superctr / MDSDRV

Sound driver for Sega Mega Drive
zlib License
63 stars 4 forks source link

Replace asm68k with a free alternative #10

Open superctr opened 4 years ago

superctr commented 4 years ago

asm68k originally came from the leaked Psy-Q Sega Saturn SDK and is an old proprietary assembler that has not been maintained in 25 years. It is also Windows-only, although it does work with Wine.

For Windows users I would like an alternative that can be either easily installed or included in the repo.

Currently, MDSDRV uses a few features which may or may not be specific to asm68k, including equr statements and some fancy expressions that might not work in other assemblers.

Suggested alternatives: https://github.com/asmotor/asmotor - Is free software (GPLv3) and is currently maintained. It has an equs directive which can replace equr. Not sure about Windows support? -> It cannot output listing files, which makes debugging much harder.

HTV04 commented 1 year ago

What about VASM (specifically the Motorola syntax)? A lot of syntax is shared, and anything that isn't should be trivial to convert over. It also supports listing files.

superctr commented 1 year ago

VASM is not free software.

image

HTV04 commented 1 year ago

Ah, understandable. Though I might port it over to VASM sometime to take advantage of its features if you don't mind.

In terms of FOSS, what about Macroassembler AS? It's under the GPL 2.0 and used for the Sonic decompilations (when they similarly migrated from ASM68K). However, I've heard it's a little buggy.

superctr commented 1 year ago

I have tried AS, unfortunately it has a pretty big behavior difference compared with asm68k, that when defining a label using EQU or SET (instead of implicit label before an instruction, see here), it will create a new local scope, making all previously defined local labels inaccessible. I have proposed adding this behavior as an option at least, but it's been refused so far.