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) ; CGBLayoutJumptable indexes (see engine/gfx/cgb_layouts.asm)
; SGBLayoutJumptable indexes (see engine/gfx/sgb_layouts.asm)
const_def const_def
const SCGB_BATTLE_GRAYSCALE const CGB_BATTLE_GRAYSCALE
const SCGB_BATTLE_COLORS const CGB_BATTLE_COLORS
const SCGB_POKEGEAR_PALS const CGB_POKEGEAR_PALS
const SCGB_STATS_SCREEN_HP_PALS const CGB_STATS_SCREEN_HP_PALS
const SCGB_POKEDEX const CGB_POKEDEX
const SCGB_SLOT_MACHINE const CGB_SLOT_MACHINE
const SCGB_BETA_TITLE_SCREEN const CGB_BETA_TITLE_SCREEN
const SCGB_GS_INTRO const CGB_GS_INTRO
const SCGB_DIPLOMA const CGB_DIPLOMA
const SCGB_MAPPALS const CGB_MAPPALS
const SCGB_PARTY_MENU const CGB_PARTY_MENU
const SCGB_EVOLUTION const CGB_EVOLUTION
const SCGB_GS_TITLE_SCREEN const CGB_GS_TITLE_SCREEN
const SCGB_0D const CGB_0D
const SCGB_MOVE_LIST const CGB_MOVE_LIST
const SCGB_BETA_PIKACHU_MINIGAME const CGB_BETA_PIKACHU_MINIGAME
const SCGB_POKEDEX_SEARCH_OPTION const CGB_POKEDEX_SEARCH_OPTION
const SCGB_BETA_POKER const CGB_BETA_POKER
const SCGB_POKEPIC const CGB_POKEPIC
const SCGB_MAGNET_TRAIN const CGB_MAGNET_TRAIN
const SCGB_PACKPALS const CGB_PACKPALS
const SCGB_TRAINER_CARD const CGB_TRAINER_CARD
const SCGB_POKEDEX_UNOWN_MODE const CGB_POKEDEX_UNOWN_MODE
const SCGB_BILLS_PC const CGB_BILLS_PC
const SCGB_UNOWN_PUZZLE const CGB_UNOWN_PUZZLE
const SCGB_GAMEFREAK_LOGO const CGB_GAMEFREAK_LOGO
const SCGB_PLAYER_OR_MON_FRONTPIC_PALS const CGB_PLAYER_OR_MON_FRONTPIC_PALS
const SCGB_TRADE_TUBE const CGB_TRADE_TUBE
const SCGB_TRAINER_OR_MON_FRONTPIC_PALS const CGB_TRAINER_OR_MON_FRONTPIC_PALS
const SCGB_1D const CGB_1D
DEF NUM_SCGB_LAYOUTS EQU const_value DEF NUM_CGB_LAYOUTS EQU const_value
DEF SCGB_PARTY_MENU_HP_BARS EQU $fc DEF CGB_PARTY_MENU_HP_BARS EQU $fc
DEF SCGB_DEFAULT EQU $ff DEF CGB_DEFAULT EQU $ff
; GetCrystalCGBLayout arguments (see engine/gfx/crystal_layouts.asm) ; GetCrystalCGBLayout arguments (see engine/gfx/crystal_layouts.asm)
const_def const_def
@ -42,7 +41,7 @@ DEF SCGB_DEFAULT EQU $ff
const CRYSTAL_CGB_MOBILE_1 const CRYSTAL_CGB_MOBILE_1
const CRYSTAL_CGB_NAME_CARD 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) ; GetPredefPal arguments (see engine/gfx/color.asm)
const_def const_def
const PREDEFPAL_ROUTES const PREDEFPAL_ROUTES
@ -125,34 +124,3 @@ DEF SCGB_DEFAULT EQU $ff
const PREDEFPAL_GAMEFREAK_LOGO_OB const PREDEFPAL_GAMEFREAK_LOGO_OB
const PREDEFPAL_GAMEFREAK_LOGO_BG const PREDEFPAL_GAMEFREAK_LOGO_BG
DEF NUM_PREDEF_PALS EQU const_value 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 GetUnownLetter
add_predef LoadPoisonBGPals add_predef LoadPoisonBGPals
add_predef DummyPredef2F add_predef DummyPredef2F
add_predef InitSGBBorder add_predef LoadCGBLayout
add_predef LoadSGBLayout
add_predef Pokedex_GetArea add_predef Pokedex_GetArea
add_predef Unused_CheckShininess add_predef Unused_CheckShininess
add_predef DoBattleTransition 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 ExitMenu
call LoadTilemapToTempTilemap call LoadTilemapToTempTilemap
call WaitBGMap call WaitBGMap
call GetMemSGBLayout call GetMemCGBLayout
call SetPalettes call SetPalettes
xor a xor a
ld c, a ld c, a
@ -2673,7 +2673,7 @@ ForcePlayerMonChoice:
call DelayFrame call DelayFrame
call _LoadHPBar call _LoadHPBar
call CloseWindow call CloseWindow
call GetMemSGBLayout call GetMemCGBLayout
call SetPalettes call SetPalettes
call SendOutMonText call SendOutMonText
call NewBattleMonStatus call NewBattleMonStatus
@ -2815,8 +2815,8 @@ LostBattle:
jr nz, .LostLinkBattle jr nz, .LostLinkBattle
; Grayscale ; Grayscale
ld b, SCGB_BATTLE_GRAYSCALE ld b, CGB_BATTLE_GRAYSCALE
call GetSGBLayout call GetCGBLayout
call SetPalettes call SetPalettes
jr .end jr .end
@ -4890,7 +4890,7 @@ BattleMenuPKMN_Loop:
call _LoadHPBar call _LoadHPBar
call CloseWindow call CloseWindow
call LoadTilemapToTempTilemap call LoadTilemapToTempTilemap
call GetMemSGBLayout call GetMemCGBLayout
call SetPalettes call SetPalettes
jp BattleMenu jp BattleMenu
@ -4970,7 +4970,7 @@ TryPlayerSwitch:
call ClearSprites call ClearSprites
call _LoadHPBar call _LoadHPBar
call CloseWindow call CloseWindow
call GetMemSGBLayout call GetMemCGBLayout
call SetPalettes call SetPalettes
ld a, [wCurPartyMon] ld a, [wCurPartyMon]
ld [wCurBattleMon], a ld [wCurBattleMon], a
@ -6795,8 +6795,8 @@ FinishBattleAnim:
push bc push bc
push de push de
push hl push hl
ld b, SCGB_BATTLE_COLORS ld b, CGB_BATTLE_COLORS
call GetSGBLayout call GetCGBLayout
call SetPalettes call SetPalettes
call DelayFrame call DelayFrame
pop hl pop hl
@ -7880,8 +7880,8 @@ BattleIntro:
farcall ClearBattleRAM farcall ClearBattleRAM
call InitEnemy call InitEnemy
call BackUpBGMap2 call BackUpBGMap2
ld b, SCGB_BATTLE_GRAYSCALE ld b, CGB_BATTLE_GRAYSCALE
call GetSGBLayout call GetCGBLayout
ld hl, rLCDC ld hl, rLCDC
res rLCDC_WINDOW_TILEMAP, [hl] ; select vBGMap0/vBGMap2 res rLCDC_WINDOW_TILEMAP, [hl] ; select vBGMap0/vBGMap2
call InitBattleDisplay call InitBattleDisplay
@ -8236,8 +8236,8 @@ _DisplayLinkRecord:
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
call ByteFill call ByteFill
call WaitBGMap2 call WaitBGMap2
ld b, SCGB_DIPLOMA ld b, CGB_DIPLOMA
call GetSGBLayout call GetCGBLayout
call SetPalettes call SetPalettes
ld c, 8 ld c, 8
call DelayFrames call DelayFrames
@ -8716,8 +8716,8 @@ InitBattleDisplay:
ldh [rWY], a ldh [rWY], a
call WaitBGMap call WaitBGMap
call HideSprites call HideSprites
ld b, SCGB_BATTLE_COLORS ld b, CGB_BATTLE_COLORS
call GetSGBLayout call GetCGBLayout
call SetPalettes call SetPalettes
ld a, $90 ld a, $90
ldh [hWY], a ldh [hWY], a

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -3410,8 +3410,6 @@ BattleAnimFunction_SkyAttack:
.GBCPals: .GBCPals:
db $ff, $aa, $55, $aa db $ff, $aa, $55, $aa
.SGBPals:
db $ff, $ff, $00, $00
BattleAnimFunction_GrowthSwordsDance: BattleAnimFunction_GrowthSwordsDance:
; Moves object in a circle where the height is 1/8 the width, while also moving upward 2 pixels per frame ; 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 inc a
ldh [hBGMapMode], a ldh [hBGMapMode], a
call WaitBGMap call WaitBGMap
ld b, SCGB_DIPLOMA ld b, CGB_DIPLOMA
call GetSGBLayout call GetCGBLayout
call SetPalettes call SetPalettes
.resume .resume
call DelayFrame call DelayFrame

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,5 +1,3 @@
INCLUDE "engine/gfx/sgb_layouts.asm"
DEF SHINY_ATK_MASK EQU %0010 DEF SHINY_ATK_MASK EQU %0010
DEF SHINY_DEF_DV EQU 10 DEF SHINY_DEF_DV EQU 10
DEF SHINY_SPD_DV EQU 10 DEF SHINY_SPD_DV EQU 10
@ -76,91 +74,13 @@ Unused_CheckShininess:
and a and a
ret 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: InitPartyMenuPalettes:
ld hl, PalPacket_PartyMenu + 1 ld hl, FourPals_PartyMenu
call CopyFourPalettes call CopyFourPalettes
call InitPartyMenuOBPals call InitPartyMenuOBPals
call WipeAttrmap call WipeAttrmap
ret 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: LoadTrainerClassPaletteAsNthBGPal:
ld a, [wTrainerClass] ld a, [wTrainerClass]
call GetTrainerPalettePointer call GetTrainerPalettePointer
@ -221,8 +141,6 @@ LoadBetaPokerPalettes: ; unreferenced
ret ret
ApplyMonOrTrainerPals: ApplyMonOrTrainerPals:
call CheckCGB
ret z
ld a, e ld a, e
and a and a
jr z, .get_trainer jr z, .get_trainer
@ -293,8 +211,6 @@ ApplyHPBarPals:
ret ret
LoadStatsScreenPals: LoadStatsScreenPals:
call CheckCGB
ret z
ld hl, StatsScreenPals ld hl, StatsScreenPals
ld b, 0 ld b, 0
dec c dec c
@ -324,31 +240,6 @@ LoadMailPalettes:
add hl, hl add hl, hl
ld de, .MailPals ld de, .MailPals
add hl, de 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 de, wBGPals1
ld bc, 1 palettes ld bc, 1 palettes
ld a, BANK(wBGPals1) ld a, BANK(wBGPals1)
@ -391,6 +282,13 @@ GetPredefPal:
add hl, bc add hl, bc
ret 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: LoadHLPaletteIntoDE:
ldh a, [rSVBK] ldh a, [rSVBK]
push af push af
@ -547,10 +445,10 @@ ApplyAttrmap:
ldh [rVBK], a ldh [rVBK], a
ret ret
; CGB layout for SCGB_PARTY_MENU_HP_BARS ; CGB layout for CGB_PARTY_MENU_HP_BARS
CGB_ApplyPartyMenuHPPals: CGB_ApplyPartyMenuHPPals:
ld hl, wHPPals ld hl, wHPPals
ld a, [wSGBPals] ld a, [wWhichPartyMonHPPal]
ld e, a ld e, a
ld d, 0 ld d, 0
add hl, de add hl, de
@ -561,7 +459,7 @@ CGB_ApplyPartyMenuHPPals:
ld e, a ld e, a
hlcoord 11, 2, wAttrmap hlcoord 11, 2, wAttrmap
ld bc, 2 * SCREEN_WIDTH ld bc, 2 * SCREEN_WIDTH
ld a, [wSGBPals] ld a, [wWhichPartyMonHPPal]
.loop .loop
and a and a
jr z, .done jr z, .done
@ -636,52 +534,9 @@ GetMonPalettePointer:
call _GetMonPalettePointer call _GetMonPalettePointer
ret 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: BattleObjectPals:
INCLUDE "gfx/battle_anims/battle_anims.pal" 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: _GetMonPalettePointer:
ld l, a ld l, a
ld h, 0 ld h, 0
@ -705,92 +560,9 @@ rept 4
endr endr
ret 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:: InitCGBPals::
call CheckCGB ldh a, [hCGB]
and a
ret z ret z
; CGB only ; CGB only
@ -845,267 +617,6 @@ InitCGBPals::
jr nz, .loop jr nz, .loop
ret 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: HPBarPals:
INCLUDE "gfx/battle/hp_bar.pal" INCLUDE "gfx/battle/hp_bar.pal"
@ -1240,9 +751,6 @@ INCLUDE "gfx/diploma/diploma.pal"
PartyMenuOBPals: PartyMenuOBPals:
INCLUDE "gfx/stats/party_menu_ob.pal" INCLUDE "gfx/stats/party_menu_ob.pal"
UnusedBattleObjectPals: ; unreferenced
INCLUDE "gfx/battle_anims/unused_battle_anims.pal"
UnusedGSTitleBGPals: UnusedGSTitleBGPals:
INCLUDE "gfx/title/unused_gs_bg.pal" 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 [wTempMonDVs], a
ld a, [wOTTrademonDVs + 1] ld a, [wOTTrademonDVs + 1]
ld [wTempMonDVs + 1], a ld [wTempMonDVs + 1], a
ld b, SCGB_PLAYER_OR_MON_FRONTPIC_PALS ld b, CGB_PLAYER_OR_MON_FRONTPIC_PALS
call GetSGBLayout call GetCGBLayout
ld a, %11100100 ; 3,2,1,0 ld a, %11100100 ; 3,2,1,0
call DmgToCgbBGPals call DmgToCgbBGPals
farcall TradeAnim_ShowGetmonFrontpic farcall TradeAnim_ShowGetmonFrontpic

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -65,8 +65,8 @@ _TimeOfDayPals::
ldh [rSVBK], a ldh [rSVBK], a
; update sgb pals ; update sgb pals
ld b, SCGB_MAPPALS ld b, CGB_MAPPALS
call GetSGBLayout call GetCGBLayout
; restore bg palette 7 ; restore bg palette 7
ld hl, wOBPals1 - 1 ; last byte in wBGPals1 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 call DelayFrame
predef InitSGBBorder
call InitSound call InitSound
xor a xor a
ld [wMapMusic], a ld [wMapMusic], a

View File

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

View File

@ -178,21 +178,10 @@ ClearPalettes::
ldh [hCGBPalUpdate], a ldh [hCGBPalUpdate], a
ret ret
GetMemSGBLayout:: GetMemCGBLayout::
ld b, SCGB_DEFAULT ld b, CGB_DEFAULT
GetSGBLayout:: GetCGBLayout::
; load sgb packets unless dmg predef_jump LoadCGBLayout
ldh a, [hCGB]
and a
jr nz, .sgb
ldh a, [hSGB]
and a
ret z
.sgb
predef_jump LoadSGBLayout
SetHPPal:: SetHPPal::
; Set palette for hp bar pixel length e at hl. ; 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/audio_constants.asm"
INCLUDE "constants/battle_anim_constants.asm" INCLUDE "constants/battle_anim_constants.asm"
INCLUDE "constants/battle_constants.asm" INCLUDE "constants/battle_constants.asm"
INCLUDE "constants/cgb_pal_constants.asm"
INCLUDE "constants/collision_constants.asm" INCLUDE "constants/collision_constants.asm"
INCLUDE "constants/credits_constants.asm" INCLUDE "constants/credits_constants.asm"
INCLUDE "constants/cry_constants.asm" INCLUDE "constants/cry_constants.asm"
@ -56,7 +57,6 @@ INCLUDE "constants/pokemon_constants.asm"
INCLUDE "constants/pokemon_data_constants.asm" INCLUDE "constants/pokemon_data_constants.asm"
INCLUDE "constants/printer_constants.asm" INCLUDE "constants/printer_constants.asm"
INCLUDE "constants/radio_constants.asm" INCLUDE "constants/radio_constants.asm"
INCLUDE "constants/scgb_constants.asm"
INCLUDE "constants/script_constants.asm" INCLUDE "constants/script_constants.asm"
INCLUDE "constants/serial_constants.asm" INCLUDE "constants/serial_constants.asm"
INCLUDE "constants/sfx_constants.asm" INCLUDE "constants/sfx_constants.asm"

View File

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