From acd022d7652fdf5e3cf50ab11929cee71135d622 Mon Sep 17 00:00:00 2001 From: xCrystal Date: Wed, 26 Jul 2023 14:29:16 +0200 Subject: [PATCH] Remove unnecessary DMG and SGB checking (#7) --- engine/battle/anim_hp_bar.asm | 11 -- engine/battle/battle_transition.asm | 14 +- .../battle/battlestart_copytilemapatonce.asm | 3 - engine/battle_anims/anim_commands.asm | 32 ---- engine/battle_anims/bg_effects.asm | 168 ------------------ engine/battle_anims/functions.asm | 8 - engine/debug/color_picker.asm | 58 ------ engine/events/heal_machine_anim.asm | 15 -- engine/events/mom.asm | 2 +- engine/events/poisonstep_pals.asm | 22 --- engine/games/card_flip.asm | 17 -- engine/games/slot_machine.asm | 5 - engine/gfx/color.asm | 78 -------- engine/gfx/sprites.asm | 8 - engine/menus/savemenu_copytilemapatonce.asm | 4 - engine/movie/trade_animation.asm | 11 +- engine/overworld/warp_connection.asm | 4 - engine/phone/phonering_copytilemapatonce.asm | 3 - engine/pokedex/pokedex.asm | 31 +--- engine/pokegear/pokegear.asm | 19 +- engine/tilesets/tileset_anims.asm | 19 +- engine/tilesets/timeofday_pals.asm | 71 -------- gfx/battle/expbarend_sgb.png | Bin 85 -> 0 bytes gfx/tilesets/flower/dmg_1.png | Bin 90 -> 0 bytes gfx/tilesets/flower/dmg_2.png | Bin 90 -> 0 bytes home/fade.asm | 43 ----- home/palettes.asm | 33 ---- home/tilemap.asm | 23 +-- home/vblank.asm | 20 +-- main.asm | 1 - 30 files changed, 10 insertions(+), 713 deletions(-) delete mode 100644 engine/battle/battlestart_copytilemapatonce.asm delete mode 100644 gfx/battle/expbarend_sgb.png delete mode 100644 gfx/tilesets/flower/dmg_1.png delete mode 100644 gfx/tilesets/flower/dmg_2.png diff --git a/engine/battle/anim_hp_bar.asm b/engine/battle/anim_hp_bar.asm index 3e413f9f7..786e576d8 100644 --- a/engine/battle/anim_hp_bar.asm +++ b/engine/battle/anim_hp_bar.asm @@ -273,9 +273,6 @@ HPBarAnim_UpdateHPRemaining: ret HPBarAnim_PaletteUpdate: - ldh a, [hCGB] - and a - ret z ld hl, wCurHPAnimPal call SetHPPal ld a, [wCurHPAnimPal] @@ -284,14 +281,6 @@ HPBarAnim_PaletteUpdate: ret HPBarAnim_BGMapUpdate: - ldh a, [hCGB] - and a - jr nz, .cgb - call DelayFrame - call DelayFrame - ret - -.cgb ld a, [wWhichHPBar] and a jr z, .load_0 diff --git a/engine/battle/battle_transition.asm b/engine/battle/battle_transition.asm index 6a5fbcb34..d0bc72b67 100644 --- a/engine/battle/battle_transition.asm +++ b/engine/battle/battle_transition.asm @@ -69,7 +69,7 @@ DoBattleTransition: call UpdateSprites call DelayFrame call .LoadPokeballTiles - call BattleStart_CopyTilemapAtOnce + call CopyTilemapAtOnce ld a, SCREEN_HEIGHT_PX ldh [hWY], a call DelayFrame @@ -636,16 +636,6 @@ StartTrainerBattle_LoadPokeBallGraphics: dec b jr nz, .tile_loop - ldh a, [hCGB] - and a - jr nz, .cgb - ld a, 1 - ldh [hBGMapMode], a - call DelayFrame - call DelayFrame - jr .nextscene - -.cgb ld hl, .pals ld a, [wTimeOfDayPal] maskbits NUM_DAYTIMES @@ -671,7 +661,7 @@ StartTrainerBattle_LoadPokeBallGraphics: ld a, TRUE ldh [hCGBPalUpdate], a call DelayFrame - call BattleStart_CopyTilemapAtOnce + call CopyTilemapAtOnce .nextscene call StartTrainerBattle_NextScene diff --git a/engine/battle/battlestart_copytilemapatonce.asm b/engine/battle/battlestart_copytilemapatonce.asm deleted file mode 100644 index 9d4d48d3a..000000000 --- a/engine/battle/battlestart_copytilemapatonce.asm +++ /dev/null @@ -1,3 +0,0 @@ -BattleStart_CopyTilemapAtOnce: - call CGBOnly_CopyTilemapAtOnce - ret diff --git a/engine/battle_anims/anim_commands.asm b/engine/battle_anims/anim_commands.asm index d2b252f22..99003fb7a 100644 --- a/engine/battle_anims/anim_commands.asm +++ b/engine/battle_anims/anim_commands.asm @@ -176,10 +176,6 @@ BattleAnimRestoreHuds: ret BattleAnimRequestPals: - ldh a, [hCGB] - and a - ret z - ldh a, [rBGP] ld b, a ld a, [wBGP] @@ -643,12 +639,7 @@ BattleAnimCmd_OBP1: ret BattleAnimCmd_ResetObp0: - ldh a, [hSGB] - and a ld a, $e0 - jr z, .not_sgb - ld a, $f0 -.not_sgb ld [wOBP0], a ret @@ -1336,23 +1327,6 @@ PlayHitSound: ret BattleAnimAssignPals: - ldh a, [hCGB] - and a - jr nz, .cgb - ldh a, [hSGB] - and a - ld a, %11100000 - jr z, .sgb - ld a, %11110000 - -.sgb - ld [wOBP0], a - ld a, %11100100 - ld [wBGP], a - ld [wOBP1], a - ret - -.cgb ld a, %11100100 ld [wBGP], a ld [wOBP0], a @@ -1405,9 +1379,6 @@ BattleAnim_RevertPals: BattleAnim_SetBGPals: ldh [rBGP], a - ldh a, [hCGB] - and a - ret z ldh a, [rSVBK] push af ld a, BANK(wBGPals1) @@ -1432,9 +1403,6 @@ BattleAnim_SetBGPals: BattleAnim_SetOBPals: ldh [rOBP0], a - ldh a, [hCGB] - and a - ret z ldh a, [rSVBK] push af ld a, BANK(wOBPals1) diff --git a/engine/battle_anims/bg_effects.asm b/engine/battle_anims/bg_effects.asm index 1b8e279a2..38943ab27 100644 --- a/engine/battle_anims/bg_effects.asm +++ b/engine/battle_anims/bg_effects.asm @@ -281,14 +281,7 @@ BattleBGEffect_AlternateHues: db -2 BattleBGEffect_CycleOBPalsGrayAndYellow: - call BattleBGEffects_CheckSGB - jr nz, .sgb ld de, .PalsCGB - jr .okay - -.sgb - ld de, .PalsSGB -.okay call BattleBGEffect_GetNthDMGPal ld [wOBP0], a ret @@ -304,14 +297,7 @@ BattleBGEffect_CycleOBPalsGrayAndYellow: db -2 BattleBGEffect_CycleMidOBPalsGrayAndYellow: - call BattleBGEffects_CheckSGB - jr nz, .sgb ld de, .PalsCGB - jr .okay - -.sgb - ld de, .PalsSGB -.okay call BattleBGEffect_GetNthDMGPal ld [wOBP0], a ret @@ -1955,90 +1941,6 @@ BattleBGEffect_BetaSendOutMon2: ; unused ret BattleBGEffect_FadeMonsToBlackRepeating: - ldh a, [hCGB] - and a - jr nz, .cgb - call BattleBGEffects_AnonJumptable -.anon_dw - dw .zero - dw .one - dw .two - -.zero - call BattleBGEffects_IncAnonJumptableIndex - ld a, $e4 - call BattleBGEffects_SetLYOverrides - ld a, LOW(rBGP) - ldh [hLCDCPointer], a - xor a - ldh [hLYOverrideStart], a - ld a, $60 - ldh [hLYOverrideEnd], a - ret - -.one - ld hl, BG_EFFECT_STRUCT_PARAM - add hl, bc - ld a, [hl] - inc [hl] - ld e, a - and $7 - ret nz - ld a, e - and $18 - sla a - swap a - sla a - ld e, a - ld d, 0 - push bc - call BGEffect_CheckBattleTurn - jr nz, .player - ld hl, .CGB_DMGEnemyData - add hl, de - ld a, [hli] - ld [wOBP1], a - ld d, a - ld e, [hl] - lb bc, $2f, $30 - jr .okay - -.player - ld hl, .DMG_PlayerData - add hl, de - ld d, [hl] - inc hl - ld a, [hl] - ld [wOBP1], a - ld e, a - lb bc, $37, $28 -.okay - call .DMG_LYOverrideLoads - pop bc - ret - -.two - call BattleBGEffects_ResetVideoHRAM - ld a, $e4 - ld [wBGP], a - ld [wOBP1], a - ret - -.DMG_LYOverrideLoads: - ld hl, wLYOverridesBackup -.loop1 - ld [hl], d - inc hl - dec b - jr nz, .loop1 -.loop2 - ld [hl], e - inc hl - dec c - jr nz, .loop2 - ret - -.cgb ld de, .Jumptable call BatttleBGEffects_GetNamedJumptablePointer jp hl @@ -2397,71 +2299,6 @@ BattleBGEffect_GetNthDMGPal: BGEffect_RapidCyclePals: ; Last index in DE: $fe signals a loop, $ff signals end - ldh a, [hCGB] - and a - jr nz, .cgb - push de - ld de, .Jumptable_DMG - call BatttleBGEffects_GetNamedJumptablePointer - pop de - jp hl - -.Jumptable_DMG: - dw .zero_dmg - dw .one_dmg - dw .two_dmg - -.zero_dmg - call BattleBGEffects_IncAnonJumptableIndex - ld a, $e4 - call BattleBGEffects_SetLYOverrides - ld a, $47 - call BattleBGEffect_SetLCDStatCustoms1 - ldh a, [hLYOverrideEnd] - inc a - ldh [hLYOverrideEnd], a - ld hl, BG_EFFECT_STRUCT_PARAM - add hl, bc - ld a, [hl] - ld [hl], $0 - ld hl, BG_EFFECT_STRUCT_BATTLE_TURN - add hl, bc - ld [hl], a - ret - -.one_dmg - ld hl, BG_EFFECT_STRUCT_BATTLE_TURN - add hl, bc - ld a, [hl] - and $f - jr z, .okay_1_dmg - dec [hl] - ret - -.okay_1_dmg - ld a, [hl] - swap a - or [hl] - ld [hl], a - call BattleBGEffect_GetFirstDMGPal - jr c, .okay_2_dmg - call BGEffect_FillLYOverridesBackup - ret - -.okay_2_dmg - ld hl, BG_EFFECT_STRUCT_PARAM - add hl, bc - dec [hl] - ret - -.two_dmg - call BattleBGEffects_ResetVideoHRAM - ld a, %11100100 - ldh [rBGP], a - call EndBattleBGEffect - ret - -.cgb push de ld de, .Jumptable_CGB call BatttleBGEffects_GetNamedJumptablePointer @@ -2919,11 +2756,6 @@ BGEffect_CheckFlyDigStatus: and 1 << SUBSTATUS_FLYING | 1 << SUBSTATUS_UNDERGROUND ret -BattleBGEffects_CheckSGB: - ldh a, [hSGB] - and a - ret - BattleBGEffects_Sine: ld e, a callfar BattleAnim_Sine_e diff --git a/engine/battle_anims/functions.asm b/engine/battle_anims/functions.asm index 6e6af6e12..11f8e0767 100644 --- a/engine/battle_anims/functions.asm +++ b/engine/battle_anims/functions.asm @@ -3399,15 +3399,7 @@ BattleAnimFunction_SkyAttack: srl a ld e, a ld d, 0 - ldh a, [hSGB] - and a - jr nz, .sgb ld hl, .GBCPals - jr .got_pals - -.sgb - ld hl, .SGBPals -.got_pals add hl, de ld a, [hl] ld hl, BATTLEANIMSTRUCT_VAR1 diff --git a/engine/debug/color_picker.asm b/engine/debug/color_picker.asm index 21b07e2a6..7a2c9e430 100644 --- a/engine/debug/color_picker.asm +++ b/engine/debug/color_picker.asm @@ -34,14 +34,6 @@ DebugColorPicker: ; unreferenced ; A debug menu to test monster and trainer palettes at runtime. - ldh a, [hCGB] - and a - jr nz, .cgb - ldh a, [hSGB] - and a - ret z - -.cgb ldh a, [hInMenu] push af ld a, TRUE @@ -180,10 +172,6 @@ DebugColor_LoadGFX: ret DebugColor_InitPalettes: - ldh a, [hCGB] - and a - ret z - ldh a, [rSVBK] push af ld a, BANK(wBGPals2) @@ -439,17 +427,11 @@ DebugColor_SetRGBMeter: ret DebugColor_UpdateScreen: - ldh a, [hCGB] - and a - jr z, .sgb - ld a, 2 ldh [hBGMapMode], a call DelayFrame call DelayFrame call DelayFrame - -.sgb call WaitBGMap ld a, DEBUGCOLORMAIN_UPDATEPALETTES @@ -457,11 +439,6 @@ DebugColor_UpdateScreen: ret DebugColor_UpdatePalettes: - ldh a, [hCGB] - and a - jr z, .sgb - -; cgb ldh a, [rSVBK] push af ld a, BANK(wBGPals2) @@ -489,41 +466,6 @@ DebugColor_UpdatePalettes: ldh [rSVBK], a ret -.sgb - ld hl, wSGBPals - ld a, 1 - ld [hli], a - ld a, LOW(PALRGB_WHITE) - ld [hli], a - ld a, HIGH(PALRGB_WHITE) - ld [hli], a - ld a, [wDebugLightColor + 0] - ld [hli], a - ld a, [wDebugLightColor + 1] - ld [hli], a - ld a, [wDebugDarkColor + 0] - ld [hli], a - ld a, [wDebugDarkColor + 1] - ld [hli], a - xor a - ld [hli], a - ld [hli], a - ld [hl], a - - ld hl, wSGBPals - call DebugColor_PushSGBPals - - hlcoord 10, 2 - ld de, wDebugLightColor - call DebugColor_PrintHexColor - hlcoord 15, 2 - ld de, wDebugDarkColor - call DebugColor_PrintHexColor - - ld a, DEBUGCOLORMAIN_JOYPAD - ld [wJumptableIndex], a - ret - DebugColor_PrintHexColor: inc hl inc hl diff --git a/engine/events/heal_machine_anim.asm b/engine/events/heal_machine_anim.asm index a6f049646..b5b6df31a 100644 --- a/engine/events/heal_machine_anim.asm +++ b/engine/events/heal_machine_anim.asm @@ -155,13 +155,6 @@ INCBIN "gfx/overworld/heal_machine.2bpp" dbsprite 11, 7, 5, 1, $7d, PAL_OW_TREE | OBP_NUM .LoadPalettes: - call IsCGB - jr nz, .cgb - ld a, %11100000 - ldh [rOBP1], a - ret - -.cgb ld hl, .palettes ld de, wOBPals2 palette PAL_OW_TREE ld bc, 1 palettes @@ -187,14 +180,6 @@ INCLUDE "gfx/overworld/heal_machine.pal" ret .FlashPalettes: - call IsCGB - jr nz, .go - ldh a, [rOBP1] - xor %00101000 - ldh [rOBP1], a - ret - -.go ldh a, [rSVBK] push af ld a, BANK(wOBPals2) diff --git a/engine/events/mom.asm b/engine/events/mom.asm index 194bae270..6f7906dcb 100644 --- a/engine/events/mom.asm +++ b/engine/events/mom.asm @@ -438,7 +438,7 @@ Mom_ContinueMenuSetup: lb bc, PRINTNUM_MONEY | PRINTNUM_LEADINGZEROS | 3, 6 call PrintNum call UpdateSprites - call CGBOnly_CopyTilemapAtOnce + call CopyTilemapAtOnce ret Mom_Wait10Frames: diff --git a/engine/events/poisonstep_pals.asm b/engine/events/poisonstep_pals.asm index 5154cf29b..dc1e57c1a 100644 --- a/engine/events/poisonstep_pals.asm +++ b/engine/events/poisonstep_pals.asm @@ -1,30 +1,8 @@ LoadPoisonBGPals: call .LoadPals - ldh a, [hCGB] - and a - ret nz - ; code was probably dummied out here ret .LoadPals: - ldh a, [hCGB] - and a - jr nz, .cgb - ld a, [wTimeOfDayPal] - maskbits NUM_DAYTIMES - cp DARKNESS_F - ld a, %00000000 - jr z, .convert_pals - ld a, %10101010 - -.convert_pals - call DmgToCgbBGPals - ld c, 4 - call DelayFrames - farcall _UpdateTimePals - ret - -.cgb ldh a, [rSVBK] push af ld a, BANK(wBGPals2) diff --git a/engine/games/card_flip.asm b/engine/games/card_flip.asm index 3109454b6..c66ac7525 100644 --- a/engine/games/card_flip.asm +++ b/engine/games/card_flip.asm @@ -443,11 +443,6 @@ CardFlip_DisplayCardFaceUp: jr nz, .row pop hl - ; Pointless CGB check - ldh a, [hCGB] - and a - ret z - ; Set the attributes ld de, wAttrmap - wTilemap add hl, de @@ -1313,14 +1308,6 @@ ChooseCard_HandleJoypad: CardFlip_UpdateCursorOAM: call ClearSprites - ldh a, [hCGB] - and a - jr nz, .skip - ldh a, [hVBlankCounter] - and $4 - ret nz - -.skip call CollapseCursorPosition add hl, hl add hl, hl @@ -1546,10 +1533,6 @@ ENDM dbsprite 1, 1, 0, 0, $00, 0 | X_FLIP | Y_FLIP | PRIORITY CardFlip_InitAttrPals: - ldh a, [hCGB] - and a - ret z - hlcoord 0, 0, wAttrmap ld bc, SCREEN_HEIGHT * SCREEN_WIDTH xor a diff --git a/engine/games/slot_machine.asm b/engine/games/slot_machine.asm index e483b86e6..4989bd802 100644 --- a/engine/games/slot_machine.asm +++ b/engine/games/slot_machine.asm @@ -172,11 +172,6 @@ Slots_GetPals: ld a, %11100100 call DmgToCgbBGPals lb de, %11100100, %11100100 - ldh a, [hCGB] - and a - jr nz, .cgb - lb de, %11000000, %11100100 -.cgb call DmgToCgbObjPals ret diff --git a/engine/gfx/color.asm b/engine/gfx/color.asm index e5b027a18..cce4196d8 100644 --- a/engine/gfx/color.asm +++ b/engine/gfx/color.asm @@ -161,77 +161,6 @@ INCLUDE "gfx/intro/gs_magikarp_bg.pal" .MagikarpOBPal: INCLUDE "gfx/intro/gs_magikarp_ob.pal" -Intro_LoadAllPal0: ; unreferenced - call CheckCGB - ret nz - ldh a, [hSGB] - and a - ret z - ld hl, BlkPacket_AllPal0 - jp PushSGBPals - -Intro_LoadBetaIntroVenusaurPalettes: ; unreferenced - call CheckCGB - jr nz, .cgb - ldh a, [hSGB] - and a - ret z - ld hl, PalPacket_BetaIntroVenusaur - jp PushSGBPals - -.cgb - ld de, wOBPals1 - ld a, PREDEFPAL_BETA_INTRO_VENUSAUR - call GetPredefPal - jp LoadHLPaletteIntoDE - -Intro_LoadPackPalettes: ; unreferenced - call CheckCGB - jr nz, .cgb - ldh a, [hSGB] - and a - ret z - ld hl, PalPacket_Pack - jp PushSGBPals - -.cgb - ld de, wOBPals1 - ld a, PREDEFPAL_PACK - call GetPredefPal - jp LoadHLPaletteIntoDE - -GSIntro_LoadMonPalette: ; unreferenced - call CheckCGB - jr nz, .cgb - ldh a, [hSGB] - and a - ret z - ld a, c - push af - ld hl, PalPacket_Pal01 - ld de, wSGBPals - ld bc, PALPACKET_LENGTH - call CopyBytes - pop af - call GetMonPalettePointer - 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 - jp PushSGBPals - -.cgb - ld de, wOBPals1 - ld a, c - call GetMonPalettePointer - call LoadPalette_White_Col1_Col2_Black - ret - LoadTrainerClassPaletteAsNthBGPal: ld a, [wTrainerClass] call GetTrainerPalettePointer @@ -269,13 +198,6 @@ LoadNthMiddleBGPal: ret LoadBetaPokerPalettes: ; unreferenced - ldh a, [hCGB] - and a - jr nz, .cgb - ld hl, wBetaPokerSGBPals - jp PushSGBPals - -.cgb ld a, [wBetaPokerSGBCol] ld c, a ld a, [wBetaPokerSGBRow] diff --git a/engine/gfx/sprites.asm b/engine/gfx/sprites.asm index 9b63eb855..5133987a8 100644 --- a/engine/gfx/sprites.asm +++ b/engine/gfx/sprites.asm @@ -545,13 +545,7 @@ Sprites_Sine: calc_sine_wave AnimateEndOfExpBar: - ldh a, [hSGB] ld de, EndOfExpBarGFX - and a - jr z, .load - ld de, SGBEndOfExpBarGFX - -.load ld hl, vTiles0 tile $00 lb bc, BANK(EndOfExpBarGFX), 1 call Request2bpp @@ -609,8 +603,6 @@ AnimateEndOfExpBar: EndOfExpBarGFX: INCBIN "gfx/battle/expbarend.2bpp" -SGBEndOfExpBarGFX: -INCBIN "gfx/battle/expbarend_sgb.2bpp" ClearSpriteAnims2: push hl diff --git a/engine/menus/savemenu_copytilemapatonce.asm b/engine/menus/savemenu_copytilemapatonce.asm index 2f30b7c7e..17f7c7312 100644 --- a/engine/menus/savemenu_copytilemapatonce.asm +++ b/engine/menus/savemenu_copytilemapatonce.asm @@ -1,8 +1,4 @@ SaveMenu_CopyTilemapAtOnce: - ldh a, [hCGB] - and a - jp z, WaitBGMap - ; The following is a modified version of _CopyTilemapAtOnce ; that waits for [rLY] to be $60 instead of $80 - 1. ldh a, [hBGMapMode] diff --git a/engine/movie/trade_animation.asm b/engine/movie/trade_animation.asm index 5f9295442..4812e7503 100644 --- a/engine/movie/trade_animation.asm +++ b/engine/movie/trade_animation.asm @@ -162,9 +162,7 @@ RunTradeAnimScript: call DisableLCD call LoadFontsBattleExtra callfar ClearSpriteAnims - ldh a, [hCGB] - and a - jr z, .NotCGB + ld a, $1 ldh [rVBK], a ld hl, vTiles0 @@ -174,7 +172,6 @@ RunTradeAnimScript: ld a, $0 ldh [rVBK], a -.NotCGB: hlbgcoord 0, 0 ld bc, VRAM_End - vBGMap0 ld a, " " @@ -1302,13 +1299,7 @@ TradeAnim_CopyBoxFromDEtoHL: ret TradeAnim_NormalPals: - ldh a, [hSGB] - and a ld a, %11100100 ; 3,2,1,0 - jr z, .not_sgb - ld a, $f0 - -.not_sgb call DmgToCgbObjPal0 ld a, %11100100 ; 3,2,1,0 call DmgToCgbBGPals diff --git a/engine/overworld/warp_connection.asm b/engine/overworld/warp_connection.asm index 6024aabb6..2a4db2f9a 100644 --- a/engine/overworld/warp_connection.asm +++ b/engine/overworld/warp_connection.asm @@ -255,10 +255,6 @@ LoadMapTimeOfDay: .PushAttrmap: decoord 0, 0 call .copy - ldh a, [hCGB] - and a - ret z - decoord 0, 0, wAttrmap ld a, $1 ldh [rVBK], a diff --git a/engine/phone/phonering_copytilemapatonce.asm b/engine/phone/phonering_copytilemapatonce.asm index 029c2958c..6cbeecf20 100644 --- a/engine/phone/phonering_copytilemapatonce.asm +++ b/engine/phone/phonering_copytilemapatonce.asm @@ -1,7 +1,4 @@ PhoneRing_CopyTilemapAtOnce: - ldh a, [hCGB] - and a - jp z, WaitBGMap ld a, [wSpriteUpdatesEnabled] cp $0 jp z, WaitBGMap diff --git a/engine/pokedex/pokedex.asm b/engine/pokedex/pokedex.asm index 190575fb6..150b51151 100644 --- a/engine/pokedex/pokedex.asm +++ b/engine/pokedex/pokedex.asm @@ -218,7 +218,7 @@ Pokedex_InitMainScreen: ld a, 7 ld [wDexListingHeight], a call Pokedex_PrintListing - call Pokedex_SetBGMapMode_3ifDMG_4ifCGB + call Pokedex_SetBGMapMode4 call Pokedex_ResetBGMapMode call Pokedex_DrawMainScreenBG ld a, POKEDEX_SCX @@ -814,12 +814,6 @@ Pokedex_UpdateUnownMode: ld a, DEXSTATE_OPTION_SCR ld [wJumptableIndex], a call DelayFrame - call Pokedex_CheckSGB - jr nz, .decompress - farcall LoadSGBPokedexGFX2 - jr .done - -.decompress ld hl, PokedexLZ ld de, vTiles2 tile $31 lb bc, BANK(PokedexLZ), 58 @@ -2420,12 +2414,6 @@ Pokedex_LoadGFX: ld hl, vTiles2 tile $60 ld bc, $20 tiles call Pokedex_InvertTiles - call Pokedex_CheckSGB - jr nz, .LoadPokedexLZ - farcall LoadSGBPokedexGFX - jr .LoadPokedexSlowpokeLZ - -.LoadPokedexLZ: ld hl, PokedexLZ ld de, vTiles2 tile $31 call Decompress @@ -2461,14 +2449,6 @@ INCBIN "gfx/pokedex/pokedex.2bpp.lz" PokedexSlowpokeLZ: INCBIN "gfx/pokedex/slowpoke.2bpp.lz" -Pokedex_CheckSGB: - ldh a, [hCGB] - or a - ret nz - ldh a, [hSGB] - dec a - ret - Pokedex_LoadUnownFont: ld a, BANK(sScratch) call OpenSRAM @@ -2553,15 +2533,6 @@ Pokedex_SetBGMapMode4: call DelayFrames ret -Pokedex_SetBGMapMode_3ifDMG_4ifCGB: - ldh a, [hCGB] - and a - jr z, .DMG - call Pokedex_SetBGMapMode4 -.DMG: - call Pokedex_SetBGMapMode3 - ret - Pokedex_ResetBGMapMode: xor a ldh [hBGMapMode], a diff --git a/engine/pokegear/pokegear.asm b/engine/pokegear/pokegear.asm index 61dd3f191..65c94a953 100644 --- a/engine/pokegear/pokegear.asm +++ b/engine/pokegear/pokegear.asm @@ -104,9 +104,6 @@ PokeGear: ld b, SCGB_POKEGEAR_PALS call GetSGBLayout call SetPalettes - ldh a, [hCGB] - and a - ret z ld a, %11100100 call DmgToCgbObjPal0 ret @@ -256,14 +253,10 @@ InitPokegearTilemap: ret .UpdateBGMap: - ldh a, [hCGB] - and a - jr z, .dmg ld a, $2 ldh [hBGMapMode], a ld c, 3 call DelayFrames -.dmg call WaitBGMap ret @@ -1676,14 +1669,9 @@ _TownMap: ld b, SCGB_POKEGEAR_PALS call GetSGBLayout call SetPalettes - ldh a, [hCGB] - and a - jr z, .dmg ld a, %11100100 call DmgToCgbObjPal0 call DelayFrame - -.dmg ld d, 0 ld e, 1 call .loop @@ -2387,19 +2375,14 @@ TownMapBGUpdate: ldh [hBGMapAddress], a ld a, h ldh [hBGMapAddress + 1], a -; Only update palettes on CGB - ldh a, [hCGB] - and a - jr z, .tiles + ; BG Map mode 2 (palettes) ld a, 2 ldh [hBGMapMode], a ; The BG Map is updated in thirds, so we wait - ; 3 frames to update the whole screen's palettes. ld c, 3 call DelayFrames -.tiles ; Update BG Map tiles call WaitBGMap ; Turn off BG Map update diff --git a/engine/tilesets/tileset_anims.asm b/engine/tilesets/tileset_anims.asm index ca2a86a75..4cbe3fba1 100644 --- a/engine/tilesets/tileset_anims.asm +++ b/engine/tilesets/tileset_anims.asm @@ -670,12 +670,7 @@ AnimateFlowerTile: ; A cycle of 2 frames, updating every other tick ld a, [wTileAnimationTimer] and %10 - -; CGB has different tile graphics for flowers - ld e, a - ldh a, [hCGB] - and 1 - add e + srl a ; hl = .FlowerTileFrames + a * 16 swap a @@ -690,9 +685,7 @@ AnimateFlowerTile: jp WriteTile .FlowerTileFrames: - INCBIN "gfx/tilesets/flower/dmg_1.2bpp" INCBIN "gfx/tilesets/flower/cgb_1.2bpp" - INCBIN "gfx/tilesets/flower/dmg_2.2bpp" INCBIN "gfx/tilesets/flower/cgb_2.2bpp" AnimateLavaBubbleTile1: @@ -905,11 +898,6 @@ endr AnimateWaterPalette: ; Transition between color values 0-2 for color 0 in palette 3. -; Don't update the palette on DMG - ldh a, [hCGB] - and a - ret z - ; Don't update a non-standard palette order ldh a, [rBGP] cp %11100100 @@ -968,11 +956,6 @@ AnimateWaterPalette: ret FlickeringCaveEntrancePalette: -; Don't update the palette on DMG - ldh a, [hCGB] - and a - ret z - ; Don't update a non-standard palette order ldh a, [rBGP] cp %11100100 diff --git a/engine/tilesets/timeofday_pals.asm b/engine/tilesets/timeofday_pals.asm index 214d2f743..69fafd0be 100644 --- a/engine/tilesets/timeofday_pals.asm +++ b/engine/tilesets/timeofday_pals.asm @@ -298,82 +298,11 @@ ConvertTimePalsDecHL: ret GetTimePalFade: -; check cgb - ldh a, [hCGB] - and a - jr nz, .cgb - -; else: dmg - -; index - ld a, [wTimeOfDayPal] - and %11 - -; get fade table - push bc - ld c, a - ld b, 0 - ld hl, .dmgfades - add hl, bc - add hl, bc - ld a, [hli] - ld h, [hl] - ld l, a - pop bc - -; get place in fade table - ld b, 0 - add hl, bc - ret - -.cgb ld hl, .cgbfade ld b, 0 add hl, bc ret -.dmgfades - dw .morn - dw .day - dw .nite - dw .darkness - -.morn - dc 3,3,3,3, 3,3,3,3, 3,3,3,3 - dc 3,3,3,2, 3,3,3,2, 3,3,3,2 - dc 3,3,2,1, 3,2,1,0, 3,2,1,0 - dc 3,2,1,0, 3,1,0,0, 3,1,0,0 - dc 2,1,0,0, 2,0,0,0, 2,0,0,0 - dc 1,0,0,0, 1,0,0,0, 1,0,0,0 - dc 0,0,0,0, 0,0,0,0, 0,0,0,0 - -.day - dc 3,3,3,3, 3,3,3,3, 3,3,3,3 - dc 3,3,3,2, 3,3,3,2, 3,3,3,2 - dc 3,3,2,1, 3,2,1,0, 3,2,1,0 - dc 3,2,1,0, 3,1,0,0, 3,1,0,0 - dc 2,1,0,0, 2,0,0,0, 2,0,0,0 - dc 1,0,0,0, 1,0,0,0, 1,0,0,0 - dc 0,0,0,0, 0,0,0,0, 0,0,0,0 - -.nite - dc 3,3,3,3, 3,3,3,3, 3,3,3,3 - dc 3,3,3,2, 3,3,3,2, 3,3,3,2 - dc 3,3,2,1, 3,2,1,0, 3,2,1,0 - dc 3,2,2,1, 3,1,0,0, 3,1,0,0 - dc 2,1,0,0, 2,0,0,0, 2,0,0,0 - dc 1,0,0,0, 1,0,0,0, 1,0,0,0 - dc 0,0,0,0, 0,0,0,0, 0,0,0,0 - -.darkness - dc 3,3,3,3, 3,3,3,3, 3,3,3,3 - dc 3,3,3,2, 3,3,3,2, 3,3,3,3 - dc 3,3,3,2, 3,2,1,0, 3,3,3,3 - dc 3,3,3,1, 3,1,0,0, 3,3,3,3 - dc 3,3,3,1, 2,0,0,0, 3,3,3,3 - dc 0,0,0,0, 1,0,0,0, 0,0,0,0 - dc 0,0,0,0, 0,0,0,0, 0,0,0,0 - .cgbfade dc 3,3,3,3, 3,3,3,3, 3,3,3,3 dc 3,3,3,2, 3,3,3,2, 3,3,3,2 diff --git a/gfx/battle/expbarend_sgb.png b/gfx/battle/expbarend_sgb.png deleted file mode 100644 index 25eed4a6229d97d8ff398eb55f1bc2f3fec05788..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 85 zcmeAS@N?(olHy`uVBq!ia0vp^93adDBp6m-`S}e<$#}XrhE&{2{_%hQ!+zVt&p-1# iw{I4h!1(0fe}0BVy}Z@W>~GkE)O))6xvXbP0l+XkKiiREM diff --git a/gfx/tilesets/flower/dmg_2.png b/gfx/tilesets/flower/dmg_2.png deleted file mode 100644 index 9a51250170c22dce82629fda4caedad24e5dab57..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 90 zcmeAS@N?(olHy`uVBq!ia0vp^93adDBp6m-`S}e