Skip to content

Would it be worth making the Z80 driver assemble? #22

Open
@Clownacy

Description

The AS branch has really nice Z80 support. Obviously that isn't the case with asm68k. I have an experimental branch that builds the driver using a separate assembler, compresses it, and then runs asm68k, which incbin's the compressed file like normal.

There are a few hurdles though. Firstly, finding a good assembler is a little tricky: VASM had a severe bug, last time I checked, ASMX is barebones, and AS is AS. AS is bagage I'd rather we find a proper replacement for in the future, so I don't really want to go with that, VASM flat-out doesn't work with the Z80 driver right now, and that just leaves ASMX.

ASMX ain't that great either. It's barebones, lacking in the most basic features like error messages that print variables or labels, it's buggy, and it's not even under an open-source license. The source code's a pretty easy read though, and I have taken the time to weed out the handful of bugs I've noticed in my fork.

Currently, my branch assembles bit-perfect, but there are still issues.

The Z80 driver and the ROM itself are both dependant on each other: the Z80 driver needs to know where the Sega chant is, and the 68k sound driver needs to know where the timpani pitch is.

To address this, I have a file a bit like C's .h files, which is included by both the Z80 and 68k code. This file contains hardcoded values for things like the Sega chant location, size, and where the Z80 timpani pitch is. If either assembler detects the constants don't match their generated equivalents, it flags a warning telling you what to change them to, but still assembles a ROM anyway. This is comparable to how S2's driver handles the size of the compressed driver.

But my question is, is this worth it? It technically makes using the disasm more difficult, since whenever you shuffle the ROM around, you have to update the header file. Not to mention, things like the Mega PCM installation guide obviously don't detail taking out the Z80 build system. Not that the Git disasms ever really cared about backwards-compatibility, I guess.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions