ref: f16193dc91e11f9970fa76b321af6afb370a34fa
parent: 25325139e6864ba47a0ba28ecdee6ac0ce8eafe3
author: yenatch <[email protected]>
date: Sat Nov 23 23:26:10 EST 2013
move more credits asm into engine/credits.asm
--- a/engine/credits.asm
+++ b/engine/credits.asm
@@ -110,6 +110,241 @@
CREDITS_WAIT EQU $fe
+Function109847: ; 109847
+ bit 6, b
+ ld a, $0
+ jr z, .asm_10984f
+ ld a, $40
+.asm_10984f
+ ld [$cf63], a
+
+ ld a, [rSVBK]
+ push af
+ ld a, $5
+ ld [rSVBK], a
+
+ call WhiteBGMap
+ call ClearTileMap
+ call ClearSprites
+
+ ld hl, $ca00
+ ld c, $80
+ ld de, $ff00
+
+.asm_10986a
+ ld a, e
+ ld [hli], a
+ ld a, d
+ ld [hli], a
+ dec c
+ jr nz, .asm_10986a
+
+ ld de, CreditsBorderGFX
+ ld hl, $9200
+ lb bc, BANK(CreditsBorderGFX), $09
+ call Request2bpp
+
+ ld de, CopyrightGFX
+ ld hl, $9600
+ lb bc, BANK(CopyrightGFX), $1d
+ call Request2bpp
+
+ ld de, TheEndGFX
+ ld hl, $9400
+ lb bc, BANK(TheEndGFX), $10
+ call Request2bpp
+
+ ld a, $ff
+ ld [$cf64], a
+ xor a
+ ld [$cf65], a
+
+ call Function109bca
+ ld e, l
+ ld d, h
+ ld hl, VTiles2
+ lb bc, BANK(CreditsMonsGFX), $10
+ call Request2bpp
+
+ call Function109a95
+ xor a
+ ld [$cf66], a
+
+ ld hl, LYOverrides
+ ld bc, $100
+ xor a
+ call ByteFill
+
+ ld a, rSCX & $ff
+ ld [hLCDStatCustom], a
+
+ call GetCreditsPalette
+ call Function32f9
+ ld a, [$ff9e]
+ push af
+ ld a, $5
+ ld [$ff9e], a
+ ld a, $1
+ ld [$ffaa], a
+ xor a
+ ld [hBGMapMode], a
+ ld [CreditsPos], a
+ ld [$cd21], a
+ ld [CreditsTimer], a
+
+.asm_1098de
+ call Function109908
+ call Function1098fd
+ jr nz, .asm_1098ee
+
+ call Function109926
+ call DelayFrame
+ jr .asm_1098de
+
+.asm_1098ee
+ call WhiteBGMap
+ xor a
+ ld [hLCDStatCustom], a
+ ld [hBGMapAddress], a
+ pop af
+ ld [$ff9e], a
+ pop af
+ ld [rSVBK], a
+ ret
+; 1098fd
+
+Function1098fd: ; 1098fd
+ ld a, [hJoypadDown]
+ and $1
+ ret z
+ ld a, [$cf63]
+ bit 7, a
+ ret
+; 109908
+
+Function109908: ; 109908
+ ld a, [hJoypadDown]
+ and $2
+ ret z
+ ld a, [$cf63]
+ bit 6, a
+ ret z
+ ld hl, CreditsPos
+ ld a, [hli]
+ cp $d
+ jr nc, .asm_10991e
+ ld a, [hli]
+ and a
+ ret z
+
+.asm_10991e
+ ld hl, CreditsTimer
+ ld a, [hl]
+ and a
+ ret z
+ dec [hl]
+ ret
+; 109926
+
+Function109926: ; 109926
+ ld a, [$cf63]
+ and $f
+ ld e, a
+ ld d, $0
+ ld hl, $5937
+ add hl, de
+ add hl, de
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ jp [hl]
+; 109937
+
+
+; no known jump sources
+Jumptable_109937: ; 109937 (42:5937)
+ dw ParseCredits
+ dw Function109951
+ dw Function109951
+ dw Function10995e
+ dw Function109964
+ dw Function10997b
+ dw Function109986
+ dw Function109951
+ dw Function109951
+ dw Function109951
+ dw Function109964
+ dw Function10997b
+ dw Function109956
+
+
+; known jump sources: 109961 (42:5961), 109983 (42:5983), 1099a0 (42:59a0), 109a62 (42:5a62)
+Function109951: ; 109951 (42:5951)
+ ld hl, $cf63
+ inc [hl]
+ ret
+
+; no known jump sources
+Function109956: ; 109956 (42:5956)
+ ld hl, $cf63
+ ld a, [hl]
+ and $f0
+ ld [hl], a
+ ret
+
+; no known jump sources
+Function10995e: ; 10995e (42:595e)
+ xor a
+ ld [hBGMapMode], a ; $ff00+$d4
+ jp Function109951
+
+; no known jump sources
+Function109964: ; 109964 (42:5964)
+ call Function109bca
+ ld a, l
+ ld [$cf68], a
+ ld a, h
+ ld [$cf69], a
+ ld a, $0
+ ld [$cf6a], a
+ ld a, $90
+ ld [$cf6b], a
+ jr Function10997b
+
+; known jump sources: 109979 (42:5979)
+Function10997b: ; 10997b (42:597b)
+ xor a
+ ld [hBGMapMode], a ; $ff00+$d4
+ ld a, $8
+ ld [$cf67], a
+ jp Function109951
+
+; known jump sources: 10998a (42:598a)
+Function109986: ; 109986 (42:5986)
+ ld a, [rLY] ; $ff00+$44
+ cp $30
+ jr c, Function109986
+ ld a, [$cf66]
+ dec a
+ dec a
+ ld [$cf66], a
+ ld hl, $d11f
+ call Function1099a3
+ ld hl, $d187
+ call Function1099a3
+ jp Function109951
+
+; known jump sources: 109997 (42:5997), 10999d (42:599d)
+Function1099a3: ; 1099a3 (42:59a3)
+ ld c, $8
+.asm_1099a5
+ ld [hli], a
+ dec c
+ jr nz, .asm_1099a5
+ ret
+; 1099aa
+
+
ParseCredits: ; 1099aa
ld hl, $cf63
bit 7, [hl]
--- a/main.asm
+++ b/main.asm
@@ -113334,239 +113334,6 @@
; 109847
-Function109847: ; 109847
- bit 6, b
- ld a, $0
- jr z, .asm_10984f
- ld a, $40
-.asm_10984f
- ld [$cf63], a
-
- ld a, [rSVBK]
- push af
- ld a, $5
- ld [rSVBK], a
-
- call WhiteBGMap
- call ClearTileMap
- call ClearSprites
-
- ld hl, $ca00
- ld c, $80
- ld de, $ff00
-
-.asm_10986a
- ld a, e
- ld [hli], a
- ld a, d
- ld [hli], a
- dec c
- jr nz, .asm_10986a
-
- ld de, CreditsBorderGFX
- ld hl, $9200
- lb bc, BANK(CreditsBorderGFX), $09
- call Request2bpp
-
- ld de, CopyrightGFX
- ld hl, $9600
- lb bc, BANK(CopyrightGFX), $1d
- call Request2bpp
-
- ld de, TheEndGFX
- ld hl, $9400
- lb bc, BANK(TheEndGFX), $10
- call Request2bpp
-
- ld a, $ff
- ld [$cf64], a
- xor a
- ld [$cf65], a
-
- call Function109bca
- ld e, l
- ld d, h
- ld hl, VTiles2
- lb bc, BANK(CreditsMonsGFX), $10
- call Request2bpp
-
- call Function109a95
- xor a
- ld [$cf66], a
-
- ld hl, LYOverrides
- ld bc, $100
- xor a
- call ByteFill
-
- ld a, rSCX & $ff
- ld [hLCDStatCustom], a
-
- call GetCreditsPalette
- call Function32f9
- ld a, [$ff9e]
- push af
- ld a, $5
- ld [$ff9e], a
- ld a, $1
- ld [$ffaa], a
- xor a
- ld [hBGMapMode], a
- ld [CreditsPos], a
- ld [$cd21], a
- ld [CreditsTimer], a
-
-.asm_1098de
- call Function109908
- call Function1098fd
- jr nz, .asm_1098ee
-
- call Function109926
- call DelayFrame
- jr .asm_1098de
-
-.asm_1098ee
- call WhiteBGMap
- xor a
- ld [hLCDStatCustom], a
- ld [hBGMapAddress], a
- pop af
- ld [$ff9e], a
- pop af
- ld [rSVBK], a
- ret
-; 1098fd
-
-Function1098fd: ; 1098fd
- ld a, [hJoypadDown]
- and $1
- ret z
- ld a, [$cf63]
- bit 7, a
- ret
-; 109908
-
-Function109908: ; 109908
- ld a, [hJoypadDown]
- and $2
- ret z
- ld a, [$cf63]
- bit 6, a
- ret z
- ld hl, CreditsPos
- ld a, [hli]
- cp $d
- jr nc, .asm_10991e
- ld a, [hli]
- and a
- ret z
-
-.asm_10991e
- ld hl, CreditsTimer
- ld a, [hl]
- and a
- ret z
- dec [hl]
- ret
-; 109926
-
-Function109926: ; 109926
- ld a, [$cf63]
- and $f
- ld e, a
- ld d, $0
- ld hl, $5937
- add hl, de
- add hl, de
- ld a, [hli]
- ld h, [hl]
- ld l, a
- jp [hl]
-; 109937
-
-
-; no known jump sources
-Jumptable_109937: ; 109937 (42:5937)
- dw ParseCredits
- dw Function109951
- dw Function109951
- dw Function10995e
- dw Function109964
- dw Function10997b
- dw Function109986
- dw Function109951
- dw Function109951
- dw Function109951
- dw Function109964
- dw Function10997b
- dw Function109956
-
-
-; known jump sources: 109961 (42:5961), 109983 (42:5983), 1099a0 (42:59a0), 109a62 (42:5a62)
-Function109951: ; 109951 (42:5951)
- ld hl, $cf63
- inc [hl]
- ret
-
-; no known jump sources
-Function109956: ; 109956 (42:5956)
- ld hl, $cf63
- ld a, [hl]
- and $f0
- ld [hl], a
- ret
-
-; no known jump sources
-Function10995e: ; 10995e (42:595e)
- xor a
- ld [hBGMapMode], a ; $ff00+$d4
- jp Function109951
-
-; no known jump sources
-Function109964: ; 109964 (42:5964)
- call Function109bca
- ld a, l
- ld [$cf68], a
- ld a, h
- ld [$cf69], a
- ld a, $0
- ld [$cf6a], a
- ld a, $90
- ld [$cf6b], a
- jr Function10997b
-
-; known jump sources: 109979 (42:5979)
-Function10997b: ; 10997b (42:597b)
- xor a
- ld [hBGMapMode], a ; $ff00+$d4
- ld a, $8
- ld [$cf67], a
- jp Function109951
-
-; known jump sources: 10998a (42:598a)
-Function109986: ; 109986 (42:5986)
- ld a, [rLY] ; $ff00+$44
- cp $30
- jr c, Function109986
- ld a, [$cf66]
- dec a
- dec a
- ld [$cf66], a
- ld hl, $d11f
- call Function1099a3
- ld hl, $d187
- call Function1099a3
- jp Function109951
-
-; known jump sources: 109997 (42:5997), 10999d (42:599d)
-Function1099a3: ; 1099a3 (42:59a3)
- ld c, $8
-.asm_1099a5
- ld [hli], a
- dec c
- jr nz, .asm_1099a5
- ret
-
; Credits
INCLUDE "engine/credits.asm"