Omnimaga

Calculator Community => TI Calculators => Axe => Topic started by: Raylin on April 14, 2010, 09:21:03 pm

Title: PIC2HEX
Post by: Raylin on April 14, 2010, 09:21:03 pm
Does anyone have the routine that converts an entire picture to hex?
Title: Re: PIC2HEX
Post by: _player1537 on April 14, 2010, 09:26:55 pm
I assume this is for axe, if so let me find Sir's program (I think someone else made one too)
Title: Re: PIC2HEX
Post by: meishe91 on April 14, 2010, 09:51:23 pm
I thought Axe Parser came with a picture to hex program.
Title: Re: PIC2HEX
Post by: DJ Omnimaga on April 14, 2010, 11:37:59 pm
The Axe one only does sprites. Sir had a routine that converted entire pics (from Graph screen) to hex and another that converted tilesheets (also from graph screen) to hex too. They were very slow, though, but still very useful for those who like to edit their tiles on the PC and convert them to 8xi files.
Title: Re: PIC2HEX
Post by: meishe91 on April 14, 2010, 11:46:55 pm
Oh ok, so it only works in a certain amount of area? (The one with Axe.)

And ah ok, that gotcha.
Title: Re: PIC2HEX
Post by: DJ Omnimaga on April 14, 2010, 11:49:50 pm
I think the pic one does the entire screen but for the tile one you can select the area of the screen you want to convert
Title: Re: PIC2HEX
Post by: meishe91 on April 14, 2010, 11:52:23 pm
What about the one with Axe? That's the one I was asking about because I don't see how it is just for sprites is all.
Title: Re: PIC2HEX
Post by: DJ Omnimaga on April 14, 2010, 11:56:55 pm
Oh, the one with axe doesn't fetch from pics, you need to draw each sprites in its editor pixel by pixel. It's quite nice, altough drawing 100 sprites in it can take ages compared to using MS Paint.
Title: Re: PIC2HEX
Post by: meishe91 on April 15, 2010, 12:00:57 am
Oh, ok. I get it.
Title: Re: PIC2HEX
Post by: SirCmpwn on April 15, 2010, 08:30:20 am
Here, attached is the one I made.  It takes about 5 minutes to convert the screen.
Title: Re: PIC2HEX
Post by: Builderboy on April 15, 2010, 02:05:29 pm
Once we are able to write to Strings we could write a Pic2Hex program in axe, to be used for axe :)

Hmmm we can write to programs, maybe this is already possible?
Title: Re: PIC2HEX
Post by: DJ Omnimaga on April 15, 2010, 04:37:25 pm
Yeah that would be cool, would be so much faster. The Tile2Hex one should be ported too.

Btw I edited Sir post to also include the Tile version of his prog.
Title: Re: PIC2HEX
Post by: SirCmpwn on April 15, 2010, 04:38:15 pm
Btw I edited Sir post to also include the Tile version of his prog.

You did?  I must not have noticed.  I'll double check it for you.

**EDIT** I guess I'm just too fast for you ;)
Title: Re: PIC2HEX
Post by: DJ Omnimaga on April 15, 2010, 04:39:21 pm
Oh, I posted my msg then tried editing your post a few seconds later, but the duplicate attachment filename error popped up (I hate that x.x)
Title: Re: PIC2HEX
Post by: SirCmpwn on April 15, 2010, 04:40:10 pm
Ah, I see.  If I may suggest having the uploader automatically append the date?
Title: Re: PIC2HEX
Post by: DJ Omnimaga on April 15, 2010, 04:48:44 pm
Nah I can,t do that. However, there are some mods I think that can do some stuff with attachments. I would need to check.
Title: Re: PIC2HEX
Post by: SirCmpwn on April 15, 2010, 05:31:47 pm
Okay, attached is a program that will convert an 8xi file into an 8xp full of hex.  It was thrown together in a few minutes, so it doesn't have error handling or any of that stuff.
Usage:
PicToHex input.8xi output.8xp CALCNAME

Where CALCNAME is what it looks like in the program menu.

Please tell me if you find any bugs.
Title: Re: PIC2HEX
Post by: Quigibo on April 15, 2010, 07:30:05 pm
By the way, I've already added support in the next version to "absorb" a pic in your RAM into the program itself.  So that should simplify this process.  But one thing I just learned is that the pics stored on the calculator are only 96x63 (756 bytes) so if you have a picture that needs the bottom row, you'll just have to add the extra 12 bytes after it in hex.  To draw a pic with axe on the buffer, simply just copy it to the graph buffer: conj(Pic00,L6,756).
Title: Re: PIC2HEX
Post by: DJ Omnimaga on April 15, 2010, 07:34:59 pm
Will the pics be added during compile, or will the data remain in pic form, externally, even after compiling?


Would such feature give you the option to absorb the pic by 8x8 chunks too?

To be honest, one reason why I fail at finding motivation to program in Axe more than I currently do is knowing I will have to do the chore of converting my sprites to hex, even if I have programs by SirCmpwn to do so. It gets hectic if I need to regulary add tiles or if I need to edit one. Plus if I have many, it can end up being a major hassle to find the right tile to delete from my source code and make sure to not accidentally delete the wrong data x.x
Title: Re: PIC2HEX
Post by: SirCmpwn on April 16, 2010, 08:27:03 am
I am currently working on a GUI based version of the above, as well as a GUI based program for exporting tiles from tilemaps.  This should make it easier to convert your pre-existing games, DJ.
Title: Re: PIC2HEX
Post by: DJ Omnimaga on April 16, 2010, 10:03:18 am
Nice to hear :D
Title: Re: PIC2HEX
Post by: SirCmpwn on April 16, 2010, 05:23:49 pm
Okay, this one uses a GUI instead.  You must have .NET installed.  If you are running Windows XP SP3 or higher, you're good.  If you are running Vista or Win7, you're good.  If you are running Linux or Mac, you need Mono.
Title: Re: PIC2HEX
Post by: DJ Omnimaga on April 16, 2010, 05:46:29 pm
Cool, I haven't made an axe program with my converted pic but I assume the program content should look like this, right? (see attachment)

I can,t wait for Tile version too ^^
Title: Re: PIC2HEX
Post by: SirCmpwn on April 16, 2010, 07:36:05 pm
Right, that looks good.  It's just a bunch of hex.
Title: Re: PIC2HEX
Post by: DJ Omnimaga on April 16, 2010, 07:53:40 pm
and according to further tests, it's the right HEX that is created too. Nice job ^^

I'll upload to download section once you got the tile version. However, I would also suggest making it clearer about what the user need to run in the zip file. Usually, people are used to having the exe file right in the root directory and people who are not used to programming vocabulary may not be aware that "bin" means it's the executable folder.
Title: Re: PIC2HEX
Post by: SirCmpwn on April 16, 2010, 10:31:13 pm
Well, I included the source code as well.  If you are planning on putting it in the downloads section, I'll package it up in an installer, which will also take care of the .NET dependency.
Title: Re: PIC2HEX
Post by: DJ Omnimaga on April 16, 2010, 10:59:31 pm
Yeah that would be cool. would make things much easier :P
Title: Re: PIC2HEX
Post by: ztrumpet on April 16, 2010, 11:13:33 pm
That program sounds really neat.  Great job SirCmpwn! ;D
Title: Re: PIC2HEX
Post by: Quigibo on April 17, 2010, 12:32:09 am
This will still be useful even after the next release because some people won't want to keep a bunch of pictures on their calculator to compile the program, they might just prefer to import them directly all in one file.  Good job on this!
Title: Re: PIC2HEX
Post by: DJ Omnimaga on April 17, 2010, 11:55:37 am
True. If I decided for example to make some sort of grayscale game with many tiles like Reuben, it would take so much space on calc and a long while to convert, not to mention the hex data would be twice larger until compiling x.x