Skip to content

Instantly share code, notes, and snippets.

@ovalenti
Created January 27, 2023 10:50
Show Gist options
  • Save ovalenti/842560b8db40239257748d9016620a51 to your computer and use it in GitHub Desktop.
Save ovalenti/842560b8db40239257748d9016620a51 to your computer and use it in GitHub Desktop.
Template for Mattel Aquarius extension ROM (with header signature)
; Basic template of a Mattel Aquarius extension ROM
; build: z80asm -o aq_romext.bin aq_romext.asm
; run: mame aquariusp -bp . -cart1 aq_romext.bin
; uncomment the following block to create a 16K ROM
;org 0xc000
; ...
; ### lower part of a 16K ROM ###
; ...
; ds 0xe000 - $
; ### Header ###
; can be customized
H0: equ 0
H1: equ 0
H2: equ 0
H3: equ 0
H4: equ 0
H6: equ 0
H8: equ 0
HA: equ 0
HC: equ 0
; signature: fixed values
H5: equ 0x9c
H7: equ 0xb0
H9: equ 0x6c
HB: equ 0x64
HD: equ 0xA8
HF: equ 0x70
HE: equ (HF - 0x4e - (H3 + H4 + H5 + H6 + H7 + H8 + H9 + HA + HB + HC + HD)) & 0xff
if H3 == 0xf7
error
endif
org 0xe000
; ROM signature
db H0
db H1
db H2
db H3
db H4
db H5
db H6
db H7
db H8
db H9
db HA
db HB
db HC
db HD
db HE
db HF
; ### high part of the ROM ###
PRNCHR: equ 0x1d94
start:
ld a,'@'
call PRNCHR
hang:
jp hang
ds 0x10000 - $ ; pad to the ROM size
@bushy555
Copy link

Thanks. Makes so much more sense.

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