It is currently Mon May 22, 2017 12:28 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 12 posts ] 
Author Message
 Post subject: Genesis bootstrapping
PostPosted: Sun May 29, 2016 12:29 pm 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 5666
Location: Seattle
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


Top
 Profile  
 
PostPosted: Sun May 29, 2016 12:41 pm 
Offline

Joined: Tue Oct 06, 2015 10:16 am
Posts: 408
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. :)


Top
 Profile  
 
PostPosted: Sun May 29, 2016 1:47 pm 
Offline
User avatar

Joined: Mon Oct 01, 2012 3:47 pm
Posts: 148
Location: freemland (NTSC-U)
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.


Top
 Profile  
 
PostPosted: Sun May 29, 2016 2:39 pm 
Offline

Joined: Thu Aug 28, 2008 1:17 am
Posts: 591
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


Top
 Profile  
 
PostPosted: Sun May 29, 2016 5:27 pm 
Offline

Joined: Mon Apr 01, 2013 11:17 pm
Posts: 429
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...


Top
 Profile  
 
PostPosted: Sun May 29, 2016 11:03 pm 
Offline
User avatar

Joined: Sat Jul 12, 2014 3:04 pm
Posts: 788
lidnariq wrote:
I want to to never have to see gnu assembler syntax :P

...because...?


Top
 Profile  
 
PostPosted: Mon May 30, 2016 12:51 am 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 5666
Location: Seattle
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


Top
 Profile  
 
PostPosted: Tue May 31, 2016 12:34 pm 
Offline

Joined: Thu Aug 12, 2010 3:43 am
Posts: 1589
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.


Top
 Profile  
 
PostPosted: Tue May 31, 2016 7:41 pm 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 5666
Location: Seattle
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


Top
 Profile  
 
PostPosted: Wed Jun 01, 2016 1:29 am 
Offline

Joined: Thu Aug 12, 2010 3:43 am
Posts: 1589
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).


Top
 Profile  
 
PostPosted: Wed Jun 01, 2016 2:17 am 
Offline

Joined: Tue Oct 06, 2015 10:16 am
Posts: 408
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.


Top
 Profile  
 
PostPosted: Wed Jun 01, 2016 8:04 am 
Offline

Joined: Sun Mar 27, 2011 10:49 am
Posts: 137
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group