ref: d08199c79d8168368aeac0381427d533e09f073d
parent: 630d789c70fcd2b87336caf4762be2012790d4a8
author: PikalaxALT <[email protected]>
date: Tue Dec 22 13:03:00 EST 2015
Color fns, some more address decoding in link/mobile
--- a/constants/cgb_constants.asm
+++ b/constants/cgb_constants.asm
@@ -8,7 +8,7 @@
const SCGB_06
const SCGB_07
const SCGB_08
- const SCGB_09
+ const SCGB_MAPPALS
const SCGB_0A
const SCGB_0B
const SCGB_0C
@@ -19,7 +19,7 @@
const SCGB_11
const SCGB_12
const SCGB_13
- const SCGB_14
+ const SCGB_PACKPALS
const SCGB_15
const SCGB_16
const SCGB_17
@@ -27,7 +27,7 @@
const SCGB_19
const SCGB_1A
const SCGB_1B
- const SCGB_1C
+ const SCGB_FRONTPICPALS
const SCGB_1D
const SCGB_1E
--- a/constants/trainer_constants.asm
+++ b/constants/trainer_constants.asm
@@ -1,5 +1,6 @@
; trainer groups
enum_start
+CHRIS EQU __enum__
trainerclass TRAINER_NONE ; 0
const PHONECONTACT_MOM
const PHONECONTACT_BIKESHOP
@@ -7,6 +8,7 @@
const PHONECONTACT_ELM
const PHONECONTACT_BUENA
+KRIS EQU __enum__
trainerclass FALKNER ; 1
trainerclass WHITNEY ; 2
--- a/engine/color.asm
+++ b/engine/color.asm
@@ -88,20 +88,20 @@
push de
push bc
ld hl, PalPacket_9ce6
- ld de, wcda9
+ ld de, wSGBPals
ld bc, PALPACKET_LENGTH
call CopyBytes
pop bc
pop de
ld a, c
- ld [wcda9 + 3], a
+ ld [wSGBPals + 3], a
ld a, b
- ld [wcda9 + 4], a
+ ld [wSGBPals + 4], a
ld a, e
- ld [wcda9 + 5], a
+ ld [wSGBPals + 5], a
ld a, d
- ld [wcda9 + 6], a
- ld hl, wcda9
+ ld [wSGBPals + 6], a
+ ld hl, wSGBPals
call Function9809
ld hl, BlkPacket_9a86
call Function9809
@@ -119,7 +119,7 @@
Function8ade: ; 8ade SGB layout $fc
ld hl, wcd9b
- ld a, [wcda9]
+ ld a, [wSGBPals]
ld e, a
ld d, $0
add hl, de
@@ -128,17 +128,16 @@
ld a, [de]
and a
ld e, $5
- jr z, .asm_8af7
+ jr z, .okay
dec a
ld e, $a
- jr z, .asm_8af7
+ jr z, .okay
ld e, $f
-
-.asm_8af7
+.okay
push de
- ld hl, wcda9 + 10
+ ld hl, wSGBPals + 10
ld bc, $6
- ld a, [wcda9]
+ ld a, [wSGBPals]
call AddNTimes
pop de
ld [hl], e
@@ -204,7 +203,7 @@
.asm_8b5c
ld de, UnknOBPals
ld a, $3b
- call GetAthPalletFromPalettes9df6
+ call GetPredefPal
jp LoadHLPaletteIntoDE
; 8b67
@@ -220,7 +219,7 @@
.asm_8b76
ld de, UnknOBPals
ld a, $3c
- call GetAthPalletFromPalettes9df6
+ call GetPredefPal
jp LoadHLPaletteIntoDE
; 8b81
@@ -233,20 +232,20 @@
ld a, c
push af
ld hl, PalPacket_9ce6
- ld de, wcda9
+ ld de, wSGBPals
ld bc, PALPACKET_LENGTH
call CopyBytes
pop af
call GetMonPalettePointer_
ld a, [hli]
- ld [wcda9 + 3], a
+ ld [wSGBPals + 3], a
ld a, [hli]
- ld [wcda9 + 4], a
+ ld [wSGBPals + 4], a
ld a, [hli]
- ld [wcda9 + 5], a
+ ld [wSGBPals + 5], a
ld a, [hl]
- ld [wcda9 + 6], a
- ld hl, wcda9
+ ld [wSGBPals + 6], a
+ ld hl, wSGBPals
jp Function9809
.asm_8bb2
@@ -438,7 +437,7 @@
jr nz, .asm_8cf0
push hl
ld hl, PalPacket_9ce6
- ld de, wcda9
+ ld de, wSGBPals
ld bc, PALPACKET_LENGTH
call CopyBytes
pop hl
@@ -446,14 +445,14 @@
inc hl
endr
ld a, [hli]
- ld [wcda9 + 3], a
+ ld [wSGBPals + 3], a
ld a, [hli]
- ld [wcda9 + 4], a
+ ld [wSGBPals + 4], a
ld a, [hli]
- ld [wcda9 + 5], a
+ ld [wSGBPals + 5], a
ld a, [hli]
- ld [wcda9 + 6], a
- ld hl, wcda9
+ ld [wSGBPals + 6], a
+ ld hl, wSGBPals
call Function9809
ld hl, BlkPacket_9a86
call Function9809
@@ -556,7 +555,7 @@
push bc
ld a, [hli]
push hl
- call GetAthPalletFromPalettes9df6
+ call GetPredefPal
call LoadHLPaletteIntoDE
pop hl
inc hl
@@ -566,7 +565,7 @@
ret
; 9625
-GetAthPalletFromPalettes9df6: ; 9625
+GetPredefPal: ; 9625
ld l, a
ld h, $0
rept 3 ; multiply by 8
@@ -737,7 +736,7 @@
Function96f3: ; 96f3 CGB layout $fc
ld hl, wcd9b
- ld a, [wcda9]
+ ld a, [wSGBPals]
ld e, a
ld d, $0
add hl, de
@@ -748,7 +747,7 @@
ld e, a
hlcoord 11, 2, AttrMap
ld bc, $28
- ld a, [wcda9]
+ ld a, [wSGBPals]
.asm_970b
and a
jr z, .asm_9712
@@ -892,10 +891,10 @@
ld a, $90
ld [rOBPI], a
ld a, $1c
- call GetAthPalletFromPalettes9df6
+ call GetPredefPal
call Function97e5
ld a, $21
- call GetAthPalletFromPalettes9df6
+ call GetPredefPal
call Function97e5
ret
; 97e5
@@ -1956,15 +1955,15 @@
INCLUDE "gfx/trainers/palette_pointers.asm"
; b1de
-Functionb1de: ; b1de
+LoadMapPals: ; b1de
callba LoadSpecialMapPalette
- jr c, .asm_b230
+ jr c, .got_pals
ld a, [wPermission]
and 7
ld e, a
ld d, 0
- ld hl, Unknown_b279
+ ld hl, .TilesetColorsPointers
rept 2
add hl, de
endr
@@ -1986,8 +1985,8 @@
ld a, $5
ld [rSVBK], a
ld hl, UnknBGPals
- ld b, $8
-.asm_b210
+ ld b, 8
+.outer_loop
ld a, [de]
push de
push hl
@@ -2001,37 +2000,37 @@
ld e, l
ld d, h
pop hl
- ld c, 8
-.asm_b222
+ ld c, 1 palettes
+.inner_loop
ld a, [de]
inc de
ld [hli], a
dec c
- jr nz, .asm_b222
+ jr nz, .inner_loop
pop de
inc de
dec b
- jr nz, .asm_b210
+ jr nz, .outer_loop
pop af
ld [rSVBK], a
-.asm_b230
+.got_pals
ld a, [TimeOfDayPal]
and 3
- ld bc, $40
+ ld bc, 8 palettes
ld hl, MapObjectPals
call AddNTimes
ld de, UnknOBPals
- ld bc, $40
+ ld bc, 8 palettes
ld a, $5 ; BANK(UnknOBPals)
call FarCopyWRAM
ld a, [wPermission]
- cp 1
- jr z, .asm_b253
- cp 2
+ cp TOWN
+ jr z, .outside
+ cp ROUTE
ret nz
-.asm_b253
+.outside
ld a, [MapGroup]
ld l, a
ld h, 0
@@ -2043,12 +2042,12 @@
ld a, [TimeOfDayPal]
and 3
cp NITE
- jr c, .asm_b26d
+ jr c, .morn_day
rept 4
inc hl
endr
-.asm_b26d
- ld de, UnknBGPals + 8 * 6 + 2
+.morn_day
+ ld de, UnknBGPals + 6 palettes + 2
ld bc, 4
ld a, $5
call FarCopyWRAM
@@ -2055,7 +2054,7 @@
ret
; b279
-Unknown_b279: ; b279
+.TilesetColorsPointers: ; b279
dw TilesetColors1
dw TilesetColors1
dw TilesetColors1
--- a/engine/debug.asm
+++ b/engine/debug.asm
@@ -542,7 +542,7 @@
ret
.asm_81c69
- ld hl, wcda9
+ ld hl, wSGBPals
ld a, $1
ld [hli], a
ld a, $ff
@@ -562,7 +562,7 @@
ld [hli], a
endr
ld [hl], a
- ld hl, wcda9
+ ld hl, wSGBPals
call Function81f0c
hlcoord 10, 2
ld de, wc608
--- a/engine/intro_menu.asm
+++ b/engine/intro_menu.asm
@@ -685,7 +685,7 @@
ld [TrainerClass], a
call Intro_PrepTrainerPic
- ld b, SCGB_1C
+ ld b, SCGB_FRONTPICPALS
call GetSGBLayout
call Intro_RotatePalettesLeftFrontpic
@@ -706,7 +706,7 @@
ld [TempMonDVs], a
ld [TempMonDVs + 1], a
- ld b, SCGB_1C
+ ld b, SCGB_FRONTPICPALS
call GetSGBLayout
call Intro_WipeInFrontpic
@@ -723,7 +723,7 @@
ld [TrainerClass], a
call Intro_PrepTrainerPic
- ld b, SCGB_1C
+ ld b, SCGB_FRONTPICPALS
call GetSGBLayout
call Intro_RotatePalettesLeftFrontpic
@@ -736,7 +736,7 @@
ld [CurPartySpecies], a
callba DrawIntroPlayerPic
- ld b, SCGB_1C
+ ld b, SCGB_FRONTPICPALS
call GetSGBLayout
call Intro_RotatePalettesLeftFrontpic
@@ -806,7 +806,7 @@
ld [CurPartySpecies], a
callba DrawIntroPlayerPic
- ld b, SCGB_1C
+ ld b, SCGB_FRONTPICPALS
call GetSGBLayout
call RotateThreePalettesLeft
--- a/engine/link.asm
+++ b/engine/link.asm
@@ -14,7 +14,7 @@
call UpdateSprites
call LoadStandardFont
call LoadFontsBattleExtra
- callba Function16d69a
+ callba LinkComms_LoadPleaseWaitTextboxBorderGFX
call WaitBGMap2
hlcoord 3, 8
ld b, 2
@@ -21,7 +21,7 @@
ld c, 12
ld d, h
ld e, l
- callba Function4d35b
+ callba LinkTextbox2
hlcoord 4, 10
ld de, String_PleaseWait
call PlaceString
@@ -38,7 +38,7 @@
TimeCapsule: ; 2805d
call ClearLinkData
call Link_PrepPartyData_Gen1
- call Function28434
+ call FixDataForLinkTransfer
xor a
ld [wPlayerLinkAction], a
call Function87d
@@ -45,7 +45,7 @@
ld a, [hLinkPlayerNumber]
cp $2
jr nz, .player_1
- ld c, $3
+ ld c, 3
call DelayFrames
xor a
ld [hSerialSend], a
@@ -90,7 +90,7 @@
ld [rIF], a
ld a, $1d
ld [rIE], a
- call Function287ab
+ call Link_CopyRandomNumbers
ld hl, OTPlayerName
call Link_FindFirstNonControlCharacter_SkipZero
push hl
@@ -180,7 +180,7 @@
Gen2ToGen2LinkComms: ; 28177
call ClearLinkData
call Link_PrepPartyData_Gen2
- call Function28434
+ call FixDataForLinkTransfer
call Function29dba
ld a, [ScriptVar]
and a
@@ -187,7 +187,7 @@
jp z, Function283b2
ld a, [hLinkPlayerNumber]
cp $2
- jr nz, .Player2
+ jr nz, .Player1
ld c, 3
call DelayFrames
xor a
@@ -204,7 +204,7 @@
ld a, $81
ld [rSC], a
-.Player2
+.Player1
ld de, MUSIC_NONE
call PlayMusic
ld c, 3
@@ -231,13 +231,13 @@
call Function75f
ld a, [wLinkMode]
cp LINK_TRADECENTER
- jr nz, .asm_281fd
+ jr nz, .not_trading
ld hl, wc9f4
ld de, wcb84
ld bc, $186
call Function283f2
-.asm_281fd
+.not_trading
xor a
ld [rIF], a
ld a, $1d
@@ -244,7 +244,7 @@
ld [rIE], a
ld de, MUSIC_NONE
call PlayMusic
- call Function287ab
+ call Link_CopyRandomNumbers
ld hl, OTPlayerName
call Link_FindFirstNonControlCharacter_SkipZero
ld de, wLinkData
@@ -253,17 +253,17 @@
ld de, wPlayerTrademonSpecies
ld hl, wLinkPlayerPartyMon1Species
ld c, $2
-.asm_28224
+.loop1
ld a, [de]
inc de
and a
- jr z, .asm_28224
+ jr z, .loop1
cp $fd
- jr z, .asm_28224
+ jr z, .loop1
cp $fe
- jr z, .asm_28224
+ jr z, .loop1
cp $ff
- jr z, .asm_28243
+ jr z, .next1
push hl
push bc
ld b, $0
@@ -274,50 +274,49 @@
ld [hl], a
pop bc
pop hl
- jr .asm_28224
+ jr .loop1
-.asm_28243
+.next1
ld hl, wc90f
dec c
- jr nz, .asm_28224
+ jr nz, .loop1
ld a, [wLinkMode]
cp LINK_TRADECENTER
- jp nz, .asm_282fe
+ jp nz, .skip_mail
ld hl, wcb84
-.asm_28254
+.loop2
ld a, [hli]
cp $20
- jr nz, .asm_28254
-.asm_28259
+ jr nz, .loop2
+.loop3
ld a, [hli]
cp $fe
- jr z, .asm_28259
+ jr z, .loop3
cp $20
- jr z, .asm_28259
+ jr z, .loop3
dec hl
ld de, wcb84
- ld bc, $190
+ ld bc, $190 ; 400
call CopyBytes
ld hl, wcb84
- ld bc, $c6
-.asm_28272
+ ld bc, $c6 ; 198
+.loop4
ld a, [hl]
cp $21
- jr nz, .asm_28279
+ jr nz, .okay1
ld [hl], $fe
-
-.asm_28279
+.okay1
inc hl
dec bc
ld a, b
or c
- jr nz, .asm_28272
+ jr nz, .loop4
ld de, wcc9e
-.asm_28282
+.loop5
ld a, [de]
inc de
cp $ff
- jr z, .asm_28294
+ jr z, .start_copying_mail
ld hl, wcc4a
dec a
ld b, $0
@@ -324,43 +323,43 @@
ld c, a
add hl, bc
ld [hl], $fe
- jr .asm_28282
+ jr .loop5
-.asm_28294
+.start_copying_mail
ld hl, wcb84
ld de, wc9f4
- ld b, $6
-.asm_2829c
+ ld b, PARTY_LENGTH
+.copy_mail_loop
push bc
- ld bc, $21
+ ld bc, MAIL_MSG_LENGTH + 1
call CopyBytes
- ld a, $e
+ ld a, (MAIL_STRUCT_LENGTH - (MAIL_MSG_LENGTH + 1)) % $100
add e
ld e, a
- ld a, $0
+ ld a, (MAIL_STRUCT_LENGTH - (MAIL_MSG_LENGTH + 1)) / $100
adc d
ld d, a
pop bc
dec b
- jr nz, .asm_2829c
+ jr nz, .copy_mail_loop
ld de, wc9f4
- ld b, $6
-.asm_282b4
+ ld b, PARTY_LENGTH
+.copy_author_loop
push bc
- ld a, $21
+ ld a, (MAIL_MSG_LENGTH + 1) % $100
add e
ld e, a
- ld a, $0
+ ld a, (MAIL_MSG_LENGTH + 1) / $100
adc d
ld d, a
- ld bc, $e
+ ld bc, MAIL_STRUCT_LENGTH - (MAIL_MSG_LENGTH + 1)
call CopyBytes
pop bc
dec b
- jr nz, .asm_282b4
- ld b, $6
+ jr nz, .copy_author_loop
+ ld b, PARTY_LENGTH
ld de, wc9f4
-.asm_282cc
+.fix_mail_loop
push bc
push de
callba IsMailEuropean
@@ -385,12 +384,12 @@
ld e, l
pop bc
dec b
- jr nz, .asm_282cc
+ jr nz, .fix_mail_loop
ld de, wcb0e
xor a
ld [de], a
-.asm_282fe
+.skip_mail
ld hl, wLinkData
ld de, OTPlayerName
ld bc, NAME_LENGTH
@@ -416,7 +415,7 @@
call z, DelayFrames
ld a, [wLinkMode]
cp LINK_COLOSSEUM
- jr nz, .asm_283a9
+ jr nz, .ready_to_trade
ld a, CAL
ld [OtherTrainerClass], a
call ClearScreen
@@ -463,7 +462,7 @@
callba LoadPokemonData
jp Function28b22
-.asm_283a9
+.ready_to_trade
ld de, MUSIC_ROUTE_30
call PlayMusic
jp InitTradeMenuDisplay
@@ -488,7 +487,7 @@
push de
ld d, h
ld e, l
- callba Function4d35b
+ callba LinkTextbox2
pop de
pop hl
bccoord 1, 14
@@ -510,7 +509,7 @@
Function283f2: ; 283f2
ld a, $1
ld [hFFCC], a
-.asm_283f6
+.loop
ld a, [hl]
ld [hSerialSend], a
call Function78a
@@ -518,26 +517,26 @@
ld b, a
inc hl
ld a, $30
-.asm_28401
+.delay_cycles
dec a
- jr nz, .asm_28401
+ jr nz, .delay_cycles
ld a, [hFFCC]
and a
ld a, b
pop bc
- jr z, .asm_28411
+ jr z, .load
dec hl
xor a
ld [hFFCC], a
- jr .asm_283f6
+ jr .loop
-.asm_28411
+.load
ld [de], a
inc de
dec bc
ld a, b
or c
- jr nz, .asm_283f6
+ jr nz, .loop
ret
; 28419
@@ -558,15 +557,15 @@
ret
; 28434
-Function28434: ; 28434
+FixDataForLinkTransfer: ; 28434
ld hl, wd1f3
ld a, $fd
- ld b, 7
+ ld b, LinkBattleRNs - wd1f3
.loop1
ld [hli], a
dec b
jr nz, .loop1
- ld b, 10
+ ld b, TempEnemyMonSpecies - LinkBattleRNs
.loop2
call Random
cp $fd
@@ -579,14 +578,14 @@
rept 3
ld [hli], a
endr
- ld b, $c8
+ ld b, wc6d3 - (wMisc + 3)
xor a
.loop3
ld [hli], a
dec b
jr nz, .loop3
- ld hl, wc818
- ld de, wMisc + 10
+ ld hl, wTimeCapsulePartyMon1 - 1 + 6
+ ld de, wc612
lb bc, 0, 0
.loop4
inc c
@@ -602,13 +601,11 @@
ld b, $d
jr z, .got_value
ld b, $27
-
.got_value
ld a, c
cp b
pop bc
jr z, .done
-
.next2
inc hl
ld a, [hl]
@@ -1163,7 +1160,7 @@
ret
; 287ab
-Function287ab: ; 287ab
+Link_CopyRandomNumbers: ; 287ab
ld a, [hLinkPlayerNumber]
cp $2
ret z
@@ -2161,8 +2158,8 @@
ret
; 29c92
-Special_AbortLink: ; 29c92
- ld c, $3
+WaitForOtherPlayerToExit: ; 29c92
+ ld c, 3
call DelayFrames
ld a, -1
ld [hLinkPlayerNumber], a
@@ -2173,7 +2170,7 @@
ld [rSC], a
ld a, $81
ld [rSC], a
- ld c, $3
+ ld c, 3
call DelayFrames
xor a
ld [rSB], a
@@ -2188,7 +2185,7 @@
ld [rSB], a
ld [hSerialReceive], a
ld [rSC], a
- ld c, $3
+ ld c, 3
call DelayFrames
ld a, -1
ld [hLinkPlayerNumber], a
@@ -2348,16 +2345,16 @@
call Function29e0c
ld a, [ScriptVar]
and a
- jr z, .asm_29e08
+ jr z, .vblank
ld bc, -1
-.asm_29de0
+.wait
dec bc
ld a, b
or c
- jr nz, .asm_29de0
+ jr nz, .wait
ld a, [wOtherPlayerLinkMode]
cp $5
- jr nz, .asm_29e03
+ jr nz, .script_var
ld a, $6
ld [wPlayerLinkAction], a
ld hl, wcf5b
@@ -2367,14 +2364,14 @@
call Function29e0c
ld a, [wOtherPlayerLinkMode]
cp $6
- jr z, .asm_29e08
+ jr z, .vblank
-.asm_29e03
+.script_var
xor a
ld [ScriptVar], a
ret
-.asm_29e08
+.vblank
xor a
ld [hVBlank], a
ret
--- a/engine/link_trade.asm
+++ b/engine/link_trade.asm
@@ -1,7 +1,11 @@
+LinkCommsBorderGFX:
+INCBIN "gfx/unknown/16cfc1.2bpp"
+; 16d421
+
__LoadTradeScreenBorder: ; 16d421
- ld de, GFX_16cfc1
+ ld de, LinkCommsBorderGFX
ld hl, VTiles2
- lb bc, BANK(GFX_16cfc1), 70
+ lb bc, BANK(LinkCommsBorderGFX), 70
call Get2bpp
ret
; 16d42e
@@ -55,19 +59,19 @@
inc c
inc c
ld a, $7
-.loop
+.row
push bc
push hl
-.loop2
+.col
ld [hli], a
dec c
- jr nz, .loop2
+ jr nz, .col
pop hl
ld de, SCREEN_WIDTH
add hl, de
pop bc
dec b
- jr nz, .loop
+ jr nz, .row
ret
; 16d640
@@ -82,7 +86,7 @@
pop hl
ld de, SCREEN_WIDTH
add hl, de
-.loop3
+.loop
push hl
ld a, $33
ld [hli], a
@@ -93,7 +97,7 @@
ld de, SCREEN_WIDTH
add hl, de
dec b
- jr nz, .loop3
+ jr nz, .loop
ld a, $35
ld [hli], a
@@ -133,10 +137,10 @@
; 16d69a
-Function16d69a: ; 16d69a
- ld de, GFX_16cfc1 + $300
+LinkComms_LoadPleaseWaitTextboxBorderGFX: ; 16d69a
+ ld de, LinkCommsBorderGFX + $30 tiles
ld hl, VTiles2 tile $76
- lb bc, BANK(GFX_16cfc1), 8
+ lb bc, BANK(LinkCommsBorderGFX), 8
call Get2bpp
ret
; 16d6a7
--- a/engine/pack.asm
+++ b/engine/pack.asm
@@ -1537,7 +1537,7 @@
Pack_InitColors: ; 10a40
call WaitBGMap
- ld b, SCGB_14
+ ld b, SCGB_PACKPALS
call GetSGBLayout
call SetPalettes
call DelayFrame
--- a/engine/party_menu.asm
+++ b/engine/party_menu.asm
@@ -125,7 +125,7 @@
PlacePartyHPBar: ; 500cf
xor a
- ld [wcda9], a
+ ld [wSGBPals], a
ld a, [PartyCount]
and a
ret z
@@ -144,7 +144,7 @@
ld b, $0
call DrawBattleHPBar
ld hl, wcd9b
- ld a, [wcda9]
+ ld a, [wSGBPals]
ld c, a
ld b, $0
add hl, bc
@@ -153,7 +153,7 @@
call GetSGBLayout
.skip
- ld hl, wcda9
+ ld hl, wSGBPals
inc [hl]
pop hl
ld de, 2 * SCREEN_WIDTH
--- a/engine/specials.asm
+++ b/engine/specials.asm
@@ -26,7 +26,7 @@
add_special Special_CheckBothSelectedSameRoom
add_special Special_FailedLinkToPast
add_special Special_CloseLink
- add_special Special_AbortLink
+ add_special WaitForOtherPlayerToExit
add_special Special_SetBitsForBattleRequest
add_special Special_SetBitsForTimeCapsuleRequest
add_special Special_CheckTimeCapsuleCompatibility
--- a/engine/time_capsule/conversion.asm
+++ b/engine/time_capsule/conversion.asm
@@ -384,7 +384,7 @@
ld [TempMonDVs], a
ld a, [hl]
ld [TempMonDVs + 1], a
- ld b, SCGB_1C
+ ld b, SCGB_FRONTPICPALS
call GetSGBLayout
call SetPalettes
ret
--- a/engine/timeofdaypals.asm
+++ b/engine/timeofdaypals.asm
@@ -65,7 +65,7 @@
; update sgb pals
- ld b, SCGB_09
+ ld b, SCGB_MAPPALS
call GetSGBLayout
--- a/engine/warp_connection.asm
+++ b/engine/warp_connection.asm
@@ -289,7 +289,7 @@
ld [hli], a
dec c
jr nz, .column
- ld bc, $20 - SCREEN_WIDTH
+ ld bc, BG_MAP_WIDTH - SCREEN_WIDTH
add hl, bc
pop bc
dec b
@@ -307,11 +307,11 @@
ld [hTileAnimFrame], a
callba RefreshSprites
call LoadFontsExtra
- callba Function106594
+ callba LoadOverworldFont
ret
LoadMapPalettes: ; 1047eb
- ld b, SCGB_09
+ ld b, SCGB_MAPPALS
jp GetSGBLayout
; 1047f0
@@ -329,7 +329,7 @@
call Function2e31
.skip
ld a, [wPlayerSpriteSetupFlags]
- and $1c
+ and %00011100
ld [wPlayerSpriteSetupFlags], a
ret
--- a/event/field_moves.asm
+++ b/event/field_moves.asm
@@ -12,7 +12,7 @@
set 2, [hl] ; Flash
callba ReplaceTimeOfDayPals
callba UpdateTimeOfDayPal
- ld b, SCGB_09
+ ld b, SCGB_MAPPALS
call GetSGBLayout
callba LoadOW_BGPal7
callba FadeInPalettes
--- a/event/magnet_train.asm
+++ b/event/magnet_train.asm
@@ -446,7 +446,7 @@
ld [TimeOfDayPal], a
ld a, $1
ld [wPermission], a
- ld b, SCGB_09
+ ld b, SCGB_MAPPALS
call GetSGBLayout
call UpdateTimePals
ld a, [rBGP]
--- a/event/photo.asm
+++ b/event/photo.asm
@@ -59,7 +59,7 @@
ld [TempMonDVs], a
ld [TempMonDVs + 1], a
- ld b, SCGB_1C
+ ld b, SCGB_FRONTPICPALS
call GetSGBLayout
call SetPalettes
--- a/home/map.asm
+++ b/home/map.asm
@@ -2002,7 +2002,7 @@
call UpdateSprites
call ret_d90
Function2b5c:: ; 2b5c
- ld b, SCGB_09
+ ld b, SCGB_MAPPALS
call GetSGBLayout
callba LoadOW_BGPal7
call WaitBGMap2
@@ -2025,7 +2025,7 @@
set 0, [hl]
call UpdateSprites
call WaitBGMap2
- ld b, SCGB_09
+ ld b, SCGB_MAPPALS
call GetSGBLayout
callba LoadOW_BGPal7
call UpdateTimePals
--- a/home/window.asm
+++ b/home/window.asm
@@ -44,7 +44,7 @@
ld [hWY], a
call ReplaceKrisSprite
callba ReturnFromMapSetupScript
- callba Function106594
+ callba LoadOverworldFont
ret
; 2e08
--- a/main.asm
+++ b/main.asm
@@ -2868,7 +2868,7 @@
callba Function561d
call DelayFrame
call ReplaceKrisSprite
- callba Function106594
+ callba LoadOverworldFont
ret
; cade
@@ -9674,10 +9674,10 @@
; 48e93
PackFGFXPointers: ; 48e93
- dw PackFGFX + $f0 * 1
- dw PackFGFX + $f0 * 3
- dw PackFGFX + $f0 * 0
- dw PackFGFX + $f0 * 2
+ dw PackFGFX + (15 tiles) * 1
+ dw PackFGFX + (15 tiles) * 3
+ dw PackFGFX + (15 tiles) * 0
+ dw PackFGFX + (15 tiles) * 2
; 48e9b
PackFGFX: ; 48e9b
@@ -9689,7 +9689,7 @@
call ClearBGPalettes
call ClearScreen
call DelayFrame
- ld b, SCGB_14
+ ld b, SCGB_PACKPALS
call GetSGBLayout
xor a
ld [wItemAttributeParamBuffer], a
@@ -10289,7 +10289,7 @@
ret
; 4d35b
-Function4d35b: ; 4d35b
+LinkTextbox2: ; 4d35b
ld h, d
ld l, e
push bc
@@ -14720,11 +14720,11 @@
; Draw the player pic at (6,4).
; Get class
- ld e, 0
+ ld e, CHRIS
ld a, [PlayerGender]
bit 0, a
jr z, .GotClass
- ld e, 1
+ ld e, KRIS
.GotClass
ld a, e
ld [TrainerClass], a
@@ -15310,6 +15310,8 @@
INCLUDE "event/mom_phone.asm"
+SECTION "bank40", ROMX, BANK[$40]
+
INCLUDE "misc/mobile_40.asm"
SECTION "bank41", ROMX, BANK[$41]
@@ -15323,6 +15325,8 @@
INCLUDE "battle/used_move_text.asm"
INCLUDE "misc/mobile_41.asm"
+
+SECTION "bank42", ROMX, BANK[$42]
INCLUDE "misc/mobile_42.asm"
--- a/maps/PokeCenter2F.asm
+++ b/maps/PokeCenter2F.asm
@@ -1,7 +1,7 @@
const_value set 2
- const POKECENTER2F_LINK_RECEPTIONIST1
- const POKECENTER2F_LINK_RECEPTIONIST2
- const POKECENTER2F_LINK_RECEPTIONIST3
+ const POKECENTER2F_TRADE_RECEPTIONIST
+ const POKECENTER2F_BATTLE_RECEPTIONIST
+ const POKECENTER2F_TIME_CAPSULE_RECEPTIONIST
const POKECENTER2F_OFFICER
PokeCenter2F_MapScriptHeader:
@@ -109,7 +109,7 @@
end
.FriendNotReady:
- special Special_AbortLink
+ special WaitForOtherPlayerToExit
writetext Text_FriendNotReady
closetext
end
@@ -134,7 +134,7 @@
.DidNotSave:
writetext Text_PleaseComeAgain
.AbortLink:
- special Special_AbortLink
+ special WaitForOtherPlayerToExit
.Cancel:
closetext
end
@@ -169,8 +169,8 @@
end
BattleTradeMobile_WalkIn:
- applymovement2 MovementData_0x192cce
- applymovement PLAYER, MovementData_0x192ce7
+ applymovement2 PokeCenter2FMobileMobileMovementData_ReceptionistWalksUpAndLeft_LookDown
+ applymovement PLAYER, PokeCenter2FMobileMovementData_PlayerWalksIntoMobileBattleRoom
end
LinkReceptionistScript_Battle:
@@ -211,7 +211,7 @@
end
.FriendNotReady:
- special Special_AbortLink
+ special WaitForOtherPlayerToExit
writetext Text_FriendNotReady
closetext
end
@@ -236,7 +236,7 @@
.DidNotSave:
writetext Text_PleaseComeAgain
.AbortLink:
- special Special_AbortLink
+ special WaitForOtherPlayerToExit
.Cancel:
closetext
end
@@ -344,7 +344,7 @@
end
.FriendNotReady:
- special Special_AbortLink
+ special WaitForOtherPlayerToExit
writetext Text_FriendNotReady
closetext
end
@@ -356,7 +356,7 @@
.DidNotSave:
writetext Text_PleaseComeAgain
.Cancel:
- special Special_AbortLink
+ special WaitForOtherPlayerToExit
closetext
end
@@ -376,8 +376,8 @@
end
Script_LeftCableTradeCenter:
- special Special_AbortLink
- scall Script_CleanUpFemaleFlagAfterTrade
+ special WaitForOtherPlayerToExit
+ scall Script_WalkOutOfLinkTradeRoom
dotrigger $0
domaptrigger TRADE_CENTER, $0
end
@@ -390,14 +390,14 @@
end
Script_WalkOutOfMobileTradeRoom:
- applymovement POKECENTER2F_LINK_RECEPTIONIST1, MovementData_0x192d0b
- applymovement PLAYER, MovementData_0x192d0f
- applymovement POKECENTER2F_LINK_RECEPTIONIST1, MovementData_0x192d14
+ applymovement POKECENTER2F_TRADE_RECEPTIONIST, PokeCenter2FMobileMovementData_ReceptionistWalksUpAndLeft
+ applymovement PLAYER, PokeCenter2FMovementData_PlayerWalksOutOfMobileRoom
+ applymovement POKECENTER2F_TRADE_RECEPTIONIST, PokeCenter2FMobileMovementData_ReceptionistWalksRightAndDown
end
Script_LeftCableColosseum:
- special Special_AbortLink
- scall Script_CleanUpFemaleFlagAfterBattle
+ special WaitForOtherPlayerToExit
+ scall Script_WalkOutOfLinkBattleRoom
dotrigger $0
domaptrigger COLOSSEUM, $0
end
@@ -410,26 +410,26 @@
end
Script_WalkOutOfMobileBattleRoom:
- applymovement POKECENTER2F_LINK_RECEPTIONIST2, MovementData_0x192d0b
- applymovement PLAYER, MovementData_0x192d0f
- applymovement POKECENTER2F_LINK_RECEPTIONIST2, MovementData_0x192d14
+ applymovement POKECENTER2F_BATTLE_RECEPTIONIST, PokeCenter2FMobileMovementData_ReceptionistWalksUpAndLeft
+ applymovement PLAYER, PokeCenter2FMovementData_PlayerWalksOutOfMobileRoom
+ applymovement POKECENTER2F_BATTLE_RECEPTIONIST, PokeCenter2FMobileMovementData_ReceptionistWalksRightAndDown
end
PokeCenter2F_CheckGender:
checkflag ENGINE_PLAYER_IS_FEMALE
iftrue .Female
- applymovement2 MovementData_0x192cca
- applymovement PLAYER, MovementData_0x192cde
+ applymovement2 PokeCenter2FMovementData_ReceptionistWalksUpAndLeft_LookRight
+ applymovement PLAYER, PokeCenter2FMovementData_PlayerTakesThreeStepsUp
end
.Female:
- applymovement2 MovementData_0x192cd8
- applymovement PLAYER, MovementData_0x192ce2
+ applymovement2 PokeCenter2FMovementData_ReceptionistWalksUpAndLeft_LookRight_2
+ applymovement PLAYER, PokeCenter2FMovementData_PlayerTakesTwoStepsUp
opentext
writetext Text_OhPleaseWait
waitbutton
closetext
- applymovement2 MovementData_0x192cdc
+ applymovement2 PokeCenter2FMovementData_ReceptionistLooksRight
spriteface PLAYER, LEFT
opentext
writetext Text_ChangeTheLook
@@ -436,10 +436,10 @@
waitbutton
closetext
playsound SFX_TINGLE
- applymovement PLAYER, MovementData_0x192d17
+ applymovement PLAYER, PokeCenter2FMovementData_PlayerSpinsClockwiseEndsFacingRight
writebyte (1 << 7) | (PAL_OW_RED << 4)
special Special_SetPlayerPalette
- applymovement PLAYER, MovementData_0x192d1c
+ applymovement PLAYER, PokeCenter2FMovementData_PlayerSpinsClockwiseEndsFacingLeft
setflag ENGINE_KRIS_IN_CABLE_CLUB
special ReplaceKrisSprite
opentext
@@ -447,51 +447,51 @@
waitbutton
closetext
showemote EMOTE_SHOCK, PLAYER, 15
- applymovement PLAYER, MovementData_0x192ce5
+ applymovement PLAYER, PokeCenter2FMovementData_PlayerTakesOneStepUp
end
-Script_CleanUpFemaleFlagAfterTrade:
+Script_WalkOutOfLinkTradeRoom:
checkflag ENGINE_KRIS_IN_CABLE_CLUB
iftrue .Female
- applymovement POKECENTER2F_LINK_RECEPTIONIST1, MovementData_0x192d04
- applymovement PLAYER, MovementData_0x192cf5
- applymovement POKECENTER2F_LINK_RECEPTIONIST1, MovementData_0x192cfe
+ applymovement POKECENTER2F_TRADE_RECEPTIONIST, PokeCenter2FMovementData_ReceptionistStepsRightLooksDown_3
+ applymovement PLAYER, PokeCenter2FMovementData_PlayerTakesThreeStepsDown
+ applymovement POKECENTER2F_TRADE_RECEPTIONIST, PokeCenter2FMovementData_ReceptionistStepsRightAndDown
end
.Female:
- applymovement POKECENTER2F_LINK_RECEPTIONIST1, MovementData_0x192d04
- applymovement PLAYER, MovementData_0x192d28
+ applymovement POKECENTER2F_TRADE_RECEPTIONIST, PokeCenter2FMovementData_ReceptionistStepsRightLooksDown_3
+ applymovement PLAYER, PokeCenter2FMovementData_PlayerTakesOneStepDown_2
clearflag ENGINE_KRIS_IN_CABLE_CLUB
playsound SFX_TINGLE
- applymovement PLAYER, MovementData_0x192d17
+ applymovement PLAYER, PokeCenter2FMovementData_PlayerSpinsClockwiseEndsFacingRight
writebyte (1 << 7) | (PAL_OW_BLUE << 4)
special Special_SetPlayerPalette
- applymovement PLAYER, MovementData_0x192d1c
+ applymovement PLAYER, PokeCenter2FMovementData_PlayerSpinsClockwiseEndsFacingLeft
special ReplaceKrisSprite
- applymovement PLAYER, MovementData_0x192d2a
- applymovement POKECENTER2F_LINK_RECEPTIONIST1, MovementData_0x192cfe
+ applymovement PLAYER, PokeCenter2FMovementData_PlayerTakesTwoStepsDown_2
+ applymovement POKECENTER2F_TRADE_RECEPTIONIST, PokeCenter2FMovementData_ReceptionistStepsRightAndDown
end
-Script_CleanUpFemaleFlagAfterBattle:
+Script_WalkOutOfLinkBattleRoom:
checkflag ENGINE_KRIS_IN_CABLE_CLUB
iftrue .Female
- applymovement POKECENTER2F_LINK_RECEPTIONIST2, MovementData_0x192d04
- applymovement PLAYER, MovementData_0x192cf5
- applymovement POKECENTER2F_LINK_RECEPTIONIST2, MovementData_0x192cfe
+ applymovement POKECENTER2F_BATTLE_RECEPTIONIST, PokeCenter2FMovementData_ReceptionistStepsRightLooksDown_3
+ applymovement PLAYER, PokeCenter2FMovementData_PlayerTakesThreeStepsDown
+ applymovement POKECENTER2F_BATTLE_RECEPTIONIST, PokeCenter2FMovementData_ReceptionistStepsRightAndDown
end
.Female:
- applymovement POKECENTER2F_LINK_RECEPTIONIST2, MovementData_0x192d04
- applymovement PLAYER, MovementData_0x192d28
+ applymovement POKECENTER2F_BATTLE_RECEPTIONIST, PokeCenter2FMovementData_ReceptionistStepsRightLooksDown_3
+ applymovement PLAYER, PokeCenter2FMovementData_PlayerTakesOneStepDown_2
clearflag ENGINE_KRIS_IN_CABLE_CLUB
playsound SFX_TINGLE
- applymovement PLAYER, MovementData_0x192d17
+ applymovement PLAYER, PokeCenter2FMovementData_PlayerSpinsClockwiseEndsFacingRight
writebyte (1 << 7) | (PAL_OW_BLUE << 4)
special Special_SetPlayerPalette
- applymovement PLAYER, MovementData_0x192d1c
+ applymovement PLAYER, PokeCenter2FMovementData_PlayerSpinsClockwiseEndsFacingLeft
special ReplaceKrisSprite
- applymovement PLAYER, MovementData_0x192d2a
- applymovement POKECENTER2F_LINK_RECEPTIONIST2, MovementData_0x192cfe
+ applymovement PLAYER, PokeCenter2FMovementData_PlayerTakesTwoStepsDown_2
+ applymovement POKECENTER2F_BATTLE_RECEPTIONIST, PokeCenter2FMovementData_ReceptionistStepsRightAndDown
end
TimeCapsuleScript_CheckPlayerGender:
@@ -500,18 +500,18 @@
checkcode VAR_FACING
if_equal LEFT, .MaleFacingLeft
if_equal RIGHT, .MaleFacingRight
- applymovement2 MovementData_0x192cd2
- applymovement PLAYER, MovementData_0x192cec
+ applymovement2 PokeCenter2FMovementData_ReceptionistStepsLeftLooksDown
+ applymovement PLAYER, PokeCenter2FMovementData_PlayerTakesTwoStepsUp_2
end
.MaleFacingLeft:
- applymovement2 MovementData_0x192cd2
- applymovement PLAYER, MovementData_0x192cef
+ applymovement2 PokeCenter2FMovementData_ReceptionistStepsLeftLooksDown
+ applymovement PLAYER, PokeCenter2FMovementData_PlayerWalksLeftAndUp
end
.MaleFacingRight:
- applymovement2 MovementData_0x192cd5
- applymovement PLAYER, MovementData_0x192cf2
+ applymovement2 PokeCenter2FMovementData_ReceptionistStepsRightLooksDown
+ applymovement PLAYER, PokeCenter2FMovementData_PlayerWalksRightAndUp
end
.Female:
@@ -518,18 +518,18 @@
checkcode VAR_FACING
if_equal RIGHT, .FemaleFacingRight
if_equal LEFT, .FemaleFacingLeft
- applymovement2 MovementData_0x192d33
- applymovement PLAYER, MovementData_0x192d2d
+ applymovement2 PokeCenter2FMovementData_ReceptionistStepsLeftLooksRight_2
+ applymovement PLAYER, PokeCenter2FMovementData_PlayerTakesOneStepUp_2
jump .FemaleContinue
.FemaleFacingRight:
- applymovement2 MovementData_0x192d36
- applymovement PLAYER, MovementData_0x192d2f
+ applymovement2 PokeCenter2FMovementData_ReceptionistStepsRightLooksLeft_2
+ applymovement PLAYER, PokeCenter2FMovementData_PlayerTakesOneStepRight
jump .FemaleContinue
.FemaleFacingLeft:
- applymovement2 MovementData_0x192d33
- applymovement PLAYER, MovementData_0x192d31
+ applymovement2 PokeCenter2FMovementData_ReceptionistStepsLeftLooksRight_2
+ applymovement PLAYER, PokeCenter2FMovementData_PlayerTakesOneStepLeft
.FemaleContinue:
opentext
writetext Text_OhPleaseWait
@@ -544,11 +544,11 @@
waitbutton
closetext
playsound SFX_TINGLE
- applymovement PLAYER, MovementData_0x192d17
+ applymovement PLAYER, PokeCenter2FMovementData_PlayerSpinsClockwiseEndsFacingRight
writebyte (1 << 7) | (PAL_OW_RED << 4)
special Special_SetPlayerPalette
- applymovement PLAYER, MovementData_0x192d22
- faceperson PLAYER, POKECENTER2F_LINK_RECEPTIONIST3
+ applymovement PLAYER, PokeCenter2FMovementData_PlayerSpinsClockwiseEndsFacingDown
+ faceperson PLAYER, POKECENTER2F_TIME_CAPSULE_RECEPTIONIST
setflag ENGINE_KRIS_IN_CABLE_CLUB
special ReplaceKrisSprite
opentext
@@ -556,30 +556,30 @@
waitbutton
closetext
showemote EMOTE_SHOCK, PLAYER, 15
- applymovement PLAYER, MovementData_0x192d2d
+ applymovement PLAYER, PokeCenter2FMovementData_PlayerTakesOneStepUp_2
end
Script_LeftTimeCapsule:
- special Special_AbortLink
+ special WaitForOtherPlayerToExit
checkflag ENGINE_KRIS_IN_CABLE_CLUB
iftrue .Female
- applymovement POKECENTER2F_LINK_RECEPTIONIST3, MovementData_0x192d08
- applymovement PLAYER, MovementData_0x192cf9
- applymovement POKECENTER2F_LINK_RECEPTIONIST3, MovementData_0x192d01
+ applymovement POKECENTER2F_TIME_CAPSULE_RECEPTIONIST, PokeCenter2FMovementData_ReceptionistStepsLeftLooksRight
+ applymovement PLAYER, PokeCenter2FMovementData_PlayerTakesTwoStepsDown
+ applymovement POKECENTER2F_TIME_CAPSULE_RECEPTIONIST, PokeCenter2FMovementData_ReceptionistStepsRightLooksDown_2
jump .Done
.Female:
- applymovement POKECENTER2F_LINK_RECEPTIONIST3, MovementData_0x192d08
- applymovement PLAYER, MovementData_0x192cfc
+ applymovement POKECENTER2F_TIME_CAPSULE_RECEPTIONIST, PokeCenter2FMovementData_ReceptionistStepsLeftLooksRight
+ applymovement PLAYER, PokeCenter2FMovementData_PlayerTakesOneStepDown
clearflag ENGINE_KRIS_IN_CABLE_CLUB
playsound SFX_TINGLE
- applymovement PLAYER, MovementData_0x192d17
+ applymovement PLAYER, PokeCenter2FMovementData_PlayerSpinsClockwiseEndsFacingRight
writebyte (1 << 7) | (PAL_OW_BLUE << 4)
special Special_SetPlayerPalette
- applymovement PLAYER, MovementData_0x192d1c
+ applymovement PLAYER, PokeCenter2FMovementData_PlayerSpinsClockwiseEndsFacingLeft
special ReplaceKrisSprite
- applymovement PLAYER, MovementData_0x192cfc
- applymovement POKECENTER2F_LINK_RECEPTIONIST3, MovementData_0x192d01
+ applymovement PLAYER, PokeCenter2FMovementData_PlayerTakesOneStepDown
+ applymovement POKECENTER2F_TIME_CAPSULE_RECEPTIONIST, PokeCenter2FMovementData_ReceptionistStepsRightLooksDown_2
.Done:
dotrigger $0
domaptrigger TIME_CAPSULE, $0
@@ -624,54 +624,54 @@
closetext
end
-MovementData_0x192cca:
+PokeCenter2FMovementData_ReceptionistWalksUpAndLeft_LookRight:
slow_step_up
slow_step_left
turn_head_right
step_end
-MovementData_0x192cce:
+PokeCenter2FMobileMobileMovementData_ReceptionistWalksUpAndLeft_LookDown:
slow_step_up
slow_step_left
turn_head_down
step_end
-MovementData_0x192cd2:
+PokeCenter2FMovementData_ReceptionistStepsLeftLooksDown:
slow_step_left
turn_head_down
step_end
-MovementData_0x192cd5:
+PokeCenter2FMovementData_ReceptionistStepsRightLooksDown:
slow_step_right
turn_head_down
step_end
-MovementData_0x192cd8:
+PokeCenter2FMovementData_ReceptionistWalksUpAndLeft_LookRight_2:
slow_step_up
slow_step_left
turn_head_right
step_end
-MovementData_0x192cdc:
+PokeCenter2FMovementData_ReceptionistLooksRight:
turn_head_right
step_end
-MovementData_0x192cde:
+PokeCenter2FMovementData_PlayerTakesThreeStepsUp:
step_up
step_up
step_up
step_end
-MovementData_0x192ce2:
+PokeCenter2FMovementData_PlayerTakesTwoStepsUp:
step_up
step_up
step_end
-MovementData_0x192ce5:
+PokeCenter2FMovementData_PlayerTakesOneStepUp:
step_up
step_end
-MovementData_0x192ce7:
+PokeCenter2FMobileMovementData_PlayerWalksIntoMobileBattleRoom:
step_up
step_up
step_right
@@ -678,64 +678,64 @@
step_up
step_end
-MovementData_0x192cec:
+PokeCenter2FMovementData_PlayerTakesTwoStepsUp_2:
step_up
step_up
step_end
-MovementData_0x192cef:
+PokeCenter2FMovementData_PlayerWalksLeftAndUp:
step_left
step_up
step_end
-MovementData_0x192cf2:
+PokeCenter2FMovementData_PlayerWalksRightAndUp:
step_right
step_up
step_end
-MovementData_0x192cf5:
+PokeCenter2FMovementData_PlayerTakesThreeStepsDown:
step_down
step_down
step_down
step_end
-MovementData_0x192cf9:
+PokeCenter2FMovementData_PlayerTakesTwoStepsDown:
step_down
step_down
step_end
-MovementData_0x192cfc:
+PokeCenter2FMovementData_PlayerTakesOneStepDown:
step_down
step_end
-MovementData_0x192cfe:
+PokeCenter2FMovementData_ReceptionistStepsRightAndDown:
slow_step_right
slow_step_down
step_end
-MovementData_0x192d01:
+PokeCenter2FMovementData_ReceptionistStepsRightLooksDown_2:
slow_step_right
turn_head_down
step_end
-MovementData_0x192d04:
+PokeCenter2FMovementData_ReceptionistStepsRightLooksDown_3:
slow_step_up
slow_step_left
turn_head_right
step_end
-MovementData_0x192d08:
+PokeCenter2FMovementData_ReceptionistStepsLeftLooksRight:
slow_step_left
turn_head_right
step_end
-MovementData_0x192d0b:
+PokeCenter2FMobileMovementData_ReceptionistWalksUpAndLeft:
slow_step_up
slow_step_left
turn_head_right
step_end
-MovementData_0x192d0f:
+PokeCenter2FMovementData_PlayerWalksOutOfMobileRoom:
step_down
step_left
step_down
@@ -742,12 +742,12 @@
step_down
step_end
-MovementData_0x192d14:
+PokeCenter2FMobileMovementData_ReceptionistWalksRightAndDown:
slow_step_right
slow_step_down
step_end
-MovementData_0x192d17:
+PokeCenter2FMovementData_PlayerSpinsClockwiseEndsFacingRight:
turn_head_down
turn_head_left
turn_head_up
@@ -754,7 +754,7 @@
turn_head_right
step_end
-MovementData_0x192d1c:
+PokeCenter2FMovementData_PlayerSpinsClockwiseEndsFacingLeft:
turn_head_down
turn_head_left
turn_head_up
@@ -762,7 +762,7 @@
turn_head_left
step_end
-MovementData_0x192d22:
+PokeCenter2FMovementData_PlayerSpinsClockwiseEndsFacingDown:
turn_head_down
turn_head_left
turn_head_up
@@ -770,33 +770,33 @@
turn_head_down
step_end
-MovementData_0x192d28:
+PokeCenter2FMovementData_PlayerTakesOneStepDown_2:
step_down
step_end
-MovementData_0x192d2a:
+PokeCenter2FMovementData_PlayerTakesTwoStepsDown_2:
step_down
step_down
step_end
-MovementData_0x192d2d:
+PokeCenter2FMovementData_PlayerTakesOneStepUp_2:
step_up
step_end
-MovementData_0x192d2f:
+PokeCenter2FMovementData_PlayerTakesOneStepRight:
step_right
step_end
-MovementData_0x192d31:
+PokeCenter2FMovementData_PlayerTakesOneStepLeft:
step_left
step_end
-MovementData_0x192d33:
+PokeCenter2FMovementData_ReceptionistStepsLeftLooksRight_2:
slow_step_left
turn_head_right
step_end
-MovementData_0x192d36:
+PokeCenter2FMovementData_ReceptionistStepsRightLooksLeft_2:
slow_step_right
turn_head_left
step_end
--- a/misc/mobile_12_2.asm
+++ b/misc/mobile_12_2.asm
@@ -191,7 +191,7 @@
xor a
ld [wd018], a
ld [wd019], a
- ld b, SCGB_14
+ ld b, SCGB_PACKPALS
call GetSGBLayout
call SetPalettes
call Function4aa22
--- a/misc/mobile_40.asm
+++ b/misc/mobile_40.asm
@@ -1,6 +1,3 @@
-
-SECTION "bank40", ROMX, BANK[$40]
-
Function100000: ; 100000
; d: 1 or 2
; e: bank
--- a/misc/mobile_41.asm
+++ b/misc/mobile_41.asm
@@ -1083,17 +1083,17 @@
INCBIN "gfx/unknown/106514.2bpp"
-Function106594:: ; 106594
- ld de, GFX_1065ad
+LoadOverworldFont:: ; 106594
+ ld de, .bgfont
ld hl, VTiles1
- lb bc, BANK(GFX_1065ad), $80
+ lb bc, BANK(.bgfont), $80
call Get2bpp
- ld de, GFX_1065ad + $800
+ ld de, .bgfont + $80 tiles
ld hl, VTiles2 tile $7f
- lb bc, BANK(GFX_1065ad), 1
+ lb bc, BANK(.bgfont), 1
call Get2bpp
ret
; 1065ad
-GFX_1065ad:
+.bgfont:
INCBIN "gfx/unknown/1065ad.2bpp"
--- a/misc/mobile_42.asm
+++ b/misc/mobile_42.asm
@@ -1,6 +1,3 @@
-
-SECTION "bank42", ROMX, BANK[$42]
-
Function108000: ; 108000
ld a, $80
ld [wcf65], a
--- a/misc/mobile_45.asm
+++ b/misc/mobile_45.asm
@@ -5955,7 +5955,7 @@
call ByteFill
call DelayFrame
callba Function14146
- ld b, SCGB_09
+ ld b, SCGB_MAPPALS
call GetSGBLayout
ld a, [rSVBK]
push af
--- a/misc/mobile_46.asm
+++ b/misc/mobile_46.asm
@@ -3348,7 +3348,7 @@
Function119800: ; 119800
ld a, $fd
ld [$c6d0], a
- ld [wc702], a
+ ld [wOTTrademonSpecies], a
ld a, [wcd81]
ld [wc74e], a
ld a, [wJumptableIndex]
@@ -7594,26 +7594,32 @@
ld [wc708], a
ld a, [wcd31]
ld [wc709], a
- ld a, $8
- ld [BGMapBuffer], a
- ld a, $c7
+
+ ld a, $c708 % $100
+ ld [wcd20], a
+ ld a, $c708 / $100
ld [wcd21], a
- ld a, $d
- ld [CreditsTimer], a
- ld a, $c6
+
+ ld a, $c60d % $100 ; Partymon Struct
+ ld [wcd22], a
+ ld a, $c60d / $100
ld [wcd23], a
- ld a, $3d
+
+ ld a, $c63d % $100 ; OT
ld [wcd24], a
- ld a, $c6
+ ld a, $c63d / $100
ld [wcd25], a
- ld a, $42
+
+ ld a, $c642 % $100 ; Nickname
ld [wcd26], a
- ld a, $c6
+ ld a, $c642 / $100
ld [wcd27], a
- ld a, $47
+
+ ld a, $c647 % $100 ; ???
ld [wcd28], a
- ld a, $c6
+ ld a, $c647 / $100
ld [wcd29], a
+
ld a, $46
ld [$c628], a
ld de, $c63d
@@ -7693,22 +7699,22 @@
ld a, [hl]
cp MIN_LEVEL
ld a, MIN_LEVEL
- jr c, .asm_11b7c5
+ jr c, .replace_level
ld a, [hl]
cp MAX_LEVEL
- jr c, .asm_11b7c6
+ jr c, .done_level
ld a, MAX_LEVEL
-.asm_11b7c5
+.replace_level
ld [hl], a
-.asm_11b7c6
+.done_level
ld [CurPartyLevel], a
- ld hl, $c616 + 1
- ld de, $c62c + 5
+ ld hl, $c617
+ ld de, $c631
ld b, $1
predef CalcPkmnStats
- ld de, $c62c + 5
- ld hl, $c62c + 3
+ ld de, $c631
+ ld hl, $c62f
ld a, [de]
ld [hli], a
inc de
@@ -7719,30 +7725,30 @@
; 11b7e5
Function11b7e5: ; 11b7e5
- ld a, [$c608 + 5]
- ld [wc702], a
+ ld a, [$c60d] ; species
+ ld [wOTTrademonSpecies], a
ld [CurPartySpecies], a
ld a, [wcd81]
ld [wc74e], a
- ld hl, $c63d
- ld de, wc724
- ld bc, $0005
+ ld hl, $c63d ; OT
+ ld de, wOTTrademonOTName
+ ld bc, $5
call CopyBytes
- ld a, $50
+ ld a, "@"
ld [de], a
- ld a, [$c608 + 11]
- ld [wEnemyWrapCount], a
- ld a, [$c608 + 12]
- ld [wPlayerCharging], a
- ld hl, $c608 + 26
+ ld a, [$c613] ; id
+ ld [wOTTrademonID], a
+ ld a, [$c613 + 1]
+ ld [wOTTrademonID + 1], a
+ ld hl, $c622 ; dvs
ld a, [hli]
- ld [wEnemyTrappingMove], a
+ ld [wOTTrademonDVs], a
ld a, [hl]
- ld [wPlayerWrapCount], a
- ld bc, $c608 + 5
+ ld [wOTTrademonDVs + 1], a
+ ld bc, $c60d ; pokemon_data_start
callba GetCaughtGender
ld a, c
- ld [wEnemyCharging], a
+ ld [wOTTrademonCaughtData], a
call SpeechTextBox
call FadeToMenu
callba Function108016
--- a/misc/mobile_5b.asm
+++ b/misc/mobile_5b.asm
@@ -863,6 +863,3 @@
RGB 07, 07, 07
; 16cfc1
-
-GFX_16cfc1:
-INCBIN "gfx/unknown/16cfc1.2bpp"
--- a/misc/mobile_5f.asm
+++ b/misc/mobile_5f.asm
@@ -274,29 +274,29 @@
Function17d0f3: ; 17d0f3
ld a, [$c608 + 5]
- ld [wc702], a
+ ld [wOTTrademonSpecies], a
ld [CurPartySpecies], a
ld a, [wcd81]
ld [wc74e], a
ld hl, $c63d
- ld de, wc724
- ld bc, $0005
+ ld de, wOTTrademonOTName
+ ld bc, 5
call CopyBytes
- ld a, $50
+ ld a, "@"
ld [de], a
ld a, [$c608 + 11]
- ld [wEnemyWrapCount], a
+ ld [wOTTrademonID], a
ld a, [$c608 + 12]
- ld [wPlayerCharging], a
+ ld [wOTTrademonID + 1], a
ld hl, $c608 + 26
ld a, [hli]
- ld [wEnemyTrappingMove], a
+ ld [wOTTrademonDVs], a
ld a, [hl]
- ld [wPlayerWrapCount], a
+ ld [wOTTrademonDVs + 1], a
ld bc, $c608 + 5
callba GetCaughtGender
ld a, c
- ld [wEnemyCharging], a
+ ld [wOTTrademonCaughtData], a
call SpeechTextBox
call FadeToMenu
callba Function10804d
--- a/predef/cgb.asm
+++ b/predef/cgb.asm
@@ -11,7 +11,6 @@
cp SCGB_RAM
jr nz, .not_ram
ld a, [SGBPredef]
-
.not_ram
cp SCGB_FC
jp z, Function96f3
@@ -62,7 +61,7 @@
dw _CGB19
dw _CGB1a
dw _CGB1b
- dw _CGB1c
+ dw _CGB_FrontpicPals
dw _CGB1d
dw _CGB1e
; 8db8
@@ -289,7 +288,7 @@
_CGB04: ; 8f70
ld de, UnknBGPals
ld a, $1d
- call GetAthPalletFromPalettes9df6
+ call GetPredefPal
call LoadHLPaletteIntoDE
ld a, [CurPartySpecies]
cp $ff
@@ -336,7 +335,7 @@
_CGB17: ; 8fca
ld de, UnknBGPals
ld a, $1d
- call GetAthPalletFromPalettes9df6
+ call GetPredefPal
call LoadHLPaletteIntoDE
ld a, [CurPartySpecies]
cp $ff
@@ -396,7 +395,7 @@
_CGB16: ; 903e
ld de, UnknBGPals
ld a, $1d
- call GetAthPalletFromPalettes9df6
+ call GetPredefPal
call LoadHLPaletteIntoDE
ld a, [CurPartySpecies]
call GetMonPalettePointer_
@@ -474,7 +473,7 @@
call WipeAttrMap
ld de, UnknOBPals
ld a, $3c
- call GetAthPalletFromPalettes9df6
+ call GetPredefPal
call LoadHLPaletteIntoDE
hlcoord 0, 6, AttrMap
lb bc, 12, SCREEN_WIDTH
@@ -539,12 +538,12 @@
Function9166: ; 9166
ld de, UnknBGPals
ld a, $38
- call GetAthPalletFromPalettes9df6
+ call GetPredefPal
call LoadHLPaletteIntoDE
ld de, UnknOBPals
ld a, $39
- call GetAthPalletFromPalettes9df6
+ call GetPredefPal
call LoadHLPaletteIntoDE
call WipeAttrMap
ret
@@ -555,7 +554,7 @@
call CopyFourPalettes
ld de, UnknOBPals
ld a, $3a
- call GetAthPalletFromPalettes9df6
+ call GetPredefPal
call LoadHLPaletteIntoDE
call WipeAttrMap
ret
@@ -587,8 +586,8 @@
; 91c8
_CGB09: ; 91c8
- call Functionb1de
- ld a, SCGB_09
+ call LoadMapPals
+ ld a, SCGB_MAPPALS
ld [SGBPredef], a
ret
; 91d1
@@ -609,7 +608,7 @@
and a
jr z, .pokemon
ld a, $1a
- call GetAthPalletFromPalettes9df6
+ call GetPredefPal
call LoadHLPaletteIntoDE
jr .got_palette
@@ -670,7 +669,7 @@
call CopyFourPalettes
ld de, UnknOBPals
ld a, $4c
- call GetAthPalletFromPalettes9df6
+ call GetPredefPal
call LoadHLPaletteIntoDE
ld a, [rSVBK]
push af
@@ -715,7 +714,7 @@
call GetTrainerPalettePointer
call LoadPalette_White_Col1_Col2_Black
ld a, $24
- call GetAthPalletFromPalettes9df6
+ call GetPredefPal
call LoadHLPaletteIntoDE
hlcoord 0, 0, AttrMap
@@ -793,7 +792,7 @@
_CGB0e: ; 9373
ld de, UnknBGPals
ld a, $10
- call GetAthPalletFromPalettes9df6
+ call GetPredefPal
call LoadHLPaletteIntoDE
ld a, [PlayerHPPal]
ld l, a
@@ -830,7 +829,7 @@
_CGB10: ; 93ba
ld de, UnknBGPals
ld a, $1d
- call GetAthPalletFromPalettes9df6
+ call GetPredefPal
call LoadHLPaletteIntoDE
call WipeAttrMap
call ApplyAttrMap
@@ -850,11 +849,11 @@
bit 0, a
jr z, .tutorial_male
- ld hl, Palettes_9469
+ ld hl, .KrisPackPals
jr .got_gender
.tutorial_male
- ld hl, Palettes_9439
+ ld hl, .ChrisPackPals
.got_gender
ld de, UnknBGPals
@@ -889,7 +888,7 @@
ret
; 9439
-Palettes_9439: ; 9439
+.ChrisPackPals: ; 9439
RGB 31, 31, 31
RGB 15, 15, 31
RGB 00, 00, 31
@@ -921,7 +920,7 @@
RGB 00, 00, 00
; 9469
-Palettes_9469: ; 9469
+.KrisPackPals: ; 9469
RGB 31, 31, 31
RGB 31, 14, 31
RGB 31, 07, 31
@@ -1010,13 +1009,13 @@
_CGB19: ; 94fa
ld de, UnknBGPals
ld a, $4e
- call GetAthPalletFromPalettes9df6
+ call GetPredefPal
call LoadHLPaletteIntoDE
- ld hl, Palette_9521
+ ld hl, .Palette
ld de, UnknOBPals
call LoadHLPaletteIntoDE
- ld hl, Palette_9521
- ld de, UnknOBPals + 8
+ ld hl, .Palette
+ ld de, UnknOBPals + 1 palettes
call LoadHLPaletteIntoDE
call WipeAttrMap
call ApplyAttrMap
@@ -1024,7 +1023,7 @@
ret
; 9521
-Palette_9521: ; 9521
+.Palette: ; 9521
RGB 31, 31, 31
RGB 13, 11, 00
RGB 23, 12, 28
@@ -1058,18 +1057,18 @@
call CopyFourPalettes
ld hl, Palettes_b681
ld de, UnknOBPals
- ld bc, $8
+ ld bc, 1 palettes
ld a, $5
call FarCopyWRAM
- ld de, UnknOBPals + $38
+ ld de, UnknOBPals + 7 palettes
ld a, $1c
- call GetAthPalletFromPalettes9df6
+ call GetPredefPal
call LoadHLPaletteIntoDE
call WipeAttrMap
ret
; 9578
-_CGB1c: ; 9578
+_CGB_FrontpicPals: ; 9578
ld de, UnknBGPals
ld a, [CurPartySpecies]
ld bc, TempMonDVs
@@ -1082,9 +1081,9 @@
; 9591
_CGB1d: ; 9591
- ld hl, Palette95e0
+ ld hl, .Palettes
ld de, UnknBGPals
- ld bc, $10
+ ld bc, 2 palettes
ld a, $5
call FarCopyWRAM
call ApplyPals
@@ -1113,7 +1112,7 @@
ret
; 95e0
-Palette95e0: ; 95e0
+.Palettes: ; 95e0
RGB 31, 31, 31
RGB 16, 31, 14
RGB 05, 14, 21
--- a/predef/sgb.asm
+++ b/predef/sgb.asm
@@ -7,7 +7,6 @@
cp SCGB_RAM
jr nz, .not_ram
ld a, [SGBPredef]
-
.not_ram
cp SCGB_FC
jp z, Function8ade
@@ -53,7 +52,7 @@
dw .SGB19
dw .SGB1a
dw .SGB1b
- dw .SGB1c
+ dw .SGB_FrontpicPals
dw .SGB1d
dw .SGB1e
; 86ad
@@ -69,8 +68,8 @@
call Function9809
ld hl, PalPacket_9ce6
- ld de, wcda9
- ld bc, $0010
+ ld de, wSGBPals
+ ld bc, $10
call CopyBytes
ld a, [PlayerHPPal]
@@ -83,17 +82,17 @@
add hl, de
ld a, [hli]
- ld [wcda9 + 3], a
+ ld [wSGBPals + 3], a
ld a, [hli]
- ld [wcda9 + 4], a
+ ld [wSGBPals + 4], a
ld a, [hli]
- ld [wcda9 + 5], a
+ ld [wSGBPals + 5], a
ld a, [hl]
- ld [wcda9 + 6], a
+ ld [wSGBPals + 6], a
ld a, [EnemyHPPal]
ld l, a
- ld h, $0
+ ld h, 0
rept 2
add hl, hl
endr
@@ -101,41 +100,41 @@
ld de, Palettes_a8be
add hl, de
ld a, [hli]
- ld [wcda9 + 9], a
+ ld [wSGBPals + 9], a
ld a, [hli]
- ld [wcda9 + 10], a
+ ld [wSGBPals + 10], a
ld a, [hli]
- ld [wcda9 + 11], a
+ ld [wSGBPals + 11], a
ld a, [hl]
- ld [wcda9 + 12], a
+ ld [wSGBPals + 12], a
ld hl, PalPacket_9cf6
- ld de, wcda9 + $10
- ld bc, $0010
+ ld de, wSGBPals + $10
+ ld bc, $10
call CopyBytes
call GetBattlemonBackpicPalettePointer
ld a, [hli]
- ld [wcda9 + $13], a
+ ld [wSGBPals + $13], a
ld a, [hli]
- ld [wcda9 + $14], a
+ ld [wSGBPals + $14], a
ld a, [hli]
- ld [wcda9 + $15], a
+ ld [wSGBPals + $15], a
ld a, [hl]
- ld [wcda9 + $16], a
+ ld [wSGBPals + $16], a
call GetEnemyFrontpicPalettePointer
ld a, [hli]
- ld [wcda9 + $19], a
+ ld [wSGBPals + $19], a
ld a, [hli]
- ld [wcda9 + $1a], a
+ ld [wSGBPals + $1a], a
ld a, [hli]
- ld [wcda9 + $1b], a
+ ld [wSGBPals + $1b], a
ld a, [hl]
- ld [wcda9 + $1c], a
+ ld [wSGBPals + $1c], a
- ld hl, wcda9
- ld de, wcda9 + $10
+ ld hl, wSGBPals
+ ld de, wSGBPals + $10
ld a, SCGB_01
ld [SGBPredef], a
ret
@@ -143,11 +142,11 @@
.SGB0e: ; 873c
ld hl, PalPacket_9bd6
- ld de, wcda9
- ld bc, $0010
+ ld de, wSGBPals
+ ld bc, $10
call CopyBytes
- ld hl, wcda9 + 1
+ ld hl, wSGBPals + 1
ld [hl], $10
rept 2
inc hl
@@ -156,7 +155,7 @@
ld a, [PlayerHPPal]
add $2f
ld [hl], a
- ld hl, wcda9
+ ld hl, wSGBPals
ld de, BlkPacket_9ad6
ret
; 875c
@@ -169,12 +168,12 @@
.SGB03: ; 8763
ld hl, PalPacket_9ce6
- ld de, wcda9
- ld bc, $0010
+ ld de, wSGBPals
+ ld bc, $10
call CopyBytes
ld a, [wcda1]
ld l, a
- ld h, $0
+ ld h, 0
rept 2
add hl, hl
endr
@@ -181,25 +180,25 @@
ld de, Palettes_a8be
add hl, de
ld a, [hli]
- ld [wcda9 + 3], a
+ ld [wSGBPals + 3], a
ld a, [hli]
- ld [wcda9 + 4], a
+ ld [wSGBPals + 4], a
ld a, [hli]
- ld [wcda9 + 5], a
+ ld [wSGBPals + 5], a
ld a, [hl]
- ld [wcda9 + 6], a
+ ld [wSGBPals + 6], a
ld a, [CurPartySpecies]
- ld bc, wd10e + 21
+ ld bc, TempMonDVs
call GetPlayerOrMonPalettePointer
ld a, [hli]
- ld [wcda9 + 9], a
+ ld [wSGBPals + 9], a
ld a, [hli]
- ld [wcda9 + 10], a
+ ld [wSGBPals + 10], a
ld a, [hli]
- ld [wcda9 + 11], a
+ ld [wSGBPals + 11], a
ld a, [hl]
- ld [wcda9 + 12], a
- ld hl, wcda9
+ ld [wSGBPals + 12], a
+ ld hl, wSGBPals
ld de, BlkPacket_9ac6
ret
; 87ab
@@ -206,16 +205,16 @@
.SGB0a: ; 87ab
ld hl, PalPacket_9c56
- ld de, wcda9 + 1
+ ld de, wSGBPals + 1
ret
; 87b2
.SGB04: ; 87b2
ld hl, PalPacket_9ce6
- ld de, wcda9
- ld bc, $0010
+ ld de, wSGBPals
+ ld bc, $10
call CopyBytes
- ld hl, wcda9 + 3
+ ld hl, wSGBPals + 3
ld [hl], $9f
inc hl
ld [hl], $2a
@@ -226,14 +225,14 @@
ld a, [CurPartySpecies]
call GetMonPalettePointer_
ld a, [hli]
- ld [wcda9 + 9], a
+ ld [wSGBPals + 9], a
ld a, [hli]
- ld [wcda9 + 10], a
+ ld [wSGBPals + 10], a
ld a, [hli]
- ld [wcda9 + 11], a
+ ld [wSGBPals + 11], a
ld a, [hl]
- ld [wcda9 + 12], a
- ld hl, wcda9
+ ld [wSGBPals + 12], a
+ ld hl, wSGBPals
ld de, BlkPacket_9ae6
ret
; 87e9
@@ -240,10 +239,10 @@
.SGB17: ; 87e9
ld hl, PalPacket_9ce6
- ld de, wcda9
- ld bc, $0010
+ ld de, wSGBPals
+ ld bc, $10
call CopyBytes
- ld hl, wcda9 + 3
+ ld hl, wSGBPals + 3
ld [hl], $9f
inc hl
ld [hl], $2a
@@ -252,17 +251,17 @@
inc hl
ld [hl], $19
ld a, [CurPartySpecies]
- ld bc, wd10e + 21
+ ld bc, TempMonDVs
call GetPlayerOrMonPalettePointer
ld a, [hli]
- ld [wcda9 + 9], a
+ ld [wSGBPals + 9], a
ld a, [hli]
- ld [wcda9 + 10], a
+ ld [wSGBPals + 10], a
ld a, [hli]
- ld [wcda9 + 11], a
+ ld [wSGBPals + 11], a
ld a, [hl]
- ld [wcda9 + 12], a
- ld hl, wcda9
+ ld [wSGBPals + 12], a
+ ld hl, wSGBPals
ld de, BlkPacket_9ae6
ret
; 8823
@@ -275,10 +274,10 @@
.SGB10: ; 882a
ld hl, PalPacket_9ce6
- ld de, wcda9
- ld bc, $0010
+ ld de, wSGBPals
+ ld bc, $10
call CopyBytes
- ld hl, wcda9 + 3
+ ld hl, wSGBPals + 3
ld [hl], $9f
inc hl
ld [hl], $2a
@@ -286,7 +285,7 @@
ld [hl], $5a
inc hl
ld [hl], $19
- ld hl, wcda9
+ ld hl, wSGBPals
ld de, BlkPacket_9a86
ret
; 884b
@@ -361,7 +360,7 @@
.SGB11: ; 889e
ld hl, BlkPacket_9a86
ld de, PlayerLightScreenCount
- ld bc, $0010
+ ld bc, $10
call CopyBytes
ld hl, PalPacket_9bb6
ld de, BlkPacket_9a86
@@ -370,14 +369,14 @@
.SGB09: ; 88b1
ld hl, PalPacket_9bd6
- ld de, wcda9
- ld bc, $0010
+ ld de, wSGBPals
+ ld bc, $10
call CopyBytes
- call .GetPermission
- ld hl, wcda9 + 1
+ call .GetMapPalsIndex
+ ld hl, wSGBPals + 1
ld [hld], a
ld de, BlkPacket_9a86
- ld a, SCGB_09
+ ld a, SCGB_MAPPALS
ld [SGBPredef], a
ret
; 88cd
@@ -385,14 +384,14 @@
.SGB0b: ; 88cd
push bc
ld hl, PalPacket_9ce6
- ld de, wcda9
- ld bc, $0010
+ ld de, wSGBPals
+ ld bc, $10
call CopyBytes
pop bc
ld a, c
and a
jr z, .asm_88ef
- ld hl, wcda9 + 3
+ ld hl, wSGBPals + 3
ld [hl], $e7
inc hl
ld [hl], $1c
@@ -404,7 +403,7 @@
.asm_88ef
ld hl, PartyMon1DVs
- ld bc, $0030
+ ld bc, $30
ld a, [CurPartyMon]
call AddNTimes
ld c, l
@@ -412,16 +411,16 @@
ld a, [PlayerHPPal]
call GetPlayerOrMonPalettePointer
ld a, [hli]
- ld [wcda9 + 3], a
+ ld [wSGBPals + 3], a
ld a, [hli]
- ld [wcda9 + 4], a
+ ld [wSGBPals + 4], a
ld a, [hli]
- ld [wcda9 + 5], a
+ ld [wSGBPals + 5], a
ld a, [hl]
- ld [wcda9 + 6], a
+ ld [wSGBPals + 6], a
.asm_8913
- ld hl, wcda9
+ ld hl, wSGBPals
ld de, BlkPacket_9a86
ret
; 891a
@@ -441,20 +440,20 @@
.SGB12: ; 8928
ld hl, PalPacket_9bd6
- ld de, wcda9
- ld bc, $0010
+ ld de, wSGBPals
+ ld bc, $10
call CopyBytes
ld hl, BlkPacket_9a86
- ld de, wcda9 + $10
- ld bc, $0010
+ ld de, wSGBPals + $10
+ ld bc, $10
call CopyBytes
- call .GetPermission
- ld hl, wcda9 + 1
+ call .GetMapPalsIndex
+ ld hl, wSGBPals + 1
ld [hl], a
- ld hl, wcda9 + 3
+ ld hl, wSGBPals + 3
ld [hl], $2e
- ld hl, wcda9 + $13
- ld a, $5
+ ld hl, wSGBPals + $13
+ ld a, 5
ld [hli], a
ld a, [wMenuBorderLeftCoord]
ld [hli], a
@@ -464,15 +463,15 @@
ld [hli], a
ld a, [wMenuBorderBottomCoord]
ld [hl], a
- ld hl, wcda9
- ld de, wcda9 + $10
+ ld hl, wSGBPals
+ ld de, wSGBPals + $10
ret
; 8969
.SGB1e: ; 8969
ld hl, PalPacket_9ce6
- ld de, wcda9
- ld bc, $0010
+ ld de, wSGBPals
+ ld bc, $10
call CopyBytes
ld a, [CurPartySpecies]
ld l, a
@@ -490,14 +489,14 @@
ld b, 0
add hl, bc
ld a, [hli]
- ld [wcda9 + 3], a
+ ld [wSGBPals + 3], a
ld a, [hli]
- ld [wcda9 + 4], a
+ ld [wSGBPals + 4], a
ld a, [hli]
- ld [wcda9 + 5], a
+ ld [wSGBPals + 5], a
ld a, [hl]
- ld [wcda9 + 6], a
- ld hl, wcda9
+ ld [wSGBPals + 6], a
+ ld hl, wSGBPals
ld de, BlkPacket_9a86
ret
; 89a6
@@ -510,21 +509,21 @@
.SGB1a: ; 89ad
ld hl, PalPacket_9ce6
- ld de, wcda9
- ld bc, $0010
+ ld de, wSGBPals
+ ld bc, $10
call CopyBytes
ld a, [CurPartySpecies]
- ld bc, wd10e + 21
+ ld bc, TempMonDVs
call GetPlayerOrMonPalettePointer
ld a, [hli]
- ld [wcda9 + 3], a
+ ld [wSGBPals + 3], a
ld a, [hli]
- ld [wcda9 + 4], a
+ ld [wSGBPals + 4], a
ld a, [hli]
- ld [wcda9 + 5], a
+ ld [wSGBPals + 5], a
ld a, [hl]
- ld [wcda9 + 6], a
- ld hl, wcda9
+ ld [wSGBPals + 6], a
+ ld hl, wSGBPals
ld de, BlkPacket_9a86
ret
; 89d9
@@ -535,99 +534,99 @@
ret
; 89e0
-.SGB1c: ; 89e0
+.SGB_FrontpicPals: ; 89e0
ld hl, PalPacket_9ce6
- ld de, wcda9
- ld bc, $0010
+ ld de, wSGBPals
+ ld bc, $10
call CopyBytes
ld a, [CurPartySpecies]
- ld bc, wd10e + 21
+ ld bc, TempMonDVs
call GetFrontpicPalettePointer
ld a, [hli]
- ld [wcda9 + 3], a
+ ld [wSGBPals + 3], a
ld a, [hli]
- ld [wcda9 + 4], a
+ ld [wSGBPals + 4], a
ld a, [hli]
- ld [wcda9 + 5], a
+ ld [wSGBPals + 5], a
ld a, [hl]
- ld [wcda9 + 6], a
- ld hl, wcda9
+ ld [wSGBPals + 6], a
+ ld hl, wSGBPals
ld de, BlkPacket_9a86
ret
; 8a0c
-.GetPermission: ; 8a0c
+.GetMapPalsIndex: ; 8a0c
ld a, [TimeOfDayPal]
- cp $2
- jr c, .asm_8a16
+ cp NITE
+ jr c, .morn_day
ld a, $19
ret
-.asm_8a16
+.morn_day
ld a, [wPermission]
- cp $2
- jr z, .asm_8a39
- cp $4
- jr z, .asm_8a3c
- cp $7
- jr z, .asm_8a3c
- cp $5
- jr z, .asm_8a3f
- cp $6
- jr z, .asm_8a42
+ cp ROUTE
+ jr z, .route
+ cp CAVE
+ jr z, .cave
+ cp DUNGEON
+ jr z, .cave
+ cp PERM_5
+ jr z, .perm5
+ cp GATE
+ jr z, .gate
ld a, [MapGroup]
ld e, a
ld d, 0
- ld hl, .Unknown_8a45
+ ld hl, .SGBRoofPalInds
add hl, de
ld a, [hl]
ret
-.asm_8a39
- ld a, $0
+.route
+ ld a, $00
ret
-.asm_8a3c
+.cave
ld a, $18
ret
-.asm_8a3f
- ld a, $6
+.perm5
+ ld a, $06
ret
-.asm_8a42
- ld a, $3
+.gate
+ ld a, $03
ret
; 8a45
-.Unknown_8a45: ; 8a45
- db $00
- db $12
- db $14
- db $18
- db $11
- db $15
- db $09
- db $04
- db $0f
- db $16
- db $0e
- db $10
- db $06
- db $01
- db $03
- db $06
- db $0b
- db $08
- db $05
- db $17
- db $08
- db $07
- db $13
- db $02
- db $0c
- db $0a
- db $0d
+.SGBRoofPalInds: ; 8a45
+ db $00 ; Unused
+ db $12 ; Olivine
+ db $14 ; Mahogany
+ db $18 ; Various Dungeons
+ db $11 ; Ecruteak
+ db $15 ; Blackthorn
+ db $09 ; Cinnabar
+ db $04 ; Cerulean
+ db $0f ; Azalea
+ db $16 ; Lake Of Rage
+ db $0e ; Violet
+ db $10 ; Goldenrod
+ db $06 ; Vermilion
+ db $01 ; Palette
+ db $03 ; Pewter
+ db $06 ; Fast Ship
+ db $0b ; Indigo Plateau
+ db $08 ; Fuchsia
+ db $05 ; Lavender
+ db $17 ; Silver Cave Outside
+ db $08 ; Pokemon Center 2F
+ db $07 ; Celadon
+ db $13 ; Cianwood
+ db $02 ; Viridian
+ db $0c ; New Bark
+ db $0a ; Saffron
+ db $0d ; Cherrygrove
; 8a60
.Finish: ; 8a60
--- a/wram.asm
+++ b/wram.asm
@@ -590,6 +590,8 @@
wc60f::
wPlayerMoveStruct:: ds MOVE_LENGTH ; c60f
wc616::
+ ds -4
+wc612:: ds 4
EnemyMonNick:: ds PKMN_NAME_LENGTH ; c616
ds -5
wInitHourBuffer:: ds 5
@@ -1487,7 +1489,7 @@
wcd9b:: ds 6
wcda1:: ds 8
-wcda9:: ds 48
+wSGBPals:: ds 48 ; cda9
AttrMap:: ; cdd9
; 20x18 grid of palettes for 8x8 tiles
@@ -2029,7 +2031,6 @@
wItemQuantityChangeBuffer:: ds 1
wItemQuantityBuffer:: ds 1
-wd10e::
TempMon::
party_struct TempMon
@@ -2090,8 +2091,8 @@
wMetatileStandingX:: ds 1
wSecondMapHeaderBank:: ds 1
wTileset:: ds 1
-wPermission:: ds 1
-wSecondMapHeaderAddr:: dw
+wPermission:: ds 1 ; d19a
+wSecondMapHeaderAddr:: dw ; d19b
; width/height are in blocks (2x2 walkable tiles, 4x4 graphics tiles)
MapHeader:: ; d19d