diff --git a/color/color.asm b/color/color.asm index 911da6e87..a7905b361 100644 --- a/color/color.asm +++ b/color/color.asm @@ -326,30 +326,30 @@ ENDC ld c, 11 call FillBox -IF GEN_2_GRAPHICS - ; Bottom half; player lifebar - ld hl, W2_TilesetPaletteMap + 7 * 20 + 9 - ld a, 2 - ld b, 4 - ld c, 11 - call FillBox - - ; Player exp bar - ld hl, W2_TilesetPaletteMap + 9 + 11 * 20 - ld a, 4 - ld b, 1 - ld c, 11 - call FillBox -ENDC - -IF !GEN_2_GRAPHICS +;IF GEN_2_GRAPHICS +; ; Bottom half; player lifebar +; ld hl, W2_TilesetPaletteMap + 7 * 20 + 9 +; ld a, 2 +; ld b, 4 +; ld c, 11 +; call FillBox + +; ; Player exp bar +; ld hl, W2_TilesetPaletteMap + 9 + 11 * 20 +; ld a, 4 +; ld b, 1 +; ld c, 11 +; call FillBox +;ENDC + +;IF !GEN_2_GRAPHICS ; Bottom half; player lifebar ld hl, W2_TilesetPaletteMap + 7 * 20 + 9 ld a, 2 ld b, 5 ld c, 11 call FillBox -ENDC +;ENDC ; Player pokemon ld hl, W2_TilesetPaletteMap + 4 * 20 @@ -383,7 +383,11 @@ ENDC ld a, SET_PAL_BATTLE ld [wDefaultPaletteCommand], a +IF GEN_2_GRAPHICS + jp SetPal_BattleExpBar +ELSE ret +ENDC ; hl: starting address ; a: pal number @@ -514,17 +518,73 @@ IF GEN_2_GRAPHICS ; Player exp bar ld hl, W2_TilesetPaletteMap + 11 + 5 * SCREEN_WIDTH ld b, 8 - ld a, 4 -.expLoop - ld [hli], a - dec b - jr nz, .expLoop + ld a, 4 | %00100000 ; load palette 4 and set bit 5 for H flip + call FillLine ENDC xor a ldh [rSVBK], a ret +IF GEN_2_GRAPHICS + ; SetPal functions related to the exp bar + +SetPal_StatusScreen2: + ld a, 2 + ldh [rSVBK], a + + ld hl, W2_TilesetPaletteMap + 11 + 5 * SCREEN_WIDTH + ld b, 8 + ld a, 1 + call FillLine + + jr SetPal_BattleExpBar.end + +SetPal_BattleAtkExpBar: + ld a, 2 + ldh [rSVBK], a + + ld hl, W2_TilesetPaletteMap + 10 + 11 * 20 + ld [hl], 2 + + jr SetPal_BattleExpBar.end + +SetPal_BattleBagExpBar: + ld c, 2 + jr SetPal_BattleExpBar.common + +SetPal_BattleExpBar: + ld c, 4 | %00100000 ; palette 4 and set bit 5 for H flip + +.common + ld a, 2 + ldh [rSVBK], a + + ld hl, W2_TilesetPaletteMap + 10 + 11 * 20 + ld b, 8 + ld a, c + call FillLine + +.end + ; Set palette map + ld a, 3 + ld [W2_StaticPaletteMapChanged], a + xor a + ld [W2_TileBasedPalettes], a ; Use a direct color map instead of assigning colors to tiles + ldh [rSVBK], a + ret +ENDC + +; hl: starting address +; a: pal number +; b: number of tiles +FillLine: +.loop + ld [hli], a + dec b + jr nz, .loop + ret + ; Show pokedex data SetPal_Pokedex: ld a, [wCurPartySpecies] diff --git a/color/exp_bar.asm b/color/exp_bar.asm index 0416d3e35..6c1ddd128 100644 --- a/color/exp_bar.asm +++ b/color/exp_bar.asm @@ -5,7 +5,7 @@ AnimateEXPBarAgain: xor a ld [wEXPBarPixelLength], a hlcoord 17, 11 - ld a, $c0 + ld a, $63 ld c, $08 .loop ld [hld], a @@ -33,7 +33,7 @@ AnimateEXPBar: hlcoord 17, 11 .loop1 ld a, [hl] - cp $c8 + cp $6B jr nz, .loop2 dec hl dec c diff --git a/color/load_hp_and_exp_bar.asm b/color/load_hp_and_exp_bar.asm index 4f4850759..b284b5297 100644 --- a/color/load_hp_and_exp_bar.asm +++ b/color/load_hp_and_exp_bar.asm @@ -4,10 +4,10 @@ LoadHPBarAndEXPBar:: ld de, HpBarAndStatusGraphics ld hl, vChars2 tile $62 lb bc, BANK(HpBarAndStatusGraphics), (HpBarAndStatusGraphicsEnd - HpBarAndStatusGraphics) / $10 - call GoodCopyVideoData - ld de, EXPBarGraphics - ld hl, vChars1 tile $40 - lb bc, BANK(EXPBarGraphics), (EXPBarGraphicsEnd - EXPBarGraphics) / $10 +; call GoodCopyVideoData +; ld de, EXPBarGraphics +; ld hl, vChars1 tile $40 +; lb bc, BANK(EXPBarGraphics), (EXPBarGraphicsEnd - EXPBarGraphics) / $10 jp GoodCopyVideoData ;GoodCopyVideoData: diff --git a/color/status_screen.asm b/color/status_screen.asm index dbc335f92..c0ea00a64 100644 --- a/color/status_screen.asm +++ b/color/status_screen.asm @@ -16,7 +16,11 @@ ENDC ret ; Only called when GEN_2_GRAPHICS is set +IF GEN_2_GRAPHICS StatusScreen2Hook: + ld b, SET_PAL_STATUS_SCREEN2 + call RunPaletteCommand hlcoord 19, 1 lb bc, 6, 10 jp DrawLineBox ; Draws the box around name, HP and status +ENDC diff --git a/color/update_hp_bar.asm b/color/update_hp_bar.asm index 0078637ac..197cd2d7a 100644 --- a/color/update_hp_bar.asm +++ b/color/update_hp_bar.asm @@ -5,6 +5,8 @@ ; e: # pixels to fill ; hl: where to draw DrawHPBarWithColor: + ld b, SET_PAL_BATTLE_EXPBAR + call RunPaletteCommand call DrawHPBar push bc push de diff --git a/constants/charmap.asm b/constants/charmap.asm index 2a6354ecf..e491a921b 100644 --- a/constants/charmap.asm +++ b/constants/charmap.asm @@ -155,21 +155,21 @@ charmap "è", $bb charmap "é", $bc charmap "ù", $bd - charmap "Ä", $be - charmap "Ö", $bf - - charmap "Ü", $c9 - charmap "ä", $ca - charmap "ö", $cb - charmap "ü", $cc - charmap "ë", $cd - charmap "ï", $ce - charmap "â", $cf - charmap "ô", $d0 - charmap "û", $d1 - charmap "ê", $d2 - charmap "î", $d3 - + charmap "ß", $be + charmap "ç", $bf + charmap "Ä", $c0 + charmap "Ö", $c1 + charmap "Ü", $c2 + charmap "ä", $c3 + charmap "ö", $c4 + charmap "ü", $c5 + charmap "ë", $c6 + charmap "ï", $c7 + charmap "â", $c8 + charmap "ô", $c9 + charmap "û", $ca + charmap "ê", $cb + charmap "î", $cc charmap "c'", $d4 charmap "d'", $d5 charmap "j'", $d6 @@ -194,8 +194,8 @@ charmap ".", $e8 charmap "ァ", $e9 ; katakana small a, unused - charmap "ß", $ea - charmap "ç", $eb + charmap "ゥ", $ea ; katakana small u, unused + charmap "ェ", $eb ; katakana small e, unused charmap "▷", $ec charmap "▶", $ed diff --git a/constants/palette_constants.asm b/constants/palette_constants.asm index 79a9b4864..72d25da1c 100644 --- a/constants/palette_constants.asm +++ b/constants/palette_constants.asm @@ -29,6 +29,12 @@ DEF PALETTE_SIZE EQU NUM_PAL_COLORS * PAL_COLOR_SIZE const SET_PAL_OAK_INTRO ; $0E const SET_PAL_NAMING_SCREEN ; $0F const SET_PAL_BATTLE_AFTER_BLACK ; $10 +IF GEN_2_GRAPHICS + const SET_PAL_STATUS_SCREEN2 ; $11 + const SET_PAL_BATTLE_EXPBAR ; $12 + const SET_PAL_BATTLE_BAGEXPBAR ; $13 + const SET_PAL_BATTLE_ATKEXPBAR ; $14 +ENDC DEF SET_PAL_PARTY_MENU_HP_BARS EQU $fc DEF SET_PAL_DEFAULT EQU $ff diff --git a/engine/battle/core.asm b/engine/battle/core.asm index 65c5074b3..31c7a63ea 100644 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -2018,7 +2018,12 @@ CenterMonName: ret DisplayBattleMenu:: +IF GEN_2_GRAPHICS + call LoadScreenTilesFromBuffer1_BattleExpBarPalHook +ELSE call LoadScreenTilesFromBuffer1 ; restore saved screen +ENDC + ld a, [wBattleType] and a jr nz, .nonstandardbattle @@ -2209,7 +2214,11 @@ DisplayBattleMenu:: jr UseBagItem BagWasSelected: +IF GEN_2_GRAPHICS + call LoadScreenTilesFromBuffer1_BattleBagExpBarPalHook +ELSE call LoadScreenTilesFromBuffer1 +ENDC ld a, [wBattleType] and a ; is it a normal battle? jr nz, .next @@ -2693,7 +2702,11 @@ SelectMenuItem: ld hl, MoveNoPPText .print call PrintText +IF GEN_2_GRAPHICS + call LoadScreenTilesFromBuffer1_BattleExpBarPalHook +ELSE call LoadScreenTilesFromBuffer1 +ENDC jp MoveSelectionMenu MoveNoPPText: @@ -2854,7 +2867,11 @@ SwapMovesInMenu: ld [wMenuItemToSwap], a ; select the current menu item for swapping jp MoveSelectionMenu +IF GEN_2_GRAPHICS +_PrintMenuItem: +ELSE PrintMenuItem: +ENDC xor a ldh [hAutoBGTransferEnabled], a hlcoord 0, 8 @@ -7134,7 +7151,7 @@ PrintEXPBar: jr .loop .skip ld b, a - ld a, $c0 + ld a, $63 add c .loop2 ld [hld], a @@ -7143,7 +7160,7 @@ PrintEXPBar: ld a, b and a jr nz, .loop - ld a, $c0 + ld a, $63 jr .loop2 CalcEXPBarPixelLength: @@ -7338,4 +7355,19 @@ PrintGenderCommon: ; used by both routines ld a, [wPokedexNum] ret +LoadScreenTilesFromBuffer1_BattleExpBarPalHook: + call LoadScreenTilesFromBuffer1 + ld b, SET_PAL_BATTLE_EXPBAR + jp RunPaletteCommand + +LoadScreenTilesFromBuffer1_BattleBagExpBarPalHook: + call LoadScreenTilesFromBuffer1 + ld b, SET_PAL_BATTLE_BAGEXPBAR + jp RunPaletteCommand + +PrintMenuItem: + ld b, SET_PAL_BATTLE_ATKEXPBAR + call RunPaletteCommand + jp _PrintMenuItem + ENDC diff --git a/engine/gfx/palettes.asm b/engine/gfx/palettes.asm index 62183fab5..b9edff234 100644 --- a/engine/gfx/palettes.asm +++ b/engine/gfx/palettes.asm @@ -58,6 +58,12 @@ SetPalFunctions: dw SetPal_OakIntro ; Set prof oak's color dw SetPal_NameEntry ; Name entry (partially replaces 08) dw SetPal_BattleAfterBlack ; Like SetPal_Battle but specifically for clearing the black palettes +IF GEN_2_GRAPHICS + dw SetPal_StatusScreen2 + dw SetPal_BattleExpBar + dw SetPal_BattleBagExpBar + dw SetPal_BattleAtkExpBar +ENDC ; HAXed to give trainers palettes independantly ; Also skips the "transform" check, caller does that instead diff --git a/gfx/font/font.png b/gfx/font/font.png index bdab45338..10f877cde 100644 Binary files a/gfx/font/font.png and b/gfx/font/font.png differ diff --git a/gfx/gs/font.png b/gfx/gs/font.png index db38a168d..eb123d87d 100644 Binary files a/gfx/gs/font.png and b/gfx/gs/font.png differ diff --git a/main.asm b/main.asm index 2aadcd08b..f2d2b37ce 100644 --- a/main.asm +++ b/main.asm @@ -108,10 +108,10 @@ INCLUDE "engine/math/random.asm" INCLUDE "color/status_screen.asm" -IF GEN_2_GRAPHICS -EXPBarGraphics: INCBIN "gfx/gs/exp_bar.2bpp" -EXPBarGraphicsEnd: -ENDC +;IF GEN_2_GRAPHICS +;EXPBarGraphics: INCBIN "gfx/gs/exp_bar.2bpp" +;EXPBarGraphicsEnd: +;ENDC SECTION "Battle Engine 2", ROMX