Page 2 of 3
Posted: Sat Mar 31, 2007 2:41 pm
by commodorejohn
I can work with assembler okay, but C makes things so much easier to keep organized and saves a lot of work. And on an 8MHz machine, the (very minor) speed loss doesn't really matter much. So...C, with some ASM.
Posted: Sat Mar 31, 2007 7:42 pm
by Edge-`
I've recently switched to Stef's minimalized GCC dev kit. I encourage anyone still using XGCC or anything older to do so :>, I'm enjoying it. If we can all improve on it (report bugs, submit useful functions, document use, etc) it could become a great benefit to the scene.
Posted: Sun Apr 01, 2007 12:44 pm
by commodorejohn
Where does one get that?
Posted: Sun Apr 01, 2007 2:07 pm
by Stef
Edge-` wrote:I've recently switched to Stef's minimalized GCC dev kit. I encourage anyone still using XGCC or anything older to do so :>, I'm enjoying it. If we can all improve on it (report bugs, submit useful functions, document use, etc) it could become a great benefit to the scene.
Thanks Edge for making pub for the minimal devkit

I'm added the function you want but i guess you did without it
Where does one get that?
here
still missing a lot of stuff, but it's continuously progressing

Posted: Mon Apr 02, 2007 7:32 am
by TmEE co.(TM)
Question: how many functions are in MiniDevKit ? I collected all my ASM routines together, made them something library like and there's around 50 to 60 functions.
Posted: Mon Apr 02, 2007 8:06 am
by Stef
TmEE co.(TM) wrote:Question: how many functions are in MiniDevKit ? I collected all my ASM routines together, made them something library like and there's around 50 to 60 functions.
I can't say how many exactly but i guess a bit more than 60...
Posted: Mon Apr 02, 2007 8:20 am
by MG
C and a little bit of ASM.
C from the GenesisDev mini-kit by Stef.
ASM since now just to test.
I'm spending all my time to search and include sprites and tiles for background than making code.
I am not hurry to reach the goal that I fixed myself : make a map plan, and 2 or 3 sprites with all the movements possible.

Posted: Mon Apr 02, 2007 9:43 am
by Stef
MG wrote:C and a little bit of ASM.
C from the GenesisDev mini-kit by Stef.
ASM since now just to test.
I'm spending all my time to search and include sprites and tiles for background than making code.
I am not hurry to reach the goal that I fixed myself : make a map plan, and 2 or 3 sprites with all the movements possible.

I done a converter which can convert binary file to C table (whatever type is supported) file.
Recently i added 4 bits BMP support : it convert a 4 bpp BMP to a u16 table C file :
1 word : width
2 word : height
3-18 words : palette in megadrive format
19-X : 4 bpp bitmap data
Posted: Mon Apr 02, 2007 2:55 pm
by TmEE co.(TM)
Why can't binary files be included in C like in ASM ?
Posted: Mon Apr 02, 2007 3:55 pm
by Fonzie
yeah, that's wierd, maybe the philosophy of C is not to store data in the code itself (sorry if i'm wrong ^^)... if i recall correctly, kaneda did a "incbin" port for xgcc...
Posted: Mon Apr 02, 2007 5:00 pm
by ElBarto
TmEE co.(TM) wrote:Why can't binary files be included in C like in ASM ?
I don't exactly understand what you want to say.
You can do :
ld main.o graphic.o where graphic.o is a binary file of a raw image and use it into your code with the extern prefix for a variable.
I already do that for the gamecube, works well.
Posted: Tue Apr 03, 2007 9:44 am
by TmEE co.(TM)
I meant, that for example, in stefs MDK, audio data was tored in word declarations, not just WAV or other format which is more convenient(least for me)
Posted: Tue Apr 03, 2007 9:55 am
by Stef
TmEE co.(TM) wrote:I meant, that for example, in stefs MDK, audio data was tored in word declarations, not just WAV or other format which is more convenient(least for me)
In fact i convert them to C file because i need an identifier to reference the binary data. It's possible to link binary file to your C project with the linker, but then, how you can reference them in your C code ?
Posted: Tue Apr 03, 2007 9:58 am
by TmEE co.(TM)
Well, its dark land to me... no experience with C... yet. I still like ASM more.
Posted: Tue Apr 03, 2007 1:35 pm
by Mask of Destiny
Stef wrote:
In fact i convert them to C file because i need an identifier to reference the binary data. It's possible to link binary file to your C project with the linker, but then, how you can reference them in your C code ?
objcopy automatically creates start and end symbols when you turn a raw binary into an ELF .o based on the file name. You'll need something like this in your source:
Code: Select all
extern unsigned char _binary_somefile_ext_start[];
extern unsigned char _binary_somefile_ext_end[];
There's also a symbol called _binary_somefile_ext_size, but I tend to just do pointer math on the start and end symbols instead.