Further remove unnecessary DMG/SGB checking (#7) and remove SGB layouts and palette data (#1)

This commit is contained in:
xCrystal 2023-07-26 17:01:20 +02:00
parent acd022d765
commit d30b9dd60f
68 changed files with 284 additions and 1826 deletions

View File

@ -1,40 +1,39 @@
; CGBLayoutJumptable indexes (see engine/gfx/cgb_layouts.asm)
; SGBLayoutJumptable indexes (see engine/gfx/sgb_layouts.asm)
const_def
const SCGB_BATTLE_GRAYSCALE
const SCGB_BATTLE_COLORS
const SCGB_POKEGEAR_PALS
const SCGB_STATS_SCREEN_HP_PALS
const SCGB_POKEDEX
const SCGB_SLOT_MACHINE
const SCGB_BETA_TITLE_SCREEN
const SCGB_GS_INTRO
const SCGB_DIPLOMA
const SCGB_MAPPALS
const SCGB_PARTY_MENU
const SCGB_EVOLUTION
const SCGB_GS_TITLE_SCREEN
const SCGB_0D
const SCGB_MOVE_LIST
const SCGB_BETA_PIKACHU_MINIGAME
const SCGB_POKEDEX_SEARCH_OPTION
const SCGB_BETA_POKER
const SCGB_POKEPIC
const SCGB_MAGNET_TRAIN
const SCGB_PACKPALS
const SCGB_TRAINER_CARD
const SCGB_POKEDEX_UNOWN_MODE
const SCGB_BILLS_PC
const SCGB_UNOWN_PUZZLE
const SCGB_GAMEFREAK_LOGO
const SCGB_PLAYER_OR_MON_FRONTPIC_PALS
const SCGB_TRADE_TUBE
const SCGB_TRAINER_OR_MON_FRONTPIC_PALS
const SCGB_1D
DEF NUM_SCGB_LAYOUTS EQU const_value
const CGB_BATTLE_GRAYSCALE
const CGB_BATTLE_COLORS
const CGB_POKEGEAR_PALS
const CGB_STATS_SCREEN_HP_PALS
const CGB_POKEDEX
const CGB_SLOT_MACHINE
const CGB_BETA_TITLE_SCREEN
const CGB_GS_INTRO
const CGB_DIPLOMA
const CGB_MAPPALS
const CGB_PARTY_MENU
const CGB_EVOLUTION
const CGB_GS_TITLE_SCREEN
const CGB_0D
const CGB_MOVE_LIST
const CGB_BETA_PIKACHU_MINIGAME
const CGB_POKEDEX_SEARCH_OPTION
const CGB_BETA_POKER
const CGB_POKEPIC
const CGB_MAGNET_TRAIN
const CGB_PACKPALS
const CGB_TRAINER_CARD
const CGB_POKEDEX_UNOWN_MODE
const CGB_BILLS_PC
const CGB_UNOWN_PUZZLE
const CGB_GAMEFREAK_LOGO
const CGB_PLAYER_OR_MON_FRONTPIC_PALS
const CGB_TRADE_TUBE
const CGB_TRAINER_OR_MON_FRONTPIC_PALS
const CGB_1D
DEF NUM_CGB_LAYOUTS EQU const_value
DEF SCGB_PARTY_MENU_HP_BARS EQU $fc
DEF SCGB_DEFAULT EQU $ff
DEF CGB_PARTY_MENU_HP_BARS EQU $fc
DEF CGB_DEFAULT EQU $ff
; GetCrystalCGBLayout arguments (see engine/gfx/crystal_layouts.asm)
const_def
@ -42,7 +41,7 @@ DEF SCGB_DEFAULT EQU $ff
const CRYSTAL_CGB_MOBILE_1
const CRYSTAL_CGB_NAME_CARD
; PredefPals indexes (see gfx/sgb/predef.pal)
; PredefPals indexes (see gfx/predef/predef.pal)
; GetPredefPal arguments (see engine/gfx/color.asm)
const_def
const PREDEFPAL_ROUTES
@ -125,34 +124,3 @@ DEF SCGB_DEFAULT EQU $ff
const PREDEFPAL_GAMEFREAK_LOGO_OB
const PREDEFPAL_GAMEFREAK_LOGO_BG
DEF NUM_PREDEF_PALS EQU const_value
; SGB system command codes
; http://gbdev.gg8.se/wiki/articles/SGB_Functions#SGB_System_Command_Table
const_def
const SGB_PAL01
const SGB_PAL23
const SGB_PAL03
const SGB_PAL12
const SGB_ATTR_BLK
const SGB_ATTR_LIN
const SGB_ATTR_DIV
const SGB_ATTR_CHR
const SGB_SOUND
const SGB_SOU_TRN
const SGB_PAL_SET
const SGB_PAL_TRN
const SGB_ATRC_EN
const SGB_TEST_EN
const SGB_ICON_EN
const SGB_DATA_SND
const SGB_DATA_TRN
const SGB_MLT_REQ
const SGB_JUMP
const SGB_CHR_TRN
const SGB_PCT_TRN
const SGB_ATTR_TRN
const SGB_ATTR_SET
const SGB_MASK_EN
const SGB_OBJ_TRN
DEF PALPACKET_LENGTH EQU $10

View File

@ -1,8 +0,0 @@
; Crystal does not support SGB, so this is unused.
MapGroupRoofSGBPalInds:
; entries correspond to map groups
table_width 1, MapGroupRoofSGBPalInds
db PREDEFPAL_ROUTES
db PREDEFPAL_OLIVINE
assert_table_length NUM_MAP_GROUPS + 1

View File

@ -55,8 +55,7 @@ PredefPointers::
add_predef GetUnownLetter
add_predef LoadPoisonBGPals
add_predef DummyPredef2F
add_predef InitSGBBorder
add_predef LoadSGBLayout
add_predef LoadCGBLayout
add_predef Pokedex_GetArea
add_predef Unused_CheckShininess
add_predef DoBattleTransition

View File

@ -1,133 +0,0 @@
; macros taken from pokered's data/sgb_packets.asm
; names taken from pandocs
; http://gbdev.gg8.se/wiki/articles/SGB_Functions#SGB_Palette_Commands
MACRO sgb_pal_trn
db (SGB_PAL_TRN << 3) + 1
ds 15
ENDM
MACRO sgb_mlt_req
db (SGB_MLT_REQ << 3) + 1
db \1 - 1
ds 14
ENDM
MACRO sgb_chr_trn
db (SGB_CHR_TRN << 3) + 1
db \1 + (\2 << 1)
ds 14
ENDM
MACRO sgb_pct_trn
db (SGB_PCT_TRN << 3) + 1
ds 15
ENDM
MACRO sgb_mask_en
db (SGB_MASK_EN << 3) + 1
db \1
ds 14
ENDM
MACRO sgb_data_snd
db (SGB_DATA_SND << 3) + 1
dw \1 ; address
db \2 ; bank
db \3 ; length (1-11)
ENDM
; Crystal does not support SGB, so this is unused.
PalTrnPacket: sgb_pal_trn
MltReq1Packet: sgb_mlt_req 1
MltReq2Packet: sgb_mlt_req 2
ChrTrnPacket: sgb_chr_trn 0, 0
PctTrnPacket: sgb_pct_trn
MaskEnFreezePacket: sgb_mask_en 1
MaskEnCancelPacket: sgb_mask_en 0
; These are packets containing SNES code.
; This set of packets is found in several Japanese SGB-compatible titles.
; It appears to be part of NCL's SGB devkit.
DataSndPacket1:
sgb_data_snd $085d, $0, 11
db $8c ; cpx #$8c (2)
db $d0, $f4 ; bne -$0c
db $60 ; rts
ds 7
DataSndPacket2:
sgb_data_snd $0852, $0, 11
db $a9, $e7 ; lda #$e7
db $9f, $01, $c0, $7e ; sta $7ec001, x
db $e8 ; inx
db $e8 ; inx
db $e8 ; inx
db $e8 ; inx
db $e0 ; cpx #$8c (1)
DataSndPacket3:
sgb_data_snd $0847, $0, 11
db $c4 ; cmp #$c4 (2)
db $d0, $16 ; bne +$16
db $a5 ; lda dp
db $cb ; wai
db $c9, $05 ; cmp #$05
db $d0, $10 ; bne +$10
db $a2, $28 ; ldx #$28
DataSndPacket4:
sgb_data_snd $083c, $0, 11
db $f0, $12 ; beq +$12
db $a5 ; lda dp
db $c9, $c9 ; cmp #$c9
db $c8 ; iny
db $d0, $1c ; bne +$1c
db $a5 ; lda dp
db $ca ; dex
db $c9 ; cmp #$c4 (1)
DataSndPacket5:
sgb_data_snd $0831, $0, 11
dbw $0c, $caa5 ; tsb $caa5
db $c9, $7e ; cmp #$7e
db $d0, $06 ; bne +$06
db $a5 ; lda dp
db $cb ; wai
db $c9, $7e ; cmp #$7e
DataSndPacket6:
sgb_data_snd $0826, $0, 11
db $39 ; bne +$39 (2)
dbw $cd, $0c48 ; cmp $0c48
db $d0, $34 ; bne +$34
db $a5 ; lda dp
db $c9, $c9 ; cmp #$c9
db $80, $d0 ; bra -$30
DataSndPacket7:
sgb_data_snd $081b, $0, 11
db $ea ; nop
db $ea ; nop
db $ea ; nop
db $ea ; nop
db $ea ; nop
; $0820:
db $a9, $01 ; lda #01
dbw $cd, $0c4f ; cmp $c4f
db $d0 ; bne +$39 (1)
DataSndPacket8:
sgb_data_snd $0810, $0, 11
dbw $4c, $0820 ; jmp $0820
db $ea ; nop
db $ea ; nop
db $ea ; nop
db $ea ; nop
db $ea ; nop
db $60 ; rts
db $ea ; nop
db $ea ; nop

View File

@ -2654,7 +2654,7 @@ ForcePlayerMonChoice:
call ExitMenu
call LoadTilemapToTempTilemap
call WaitBGMap
call GetMemSGBLayout
call GetMemCGBLayout
call SetPalettes
xor a
ld c, a
@ -2673,7 +2673,7 @@ ForcePlayerMonChoice:
call DelayFrame
call _LoadHPBar
call CloseWindow
call GetMemSGBLayout
call GetMemCGBLayout
call SetPalettes
call SendOutMonText
call NewBattleMonStatus
@ -2815,8 +2815,8 @@ LostBattle:
jr nz, .LostLinkBattle
; Grayscale
ld b, SCGB_BATTLE_GRAYSCALE
call GetSGBLayout
ld b, CGB_BATTLE_GRAYSCALE
call GetCGBLayout
call SetPalettes
jr .end
@ -4890,7 +4890,7 @@ BattleMenuPKMN_Loop:
call _LoadHPBar
call CloseWindow
call LoadTilemapToTempTilemap
call GetMemSGBLayout
call GetMemCGBLayout
call SetPalettes
jp BattleMenu
@ -4970,7 +4970,7 @@ TryPlayerSwitch:
call ClearSprites
call _LoadHPBar
call CloseWindow
call GetMemSGBLayout
call GetMemCGBLayout
call SetPalettes
ld a, [wCurPartyMon]
ld [wCurBattleMon], a
@ -6795,8 +6795,8 @@ FinishBattleAnim:
push bc
push de
push hl
ld b, SCGB_BATTLE_COLORS
call GetSGBLayout
ld b, CGB_BATTLE_COLORS
call GetCGBLayout
call SetPalettes
call DelayFrame
pop hl
@ -7880,8 +7880,8 @@ BattleIntro:
farcall ClearBattleRAM
call InitEnemy
call BackUpBGMap2
ld b, SCGB_BATTLE_GRAYSCALE
call GetSGBLayout
ld b, CGB_BATTLE_GRAYSCALE
call GetCGBLayout
ld hl, rLCDC
res rLCDC_WINDOW_TILEMAP, [hl] ; select vBGMap0/vBGMap2
call InitBattleDisplay
@ -8236,8 +8236,8 @@ _DisplayLinkRecord:
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
call ByteFill
call WaitBGMap2
ld b, SCGB_DIPLOMA
call GetSGBLayout
ld b, CGB_DIPLOMA
call GetCGBLayout
call SetPalettes
ld c, 8
call DelayFrames
@ -8716,8 +8716,8 @@ InitBattleDisplay:
ldh [rWY], a
call WaitBGMap
call HideSprites
ld b, SCGB_BATTLE_COLORS
call GetSGBLayout
ld b, CGB_BATTLE_COLORS
call GetCGBLayout
call SetPalettes
ld a, $90
ldh [hWY], a

View File

@ -27,8 +27,8 @@ BattleCommand_BatonPass:
hlcoord 1, 0
lb bc, 4, 10
call ClearBox
ld b, SCGB_BATTLE_COLORS
call GetSGBLayout
ld b, CGB_BATTLE_COLORS
call GetCGBLayout
call SetPalettes
call BatonPass_LinkPlayerSwitch

View File

@ -12,7 +12,7 @@ _ReturnToBattle_UseBall:
.continue
farcall GetEnemyMonFrontpic
farcall _LoadBattleFontsHPBar
call GetMemSGBLayout
call GetMemCGBLayout
call CloseWindow
call LoadStandardMenuHeader
call WaitBGMap

View File

@ -250,8 +250,8 @@ _ShowLinkBattleParticipants:
ld [hli], a
ld [hl], "<BOLD_S>"
farcall LinkBattle_TrainerHuds ; no need to farcall
ld b, SCGB_DIPLOMA
call GetSGBLayout
ld b, CGB_DIPLOMA
call GetCGBLayout
call SetPalettes
ld a, $e4
ldh [rOBP0], a

View File

@ -1148,8 +1148,8 @@ BattleAnimCmd_BeatUp:
.done
pop af
ld [wCurPartySpecies], a
ld b, SCGB_BATTLE_COLORS
call GetSGBLayout
ld b, CGB_BATTLE_COLORS
call GetCGBLayout
pop af
ldh [rSVBK], a

View File

@ -291,11 +291,6 @@ BattleBGEffect_CycleOBPalsGrayAndYellow:
dc 2, 1, 0, 0
db -2
.PalsSGB:
dc 3, 3, 0, 0
dc 3, 0, 0, 0
db -2
BattleBGEffect_CycleMidOBPalsGrayAndYellow:
ld de, .PalsCGB
call BattleBGEffect_GetNthDMGPal
@ -307,11 +302,6 @@ BattleBGEffect_CycleMidOBPalsGrayAndYellow:
dc 3, 1, 2, 0
db -2
.PalsSGB:
dc 3, 3, 0, 0
dc 3, 0, 3, 0
db -2
BattleBGEffect_CycleBGPals_Inverted:
ld de, .Pals
call BattleBGEffect_GetNthDMGPal

View File

@ -3410,8 +3410,6 @@ BattleAnimFunction_SkyAttack:
.GBCPals:
db $ff, $aa, $55, $aa
.SGBPals:
db $ff, $ff, $00, $00
BattleAnimFunction_GrowthSwordsDance:
; Moves object in a circle where the height is 1/8 the width, while also moving upward 2 pixels per frame

View File

@ -600,8 +600,8 @@ DebugRoom_EditPagedValues:
inc a
ldh [hBGMapMode], a
call WaitBGMap
ld b, SCGB_DIPLOMA
call GetSGBLayout
ld b, CGB_DIPLOMA
call GetCGBLayout
call SetPalettes
.resume
call DelayFrame

View File

@ -74,8 +74,8 @@ DisplayCaughtContestMonStats:
ld [wOptions], a
call WaitBGMap
ld b, SCGB_DIPLOMA
call GetSGBLayout
ld b, CGB_DIPLOMA
call GetCGBLayout
call SetPalettes
ret

View File

@ -29,8 +29,8 @@ PlaceDiplomaOnScreen:
call PlaceString
call EnableLCD
call WaitBGMap
ld b, SCGB_DIPLOMA
call GetSGBLayout
ld b, CGB_DIPLOMA
call GetCGBLayout
call SetPalettes
call DelayFrame
ret

View File

@ -15,8 +15,8 @@ BlindingFlash:
set STATUSFLAGS_FLASH_F, [hl]
farcall ReplaceTimeOfDayPals
farcall UpdateTimeOfDayPal
ld b, SCGB_MAPPALS
call GetSGBLayout
ld b, CGB_MAPPALS
call GetCGBLayout
farcall LoadOW_BGPal7
farcall FadeInPalettes
ret

View File

@ -254,8 +254,8 @@ AnimateHOFMonEntrance:
call WaitBGMap
xor a
ldh [hBGMapMode], a
ld b, SCGB_PLAYER_OR_MON_FRONTPIC_PALS
call GetSGBLayout
ld b, CGB_PLAYER_OR_MON_FRONTPIC_PALS
call GetCGBLayout
call SetPalettes
call HOF_SlideBackpic
xor a
@ -387,8 +387,8 @@ _HallOfFamePC:
ld de, .EmptyString
call PlaceString
call WaitBGMap
ld b, SCGB_PLAYER_OR_MON_FRONTPIC_PALS
call GetSGBLayout
ld b, CGB_PLAYER_OR_MON_FRONTPIC_PALS
call GetCGBLayout
call SetPalettes
decoord 6, 5
ld c, ANIM_MON_HOF
@ -541,8 +541,8 @@ HOF_AnimatePlayerPic:
xor a
ldh [hBGMapMode], a
ld [wCurPartySpecies], a
ld b, SCGB_PLAYER_OR_MON_FRONTPIC_PALS
call GetSGBLayout
ld b, CGB_PLAYER_OR_MON_FRONTPIC_PALS
call GetCGBLayout
call SetPalettes
call HOF_SlideBackpic
xor a

View File

@ -406,8 +406,8 @@ MagnetTrain_Jumptable_FirstRunThrough:
ld [wTimeOfDayPal], a
ld a, TOWN
ld [wEnvironment], a
ld b, SCGB_MAPPALS
call GetSGBLayout
ld b, CGB_MAPPALS
call GetCGBLayout
call UpdateTimePals
ldh a, [rBGP]

View File

@ -3,8 +3,8 @@ MoveTutor:
call ClearBGPalettes
call ClearScreen
call DelayFrame
ld b, SCGB_PACKPALS
call GetSGBLayout
ld b, CGB_PACKPALS
call GetCGBLayout
xor a
ld [wItemAttributeValue], a
call .GetMoveTutorMove

View File

@ -4,8 +4,8 @@ Pokepic::
call MenuBox
call UpdateSprites
call ApplyTilemap
ld b, SCGB_POKEPIC
call GetSGBLayout
ld b, CGB_POKEPIC
call GetCGBLayout
xor a
ldh [hBGMapMode], a
ld a, [wCurPartySpecies]
@ -32,7 +32,7 @@ ClosePokepic::
call CopyMenuHeader
call ClearMenuBoxInterior
call WaitBGMap
call GetMemSGBLayout
call GetMemCGBLayout
xor a
ldh [hBGMapMode], a
call OverworldTextModeSwitch

View File

@ -62,8 +62,8 @@ _UnownPrinter:
ld [wTempMonDVs], a
ld [wTempMonDVs + 1], a
ld b, SCGB_TRAINER_OR_MON_FRONTPIC_PALS
call GetSGBLayout
ld b, CGB_TRAINER_OR_MON_FRONTPIC_PALS
call GetCGBLayout
call SetPalettes
.joy_loop

View File

@ -37,8 +37,8 @@ OverworldBGMap:
ret
BattleBGMap:
ld b, SCGB_BATTLE_GRAYSCALE
call GetSGBLayout
ld b, CGB_BATTLE_GRAYSCALE
call GetCGBLayout
call SetPalettes
ret

View File

@ -8,8 +8,8 @@ _MemoryGame:
.LoadGFXAndPals:
call DisableLCD
ld b, SCGB_DIPLOMA
call GetSGBLayout
ld b, CGB_DIPLOMA
call GetCGBLayout
callfar ClearSpriteAnims
ld hl, MemoryGameLZ
ld de, vTiles2 tile $00

View File

@ -111,8 +111,8 @@ _SlotMachine:
ld bc, vBGMap1 - vBGMap0
ld a, " "
call ByteFill
ld b, SCGB_SLOT_MACHINE
call GetSGBLayout
ld b, CGB_SLOT_MACHINE
call GetCGBLayout
callfar ClearSpriteAnims
ld hl, wSlots
ld bc, wSlotsDataEnd - wSlots

View File

@ -48,8 +48,8 @@ _UnownPuzzle:
ld a, %10010011
ldh [rLCDC], a
call WaitBGMap
ld b, SCGB_UNOWN_PUZZLE
call GetSGBLayout
ld b, CGB_UNOWN_PUZZLE
call GetCGBLayout
ld a, $e4
call DmgToCgbBGPals
ld a, $24

View File

@ -1,17 +1,12 @@
; Replaces the functionality of sgb.asm to work with CGB hardware.
CheckCGB:
ldh a, [hCGB]
and a
ret
LoadSGBLayoutCGB:
LoadCGBLayout:
ld a, b
cp SCGB_DEFAULT
cp CGB_DEFAULT
jr nz, .not_default
ld a, [wDefaultSGBLayout]
.not_default
cp SCGB_PARTY_MENU_HP_BARS
cp CGB_PARTY_MENU_HP_BARS
jp z, CGB_ApplyPartyMenuHPPals
call ResetBGPals
ld l, a
@ -60,18 +55,18 @@ CGBLayoutJumptable:
dw _CGB_TradeTube
dw _CGB_TrainerOrMonFrontpicPals
dw _CGB_Unused1D
assert_table_length NUM_SCGB_LAYOUTS
assert_table_length NUM_CGB_LAYOUTS
_CGB_BattleGrayscale:
ld hl, PalPacket_BattleGrayscale + 1
ld hl, FourPals_BattleGrayscale
ld de, wBGPals1
ld c, 4
call CopyPalettes
ld hl, PalPacket_BattleGrayscale + 1
ld hl, FourPals_BattleGrayscale
ld de, wBGPals1 palette PAL_BATTLE_BG_EXP
ld c, 4
call CopyPalettes
ld hl, PalPacket_BattleGrayscale + 1
ld hl, FourPals_BattleGrayscale
ld de, wOBPals1
ld c, 2
call CopyPalettes
@ -108,7 +103,7 @@ _CGB_BattleColors:
call LoadPalette_White_Col1_Col2_Black ; PAL_BATTLE_OB_ENEMY
pop hl
call LoadPalette_White_Col1_Col2_Black ; PAL_BATTLE_OB_PLAYER
ld a, SCGB_BATTLE_COLORS
ld a, CGB_BATTLE_COLORS
ld [wDefaultSGBLayout], a
call ApplyPals
_CGB_FinishBattleScreenLayout:
@ -411,7 +406,7 @@ _CGB_SlotMachine:
ret
_CGB_BetaTitleScreen:
ld hl, PalPacket_BetaTitleScreen + 1
ld hl, FourPals_BetaTitleScreen
call CopyFourPalettes
call WipeAttrmap
ld de, wOBPals1
@ -475,7 +470,7 @@ INCLUDE "gfx/intro/gs_shellder_lapras_ob.pal"
ret
.StartersCharizardScene:
ld hl, PalPacket_Pack + 1
ld hl, FourPals_Pack
call CopyFourPalettes
ld de, wOBPals1
ld a, PREDEFPAL_GS_INTRO_STARTERS_TRANSITION
@ -502,7 +497,7 @@ _CGB_Diploma:
ld a, BANK(wBGPals1)
call FarCopyWRAM
ld hl, PalPacket_Diploma + 1
ld hl, FourPals_Diploma
call CopyFourPalettes
call WipeAttrmap
call ApplyAttrmap
@ -510,12 +505,12 @@ _CGB_Diploma:
_CGB_MapPals:
call LoadMapPals
ld a, SCGB_MAPPALS
ld a, CGB_MAPPALS
ld [wDefaultSGBLayout], a
ret
_CGB_PartyMenu:
ld hl, PalPacket_PartyMenu + 1
ld hl, FourPals_PartyMenu
call CopyFourPalettes
call InitPartyMenuBGPal0
call InitPartyMenuBGPal7
@ -568,7 +563,7 @@ _CGB_GSTitleScreen:
ld bc, 2 palettes
ld a, BANK(wOBPals1)
call FarCopyWRAM
ld a, SCGB_DIPLOMA
ld a, CGB_DIPLOMA
ld [wDefaultSGBLayout], a
call ApplyPals
ld a, TRUE
@ -576,14 +571,14 @@ _CGB_GSTitleScreen:
ret
_CGB_Unused0D:
ld hl, PalPacket_Diploma + 1
ld hl, FourPals_Diploma
call CopyFourPalettes
call WipeAttrmap
call ApplyAttrmap
ret
_CGB_UnownPuzzle:
ld hl, PalPacket_UnownPuzzle + 1
ld hl, FourPals_UnownPuzzle
call CopyFourPalettes
ld de, wOBPals1
ld a, PREDEFPAL_UNOWN_PUZZLE
@ -734,7 +729,7 @@ _CGB_MoveList:
ret
_CGB_BetaPikachuMinigame:
ld hl, PalPacket_BetaPikachuMinigame + 1
ld hl, FourPals_BetaPikachuMinigame
call CopyFourPalettes
call WipeAttrmap
call ApplyAttrmap
@ -844,7 +839,7 @@ _CGB_Pokepic:
ret
_CGB_MagnetTrain: ; unused
ld hl, PalPacket_MagnetTrain + 1
ld hl, FourPals_MagnetTrain
call CopyFourPalettes
call WipeAttrmap
hlcoord 0, 4, wAttrmap
@ -901,7 +896,7 @@ _CGB_Unused1D:
ret
_CGB_TradeTube:
ld hl, PalPacket_TradeTube + 1
ld hl, FourPals_TradeTube
call CopyFourPalettes
ld hl, PartyMenuOBPals
ld de, wOBPals1

View File

@ -1,5 +1,3 @@
INCLUDE "engine/gfx/sgb_layouts.asm"
DEF SHINY_ATK_MASK EQU %0010
DEF SHINY_DEF_DV EQU 10
DEF SHINY_SPD_DV EQU 10
@ -76,91 +74,13 @@ Unused_CheckShininess:
and a
ret
SGB_ApplyCreditsPals: ; unreferenced
push de
push bc
ld hl, PalPacket_Pal01
ld de, wSGBPals
ld bc, PALPACKET_LENGTH
call CopyBytes
pop bc
pop de
ld a, c
ld [wSGBPals + 3], a
ld a, b
ld [wSGBPals + 4], a
ld a, e
ld [wSGBPals + 5], a
ld a, d
ld [wSGBPals + 6], a
ld hl, wSGBPals
call PushSGBPals
ld hl, BlkPacket_AllPal0
call PushSGBPals
ret
InitPartyMenuPalettes:
ld hl, PalPacket_PartyMenu + 1
ld hl, FourPals_PartyMenu
call CopyFourPalettes
call InitPartyMenuOBPals
call WipeAttrmap
ret
; SGB layout for SCGB_PARTY_MENU_HP_BARS
SGB_ApplyPartyMenuHPPals:
ld hl, wHPPals
ld a, [wSGBPals]
ld e, a
ld d, 0
add hl, de
ld e, l
ld d, h
ld a, [de]
and a
ld e, $5
jr z, .okay
dec a
ld e, $a
jr z, .okay
ld e, $f
.okay
push de
ld hl, wSGBPals + 10
ld bc, $6
ld a, [wSGBPals]
call AddNTimes
pop de
ld [hl], e
ret
Intro_LoadMagikarpPalettes: ; unreferenced
call CheckCGB
ret z
; CGB only
ld hl, .MagikarpBGPal
ld de, wBGPals1
ld bc, 1 palettes
ld a, BANK(wBGPals1)
call FarCopyWRAM
ld hl, .MagikarpOBPal
ld de, wOBPals1
ld bc, 1 palettes
ld a, BANK(wOBPals1)
call FarCopyWRAM
call ApplyPals
ld a, TRUE
ldh [hCGBPalUpdate], a
ret
.MagikarpBGPal:
INCLUDE "gfx/intro/gs_magikarp_bg.pal"
.MagikarpOBPal:
INCLUDE "gfx/intro/gs_magikarp_ob.pal"
LoadTrainerClassPaletteAsNthBGPal:
ld a, [wTrainerClass]
call GetTrainerPalettePointer
@ -221,8 +141,6 @@ LoadBetaPokerPalettes: ; unreferenced
ret
ApplyMonOrTrainerPals:
call CheckCGB
ret z
ld a, e
and a
jr z, .get_trainer
@ -293,8 +211,6 @@ ApplyHPBarPals:
ret
LoadStatsScreenPals:
call CheckCGB
ret z
ld hl, StatsScreenPals
ld b, 0
dec c
@ -324,31 +240,6 @@ LoadMailPalettes:
add hl, hl
ld de, .MailPals
add hl, de
call CheckCGB
jr nz, .cgb
push hl
ld hl, PalPacket_Pal01
ld de, wSGBPals
ld bc, PALPACKET_LENGTH
call CopyBytes
pop hl
inc hl
inc hl
ld a, [hli]
ld [wSGBPals + 3], a
ld a, [hli]
ld [wSGBPals + 4], a
ld a, [hli]
ld [wSGBPals + 5], a
ld a, [hli]
ld [wSGBPals + 6], a
ld hl, wSGBPals
call PushSGBPals
ld hl, BlkPacket_AllPal0
call PushSGBPals
ret
.cgb
ld de, wBGPals1
ld bc, 1 palettes
ld a, BANK(wBGPals1)
@ -391,6 +282,13 @@ GetPredefPal:
add hl, bc
ret
PredefPals:
table_width PALETTE_SIZE, PredefPals
INCLUDE "gfx/predef/predef.pal"
assert_table_length NUM_PREDEF_PALS
INCLUDE "gfx/predef/four_pals.asm"
LoadHLPaletteIntoDE:
ldh a, [rSVBK]
push af
@ -547,10 +445,10 @@ ApplyAttrmap:
ldh [rVBK], a
ret
; CGB layout for SCGB_PARTY_MENU_HP_BARS
; CGB layout for CGB_PARTY_MENU_HP_BARS
CGB_ApplyPartyMenuHPPals:
ld hl, wHPPals
ld a, [wSGBPals]
ld a, [wWhichPartyMonHPPal]
ld e, a
ld d, 0
add hl, de
@ -561,7 +459,7 @@ CGB_ApplyPartyMenuHPPals:
ld e, a
hlcoord 11, 2, wAttrmap
ld bc, 2 * SCREEN_WIDTH
ld a, [wSGBPals]
ld a, [wWhichPartyMonHPPal]
.loop
and a
jr z, .done
@ -636,52 +534,9 @@ GetMonPalettePointer:
call _GetMonPalettePointer
ret
CGBCopyBattleObjectPals: ; unreferenced
; dummied out
ret
call CheckCGB
ret z
ld hl, BattleObjectPals
ld a, (1 << rOBPI_AUTO_INCREMENT) | $10
ldh [rOBPI], a
ld c, 6 palettes
.loop
ld a, [hli]
ldh [rOBPD], a
dec c
jr nz, .loop
ld hl, BattleObjectPals
ld de, wOBPals1 palette 2
ld bc, 2 palettes
ld a, BANK(wOBPals1)
call FarCopyWRAM
ret
BattleObjectPals:
INCLUDE "gfx/battle_anims/battle_anims.pal"
CGBCopyTwoPredefObjectPals: ; unreferenced
call CheckCGB
ret z
ld a, (1 << rOBPI_AUTO_INCREMENT) | $10
ldh [rOBPI], a
ld a, PREDEFPAL_TRADE_TUBE
call GetPredefPal
call .PushPalette
ld a, PREDEFPAL_RB_GREENMON
call GetPredefPal
call .PushPalette
ret
.PushPalette:
ld c, 1 palettes
.loop
ld a, [hli]
ldh [rOBPD], a
dec c
jr nz, .loop
ret
_GetMonPalettePointer:
ld l, a
ld h, 0
@ -705,92 +560,9 @@ rept 4
endr
ret
PushSGBPals:
ld a, [wJoypadDisable]
push af
set JOYPAD_DISABLE_SGB_TRANSFER_F, a
ld [wJoypadDisable], a
call _PushSGBPals
pop af
ld [wJoypadDisable], a
ret
_PushSGBPals:
ld a, [hl]
and $7
ret z
ld b, a
.loop
push bc
xor a
ldh [rJOYP], a
ld a, $30
ldh [rJOYP], a
ld b, $10
.loop2
ld e, $8
ld a, [hli]
ld d, a
.loop3
bit 0, d
ld a, $10
jr nz, .okay
ld a, $20
.okay
ldh [rJOYP], a
ld a, $30
ldh [rJOYP], a
rr d
dec e
jr nz, .loop3
dec b
jr nz, .loop2
ld a, $20
ldh [rJOYP], a
ld a, $30
ldh [rJOYP], a
call SGBDelayCycles
pop bc
dec b
jr nz, .loop
ret
InitSGBBorder:
call CheckCGB
ret nz
; SGB/DMG only
di
ld a, [wJoypadDisable]
push af
set JOYPAD_DISABLE_SGB_TRANSFER_F, a
ld [wJoypadDisable], a
xor a
ldh [rJOYP], a
ldh [hSGB], a
call PushSGBBorderPalsAndWait
jr nc, .skip
ld a, $1
ldh [hSGB], a
call _InitSGBBorderPals
call SGBBorder_PushBGPals
call SGBDelayCycles
call SGB_ClearVRAM
call PushSGBBorder
call SGBDelayCycles
call SGB_ClearVRAM
ld hl, MaskEnCancelPacket
call _PushSGBPals
.skip
pop af
ld [wJoypadDisable], a
ei
ret
InitCGBPals::
call CheckCGB
ldh a, [hCGB]
and a
ret z
; CGB only
@ -845,267 +617,6 @@ InitCGBPals::
jr nz, .loop
ret
_InitSGBBorderPals:
ld hl, .PacketPointerTable
ld c, 9
.loop
push bc
ld a, [hli]
push hl
ld h, [hl]
ld l, a
call _PushSGBPals
pop hl
inc hl
pop bc
dec c
jr nz, .loop
ret
.PacketPointerTable:
dw MaskEnFreezePacket
dw DataSndPacket1
dw DataSndPacket2
dw DataSndPacket3
dw DataSndPacket4
dw DataSndPacket5
dw DataSndPacket6
dw DataSndPacket7
dw DataSndPacket8
UpdateSGBBorder: ; unreferenced
di
xor a
ldh [rJOYP], a
ld hl, MaskEnFreezePacket
call _PushSGBPals
call PushSGBBorder
call SGBDelayCycles
call SGB_ClearVRAM
ld hl, MaskEnCancelPacket
call _PushSGBPals
ei
ret
PushSGBBorder:
call .LoadSGBBorderPointers
push de
call SGBBorder_YetMorePalPushing
pop hl
call SGBBorder_MorePalPushing
ret
.LoadSGBBorderPointers:
ld hl, SGBBorderGFX
ld de, SGBBorderMapAndPalettes
ret
SGB_ClearVRAM:
ld hl, VRAM_Begin
ld bc, VRAM_End - VRAM_Begin
xor a
call ByteFill
ret
PushSGBBorderPalsAndWait:
ld hl, MltReq2Packet
call _PushSGBPals
call SGBDelayCycles
ldh a, [rJOYP]
and $3
cp $3
jr nz, .carry
ld a, $20
ldh [rJOYP], a
ldh a, [rJOYP]
ldh a, [rJOYP]
call SGBDelayCycles
call SGBDelayCycles
ld a, $30
ldh [rJOYP], a
call SGBDelayCycles
call SGBDelayCycles
ld a, $10
ldh [rJOYP], a
rept 6
ldh a, [rJOYP]
endr
call SGBDelayCycles
call SGBDelayCycles
ld a, $30
ldh [rJOYP], a
ldh a, [rJOYP]
ldh a, [rJOYP]
ldh a, [rJOYP]
call SGBDelayCycles
call SGBDelayCycles
ldh a, [rJOYP]
and $3
cp $3
jr nz, .carry
call .FinalPush
and a
ret
.carry
call .FinalPush
scf
ret
.FinalPush:
ld hl, MltReq1Packet
call _PushSGBPals
vc_hook Unknown_network_reset ; Unknown why this hook is here, doesn't seem to be needed
jp SGBDelayCycles
SGBBorder_PushBGPals:
call DisableLCD
ld a, %11100100
ldh [rBGP], a
ld hl, PredefPals
ld de, vTiles1
ld bc, $100 tiles
call CopyData
call DrawDefaultTiles
ld a, LCDC_DEFAULT
ldh [rLCDC], a
ld hl, PalTrnPacket
call _PushSGBPals
xor a
ldh [rBGP], a
ret
SGBBorder_MorePalPushing:
call DisableLCD
ld a, $e4
ldh [rBGP], a
ld de, vTiles1
ld bc, (6 + SCREEN_WIDTH + 6) * 5 * 2
call CopyData
ld b, SCREEN_HEIGHT
.loop
push bc
ld bc, 6 * 2
call CopyData
ld bc, SCREEN_WIDTH * 2
call ClearBytes
ld bc, 6 * 2
call CopyData
pop bc
dec b
jr nz, .loop
ld bc, (6 + SCREEN_WIDTH + 6) * 5 * 2
call CopyData
ld bc, $100
call ClearBytes
ld bc, 16 palettes
call CopyData
call DrawDefaultTiles
ld a, LCDC_DEFAULT
ldh [rLCDC], a
ld hl, PctTrnPacket
call _PushSGBPals
xor a
ldh [rBGP], a
ret
SGBBorder_YetMorePalPushing:
call DisableLCD
ld a, %11100100
ldh [rBGP], a
ld de, vTiles1
ld b, $80
.loop
push bc
ld bc, 1 tiles
call CopyData
ld bc, 1 tiles
call ClearBytes
pop bc
dec b
jr nz, .loop
call DrawDefaultTiles
ld a, LCDC_DEFAULT
ldh [rLCDC], a
ld hl, ChrTrnPacket
call _PushSGBPals
xor a
ldh [rBGP], a
ret
CopyData:
; copy bc bytes of data from hl to de
.loop
ld a, [hli]
ld [de], a
inc de
dec bc
ld a, c
or b
jr nz, .loop
ret
ClearBytes:
; clear bc bytes of data starting from de
.loop
xor a
ld [de], a
inc de
dec bc
ld a, c
or b
jr nz, .loop
ret
DrawDefaultTiles:
; Draw 240 tiles (2/3 of the screen) from tiles in VRAM
hlbgcoord 0, 0 ; BG Map 0
ld de, BG_MAP_WIDTH - SCREEN_WIDTH
ld a, $80 ; starting tile
ld c, 12 + 1
.line
ld b, 20
.tile
ld [hli], a
inc a
dec b
jr nz, .tile
; next line
add hl, de
dec c
jr nz, .line
ret
SGBDelayCycles:
ld de, 7000
.wait
nop
nop
nop
dec de
ld a, d
or e
jr nz, .wait
ret
INCLUDE "gfx/sgb/blk_packets.asm"
INCLUDE "gfx/sgb/pal_packets.asm"
INCLUDE "data/sgb_ctrl_packets.asm"
PredefPals:
table_width PALETTE_SIZE, PredefPals
INCLUDE "gfx/sgb/predef.pal"
assert_table_length NUM_PREDEF_PALS
SGBBorderMapAndPalettes:
; interleaved tile ids and palette ids, without the center 20x18 screen area
INCBIN "gfx/sgb/sgb_border.sgb.tilemap"
; four SGB palettes of 16 colors each; only the first 4 colors are used
INCLUDE "gfx/sgb/sgb_border.pal"
SGBBorderGFX:
INCBIN "gfx/sgb/sgb_border.2bpp"
HPBarPals:
INCLUDE "gfx/battle/hp_bar.pal"
@ -1240,9 +751,6 @@ INCLUDE "gfx/diploma/diploma.pal"
PartyMenuOBPals:
INCLUDE "gfx/stats/party_menu_ob.pal"
UnusedBattleObjectPals: ; unreferenced
INCLUDE "gfx/battle_anims/unused_battle_anims.pal"
UnusedGSTitleBGPals:
INCLUDE "gfx/title/unused_gs_bg.pal"

View File

@ -1,571 +0,0 @@
LoadSGBLayout:
call CheckCGB
jp nz, LoadSGBLayoutCGB
ld a, b
cp SCGB_DEFAULT
jr nz, .not_default
ld a, [wDefaultSGBLayout]
.not_default
cp SCGB_PARTY_MENU_HP_BARS
jp z, SGB_ApplyPartyMenuHPPals
ld l, a
ld h, 0
add hl, hl
ld de, SGBLayoutJumptable
add hl, de
ld a, [hli]
ld h, [hl]
ld l, a
ld de, _LoadSGBLayout_ReturnFromJumptable
push de
jp hl
SGBLayoutJumptable:
table_width 2, SGBLayoutJumptable
dw .SGB_BattleGrayscale
dw .SGB_BattleColors
dw .SGB_PokegearPals
dw .SGB_StatsScreenHPPals
dw .SGB_Pokedex
dw .SGB_SlotMachine
dw .SGB_BetaTitleScreen
dw .SGB_GSIntro
dw .SGB_Diploma
dw .SGB_MapPals
dw .SGB_PartyMenu
dw .SGB_Evolution
dw .SGB_GSTitleScreen
dw .SGB_Unused0D
dw .SGB_MoveList
dw .SGB_BetaPikachuMinigame
dw .SGB_PokedexSearchOption
dw .SGB_BetaPoker
dw .SGB_Pokepic
dw .SGB_MagnetTrain
dw .SGB_PackPals
dw .SGB_TrainerCard
dw .SGB_PokedexUnownMode
dw .SGB_BillsPC
dw .SGB_UnownPuzzle
dw .SGB_GamefreakLogo
dw .SGB_PlayerOrMonFrontpicPals
dw .SGB_TradeTube
dw .SGB_TrainerOrMonFrontpicPals
dw .SGB_Unused1D
assert_table_length NUM_SCGB_LAYOUTS
.SGB_BattleGrayscale:
ld hl, PalPacket_BattleGrayscale
ld de, BlkPacket_Battle
ret
.SGB_BattleColors:
ld hl, BlkPacket_Battle
call PushSGBPals
ld hl, PalPacket_Pal01
ld de, wSGBPals
ld bc, PALPACKET_LENGTH
call CopyBytes
ld a, [wPlayerHPPal]
ld l, a
ld h, 0
add hl, hl
add hl, hl
ld de, HPBarPals
add hl, de
ld a, [hli]
ld [wSGBPals + 3], a
ld a, [hli]
ld [wSGBPals + 4], a
ld a, [hli]
ld [wSGBPals + 5], a
ld a, [hl]
ld [wSGBPals + 6], a
ld a, [wEnemyHPPal]
ld l, a
ld h, 0
add hl, hl
add hl, hl
ld de, HPBarPals
add hl, de
ld a, [hli]
ld [wSGBPals + 9], a
ld a, [hli]
ld [wSGBPals + 10], a
ld a, [hli]
ld [wSGBPals + 11], a
ld a, [hl]
ld [wSGBPals + 12], a
ld hl, PalPacket_Pal23
ld de, wSGBPals + PALPACKET_LENGTH
ld bc, PALPACKET_LENGTH
call CopyBytes
call GetBattlemonBackpicPalettePointer
ld a, [hli]
ld [wSGBPals + 19], a
ld a, [hli]
ld [wSGBPals + 20], a
ld a, [hli]
ld [wSGBPals + 21], a
ld a, [hl]
ld [wSGBPals + 22], a
call GetEnemyFrontpicPalettePointer
ld a, [hli]
ld [wSGBPals + 25], a
ld a, [hli]
ld [wSGBPals + 26], a
ld a, [hli]
ld [wSGBPals + 27], a
ld a, [hl]
ld [wSGBPals + 28], a
ld hl, wSGBPals
ld de, wSGBPals + PALPACKET_LENGTH
ld a, SCGB_BATTLE_COLORS
ld [wDefaultSGBLayout], a
ret
.SGB_MoveList:
ld hl, PalPacket_AllPal0
ld de, wSGBPals
ld bc, PALPACKET_LENGTH
call CopyBytes
ld hl, wSGBPals + 1
ld [hl], $10
inc hl
inc hl
ld a, [wPlayerHPPal]
add PREDEFPAL_HP_GREEN
ld [hl], a
ld hl, wSGBPals
ld de, BlkPacket_MoveList
ret
.SGB_PokegearPals:
ld hl, PalPacket_Pokegear
ld de, BlkPacket_AllPal0
ret
.SGB_StatsScreenHPPals:
ld hl, PalPacket_Pal01
ld de, wSGBPals
ld bc, PALPACKET_LENGTH
call CopyBytes
ld a, [wCurHPPal]
ld l, a
ld h, 0
add hl, hl
add hl, hl
ld de, HPBarPals
add hl, de
ld a, [hli]
ld [wSGBPals + 3], a
ld a, [hli]
ld [wSGBPals + 4], a
ld a, [hli]
ld [wSGBPals + 5], a
ld a, [hl]
ld [wSGBPals + 6], a
ld a, [wCurPartySpecies]
ld bc, wTempMonDVs
call GetPlayerOrMonPalettePointer
ld a, [hli]
ld [wSGBPals + 9], a
ld a, [hli]
ld [wSGBPals + 10], a
ld a, [hli]
ld [wSGBPals + 11], a
ld a, [hl]
ld [wSGBPals + 12], a
ld hl, wSGBPals
ld de, BlkPacket_StatsScreen
ret
.SGB_PartyMenu:
ld hl, PalPacket_PartyMenu
ld de, wSGBPals + 1
ret
.SGB_Pokedex:
ld hl, PalPacket_Pal01
ld de, wSGBPals
ld bc, PALPACKET_LENGTH
call CopyBytes
ld hl, wSGBPals + 3
ld [hl], LOW(palred 31 + palgreen 20 + palblue 10)
inc hl
ld [hl], HIGH(palred 31 + palgreen 20 + palblue 10)
inc hl
ld [hl], LOW(palred 26 + palgreen 10 + palblue 6)
inc hl
ld [hl], HIGH(palred 26 + palgreen 10 + palblue 6)
ld a, [wCurPartySpecies]
call GetMonPalettePointer
ld a, [hli]
ld [wSGBPals + 9], a
ld a, [hli]
ld [wSGBPals + 10], a
ld a, [hli]
ld [wSGBPals + 11], a
ld a, [hl]
ld [wSGBPals + 12], a
ld hl, wSGBPals
ld de, BlkPacket_Pokedex_PC
ret
.SGB_BillsPC:
ld hl, PalPacket_Pal01
ld de, wSGBPals
ld bc, PALPACKET_LENGTH
call CopyBytes
ld hl, wSGBPals + 3
ld [hl], LOW(palred 31 + palgreen 20 + palblue 10)
inc hl
ld [hl], HIGH(palred 31 + palgreen 20 + palblue 10)
inc hl
ld [hl], LOW(palred 26 + palgreen 10 + palblue 6)
inc hl
ld [hl], HIGH(palred 26 + palgreen 10 + palblue 6)
ld a, [wCurPartySpecies]
ld bc, wTempMonDVs
call GetPlayerOrMonPalettePointer
ld a, [hli]
ld [wSGBPals + 9], a
ld a, [hli]
ld [wSGBPals + 10], a
ld a, [hli]
ld [wSGBPals + 11], a
ld a, [hl]
ld [wSGBPals + 12], a
ld hl, wSGBPals
ld de, BlkPacket_Pokedex_PC
ret
.SGB_PokedexUnownMode:
call .SGB_Pokedex
ld de, BlkPacket_PokedexUnownMode
ret
.SGB_PokedexSearchOption:
ld hl, PalPacket_Pal01
ld de, wSGBPals
ld bc, PALPACKET_LENGTH
call CopyBytes
ld hl, wSGBPals + 3
ld [hl], LOW(palred 31 + palgreen 20 + palblue 10)
inc hl
ld [hl], HIGH(palred 31 + palgreen 20 + palblue 10)
inc hl
ld [hl], LOW(palred 26 + palgreen 10 + palblue 6)
inc hl
ld [hl], HIGH(palred 26 + palgreen 10 + palblue 6)
ld hl, wSGBPals
ld de, BlkPacket_AllPal0
ret
.SGB_PackPals:
ld hl, PalPacket_Pack
ld de, BlkPacket_AllPal0
ret
.SGB_SlotMachine:
ld hl, PalPacket_SlotMachine
ld de, BlkPacket_SlotMachine
ret
.SGB_BetaTitleScreen:
ld hl, PalPacket_BetaTitleScreen
ld de, BlkPacket_BetaTitleScreen
ret
.SGB_Diploma:
ld hl, PalPacket_Diploma
ld de, BlkPacket_AllPal0
ret
.SGB_GSIntro:
ld b, 0
ld hl, .BlkPacketTable_GSIntro
rept 4
add hl, bc
endr
ld e, [hl]
inc hl
ld d, [hl]
inc hl
ld a, [hli]
ld h, [hl]
ld l, a
ret
.BlkPacketTable_GSIntro:
dw BlkPacket_AllPal0, PalPacket_GSIntroShellderLapras
dw BlkPacket_GSIntroJigglypuffPikachu, PalPacket_GSIntroJigglypuffPikachu
dw BlkPacket_AllPal0, PalPacket_GSIntroStartersTransition
.SGB_GSTitleScreen:
ld hl, PalPacket_GSTitleScreen
ld de, BlkPacket_GSTitleScreen
ld a, SCGB_DIPLOMA
ld [wDefaultSGBLayout], a
ret
.SGB_MagnetTrain:
ld hl, PalPacket_MagnetTrain
ld de, BlkPacket_MagnetTrain
ret
.SGB_BetaPikachuMinigame:
ld hl, PalPacket_BetaPikachuMinigame
ld de, BlkPacket_AllPal0
ret
.SGB_BetaPoker:
ld hl, BlkPacket_AllPal0
ld de, wBetaPokerSGBPals
ld bc, PALPACKET_LENGTH
call CopyBytes
ld hl, PalPacket_BetaPoker
ld de, BlkPacket_AllPal0
ret
.SGB_MapPals:
ld hl, PalPacket_AllPal0
ld de, wSGBPals
ld bc, PALPACKET_LENGTH
call CopyBytes
call .GetMapPalsIndex
ld hl, wSGBPals + 1
ld [hld], a
ld de, BlkPacket_AllPal0
ld a, SCGB_MAPPALS
ld [wDefaultSGBLayout], a
ret
.SGB_Evolution:
push bc
ld hl, PalPacket_Pal01
ld de, wSGBPals
ld bc, PALPACKET_LENGTH
call CopyBytes
pop bc
ld a, c
and a
jr z, .partymon
; Egg
ld hl, wSGBPals + 3
ld [hl], LOW(palred 7 + palgreen 7 + palblue 7)
inc hl
ld [hl], HIGH(palred 7 + palgreen 7 + palblue 7)
inc hl
ld [hl], LOW(palred 2 + palgreen 3 + palblue 3)
inc hl
ld [hl], HIGH(palred 2 + palgreen 3 + palblue 3)
jr .done
.partymon
ld hl, wPartyMon1DVs
ld bc, PARTYMON_STRUCT_LENGTH
ld a, [wCurPartyMon]
call AddNTimes
ld c, l
ld b, h
ld a, [wPlayerHPPal]
call GetPlayerOrMonPalettePointer
ld a, [hli]
ld [wSGBPals + 3], a
ld a, [hli]
ld [wSGBPals + 4], a
ld a, [hli]
ld [wSGBPals + 5], a
ld a, [hl]
ld [wSGBPals + 6], a
.done
ld hl, wSGBPals
ld de, BlkPacket_AllPal0
ret
.SGB_Unused0D:
.SGB_TrainerCard:
ld hl, PalPacket_Diploma
ld de, BlkPacket_AllPal0
ret
.SGB_UnownPuzzle:
ld hl, PalPacket_UnownPuzzle
ld de, BlkPacket_AllPal0
ret
.SGB_Pokepic:
ld hl, PalPacket_AllPal0
ld de, wSGBPals
ld bc, PALPACKET_LENGTH
call CopyBytes
ld hl, BlkPacket_AllPal0
ld de, wSGBPals + PALPACKET_LENGTH
ld bc, PALPACKET_LENGTH
call CopyBytes
call .GetMapPalsIndex
ld hl, wSGBPals + 1
ld [hl], a
ld hl, wSGBPals + 3
ld [hl], $2e
ld hl, wSGBPals + $13
ld a, 5
ld [hli], a
ld a, [wMenuBorderLeftCoord]
ld [hli], a
ld a, [wMenuBorderTopCoord]
ld [hli], a
ld a, [wMenuBorderRightCoord]
ld [hli], a
ld a, [wMenuBorderBottomCoord]
ld [hl], a
ld hl, wSGBPals
ld de, wSGBPals + PALPACKET_LENGTH
ret
.SGB_Unused1D:
ld hl, PalPacket_Pal01
ld de, wSGBPals
ld bc, PALPACKET_LENGTH
call CopyBytes
ld a, [wCurPartySpecies]
ld l, a
ld h, 0
add hl, hl
add hl, hl
add hl, hl
ld de, PokemonPalettes
add hl, de
ld a, [wUnusedSGB1eColorOffset]
and 3
sla a
sla a
ld c, a
ld b, 0
add hl, bc
ld a, [hli]
ld [wSGBPals + 3], a
ld a, [hli]
ld [wSGBPals + 4], a
ld a, [hli]
ld [wSGBPals + 5], a
ld a, [hl]
ld [wSGBPals + 6], a
ld hl, wSGBPals
ld de, BlkPacket_AllPal0
ret
.SGB_GamefreakLogo:
ld hl, PalPacket_GamefreakLogo
ld de, BlkPacket_AllPal0
ret
.SGB_PlayerOrMonFrontpicPals:
ld hl, PalPacket_Pal01
ld de, wSGBPals
ld bc, PALPACKET_LENGTH
call CopyBytes
ld a, [wCurPartySpecies]
ld bc, wTempMonDVs
call GetPlayerOrMonPalettePointer
ld a, [hli]
ld [wSGBPals + 3], a
ld a, [hli]
ld [wSGBPals + 4], a
ld a, [hli]
ld [wSGBPals + 5], a
ld a, [hl]
ld [wSGBPals + 6], a
ld hl, wSGBPals
ld de, BlkPacket_AllPal0
ret
.SGB_TradeTube:
ld hl, PalPacket_TradeTube
ld de, BlkPacket_AllPal0
ret
.SGB_TrainerOrMonFrontpicPals:
ld hl, PalPacket_Pal01
ld de, wSGBPals
ld bc, PALPACKET_LENGTH
call CopyBytes
ld a, [wCurPartySpecies]
ld bc, wTempMonDVs
call GetFrontpicPalettePointer
ld a, [hli]
ld [wSGBPals + 3], a
ld a, [hli]
ld [wSGBPals + 4], a
ld a, [hli]
ld [wSGBPals + 5], a
ld a, [hl]
ld [wSGBPals + 6], a
ld hl, wSGBPals
ld de, BlkPacket_AllPal0
ret
.GetMapPalsIndex:
ld a, [wTimeOfDayPal]
cp NITE_F
jr c, .morn_day
ld a, PREDEFPAL_NITE
ret
.morn_day
ld a, [wEnvironment]
cp ROUTE
jr z, .route
cp CAVE
jr z, .cave
cp DUNGEON
jr z, .cave
cp ENVIRONMENT_5
jr z, .env5
cp GATE
jr z, .gate
ld a, [wMapGroup]
ld e, a
ld d, 0
ld hl, MapGroupRoofSGBPalInds
add hl, de
ld a, [hl]
ret
.route
ld a, PREDEFPAL_ROUTES
ret
.cave
ld a, PREDEFPAL_DUNGEONS
ret
.env5
ld a, PREDEFPAL_VERMILION
ret
.gate
ld a, PREDEFPAL_PEWTER
ret
INCLUDE "data/maps/sgb_roof_pal_inds.asm"
_LoadSGBLayout_ReturnFromJumptable:
push de
call PushSGBPals
pop hl
jp PushSGBPals

View File

@ -24,8 +24,8 @@ AnimateTrademonFrontpic:
ld [wTempMonDVs], a
ld a, [wOTTrademonDVs + 1]
ld [wTempMonDVs + 1], a
ld b, SCGB_PLAYER_OR_MON_FRONTPIC_PALS
call GetSGBLayout
ld b, CGB_PLAYER_OR_MON_FRONTPIC_PALS
call GetCGBLayout
ld a, %11100100 ; 3,2,1,0
call DmgToCgbBGPals
farcall TradeAnim_ShowGetmonFrontpic

View File

@ -1435,8 +1435,8 @@ ClearPocketList:
Pack_InitColors:
call WaitBGMap
ld b, SCGB_PACKPALS
call GetSGBLayout
ld b, CGB_PACKPALS
call GetCGBLayout
call SetPalettes
call DelayFrame
ret

View File

@ -552,8 +552,8 @@ LinkTimeout:
call PlaceHLTextAtBC
call RotateThreePalettesRight
call ClearScreen
ld b, SCGB_DIPLOMA
call GetSGBLayout
ld b, CGB_DIPLOMA
call GetCGBLayout
call WaitBGMap2
ret
@ -1631,8 +1631,8 @@ LinkTradePartymonMenuCheckCancel:
ExitLinkCommunications:
call RotateThreePalettesRight
call ClearScreen
ld b, SCGB_DIPLOMA
call GetSGBLayout
ld b, CGB_DIPLOMA
call GetCGBLayout
call WaitBGMap2
xor a
ld [wUnusedLinkCommunicationByte], a
@ -1955,8 +1955,8 @@ LinkTrade:
call DelayFrames
call ClearTilemap
call LoadFontsBattleExtra
ld b, SCGB_DIPLOMA
call GetSGBLayout
ld b, CGB_DIPLOMA
call GetCGBLayout
ldh a, [hSerialConnectionStatus]
cp USING_EXTERNAL_CLOCK
jr z, .player_2

View File

@ -17,7 +17,7 @@ LoadMobileTradeBorderTilemap:
TestMobileTradeBorderTilemap: ; unreferenced
; Loads the mobile trade border graphics and tilemap,
; with a placeholder SCGB_DIPLOMA layout, and exits
; with a placeholder CGB_DIPLOMA layout, and exits
; after pressing A or B. Possibly used for testing.
call LoadStandardMenuHeader
call ClearBGPalettes
@ -25,8 +25,8 @@ TestMobileTradeBorderTilemap: ; unreferenced
call ClearSprites
farcall __LoadTradeScreenBorderGFX ; useless to farcall
farcall LoadMobileTradeBorderTilemap ; useless to farcall
ld b, SCGB_DIPLOMA
call GetSGBLayout
ld b, CGB_DIPLOMA
call GetCGBLayout
call SetPalettes
call WaitBGMap
call JoyWaitAorB

View File

@ -1,7 +1,7 @@
_DeleteSaveData:
farcall BlankScreen
ld b, SCGB_DIPLOMA
call GetSGBLayout
ld b, CGB_DIPLOMA
call GetCGBLayout
call LoadStandardFont
call LoadFontsExtra
ld de, MUSIC_MAIN_MENU

View File

@ -591,8 +591,8 @@ OakSpeech:
ld [wTrainerClass], a
call Intro_PrepTrainerPic
ld b, SCGB_TRAINER_OR_MON_FRONTPIC_PALS
call GetSGBLayout
ld b, CGB_TRAINER_OR_MON_FRONTPIC_PALS
call GetCGBLayout
call Intro_RotatePalettesLeftFrontpic
ld hl, OakText1
@ -612,8 +612,8 @@ OakSpeech:
ld [wTempMonDVs], a
ld [wTempMonDVs + 1], a
ld b, SCGB_TRAINER_OR_MON_FRONTPIC_PALS
call GetSGBLayout
ld b, CGB_TRAINER_OR_MON_FRONTPIC_PALS
call GetCGBLayout
call Intro_WipeInFrontpic
ld hl, OakText2
@ -629,8 +629,8 @@ OakSpeech:
ld [wTrainerClass], a
call Intro_PrepTrainerPic
ld b, SCGB_TRAINER_OR_MON_FRONTPIC_PALS
call GetSGBLayout
ld b, CGB_TRAINER_OR_MON_FRONTPIC_PALS
call GetCGBLayout
call Intro_RotatePalettesLeftFrontpic
ld hl, OakText5
@ -642,8 +642,8 @@ OakSpeech:
ld [wCurPartySpecies], a
farcall DrawIntroPlayerPic
ld b, SCGB_TRAINER_OR_MON_FRONTPIC_PALS
call GetSGBLayout
ld b, CGB_TRAINER_OR_MON_FRONTPIC_PALS
call GetCGBLayout
call Intro_RotatePalettesLeftFrontpic
ld hl, OakText6
@ -712,8 +712,8 @@ NamePlayer:
ld [wCurPartySpecies], a
farcall DrawIntroPlayerPic
ld b, SCGB_TRAINER_OR_MON_FRONTPIC_PALS
call GetSGBLayout
ld b, CGB_TRAINER_OR_MON_FRONTPIC_PALS
call GetCGBLayout
call RotateThreePalettesLeft
ld hl, wPlayerName
@ -949,8 +949,8 @@ StartTitleScreen:
ldh [hWX], a
ld a, $90
ldh [hWY], a
ld b, SCGB_DIPLOMA
call GetSGBLayout
ld b, CGB_DIPLOMA
call GetCGBLayout
call UpdateTimePals
ld a, [wTitleScreenSelectedOption]
cp NUM_TITLESCREENOPTIONS

View File

@ -15,8 +15,8 @@ MainMenu:
xor a
ld [wDisableTextAcceleration], a
call ClearTilemapEtc
ld b, SCGB_DIPLOMA
call GetSGBLayout
ld b, CGB_DIPLOMA
call GetCGBLayout
call SetPalettes
ld hl, wGameTimerPaused
res GAME_TIMER_PAUSED_F, [hl]

View File

@ -45,8 +45,8 @@ NamingScreen:
.SetUpNamingScreen:
call ClearBGPalettes
ld b, SCGB_DIPLOMA
call GetSGBLayout
ld b, CGB_DIPLOMA
call GetCGBLayout
call DisableLCD
call LoadNamingScreenGFX
call NamingScreen_InitText
@ -942,8 +942,8 @@ _ComposeMailMessage:
ld a, LCDC_DEFAULT
ldh [rLCDC], a
call .initwNamingScreenMaxNameLength
ld b, SCGB_DIPLOMA
call GetSGBLayout
ld b, CGB_DIPLOMA
call GetCGBLayout
call WaitBGMap
call WaitTop
ld a, %11100100

View File

@ -46,8 +46,8 @@ _Option:
inc a
ldh [hBGMapMode], a
call WaitBGMap
ld b, SCGB_DIPLOMA
call GetSGBLayout
ld b, CGB_DIPLOMA
call GetCGBLayout
call SetPalettes
.joypad_loop

View File

@ -66,8 +66,8 @@ TrainerCard:
call EnableLCD
call WaitBGMap
ld b, SCGB_TRAINER_CARD
call GetSGBLayout
ld b, CGB_TRAINER_CARD
call GetCGBLayout
call SetPalettes
call WaitBGMap
ld hl, wJumptableIndex

View File

@ -52,7 +52,7 @@ EvolutionAnimation:
ld [wPlayerHPPal], a
ld c, FALSE
call .GetSGBLayout
call .GetCGBLayout
ld a, [wEvolutionOldSpecies]
ld [wCurPartySpecies], a
@ -92,7 +92,7 @@ EvolutionAnimation:
call DelayFrames
ld c, TRUE
call .GetSGBLayout
call .GetCGBLayout
call .AnimationSequence
jr c, .cancel_evo
@ -108,7 +108,7 @@ EvolutionAnimation:
ld [wPlayerHPPal], a
ld c, FALSE
call .GetSGBLayout
call .GetCGBLayout
call .PlayEvolvedSFX
farcall ClearSpriteAnims
@ -146,7 +146,7 @@ EvolutionAnimation:
ld [wPlayerHPPal], a
ld c, FALSE
call .GetSGBLayout
call .GetCGBLayout
call .PlayEvolvedSFX
farcall ClearSpriteAnims
@ -157,9 +157,9 @@ EvolutionAnimation:
call PlayMonCry
ret
.GetSGBLayout:
ld b, SCGB_EVOLUTION
jp GetSGBLayout
.GetCGBLayout:
ld b, CGB_EVOLUTION
jp GetCGBLayout
.PlaceFrontpic:
call GetBaseData

View File

@ -17,8 +17,8 @@ SplashScreen:
ld a, SCREEN_HEIGHT_PX
ldh [hWY], a
call WaitBGMap
ld b, SCGB_GAMEFREAK_LOGO
call GetSGBLayout
ld b, CGB_GAMEFREAK_LOGO
call GetCGBLayout
call SetPalettes
ld c, 10
call DelayFrames

View File

@ -372,8 +372,8 @@ TradeAnim_InitTubeAnim:
ld [hl], b
call WaitBGMap
ld b, SCGB_TRADE_TUBE
call GetSGBLayout
ld b, CGB_TRADE_TUBE
call GetCGBLayout
ld a, %11100100 ; 3,2,1,0
call DmgToCgbBGPals
ld a, %11010000
@ -633,8 +633,8 @@ TradeAnim_EnterLinkTube1:
lb bc, 3, 12
call TradeAnim_CopyBoxFromDEtoHL
call WaitBGMap
ld b, SCGB_TRADE_TUBE
call GetSGBLayout
ld b, CGB_TRADE_TUBE
call GetCGBLayout
ld a, %11100100 ; 3,2,1,0
call DmgToCgbBGPals
lb de, %11100100, %11100100 ; 3,2,1,0, 3,2,1,0
@ -764,8 +764,8 @@ TradeAnim_ShowGivemonData:
ld [wTempMonDVs], a
ld a, [wPlayerTrademonDVs + 1]
ld [wTempMonDVs + 1], a
ld b, SCGB_PLAYER_OR_MON_FRONTPIC_PALS
call GetSGBLayout
ld b, CGB_PLAYER_OR_MON_FRONTPIC_PALS
call GetCGBLayout
ld a, %11100100 ; 3,2,1,0
call DmgToCgbBGPals
call TradeAnim_ShowGivemonFrontpic
@ -789,8 +789,8 @@ TradeAnim_ShowGetmonData:
ld [wTempMonDVs], a
ld a, [wOTTrademonDVs + 1]
ld [wTempMonDVs + 1], a
ld b, SCGB_PLAYER_OR_MON_FRONTPIC_PALS
call GetSGBLayout
ld b, CGB_PLAYER_OR_MON_FRONTPIC_PALS
call GetCGBLayout
ld a, %11100100 ; 3,2,1,0
call DmgToCgbBGPals
call TradeAnim_ShowGetmonFrontpic

View File

@ -292,8 +292,8 @@ LoadMapGraphics:
ret
LoadMapPalettes:
ld b, SCGB_MAPPALS
jp GetSGBLayout
ld b, CGB_MAPPALS
jp GetCGBLayout
RefreshMapSprites:
call ClearSprites

View File

@ -44,7 +44,7 @@ NewPokedexEntry:
ld [wTempMonDVs], a
ld a, [hl]
ld [wTempMonDVs + 1], a
ld b, SCGB_TRAINER_OR_MON_FRONTPIC_PALS
call GetSGBLayout
ld b, CGB_TRAINER_OR_MON_FRONTPIC_PALS
call GetCGBLayout
call SetPalettes
ret

View File

@ -238,8 +238,8 @@ Pokedex_InitMainScreen:
call Pokedex_ResetBGMapMode
ld a, -1
ld [wCurPartySpecies], a
ld a, SCGB_POKEDEX
call Pokedex_GetSGBLayout
ld a, CGB_POKEDEX
call Pokedex_GetCGBLayout
call Pokedex_UpdateCursorOAM
farcall DrawPokedexListWindow
hlcoord 0, 17
@ -331,8 +331,8 @@ Pokedex_InitDexEntryScreen:
ldh [hWX], a
call Pokedex_GetSelectedMon
ld [wCurPartySpecies], a
ld a, SCGB_POKEDEX
call Pokedex_GetSGBLayout
ld a, CGB_POKEDEX
call Pokedex_GetCGBLayout
ld a, [wCurPartySpecies]
call PlayMonCry
call Pokedex_IncrementDexPointer
@ -401,8 +401,8 @@ Pokedex_ReinitDexEntryScreen:
call WaitBGMap
call Pokedex_GetSelectedMon
ld [wCurPartySpecies], a
ld a, SCGB_POKEDEX
call Pokedex_GetSGBLayout
ld a, CGB_POKEDEX
call Pokedex_GetCGBLayout
ld a, [wCurPartySpecies]
call PlayMonCry
ld hl, wJumptableIndex
@ -449,8 +449,8 @@ DexEntryScreen_MenuActionJumptable:
call WaitBGMap
call Pokedex_GetSelectedMon
ld [wCurPartySpecies], a
ld a, SCGB_POKEDEX
call Pokedex_GetSGBLayout
ld a, CGB_POKEDEX
call Pokedex_GetCGBLayout
ret
.Cry:
@ -509,8 +509,8 @@ Pokedex_InitOptionScreen:
ld [wDexArrowCursorPosIndex], a
call Pokedex_DisplayModeDescription
call WaitBGMap
ld a, SCGB_POKEDEX_SEARCH_OPTION
call Pokedex_GetSGBLayout
ld a, CGB_POKEDEX_SEARCH_OPTION
call Pokedex_GetCGBLayout
call Pokedex_IncrementDexPointer
ret
@ -617,8 +617,8 @@ Pokedex_InitSearchScreen:
ld [wDexSearchSlowpokeFrame], a
farcall DoDexSearchSlowpokeFrame
call WaitBGMap
ld a, SCGB_POKEDEX_SEARCH_OPTION
call Pokedex_GetSGBLayout
ld a, CGB_POKEDEX_SEARCH_OPTION
call Pokedex_GetCGBLayout
call Pokedex_IncrementDexPointer
ret
@ -736,8 +736,8 @@ Pokedex_InitSearchResultsScreen:
call Pokedex_UpdateSearchResultsCursorOAM
ld a, -1
ld [wCurPartySpecies], a
ld a, SCGB_POKEDEX
call Pokedex_GetSGBLayout
ld a, CGB_POKEDEX
call Pokedex_GetCGBLayout
call Pokedex_IncrementDexPointer
ret
@ -796,8 +796,8 @@ Pokedex_InitUnownMode:
call Pokedex_UnownModePlaceCursor
farcall PrintUnownWord
call WaitBGMap
ld a, SCGB_POKEDEX_UNOWN_MODE
call Pokedex_GetSGBLayout
ld a, CGB_POKEDEX_UNOWN_MODE
call Pokedex_GetCGBLayout
call Pokedex_IncrementDexPointer
ret
@ -2311,9 +2311,9 @@ Pokedex_ApplyPrintPals:
call DelayFrame
ret
Pokedex_GetSGBLayout:
Pokedex_GetCGBLayout:
ld b, a
call GetSGBLayout
call GetCGBLayout
Pokedex_ApplyUsualPals:
; This applies the palettes used for most Pokédex screens.
@ -2513,8 +2513,8 @@ _NewPokedexEntry:
call GetBaseData
ld de, vTiles2
predef GetMonFrontpic
ld a, SCGB_POKEDEX
call Pokedex_GetSGBLayout
ld a, CGB_POKEDEX
call Pokedex_GetCGBLayout
ld a, [wCurPartySpecies]
call PlayMonCry
ret

View File

@ -101,8 +101,8 @@ PokeGear:
ld [wPokegearRadioChannelAddr + 1], a
call Pokegear_InitJumptableIndices
call InitPokegearTilemap
ld b, SCGB_POKEGEAR_PALS
call GetSGBLayout
ld b, CGB_POKEGEAR_PALS
call GetCGBLayout
call SetPalettes
ld a, %11100100
call DmgToCgbObjPal0
@ -1666,8 +1666,8 @@ _TownMap:
ld [wTownMapCursorObjectPointer], a
ld a, b
ld [wTownMapCursorObjectPointer + 1], a
ld b, SCGB_POKEGEAR_PALS
call GetSGBLayout
ld b, CGB_POKEGEAR_PALS
call GetCGBLayout
call SetPalettes
ld a, %11100100
call DmgToCgbObjPal0
@ -1886,8 +1886,8 @@ _FlyMap:
call Request1bpp
call FlyMap
call Pokegear_DummyFunction
ld b, SCGB_POKEGEAR_PALS
call GetSGBLayout
ld b, CGB_POKEGEAR_PALS
call GetCGBLayout
call SetPalettes
.loop
call JoyTextDelay
@ -2156,8 +2156,8 @@ Pokedex_GetArea:
call TownMapPals
hlbgcoord 0, 0
call TownMapBGUpdate
ld b, SCGB_POKEGEAR_PALS
call GetSGBLayout
ld b, CGB_POKEGEAR_PALS
call GetCGBLayout
call SetPalettes
xor a
ldh [hBGMapMode], a
@ -2583,8 +2583,8 @@ EntireFlyMap: ; unreferenced
ld [wTownMapCursorCoordinates], a
ld a, b
ld [wTownMapCursorCoordinates + 1], a
ld b, SCGB_POKEGEAR_PALS
call GetSGBLayout
ld b, CGB_POKEGEAR_PALS
call GetCGBLayout
call SetPalettes
.loop
call JoyTextDelay

View File

@ -62,7 +62,7 @@ _DepositPKMN:
call PCMonInfo
ld a, $ff
ld [wCurPartySpecies], a
ld a, SCGB_BILLS_PC
ld a, CGB_BILLS_PC
call BillsPC_ApplyPalettes
call WaitBGMap
call BillsPC_UpdateSelectionCursor
@ -117,7 +117,7 @@ _DepositPKMN:
call ClearSprites
call BillsPC_GetSelectedPokemonSpecies
ld [wCurPartySpecies], a
ld a, SCGB_BILLS_PC
ld a, CGB_BILLS_PC
call BillsPC_ApplyPalettes
ld de, PCString_WhatsUp
call BillsPC_PlaceString
@ -176,7 +176,7 @@ BillsPCDepositFuncStats:
call PCMonInfo
call BillsPC_GetSelectedPokemonSpecies
ld [wCurPartySpecies], a
ld a, SCGB_BILLS_PC
ld a, CGB_BILLS_PC
call BillsPC_ApplyPalettes
ret
@ -320,7 +320,7 @@ _WithdrawPKMN:
call PCMonInfo
ld a, $ff
ld [wCurPartySpecies], a
ld a, SCGB_BILLS_PC
ld a, CGB_BILLS_PC
call BillsPC_ApplyPalettes
call WaitBGMap
call BillsPC_UpdateSelectionCursor
@ -374,7 +374,7 @@ _WithdrawPKMN:
call ClearSprites
call BillsPC_GetSelectedPokemonSpecies
ld [wCurPartySpecies], a
ld a, SCGB_BILLS_PC
ld a, CGB_BILLS_PC
call BillsPC_ApplyPalettes
ld de, PCString_WhatsUp
call BillsPC_PlaceString
@ -432,7 +432,7 @@ BillsPC_Withdraw:
call PCMonInfo
call BillsPC_GetSelectedPokemonSpecies
ld [wCurPartySpecies], a
ld a, SCGB_BILLS_PC
ld a, CGB_BILLS_PC
call BillsPC_ApplyPalettes
ret
@ -561,7 +561,7 @@ _MovePKMNWithoutMail:
call PCMonInfo
ld a, $ff
ld [wCurPartySpecies], a
ld a, SCGB_BILLS_PC
ld a, CGB_BILLS_PC
call BillsPC_ApplyPalettes
call WaitBGMap
call BillsPC_UpdateSelectionCursor
@ -625,7 +625,7 @@ _MovePKMNWithoutMail:
call ClearSprites
call BillsPC_GetSelectedPokemonSpecies
ld [wCurPartySpecies], a
ld a, SCGB_BILLS_PC
ld a, CGB_BILLS_PC
call BillsPC_ApplyPalettes
ld de, PCString_WhatsUp
call BillsPC_PlaceString
@ -679,7 +679,7 @@ _MovePKMNWithoutMail:
call PCMonInfo
call BillsPC_GetSelectedPokemonSpecies
ld [wCurPartySpecies], a
ld a, SCGB_BILLS_PC
ld a, CGB_BILLS_PC
call BillsPC_ApplyPalettes
ret
@ -2160,7 +2160,7 @@ endr
BillsPC_ApplyPalettes:
ld b, a
call GetSGBLayout
call GetCGBLayout
ld a, %11100100
call DmgToCgbBGPals
ld a, %11111100

View File

@ -755,9 +755,9 @@ EggHatch_AnimationSequence:
Hatch_LoadFrontpicPal:
ld [wPlayerHPPal], a
ld b, SCGB_EVOLUTION
ld b, CGB_EVOLUTION
ld c, $0
jp GetSGBLayout
jp GetCGBLayout
EggHatch_CrackShell:
ld a, [wFrameCounter]

View File

@ -1127,8 +1127,8 @@ SetUpMoveScreenBG:
call PrintLevel
ld hl, wPlayerHPPal
call SetHPPal
ld b, SCGB_MOVE_LIST
call GetSGBLayout
ld b, CGB_MOVE_LIST
call GetCGBLayout
hlcoord 16, 0
lb bc, 1, 3
jp ClearBox

View File

@ -18,8 +18,8 @@ SelectTradeOrDayCareMon:
call ClearBGPalettes
call InitPartyMenuLayout
call WaitBGMap
ld b, SCGB_PARTY_MENU
call GetSGBLayout
ld b, CGB_PARTY_MENU
call GetCGBLayout
call SetPalettes
call DelayFrame
call PartyMenuSelect
@ -113,7 +113,7 @@ PlacePartyNicknames:
PlacePartyHPBar:
xor a
ld [wSGBPals], a
ld [wWhichPartyMonHPPal], a
ld a, [wPartyCount]
and a
ret z
@ -132,15 +132,15 @@ PlacePartyHPBar:
ld b, $0
call DrawBattleHPBar
ld hl, wHPPals
ld a, [wSGBPals]
ld a, [wWhichPartyMonHPPal]
ld c, a
ld b, 0
add hl, bc
call SetHPPal
ld b, SCGB_PARTY_MENU_HP_BARS
call GetSGBLayout
ld b, CGB_PARTY_MENU_HP_BARS
call GetCGBLayout
.skip
ld hl, wSGBPals
ld hl, wWhichPartyMonHPPal
inc [hl]
pop hl
ld de, 2 * SCREEN_WIDTH
@ -149,8 +149,8 @@ PlacePartyHPBar:
inc b
dec c
jr nz, .loop
ld b, SCGB_PARTY_MENU
call GetSGBLayout
ld b, CGB_PARTY_MENU
call GetCGBLayout
ret
PlacePartymonHPBar:

View File

@ -421,8 +421,8 @@ StatsScreen_InitUpperHalf:
farcall ComputeHPBarPixels
ld hl, wCurHPPal
call SetHPPal
ld b, SCGB_STATS_SCREEN_HP_PALS
call GetSGBLayout
ld b, CGB_STATS_SCREEN_HP_PALS
call GetCGBLayout
call DelayFrame
ret
@ -945,16 +945,13 @@ StatsScreen_LoadTextboxSpaceGFX:
pop hl
ret
StatsScreenSpaceGFX: ; unreferenced
INCBIN "gfx/font/space.2bpp"
EggStatsScreen:
xor a
ldh [hBGMapMode], a
ld hl, wCurHPPal
call SetHPPal
ld b, SCGB_STATS_SCREEN_HP_PALS
call GetSGBLayout
ld b, CGB_STATS_SCREEN_HP_PALS
call GetCGBLayout
call StatsScreen_PlaceHorizontalDivider
ld de, EggString
hlcoord 8, 1

View File

@ -223,8 +223,8 @@ PrintPartyMonPage1:
hlcoord 0, 0
call _PrepMonFrontpic
call WaitBGMap
ld b, SCGB_STATS_SCREEN_HP_PALS
call GetSGBLayout
ld b, CGB_STATS_SCREEN_HP_PALS
call GetCGBLayout
call SetPalettes
ret
@ -274,8 +274,8 @@ PrintPartyMonPage2:
ld de, wTempMonSpeed
call .PrintTempMonStats
call WaitBGMap
ld b, SCGB_STATS_SCREEN_HP_PALS
call GetSGBLayout
ld b, CGB_STATS_SCREEN_HP_PALS
call GetCGBLayout
call SetPalettes
ret

View File

@ -1,7 +1,7 @@
_ResetClock:
farcall BlankScreen
ld b, SCGB_DIPLOMA
call GetSGBLayout
ld b, CGB_DIPLOMA
call GetCGBLayout
call LoadStandardFont
call LoadFontsExtra
ld de, MUSIC_MAIN_MENU

View File

@ -21,8 +21,8 @@ InitClock:
call RotateFourPalettesLeft
call ClearTilemap
call ClearSprites
ld b, SCGB_DIPLOMA
call GetSGBLayout
ld b, CGB_DIPLOMA
call GetCGBLayout
xor a
ldh [hBGMapMode], a
call LoadStandardFont

View File

@ -65,8 +65,8 @@ _TimeOfDayPals::
ldh [rSVBK], a
; update sgb pals
ld b, SCGB_MAPPALS
call GetSGBLayout
ld b, CGB_MAPPALS
call GetCGBLayout
; restore bg palette 7
ld hl, wOBPals1 - 1 ; last byte in wBGPals1

View File

@ -1,30 +0,0 @@
; gray
RGB 31, 31, 31
RGB 21, 21, 21
RGB 13, 13, 13
RGB 07, 07, 07
; yellow
RGB 31, 31, 31
RGB 31, 31, 07
RGB 31, 16, 01
RGB 07, 07, 07
; red
RGB 31, 31, 31
RGB 31, 19, 24
RGB 30, 10, 06
RGB 07, 07, 07
; green
RGB 31, 31, 31
RGB 12, 25, 01
RGB 05, 14, 00
RGB 07, 07, 07
; blue
RGB 31, 31, 31
RGB 08, 12, 31
RGB 01, 04, 31
RGB 07, 07, 07
; brown
RGB 31, 31, 31
RGB 24, 18, 07
RGB 20, 15, 03
RGB 07, 07, 07

View File

@ -1,4 +0,0 @@
RGB 31, 31, 31
RGB 18, 23, 31
RGB 15, 20, 31
RGB 00, 00, 00

View File

@ -1,4 +0,0 @@
RGB 31, 31, 31
RGB 31, 31, 12
RGB 08, 16, 28
RGB 00, 00, 00

30
gfx/predef/four_pals.asm Executable file
View File

@ -0,0 +1,30 @@
MACRO four_pals
dw PREDEFPAL_\1, PREDEFPAL_\2, PREDEFPAL_\3, PREDEFPAL_\4
ENDM
FourPals_MagnetTrain:
four_pals BETA_SHINY_GREENMON, CGB_BADGE, RB_BROWNMON, ROUTES
FourPals_UnownPuzzle:
four_pals UNOWN_PUZZLE, UNOWN_PUZZLE, UNOWN_PUZZLE, UNOWN_PUZZLE
FourPals_Pack:
four_pals PACK, ROUTES, ROUTES, ROUTES
FourPals_BetaPikachuMinigame:
four_pals GS_INTRO_JIGGLYPUFF_PIKACHU_OB, ROUTES, ROUTES, ROUTES
FourPals_PartyMenu:
four_pals PARTY_ICON, HP_GREEN, HP_YELLOW, HP_RED
FourPals_BattleGrayscale:
four_pals BLACKOUT, BLACKOUT, BLACKOUT, BLACKOUT
FourPals_BetaTitleScreen:
four_pals BETA_LOGO_1, BETA_LOGO_2, DIPLOMA, RB_PURPLEMON
FourPals_Diploma:
four_pals DIPLOMA, ROUTES, ROUTES, ROUTES
FourPals_TradeTube:
four_pals TRADE_TUBE, ROUTES, ROUTES, ROUTES

0
gfx/sgb/predef.pal → gfx/predef/predef.pal Normal file → Executable file
View File

View File

@ -1,89 +0,0 @@
; macros taken from pokered's data/sgb_packets.asm
; names taken from pandocs
; http://gbdev.gg8.se/wiki/articles/SGB_Functions#SGB_Palette_Commands
MACRO attr_blk
db (SGB_ATTR_BLK << 3) + ((\1 * 6) / 16 + 1)
db \1
ENDM
MACRO attr_blk_data
db \1 ; which regions are affected
db \2 + (\3 << 2) + (\4 << 4) ; palette for each region
db \5, \6, \7, \8 ; x1, y1, x2, y2
ENDM
BlkPacket_AllPal0:
attr_blk 1
attr_blk_data %011, 0,0,0, 00,00, 19,17
ds 8, 0
BlkPacket_GSIntroJigglypuffPikachu:
attr_blk 1
attr_blk_data %111, 1,1,0, 00,10, 19,13
ds 8, 0
BlkPacket_Battle:
attr_blk 5
attr_blk_data %111, 2,2,0, 00,12, 19,17 ; text box: pal 2
attr_blk_data %011, 1,1,0, 01,00, 10,03 ; enemy HP bar: pal 1
attr_blk_data %011, 0,0,0, 10,08, 19,10 ; player HP+exp bar: pal 0
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,07 ; enemy mon : pal 3
BlkPacket_StatsScreen:
attr_blk 1
attr_blk_data %111, 1,1,0, 00,01, 07,07 ; mon: pal 1
ds 8, 0
BlkPacket_MoveList:
attr_blk 1
attr_blk_data %111, 1,1,0, 11,01, 19,02
ds 8, 0
BlkPacket_Pokedex_PC:
attr_blk 1
attr_blk_data %111, 1,1,0, 01,01, 08,08 ; mon: pal 1
ds 8, 0
BlkPacket_PokedexUnownMode:
attr_blk 1
attr_blk_data %111, 1,1,0, 07,05, 13,11 ; unown: pal 1
ds 8, 0
BlkPacket_SlotMachine:
attr_blk 5
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 ; "2" rows: pal 2
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 ; slot reels: pal 0
attr_blk_data %011, 0,0,0, 00,12, 19,17 ; text box: pal 0
BlkPacket_PartyMenu: ; unreferenced
attr_blk 7
attr_blk_data %111, 0,0,1, 00,00, 02,12
attr_blk_data %010, 0,0,0, 12,00, 18,01
attr_blk_data %010, 0,0,0, 12,02, 18,03
attr_blk_data %010, 0,0,0, 12,04, 18,05
attr_blk_data %010, 0,0,0, 12,06, 18,07
attr_blk_data %010, 0,0,0, 12,08, 18,09
attr_blk_data %010, 0,0,0, 12,10, 18,11
ds 4, 0
BlkPacket_GSTitleScreen:
attr_blk 3
attr_blk_data %111, 0,0,2, 00,00, 19,04
attr_blk_data %011, 3,3,0, 00,06, 19,17
attr_blk_data %011, 1,1,0, 15,01, 18,04
ds 12, 0
BlkPacket_BetaTitleScreen:
attr_blk 1
attr_blk_data %111, 0,0,1, 00,00, 19,05 ; logo
ds 8, 0
BlkPacket_MagnetTrain:
attr_blk 2
attr_blk_data %111, 2,2,0, 00,04, 19,13 ; fence
attr_blk_data %011, 1,1,0, 00,06, 19,11 ; train
ds 2, 0

View File

@ -1,96 +0,0 @@
; macros taken from pokered's data/sgb_packets.asm
; names taken from pandocs
; http://gbdev.gg8.se/wiki/articles/SGB_Functions#SGB_Palette_Commands
MACRO sgb_pal_set
db (SGB_PAL_SET << 3) + 1
dw PREDEFPAL_\1, PREDEFPAL_\2, PREDEFPAL_\3, PREDEFPAL_\4
ds 7, 0
ENDM
MACRO sgb_pal01
db (SGB_PAL01 << 3) + 1
ENDM
MACRO sgb_pal23
db (SGB_PAL23 << 3) + 1
ENDM
PalPacket_GSTitleScreen:
sgb_pal_set GS_TITLE_SCREEN_0, GS_TITLE_SCREEN_1, GS_TITLE_SCREEN_2, GS_TITLE_SCREEN_3
PalPacket_MagnetTrain:
sgb_pal_set BETA_SHINY_GREENMON, CGB_BADGE, RB_BROWNMON, ROUTES
PalPacket_BetaPoker:
sgb_pal_set BETA_POKER_0, BETA_POKER_1, BETA_POKER_2, BETA_POKER_3
PalPacket_UnownPuzzle:
sgb_pal_set UNOWN_PUZZLE, UNOWN_PUZZLE, UNOWN_PUZZLE, UNOWN_PUZZLE
PalPacket_AllPal0:
sgb_pal_set ROUTES, ROUTES, ROUTES, ROUTES
PalPacket_GSIntroShellderLapras:
sgb_pal_set GS_INTRO_SHELLDER_LAPRAS, ROUTES, ROUTES, ROUTES
PalPacket_BetaIntroLapras: ; unreferenced
sgb_pal_set BETA_INTRO_LAPRAS, ROUTES, ROUTES, ROUTES
PalPacket_GSIntroJigglypuffPikachu:
sgb_pal_set GS_INTRO_JIGGLYPUFF_PIKACHU_BG, GS_INTRO_JIGGLYPUFF_PIKACHU_OB, ROUTES, ROUTES
PalPacket_GSIntroStartersTransition:
sgb_pal_set GS_INTRO_STARTERS_TRANSITION, ROUTES, ROUTES, ROUTES
PalPacket_BetaIntroVenusaur:
sgb_pal_set BETA_INTRO_VENUSAUR, ROUTES, ROUTES, ROUTES
PalPacket_Pack:
sgb_pal_set PACK, ROUTES, ROUTES, ROUTES
PalPacket_BetaPikachuMinigame:
sgb_pal_set GS_INTRO_JIGGLYPUFF_PIKACHU_OB, ROUTES, ROUTES, ROUTES
PalPacket_PartyMenu:
sgb_pal_set PARTY_ICON, HP_GREEN, HP_YELLOW, HP_RED
PalPacket_BattleGrayscale:
sgb_pal_set BLACKOUT, BLACKOUT, BLACKOUT, BLACKOUT
PalPacket_Pokegear:
sgb_pal_set POKEGEAR, ROUTES, ROUTES, ROUTES
PalPacket_Pack2: ; unreferenced
sgb_pal_set PACK, ROUTES, ROUTES, ROUTES
PalPacket_SlotMachine:
sgb_pal_set SLOT_MACHINE_0, SLOT_MACHINE_1, SLOT_MACHINE_2, SLOT_MACHINE_3
PalPacket_BetaTitleScreen:
sgb_pal_set BETA_LOGO_1, BETA_LOGO_2, DIPLOMA, RB_PURPLEMON
PalPacket_Diploma:
sgb_pal_set DIPLOMA, ROUTES, ROUTES, ROUTES
PalPacket_TradeTube:
sgb_pal_set TRADE_TUBE, ROUTES, ROUTES, ROUTES
PalPacket_GamefreakLogo:
sgb_pal_set GS_INTRO_GAMEFREAK_LOGO, ROUTES, ROUTES, ROUTES
PalPacket_Pal01:
sgb_pal01
RGB 31, 31, 31
rept 6
RGB 00, 00, 00
endr
db 0
PalPacket_Pal23:
sgb_pal23
RGB 31, 31, 31
rept 6
RGB 00, 00, 00
endr
db 0

Binary file not shown.

View File

@ -1,79 +0,0 @@
RGB 24, 06, 06
RGB 24, 24, 26
RGB 14, 15, 20
RGB 04, 07, 10
RGB 31, 31, 25
RGB 31, 31, 25
RGB 31, 31, 25
RGB 31, 31, 25
RGB 31, 31, 25
RGB 31, 31, 25
RGB 31, 31, 25
RGB 31, 31, 25
RGB 31, 31, 25
RGB 31, 31, 25
RGB 31, 31, 25
RGB 31, 31, 25
RGB 18, 24, 18
RGB 31, 26, 15
RGB 26, 19, 10
RGB 12, 07, 05
RGB 31, 31, 25
RGB 31, 31, 25
RGB 31, 31, 25
RGB 31, 31, 25
RGB 31, 31, 25
RGB 31, 31, 25
RGB 31, 31, 25
RGB 31, 31, 25
RGB 31, 31, 25
RGB 31, 31, 25
RGB 31, 31, 25
RGB 31, 31, 25
RGB 18, 06, 31
RGB 31, 31, 29
RGB 31, 12, 00
RGB 00, 00, 00
RGB 31, 31, 25
RGB 31, 31, 25
RGB 31, 31, 25
RGB 31, 31, 25
RGB 31, 31, 25
RGB 31, 31, 25
RGB 31, 31, 25
RGB 31, 31, 25
RGB 31, 31, 25
RGB 31, 31, 25
RGB 31, 31, 25
RGB 31, 31, 25
RGB 12, 31, 06
RGB 22, 26, 30
RGB 16, 17, 21
RGB 00, 03, 00
RGB 31, 31, 25
RGB 31, 31, 25
RGB 31, 31, 25
RGB 31, 31, 25
RGB 31, 31, 25
RGB 31, 31, 25
RGB 31, 31, 25
RGB 31, 31, 25
RGB 31, 31, 25
RGB 31, 31, 25
RGB 31, 31, 25
RGB 31, 31, 25

Binary file not shown.

Before

Width:  |  Height:  |  Size: 608 B

View File

@ -160,8 +160,6 @@ Init::
call DelayFrame
predef InitSGBBorder
call InitSound
xor a
ld [wMapMusic], a

View File

@ -1910,8 +1910,8 @@ ExitAllMenus::
call UpdateSprites
call GSReloadPalettes
FinishExitMenu::
ld b, SCGB_MAPPALS
call GetSGBLayout
ld b, CGB_MAPPALS
call GetCGBLayout
farcall LoadOW_BGPal7
call WaitBGMap2
farcall FadeInPalettes
@ -1932,8 +1932,8 @@ ReturnToMapWithSpeechTextbox::
set 0, [hl]
call UpdateSprites
call WaitBGMap2
ld b, SCGB_MAPPALS
call GetSGBLayout
ld b, CGB_MAPPALS
call GetCGBLayout
farcall LoadOW_BGPal7
call UpdateTimePals
call DelayFrame

View File

@ -178,21 +178,10 @@ ClearPalettes::
ldh [hCGBPalUpdate], a
ret
GetMemSGBLayout::
ld b, SCGB_DEFAULT
GetSGBLayout::
; load sgb packets unless dmg
ldh a, [hCGB]
and a
jr nz, .sgb
ldh a, [hSGB]
and a
ret z
.sgb
predef_jump LoadSGBLayout
GetMemCGBLayout::
ld b, CGB_DEFAULT
GetCGBLayout::
predef_jump LoadCGBLayout
SetHPPal::
; Set palette for hp bar pixel length e at hl.

View File

@ -32,6 +32,7 @@ INCLUDE "constants/text_constants.asm"
INCLUDE "constants/audio_constants.asm"
INCLUDE "constants/battle_anim_constants.asm"
INCLUDE "constants/battle_constants.asm"
INCLUDE "constants/cgb_pal_constants.asm"
INCLUDE "constants/collision_constants.asm"
INCLUDE "constants/credits_constants.asm"
INCLUDE "constants/cry_constants.asm"
@ -56,7 +57,6 @@ INCLUDE "constants/pokemon_constants.asm"
INCLUDE "constants/pokemon_data_constants.asm"
INCLUDE "constants/printer_constants.asm"
INCLUDE "constants/radio_constants.asm"
INCLUDE "constants/scgb_constants.asm"
INCLUDE "constants/script_constants.asm"
INCLUDE "constants/serial_constants.asm"
INCLUDE "constants/sfx_constants.asm"

View File

@ -953,7 +953,7 @@ wEnemyHPPal:: db
wHPPals:: ds PARTY_LENGTH
wCurHPPal:: db
wSGBPals:: ds 48
wWhichPartyMonHPPal:: db
wAttrmap::
; 20x18 grid of bg tile attributes for 8x8 tiles