merge with newest update

This commit is contained in:
JimB16
2015-10-26 03:26:53 +01:00
446 changed files with 17108 additions and 16475 deletions

View File

@@ -106,7 +106,7 @@ UpdateEnemyMonInParty:: ; 39b0
; Update level, status, current HP
; No wildmons.
ld a, [IsInBattle]
ld a, [wBattleMode]
dec a
ret z
@@ -194,34 +194,6 @@ endr
dw .status, .statusopp, .animation, .effect, .power, .type
dw .curmove, .lastcounter, .lastcounteropp, .lastmove, .lastmoveopp
const_def
const PLAYER_SUBSTATUS_1
const ENEMY_SUBSTATUS_1
const PLAYER_SUBSTATUS_2
const ENEMY_SUBSTATUS_2
const PLAYER_SUBSTATUS_3
const ENEMY_SUBSTATUS_3
const PLAYER_SUBSTATUS_4
const ENEMY_SUBSTATUS_4
const PLAYER_SUBSTATUS_5
const ENEMY_SUBSTATUS_5
const PLAYER_STATUS
const ENEMY_STATUS
const PLAYER_MOVE_ANIMATION
const ENEMY_MOVE_ANIMATION
const PLAYER_MOVE_EFFECT
const ENEMY_MOVE_EFFECT
const PLAYER_MOVE_POWER
const ENEMY_MOVE_POWER
const PLAYER_MOVE_TYPE
const ENEMY_MOVE_TYPE
const PLAYER_CUR_MOVE
const ENEMY_CUR_MOVE
const PLAYER_COUNTER_MOVE
const ENEMY_COUNTER_MOVE
const PLAYER_LAST_MOVE
const ENEMY_LAST_MOVE
; player enemy
.substatus1 db PLAYER_SUBSTATUS_1, ENEMY_SUBSTATUS_1
.substatus1opp db ENEMY_SUBSTATUS_1, PLAYER_SUBSTATUS_1
@@ -293,8 +265,8 @@ CELL_PHONE_TOP EQU $5e
CELL_PHONE_BOTTOM EQU $5f
; For mobile link battles only.
ld a, [InLinkBattle]
cp 4
ld a, [wLinkMode]
cp LINK_MOBILE
ret c
; Draw a cell phone icon at the

View File

@@ -117,8 +117,8 @@ Functione51:: ; e51
ret
; e58
Functione58:: ; e58
callba Functionfb4be
LoadFontsBattleExtra:: ; e58
callba _LoadFontsBattleExtra
ret
; e5f
@@ -211,6 +211,7 @@ endr
Request2bpp:: ; eba
; Load 2bpp at b:de to occupy c tiles of hl.
ld a, [hBGMapMode]
push af
xor a
@@ -223,19 +224,19 @@ Request2bpp:: ; eba
ld a, [$ffd3]
push af
ld a, $8
ld [$ffd3], a
ld a, [InLinkBattle]
cp $4
jr nz, .asm_edc
ld a, [$ffe9]
ld a, [wLinkMode]
cp LINK_MOBILE
jr nz, .NotMobile
ld a, [hMobile]
and a
jr nz, .asm_edc
jr nz, .NotMobile
ld a, $6
ld [$ffd3], a
.asm_edc
.NotMobile
ld a, e
ld [Requested2bppSource], a
ld a, d
@@ -244,12 +245,11 @@ Request2bpp:: ; eba
ld [Requested2bppDest], a
ld a, h
ld [Requested2bppDest + 1], a
.asm_eec
.loop
ld a, c
ld hl, $ffd3
cp [hl]
jr nc, .asm_f08
jr nc, .iterate
ld [Requested2bpp], a
.wait
@@ -268,19 +268,21 @@ Request2bpp:: ; eba
ld [hBGMapMode], a
ret
.asm_f08
.iterate
ld a, [$ffd3]
ld [Requested2bpp], a
.asm_f0d
.wait2
call DelayFrame
ld a, [Requested2bpp]
and a
jr nz, .asm_f0d
jr nz, .wait2
ld a, c
ld hl, $ffd3
sub [hl]
ld c, a
jr .asm_eec
jr .loop
; f1e
@@ -300,16 +302,16 @@ Request1bpp:: ; f1e
ld a, $8
ld [$ffd3], a
ld a, [InLinkBattle]
cp $4
jr nz, .asm_f40
ld a, [$ffe9]
ld a, [wLinkMode]
cp LINK_MOBILE
jr nz, .NotMobile
ld a, [hMobile]
and a
jr nz, .asm_f40
jr nz, .NotMobile
ld a, $6
ld [$ffd3], a
.asm_f40
.NotMobile
ld a, e
ld [Requested1bppSource], a
ld a, d
@@ -318,11 +320,11 @@ Request1bpp:: ; f1e
ld [Requested1bppDest], a
ld a, h
ld [Requested1bppDest + 1], a
.asm_f50
.loop
ld a, c
ld hl, $ffd3
cp [hl]
jr nc, .asm_f6c
jr nc, .iterate
ld [Requested1bpp], a
.wait
@@ -341,19 +343,21 @@ Request1bpp:: ; f1e
ld [hBGMapMode], a
ret
.asm_f6c
.iterate
ld a, [$ffd3]
ld [Requested1bpp], a
.asm_f71
.wait2
call DelayFrame
ld a, [Requested1bpp]
and a
jr nz, .asm_f71
jr nz, .wait2
ld a, c
ld hl, $ffd3
sub [hl]
ld c, a
jr .asm_f50
jr .loop
; f82

View File

@@ -136,15 +136,14 @@ Init:: ; 17d
; BG on
ld [rLCDC], a
ld a, $ff
ld a, -1
ld [$ffcb], a
callba Function9890
ld a, $9c
ld [$ffd7], a
xor a
ld a, VBGMap1 / $100
ld [hBGMapAddress + 1], a
xor a ; VBGMap1 % $100
ld [hBGMapAddress], a
callba StartClock

View File

@@ -39,7 +39,7 @@ Joypad:: ; 935
; We can only get four inputs at a time.
; We take d-pad first for no particular reason.
ld a, D_PAD
ld a, R_DPAD
ld [rJOYP], a
; Read twice to give the request time to take.
rept 2
@@ -57,7 +57,7 @@ endr
; Buttons make 8 total inputs (A, B, Select, Start).
; We can fit this into one byte.
ld a, BUTTONS
ld a, R_BUTTONS
ld [rJOYP], a
; Wait for input to stabilize.
rept 6
@@ -198,14 +198,14 @@ GetJoypad:: ; 984
.updateauto
; An input of $ff will end the stream.
ld a, [hli]
cp a, $ff
cp a, -1
jr z, .stopauto
ld b, a
; A duration of $ff will end the stream indefinitely.
ld a, [hli]
ld [AutoInputLength], a
cp a, $ff
cp a, -1
jr nz, .next
; The current input is overwritten.
@@ -273,42 +273,44 @@ StopAutoInput:: ; a0a
; a1b
Functiona1b:: ; a1b
JoyTitleScreenInput:: ; a1b
.loop
call DelayFrame
push bc
call Functiona57
call JoyTextDelay
pop bc
ld a, [hJoyDown]
cp D_UP | SELECT | B_BUTTON
jr z, .asm_a34
jr z, .keycombo
ld a, [$ffa9]
ld a, [hJoyLast]
and START | A_BUTTON
jr nz, .asm_a34
jr nz, .keycombo
dec c
jr nz, Functiona1b
jr nz, .loop
and a
ret
.asm_a34
.keycombo
scf
ret
; a36
Functiona36:: ; a36
JoyWaitAorB:: ; a36
.loop
call DelayFrame
call GetJoypad
ld a, [hJoyPressed]
and A_BUTTON | B_BUTTON
ret nz
call RTC
jr Functiona36
jr .loop
; a46
CloseText:: ; a46
@@ -317,37 +319,37 @@ CloseText:: ; a46
ld a, 1
ld [hOAMUpdate], a
call WaitBGMap
call Functiona36
call JoyWaitAorB
pop af
ld [hOAMUpdate], a
ret
; a57
Functiona57:: ; a57
JoyTextDelay:: ; a57
call GetJoypad
ld a, [$ffaa]
ld a, [hInMenu]
and a
ld a, [hJoyPressed]
jr z, .asm_a63
jr z, .ok
ld a, [hJoyDown]
.asm_a63
.ok
ld [hJoyLast], a
ld a, [hJoyPressed]
and a
jr z, .asm_a70
jr z, .checkframedelay
ld a, 15
ld [TextDelayFrames], a
ret
.asm_a70
.checkframedelay
ld a, [TextDelayFrames]
and a
jr z, .asm_a7a
jr z, .restartframedelay
xor a
ld [hJoyLast], a
ret
.asm_a7a
.restartframedelay
ld a, 5
ld [TextDelayFrames], a
ret
@@ -356,90 +358,95 @@ Functiona57:: ; a57
Functiona80:: ; a80
ld a, [hConnectionStripLength]
push af
ld a, [$ffb0]
ld a, [hConnectedMapWidth]
push af
xor a
ld [hConnectionStripLength], a
ld a, $6
ld [$ffb0], a
.asm_a8d
ld a, 6
ld [hConnectedMapWidth], a
.loop
push hl
hlcoord 18, 17
call Functionb06
pop hl
call Functiona57
ld a, [$ffa9]
and $3
jr z, .asm_a8d
call JoyTextDelay
ld a, [hJoyLast]
and A_BUTTON | B_BUTTON
jr z, .loop
pop af
ld [$ffb0], a
ld [hConnectedMapWidth], a
pop af
ld [hConnectionStripLength], a
ret
; aa5
Functionaa5:: ; aa5
call Functiona57
ld a, [$ffa9]
.loop
call JoyTextDelay
ld a, [hJoyLast]
and A_BUTTON | B_BUTTON
jr z, Functionaa5
jr z, .loop
ret
; aaf
KeepTextOpen:: ; aaf
ld a, [InLinkBattle]
ld a, [wLinkMode]
and a
jr nz, .asm_ac1
call Functionac6
jr nz, .link
call .wait_input
push de
ld de, SFX_READ_TEXT_2
call PlaySFX
pop de
ret
.asm_ac1
.link
ld c, 65
jp DelayFrames
; ac6
Functionac6:: ; ac6
.wait_input: ; ac6
ld a, [hOAMUpdate]
push af
ld a, $1
ld [hOAMUpdate], a
ld a, [InputType]
or a
jr z, .asm_ad9
callba Start_DudeAutoInput_A
.asm_ad9
call Functionaf5
call Functiona57
jr z, .input_wait_loop
callba _DudeAutoInput_A
.input_wait_loop
call .blink_cursor
call JoyTextDelay
ld a, [hJoyPressed]
and $3
jr nz, .asm_af1
and A_BUTTON | B_BUTTON
jr nz, .received_input
call RTC
ld a, $1
ld [hBGMapMode], a
call DelayFrame
jr .asm_ad9
jr .input_wait_loop
.asm_af1
.received_input
pop af
ld [hOAMUpdate], a
ret
; af5
Functionaf5:: ; af5
.blink_cursor: ; af5
ld a, [$ff9b]
and $10
jr z, .asm_aff
ld a, $ee
jr .asm_b02
and %00010000 ; bit 4, a
jr z, .cursor_off
ld a, "â–Ľ"
jr .load_cursor_state
.asm_aff
.cursor_off
ld a, [TileMap + 17 + 17 * SCREEN_WIDTH]
.asm_b02
.load_cursor_state
ld [TileMap + 18 + 17 * SCREEN_WIDTH], a
ret
; b06
@@ -448,7 +455,7 @@ Functionb06:: ; b06
push bc
ld a, [hl]
ld b, a
ld a, $ee
ld a, "â–Ľ"
cp b
pop bc
jr nz, .asm_b27
@@ -456,16 +463,16 @@ Functionb06:: ; b06
dec a
ld [hConnectionStripLength], a
ret nz
ld a, [$ffb0]
ld a, [hConnectedMapWidth]
dec a
ld [$ffb0], a
ld [hConnectedMapWidth], a
ret nz
ld a, $7a
ld a, "─"
ld [hl], a
ld a, $ff
ld a, -1
ld [hConnectionStripLength], a
ld a, $6
ld [$ffb0], a
ld a, 6
ld [hConnectedMapWidth], a
ret
.asm_b27
@@ -477,12 +484,12 @@ Functionb06:: ; b06
ret nz
dec a
ld [hConnectionStripLength], a
ld a, [$ffb0]
ld a, [hConnectedMapWidth]
dec a
ld [$ffb0], a
ld [hConnectedMapWidth], a
ret nz
ld a, $6
ld [$ffb0], a
ld [hConnectedMapWidth], a
ld a, $ee
ld [hl], a
ret

View File

@@ -214,7 +214,7 @@ Function222a:: ; 222a
ret
; 2238
Function2238:: ; 2238
CheckWarpTile:: ; 2238
call Function2252
ret nc
push bc
@@ -258,11 +258,11 @@ Function2266:: ; 2266
ld a, [MapX]
sub $4
ld d, a
ld a, [wdbfb]
ld a, [wCurrMapWarpCount]
and a
ret z
ld c, a
ld hl, wdbfc
ld hl, wCurrMapWarpHeaderPointer
ld a, [hli]
ld h, [hl]
ld l, a
@@ -294,7 +294,7 @@ Function2266:: ; 2266
pop hl
call Function22a3
ret nc
ld a, [wdbfb]
ld a, [wCurrMapWarpCount]
inc a
sub c
ld c, a
@@ -325,7 +325,7 @@ Function22a7:: ; 22a7
Function22b4:: ; 22b4
push bc
ld hl, wdbfc
ld hl, wCurrMapWarpHeaderPointer
ld a, [hli]
ld h, [hl]
ld l, a
@@ -439,8 +439,8 @@ Function234f:: ; 234f
ld a, [hli]
ld h, [hl]
ld l, a
call Function23ac
call Function23c3
call ReadMapTriggers
call ReadMapCallbacks
ret
; 235c
@@ -507,34 +507,36 @@ GetMapConnection:: ; 23a3
; 23ac
Function23ac:: ; 23ac
ld a, [hli]
ReadMapTriggers:: ; 23ac
ld a, [hli] ; trigger count
ld c, a
ld [wdc07], a
ld [wCurrMapTriggerCount], a ; current map trigger count
ld a, l
ld [wdc07 + 1], a
ld [wCurrMapTriggerHeaderPointer], a ; map trigger pointer
ld a, h
ld [wdc09], a
ld a, c
and a
ret z
ld bc, $0004
ld bc, 4 ; size of a map trigger header entry
call AddNTimes
ret
; 23c3
Function23c3:: ; 23c3
ReadMapCallbacks:: ; 23c3
ld a, [hli]
ld c, a
ld [wdc0a], a
ld [wCurrMapCallbackCount], a
ld a, l
ld [wdc0b], a
ld [wCurrMapCallbackHeaderPointer], a
ld a, h
ld [wdc0b + 1], a
ld [wCurrMapCallbackHeaderPointer + 1], a
ld a, c
and a
ret z
ld bc, $0003
ld bc, 3
call AddNTimes
ret
; 23da
@@ -542,9 +544,9 @@ Function23c3:: ; 23c3
ReadWarps:: ; 23da
ld a, [hli]
ld c, a
ld [wdbfb], a
ld [wCurrMapWarpCount], a
ld a, l
ld [wdbfc], a
ld [wCurrMapWarpHeaderPointer], a
ld a, h
ld [wdbfd], a
ld a, c
@@ -560,7 +562,7 @@ ReadCoordEvents:: ; 23f1
ld c, a
ld [wCurrentMapXYTriggerCount], a
ld a, l
ld [wdbff], a
ld [wCurrentMapXYTriggerHeaderPointer], a
ld a, h
ld [wdc00], a
ld a, c
@@ -1000,11 +1002,11 @@ RunMapCallback:: ; 263b
; 2653
Function2653:: ; 2653
ld a, [wdc0a]
ld a, [wCurrMapCallbackCount]
ld c, a
and a
ret z
ld hl, wdc0b
ld hl, wCurrMapCallbackHeaderPointer
ld a, [hli]
ld h, [hl]
ld l, a
@@ -1896,7 +1898,7 @@ CheckCurrentMapXYTriggers:: ; 2ad4
CheckStandingOnXYTrigger:: ; 2ae7
; Checks to see if you are standing on an xy-trigger. If yes, copies the trigger to EngineBuffer1 and sets carry.
ld hl, wdbff
ld hl, wCurrentMapXYTriggerHeaderPointer
ld a, [hli]
ld h, [hl]
ld l, a
@@ -1958,7 +1960,7 @@ FadeToMenu:: ; 2b29
call LoadMenuDataHeader_0x1d75
callba FadeBlackBGMap
call ClearSprites
call Function2ed3
call DisableSpriteUpdates
ret
; 2b3c
@@ -1986,7 +1988,7 @@ Function2b5c:: ; 2b5c
callba Function49409
call Function3200
callba FadeInBGMap
call Function2ee4
call EnableSpriteUpdates
ret
; 2b74

View File

@@ -1,14 +1,14 @@
; Functions used in displaying and handling menus.
LoadMenuDataHeader:: ; 0x1d35
LoadMenuDataHeader::
call CopyMenuDataHeader
call Function1c00
call BackUpTiles
ret
CopyMenuDataHeader:: ; 0x1d3c
CopyMenuDataHeader::
ld de, wcf81
ld bc, $0010
ld bc, 16
call CopyBytes
ld a, [hROMBank]
ld [wcf8a], a
@@ -16,7 +16,7 @@ CopyMenuDataHeader:: ; 0x1d3c
; 0x1d4b
Function1d4b:: ; 1d4b
ld [wcf88], a
ld [wPocketCursorBuffer], a
ret
; 1d4f
@@ -71,7 +71,7 @@ Call_ExitMenu:: ; 1d7d
ret
; 1d81
InterpretMenu2:: ; 0x1d81
InterpretMenu2::
xor a
ld [hBGMapMode], a
call Function1cbb
@@ -81,16 +81,16 @@ InterpretMenu2:: ; 0x1d81
call Function1c66
ld a, [wcf91]
bit 7, a
jr z, .asm_1da7 ; 0x1d98 $d
jr z, .cancel
call Function1c10
call Function1bc9
call Function1ff8
bit 1, a
jr z, .asm_1da9 ; 0x1da5 $2
.asm_1da7
jr z, .okay
.cancel
scf
ret
.asm_1da9
.okay
and a
ret
; 0x1dab
@@ -103,7 +103,7 @@ GetMenu2:: ; 1dab
ret
; 1db8
Function1db8:: ; 0x1db8
Function1db8::
push hl
push bc
push af
@@ -131,9 +131,9 @@ YesNoBox:: ; 1dcf
PlaceYesNoBox:: ; 1dd2
jr _YesNoBox
Function1dd4:: ; 1dd4
PlaceGenericTwoOptionBox:: ; 1dd4
call LoadMenuDataHeader
jr Function1dfe
jr InterpretTwoOptionMenu
_YesNoBox:: ; 1dd9
; Return nc (yes) or c (no).
@@ -141,39 +141,41 @@ _YesNoBox:: ; 1dd9
ld hl, YesNoMenuDataHeader
call CopyMenuDataHeader
pop bc
; This seems to be an overflow prevention, but
; it was coded wrong.
ld a, b
cp $e
jr nz, .asm_1de9
ld a, $e
cp SCREEN_WIDTH - 6
jr nz, .okay ; should this be "jr nc"?
ld a, SCREEN_WIDTH - 6
ld b, a
.asm_1de9
.okay
ld a, b
ld [wcf83], a
ld [wMenuBorderLeftCoord], a
add $5
ld [wcf85], a
ld [wMenuBorderRightCoord], a
ld a, c
ld [wcf82], a
ld [wMenuBorderTopCoord], a
add $4
ld [wcf84], a
call Function1c00
ld [wMenuBorderBottomCoord], a
call BackUpTiles
Function1dfe:: ; 1dfe
InterpretTwoOptionMenu:: ; 1dfe
call InterpretMenu2
push af
ld c, $f
call DelayFrames
call WriteBackup
pop af
jr c, .asm_1e16
jr c, .no
ld a, [wcfa9]
cp 2 ; no
jr z, .asm_1e16
jr z, .no
and a
ret
.asm_1e16
ld a, $2
.no
ld a, 2
ld [wcfa9], a
scf
ret
@@ -196,7 +198,7 @@ YesNoMenuData2:: ; 1e25
Function1e2e:: ; 1e2e
call Function1e35
call Function1c00
call BackUpTiles
ret
; 1e35
@@ -204,24 +206,24 @@ Function1e35:: ; 1e35
push de
call CopyMenuDataHeader
pop de
ld a, [wcf83]
ld a, [wMenuBorderLeftCoord]
ld h, a
ld a, [wcf85]
ld a, [wMenuBorderRightCoord]
sub h
ld h, a
ld a, d
ld [wcf83], a
ld [wMenuBorderLeftCoord], a
add h
ld [wcf85], a
ld a, [wcf82]
ld [wMenuBorderRightCoord], a
ld a, [wMenuBorderTopCoord]
ld l, a
ld a, [wcf84]
ld a, [wMenuBorderBottomCoord]
sub l
ld l, a
ld a, e
ld [wcf82], a
ld [wMenuBorderTopCoord], a
add l
ld [wcf84], a
ld [wMenuBorderBottomCoord], a
ret
; 1e5d
@@ -243,14 +245,14 @@ SetUpMenu:: ; 1e70
set 7, [hl]
ret
MenuFunc_1e7f:: ; 0x1e7f
MenuFunc_1e7f::
call Function1c66
call Function1ebd
call Function1ea6
call Function1cbb
ret
MenuWriteText:: ; 0x1e8c
MenuWriteText::
xor a
ld [hBGMapMode], a
call Function1ebd ; sort out the text
@@ -267,18 +269,18 @@ MenuWriteText:: ; 0x1e8c
; 0x1ea6
Function1ea6:: ; 1ea6
ld a, [wcf83]
ld a, [wMenuBorderLeftCoord]
ld c, a
ld a, [wcf85]
ld a, [wMenuBorderRightCoord]
sub c
ld c, a
ld a, [wcf92]
add a
inc a
ld b, a
ld a, [wcf82]
ld a, [wMenuBorderTopCoord]
add b
ld [wcf84], a
ld [wMenuBorderBottomCoord], a
ret
; 1ebd
@@ -308,7 +310,7 @@ Function1ebd:: ; 1ebd
; 1eda
Function1eda:: ; 1eda
call Function1cfd
call GetMemTileCoord
ld bc, $002a
add hl, bc
.asm_1ee1
@@ -408,7 +410,7 @@ Function1f2a:: ; 1f2a
ld a, [hl]
ld [MenuSelection], a
ld a, [wcfa9]
ld [wcf88], a
ld [wPocketCursorBuffer], a
and a
ret
@@ -484,21 +486,23 @@ endr
ret
; 1fbf
Function1fbf:: ; 1fbf
ResetTextRelatedRAM:: ; 1fbf
ld hl, wcf71
call Function1ff0
call .bytefill
ld hl, wcf81
call Function1ff0
call .bytefill
ld hl, wcf91
call Function1ff0
call .bytefill
ld hl, wcfa1
call Function1ff0
call .bytefill
ld a, [rSVBK]
push af
ld a, $7
ld [rSVBK], a
xor a
ld hl, $dfff
ld hl, w7_dfff
rept 2
ld [hld], a
endr
@@ -506,12 +510,13 @@ endr
ld [wcf71], a
ld a, h
ld [wcf72], a
pop af
ld [rSVBK], a
ret
; 1ff0
Function1ff0:: ; 1ff0
.bytefill: ; 1ff0
ld bc, $0010
xor a
call ByteFill
@@ -521,13 +526,13 @@ Function1ff0:: ; 1ff0
Function1ff8:: ; 1ff8
push af
and $3
jr z, .asm_2007
jr z, .nosound
ld hl, wcf81
bit 3, [hl]
jr nz, .asm_2007
jr nz, .nosound
call PlayClickSFX
.asm_2007
.nosound
pop af
ret
; 2009
@@ -566,7 +571,7 @@ InterpretMenu:: ; 202a
ld a, [hROMBank]
ld [wcf94], a
callba Function2400e
ld a, [wcf88]
ld a, [wPocketCursorBuffer]
ret
; 2039
@@ -574,7 +579,7 @@ Function2039:: ; 2039
ld a, [hROMBank]
ld [wcf94], a
callba Function24022
ld a, [wcf88]
ld a, [wPocketCursorBuffer]
ret
; 2048
@@ -582,7 +587,7 @@ Function2048:: ; 2048
ld a, [hROMBank]
ld [wcf94], a
callba Function2403c
ld a, [wcf88]
ld a, [wPocketCursorBuffer]
ret
; 2057

View File

@@ -74,9 +74,9 @@ Timer:: ; 3e93
push de
push hl
ld a, [$ffe9]
ld a, [hMobile]
and a
jr z, .asm_3ed2
jr z, .pop_ret
xor a
ld [rTAC], a
@@ -88,15 +88,15 @@ Timer:: ; 3e93
ld a, [$c86a]
or a
jr z, .asm_3ed2
jr z, .pop_ret
ld a, [$c822]
bit 1, a
jr nz, .asm_3eca
jr nz, .skip_Function1118de
ld a, [rSC]
and 1 << rSC_ON
jr nz, .asm_3eca
jr nz, .skip_Function1118de
ld a, [hROMBank]
push af
@@ -111,14 +111,14 @@ Timer:: ; 3e93
ld [$c981], a
rst Bankswitch
.asm_3eca
.skip_Function1118de
ld a, [rTMA]
ld [rTIMA], a
ld a, 1 << rTAC_ON | rTAC_65536_HZ
ld [rTAC], a
.asm_3ed2
.pop_ret
pop hl
pop de
pop bc

View File

@@ -159,11 +159,11 @@ Function1bd3:: ; 1bd3
Function1bdd:: ; 1bdd
push bc
push af
ld a, [$ffa9]
and $f0
ld a, [hJoyLast]
and D_PAD
ld b, a
ld a, [hJoyPressed]
and $f
and BUTTONS
or b
ld b, a
pop af
@@ -190,33 +190,3 @@ Function1bf7:: ; 1bf7
ret
; 1c00
Function1c00:: ; 1c00
callab Function24374
ret
; 1c07
ExitMenu:: ; 0x1c07
push af
callab Function243e8
pop af
ret
Function1c10:: ; 0x1c10
callab Function2446d
ret
WriteBackup:: ; 0x1c17
push af
call ExitMenu
call Function321c
call UpdateSprites
pop af
ret
Function1c23:: ; 0x1c23
call Function1cfd
call Function1c30
call Function1d19
call Function1c30
ret
; 0x1c30

View File

@@ -79,6 +79,7 @@ DmgToCgbBGPals:: ; c9f
ld [rBGP], a
push af
; Don't need to be here if CGB
ld a, [hCGB]
and a
jr z, .end
@@ -89,7 +90,7 @@ DmgToCgbBGPals:: ; c9f
ld a, [rSVBK]
push af
ld a, 5
ld a, 5 ; gfx
ld [rSVBK], a
; copy & reorder bg pal buffer
@@ -165,16 +166,21 @@ DmgToCgbObjPals:: ; ccb
Functioncf8:: ; cf8
ld [rOBP0], a
push af
; Don't need to be here if CGB
ld a, [hCGB]
and a
jr z, .asm_d22
jr z, .done
push hl
push de
push bc
ld a, [rSVBK]
push af
ld a, $5
ld a, 5 ; gfx
ld [rSVBK], a
ld hl, OBPals
ld de, Unkn2Pals
ld a, [rOBP0]
@@ -183,13 +189,15 @@ Functioncf8:: ; cf8
call CopyPals
ld a, $1
ld [hCGBPalUpdate], a
pop af
ld [rSVBK], a
pop bc
pop de
pop hl
.asm_d22
.done
pop af
ret
; d24

View File

@@ -15,7 +15,7 @@ Serial:: ; 6ef
jr nz, .asm_721
ld a, [$ffcb]
inc a
inc a ; is it equal to -1?
jr z, .asm_726
ld a, [rSB]
@@ -334,7 +334,7 @@ Function87d:: ; 87d
Function8c1:: ; 8c1
push bc
ld b, $60
ld a, [InLinkBattle]
ld a, [wLinkMode]
cp $1
jr z, .asm_8d7
ld b, $60
@@ -391,7 +391,7 @@ Function908:: ; 908
; 919
Function919:: ; 919
ld a, [InLinkBattle]
ld a, [wLinkMode]
and a
ret nz
ld a, $2

File diff suppressed because it is too large Load Diff

View File

@@ -1,44 +1,79 @@
Function1c30:: ; 0x1c30
call Function1c53
BackUpTiles:: ; 1c00
callab _BackUpTiles
ret
; 1c07
ExitMenu:: ; 0x1c07
push af
callab Function243e8
pop af
ret
Function1c10:: ; 0x1c10
callab Function2446d
ret
WriteBackup:: ; 0x1c17
push af
call ExitMenu
call Function321c
call UpdateSprites
pop af
ret
RestoreTileBackup:: ; 0x1c23
call GetMemTileCoord
call .copy
call GetMemAttrCoord
call .copy
ret
; 0x1c30
.copy: ; 0x1c30
call GetMenuBoxDims
inc b
inc c
.asm_1c35
.row
push bc
push hl
.asm_1c37
.col
ld a, [de]
ld [hli], a
dec de
dec c
jr nz, .asm_1c37 ; 0x1c3b $fa
jr nz, .col ; 0x1c3b $fa
pop hl
ld bc, $0014
ld bc, SCREEN_WIDTH
add hl, bc
pop bc
dec b
jr nz, .asm_1c35 ; 0x1c44 $ef
jr nz, .row ; 0x1c44 $ef
ret
Function1c47:: ; 0x1c47
ld b, $10
ld de, wcf81
.asm_1c4c
.loop
ld a, [hld]
ld [de], a
inc de
dec b
jr nz, .asm_1c4c ; 0x1c50 $fa
jr nz, .loop ; 0x1c50 $fa
ret
Function1c53:: ; 0x1c53
ld a, [wcf82]
GetMenuBoxDims:: ; 0x1c53
ld a, [wMenuBorderTopCoord] ; top
ld b, a
ld a, [wcf84]
ld a, [wMenuBorderBottomCoord] ; bottom
sub b
ld b, a
ld a, [wcf83]
ld a, [wMenuBorderLeftCoord] ; left
ld c, a
ld a, [wcf85]
ld a, [wMenuBorderRightCoord] ; right
sub c
ld c, a
ret
@@ -99,7 +134,7 @@ Function1c89:: ; 1c89
ld a, [wcf91]
bit 4, a
ret z
call Function1cfd
call GetMemTileCoord
ld a, [de]
ld c, a
inc de
@@ -109,18 +144,18 @@ Function1c89:: ; 1c89
; 1cbb
Function1cbb:: ; 1cbb
call Function1cfd
call Function1c53
call GetMemTileCoord
call GetMenuBoxDims
dec b
dec c
jp TextBox
; 1cc6
Function1cc6:: ; 1cc6
ld a, [wcf82]
ld a, [wMenuBorderTopCoord]
ld b, a
inc b
ld a, [wcf83]
ld a, [wMenuBorderLeftCoord]
ld c, a
inc c
ld a, [wcf91]
@@ -139,10 +174,10 @@ Function1cc6:: ; 1cc6
; 1ce1
Function1ce1:: ; 1ce1
call Function1cfd
call GetMemTileCoord
ld bc, $0015
add hl, bc
call Function1c53
call GetMenuBoxDims
dec b
dec c
call ClearBox
@@ -150,8 +185,8 @@ Function1ce1:: ; 1ce1
; 1cf1
Function1cf1:: ; 1cf1
call Function1cfd
call Function1c53
call GetMemTileCoord
call GetMenuBoxDims
inc c
inc b
call ClearBox
@@ -159,10 +194,10 @@ Function1cf1:: ; 1cf1
; 1cfd
Function1cfd:: ; 1cfd
ld a, [wcf83]
GetMemTileCoord:: ; 1cfd
ld a, [wMenuBorderLeftCoord]
ld c, a
ld a, [wcf82]
ld a, [wMenuBorderTopCoord]
ld b, a
; 1d05
@@ -191,10 +226,10 @@ endr
ret
; 1d19
Function1d19:: ; 1d19
ld a, [wcf83]
GetMemAttrCoord:: ; 1d19
ld a, [wMenuBorderLeftCoord]
ld c, a
ld a, [wcf82]
ld a, [wMenuBorderTopCoord]
ld b, a
GetAttrCoord:: ; 1d21

View File

@@ -3,7 +3,7 @@
AskTimer:: ; 591
push af
ld a, [$ffe9]
ld a, [hMobile]
and a
jr z, .asm_59a
call Timer

View File

@@ -146,7 +146,7 @@ VBlank0:: ; 2b1
rst Bankswitch
ld a, [hSeconds]
ld [$ffe3], a
ld [hSecondsBackup], a
ret
; 325

View File

@@ -1,6 +1,6 @@
ResetWindow:: ; 2dba
call Function1fbf
call ResetTextRelatedRAM
ld a, [hROMBank]
push af
ld a, BANK(Function6454) ; and BANK(Function64bf)
@@ -16,12 +16,14 @@ ResetWindow:: ; 2dba
; 2dcf
Function2dcf:: ; 2dcf
LoadMoveSprites:: ; 2dcf
ld a, [hOAMUpdate]
push af
ld a, $1
ld [hOAMUpdate], a
call Function2de2
pop af
ld [hOAMUpdate], a
ld hl, VramState
@@ -30,7 +32,7 @@ Function2dcf:: ; 2dcf
; 2de2
Function2de2:: ; 2de2
call Function1fbf
call ResetTextRelatedRAM
xor a
ld [hBGMapMode], a
call Function2173
@@ -46,8 +48,8 @@ Function2de2:: ; 2de2
ret
; 2e08
Function2e08:: ; 2e08
call Function1fbf
LoadFont:: ; 2e08
call ResetTextRelatedRAM
ld a, [hROMBank]
push af
ld a, BANK(Function6454) ; and BANK(Function64bf)
@@ -68,7 +70,9 @@ Function2e20:: ; 2e20
push af
ld a, $1
ld [hOAMUpdate], a
callba Function104110
pop af
ld [hOAMUpdate], a
ret