minor fixes to main menu mostly

This commit is contained in:
Shoofle 2025-10-04 14:45:17 -04:00
parent d6c623734f
commit 337919ac07
3 changed files with 34 additions and 51 deletions

View File

@ -14,7 +14,6 @@ vBuildingByte: dw
vPrinterIsReady: db
vPrinterRow: db
print vPrinterRow
vPrinterStart: db
POPS

View File

@ -27,18 +27,19 @@ ScreenMainMenu:
dw MainMenuTeardown
MainMenuSetup:
call Async_Kill
ld a, BANK("Main Menu Data")
ld [rROMB0], a
ld hl, ZEROES
ld de, MY_OAM
ld bc, $100
call CopyRange
ld a, BANK("Main Menu Data")
ld [rROMB0], a
ld hl, MainMenuSetup.asyncTask
call Async_Spawn_HL
ld a, 0
ld [vFrameCount1], a ; first starts at 0
ld [vFrameCount1], a ; first card starts at 0
ld [vTime], a
ld [vTime+1], a
ld [vMenuIndex], a
@ -46,7 +47,6 @@ MainMenuSetup:
ld [vSelectedSpreadCard], a
; second starts at 1/3 length which is approximately L/2 - L/4 - L/8 + L/16 ?
ld hl, Coords
ld a, [hl]
@ -89,27 +89,21 @@ MainMenuSetup:
; that should be just about 2/3 of L !
ld [vFrameCount3], a
;ld hl, Coords
;ld a, [hl]
;srl a
;ldh [vFrameCount4], a
ld a, 0
ld [vFrameCountSquares], a
ld hl, MainMenuSetup.asyncTask
call Async_Spawn_HL
ld a, %11100100
ldh [rBGP], a
ldh [rOBP0], a
ldh a, [rLCDC]
or a, LCDCF_OBJ16 ;LCDCF_BLK21 | LCDCF_ON | LCDCF_BGON | LCDCF_OBJON | LCDCF_OBJ16
ld a, LCDCF_BLK21 | LCDCF_ON | LCDCF_BGON | LCDCF_OBJON | LCDCF_OBJ16
ldh [rLCDC], a
ret
.asyncTask:
ld hl, MainUITilemap
ld de, _SCRN0
ld b, 18
@ -187,12 +181,6 @@ MainMenuSetup:
MainMenuUpdate:
; if pressing a key and unblocked:
; signal an animation to start
; turn on block
; if in animation state:
; increment timer
; if timer is max, turn off animation state and unblock?
ld a, BANK("Main Menu Data")
ld [rROMB0], a
@ -287,7 +275,7 @@ MainMenuUpdate:
call ArrayClampLooping
ld [vFrameCountSquares], a
sla a ; mulltiiply by 2
sla a ; mulltiiply squares frame count by 2
ld b, 0
ld c, a
ld hl, SquaresTiles + 1

View File

@ -90,9 +90,16 @@ SECTION "Header", ROM0[$100]
SECTION "Main Program", ROM0[$150]
EntryPoint:
cp a, BOOTUP_A_CGB
call nz, SetupForDMG
call z, SetupForCGB
; Shut down audio circuitry
jp z, .SetupForCGB
.SetupForDMG:
ld a, $0
ld [rDeviceType], a
jp .doneWithSetup
.SetupForCGB:
ld a, $1
ld [rDeviceType], a
.doneWithSetup:
; Shut things down
ld a, 0
ldh [rNR52], a ; shut down audio
ldh [rDIV], a ; reset timer just in case??
@ -159,7 +166,6 @@ EntryPoint:
dec a ; decrement our length counter
jr nz, .writeFlip
ld a, %1010_1010
ld [rLFSR], a
@ -296,18 +302,19 @@ Loop:
xor a, a ; zero a out in one cycle
; store dpad and btn state in the rMYBTN register
ld hl, rP1
ld [hl], P1F_GET_DPAD
ld a, [hl]
ld a, [hl]
ld a, [hl]
ld a, P1F_GET_DPAD
ldh [rP1], a
ldh a, [rP1]
ldh a, [rP1]
ldh a, [rP1]
cpl
and a, %00001111
ld b, a
ld [hl], P1F_GET_BTN
ld a, [hl]
ld a, [hl]
ld a, [hl]
ld a, P1F_GET_BTN
ldh [rP1], a
ldh a, [rP1]
ldh a, [rP1]
ldh a, [rP1]
cpl
and a, %00001111
swap a
@ -321,7 +328,6 @@ Loop:
ld [rMYBTN], a ; save that as btn state
call SoundUpdate
println "scene update is ", SCENE_UPDATE - 1
call SCENE_UPDATE - 1 ; hope this takes not too many scanlines!
di
@ -330,27 +336,16 @@ println "scene update is ", SCENE_UPDATE - 1
ei
halt
println "scene draw is ", SCENE_DRAW - 1
call SCENE_DRAW - 1 ; hope this takes fewer than 9 scanlines!
; either way it's going to eat into the update timing
; at this point we want to make sure that scanline 153 has passed
; we should check if we're past there and skip this await if necessary
ld b, 2
ld b, 3
call AwaitLine
jp Loop
SetupForDMG:
ld a, $0
ld hl, rDeviceType
ld [hl], a
ret
SetupForCGB:
ld a, $1
ld hl, rDeviceType
ld [hl], a
ret
@ -375,6 +370,7 @@ ChangeScene: ; hl should be a pointer to, in sequence, setup update draw teardow
ld a, [hl+]
ld [SCENE_TEARDOWN+1], a
call Async_Kill
call SCENE_SETUP - 1
ei