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

bushy555 commented Feb 6, 2023

Typically based purely on CPU speed. Porting the code to different Z80 platforms with differing CPU speeds, the outputting sound is faster or slower, with a different pitch. However most 1-bit player engines have some sort of speed controlling loop.
Out of interest, BinTracker Windows version was released two days ago by Utz. https://github.com/bintracker/bintracker/releases
Outputs ZX Spectrum asm, change the sound port, re-assemble, and essentially you have a music sound tracker for the Aquarius.

@bushy555
Copy link

bushy555 commented Feb 8, 2023

Hi
Using your header, Ive managed to get another three working that previously didn't work with the previous hacked header that I was attempting to use. So thanks heaps.
Ive been using the old VirtualAquarius and MESS emulators, since I can't get anything else to work (MAME, Aqualite). However, I can only get players that are under 8k working (Assembled to $E000). Anything to $C000 just fails unfortunately. Aquarius stuff just seems very very 'finicky' to me.

Various stuff is here if interested: https://github.com/bushy555/Aquarius_1-bit_music

@ovalenti
Copy link
Author

ovalenti commented Feb 9, 2023

Hi @bushy555, briefly looking at your work to port to Aquarius, I could notice a few things:

  • in order to be accepted by mame, ROM files have to be exactly 8K or 16K
  • some engines (at least juston) rely on modifying the code (inject delay values or addresses). This is not possible when the code executes from ROM. 2K of RAM are available at 0x3800 if you need to store values.

@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