diff --git a/src/engine/bank02.asm b/src/engine/bank02.asm index 1b7d98b..2626ac5 100644 --- a/src/engine/bank02.asm +++ b/src/engine/bank02.asm @@ -543,7 +543,7 @@ _DrawYourOrOppPlayAreaScreen:: DrawYourOrOppPlayAreaScreen_EmptiedScreen: call LoadSymbolsFont - call Func_1dff + call LoadDuelPlayAreaScreenTiles bank1call SetDefaultPalettes lb de, 6, 0 call InitTextPrinting @@ -637,7 +637,7 @@ DrawInPlayAreaScreen:: push af ld a, CONSOLE_DMG ld [wConsole], a - call Func_1dff + call LoadDuelPlayAreaScreenTiles pop af ld [wConsole], a bank1call SetDefaultPalettes @@ -694,7 +694,7 @@ _DrawPlayersPrizeAndBenchCards:: call DoFrame call EmptyScreen call LoadSymbolsFont - call Func_1dff + call LoadDuelPlayAreaScreenTiles ; player cards ld a, PLAYER_TURN ld [wCheckMenuPlayAreaWhichDuelist], a diff --git a/src/engine/bills_pc.asm b/src/engine/bills_pc.asm index add1e01..6e38d54 100644 --- a/src/engine/bills_pc.asm +++ b/src/engine/bills_pc.asm @@ -76,7 +76,7 @@ _BillsPC: call SetupText call EmptyScreen - ld hl, $4930 ; DuelOtherGraphics + $30 tiles + ld hl, DuelMenuAndCardPicBorderTiles ld de, v0Tiles2 + $30 tiles ld b, 8 call CopyFontsOrDuelGraphicsTiles diff --git a/src/gfx/card_graphics.asm b/src/gfx/card_graphics.asm index d78780a..d16d29f 100644 --- a/src/gfx/card_graphics.asm +++ b/src/gfx/card_graphics.asm @@ -19,7 +19,20 @@ DuelOtherGraphics:: INCBIN "gfx/duel/duel_other_gfx.bin" SECTION "Gfx 1c", ROMX[$4000], BANK[$1c] - INCBIN "gfx/cards/misc/gfx_070000.bin" +DuelCheckPokemonScreenGfx:: + INCBIN "gfx/duel/check_pokemon_screen.bin" +DuelPlayAreaScreenGfx:: + INCBIN "gfx/duel/play_area_screen.bin" +DuelPlayAreaScreenGfxDMG:: + INCBIN "gfx/duel/play_area_screen_dmg.bin" +DuelDeckAndDiscardPileIcons:: + INCBIN "gfx/duel/deck_discard_icons.bin" +DuelCoinTossResultTiles:: + INCBIN "gfx/duel/coin_toss_result_symbols.bin" +DuelMenuAndCardPicBorderTiles:: + INCBIN "gfx/duel/menu_card_pic_border.bin" +DuelDrawCardsScreenIcons:: + INCBIN "gfx/duel/draw_cards_icons.bin" DuelBoxMessages:: INCBIN "gfx/duel/box_messages.2bpp" ds $2450, $ff diff --git a/src/gfx/cards/misc/gfx_070000.bin b/src/gfx/cards/misc/gfx_070000.bin deleted file mode 100644 index dab394c..0000000 Binary files a/src/gfx/cards/misc/gfx_070000.bin and /dev/null differ diff --git a/src/gfx/duel/check_pokemon_screen.bin b/src/gfx/duel/check_pokemon_screen.bin new file mode 100644 index 0000000..47696e2 Binary files /dev/null and b/src/gfx/duel/check_pokemon_screen.bin differ diff --git a/src/gfx/duel/coin_toss_result_symbols.bin b/src/gfx/duel/coin_toss_result_symbols.bin new file mode 100644 index 0000000..848cb21 Binary files /dev/null and b/src/gfx/duel/coin_toss_result_symbols.bin differ diff --git a/src/gfx/duel/deck_discard_icons.bin b/src/gfx/duel/deck_discard_icons.bin new file mode 100644 index 0000000..78736ac Binary files /dev/null and b/src/gfx/duel/deck_discard_icons.bin differ diff --git a/src/gfx/duel/draw_cards_icons.bin b/src/gfx/duel/draw_cards_icons.bin new file mode 100644 index 0000000..a092b44 Binary files /dev/null and b/src/gfx/duel/draw_cards_icons.bin differ diff --git a/src/gfx/duel/menu_card_pic_border.bin b/src/gfx/duel/menu_card_pic_border.bin new file mode 100644 index 0000000..d3eb353 Binary files /dev/null and b/src/gfx/duel/menu_card_pic_border.bin differ diff --git a/src/gfx/duel/play_area_screen.bin b/src/gfx/duel/play_area_screen.bin new file mode 100644 index 0000000..ffa43d5 Binary files /dev/null and b/src/gfx/duel/play_area_screen.bin differ diff --git a/src/gfx/duel/play_area_screen_dmg.bin b/src/gfx/duel/play_area_screen_dmg.bin new file mode 100644 index 0000000..537dc5b Binary files /dev/null and b/src/gfx/duel/play_area_screen_dmg.bin differ diff --git a/src/home/tiles.asm b/src/home/tiles.asm index 22c7161..0e51bff 100644 --- a/src/home/tiles.asm +++ b/src/home/tiles.asm @@ -64,7 +64,7 @@ LoadCardSet2Tiles:: add hl, hl add hl, hl add hl, hl - ld de, $3dd0 ; DuelOtherGraphics + $1d tiles + ld de, DuelOtherGraphics + $1d tiles - $4000 ; card set 2 icons add hl, de ld de, v0Tiles1 + $7c tiles ld b, $04 @@ -86,7 +86,7 @@ LoadCardSet2Tiles:: ; loads the Deck and Hand icons for the "Draw X card(s) from the deck." screen LoadDuelDrawCardsScreenTiles:: - ld hl, $49b0 ; DuelOtherGraphics + $29 tiles + ld hl, DuelDrawCardsScreenIcons ld de, v0Tiles1 + $74 tiles ld b, $08 jp CopyFontsOrDuelGraphicsTiles @@ -102,7 +102,7 @@ LoadDuelCheckPokemonScreenTiles:: ; fallthrough .got_num_tiles - ld hl, $4000 + ld hl, DuelCheckPokemonScreenGfx ld de, v0Tiles1 + $50 tiles call CopyFontsOrDuelGraphicsTiles bank1call Func_6c12 @@ -111,7 +111,7 @@ LoadDuelCheckPokemonScreenTiles:: ; loads the 8 tiles that make up the border of the main duel menu as well as the border ; of a large card picture (displayed after drawing the card or placing it in the arena). LoadCardOrDuelMenuBorderTiles:: - ld hl, $4930 ; DuelOtherGraphics + $15 tiles + ld hl, DuelMenuAndCardPicBorderTiles ld de, v0Tiles1 + $50 tiles ld b, $08 jr CopyFontsOrDuelGraphicsTiles @@ -150,16 +150,18 @@ LoadDeckAndDiscardPileIcons:: ld de, $cb16 ld c, $08 call CopyFontsOrDuelGraphicsBytes - ld hl, $47e0 + ld hl, DuelDeckAndDiscardPileIcons ld de, $8a00 ld b, $0d call CopyFontsOrDuelGraphicsTiles -Func_1dff:: - ld hl, $4240 +; load the tiles for the player's / opponent's Play Area screen +; (uses a separate set of tiles on CGB vs DMG/SGB) +LoadDuelPlayAreaScreenTiles:: + ld hl, DuelPlayAreaScreenGfx ld a, [wConsole] cp CONSOLE_CGB jr z, .copy - ld hl, $4510 + ld hl, DuelPlayAreaScreenGfxDMG .copy ld de, v0Tiles1 + $50 tiles ld b, $30 @@ -171,7 +173,7 @@ LoadDuelCoinTossResultTiles:: ld de, $cafe ld c, $08 call CopyFontsOrDuelGraphicsBytes - ld hl, $48b0 ; DuelOtherGraphics + $d tiles + ld hl, DuelCoinTossResultTiles ld de, v0Tiles2 + $30 tiles ld b, $08 jr CopyFontsOrDuelGraphicsTiles @@ -203,7 +205,7 @@ Func_212f:: ld b, $30 call CopyFontsOrDuelGraphicsTiles ; text box frame tiles - ld hl, $4930 ; DuelOtherGraphics + $15 tiles + ld hl, DuelMenuAndCardPicBorderTiles ld de, sGfxBuffer1 + $30 tiles ld b, $8 call CopyFontsOrDuelGraphicsTiles diff --git a/tools/extract_card_gfx.py b/tools/extract_card_gfx.py index 3d0252e..321bb09 100644 --- a/tools/extract_card_gfx.py +++ b/tools/extract_card_gfx.py @@ -37,12 +37,26 @@ REGION_END = 0xd9818 # end of last card; rest of region is 0xff pad # tiles = 48+48+19+64). The loaders keep their raw operands; these labels just # document and source the data. # (file offset, size, label, gfx path stem, png width in tiles | None for raw .bin) +# Bank-layout note: these duel graphics are reached through CopyFontsOrDuelGraphicsTiles, +# whose BankpushROM (src/home/switch_rom.asm) sets bank = BANK(Fonts) + hl's top 2 bits and +# masks the address into $4000-$7fff. So an operand hl<$4000 reads Gfx1 (bank $1b) at hl+$4000, +# while $4000<=hl<$8000 reads Gfx2 (bank $1c) at hl. That's why the $1b tail (file 0x6f4d0..0x70000) +# and the $1c block (file 0x70000..) are one logical duel-gfx region split across two banks. KNOWN_PRE = [ + # --- Gfx1 tail (bank $1b), referenced as `