Genesis bootstrapping

Discussion of development of software for any "obsolete" computer or video game system. See the WSdev wiki and ObscureDev wiki for more information on certain platforms.
Post Reply
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Genesis bootstrapping

Post by lidnariq »

Anyone have a favorite quickstart guide and/or toolchain recommendations for the Megadrive?

My only irrational requirement is I want to to never have to see gnu assembler syntax :P
calima
Posts: 1745
Joined: Tue Oct 06, 2015 10:16 am

Re: Genesis bootstrapping

Post by calima »

The #1 would be SGDK, which uses gcc. It fails your gnu syntax requirement, but why would you write asm for a platform where you have a decent compiler? You get to use gcc 6, which is heaven compared to cc65.

The need-to-be-fast functions are part of the SDK, just like neslib here, and if your own code has such a bottleneck, I'd say gnu syntax is worth the cost. :)
User avatar
freem
Posts: 176
Joined: Mon Oct 01, 2012 3:47 pm
Location: freemland (NTSC-U)
Contact:

Re: Genesis bootstrapping

Post by freem »

lidnariq wrote:My only irrational requirement is I want to to never have to see gnu assembler syntax :P
vasm targeting m68k with mot syntax should satisfy this requirement. It's served me well during Neo-Geo development, so I'd imagine it'd be good for Genesis/Mega Drive as well.
tomaitheous
Posts: 592
Joined: Thu Aug 28, 2008 1:17 am
Contact:

Re: Genesis bootstrapping

Post by tomaitheous »

lidnariq wrote:Anyone have a favorite quickstart guide and/or toolchain recommendations for the Megadrive?

My only irrational requirement is I want to to never have to see gnu assembler syntax :P
I hate gnu 68k assembler syntax :yuck:

I'm probably one of the only one that uses this in MD/Gen dev: http://john.ccac.rwth-aachen.de:8000/as/cpulist.html
But it supports reassembling back over included binaries, which is nice for hacking. I couldn't find any other 68k assemblers that allowed this.
__________________________
http://pcedev.wordpress.com
Joe
Posts: 650
Joined: Mon Apr 01, 2013 11:17 pm

Re: Genesis bootstrapping

Post by Joe »

lidnariq wrote:My only irrational requirement is I want to to never have to see gnu assembler syntax :P
You can use as without seeing any MIT syntax, since it also accepts Motorola syntax. :P

The only trouble is things like gcc and objdump...
User avatar
Myask
Posts: 965
Joined: Sat Jul 12, 2014 3:04 pm

Re: Genesis bootstrapping

Post by Myask »

lidnariq wrote:I want to to never have to see gnu assembler syntax :P
...because...?
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: Genesis bootstrapping

Post by lidnariq »

Because
In my opinion it's ugly.
In my opinion (intel syntax) [rbp-4] makes sense and -4(%rbp) doesn't.
In my opinion, the corresponding 68k wouldn't be all that bad ((-4,fp) vs -4(%fp)) EXCEPT that MIT syntax kept Motorola's syntax for postdecrementing address registers, i.e. -(%sp). Typo and omit the number? It'll assemble JUST FINE and randomly do something ENTIRELY UNRELATED. Is that always a problem with assembly language? Yes, but that doesn't mean you should make it even easier.
In my opinion, the people who designed the assembly language for any given ISA usually put a lot of thought into it, and I feel like grafting GNU/MIT/AT&T syntax onto other things doesn't.

And really, the biggest reason, and the only one I actually need: the dirty hack that it was invented for—to help people who had to maintain multiple assembly code bases on widely varying 32-bit processors so that they wouldn't make stupid mistakes (sigils prevent using mismatched register names, and making src,dst the only used direction)—is entirely irrelevant to me and my use cases.


Just in case anyone wants to argue: don't. At least modern versions of gcc support -masm=intel, even if I mayn't have -masm=mot
Sik
Posts: 1589
Joined: Thu Aug 12, 2010 3:43 am

Re: Genesis bootstrapping

Post by Sik »

More convincing reason to not use GNU syntax: it's completely different from what every other assembler uses. Yeah other assemblers differ between them, but usually on things like local labels or special features, not on the basic things. GNU syntax is its own completely unique beast that disregards everything.
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: Genesis bootstrapping

Post by lidnariq »

Anyway, now that we all talked extensively about the tangent about what a gas gas's syntax is ...

Recommendations for debugging emulators, toolchains, reference documentation, anything I'm forgetting? All I saw was calima's recommendation for SGDK.

Exodus seems to be the most accurate emulator; how does the usability of its debugger compare to FCEUX/NO$NES/Nintendulator/bsnes-plus/NO$SNS/MESS/gdb/MPLAB ?

Is md.squee.co the best analogue to wiki.nesdev.com and wiki.superfamicom.org ?

Is there just a quickstart guide somewhere on one of the sega fora that someone could point me at? I'm just trying to avoid starting off with blatantly wrong information.


Or should I just read through the source of ProjectMD and do what it does? ;p
Sik
Posts: 1589
Joined: Thu Aug 12, 2010 3:43 am

Re: Genesis bootstrapping

Post by Sik »

lidnariq wrote:Or should I just read through the source of ProjectMD and do what it does? ;p
I was gonna mention Dragon's Castle, but it seems that Project MD's entry point is a lot easier to understand than I remember. You still may want to look at Dragon's Castle for details (in particular, the video registers in its InitVideo subroutine - don't waste time figuring out them all, just use those as-is for some reasonable defaults then figure out later how to reconfigure them when needed).
calima
Posts: 1745
Joined: Tue Oct 06, 2015 10:16 am

Re: Genesis bootstrapping

Post by calima »

The official MD docs from Sega are online, use those (google sega2f.htm).

The only emulators I can use are dgen and mednafen, others don't support 64-bit or don't support Linux. Dgen is inaccurate, but it starts up faster, so that's what I use for first testing. Mednafen is more accurate, it displays most DMA problems for example, but still misses some that show up on hw.

Neither has a debugger, AFAIK mednafen's debugger hasn't yet been implemented for MD. That hasn't been much of a concern, since I haven't needed to write m68k asm at all, and finding a compiler bug in recent gcc has lottery-like odds.
adam_smasher
Posts: 271
Joined: Sun Mar 27, 2011 10:49 am
Location: Victoria, BC

Re: Genesis bootstrapping

Post by adam_smasher »

It's been a while since I've played with this stuff but I remember Exodus' debugger (and Exodus in general) being kind of janky and glitchy.

MESS has a debugger that works okay.
Post Reply