This commit is contained in:
xCrystal
2016-01-26 19:54:13 +01:00
parent 51827f0bf6
commit 5428dd5b63
8 changed files with 51 additions and 44 deletions
+1 -1
View File
@@ -182,7 +182,7 @@ StartDuel: ; 409f (1:409f)
call DrawWideTextBox_PrintText
call EnableLCD
.asm_41a7
call Func_053f
call DoFrame
call Func_378a
or a
jr nz, .asm_41a7
+2 -2
View File
@@ -84,7 +84,7 @@ Func_8dbc: ; 8dbc (2:4dbc)
ld hl, $0224
call DrawWideTextBox_PrintText
.asm_8dc8
call Func_053f
call DoFrame
jr c, Func_8dbc
call Func_8dea
jr c, Func_8dbc
@@ -150,7 +150,7 @@ Func_8e42: ; 8e42 (2:4e42)
call Func_2c08
call Func_905a
.asm_8e4e
call Func_053f
call DoFrame
call Func_9065
jp nc, .asm_8e4e
cp $ff
+8 -8
View File
@@ -52,14 +52,14 @@ LoadMap: ; c000 (3:4000)
call Func_c141
call Func_c17a
.asm_c092
call Func_3c48
call DoFrameIfLCDEnabled
call Func_c491
call Func_c0ce
ld hl, $d0b4
ld a, [hl]
and $d0
jr z, .asm_c092
call Func_3c48
call DoFrameIfLCDEnabled
ld hl, $d0b4
ld a, [hl]
bit 4, [hl]
@@ -344,7 +344,7 @@ Func_c280: ; c280 (3:4280)
ld hl, $cac0
inc [hl]
call EnableLCD
call Func_3c48
call DoFrameIfLCDEnabled
call DisableLCD
farcall Func_12871
ret
@@ -373,7 +373,7 @@ Func_c2a3: ; c2a3 (3:42a3)
ld a, $1
ld [$cac0], a
call EnableLCD
call Func_3c48
call DoFrameIfLCDEnabled
call DisableLCD
pop de
pop bc
@@ -957,7 +957,7 @@ MainMenu_c75a: ; c75a (3:475a)
ld a, $1
call Func_c29b
.asm_c76a
call Func_3c48
call DoFrameIfLCDEnabled
call Func_264b
jr nc, .asm_c76a
ld a, e
@@ -1033,7 +1033,7 @@ PC_c7ea: ; c7ea (3:47ea)
call PlaySong
call Func_c241
call $4915
call Func_3c48
call DoFrameIfLCDEnabled
ld hl, $0352
call $2c73
call $484e
@@ -1041,7 +1041,7 @@ PC_c7ea: ; c7ea (3:47ea)
ld a, $1
call Func_c29b
.asm_c806
call Func_3c48
call DoFrameIfLCDEnabled
call Func_264b
jr nc, .asm_c806
ld a, e
@@ -1060,7 +1060,7 @@ PC_c7ea: ; c7ea (3:47ea)
jr .asm_c801
.asm_c82f
call Func_c135
call Func_3c48
call DoFrameIfLCDEnabled
ld hl, $0353
call $4891
call Func_c111
+4 -4
View File
@@ -39,7 +39,7 @@ Medal_1029e: ; 1029e (4:429e)
ld a, $ff
ld [$d116], a
.asm_102e2
call Func_3c48
call DoFrameIfLCDEnabled
ld a, [$d116]
inc a
ld [$d116], a
@@ -121,7 +121,7 @@ BoosterPack_1031b: ; 1031b (4:431b)
ld [wFrameType], a
farcallx $1, $7599
farcall Func_c1a4
call Func_3c48
call DoFrameIfLCDEnabled
pop af
ld [$d291], a
ret
@@ -178,7 +178,7 @@ Duel_Init: ; 103d3 (4:43d3)
ld a, [wMatchStartTheme]
call PlaySong
call $4031
call Func_3c48
call DoFrameIfLCDEnabled
ld bc, $2f1d
ld de, $1211
call Func_2a1a
@@ -758,7 +758,7 @@ CardPop_12768: ; 12768 (4:6768)
call PlaySong
bank1call Func_7571
farcall Func_c1a4
call Func_3c48
call DoFrameIfLCDEnabled
ld a, MUSIC_STOP
call PlaySong
scf
+1 -1
View File
@@ -145,7 +145,7 @@ Func_1a61f: ; 1a61f (6:661f)
push hl
ld e, a
ld d, $0
call $2f10
call LoadCardDataToRAM
call Func_379b
ld a, MUSIC_MEDAL
call PlaySong
+5 -5
View File
@@ -132,7 +132,7 @@ Func_1d078: ; 1d078 (7:5078)
ld a, $3c
ld [$d626], a
.asm_1d095
call Func_3c48
call DoFrameIfLCDEnabled
call UpdateRNGSources
call $5614
ld hl, $d635
@@ -212,7 +212,7 @@ Func_1d11c: ; 1d11c (7:511c)
farcall Func_111e9
farcallx $4, $4031
.asm_1d15a
call Func_3c48
call DoFrameIfLCDEnabled
call UpdateRNGSources
call Func_264b
push af
@@ -287,7 +287,7 @@ Credits_1d6ad: ; 1d6ad (7:56ad)
farcallx $4, $4031
call $57fc
.asm_1d6c8
call Func_3c48
call DoFrameIfLCDEnabled
call $5765
call $580b
ld a, [$d633]
@@ -300,10 +300,10 @@ Credits_1d6ad: ; 1d6ad (7:56ad)
call PlaySong
farcall Func_10ab4
call $3ca4
call $02d4
call Set_WD_off
call $5758
call EnableLCD
call Func_3c48
call DoFrameIfLCDEnabled
call DisableLCD
ld hl, $cabb
set 1, [hl]
+25 -22
View File
@@ -23,7 +23,7 @@ SECTION "rst38",ROM0[$38]
SECTION "vblank",ROM0[$40]
jp VBlankHandler
SECTION "lcdc",ROM0[$48]
call $cacd
call wLCDCFunctiontrampoline
reti
SECTION "timer",ROM0[$50]
jp TimerHandler
@@ -100,7 +100,7 @@ VBlankHandler: ; 019b (0:019b)
ld a, [wLCDC]
ld [rLCDC], a
ei
call $cad0
call wVBlankFunctionTrampoline
call FlushPalettes
ld hl, wVBlankCtr
inc [hl]
@@ -342,7 +342,7 @@ SetupLCD: ; 030b (0:030b)
xor a
ld [wReentrancyFlag], a
ld a, $c3 ; $c3 = jp nn
ld [$cacd], a
ld [wLCDCFunctiontrampoline], a
ld [wVBlankFunctionTrampoline], a
ld hl, wVBlankFunctionTrampoline + 1
ld [hl], NopF & $ff ;
@@ -706,16 +706,19 @@ ClearJoypad: ; 052a (0:052a)
pop hl
ret
Func_0536: ; 0536 (0:0536)
; calls DoFrame a times
DoAFrames: ; 0536 (0:0536)
.loop
push af
call Func_053f
call DoFrame
pop af
dec a
jr nz, .loop
ret
Func_053f: ; 053f (0:053f)
; updates background, sprites and other game variables, halts until vblank, and reads user input
; if $cad5 is not 0, the game can be paused (and resumed) by pressing the select button
DoFrame: ; 053f (0:053f)
push af
push hl
push de
@@ -727,18 +730,18 @@ Func_053f: ; 053f (0:053f)
call HandleDPadRepeat
ld a, [$cad5]
or a
jr z, .asm_56d
jr z, .done
ld a, [hButtonsPressed]
and $4
jr z, .asm_56d
.asm_55e
jr z, .done
.gamePausedLoop
call WaitForVBlank
call ReadJoypad
call HandleDPadRepeat
ld a, [hButtonsPressed]
and $4
jr z, .asm_55e
.asm_56d
jr z, .gamePausedLoop
.done
pop bc
pop de
pop hl
@@ -2010,13 +2013,13 @@ Func_0e63: ; 0e63 (0:0e63)
dec c
jr z, .asm_e75
ld a, [hli]
call $0e0a
call Func_0e0a
dec c
.asm_e75
inc b
dec b
jr z, .asm_e81
call $0e39
call Func_0e39
jr c, .asm_e81
ld [de], a
inc de
@@ -3577,7 +3580,7 @@ DrawNarrowTextBox_WaitForInput: ; 2a7c (0:2a7c)
call InitializeCursorParameters
call EnableLCD
.waitAorBLoop
call Func_053f
call DoFrame
call HandleTextBoxInput
ld a, [hButtonsPressed]
and $3
@@ -3605,7 +3608,7 @@ WaitForWideTextBoxInput: ; 2aae (0:2aae)
call InitializeCursorParameters
call EnableLCD
.waitAorBLoop
call Func_053f
call DoFrame
call HandleTextBoxInput
ld a, [hButtonsPressed]
and $3
@@ -3638,7 +3641,7 @@ Func_2af0: ; 2af0 (0:2af0)
call EnableLCD
jr .asm_2b39
.asm_2b1f
call Func_053f
call DoFrame
call HandleTextBoxInput
ld a, [hButtonsPressed]
bit 0, a
@@ -4023,7 +4026,7 @@ Func_2e41: ; 2e41 (0:2e41)
jr nz, .asm_2e70
jr .asm_2e6d
.asm_2e6a
call Func_053f
call DoFrame
.asm_2e6d
dec a
jr nz, .asm_2e6a
@@ -4479,7 +4482,7 @@ Func_312d: ; 312d (0:312d) ; serial transfer-related
ld [$ce63], a ; [$ce63] ← 1
call Func_31fc
.asm_315d
call Func_053f
call DoFrame
ld a, [$ce63]
or a
jr nz, .asm_315d
@@ -5129,19 +5132,19 @@ Func_3c45: ; 3c45 (0:3c45)
INCBIN "baserom.gbc",$3c46,$3c48 - $3c46
Func_3c48: ; 3c48 (0:3c48)
DoFrameIfLCDEnabled: ; 3c48 (0:3c48)
push af
ld a, [rLCDC]
bit 7, a
jr z, .asm_3c58
jr z, .done
push bc
push de
push hl
call Func_053f
call DoFrame
pop hl
pop de
pop bc
.asm_3c58
.done
pop af
ret
+5 -1
View File
@@ -209,10 +209,14 @@ wRNG2:: ; cacb
wCounter:: ; cacc
ds $1
; the LCDC status interrupt is always disabled and this always reads as jp $0000
wLCDCFunctiontrampoline:: ; cacd
ds $3
wVBlankFunctionTrampoline:: ; cad0
ds $20 ; unknown length
ds $3
ds $1d
wBufPalette:: ; caf0 - cab7f
ds $80