commented SGB palette stuff

This commit is contained in:
YamaArashi 2015-08-12 02:16:56 -07:00
parent 43fddc803f
commit 64cfbcce7a
34 changed files with 408 additions and 334 deletions

View file

@ -159,6 +159,11 @@ BIT_LEADING_ZEROES EQU 7
LEFT_ALIGN EQU (1 << BIT_LEFT_ALIGN) LEFT_ALIGN EQU (1 << BIT_LEFT_ALIGN)
LEADING_ZEROES EQU (1 << BIT_LEADING_ZEROES) LEADING_ZEROES EQU (1 << BIT_LEADING_ZEROES)
; HP bar
HP_BAR_GREEN EQU 0
HP_BAR_YELLOW EQU 1
HP_BAR_RED EQU 2
; serial ; serial
ESTABLISH_CONNECTION_WITH_INTERNAL_CLOCK EQU $01 ESTABLISH_CONNECTION_WITH_INTERNAL_CLOCK EQU $01

View file

@ -1,3 +1,19 @@
SET_PAL_BATTLE_BLACK EQU $00
SET_PAL_BATTLE EQU $01
SET_PAL_TOWN_MAP EQU $02
SET_PAL_STATUS_SCREEN EQU $03
SET_PAL_POKEDEX EQU $04
SET_PAL_SLOTS EQU $05
SET_PAL_TITLE_SCREEN EQU $06
SET_PAL_NIDORINO_INTRO EQU $07
SET_PAL_GENERIC EQU $08
SET_PAL_OVERWORLD EQU $09
SET_PAL_PARTY_MENU EQU $0A
SET_PAL_POKEMON_WHOLE_SCREEN EQU $0B
SET_PAL_GAME_FREAK_INTRO EQU $0C
SET_PAL_TRAINER_CARD EQU $0D
UPDATE_PARTY_MENU_BLK_PACKET EQU $FC
; super game boy palettes ; super game boy palettes
const_value = 0 const_value = 0

View file

@ -60,11 +60,11 @@ BlkPacket_WholeScreen: ; 7219e (1c:619e)
BlkPacket_Battle: ; 721b5 (1c:61b5) BlkPacket_Battle: ; 721b5 (1c:61b5)
ATTR_BLK 5 ATTR_BLK 5
ATTR_BLK_DATA %111, 2,2,0, 00,12, 19,17 ATTR_BLK_DATA %111, 2,2,0, 00,12, 19,17 ; message box: pal 2
ATTR_BLK_DATA %011, 1,1,0, 01,00, 10,03 ATTR_BLK_DATA %011, 1,1,0, 01,00, 10,03 ; enemy HP bar: pal 1
ATTR_BLK_DATA %011, 0,0,0, 10,07, 19,10 ATTR_BLK_DATA %011, 0,0,0, 10,07, 19,10 ; player HP bar: pal 0
ATTR_BLK_DATA %011, 2,2,0, 00,04, 08,11 ATTR_BLK_DATA %011, 2,2,0, 00,04, 08,11 ; player mon: pal 2
ATTR_BLK_DATA %011, 3,3,0, 11,00, 19,06 ATTR_BLK_DATA %011, 3,3,0, 11,00, 19,06 ; enemy mon : pal 3
db $03,$00,$00,$13,$0b,$00 db $03,$00,$00,$13,$0b,$00
db $03,$00,$0c,$13,$11,$02 db $03,$00,$0c,$13,$11,$02
@ -76,7 +76,7 @@ BlkPacket_Battle: ; 721b5 (1c:61b5)
BlkPacket_StatusScreen: ; 721fa (1c:61fa) BlkPacket_StatusScreen: ; 721fa (1c:61fa)
ATTR_BLK 1 ATTR_BLK 1
ATTR_BLK_DATA %111, 1,1,0, 01,00, 07,06 ATTR_BLK_DATA %111, 1,1,0, 01,00, 07,06 ; mon: pal 1, HP bar: pal 0
ds 8 ds 8
db $02,$00,$00,$11,$00,$03 db $02,$00,$00,$11,$00,$03
@ -86,7 +86,7 @@ BlkPacket_StatusScreen: ; 721fa (1c:61fa)
BlkPacket_Pokedex: ; 72222 (1c:6222) BlkPacket_Pokedex: ; 72222 (1c:6222)
ATTR_BLK 1 ATTR_BLK 1
ATTR_BLK_DATA %111, 1,1,0, 01,01, 08,08 ATTR_BLK_DATA %111, 1,1,0, 01,01, 08,08 ; mon: pal 1, everything else: pal 0
ds 8 ds 8
db $02,$00,$00,$11,$00,$01 db $02,$00,$00,$11,$00,$01
@ -97,11 +97,11 @@ BlkPacket_Pokedex: ; 72222 (1c:6222)
BlkPacket_Slots: ; 7224f (1c:624f) BlkPacket_Slots: ; 7224f (1c:624f)
ATTR_BLK 5 ATTR_BLK 5
ATTR_BLK_DATA %011, 1,1,0, 00,00, 19,11 ATTR_BLK_DATA %011, 1,1,0, 00,00, 19,11 ; "3" rows and top of screen: pal 1
ATTR_BLK_DATA %011, 2,2,0, 00,04, 19,09 ATTR_BLK_DATA %011, 2,2,0, 00,04, 19,09 ; "2" rows: pal 2
ATTR_BLK_DATA %010, 3,3,0, 00,06, 19,07 ATTR_BLK_DATA %010, 3,3,0, 00,06, 19,07 ; "1" row: pal 3
ATTR_BLK_DATA %011, 0,0,0, 04,04, 15,09 ATTR_BLK_DATA %011, 0,0,0, 04,04, 15,09 ; slot reels: pal 0
ATTR_BLK_DATA %011, 0,0,0, 00,12, 19,17 ATTR_BLK_DATA %011, 0,0,0, 00,12, 19,17 ; message box: pal 0
db $03,$00,$00,$13,$0b,$01 db $03,$00,$00,$13,$0b,$01
db $03,$00,$04,$13,$09,$02 db $03,$00,$04,$13,$09,$02
@ -112,9 +112,9 @@ BlkPacket_Slots: ; 7224f (1c:624f)
BlkPacket_Titlescreen: ; 7228e (1c:628e) BlkPacket_Titlescreen: ; 7228e (1c:628e)
ATTR_BLK 3 ATTR_BLK 3
ATTR_BLK_DATA %011, 0,0,0, 00,00, 19,07 ATTR_BLK_DATA %011, 0,0,0, 00,00, 19,07 ; pokemon logo: pal 0
ATTR_BLK_DATA %010, 1,1,0, 00,08, 19,09 ATTR_BLK_DATA %010, 1,1,0, 00,08, 19,09 ; version text: pal 1
ATTR_BLK_DATA %011, 2,2,0, 00,10, 19,17 ATTR_BLK_DATA %011, 2,2,0, 00,10, 19,17 ; player, mon, copyright text: pal 2
ds 12 ds 12
db $03,$00,$00,$13,$07,$00 db $03,$00,$00,$13,$07,$00
@ -124,9 +124,9 @@ BlkPacket_Titlescreen: ; 7228e (1c:628e)
BlkPacket_NidorinoIntro: ; 722c1 (1c:62c1) BlkPacket_NidorinoIntro: ; 722c1 (1c:62c1)
ATTR_BLK 3 ATTR_BLK 3
ATTR_BLK_DATA %011, 1,1,0, 00,00, 19,03 ATTR_BLK_DATA %011, 1,1,0, 00,00, 19,03 ; upper black bar: pal 1
ATTR_BLK_DATA %011, 0,0,0, 00,04, 19,13 ATTR_BLK_DATA %011, 0,0,0, 00,04, 19,13 ; letterbox: pal 0
ATTR_BLK_DATA %011, 1,1,0, 00,14, 19,17 ATTR_BLK_DATA %011, 1,1,0, 00,14, 19,17 ; lower black bar: pal 1
ds 12 ds 12
db $03,$00,$00,$13,$03,$01 db $03,$00,$00,$13,$03,$01
@ -136,13 +136,13 @@ BlkPacket_NidorinoIntro: ; 722c1 (1c:62c1)
BlkPacket_PartyMenu: ; 722f4 (1c:62f4) BlkPacket_PartyMenu: ; 722f4 (1c:62f4)
ATTR_BLK 7 ATTR_BLK 7
ATTR_BLK_DATA %110, 0,0,1, 01,00, 02,12 ATTR_BLK_DATA %110, 0,0,1, 01,00, 02,12 ; mon sprites: pal 0, everything else: pal 1
ATTR_BLK_DATA %010, 0,0,0, 05,01, 11,01 ATTR_BLK_DATA %010, 0,0,0, 05,01, 11,01 ; HP bar 0: pal set dynamically
ATTR_BLK_DATA %010, 0,0,0, 05,03, 11,03 ATTR_BLK_DATA %010, 0,0,0, 05,03, 11,03 ; HP bar 1: pal set dynamically
ATTR_BLK_DATA %010, 0,0,0, 05,05, 11,05 ATTR_BLK_DATA %010, 0,0,0, 05,05, 11,05 ; HP bar 2: pal set dynamically
ATTR_BLK_DATA %010, 0,0,0, 05,07, 11,07 ATTR_BLK_DATA %010, 0,0,0, 05,07, 11,07 ; HP bar 3: pal set dynamically
ATTR_BLK_DATA %010, 0,0,0, 05,09, 11,09 ATTR_BLK_DATA %010, 0,0,0, 05,09, 11,09 ; HP bar 4: pal set dynamically
ATTR_BLK_DATA %010, 0,0,0, 05,11, 11,11 ATTR_BLK_DATA %010, 0,0,0, 05,11, 11,11 ; HP bar 5: pal set dynamically
ds 4 ds 4
db $02,$00,$00,$11,$01,$03 db $02,$00,$00,$11,$01,$03
@ -158,16 +158,16 @@ BlkPacket_PartyMenu: ; 722f4 (1c:62f4)
BlkPacket_TrainerCard: ; 72360 (1c:6360) BlkPacket_TrainerCard: ; 72360 (1c:6360)
ATTR_BLK 10 ATTR_BLK 10
ATTR_BLK_DATA %010, 0,0,0, 03,12, 04,13 ATTR_BLK_DATA %010, 0,0,0, 03,12, 04,13 ; Boulder Badge
ATTR_BLK_DATA %010, 1,1,0, 07,12, 08,13 ATTR_BLK_DATA %010, 1,1,0, 07,12, 08,13 ; Cascade Badge
ATTR_BLK_DATA %010, 3,3,0, 11,12, 12,13 ATTR_BLK_DATA %010, 3,3,0, 11,12, 12,13 ; Thunder Badge
ATTR_BLK_DATA %010, 2,2,0, 16,11, 17,12 ATTR_BLK_DATA %010, 2,2,0, 16,11, 17,12 ; Rainbow Badge
ATTR_BLK_DATA %010, 1,1,0, 14,13, 15,14 ATTR_BLK_DATA %010, 1,1,0, 14,13, 15,14 ; Rainbow Badge
ATTR_BLK_DATA %010, 3,3,0, 16,13, 17,14 ATTR_BLK_DATA %010, 3,3,0, 16,13, 17,14 ; Rainbow Badge
ATTR_BLK_DATA %010, 2,2,0, 03,15, 04,16 ATTR_BLK_DATA %010, 2,2,0, 03,15, 04,16 ; Soul Badge
ATTR_BLK_DATA %010, 3,3,0, 07,15, 08,16 ATTR_BLK_DATA %010, 3,3,0, 07,15, 08,16 ; Marsh Badge
ATTR_BLK_DATA %010, 2,2,0, 11,15, 12,16 ATTR_BLK_DATA %010, 2,2,0, 11,15, 12,16 ; Volcano Badge
ATTR_BLK_DATA %010, 1,1,0, 15,15, 16,16 ATTR_BLK_DATA %010, 1,1,0, 15,15, 16,16 ; Earth Badge
ds 2 ds 2
db $03,$03,$0c,$04,$0d,$00 db $03,$03,$0c,$04,$0d,$00
@ -184,9 +184,9 @@ BlkPacket_TrainerCard: ; 72360 (1c:6360)
BlkPacket_GameFreakIntro: ; 723dd (1c:63dd) BlkPacket_GameFreakIntro: ; 723dd (1c:63dd)
ATTR_BLK 3 ATTR_BLK 3
ATTR_BLK_DATA %111, 1,1,0, 05,11, 07,13 ATTR_BLK_DATA %111, 1,1,0, 05,11, 07,13 ; falling stars (left): pal 1, GameFreak logo: pal 0
ATTR_BLK_DATA %010, 2,2,0, 08,11, 09,13 ATTR_BLK_DATA %010, 2,2,0, 08,11, 09,13 ; falling stars (middle): pal 2
ATTR_BLK_DATA %011, 3,3,0, 12,11, 14,13 ATTR_BLK_DATA %011, 3,3,0, 12,11, 14,13 ; falling stars (right): pal 3
ds 12 ds 12
db $03,$00,$00,$13,$0a,$00 db $03,$00,$00,$13,$0a,$00

View file

@ -2170,8 +2170,8 @@ ChangeMonPic: ; 79793 (1e:5793)
pop af pop af
ld [wBattleMonSpecies2], a ld [wBattleMonSpecies2], a
.done .done
ld b, $1 ld b, SET_PAL_BATTLE
jp GoPAL_SET jp RunPaletteCommand
AnimationHideEnemyMonPic: ; 797d8 (1e:57d8) AnimationHideEnemyMonPic: ; 797d8 (1e:57d8)
; Hides the enemy mon's sprite ; Hides the enemy mon's sprite

View file

@ -184,8 +184,8 @@ SlidePlayerAndEnemySilhouettesOnScreen: ; 3c04c (f:404c)
inc a inc a
ld [H_AUTOBGTRANSFERENABLED], a ld [H_AUTOBGTRANSFERENABLED], a
call Delay3 call Delay3
ld b, $1 ld b, SET_PAL_BATTLE
call GoPAL_SET call RunPaletteCommand
call HideSprites call HideSprites
jpab PrintBeginningBattleText jpab PrintBeginningBattleText
@ -976,7 +976,7 @@ AnyEnemyPokemonAliveCheck: ; 3c64f (f:464f)
; stores whether enemy ran in Z flag ; stores whether enemy ran in Z flag
ReplaceFaintedEnemyMon: ; 3c664 (f:4664) ReplaceFaintedEnemyMon: ; 3c664 (f:4664)
ld hl, wcf1e ld hl, wEnemyHPBarColor
ld e, $30 ld e, $30
call GetBattleHealthBarColor call GetBattleHealthBarColor
callab DrawEnemyPokeballs callab DrawEnemyPokeballs
@ -1199,7 +1199,7 @@ ChooseNextMon: ; 3c7d8 (f:47d8)
call GBPalWhiteOut call GBPalWhiteOut
call LoadHudTilePatterns call LoadHudTilePatterns
call LoadScreenTilesFromBuffer1 call LoadScreenTilesFromBuffer1
call GoPAL_SET_CF1C call RunDefaultPaletteCommand
call GBPalNormal call GBPalNormal
call SendOutMon call SendOutMon
ld hl, wEnemyMonHP ld hl, wEnemyMonHP
@ -1228,8 +1228,8 @@ HandlePlayerBlackOut: ; 3c837 (f:4837)
cp OAKS_LAB cp OAKS_LAB
ret z ; starter battle in oak's lab: don't black out ret z ; starter battle in oak's lab: don't black out
.notSony1Battle .notSony1Battle
ld b, $0 ld b, SET_PAL_BATTLE_BLACK
call GoPAL_SET call RunPaletteCommand
ld hl, PlayerBlackedOutText2 ld hl, PlayerBlackedOutText2
ld a, [wLinkState] ld a, [wLinkState]
cp LINK_STATE_BATTLING cp LINK_STATE_BATTLING
@ -1494,8 +1494,8 @@ EnemySendOutFirstMon: ; 3c92a (f:492a)
coord hl, 0, 0 coord hl, 0, 0
lb bc, 4, 11 lb bc, 4, 11
call ClearScreenArea call ClearScreenArea
ld b,1 ld b, SET_PAL_BATTLE
call GoPAL_SET call RunPaletteCommand
call GBPalNormal call GBPalNormal
ld hl,TrainerSentOutText ld hl,TrainerSentOutText
call PrintText call PrintText
@ -1829,8 +1829,8 @@ SendOutMon: ; 3cc91 (f:4c91)
ld [W_PLAYERDISABLEDMOVE], a ld [W_PLAYERDISABLEDMOVE], a
ld [wPlayerDisabledMoveNumber], a ld [wPlayerDisabledMoveNumber], a
ld [wPlayerMonMinimized], a ld [wPlayerMonMinimized], a
ld b, $1 ld b, SET_PAL_BATTLE
call GoPAL_SET call RunPaletteCommand
ld hl, W_ENEMYBATTSTATUS1 ld hl, W_ENEMYBATTSTATUS1
res UsingTrappingMove, [hl] res UsingTrappingMove, [hl]
ld a, $1 ld a, $1
@ -1926,7 +1926,7 @@ DrawPlayerHUDAndHPBar: ; 3cd60 (f:4d60)
predef DrawHP predef DrawHP
ld a, $1 ld a, $1
ld [H_AUTOBGTRANSFERENABLED], a ld [H_AUTOBGTRANSFERENABLED], a
ld hl, wcf1d ld hl, wPlayerHPBarColor
call GetBattleHealthBarColor call GetBattleHealthBarColor
ld hl, wBattleMonHP ld hl, wBattleMonHP
ld a, [hli] ld a, [hli]
@ -1935,8 +1935,8 @@ DrawPlayerHUDAndHPBar: ; 3cd60 (f:4d60)
ld a, [wccf6] ld a, [wccf6]
and a and a
ret nz ret nz
ld a, [wcf1d] ld a, [wPlayerHPBarColor]
cp $2 cp HP_BAR_RED
jr z, .asm_3cde6 jr z, .asm_3cde6
.asm_3cdd9 .asm_3cdd9
ld hl, wLowHealthAlarm ld hl, wLowHealthAlarm
@ -2039,7 +2039,7 @@ DrawEnemyHUDAndHPBar: ; 3cdec (f:4dec)
call DrawHPBar call DrawHPBar
ld a, $1 ld a, $1
ld [H_AUTOBGTRANSFERENABLED], a ld [H_AUTOBGTRANSFERENABLED], a
ld hl, wcf1e ld hl, wEnemyHPBarColor
GetBattleHealthBarColor: ; 3ce90 (f:4e90) GetBattleHealthBarColor: ; 3ce90 (f:4e90)
ld b, [hl] ld b, [hl]
@ -2047,8 +2047,8 @@ GetBattleHealthBarColor: ; 3ce90 (f:4e90)
ld a, [hl] ld a, [hl]
cp b cp b
ret z ret z
ld b, $1 ld b, SET_PAL_BATTLE
jp GoPAL_SET jp RunPaletteCommand
; center's mon's name on the battle screen ; center's mon's name on the battle screen
; if the name is 1 or 2 letters long, it is printed 2 spaces more to the right than usual ; if the name is 1 or 2 letters long, it is printed 2 spaces more to the right than usual
@ -2397,7 +2397,7 @@ PartyMenuOrRockOrRun:
call GBPalWhiteOut call GBPalWhiteOut
call LoadHudTilePatterns call LoadHudTilePatterns
call LoadScreenTilesFromBuffer2 call LoadScreenTilesFromBuffer2
call GoPAL_SET_CF1C call RunDefaultPaletteCommand
call GBPalNormal call GBPalNormal
jp DisplayBattleMenu jp DisplayBattleMenu
.partyMonDeselected .partyMonDeselected
@ -2486,7 +2486,7 @@ PartyMenuOrRockOrRun:
call ClearSprites call ClearSprites
call LoadHudTilePatterns call LoadHudTilePatterns
call LoadScreenTilesFromBuffer1 call LoadScreenTilesFromBuffer1
call GoPAL_SET_CF1C call RunDefaultPaletteCommand
call GBPalNormal call GBPalNormal
; fall through to SwitchPlayerMon ; fall through to SwitchPlayerMon
@ -6932,8 +6932,8 @@ InitWildBattle: ; 3ef8b (f:6f8b)
; common code that executes after init battle code specific to trainer or wild battles ; common code that executes after init battle code specific to trainer or wild battles
InitBattle_Common: ; 3efeb (f:6feb) InitBattle_Common: ; 3efeb (f:6feb)
ld b, $0 ld b, SET_PAL_BATTLE_BLACK
call GoPAL_SET call RunPaletteCommand
call SlidePlayerAndEnemySilhouettesOnScreen call SlidePlayerAndEnemySilhouettesOnScreen
xor a xor a
ld [H_AUTOBGTRANSFERENABLED], a ld [H_AUTOBGTRANSFERENABLED], a

View file

@ -16,9 +16,9 @@ InitBattleVariables: ; 525af (14:65af)
ld [wPlayerMonNumber], a ld [wPlayerMonNumber], a
ld [wEscapedFromBattle], a ld [wEscapedFromBattle], a
ld [wMapPalOffset], a ld [wMapPalOffset], a
ld hl, wcf1d ld hl, wPlayerHPBarColor
ld [hli], a ld [hli], a ; wPlayerHPBarColor
ld [hl], a ld [hl], a ; wEnemyHPBarColor
ld hl, wCanEvolveFlags ld hl, wCanEvolveFlags
ld b, $3c ld b, $3c
.loop .loop

View file

@ -3,8 +3,8 @@ _ScrollTrainerPicAfterBattle: ; 396d3 (e:56d3)
; the screen from the right. ; the screen from the right.
xor a xor a
ld [wEnemyMonSpecies2], a ld [wEnemyMonSpecies2], a
ld b, $1 ld b, SET_PAL_BATTLE
call GoPAL_SET call RunPaletteCommand
callab _LoadTrainerPic callab _LoadTrainerPic
coord hl, 19, 0 coord hl, 19, 0
ld c, $0 ld c, $0

View file

@ -1,6 +1,6 @@
DoClearSaveDialogue: ; 1c98a (7:498a) DoClearSaveDialogue: ; 1c98a (7:498a)
call ClearScreen call ClearScreen
call GoPAL_SET_CF1C call RunDefaultPaletteCommand
call LoadFontTilePatterns call LoadFontTilePatterns
call LoadTextBoxTilePatterns call LoadTextBoxTilePatterns
ld hl, ClearSaveDataText ld hl, ClearSaveDataText

View file

@ -21,8 +21,8 @@ EvolveMon: ; 7bde9 (1e:7de9)
ld [H_AUTOBGTRANSFERENABLED], a ld [H_AUTOBGTRANSFERENABLED], a
ld [hTilesetType], a ld [hTilesetType], a
ld a, [wEvoOldSpecies] ld a, [wEvoOldSpecies]
ld [wcf1d], a ld [wWholeScreenPaletteMonSpecies], a
ld c, $0 ld c, 0
call EvolutionSetWholeScreenPalette call EvolutionSetWholeScreenPalette
ld a, [wEvoNewSpecies] ld a, [wEvoNewSpecies]
ld [wcf91], a ld [wcf91], a
@ -46,7 +46,7 @@ EvolveMon: ; 7bde9 (1e:7de9)
call PlayMusic call PlayMusic
ld c, 80 ld c, 80
call DelayFrames call DelayFrames
ld c, $1 ld c, 1 ; set PAL_BLACK instead of mon palette
call EvolutionSetWholeScreenPalette call EvolutionSetWholeScreenPalette
lb bc, $1, $10 lb bc, $1, $10
.animLoop .animLoop
@ -66,13 +66,13 @@ EvolveMon: ; 7bde9 (1e:7de9)
call Evolution_ChangeMonPic ; show the new species pic call Evolution_ChangeMonPic ; show the new species pic
ld a, [wEvoNewSpecies] ld a, [wEvoNewSpecies]
.done .done
ld [wcf1d], a ld [wWholeScreenPaletteMonSpecies], a
ld a, $ff ld a, $ff
ld [wNewSoundID], a ld [wNewSoundID], a
call PlaySound call PlaySound
ld a, [wcf1d] ld a, [wWholeScreenPaletteMonSpecies]
call PlayCry call PlayCry
ld c, $0 ld c, 0
call EvolutionSetWholeScreenPalette call EvolutionSetWholeScreenPalette
pop af pop af
ld [wd0b5], a ld [wd0b5], a
@ -94,8 +94,8 @@ EvolveMon: ; 7bde9 (1e:7de9)
jr .done jr .done
EvolutionSetWholeScreenPalette: ; 7beb4 (1e:7eb4) EvolutionSetWholeScreenPalette: ; 7beb4 (1e:7eb4)
ld b, $b ld b, SET_PAL_POKEMON_WHOLE_SCREEN
jp GoPAL_SET jp RunPaletteCommand
Evolution_LoadPic: ; 7beb9 (1e:7eb9) Evolution_LoadPic: ; 7beb9 (1e:7eb9)
call GetMonHeader call GetMonHeader

View file

@ -104,7 +104,7 @@ HoFShowMonOrPlayer: ; 70278 (1c:4278)
ld [wcf91], a ld [wcf91], a
ld [wd0b5], a ld [wd0b5], a
ld [wBattleMonSpecies2], a ld [wBattleMonSpecies2], a
ld [wcf1d], a ld [wWholeScreenPaletteMonSpecies], a
ld a, [wHoFMonOrPlayer] ld a, [wHoFMonOrPlayer]
and a and a
jr z, .showMon jr z, .showMon
@ -117,9 +117,9 @@ HoFShowMonOrPlayer: ; 70278 (1c:4278)
call LoadFrontSpriteByMonIndex call LoadFrontSpriteByMonIndex
predef LoadMonBackPic predef LoadMonBackPic
.next1 .next1
ld b, $b ld b, SET_PAL_POKEMON_WHOLE_SCREEN
ld c, $0 ld c, 0
call GoPAL_SET call RunPaletteCommand
ld a, %11100100 ld a, %11100100
ld [rBGP], a ld [rBGP], a
ld c, $31 ; back pic ld c, $31 ; back pic

View file

@ -18,8 +18,8 @@ PlayIntro: ; 41682 (10:5682)
ret ret
PlayIntroScene: ; 4169d (10:569d) PlayIntroScene: ; 4169d (10:569d)
ld b, $7 ld b, SET_PAL_NIDORINO_INTRO
call GoPAL_SET call RunPaletteCommand
ld a, %11100100 ld a, %11100100
ld [rBGP], a ld [rBGP], a
ld [rOBP0], a ld [rOBP0], a
@ -302,8 +302,8 @@ LoadIntroGraphics: ; 41852 (10:5852)
jp FarCopyData2 jp FarCopyData2
PlayShootingStar: ; 4188a (10:588a) PlayShootingStar: ; 4188a (10:588a)
ld b, $c ld b, SET_PAL_GAME_FREAK_INTRO
call GoPAL_SET call RunPaletteCommand
callba LoadCopyrightAndTextBoxTiles callba LoadCopyrightAndTextBoxTiles
ld a, $e4 ld a, $e4
ld [rBGP], a ld [rBGP], a

View file

@ -127,7 +127,7 @@ ItemUseBall: ; d687 (3:5687)
ld hl,W_NUMSAFARIBALLS ld hl,W_NUMSAFARIBALLS
dec [hl] dec [hl]
.skipSafariZoneCode .skipSafariZoneCode
call GoPAL_SET_CF1C call RunDefaultPaletteCommand
ld a,$43 ld a,$43
ld [wd11e],a ld [wd11e],a
call LoadScreenTilesFromBuffer1 ;restore screenBuffer from Backup call LoadScreenTilesFromBuffer1 ;restore screenBuffer from Backup
@ -1111,7 +1111,7 @@ ItemUseMedicine: ; dabb (3:5abb)
and a ; using Softboiled? and a ; using Softboiled?
ret nz ; if so, return ret nz ; if so, return
call GBPalWhiteOut call GBPalWhiteOut
call z,GoPAL_SET_CF1C call z,RunDefaultPaletteCommand
ld a,[W_ISINBATTLE] ld a,[W_ISINBATTLE]
and a and a
ret nz ret nz
@ -1928,7 +1928,7 @@ ItemUsePPRestore: ; e31e (3:631e)
pop af pop af
ld [wWhichPokemon],a ld [wWhichPokemon],a
call GBPalWhiteOut call GBPalWhiteOut
call GoPAL_SET_CF1C call RunDefaultPaletteCommand
jp RemoveUsedItem jp RemoveUsedItem
.afterRestoringPP ; after using a (Max) Ether/Elixir .afterRestoringPP ; after using a (Max) Ether/Elixir
ld a,[wWhichPokemon] ld a,[wWhichPokemon]
@ -2032,7 +2032,7 @@ ItemUsePPRestore: ; e31e (3:631e)
call ItemUseNoEffect call ItemUseNoEffect
.itemNotUsed .itemNotUsed
call GBPalWhiteOut call GBPalWhiteOut
call GoPAL_SET_CF1C call RunDefaultPaletteCommand
pop af pop af
xor a xor a
ld [wActionResultOrTookBattleTurn],a ; item use failed ld [wActionResultOrTookBattleTurn],a ; item use failed
@ -2125,7 +2125,7 @@ ItemUseTMHM: ; e479 (3:6479)
pop af pop af
call GBPalWhiteOutWithDelay3 call GBPalWhiteOutWithDelay3
call ClearSprites call ClearSprites
call GoPAL_SET_CF1C call RunDefaultPaletteCommand
jp LoadScreenTilesFromBuffer1 ; restore saved screen jp LoadScreenTilesFromBuffer1 ; restore saved screen
.checkIfAbleToLearnMove .checkIfAbleToLearnMove
predef CanLearnTM ; check if the pokemon can learn the move predef CanLearnTM ; check if the pokemon can learn the move
@ -2201,7 +2201,7 @@ ItemUseNotYoursToUse: ; e586 (3:6586)
jr ItemUseFailed jr ItemUseFailed
ThrowBallAtTrainerMon: ; e58b (3:658b) ThrowBallAtTrainerMon: ; e58b (3:658b)
call GoPAL_SET_CF1C call RunDefaultPaletteCommand
call LoadScreenTilesFromBuffer1 ; restore saved screen call LoadScreenTilesFromBuffer1 ; restore saved screen
call Delay3 call Delay3
ld a,TOSS_ANIM ld a,TOSS_ANIM

View file

@ -450,7 +450,7 @@ DisplayDepositWithdrawMenu: ; 2174b (8:574b)
predef StatusScreen2 predef StatusScreen2
call LoadScreenTilesFromBuffer1 call LoadScreenTilesFromBuffer1
call ReloadTilesetTilePatterns call ReloadTilesetTilePatterns
call GoPAL_SET_CF1C call RunDefaultPaletteCommand
call LoadGBPal call LoadGBPal
jr .loop jr .loop

View file

@ -55,8 +55,8 @@ DisplayDiploma: ; 566e2 (15:66e2)
call EnableLCD call EnableLCD
callba LoadTrainerInfoTextBoxTiles callba LoadTrainerInfoTextBoxTiles
ld b, $8 ld b, SET_PAL_GENERIC
call GoPAL_SET call RunPaletteCommand
call Delay3 call Delay3
call GBPalNormal call GBPalNormal
ld a, $90 ld a, $90

View file

@ -47,7 +47,7 @@ PKMNLeaguePC: ; 0x7657e
res 6, [hl] res 6, [hl]
call GBPalWhiteOutWithDelay3 call GBPalWhiteOutWithDelay3
call ClearScreen call ClearScreen
call GoPAL_SET_CF1C call RunDefaultPaletteCommand
jp GBPalNormal jp GBPalNormal
LeaguePCShowTeam: ; 765e5 (1d:65e5) LeaguePCShowTeam: ; 765e5 (1d:65e5)
@ -86,15 +86,15 @@ LeaguePCShowMon: ; 76610 (1d:6610)
ld [wcf91], a ld [wcf91], a
ld [wd0b5], a ld [wd0b5], a
ld [wBattleMonSpecies2], a ld [wBattleMonSpecies2], a
ld [wcf1d], a ld [wWholeScreenPaletteMonSpecies], a
ld a, [hli] ld a, [hli]
ld [wHoFMonLevel], a ld [wHoFMonLevel], a
ld de, wcd6d ld de, wcd6d
ld bc, NAME_LENGTH ld bc, NAME_LENGTH
call CopyData call CopyData
ld b, $0B ld b, SET_PAL_POKEMON_WHOLE_SCREEN
ld c, 0 ld c, 0
call GoPAL_SET call RunPaletteCommand
coord hl, 12, 5 coord hl, 12, 5
call GetMonHeader call GetMonHeader
call LoadFrontSpriteByMonIndex call LoadFrontSpriteByMonIndex

View file

@ -24,7 +24,7 @@ MainMenu: ; 5af2 (1:5af2)
ld hl,wd72e ld hl,wd72e
res 6,[hl] res 6,[hl]
call ClearScreen call ClearScreen
call GoPAL_SET_CF1C call RunDefaultPaletteCommand
call LoadTextBoxTilePatterns call LoadTextBoxTilePatterns
call LoadFontTilePatterns call LoadFontTilePatterns
ld hl,wd730 ld hl,wd730

View file

@ -88,8 +88,8 @@ DisplayNamingScreen: ; 6596 (1:6596)
call GBPalWhiteOutWithDelay3 call GBPalWhiteOutWithDelay3
call ClearScreen call ClearScreen
call UpdateSprites call UpdateSprites
ld b, $8 ld b, SET_PAL_GENERIC
call GoPAL_SET call RunPaletteCommand
call LoadHpBarAndStatusTilePatterns call LoadHpBarAndStatusTilePatterns
call LoadEDTile call LoadEDTile
callba LoadMonPartySpriteGfx callba LoadMonPartySpriteGfx
@ -163,7 +163,7 @@ DisplayNamingScreen: ; 6596 (1:6596)
call GBPalWhiteOutWithDelay3 call GBPalWhiteOutWithDelay3
call ClearScreen call ClearScreen
call ClearSprites call ClearSprites
call GoPAL_SET_CF1C call RunDefaultPaletteCommand
call GBPalNormal call GBPalNormal
xor a xor a
ld [W_SUBANIMTRANSFORM], a ld [W_SUBANIMTRANSFORM], a

View file

@ -29,13 +29,13 @@ RedrawPartyMenu_: ; 12ce3 (4:6ce3)
cp a,SWAP_MONS_PARTY_MENU cp a,SWAP_MONS_PARTY_MENU
jp z,.printMessage jp z,.printMessage
call ErasePartyMenuCursors call ErasePartyMenuCursors
callba SendBlkPacket_PartyMenu callba InitPartyMenuBlkPacket
coord hl, 3, 0 coord hl, 3, 0
ld de,wPartySpecies ld de,wPartySpecies
xor a xor a
ld c,a ld c,a
ld [hPartyMonIndex],a ld [hPartyMonIndex],a
ld [wcf2d],a ld [wWhichPartyMenuHPBar],a
.loop .loop
ld a,[de] ld a,[de]
cp a,$FF ; reached the terminator? cp a,$FF ; reached the terminator?
@ -96,7 +96,7 @@ RedrawPartyMenu_: ; 12ce3 (4:6ce3)
ld a,[hFlags_0xFFF6] ld a,[hFlags_0xFFF6]
res 0,a res 0,a
ld [hFlags_0xFFF6],a ld [hFlags_0xFFF6],a
call SetPartyMenuHealthBarColor ; color the HP bar (on SGB) call SetPartyMenuHPBarColor ; color the HP bar (on SGB)
pop hl pop hl
jr .printLevel jr .printLevel
.teachMoveMenu .teachMoveMenu
@ -188,8 +188,8 @@ RedrawPartyMenu_: ; 12ce3 (4:6ce3)
.notAbleToEvolveText .notAbleToEvolveText
db "NOT ABLE@" db "NOT ABLE@"
.afterDrawingMonEntries .afterDrawingMonEntries
ld b,$0A ld b, SET_PAL_PARTY_MENU
call GoPAL_SET call RunPaletteCommand
.printMessage .printMessage
ld hl,wd730 ld hl,wd730
ld a,[hl] ld a,[hl]
@ -311,15 +311,15 @@ RareCandyText: ; 12ec0 (4:6ec0)
db $06 db $06
db "@" db "@"
SetPartyMenuHealthBarColor: ; 12ec7 (4:6ec7) SetPartyMenuHPBarColor: ; 12ec7 (4:6ec7)
ld hl, wcf1f ld hl, wPartyMenuHPBarColors
ld a, [wcf2d] ld a, [wWhichPartyMenuHPBar]
ld c, a ld c, a
ld b, $0 ld b, 0
add hl, bc add hl, bc
call GetHealthBarColor call GetHealthBarColor
ld b, $fc ld b, UPDATE_PARTY_MENU_BLK_PACKET
call GoPAL_SET call RunPaletteCommand
ld hl, wcf2d ld hl, wWhichPartyMenuHPBar
inc [hl] inc [hl]
ret ret

View file

@ -12,8 +12,8 @@ ShowPokedexMenu: ; 40000 (10:4000)
ld [wd11e],a ld [wd11e],a
ld [hJoy7],a ld [hJoy7],a
.setUpGraphics .setUpGraphics
ld b,$08 ld b, SET_PAL_GENERIC
call GoPAL_SET call RunPaletteCommand
callab LoadPokedexTilePatterns callab LoadPokedexTilePatterns
.doPokemonListMenu .doPokemonListMenu
ld hl,wTopMenuItemY ld hl,wTopMenuItemY
@ -41,7 +41,7 @@ ShowPokedexMenu: ; 40000 (10:4000)
pop af pop af
ld [wListScrollOffset],a ld [wListScrollOffset],a
call GBPalWhiteOutWithDelay3 call GBPalWhiteOutWithDelay3
call GoPAL_SET_CF1C call RunDefaultPaletteCommand
jp ReloadMapData jp ReloadMapData
.goToSideMenu .goToSideMenu
call HandlePokedexSideMenu call HandlePokedexSideMenu
@ -404,8 +404,8 @@ ShowPokedexDataInternal: ; 402e2 (10:42e2)
ld a,[wd11e] ; pokemon ID ld a,[wd11e] ; pokemon ID
ld [wcf91],a ld [wcf91],a
push af push af
ld b,04 ld b, SET_PAL_POKEDEX
call GoPAL_SET call RunPaletteCommand
pop af pop af
ld [wd11e],a ld [wd11e],a
ld a,[hTilesetType] ld a,[hTilesetType]
@ -561,7 +561,7 @@ ShowPokedexDataInternal: ; 402e2 (10:42e2)
ld [hTilesetType],a ld [hTilesetType],a
call GBPalWhiteOut call GBPalWhiteOut
call ClearScreen call ClearScreen
call GoPAL_SET_CF1C call RunDefaultPaletteCommand
call LoadTextBoxTilePatterns call LoadTextBoxTilePatterns
call GBPalNormal call GBPalNormal
ld hl,wd72c ld hl,wd72c

View file

@ -297,7 +297,7 @@ ErasePartyMenuCursors: ; 132ed (4:72ed)
ItemMenuLoop: ; 132fc (4:72fc) ItemMenuLoop: ; 132fc (4:72fc)
call LoadScreenTilesFromBuffer2DisableBGTransfer ; restore saved screen call LoadScreenTilesFromBuffer2DisableBGTransfer ; restore saved screen
call GoPAL_SET_CF1C call RunDefaultPaletteCommand
StartMenu_Item: ; 13302 (4:7302) StartMenu_Item: ; 13302 (4:7302)
ld a,[wLinkState] ld a,[wLinkState]
@ -506,14 +506,14 @@ StartMenu_TrainerInfo: ; 13460 (4:7460)
ld [hTilesetType],a ld [hTilesetType],a
call DrawTrainerInfo call DrawTrainerInfo
predef DrawBadges ; draw badges predef DrawBadges ; draw badges
ld b,$0d ld b, SET_PAL_TRAINER_CARD
call GoPAL_SET call RunPaletteCommand
call GBPalNormal call GBPalNormal
call WaitForTextScrollButtonPress ; wait for button press call WaitForTextScrollButtonPress ; wait for button press
call GBPalWhiteOut call GBPalWhiteOut
call LoadFontTilePatterns call LoadFontTilePatterns
call LoadScreenTilesFromBuffer2 ; restore saved screen call LoadScreenTilesFromBuffer2 ; restore saved screen
call GoPAL_SET_CF1C call RunDefaultPaletteCommand
call ReloadMapData call ReloadMapData
call LoadGBPal call LoadGBPal
pop af pop af

View file

@ -121,10 +121,10 @@ StatusScreen: ; 12953 (4:6953)
call PlaceString ; "TYPE1/" call PlaceString ; "TYPE1/"
coord hl, 11, 3 coord hl, 11, 3
predef DrawHP predef DrawHP
ld hl, wcf25 ld hl, wStatusScreenHPBarColor
call GetHealthBarColor call GetHealthBarColor
ld b, $3 ld b, SET_PAL_STATUS_SCREEN
call GoPAL_SET ; SGB palette call RunPaletteCommand
coord hl, 16, 6 coord hl, 16, 6
ld de, wLoadedMonStatus ld de, wLoadedMonStatus
call PrintStatusCondition call PrintStatusCondition

View file

@ -5,12 +5,12 @@ AnimatePartyMon_ForceSpeed1: ; 716f7 (1c:56f7)
inc a inc a
jr GetAnimationSpeed jr GetAnimationSpeed
; wcf1f contains the party mon's health bar colors ; wPartyMenuHPBarColors contains the party mon's health bar colors
; 0: green ; 0: green
; 1: yellow ; 1: yellow
; 2: red ; 2: red
AnimatePartyMon: ; 716ff (1c:56ff) AnimatePartyMon: ; 716ff (1c:56ff)
ld hl, wcf1f ld hl, wPartyMenuHPBarColors
ld a, [wCurrentMenuItem] ld a, [wCurrentMenuItem]
ld c, a ld c, a
ld b, $0 ld b, $0

View file

@ -1,33 +1,33 @@
Func_71ddf: ; 71ddf (1c:5ddf) _RunPaletteCommand: ; 71ddf (1c:5ddf)
call GetPredefRegisters call GetPredefRegisters
ld a, b ld a, b
cp $ff cp $ff
jr nz, .asm_71dea jr nz, .next
ld a, [wcf1c] ld a, [wDefaultPaletteCommand] ; use default command if command ID is $ff
.asm_71dea .next
cp $fc cp UPDATE_PARTY_MENU_BLK_PACKET
jp z, Func_71fc2 jp z, UpdatePartyMenuBlkPacket
ld l, a ld l, a
ld h, $0 ld h, 0
add hl, hl add hl, hl
ld de, PointerTable_71f73 ld de, SetPalFunctions
add hl, de add hl, de
ld a, [hli] ld a, [hli]
ld h, [hl] ld h, [hl]
ld l, a ld l, a
ld de, Func_72156 ld de, SendSGBPackets
push de push de
jp [hl] jp [hl]
SendPalPacket_Black: ; 71dff (1c:5dff) SetPal_BattleBlack: ; 71dff (1c:5dff)
ld hl, PalPacket_Black ld hl, PalPacket_Black
ld de, BlkPacket_Battle ld de, BlkPacket_Battle
ret ret
; uses PalPacket_Empty to build a packet based on mon IDs and health color ; uses PalPacket_Empty to build a packet based on mon IDs and health color
BuildBattlePalPacket: ; 71e06 (1c:5e06) SetPal_Battle: ; 71e06 (1c:5e06)
ld hl, PalPacket_Empty ld hl, PalPacket_Empty
ld de, wcf2d ld de, wPalPacket
ld bc, $10 ld bc, $10
call CopyData call CopyData
ld a, [W_PLAYERBATTSTATUS3] ld a, [W_PLAYERBATTSTATUS3]
@ -38,12 +38,12 @@ BuildBattlePalPacket: ; 71e06 (1c:5e06)
ld hl, wEnemyMonSpecies2 ld hl, wEnemyMonSpecies2
call DeterminePaletteID call DeterminePaletteID
ld c, a ld c, a
ld hl, wcf2e ld hl, wPalPacket + 1
ld a, [wcf1d] ld a, [wPlayerHPBarColor]
add PAL_GREENBAR add PAL_GREENBAR
ld [hli], a ld [hli], a
inc hl inc hl
ld a, [wcf1e] ld a, [wEnemyHPBarColor]
add PAL_GREENBAR add PAL_GREENBAR
ld [hli], a ld [hli], a
inc hl inc hl
@ -52,21 +52,21 @@ BuildBattlePalPacket: ; 71e06 (1c:5e06)
inc hl inc hl
ld a, c ld a, c
ld [hl], a ld [hl], a
ld hl, wcf2d ld hl, wPalPacket
ld de, BlkPacket_Battle ld de, BlkPacket_Battle
ld a, $1 ld a, SET_PAL_BATTLE
ld [wcf1c], a ld [wDefaultPaletteCommand], a
ret ret
SendPalPacket_TownMap: ; 71e48 (1c:5e48) SetPal_TownMap: ; 71e48 (1c:5e48)
ld hl, PalPacket_TownMap ld hl, PalPacket_TownMap
ld de, BlkPacket_WholeScreen ld de, BlkPacket_WholeScreen
ret ret
; uses PalPacket_Empty to build a packet based the mon ID ; uses PalPacket_Empty to build a packet based the mon ID
BuildStatusScreenPalPacket: ; 71e4f (1c:5e4f) SetPal_StatusScreen: ; 71e4f (1c:5e4f)
ld hl, PalPacket_Empty ld hl, PalPacket_Empty
ld de, wcf2d ld de, wPalPacket
ld bc, $10 ld bc, $10
call CopyData call CopyData
ld a, [wcf91] ld a, [wcf91]
@ -76,67 +76,67 @@ BuildStatusScreenPalPacket: ; 71e4f (1c:5e4f)
.pokemon .pokemon
call DeterminePaletteIDOutOfBattle call DeterminePaletteIDOutOfBattle
push af push af
ld hl, wcf2e ld hl, wPalPacket + 1
ld a, [wcf25] ld a, [wStatusScreenHPBarColor]
add PAL_GREENBAR add PAL_GREENBAR
ld [hli], a ld [hli], a
inc hl inc hl
pop af pop af
ld [hl], a ld [hl], a
ld hl, wcf2d ld hl, wPalPacket
ld de, BlkPacket_StatusScreen ld de, BlkPacket_StatusScreen
ret ret
SendPalPacket_PartyMenu: ; 71e7b (1c:5e7b) SetPal_PartyMenu: ; 71e7b (1c:5e7b)
ld hl, PalPacket_PartyMenu ld hl, PalPacket_PartyMenu
ld de, wcf2e ld de, wPartyMenuBlkPacket
ret ret
SendPalPacket_Pokedex: ; 71e82 (1c:5e82) SetPal_Pokedex: ; 71e82 (1c:5e82)
ld hl, PalPacket_Pokedex ld hl, PalPacket_Pokedex
ld de, wcf2d ld de, wPalPacket
ld bc, $10 ld bc, $10
call CopyData call CopyData
ld a, [wcf91] ld a, [wcf91]
call DeterminePaletteIDOutOfBattle call DeterminePaletteIDOutOfBattle
ld hl, wcf30 ld hl, wPalPacket + 3
ld [hl], a ld [hl], a
ld hl, wcf2d ld hl, wPalPacket
ld de, BlkPacket_Pokedex ld de, BlkPacket_Pokedex
ret ret
SendPalPacket_Slots: ; 71e9f (1c:5e9f) SetPal_Slots: ; 71e9f (1c:5e9f)
ld hl, PalPacket_Slots ld hl, PalPacket_Slots
ld de, BlkPacket_Slots ld de, BlkPacket_Slots
ret ret
SendPalPacket_Titlescreen: ; 71ea6 (1c:5ea6) SetPal_TitleScreen: ; 71ea6 (1c:5ea6)
ld hl, PalPacket_Titlescreen ld hl, PalPacket_Titlescreen
ld de, BlkPacket_Titlescreen ld de, BlkPacket_Titlescreen
ret ret
; used mostly for menus and the Oak intro ; used mostly for menus and the Oak intro
SendPalPacket_Generic: ; 71ead (1c:5ead) SetPal_Generic: ; 71ead (1c:5ead)
ld hl, PalPacket_Generic ld hl, PalPacket_Generic
ld de, BlkPacket_WholeScreen ld de, BlkPacket_WholeScreen
ret ret
SendPalPacket_NidorinoIntro: ; 71eb4 (1c:5eb4) SetPal_NidorinoIntro: ; 71eb4 (1c:5eb4)
ld hl, PalPacket_NidorinoIntro ld hl, PalPacket_NidorinoIntro
ld de, BlkPacket_NidorinoIntro ld de, BlkPacket_NidorinoIntro
ret ret
SendPalPacket_GameFreakIntro: ; 71ebb (1c:5ebb) SetPal_GameFreakIntro: ; 71ebb (1c:5ebb)
ld hl, PalPacket_GameFreakIntro ld hl, PalPacket_GameFreakIntro
ld de, BlkPacket_GameFreakIntro ld de, BlkPacket_GameFreakIntro
ld a, $8 ld a, SET_PAL_GENERIC
ld [wcf1c], a ld [wDefaultPaletteCommand], a
ret ret
; uses PalPacket_Empty to build a packet based on the current map ; uses PalPacket_Empty to build a packet based on the current map
BuildOverworldPalPacket: ; 71ec7 (1c:5ec7) SetPal_Overworld: ; 71ec7 (1c:5ec7)
ld hl, PalPacket_Empty ld hl, PalPacket_Empty
ld de, wcf2d ld de, wPalPacket
ld bc, $10 ld bc, $10
call CopyData call CopyData
ld a, [W_CURMAPTILESET] ld a, [W_CURMAPTILESET]
@ -162,12 +162,12 @@ BuildOverworldPalPacket: ; 71ec7 (1c:5ec7)
jr c, .town jr c, .town
ld a, PAL_ROUTE - 1 ld a, PAL_ROUTE - 1
.town .town
inc a ; a town's pallete ID is its map ID + 1 inc a ; a town's palette ID is its map ID + 1
ld hl, wcf2e ld hl, wPalPacket + 1
ld [hld], a ld [hld], a
ld de, BlkPacket_WholeScreen ld de, BlkPacket_WholeScreen
ld a, $9 ld a, SET_PAL_OVERWORLD
ld [wcf1c], a ld [wDefaultPaletteCommand], a
ret ret
.PokemonTowerOrAgatha .PokemonTowerOrAgatha
ld a, PAL_GREYMON - 1 ld a, PAL_GREYMON - 1
@ -181,131 +181,143 @@ BuildOverworldPalPacket: ; 71ec7 (1c:5ec7)
; used when a Pokemon is the only thing on the screen ; used when a Pokemon is the only thing on the screen
; such as evolution, trading and the Hall of Fame ; such as evolution, trading and the Hall of Fame
SendPokemonPalette_WholeScreen: ; 71f17 (1c:5f17) SetPal_PokemonWholeScreen: ; 71f17 (1c:5f17)
push bc push bc
ld hl, PalPacket_Empty ld hl, PalPacket_Empty
ld de, wcf2d ld de, wPalPacket
ld bc, $10 ld bc, $10
call CopyData call CopyData
pop bc pop bc
ld a, c ld a, c
and a and a
ld a, $1e ld a, PAL_BLACK
jr nz, .asm_71f31 jr nz, .next
ld a, [wcf1d] ld a, [wWholeScreenPaletteMonSpecies]
call DeterminePaletteIDOutOfBattle call DeterminePaletteIDOutOfBattle
.asm_71f31 .next
ld [wcf2e], a ld [wPalPacket + 1], a
ld hl, wcf2d ld hl, wPalPacket
ld de, BlkPacket_WholeScreen ld de, BlkPacket_WholeScreen
ret ret
BuildTrainerCardPalPacket: ; 71f3b (1c:5f3b) SetPal_TrainerCard: ; 71f3b (1c:5f3b)
ld hl, BlkPacket_TrainerCard ld hl, BlkPacket_TrainerCard
ld de, wcc5b ld de, wTrainerCardBlkPacket
ld bc, $40 ld bc, $40
call CopyData call CopyData
ld de, LoopCounts_71f8f ld de, BadgeBlkDataLengths
ld hl, wcc5d ld hl, wTrainerCardBlkPacket + 2
ld a, [W_OBTAINEDBADGES] ld a, [W_OBTAINEDBADGES]
ld c, $8 ld c, 8
.asm_71f52 .badgeLoop
srl a srl a
push af push af
jr c, .asm_71f62 jr c, .haveBadge
; The player doens't have the badge, so zero the badge's blk data.
push bc push bc
ld a, [de] ld a, [de]
ld c, a ld c, a
xor a xor a
.asm_71f5b .zeroBadgeDataLoop
ld [hli], a ld [hli], a
dec c dec c
jr nz, .asm_71f5b jr nz, .zeroBadgeDataLoop
pop bc pop bc
jr .asm_71f67 jr .nextBadge
.asm_71f62 .haveBadge
; The player does have the badge, so skip past the badge's blk data.
ld a, [de] ld a, [de]
.asm_71f63 .skipBadgeDataLoop
inc hl inc hl
dec a dec a
jr nz, .asm_71f63 jr nz, .skipBadgeDataLoop
.asm_71f67 .nextBadge
pop af pop af
inc de inc de
dec c dec c
jr nz, .asm_71f52 jr nz, .badgeLoop
ld hl, PalPacket_TrainerCard ld hl, PalPacket_TrainerCard
ld de, wcc5b ld de, wTrainerCardBlkPacket
ret ret
PointerTable_71f73: ; 71f73 (1c:5f73) SetPalFunctions: ; 71f73 (1c:5f73)
dw SendPalPacket_Black dw SetPal_BattleBlack
dw BuildBattlePalPacket dw SetPal_Battle
dw SendPalPacket_TownMap dw SetPal_TownMap
dw BuildStatusScreenPalPacket dw SetPal_StatusScreen
dw SendPalPacket_Pokedex dw SetPal_Pokedex
dw SendPalPacket_Slots dw SetPal_Slots
dw SendPalPacket_Titlescreen dw SetPal_TitleScreen
dw SendPalPacket_NidorinoIntro dw SetPal_NidorinoIntro
dw SendPalPacket_Generic dw SetPal_Generic
dw BuildOverworldPalPacket dw SetPal_Overworld
dw SendPalPacket_PartyMenu dw SetPal_PartyMenu
dw SendPokemonPalette_WholeScreen dw SetPal_PokemonWholeScreen
dw SendPalPacket_GameFreakIntro dw SetPal_GameFreakIntro
dw BuildTrainerCardPalPacket dw SetPal_TrainerCard
; each byte is the number of loops to make in .asm_71f5b for each badge ; The length of the blk data of each badge on the Trainer Card.
LoopCounts_71f8f: ; 71f8f (1c:5f8f) ; The Rainbow Badge has 3 entries because of its many colors.
db $06,$06,$06,$12,$06,$06,$06,$06 BadgeBlkDataLengths: ; 71f8f (1c:5f8f)
db 6 ; Boulder Badge
db 6 ; Cascade Badge
db 6 ; Thunder Badge
db 6 * 3 ; Rainbow Badge
db 6 ; Soul Badge
db 6 ; Marsh Badge
db 6 ; Volcano Badge
db 6 ; Earth Badge
DeterminePaletteID: ; 71f97 (1c:5f97) DeterminePaletteID: ; 71f97 (1c:5f97)
bit 3, a ; bit 3 of battle status 3, set if current Pokemon is transformed bit Transformed, a ; a is battle status 3
ld a, PAL_GREYMON ; if yes, use Ditto's palette ld a, PAL_GREYMON ; if the mon has used Transform, use Ditto's palette
ret nz ret nz
ld a, [hl] ld a, [hl]
DeterminePaletteIDOutOfBattle: ; 71f9d (1c:5f9d) DeterminePaletteIDOutOfBattle: ; 71f9d (1c:5f9d)
ld [wd11e], a ld [wd11e], a
and a and a ; is the mon index 0?
jr z, .idZero jr z, .skipDexNumConversion
push bc push bc
predef IndexToPokedex ; turn Pokemon ID number into Pokedex number predef IndexToPokedex
pop bc pop bc
ld a, [wd11e] ld a, [wd11e]
.idZero .skipDexNumConversion
ld e, a ld e, a
ld d, $00 ld d, 0
ld hl, MonsterPalettes ; not just for Pokemon, Trainers use it too ld hl, MonsterPalettes ; not just for Pokemon, Trainers use it too
add hl, de add hl, de
ld a, [hl] ld a, [hl]
ret ret
SendBlkPacket_PartyMenu: ; 71fb6 (1c:5fb6) InitPartyMenuBlkPacket: ; 71fb6 (1c:5fb6)
ld hl, BlkPacket_PartyMenu ld hl, BlkPacket_PartyMenu
ld de, wcf2e ld de, wPartyMenuBlkPacket
ld bc, $30 ld bc, $30
jp CopyData jp CopyData
Func_71fc2: ; 71fc2 (1c:5fc2) UpdatePartyMenuBlkPacket: ; 71fc2 (1c:5fc2)
ld hl, wcf1f ; Update the blk packet with the palette of the HP bar that is
ld a, [wcf2d] ; specified in [wWhichPartyMenuHPBar].
ld hl, wPartyMenuHPBarColors
ld a, [wWhichPartyMenuHPBar]
ld e, a ld e, a
ld d, $0 ld d, 0
add hl, de add hl, de
ld e, l ld e, l
ld d, h ld d, h
ld a, [de] ld a, [de]
and a and a
ld e, $5 ld e, (1 << 2) | 1 ; green
jr z, .asm_71fdb jr z, .next
dec a dec a
ld e, $a ld e, (2 << 2) | 2 ; yellow
jr z, .asm_71fdb jr z, .next
ld e, $f ld e, (3 << 2) | 3 ; red
.asm_71fdb .next
push de push de
ld hl, wcf37 ld hl, wPartyMenuBlkPacket + 8 + 1
ld bc, $6 ld bc, 6
ld a, [wcf2d] ld a, [wWhichPartyMenuHPBar]
call AddNTimes call AddNTimes
pop de pop de
ld [hl], e ld [hl], e
@ -321,11 +333,9 @@ SendSGBPacket: ; 71feb (1c:5feb)
.loop2 .loop2
; save B for later use ; save B for later use
push bc push bc
; load a non-zero value in $fff9 to disable the routine that checks actual ; disable ReadJoypad to prevent it from interfering with sending the packet
; joypad input (said routine, located at $15f, does nothing if $fff9 is not ld a, 1
; zero) ld [hDisableJoypadPolling], a
ld a,$01
ld [$fff9],a
; send RESET signal (P14=LOW, P15=LOW) ; send RESET signal (P14=LOW, P15=LOW)
xor a xor a
ld [rJOYP],a ld [rJOYP],a
@ -367,7 +377,7 @@ SendSGBPacket: ; 71feb (1c:5feb)
ld a,$30 ld a,$30
ld [rJOYP],a ld [rJOYP],a
xor a xor a
ld [$fff9],a ld [hDisableJoypadPolling],a
; wait for about 70000 cycles ; wait for about 70000 cycles
call Wait7000 call Wait7000
; restore (previously pushed) number of packets ; restore (previously pushed) number of packets
@ -383,39 +393,39 @@ LoadSGB: ; 7202b (1c:602b)
ld [wOnSGB], a ld [wOnSGB], a
call CheckSGB call CheckSGB
ret nc ret nc
ld a, $1 ld a, 1
ld [wOnSGB], a ld [wOnSGB], a
ld a, [wGBC] ld a, [wGBC]
and a and a
jr z, .asm_7203f jr z, .notGBC
ret ret
.asm_7203f .notGBC
di di
call Func_72075 call PrepareSuperNintendoVRAMTransfer
ei ei
ld a, $1 ld a, 1
ld [wcf2d], a ld [wCopyingSGBTileData], a
ld de, ChrTrnPacket ld de, ChrTrnPacket
ld hl, SGBBorderGraphics ld hl, SGBBorderGraphics
call Func_7210b call CopyGfxToSuperNintendoVRAM
xor a xor a
ld [wcf2d], a ld [wCopyingSGBTileData], a
ld de, PctTrnPacket ld de, PctTrnPacket
ld hl, BorderPalettes ld hl, BorderPalettes
call Func_7210b call CopyGfxToSuperNintendoVRAM
xor a xor a
ld [wcf2d], a ld [wCopyingSGBTileData], a
ld de, PalTrnPacket ld de, PalTrnPacket
ld hl, SuperPalettes ld hl, SuperPalettes
call Func_7210b call CopyGfxToSuperNintendoVRAM
call ClearVram call ClearVram
ld hl, MaskEnCancelPacket ld hl, MaskEnCancelPacket
jp SendSGBPacket jp SendSGBPacket
Func_72075: ; 72075 (1c:6075) PrepareSuperNintendoVRAMTransfer: ; 72075 (1c:6075)
ld hl, PointerTable_72089 ld hl, .packetPointers
ld c, $9 ld c, 9
.asm_7207a .loop
push bc push bc
ld a, [hli] ld a, [hli]
push hl push hl
@ -426,10 +436,11 @@ Func_72075: ; 72075 (1c:6075)
inc hl inc hl
pop bc pop bc
dec c dec c
jr nz, .asm_7207a jr nz, .loop
ret ret
PointerTable_72089: ; 72089 (1c:6089) .packetPointers
; Only the first packet is needed.
dw MaskEnFreezePacket dw MaskEnFreezePacket
dw DataSnd_72548 dw DataSnd_72548
dw DataSnd_72558 dw DataSnd_72558
@ -441,17 +452,18 @@ PointerTable_72089: ; 72089 (1c:6089)
dw DataSnd_725b8 dw DataSnd_725b8
CheckSGB: ; 7209b (1c:609b) CheckSGB: ; 7209b (1c:609b)
; Returns whether the game is running on an SGB in carry.
ld hl, MltReq2Packet ld hl, MltReq2Packet
di di
call SendSGBPacket call SendSGBPacket
ld a, $1 ld a, 1
ld [$fff9], a ld [hDisableJoypadPolling], a
ei ei
call Wait7000 call Wait7000
ld a, [rJOYP] ld a, [rJOYP]
and $3 and $3
cp $3 cp $3
jr nz, .asm_720fd jr nz, .isSGB
ld a, $20 ld a, $20
ld [rJOYP], a ld [rJOYP], a
ld a, [rJOYP] ld a, [rJOYP]
@ -482,50 +494,50 @@ CheckSGB: ; 7209b (1c:609b)
ld a, [rJOYP] ld a, [rJOYP]
and $3 and $3
cp $3 cp $3
jr nz, .asm_720fd jr nz, .isSGB
call Func_72102 call SendMltReq1Packet
and a and a
ret ret
.asm_720fd .isSGB
call Func_72102 call SendMltReq1Packet
scf scf
ret ret
Func_72102: ; 72102 (1c:6102) SendMltReq1Packet: ; 72102 (1c:6102)
ld hl, MltReq1Packet ld hl, MltReq1Packet
call SendSGBPacket call SendSGBPacket
jp Wait7000 jp Wait7000
Func_7210b: ; 7210b (1c:610b) CopyGfxToSuperNintendoVRAM: ; 7210b (1c:610b)
di di
push de push de
call DisableLCD call DisableLCD
ld a, $e4 ld a, $e4
ld [rBGP], a ld [rBGP], a
ld de, vChars1 ld de, vChars1
ld a, [wcf2d] ld a, [wCopyingSGBTileData]
and a and a
jr z, .asm_72122 jr z, .notCopyingTileData
call Func_72188 call CopySGBBorderTiles
jr .asm_72128 jr .next
.asm_72122 .notCopyingTileData
ld bc, $1000 ld bc, $1000
call CopyData call CopyData
.asm_72128 .next
ld hl, vBGMap0 ld hl, vBGMap0
ld de, $c ld de, $c
ld a, $80 ld a, $80
ld c, $d ld c, $d
.asm_72132 .loop
ld b, $14 ld b, $14
.asm_72134 .innerLoop
ld [hli], a ld [hli], a
inc a inc a
dec b dec b
jr nz, .asm_72134 jr nz, .innerLoop
add hl, de add hl, de
dec c dec c
jr nz, .asm_72132 jr nz, .loop
ld a, $e3 ld a, $e3
ld [rLCDC], a ld [rLCDC], a
pop hl pop hl
@ -548,27 +560,27 @@ Wait7000: ; 7214a (1c:614a)
jr nz, .loop jr nz, .loop
ret ret
Func_72156: ; 72156 (1c:6156) SendSGBPackets: ; 72156 (1c:6156)
ld a, [wGBC] ld a, [wGBC]
and a and a
jr z, .asm_72165 jr z, .notGBC
push de push de
call Func_7216d call InitGBCPalettes
pop hl pop hl
call Func_72187 call EmptyFunc5
ret ret
.asm_72165 .notGBC
push de push de
call SendSGBPacket call SendSGBPacket
pop hl pop hl
jp SendSGBPacket jp SendSGBPacket
Func_7216d: ; 7216d (1c:616d) InitGBCPalettes: ; 7216d (1c:616d)
ld a, $80 ld a, $80 ; index 0 with auto-increment
ld [$ff68], a ld [rBGPI], a
inc hl inc hl
ld c, $20 ld c, $20
.asm_72174 .loop
ld a, [hli] ld a, [hli]
inc hl inc hl
add a add a
@ -576,37 +588,48 @@ Func_7216d: ; 7216d (1c:616d)
add a add a
ld de, SuperPalettes ld de, SuperPalettes
add e add e
jr nc, .asm_72180 jr nc, .noCarry
inc d inc d
.asm_72180 .noCarry
ld a, [de] ld a, [de]
ld [$ff69], a ld [rBGPD], a
dec c dec c
jr nz, .asm_72174 jr nz, .loop
ret ret
Func_72187: ; 72187 (1c:6187) EmptyFunc5: ; 72187 (1c:6187)
ret ret
Func_72188: ; 72188 (1c:6188) CopySGBBorderTiles: ; 72188 (1c:6188)
ld b, $80 ; SGB tile data is stored in a 4BPP planar format.
.asm_7218a ; Each tile is 32 bytes. The first 16 bytes contain bit planes 1 and 2, while
ld c, $10 ; the second 16 bytes contain bit planes 3 and 4.
.asm_7218c ; This function converts 2BPP planar data into this format by mapping
; 2BPP colors 0-3 to 4BPP colors 0-3. 4BPP colors 4-15 are not used.
ld b, 128
.tileLoop
; Copy bit planes 1 and 2 of the tile data.
ld c, 16
.copyLoop
ld a, [hli] ld a, [hli]
ld [de], a ld [de], a
inc de inc de
dec c dec c
jr nz, .asm_7218c jr nz, .copyLoop
ld c, $10
; Zero bit planes 3 and 4.
ld c, 16
xor a xor a
.asm_72195 .zeroLoop
ld [de], a ld [de], a
inc de inc de
dec c dec c
jr nz, .asm_72195 jr nz, .zeroLoop
dec b dec b
jr nz, .asm_7218a jr nz, .tileLoop
ret ret
INCLUDE "data/sgb_packets.asm" INCLUDE "data/sgb_packets.asm"

View file

@ -121,7 +121,7 @@ PredefPointers:: ; 4fe79 (13:7e79)
add_predef SetPartyMonTypes add_predef SetPartyMonTypes
add_predef CanLearnTM add_predef CanLearnTM
add_predef TMToMove add_predef TMToMove
add_predef Func_71ddf add_predef _RunPaletteCommand
add_predef StarterDex ; 46 add_predef StarterDex ; 46
add_predef _AddPartyMon add_predef _AddPartyMon
add_predef UpdateHPBar2 add_predef UpdateHPBar2

View file

@ -21,8 +21,8 @@ PromptUserToPlaySlots: ; 3730e (d:730e)
call GBPalWhiteOutWithDelay3 call GBPalWhiteOutWithDelay3
call LoadSlotMachineTiles call LoadSlotMachineTiles
call LoadFontTilePatterns call LoadFontTilePatterns
ld b, $5 ld b, SET_PAL_SLOTS
call GoPAL_SET call RunPaletteCommand
call GBPalNormal call GBPalNormal
ld a, $e4 ld a, $e4
ld [rOBP0], a ld [rOBP0], a
@ -41,7 +41,7 @@ PromptUserToPlaySlots: ; 3730e (d:730e)
call GBPalWhiteOutWithDelay3 call GBPalWhiteOutWithDelay3
ld a, $1 ld a, $1
ld [wUpdateSpritesEnabled], a ld [wUpdateSpritesEnabled], a
call GoPAL_SET_CF1C call RunDefaultPaletteCommand
call ReloadMapSpriteTilePatterns call ReloadMapSpriteTilePatterns
call ReloadTilesetTilePatterns call ReloadTilesetTilePatterns
.done .done

View file

@ -134,8 +134,8 @@ ENDC
call LoadScreenTilesFromBuffer2 call LoadScreenTilesFromBuffer2
ld a, vBGMap0 / $100 ld a, vBGMap0 / $100
call TitleScreenCopyTileMapToVRAM call TitleScreenCopyTileMapToVRAM
ld b, $6 ld b, SET_PAL_TITLE_SCREEN
call GoPAL_SET call RunPaletteCommand
call GBPalNormal call GBPalNormal
ld a, %11100100 ld a, %11100100
ld [rOBP0], a ld [rOBP0], a

View file

@ -314,8 +314,8 @@ LoadTownMap: ; 7109b (1c:509b)
jr .nextTile jr .nextTile
.done .done
call EnableLCD call EnableLCD
ld b, $2 ld b, SET_PAL_TOWN_MAP
call GoPAL_SET call RunPaletteCommand
call Delay3 call Delay3
call GBPalNormal call GBPalNormal
xor a xor a
@ -338,7 +338,7 @@ ExitTownMap: ; 711ab (1c:51ab)
call LoadPlayerSpriteGraphics call LoadPlayerSpriteGraphics
call LoadFontTilePatterns call LoadFontTilePatterns
call UpdateSprites call UpdateSprites
jp GoPAL_SET_CF1C jp RunDefaultPaletteCommand
DrawPlayerOrBirdSprite: ; 711c4 (1c:51c4) DrawPlayerOrBirdSprite: ; 711c4 (1c:51c4)
; a = map number ; a = map number

View file

@ -268,8 +268,8 @@ Trade_DrawOpenEndOfLinkCable: ; 41298 (10:5298)
call Trade_ClearTileMap call Trade_ClearTileMap
ld b, vBGMap0 / $100 ld b, vBGMap0 / $100
call CopyScreenTileBufferToVRAM call CopyScreenTileBufferToVRAM
ld b, $8 ld b, SET_PAL_GENERIC
call GoPAL_SET call RunPaletteCommand
; This function call is pointless. It just copies blank tiles to VRAM that was ; This function call is pointless. It just copies blank tiles to VRAM that was
; already filled with blank tiles. ; already filled with blank tiles.
@ -727,10 +727,10 @@ Trade_CircleOAM3: ; 4159c (10:559c)
Trade_LoadMonSprite: ; 415a4 (10:55a4) Trade_LoadMonSprite: ; 415a4 (10:55a4)
ld [wcf91], a ld [wcf91], a
ld [wd0b5], a ld [wd0b5], a
ld [wcf1d], a ld [wWholeScreenPaletteMonSpecies], a
ld b, $b ld b, SET_PAL_POKEMON_WHOLE_SCREEN
ld c, $0 ld c, 0
call GoPAL_SET call RunPaletteCommand
ld a, [H_AUTOBGTRANSFERENABLED] ld a, [H_AUTOBGTRANSFERENABLED]
xor $1 xor $1
ld [H_AUTOBGTRANSFERENABLED], a ld [H_AUTOBGTRANSFERENABLED], a

View file

@ -4469,7 +4469,7 @@ RestoreScreenTilesAndReloadTilePatterns:: ; 3dbe (0:3dbe)
call ReloadMapSpriteTilePatterns call ReloadMapSpriteTilePatterns
call LoadScreenTilesFromBuffer2 call LoadScreenTilesFromBuffer2
call LoadTextBoxTilePatterns call LoadTextBoxTilePatterns
call GoPAL_SET_CF1C call RunDefaultPaletteCommand
jr Delay3 jr Delay3
@ -4499,13 +4499,13 @@ GBPalWhiteOut::
ret ret
GoPAL_SET_CF1C:: ; 3ded (0:3ded) RunDefaultPaletteCommand:: ; 3ded (0:3ded)
ld b,$ff ld b,$ff
GoPAL_SET:: ; 3def (0:3def) RunPaletteCommand:: ; 3def (0:3def)
ld a,[wOnSGB] ld a,[wOnSGB]
and a and a
ret z ret z
predef_jump Func_71ddf predef_jump _RunPaletteCommand
GetHealthBarColor:: GetHealthBarColor::
; Return at hl the palette of ; Return at hl the palette of

View file

@ -659,8 +659,8 @@ CheckMapConnections:: ; 07ba (0:07ba)
.loadNewMap ; load the connected map that was entered .loadNewMap ; load the connected map that was entered
call LoadMapHeader call LoadMapHeader
call PlayDefaultMusicFadeOutCurrent call PlayDefaultMusicFadeOutCurrent
ld b,$09 ld b, SET_PAL_OVERWORLD
call GoPAL_SET call RunPaletteCommand
; Since the sprite set shouldn't change, this will just update VRAM slots at ; Since the sprite set shouldn't change, this will just update VRAM slots at
; $C2XE without loading any tile patterns. ; $C2XE without loading any tile patterns.
callba InitMapSprites callba InitMapSprites
@ -2343,8 +2343,8 @@ LoadMapData:: ; 1241 (0:1241)
ld a,$01 ld a,$01
ld [wUpdateSpritesEnabled],a ld [wUpdateSpritesEnabled],a
call EnableLCD call EnableLCD
ld b,$09 ld b, SET_PAL_OVERWORLD
call GoPAL_SET call RunPaletteCommand
call LoadPlayerSpriteGraphics call LoadPlayerSpriteGraphics
ld a,[wd732] ld a,[wd732]
and a,1 << 4 | 1 << 3 ; fly warp or dungeon warp and a,1 << 4 | 1 << 3 ; fly warp or dungeon warp

View file

@ -74,7 +74,7 @@ VBlank::
callba TrackPlayTime ; keep track of time played callba TrackPlayTime ; keep track of time played
ld a, [$fff9] ld a, [hDisableJoypadPolling]
and a and a
call z, ReadJoypad call z, ReadJoypad

View file

@ -317,5 +317,7 @@ hFlags_0xFFF6 EQU $FFF6
hFieldMoveMonMenuTopMenuItemX EQU $FFF7 hFieldMoveMonMenuTopMenuItemX EQU $FFF7
hDisableJoypadPolling EQU $FFF9
hJoyInput EQU $FFF8 hJoyInput EQU $FFF8

View file

@ -3156,7 +3156,7 @@ RedrawMapView: ; eedc (3:6edc)
ld [H_AUTOBGTRANSFERENABLED], a ld [H_AUTOBGTRANSFERENABLED], a
ld [hTilesetType], a ; no flower/water BG tile animations ld [hTilesetType], a ; no flower/water BG tile animations
call LoadCurrentMapView call LoadCurrentMapView
call GoPAL_SET_CF1C call RunDefaultPaletteCommand
ld hl, wMapViewVRAMPointer ld hl, wMapViewVRAMPointer
ld a, [hli] ld a, [hli]
ld h, [hl] ld h, [hl]

View file

@ -477,6 +477,9 @@ wNPCMovementScriptBank:: ; cc58
ds 2 ds 2
wTrainerCardBlkPacket:: ; cc5b
; $40 bytes
wSlotMachineSevenAndBarModeChance:: ; cc5b wSlotMachineSevenAndBarModeChance:: ; cc5b
; If a random number greater than this value is generated, then the player is ; If a random number greater than this value is generated, then the player is
; allowed to have three 7 symbols or bar symbols line up. ; allowed to have three 7 symbols or bar symbols line up.
@ -1283,15 +1286,40 @@ wOnSGB:: ; cf1b
; if running on SGB, it's 1, else it's 0 ; if running on SGB, it's 1, else it's 0
ds 1 ds 1
wcf1c:: ds 1 ; used with sgb palettes wDefaultPaletteCommand:: ; cf1c
wcf1d:: ds 1 ; used when displaying palettes for Pokemon ds 1
wcf1e:: ds 1 ; used to display palettes for HP bar
wcf1f:: ds 6 ; used to display HP bars in Pokemon Menu (probably palettes) wPlayerHPBarColor:: ; cf1d
wcf25:: ds 8 ; used to display HP bar for Pokemon Status Screen (probably palettes too)
wcf2d:: ds 1 ; also used to display HP bar for Pokemon Menu (something about HP colour) wWholeScreenPaletteMonSpecies:: ; cf1d
wcf2e:: ds 2 ; more HP bar palette stuff. ; species of the mon whose palette is used for the whole screen
wcf30:: ds 7 ; used with palettes (apparently for Pokedex) ds 1
wcf37:: ds 20 ; used with palletes too (used for Party Menu)
wEnemyHPBarColor:: ; cf1e
ds 1
; 0: green
; 1: yellow
; 2: red
wPartyMenuHPBarColors:: ; cf1f
ds 6
wStatusScreenHPBarColor:: ; cf25
ds 1
ds 7
wCopyingSGBTileData:: ; c2fd
wWhichPartyMenuHPBar:: ; cf2d
wPalPacket:: ; cf2d
ds 1
wPartyMenuBlkPacket:: ; cf2e
; $30 bytes
ds 29
wcf4b:: ds 1 ; storage buffer for various strings wcf4b:: ds 1 ; storage buffer for various strings
wcf4c:: ds 1 ; used with displaying EXP value, probably also overflowed with wcf4b wcf4c:: ds 1 ; used with displaying EXP value, probably also overflowed with wcf4b
wGainBoostedExp:: ; cf4d wGainBoostedExp:: ; cf4d