Hey guys I'm new and I got a couple of questions
Moderator: BigEvilCorporation
Hey guys I'm new and I got a couple of questions
Hi all, I just finished setting up SGDK with codeblocks and compiling my first hello world.
I'm pretty seasoned when it comes to C but I wanted to know how I could program for the genesis in ASM because I'd really love to learn.
Also, any reason why the gensmodk takes up 100% cpu when I run my programs? o_o
Thanks
I'm pretty seasoned when it comes to C but I wanted to know how I could program for the genesis in ASM because I'd really love to learn.
Also, any reason why the gensmodk takes up 100% cpu when I run my programs? o_o
Thanks
-
- Very interested
- Posts: 3131
- Joined: Thu Nov 30, 2006 9:46 pm
- Location: France - Sevres
- Contact:
Hi Ricky,
Nice to see new guys there
You can use ASM as C with SGDK, the makefile handle them you just need .s extension to your file.
Have a look in the library source files to see the syntax, you have some assembly ones as this one :
http://code.google.com/p/sgdk/source/br ... bmp_ff_a.s
I think you have first to learn about the megadrive hardware itself (if you are not already familiar with).
Nice to see new guys there
You can use ASM as C with SGDK, the makefile handle them you just need .s extension to your file.
Have a look in the library source files to see the syntax, you have some assembly ones as this one :
http://code.google.com/p/sgdk/source/br ... bmp_ff_a.s
I think you have first to learn about the megadrive hardware itself (if you are not already familiar with).
How do I learn MD hardware? I can't find good papers, but I've been reading the forum and I get little pieces here and there. You got any good sources to share?Stef wrote:Hi Ricky,
Nice to see new guys there
You can use ASM as C with SGDK, the makefile handle them you just need .s extension to your file.
Have a look in the library source files to see the syntax, you have some assembly ones as this one :
http://code.google.com/p/sgdk/source/br ... bmp_ff_a.s
I think you have first to learn about the megadrive hardware itself (if you are not already familiar with).
I was reading about XGCC, what to do with that? Can it work with your devkit?
-
- Very interested
- Posts: 3131
- Joined: Thu Nov 30, 2006 9:46 pm
- Location: France - Sevres
- Contact:
Shiru gave you the best sources to learn MD hardwareRicky wrote: How do I learn MD hardware? I can't find good papers, but I've been reading the forum and I get little pieces here and there. You got any good sources to share?
I was reading about XGCC, what to do with that? Can it work with your devkit?
Sega2F is a complete documentation leaked from official megadrive devkit.
gen-hw and genvdp are very good summary of the above document.
You don't need XGCC is you use SGDK (as you already have the compiler).
-
- Very interested
- Posts: 2984
- Joined: Fri Aug 17, 2007 9:33 pm
You would need an assembler that could produce files gcc is capable of dealing with. My own thought was to use vasm68k to make COFF files, then use OBJCOPY to convert COFF to ELF, and then you could link it into your project like normal.sega16 wrote:Is is possible to use asm68k or something other than that awful gcc syntax for compiling an asm file I just do not like the gcc syntax.
Your other choice is to assemble the code to binary at a specific location, then use something like .incbin in gcc. That makes variables much harder to deal with, along with needing to assemble to a set address.
Seems like a lot to deal with just to change syntax. I personally don't really mind, as long as I'm as low level as I can get.Chilly Willy wrote:You would need an assembler that could produce files gcc is capable of dealing with. My own thought was to use vasm68k to make COFF files, then use OBJCOPY to convert COFF to ELF, and then you could link it into your project like normal.sega16 wrote:Is is possible to use asm68k or something other than that awful gcc syntax for compiling an asm file I just do not like the gcc syntax.
Your other choice is to assemble the code to binary at a specific location, then use something like .incbin in gcc. That makes variables much harder to deal with, along with needing to assemble to a set address.
-
- Very interested
- Posts: 2984
- Joined: Fri Aug 17, 2007 9:33 pm
Hmm - actually, looking at the current vasm info, it DOES support ELF, so you should be able to assemble to ELF for direct linking in your project.
http://sun.hasenbraten.de/vasm/
http://sun.hasenbraten.de/vasm/
Damn.. no Win binaryChilly Willy wrote:Hmm - actually, looking at the current vasm info, it DOES support ELF, so you should be able to assemble to ELF for direct linking in your project.
http://sun.hasenbraten.de/vasm/
You guys recommend snASM68k?
I'd strongly recommend, rather than reading the sega2f html or doc version, that you go with the proper scanned version we now have available:
http://nemesis.hacking-cult.org/MegaDri ... Manual.pdf
This is the exact same manual, just with a few pages that were missing from the old sega2f document, minus a lot of transcription errors and the woeful formatting.
http://nemesis.hacking-cult.org/MegaDri ... Manual.pdf
This is the exact same manual, just with a few pages that were missing from the old sega2f document, minus a lot of transcription errors and the woeful formatting.
-
- Very interested
- Posts: 2984
- Joined: Fri Aug 17, 2007 9:33 pm
No, it's old and won't let you do anything but a 100% assembly binary. Look, your choices are limited: use gcc and it's odd syntax, build vbcc yourself, or use one of the standalone assemblers and put up with binary only.Ricky wrote:Damn.. no Win binaryChilly Willy wrote:Hmm - actually, looking at the current vasm info, it DOES support ELF, so you should be able to assemble to ELF for direct linking in your project.
http://sun.hasenbraten.de/vasm/
You guys recommend snASM68k?