clean up more bank 0

This commit is contained in:
yenatch 2013-09-09 02:22:04 -04:00
parent 53b7926f5e
commit 106b0e139f

View File

@ -950,6 +950,7 @@ PrintLetterDelay: ; 313d
ret ret
; 318c ; 318c
CopyDataUntil: ; 318c CopyDataUntil: ; 318c
; Copies [hl, bc) to [de, bc - hl). ; Copies [hl, bc) to [de, bc - hl).
; In other words, the source data is from hl up to but not including bc, ; In other words, the source data is from hl up to but not including bc,
@ -966,12 +967,15 @@ CopyDataUntil: ; 318c
ret ret
; 0x3198 ; 0x3198
PrintNum: ; 3198 PrintNum: ; 3198
ld a, [hROMBank] ld a, [hROMBank]
push af push af
ld a, BANK(_PrintNum) ld a, BANK(_PrintNum)
rst Bankswitch rst Bankswitch
call _PrintNum call _PrintNum
pop af pop af
rst Bankswitch rst Bankswitch
ret ret
@ -981,18 +985,18 @@ PrintNum: ; 3198
Function31a4: ; 31a4 Function31a4: ; 31a4
ld a, [hROMBank] ld a, [hROMBank]
push af push af
ld a, $41 ld a, BANK(Function1061ef)
rst Bankswitch rst Bankswitch
call $61ef call Function1061ef
pop af pop af
rst Bankswitch rst Bankswitch
ret ret
; 31b0 ; 31b0
Function31b0: ; 31b0 FarPrintText: ; 31b0
ld [hBuffer], a ld [hBuffer], a
ld a, [hROMBank] ld a, [hROMBank]
push af push af
@ -1000,13 +1004,14 @@ Function31b0: ; 31b0
rst Bankswitch rst Bankswitch
call PrintText call PrintText
pop af pop af
rst Bankswitch rst Bankswitch
ret ret
; 31be ; 31be
Function31be: ; 31be
CallPointerAt: ; 31be
ld a, [hROMBank] ld a, [hROMBank]
push af push af
ld a, [hli] ld a, [hli]
@ -1024,10 +1029,13 @@ Function31be: ; 31be
ret ret
; 31cd ; 31cd
Function31cd: ; 31cd Function31cd: ; 31cd
; Push pointer hl in the current bank to $d0e8.
ld a, [hROMBank] ld a, [hROMBank]
Function31cf: ; 31cf Function31cf: ; 31cf
; Push pointer a:hl to $d0e8.
ld [$d0e8], a ld [$d0e8], a
ld a, l ld a, l
ld [$d0e9], a ld [$d0e9], a
@ -1091,15 +1099,15 @@ Function3200: ; 0x3200
ld a, [hCGB] ld a, [hCGB]
and a and a
jr z, .asm_320e jr z, .asm_320e
ld a, $2 ld a, 2
ld [hBGMapMode], a ld [hBGMapMode], a
ld c, $4 ld c, 4
call DelayFrames call DelayFrames
.asm_320e .asm_320e
ld a, $1 ld a, 1
ld [hBGMapMode], a ld [hBGMapMode], a
ld c, $4 ld c, 4
call DelayFrames call DelayFrames
ret ret
; 0x3218 ; 0x3218
@ -1116,9 +1124,11 @@ Function321c: ; 321c
ld a, [hCGB] ld a, [hCGB]
and a and a
jr z, .asm_322e jr z, .asm_322e
ld a, [$c2ce] ld a, [$c2ce]
cp 0 cp 0
jr z, .asm_322e jr z, .asm_322e
ld a, 1 ld a, 1
ld [hBGMapMode], a ld [hBGMapMode], a
jr Function323d jr Function323d
@ -1267,26 +1277,28 @@ ClearPalettes: ; 3317
ret ret
.cgb .cgb
; Save WRAM bank
ld a, [rSVBK] ld a, [rSVBK]
push af push af
; WRAM bank 5
ld a, 5 ld a, 5
ld [rSVBK], a ld [rSVBK], a
; Fill BGPals and OBPals with $ffff (white) ; Fill BGPals and OBPals with $ffff (white)
ld hl, BGPals ld hl, BGPals
ld bc, $0080 ld bc, $80
ld a, $ff ld a, $ff
call ByteFill call ByteFill
; Restore WRAM bank
pop af pop af
ld [rSVBK], a ld [rSVBK], a
; Request palette update ; Request palette update
ld a, 1 ld a, 1
ld [hCGBPalUpdate], a ld [hCGBPalUpdate], a
ret ret
; 333e ; 333e
ClearSGB: ; 333e ClearSGB: ; 333e
ld b, $ff ld b, $ff
GetSGBLayout: ; 3340 GetSGBLayout: ; 3340
@ -1360,9 +1372,9 @@ CountSetBits: ; 0x335f
GetWeekday: ; 3376 GetWeekday: ; 3376
ld a, [CurDay] ld a, [CurDay]
.loop .mod
sub 7 sub 7
jr nc, .loop jr nc, .mod
add 7 add 7
ret ret
; 3380 ; 3380
@ -2177,7 +2189,7 @@ Function3718: ; 3718
ld h, [hl] ld h, [hl]
ld l, a ld l, a
call GetMapEventBank call GetMapEventBank
call Function31b0 call FarPrintText
call WaitBGMap call WaitBGMap
call Functiona80 call Functiona80
ret ret
@ -30456,7 +30468,7 @@ Function247f0: ; 247f0
ld d, h ld d, h
ld e, l ld e, l
ld hl, $cf98 ld hl, $cf98
jp Function31be jp CallPointerAt
; 2486e ; 2486e
Function2486e: ; 2486e Function2486e: ; 2486e
@ -30464,7 +30476,7 @@ Function2486e: ; 2486e
ld d, h ld d, h
ld e, l ld e, l
ld hl, $cf98 ld hl, $cf98
call Function31be call CallPointerAt
pop hl pop hl
ld a, [$cf93] ld a, [$cf93]
and a and a
@ -30475,7 +30487,7 @@ Function2486e: ; 2486e
ld d, h ld d, h
ld e, l ld e, l
ld hl, $cf9b ld hl, $cf9b
call Function31be call CallPointerAt
.asm_2488a .asm_2488a
ret ret
@ -30528,7 +30540,7 @@ Function248b8: ; 248b8
dec a dec a
call Function248d5 call Function248d5
ld hl, $cf9e ld hl, $cf9e
call Function31be call CallPointerAt
ret ret
; 248d5 ; 248d5
@ -49955,7 +49967,7 @@ Function492b9: ; 492b9
pop de pop de
ld a, $b ld a, $b
ld hl, $48ce ld hl, $48ce
call Function31b0 call FarPrintText
jr .asm_49300 jr .asm_49300
.asm_492e5 .asm_492e5