Omnimaga

Calculator Community => TI Calculators => Calculator C => Topic started by: Jonson26 on May 21, 2020, 04:52:09 am

Title: What's the best sprite editor for TI 68k C/ASM?
Post by: Jonson26 on May 21, 2020, 04:52:09 am
The title pretty much explains everything. A pencil-like feature would be perfect (like in paint), so i don't have to click on every pixel individually, and instead just drag my mouse with the button pressed down. Greyscale and masking support would be nice too.
Title: Re: What's the best sprite editor for TI 68k C/ASM?
Post by: Xeda112358 on May 21, 2020, 08:00:52 am
It has been a long time since I did 68k C and Assembly, but I thought that you could basically "include" a .bmp or .png or what-have-you. I know I can do that with the Z80 calcs and probably eZ80.

If so, I always opt for old-school MS Paint, or mtpaint on Linux.
Title: Re: What's the best sprite editor for TI 68k C/ASM?
Post by: Jonson26 on May 26, 2020, 06:21:30 pm
AFAIK, in GCC4TI you use arrays of chars, short ints or long ints (for 8, 16 and 32 pixel wide sprites). You can directly edit the sprites if you use binary notation for initialising the arrays. Most of the sprite editors I found on ticalc seem to offer output in hexadecimal, which is fine too. The problem is, that all of the ones I've tried seem to be unfinished in some way or another. As for importing BMP's, I've never seen any mention of it in any of the 68k programming documentation. I guess the search goes on (or I'll have to make my own)  :-\
Title: Re: What's the best sprite editor for TI 68k C/ASM?
Post by: Eeems on May 27, 2020, 09:40:37 am
AFAIK, in GCC4TI you use arrays of chars, short ints or long ints (for 8, 16 and 32 pixel wide sprites). You can directly edit the sprites if you use binary notation for initialising the arrays. Most of the sprite editors I found on ticalc seem to offer output in hexadecimal, which is fine too. The problem is, that all of the ones I've tried seem to be unfinished in some way or another. As for importing BMP's, I've never seen any mention of it in any of the 68k programming documentation. I guess the search goes on (or I'll have to make my own)  :-\
have you tried to just import them to see what happens?
Title: Re: What's the best sprite editor for TI 68k C/ASM?
Post by: Jonson26 on May 29, 2020, 06:16:39 am
Well, I don't really see how I would go about importing a BMP file in c. The #include statement is only for code, and in the new file menu in the IDE there's no way to add a BMP. There is the import binary function, but I'm not sure if it can be used for this purpose.
Title: Re: What's the best sprite editor for TI 68k C/ASM?
Post by: Eeems on May 29, 2020, 02:57:19 pm
Well, I don't really see how I would go about importing a BMP file in c. The #include statement is only for code, and in the new file menu in the IDE there's no way to add a BMP. There is the import binary function, but I'm not sure if it can be used for this purpose.
With spasm you can #include a bmp file (e.g. images.asm (https://github.com/Eeems/TBP/blob/master/src/images.asm)). Have you tried to see if it will just embed the data?
Title: Re: What's the best sprite editor for TI 68k C/ASM?
Post by: Jonson26 on June 01, 2020, 07:54:04 am
Why would I use spasm for 68k?  ???
Isn't that made for the z80?
Title: Re: What's the best sprite editor for TI 68k C/ASM?
Post by: Eeems on June 01, 2020, 10:30:16 am
Why would I use spasm for 68k?  ???
Isn't that made for the z80?
That's not what I meant. Have you tried to see if the 68k assembler you are using will allow you to include bmp files?
Title: Re: What's the best sprite editor for TI 68k C/ASM?
Post by: Jonson26 on June 01, 2020, 03:50:56 pm
I'm using GCC4TI, which is a C compiler. I've read the included documentation along with some tutorials (there was a nice one on technoplaza.net, back when it was still up) and every single time sprites were declared as arrays of either unsigned chars, unsigned short ints or unsigned long ints. Example smiley face sprite:
Code: [Select]
unsigned char sprite[] = {
0b01111110,
0b10000001,
0b10100101,
0b10000001,
0b10100101,
0b10011001,
0b10000001,
0b01111110
};
Equivalent to:
Code: [Select]
unsigned char sprite[] = {0x7E, 0x81, 0xA5, 0x81, 0xA5, 0x99, 0x81, 0x7E};
As far as the standard assembler for 68k programming, to my knowledge it's always been A68K, which originates from the Amiga (in fact, some of the early Fargo programmers seem to have used only this system) so microsoft BMP's kinda seem out-of-place.
Title: Re: What's the best sprite editor for TI 68k C/ASM?
Post by: Eeems on June 01, 2020, 04:28:01 pm
It looks like you can't include bmp files (https://debrouxl.github.io/gcc4ti/faq.html#15). You should open a feature request: https://github.com/debrouxl/gcc4ti/issues