Building the rom in galactic-armada produces 2 main bugs. The following were found running BGB and Emulicious on Windows 11.
The bullets object pool is not initialized correctly.
This is one is an easy fix. The Enemies initialization gets this correct.
In bullets.asm...
ld b, a
ld hl, wBullets
ld [hl], a
InitializeBullets_Loop:
; Increase the address
ld a, l
add PER_BULLET_BYTES_COUNT
ld l, a
ld a, h
adc 0
ld h, a
Should be
ld b, a
ld hl, wBullets
InitializeBullets_Loop:
; Set as inactive
ld [hl], 0
; Increase the address
ld a, l
add PER_BULLET_BYTES_COUNT
ld l, a
ld a, h
adc 0
ld h, a
The hud updates inconsistently
I'm a lot less sure on exactly why this is happening but I think it's due to trying to write to VRAM during mode 2/3. I'm unsure what the recommended solution for this is. The way solved it was by setting a variable to indicate we need to redraw the hud and then checked that at an appropriate time (aka after a vblank wait). Looking at the pan docs it might also be possible to just wait for rSTAT to return mode 0/1 in the draw routines.
Building the rom in
galactic-armadaproduces 2 main bugs. The following were found running BGB and Emulicious on Windows 11.The bullets object pool is not initialized correctly.
This is one is an easy fix. The Enemies initialization gets this correct.
In
bullets.asm...Should be
The hud updates inconsistently
I'm a lot less sure on exactly why this is happening but I think it's due to trying to write to VRAM during mode 2/3. I'm unsure what the recommended solution for this is. The way solved it was by setting a variable to indicate we need to redraw the hud and then checked that at an appropriate time (aka after a vblank wait). Looking at the pan docs it might also be possible to just wait for rSTAT to return mode 0/1 in the draw routines.