Coding language

Ask anything your want about Megadrive/Genesis programming.

Moderator: BigEvilCorporation

What language do you use ?

ASM only
11
50%
C only
2
9%
BasicEga
0
No votes
Lot of C, little bit of ASM
9
41%
Lot of ASM, little bit of C
0
No votes
 
Total votes: 22

commodorejohn
Very interested
Posts: 70
Joined: Tue Mar 06, 2007 6:30 pm

Post by commodorejohn » Sat Mar 31, 2007 2:41 pm

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.

Edge-`
Interested
Posts: 39
Joined: Sun Dec 10, 2006 3:26 am

Post by Edge-` » Sat Mar 31, 2007 7:42 pm

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.
Genny Wars (Someday.. :D)

commodorejohn
Very interested
Posts: 70
Joined: Tue Mar 06, 2007 6:30 pm

Post by commodorejohn » Sun Apr 01, 2007 12:44 pm

Where does one get that?

Stef
Very interested
Posts: 3058
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Sun Apr 01, 2007 2:07 pm

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 :)

TmEE co.(TM)
Very interested
Posts: 2404
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Post by TmEE co.(TM) » Mon Apr 02, 2007 7:32 am

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.
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

Stef
Very interested
Posts: 3058
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Mon Apr 02, 2007 8:06 am

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...

MG
Very interested
Posts: 56
Joined: Wed Feb 28, 2007 8:41 am
Contact:

Post by MG » Mon Apr 02, 2007 8:20 am

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. :)
Ah ? ben si ? pourquoi pas...

Stef
Very interested
Posts: 3058
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Mon Apr 02, 2007 9:43 am

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

TmEE co.(TM)
Very interested
Posts: 2404
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Post by TmEE co.(TM) » Mon Apr 02, 2007 2:55 pm

Why can't binary files be included in C like in ASM ?
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

Fonzie
Genny lover
Posts: 323
Joined: Tue Aug 29, 2006 11:17 am
Contact:

Post by Fonzie » Mon Apr 02, 2007 3:55 pm

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...

ElBarto
Very interested
Posts: 160
Joined: Wed Dec 13, 2006 10:29 am
Contact:

Post by ElBarto » Mon Apr 02, 2007 5:00 pm

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.

TmEE co.(TM)
Very interested
Posts: 2404
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Post by TmEE co.(TM) » Tue Apr 03, 2007 9:44 am

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)
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

Stef
Very interested
Posts: 3058
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Tue Apr 03, 2007 9:55 am

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 ?

TmEE co.(TM)
Very interested
Posts: 2404
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Post by TmEE co.(TM) » Tue Apr 03, 2007 9:58 am

Well, its dark land to me... no experience with C... yet. I still like ASM more.
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

Mask of Destiny
Very interested
Posts: 594
Joined: Thu Nov 30, 2006 6:30 am

Post by Mask of Destiny » Tue Apr 03, 2007 1:35 pm

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.

Post Reply