From 274ab00a8bd371d7be2f9bcc70f5c5d732eac1af Mon Sep 17 00:00:00 2001 From: Retnuhytnuob <65794339+Retnuhytnuob@users.noreply.github.com> Date: Thu, 17 Sep 2026 00:21:56 -0500 Subject: [PATCH] Convert the 0x06... range to practical forms; mode lamp naming (#265) Adds some define macro for specifying an address in the Board/Object VRAM space, indexed by the Block, Row, Col Documents the usage of the block 2 + 6 lines of block 3, with a 'modulused crosssection of the board', and a tilemap that draws those in the correct color, for the section where the camera is. (this also explains the 'wrapping, with wrong colors' if viewing the BG layer 3.) Adds a define macro for addressing with the 'board wrapped' memory content, so that the tile reads as its board relative position, rather than its vram memory position. Applies macro in place of memory address, when working with the VRAM data. Resolves #224 --- AI_Usage_Disclaimer.txt | 2 + data/rom_2.s | 142 ++++++++------- expected_objs/sub_E464.o | Bin 3540 -> 0 bytes include/constants/board/main_board.h | 15 ++ include/gba/defines.h | 58 ++++--- include/gba/gba.h | 1 + include/gba/gba_c_defines.h | 15 ++ include/global.h | 10 +- src/all_board_banners.c | 4 +- src/all_board_mode_change_and_debug_menu.c | 31 ++-- src/all_board_pause_game.c | 9 +- src/all_board_pinball_game_main.c | 6 +- src/all_board_portrait_display.c | 33 ++-- src/all_board_process1.c | 2 +- src/all_board_process2.c | 4 +- src/all_board_process4.c | 4 +- src/all_board_process6_collision.c | 8 +- src/all_board_process7.c | 12 +- src/all_board_process8.c | 8 +- src/all_board_setup.c | 144 +++++++-------- src/bonus_complete_scoring_transition.c | 25 +-- src/bonus_field_select.c | 12 +- src/dusclops_process3.c | 10 +- src/ereader.c | 22 +-- src/field_select.c | 12 +- src/gbplayer.c | 6 +- src/groudon_process3.c | 8 +- src/high_scores.c | 38 ++-- src/intro.c | 122 ++++++------- src/kecleon_process3.c | 8 +- src/kyogre_process3.c | 16 +- src/main_board_bumpers.c | 14 +- src/main_board_catch_holes.c | 32 ++-- ...ain_board_catch_normal_and_jirachi_modes.c | 54 +++--- src/main_board_catch_tile_logic.c | 10 +- src/main_board_center_capture_hole.c | 44 ++--- src/main_board_charge_spinner.c | 2 +- src/main_board_evolution_mode.c | 40 ++--- src/main_board_intro_mode.c | 4 +- src/main_board_launcher_and_cutscenes.c | 28 +-- src/main_board_pichu_entity.c | 16 +- src/main_board_to_be_split.c | 79 ++++----- src/options.c | 12 +- src/pokedex.c | 56 +++--- src/rayquaza_process3.c | 16 +- src/ruby_board_indicators.c | 15 +- src/ruby_collision.c | 4 +- src/ruby_process3_entities_2.c | 16 +- src/ruby_ramp.c | 4 +- src/ruby_trigger_targets.c | 20 +-- src/sapphire_board_indicators.c | 14 +- src/sapphire_collision.c | 4 +- src/sapphire_pond_and_zigzagoon.c | 10 +- src/sapphire_seedot_egg_shop.c | 22 +-- src/save_and_restore_game.c | 164 +++++++++--------- src/spheal_process3.c | 24 +-- src/titlescreen.c | 24 +-- src/util.c | 2 +- 58 files changed, 788 insertions(+), 729 deletions(-) delete mode 100644 expected_objs/sub_E464.o create mode 100644 include/gba/gba_c_defines.h diff --git a/AI_Usage_Disclaimer.txt b/AI_Usage_Disclaimer.txt index a02bbfc0..5a295701 100644 --- a/AI_Usage_Disclaimer.txt +++ b/AI_Usage_Disclaimer.txt @@ -8,6 +8,8 @@ The tools listed above were built with the assistance of ChatGPT Claude is listed in the commit history, helping with the final data dump process, and orchestrating the tool usage for adding the palettes to many pre-existing graphics. - Claude's comments and naming have been replaced based on human understanding of the content. The only remains from that work are the raw graphics and json files we would have created anyway. +The latest piece before the first known use of commit with AI in this project is commit 018ce17fa, from Feb 8 2026, just before the piece that added the Oam slicer functionality, allowing for graphics to have a human readable form rather than being the raw tiles. + ------- If there is a desire to keep all the work done by a human, while expunging the remaining AI touched code, (Maybe from a 'code watermark' concern) that's reasonably possible. - Only one segment of that removal would impact the make process: the oam slicer tooling. diff --git a/data/rom_2.s b/data/rom_2.s index 4936d2c8..43c0ca18 100644 --- a/data/rom_2.s +++ b/data/rom_2.s @@ -3,6 +3,7 @@ #include "constants/fields.h" #include "constants/species.h" #include "constants/bg_music.h" +#include "gba/defines.h" #include "gba/io_reg.h" #include "gba/oam_types.h" #include "constants/global.h" @@ -6787,9 +6788,6 @@ gChikoritaFlashFrameIndices:: @ 0x086ADA58 .2byte 1, 1, 1, 1, 2, 3, 4, 5, 6, 7, 0 gGulpinAnimData:: @ 0x086ADA6E -@ 109 frames of 5 s16: index into gGulpinOamData, how many game frames to hold -@ it, then three gRubyStageGulpin_Gfx indices -- one per segment of the Gulpin -@ stack, DMA'd to 0x06013B80, 0x06013A00 and 0x06013880. .2byte 0, 4, 0, 1, 0 .2byte 1, 4, 0, 1, 0 .2byte 2, 4, 0, 1, 0 @@ -8644,18 +8642,18 @@ gRubySlingshotTilePointers:: @ 0x086B08D4 @ Third set of 5 is the destination address. .4byte gRuby_LSlingshot_Off_R0, gRuby_LSlingshot_Off_R1, gRuby_LSlingshot_Off_R2, gRuby_LSlingshot_Off_R3, gRuby_LSlingshot_Off_R4 .4byte gRuby_LSlingshot_On_R0, gRuby_LSlingshot_On_R1, gRuby_LSlingshot_On_R2, gRuby_LSlingshot_On_R3, gRuby_LSlingshot_On_R4 - .4byte 0x0600DA00, 0x0600DA20, 0x0600DA60, 0x0600DAC0, 0x0600DB20 + .4byte BG_TILE_ADDR(TILE_INDEX(3, 6, 16)), BG_TILE_ADDR(TILE_INDEX(3, 6, 17)), BG_TILE_ADDR(TILE_INDEX(3, 6, 19)), BG_TILE_ADDR(TILE_INDEX(3, 6, 22)), BG_TILE_ADDR(TILE_INDEX(3, 6, 25)) .4byte gRuby_RSlingshot_Off_R0, gRuby_RSlingshot_Off_R1, gRuby_RSlingshot_Off_R2, gRuby_RSlingshot_Off_R3, gRuby_RSlingshot_Off_R4 .4byte gRuby_RSlingshot_On_R0, gRuby_RSlingshot_On_R1, gRuby_RSlingshot_On_R2, gRuby_RSlingshot_On_R3, gRuby_RSlingshot_On_R4 - .4byte 0x0600DB60, 0x0600DB80, 0x0600DBC0, 0x0600DC20, 0x0600DC80 + .4byte BG_TILE_ADDR(TILE_INDEX(3, 6, 27)), BG_TILE_ADDR(TILE_INDEX(3, 6, 28)), BG_TILE_ADDR(TILE_INDEX(3, 6, 30)), BG_TILE_ADDR(TILE_INDEX(3, 7, 1)), BG_TILE_ADDR(TILE_INDEX(3, 7, 4)) gShopItemTilePointers:: @ 0x086B094C @ Arranged into 3 sets of 3. @ Third set is the destination address. .4byte gRubyShopSignMartPiece0, gRubyShopSignMartPiece1, gRubyShopSignMartPiece2 .4byte gRubyShopSignCenterPiece0, gRubyShopSignCenterPiece1, gRubyShopSignCenterPiece2 - .4byte 0x0600D860, 0x0600D920, 0x0600D9E0 + .4byte BG_TILE_ADDR(TILE_INDEX(3, 6, 3)), BG_TILE_ADDR(TILE_INDEX(3, 6, 9)), BG_TILE_ADDR(TILE_INDEX(3, 6, 15)) gRubyProgressDigitTilePointers:: @ 0x086B0970 @ 11 sets of 2. @@ -8670,7 +8668,7 @@ gRubyProgressDigitTilePointers:: @ 0x086B0970 .4byte gRubyProgressDigit7_Tens, gRubyProgressDigit7_Ones .4byte gRubyProgressDigit8_Tens, gRubyProgressDigit8_Ones .4byte gRubyProgressDigit9_Tens, gRubyProgressDigit9_Ones - .4byte 0x0600D820, 0x0600D840 + .4byte BG_TILE_ADDR(TILE_INDEX(3, 6, 1)), BG_TILE_ADDR(TILE_INDEX(3, 6, 2)) gRubyTrapIndicatorTilePointers:: @ 0x086B09C8 @ 4 sets of 2 @@ -8678,7 +8676,7 @@ gRubyTrapIndicatorTilePointers:: @ 0x086B09C8 .4byte gRubyTrapIndicatorState0Top, gRubyTrapIndicatorState0Bot .4byte gRubyTrapIndicatorState1Top, gRubyTrapIndicatorState1Bot .4byte gRubyTrapIndicatorState2Top, gRubyTrapIndicatorState2Bot - .4byte 0x060081C0, 0x060085C0 + .4byte BG_ADDR_FOR_BOARD_WRAP(33, 14), BG_ADDR_FOR_BOARD_WRAP(34, 14) gRubyCatchLightTilePointers:: @ 0x086B09E8 @ 3 sets of 7 sets of 2 @@ -8689,7 +8687,7 @@ gRubyCatchLightTilePointers:: @ 0x086B09E8 .4byte gRubyCatchLightSlot0State3Top, gRubyCatchLightSlot0State3Bot .4byte gRubyCatchLightSlot0State4Top, gRubyCatchLightSlot0State4Bot .4byte gRubyCatchLightSlot0State5Top, gRubyCatchLightSlot0State5Bot - .4byte 0x0600A180, 0x0600A580 + .4byte BG_ADDR_FOR_BOARD_WRAP(41, 12), BG_ADDR_FOR_BOARD_WRAP(42, 12) .4byte gRubyCatchLightState0Top, gRubyCatchLightState0Bot .4byte gRubyCatchLightState1Top, gRubyCatchLightState1Bot @@ -8697,7 +8695,7 @@ gRubyCatchLightTilePointers:: @ 0x086B09E8 .4byte gRubyCatchLightSlot1State3Top, gRubyCatchLightSlot1State3Bot .4byte gRubyCatchLightSlot1State4Top, gRubyCatchLightSlot1State4Bot .4byte gRubyCatchLightSlot1State5Top, gRubyCatchLightSlot1State5Bot - .4byte 0x0600A1C0, 0x0600A5C0 + .4byte BG_ADDR_FOR_BOARD_WRAP(41, 14), BG_ADDR_FOR_BOARD_WRAP(42, 14) .4byte gRubyCatchLightState0Top, gRubyCatchLightState0Bot .4byte gRubyCatchLightState1Top, gRubyCatchLightState1Bot @@ -8705,28 +8703,28 @@ gRubyCatchLightTilePointers:: @ 0x086B09E8 .4byte gRubyCatchLightSlot2State3Top, gRubyCatchLightSlot2State3Bot .4byte gRubyCatchLightSlot2State4Top, gRubyCatchLightSlot2State4Bot .4byte gRubyCatchLightSlot2State5Top, gRubyCatchLightSlot2State5Bot - .4byte 0x0600A200, 0x0600A600 + .4byte BG_ADDR_FOR_BOARD_WRAP(41, 16), BG_ADDR_FOR_BOARD_WRAP(42, 16) gRubySaverTilePointers:: @ 0x086B0A90 @ 3 sets of 4 @ third set has destination address .4byte gRubySaverRow0Tile_Off, gRubySaverRow1Tile_Off, gRubySaverRow2Tile_Off, gRubySaverRow3Tile_Off .4byte gRubySaverRow0Tile_On, gRubySaverRow1Tile_On, gRubySaverRow2Tile_On, gRubySaverRow3Tile_On - .4byte 0x0600AD80, 0x0600B180, 0x0600B5A0, 0x0600BA00 + .4byte BG_ADDR_FOR_BOARD_WRAP(44, 12), BG_ADDR_FOR_BOARD_WRAP(45, 12), BG_ADDR_FOR_BOARD_WRAP(46, 13), BG_ADDR_FOR_BOARD_WRAP(47, 16) gRubyHatchArrowTilePointer:: @ 0x086B0AC0 @ 3 sets of 4 @ third set has destination address .4byte gRubyHatchArrowRow0Tile_Off, gRubyHatchArrowRow1Tile_Off, gRubyHatchArrowRow2Tile_Off, gRubyHatchArrowRow3Tile_Off .4byte gRubyHatchArrowRow0Tile_On, gRubyHatchArrowRow1Tile_On, gRubyHatchArrowRow2Tile_On, gRubyHatchArrowRow3Tile_On - .4byte 0x0600B960, 0x0600BD60, 0x0600C160, 0x0600C560 + .4byte BG_ADDR_FOR_BOARD_WRAP(25, 11), BG_ADDR_FOR_BOARD_WRAP(26, 11), BG_ADDR_FOR_BOARD_WRAP(27, 11), BG_ADDR_FOR_BOARD_WRAP(28, 11) gRubyBumperArrowTilePointer:: @ 0x086B0AF0 @ 3 sets of 4 @ third set has destination address .4byte gRubyBumperArrowRow0Tile_Off, gRubyBumperArrowRow1Tile_Off, gRubyBumperArrowRow2Tile_Off, gRubyBumperArrowRow3Tile_Off .4byte gRubyBumperArrowRow0Tile_On, gRubyBumperArrowRow1Tile_On, gRubyBumperArrowRow2Tile_On, gRubyBumperArrowRow3Tile_On - .4byte 0x0600B620, 0x0600B9E0, 0x0600BDE0, 0x0600C1E0 + .4byte BG_ADDR_FOR_BOARD_WRAP(24, 17), BG_ADDR_FOR_BOARD_WRAP(25, 15), BG_ADDR_FOR_BOARD_WRAP(26, 15), BG_ADDR_FOR_BOARD_WRAP(27, 15) gRubyShopRampArrowTilePointsers:: @ 0x086B0B20 @ 5 sets of 4 @@ -8737,29 +8735,29 @@ gRubyShopRampArrowTilePointsers:: @ 0x086B0B20 .4byte gRubyMartArrow_R0_On, gRubyMartArrow_R1_On, gRubyMartArrow_R2_On, gRubyMartArrow_R3_On .4byte gRubyEvoArrow_R0_Off, gRubyEvoArrow_R1_Off, gRubyEvoArrow_R2_Off, gRubyEvoArrow_R3_Off .4byte gRubyEvoArrow_R0_On, gRubyEvoArrow_R1_On, gRubyEvoArrow_R2_On, gRubyEvoArrow_R3_On - .4byte 0x0600C620, 0x0600CA20, 0x0600CE20, 0x0600D220 + .4byte BG_ADDR_FOR_BOARD_WRAP(28, 17), BG_ADDR_FOR_BOARD_WRAP(29, 17), BG_ADDR_FOR_BOARD_WRAP(30, 17), BG_ADDR_FOR_BOARD_WRAP(31, 17) gRubyBallPowerUpLightTilePointers:: @ 0x086B0B70 @ 3 sets of 3 @ third value has the destination address - .4byte gRubyBallPowerUpLight0off, gRubyBallPowerUpLight0on, 0x060085C0 - .4byte gRubyBallPowerUpLight1off, gRubyBallPowerUpLight1on, 0x06008600 - .4byte gRubyBallPowerUpLight2off, gRubyBallPowerUpLight2on, 0x06008660 + .4byte gRubyBallPowerUpLight0off, gRubyBallPowerUpLight0on, BG_ADDR_FOR_BOARD_WRAP(12, 14) + .4byte gRubyBallPowerUpLight1off, gRubyBallPowerUpLight1on, BG_ADDR_FOR_BOARD_WRAP(12, 16) + .4byte gRubyBallPowerUpLight2off, gRubyBallPowerUpLight2on, BG_ADDR_FOR_BOARD_WRAP(12, 19) gRubyCatchArrowTilePointer:: @ 0x086B0B94 @ 3 sets of 4 @ third set has the destination address .4byte gRubyCatchArrowRow0Tile_Off, gRubyCatchArrowRow1Tile_Off, gRubyCatchArrowRow2Tile_Off, gRubyCatchArrowRow3Tile_Off .4byte gRubyCatchArrowRow0Tile_On, gRubyCatchArrowRow1Tile_On, gRubyCatchArrowRow2Tile_On, gRubyCatchArrowRow3Tile_On - .4byte 0x0600D2A0, 0x0600D660, 0x06008260, 0x06008660 + .4byte BG_ADDR_FOR_BOARD_WRAP(31, 21), BG_ADDR_FOR_BOARD_WRAP(32, 19), BG_ADDR_FOR_BOARD_WRAP(33, 19), BG_ADDR_FOR_BOARD_WRAP(34, 19) gRubyHoleIndicatorTilePointers:: @ 0x086B0BC4 @ 4 sets of 4 @ third value has the destination; fouth value blank. - .4byte gRubyHoleLightH_Off, gRubyHoleLightH_On, 0x0600A460, 0 - .4byte gRubyHoleLightO_Off, gRubyHoleLightO_On, 0x0600A4C0, 0 - .4byte gRubyHoleLightL_Off, gRubyHoleLightL_On, 0x0600A6C0, 0 - .4byte gRubyHoleLightE_Off, gRubyHoleLightE_On, 0x0600A720, 0 + .4byte gRubyHoleLightH_Off, gRubyHoleLightH_On, BG_ADDR_FOR_BOARD_WRAP(42, 3), 0 + .4byte gRubyHoleLightO_Off, gRubyHoleLightO_On, BG_ADDR_FOR_BOARD_WRAP(42, 6), 0 + .4byte gRubyHoleLightL_Off, gRubyHoleLightL_On, BG_ADDR_FOR_BOARD_WRAP(42, 22), 0 + .4byte gRubyHoleLightE_Off, gRubyHoleLightE_On, BG_ADDR_FOR_BOARD_WRAP(42, 25), 0 gRubyEvoArrowTilePtrs:: @ 0x086B0C04 @ 3 sets of 5 sets of 3 @@ -8768,19 +8766,19 @@ gRubyEvoArrowTilePtrs:: @ 0x086B0C04 .4byte gRubyEvo_EArrow_Top0, gRubyEvo_EArrow_Mid0, gRubyEvo_EArrow_Bot0 .4byte gRubyEvo_EArrow_Top1, gRubyEvo_EArrow_Mid1, gRubyEvo_EArrow_Bot1 .4byte gRubyEvo_EArrow_Top2, gRubyEvo_EArrow_Mid2, gRubyEvo_EArrow_Bot2 - .4byte 0x0600D080, 0x0600D480, 0x06008080 + .4byte BG_ADDR_FOR_BOARD_WRAP(31, 4), BG_ADDR_FOR_BOARD_WRAP(32, 4), BG_ADDR_FOR_BOARD_WRAP(33, 4) .4byte gRubyEvo_VArrow_Top0, gRubyEvo_VArrow_Mid0, gRubyEvo_VArrow_Bot0 .4byte gRubyEvo_VArrow_Top1, gRubyEvo_VArrow_Mid1, gRubyEvo_VArrow_Bot1 .4byte gRubyEvo_VArrow_Top2, gRubyEvo_VArrow_Mid2, gRubyEvo_VArrow_Bot2 .4byte gRubyEvo_VArrow_Top3, gRubyEvo_VArrow_Mid3, gRubyEvo_VArrow_Bot3 - .4byte 0x060080A0, 0x060084A0, 0x060088A0 + .4byte BG_ADDR_FOR_BOARD_WRAP(33, 5), BG_ADDR_FOR_BOARD_WRAP(34, 5), BG_ADDR_FOR_BOARD_WRAP(35, 5) .4byte gRubyEvo_OArrow_Top0, gRubyEvo_OArrow_Mid0, gRubyEvo_OArrow_Bot0 .4byte gRubyEvo_OArrow_Top0, gRubyEvo_OArrow_Mid0, gRubyEvo_OArrow_Bot0 .4byte gRubyEvo_OArrow_Top1, gRubyEvo_OArrow_Mid1, gRubyEvo_OArrow_Bot1 .4byte gRubyEvo_OArrow_Top2, gRubyEvo_OArrow_Mid2, gRubyEvo_OArrow_Bot2 - .4byte 0x060088C0, 0x06008CC0, 0x060090C0 + .4byte BG_ADDR_FOR_BOARD_WRAP(35, 6), BG_ADDR_FOR_BOARD_WRAP(36, 6), BG_ADDR_FOR_BOARD_WRAP(37, 6) gRubyCoinRewardTilePtrs:: @ 0x086B0CB8 @ 3 sets of 5 sets of 3 @@ -8789,19 +8787,19 @@ gRubyCoinRewardTilePtrs:: @ 0x086B0CB8 .4byte gRubyCoinArrow_0825DF10, gRubyCoinArrow_0825E310, gRubyCoinArrow_0825E710 .4byte gRubyCoinArrow_0825DF70, gRubyCoinArrow_0825E370, gRubyCoinArrow_0825E770 .4byte gRubyCoinArrow_0825DFD0, gRubyCoinArrow_0825E3D0, gRubyCoinArrow_0825E7D0 - .4byte 0x0600B4E0, 0x0600B8E0, 0x0600BCE0 + .4byte BG_ADDR_FOR_BOARD_WRAP(24, 7), BG_ADDR_FOR_BOARD_WRAP(25, 7), BG_ADDR_FOR_BOARD_WRAP(26, 7) .4byte gRubyCoinArrow_0825E030, gRubyCoinArrow_0825E430, gRubyCoinArrow_0825E830 .4byte gRubyCoinArrow_0825E090, gRubyCoinArrow_0825E490, gRubyCoinArrow_0825E890 .4byte gRubyCoinArrow_0825E0F0, gRubyCoinArrow_0825E4F0, gRubyCoinArrow_0825E8F0 .4byte gRubyCoinArrow_0825E150, gRubyCoinArrow_0825E550, gRubyCoinArrow_0825E950 - .4byte 0x0600BCE0, 0x0600C0E0, 0x0600C4E0 + .4byte BG_ADDR_FOR_BOARD_WRAP(26, 7), BG_ADDR_FOR_BOARD_WRAP(27, 7), BG_ADDR_FOR_BOARD_WRAP(28, 7) .4byte gRubyCoinArrow_0825E1B0, gRubyCoinArrow_0825E5B0, gRubyCoinArrow_0825E9B0 .4byte gRubyCoinArrow_0825E1B0, gRubyCoinArrow_0825E5B0, gRubyCoinArrow_0825E9B0 .4byte gRubyCoinArrow_0825E210, gRubyCoinArrow_0825E610, gRubyCoinArrow_0825EA10 .4byte gRubyCoinArrow_0825E270, gRubyCoinArrow_0825E670, gRubyCoinArrow_0825EA70 - .4byte 0x0600C500, 0x0600C900, 0x0600CD00 + .4byte BG_ADDR_FOR_BOARD_WRAP(28, 8), BG_ADDR_FOR_BOARD_WRAP(29, 8), BG_ADDR_FOR_BOARD_WRAP(30, 8) gRubyGetArrowTilePtrs:: @ 0x086B0D6C @ 3 sets of 5 sets of 3 @@ -8810,19 +8808,19 @@ gRubyGetArrowTilePtrs:: @ 0x086B0D6C .4byte gRubyGetArrow_0825EB10, gRubyGetArrow_0825EF10, gRubyGetArrow_0825F310 .4byte gRubyGetArrow_0825EB70, gRubyGetArrow_0825EF70, gRubyGetArrow_0825F370 .4byte gRubyGetArrow_0825EBD0, gRubyGetArrow_0825EFD0, gRubyGetArrow_0825F3D0 - .4byte 0x0600D2E0, 0x0600D6E0, 0x060082E0 + .4byte BG_ADDR_FOR_BOARD_WRAP(31, 23), BG_ADDR_FOR_BOARD_WRAP(32, 23), BG_ADDR_FOR_BOARD_WRAP(33, 23) .4byte gRubyGetArrow_0825EC50, gRubyGetArrow_0825F050, gRubyGetArrow_0825F430 .4byte gRubyGetArrow_0825ECB0, gRubyGetArrow_0825F0B0, gRubyGetArrow_0825F490 .4byte gRubyGetArrow_0825ED10, gRubyGetArrow_0825F110, gRubyGetArrow_0825F4F0 .4byte gRubyGetArrow_0825ED70, gRubyGetArrow_0825F170, gRubyGetArrow_0825F550 - .4byte 0x060082E0, 0x060086E0, 0x06008AC0 + .4byte BG_ADDR_FOR_BOARD_WRAP(33, 23), BG_ADDR_FOR_BOARD_WRAP(34, 23), BG_ADDR_FOR_BOARD_WRAP(35, 22) .4byte gRubyGetArrow_0825EDD0, gRubyGetArrow_0825F1B0, gRubyGetArrow_0825F5B0 .4byte gRubyGetArrow_0825EDD0, gRubyGetArrow_0825F1B0, gRubyGetArrow_0825F5B0 .4byte gRubyGetArrow_0825EE30, gRubyGetArrow_0825F210, gRubyGetArrow_0825F610 .4byte gRubyGetArrow_0825EE90, gRubyGetArrow_0825F270, gRubyGetArrow_0825F670 - .4byte 0x06008AC0, 0x06008EA0, 0x060092A0 + .4byte BG_ADDR_FOR_BOARD_WRAP(35, 22), BG_ADDR_FOR_BOARD_WRAP(36, 21), BG_ADDR_FOR_BOARD_WRAP(37, 21) gBallUpgradeFx_TileIndicies:: @ 0x086B0E20 @ 31 values (ix 0 - 30) used, then padding @@ -8843,7 +8841,7 @@ gSapphirePSquareIndicator:: @ 0x086B0E6C .4byte gSapphirePSquareFrame2Top, gSapphirePSquareFrame2Bot .4byte gSapphirePSquareFrame3Top, gSapphirePSquareFrame3Bot .4byte gSapphirePSquareFrame4Top, gSapphirePSquareFrame4Bot - .4byte 0x0600A640, 0x0600AA40 + .4byte BG_ADDR_FOR_BOARD_WRAP(20, 18), BG_ADDR_FOR_BOARD_WRAP(21, 18) gSapphireProgressDigitTilePtrs:: @ 0x086B0E9C @ 11 sets of 4 @@ -8858,7 +8856,7 @@ gSapphireProgressDigitTilePtrs:: @ 0x086B0E9C .4byte gSapphireProgressDigit7_TensTop, gSapphireProgressDigit7_TensBot, gSapphireProgressDigit7_OnesTop, gSapphireProgressDigit7_OnesBot .4byte gSapphireProgressDigit8_TensTop, gSapphireProgressDigit8_TensBot, gSapphireProgressDigit8_OnesTop, gSapphireProgressDigit8_OnesBot .4byte gSapphireProgressDigit9_TensTop, gSapphireProgressDigit9_TensBot, gSapphireProgressDigit9_OnesTop, gSapphireProgressDigit9_OnesBot - .4byte 0x0600B220, 0x0600B620, 0x0600B240, 0x0600B640 + .4byte BG_ADDR_FOR_BOARD_WRAP(23, 17), BG_ADDR_FOR_BOARD_WRAP(24, 17), BG_ADDR_FOR_BOARD_WRAP(23, 18), BG_ADDR_FOR_BOARD_WRAP(24, 18) gRotatingBackgroundTilePtrs:: @ 0x086B0F4C @ 5 sets of 4 @@ -8867,61 +8865,61 @@ gRotatingBackgroundTilePtrs:: @ 0x086B0F4C .4byte gWailmerWaterFrame1Row0, gWailmerWaterFrame1Row1, gWailmerWaterFrame1Row2, gWailmerWaterFrame1Row3 .4byte gWailmerWaterFrame2Row0, gWailmerWaterFrame2Row1, gWailmerWaterFrame2Row2, gWailmerWaterFrame2Row3 .4byte gWailmerWaterFrame1Row0, gWailmerWaterFrame1Row1, gWailmerWaterFrame1Row2, gWailmerWaterFrame1Row3 - .4byte 0x0600AEA0, 0x0600B2A0, 0x0600B6A0, 0x0600BAA0 + .4byte BG_ADDR_FOR_BOARD_WRAP(22, 21), BG_ADDR_FOR_BOARD_WRAP(23, 21), BG_ADDR_FOR_BOARD_WRAP(24, 21), BG_ADDR_FOR_BOARD_WRAP(25, 21) gHatchMachineDrawSegment:: @ 0x086B0F9C @ 10 sets of 3 sets of 2 @ third set has destination address .4byte gHatchMachineSeg0IdleA, gHatchMachineSeg0IdleB .4byte gHatchMachineSeg0HitA, gHatchMachineSeg0HitB - .4byte 0x0600DD40, 0x0600DD80 + .4byte BG_TILE_ADDR(TILE_INDEX(3, 7, 10)), BG_TILE_ADDR(TILE_INDEX(3, 7, 12)) .4byte gHatchMachineSeg1IdleA, gHatchMachineSeg1IdleB .4byte gHatchMachineSeg1HitA, gHatchMachineSeg1HitB - .4byte 0x0600DDC0, 0x0600DE00 + .4byte BG_TILE_ADDR(TILE_INDEX(3, 7, 14)), BG_TILE_ADDR(TILE_INDEX(3, 7, 16)) .4byte gHatchMachineSeg2IdleA, gHatchMachineSeg2IdleB .4byte gHatchMachineSeg2HitA, gHatchMachineSeg2HitB - .4byte 0x0600D9C0, 0x0600DAC0 + .4byte BG_TILE_ADDR(TILE_INDEX(3, 6, 14)), BG_TILE_ADDR(TILE_INDEX(3, 6, 22)) .4byte gHatchMachineSeg3Idle, gHatchMachineSeg3Idle .4byte gHatchMachineSeg3Hit, gHatchMachineSeg3Hit - .4byte 0x0600DE40, 0x0600DE40 + .4byte BG_TILE_ADDR(TILE_INDEX(3, 7, 18)), BG_TILE_ADDR(TILE_INDEX(3, 7, 18)) .4byte gHatchMachineSeg4IdleA, gHatchMachineSeg4IdleB .4byte gHatchMachineSeg4HitA, gHatchMachineSeg4HitB - .4byte 0x0600D900, 0x0600DA00 + .4byte BG_TILE_ADDR(TILE_INDEX(3, 6, 8)), BG_TILE_ADDR(TILE_INDEX(3, 6, 16)) .4byte gHatchMachineSeg5IdleA, gHatchMachineSeg5IdleB .4byte gHatchMachineSeg5HitA, gHatchMachineSeg5HitB - .4byte 0x0600DE80, 0x0600DEC0 + .4byte BG_TILE_ADDR(TILE_INDEX(3, 7, 20)), BG_TILE_ADDR(TILE_INDEX(3, 7, 22)) .4byte gHatchMachineSeg6IdleA, gHatchMachineSeg6IdleB .4byte gHatchMachineSeg6HitA, gHatchMachineSeg6HitB - .4byte 0x0600DF00, 0x0600DF40 + .4byte BG_TILE_ADDR(TILE_INDEX(3, 7, 24)), BG_TILE_ADDR(TILE_INDEX(3, 7, 26)) .4byte gHatchMachineSeg7IdleA, gHatchMachineSeg7IdleB .4byte gHatchMachineSeg7HitA, gHatchMachineSeg7HitB - .4byte 0x0600DF80, 0x0600DFC0 + .4byte BG_TILE_ADDR(TILE_INDEX(3, 7, 28)), BG_TILE_ADDR(TILE_INDEX(3, 7, 30)) .4byte gHatchMachineSeg8IdleA, gHatchMachineSeg8IdleB .4byte gHatchMachineSeg8HitA, gHatchMachineSeg8HitB - .4byte 0x0600E000, 0x0600E040 + .4byte BG_TILE_ADDR(TILE_INDEX(3, 8, 0)), BG_TILE_ADDR(TILE_INDEX(3, 8, 2)) .4byte gHatchMachineSeg9IdleA, gHatchMachineSeg9IdleB .4byte gHatchMachineSeg9HitA, gHatchMachineSeg9HitB - .4byte 0x0600E080, 0x0600E0C0 + .4byte BG_TILE_ADDR(TILE_INDEX(3, 8, 4)), BG_TILE_ADDR(TILE_INDEX(3, 8, 6)) gSapphireSlingshotTilePtrs:: @ 0x086B108C @ 2 sets (sides) of 3 sets of 5 @ third set has destination address .4byte gSapphire_LSlingshot_Off_R0, gSapphire_LSlingshot_Off_R1, gSapphire_LSlingshot_Off_R2, gSapphire_LSlingshot_Off_R3, gSapphire_LSlingshot_Off_R4 .4byte gSapphire_LSlingshot_On_R0, gSapphire_LSlingshot_On_R1, gSapphire_LSlingshot_On_R2, gSapphire_LSlingshot_On_R3, gSapphire_LSlingshot_On_R4 - .4byte 0x0600E100, 0x0600E120, 0x0600E160, 0x0600E1C0, 0x0600E220 + .4byte BG_TILE_ADDR(TILE_INDEX(3, 8, 8)), BG_TILE_ADDR(TILE_INDEX(3, 8, 9)), BG_TILE_ADDR(TILE_INDEX(3, 8, 11)), BG_TILE_ADDR(TILE_INDEX(3, 8, 14)), BG_TILE_ADDR(TILE_INDEX(3, 8, 17)) .4byte gSapphire_RSlingshot_Off_R0, gSapphire_RSlingshot_Off_R1, gSapphire_RSlingshot_Off_R2, gSapphire_RSlingshot_Off_R3, gSapphire_RSlingshot_Off_R4 .4byte gSapphire_RSlingshot_On_R0, gSapphire_RSlingshot_On_R1, gSapphire_RSlingshot_On_R2, gSapphire_RSlingshot_On_R3, gSapphire_RSlingshot_On_R4 - .4byte 0x0600E260, 0x0600E280, 0x0600E2C0, 0x0600E320, 0x0600E380 + .4byte BG_TILE_ADDR(TILE_INDEX(3, 8, 19)), BG_TILE_ADDR(TILE_INDEX(3, 8, 20)), BG_TILE_ADDR(TILE_INDEX(3, 8, 22)), BG_TILE_ADDR(TILE_INDEX(3, 8, 25)), BG_TILE_ADDR(TILE_INDEX(3, 8, 28)) gSapphireTrapIndicatorTilePtrs:: @ 0x086B1104 @ 4 sets of 2 @@ -8929,7 +8927,7 @@ gSapphireTrapIndicatorTilePtrs:: @ 0x086B1104 .4byte gSapphireTrapIndicatorState0Top, gSapphireTrapIndicatorState0Bot .4byte gSapphireTrapIndicatorState1Top, gSapphireTrapIndicatorState1Bot .4byte gSapphireTrapIndicatorState2Top, gSapphireTrapIndicatorState2Bot - .4byte 0x060081C0, 0x060085C0 + .4byte BG_ADDR_FOR_BOARD_WRAP(33, 14), BG_ADDR_FOR_BOARD_WRAP(34, 14) gSapphireCatchLightTilePtrs:: @ 0x086B1124 @ 3 sets of 7 sets of 2 @@ -8940,7 +8938,7 @@ gSapphireCatchLightTilePtrs:: @ 0x086B1124 .4byte gSapphireCatchLightSlot0State3Top, gSapphireCatchLightSlot0State3Bot .4byte gSapphireCatchLightSlot0State4Top, gSapphireCatchLightSlot0State4Bot .4byte gSapphireCatchLightSlot0State5Top, gSapphireCatchLightSlot0State5Bot - .4byte 0x0600A180, 0x0600A580 + .4byte BG_ADDR_FOR_BOARD_WRAP(41, 12), BG_ADDR_FOR_BOARD_WRAP(42, 12) .4byte gSapphireCatchLightState0Top, gSapphireCatchLightState0Bot .4byte gSapphireCatchLightState1Top, gSapphireCatchLightState1Bot @@ -8948,7 +8946,7 @@ gSapphireCatchLightTilePtrs:: @ 0x086B1124 .4byte gSapphireCatchLightSlot1State3Top, gSapphireCatchLightSlot1State3Bot .4byte gSapphireCatchLightSlot1State4Top, gSapphireCatchLightSlot1State4Bot .4byte gSapphireCatchLightSlot1State5Top, gSapphireCatchLightSlot1State5Bot - .4byte 0x0600A1C0, 0x0600A5C0 + .4byte BG_ADDR_FOR_BOARD_WRAP(41, 14), BG_ADDR_FOR_BOARD_WRAP(42, 14) .4byte gSapphireCatchLightState0Top, gSapphireCatchLightState0Bot .4byte gSapphireCatchLightState1Top, gSapphireCatchLightState1Bot @@ -8956,21 +8954,21 @@ gSapphireCatchLightTilePtrs:: @ 0x086B1124 .4byte gSapphireCatchLightSlot2State3Top, gSapphireCatchLightSlot2State3Bot .4byte gSapphireCatchLightSlot2State4Top, gSapphireCatchLightSlot2State4Bot .4byte gSapphireCatchLightSlot2State5Top, gSapphireCatchLightSlot2State5Bot - .4byte 0x0600A200, 0x0600A600 + .4byte BG_ADDR_FOR_BOARD_WRAP(41, 16), BG_ADDR_FOR_BOARD_WRAP(42, 16) gSapphireSaverDisplayTilePtrs:: @ 0x086B11CC @ 3 sets of 4 @ third set has destination address .4byte gSapphireSaverRow0Tile_Off, gSapphireSaverRow1Tile_Off, gSapphireSaverRow2Tile_Off, gSapphireSaverRow3Tile_Off .4byte gSapphireSaverRow0Tile_On, gSapphireSaverRow1Tile_On, gSapphireSaverRow2Tile_On, gSapphireSaverRow3Tile_On - .4byte 0x0600AD80, 0x0600B180, 0x0600B5A0, 0x0600BA00 + .4byte BG_ADDR_FOR_BOARD_WRAP(44, 12), BG_ADDR_FOR_BOARD_WRAP(45, 12), BG_ADDR_FOR_BOARD_WRAP(46, 13), BG_ADDR_FOR_BOARD_WRAP(47, 16) gSapphireHatchArrowTilePtrs:: @ 0x086B11FC @ 3 sets of 4 @ third set has destination address .4byte gSapphireHatchArrow_082E06A0, gSapphireHatchArrow_082E0A60, gSapphireHatchArrow_082E0E60, gSapphireHatchArrow_082E1260 .4byte gSapphireHatchArrow_082E0720, gSapphireHatchArrow_082E0AE0, gSapphireHatchArrow_082E0EE0, gSapphireHatchArrow_082E12E0 - .4byte 0x0600CEA0, 0x0600D260, 0x0600D660, 0x06008260 + .4byte BG_ADDR_FOR_BOARD_WRAP(30, 21), BG_ADDR_FOR_BOARD_WRAP(31, 19), BG_ADDR_FOR_BOARD_WRAP(32, 19), BG_ADDR_FOR_BOARD_WRAP(33, 19) gSapphireBumperArrowTilePtrs:: @ 0x086B122C @ 3 sets of 4 @@ -8978,7 +8976,7 @@ gSapphireBumperArrowTilePtrs:: @ 0x086B122C @ note: first row data has blank tiles, and not actually referenced. .4byte gSapphireBumperArrow_082E0860, gSapphireBumperArrow_082E0C60, gSapphireBumperArrow_082E1060, gSapphireBumperArrow_082E1460 .4byte gSapphireBumperArrow_082E08E0, gSapphireBumperArrow_082E0CE0, gSapphireBumperArrow_082E10E0, gSapphireBumperArrow_082E14E0 - .4byte 0x0600A9A0, 0x0600ADA0, 0x0600B1A0, 0x0600B5A0 + .4byte BG_ADDR_FOR_BOARD_WRAP(21, 13), BG_ADDR_FOR_BOARD_WRAP(22, 13), BG_ADDR_FOR_BOARD_WRAP(23, 13), BG_ADDR_FOR_BOARD_WRAP(24, 13) gSapphireShopArrowTilePtrs:: @ 0x086B125C @ 5 sets of 4 @@ -8987,29 +8985,29 @@ gSapphireShopArrowTilePtrs:: @ 0x086B125C .4byte gSapphireMartArrow_082E1700, gSapphireMartArrow_082E1B00, gSapphireMartArrow_082E1F00, gSapphireMartArrow_082E2300 .4byte gSapphireEvoArrow_082E1780, gSapphireEvoArrow_082E1B80, gSapphireEvoArrow_082E1F80, gSapphireEvoArrow_082E2380 .4byte gSapphireEvoArrow_082E1800, gSapphireEvoArrow_082E1C00, gSapphireEvoArrow_082E2000, gSapphireEvoArrow_082E2400 - .4byte 0x0600BD20, 0x0600C120, 0x0600C520, 0x0600C920 + .4byte BG_ADDR_FOR_BOARD_WRAP(26, 9), BG_ADDR_FOR_BOARD_WRAP(27, 9), BG_ADDR_FOR_BOARD_WRAP(28, 9), BG_ADDR_FOR_BOARD_WRAP(29, 9) gSapphireBallPowerUpLightTilePtrs:: @ 0x086B12AC @ 3 sets of 3 @ third value has destination address - .4byte gSapphireBallPowerUpLight0off, gSapphireBallPowerUpLight0on, 0x06008540 - .4byte gSapphireBallPowerUpLight1off, gSapphireBallPowerUpLight1on, 0x060085A0 - .4byte gSapphireBallPowerUpLight2off, gSapphireBallPowerUpLight2on, 0x060085E0 + .4byte gSapphireBallPowerUpLight0off, gSapphireBallPowerUpLight0on, BG_ADDR_FOR_BOARD_WRAP(12, 10) + .4byte gSapphireBallPowerUpLight1off, gSapphireBallPowerUpLight1on, BG_ADDR_FOR_BOARD_WRAP(12, 13) + .4byte gSapphireBallPowerUpLight2off, gSapphireBallPowerUpLight2on, BG_ADDR_FOR_BOARD_WRAP(12, 15) gSapphireCatchArrowTilePtrs:: @ 0x086B12D0 @ 3 sets of 4 @ third set has destination address .4byte gSapphireCatchArrow_082E0780, gSapphireCatchArrow_082E0B60, gSapphireCatchArrow_082E0F60, gSapphireCatchArrow_082E1360 .4byte gSapphireCatchArrow_082E0800, gSapphireCatchArrow_082E0BE0, gSapphireCatchArrow_082E0FE0, gSapphireCatchArrow_082E13E0 - .4byte 0x0600C260, 0x0600C640, 0x0600CA40, 0x0600CE40 + .4byte BG_ADDR_FOR_BOARD_WRAP(27, 19), BG_ADDR_FOR_BOARD_WRAP(28, 18), BG_ADDR_FOR_BOARD_WRAP(29, 18), BG_ADDR_FOR_BOARD_WRAP(30, 18) gSapphireHoleIndicatorTilePtrs:: @ 0x086B1300 @ 4 sets of 4 @ third value has the destination; fouth value blank. - .4byte gSapphireHoleLightH_Off, gSapphireHoleLightH_On, 0x0600A460, 0 - .4byte gSapphireHoleLightO_Off, gSapphireHoleLightO_On, 0x0600A4C0, 0 - .4byte gSapphireHoleLightL_Off, gSapphireHoleLightL_On, 0x0600A6C0, 0 - .4byte gSapphireHoleLightE_Off, gSapphireHoleLightE_On, 0x0600A720, 0 + .4byte gSapphireHoleLightH_Off, gSapphireHoleLightH_On, BG_ADDR_FOR_BOARD_WRAP(42, 3), 0 + .4byte gSapphireHoleLightO_Off, gSapphireHoleLightO_On, BG_ADDR_FOR_BOARD_WRAP(42, 6), 0 + .4byte gSapphireHoleLightL_Off, gSapphireHoleLightL_On, BG_ADDR_FOR_BOARD_WRAP(42, 22), 0 + .4byte gSapphireHoleLightE_Off, gSapphireHoleLightE_On, BG_ADDR_FOR_BOARD_WRAP(42, 25), 0 gSapphireEvoArrowTilePtrs:: @ 0x086B1340 @ 3 sets of 5 sets of 3 @@ -9018,19 +9016,19 @@ gSapphireEvoArrowTilePtrs:: @ 0x086B1340 .4byte gSapphireEvo_EArrow_Top0, gSapphireEvo_EArrow_Mid0, gSapphireEvo_EArrow_Bot0 .4byte gSapphireEvo_EArrow_Top1, gSapphireEvo_EArrow_Mid1, gSapphireEvo_EArrow_Bot1 .4byte gSapphireEvo_EArrow_Top2, gSapphireEvo_EArrow_Mid2, gSapphireEvo_EArrow_Bot2 - .4byte 0x0600D080, 0x0600D480, 0x06008080 + .4byte BG_ADDR_FOR_BOARD_WRAP(31, 4), BG_ADDR_FOR_BOARD_WRAP(32, 4), BG_ADDR_FOR_BOARD_WRAP(33, 4) .4byte gSapphireEvo_VArrow_Top0, gSapphireEvo_VArrow_Mid0, gSapphireEvo_VArrow_Bot0 .4byte gSapphireEvo_VArrow_Top1, gSapphireEvo_VArrow_Mid1, gSapphireEvo_VArrow_Bot1 .4byte gSapphireEvo_VArrow_Top2, gSapphireEvo_VArrow_Mid2, gSapphireEvo_VArrow_Bot2 .4byte gSapphireEvo_VArrow_Top3, gSapphireEvo_VArrow_Mid3, gSapphireEvo_VArrow_Bot3 - .4byte 0x060080A0, 0x060084A0, 0x060088A0 + .4byte BG_ADDR_FOR_BOARD_WRAP(33, 5), BG_ADDR_FOR_BOARD_WRAP(34, 5), BG_ADDR_FOR_BOARD_WRAP(35, 5) .4byte gSapphireEvo_OArrow_Top0, gSapphireEvo_OArrow_Mid0, gSapphireEvo_OArrow_Bot0 .4byte gSapphireEvo_OArrow_Top0, gSapphireEvo_OArrow_Mid0, gSapphireEvo_OArrow_Bot0 .4byte gSapphireEvo_OArrow_Top1, gSapphireEvo_OArrow_Mid1, gSapphireEvo_OArrow_Bot1 .4byte gSapphireEvo_OArrow_Top2, gSapphireEvo_OArrow_Mid2, gSapphireEvo_OArrow_Bot2 - .4byte 0x060088C0, 0x06008CC0, 0x060090E0 + .4byte BG_ADDR_FOR_BOARD_WRAP(35, 6), BG_ADDR_FOR_BOARD_WRAP(36, 6), BG_ADDR_FOR_BOARD_WRAP(37, 7) gSapphireCoinRewardTilePtrs:: @ 0x086B13F4 @ 3 sets of 5 sets of 3 @@ -9038,19 +9036,19 @@ gSapphireCoinRewardTilePtrs:: @ 0x086B13F4 .4byte gSapphireCoinArrow_082DB5E0, gSapphireCoinArrow_082DB9E0, gSapphireCoinArrow_082DBDE0 .4byte gSapphireCoinArrow_082DB640, gSapphireCoinArrow_082DBA40, gSapphireCoinArrow_082DBE40 .4byte gSapphireCoinArrow_082DB6A0, gSapphireCoinArrow_082DBAA0, gSapphireCoinArrow_082DBEA0 - .4byte 0x0600C4A0, 0x0600C8A0, 0x0600CCA0 + .4byte BG_ADDR_FOR_BOARD_WRAP(28, 5), BG_ADDR_FOR_BOARD_WRAP(29, 5), BG_ADDR_FOR_BOARD_WRAP(30, 5) .4byte 0,0,0 .4byte gSapphireCoinArrow_082DB720, gSapphireCoinArrow_082DBB20, gSapphireCoinArrow_082DBF20 .4byte gSapphireCoinArrow_082DB780, gSapphireCoinArrow_082DBB80, gSapphireCoinArrow_082DBF80 .4byte gSapphireCoinArrow_082DB7E0, gSapphireCoinArrow_082DBBE0, gSapphireCoinArrow_082DBFE0 - .4byte 0x0600CCE0, 0x0600D0E0, 0x0600D4C0 + .4byte BG_ADDR_FOR_BOARD_WRAP(30, 7), BG_ADDR_FOR_BOARD_WRAP(31, 7), BG_ADDR_FOR_BOARD_WRAP(32, 6) .4byte 0,0,0 .4byte gSapphireCoinArrow_082DB820, gSapphireCoinArrow_082DBC20, gSapphireCoinArrow_082DC020 .4byte gSapphireCoinArrow_082DB880, gSapphireCoinArrow_082DBC80, gSapphireCoinArrow_082DC080 .4byte gSapphireCoinArrow_082DB8E0, gSapphireCoinArrow_082DBCE0, gSapphireCoinArrow_082DC0E0 - .4byte 0x0600D0E0, 0x0600D4E0, 0x060080E0 + .4byte BG_ADDR_FOR_BOARD_WRAP(31, 7), BG_ADDR_FOR_BOARD_WRAP(32, 7), BG_ADDR_FOR_BOARD_WRAP(33, 7) .4byte 0,0,0 gSapphireGetArrowTilePtrs:: @ 0x086B14A8 @@ -9060,19 +9058,19 @@ gSapphireGetArrowTilePtrs:: @ 0x086B14A8 .4byte gSapphireGetArrow_082DC1E0, gSapphireGetArrow_082DC5E0, gSapphireGetArrow_082DC9E0 .4byte gSapphireGetArrow_082DC240, gSapphireGetArrow_082DC640, gSapphireGetArrow_082DCA40 .4byte gSapphireGetArrow_082DC2A0, gSapphireGetArrow_082DC6A0, gSapphireGetArrow_082DCAA0 - .4byte 0x0600D2E0, 0x0600D6E0, 0x060082E0 + .4byte BG_ADDR_FOR_BOARD_WRAP(31, 23), BG_ADDR_FOR_BOARD_WRAP(32, 23), BG_ADDR_FOR_BOARD_WRAP(33, 23) .4byte gSapphireGetArrow_082DC320, gSapphireGetArrow_082DC720, gSapphireGetArrow_082DCB00 .4byte gSapphireGetArrow_082DC380, gSapphireGetArrow_082DC780, gSapphireGetArrow_082DCB60 .4byte gSapphireGetArrow_082DC3E0, gSapphireGetArrow_082DC7E0, gSapphireGetArrow_082DCBC0 .4byte gSapphireGetArrow_082DC440, gSapphireGetArrow_082DC840, gSapphireGetArrow_082DCC20 - .4byte 0x060082E0, 0x060086E0, 0x06008AC0 + .4byte BG_ADDR_FOR_BOARD_WRAP(33, 23), BG_ADDR_FOR_BOARD_WRAP(34, 23), BG_ADDR_FOR_BOARD_WRAP(35, 22) .4byte gSapphireGetArrow_082DC4A0, gSapphireGetArrow_082DC880, gSapphireGetArrow_082DCC80 .4byte gSapphireGetArrow_082DC4A0, gSapphireGetArrow_082DC880, gSapphireGetArrow_082DCC80 .4byte gSapphireGetArrow_082DC500, gSapphireGetArrow_082DC8E0, gSapphireGetArrow_082DCCE0 .4byte gSapphireGetArrow_082DC560, gSapphireGetArrow_082DC940, gSapphireGetArrow_082DCD40 - .4byte 0x06008AC0, 0x06008EA0, 0x060092A0 + .4byte BG_ADDR_FOR_BOARD_WRAP(35, 22), BG_ADDR_FOR_BOARD_WRAP(36, 21), BG_ADDR_FOR_BOARD_WRAP(37, 21) gFieldSpriteSets:: @ 0x086B155C .4byte gRubyBoardSpriteSets diff --git a/expected_objs/sub_E464.o b/expected_objs/sub_E464.o deleted file mode 100644 index 6c3aad545f8f70f3a81fb61a4311f055c9c1a768..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3540 zcmb`KZ){Ul6u|F$8(S-gg~%w-$XmPV7IAs&+V>s-wSQhO?fziL{xHRKX zE_e6*&N=to^Umqs?Ou;{Q%RBt9};OHD@4eVbw$gXKyhgyPU0ZTm-f@WG)9-c-oH2C znN_SUZ_)ue5GPZljx@}AB~Nd3)^~s`yB~8W<8RPpf+&tbrk(L#Cl}pLw@tg_#P@BA zw37K-OOm2mtyZGE->~BJNwpL!OdXaPcQ*Pxh5HW+HZbX-*U?7)_PjN-e(8nCn@ttT8;Kq(rc>u zraal=7=yEHsik9~Ux{1i72EQ462&!GuUf>{HRrAyCC#e+cEopMf!?7ebp(9&BIz<^ z?@a164O7``r!sVd+tcZSQ(m%@)CFe@70*bRQR>cn^OoB&<_Ji^4*R3XtwjS)BlC&d z^>NY|9+W+#RhqAD^(;&&Q`U&GZK+uBfBaRb0rP`Gp}-pUuuxz-lgg~M8S3pClp*tw z$eS!aetTo$UAhq}x7#DKR~l2YcNVJi=&E@ed0&36oHcv;yNmahP)cwnJ9`cwuIwKdeuj44CD zeN=898g{zdi~a7i)uKnKn`v`^wp8>pAo}@~=;srtpG`Mz)9s1(a7Pty>Ky9m=2a{6 zcO6YHtgq;2L%E-uaNVGU)xG0Y|r^Ex5KY=Hk~<4q)i~M3GeIC`^}yNsgoU&6Tdo`d&Q`!c(V{v13!4w zklHE_2{eR^il`D<4}1i%8+Z({7dVG_2k;bP4LAw2G$axN!6lawPVWTq1oH0(wh*U) zPa+-#wh@m5pGJHFcpC93;B$zlfhpn-f$I=|3cMHbSHO2f*(5RxoI>{RfG;4v2K+JN zAAt`dW+L|g8JM7Y+y$IP{=Wm)BKv({2V!=WTtWV8L0*UK?EHtw&O}`QO`vE%{@a1) z(et(f8;CoAcO!llID~i)u!*=AIF9%La5v&Ca1!xxU^n7Ca6jU=fPX^yz7ITv>>mKP zA)Wz#8Sxju8N{qU8e%Y4_+J9W9I}4{dTQ!|a!I;<^ThWQVF}^oQg&!4uRQQF%{4`BS5r0`{1T=1q za$S(}$eQXWO(SIoP2<6}cHyA$V>C_Z{6eSm#5A2BZFKM``cA$>4|6{~EUaN3MGp(V zi0~8T()AUq*wL|~6VgupczRSsiSmax{QO))WN-Mz-q=d^e6JCVl8MR8a4Z02={}ww z=^GnAoXhrQa}(syz_C}49e?fEusG%|VcV3yq%Ihc=xOZS`{Dcx^!v~;h@X6ZhYW2JjcrltEyhTE9k zOLDw)AIS*_0-trp?ETF6Iapa-1O9%QKYLFydx))IXYVl(LF z{p|0Z=}Fr}{%9_pfi*W?T1UAwo;}i*%TDD;+ekW>CT*FC3DO4N4cgMV-1y - #define TRUE 1 #define FALSE 0 -#define IWRAM_DATA __attribute__((section("iwram_data"))) -#define EWRAM_DATA __attribute__((section("ewram_data"))) - -#define ALIGNED(n) __attribute__((aligned(n))) - -#define SOUND_INFO_PTR (*(struct SoundInfo **)0x3007FF0) -#define INTR_CHECK (*(u16 *)0x3007FF8) -#define INTR_VECTOR (*(void **)0x3007FFC) +// Note: IWRAM, EWRAM, SOUND_INFO_PTR, INTR_CHECK and INTR_VECTOR have been split to +// a separate file, allowing reuse of these defines from the rom_.s data files. #define EWRAM_START 0x02000000 #define EWRAM_END (EWRAM_START + 0x40000) @@ -40,9 +32,6 @@ // "Character" Block: The container in VRAM holding a set of these tiles. #define BG_CHAR_SIZE 0x4000 #define BG_SCREEN_SIZE 0x800 // Char block is 8 screens -#define BG_CHAR_ADDR(n) (void*)(BG_VRAM + (BG_CHAR_SIZE * (n))) -#define BG_SCREEN_ADDR(n) (void*)(BG_VRAM + (BG_SCREEN_SIZE * (n))) -#define BG_CHAR_SCREEN_ADDR(m,n) (void*)(BG_VRAM + (BG_CHAR_SIZE * (m))+ (BG_SCREEN_SIZE * (n))) #define BG_TILE_H_FLIP(n) (0x400 + (n)) #define BG_TILE_V_FLIP(n) (0x800 + (n)) @@ -63,11 +52,9 @@ #define DISPLAY_WIDTH 240 #define DISPLAY_HEIGHT 160 -#define TILE_SIZE_4BPP 32 -#define TILE_SIZE_8BPP 64 +#define TILE_SIZE_4BPP 0x20 #define TILE_OFFSET_4BPP(n) ((n) * TILE_SIZE_4BPP) -#define TILE_OFFSET_8BPP(n) ((n) * TILE_SIZE_8BPP) #define TOTAL_OBJ_TILE_COUNT 1024 @@ -79,24 +66,41 @@ #define PALETTES_PER_BANK 16 // One bank for BG palettes, one for Obj palettes #define COLORS_PER_PALETTE 16 -#define BG_PLTT_SLOT(n) (void*)(BG_PLTT + (n) * PLTT_SLOT_SIZE) -#define OBJ_PLTT_SLOT(n) (void*)(OBJ_PLTT + (n) * PLTT_SLOT_SIZE) +#define BG_PLTT_SLOT(n) (BG_PLTT + (n) * PLTT_SLOT_SIZE) +#define OBJ_PLTT_SLOT(n) (OBJ_PLTT + (n) * PLTT_SLOT_SIZE) #define TILES_SIZE_4BPP(n) ((n) * TILE_SIZE_4BPP) -#define TILES_SIZE_8BPP(n) ((n) * TILE_SIZE_8BPP) -#define BG_TILE_ADDR(n) (void*)(BG_VRAM + TILE_OFFSET_4BPP(n)) -#define OBJ_TILE_ADDR(n) (void*)(OBJ_VRAM0 + TILE_OFFSET_4BPP(n)) +#define BG_TILE_ADDR(n) (BG_VRAM + TILE_OFFSET_4BPP(n)) +#define OBJ_TILE_ADDR(n) (OBJ_VRAM0 + TILE_OFFSET_4BPP(n)) #define TILE_WIDTH 8 #define TILE_HEIGHT 8 -#define TILE_INDEX(x, y, width) \ - ((y) * (width) + (x)) +#define TILES_PER_CHARBLOCK_ROW 32 +#define TILES_PER_CHARBLOCK (BG_CHAR_SIZE / TILE_SIZE_4BPP) -#define BG_SCREENBLOCK_WIDTH 32 -#define BG_SCREENBLOCK_HEIGHT 32 -#define BG_SCREENBLOCK_ENTRIES \ - (BG_SCREENBLOCK_WIDTH * BG_SCREENBLOCK_HEIGHT) +#define TILE_INDEX(charBlock, y, x) (((charBlock) * TILES_PER_CHARBLOCK) + ((y) * TILES_PER_CHARBLOCK_ROW) + (x)) + +/* +The main board graphics for the pinball board are loaded into the BG section of VRAM, starting at +char block 2, and extending 6 rows into BG_VRAM char block 3. + +From there, a tilemap pulls them onto the board, and gives them the correct palette on BG layer 3. +The tilemap covers the whole board, but is pulling it from a memory space that gets reused. (section wrapping) +One consequence of this is that a piece intended for one segment of the board will also appear on the output +BG layer 3 in other spots, possibly with the wrong palette. (Outside the area the camera is showing) + +Board wrapping starts with the top of the board offset a few rows, as part of the scroll wrapping strategy. +*/ + +// Note: this is mostly normalized, based on manual calculations from the top +// loadFieldBoardGraphics suggests that the top of sapphire might be 1 line earlier, ruby 2 lines later +#define BOARD_ROW_OFFSET 11 +#define BOARD_ROW_COUNT 22 + +#define WRAP_ROW(y) (((y) + BOARD_ROW_OFFSET) % BOARD_ROW_COUNT) + +#define BG_ADDR_FOR_BOARD_WRAP(y, x) BG_TILE_ADDR(TILE_INDEX(2, WRAP_ROW(y), (x))) #endif // GUARD_GBA_DEFINES diff --git a/include/gba/gba.h b/include/gba/gba.h index 34934403..edf9dc1d 100644 --- a/include/gba/gba.h +++ b/include/gba/gba.h @@ -1,6 +1,7 @@ #ifndef GUARD_GBA_GBA_H #define GUARD_GBA_GBA_H +#include "gba/gba_c_defines.h" #include "gba/defines.h" #include "gba/io_reg.h" #include "gba/types.h" diff --git a/include/gba/gba_c_defines.h b/include/gba/gba_c_defines.h new file mode 100644 index 00000000..2096d07d --- /dev/null +++ b/include/gba/gba_c_defines.h @@ -0,0 +1,15 @@ +#ifndef GUARD_GBA_C_DEFINES +#define GUARD_GBA_C_DEFINES + +#include + +#define IWRAM_DATA __attribute__((section("iwram_data"))) +#define EWRAM_DATA __attribute__((section("ewram_data"))) + +#define ALIGNED(n) __attribute__((aligned(n))) + +#define SOUND_INFO_PTR (*(struct SoundInfo **)0x3007FF0) +#define INTR_CHECK (*(u16 *)0x3007FF8) +#define INTR_VECTOR (*(void **)0x3007FFC) + +#endif \ No newline at end of file diff --git a/include/global.h b/include/global.h index e37c6b2e..daf16889 100644 --- a/include/global.h +++ b/include/global.h @@ -779,7 +779,7 @@ struct PinballGame /*0x62C*/ u8 travelModeCompletionCount; /*0x62D*/ u8 slotsPlayedCount; /*0x62E*/ u8 bonusPikaSaverCount; - /*0x62F*/ u8 bonusMultiplier; + /*0x62F*/ u8 endOfBallBonusMultiplier; /*0x630*/ u32 bonusSubtotal; /*0x634*/ u32 bonusCategoryScore; /*0x638*/ s8 bonusSummaryPhase; @@ -828,7 +828,7 @@ struct PinballGame /*0x706*/ u8 filler706[0x2]; /*0x708*/ u32 portraitCycleFrame; /*0x70C*/ u16 hudAnimFrameCounter; - /*0x70E*/ s8 progressLevel; // Becomes bonusMultiplier at end-of-ball; displayed on the blue bonus sign + /*0x70E*/ s8 bonusMultTracker; /*0x70F*/ s8 unk70F; /*0x710*/ s8 holeIndicators[4]; // 'HOLE' light indicators in Ruby/Sapphire field /*0x714*/ s8 allHolesLit; @@ -838,11 +838,11 @@ struct PinballGame /*0x718*/ s8 ballPowerUpLight[3]; /*0x71B*/ s8 ballPowerUpAnimActive; /*0x71C*/ u8 gBallUpgradeFxTimer; - /*0x71D*/ s8 catchLights[3]; - /*0x720*/ u8 evoBlinkTimer; + /*0x71D*/ s8 modeProgressLights[3]; // 3 Pokeballs, "Catch!", and "Evo" light under portrait + /*0x720*/ u8 modeProgressBlinkTimer; // 3 Pokeballs, "Catch!", and "Evo" light under portrait /*0x721*/ s8 evoCatchLightSlot1; /*0x722*/ s8 evoCatchLightSlot2; - /*0x723*/ s8 evoItemCount; + /*0x723*/ s8 monProgressTowardsBonusCount; /*0x724*/ u16 saverTimeRemaining; /*0x726*/ s8 saverLit; /*0x727*/ u8 filler727[0x1]; diff --git a/src/all_board_banners.c b/src/all_board_banners.c index 139d71e5..9819c461 100644 --- a/src/all_board_banners.c +++ b/src/all_board_banners.c @@ -136,7 +136,7 @@ void RenderBannerSlideAnimation(void) else { gCurrentPinballGame->activeFxType = FX_MODE_START_BANNER; - DmaCopy16(3, gModeBannerTilemaps[gCurrentPinballGame->bannerGfxIndex], OBJ_TILE_ADDR(TILE_INDEX(0, 22, 32)), 0x25E0); + DmaCopy16(3, gModeBannerTilemaps[gCurrentPinballGame->bannerGfxIndex], OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x25E0); AnimateBannerSlide(); if (gCurrentPinballGame->bannerDisplayDuration > 0) { @@ -164,7 +164,7 @@ void RenderBannerSlideAnimation(void) { gCurrentPinballGame->activeFxType = FX_MODE_START_BANNER; // i = framecount ??? - DmaCopy16(3, gModeBannerTilemaps[gCurrentPinballGame->bannerGfxIndex] + ((i = frameCount) * 0x21C0), OBJ_TILE_ADDR(TILE_INDEX(0, 22, 32)), 0x21C0); + DmaCopy16(3, gModeBannerTilemaps[gCurrentPinballGame->bannerGfxIndex] + ((i = frameCount) * 0x21C0), OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x21C0); if (gCurrentPinballGame->bannerDisplayDuration > 0) { gCurrentPinballGame->bannerDisplayDuration--; diff --git a/src/all_board_mode_change_and_debug_menu.c b/src/all_board_mode_change_and_debug_menu.c index ef88fe0c..8194bf77 100644 --- a/src/all_board_mode_change_and_debug_menu.c +++ b/src/all_board_mode_change_and_debug_menu.c @@ -117,7 +117,7 @@ void DebugMenu_RenderAndHandleInput(void) for (i = 0x340; i < 0x380; i++) gBG0TilemapBuffer[i] += 0xC100; - DmaCopy16(3, gBG0TilemapBuffer, BG_CHAR_SCREEN_ADDR(0,4), BG_SCREEN_SIZE); + DmaCopy16(3, gBG0TilemapBuffer, BG_TILE_ADDR(TILE_INDEX(0,8,0)), BG_SCREEN_SIZE); if (JOY_HELD(A_BUTTON)) ClearDebugTextDisplay(); } @@ -156,7 +156,7 @@ void GameOverAnimation(void) if (gMain.animationTimer == 3600) { - DmaCopy16(3, gMainBoardGameOverText_Gfx, (void *)0x06015800, 0x400); + DmaCopy16(3, gMainBoardGameOverText_Gfx, OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x400); gMain.fieldSpriteGroups[FIELD_SG_GAME_OVER_TEXT]->active = TRUE; for (i = 0; i < 8; i++) { @@ -206,7 +206,7 @@ void EndOfBallSequence(void) gMain.spriteGroups[SG_END_OF_BALL_BONUS_TEXT_LINE_0].active = TRUE; gMain.spriteGroups[SG_END_OF_BALL_BONUS_TEXT_LINE_1].active = TRUE; gMain.spriteGroups[SG_END_OF_BALL_BONUS_TEXT_LINE_2].active = TRUE; - DmaCopy16(3, gMainBoardEndOfBall_Gfx, (void *)0x6015800, 0x2800); + DmaCopy16(3, gMainBoardEndOfBall_Gfx, OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x2800); if (gMain.selectedField == FIELD_RUBY) { DmaCopy16(3, gEndOfBallBonus_Ruby_Pal, OBJ_PLTT_SLOT(PAL_IX_BANNER), PLTT_SLOT_SIZE); @@ -243,7 +243,7 @@ void EndOfBallSequence(void) gCurrentPinballGame->travelModeCompletionCount = 0; gCurrentPinballGame->slotsPlayedCount = 0; gCurrentPinballGame->bonusPikaSaverCount = 0; - gCurrentPinballGame->bonusMultiplier = 0; + gCurrentPinballGame->endOfBallBonusMultiplier = 0; InitBallState(0); SetBoardCollisionConfig(0); gCurrentPinballGame->boardCollisionConfigChanged = FALSE; @@ -455,14 +455,14 @@ void BallSaverAnimation(void) gMain.spriteGroups[SG_BALL_SAVE_LATI_ARM].active = TRUE; if (gMain.selectedField == FIELD_RUBY) { - DmaCopy16(3, gMainBoardBallSave_Gfx, (void *)0x06015800, 0x2400); - DmaCopy16(3, gMainBoardBallSaveLatios_Gfx, (void *)0x06016800, 0x800); - DmaCopy16(3, gMainBoardBallSaveLatiosArm_Gfx, (void *)0x06017000, 0xC0); + DmaCopy16(3, gMainBoardBallSave_Gfx, OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x2400); + DmaCopy16(3, gMainBoardBallSaveLatios_Gfx, OBJ_TILE_ADDR(TILE_INDEX(1, 10, 0)), 0x800); + DmaCopy16(3, gMainBoardBallSaveLatiosArm_Gfx, OBJ_TILE_ADDR(TILE_INDEX(1, 12, 0)), 0xC0); DmaCopy16(3, gBallSaver_Ruby_Pal, OBJ_PLTT_SLOT(PAL_IX_LATI_BALL_SAVER), PLTT_SLOT_SIZE); } else { - DmaCopy16(3, gMainBoardBallSave_Gfx, (void *)0x06015800, 0x2400); + DmaCopy16(3, gMainBoardBallSave_Gfx, OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x2400); DmaCopy16(3, gBallSaver_Sapphire_Pal, OBJ_PLTT_SLOT(PAL_IX_LATI_BALL_SAVER), PLTT_SLOT_SIZE); } @@ -503,7 +503,7 @@ void ClearDebugTextDisplay(void) for (i = 0x340; i < 0x380; i++) gBG0TilemapBuffer[i] = 0x1FF; - DmaCopy16(3, gBG0TilemapBuffer, BG_CHAR_SCREEN_ADDR(0,4), BG_SCREEN_SIZE); + DmaCopy16(3, gBG0TilemapBuffer, BG_TILE_ADDR(TILE_INDEX(0,8,0)), BG_SCREEN_SIZE); } void DebugMoveBallPosition(void) @@ -588,6 +588,7 @@ void EndOfBallBonusSummary(void) { for (j = 0; j < EOB_SUMMARY_CHARS_PER_LINE; j++) { + s16 charix; s16 var1 = gCurrentPinballGame->bonusTextContent[i][j]; if (var1 == 95) var1 = 48; @@ -598,11 +599,13 @@ void EndOfBallBonusSummary(void) if (gCurrentPinballGame->bonusTextRevealMask[i][j]) { - DmaCopy16(3, gBonusSummaryCharTiles[var1], (void *)0x06016000 + (j + i * 22 + 0xA0) * 0x20, 0x20); + //OBJ_TILE_ADDR(TILE_INDEX(1, 13, 22 * i + j)) + DmaCopy16(3, gBonusSummaryCharTiles[var1], OBJ_TILE_ADDR(TILE_INDEX(1, 8, 0)) + (j + i * 22 + 160) * 0x20, 0x20); } else { - DmaCopy16(3, gBonusSummaryCharTiles[48], (void *)0x06016000 + (j + i * 22 + 0xA0) * 0x20, 0x20); + //OBJ_TILE_ADDR(TILE_INDEX(1, 13, 22 * i + j)) + DmaCopy16(3, gBonusSummaryCharTiles[48], OBJ_TILE_ADDR(TILE_INDEX(1, 8, 0)) + (j + i * 22 + 160) * 0x20, 0x20); } } } @@ -901,7 +904,7 @@ void EndOfBallBonusSummary(void) // Line 1 score display: bonus multiplier for (i = 0; i < 10; i++) scoreDigit[i] = 0; - value = gCurrentPinballGame->bonusMultiplier; + value = gCurrentPinballGame->endOfBallBonusMultiplier; scoreDigit[5] = DIGIT_100K(value); scoreDigit[4] = DIGIT_10K(value); scoreDigit[3] = DIGIT_1K(value) + DIGIT_TILE_WITH_COMMA_OFFSET; @@ -918,7 +921,7 @@ void EndOfBallBonusSummary(void) scoreDigit[i] = 0; value = 0; scoreHi = 0; - while (gCurrentPinballGame->bonusMultiplier != 0) + while (gCurrentPinballGame->endOfBallBonusMultiplier != 0) { // Note: tallied in a loop, rather than a base multiplication to prevent integer overflow. value += gCurrentPinballGame->bonusSubtotal; @@ -927,7 +930,7 @@ void EndOfBallBonusSummary(void) value -= (2 * SCORE_HI_STEP); scoreHi += 2; } - gCurrentPinballGame->bonusMultiplier--; + gCurrentPinballGame->endOfBallBonusMultiplier--; } if (value / SCORE_HI_STEP > 0) diff --git a/src/all_board_pause_game.c b/src/all_board_pause_game.c index de4be1d9..2d79b322 100644 --- a/src/all_board_pause_game.c +++ b/src/all_board_pause_game.c @@ -50,8 +50,9 @@ void PauseGame(void) { for (j = 0; j < COLORS_PER_PALETTE; j++) { - //Palette 9, color 12 is used for the white text in the pause screen - if (i != 9 || j != 12) + // Palette 9, color 12 is used for the white text in the pause screen + // Dim all other colors to 2/5 of their original values + if (i != PAL_IX_PAUSE_TEXT || j != 12) { rgb[0] = (RGB5_GET_R(gCurrentPinballGame->pauseObjPalette[i][j]) * 2) / 5; rgb[1] = (RGB5_GET_G(gCurrentPinballGame->pauseObjPalette[i][j]) * 2) / 5; @@ -243,11 +244,11 @@ void AnimatePauseMenuOverlay(void) index = gPauseMenuTextAnimFrames[(gMain.systemFrameCount % 65) / 5]; if (gMain.selectedField < MAIN_FIELD_COUNT) { - DmaCopy16(3, gPauseMenuText_Gfx[index], (void *)0x060118C0, 0x20); + DmaCopy16(3, gPauseMenuText_Gfx[index], OBJ_TILE_ADDR(TILE_INDEX(0, 6, 6)), 0x20); } else { - DmaCopy16(3, gPauseMenuText_Gfx[index], (void *)0x06010480, 0x20); + DmaCopy16(3, gPauseMenuText_Gfx[index], OBJ_TILE_ADDR(TILE_INDEX(0, 1, 4)), 0x20); } offsets = gPauseMenuSpriteOffsets; diff --git a/src/all_board_pinball_game_main.c b/src/all_board_pinball_game_main.c index 022cfd09..cff582ab 100644 --- a/src/all_board_pinball_game_main.c +++ b/src/all_board_pinball_game_main.c @@ -318,7 +318,7 @@ void InitPinballGameState(void) gCurrentPinballGame->chargeIndicatorXOffset = 0; gCurrentPinballGame->chargeIndicatorYOffset = 120; gCurrentPinballGame->fullChargeIndicatorBlinkTimer = 60; - DmaCopy16(3, gDxModePikachuObjTiles, (void *)OBJ_VRAM0 + 0x600, 0x180); + DmaCopy16(3, gDxModePikachuObjTiles, OBJ_TILE_ADDR(TILE_INDEX(0, 1, 16)), 0x180); gCurrentPinballGame->outLanePikaPosition = PIKA_BOTH_SIDES; gMain.fieldSpriteGroups[FIELD_SG_HATCH_MON_ENTITY]->active = FALSE; gCurrentPinballGame->pichuEntranceTimer = 1; @@ -690,7 +690,7 @@ void IdleGameFrameUpdate(void) gBG0TilemapBuffer[0x34A + i] = 0x1FF; } - DmaCopy16(3, &gBG0TilemapBuffer[0x340], (void *)0x6002680, 0x40); + DmaCopy16(3, &gBG0TilemapBuffer[0x340], BG_TILE_ADDR(TILE_INDEX(0, 9, 20)), 0x40); } void BonusFieldFrameUpdate(void) @@ -834,7 +834,7 @@ void IdleBonusFieldFrameUpdate(void) gBG0TilemapBuffer[0x32B + i] = 0x1FF; } - DmaCopy16(3, &gBG0TilemapBuffer[0x320], (void *)0x6002640, 0x40); + DmaCopy16(3, &gBG0TilemapBuffer[0x320], BG_TILE_ADDR(TILE_INDEX(0, 9, 18)), 0x40); } void PinballGame_State3_4B20C(void) diff --git a/src/all_board_portrait_display.c b/src/all_board_portrait_display.c index 07cc2658..9f883577 100644 --- a/src/all_board_portrait_display.c +++ b/src/all_board_portrait_display.c @@ -33,7 +33,8 @@ void LoadPortraitGraphics(s16 displayMode, s16 picIx) case PORTRAIT_STATE_CURRENT_LOCATION: gCurrentPinballGame->creatureOamPriority = 3; gCurrentPinballGame->portraitGfxIndex[picIx] = gCurrentPinballGame->areaRoulettePortraitIndex[picIx]; - DmaCopy16(3, gLocationPortraitGfx[gCurrentPinballGame->portraitGfxIndex[picIx]], (void *)0x06010CA0 + picIx * 0x300, 0x300); + DmaCopy16(3, gLocationPortraitGfx[gCurrentPinballGame->portraitGfxIndex[picIx]], + OBJ_TILE_ADDR(TILE_INDEX(0, 3, 5 + picIx * 24)), 24 * 0x20); index = gCurrentPinballGame->areaRoulettePortraitIndex[picIx] * 0x10; DmaCopy16(3, &gLocation_Pals[index], OBJ_PLTT_SLOT(gPortraitPaletteSlots[picIx]), PLTT_SLOT_SIZE); break; @@ -41,23 +42,26 @@ void LoadPortraitGraphics(s16 displayMode, s16 picIx) ptr = gShopItemData[START_SLOT_CARD]; gCurrentPinballGame->portraitGfxIndex[picIx] = ptr[(gCurrentPinballGame->portraitCycleFrame % 48) / 24]; index = ptr[2] * 0x10; - DmaCopy16(3, gPortraitAnimFrameGraphics[gCurrentPinballGame->portraitGfxIndex[picIx]], (void *)0x06010CA0 + picIx * 0x300, 0x300); + DmaCopy16(3, gPortraitAnimFrameGraphics[gCurrentPinballGame->portraitGfxIndex[picIx]], + OBJ_TILE_ADDR(TILE_INDEX(0, 3, 5 + picIx * 24)), 24 * 0x20); DmaCopy16(3, &gPortraitAnim_Pals[index], OBJ_PLTT_SLOT(gPortraitPaletteSlots[picIx]), PLTT_SLOT_SIZE); break; case PORTRAIT_STATE_ROULETTE_WHEEL: ptr = gShopItemData[gCurrentPinballGame->modeOutcomeValues[picIx]]; gCurrentPinballGame->portraitGfxIndex[picIx] = ptr[0]; index = ptr[2] * 0x10; - DmaCopy16(3, gPortraitAnimFrameGraphics[gCurrentPinballGame->portraitGfxIndex[picIx]], (void *)0x06010CA0 + picIx * 0x300, 0x300); + DmaCopy16(3, gPortraitAnimFrameGraphics[gCurrentPinballGame->portraitGfxIndex[picIx]], + OBJ_TILE_ADDR(TILE_INDEX(0, 3, 5 + picIx * 24)), + 24 * 0x20); DmaCopy16(3, &gPortraitAnim_Pals[index], OBJ_PLTT_SLOT(gPortraitPaletteSlots[picIx]), PLTT_SLOT_SIZE); break; case PORTRAIT_STATE_POKEMON_DISPLAY: gCurrentPinballGame->portraitGfxIndex[picIx] = gCurrentPinballGame->currentSpecies; DmaCopy16( 3, - gMonPortraitGroupGfx[gCurrentPinballGame->portraitGfxIndex[picIx] / 15] + (gCurrentPinballGame->portraitGfxIndex[picIx] % 15) * 0x300, - (void *)0x06010CA0 + picIx * 24, - 0x300); + gMonPortraitGroupGfx[gCurrentPinballGame->portraitGfxIndex[picIx] / 15] + (gCurrentPinballGame->portraitGfxIndex[picIx] % 15) * 24 * 0x20, + OBJ_TILE_ADDR(TILE_INDEX(0, 3, 5)) + picIx * 24, // BUG: missing * 0x20; but picIx will always be 0 here. + 24 * 0x20); DmaCopy16( 3, gMonPortraitGroupPals[gCurrentPinballGame->portraitGfxIndex[picIx] / 15][gCurrentPinballGame->portraitGfxIndex[picIx] % 15], @@ -104,16 +108,16 @@ void LoadPortraitGraphics(s16 displayMode, s16 picIx) DmaCopy16( 3, - gMonPortraitGroupGfx[gCurrentPinballGame->portraitGfxIndex[picIx] / 15] + (gCurrentPinballGame->portraitGfxIndex[picIx] % 15) * 0x300, - (void *)0x06010CA0 + picIx * 0x18, - 0x300); + gMonPortraitGroupGfx[gCurrentPinballGame->portraitGfxIndex[picIx] / 15] + (gCurrentPinballGame->portraitGfxIndex[picIx] % 15) * 24 * 0x20, + OBJ_TILE_ADDR(TILE_INDEX(0, 3, 5)) + picIx * 24, // BUG: missing * 0x20; but picIx will always be 0 here. + 24 * 0x20); break; case PORTRAIT_STATE_TRAVEL_RAMP_INDICATOR: if (gCurrentPinballGame->boardSubState == TRAVEL_SUBSTATE_STOP_LANE_INDICATORS) { // This code state likely doesn't matter - Board is in this board substate for exactly 1 frame. gCurrentPinballGame->portraitGfxIndex[picIx] = gShopItemData[GOTO_NEXT_CARD][(gCurrentPinballGame->portraitCycleFrame % 48) / 24]; - DmaCopy16(3, gPortraitAnimFrameGraphics[gCurrentPinballGame->portraitGfxIndex[picIx]], (void *)0x06010CA0 + picIx * 0x300, 0x300); + DmaCopy16(3, gPortraitAnimFrameGraphics[gCurrentPinballGame->portraitGfxIndex[picIx]], OBJ_TILE_ADDR(TILE_INDEX(0, 3, 5 + picIx * 24)), 24 * 0x20); // !!!!! BUG: this should be multiplied by 16 !! index = gShopItemData[GOTO_NEXT_CARD][2]; @@ -121,7 +125,7 @@ void LoadPortraitGraphics(s16 displayMode, s16 picIx) else { gCurrentPinballGame->portraitGfxIndex[picIx] = gShopItemData[TRAVEL_RAMP_INDICATOR_CARD][(gCurrentPinballGame->portraitCycleFrame % 48) / 24]; - DmaCopy16(3, gPortraitAnimFrameGraphics[gCurrentPinballGame->portraitGfxIndex[picIx]], (void *)0x06010CA0 + picIx * 0x300, 0x300); + DmaCopy16(3, gPortraitAnimFrameGraphics[gCurrentPinballGame->portraitGfxIndex[picIx]], OBJ_TILE_ADDR(TILE_INDEX(0, 3, 5 + picIx * 24)), 24 * 0x20); index = gShopItemData[TRAVEL_RAMP_INDICATOR_CARD][2] * 16; } DmaCopy16(3, &gPortraitAnim_Pals[index], OBJ_PLTT_SLOT(gPortraitPaletteSlots[picIx]), PLTT_SLOT_SIZE); @@ -130,7 +134,8 @@ void LoadPortraitGraphics(s16 displayMode, s16 picIx) ptr = gShopItemData[gCurrentPinballGame->shopSelectedItemId]; gCurrentPinballGame->portraitGfxIndex[picIx] = ptr[0]; index = ptr[2] * 16; - DmaCopy16(3, gPortraitAnimFrameGraphics[gCurrentPinballGame->portraitGfxIndex[picIx]], (void *)0x06010CA0 + picIx * 0x300, 0x300); + DmaCopy16(3, gPortraitAnimFrameGraphics[gCurrentPinballGame->portraitGfxIndex[picIx]], OBJ_TILE_ADDR(TILE_INDEX(0, 3, 5 + picIx * 24)), 24 * 0x20); + if (gCurrentPinballGame->coins < ptr[3] || ( (gShopCursorToItemMap[gCurrentPinballGame->shopItemCursor] == PRIZE_PICHU_SAVER @@ -162,7 +167,7 @@ void LoadPortraitGraphics(s16 displayMode, s16 picIx) ptr2 = ptr = gShopItemData[gCurrentPinballGame->modeOutcomeValues[picIx]]; gCurrentPinballGame->portraitGfxIndex[picIx] = *(ptr2 += (gCurrentPinballGame->portraitCycleFrame % 48) / 24); index = ptr[2] * 16; - DmaCopy16(3, gPortraitAnimFrameGraphics[gCurrentPinballGame->portraitGfxIndex[picIx]], (void *)0x06010CA0 + picIx * 0x300, 0x300); + DmaCopy16(3, gPortraitAnimFrameGraphics[gCurrentPinballGame->portraitGfxIndex[picIx]], OBJ_TILE_ADDR(TILE_INDEX(0, 3, 5 + picIx * 24)), 24 * 0x20); DmaCopy16(3, &gPortraitAnim_Pals[index], OBJ_PLTT_SLOT(gPortraitPaletteSlots[picIx]), PLTT_SLOT_SIZE); break; case PORTRAIT_STATE_ROULETTE_OUTCOME: @@ -170,7 +175,7 @@ void LoadPortraitGraphics(s16 displayMode, s16 picIx) ptr2 = ptr = gShopItemData[gCurrentPinballGame->prizeId]; gCurrentPinballGame->portraitGfxIndex[picIx] = *(ptr2 += gRouletteOutcomeFrameOffsets[gCurrentPinballGame->outcomeFrameCounter / 12]); index = ptr[2] * 16; - DmaCopy16(3, gPortraitAnimFrameGraphics[gCurrentPinballGame->portraitGfxIndex[picIx]], (void *)0x06010CA0 + picIx * 0x300, 0x300); + DmaCopy16(3, gPortraitAnimFrameGraphics[gCurrentPinballGame->portraitGfxIndex[picIx]], OBJ_TILE_ADDR(TILE_INDEX(0, 3, 5 + picIx * 24)), 24 * 0x20); DmaCopy16(3, &gPortraitAnim_Pals[index], OBJ_PLTT_SLOT(gPortraitPaletteSlots[picIx]), PLTT_SLOT_SIZE); break; } diff --git a/src/all_board_process1.c b/src/all_board_process1.c index 9f2d79dc..24e699d9 100644 --- a/src/all_board_process1.c +++ b/src/all_board_process1.c @@ -17,7 +17,7 @@ void ClearBG0Tilemap(void) for (i = 0; i < 0x800; i++) gBG0TilemapBuffer[i] = 0x1FF; - DmaCopy16(3, gBG0TilemapBuffer, BG_CHAR_SCREEN_ADDR(0,4), 2* BG_SCREEN_SIZE); + DmaCopy16(3, gBG0TilemapBuffer, BG_TILE_ADDR(TILE_INDEX(0,8,0)), 2* BG_SCREEN_SIZE); } diff --git a/src/all_board_process2.c b/src/all_board_process2.c index 00c14e90..ee456101 100644 --- a/src/all_board_process2.c +++ b/src/all_board_process2.c @@ -580,8 +580,8 @@ void ResetBoardStateOnDeath(void) gCurrentPinballGame->ballUpgradeTimerPaused = FALSE; DmaCopy16(3, gBall_Pals[gCurrentPinballGame->ballUpgradeType], OBJ_PLTT_SLOT(PAL_IX_BALL), PLTT_SLOT_SIZE); - gCurrentPinballGame->bonusMultiplier = gCurrentPinballGame->progressLevel; - gCurrentPinballGame->progressLevel = 1; + gCurrentPinballGame->endOfBallBonusMultiplier = gCurrentPinballGame->bonusMultTracker; + gCurrentPinballGame->bonusMultTracker = 1; if (gCurrentPinballGame->whiscashFrameIx == WHISCASH_FRAME_GONE_AFTER_HIT) { gCurrentPinballGame->shouldProcessWhiscash = FALSE; diff --git a/src/all_board_process4.c b/src/all_board_process4.c index a4e69315..28c69e74 100644 --- a/src/all_board_process4.c +++ b/src/all_board_process4.c @@ -74,7 +74,7 @@ void UpdateFrameProcess4_FlipperLogic_MainBoards(void) spriteGroup->baseX = gFlipperBaseXPositions[i] - gCurrentPinballGame->cameraXOffset; spriteGroup->baseY = gBoardConfig.fieldLayout.flipperBaseY - gCurrentPinballGame->cameraYOffset; - DmaCopy16(3, gFlipper_Gfx[flipperTileIndex], OBJ_VRAM0 + i * 0x200, 0x200); + DmaCopy16(3, gFlipper_Gfx[flipperTileIndex], OBJ_TILE_ADDR(TILE_INDEX(0, 0, i * 16)), 16 * 0x20); oamData = &spriteGroup->oam[0]; gOamBuffer[oamData->oamId].x = oamData->xOffset + spriteGroup->baseX; @@ -188,7 +188,7 @@ void UpdateFrameProcess4_FlipperLogic_BonusBoards(void) spriteGroup->baseX = gFlipperBaseXPositions[i] - gCurrentPinballGame->cameraXOffset; spriteGroup->baseY = gBoardConfig.fieldLayout.flipperBaseY - gCurrentPinballGame->cameraYOffset; - DmaCopy16(3, gFlipper_Gfx[flipperTileIndex], OBJ_VRAM0 + i * 0x200, 0x200); + DmaCopy16(3, gFlipper_Gfx[flipperTileIndex], OBJ_TILE_ADDR(TILE_INDEX(0, 0, i * 16)), 16 * 0x20); if (spriteGroup->baseY > 180) spriteGroup->baseY = 180; diff --git a/src/all_board_process6_collision.c b/src/all_board_process6_collision.c index 072c855b..f8c2a9b8 100644 --- a/src/all_board_process6_collision.c +++ b/src/all_board_process6_collision.c @@ -787,14 +787,14 @@ u16 CheckCatchTargetCollision(struct Vector16 *ballPosition, u16 *collisionAngle gCurrentPinballGame->creatureHitCount++; if (gCurrentPinballGame->creatureHitCount == 3) { - gCurrentPinballGame->catchLights[gCurrentPinballGame->creatureHitCount - 1] = 3; + gCurrentPinballGame->modeProgressLights[gCurrentPinballGame->creatureHitCount - 1] = MODE_PROGRESS_LAMP_CATCH_LIT; gCurrentPinballGame->captureState = MON_CAPTURE_SPECIAL_STATE_CAPTURE_CUTSCENE; gCurrentPinballGame->captureSequenceFrame = 0; gCurrentPinballGame->scoreAddedInFrame = SCORE_JIRACHI_CATCH_HIT; } else { - gCurrentPinballGame->catchLights[gCurrentPinballGame->creatureHitCount - 1] = 3; + gCurrentPinballGame->modeProgressLights[gCurrentPinballGame->creatureHitCount - 1] = MODE_PROGRESS_LAMP_CATCH_LIT; gCurrentPinballGame->captureState = MON_CAPTURE_SPECIAL_STATE_MON_HIT_IN_CATCH_MODE; gCurrentPinballGame->scoreAddedInFrame = SCORE_JIRACHI_CATCH_HIT; } @@ -813,14 +813,14 @@ u16 CheckCatchTargetCollision(struct Vector16 *ballPosition, u16 *collisionAngle gCurrentPinballGame->creatureHitCount++; if (gCurrentPinballGame->creatureHitCount == 3) { - gCurrentPinballGame->catchLights[gCurrentPinballGame->creatureHitCount - 1] = 3; + gCurrentPinballGame->modeProgressLights[gCurrentPinballGame->creatureHitCount - 1] = MODE_PROGRESS_LAMP_CATCH_LIT; gCurrentPinballGame->captureState = MON_CAPTURE_SPECIAL_STATE_CAPTURE_CUTSCENE; gCurrentPinballGame->captureSequenceFrame = 0; gCurrentPinballGame->scoreAddedInFrame = SCORE_CATCH_HIT; } else { - gCurrentPinballGame->catchLights[gCurrentPinballGame->creatureHitCount - 1] = 3; + gCurrentPinballGame->modeProgressLights[gCurrentPinballGame->creatureHitCount - 1] = MODE_PROGRESS_LAMP_CATCH_LIT; gCurrentPinballGame->captureState = MON_CAPTURE_SPECIAL_STATE_MON_HIT_IN_CATCH_MODE; gCurrentPinballGame->scoreAddedInFrame = SCORE_CATCH_HIT; } diff --git a/src/all_board_process7.c b/src/all_board_process7.c index c14c9a0f..ef753b2e 100644 --- a/src/all_board_process7.c +++ b/src/all_board_process7.c @@ -78,7 +78,7 @@ void UpdateFrameProcess7_DrawBall_MainBoards(void) oamData->priority = currentBallState->oamPriority; r8 = r8; // this fools the compiler into thinking r8 holds something that could need sign extending/truncation - DmaCopy16(3, gBallRotationTileGraphics[r8 + gCurrentPinballGame->ballUpgradeType * 17], (void *)OBJ_VRAM0 + 0x400, 0x80); + DmaCopy16(3, gBallRotationTileGraphics[r8 + gCurrentPinballGame->ballUpgradeType * 17], OBJ_TILE_ADDR(TILE_INDEX(0, 1, 0)), 0x80); if (spriteGroup->baseY > 200) spriteGroup->baseY = 200; @@ -119,7 +119,7 @@ void UpdateFrameProcess7_DrawBall_MainBoards(void) else oamData->priority = currentBallState->oamPriority; - DmaCopy16(3, gBallRotationTileGraphics[r8 + gCurrentPinballGame->ballUpgradeType * 17], (void *)OBJ_VRAM0 + 0x400, 0x80); + DmaCopy16(3, gBallRotationTileGraphics[r8 + gCurrentPinballGame->ballUpgradeType * 17], OBJ_TILE_ADDR(TILE_INDEX(0, 1, 0)), 0x80); if (spriteGroup->baseY > 200) spriteGroup->baseY = 200; @@ -215,7 +215,7 @@ void UpdateFrameProcess7_DrawBall_MainBoards(void) } newIx = gCurrentPinballGame->ballUpgradeFxTileIndex; - DmaCopy16(3, gBallUpgradeFx_Gfx[newIx], (void *)0x6011EE0, 0x200); + DmaCopy16(3, gBallUpgradeFx_Gfx[newIx], OBJ_TILE_ADDR(TILE_INDEX(0, 7, 23)), 0x200); oam = &spriteGroup->oam[0]; @@ -268,7 +268,7 @@ void UpdateFrameProcess7_DrawBall_BonusBoards() } r5 = gCurrentPinballGame->ball->spinAngle >> 12; - DmaCopy16(3, &gBallRotationTileGraphics[r5 + gCurrentPinballGame->ballUpgradeType * 17], (void *)OBJ_VRAM0 + 0x400, 0x80); + DmaCopy16(3, &gBallRotationTileGraphics[r5 + gCurrentPinballGame->ballUpgradeType * 17], OBJ_TILE_ADDR(TILE_INDEX(0, 1, 0)), 0x80); primaryBall->positionQ0.x = primaryBall->positionQ1.x / 2; primaryBall->positionQ0.y = primaryBall->positionQ1.y / 2; @@ -335,7 +335,7 @@ void UpdateFrameProcess7_DrawBall_BonusBoards() if (gCurrentPinballGame->ballRespawnTimer > 149) { r5 = ((gCurrentPinballGame->ballRespawnTimer - 150) % 66) / 6; - DmaCopy16(3, &gBallSpawnGlowTiles_Type1[r5], (void *)OBJ_VRAM0 + 0x720, 0x200); + DmaCopy16(3, &gBallSpawnGlowTiles_Type1[r5], OBJ_TILE_ADDR(TILE_INDEX(0, 1, 25)), 0x200); primaryBall->spinSpeed -= 40; } @@ -378,7 +378,7 @@ void UpdateFrameProcess7_DrawBall_BonusBoards() if (gCurrentPinballGame->ballRespawnTimer > 4) { r5 = ((gCurrentPinballGame->ballRespawnTimer - 5) % 63 / 7); - DmaCopy16(3, &gBallSpawnGlowTiles_Type2[r5], (void *)OBJ_VRAM0 + 0x720, 0x200); + DmaCopy16(3, &gBallSpawnGlowTiles_Type2[r5], OBJ_TILE_ADDR(TILE_INDEX(0, 1, 25)), 0x200); primaryBall->spinSpeed -= 20; } diff --git a/src/all_board_process8.c b/src/all_board_process8.c index 8b3fda86..b1b068fe 100644 --- a/src/all_board_process8.c +++ b/src/all_board_process8.c @@ -160,7 +160,7 @@ void UpdateFrameProcess8_HudUpdate_AllBoards(void) gBG0TilemapBuffer[0x7FD] = 0xC19F; } - DmaCopy16(3, &gBG0TilemapBuffer[0x7C0], (void *)0x06002F80, 0x80); + DmaCopy16(3, &gBG0TilemapBuffer[0x7C0], BG_TILE_ADDR(TILE_INDEX(0, 11, 28)), 0x80); } void ProcessEventTimer(void) @@ -193,7 +193,7 @@ void ProcessEventTimer(void) gBG0TilemapBuffer[0x199 + i] = 0x1FF; } - DmaCopy16(3, &gBG0TilemapBuffer[0x160], (void *)0x060022C0, 0x80); + DmaCopy16(3, &gBG0TilemapBuffer[0x160], BG_TILE_ADDR(TILE_INDEX(0, 8, 22)), 0x80); gCurrentPinballGame->eventTimerType = EVENT_TIMER_MODE_NONE; gCurrentPinballGame->eventTimer = 0; } @@ -211,7 +211,7 @@ void ProcessEventTimer(void) gBG0TilemapBuffer[i + 0x199] = timerDisplayChar[i] * 2 - 0x3EC0 + 1; } } - DmaCopy16(3, &gBG0TilemapBuffer[0x160], (void *)0x060022C0, 0x80); + DmaCopy16(3, &gBG0TilemapBuffer[0x160],BG_TILE_ADDR(TILE_INDEX(0, 8, 22)), 0x80); } if (gCurrentPinballGame->eventTimer <= TIMER_TEXT_RED_UNDER_TIME) @@ -253,5 +253,5 @@ void ResetEventState(void) gBG0TilemapBuffer[0x199 + i] = 0x1FF; } - DmaCopy16(3, &gBG0TilemapBuffer[0x160], (void *)0x060022C0, 0x80); + DmaCopy16(3, &gBG0TilemapBuffer[0x160], BG_TILE_ADDR(TILE_INDEX(0, 8, 22)), 0x80); } diff --git a/src/all_board_setup.c b/src/all_board_setup.c index 1cefd713..42d4a56c 100644 --- a/src/all_board_setup.c +++ b/src/all_board_setup.c @@ -78,110 +78,116 @@ void loadFieldBoardGraphics(void) { case FIELD_RUBY: DmaCopy16(3, gRubyBoard_Pals, BG_PLTT, BG_PLTT_SIZE); - DmaCopy16(3, gRubyBoardBGTiles, BG_CHAR_SCREEN_ADDR(2,0), 2*BG_CHAR_SIZE); - DmaCopy16(3, gRubyBoardBGTilemap, BG_CHAR_SCREEN_ADDR(0,6), 2*BG_SCREEN_SIZE); + DmaCopy16(3, gRubyBoardBGTiles, BG_TILE_ADDR(TILE_INDEX(2,0,0)), 2*BG_CHAR_SIZE); + DmaCopy16(3, gRubyBoardBGTilemap, BG_TILE_ADDR(TILE_INDEX(0,12,0)), 2*BG_SCREEN_SIZE); LZ77UnCompWram(gRubyBoardCompressedTiles1, gBoardGfxBuffer); - DmaCopy16(3, gBoardGfxBuffer, BG_CHAR_SCREEN_ADDR(1,0), BG_CHAR_SIZE); + DmaCopy16(3, gBoardGfxBuffer, BG_TILE_ADDR(TILE_INDEX(1,0,0)), BG_CHAR_SIZE); LZ77UnCompWram(gRubyBoardCompressedTiles2, gBoardGfxBuffer); LZ77UnCompWram(gRubyBoardCompressedBGTileBuffer, gBoardBGTileBufferAlt); - DmaCopy16(3, &gBoardGfxBuffer[0xC00], (void *)0x0600B400, 0x2400); - DmaCopy16(3, &gBoardGfxBuffer[0x3000], BG_CHAR_SCREEN_ADDR(2,0), 0x3400); - DmaCopy16(3, gRubyBoardBG0Tilemap, BG_CHAR_SCREEN_ADDR(0,0), 2*BG_SCREEN_SIZE); - DmaCopy16(3, gRubyBoardBG1Tilemap, BG_CHAR_SCREEN_ADDR(0,2), 2*BG_SCREEN_SIZE); - DmaCopy16(3, gBoardHudTiles_A, (void *)0x06006800, 0x400); - DmaCopy16(3, gBoardHudTiles_B, (void *)0x06006C00, 0x800); - DmaCopy16(3, gRubyIntroSprites_Gfx, (void *)0x06010000, 0x8000); + + // Initialize section with the board's 'Tile wrap' logic + DmaCopy16(3, &gBoardGfxBuffer[0xC00], BG_ADDR_FOR_BOARD_WRAP(2, 0), 0x2400); + DmaCopy16(3, &gBoardGfxBuffer[0x3000], BG_TILE_ADDR(TILE_INDEX(2,0,0)), 0x3400); + + DmaCopy16(3, gRubyBoardBG0Tilemap, BG_TILE_ADDR(TILE_INDEX(0,0,0)), 2*BG_SCREEN_SIZE); + DmaCopy16(3, gRubyBoardBG1Tilemap, BG_TILE_ADDR(TILE_INDEX(0,4,0)), 2*BG_SCREEN_SIZE); + DmaCopy16(3, gBoardHudTiles_A, BG_TILE_ADDR(TILE_INDEX(1, 10, 0)), 0x400); + DmaCopy16(3, gBoardHudTiles_B, BG_TILE_ADDR(TILE_INDEX(1, 11, 0)), 0x800); + DmaCopy16(3, gRubyIntroSprites_Gfx, OBJ_TILE_ADDR(TILE_INDEX(0,0,0)), 0x8000); break; case FIELD_SAPPHIRE: DmaCopy16(3, gSapphireBoardPalette, BG_PLTT, BG_PLTT_SIZE); - DmaCopy16(3, gSapphireBoardBGTiles, BG_CHAR_SCREEN_ADDR(2,0), 2*BG_CHAR_SIZE); - DmaCopy16(3, gSapphireBoardBGTilemap, BG_CHAR_SCREEN_ADDR(0,6), 2*BG_SCREEN_SIZE); + DmaCopy16(3, gSapphireBoardBGTiles, BG_TILE_ADDR(TILE_INDEX(2,0,0)), 2*BG_CHAR_SIZE); + DmaCopy16(3, gSapphireBoardBGTilemap, BG_TILE_ADDR(TILE_INDEX(0,12,0)), 2*BG_SCREEN_SIZE); LZ77UnCompWram(gSapphireBoardCompressedTiles1, gBoardGfxBuffer); - DmaCopy16(3, gBoardGfxBuffer, BG_CHAR_SCREEN_ADDR(1,0), BG_CHAR_SIZE); + DmaCopy16(3, gBoardGfxBuffer, BG_TILE_ADDR(TILE_INDEX(1,0,0)), BG_CHAR_SIZE); LZ77UnCompWram(gSapphireBoardCompressedTiles2, gBoardGfxBuffer); LZ77UnCompWram(gSapphireBoardCompressedBGTileBuffer, gBoardBGTileBufferAlt); - DmaCopy16(3, gBoardGfxBuffer, (void *)0x0600A800, 0x3000); - DmaCopy16(3, &gBoardGfxBuffer[0x3000], BG_CHAR_SCREEN_ADDR(2,0), 0x2800); - DmaCopy16(3, gSapphireBoardBG0Tilemap, BG_CHAR_SCREEN_ADDR(0,0), 2*BG_SCREEN_SIZE); - DmaCopy16(3, gSapphireBoardBG1Tilemap, BG_CHAR_SCREEN_ADDR(0,2), 2*BG_SCREEN_SIZE); - DmaCopy16(3, gBoardHudTiles_A, (void *)0x06006800, 0x400); - DmaCopy16(3, gBoardHudTiles_B, (void *)0x06006C00, 0x800); - DmaCopy16(3, gSapphireIntroSprites_Gfx, (void *)0x06010000, 0x8000); + + // Initialize section with the board's 'Tile wrap' logic + DmaCopy16(3, gBoardGfxBuffer, BG_ADDR_FOR_BOARD_WRAP(-1, 0), 0x3000); + DmaCopy16(3, &gBoardGfxBuffer[0x3000], BG_TILE_ADDR(TILE_INDEX(2,0,0)), 0x2800); + + DmaCopy16(3, gSapphireBoardBG0Tilemap, BG_TILE_ADDR(TILE_INDEX(0,0,0)), 2*BG_SCREEN_SIZE); + DmaCopy16(3, gSapphireBoardBG1Tilemap, BG_TILE_ADDR(TILE_INDEX(0,4,0)), 2*BG_SCREEN_SIZE); + DmaCopy16(3, gBoardHudTiles_A, BG_TILE_ADDR(TILE_INDEX(1, 10, 0)), 0x400); + DmaCopy16(3, gBoardHudTiles_B, BG_TILE_ADDR(TILE_INDEX(1, 11, 0)), 0x800); + DmaCopy16(3, gSapphireIntroSprites_Gfx, OBJ_TILE_ADDR(TILE_INDEX(0,0,0)), 0x8000); break; case FIELD_DUSCLOPS: DmaCopy16(3, gDusclopsBoardPalette, BG_PLTT, BG_PLTT_SIZE); LZ77UnCompWram(gBonusFieldCompressedBaseTiles, gBoardGfxBuffer); - DmaCopy16(3, gBoardGfxBuffer, BG_CHAR_SCREEN_ADDR(1,0), BG_CHAR_SIZE); + DmaCopy16(3, gBoardGfxBuffer, BG_TILE_ADDR(TILE_INDEX(1,0,0)), BG_CHAR_SIZE); LZ77UnCompWram(gDusclopsBoardCompressedBGTiles, gBoardGfxBuffer); - DmaCopy16(3, gBoardGfxBuffer, BG_CHAR_SCREEN_ADDR(2,0), 2*BG_CHAR_SIZE); - DmaCopy16(3, gDusclopsBoardBG0Tilemap, BG_CHAR_SCREEN_ADDR(0,0), BG_SCREEN_SIZE); - DmaCopy16(3, gDusclopsBoardBG1Tilemap, BG_CHAR_SCREEN_ADDR(0,1), BG_SCREEN_SIZE); - DmaCopy16(3, gDusclopsBoardBG2Tilemap, BG_CHAR_SCREEN_ADDR(0,2), BG_SCREEN_SIZE); - DmaCopy16(3, gBoardHudTiles_A, (void *)0x06006800, 0x400); - DmaCopy16(3, gBoardHudTiles_B, (void *)0x06006C00, 0x800); - DmaCopy16(3, gDusclopsIntroSprite_Gfx, (void *)0x06010000, 0x8000); + DmaCopy16(3, gBoardGfxBuffer, BG_TILE_ADDR(TILE_INDEX(2,0,0)), 2*BG_CHAR_SIZE); + DmaCopy16(3, gDusclopsBoardBG0Tilemap, BG_TILE_ADDR(TILE_INDEX(0,0,0)), BG_SCREEN_SIZE); + DmaCopy16(3, gDusclopsBoardBG1Tilemap, BG_TILE_ADDR(TILE_INDEX(0,2,0)), BG_SCREEN_SIZE); + DmaCopy16(3, gDusclopsBoardBG2Tilemap, BG_TILE_ADDR(TILE_INDEX(0,4,0)), BG_SCREEN_SIZE); + DmaCopy16(3, gBoardHudTiles_A, BG_TILE_ADDR(TILE_INDEX(1, 10, 0)), 0x400); + DmaCopy16(3, gBoardHudTiles_B, BG_TILE_ADDR(TILE_INDEX(1, 11, 0)), 0x800); + DmaCopy16(3, gDusclopsIntroSprite_Gfx, OBJ_TILE_ADDR(TILE_INDEX(0,0,0)), 0x8000); break; case FIELD_KECLEON: DmaCopy16(3, gKecleonBoardPalette, BG_PLTT, BG_PLTT_SIZE); LZ77UnCompWram(gBonusFieldCompressedBaseTiles, gBoardGfxBuffer); - DmaCopy16(3, gBoardGfxBuffer, BG_CHAR_SCREEN_ADDR(1,0), BG_CHAR_SIZE); + DmaCopy16(3, gBoardGfxBuffer, BG_TILE_ADDR(TILE_INDEX(1,0,0)), BG_CHAR_SIZE); LZ77UnCompWram(gKecleonBoardCompressedBGTiles, gBoardGfxBuffer); - DmaCopy16(3, gBoardGfxBuffer, BG_CHAR_SCREEN_ADDR(2,0), 2*BG_CHAR_SIZE); - DmaCopy16(3, gKecleonBoardBG0Tilemap, BG_CHAR_SCREEN_ADDR(0,0), BG_SCREEN_SIZE); - DmaCopy16(3, gKecleonBoardBG1Tilemap, BG_CHAR_SCREEN_ADDR(0,1), BG_SCREEN_SIZE); - DmaCopy16(3, gKecleonBerryOverlayTilemap, BG_CHAR_SCREEN_ADDR(0,2), BG_SCREEN_SIZE); - DmaCopy16(3, gBoardHudTiles_A, (void *)0x06006800, 0x400); - DmaCopy16(3, gBoardHudTiles_B, (void *)0x06006C00, 0x800); - DmaCopy16(3, gKecleonIntroSprite_Gfx, (void *)0x06010000, 0x8000); + DmaCopy16(3, gBoardGfxBuffer, BG_TILE_ADDR(TILE_INDEX(2,0,0)), 2*BG_CHAR_SIZE); + DmaCopy16(3, gKecleonBoardBG0Tilemap, BG_TILE_ADDR(TILE_INDEX(0,0,0)), BG_SCREEN_SIZE); + DmaCopy16(3, gKecleonBoardBG1Tilemap, BG_TILE_ADDR(TILE_INDEX(0,2,0)), BG_SCREEN_SIZE); + DmaCopy16(3, gKecleonBerryOverlayTilemap, BG_TILE_ADDR(TILE_INDEX(0,4,0)), BG_SCREEN_SIZE); + DmaCopy16(3, gBoardHudTiles_A, BG_TILE_ADDR(TILE_INDEX(1, 10, 0)), 0x400); + DmaCopy16(3, gBoardHudTiles_B, BG_TILE_ADDR(TILE_INDEX(1, 11, 0)), 0x800); + DmaCopy16(3, gKecleonIntroSprite_Gfx, OBJ_TILE_ADDR(TILE_INDEX(0,0,0)), 0x8000); break; case FIELD_KYOGRE: DmaCopy16(3, gKyogreBoardPalette, BG_PLTT, BG_PLTT_SIZE); LZ77UnCompWram(gBonusFieldCompressedBaseTiles, gBoardGfxBuffer); - DmaCopy16(3, gBoardGfxBuffer, BG_CHAR_SCREEN_ADDR(1,0), BG_CHAR_SIZE); + DmaCopy16(3, gBoardGfxBuffer, BG_TILE_ADDR(TILE_INDEX(1,0,0)), BG_CHAR_SIZE); LZ77UnCompWram(gKyogreBoardCompressedBGTiles, gBoardGfxBuffer); - DmaCopy16(3, gBoardGfxBuffer, BG_CHAR_SCREEN_ADDR(2,0), 2*BG_CHAR_SIZE); - DmaCopy16(3, gKyogreWaterBackgroundTilemap, BG_CHAR_SCREEN_ADDR(0,0), BG_SCREEN_SIZE); - DmaCopy16(3, gKyogreBoardBG1Tilemap, BG_CHAR_SCREEN_ADDR(0,1), BG_SCREEN_SIZE); - DmaCopy16(3, gBoardHudTiles_A, (void *)0x06006800, 0x400); - DmaCopy16(3, gBoardHudTiles_B, (void *)0x06006C00, 0x800); - DmaCopy16(3, gKyogreIntroSprite_Gfx, (void *)0x06010000, 0x8000); + DmaCopy16(3, gBoardGfxBuffer, BG_TILE_ADDR(TILE_INDEX(2,0,0)), 2*BG_CHAR_SIZE); + DmaCopy16(3, gKyogreWaterBackgroundTilemap, BG_TILE_ADDR(TILE_INDEX(0,0,0)), BG_SCREEN_SIZE); + DmaCopy16(3, gKyogreBoardBG1Tilemap, BG_TILE_ADDR(TILE_INDEX(0,2,0)), BG_SCREEN_SIZE); + DmaCopy16(3, gBoardHudTiles_A, BG_TILE_ADDR(TILE_INDEX(1, 10, 0)), 0x400); + DmaCopy16(3, gBoardHudTiles_B, BG_TILE_ADDR(TILE_INDEX(1, 11, 0)), 0x800); + DmaCopy16(3, gKyogreIntroSprite_Gfx, OBJ_TILE_ADDR(TILE_INDEX(0,0,0)), 0x8000); break; case FIELD_GROUDON: DmaCopy16(3, gGroudonLavaPaletteCycleData, BG_PLTT, BG_PLTT_SIZE); LZ77UnCompWram(gBonusFieldCompressedBaseTiles, gBoardGfxBuffer); - DmaCopy16(3, gBoardGfxBuffer, BG_CHAR_SCREEN_ADDR(1,0), BG_CHAR_SIZE); + DmaCopy16(3, gBoardGfxBuffer, BG_TILE_ADDR(TILE_INDEX(1,0,0)), BG_CHAR_SIZE); LZ77UnCompWram(gGroudonBoardCompressedBGTiles, gBoardGfxBuffer); - DmaCopy16(3, gBoardGfxBuffer, BG_CHAR_SCREEN_ADDR(2,0), 2*BG_CHAR_SIZE); - DmaCopy16(3, gGroudonBoardBG0Tilemap, BG_CHAR_SCREEN_ADDR(0,0), BG_SCREEN_SIZE); - DmaCopy16(3, gGroudonBoardBG1Tilemap, BG_CHAR_SCREEN_ADDR(0,1), BG_SCREEN_SIZE); - DmaCopy16(3, gBoardHudTiles_A, (void *)0x06006800, 0x400); - DmaCopy16(3, gBoardHudTiles_B, (void *)0x06006C00, 0x800); - DmaCopy16(3, gGroudonIntroSprite_Gfx, (void *)0x06010000, 0x8000); + DmaCopy16(3, gBoardGfxBuffer, BG_TILE_ADDR(TILE_INDEX(2,0,0)), 2*BG_CHAR_SIZE); + DmaCopy16(3, gGroudonBoardBG0Tilemap, BG_TILE_ADDR(TILE_INDEX(0,0,0)), BG_SCREEN_SIZE); + DmaCopy16(3, gGroudonBoardBG1Tilemap, BG_TILE_ADDR(TILE_INDEX(0,2,0)), BG_SCREEN_SIZE); + DmaCopy16(3, gBoardHudTiles_A, BG_TILE_ADDR(TILE_INDEX(1, 10, 0)), 0x400); + DmaCopy16(3, gBoardHudTiles_B, BG_TILE_ADDR(TILE_INDEX(1, 11, 0)), 0x800); + DmaCopy16(3, gGroudonIntroSprite_Gfx, OBJ_TILE_ADDR(TILE_INDEX(0,0,0)), 0x8000); break; case FIELD_RAYQUAZA: DmaCopy16(3, gRayquazaBoardPalette, BG_PLTT, BG_PLTT_SIZE); LZ77UnCompWram(gBonusFieldCompressedBaseTiles, gBoardGfxBuffer); - DmaCopy16(3, gBoardGfxBuffer, BG_CHAR_SCREEN_ADDR(1,0), BG_CHAR_SIZE); + DmaCopy16(3, gBoardGfxBuffer, BG_TILE_ADDR(TILE_INDEX(1,0,0)), BG_CHAR_SIZE); LZ77UnCompWram(gRayquazaBoardCompressedBGTiles, gBoardGfxBuffer); - DmaCopy16(3, gBoardGfxBuffer, BG_CHAR_SCREEN_ADDR(2,0), 2*BG_CHAR_SIZE); - DmaCopy16(3, gRayquazaBoardBG0Tilemap, BG_CHAR_SCREEN_ADDR(0,0), 2*BG_SCREEN_SIZE); - DmaCopy16(3, gRayquazaBoardBG1Tilemap, BG_CHAR_SCREEN_ADDR(0,2), 2*BG_SCREEN_SIZE); - DmaCopy16(3, gRayquazaBoardBGScrollTilemap, BG_CHAR_SCREEN_ADDR(0,6), 2*BG_SCREEN_SIZE); - DmaCopy16(3, gBoardHudTiles_A, (void *)0x06006800, 0x400); - DmaCopy16(3, gBoardHudTiles_B, (void *)0x06006C00, 0x800); - DmaCopy16(3, gRayquazaIntroSprite_Gfx, (void *)0x06010000, 0x8000); + DmaCopy16(3, gBoardGfxBuffer, BG_TILE_ADDR(TILE_INDEX(2,0,0)), 2*BG_CHAR_SIZE); + DmaCopy16(3, gRayquazaBoardBG0Tilemap, BG_TILE_ADDR(TILE_INDEX(0,0,0)), 2*BG_SCREEN_SIZE); + DmaCopy16(3, gRayquazaBoardBG1Tilemap, BG_TILE_ADDR(TILE_INDEX(0,4,0)), 2*BG_SCREEN_SIZE); + DmaCopy16(3, gRayquazaBoardBGScrollTilemap, BG_TILE_ADDR(TILE_INDEX(0,12,0)), 2*BG_SCREEN_SIZE); + DmaCopy16(3, gBoardHudTiles_A, BG_TILE_ADDR(TILE_INDEX(1, 10, 0)), 0x400); + DmaCopy16(3, gBoardHudTiles_B, BG_TILE_ADDR(TILE_INDEX(1, 11, 0)), 0x800); + DmaCopy16(3, gRayquazaIntroSprite_Gfx, OBJ_TILE_ADDR(TILE_INDEX(0,0,0)), 0x8000); break; case FIELD_SPHEAL: DmaCopy16(3, gSphealBoardPalette, BG_PLTT, BG_PLTT_SIZE); LZ77UnCompWram(gBonusFieldCompressedBaseTiles, gBoardGfxBuffer); - DmaCopy16(3, gBoardGfxBuffer, BG_CHAR_SCREEN_ADDR(1,0), BG_CHAR_SIZE); + DmaCopy16(3, gBoardGfxBuffer, BG_TILE_ADDR(TILE_INDEX(1,0,0)), BG_CHAR_SIZE); LZ77UnCompWram(gSphealBoardCompressedBGTiles, gBoardGfxBuffer); - DmaCopy16(3, gBoardGfxBuffer, BG_CHAR_SCREEN_ADDR(2,0), 2*BG_CHAR_SIZE); - DmaCopy16(3, gSphealWaterBackgroundTilemap, BG_CHAR_SCREEN_ADDR(0,0), BG_SCREEN_SIZE); - DmaCopy16(3, gSphealBoardBG1Tilemap, BG_CHAR_SCREEN_ADDR(0,1), BG_SCREEN_SIZE); - DmaCopy16(3, gBoardHudTiles_A, (void *)0x06006800, 0x400); - DmaCopy16(3, gBoardHudTiles_B, (void *)0x06006C00, 0x800); - DmaCopy16(3, gSphealIntroSprites_Gfx, (void *)0x06010000, 0x8000); + DmaCopy16(3, gBoardGfxBuffer, BG_TILE_ADDR(TILE_INDEX(2,0,0)), 2*BG_CHAR_SIZE); + DmaCopy16(3, gSphealWaterBackgroundTilemap, BG_TILE_ADDR(TILE_INDEX(0,0,0)), BG_SCREEN_SIZE); + DmaCopy16(3, gSphealBoardBG1Tilemap, BG_TILE_ADDR(TILE_INDEX(0,2,0)), BG_SCREEN_SIZE); + DmaCopy16(3, gBoardHudTiles_A, BG_TILE_ADDR(TILE_INDEX(1, 10, 0)), 0x400); + DmaCopy16(3, gBoardHudTiles_B, BG_TILE_ADDR(TILE_INDEX(1, 11, 0)), 0x800); + DmaCopy16(3, gSphealIntroSprites_Gfx, OBJ_TILE_ADDR(TILE_INDEX(0,0,0)), 0x8000); break; } @@ -209,22 +215,22 @@ void UpdateScrollingBackgroundTiles(void) { if (r3[0] > 31) { - DmaCopy16(3, &gBoardBGTileBufferAlt[(r3[0] - 32) * 0x400], BG_CHAR_SCREEN_ADDR(2,0) + r3[1] * 0x400, 0x400); + DmaCopy16(3, &gBoardBGTileBufferAlt[(r3[0] - 32) * 0x400], BG_TILE_ADDR(TILE_INDEX(2,r3[1],0)), 0x400); } else { - DmaCopy16(3, &gBoardGfxBuffer[r3[0] * 0x400], BG_CHAR_SCREEN_ADDR(2,0) + r3[1] * 0x400, 0x400); + DmaCopy16(3, &gBoardGfxBuffer[r3[0] * 0x400], BG_TILE_ADDR(TILE_INDEX(2,r3[1],0)), 0x400); } } else { if (r3[2] > 31) { - DmaCopy16(3, &gBoardBGTileBufferAlt[(r3[2] - 32) * 0x400], BG_CHAR_SCREEN_ADDR(2,0) + r3[3] * 0x400, 0x400); + DmaCopy16(3, &gBoardBGTileBufferAlt[(r3[2] - 32) * 0x400], BG_TILE_ADDR(TILE_INDEX(2,r3[3],0)), 0x400); } else { - DmaCopy16(3, &gBoardGfxBuffer[r3[2] * 0x400], BG_CHAR_SCREEN_ADDR(2,0) + r3[3] * 0x400, 0x400); + DmaCopy16(3, &gBoardGfxBuffer[r3[2] * 0x400], BG_TILE_ADDR(TILE_INDEX(2,r3[3],0)), 0x400); } } diff --git a/src/bonus_complete_scoring_transition.c b/src/bonus_complete_scoring_transition.c index a3c947cb..0301ecc4 100644 --- a/src/bonus_complete_scoring_transition.c +++ b/src/bonus_complete_scoring_transition.c @@ -150,42 +150,47 @@ void ProcessBonusBannerAndScoring(void) case FIELD_DUSCLOPS: for (i = 0; i < 8; i++) { - DmaCopy16(3, &gDusclopsBonusClear_Gfx[(scoreCharacter[i] + 0x70) * 0x40], (void *)0x06017000 + ((i * 2) + 12) * 0x20, 0x40); + DmaCopy16(3, &gDusclopsBonusClear_Gfx[(scoreCharacter[i] + 0x70) * 0x40], + OBJ_TILE_ADDR(TILE_INDEX(1, 12, (i * 2) + 12)), 0x40); } scoreMultTileIx = gCurrentPinballGame->ballUpgradeType + 0x71; - DmaCopy16(3, &gDusclopsBonusClear_Gfx[scoreMultTileIx * 0x40], (void *)0x06017380, 0x40); + DmaCopy16(3, &gDusclopsBonusClear_Gfx[scoreMultTileIx * 0x40], OBJ_TILE_ADDR(TILE_INDEX(1, 12, 28)), 0x40); break; case FIELD_KECLEON: for (i = 0; i < 8; i++) { - DmaCopy16(3, &gKecleonBonusClear_Gfx[(scoreCharacter[i] + 0x70) * 0x40], (void *)0x06017000 + ((i * 2) + 12) * 0x20, 0x40); + DmaCopy16(3, &gKecleonBonusClear_Gfx[(scoreCharacter[i] + 0x70) * 0x40], + OBJ_TILE_ADDR(TILE_INDEX(1, 12, (i * 2) + 12)), 0x40); } scoreMultTileIx = gCurrentPinballGame->ballUpgradeType + 0x71; - DmaCopy16(3, &gKecleonBonusClear_Gfx[scoreMultTileIx * 0x40], (void *)0x06017380, 0x40); + DmaCopy16(3, &gKecleonBonusClear_Gfx[scoreMultTileIx * 0x40], OBJ_TILE_ADDR(TILE_INDEX(1, 12, 28)), 0x40); break; case FIELD_KYOGRE: for (i = 0; i < 8; i++) { - DmaCopy16(3, &gKyogreBonusClear_Gfx[(scoreCharacter[i] + 0x70) * 0x40], (void *)0x06017000 + ((i * 2) + 12) * 0x20, 0x40); + DmaCopy16(3, &gKyogreBonusClear_Gfx[(scoreCharacter[i] + 0x70) * 0x40], + OBJ_TILE_ADDR(TILE_INDEX(1, 12, (i * 2) + 12)), 0x40); } scoreMultTileIx = gCurrentPinballGame->ballUpgradeType + 0x71; - DmaCopy16(3, &gKyogreBonusClear_Gfx[scoreMultTileIx * 0x40], (void *)0x06017380, 0x40); + DmaCopy16(3, &gKyogreBonusClear_Gfx[scoreMultTileIx * 0x40], OBJ_TILE_ADDR(TILE_INDEX(1, 12, 28)), 0x40); break; case FIELD_GROUDON: for (i = 0; i < 8; i++) { - DmaCopy16(3, &gGroudonBonusClear_Gfx[(scoreCharacter[i] + 0x70) * 0x40], (void *)0x06017000 + ((i * 2) + 12) * 0x20, 0x40); + DmaCopy16(3, &gGroudonBonusClear_Gfx[(scoreCharacter[i] + 0x70) * 0x40], + OBJ_TILE_ADDR(TILE_INDEX(1, 12, (i * 2) + 12)), 0x40); } scoreMultTileIx = gCurrentPinballGame->ballUpgradeType + 0x71; - DmaCopy16(3, &gGroudonBonusClear_Gfx[scoreMultTileIx* 0x40], (void *)0x06017380, 0x40); + DmaCopy16(3, &gGroudonBonusClear_Gfx[scoreMultTileIx* 0x40], OBJ_TILE_ADDR(TILE_INDEX(1, 12, 28)), 0x40); break; case FIELD_RAYQUAZA: for (i = 0; i < 8; i++) { - DmaCopy16(3, &gRayquazaBonusClear_Gfx[(scoreCharacter[i] + 0x70) * 0x40], (void *)0x06017000 + ((i * 2) + 12) * 0x20, 0x40); + DmaCopy16(3, &gRayquazaBonusClear_Gfx[(scoreCharacter[i] + 0x70) * 0x40], + OBJ_TILE_ADDR(TILE_INDEX(1, 12, (i * 2) + 12)), 0x40); } scoreMultTileIx = gCurrentPinballGame->ballUpgradeType + 0x71; - DmaCopy16(3, &gRayquazaBonusClear_Gfx[scoreMultTileIx * 0x40], (void *)0x06017380, 0x40); + DmaCopy16(3, &gRayquazaBonusClear_Gfx[scoreMultTileIx * 0x40], OBJ_TILE_ADDR(TILE_INDEX(1, 12, 28)), 0x40); break; } } diff --git a/src/bonus_field_select.c b/src/bonus_field_select.c index 3ab5edc9..11a2211a 100644 --- a/src/bonus_field_select.c +++ b/src/bonus_field_select.c @@ -68,13 +68,13 @@ void LoadBonusFieldSelectGraphics(void) gMain.dispcntBackup = REG_DISPCNT; DmaCopy16(3, gBonusFieldSelectStages_Pals, BG_PLTT, BG_PLTT_SIZE); - DmaCopy16(3, gFieldSelectWindow_Gfx, BG_CHAR_ADDR(1), BG_CHAR_SIZE); - DmaCopy16(3, gBonusFieldSelectStages_Gfx, BG_CHAR_ADDR(2), 3*BG_SCREEN_SIZE); - DmaCopy16(3, gBonusFieldSelectBg0_Tilemap, BG_CHAR_ADDR(0), BG_SCREEN_SIZE); - DmaCopy16(3, gBonusFieldSelectBg1_Tilemap, BG_CHAR_SCREEN_ADDR(0,1), BG_SCREEN_SIZE); - DmaCopy16(3, gBonusFieldSelectBg2_Tilemap, BG_CHAR_SCREEN_ADDR(0,2), BG_SCREEN_SIZE); + DmaCopy16(3, gFieldSelectWindow_Gfx, BG_TILE_ADDR(TILE_INDEX(1,0,0)), BG_CHAR_SIZE); + DmaCopy16(3, gBonusFieldSelectStages_Gfx, BG_TILE_ADDR(TILE_INDEX(2,0,0)), 3*BG_SCREEN_SIZE); + DmaCopy16(3, gBonusFieldSelectBg0_Tilemap, BG_TILE_ADDR(TILE_INDEX(0,0,0)), BG_SCREEN_SIZE); + DmaCopy16(3, gBonusFieldSelectBg1_Tilemap, BG_TILE_ADDR(TILE_INDEX(0,2,0)), BG_SCREEN_SIZE); + DmaCopy16(3, gBonusFieldSelectBg2_Tilemap, BG_TILE_ADDR(TILE_INDEX(0,4,0)), BG_SCREEN_SIZE); DmaCopy16(3, gFieldSelectSpritePals, OBJ_PLTT_SLOT(PAL_IX_0), 3*PLTT_SLOT_SIZE); - DmaCopy16(3, gFieldSelectSpriteGfx, OBJ_VRAM0, 0x4020); + DmaCopy16(3, gFieldSelectSpriteGfx, OBJ_TILE_ADDR(TILE_INDEX(0,0,0)), 0x4020); EnableVBlankInterrupts(); InitBonusFieldSelectState(); diff --git a/src/dusclops_process3.c b/src/dusclops_process3.c index 37495bad..354485ba 100644 --- a/src/dusclops_process3.c +++ b/src/dusclops_process3.c @@ -143,7 +143,7 @@ void UpdateFrameProcess3_BoardLogic_DusclopsBoard(void) gCurrentPinballGame->stageTimer = 0; gMain.spriteGroups[SG_BONUS_COMPLETE_BANNER].active = TRUE; gMain.spriteGroups[SG_BONUS_COMPLETE_BANNER_SCORE].active = TRUE; - DmaCopy16(3, gDusclopsBonusClear_Gfx, OBJ_VRAM1+0x1800, 8192); + DmaCopy16(3, gDusclopsBonusClear_Gfx, OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x2000); gCurrentPinballGame->bannerSlideYOffset = 136; } break; @@ -566,7 +566,7 @@ void DuskullPhase_ProcessGraphics() { for (i = 0; i < DUSKULL_CONCURRENT_MAX; i++) { s16 spriteVariant = gCurrentPinballGame->minionSpriteVariant[i]; - DmaCopy16(3, gDusclopsBoardDuskull_Gfx + spriteVariant * 0x280, OBJ_VRAM0 + 0x920 + i * 0x280, 0x280); + DmaCopy16(3, gDusclopsBoardDuskull_Gfx + spriteVariant * 0x280, OBJ_TILE_ADDR(TILE_INDEX(0, 2, 9 + 20 * i)), 0x280); oamIx = gCurrentPinballGame->minionOamIx[i]; spriteGroup = &gMain.spriteGroups[SG_DUSKULL_ENTITY_BASE + i]; @@ -1008,7 +1008,7 @@ void DusclopsPhase_ProcessEntityLogicAndGraphics(void) break; } //End switch - DmaCopy16(3 , gDusclopsBoardDusclops_Gfx + tileOffset * 1024, (void *)OBJ_VRAM0+0x10a0, BG_SCREEN_SIZE); + DmaCopy16(3 , gDusclopsBoardDusclops_Gfx + tileOffset * 1024, OBJ_TILE_ADDR(TILE_INDEX(0, 4, 5)), BG_SCREEN_SIZE); gCurrentPinballGame->bossCollisionX = ((gCurrentPinballGame->bossPositionX / 10) * 2) + 16; gCurrentPinballGame->bossCollisionY = ((gCurrentPinballGame->bossPositionY / 10) * 2) + 16; @@ -1058,7 +1058,7 @@ void DusclopsPhase_ProcessEntityLogicAndGraphics(void) s16 i; u8 r1; r1 = gMain.systemFrameCount % 4; - DmaCopy16(3 , gDusclopsBoardDusclopsAppearFx_Gfx + r1 / 2 * 0x600, (void *)OBJ_VRAM0 + 0x1aa0, 0xc00); + DmaCopy16(3 , gDusclopsBoardDusclopsAppearFx_Gfx + r1 / 2 * 0x600, OBJ_TILE_ADDR(TILE_INDEX(0, 6, 21)), 0xc00); for (i = 0; i < 2; i++) { @@ -1090,7 +1090,7 @@ void DusclopsPhase_ProcessEntityLogicAndGraphics(void) else tileOffset = 2; - DmaCopy16(3 , gDusclopsBoardDusclopsBallGrabSwirl_Gfx + tileOffset * 0x200,(void *)OBJ_VRAM0+0x18a0, 0x200); + DmaCopy16(3 , gDusclopsBoardDusclopsBallGrabSwirl_Gfx + tileOffset * 0x200,OBJ_TILE_ADDR(TILE_INDEX(0, 6, 5)), 0x200); } else { diff --git a/src/ereader.c b/src/ereader.c index 54c604f4..f1db5fc9 100644 --- a/src/ereader.c +++ b/src/ereader.c @@ -78,10 +78,10 @@ void LoadEReaderGraphics(void) DmaCopy16(3, gEReaderBackground_Pals, BG_PLTT_SLOT(PAL_IX_0), 2*PLTT_SLOT_SIZE); DmaCopy16(3, gPokedexBackground_Pals[4], BG_PLTT_SLOT(PAL_IX_2), PLTT_SLOT_SIZE); DmaCopy16(3, gEReaderBackground_Gfx, gTempGfxBuffer, 6*BG_SCREEN_SIZE); - DmaCopy16(3, gEReaderText_Tilemap, BG_SCREEN_ADDR(0), BG_SCREEN_SIZE); - DmaCopy16(3, gEReaderOverlay_Tilemap, BG_SCREEN_ADDR(1), BG_SCREEN_SIZE); + DmaCopy16(3, gEReaderText_Tilemap, BG_TILE_ADDR(TILE_INDEX(0,0,0)), BG_SCREEN_SIZE); + DmaCopy16(3, gEReaderOverlay_Tilemap, BG_TILE_ADDR(TILE_INDEX(0,2,0)), BG_SCREEN_SIZE); DmaCopy16(3, gPokedexSprites_Pals, OBJ_PLTT_SLOT(PAL_IX_0), 6*PLTT_SLOT_SIZE); - DmaCopy16(3, gPokedexSprites_Gfx, OBJ_VRAM0, 0x6C20); + DmaCopy16(3, gPokedexSprites_Gfx, OBJ_TILE_ADDR(TILE_INDEX(0,0,0)), 0x6C20); InitEReaderTextState(); gEReaderTextCharIndex = 0; @@ -90,7 +90,7 @@ void LoadEReaderGraphics(void) gEReaderTextPageIndex = 0; ClearEReaderTextRows(); - DmaCopy16(3, gTempGfxBuffer, BG_CHAR_ADDR(1), 6*BG_SCREEN_SIZE); + DmaCopy16(3, gTempGfxBuffer, BG_TILE_ADDR(TILE_INDEX(1,0,0)), 6*BG_SCREEN_SIZE); UpdateEReaderSprites(); m4aSongNumStart(MUS_EREADER); @@ -157,7 +157,7 @@ void Ereader_ShowInstructions(void) gMain.subState = EREADER_STATE_RETURN_TO_MENU; } UpdateEReaderSprites(); - DmaCopy16(3, gTempGfxBuffer, BG_CHAR_ADDR(1), 6*BG_SCREEN_SIZE); + DmaCopy16(3, gTempGfxBuffer, BG_TILE_ADDR(TILE_INDEX(1,0,0)), 6*BG_SCREEN_SIZE); } void Ereader_AnimateLinkCable(void) @@ -293,7 +293,7 @@ void Ereader_ShowLinkTimeout(void) } } UpdateEReaderSprites(); - DmaCopy16(3, gTempGfxBuffer, BG_CHAR_ADDR(1), 6*BG_SCREEN_SIZE); + DmaCopy16(3, gTempGfxBuffer, BG_TILE_ADDR(TILE_INDEX(1,0,0)), 6*BG_SCREEN_SIZE); } void Ereader_CloseSuccessfulTransmission(void) @@ -342,10 +342,10 @@ void Ereader_ShowSuccessPopup(void) DmaCopy16(3, gEReaderBackground_Pals, BG_PLTT_SLOT(PAL_IX_0), 2*PLTT_SLOT_SIZE); DmaCopy16(3, gPokedexBackground_Pals[4], BG_PLTT_SLOT(PAL_IX_2), PLTT_SLOT_SIZE); DmaCopy16(3, gEReaderBackground_Gfx, gTempGfxBuffer, 6*BG_SCREEN_SIZE); - DmaCopy16(3, gEReaderText_Tilemap, BG_SCREEN_ADDR(0), BG_SCREEN_SIZE); - DmaCopy16(3, gEReaderOverlay_Tilemap, BG_SCREEN_ADDR(1), BG_SCREEN_SIZE); + DmaCopy16(3, gEReaderText_Tilemap, BG_TILE_ADDR(TILE_INDEX(0,0,0)), BG_SCREEN_SIZE); + DmaCopy16(3, gEReaderOverlay_Tilemap, BG_TILE_ADDR(TILE_INDEX(0,2,0)), BG_SCREEN_SIZE); DmaCopy16(3, gPokedexSprites_Pals, OBJ_PLTT_SLOT(PAL_IX_0), 6*PLTT_SLOT_SIZE); - DmaCopy16(3, gPokedexSprites_Gfx, OBJ_VRAM0, 0x6C20); + DmaCopy16(3, gPokedexSprites_Gfx, OBJ_TILE_ADDR(TILE_INDEX(0,0,0)), 0x6C20); InitEReaderTextState(); gEReaderTextCharIndex = 0; @@ -354,7 +354,7 @@ void Ereader_ShowSuccessPopup(void) gEReaderTextPageIndex = gEReaderCardStartPages[gEReaderCardIndex]; ClearEReaderTextRows(); - DmaCopy16(3, gTempGfxBuffer, BG_CHAR_ADDR(1), 6*BG_SCREEN_SIZE); + DmaCopy16(3, gTempGfxBuffer, BG_TILE_ADDR(TILE_INDEX(1,0,0)), 6*BG_SCREEN_SIZE); UpdateEReaderSprites(); m4aSongNumStart(MUS_EREADER); @@ -409,7 +409,7 @@ void Ereader_ShowPrizeText(void) } } UpdateEReaderSprites(); - DmaCopy16(3, gTempGfxBuffer, BG_CHAR_ADDR(1), 6*BG_SCREEN_SIZE); + DmaCopy16(3, gTempGfxBuffer, BG_TILE_ADDR(TILE_INDEX(1,0,0)), 6*BG_SCREEN_SIZE); } void Ereader_FadeScreenToMenu(void) diff --git a/src/field_select.c b/src/field_select.c index 6b916087..35664af3 100644 --- a/src/field_select.c +++ b/src/field_select.c @@ -57,13 +57,13 @@ void LoadFieldSelectGraphics(void) gMain.dispcntBackup = REG_DISPCNT; DmaCopy16(3, gFieldSelectBGPals, BG_PLTT, BG_PLTT_SIZE); - DmaCopy16(3, gFieldSelectWindow_Gfx, BG_CHAR_ADDR(1), 0x1400); - DmaCopy16(3, gFieldSelectMiniFields_Gfx, BG_CHAR_ADDR(2), 7*BG_SCREEN_SIZE); - DmaCopy16(3, gFieldSelectBG0Tilemap, BG_VRAM, BG_SCREEN_SIZE); - DmaCopy16(3, gFieldSelectFrameShadowTilemap, BG_SCREEN_ADDR(1), BG_SCREEN_SIZE); - DmaCopy16(3, gFieldSelectWindowTilemap, BG_SCREEN_ADDR(2), BG_SCREEN_SIZE); + DmaCopy16(3, gFieldSelectWindow_Gfx, BG_TILE_ADDR(TILE_INDEX(1,0,0)), 0x1400); + DmaCopy16(3, gFieldSelectMiniFields_Gfx, BG_TILE_ADDR(TILE_INDEX(2,0,0)), 7*BG_SCREEN_SIZE); + DmaCopy16(3, gFieldSelectBG0Tilemap, BG_TILE_ADDR(TILE_INDEX(0,0,0)), BG_SCREEN_SIZE); + DmaCopy16(3, gFieldSelectFrameShadowTilemap, BG_TILE_ADDR(TILE_INDEX(0,2,0)), BG_SCREEN_SIZE); + DmaCopy16(3, gFieldSelectWindowTilemap, BG_TILE_ADDR(TILE_INDEX(0,4,0)), BG_SCREEN_SIZE); DmaCopy16(3, gFieldSelectSpritePals, OBJ_PLTT, OBJ_PLTT_SIZE); - DmaCopy16(3, gFieldSelectSpriteGfx, OBJ_VRAM0, 0x4020); + DmaCopy16(3, gFieldSelectSpriteGfx, OBJ_TILE_ADDR(TILE_INDEX(0,0,0)), 0x4020); EnableVBlankInterrupts(); InitFieldSelectData(); diff --git a/src/gbplayer.c b/src/gbplayer.c index a22cbcfc..01faf41f 100644 --- a/src/gbplayer.c +++ b/src/gbplayer.c @@ -25,10 +25,10 @@ static u8 CheckGameBoyPlayer(void) lastDetectedFrame = 0; prevDetectedFrame = 0; VBlankIntrWait(); - DmaCopy16(3, gGbPlayerGfx, BG_CHAR_ADDR(2), BG_CHAR_SIZE); + DmaCopy16(3, gGbPlayerGfx, BG_TILE_ADDR(TILE_INDEX(2,0,0)), BG_CHAR_SIZE); DmaCopy16(3, gGbPlayerPalettes, BG_PLTT, BG_PLTT_SIZE); DmaCopy16(3, gGbPlayerTilemap, gGbPlayerTilemapBuffer, 0x500); - DmaCopy16(3, gGbPlayerTilemapBuffer, BG_SCREEN_ADDR(0), BG_SCREEN_SIZE); + DmaCopy16(3, gGbPlayerTilemapBuffer, BG_TILE_ADDR(TILE_INDEX(0,0,0)), BG_SCREEN_SIZE); REG_BG0CNT = BGCNT_256COLOR | BGCNT_CHARBASE(2); for (i = 0; i <= 16; i++) { @@ -62,7 +62,7 @@ static u8 CheckGameBoyPlayer(void) { vu32 *dmaRegs = dma3; dmaRegs[0] = (vu32)gGbPlayerTilemapBuffer; - dmaRegs[1] = (vu32)BG_SCREEN_ADDR(0); + dmaRegs[1] = (vu32)BG_TILE_ADDR(TILE_INDEX(0,0,0)); dmaRegs[2] = ((DMA_ENABLE | DMA_START_NOW | DMA_32BIT | DMA_SRC_INC | DMA_DEST_INC) << 16 | (BG_SCREEN_SIZE / sizeof(u32))); dmaRegs[2]; } diff --git a/src/groudon_process3.c b/src/groudon_process3.c index 53a6e8b0..f285258b 100644 --- a/src/groudon_process3.c +++ b/src/groudon_process3.c @@ -129,7 +129,7 @@ void InitFrameProcess3_BoardLogic_GroudonBoard(void) UpdateGroudonFieldEntities(); UpdateGroudonEntityLogic(); RenderGroudonSprites(); - DmaCopy16(3, gGroudonAttackFx_Gfx, (void *)0x06015800, 0x2000); + DmaCopy16(3, gGroudonAttackFx_Gfx, OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x2000); AnimateGroudonBackground(); m4aSongNumStart(MUS_BONUS_FIELD_GROUDON); DmaCopy16(3, gBonusStageObjPal, OBJ_PLTT_SLOT(PAL_IX_9), PLTT_SLOT_SIZE); @@ -174,7 +174,7 @@ void UpdateFrameProcess3_BoardLogic_GroudonBoard(void) gCurrentPinballGame->stageTimer = 0; gMain.spriteGroups[SG_BONUS_COMPLETE_BANNER].active = TRUE; gMain.spriteGroups[SG_BONUS_COMPLETE_BANNER_SCORE].active = TRUE; - DmaCopy16(3, gGroudonBonusClear_Gfx, (void *)0x06015800, 0x2000); + DmaCopy16(3, gGroudonBonusClear_Gfx, OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x2000); gCurrentPinballGame->bannerSlideYOffset = 136; gMain.modeChangeFlags = MODE_CHANGE_BONUS_BANNER; gCurrentPinballGame->cameraLocked = TRUE; @@ -216,7 +216,7 @@ void UpdateFrameProcess3_BoardLogic_GroudonBoard(void) gCurrentPinballGame->stageTimer = 140; gMain.spriteGroups[SG_BONUS_COMPLETE_BANNER].active = TRUE; gMain.spriteGroups[SG_BONUS_COMPLETE_BANNER_SCORE].active = TRUE; - DmaCopy16(3, gGroudonBonusClear_Gfx, (void *)0x06015800, 0x2000); + DmaCopy16(3, gGroudonBonusClear_Gfx, OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x2000); gCurrentPinballGame->bannerSlideYOffset = 136; gMain.modeChangeFlags = MODE_CHANGE_BONUS_BANNER; break; @@ -1344,7 +1344,7 @@ void UpdateGroudonFieldEntities(void) } frameIx = gCurrentPinballGame->boulderSpriteFrame[i]; - DmaCopy16(3, gGroudonBoardBoulders_Gfx[frameIx], (void *)0x06010FA0 + i * 0x300, 0x300); + DmaCopy16(3, gGroudonBoardBoulders_Gfx[frameIx], OBJ_TILE_ADDR(TILE_INDEX(0, 3, 29 + i * 24)) , 0x300); group->baseX = (gCurrentPinballGame->boulderGroundPosition[i].x / 10) + i - gCurrentPinballGame->cameraXOffset; group->baseY = (gCurrentPinballGame->boulderFallHeight[i] / 10) + (gCurrentPinballGame->boulderGroundPosition[i].y / 10) - gCurrentPinballGame->cameraYOffset; diff --git a/src/high_scores.c b/src/high_scores.c index 313ebc04..3e7b2b68 100644 --- a/src/high_scores.c +++ b/src/high_scores.c @@ -121,15 +121,15 @@ void LoadHighScoreGraphics(void) gMain.dispcntBackup = REG_DISPCNT; DmaCopy16(3, gHighScoreBG_Pals, BG_PLTT, BG_PLTT_SIZE); - DmaCopy16(3, gHighScoreText_Gfx, BG_CHAR_ADDR(1), 0x4800); - DmaCopy16(3, gHighScoreBallWatermark_Gfx, BG_CHAR_ADDR(3), 0x2C00); + DmaCopy16(3, gHighScoreText_Gfx, BG_TILE_ADDR(TILE_INDEX(1,0,0)), 0x4800); + DmaCopy16(3, gHighScoreBallWatermark_Gfx, BG_TILE_ADDR(TILE_INDEX(3,0,0)), 0x2C00); DmaCopy16(3, gHighScoreScoreTable_Tilemap, gBG0TilemapBuffer, 2*BG_SCREEN_SIZE); - DmaCopy16(3, gHighScoreBallWatermark_Tilemap, BG_SCREEN_ADDR(2), 2*BG_SCREEN_SIZE); + DmaCopy16(3, gHighScoreBallWatermark_Tilemap, BG_TILE_ADDR(TILE_INDEX(0,4,0)), 2*BG_SCREEN_SIZE); DmaCopy16(3, gHighScoreSprite_Pals, OBJ_PLTT_SLOT(PAL_IX_0), 8*PLTT_SLOT_SIZE); - DmaCopy16(3, gHighScoreDialogs_Gfx, (void *)OBJ_VRAM0, 0x4420); + DmaCopy16(3, gHighScoreDialogs_Gfx, OBJ_TILE_ADDR(TILE_INDEX(0,0,0)), 0x4420); InitHighScoreData(); DrawAllHighScoreText(); - DmaCopy16(3, gBG0TilemapBuffer, BG_CHAR_ADDR(0), 2*BG_SCREEN_SIZE); + DmaCopy16(3, gBG0TilemapBuffer, BG_TILE_ADDR(TILE_INDEX(0,0,0)), 2*BG_SCREEN_SIZE); if(gHighScoreEntrySource == 0) m4aSongNumStart(MUS_HIGH_SCORE); @@ -349,7 +349,7 @@ void HighScore_FlashNewEntry(void) gMain.subState = HIGH_SCORE_STATE_NAME_ENTRY; } - DmaCopy16(3, gBG0TilemapBuffer, BG_CHAR_ADDR(0), 2*BG_SCREEN_SIZE); + DmaCopy16(3, gBG0TilemapBuffer, BG_TILE_ADDR(TILE_INDEX(0,0,0)), 2*BG_SCREEN_SIZE); } void HighScore_BrowseScores(void) @@ -568,7 +568,7 @@ void HighScore_NameEntry(void) } } - DmaCopy16(3, gBG0TilemapBuffer, BG_CHAR_ADDR(0), 2*BG_SCREEN_SIZE); + DmaCopy16(3, gBG0TilemapBuffer, BG_TILE_ADDR(TILE_INDEX(0,0,0)), 2*BG_SCREEN_SIZE); if (gHighScoreScreenState.inputRepeatDelay > 0) gHighScoreScreenState.inputRepeatDelay--; } @@ -746,15 +746,15 @@ void IdleHighScore_LoadGraphics(void) REG_DISPCNT |= DISPCNT_BG3_ON; gMain.dispcntBackup = REG_DISPCNT; DmaCopy16(3, gHighScoreBG_Pals, BG_PLTT, BG_PLTT_SIZE); - DmaCopy16(3, gHighScoreText_Gfx, BG_CHAR_ADDR(1), 0x4800); - DmaCopy16(3, gHighScoreBallWatermark_Gfx, BG_CHAR_ADDR(3), 0x2C00); + DmaCopy16(3, gHighScoreText_Gfx, BG_TILE_ADDR(TILE_INDEX(1,0,0)), 0x4800); + DmaCopy16(3, gHighScoreBallWatermark_Gfx, BG_TILE_ADDR(TILE_INDEX(3,0,0)), 0x2C00); DmaCopy16(3, gHighScoreScoreTable_Tilemap, gBG0TilemapBuffer, 2*BG_SCREEN_SIZE); - DmaCopy16(3, gHighScoreBallWatermark_Tilemap, BG_SCREEN_ADDR(2), 2*BG_SCREEN_SIZE); + DmaCopy16(3, gHighScoreBallWatermark_Tilemap, BG_TILE_ADDR(TILE_INDEX(0,4,0)), 2*BG_SCREEN_SIZE); DmaCopy16(3, gHighScoreSprite_Pals, OBJ_PLTT_SLOT(PAL_IX_0), PLTT_SLOT_SIZE); - DmaCopy16(3, gHighScoreDialogs_Gfx, (void *)OBJ_VRAM0, 0x4420); + DmaCopy16(3, gHighScoreDialogs_Gfx, OBJ_TILE_ADDR(TILE_INDEX(0,0,0)), 0x4420); InitIdleHighScoreData(); DrawAllHighScoreText(); - DmaCopy16(3, gBG0TilemapBuffer,BG_CHAR_ADDR(0), 2*BG_SCREEN_SIZE); + DmaCopy16(3, gBG0TilemapBuffer,BG_TILE_ADDR(TILE_INDEX(0,0,0)), 2*BG_SCREEN_SIZE); m4aSongNumStart(MUS_HIGH_SCORE); EnableVBlankInterrupts(); FadeInScreen(); @@ -836,7 +836,7 @@ void IdleHighScore_AutoScroll(void) } gHighScoreScreenState.displayTimer++; - DmaCopy16(3, gBG0TilemapBuffer, BG_CHAR_ADDR(0), 2*BG_SCREEN_SIZE); + DmaCopy16(3, gBG0TilemapBuffer, BG_TILE_ADDR(TILE_INDEX(0,0,0)), 2*BG_SCREEN_SIZE); if (JOY_NEW(START_BUTTON | A_BUTTON | B_BUTTON)) { @@ -864,15 +864,15 @@ void HighScore_ReloadAfterLink(void) REG_DISPCNT |= DISPCNT_BG3_ON; gMain.dispcntBackup = REG_DISPCNT; DmaCopy16(3, gHighScoreBG_Pals, BG_PLTT, BG_PLTT_SIZE); - DmaCopy16(3, gHighScoreText_Gfx, BG_CHAR_ADDR(1), BG_CHAR_SIZE + BG_SCREEN_SIZE); - DmaCopy16(3, gHighScoreBallWatermark_Gfx, BG_CHAR_ADDR(3), 0x2C00); + DmaCopy16(3, gHighScoreText_Gfx, BG_TILE_ADDR(TILE_INDEX(1,0,0)), BG_CHAR_SIZE + BG_SCREEN_SIZE); + DmaCopy16(3, gHighScoreBallWatermark_Gfx, BG_TILE_ADDR(TILE_INDEX(3,0,0)), 0x2C00); DmaCopy16(3, gHighScoreScoreTable_Tilemap, gBG0TilemapBuffer, 2*BG_SCREEN_SIZE); - DmaCopy16(3, gHighScoreBallWatermark_Tilemap, BG_SCREEN_ADDR(2), 2*BG_SCREEN_SIZE); + DmaCopy16(3, gHighScoreBallWatermark_Tilemap, BG_TILE_ADDR(TILE_INDEX(0,4,0)), 2*BG_SCREEN_SIZE); DmaCopy16(3, gHighScoreSprite_Pals, OBJ_PLTT_SLOT(PAL_IX_0), PLTT_SLOT_SIZE); - DmaCopy16(3, gHighScoreDialogs_Gfx, (void *)OBJ_VRAM0, 0x4420); + DmaCopy16(3, gHighScoreDialogs_Gfx, OBJ_TILE_ADDR(TILE_INDEX(0,0,0)), 0x4420); InitIdleHighScoreData(); DrawAllHighScoreText(); - DmaCopy16(3, gBG0TilemapBuffer, BG_CHAR_ADDR(0), 2*BG_SCREEN_SIZE); + DmaCopy16(3, gBG0TilemapBuffer, BG_TILE_ADDR(TILE_INDEX(0,0,0)), 2*BG_SCREEN_SIZE); m4aSongNumStart(MUS_HIGH_SCORE); EnableVBlankInterrupts(); FadeInScreen(); @@ -934,7 +934,7 @@ void HighScore_ShowMergedScores(void) } gHighScoreScreenState.displayTimer++; - DmaCopy16(3, gBG0TilemapBuffer, BG_CHAR_ADDR(0), 2*BG_SCREEN_SIZE); + DmaCopy16(3, gBG0TilemapBuffer, BG_TILE_ADDR(TILE_INDEX(0,0,0)), 2*BG_SCREEN_SIZE); if (JOY_NEW(START_BUTTON | A_BUTTON | B_BUTTON)) { diff --git a/src/intro.c b/src/intro.c index 22c30850..9b0e63b5 100644 --- a/src/intro.c +++ b/src/intro.c @@ -139,8 +139,8 @@ void Intro_State0_929C(void) REG_BG1CNT = BGCNT_TXT256x256 | BGCNT_CHARBASE(1) | BGCNT_PRIORITY(1); REG_DISPCNT |= DISPCNT_BG1_ON; - DmaCopy16(3, gIntroCopyright_Tilemap, BG_SCREEN_ADDR(0), BG_SCREEN_SIZE); - DmaCopy16(3, gIntroCopyright_Gfx, BG_CHAR_ADDR(1), BG_SCREEN_SIZE); + DmaCopy16(3, gIntroCopyright_Tilemap, BG_TILE_ADDR(TILE_INDEX(0,0,0)), BG_SCREEN_SIZE); + DmaCopy16(3, gIntroCopyright_Gfx, BG_TILE_ADDR(TILE_INDEX(1,0,0)), BG_SCREEN_SIZE); DmaCopy16(3, gIntroCopyright_Pal, BG_PLTT, BG_PLTT_SIZE); gMain.dispcntBackup = REG_DISPCNT; @@ -225,15 +225,15 @@ void IntroScene1_00_LoadTitleLettersAndTorchicScene(void) REG_BG3CNT = BGCNT_TXT256x256 | BGCNT_SCREENBASE(31) | BGCNT_PRIORITY(3); REG_DISPCNT |= DISPCNT_BG3_ON; - DmaCopy16(3, gIntroScene1Torchic_BG0Tilemap, BG_CHAR_SCREEN_ADDR(3,2), BG_SCREEN_SIZE); - DmaCopy16(3, gIntroScene1Torchic_BG1Tilemap, BG_CHAR_SCREEN_ADDR(3,3), 2*BG_SCREEN_SIZE); - DmaCopy16(3, gIntroScene1Torchic_BG2Tilemap, BG_CHAR_SCREEN_ADDR(3,5), 2*BG_SCREEN_SIZE); - DmaCopy16(3, gIntroScene1Torchic_BG3Tilemap, BG_CHAR_SCREEN_ADDR(3,7), BG_SCREEN_SIZE); + DmaCopy16(3, gIntroScene1Torchic_BG0Tilemap, BG_TILE_ADDR(TILE_INDEX(3,4,0)), BG_SCREEN_SIZE); + DmaCopy16(3, gIntroScene1Torchic_BG1Tilemap, BG_TILE_ADDR(TILE_INDEX(3,6,0)), 2*BG_SCREEN_SIZE); + DmaCopy16(3, gIntroScene1Torchic_BG2Tilemap, BG_TILE_ADDR(TILE_INDEX(3,10,0)), 2*BG_SCREEN_SIZE); + DmaCopy16(3, gIntroScene1Torchic_BG3Tilemap, BG_TILE_ADDR(TILE_INDEX(3,14,0)), BG_SCREEN_SIZE); - DmaCopy16(3, gIntroScene1TorchicText_Gfx, BG_CHAR_ADDR(0), 0x5800); + DmaCopy16(3, gIntroScene1TorchicText_Gfx, BG_TILE_ADDR(TILE_INDEX(0,0,0)), 0x5800); DmaCopy16(3, gIntroScene1TorchicBall_Gfx, gIntroTileBuffer, 0x6800); DarkenPalette(gIntroScene1TorchicSprites_Pals, (void*)BG_PLTT, BG_PLTT_SIZE, PLTT_SLOT_SIZE); - DmaCopy16(3, gIntroScene1TorchicSprites_Gfx, BG_CHAR_ADDR(4), 0x8000); + DmaCopy16(3, gIntroScene1TorchicSprites_Gfx, OBJ_TILE_ADDR(TILE_INDEX(0,0,0)), 0x8000); DmaCopy16(3, gIntroScene1TorchicSprites_Pals, OBJ_PLTT, OBJ_PLTT_SIZE); IntroScene1Torchic_InitVars(); gMain.bgOffsets[0].xOffset = gIntroBGParams[0].posX; @@ -359,7 +359,7 @@ void IntroScene1Torchic_04_LargeSparkle(void) if (++gIntroSpriteEntities[0].frameTimer > 1) { gIntroSpriteEntities[0].visible = FALSE; - DarkenPalette(&gIntroScene1TorchicSprites_Pals[14], BG_PLTT_SLOT(PAL_IX_7), 0x20, 0); + DarkenPalette(&gIntroScene1TorchicSprites_Pals[14], (void*) BG_PLTT_SLOT(PAL_IX_7), 0x20, 0); m4aSongNumStart(MUS_OPENING); gIntroSceneIndex++; } @@ -391,7 +391,7 @@ void IntroScene1Torchic_05_SpeedLineFadeIn(void) } else { - CopyBgTilesRect(&gIntroTileBuffer, (void *)0x60036e0, 8, 8); + CopyBgTilesRect(&gIntroTileBuffer, (void *)BG_TILE_ADDR(TILE_INDEX(0, 13, 23)), 8, 8); gIntroSceneIndex++; } @@ -426,7 +426,7 @@ void IntroScene1Torchic_06_BrightenPokeballFlyTowardsScreen(void) gMain.bgOffsets[0].yOffset = gIntroBGParams[0].posY; if (++gIntroBGParams[0].frameTimer > gIntroScene1Torchic_BGAnimTiming[gIntroBGParams[0].animFrame].y) { - CopyBgTilesRect(&gIntroTileBuffer[gIntroScene1Torchic_TileOffsets[gIntroBGParams[0].animFrame]], (void *)0x60036E0, 8, 8); + CopyBgTilesRect(&gIntroTileBuffer[gIntroScene1Torchic_TileOffsets[gIntroBGParams[0].animFrame]], (void *)BG_TILE_ADDR(TILE_INDEX(0, 13, 23)), 8, 8); if (++gIntroBGParams[0].animFrame > 3) { gIntroSpriteEntities[3].visible = TRUE; @@ -463,9 +463,9 @@ void IntroScene1Torchic_07_TorchicRiseAndBGSplit(void) if (++gIntroBGParams[0].frameTimer > gIntroScene1Torchic_BGAnimTiming[gIntroBGParams[0].animFrame].y) { if (gIntroBGParams[0].animFrame < 7) - CopyBgTilesRect(&gIntroTileBuffer[gIntroScene1Torchic_TileOffsets[gIntroBGParams[0].animFrame]], (void *)0x60036e0, 8, 8); + CopyBgTilesRect(&gIntroTileBuffer[gIntroScene1Torchic_TileOffsets[gIntroBGParams[0].animFrame]], (void *) BG_TILE_ADDR(TILE_INDEX(0, 13, 23)), 8, 8); else - CopyBgTilesRect(&gIntroTileBuffer[gIntroScene1Torchic_TileOffsets[gIntroBGParams[0].animFrame]], (void *)0x60032c0, 10, 10); + CopyBgTilesRect(&gIntroTileBuffer[gIntroScene1Torchic_TileOffsets[gIntroBGParams[0].animFrame]], (void *) BG_TILE_ADDR(TILE_INDEX(0, 12, 22)), 10, 10); gIntroBGParams[0].animFrame++; } @@ -692,10 +692,10 @@ void IntroScene2Pikas_14_LoadPinkYellowBackground(void) REG_BG3CNT = BGCNT_TXT256x256 | BGCNT_SCREENBASE(30) | BGCNT_PRIORITY(3); REG_DISPCNT |= DISPCNT_BG3_ON; - DmaCopy16(3, gIntroScene2Pikas_BG0Tiles, BG_CHAR_SCREEN_ADDR(1,4), 4*BG_SCREEN_SIZE); - DmaCopy16(3, gIntroScene2Pikas_BG1Tiles, BG_CHAR_SCREEN_ADDR(3,2), 4*BG_SCREEN_SIZE); - DmaCopy16(3, gIntroScene2Pikas_BG3Tilemap, BG_CHAR_SCREEN_ADDR(3,6), BG_SCREEN_SIZE); - DmaCopy16(3, gIntroScene2PikasSprites_Gfx, BG_CHAR_SCREEN_ADDR(0,0), 7*BG_SCREEN_SIZE + 0x400); + DmaCopy16(3, gIntroScene2Pikas_BG0Tiles, BG_TILE_ADDR(TILE_INDEX(1,8,0)), 4*BG_SCREEN_SIZE); + DmaCopy16(3, gIntroScene2Pikas_BG1Tiles, BG_TILE_ADDR(TILE_INDEX(3,4,0)), 4*BG_SCREEN_SIZE); + DmaCopy16(3, gIntroScene2Pikas_BG3Tilemap, BG_TILE_ADDR(TILE_INDEX(3,12,0)), BG_SCREEN_SIZE); + DmaCopy16(3, gIntroScene2PikasSprites_Gfx, BG_TILE_ADDR(TILE_INDEX(0,0,0)), 7*BG_SCREEN_SIZE + 0x400); DmaCopy16(3, gIntroScene2Pikas_Pal, BG_PLTT_SLOT(PAL_IX_0), 4*PLTT_SLOT_SIZE); IntroScene2Pikas_InitVars(); gMain.bgOffsets[0].xOffset = gIntroBGParams[0].posX; @@ -812,15 +812,15 @@ void IntroScene3Treecko_20_LoadTreeckoFlipperBall(void) REG_BG3CNT = BGCNT_TXT256x256 | BGCNT_SCREENBASE(31) | BGCNT_PRIORITY(3); REG_DISPCNT |= DISPCNT_BG3_ON; - DmaCopy16(3, gIntroScene3Treecko_BG0Tilemap, BG_CHAR_SCREEN_ADDR(3,2), 2*BG_SCREEN_SIZE); - DmaCopy16(3, gIntroScene3Treecko_BG1Tilemap, BG_CHAR_SCREEN_ADDR(3,4), BG_SCREEN_SIZE); - DmaCopy16(3, gIntroScene3Treecko_BG2Tilemap, BG_CHAR_SCREEN_ADDR(3,5), 2*BG_SCREEN_SIZE); - DmaCopy16(3, gIntroScene3Treecko_BG3Tilemap, BG_CHAR_SCREEN_ADDR(3,7), BG_SCREEN_SIZE); + DmaCopy16(3, gIntroScene3Treecko_BG0Tilemap, BG_TILE_ADDR(TILE_INDEX(3,4,0)), 2*BG_SCREEN_SIZE); + DmaCopy16(3, gIntroScene3Treecko_BG1Tilemap, BG_TILE_ADDR(TILE_INDEX(3,8,0)), BG_SCREEN_SIZE); + DmaCopy16(3, gIntroScene3Treecko_BG2Tilemap, BG_TILE_ADDR(TILE_INDEX(3,10,0)), 2*BG_SCREEN_SIZE); + DmaCopy16(3, gIntroScene3Treecko_BG3Tilemap, BG_TILE_ADDR(TILE_INDEX(3,14,0)), BG_SCREEN_SIZE); DmaCopy16(3, gIntroScene3Treecko_BG1TilemapA, gBG0TilemapBuffer, BG_SCREEN_SIZE); DmaCopy16(3, gIntroScene3Treecko_BG1TilemapB, gIntroScene3Treecko_AltBG1TilemapBuffer, BG_SCREEN_SIZE); - DmaCopy16(3, gIntroScene3TreeckoSprites_Gfx, BG_VRAM, 0x6C00); + DmaCopy16(3, gIntroScene3TreeckoSprites_Gfx, BG_TILE_ADDR(TILE_INDEX(0,0,0)), 0x6C00); DmaCopy16(3, gIntroScene3Treecko_Pal, BG_PLTT_SLOT(PAL_IX_0), 7*PLTT_SLOT_SIZE); - DmaCopy16(3, gIntroScene3TreeckoTreecko_Gfx, OBJ_VRAM0, 0x2000); + DmaCopy16(3, gIntroScene3TreeckoTreecko_Gfx, OBJ_TILE_ADDR(TILE_INDEX(0,0,0)), 0x2000); DmaCopy16(3, gIntroScene3Treecko_Pal, OBJ_PLTT_SLOT(PAL_IX_0), 7*PLTT_SLOT_SIZE); IntroScene3Treecko_InitVars(); @@ -914,7 +914,7 @@ void IntroScene3Treecko_22_FlipperHitTextScroll(void) if (gIntroBGParams[2].animFrame == 2) { - DmaCopy16(3, gBG0TilemapBuffer, BG_CHAR_SCREEN_ADDR(3,4), BG_SCREEN_SIZE); + DmaCopy16(3, gBG0TilemapBuffer, BG_TILE_ADDR(TILE_INDEX(3,8,0)), BG_SCREEN_SIZE); gIntroBGParams[1].posX = 0; gIntroBGParams[1].posY = 0; gMain.bgOffsets[1].xOffset = gIntroBGParams[1].posX; @@ -922,7 +922,7 @@ void IntroScene3Treecko_22_FlipperHitTextScroll(void) } else if (gIntroBGParams[2].animFrame == 4) { - DmaCopy16(3, gIntroScene3Treecko_AltBG1TilemapBuffer, BG_CHAR_SCREEN_ADDR(3,4), BG_SCREEN_SIZE); + DmaCopy16(3, gIntroScene3Treecko_AltBG1TilemapBuffer, BG_TILE_ADDR(TILE_INDEX(3,8,0)), BG_SCREEN_SIZE); gIntroBGParams[1].posX = 0; gIntroBGParams[1].posY = 0; gMain.bgOffsets[1].xOffset = gIntroBGParams[1].posX; @@ -995,10 +995,10 @@ void IntroScene4PlusleMinun_26_LoadTealWhiteBackground(void) REG_BG3CNT = BGCNT_TXT256x256 | BGCNT_SCREENBASE(30) | BGCNT_PRIORITY(3); REG_DISPCNT |= DISPCNT_BG3_ON; - DmaCopy16(3, gIntroScene4PlusleMinun_BG0Tiles, BG_CHAR_SCREEN_ADDR(1,4), 4*BG_SCREEN_SIZE); - DmaCopy16(3, gIntroScene4PlusleMinun_BG1Tiles, BG_CHAR_SCREEN_ADDR(3,2), 4*BG_SCREEN_SIZE); - DmaCopy16(3, gIntroScene4PlusleMinun_BG3Tilemap, BG_CHAR_SCREEN_ADDR(3,6), BG_SCREEN_SIZE); - DmaCopy16(3, gIntroScene4PlusleMinunSprites_Gfx, BG_CHAR_ADDR(0), BG_CHAR_SIZE); + DmaCopy16(3, gIntroScene4PlusleMinun_BG0Tiles, BG_TILE_ADDR(TILE_INDEX(1,8,0)), 4*BG_SCREEN_SIZE); + DmaCopy16(3, gIntroScene4PlusleMinun_BG1Tiles, BG_TILE_ADDR(TILE_INDEX(3,4,0)), 4*BG_SCREEN_SIZE); + DmaCopy16(3, gIntroScene4PlusleMinun_BG3Tilemap, BG_TILE_ADDR(TILE_INDEX(3,12,0)), BG_SCREEN_SIZE); + DmaCopy16(3, gIntroScene4PlusleMinunSprites_Gfx, BG_TILE_ADDR(TILE_INDEX(0,0,0)), BG_CHAR_SIZE); DmaCopy16(3, gIntroScene4PlusleMinun_Pal, BG_PLTT_SLOT(PAL_IX_0), 3*PLTT_SLOT_SIZE); gMain.dispcntBackup = REG_DISPCNT; @@ -1115,14 +1115,14 @@ void IntroScene5Mudkip_32_LoadMudkipBallScene(void) REG_BG3CNT = BGCNT_TXT256x256 | BGCNT_SCREENBASE(30) | BGCNT_PRIORITY(3); REG_DISPCNT |= DISPCNT_BG3_ON; - DmaCopy16(3, gIntroScene5Mudkip_BG0Tilemap, BG_CHAR_SCREEN_ADDR(1,4), BG_SCREEN_SIZE); - DmaCopy16(3, gIntroScene5Mudkip_BG1Tiles, BG_CHAR_SCREEN_ADDR(1,6), 2*BG_SCREEN_SIZE); - DmaCopy16(3, gIntroScene5Mudkip_BG2Tilemap, BG_CHAR_SCREEN_ADDR(3,4), 2*BG_SCREEN_SIZE); - DmaCopy16(3, gIntroScene5Mudkip_BG3Tilemap, BG_CHAR_SCREEN_ADDR(3,6), BG_SCREEN_SIZE); - DmaCopy16(3, gIntroScene5MudkipText_Gfx, BG_CHAR_ADDR(0), 5*BG_SCREEN_SIZE); + DmaCopy16(3, gIntroScene5Mudkip_BG0Tilemap, BG_TILE_ADDR(TILE_INDEX(1,8,0)), BG_SCREEN_SIZE); + DmaCopy16(3, gIntroScene5Mudkip_BG1Tiles, BG_TILE_ADDR(TILE_INDEX(1,12,0)), 2*BG_SCREEN_SIZE); + DmaCopy16(3, gIntroScene5Mudkip_BG2Tilemap, BG_TILE_ADDR(TILE_INDEX(3,8,0)), 2*BG_SCREEN_SIZE); + DmaCopy16(3, gIntroScene5Mudkip_BG3Tilemap, BG_TILE_ADDR(TILE_INDEX(3,12,0)), BG_SCREEN_SIZE); + DmaCopy16(3, gIntroScene5MudkipText_Gfx, BG_TILE_ADDR(TILE_INDEX(0,0,0)), 5*BG_SCREEN_SIZE); DmaCopy16(3, gIntroScene1TorchicBall_Gfx, gTempGfxBuffer, BG_CHAR_SIZE); DmaCopy16(3, gIntroScene5Mudkip_Pal, BG_PLTT_SLOT(PAL_IX_0), 12*PLTT_SLOT_SIZE); - DmaCopy16(3, gIntroScene5MudkipSprites_Gfx, OBJ_VRAM0, 6*BG_SCREEN_SIZE); + DmaCopy16(3, gIntroScene5MudkipSprites_Gfx, OBJ_TILE_ADDR(TILE_INDEX(0,0,0)), 6*BG_SCREEN_SIZE); DmaCopy16(3, gIntroScene5Mudkip_Pal, OBJ_PLTT_SLOT(PAL_IX_0), 12*PLTT_SLOT_SIZE); IntroScene5Mudkip_InitVars(); @@ -1157,7 +1157,7 @@ void IntroScene5Mudkip_InitVars(void) gIntroBGParams[0].frameTimer = 0; gIntroBGParams[0].velX = 0; - CopyBgTilesRect(&gTextTilemapBuffer, (void *) 0x6002ee0, 8, 8); + CopyBgTilesRect(&gTextTilemapBuffer, (void*)BG_TILE_ADDR(TILE_INDEX(0, 11, 23)), 8, 8); gIntroBGParams[1].posX = 0xA5; gIntroBGParams[1].posY = 0; @@ -1192,7 +1192,7 @@ void IntroScene5Mudkip_33_MoveMudkipBallSplit(void) if (gIntroBGParams[0].frameTimer > gIntroScene5Mudkip_BGAnimTiming[gIntroBGParams[0].animFrame].y) { gIntroBGParams[0].animFrame++; - CopyBgTilesRect(&gTempGfxBuffer[gIntroScene5Mudkip_TileOffsets[gIntroBGParams[0].animFrame]], (void *) 0x6002EE0, 8, 8); + CopyBgTilesRect(&gTempGfxBuffer[gIntroScene5Mudkip_TileOffsets[gIntroBGParams[0].animFrame]], (void *) BG_TILE_ADDR(TILE_INDEX(0, 11, 23)), 8, 8); } IntroScene5Mudkip_RenderAllSprites(); @@ -1217,7 +1217,7 @@ void IntroScene5Mudkip_34_MoveMudkipBallTextScroll(void) if (gIntroBGParams[0].animFrame < 7) { gIntroBGParams[0].animFrame++; - CopyBgTilesRect(&gTempGfxBuffer[gIntroScene5Mudkip_TileOffsets[gIntroBGParams[0].animFrame]], (void *) 0x6002EE0, 8, 8); + CopyBgTilesRect(&gTempGfxBuffer[gIntroScene5Mudkip_TileOffsets[gIntroBGParams[0].animFrame]], (void *) BG_TILE_ADDR(TILE_INDEX(0, 11, 23)), 8, 8); } } @@ -1256,7 +1256,7 @@ void IntroScene5Mudkip_36_FlashWhite(void) FlashWhiteTransitionOut(); ClearSprites(); DmaFill32(3, 0, OAM, 0x400); - DmaFill16(3, 0, OBJ_VRAM0, 0x5000); + DmaFill16(3, 0, OBJ_TILE_ADDR(TILE_INDEX(0,0,0)), 0x5000); DisableDisplayInterrupts(); gIntroSceneIndex++; } @@ -1347,13 +1347,13 @@ void IntroScene6Chinchou_38_LoadChinchou(void) REG_BG3CNT = BGCNT_TXT256x256 | BGCNT_SCREENBASE(31) | BGCNT_PRIORITY(3); REG_DISPCNT |= DISPCNT_BG3_ON; - DmaCopy16(3, gIntroScene6Chinchou_BG0Tilemap, BG_CHAR_SCREEN_ADDR(1,7), BG_SCREEN_SIZE); - DmaCopy16(3, gIntroScene6Chinchou_BG1Tiles, BG_CHAR_SCREEN_ADDR(3,2), 4*BG_SCREEN_SIZE); - DmaCopy16(3, gIntroScene6Chinchou_BG2Tilemap, BG_CHAR_SCREEN_ADDR(3,6), BG_SCREEN_SIZE); - DmaCopy16(3, gIntroScene6Chinchou_BG3Tilemap, BG_CHAR_SCREEN_ADDR(3,7), BG_SCREEN_SIZE); - DmaCopy16(3, gIntroScene6ChinchouSprites_Gfx, BG_VRAM, 0x6400); + DmaCopy16(3, gIntroScene6Chinchou_BG0Tilemap, BG_TILE_ADDR(TILE_INDEX(1,14,0)), BG_SCREEN_SIZE); + DmaCopy16(3, gIntroScene6Chinchou_BG1Tiles, BG_TILE_ADDR(TILE_INDEX(3,4,0)), 4*BG_SCREEN_SIZE); + DmaCopy16(3, gIntroScene6Chinchou_BG2Tilemap, BG_TILE_ADDR(TILE_INDEX(3,12,0)), BG_SCREEN_SIZE); + DmaCopy16(3, gIntroScene6Chinchou_BG3Tilemap, BG_TILE_ADDR(TILE_INDEX(3,14,0)), BG_SCREEN_SIZE); + DmaCopy16(3, gIntroScene6ChinchouSprites_Gfx, BG_TILE_ADDR(TILE_INDEX(0,0,0)), 0x6400); DmaCopy16(3, gIntroScene6Chinchou_Pal, BG_PLTT_SLOT(PAL_IX_0), 4*PLTT_SLOT_SIZE); - DmaCopy16(3, gIntroScene6ChinchouStars_Gfx, OBJ_VRAM0, 0x1000); + DmaCopy16(3, gIntroScene6ChinchouStars_Gfx, OBJ_TILE_ADDR(TILE_INDEX(0,0,0)), 0x1000); DmaCopy16(3, gIntroScene6Chinchou_Pal, OBJ_PLTT_SLOT(PAL_IX_0), 4*PLTT_SLOT_SIZE); IntroScene6Chinchou_InitVars(); @@ -1496,7 +1496,7 @@ void IntroScene6Chinchou_41_FlashWhiteClearSprites(void) { ClearSprites(); DmaFill32(3, 0, OAM, 0x400); - DmaFill16(3, 0, OBJ_VRAM0, 0x5000); + DmaFill16(3, 0, OBJ_TILE_ADDR(TILE_INDEX(0,0,0)), 0x5000); FlashWhiteTransitionOut(); DisableDisplayInterrupts(); gIntroSceneIndex++; @@ -1578,13 +1578,13 @@ void IntroScene7Parade_43_LoadPinkYellowBackground(void) REG_BG3CNT = BGCNT_TXT256x256 | BGCNT_SCREENBASE(15) | BGCNT_PRIORITY(3); REG_DISPCNT |= DISPCNT_BG3_ON; - DmaCopy16(3, gIntroScene7Parade_BG0Tiles, BG_CHAR_SCREEN_ADDR(2,4), 4*BG_SCREEN_SIZE); - DmaCopy16(3, gIntroScene7Parade_BG1Tiles, BG_CHAR_SCREEN_ADDR(3,0), 4*BG_SCREEN_SIZE); - DmaCopy16(3, gIntroScene7Parade_BG2Tiles, BG_CHAR_SCREEN_ADDR(3,4), 4*BG_SCREEN_SIZE); - DmaCopy16(3, gIntroScene7Parade_BG3Tilemap, BG_CHAR_SCREEN_ADDR(1,7), BG_SCREEN_SIZE); - DmaCopy16(3, gIntroScene7ParadeSprites_Gfx, BG_VRAM, 0x5000); + DmaCopy16(3, gIntroScene7Parade_BG0Tiles, BG_TILE_ADDR(TILE_INDEX(2,8,0)), 4*BG_SCREEN_SIZE); + DmaCopy16(3, gIntroScene7Parade_BG1Tiles, BG_TILE_ADDR(TILE_INDEX(3,0,0)), 4*BG_SCREEN_SIZE); + DmaCopy16(3, gIntroScene7Parade_BG2Tiles, BG_TILE_ADDR(TILE_INDEX(3,8,0)), 4*BG_SCREEN_SIZE); + DmaCopy16(3, gIntroScene7Parade_BG3Tilemap, BG_TILE_ADDR(TILE_INDEX(1,14,0)), BG_SCREEN_SIZE); + DmaCopy16(3, gIntroScene7ParadeSprites_Gfx, BG_TILE_ADDR(TILE_INDEX(0,0,0)), 0x5000); DmaCopy16(3, gIntroScene7Parade_Pal, BG_PLTT_SLOT(PAL_IX_0), 11*PLTT_SLOT_SIZE); - DmaCopy16(3, gIntroScene7ParadeWailmer_Gfx, OBJ_VRAM0, 0x2000); + DmaCopy16(3, gIntroScene7ParadeWailmer_Gfx, OBJ_TILE_ADDR(TILE_INDEX(0,0,0)), 0x2000); DmaCopy16(3, gIntroScene7Parade_Pal, OBJ_PLTT_SLOT(PAL_IX_0), 11*PLTT_SLOT_SIZE); gMain.dispcntBackup = REG_DISPCNT; @@ -1851,10 +1851,10 @@ void IntroScene8WailmerLaunch_51_LoadWailmerBlastBackground(void) REG_BG2CNT = BGCNT_TXT256x256 | BGCNT_SCREENBASE(0) | BGCNT_PRIORITY(3) | BGCNT_CHARBASE(1); REG_DISPCNT |= DISPCNT_BG2_ON; - DmaCopy16(3, gIntroScene8WailmerLaunch_BG2Tilemap, BG_VRAM, BG_SCREEN_SIZE); - DmaCopy16(3, gIntroScene8WailmerLaunchExplosion_Gfx, BG_CHAR_SCREEN_ADDR(1,0), 0x3400); + DmaCopy16(3, gIntroScene8WailmerLaunch_BG2Tilemap, BG_TILE_ADDR(TILE_INDEX(0,0,0)), BG_SCREEN_SIZE); + DmaCopy16(3, gIntroScene8WailmerLaunchExplosion_Gfx, BG_TILE_ADDR(TILE_INDEX(1,0,0)), 0x3400); DmaCopy16(3, gIntroScene8WailmerLaunch_Pal, BG_PLTT_SLOT(PAL_IX_0), 10*PLTT_SLOT_SIZE); - DmaCopy16(3, gIntroScene8WailmerLaunch_Gfx, OBJ_VRAM0, 0x2C00); + DmaCopy16(3, gIntroScene8WailmerLaunch_Gfx, OBJ_TILE_ADDR(TILE_INDEX(0,0,0)), 0x2C00); DmaCopy16(3, gIntroScene8WailmerLaunch_Pal, OBJ_PLTT_SLOT(PAL_IX_0), 10*PLTT_SLOT_SIZE); gMain.dispcntBackup = REG_DISPCNT; @@ -1979,7 +1979,7 @@ void IntroScene8WailmerLaunch_57_FlashWhiteClearSprites(void) FlashWhiteTransitionOut(); ClearSprites(); DmaFill32(3, 0, OAM, 0x400); - DmaFill16(3, 0, OBJ_VRAM0, 0x5000); + DmaFill16(3, 0, OBJ_TILE_ADDR(TILE_INDEX(0,0,0)), 0x5000); DisableDisplayInterrupts(); gIntroSceneIndex++; } @@ -2144,10 +2144,10 @@ void IntroScene9BallFlight_59_LoadSkySpeedOrbs(void) REG_BG3CNT = BGCNT_TXT256x256 | BGCNT_SCREENBASE(0) | BGCNT_PRIORITY(3) | BGCNT_CHARBASE(1); REG_DISPCNT |= DISPCNT_BG3_ON; - DmaCopy16(3, gIntroScene9BallFlight_BG3Tilemap, BG_VRAM, BG_SCREEN_SIZE); - DmaCopy16(3, gIntroScene9BallFlightClouds_Gfx, BG_CHAR_SCREEN_ADDR(1,0), 0x2400); + DmaCopy16(3, gIntroScene9BallFlight_BG3Tilemap, BG_TILE_ADDR(TILE_INDEX(0,0,0)), BG_SCREEN_SIZE); + DmaCopy16(3, gIntroScene9BallFlightClouds_Gfx, BG_TILE_ADDR(TILE_INDEX(1,0,0)), 0x2400); DmaCopy16(3, gIntroScene9BallFlight_Pal, BG_PLTT_SLOT(PAL_IX_0), 2*PLTT_SLOT_SIZE); - DmaCopy16(3, gIntroScene9BallFlightall_Gfx, OBJ_VRAM0, 0x7000); + DmaCopy16(3, gIntroScene9BallFlightall_Gfx, OBJ_TILE_ADDR(TILE_INDEX(0,0,0)), 0x7000); DmaCopy16(3, gIntroScene9BallFlight_Pal, OBJ_PLTT_SLOT(PAL_IX_0), 2*PLTT_SLOT_SIZE); gMain.dispcntBackup = REG_DISPCNT; @@ -2236,14 +2236,14 @@ void IntroScene9BallFlight_62_MoveBallSkyFadeWhite(void) gIntroObjWhiteFlash = 32; } - BrightenPalette(gIntroScene9BallFlight_Pal, OBJ_PLTT_SLOT(PAL_IX_0), 0x20, gIntroObjWhiteFlash); + BrightenPalette(gIntroScene9BallFlight_Pal, (void*)OBJ_PLTT_SLOT(PAL_IX_0), 0x20, gIntroObjWhiteFlash); if (gIntroFrameCounter > 136) { gIntroBGWhiteFlash += 2; if (gIntroBGWhiteFlash > 32) gIntroBGWhiteFlash = 0x20; - BrightenPalette(gIntroScene9BallFlight_Pal, BG_PLTT_SLOT(PAL_IX_0), 0x40, gIntroBGWhiteFlash); + BrightenPalette(gIntroScene9BallFlight_Pal, (void*)BG_PLTT_SLOT(PAL_IX_0), 0x40, gIntroBGWhiteFlash); } gIntroBGParams[0].posX -= 0x24; diff --git a/src/kecleon_process3.c b/src/kecleon_process3.c index b81903c6..5d335a40 100644 --- a/src/kecleon_process3.c +++ b/src/kecleon_process3.c @@ -169,7 +169,7 @@ void UpdateFrameProcess3_BoardLogic_KecleonBoard(void) gCurrentPinballGame->stageTimer = 0; gMain.spriteGroups[SG_BONUS_COMPLETE_BANNER].active = TRUE; gMain.spriteGroups[SG_BONUS_COMPLETE_BANNER_SCORE].active = TRUE; - DmaCopy16(3, gKecleonBonusClear_Gfx, (void *)0x6015800, 0x2000); + DmaCopy16(3, gKecleonBonusClear_Gfx, OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x2000); gCurrentPinballGame->bannerSlideYOffset = 0x88; gMain.modeChangeFlags = MODE_CHANGE_BONUS_BANNER; } @@ -791,7 +791,7 @@ void RenderKecleonSprites(void) sp0 = gCurrentPinballGame->bossVulnerable; gCurrentPinballGame->bossVulnerable = gKecleonAnimFramesetTable[gCurrentPinballGame->bossFramesetIndex][2]; - DmaCopy16(3, gKecleonStageKecleon_Gfx[sp0], (void *)0x6010920, 0x280); + DmaCopy16(3, gKecleonStageKecleon_Gfx[sp0], OBJ_TILE_ADDR(TILE_INDEX(0, 2, 9)), 0x280); sp4 = gKecleonAnimFramesetTable[gCurrentPinballGame->bossFramesetIndex][0]; spriteGroup->baseX = gCurrentPinballGame->bossPositionX / 10 + baseX - gCurrentPinballGame->cameraXOffset; spriteGroup->baseY = gCurrentPinballGame->bossPositionY / 10 + baseY - gCurrentPinballGame->cameraYOffset; @@ -901,7 +901,7 @@ void RenderKecleonSprites(void) var0 = gCurrentPinballGame->kecleonCollisionEnabled * 3; var1 = gCurrentPinballGame->kecleonDustGfxFrame / 8 - 2; - DmaCopy16(3, gKecleonStageKecleonFx_Gfx[var0 - var1], (void *)0x6010BA0, 0x100); + DmaCopy16(3, gKecleonStageKecleonFx_Gfx[var0 - var1], OBJ_TILE_ADDR(TILE_INDEX(0, 2, 29)), 0x100); if (gCurrentPinballGame->kecleonDustGfxFrame > 0) { gCurrentPinballGame->kecleonDustGfxFrame--; @@ -1090,7 +1090,7 @@ void UpdateKecleonScopeVision(void) } } - DmaCopy16(3, &gBG0TilemapBuffer[0x400], BG_CHAR_SCREEN_ADDR(0,2), 0x500); + DmaCopy16(3, &gBG0TilemapBuffer[0x400], BG_TILE_ADDR(TILE_INDEX(0,4,0)), 0x500); } void RenderKecleonBoardElements(void) diff --git a/src/kyogre_process3.c b/src/kyogre_process3.c index 1b8b4265..70d3aa79 100644 --- a/src/kyogre_process3.c +++ b/src/kyogre_process3.c @@ -157,7 +157,7 @@ void UpdateFrameProcess3_BoardLogic_KyogreBoard(void) gCurrentPinballGame->stageTimer = 0; gMain.spriteGroups[SG_BONUS_COMPLETE_BANNER].active = TRUE; gMain.spriteGroups[SG_BONUS_COMPLETE_BANNER_SCORE].active = TRUE; - DmaCopy16(3, gKyogreBonusClear_Gfx, (void *)0x06015800, 0x2000); + DmaCopy16(3, gKyogreBonusClear_Gfx, OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x2000); gCurrentPinballGame->bannerSlideYOffset = 136; gMain.modeChangeFlags = MODE_CHANGE_BONUS_BANNER; gCurrentPinballGame->cameraLocked = TRUE; @@ -199,7 +199,7 @@ void UpdateFrameProcess3_BoardLogic_KyogreBoard(void) gCurrentPinballGame->stageTimer = 140; gMain.spriteGroups[SG_BONUS_COMPLETE_BANNER].active = TRUE; gMain.spriteGroups[SG_BONUS_COMPLETE_BANNER_SCORE].active = TRUE; - DmaCopy16(3, gKyogreBonusClear_Gfx, (void *)0x06015800, 0x2000); + DmaCopy16(3, gKyogreBonusClear_Gfx, OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x2000); gCurrentPinballGame->bannerSlideYOffset = 136; gMain.modeChangeFlags = MODE_CHANGE_BONUS_BANNER; break; @@ -692,12 +692,12 @@ void RenderKyogreSprites(void) var2 = gKyogreAnimFramesetTable[gCurrentPinballGame->bossFramesetIndex][0]; if (index < 15) { - DmaCopy16(3, gKyogreBodySprites_First15[index], (void *)0x06010FA0, 0x580); + DmaCopy16(3, gKyogreBodySprites_First15[index], OBJ_TILE_ADDR(TILE_INDEX(0, 3, 29)), 0x580); } else { index -= 15; - DmaCopy16(3, gKyogreBodySprites_After15[index], (void *)0x06010FA0, 0x4C0); + DmaCopy16(3, gKyogreBodySprites_After15[index], OBJ_TILE_ADDR(TILE_INDEX(0, 3, 29)), 0x4C0); } group->baseX = gCurrentPinballGame->bossPositionX / 10 + 72u - gCurrentPinballGame->cameraXOffset; @@ -769,7 +769,7 @@ void RenderKyogreSprites(void) group->baseY = 200; index = gKyogreSplashAnimIndices[(gCurrentPinballGame->shockwaveAnimTimer % 84) / 6]; - DmaCopy16(3, gKyogreSplashSpriteFrames[index], (void *)0x06012420, 0xC0); + DmaCopy16(3, gKyogreSplashSpriteFrames[index], OBJ_TILE_ADDR(TILE_INDEX(0, 9, 1)), 0xC0); for (i = 0; i < 2; i++) { oamSimple = &group->oam[i]; @@ -1015,7 +1015,7 @@ void UpdateKyogreFieldEntities(void) group->baseY = 200; index = gKyogrefreezeTrapAnimFrameset[gCurrentPinballGame->freezeTrapAnimFrame][2]; - DmaCopy16(3, gKyogreFreeze_Gfx[index], (void *)0x060124E0, 0x3C0); + DmaCopy16(3, gKyogreFreeze_Gfx[index], OBJ_TILE_ADDR(TILE_INDEX(0, 9, 7)), 0x3C0); var0 = gKyogrefreezeTrapAnimFrameset[gCurrentPinballGame->freezeTrapAnimFrame][0]; for (i = 0; i < 4; i++) { @@ -1210,7 +1210,7 @@ void UpdateKyogreFieldEntities(void) } } - DmaCopy16(3, gKyogreWhirlpoolTrap_Gfx[index], (void *)(0x06011520 + i * 0x200), 0x200); + DmaCopy16(3, gKyogreWhirlpoolTrap_Gfx[index], OBJ_TILE_ADDR(TILE_INDEX(0, 5, 9 + i * 16)), 0x200); if (group->active) { if (gCurrentPinballGame->vortexEntityState[i] > KYOGRE_WHIRLPOOL_PHASE_INIT) @@ -1366,7 +1366,7 @@ void AnimateKyogreBackground(void) for (i = 0; i < 0x400; i++) gBG0TilemapBuffer[0x800 + i] = gKyogreWaterBackgroundTilemap[i] + index * 4; - DmaCopy16(3, &gBG0TilemapBuffer[0x800], BG_SCREEN_ADDR(0), BG_SCREEN_SIZE); + DmaCopy16(3, &gBG0TilemapBuffer[0x800], BG_TILE_ADDR(TILE_INDEX(0,0,0)), BG_SCREEN_SIZE); index = gKyogreWaterPaletteSegmentCycle[(gMain.systemFrameCount % 96) / 24]; DmaCopy16(3, gKyogreFadeInPaletteProgression[gCurrentPinballGame->bossLightFadeInCounter][index], BG_PLTT_SLOT(PAL_IX_3), PLTT_SLOT_SIZE); diff --git a/src/main_board_bumpers.c b/src/main_board_bumpers.c index b462bf9b..f28dccbd 100644 --- a/src/main_board_bumpers.c +++ b/src/main_board_bumpers.c @@ -227,7 +227,7 @@ void DrawSapphireShopGuards(void) group->baseX = 68 - gCurrentPinballGame->cameraXOffset; group->baseY = 144 - gCurrentPinballGame->cameraYOffset; index = gShopGuardianAnimFramesetData[gCurrentPinballGame->shopGuardianAnimFrames[MINUN_TARGET_BUTTON_IX]][0]; - DmaCopy16(3, &gSapphireMinun_Gfx[index], (void *)0x06012DA0, 0x280); + DmaCopy16(3, &gSapphireMinun_Gfx[index], OBJ_TILE_ADDR(TILE_INDEX(0, 11, 13)), 0x280); for (i = 0; i < 2; i++) { oamSimple = &group->oam[i]; @@ -241,7 +241,7 @@ void DrawSapphireShopGuards(void) { group->baseY = 144 - gCurrentPinballGame->cameraYOffset; index = gCurrentPinballGame->shopGuardianTargetHitFxTimer[MINUN_TARGET_BUTTON_IX] / 2; - DmaCopy16(3, &gSapphireMinunHeadElectricity_Gfx[index], (void *)0x06014720, 0x180); + DmaCopy16(3, &gSapphireMinunHeadElectricity_Gfx[index], OBJ_TILE_ADDR(TILE_INDEX(1, 1, 25)), 0x180); } else { @@ -256,7 +256,7 @@ void DrawSapphireShopGuards(void) group->baseX = 36 - gCurrentPinballGame->cameraXOffset; group->baseY = 163 - gCurrentPinballGame->cameraYOffset; index = gShopGuardianAnimFramesetData[gCurrentPinballGame->shopGuardianAnimFrames[PLUSLE_TARGET_BUTTON_IX]][0]; - DmaCopy16(3, &gSapphirePlusle_Gfx[index], (void *)0x060130A0, 0x280); + DmaCopy16(3, &gSapphirePlusle_Gfx[index], OBJ_TILE_ADDR(TILE_INDEX(0, 12, 5)), 0x280); for (i = 0; i < 2; i++) { oamSimple = &group->oam[i]; @@ -270,7 +270,7 @@ void DrawSapphireShopGuards(void) { group->baseY = 163 - gCurrentPinballGame->cameraYOffset; index = gCurrentPinballGame->shopGuardianTargetHitFxTimer[PLUSLE_TARGET_BUTTON_IX] / 2; - DmaCopy16(3, &gSapphirePlusleHeadElectricity_Gfx[index], (void *)0x06014920, 0x180); + DmaCopy16(3, &gSapphirePlusleHeadElectricity_Gfx[index], OBJ_TILE_ADDR(TILE_INDEX(1, 2, 9)), 0x180); } else { @@ -309,7 +309,7 @@ void DrawSapphireShopGuards(void) else index = 9; - DmaCopy16(3, &gSapphireBoardShopShockWall_Gfx[index], (void *)0x060146A0, 0x80); + DmaCopy16(3, &gSapphireBoardShopShockWall_Gfx[index], OBJ_TILE_ADDR(TILE_INDEX(1, 1, 21)), 0x80); oamSimple = &group->oam[0]; gOamBuffer[oamSimple->oamId].x = oamSimple->xOffset + group->baseX; gOamBuffer[oamSimple->oamId].y = oamSimple->yOffset + group->baseY; @@ -369,7 +369,7 @@ void HandleRubyBumperHit(void) gCurrentPinballGame->bannerSlidePosition = -2500; gCurrentPinballGame->bannerSlideTimer = 50; gCurrentPinballGame->bannerSlideVelocity = 0; - DmaCopy16(3, gModeBannerTilemaps[7], (void *)0x06015800, 0x2400); + DmaCopy16(3, gModeBannerTilemaps[7], OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x2400); DmaCopy16(3, gModeBanner_Pals[7], OBJ_PLTT_SLOT(PAL_IX_BANNER), PLTT_SLOT_SIZE); gMain.blendControl = 0xCE; } @@ -403,7 +403,7 @@ void HandleRubyBumperHit(void) index = ((gCurrentPinballGame->globalAnimFrameCounter + (i * 10)) % 30) / 15; } - DmaCopy16(3, &gPondBumper_Gfx[index], (void *)0x060133A0 + i * 0x200, 0x200); + DmaCopy16(3, &gPondBumper_Gfx[index], OBJ_TILE_ADDR(TILE_INDEX(0, 12, 29 + i * 16)), 0x200); group->baseX = gCurrentPinballGame->rubyBumperLogicPosition[i].x / 10 - gCurrentPinballGame->cameraXOffset - 8; group->baseY = gCurrentPinballGame->rubyBumperLogicPosition[i].y / 10 - gCurrentPinballGame->cameraYOffset - 10; diff --git a/src/main_board_catch_holes.c b/src/main_board_catch_holes.c index c09871f3..3fe5d65a 100644 --- a/src/main_board_catch_holes.c +++ b/src/main_board_catch_holes.c @@ -31,7 +31,7 @@ void UpdateShopEntryAnimation(s16 arg0) { gCurrentPinballGame->activeFxType = FX_SHOP_EVO_SELECTION; - DmaCopy16(3, &gPokemonNameDisplayGfx, OBJ_VRAM1 + 0x1C00, 0x940); + DmaCopy16(3, &gPokemonNameDisplayGfx, OBJ_TILE_ADDR(TILE_INDEX(1, 7, 0)), 0x940); DmaCopy16(3, gShopNameDisplay_Pals, BG_PLTT_SLOT(PAL_IX_SHOP_BG), PLTT_SLOT_SIZE); } @@ -76,7 +76,7 @@ void UpdateShopEntryAnimation(s16 arg0) gMain.fieldSpriteGroups[FIELD_SG_MAIN_SHOP_PORTRAIT_OVERLAY]->active = TRUE; DmaCopy16(3, gShopEvoUI_Pals, OBJ_PLTT_SLOT(PAL_IX_SHOP_UI), PLTT_SLOT_SIZE); - DmaCopy16(3, gShopModeBG0_0_Tilemap, BG_CHAR_SCREEN_ADDR(0,4), 0xC40); + DmaCopy16(3, gShopModeBG0_0_Tilemap, BG_TILE_ADDR(TILE_INDEX(0,8,0)), 0xC40); gMain.bgOffsets[0].yOffset = 80; gMain.shopPanelSlideOffset = 0; @@ -176,7 +176,7 @@ void UpdateShopEntryAnimation(s16 arg0) else gCurrentPinballGame->shopBgAnimFrame = 0; - DmaCopy16(3, gShopEvoBGAnimFrames[gCurrentPinballGame->shopBgAnimFrame / 2], BG_CHAR_SCREEN_ADDR(0,4), 0xC40); + DmaCopy16(3, gShopEvoBGAnimFrames[gCurrentPinballGame->shopBgAnimFrame / 2], BG_TILE_ADDR(TILE_INDEX(0,8,0)), 0xC40); gMain.bgOffsets[0].yOffset = 80 - (4 * gMain.shopPanelSlideOffset); if (gCurrentPinballGame->catchModeEventTimer != 0) @@ -341,7 +341,7 @@ void UpdateShopEntryAnimation(s16 arg0) gCurrentPinballGame->bannerSlideTimer = 50; gCurrentPinballGame->bannerSlideVelocity = 0; - DmaCopy16(3, gModeBannerTilemaps[3], OBJ_VRAM1 + 0x1800, 0x2400); + DmaCopy16(3, gModeBannerTilemaps[3], OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x2400); DmaCopy16(3, gModeBanner_Pals[3], OBJ_PLTT_SLOT(PAL_IX_BANNER), PLTT_SLOT_SIZE); gMain.blendControl = 206; @@ -357,7 +357,7 @@ void UpdateShopEntryAnimation(s16 arg0) { gCurrentPinballGame->activeFxType = FX_SHOP_EVO_SELECTION; - DmaCopy16(3, &gPokemonNameDisplayGfx, OBJ_VRAM1 + 0x1C00, 0x940); + DmaCopy16(3, &gPokemonNameDisplayGfx, OBJ_TILE_ADDR(TILE_INDEX(1, 7, 0)), 0x940); DmaCopy16(3, gEvoNameDisplay_Pals, BG_PLTT_SLOT(PAL_IX_SHOP_BG), PLTT_SLOT_SIZE); } @@ -399,7 +399,7 @@ void UpdateShopEntryAnimation(s16 arg0) gCurrentPinballGame->shopAnimSlideTimer = 15; gMain.shopPanelActive = TRUE; - DmaCopy16(3, &gEvoModeBG0_0_Tilemap, BG_CHAR_SCREEN_ADDR(0,4), 0xC40); + DmaCopy16(3, &gEvoModeBG0_0_Tilemap, BG_TILE_ADDR(TILE_INDEX(0,8,0)), 0xC40); } if (gCurrentPinballGame->shopEntryTimer <= 144) @@ -632,7 +632,7 @@ void UpdateShopEntryAnimation(s16 arg0) gCurrentPinballGame->shopBgAnimFrame = 0; } - DmaCopy16(3, gShopEvoBGAnimFrames[gCurrentPinballGame->shopBgAnimFrame / 2 + 4], BG_CHAR_SCREEN_ADDR(0,4), 0xC40); + DmaCopy16(3, gShopEvoBGAnimFrames[gCurrentPinballGame->shopBgAnimFrame / 2 + 4], BG_TILE_ADDR(TILE_INDEX(0,8,0)), 0xC40); gMain.bgOffsets[0].yOffset = 80 - (gMain.shopPanelSlideOffset * 4); if (gCurrentPinballGame->catchModeEventTimer != 0) @@ -705,10 +705,10 @@ void UpdateShopEntryAnimation(s16 arg0) gMain.fieldSpriteGroups[FIELD_SG_MAIN_SHOP_ARROWS]->active = FALSE; gMain.fieldSpriteGroups[FIELD_SG_MAIN_SHOP_PORTRAIT_OVERLAY]->active = FALSE; - gCurrentPinballGame->evoBlinkTimer = 0; - gCurrentPinballGame->catchLights[0] = 4; - gCurrentPinballGame->catchLights[1] = 4; - gCurrentPinballGame->catchLights[2] = 4; + gCurrentPinballGame->modeProgressBlinkTimer = 0; + gCurrentPinballGame->modeProgressLights[MODE_LAMP_LEFT] = MODE_PROGRESS_LAMP_EVO_UNLIT; + gCurrentPinballGame->modeProgressLights[MODE_LAMP_CENTER] = MODE_PROGRESS_LAMP_EVO_UNLIT; + gCurrentPinballGame->modeProgressLights[MODE_LAMP_RIGHT] = MODE_PROGRESS_LAMP_EVO_UNLIT; HidePokemonNameDisplay(); gCurrentPinballGame->activeFxType = FX_NONE; @@ -816,11 +816,11 @@ void TransitionToBonusField(void) if (gCurrentPinballGame->bonusReturnState == BONUS_RETURN_LOCATION_CENTER_KICKOUT) { - gCurrentPinballGame->evoItemCount = 0; - gCurrentPinballGame->evoBlinkTimer = 0; - gCurrentPinballGame->catchLights[0] = 0; - gCurrentPinballGame->catchLights[1] = 0; - gCurrentPinballGame->catchLights[2] = 0; + gCurrentPinballGame->monProgressTowardsBonusCount = 0; + gCurrentPinballGame->modeProgressBlinkTimer = 0; + gCurrentPinballGame->modeProgressLights[MODE_LAMP_LEFT] = MODE_PROGRESS_LAMP_BALL_UNLIT; + gCurrentPinballGame->modeProgressLights[MODE_LAMP_CENTER] = MODE_PROGRESS_LAMP_BALL_UNLIT; + gCurrentPinballGame->modeProgressLights[MODE_LAMP_RIGHT] = MODE_PROGRESS_LAMP_BALL_UNLIT; } m4aMPlayAllStop(); DisableVBlankInterrupts(); diff --git a/src/main_board_catch_normal_and_jirachi_modes.c b/src/main_board_catch_normal_and_jirachi_modes.c index 91731fad..c4dcf548 100644 --- a/src/main_board_catch_normal_and_jirachi_modes.c +++ b/src/main_board_catch_normal_and_jirachi_modes.c @@ -56,10 +56,10 @@ void CleanupCatchEmState(void) for (i = 0; i < 3; i++) { - if (i < gCurrentPinballGame->evoItemCount) - gCurrentPinballGame->catchLights[i] = 1; + if (i < gCurrentPinballGame->monProgressTowardsBonusCount) + gCurrentPinballGame->modeProgressLights[i] = MODE_PROGRESS_LAMP_BALL_LIT; else - gCurrentPinballGame->catchLights[i] = 0; + gCurrentPinballGame->modeProgressLights[i] = MODE_PROGRESS_LAMP_BALL_UNLIT; } } @@ -174,7 +174,7 @@ void UpdateCatchEmMode(void) gCurrentPinballGame->bannerSlidePosition = -2500; gCurrentPinballGame->bannerSlideTimer = 50; gCurrentPinballGame->bannerSlideVelocity = 0; - DmaCopy16(3, gModeBannerTilemaps[2], (void *)0x06015800, 0x2400); + DmaCopy16(3, gModeBannerTilemaps[2], OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x2400); DmaCopy16(3, gModeBanner_Pals[2], OBJ_PLTT_SLOT(PAL_IX_BANNER), PLTT_SLOT_SIZE); gMain.blendControl = 0xCE; } @@ -209,7 +209,7 @@ void UpdateCatchEmMode(void) gCurrentPinballGame->bannerSlidePosition = -2500; gCurrentPinballGame->bannerSlideTimer = 50; gCurrentPinballGame->bannerSlideVelocity = 0; - DmaCopy16(3, gModeBannerTilemaps[2], (void *)0x06015800, 0x2400); + DmaCopy16(3, gModeBannerTilemaps[2], OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x2400); DmaCopy16(3, gModeBanner_Pals[2], OBJ_PLTT_SLOT(PAL_IX_BANNER), PLTT_SLOT_SIZE); gMain.blendControl = 0xCE; } @@ -241,7 +241,7 @@ void UpdateCatchEmMode(void) else { gCurrentPinballGame->activeFxType = FX_CATCH_MON_REVEAL_PUFF; - DmaCopy16(3, gCatchMonAppearFx_Gfx, (void *)0x06015800, 0x1400); + DmaCopy16(3, gCatchMonAppearFx_Gfx, OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x1400); DmaCopy16(3, gCatchMonAppearFx_Pal, OBJ_PLTT_SLOT(PAL_IX_CATCH_TILE_FX), PLTT_SLOT_SIZE); m4aSongNumStart(SE_CATCH_MON_ENTITY_APPEARS); gCurrentPinballGame->boardSubState++; @@ -257,10 +257,10 @@ void UpdateCatchEmMode(void) DmaCopy16(3, gCatchSpritePalettes, OBJ_PLTT_SLOT(PAL_IX_MON_PORTRAIT), PLTT_SLOT_SIZE); gCurrentPinballGame->catchTargetX = 118; gCurrentPinballGame->catchTargetY = 264; - gCurrentPinballGame->evoBlinkTimer = 0; - gCurrentPinballGame->catchLights[0] = 2; - gCurrentPinballGame->catchLights[1] = 2; - gCurrentPinballGame->catchLights[2] = 2; + gCurrentPinballGame->modeProgressBlinkTimer = 0; + gCurrentPinballGame->modeProgressLights[MODE_LAMP_LEFT] = MODE_PROGRESS_LAMP_CATCH_UNLIT; + gCurrentPinballGame->modeProgressLights[MODE_LAMP_CENTER] = MODE_PROGRESS_LAMP_CATCH_UNLIT; + gCurrentPinballGame->modeProgressLights[MODE_LAMP_RIGHT] = MODE_PROGRESS_LAMP_CATCH_UNLIT; DrawCatchMonBoardSprite(); gCurrentPinballGame->catchMonCollisionEnabled = TRUE; gCurrentPinballGame->boardSubState++; @@ -295,7 +295,7 @@ void UpdateCatchEmMode(void) } else { - if (gCurrentPinballGame->catchLights[2] == 1) + if (gCurrentPinballGame->modeProgressLights[MODE_LAMP_RIGHT] == MODE_PROGRESS_LAMP_BALL_LIT) RequestBoardStateTransition(MAIN_BOARD_STATE_BOSS_HOLE_ACTIVE); else RequestBoardStateTransition(MAIN_BOARD_STATE_DEFAULT); @@ -382,7 +382,7 @@ void UpdateJirachiBonus(void) gCurrentPinballGame->bannerSlidePosition = -2500; gCurrentPinballGame->bannerSlideTimer = 50; gCurrentPinballGame->bannerSlideVelocity = 0; - DmaCopy16(3, gModeBannerTilemaps[5], (void *)0x06015800, 0x2400); + DmaCopy16(3, gModeBannerTilemaps[5], OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x2400); DmaCopy16(3, gModeBanner_Pals[5], OBJ_PLTT_SLOT(PAL_IX_BANNER), PLTT_SLOT_SIZE); gMain.blendControl = 0xCE; } @@ -416,7 +416,7 @@ void UpdateJirachiBonus(void) gCurrentPinballGame->bannerSlidePosition = -2500; gCurrentPinballGame->bannerSlideTimer = 50; gCurrentPinballGame->bannerSlideVelocity = 0; - DmaCopy16(3, gModeBannerTilemaps[5], (void *)0x06015800, 0x2400); + DmaCopy16(3, gModeBannerTilemaps[5], OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x2400); DmaCopy16(3, gModeBanner_Pals[5], OBJ_PLTT_SLOT(PAL_IX_BANNER), PLTT_SLOT_SIZE); gMain.blendControl = 0xCE; return; @@ -441,13 +441,13 @@ void UpdateJirachiBonus(void) case JIRACHI_CATCH_SUBSTATE_SETUP_CATCH_HIT_COUNT: DmaCopy16(3, gCaptureHit_Pal, OBJ_PLTT_SLOT(PAL_IX_MON_SHADOW_PORTRAIT), PLTT_SLOT_SIZE); DmaCopy16(3, gCatchSpritePalettes, OBJ_PLTT_SLOT(PAL_IX_CATCH_MON), PLTT_SLOT_SIZE); - gCurrentPinballGame->evoBlinkTimer = 0; - gCurrentPinballGame->catchLights[0] = 2; - gCurrentPinballGame->catchLights[1] = 2; - gCurrentPinballGame->catchLights[2] = 2; + gCurrentPinballGame->modeProgressBlinkTimer = 0; + gCurrentPinballGame->modeProgressLights[MODE_LAMP_LEFT] = MODE_PROGRESS_LAMP_CATCH_UNLIT; + gCurrentPinballGame->modeProgressLights[MODE_LAMP_CENTER] = MODE_PROGRESS_LAMP_CATCH_UNLIT; + gCurrentPinballGame->modeProgressLights[MODE_LAMP_RIGHT] = MODE_PROGRESS_LAMP_CATCH_UNLIT; gCurrentPinballGame->catchMonCollisionEnabled = TRUE; gMain.fieldSpriteGroups[FIELD_SG_CATCH_MON_ENTITY]->active = TRUE; - DmaCopy16(3, gCatchSpriteGfxBuffer, (void *)0x06010CA0, 0x480); + DmaCopy16(3, gCatchSpriteGfxBuffer, OBJ_TILE_ADDR(TILE_INDEX(0, 3, 5)), 0x480); gCurrentPinballGame->modeAnimTimer = 40; gCurrentPinballGame->jirachiLogicX = 900; gCurrentPinballGame->jirachiLogicY = -1400; @@ -558,7 +558,7 @@ void UpdateJirachiBonus(void) } else { - if (gCurrentPinballGame->catchLights[2] == 1) + if (gCurrentPinballGame->modeProgressLights[MODE_LAMP_RIGHT] == MODE_PROGRESS_LAMP_BALL_LIT) RequestBoardStateTransition(MAIN_BOARD_STATE_BOSS_HOLE_ACTIVE); else RequestBoardStateTransition(MAIN_BOARD_STATE_DEFAULT); @@ -626,19 +626,19 @@ void DrawCatchMonBoardSprite(void) { if (gCurrentPinballGame->captureFlashTimer == 20 || gCurrentPinballGame->captureFlashTimer == 200) { - DmaCopy16(3, gCatchSpriteFlashGfx, (void *)0x06010CA0, 0x480); + DmaCopy16(3, gCatchSpriteFlashGfx, OBJ_TILE_ADDR(TILE_INDEX(0, 3, 5)), 0x480); } if (gCurrentPinballGame->captureFlashTimer == 24) { - DmaCopy16(3, gCatchSpriteGfxBuffer, (void *)0x06010CA0, 0x480); + DmaCopy16(3, gCatchSpriteGfxBuffer, OBJ_TILE_ADDR(TILE_INDEX(0, 3, 5)), 0x480); } gCurrentPinballGame->captureFlashTimer--;; } else if (gCurrentPinballGame->randomSpriteVariantSeed == 5) { - DmaCopy16(3, &gCatchSpriteGfxBuffer[index * 0x480], (void *)0x06010CA0, 0x480); + DmaCopy16(3, &gCatchSpriteGfxBuffer[index * 0x480], OBJ_TILE_ADDR(TILE_INDEX(0, 3, 5)), 0x480); } if (gCurrentPinballGame->captureSequenceTimer < 13) @@ -702,7 +702,7 @@ void DrawJirachiSprites(void) if (gCurrentPinballGame->stageTimer >= 90) { index = (150 - gCurrentPinballGame->stageTimer) / 4; - DmaCopy16(3, &gJirachiFx_Gfx[index], (void *)0x06010CA0, 0x480); + DmaCopy16(3, &gJirachiFx_Gfx[index], OBJ_TILE_ADDR(TILE_INDEX(0, 3, 5)), 0x480); } else { @@ -713,19 +713,19 @@ void DrawJirachiSprites(void) { if (gCurrentPinballGame->captureFlashTimer == 20 || gCurrentPinballGame->captureFlashTimer == 200) { - DmaCopy16(3, gCatchSpriteFlashGfx, (void *)0x06010CA0, 0x480); + DmaCopy16(3, gCatchSpriteFlashGfx, OBJ_TILE_ADDR(TILE_INDEX(0, 3, 5)), 0x480); } if (gCurrentPinballGame->captureFlashTimer == 24) { - DmaCopy16(3, gCatchSpriteGfxBuffer, (void *)0x06010CA0, 0x480); + DmaCopy16(3, gCatchSpriteGfxBuffer, OBJ_TILE_ADDR(TILE_INDEX(0, 3, 5)), 0x480); } gCurrentPinballGame->captureFlashTimer--; } else if (gCurrentPinballGame->randomSpriteVariantSeed == 5) { - DmaCopy16(3, &gCatchSpriteGfxBuffer[index * 0x480], (void *)0x06010CA0, 0x480); + DmaCopy16(3, &gCatchSpriteGfxBuffer[index * 0x480], OBJ_TILE_ADDR(TILE_INDEX(0, 3, 5)), 0x480); } if (gCurrentPinballGame->captureState != MON_CAPTURE_SPECIAL_STATE_CAPTURE_CUTSCENE) @@ -881,7 +881,7 @@ void PlayCatchMonAppearsAnimation(void) if (gCurrentPinballGame->catchRevealFrameId > 2) { DmaCopy16(3, gCatchSpritePalettes, OBJ_PLTT_SLOT(PAL_IX_CATCH_MON), PLTT_SLOT_SIZE); - DmaCopy16(3, gCatchSpriteGfxBuffer, (void *)0x06010CA0, 0x480); + DmaCopy16(3, gCatchSpriteGfxBuffer, OBJ_TILE_ADDR(TILE_INDEX(0, 3, 5)), 0x480); DrawCatchMonBoardSprite(); } diff --git a/src/main_board_catch_tile_logic.c b/src/main_board_catch_tile_logic.c index 93de2425..10f1d493 100644 --- a/src/main_board_catch_tile_logic.c +++ b/src/main_board_catch_tile_logic.c @@ -75,7 +75,7 @@ void RevealCatchTilesSequential(void) { gCurrentPinballGame->activeFxType = FX_SEQUENTIAL_CATCH_TILE; DmaCopy16(3, gCatchTile_Reveal_Pal, OBJ_PLTT_SLOT(PAL_IX_CATCH_TILE_FX), PLTT_SLOT_SIZE); - DmaCopy16(3, gCatchTile_RevealTilesGfx, (void *)0x06015800, 0x2800); + DmaCopy16(3, gCatchTile_RevealTilesGfx, OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x2800); } if (gCatchTile_SequentialFramesetData[gCurrentPinballGame->catchRevealFrameId][1] > gCurrentPinballGame->catchTileRevealFrameAnimTimer) @@ -197,7 +197,7 @@ void RevealCatchTilesBurst(void) break; case CATCH_TILE_BURST_PHASE_LOAD_LIGHTNING_GFX: gCurrentPinballGame->activeFxType = FX_CATCH_TILE_BURST_1; - DmaCopy16(3, gCatchTile_BurstStart_Gfx, (void *)0x06015800, 0x2000); + DmaCopy16(3, gCatchTile_BurstStart_Gfx, OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x2000); DmaCopy16(3, gCatchTile_BurstStart_Pal, OBJ_PLTT_SLOT(PAL_IX_CATCH_TILE_FX), PLTT_SLOT_SIZE); gMain.fieldSpriteGroups[FIELD_SG_CATCH_BURST_LIGHTNING_STRIKE]->active = TRUE; m4aSongNumStart(SE_CATCH_ALL_REVEAL_LIGHTNING); @@ -243,7 +243,7 @@ void RevealCatchTilesBurst(void) break; case CATCH_TILE_BURST_PHASE_LOAD_TILE_GFX: gCurrentPinballGame->activeFxType = FX_CATCH_TILE_BURST_2; - DmaCopy16(3, gCatchTile_BurstStage2_Gfx, (void *)0x06015800, 0x800); + DmaCopy16(3, gCatchTile_BurstStage2_Gfx, OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x800); DmaCopy16(3, gCatchTile_BurstStage2_Pal, OBJ_PLTT_SLOT(PAL_IX_CATCH_TILE_FX), PLTT_SLOT_SIZE); gMain.fieldSpriteGroups[FIELD_SG_CATCH_BURST_TILE_FLASH_FX]->active = TRUE; gCurrentPinballGame->catchTilesBurstPhase++; @@ -284,7 +284,7 @@ void RevealCatchTilesBurst(void) break; case CATCH_TILE_BURST_PHASE_LOAD_TILE_SHARD_GFX: gCurrentPinballGame->activeFxType = FX_CATCH_TILE_BURST_3; - DmaCopy16(3, gCatchTile_BurstStage3_Gfx, (void *)0x06015800, 0x2000); + DmaCopy16(3, gCatchTile_BurstStage3_Gfx, OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x2000); DmaCopy16(3, gCatchTile_BurstStage3_Pal, OBJ_PLTT_SLOT(PAL_IX_CATCH_TILE_FX), PLTT_SLOT_SIZE); gCurrentPinballGame->catchTilesBurstPhase++; InitBurstTileParticles(); @@ -328,7 +328,7 @@ void RevealCatchTilesBurst(void) break; case CATCH_TILE_BURST_PHASE_LOAD_ELECTRIC_GFX: gCurrentPinballGame->activeFxType = FX_CATCH_TILE_BURST_4; - DmaCopy16(3, gCatchTile_BurstStage4_Gfx, (void *)0x06015800, 0x1800); + DmaCopy16(3, gCatchTile_BurstStage4_Gfx, OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x1800); DmaCopy16(3, gCatchTile_BurstStage4_Pal, OBJ_PLTT_SLOT(PAL_IX_CATCH_TILE_FX), PLTT_SLOT_SIZE); gMain.fieldSpriteGroups[FIELD_SG_CATCH_BURST_PANEL_ELECTRIFY_FX]->active = TRUE; gCurrentPinballGame->catchTilesBurstPhase++; diff --git a/src/main_board_center_capture_hole.c b/src/main_board_center_capture_hole.c index 3e28618b..c87e3c48 100644 --- a/src/main_board_center_capture_hole.c +++ b/src/main_board_center_capture_hole.c @@ -274,7 +274,7 @@ void GivePrize(void) gCurrentPinballGame->fullChargeSlideAnimTimer = 0; gCurrentPinballGame->chargeIndicatorYOffset = 120; gCurrentPinballGame->fullChargeIndicatorBlinkTimer = 60; - DmaCopy16(3, gPikachuSaverTilesGfx, (void *)0x06010600, 0x180); + DmaCopy16(3, gPikachuSaverTilesGfx, OBJ_TILE_ADDR(TILE_INDEX(0, 1, 16)), 0x180); gCurrentPinballGame->outLanePikaPosition = PIKA_BOTH_SIDES; gMain.fieldSpriteGroups[FIELD_SG_HATCH_MON_ENTITY]->active = FALSE; gCurrentPinballGame->pichuEntranceTimer = 1; @@ -489,9 +489,9 @@ void GivePrize(void) case PRIZE_BONUS_MULT_PLUS_5: if (gCurrentPinballGame->outcomeFrameCounter == 70) { - gCurrentPinballGame->progressLevel += gCurrentPinballGame->prizeId - 35; - if (gCurrentPinballGame->progressLevel > 99) - gCurrentPinballGame->progressLevel = 99; + gCurrentPinballGame->bonusMultTracker += gCurrentPinballGame->prizeId - 35; + if (gCurrentPinballGame->bonusMultTracker > 99) + gCurrentPinballGame->bonusMultTracker = 99; } break; case PRIZE_START_BONUS_MODE_DUSKULL: @@ -555,9 +555,9 @@ void RunMonCaptureSequence(void) gCurrentPinballGame->ball->positionQ8.y += gCurrentPinballGame->ball->velocity.y; gCurrentPinballGame->activeFxType = FX_CAPTURE_MON_ABSORB; - DmaCopy16(3, gCaptureScreenTilesGfx, 0x06015800, 0x1C00); - DmaCopy16(3, &gCaptureBallTilesGfx[gCurrentPinballGame->ballUpgradeType << 9], 0x060164C0, 0x80); - DmaCopy16(3, &gCaptureBallTilesGfx[((gCurrentPinballGame->ballUpgradeType * 8 + 4) << 6)], 0x06016760, 0x80); + DmaCopy16(3, gCaptureScreenTilesGfx, OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x1C00); + DmaCopy16(3, &gCaptureBallTilesGfx[gCurrentPinballGame->ballUpgradeType << 9], OBJ_TILE_ADDR(TILE_INDEX(1, 9, 6)), 0x80); + DmaCopy16(3, &gCaptureBallTilesGfx[((gCurrentPinballGame->ballUpgradeType * 8 + 4) << 6)], OBJ_TILE_ADDR(TILE_INDEX(1, 9, 27)), 0x80); gCurrentPinballGame->ballUpgradeTimerPaused = TRUE; @@ -572,10 +572,10 @@ void RunMonCaptureSequence(void) case 1: if (gCurrentPinballGame->boardState == MAIN_BOARD_STATE_CATCH_EM_MODE) { - gCurrentPinballGame->evoBlinkTimer = 0; - gCurrentPinballGame->catchLights[0] = 2; - gCurrentPinballGame->catchLights[1] = 2; - gCurrentPinballGame->catchLights[2] = 2; + gCurrentPinballGame->modeProgressBlinkTimer = 0; + gCurrentPinballGame->modeProgressLights[MODE_LAMP_LEFT] = MODE_PROGRESS_LAMP_CATCH_UNLIT; + gCurrentPinballGame->modeProgressLights[MODE_LAMP_CENTER] = MODE_PROGRESS_LAMP_CATCH_UNLIT; + gCurrentPinballGame->modeProgressLights[MODE_LAMP_RIGHT] = MODE_PROGRESS_LAMP_CATCH_UNLIT; } gCurrentPinballGame->ball->oamPriority = 0; @@ -1155,7 +1155,7 @@ void RunMonCaptureSequence(void) } } - DmaCopy16(3, &gBG0TilemapBuffer, BG_CHAR_SCREEN_ADDR(0,4), BG_SCREEN_SIZE); + DmaCopy16(3, &gBG0TilemapBuffer, BG_TILE_ADDR(TILE_INDEX(0,8,0)), BG_SCREEN_SIZE); } if (gCurrentPinballGame->captureSequenceFrame >= 240 && gCurrentPinballGame->captureSequenceFrame <= 269) @@ -1170,7 +1170,7 @@ void RunMonCaptureSequence(void) } } - DmaCopy16(3, &gBG0TilemapBuffer, BG_CHAR_SCREEN_ADDR(0,4), BG_SCREEN_SIZE); + DmaCopy16(3, &gBG0TilemapBuffer, BG_TILE_ADDR(TILE_INDEX(0,8,0)), BG_SCREEN_SIZE); if (gCurrentPinballGame->captureSequenceFrame == 269) { @@ -1268,19 +1268,19 @@ void RunMonCaptureSequence(void) for (i = 0; i <= 2; i++) { - if (i < gCurrentPinballGame->evoItemCount) - gCurrentPinballGame->catchLights[i] = 1; + if (i < gCurrentPinballGame->monProgressTowardsBonusCount) + gCurrentPinballGame->modeProgressLights[i] = MODE_PROGRESS_LAMP_BALL_LIT; else - gCurrentPinballGame->catchLights[i] = 0; + gCurrentPinballGame->modeProgressLights[i] = MODE_PROGRESS_LAMP_BALL_UNLIT; } - if (gCurrentPinballGame->evoItemCount <= 2) + if (gCurrentPinballGame->monProgressTowardsBonusCount <= 2) { - gCurrentPinballGame->evoCatchLightSlot1 = gCurrentPinballGame->evoItemCount; - gCurrentPinballGame->evoCatchLightSlot2 = gCurrentPinballGame->evoItemCount; - gCurrentPinballGame->catchLights[gCurrentPinballGame->evoCatchLightSlot1] = 1; - gCurrentPinballGame->evoBlinkTimer = 120; - gCurrentPinballGame->evoItemCount++; + gCurrentPinballGame->evoCatchLightSlot1 = gCurrentPinballGame->monProgressTowardsBonusCount; + gCurrentPinballGame->evoCatchLightSlot2 = gCurrentPinballGame->monProgressTowardsBonusCount; + gCurrentPinballGame->modeProgressLights[gCurrentPinballGame->evoCatchLightSlot1] = MODE_PROGRESS_LAMP_BALL_LIT; + gCurrentPinballGame->modeProgressBlinkTimer = 120; + gCurrentPinballGame->monProgressTowardsBonusCount++; } gCurrentPinballGame->caughtMonCount++; diff --git a/src/main_board_charge_spinner.c b/src/main_board_charge_spinner.c index f0e933ac..3f5712a2 100644 --- a/src/main_board_charge_spinner.c +++ b/src/main_board_charge_spinner.c @@ -139,7 +139,7 @@ void DrawPikachuSpinner(void) if (gCurrentPinballGame->pikachuSpinFrame != gCurrentPinballGame->pikachuSpinPrevFrame) { gCurrentPinballGame->pikachuSpinPrevFrame = gCurrentPinballGame->pikachuSpinFrame; - DmaCopy16(3, gMainBoardPikaSpinner_Gfx[index], (void *)0x06010780, 0x120); + DmaCopy16(3, gMainBoardPikaSpinner_Gfx[index], OBJ_TILE_ADDR(TILE_INDEX(0, 1, 28)), 0x120); } for (i = 0; i < 4; i++) diff --git a/src/main_board_evolution_mode.c b/src/main_board_evolution_mode.c index 0e101127..997e68cb 100644 --- a/src/main_board_evolution_mode.c +++ b/src/main_board_evolution_mode.c @@ -26,10 +26,10 @@ void CleanupEvolutionModeState(void) gCurrentPinballGame->portraitDisplayState = PORTRAIT_DISPLAY_MODE_BOARD_CENTER; for (i = 0; i < 3; i++) { - if (i < gCurrentPinballGame->evoItemCount) - gCurrentPinballGame->catchLights[i] = 1; + if (i < gCurrentPinballGame->monProgressTowardsBonusCount) + gCurrentPinballGame->modeProgressLights[i] = MODE_PROGRESS_LAMP_BALL_LIT; else - gCurrentPinballGame->catchLights[i] = 0; + gCurrentPinballGame->modeProgressLights[i] = MODE_PROGRESS_LAMP_BALL_UNLIT; } gMain.fieldSpriteGroups[FIELD_SG_CENTER_HOLE_GRAVITY_FX]->active = FALSE; @@ -259,7 +259,7 @@ void UpdateEvolutionMode(void) gBG0TilemapBuffer[((j + 15) * 0x20) + i] = 0xC100; } - DmaCopy16(3, gBG0TilemapBuffer, BG_CHAR_SCREEN_ADDR(0,4), BG_SCREEN_SIZE); + DmaCopy16(3, gBG0TilemapBuffer, BG_TILE_ADDR(TILE_INDEX(0,8,0)), BG_SCREEN_SIZE); } if (gCurrentPinballGame->stageTimer >= 240 && gCurrentPinballGame->stageTimer < 270) @@ -271,7 +271,7 @@ void UpdateEvolutionMode(void) gBG0TilemapBuffer[((j + 15) << 5) + i] = 0x1FF; } - DmaCopy16(3, gBG0TilemapBuffer, BG_CHAR_SCREEN_ADDR(0,4), BG_SCREEN_SIZE); + DmaCopy16(3, gBG0TilemapBuffer, BG_TILE_ADDR(TILE_INDEX(0,8,0)), BG_SCREEN_SIZE); if (gCurrentPinballGame->stageTimer == 269) { gMain.scoreOverlayActive = FALSE; @@ -290,19 +290,19 @@ void UpdateEvolutionMode(void) } else if (gCurrentPinballGame->modeAnimTimer == 24) { - if (gCurrentPinballGame->evoItemCount < 3) + if (gCurrentPinballGame->monProgressTowardsBonusCount < 3) { - gCurrentPinballGame->evoCatchLightSlot1 = gCurrentPinballGame->evoItemCount; - gCurrentPinballGame->evoCatchLightSlot2 = gCurrentPinballGame->evoItemCount; - gCurrentPinballGame->catchLights[gCurrentPinballGame->evoCatchLightSlot1] = 1; - gCurrentPinballGame->evoBlinkTimer = 120; - gCurrentPinballGame->evoItemCount++; - if (gCurrentPinballGame->evoItemCount < 3) + gCurrentPinballGame->evoCatchLightSlot1 = gCurrentPinballGame->monProgressTowardsBonusCount; + gCurrentPinballGame->evoCatchLightSlot2 = gCurrentPinballGame->monProgressTowardsBonusCount; + gCurrentPinballGame->modeProgressLights[gCurrentPinballGame->evoCatchLightSlot1] = MODE_PROGRESS_LAMP_BALL_LIT; + gCurrentPinballGame->modeProgressBlinkTimer = 120; + gCurrentPinballGame->monProgressTowardsBonusCount++; + if (gCurrentPinballGame->monProgressTowardsBonusCount < 3) { - gCurrentPinballGame->evoCatchLightSlot2 = gCurrentPinballGame->evoItemCount; - gCurrentPinballGame->catchLights[gCurrentPinballGame->evoCatchLightSlot2] = 1; - gCurrentPinballGame->evoBlinkTimer = 120; - gCurrentPinballGame->evoItemCount++; + gCurrentPinballGame->evoCatchLightSlot2 = gCurrentPinballGame->monProgressTowardsBonusCount; + gCurrentPinballGame->modeProgressLights[gCurrentPinballGame->evoCatchLightSlot2] = MODE_PROGRESS_LAMP_BALL_LIT; + gCurrentPinballGame->modeProgressBlinkTimer = 120; + gCurrentPinballGame->monProgressTowardsBonusCount++; } } @@ -357,7 +357,7 @@ void UpdateEvolutionMode(void) } else { - if (gCurrentPinballGame->catchLights[2] == 1) + if (gCurrentPinballGame->modeProgressLights[MODE_LAMP_RIGHT] == MODE_PROGRESS_LAMP_BALL_LIT) RequestBoardStateTransition(MAIN_BOARD_STATE_BOSS_HOLE_ACTIVE); else RequestBoardStateTransition(MAIN_BOARD_STATE_DEFAULT); @@ -388,7 +388,7 @@ void UpdateEvolutionItemAnimation(void) if (gCurrentPinballGame->evoItemAppearTimer == 80) { gCurrentPinballGame->activeFxType = FX_EVO_ITEM_SPAWN; - DmaCopy16(3, gEvoItemAppear_GfxList[gCurrentPinballGame->evoItemGfxIndex], (void *)0x06015800, 0x1C00); + DmaCopy16(3, gEvoItemAppear_GfxList[gCurrentPinballGame->evoItemGfxIndex], OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x1C00); DmaCopy16(3, gEvoItem_Pals[gCurrentPinballGame->evoItemGfxIndex], OBJ_PLTT_SLOT(PAL_IX_EVO_ITEM), PLTT_SLOT_SIZE); gCurrentPinballGame->evoItemAnimFrame = 0; gCurrentPinballGame->evoItemAnimFrameTimer = 0; @@ -451,7 +451,7 @@ void UpdateEvolutionItemAnimation(void) gCurrentPinballGame->scoreAddedInFrame = SCORE_EVO_ITEM_COLLECTED; MPlayStart(&gMPlayInfo_SE1, &se_evo_item_collected); gCurrentPinballGame->boardSubState = EVOLUTION_SUBSTATE_PREP_SPAWN_EVO_ITEM; - gCurrentPinballGame->catchLights[gCurrentPinballGame->evoItemsCaught] = 5; + gCurrentPinballGame->modeProgressLights[gCurrentPinballGame->evoItemsCaught] = MODE_PROGRESS_LAMP_EVO_LIT; gCurrentPinballGame->evoItemsCaught++; gMain.fieldSpriteGroups[FIELD_SG_EVO_ITEM]->active = FALSE; if (gCurrentPinballGame->evoItemsCaught == 3) @@ -471,7 +471,7 @@ void UpdateEvolutionItemAnimation(void) if (index > 14) index = 14; - DmaCopy16(3, gEvoItemTilesGfxPtrs[gCurrentPinballGame->evoItemGfxIndex] + index * 0x200, (void *)0x060116C0, 0x200); + DmaCopy16(3, gEvoItemTilesGfxPtrs[gCurrentPinballGame->evoItemGfxIndex] + index * 0x200, OBJ_TILE_ADDR(TILE_INDEX(0, 5, 22)), 0x200); oamSimple = &group->oam[0]; gOamBuffer[oamSimple->oamId].x = oamSimple->xOffset + group->baseX; gOamBuffer[oamSimple->oamId].y = oamSimple->yOffset + group->baseY; diff --git a/src/main_board_intro_mode.c b/src/main_board_intro_mode.c index 08743a1d..f4e0551c 100644 --- a/src/main_board_intro_mode.c +++ b/src/main_board_intro_mode.c @@ -36,7 +36,7 @@ void InitBoardIntroMode(void) gCurrentPinballGame->catchTilePalette[i] = PAL_IX_LOCATION_PORTRAIT; DmaCopy16(3, gTravelPortrait_Pal, OBJ_PLTT_SLOT(PAL_IX_TRAVEL_PAINTER), PLTT_SLOT_SIZE); - DmaCopy16(3, gAreaRouletteSelectedFx_Gfx, (void *)0x06015800, 0x280); + DmaCopy16(3, gAreaRouletteSelectedFx_Gfx, OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x280); gCurrentPinballGame->activeFxType = FX_FIRST_AREA_SELECTION; } @@ -315,5 +315,5 @@ void SetBoardArrowState(s16 arg0) gCurrentPinballGame->catchArrowProgress = 2; } - gCurrentPinballGame->progressLevel = 1; + gCurrentPinballGame->bonusMultTracker = 1; } diff --git a/src/main_board_launcher_and_cutscenes.c b/src/main_board_launcher_and_cutscenes.c index d9d89a5f..8eed6c3e 100644 --- a/src/main_board_launcher_and_cutscenes.c +++ b/src/main_board_launcher_and_cutscenes.c @@ -73,7 +73,7 @@ void AnimateOneUpSprite(void) index = 0; } - DmaCopy16(3, gOneUpBannerSprite_Gfx[index], (void *)0x060152A0, 0x200); + DmaCopy16(3, gOneUpBannerSprite_Gfx[index], OBJ_TILE_ADDR(TILE_INDEX(1, 4, 21)), 0x200); } else { @@ -115,7 +115,7 @@ void AnimateOneUpSprite(void) if (gCurrentPinballGame->oneUpAnimTimer < 58) { index = gCurrentPinballGame->numLives - 1 + (((gCurrentPinballGame->oneUpAnimTimer % 16) / 8) * 9); - DmaCopy16(3, gLifeCountDigit_Gfx[index], (void *)0x06015520, 0x40); + DmaCopy16(3, gLifeCountDigit_Gfx[index], OBJ_TILE_ADDR(TILE_INDEX(1, 5, 9)), 0x40); oamSimple = &group->oam[2]; gOamBuffer[oamSimple->oamId].x = oamSimple->xOffset + 216; gOamBuffer[oamSimple->oamId].y = oamSimple->yOffset - 112; @@ -284,7 +284,7 @@ void DrawSpoinkSprite(void) else index = gSpoinkAnimFrameset[gCurrentPinballGame->spoinkAnimFrameIx][0]; - DmaCopy16(3, gSpoinkEntity_Gfx[index], (void *)0x060120E0, 0x1C0); + DmaCopy16(3, gSpoinkEntity_Gfx[index], OBJ_TILE_ADDR(TILE_INDEX(0, 8, 7)), 0x1C0); group->baseX = 231 - gCurrentPinballGame->cameraXOffset; group->baseY = 376 - gCurrentPinballGame->cameraYOffset; for (i = 0; i < 3; i++) @@ -321,7 +321,7 @@ void RunEvolutionCutscene(void) if (gCurrentPinballGame->stageTimer == 10) { gCurrentPinballGame->activeFxType = FX_EVOLUTION_CUTSCENE; - DmaCopy16(3, gEvolutionCutsceneTilesGfx, (void *)0x06015800, 0x2400); + DmaCopy16(3, gEvolutionCutsceneTilesGfx, OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x2400); DmaCopy16(3, gBoardActionObj_Pals, OBJ_PLTT_SLOT(PAL_IX_BANNER), PLTT_SLOT_SIZE); gMain.fieldSpriteGroups[FIELD_SG_EVOLUTION_TEXT_LARGE_BOTTOM]->active = TRUE; gMain.fieldSpriteGroups[FIELD_SG_EVOLUTION_TEXT_LARGE_TOP]->active = TRUE; @@ -345,7 +345,7 @@ void RunEvolutionCutscene(void) gBG0TilemapBuffer[(i + 15) * 0x20 + j] = 0xC100; } - DmaCopy16(3, gBG0TilemapBuffer, BG_CHAR_SCREEN_ADDR(0,4), BG_SCREEN_SIZE); + DmaCopy16(3, gBG0TilemapBuffer, BG_TILE_ADDR(TILE_INDEX(0,8,0)), BG_SCREEN_SIZE); if (var0 == 30) m4aSongNumStart(MUS_EVOLUTION); @@ -360,7 +360,7 @@ void RunEvolutionCutscene(void) gBG0TilemapBuffer[(i + 15) * 32 + j] = 0xC100; } - DmaCopy16(3, gBG0TilemapBuffer, BG_CHAR_SCREEN_ADDR(0,4), BG_SCREEN_SIZE); + DmaCopy16(3, gBG0TilemapBuffer, BG_TILE_ADDR(TILE_INDEX(0,8,0)), BG_SCREEN_SIZE); } } @@ -613,7 +613,7 @@ void RunEvolutionCutscene(void) for (i = 0x1E0; i < 0x340; i++) gBG0TilemapBuffer[i] = 0x1FF; - DmaCopy16(3, gBG0TilemapBuffer, BG_CHAR_SCREEN_ADDR(0,4), BG_SCREEN_SIZE); + DmaCopy16(3, gBG0TilemapBuffer, BG_TILE_ADDR(TILE_INDEX(0,8,0)), BG_SCREEN_SIZE); if (gMain.selectedField == FIELD_SAPPHIRE) gCurrentPinballGame->sapphireBumperTimer = 0; } @@ -629,7 +629,7 @@ void RunEvolutionCutscene(void) gCurrentPinballGame->currentSpecies = gCurrentPinballGame->postEvoSpecies; LoadPortraitGraphics(PORTRAIT_STATE_POKEMON_DISPLAY, PORTRAIT_MAIN_SLOT); gCurrentPinballGame->activeFxType = FX_END_OF_EVO_LIGHTNING; - DmaCopy16(3, gCatchTile_BurstStage4_Gfx, (void *)0x06015800, 0x1800); + DmaCopy16(3, gCatchTile_BurstStage4_Gfx, OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x1800); DmaCopy16(3, gCatchTile_BurstStage4_Pal, OBJ_PLTT_SLOT(PAL_IX_CATCH_TILE_FX), PLTT_SLOT_SIZE); gCurrentPinballGame->creatureOamPriority = 3; } @@ -718,15 +718,15 @@ void RunTravelEventCutscene(void) gCurrentPinballGame->activeFxType = FX_TRAVEL_PAINTER_CUTSCENE; if (gMain.selectedField == FIELD_RUBY) { - DmaCopy16(3, gRubyTravelPaint_Gfx, (void *)0x06015800, 0x1800); + DmaCopy16(3, gRubyTravelPaint_Gfx, OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x1800); DmaCopy16(3, gRubyPainter_Pals, OBJ_PLTT_SLOT(PAL_IX_TRAVEL_PAINTER), PLTT_SLOT_SIZE); - DmaCopy16(3, gRubyTravelVolbeat_Gfx, (void *)0x06015800, 0x480); + DmaCopy16(3, gRubyTravelVolbeat_Gfx, OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x480); } else { - DmaCopy16(3, gSapphireTravelPaint_Gfx, (void *)0x06015800, 0x1800); + DmaCopy16(3, gSapphireTravelPaint_Gfx, OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x1800); DmaCopy16(3, gSapphirePainter_Pals, OBJ_PLTT_SLOT(PAL_IX_TRAVEL_PAINTER), PLTT_SLOT_SIZE); - DmaCopy16(3, gSapphireTravelIllumise_Gfx, (void *)0x06015800, 0x480); + DmaCopy16(3, gSapphireTravelIllumise_Gfx, OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x480); } } else @@ -830,11 +830,11 @@ void RunTravelEventCutscene(void) if (gMain.selectedField == FIELD_RUBY) { - DmaCopy16(3, gRubyTravelVolbeat_Gfx[index], (void *) 0x06015800, 0x480); + DmaCopy16(3, gRubyTravelVolbeat_Gfx[index], OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x480); } else { - DmaCopy16(3, gSapphireTravelIllumise_Gfx[index], (void *) 0x06015800, 0x480); + DmaCopy16(3, gSapphireTravelIllumise_Gfx[index], OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x480); } index = gTravelEventAnimData[gCurrentPinballGame->travelAnimKeyframeIndex][0]; diff --git a/src/main_board_pichu_entity.c b/src/main_board_pichu_entity.c index 2edaa63f..928941dd 100644 --- a/src/main_board_pichu_entity.c +++ b/src/main_board_pichu_entity.c @@ -107,7 +107,7 @@ void UpdateKickbackLogic(void) else gCurrentPinballGame->pikaSaverTileIndex[outlaneChuteIx] = 2; - DmaCopy16(3, gPikaSaverTilesGfx + (gCurrentPinballGame->pikaSaverTileIndex[outlaneChuteIx] * 0x180), 0x06010480 + ((outlaneChuteIx) * 0x180), 0x180); + DmaCopy16(3, gPikaSaverTilesGfx + (gCurrentPinballGame->pikaSaverTileIndex[outlaneChuteIx] * 0x180), OBJ_TILE_ADDR(TILE_INDEX(0, 1, 4 + 12 * outlaneChuteIx)), 0x180); } if (gCurrentPinballGame->outLanePikaPosition == PIKA_BOTH_SIDES) @@ -211,11 +211,11 @@ void UpdateKickbackLogic(void) if (gCurrentPinballGame->outLanePikaPosition == PIKA_BOTH_SIDES && gCurrentPinballGame->outLaneSide == OUTLANE_RIGHT) { - DmaCopy16(3, gPikaSaverFullCoverageGfx, 0x06015800, 0x2400); + DmaCopy16(3, gPikaSaverFullCoverageGfx, OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x2400); } else { - DmaCopy16(3, gPikaSaverPartialCoverageGfx, 0x06015800, 0x2400); + DmaCopy16(3, gPikaSaverPartialCoverageGfx, OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x2400); } } } @@ -247,7 +247,7 @@ void UpdateKickbackLogic(void) else gCurrentPinballGame->pikaSaverTileIndex[outlaneChuteIx] = 0; - DmaCopy16(3, gPikaSaverTilesGfx + (gCurrentPinballGame->pikaSaverTileIndex[outlaneChuteIx] * 0x180), 0x06010480 + (outlaneChuteIx * 0x180), 0x180); + DmaCopy16(3, gPikaSaverTilesGfx + (gCurrentPinballGame->pikaSaverTileIndex[outlaneChuteIx] * 0x180), OBJ_TILE_ADDR(TILE_INDEX(0, 1, 4 + 12 * outlaneChuteIx)), 0x180); } } @@ -300,7 +300,7 @@ void UpdateKickbackLogic(void) { if ((gMain.fieldFrameCount % 5) == 0) { - DmaCopy16(3, gPikaSaverTilesGfx + (gCurrentPinballGame->pikaSaverTileIndex[outlaneChuteIx] * 0x180), 0x06010480 + (outlaneChuteIx * 0x180), 0x180); + DmaCopy16(3, gPikaSaverTilesGfx + (gCurrentPinballGame->pikaSaverTileIndex[outlaneChuteIx] * 0x180), OBJ_TILE_ADDR(TILE_INDEX(0, 1, 4 + 12 * outlaneChuteIx)), 0x180); } tempY = 380 - gCurrentPinballGame->cameraYOffset; @@ -360,7 +360,7 @@ void PichuArrivalSequence(void) { if (gCurrentPinballGame->pichuWalkMode != 1) { - DmaCopy16(3, gPikaSaverTilesGfx, (void *)0x06010600, 0x180); + DmaCopy16(3, gPikaSaverTilesGfx, OBJ_TILE_ADDR(TILE_INDEX(0, 1, 16)), 0x180); } } tempVec.x = gPikaSaverWaypoints[gCurrentPinballGame->creatureWaypointIndex].x - 120 - gCurrentPinballGame->walkMonXPos; @@ -383,7 +383,7 @@ void PichuArrivalSequence(void) else if (group->baseY < -30) group->baseY = -30; - DmaCopy16(3, gMonHatchSpriteGroup5_Gfx + (index + 30) * 0x120 , (void *)0x060112A0, 0x120); + DmaCopy16(3, gMonHatchSpriteGroup5_Gfx + (index + 30) * 0x120 , OBJ_TILE_ADDR(TILE_INDEX(0, 4, 21)), 0x120); for (i = 0; i < 4; i++) { oamSimple = &group->oam[i]; @@ -400,7 +400,7 @@ void PichuArrivalSequence(void) { if (gCurrentPinballGame->creatureWaypointIndex == 4) { - DmaCopy16(3, gPikachuSaverTilesGfx, (void *)0x06010600, 0x180); + DmaCopy16(3, gPikachuSaverTilesGfx, OBJ_TILE_ADDR(TILE_INDEX(0, 1, 16)), 0x180); gCurrentPinballGame->outLanePikaPosition = PIKA_BOTH_SIDES; gMain.fieldSpriteGroups[FIELD_SG_HATCH_MON_ENTITY]->active = FALSE; gCurrentPinballGame->pichuEntranceTimer = 1; diff --git a/src/main_board_to_be_split.c b/src/main_board_to_be_split.c index d5800a62..e37eabbc 100644 --- a/src/main_board_to_be_split.c +++ b/src/main_board_to_be_split.c @@ -181,11 +181,11 @@ void FullCatchStateCleanup(void) gCurrentPinballGame->bonusTrapEnabled = FALSE; LoadPortraitGraphics(PORTRAIT_STATE_CURRENT_LOCATION, PORTRAIT_MAIN_SLOT); gCurrentPinballGame->portraitDisplayState = PORTRAIT_DISPLAY_MODE_BOARD_CENTER; - gCurrentPinballGame->evoItemCount = 0; - gCurrentPinballGame->evoBlinkTimer = 0; - gCurrentPinballGame->catchLights[0] = 0; - gCurrentPinballGame->catchLights[1] = 0; - gCurrentPinballGame->catchLights[2] = 0; + gCurrentPinballGame->monProgressTowardsBonusCount = 0; + gCurrentPinballGame->modeProgressBlinkTimer = 0; + gCurrentPinballGame->modeProgressLights[MODE_LAMP_LEFT] = MODE_PROGRESS_LAMP_BALL_UNLIT; + gCurrentPinballGame->modeProgressLights[MODE_LAMP_CENTER] = MODE_PROGRESS_LAMP_BALL_UNLIT; + gCurrentPinballGame->modeProgressLights[MODE_LAMP_RIGHT] = MODE_PROGRESS_LAMP_BALL_UNLIT; } void InitBonusStageSelect(void) @@ -379,7 +379,7 @@ void UpdateBonusStageSelect(void) void ShowBonusTrapSprite(void) { - DmaCopy16(3, gMainStageBonusTrap_Gfx[0], (void *)0x060113C0, 0x300); + DmaCopy16(3, gMainStageBonusTrap_Gfx[0], OBJ_TILE_ADDR(TILE_INDEX(0, 4, 30)), 0x300); gMain.fieldSpriteGroups[FIELD_SG_CENTER_HOLE_GRAVITY_FX]->active = TRUE; gCurrentPinballGame->bonusTrapEnabled = TRUE; } @@ -407,7 +407,7 @@ void AnimateBonusTrapSprite(void) { if (gCurrentPinballGame->bonusTrapAnimFrame != gCurrentPinballGame->prevBonusTrapFrame) { - DmaCopy16(3, gMainStageBonusTrap_Gfx[gCurrentPinballGame->bonusTrapAnimFrame], (void *)0x060113C0, 0x300); + DmaCopy16(3, gMainStageBonusTrap_Gfx[gCurrentPinballGame->bonusTrapAnimFrame], OBJ_TILE_ADDR(TILE_INDEX(0, 4, 30)), 0x300); gCurrentPinballGame->prevBonusTrapFrame = gCurrentPinballGame->bonusTrapAnimFrame; } } @@ -462,11 +462,11 @@ void ProcessChargeIndicator(void) gCurrentPinballGame->fullChargeIndicatorBlinkTimer = 60; } - DmaCopy16(3, gChargeFillIndicator_Gfx[chargeLevelIx], (void *)0x06010AE0, 0x80); + DmaCopy16(3, gChargeFillIndicator_Gfx[chargeLevelIx], OBJ_TILE_ADDR(TILE_INDEX(0, 2, 23)), 0x80); } else { - DmaCopy16(3, gChargeFillIndicator_Gfx[gCurrentPinballGame->chargeFillValue], (void *)0x06010AE0, 0x80); + DmaCopy16(3, gChargeFillIndicator_Gfx[gCurrentPinballGame->chargeFillValue], OBJ_TILE_ADDR(TILE_INDEX(0, 2, 23)), 0x80); gCurrentPinballGame->prevChargeFillValue = gCurrentPinballGame->chargeFillValue; } } @@ -539,7 +539,7 @@ void UpdateRubyEvolutionShopSprite(void) if (gCurrentPinballGame->shopAnimTimer % 6 == 0) { - DmaCopy16(3, gRubyBoardShop_Gfx[index], (void *)0x06013D00, 0x500); + DmaCopy16(3, gRubyBoardShop_Gfx[index], OBJ_TILE_ADDR(TILE_INDEX(0, 15, 8)), 0x500); } group->baseX = 181 - gCurrentPinballGame->cameraXOffset; @@ -581,9 +581,9 @@ void RenderEvolutionUI(s16 arg0) if (arg0) { index = LEAD_DIGIT_10S(var1[3]); - DmaCopy16(3, gDecimalDigitTilesGfx[index], (void *)0x06015DA0, 0x40); + DmaCopy16(3, gDecimalDigitTilesGfx[index], OBJ_TILE_ADDR(TILE_INDEX(1, 7, 13)), 0x40); index = DIGIT_1S(var1[3]); - DmaCopy16(3, gDecimalDigitTilesGfx[index], (void *)0x06015E60, 0x40); + DmaCopy16(3, gDecimalDigitTilesGfx[index], OBJ_TILE_ADDR(TILE_INDEX(1, 7, 19)), 0x40); } if (group->active) @@ -725,7 +725,7 @@ void RenderEvolutionUI(s16 arg0) } // Used for change selection sheen, sold out banner/greying - DmaCopy16(3, gShopPortraitOverlayGfx[index], (void *)0x06016220, 0x300); + DmaCopy16(3, gShopPortraitOverlayGfx[index], OBJ_TILE_ADDR(TILE_INDEX(1, 8, 17)), 0x300); for (i = 0; i < 2; i++) { oamSimple = &group->oam[i]; @@ -860,7 +860,7 @@ void InitTotodileEggDelivery(void) gCurrentPinballGame->portraitOffsetY = 160; gCurrentPinballGame->activeFxType = FX_TOTODILE_EGG_DELIVERY; DmaCopy16(3, gTotodile_Pal, OBJ_PLTT_SLOT(PAL_IX_RUBY_EGG_DELIVERER), PLTT_SLOT_SIZE); - DmaCopy16(3, gTotodileEggDelivery_Gfx, (void *)0x06015800, 0xCA0); + DmaCopy16(3, gTotodileEggDelivery_Gfx, OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0xCA0); } void AnimateTotodileEggDelivery(void) @@ -903,7 +903,7 @@ void AnimateTotodileEggDelivery(void) { gCurrentPinballGame->portraitOffsetX = 0; gCurrentPinballGame->portraitOffsetY = 0; - DmaCopy16(3, gEggFrameTilesGfx[0], (void *)0x06011CE0, 0x200); + DmaCopy16(3, gEggFrameTilesGfx[0], OBJ_TILE_ADDR(TILE_INDEX(0, 7, 7)), 0x200); } if (gCurrentPinballGame->totodileDeliveryFrame == 14) @@ -943,7 +943,7 @@ void InitAerodactylEggDelivery(void) gCurrentPinballGame->portraitOffsetY = gCurrentPinballGame->eggDeliveryY / 20 - gFlyingCreatureCameraOffsets[0].y; gCurrentPinballGame->activeFxType = FX_AERODACTYL_EGG_DELIVERY; DmaCopy16(3, gAerodactlyFlight_Pal, OBJ_PLTT_SLOT(PAL_IX_RUBY_EGG_DELIVERER), PLTT_SLOT_SIZE); - DmaCopy16(3, gAerodactlyFlight_Gfx, (void *)0x06015800, 0x1000); + DmaCopy16(3, gAerodactlyFlight_Gfx, OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x1000); } void AnimateAerodactylEggDelivery(void) @@ -981,7 +981,7 @@ void AnimateAerodactylEggDelivery(void) if (gCurrentPinballGame->eggDropTimer == 78) gCurrentPinballGame->scoreAddedInFrame = SCORE_AERODACTYL_EGG_DELIVERY; - DmaCopy16(3, gEggFrameTilesGfx[0], (void *)0x06011CE0, 0x200); + DmaCopy16(3, gEggFrameTilesGfx[0], OBJ_TILE_ADDR(TILE_INDEX(0, 7, 7)), 0x200); } else { @@ -1019,13 +1019,13 @@ void LoadPokemonNameGraphics(void) { if (gSpeciesInfo[gCurrentPinballGame->currentSpecies].name[i] == ' ') { - DmaCopy16(3, gSpaceTileGfx, (void *)0x06015800 + i * 0x40, 0x40); + DmaCopy16(3, gSpaceTileGfx, OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)) + i * 0x40, 0x40); gCurrentPinballGame->nameSpacingOffset += 4; } else { index = gSpeciesInfo[gCurrentPinballGame->currentSpecies].name[i] - 'A'; - DmaCopy16(3, gAlphabetTilesGfx[index], (void *)0x06015800 + i * 0x40, 0x40); + DmaCopy16(3, gAlphabetTilesGfx[index], OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)) + i * 0x40, 0x40); } } } @@ -1070,13 +1070,13 @@ void InitWasCaughtBanner(void) { if (gSpeciesInfo[gCurrentPinballGame->currentSpecies].name[i] == ' ') { - DmaCopy16(3, gSpaceTileGfx, (void *)0x06015800 + i * 0x40, 0x40); + DmaCopy16(3, gSpaceTileGfx, OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)) + i * 0x40, 0x40); gCurrentPinballGame->nameSpacingOffset += 4; } else { index = gSpeciesInfo[gCurrentPinballGame->currentSpecies].name[i] - 'A'; - DmaCopy16(3, gAlphabetTilesGfx[index], (void *)0x06015800 + i * 0x40, 0x40); + DmaCopy16(3, gAlphabetTilesGfx[index], OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)) + i * 0x40, 0x40); } } @@ -1085,12 +1085,13 @@ void InitWasCaughtBanner(void) { if (gCaughtTextChars[i] == ' ') { - DmaCopy16(3, gSpaceTileGfx, (void *)0x06015800 + (i + 10) * 0x40, 0x40); + //TILE_INDEX(1, 6, 20 + 2 * i) + DmaCopy16(3, gSpaceTileGfx, OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)) + (i + 10) * 0x40, 0x40); } else { index = gCaughtTextChars[i] - 'A'; - DmaCopy16(3, gAlphabetTilesGfx[index], (void *)0x06015800 + (i + 10) * 0x40, 0x40); + DmaCopy16(3, gAlphabetTilesGfx[index], OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)) + (i + 10) * 0x40, 0x40); } } @@ -1332,9 +1333,9 @@ void UpdateRubyEggHatchAnimation(void) if (gCurrentPinballGame->prevEggAnimFrame != gCurrentPinballGame->eggAnimFrameIndex) { index = gEggAnimationFrameData[gCurrentPinballGame->eggAnimFrameIndex][2]; - DmaCopy16(3, gRubyBoardHatchCave_Gfx[index], (void *)0x060122A0, 0x480); + DmaCopy16(3, gRubyBoardHatchCave_Gfx[index], OBJ_TILE_ADDR(TILE_INDEX(0, 8, 21)), 0x480); index = gEggAnimationFrameData[gCurrentPinballGame->eggAnimFrameIndex][3]; - DmaCopy16(3, gEggFrameTilesGfx[index], (void *)0x06011CE0, 0x200); + DmaCopy16(3, gEggFrameTilesGfx[index], OBJ_TILE_ADDR(TILE_INDEX(0, 7, 7)), 0x200); gCurrentPinballGame->prevEggAnimFrame = gCurrentPinballGame->eggAnimFrameIndex; } @@ -1454,7 +1455,7 @@ void UpdateHatchCave(void) group->baseY = gCurrentPinballGame->cyndaquilCaveSpriteY - gCurrentPinballGame->cameraYOffset; if (var0 % 6 == 0) { - DmaCopy16(3, gRubyStageCyndaquil_Gfx[gCurrentPinballGame->cyndaquilFrame], (void *)0x06013300, 0x280); + DmaCopy16(3, gRubyStageCyndaquil_Gfx[gCurrentPinballGame->cyndaquilFrame], OBJ_TILE_ADDR(TILE_INDEX(0, 12, 24)), 0x280); } } else if (gCurrentPinballGame->cyndaquilPosition == CYNDAQUIL_POSITION_CAVE_ENTRANCE) @@ -1465,7 +1466,7 @@ void UpdateHatchCave(void) { gCurrentPinballGame->eggAnimationPhase = EGG_ANIM_PHASE_CYNDAQUIL_ENTERS_BALL_JUMP; gCurrentPinballGame->cyndaquilFrame = 1; - DmaCopy16(3, gRubyStageCyndaquil_Gfx[gCurrentPinballGame->cyndaquilFrame], (void *)0x06013300, 0x280); + DmaCopy16(3, gRubyStageCyndaquil_Gfx[gCurrentPinballGame->cyndaquilFrame], OBJ_TILE_ADDR(TILE_INDEX(0, 12, 24)), 0x280); gMain.modeChangeFlags |= MODE_CHANGE_BANNER; gCurrentPinballGame->bannerDelayTimer = 0; gCurrentPinballGame->bannerDisplayTimer = 60; @@ -1588,10 +1589,10 @@ void CleanupEggModeState(void) gCurrentPinballGame->portraitDisplayState = PORTRAIT_DISPLAY_MODE_BOARD_CENTER; for (i = 0; i < 3; i++) { - if (i < gCurrentPinballGame->evoItemCount) - gCurrentPinballGame->catchLights[i] = 1; + if (i < gCurrentPinballGame->monProgressTowardsBonusCount) + gCurrentPinballGame->modeProgressLights[i] = MODE_PROGRESS_LAMP_BALL_LIT; else - gCurrentPinballGame->catchLights[i] = 0; + gCurrentPinballGame->modeProgressLights[i] = MODE_PROGRESS_LAMP_BALL_UNLIT; } } @@ -1714,7 +1715,7 @@ void UpdateEggMode(void) group->baseX = gCurrentPinballGame->walkMonXPos / 10 - gCurrentPinballGame->cameraXOffset; group->baseY = gCurrentPinballGame->walkMonYPos / 10 - gCurrentPinballGame->cameraYOffset; - DmaCopy16(3, gCatchSpriteFrameBuffer[var0], (void *)0x060112A0, 0x120); + DmaCopy16(3, gCatchSpriteFrameBuffer[var0], OBJ_TILE_ADDR(TILE_INDEX(0, 4, 21)), 0x120); DmaCopy16(3, gCatchSpritePaletteBuffer, OBJ_PLTT_SLOT(PAL_IX_CATCH_MON), PLTT_SLOT_SIZE); for (i = 0; i < 4; i++) { @@ -1804,7 +1805,7 @@ void UpdateEggMode(void) } } - DmaCopy16(3, gCatchSpriteFrameBuffer[var0], (void *)0x060112A0, 0x120); + DmaCopy16(3, gCatchSpriteFrameBuffer[var0], OBJ_TILE_ADDR(TILE_INDEX(0, 4, 21)), 0x120); gCurrentPinballGame->waypointSubTimer++; group->baseX = gCurrentPinballGame->walkMonXPos / 10 - gCurrentPinballGame->cameraXOffset; group->baseY = gCurrentPinballGame->walkMonYPos / 10 - gCurrentPinballGame->cameraYOffset; @@ -1889,7 +1890,7 @@ void UpdateEggMode(void) else if (group->baseY < -30) group->baseY = -30; - DmaCopy16(3, gCatchSpriteFrameBuffer[var0], (void *)0x060112A0, 0x120); + DmaCopy16(3, gCatchSpriteFrameBuffer[var0], OBJ_TILE_ADDR(TILE_INDEX(0, 4, 21)), 0x120); for (i = 0; i < 4; i++) { oamSimple = &group->oam[i]; @@ -1937,9 +1938,9 @@ void UpdateEggMode(void) case EGG_HATCH_SUBSTATE_SETUP_CATCH_ANIMATION: gCurrentPinballGame->activeFxType = FX_CAPTURE_MON_ABSORB; DmaCopy16(3, gCaptureHit_Pal, OBJ_PLTT_SLOT(PAL_IX_MON_SHADOW_PORTRAIT), PLTT_SLOT_SIZE); - DmaCopy16(3, gCaptureScreenTilesGfx, (void *)0x06015800, 0x1C00); - DmaCopy16(3, &gCaptureBallTilesGfx[gCurrentPinballGame->ballUpgradeType * 0x200], (void *)0x060164C0, 0x80); - DmaCopy16(3, &gCaptureBallTilesGfx[(gCurrentPinballGame->ballUpgradeType * 8 + 4) * 0x40], (void *)0x06016760, 0x80); + DmaCopy16(3, gCaptureScreenTilesGfx, OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x1C00); + DmaCopy16(3, &gCaptureBallTilesGfx[gCurrentPinballGame->ballUpgradeType * 0x200], OBJ_TILE_ADDR(TILE_INDEX(1, 9, 6)), 0x80); + DmaCopy16(3, &gCaptureBallTilesGfx[(gCurrentPinballGame->ballUpgradeType * 8 + 4) * 0x40], OBJ_TILE_ADDR(TILE_INDEX(1, 9, 27)), 0x80); gCurrentPinballGame->captureSequenceFrame = 0; gCurrentPinballGame->captureState = MON_CAPTURE_SPECIAL_STATE_CAPTURE_CUTSCENE; gCurrentPinballGame->catchTargetX = gCurrentPinballGame->walkMonXPos / 10 + 8; @@ -1953,7 +1954,7 @@ void UpdateEggMode(void) if (group->baseY > 180) group->baseY = 180; - DmaCopy16(3, gCatchAnimTileBuffer, (void *)0x060112A0, 0x120); + DmaCopy16(3, gCatchAnimTileBuffer, OBJ_TILE_ADDR(TILE_INDEX(0, 4, 21)), 0x120); for (i = 0; i < 4; i++) { oamSimple = &group->oam[i]; @@ -1982,7 +1983,7 @@ void UpdateEggMode(void) gOamBuffer[oamSimple->oamId].y = oamSimple->yOffset + group->baseY; } - DmaCopy16(3, gCatchAnimTileBuffer, (void *)0x060112A0, 0x120); + DmaCopy16(3, gCatchAnimTileBuffer, OBJ_TILE_ADDR(TILE_INDEX(0, 4, 21)), 0x120); if (gCurrentPinballGame->captureSequenceTimer == 23) gMain.fieldSpriteGroups[FIELD_SG_HATCH_MON_ENTITY]->active = FALSE; } @@ -2014,7 +2015,7 @@ void UpdateEggMode(void) } else { - if (gCurrentPinballGame->catchLights[2] == 1) + if (gCurrentPinballGame->modeProgressLights[MODE_LAMP_RIGHT] == MODE_PROGRESS_LAMP_BALL_LIT) RequestBoardStateTransition(MAIN_BOARD_STATE_BOSS_HOLE_ACTIVE); else RequestBoardStateTransition(MAIN_BOARD_STATE_DEFAULT); diff --git a/src/options.c b/src/options.c index 72a5b4b0..ae304334 100644 --- a/src/options.c +++ b/src/options.c @@ -96,10 +96,10 @@ void Options_LoadGraphics(void) gMain.dispcntBackup = REG_DISPCNT; DmaCopy16(3, gOptionsBackground_Pals, BG_PLTT, BG_PLTT_SIZE); - DmaCopy16(3, gOptionsText_Gfx, BG_CHAR_ADDR(1), 0x1800); - DmaCopy16(3, gOptionsBackground_Gfx, BG_CHAR_ADDR(2), 0xC00); + DmaCopy16(3, gOptionsText_Gfx, BG_TILE_ADDR(TILE_INDEX(1,0,0)), 0x1800); + DmaCopy16(3, gOptionsBackground_Gfx, BG_TILE_ADDR(TILE_INDEX(2,0,0)), 0xC00); DmaCopy16(3, gOptionsText_Tilemap, gBG0TilemapBuffer, BG_SCREEN_SIZE); - DmaCopy16(3, gBG0TilemapBuffer, BG_CHAR_ADDR(0), BG_SCREEN_SIZE); + DmaCopy16(3, gBG0TilemapBuffer, BG_TILE_ADDR(TILE_INDEX(0,0,0)), BG_SCREEN_SIZE); if (gGameBoyPlayerEnabled != TRUE) { @@ -107,10 +107,10 @@ void Options_LoadGraphics(void) SetStringPalette(18, 5, 3, 2, 2); } - DmaCopy16(3, gBG0TilemapBuffer, BG_SCREEN_ADDR(0), BG_SCREEN_SIZE); - DmaCopy16(3, gOptionsBackground_Tilemap, BG_SCREEN_ADDR(1), BG_SCREEN_SIZE); + DmaCopy16(3, gBG0TilemapBuffer, BG_TILE_ADDR(TILE_INDEX(0,0,0)), BG_SCREEN_SIZE); + DmaCopy16(3, gOptionsBackground_Tilemap, BG_TILE_ADDR(TILE_INDEX(0,2,0)), BG_SCREEN_SIZE); DmaCopy16(3, gGBAButtonIcons_Pals, OBJ_PLTT_SLOT(PAL_IX_0), 3*PLTT_SLOT_SIZE); - DmaCopy16(3, gOptionsSprites_Gfx, OBJ_VRAM0, 0x2020); + DmaCopy16(3, gOptionsSprites_Gfx, OBJ_TILE_ADDR(TILE_INDEX(0,0,0)), 0x2020); Options_InitStates(); UpdateOptionsSpritePositions(); m4aMPlayAllStop(); diff --git a/src/pokedex.c b/src/pokedex.c index 5c519a3f..d3eed954 100644 --- a/src/pokedex.c +++ b/src/pokedex.c @@ -128,14 +128,14 @@ void LoadPokedexGraphics(void) gMain.dispcntBackup = REG_DISPCNT; - DmaCopy16(3, gPokedexBgText_Gfx, BG_CHAR_ADDR(1), 0x4400); - DmaCopy16(3, gPokedexBg_Gfx, BG_CHAR_ADDR(3), 0x1400); + DmaCopy16(3, gPokedexBgText_Gfx, BG_TILE_ADDR(TILE_INDEX(1,0,0)), 0x4400); + DmaCopy16(3, gPokedexBg_Gfx, BG_TILE_ADDR(TILE_INDEX(3,0,0)), 0x1400); DmaCopy16(3, gPokedexBackground_Pals, BG_PLTT, BG_PLTT_SIZE); DmaCopy16(3, gPokedexBg1_Tilemap, gBG0TilemapBuffer, BG_SCREEN_SIZE); DmaCopy16(3, gPokedexBg2_Tilemap, gPokedexVramBuffer, BG_SCREEN_SIZE); - DmaCopy16(3, gPokedexBg3_Tilemap, BG_SCREEN_ADDR(2), BG_SCREEN_SIZE); + DmaCopy16(3, gPokedexBg3_Tilemap, BG_TILE_ADDR(TILE_INDEX(0,4,0)), BG_SCREEN_SIZE); DmaCopy16(3, gPokedexSprites_Pals, OBJ_PLTT, OBJ_PLTT_SIZE); - DmaCopy16(3, gPokedexSprites_Gfx, OBJ_VRAM0, 0x6C20); + DmaCopy16(3, gPokedexSprites_Gfx, OBJ_TILE_ADDR(TILE_INDEX(0,0,0)), 0x6C20); InitPokedexState(); PrintSeenOwnedTotals(gPokedexNumSeen, gPokedexNumOwned); @@ -148,8 +148,8 @@ void LoadPokedexGraphics(void) gPokedexVramBuffer[0x134] = 0x59; - DmaCopy16(3, gBG0TilemapBuffer, BG_SCREEN_ADDR(0), BG_SCREEN_SIZE); - DmaCopy16(3, gPokedexVramBuffer,BG_SCREEN_ADDR(1), BG_SCREEN_SIZE); + DmaCopy16(3, gBG0TilemapBuffer, BG_TILE_ADDR(TILE_INDEX(0,0,0)), BG_SCREEN_SIZE); + DmaCopy16(3, gPokedexVramBuffer,BG_TILE_ADDR(TILE_INDEX(0,2,0)), BG_SCREEN_SIZE); RenderPokedexSprites(); EnableVBlankInterrupts(); @@ -274,7 +274,7 @@ void Pokedex_HandleListInput(void) if (gPokedexFlags[gPokedexSelectedMon] >= 2) { gPokedexShowButtonPrompt = FALSE; - DmaCopy16(3, 0x6000280, gPokedexInfoWindowBackupTiles, 0x200); + DmaCopy16(3, BG_TILE_ADDR(TILE_INDEX(0, 0, 20)), gPokedexInfoWindowBackupTiles, 0x200); gMain.subState = POKEDEX_STATE_3; } else @@ -330,7 +330,7 @@ void Pokedex_HandleListInput(void) if (gPokedexFlags[gPokedexSelectedMon] >= SPECIES_DEX_SHARED) { gPokedexShowButtonPrompt = FALSE; - DmaCopy16(3, 0x6000280, gPokedexInfoWindowBackupTiles, 0x200); + DmaCopy16(3, BG_TILE_ADDR(TILE_INDEX(0, 0, 20)), gPokedexInfoWindowBackupTiles, 0x200); gMain.subState = POKEDEX_STATE_3; } else @@ -360,7 +360,7 @@ void Pokedex_HandleListInput(void) gPokedexScrollWaitFrames--; RenderPokedexSprites(); - DmaCopy16(3, gBG0TilemapBuffer, BG_SCREEN_ADDR(0), BG_SCREEN_SIZE); + DmaCopy16(3, gBG0TilemapBuffer, BG_TILE_ADDR(TILE_INDEX(0,0,0)), BG_SCREEN_SIZE); } void Pokedex_PostScrollRefresh(void) @@ -372,7 +372,7 @@ void Pokedex_PostScrollRefresh(void) gPokedexScrollWaitFrames--; RenderPokedexSprites(); - DmaCopy16(3, gBG0TilemapBuffer, BG_SCREEN_ADDR(0), BG_SCREEN_SIZE); + DmaCopy16(3, gBG0TilemapBuffer, BG_TILE_ADDR(TILE_INDEX(0,0,0)), BG_SCREEN_SIZE); gMain.subState = POKEDEX_STATE_HANDLE_LIST_INPUT; } @@ -389,8 +389,8 @@ void Pokedex_InfoWindowSlideIn(void) gPokedexInfoWindowSlideStep++; gPokedexVramBuffer[0x134] = 0x59; - DmaCopy16(3, gBG0TilemapBuffer, BG_SCREEN_ADDR(0), BG_SCREEN_SIZE); - DmaCopy16(3, gPokedexVramBuffer, BG_SCREEN_ADDR(1), BG_SCREEN_SIZE); + DmaCopy16(3, gBG0TilemapBuffer, BG_TILE_ADDR(TILE_INDEX(0,0,0)), BG_SCREEN_SIZE); + DmaCopy16(3, gPokedexVramBuffer, BG_TILE_ADDR(TILE_INDEX(0,2,0)), BG_SCREEN_SIZE); if (gPokedexInfoWindowSlideStep > 7) { @@ -403,7 +403,7 @@ void Pokedex_InfoWindowSlideIn(void) if (gPokedexSelectedMon < BONUS_SPECIES_START) gPokedexShowPageIndicator = 1; - DmaCopy16(3, gPokedexInfoWindowTilemap, (void *)0x6000280, 2*0xE0); + DmaCopy16(3, gPokedexInfoWindowTilemap, BG_TILE_ADDR(TILE_INDEX(0, 0, 20)), 2*0xE0); PrintDexDescription(gPokedexSelectedMon, gPokedexDescriptionPage); m4aMPlayVolumeControl(&gMPlayInfo_BGM, TRACKS_ALL, 0x40); PlayCry_NormalNoDucking(gSpeciesInfo[gPokedexSelectedMon].speciesIdRS, 0, 127, 10); @@ -562,8 +562,8 @@ void Pokedex_InfoWindowSlideOut(void) gPokedexInfoWindowSlideStep++; gPokedexVramBuffer[0x134] = 0x59; - DmaCopy16(3, gPokedexVramBuffer, BG_SCREEN_ADDR(1), BG_SCREEN_SIZE); - DmaCopy16(3, gBG0TilemapBuffer, BG_SCREEN_ADDR(0), BG_SCREEN_SIZE); + DmaCopy16(3, gPokedexVramBuffer, BG_TILE_ADDR(TILE_INDEX(0,2,0)), BG_SCREEN_SIZE); + DmaCopy16(3, gBG0TilemapBuffer, BG_TILE_ADDR(TILE_INDEX(0,0,0)), BG_SCREEN_SIZE); if (gPokedexInfoWindowSlideStep > 8) { @@ -572,7 +572,7 @@ void Pokedex_InfoWindowSlideOut(void) gPokedexShowButtonPrompt = TRUE; DmaFill16(3, 0, gTempGfxBuffer, 0x1800); - DmaFill16(3, 0, (void *)0x6005C00, 0x1800); + DmaFill16(3, 0, BG_TILE_ADDR(TILE_INDEX(1, 7, 0)), 0x1800); gMain.subState = POKEDEX_STATE_HANDLE_LIST_INPUT; } } @@ -1759,14 +1759,14 @@ static void PrintSelectedMonDexNum(s16 species) var0 += var2; } - CopyBgTilesRect(gTempGfxBuffer, (void *)0x06004C00, 8, 2); + CopyBgTilesRect(gTempGfxBuffer, (void *)BG_TILE_ADDR(TILE_INDEX(1, 3, 0)), 8, 2); DmaFill16(3, 0, gTempGfxBuffer, 0x800); var0 = 0; } else { for (i = 0; i < 10; i++) - CopyBgTilesRect((void *)&gPokedexTextGlyphs_Gfx[ENGLISH_GLYPHS_START], (void *)0x06004C00 + i * 0x20, 1, 2); + CopyBgTilesRect((void *)&gPokedexTextGlyphs_Gfx[ENGLISH_GLYPHS_START], (void *)BG_TILE_ADDR(TILE_INDEX(1, 3, i)), 1, 2); } if (gPokedexFlags[species] == SPECIES_DEX_SEEN || gPokedexFlags[species] > SPECIES_DEX_SHARED) @@ -1784,13 +1784,13 @@ static void PrintSelectedMonDexNum(s16 species) var0 += var2; } - CopyBgTilesRect(gTempGfxBuffer, (void *)0x06004D00, 9, 2); + CopyBgTilesRect(gTempGfxBuffer, (void *)BG_TILE_ADDR(TILE_INDEX(1, 3, 8)), 9, 2); DmaFill16(3, 0, gTempGfxBuffer, 0x800); } else { for (i = 0; i < 9; i++) - CopyBgTilesRect((void *)&gPokedexTextGlyphs_Gfx[ENGLISH_GLYPHS_START], (void *)0x06004D00 + i * 0x20, 1, 2); + CopyBgTilesRect((void *)&gPokedexTextGlyphs_Gfx[ENGLISH_GLYPHS_START], (void *)BG_TILE_ADDR(TILE_INDEX(1, 3, 8 + i)), 1, 2); } if (gPokedexFlags[species] == SPECIES_DEX_CAUGHT) @@ -1927,20 +1927,20 @@ void LoadMonPortrait(s16 species) switch (state) { case SPECIES_DEX_UNSEEN: - CopyBgTilesRect(gPokedexSprites_Gfx + 0x5C00, (void *)0x06013400, 24, 1); + CopyBgTilesRect(gPokedexSprites_Gfx + 0x5C00, (void*)OBJ_TILE_ADDR(TILE_INDEX(0, 13, 0)), 24, 1); DmaCopy16(3, gPokedexSprites_Pals, OBJ_PLTT_SLOT(PAL_IX_BALL), PLTT_SLOT_SIZE); break; case SPECIES_DEX_SEEN: - CopyBgTilesRect(gMonPortraitGroupGfx[var1] + var2 * 0x300, (void *)0x06013400, 24, 1); + CopyBgTilesRect(gMonPortraitGroupGfx[var1] + var2 * 0x300, (void*)OBJ_TILE_ADDR(TILE_INDEX(0, 13, 0)), 24, 1); DmaCopy16(3, gMonPortraitGroupPals[0][15], OBJ_PLTT_SLOT(PAL_IX_BALL), PLTT_SLOT_SIZE); break; case SPECIES_DEX_SHARED: case SPECIES_DEX_SHARED_AND_SEEN: - CopyBgTilesRect(gMonPortraitGroupGfx[var1] + var2 * 0x300, (void *)0x06013400, 24, 1); - DarkenPalette(&gMonPortraitGroupPals[var1][var2], OBJ_PLTT_SLOT(PAL_IX_BALL), 0x20, 0xE); + CopyBgTilesRect(gMonPortraitGroupGfx[var1] + var2 * 0x300, (void*)OBJ_TILE_ADDR(TILE_INDEX(0, 13, 0)), 24, 1); + DarkenPalette(&gMonPortraitGroupPals[var1][var2], (void*)OBJ_PLTT_SLOT(PAL_IX_BALL), 0x20, 0xE); break; case SPECIES_DEX_CAUGHT: - CopyBgTilesRect(gMonPortraitGroupGfx[var1] + var2 * 0x300, (void *)0x06013400, 24, 1); + CopyBgTilesRect(gMonPortraitGroupGfx[var1] + var2 * 0x300, (void*)OBJ_TILE_ADDR(TILE_INDEX(0, 13, 0)), 24, 1); DmaCopy16(3, gMonPortraitGroupPals[var1][var2], OBJ_PLTT_SLOT(PAL_IX_BALL), PLTT_SLOT_SIZE); break; } @@ -1975,7 +1975,7 @@ void PrintDexDescription(s16 species, u32 page) var0 = 0; } - DmaCopy16(3, gTempGfxBuffer, BG_CHAR_SCREEN_ADDR(1,3) + 0x400 , 3*BG_SCREEN_SIZE); + DmaCopy16(3, gTempGfxBuffer, BG_TILE_ADDR(TILE_INDEX(1,7,0)), 3*BG_SCREEN_SIZE); } void BlitGlyphToTileBuffer(s32 arg0, s32 arg1, s32 arg2) { @@ -2409,7 +2409,7 @@ void LoadMonAnimationSprite(s16 species) quotient = var0 / 5; remainder = var0 % 5; - CopyBgTilesRect(gCatchSpriteGfxPtrs[quotient] + remainder * 0xD80, (void *)(OBJ_VRAM0 + 0x3800), 108, 1); + CopyBgTilesRect(gCatchSpriteGfxPtrs[quotient] + remainder * 0xD80, (void*) OBJ_TILE_ADDR(TILE_INDEX(0, 14, 0)), 108, 1); DmaCopy16(3, gCatchMonPaletteGroups[quotient][remainder], OBJ_PLTT_SLOT(PAL_IX_2), PLTT_SLOT_SIZE); } else @@ -2418,7 +2418,7 @@ void LoadMonAnimationSprite(s16 species) quotient = (var0 - 100) / 6; remainder = (var0 - 100) % 6; - CopyBgTilesRect(gMonHatchSpriteGroupGfx[quotient][remainder], (void *)(OBJ_VRAM0 + 0x4800), 135, 1); + CopyBgTilesRect(gMonHatchSpriteGroupGfx[quotient][remainder], (void *) OBJ_TILE_ADDR(TILE_INDEX(1, 2, 0)), 135, 1); DmaCopy16(3, gMonHatchSpriteGroupPals[quotient][remainder], OBJ_PLTT_SLOT(PAL_IX_3), PLTT_SLOT_SIZE); } } diff --git a/src/rayquaza_process3.c b/src/rayquaza_process3.c index 4f05f8fa..1b86f4d5 100644 --- a/src/rayquaza_process3.c +++ b/src/rayquaza_process3.c @@ -128,8 +128,8 @@ void InitFrameProcess3_BoardLogic_RayquazaBoard(void) gCurrentPinballGame->windCloudPosition.y = 0; gCurrentPinballGame->flippersDisabled = TRUE; UpdateRayquazaIntroSequence(); - DmaCopy16(3, gRayquazaSkyBackgroundGfx, (void *)0x06015800, 0x2800); - DmaCopy16(3, gRayquazaSpriteSheet, (void *)0x06011620, 0x860); + DmaCopy16(3, gRayquazaSkyBackgroundGfx, OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x2800); + DmaCopy16(3, gRayquazaSpriteSheet, OBJ_TILE_ADDR(TILE_INDEX(0, 5, 17)), 0x860); UpdateRayquazaEntityLogic(); RenderRayquazaSprites(); DmaCopy16(3, gBonusStageObjPal, OBJ_PLTT_SLOT(PAL_IX_9), PLTT_SLOT_SIZE); @@ -155,7 +155,7 @@ void UpdateFrameProcess3_BoardLogic_RayquazaBoard(void) gCurrentPinballGame->stageTimer = 0; gMain.spriteGroups[SG_BONUS_COMPLETE_BANNER].active = TRUE; gMain.spriteGroups[SG_BONUS_COMPLETE_BANNER_SCORE].active = TRUE; - DmaCopy16(3, gRayquazaBonusClear_Gfx, (void *)0x06015800, 0x2000); + DmaCopy16(3, gRayquazaBonusClear_Gfx, OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x2000); gCurrentPinballGame->bannerSlideYOffset = 136; gMain.modeChangeFlags = MODE_CHANGE_BONUS_BANNER; gCurrentPinballGame->cameraLocked = TRUE; @@ -196,7 +196,7 @@ void UpdateFrameProcess3_BoardLogic_RayquazaBoard(void) gCurrentPinballGame->stageTimer = 140; gMain.spriteGroups[SG_BONUS_COMPLETE_BANNER].active = TRUE; gMain.spriteGroups[SG_BONUS_COMPLETE_BANNER_SCORE].active = TRUE; - DmaCopy16(3, gRayquazaBonusClear_Gfx, (void *)0x06015800, 0x2000); + DmaCopy16(3, gRayquazaBonusClear_Gfx, OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x2000); gCurrentPinballGame->bannerSlideYOffset = 136; gMain.modeChangeFlags = MODE_CHANGE_BONUS_BANNER; break; @@ -495,7 +495,7 @@ void UpdateRayquazaEntityLogic(void) else { gCurrentPinballGame->bossEntityState = RAYQUAZA_ENTITY_STATE_FLYBY; - DmaCopy16(3, gRayquazaFlyby_Gfx, (void *)0x06015800, 0x1C00); + DmaCopy16(3, gRayquazaFlyby_Gfx, OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x1C00); if (gCurrentPinballGame->windAttackCount & 1) { gMain.spriteGroups[SG_RAYQUAZA_ENTITY_FLYBY_RIGHT].active = TRUE; @@ -644,7 +644,7 @@ void UpdateRayquazaEntityLogic(void) break; case RAYQUAZA_ENTITY_STATE_BOARD_CLEANUP: - DmaCopy16(3, gRayquazaSpriteSheet, (void *)0x06011620, 0x860); + DmaCopy16(3, gRayquazaSpriteSheet, OBJ_TILE_ADDR(TILE_INDEX(0, 5, 17)), 0x860); gCurrentPinballGame->bossEntityState = RAYQUAZA_ENTITY_STATE_FLYDOWN; gCurrentPinballGame->bossPositionX = 1140; gCurrentPinballGame->bossPositionY = -1200; @@ -844,7 +844,7 @@ void RenderRayquazaSprites(void) } gCurrentPinballGame->bossVulnerable = gRayquazaAnimFramesetTable[gCurrentPinballGame->bossFramesetIndex][2]; - DmaCopy16(3, gRayquazaBodyVariantTiles[varSL], (void *)0x06011620, 0x800); + DmaCopy16(3, gRayquazaBodyVariantTiles[varSL], OBJ_TILE_ADDR(TILE_INDEX(0, 5, 17)), 0x800); } group = &gMain.spriteGroups[SG_RAYQUAZA_ENTITY_ROAR_HEAD_EXTENSION]; @@ -1401,7 +1401,7 @@ void UpdateRayquazaMinionsAndEffects(void) if (group->active) { - DmaCopy16(3, gRayquazaTornadoGfx[sp0], (void *)0x06011EA0, 0x280); + DmaCopy16(3, gRayquazaTornadoGfx[sp0], OBJ_TILE_ADDR(TILE_INDEX(0, 7, 21)), 0x280); group->baseX = gCurrentPinballGame->vortexScreenPosition[i].x / 10 - gCurrentPinballGame->cameraXOffset; group->baseY = gCurrentPinballGame->vortexScreenPosition[i].y / 10 - gCurrentPinballGame->cameraYOffset; for (j = 0; j < 2; j++) diff --git a/src/ruby_board_indicators.c b/src/ruby_board_indicators.c index 5453942f..f279479c 100644 --- a/src/ruby_board_indicators.c +++ b/src/ruby_board_indicators.c @@ -120,8 +120,8 @@ void DrawRubyProgressDigits(void) const u8 **src; const u8 **dest; - var0 = LEAD_DIGIT_10S(gCurrentPinballGame->progressLevel); - var1 = DIGIT_1S(gCurrentPinballGame->progressLevel); + var0 = LEAD_DIGIT_10S(gCurrentPinballGame->bonusMultTracker); + var1 = DIGIT_1S(gCurrentPinballGame->bonusMultTracker); src = gRubyProgressDigitTilePointers[var0]; dest = gRubyProgressDigitTilePointers[10]; @@ -142,22 +142,23 @@ void AnimateRubyTrapIndicator(void) DmaCopy16(3, src[1], dest[1], 0x40); } +//This is the section that sits under the picture, showing mons till next bonus, "Catch!", and "EVO" void AnimateRubyCatchLightBlink(void) { s16 i; const u8 **src; const u8 **dest; - if (gCurrentPinballGame->evoBlinkTimer) + if (gCurrentPinballGame->modeProgressBlinkTimer) { - gCurrentPinballGame->catchLights[gCurrentPinballGame->evoCatchLightSlot1] = 1 - (gCurrentPinballGame->evoBlinkTimer % 36) / 18; - gCurrentPinballGame->catchLights[gCurrentPinballGame->evoCatchLightSlot2] = gCurrentPinballGame->catchLights[gCurrentPinballGame->evoCatchLightSlot1]; - gCurrentPinballGame->evoBlinkTimer--; + gCurrentPinballGame->modeProgressLights[gCurrentPinballGame->evoCatchLightSlot1] = MODE_PROGRESS_LAMP_BALL_LIT - (gCurrentPinballGame->modeProgressBlinkTimer % 36) / 18; + gCurrentPinballGame->modeProgressLights[gCurrentPinballGame->evoCatchLightSlot2] = gCurrentPinballGame->modeProgressLights[gCurrentPinballGame->evoCatchLightSlot1]; + gCurrentPinballGame->modeProgressBlinkTimer--; } for (i = 0; i < 3; i++) { - src = gRubyCatchLightTilePointers[i][gCurrentPinballGame->catchLights[i]]; + src = gRubyCatchLightTilePointers[i][gCurrentPinballGame->modeProgressLights[i]]; dest = gRubyCatchLightTilePointers[i][6]; DmaCopy16(3, src[0], dest[0], 0x40); DmaCopy16(3, src[1], dest[1], 0x40); diff --git a/src/ruby_collision.c b/src/ruby_collision.c index 3d5e0d42..a57cfa39 100644 --- a/src/ruby_collision.c +++ b/src/ruby_collision.c @@ -336,8 +336,8 @@ void ProcessRubyCollisionEvent(u8 triggerType, s16* hasCollisionImpact, u16* col // Bonus Multiplier Addition button gCurrentPinballGame->scoreAddedInFrame = SCORE_RUBY_BONUS_MULTIPLIER_BUTTON; - if (gCurrentPinballGame->progressLevel <= 98) - gCurrentPinballGame->progressLevel++; + if (gCurrentPinballGame->bonusMultTracker <= 98) + gCurrentPinballGame->bonusMultTracker++; } else if (gCurrentPinballGame->ball->positionQ0.x > 91) { diff --git a/src/ruby_process3_entities_2.c b/src/ruby_process3_entities_2.c index 01f24247..b3b8ca54 100644 --- a/src/ruby_process3_entities_2.c +++ b/src/ruby_process3_entities_2.c @@ -143,7 +143,7 @@ void UpdateNuzleafEntity(void) { group->baseX = gNuzleafPositions[gCurrentPinballGame->nuzleafPositionIndex][0] - gCurrentPinballGame->cameraXOffset; group->baseY = gNuzleafPositions[gCurrentPinballGame->nuzleafPositionIndex][1] - gCurrentPinballGame->cameraYOffset; - DmaCopy16(3, gRubyStageNuzleaf_Gfx[gCurrentPinballGame->nuzleafGfxTileIndex], (void *)0x06014380, 0x260); + DmaCopy16(3, gRubyStageNuzleaf_Gfx[gCurrentPinballGame->nuzleafGfxTileIndex], OBJ_TILE_ADDR(TILE_INDEX(1, 0, 28)), 0x260); for (i = 0; i < 2; i++) { oamSimple = &group->oam[i]; @@ -219,7 +219,7 @@ void AnimateRubyShopDoor(void) gCurrentPinballGame->shopDoorAnimDelay = 4; } - DmaCopy16(3, gRubyBoardShopDoor_Gfx[gCurrentPinballGame->shopDoorCurrentFrame], (void *)0x06013180, 0x180); + DmaCopy16(3, gRubyBoardShopDoor_Gfx[gCurrentPinballGame->shopDoorCurrentFrame], OBJ_TILE_ADDR(TILE_INDEX(0, 12, 12)), 0x180); } } @@ -253,7 +253,7 @@ void DrawWhiscash(void) { frameIx = frameData[0]; DmaCopy16(3, gWhiscash_Pals[3*gCurrentPinballGame->paletteDimmingIx], OBJ_PLTT_SLOT(PAL_IX_RUBY_BUMPERS), PLTT_SLOT_SIZE); - DmaCopy16(3, gWhiscash_Gfx[frameIx], (void *)0x06014680, 0x460); + DmaCopy16(3, gWhiscash_Gfx[frameIx], OBJ_TILE_ADDR(TILE_INDEX(1, 1, 20)), 0x460); gCurrentPinballGame->rubyBumperCollisionPosition[0].x = -248; gCurrentPinballGame->rubyBumperCollisionPosition[0].y = -316; group->baseX = frameData[2] + 124u - gCurrentPinballGame->cameraXOffset; @@ -761,7 +761,7 @@ void RubyPondTriBumperHandleHitAndDraw(void) gCurrentPinballGame->bannerSlidePosition = -2500; gCurrentPinballGame->bannerSlideTimer = 50; gCurrentPinballGame->bannerSlideVelocity = 0; - DmaCopy16(3, gModeBannerTilemaps[6], (void *)0x06015800, 0x2400); + DmaCopy16(3, gModeBannerTilemaps[6], OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x2400); DmaCopy16(3, gModeBanner_Pals[6], OBJ_PLTT_SLOT(PAL_IX_BANNER), PLTT_SLOT_SIZE); } else @@ -779,7 +779,7 @@ void RubyPondTriBumperHandleHitAndDraw(void) gCurrentPinballGame->bannerSlidePosition = -2500; gCurrentPinballGame->bannerSlideTimer = 50; gCurrentPinballGame->bannerSlideVelocity = 0; - DmaCopy16(3, gModeBannerTilemaps[1], (void *)0x06015800, 0x2400); + DmaCopy16(3, gModeBannerTilemaps[1], OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x2400); DmaCopy16(3, gModeBanner_Pals[1], OBJ_PLTT_SLOT(PAL_IX_BANNER), PLTT_SLOT_SIZE); } @@ -820,7 +820,7 @@ void RubyPondTriBumperHandleHitAndDraw(void) var0 = (gCurrentPinballGame->globalAnimFrameCounter % 50) / 25; } - DmaCopy16(3, gLotadBumper_Gfx[var0], (void *)0x06012E80 + i * 0x100, 0x100); + DmaCopy16(3, gLotadBumper_Gfx[var0], OBJ_TILE_ADDR(TILE_INDEX(0, 11, 20 + 8 * i)), 0x100); } DmaCopy16(3, gLotadBumper_Pals[3*gCurrentPinballGame->paletteDimmingIx], OBJ_PLTT_SLOT(PAL_IX_RUBY_BUMPERS), PLTT_SLOT_SIZE); @@ -848,7 +848,7 @@ void RubyPondTriBumperHandleHitAndDraw(void) var0 = (gCurrentPinballGame->globalAnimFrameCounter % 50) / 25; } - DmaCopy16(3, gChinchouBumper_Gfx[var0], (void *)0x06012E80 + i * 0x100, 0x100); + DmaCopy16(3, gChinchouBumper_Gfx[var0], OBJ_TILE_ADDR(TILE_INDEX(0, 11, 20 + 8 * i)), 0x100); } DmaCopy16(3, gChinchouBumper_Pals[3*gCurrentPinballGame->paletteDimmingIx], OBJ_PLTT_SLOT(PAL_IX_RUBY_BUMPERS), PLTT_SLOT_SIZE); @@ -886,7 +886,7 @@ void AnimateSharpedoEntity(void) index = (gMain.systemFrameCount % 55) / 11; group = &gMain.spriteGroups[SG_RUBY_SHARPEDO]; - DmaCopy16(3, gRubyBoardSharpedo_Gfx[gCurrentPinballGame->catchHoleTileVariant], (void *)0x06012C20, 0x260); + DmaCopy16(3, gRubyBoardSharpedo_Gfx[gCurrentPinballGame->catchHoleTileVariant], OBJ_TILE_ADDR(TILE_INDEX(0, 11, 1)), 0x260); if (gCurrentPinballGame->catchHoleAnimFrame) index = gCurrentPinballGame->catchHoleAnimFrame; diff --git a/src/ruby_ramp.c b/src/ruby_ramp.c index 7a3e292e..654fe7d4 100644 --- a/src/ruby_ramp.c +++ b/src/ruby_ramp.c @@ -139,7 +139,7 @@ void UpdateMakuhitaEntity(void) { group->baseX = 184 - gCurrentPinballGame->cameraXOffset; group->baseY = 277 - gCurrentPinballGame->cameraYOffset; - DmaCopy16(3, gRubyMakuhitaGfx[index], (void*) 0x06013580, 0x300); + DmaCopy16(3, gRubyMakuhitaGfx[index], OBJ_TILE_ADDR(TILE_INDEX(0, 13, 12)), 0x300); for (i = 0; i < 3;i++) { oamSimple = &group->oam[i]; @@ -169,7 +169,7 @@ void DrawRubyRampPrize(void) else index = (gCurrentPinballGame->globalAnimFrameCounter % 32) / 8; - DmaCopy16(3, gRubyBoardRampPrize_Gfx[index], (void *) 0x06014B00, 0x80); + DmaCopy16(3, gRubyBoardRampPrize_Gfx[index], OBJ_TILE_ADDR(TILE_INDEX(1, 2, 24)), 0x80); oamSimple = &group->oam[0]; gOamBuffer[oamSimple->oamId].x = oamSimple->xOffset + group->baseX; gOamBuffer[oamSimple->oamId].y = oamSimple->yOffset + group->baseY; diff --git a/src/ruby_trigger_targets.c b/src/ruby_trigger_targets.c index c01df1d2..b61fd99c 100644 --- a/src/ruby_trigger_targets.c +++ b/src/ruby_trigger_targets.c @@ -32,7 +32,7 @@ void UpdateChikoritaAttackAnimation(void) if (gCurrentPinballGame->chikoritaProjectileTimer >= 27 && gCurrentPinballGame->chikoritaProjectileTimer < 47) { index = (gCurrentPinballGame->chikoritaProjectileTimer - 27) / 5; - DmaCopy16(3, gChikoritaExplosionTiles[index], (void *)0x06014280, 0x100); + DmaCopy16(3, gChikoritaExplosionTiles[index], OBJ_TILE_ADDR(TILE_INDEX(1, 0, 20)), 0x100); group->baseX = 176 - gCurrentPinballGame->cameraXOffset; } else @@ -46,7 +46,7 @@ void UpdateChikoritaAttackAnimation(void) if (gCurrentPinballGame->chikoritaProjectileTimer >= 100 && gCurrentPinballGame->chikoritaProjectileTimer < 120) { index = (gCurrentPinballGame->chikoritaProjectileTimer - 100) / 5; - DmaCopy16(3, gChikoritaExplosionTiles[index], (void *)0x06014280, 0x100); + DmaCopy16(3, gChikoritaExplosionTiles[index], OBJ_TILE_ADDR(TILE_INDEX(1, 0, 20)), 0x100); group->baseX = 32 - gCurrentPinballGame->cameraXOffset; } else @@ -80,7 +80,7 @@ void UpdateChikoritaAttackAnimation(void) m4aSongNumStart(SE_CHIKORITA_LEAF_BLADE); index = (gCurrentPinballGame->chikoritaProjectileTimer % 16) / 4; - DmaCopy16(3, gChikoritaProjectileTiles[index], (void *)0x06014200, 0x80); + DmaCopy16(3, gChikoritaProjectileTiles[index], OBJ_TILE_ADDR(TILE_INDEX(1, 0, 16)), 0x80); var0 = (gCurrentPinballGame->chikoritaProjectileTimer << 0x10) / 90; gCurrentPinballGame->chikoritaProjectileVelX -= 2; gCurrentPinballGame->chikoritaProjectileX += gCurrentPinballGame->chikoritaProjectileVelX; @@ -168,14 +168,14 @@ void AnimateChikoritaSprite(void) else gCurrentPinballGame->chikoritaFlashActive = FALSE; - DmaCopy16(3, gRubyChikoritaEntity[index], (void *)0x06012720, 0x300); + DmaCopy16(3, gRubyChikoritaEntity[index], OBJ_TILE_ADDR(TILE_INDEX(0, 9, 25)), 0x300); } else { index = (gMain.systemFrameCount % 50) / 25; if (gCurrentPinballGame->randomSpriteVariantSeed == 1) { - DmaCopy16(3, gRubyChikoritaEntity[index], (void *)0x06012720, 0x300); + DmaCopy16(3, gRubyChikoritaEntity[index], OBJ_TILE_ADDR(TILE_INDEX(0, 9, 25)), 0x300); } } @@ -310,9 +310,9 @@ void UpdateGulpinBossState(void) } index = gulpinFramesetData[0]; - DmaCopy16(3, gRubyStageGulpin_Gfx[gulpinFramesetData[2]], (void *)0x06013B80, 0x180); - DmaCopy16(3, gRubyStageGulpin_Gfx[gulpinFramesetData[3]], (void *)0x06013A00, 0x180); - DmaCopy16(3, gRubyStageGulpin_Gfx[gulpinFramesetData[4]], (void *)0x06013880, 0x180); + DmaCopy16(3, gRubyStageGulpin_Gfx[gulpinFramesetData[2]], OBJ_TILE_ADDR(TILE_INDEX(0, 14, 28)), 0x180); + DmaCopy16(3, gRubyStageGulpin_Gfx[gulpinFramesetData[3]], OBJ_TILE_ADDR(TILE_INDEX(0, 14, 16)), 0x180); + DmaCopy16(3, gRubyStageGulpin_Gfx[gulpinFramesetData[4]], OBJ_TILE_ADDR(TILE_INDEX(0, 14, 4)), 0x180); for (i = 0; i < 6; i++) { oamSimple = &group->oam[i]; @@ -440,7 +440,7 @@ void DrawRubySideBumperSprites(void) for (i = 0; i < SIDE_COUNT; i++) { index = gLinooneBumperGfxFrameIndices[gCurrentPinballGame->linooneSideBumperAnimPhase[i]][0]; - DmaCopy16(3, gLinooneBumperGfx[index], (void *)0x06012A20 + i * 0x100, 0x100); + DmaCopy16(3, gLinooneBumperGfx[index], OBJ_TILE_ADDR(TILE_INDEX(0, 10, 17 + 8 * i)), 0x100); group = &gMain.spriteGroups[SG_RUBY_LINOONE_LEFT + i]; if (group->active) { @@ -481,7 +481,7 @@ void DrawRubySideBumperSprites(void) gCurrentPinballGame->bannerSlidePosition = 0; gCurrentPinballGame->bannerSlideTimer = 50; gCurrentPinballGame->bannerSlideVelocity = 0; - DmaCopy16(3, gModeBannerTilemaps[4], (void *)0x06015800, 0x2400); + DmaCopy16(3, gModeBannerTilemaps[4], OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x2400); DmaCopy16(3, gModeBanner_Pals[4], OBJ_PLTT_SLOT(PAL_IX_BANNER), PLTT_SLOT_SIZE); gMain.blendControl = 0xCE; } diff --git a/src/sapphire_board_indicators.c b/src/sapphire_board_indicators.c index 8dc7699c..a6f40a5b 100644 --- a/src/sapphire_board_indicators.c +++ b/src/sapphire_board_indicators.c @@ -89,8 +89,8 @@ void DrawSapphireProgressDigits(void) const u8 **src; const u8 **dest; - var0 = LEAD_DIGIT_10S(gCurrentPinballGame->progressLevel); - var1 = DIGIT_1S(gCurrentPinballGame->progressLevel); + var0 = LEAD_DIGIT_10S(gCurrentPinballGame->bonusMultTracker); + var1 = DIGIT_1S(gCurrentPinballGame->bonusMultTracker); if (gCurrentPinballGame->hudSpriteBaseY > 36) { src = gSapphireProgressDigitTilePtrs[var0]; @@ -174,16 +174,16 @@ void AnimateSapphireCatchLightBlink(void) const u8 **src; const u8 **dest; - if (gCurrentPinballGame->evoBlinkTimer) + if (gCurrentPinballGame->modeProgressBlinkTimer) { - gCurrentPinballGame->catchLights[gCurrentPinballGame->evoCatchLightSlot1] = 1 - (gCurrentPinballGame->evoBlinkTimer % 36) / 18; - gCurrentPinballGame->catchLights[gCurrentPinballGame->evoCatchLightSlot2] = gCurrentPinballGame->catchLights[gCurrentPinballGame->evoCatchLightSlot1]; - gCurrentPinballGame->evoBlinkTimer--; + gCurrentPinballGame->modeProgressLights[gCurrentPinballGame->evoCatchLightSlot1] = MODE_PROGRESS_LAMP_BALL_LIT - (gCurrentPinballGame->modeProgressBlinkTimer % 36) / 18; + gCurrentPinballGame->modeProgressLights[gCurrentPinballGame->evoCatchLightSlot2] = gCurrentPinballGame->modeProgressLights[gCurrentPinballGame->evoCatchLightSlot1]; + gCurrentPinballGame->modeProgressBlinkTimer--; } for (i = 0; i < 3; i++) { - src = gSapphireCatchLightTilePtrs[i][gCurrentPinballGame->catchLights[i]]; + src = gSapphireCatchLightTilePtrs[i][gCurrentPinballGame->modeProgressLights[i]]; dest = gSapphireCatchLightTilePtrs[i][6]; DmaCopy16(3, src[0], dest[0], 0x40); DmaCopy16(3, src[1], dest[1], 0x40); diff --git a/src/sapphire_collision.c b/src/sapphire_collision.c index eb2d966b..f52426f3 100644 --- a/src/sapphire_collision.c +++ b/src/sapphire_collision.c @@ -267,8 +267,8 @@ void ProcessSapphireCollisionEvent(u8 triggerType, u16* hasCollisionImpact, u16* gCurrentPinballGame->pelipperFrameTimer = 1800; gCurrentPinballGame->pelipperState = PELIPPER_STATE_WATCHING_RAMP; - if (gCurrentPinballGame->progressLevel < 99) - gCurrentPinballGame->progressLevel++; + if (gCurrentPinballGame->bonusMultTracker < 99) + gCurrentPinballGame->bonusMultTracker++; gCurrentPinballGame->scoreAddedInFrame = SCORE_SAPPHIRE_BONUS_MULTIPLIER_BUTTON; } diff --git a/src/sapphire_pond_and_zigzagoon.c b/src/sapphire_pond_and_zigzagoon.c index 328c32d5..a968866e 100644 --- a/src/sapphire_pond_and_zigzagoon.c +++ b/src/sapphire_pond_and_zigzagoon.c @@ -312,7 +312,7 @@ void UpdatePelipperPondEntity(void) if (group->active) { - DmaCopy16(3, gPelipper_Gfx[frameId], (void *)0x060122A0, 0x480); + DmaCopy16(3, gPelipper_Gfx[frameId], OBJ_TILE_ADDR(TILE_INDEX(0, 8, 21)), 0x480); group->baseX = gCurrentPinballGame->pelipperPosX / 10 + 146 - gCurrentPinballGame->cameraXOffset; group->baseY = gCurrentPinballGame->pelipperPosY / 10 + 110 - gCurrentPinballGame->cameraYOffset + gCurrentPinballGame->pelipperYBobOffset / 10; for (i = 0; i < 4; i++) @@ -349,7 +349,7 @@ void AnimateWailmerEntity(void) index = gWailmerAnimFrameMap[index][1]; group->baseX = 164 - gCurrentPinballGame->cameraXOffset; group->baseY = 166 - gCurrentPinballGame->cameraYOffset; - DmaCopy16(3, gSapphireBoardWailmer_Gfx[index], (void *)0x06012720, 0x300); + DmaCopy16(3, gSapphireBoardWailmer_Gfx[index], OBJ_TILE_ADDR(TILE_INDEX(0, 9, 25)), 0x300); for (i = 0; i < 2; i++) { oamSimple = &group->oam[i]; @@ -409,7 +409,7 @@ void UpdateZigzagoonEntity(void) gCurrentPinballGame->zigzagoonFxFrame = 0; gMain.spriteGroups[SG_SAPPHIRE_ZIGZAGOON_TRAIL_FX].active = TRUE; gCurrentPinballGame->activeFxType = FX_ZIGZAGOON_ROULETTE_STOP; - DmaCopy16(3, gSapphireBoardZigzagoonFx_Gfx, (void *)0x06015800, 0xC00); + DmaCopy16(3, gSapphireBoardZigzagoonFx_Gfx, OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0xC00); m4aSongNumStart(SE_ZIGZAGOON_ROULETTE_STOP); gCurrentPinballGame->scoreAddedInFrame = SCORE_ZIGZAGOON_ROULETTE_STOP; break; @@ -459,7 +459,7 @@ void DrawZigzagoonAndRouletteStopPrompt(void) group->baseX = 198 - gCurrentPinballGame->cameraXOffset; group->baseY = gCurrentPinballGame->sapphireBumperTimer + 284 - gCurrentPinballGame->cameraYOffset; index = gCurrentPinballGame->zigzagoonGfxFrame; - DmaCopy16(3, gSapphireBoardZigzagoon_Gfx[index], (void *)0x06012A20, 0x380); + DmaCopy16(3, gSapphireBoardZigzagoon_Gfx[index], OBJ_TILE_ADDR(TILE_INDEX(0, 10, 17)), 0x380); index = gCurrentPinballGame->zigzagoonOamFrame; for (i = 0; i < 3; i++) { @@ -503,7 +503,7 @@ void DrawZigzagoonAndRouletteStopPrompt(void) { group->baseY = 260 - gCurrentPinballGame->cameraYOffset; index = (gCurrentPinballGame->globalAnimFrameCounter % 50) / 25; - DmaCopy16(3, &gZigzagoonShockWallIndicator_Gfx[index], (void *)0x06014FA0, 0x200); + DmaCopy16(3, &gZigzagoonShockWallIndicator_Gfx[index], OBJ_TILE_ADDR(TILE_INDEX(1, 3, 29)), 0x200); } else { diff --git a/src/sapphire_seedot_egg_shop.c b/src/sapphire_seedot_egg_shop.c index 841e4f5d..a01f452f 100644 --- a/src/sapphire_seedot_egg_shop.c +++ b/src/sapphire_seedot_egg_shop.c @@ -85,7 +85,7 @@ void UpdateSapphireEggHatchAnimation(void) if (gCurrentPinballGame->prevEggAnimFrame != gCurrentPinballGame->eggAnimFrameIndex) { index = gEggAnimationFrameData[gCurrentPinballGame->eggAnimFrameIndex][3]; - DmaCopy16(3, &gEggFrameTilesGfx[index], (void *)0x06011CE0, 0x200); + DmaCopy16(3, &gEggFrameTilesGfx[index], OBJ_TILE_ADDR(TILE_INDEX(0, 7, 7)), 0x200); gCurrentPinballGame->prevEggAnimFrame = gCurrentPinballGame->eggAnimFrameIndex; } @@ -340,7 +340,7 @@ void UpdateSapphireSeedotCollection(void) gCurrentPinballGame->bannerSlidePosition = 0; gCurrentPinballGame->bannerSlideTimer = 50; gCurrentPinballGame->bannerSlideVelocity = 0; - DmaCopy16(3, gModeBannerTilemaps[4], (void *)0x06015800, 0x2400); + DmaCopy16(3, gModeBannerTilemaps[4], OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x2400); DmaCopy16(3, gModeBanner_Pals[4], OBJ_PLTT_SLOT(PAL_IX_BANNER), PLTT_SLOT_SIZE); gMain.blendControl = 0xCE; } @@ -400,7 +400,7 @@ void DrawSapphireSeedotAndBasketSprites(void) group->baseX = 10 - gCurrentPinballGame->cameraXOffset; group->baseY = 298 - gCurrentPinballGame->cameraYOffset; index = gCurrentPinballGame->basketBounceFrame; - DmaCopy16(3, gSapphireStageBasket_Gfx[index], (void *)0x060139A0, 0x280); + DmaCopy16(3, gSapphireStageBasket_Gfx[index], OBJ_TILE_ADDR(TILE_INDEX(0, 14, 13)), 0x280); for (i = 0; i < 2; i++) { @@ -427,7 +427,7 @@ void DrawSapphireSeedotAndBasketSprites(void) else group->baseY = 200; - DmaCopy16(3, gSapphireBoardSeedot_Gfx[gCurrentPinballGame->seedotSpriteFrame[j]], (void *)0x06013C20 + j * 0x180, 0x160); + DmaCopy16(3, gSapphireBoardSeedot_Gfx[gCurrentPinballGame->seedotSpriteFrame[j]], OBJ_TILE_ADDR(TILE_INDEX(0, 15, 1 + 12 * j)), 0x160); index = gCurrentPinballGame->seedotOamFramesetIndex[j]; for (i = 0; i < 2; i++) { @@ -554,7 +554,7 @@ void DrawSapphireShopSignSprite(void) group->baseY = 115 - gCurrentPinballGame->cameraYOffset; index = gCurrentPinballGame->shopSignPaletteIndex + gCurrentPinballGame->paletteDimmingIx * 3; DmaCopy16(3, gSapphireShopSign_Pals[index], OBJ_PLTT_SLOT(PAL_IX_SAPPHIRE_MART_SIGN), PLTT_SLOT_SIZE); - DmaCopy16(3, gSapphireShopSignTileGfx[gCurrentPinballGame->shopSignFrame], (void *) 0x06014B20, 0x480); + DmaCopy16(3, gSapphireShopSignTileGfx[gCurrentPinballGame->shopSignFrame], OBJ_TILE_ADDR(TILE_INDEX(1, 2, 25)), 0x480); for (i = 0; i < 2; i++) { oamSimple = &group->oam[i]; @@ -613,7 +613,7 @@ void UpdateSapphireHatchMachine(void) } index = gCurrentPinballGame->sapphireHatchMachineFrameIx; - DmaCopy16(3, &gHatchMachineElevator_Gfx[index], (void *)0x600D900, 0x440); + DmaCopy16(3, &gHatchMachineElevator_Gfx[index], BG_TILE_ADDR(TILE_INDEX(3, 6, 8)), 0x440); gCurrentPinballGame->hatchMachineProgressTickSignaled = FALSE; } break; @@ -621,12 +621,12 @@ void UpdateSapphireHatchMachine(void) if (gCurrentPinballGame->holeAnimFrameCounter < 270) { index = (gCurrentPinballGame->holeAnimFrameCounter % 60) / 30 + 4; - DmaCopy16(3, &gHatchMachineElevator_Gfx[index], (void *)0x600D900, 0x440); + DmaCopy16(3, &gHatchMachineElevator_Gfx[index], BG_TILE_ADDR(TILE_INDEX(3, 6, 8)), 0x440); } else { index = 0; - DmaCopy16(3, &gHatchMachineElevator_Gfx[index], (void *)0x600D900, 0x440); + DmaCopy16(3, &gHatchMachineElevator_Gfx[index], BG_TILE_ADDR(TILE_INDEX(3, 6, 8)), 0x440); gCurrentPinballGame->sapphireHatchMachineState = HATCH_MACHINE_STATE_MON_HATCHED; gCurrentPinballGame->sapphireHatchMachineFrameIx = 0; } @@ -658,7 +658,7 @@ void UpdateSapphireHatchMachine(void) m4aSongNumStart(SE_HATCH_MACHINE_ELEVATOR); index = gHoleAnimKeyframeData[gCurrentPinballGame->sapphireHatchMachineFrameIx][0]; - DmaCopy16(3, &gHatchMachineElevator_Gfx[index], (void *)0x600D900, 0x440); + DmaCopy16(3, &gHatchMachineElevator_Gfx[index], BG_TILE_ADDR(TILE_INDEX(3, 6, 8)), 0x440); } if (gCurrentPinballGame->sapphireHatchMachineFrameIx < 6) @@ -708,7 +708,7 @@ void UpdateSapphireHatchMachine(void) gCurrentPinballGame->sapphireHatchMachineState = HATCH_MACHINE_STATE_RESET; index = gHoleAnimKeyframeData[gCurrentPinballGame->sapphireHatchMachineFrameIx][0]; - DmaCopy16(3, gHatchMachineElevator_Gfx[index], (void *)0x600D900, 0x440); + DmaCopy16(3, gHatchMachineElevator_Gfx[index], BG_TILE_ADDR(TILE_INDEX(3, 6, 8)), 0x440); } if (gCurrentPinballGame->sapphireHatchMachineFrameIx == 14 && gCurrentPinballGame->holeAnimFrameCounter == 10) @@ -748,7 +748,7 @@ void UpdateSapphireHatchMachine(void) } index = gSplashEffectTileIndices[gCurrentPinballGame->splashEffectFrameIndex[i]][0]; - DmaCopy16(3, &gHatchMachineSparkleFx_Gfx[index], (void *)0x060140a0 + i * 0x100, 0x100); + DmaCopy16(3, &gHatchMachineSparkleFx_Gfx[index], OBJ_TILE_ADDR(TILE_INDEX(1, 0, 5 + 8 * i)), 0x100); group->baseX = gSplashEffectPositions[gCurrentPinballGame->splashEffectPositionIndex[i]].x - gCurrentPinballGame->cameraXOffset; group->baseY = gSplashEffectPositions[gCurrentPinballGame->splashEffectPositionIndex[i]].y - gCurrentPinballGame->cameraYOffset; for (j = 0; j < 3; j++) diff --git a/src/save_and_restore_game.c b/src/save_and_restore_game.c index 14d7c315..b8c5c982 100644 --- a/src/save_and_restore_game.c +++ b/src/save_and_restore_game.c @@ -132,7 +132,7 @@ void SaveGameToSram(void) WriteAndVerifySramFast((const u8 *)gCurrentPinballGame, (void *)SRAM + 0x544, sizeof(*gCurrentPinballGame)); } -/// @brief +/// @brief /// @param arg0 1 = restore game SRAM, 2 = load demo, 0 = ? void RestoreGameState(u16 arg0) { @@ -219,12 +219,12 @@ void RestoreGameState(u16 arg0) var1 = (i + 10 + gCurrentPinballGame->ballLaunchSpeed) % 22; if (var0 < 32) { - DmaCopy16(3, &gBoardGfxBuffer[var0 * 0x400], (void *)BG_CHAR_ADDR(2) + var1 * 0x400, 0x400); + DmaCopy16(3, &gBoardGfxBuffer[var0 * 0x400], (void *)BG_TILE_ADDR(TILE_INDEX(2,var1,0)), 0x400); } else { var0 -= 32; - DmaCopy16(3, &gBoardBGTileBufferAlt[var0 * 0x400], (void *)BG_CHAR_ADDR(2) + var1 * 0x400, 0x400); + DmaCopy16(3, &gBoardBGTileBufferAlt[var0 * 0x400], (void *)BG_TILE_ADDR(TILE_INDEX(2,var1,0)), 0x400); } } } @@ -232,7 +232,7 @@ void RestoreGameState(u16 arg0) for (i = 0; i < 0x800; i++) gBG0TilemapBuffer[i] = 0x1FF; - DmaCopy16(3, gBG0TilemapBuffer, BG_CHAR_SCREEN_ADDR(0,4), 2*BG_SCREEN_SIZE); + DmaCopy16(3, gBG0TilemapBuffer, BG_TILE_ADDR(TILE_INDEX(0,8,0)), 2*BG_SCREEN_SIZE); if (gMain.scoreOverlayActive) { if (gCurrentPinballGame->boardState == MAIN_BOARD_STATE_EVO_MODE) @@ -252,7 +252,7 @@ void RestoreGameState(u16 arg0) } } - DmaCopy16(3, gBG0TilemapBuffer, BG_CHAR_SCREEN_ADDR(0,4), BG_SCREEN_SIZE); + DmaCopy16(3, gBG0TilemapBuffer, BG_TILE_ADDR(TILE_INDEX(0,8,0)), BG_SCREEN_SIZE); } DmaCopy16(3, gCurrentPinballGame->savedObjPalette[gMain.isBonusField], OBJ_PLTT, OBJ_PLTT_SIZE); @@ -347,72 +347,72 @@ void RestoreFieldSpecificGraphics(void) if (gCurrentPinballGame->outLanePikaPosition == PIKA_BOTH_SIDES && gCurrentPinballGame->outLaneSide == OUTLANE_RIGHT) { - DmaCopy16(3, gPikaSaverFullCoverageGfx, (void *)0x6015800, 0x2400); + DmaCopy16(3, gPikaSaverFullCoverageGfx, OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x2400); } else { - DmaCopy16(3, gPikaSaverPartialCoverageGfx, (void *)0x6015800, 0x2400); + DmaCopy16(3, gPikaSaverPartialCoverageGfx, OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x2400); } break; case FX_AERODACTYL_EGG_DELIVERY: - DmaCopy16(3, gAerodactlyFlight_Gfx, (void *)0x6015800, 0x1000); + DmaCopy16(3, gAerodactlyFlight_Gfx, OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x1000); break; case FX_TOTODILE_EGG_DELIVERY: - DmaCopy16(3, gTotodileEggDelivery_Gfx, (void *)0x6015800, 0xCA0); + DmaCopy16(3, gTotodileEggDelivery_Gfx, OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0xCA0); break; case FX_MODE_START_BANNER: - DmaCopy16(3, gModeBannerTilemaps[gCurrentPinballGame->bannerGfxIndex], (void *)0x6015800, 0x25E0); + DmaCopy16(3, gModeBannerTilemaps[gCurrentPinballGame->bannerGfxIndex], OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x25E0); break; case FX_CATCH_TILE_BURST_1: - DmaCopy16(3, gCatchTile_BurstStart_Gfx, (void *)0x6015800, 0x2000); + DmaCopy16(3, gCatchTile_BurstStart_Gfx, OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x2000); break; case FX_CATCH_TILE_BURST_2: - DmaCopy16(3, gCatchTile_BurstStage2_Gfx, (void *)0x6015800, 0x800); + DmaCopy16(3, gCatchTile_BurstStage2_Gfx, OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x800); break; case FX_CATCH_TILE_BURST_3: - DmaCopy16(3, gCatchTile_BurstStage3_Gfx, (void *)0x6015800, 0x2000); + DmaCopy16(3, gCatchTile_BurstStage3_Gfx, OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x2000); break; case FX_CATCH_TILE_BURST_4: - DmaCopy16(3, gCatchTile_BurstStage4_Gfx, (void *)0x6015800, 0x1800); + DmaCopy16(3, gCatchTile_BurstStage4_Gfx, OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x1800); break; case FX_CAPTURE_MON_ABSORB: - DmaCopy16(3, gCaptureScreenTilesGfx, (void *)0x6015800, 0x1C00); + DmaCopy16(3, gCaptureScreenTilesGfx, OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x1C00); break; case FX_CATCH_MON_REVEAL_PUFF: - DmaCopy16(3, gCatchMonAppearFx_Gfx, (void *)0x6015800, 0x1400); + DmaCopy16(3, gCatchMonAppearFx_Gfx, OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x1400); break; case FX_SEQUENTIAL_CATCH_TILE: - DmaCopy16(3, gCatchTile_RevealTilesGfx, (void *)0x6015800, 0x2800); + DmaCopy16(3, gCatchTile_RevealTilesGfx, OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x2800); break; case FX_FIRST_AREA_SELECTION: - DmaCopy16(3, gAreaRouletteSelectedFx_Gfx, (void *)0x6015800, 0x280); + DmaCopy16(3, gAreaRouletteSelectedFx_Gfx, OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x280); break; case FX_MON_SELECTION_NAME: for (i = 0; i < 10; i++) { if (gSpeciesInfo[gCurrentPinballGame->currentSpecies].name[i] == ' ') { - DmaCopy16(3, gSpaceTileGfx, (void *)0x6015800 + i * 0x40, 0x40); + DmaCopy16(3, gSpaceTileGfx, OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)) + i * 0x40, 0x40); } else { int letterTileIx = gSpeciesInfo[gCurrentPinballGame->currentSpecies].name[i] - 'A'; - DmaCopy16(3, gAlphabetTilesGfx[letterTileIx], (void *)0x6015800 + i * 0x40, 0x40); + DmaCopy16(3, gAlphabetTilesGfx[letterTileIx], OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)) + i * 0x40, 0x40); } } - DmaCopy16(3, gPokemonNameDisplayGfx, (void *)0x6015C00, 0x940); + DmaCopy16(3, gPokemonNameDisplayGfx, OBJ_TILE_ADDR(TILE_INDEX(1, 7, 0)), 0x940); break; case FX_MON_WAS_CAUGHT_CUTSCENE: for (i = 0; i < 10; i++) { if (gSpeciesInfo[gCurrentPinballGame->currentSpecies].name[i] == ' ') { - DmaCopy16(3, gSpaceTileGfx, (void *)0x6015800 + i * 0x40, 0x40); + DmaCopy16(3, gSpaceTileGfx, OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)) + i * 0x40, 0x40); } else { int letterTileIx = gSpeciesInfo[gCurrentPinballGame->currentSpecies].name[i] - 'A'; - DmaCopy16(3, gAlphabetTilesGfx[letterTileIx], (void *)0x6015800 + i * 0x40, 0x40); + DmaCopy16(3, gAlphabetTilesGfx[letterTileIx], OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)) + i * 0x40, 0x40); } } @@ -420,55 +420,56 @@ void RestoreFieldSpecificGraphics(void) { if (gCaughtTextChars[i] == ' ') { - DmaCopy16(3, gSpaceTileGfx, (void *)0x6015800 + (i + 10) * 0x40, 0x40); + // TILE_INDEX(1, 6, 20 + 2 * i) + DmaCopy16(3, gSpaceTileGfx, OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)) + (i + 10) * 0x40, 0x40); } else { int letterTileIx = gCaughtTextChars[i] - 'A'; - DmaCopy16(3, gAlphabetTilesGfx[letterTileIx], (void *)0x6015800 + (i + 10) * 0x40, 0x40); + DmaCopy16(3, gAlphabetTilesGfx[letterTileIx], OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)) + (i + 10) * 0x40, 0x40); } } break; case FX_EVO_ITEM_SPAWN: - DmaCopy16(3, gEvoItemAppear_GfxList[gCurrentPinballGame->evoItemGfxIndex], (void *)0x6015800, 0x1C00); + DmaCopy16(3, gEvoItemAppear_GfxList[gCurrentPinballGame->evoItemGfxIndex], OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x1C00); break; case FX_EVOLUTION_CUTSCENE: - DmaCopy16(3, gEvolutionCutsceneTilesGfx, (void *)0x6015800, 0x2400); + DmaCopy16(3, gEvolutionCutsceneTilesGfx, OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x2400); break; case FX_END_OF_EVO_LIGHTNING: - DmaCopy16(3, gCatchTile_BurstStage4_Gfx, (void *)0x6015800, 0x1800); + DmaCopy16(3, gCatchTile_BurstStage4_Gfx, OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x1800); break; case FX_SHOP_EVO_SELECTION: - DmaCopy16(3, gPokemonNameDisplayGfx, (void *)0x6015C00, 0x940); + DmaCopy16(3, gPokemonNameDisplayGfx, OBJ_TILE_ADDR(TILE_INDEX(1, 7, 0)), 0x940); if (!gCurrentPinballGame->evolutionShopActive) { var1 = gShopItemData[gShopCursorToItemMap[gCurrentPinballGame->shopItemCursor]]; var2 = LEAD_DIGIT_10S(var1[3]); - DmaCopy16(3, gDecimalDigitTilesGfx[var2], (void *)0x6015DA0, 0x40); + DmaCopy16(3, gDecimalDigitTilesGfx[var2], OBJ_TILE_ADDR(TILE_INDEX(1, 7, 13)), 0x40); var3 = DIGIT_1S(var1[3]); - DmaCopy16(3, gDecimalDigitTilesGfx[var3], (void *)0x6015E60, 0x40); + DmaCopy16(3, gDecimalDigitTilesGfx[var3], OBJ_TILE_ADDR(TILE_INDEX(1, 7, 19)), 0x40); } break; case FX_BALL_SAVED_CUTSCENE: - DmaCopy16(3, gMainBoardBallSave_Gfx, (void *)0x6015800, 0x2400); + DmaCopy16(3, gMainBoardBallSave_Gfx, OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x2400); break; case FX_END_OF_BALL_SUMMARY: - DmaCopy16(3, gMainBoardEndOfBall_Gfx, (void *)0x6015800, 0x2800); + DmaCopy16(3, gMainBoardEndOfBall_Gfx, OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x2800); break; case FX_TRAVEL_PAINTER_CUTSCENE: if (gMain.selectedField == FIELD_RUBY) { - DmaCopy16(3, gRubyTravelPaint_Gfx, (void *)0x6015800, 0x1800); + DmaCopy16(3, gRubyTravelPaint_Gfx, OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x1800); DmaCopy16(3, gRubyPainter_Pals, OBJ_PLTT_SLOT(PAL_IX_TRAVEL_PAINTER), PLTT_SLOT_SIZE); } else { - DmaCopy16(3, gSapphireTravelPaint_Gfx, (void *)0x6015800, 0x1800); + DmaCopy16(3, gSapphireTravelPaint_Gfx, OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x1800); DmaCopy16(3, gSapphirePainter_Pals, OBJ_PLTT_SLOT(PAL_IX_TRAVEL_PAINTER), PLTT_SLOT_SIZE); } break; case FX_ZIGZAGOON_ROULETTE_STOP: - DmaCopy16(3, gSapphireBoardZigzagoonFx_Gfx, (void *)0x6015800, 0xC00); + DmaCopy16(3, gSapphireBoardZigzagoonFx_Gfx, OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0xC00); break; } } @@ -485,28 +486,28 @@ void RestoreMainFieldDynamicGraphics(void) for (i = 0; i < SIDE_COUNT; i++) { var0 = gCurrentPinballGame->flipper[i].position / 2; - DmaCopy16(3, gFlipper_Gfx[var0], ((i * 0x200) + 0x06010000), 0x200); + DmaCopy16(3, gFlipper_Gfx[var0], ((i * 0x200) + OBJ_TILE_ADDR(TILE_INDEX(0, 0, 0))), 0x200); } var0 = gCurrentPinballGame->ball->spinAngle / 0x1000; - DmaCopy16(3, gBallRotationTileGraphics[var0], (void *)OBJ_VRAM0 + 0x400, 0x80); + DmaCopy16(3, gBallRotationTileGraphics[var0], OBJ_TILE_ADDR(TILE_INDEX(0, 1, 0)), 0x80); for (i = 0; i <= 1; i++) { - DmaCopy16(3, gPikaSaverTilesGfx + ((var0 =gCurrentPinballGame->pikaSaverTileIndex[i]) * 0x180), 0x06010480 + (i * 0x180), 0x180); + DmaCopy16(3, gPikaSaverTilesGfx + ((var0 =gCurrentPinballGame->pikaSaverTileIndex[i]) * 0x180), OBJ_TILE_ADDR(TILE_INDEX(0, 1, 4 + 12 * i)), 0x180); } var0 = gCurrentPinballGame->pikachuSpinFrame; - DmaCopy16(3, gMainBoardPikaSpinner_Gfx[var0 = gCurrentPinballGame->pikachuSpinFrame], 0x06010780, 0x120); + DmaCopy16(3, gMainBoardPikaSpinner_Gfx[var0 = gCurrentPinballGame->pikachuSpinFrame], OBJ_TILE_ADDR(TILE_INDEX(0, 1, 28)), 0x120); var0 = gCurrentPinballGame->chargeFillValue; - DmaCopy16(3, gChargeFillIndicator_Gfx[var0], 0x06010AE0, 0x80); + DmaCopy16(3, gChargeFillIndicator_Gfx[var0], OBJ_TILE_ADDR(TILE_INDEX(0, 2, 23)), 0x80); for (i = 0; i <= 1; i++) { switch (gCurrentPinballGame->portraitRenderMode[i]) { case PORTRAIT_STATE_CURRENT_LOCATION: - DmaCopy16(3, gLocationPortraitGfx[gCurrentPinballGame->portraitGfxIndex[i]], 0x06010CA0 + (i * 0x300), 0x300); + DmaCopy16(3, gLocationPortraitGfx[gCurrentPinballGame->portraitGfxIndex[i]], OBJ_TILE_ADDR(TILE_INDEX(0, 3, 5 + 24 * i)), 0x300); gCurrentPinballGame->ball += 0; //TODO: Dumb match is still a match... break; case PORTRAIT_STATE_EVO_PREVIEW: @@ -534,7 +535,8 @@ void RestoreMainFieldDynamicGraphics(void) DmaCopy16(3, gMonPortraitGroupPals[gCurrentPinballGame->portraitGfxIndex[i] / 15][gCurrentPinballGame->portraitGfxIndex[i] % 15], OBJ_PLTT_SLOT(PAL_IX_LOCATION_PORTRAIT), PLTT_SLOT_SIZE); } case PORTRAIT_STATE_POKEMON_DISPLAY: - DmaCopy16(3, gMonPortraitGroupGfx[gCurrentPinballGame->portraitGfxIndex[i] / 15] + (gCurrentPinballGame->portraitGfxIndex[i] % 15) * 0x300, 0x06010CA0 + (i * 0x18), 0x300); + // Bug: missing the * 0x20; but not a problem since only portrait 0 gets displayed + DmaCopy16(3, gMonPortraitGroupGfx[gCurrentPinballGame->portraitGfxIndex[i] / 15] + (gCurrentPinballGame->portraitGfxIndex[i] % 15) * 0x300, OBJ_TILE_ADDR(TILE_INDEX(0, 3, 5)) + (i * 0x18), 0x300); break; case PORTRAIT_STATE_SLOT_START_CARD: case PORTRAIT_STATE_ROULETTE_WHEEL: @@ -542,7 +544,7 @@ void RestoreMainFieldDynamicGraphics(void) case PORTRAIT_STATE_SHOP_SELECTOR: case PORTRAIT_STATE_CONFIRMATION_PROMPT: case PORTRAIT_STATE_ROULETTE_OUTCOME: - DmaCopy16(3, gPortraitAnimFrameGraphics[gCurrentPinballGame->portraitGfxIndex[i]], 0x06010CA0 + (i * 0x300), 0x300); + DmaCopy16(3, gPortraitAnimFrameGraphics[gCurrentPinballGame->portraitGfxIndex[i]], OBJ_TILE_ADDR(TILE_INDEX(0, 3, 5 + 24 * i)), 0x300); break; } } @@ -555,11 +557,11 @@ void RestoreMainFieldDynamicGraphics(void) case CATCH_EM_SUBSTATE_SETUP_CATCH_HIT_COUNT: if ((u32) gCurrentPinballGame->captureFlashTimer > 4) { - DmaCopy16(3, gCatchSpriteFlashGfx, 0x06010CA0, 0x480); + DmaCopy16(3, gCatchSpriteFlashGfx, OBJ_TILE_ADDR(TILE_INDEX(0, 3, 5)), 0x480); } else { - DmaCopy16(3, gCatchSpriteGfxBuffer, 0x06010CA0, 0x480); + DmaCopy16(3, gCatchSpriteGfxBuffer, OBJ_TILE_ADDR(TILE_INDEX(0, 3, 5)), 0x480); } break; case CATCH_EM_SUBSTATE_CATCH_HIT_PHASE: @@ -567,11 +569,11 @@ void RestoreMainFieldDynamicGraphics(void) { if (gCurrentPinballGame->captureFlashTimer > 4) { - DmaCopy16(3, gCatchSpriteFlashGfx, 0x06010CA0, 0x480); + DmaCopy16(3, gCatchSpriteFlashGfx, OBJ_TILE_ADDR(TILE_INDEX(0, 3, 5)), 0x480); } else { - DmaCopy16(3, gCatchSpriteGfxBuffer, 0x06010CA0, 0x480); + DmaCopy16(3, gCatchSpriteGfxBuffer, OBJ_TILE_ADDR(TILE_INDEX(0, 3, 5)), 0x480); } } break; @@ -585,11 +587,11 @@ void RestoreMainFieldDynamicGraphics(void) case JIRACHI_CATCH_SUBSTATE_SETUP_CATCH_HIT_COUNT: if (gCurrentPinballGame->captureFlashTimer > 4U) { - DmaCopy16(3, gCatchSpriteFlashGfx, 0x06010CA0, 0x480); + DmaCopy16(3, gCatchSpriteFlashGfx, OBJ_TILE_ADDR(TILE_INDEX(0, 3, 5)), 0x480); } else { - DmaCopy16(3, gCatchSpriteGfxBuffer, 0x06010CA0, 0x480); + DmaCopy16(3, gCatchSpriteGfxBuffer, OBJ_TILE_ADDR(TILE_INDEX(0, 3, 5)), 0x480); } break; case JIRACHI_CATCH_SUBSTATE_CATCH_HIT_PHASE: @@ -597,21 +599,21 @@ void RestoreMainFieldDynamicGraphics(void) { if (gCurrentPinballGame->captureFlashTimer > 4U) { - DmaCopy16(3, gCatchSpriteFlashGfx, 0x06010CA0, 0x480); + DmaCopy16(3, gCatchSpriteFlashGfx, OBJ_TILE_ADDR(TILE_INDEX(0, 3, 5)), 0x480); } else { - DmaCopy16(3, gCatchSpriteGfxBuffer, 0x06010CA0, 0x480); + DmaCopy16(3, gCatchSpriteGfxBuffer, OBJ_TILE_ADDR(TILE_INDEX(0, 3, 5)), 0x480); } } break; } } - DmaCopy16(3, gMainStageBonusTrap_Gfx[gCurrentPinballGame->bonusTrapAnimFrame], 0x060113C0, 0x300); - DmaCopy16(3, gEvoItemTilesGfxPtrs[gCurrentPinballGame->evoItemGfxIndex] + var0 * 0x200, 0x060116C0, 0x200); - DmaCopy16(3, gEggFrameTilesGfx[(s16)gEggAnimationFrameData[gCurrentPinballGame->eggAnimFrameIndex][3]], 0x06011CE0, 0x200); - DmaCopy16(3, gBallUpgradeFx_Gfx[gCurrentPinballGame->ballUpgradeFxTileIndex], 0x06011EE0, 0x200); + DmaCopy16(3, gMainStageBonusTrap_Gfx[gCurrentPinballGame->bonusTrapAnimFrame], OBJ_TILE_ADDR(TILE_INDEX(0, 4, 30)), 0x300); + DmaCopy16(3, gEvoItemTilesGfxPtrs[gCurrentPinballGame->evoItemGfxIndex] + var0 * 0x200, OBJ_TILE_ADDR(TILE_INDEX(0, 5, 22)), 0x200); + DmaCopy16(3, gEggFrameTilesGfx[(s16)gEggAnimationFrameData[gCurrentPinballGame->eggAnimFrameIndex][3]], OBJ_TILE_ADDR(TILE_INDEX(0, 7, 7)), 0x200); + DmaCopy16(3, gBallUpgradeFx_Gfx[gCurrentPinballGame->ballUpgradeFxTileIndex], OBJ_TILE_ADDR(TILE_INDEX(0, 7, 23)), 0x200); return; } @@ -621,23 +623,23 @@ void RestoreRubyBoardTileGraphics(void) s16 var0; var0 = gEggAnimationFrameData[gCurrentPinballGame->eggAnimFrameIndex][2]; - DmaCopy16(3, gRubyBoardHatchCave_Gfx[var0], (void *)0x60122A0, 0x480); + DmaCopy16(3, gRubyBoardHatchCave_Gfx[var0], OBJ_TILE_ADDR(TILE_INDEX(0, 8, 21)), 0x480); var0 = (gMain.systemFrameCount % 50) / 25; - DmaCopy16(3, gRubyChikoritaEntity[var0], (void *)0x6012720, 0x300); - DmaCopy16(3, gRubyBoardSharpedo_Gfx[gCurrentPinballGame->catchHoleTileVariant], (void *)0x6012C20, 0x260); + DmaCopy16(3, gRubyChikoritaEntity[var0], OBJ_TILE_ADDR(TILE_INDEX(0, 9, 25)), 0x300); + DmaCopy16(3, gRubyBoardSharpedo_Gfx[gCurrentPinballGame->catchHoleTileVariant], OBJ_TILE_ADDR(TILE_INDEX(0, 11, 1)), 0x260); for (i = 0; i < 2; i++) - DmaCopy16(3, gChinchouBumper_Gfx[var0], (void *)0x6010000 + (0x174 + i * 8) * 0x20, 0x100); + DmaCopy16(3, gChinchouBumper_Gfx[var0], OBJ_TILE_ADDR(TILE_INDEX(0, 11, 20 + 8 * i)), 0x100); var0 = gCurrentPinballGame->shopDoorCurrentFrame & 0xF; - DmaCopy16(3, gRubyBoardShopDoor_Gfx[var0], (void *)0x6013180, 0x180); + DmaCopy16(3, gRubyBoardShopDoor_Gfx[var0], OBJ_TILE_ADDR(TILE_INDEX(0, 12, 12)), 0x180); if (gCurrentPinballGame->cyndaquilPosition < CYNDAQUIL_POSITION_CAVE_ENTRANCE) gCurrentPinballGame->cyndaquilFrame = 0; else gCurrentPinballGame->cyndaquilFrame = 1; - DmaCopy16(3, gRubyStageCyndaquil_Gfx[gCurrentPinballGame->cyndaquilFrame], (void *)0x6013300, 0x280); + DmaCopy16(3, gRubyStageCyndaquil_Gfx[gCurrentPinballGame->cyndaquilFrame], OBJ_TILE_ADDR(TILE_INDEX(0, 12, 24)), 0x280); var0 = gEvoShopAnimFrames[gCurrentPinballGame->evolutionShopActive][(gCurrentPinballGame->shopAnimTimer % 42) / 6]; - DmaCopy16(3, gRubyBoardShop_Gfx[var0], (void *)0x6013D00, 0x500); + DmaCopy16(3, gRubyBoardShop_Gfx[var0], OBJ_TILE_ADDR(TILE_INDEX(0, 15, 8)), 0x500); } void RestoreSapphireBoardTileGraphics(void) @@ -650,16 +652,16 @@ void RestoreSapphireBoardTileGraphics(void) case HATCH_MACHINE_STATE_ACTIVATED_LIGHT_CROSS: case HATCH_MACHINE_STATE_MON_HATCHED: index = gCurrentPinballGame->sapphireHatchMachineFrameIx; - DmaCopy16(3, gHatchMachineElevator_Gfx[index], (void *)0x600D900, 0x440); + DmaCopy16(3, gHatchMachineElevator_Gfx[index], BG_TILE_ADDR(TILE_INDEX(3, 6, 8)), 0x440); break; case HATCH_MACHINE_STATE_ELEVATOR_DECENDS: case HATCH_MACHINE_STATE_EMPTY: index = 15; - DmaCopy16(3, gHatchMachineElevator_Gfx[index], (void *)0x600D900, 0x440); + DmaCopy16(3, gHatchMachineElevator_Gfx[index], BG_TILE_ADDR(TILE_INDEX(3, 6, 8)), 0x440); break; case HATCH_MACHINE_STATE_EGG_RISING: index = gHoleAnimKeyframeData[gCurrentPinballGame->sapphireHatchMachineFrameIx][0]; - DmaCopy16(3, gHatchMachineElevator_Gfx[index], (void *)0x600D900, 0x440); + DmaCopy16(3, gHatchMachineElevator_Gfx[index], BG_TILE_ADDR(TILE_INDEX(3, 6, 8)), 0x440); break; case HATCH_MACHINE_STATE_RESET: break; @@ -668,21 +670,21 @@ void RestoreSapphireBoardTileGraphics(void) void RestoreDusclopsBonusGraphics(void) { - DmaCopy16(3, gDusclopsBonusClear_Gfx, (void *)0x6015800, 0x2000); + DmaCopy16(3, gDusclopsBonusClear_Gfx, OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x2000); } void RestoreKecleonBonusGraphics(void) { - DmaCopy16(3, gKecleonBonusClear_Gfx, (void *)0x6015800, 0x2000); + DmaCopy16(3, gKecleonBonusClear_Gfx, OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x2000); } void RestoreKyogreBonusGraphics(void) { - DmaCopy16(3, gKyogreBonusClear_Gfx, (void *)0x6015800, 0x2000); + DmaCopy16(3, gKyogreBonusClear_Gfx, OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x2000); DmaCopy16( 3, gMonPortraitGroupGfx[gCurrentPinballGame->portraitGfxIndex[0] / 15] + (gCurrentPinballGame->portraitGfxIndex[0] % 15) * 0x300, - (void *)0x6010CA0, + OBJ_TILE_ADDR(TILE_INDEX(0, 3, 5)), 0x300 ); } @@ -691,17 +693,17 @@ void RestoreGroudonBonusGraphics(void) { if (gCurrentPinballGame->boardState <= LEGENDARY_BOARD_STATE_BATTLE_PHASE) { - DmaCopy16(3, gGroudonAttackFx_Gfx, (void *)0x6015800, 0x2000); + DmaCopy16(3, gGroudonAttackFx_Gfx, OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x2000); } else { - DmaCopy16(3, gGroudonBonusClear_Gfx, (void *)0x6015800, 0x2000); + DmaCopy16(3, gGroudonBonusClear_Gfx, OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x2000); } DmaCopy16( 3, gMonPortraitGroupGfx[gCurrentPinballGame->portraitGfxIndex[0] / 15] + (gCurrentPinballGame->portraitGfxIndex[0] % 15) * 0x300, - (void *)0x6010CA0, + OBJ_TILE_ADDR(TILE_INDEX(0, 3, 5)), 0x300 ); } @@ -712,27 +714,27 @@ void RestoreRayquazaBonusGraphics(void) if (gCurrentPinballGame->boardState == LEGENDARY_BOARD_STATE_INTRO) { - DmaCopy16(3, gRayquazaSkyBackgroundGfx, (void *)0x6015800, 0x2800); + DmaCopy16(3, gRayquazaSkyBackgroundGfx, OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x2800); } else if (gCurrentPinballGame->boardState == LEGENDARY_BOARD_STATE_BATTLE_PHASE) { - DmaCopy16(3, gRayquazaFlyby_Gfx, (void *)0x6015800, 0x1C00); + DmaCopy16(3, gRayquazaFlyby_Gfx, OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x1C00); } else { - DmaCopy16(3, gRayquazaBonusClear_Gfx, (void *)0x6015800, 0x2000); + DmaCopy16(3, gRayquazaBonusClear_Gfx, OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x2000); } var0 = gCurrentPinballGame->bossEntityState - 2; if (var0 > 9) // bossEntityState > RAYQUAZA_ENTITY_STATE_DEPARTS { - DmaCopy16(3, gRayquazaSpriteSheet, (void *)0x6011620, 0x860); + DmaCopy16(3, gRayquazaSpriteSheet, OBJ_TILE_ADDR(TILE_INDEX(0, 5, 17)), 0x860); } DmaCopy16( 3, gMonPortraitGroupGfx[gCurrentPinballGame->portraitGfxIndex[0] / 15] + (gCurrentPinballGame->portraitGfxIndex[0] % 15) * 0x300, - (void *)0x6010CA0, + OBJ_TILE_ADDR(TILE_INDEX(0, 3, 5)), 0x300 ); } @@ -746,7 +748,7 @@ void RestoreSphealBonusGraphics(void) for (i = 0; i < 0x800; i++) gBG0TilemapBuffer[0x400 + i] = 0x200; - DmaCopy16(3, &gBG0TilemapBuffer[0x400], BG_CHAR_SCREEN_ADDR(0,2), 2*BG_SCREEN_SIZE); + DmaCopy16(3, &gBG0TilemapBuffer[0x400], BG_TILE_ADDR(TILE_INDEX(0,4,0)), 2*BG_SCREEN_SIZE); gMain.blendControl = 0x1C42; gMain.blendAlpha = 0xC04; for (i = 0; i < 0x140; i++) @@ -763,11 +765,11 @@ void RestoreSphealBonusGraphics(void) gMain.bgOffsets[1].xOffset = 8; gMain.bgOffsets[1].yOffset = 126; - DmaCopy16(3, &gBG0TilemapBuffer[0x800], (void *)0x6001140, 0x280); + DmaCopy16(3, &gBG0TilemapBuffer[0x800], BG_TILE_ADDR(TILE_INDEX(0, 4, 10)), 0x280); for (i = 0; i < 0x800; i++) gBG0TilemapBuffer[i] = 0x1FF; - DmaCopy16(3, gSphealResultsScreenGfx, (void *)0x6015800, 0x800); + DmaCopy16(3, gSphealResultsScreenGfx, OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x800); } void nullsub_18(void) diff --git a/src/spheal_process3.c b/src/spheal_process3.c index a1b384d8..4442a2b2 100644 --- a/src/spheal_process3.c +++ b/src/spheal_process3.c @@ -129,7 +129,7 @@ void InitFrameProcess3_BoardLogic_SphealBoard(void) for (i = 0; i < 0x800; i++) gBG0TilemapBuffer[0x400 + i] = 0x200; - DmaCopy16(3, &gBG0TilemapBuffer[0x400], BG_CHAR_SCREEN_ADDR(0,2), 2*BG_SCREEN_SIZE); + DmaCopy16(3, &gBG0TilemapBuffer[0x400], BG_TILE_ADDR(TILE_INDEX(0,4,0)), 2*BG_SCREEN_SIZE); gMain.blendControl = 0x1C42; gMain.blendAlpha = 0xC04; @@ -141,7 +141,7 @@ void InitFrameProcess3_BoardLogic_SphealBoard(void) } gMain.bgOffsets[1].yOffset = 126; - DmaCopy16(3, &gBG0TilemapBuffer[0x800], (void *)0x06001140, 0x280); + DmaCopy16(3, &gBG0TilemapBuffer[0x800], BG_TILE_ADDR(TILE_INDEX(0, 4, 10)), 0x280); DmaCopy16(3, gBall_Pals[gCurrentPinballGame->ballUpgradeType], OBJ_PLTT_SLOT(PAL_IX_BALL), PLTT_SLOT_SIZE); m4aSongNumStart(MUS_BONUS_FIELD_SPHEAL); DmaCopy16(3, gBonusStageObjPal, OBJ_PLTT_SLOT(PAL_IX_9), PLTT_SLOT_SIZE); @@ -213,7 +213,7 @@ void UpdateFrameProcess3_BoardLogic_SphealBoard(void) gMain.spriteGroups[SG_SPHEAL_END_SCORE_SPHEALS_SUNK].active = TRUE; gMain.spriteGroups[SG_SPHEAL_END_SCORE_BALLS_SUNK].active = TRUE; gMain.spriteGroups[SG_SPHEAL_END_SCORE_TOTAL].active = TRUE; - DmaCopy16(3, gSphealResultsScreenGfx, (void *)0x06015800, 0x800); + DmaCopy16(3, gSphealResultsScreenGfx, OBJ_TILE_ADDR(TILE_INDEX(1, 6, 0)), 0x800); gCurrentPinballGame->bannerSlideYOffset = -126; gCurrentPinballGame->cameraLocked = TRUE; } @@ -387,7 +387,7 @@ void UpdateSealeoEntityLogic(void) else var0 = gSealeoFramesetData[gCurrentPinballGame->minionFramesetIx[0]][0]; - DmaCopy16(3, gSphealMinionBodySprites[var0], (void *)0x060114A0, 0x600); + DmaCopy16(3, gSphealMinionBodySprites[var0], OBJ_TILE_ADDR(TILE_INDEX(0, 5, 5)), 0x600); oamSimple = &group->oam[0]; gOamBuffer[oamSimple->oamId].x = oamSimple->xOffset + group->baseX; gOamBuffer[oamSimple->oamId].y = oamSimple->yOffset + group->baseY; @@ -403,7 +403,7 @@ void UpdateSealeoEntityLogic(void) else var0 = gSealeoFramesetData[gCurrentPinballGame->minionFramesetIx[1]][0]; - DmaCopy16(3, gSphealMinionBodySprites[var0], (void *)0x06010CA0, 0x600); + DmaCopy16(3, gSphealMinionBodySprites[var0], OBJ_TILE_ADDR(TILE_INDEX(0, 3, 5)), 0x600); oamSimple = &group->oam[0]; gOamBuffer[oamSimple->oamId].x = oamSimple->xOffset + group->baseX; gOamBuffer[oamSimple->oamId].y = oamSimple->yOffset + group->baseY; @@ -870,7 +870,7 @@ void UpdateSphealEntityLogic(void) group->baseX = (gCurrentPinballGame->sphealPositionQ8[i].x / 256) - (gCurrentPinballGame->cameraXOffset + 12); group->baseY = (gCurrentPinballGame->sphealPositionQ8[i].y / 256) - (gCurrentPinballGame->cameraYOffset + 14); - DmaCopy16(3, gSphealFlyingEnemyVariantSprites[sphealFrameIx], (void *)0x06011CA0 + i * 0x120, 0x120); + DmaCopy16(3, gSphealFlyingEnemyVariantSprites[sphealFrameIx], OBJ_TILE_ADDR(TILE_INDEX(0, 7, 5 + 9 * i)), 0x120); for (j = 0; j < SPHEAL_SPRITE_SEGMENTS; j++) { oamSimple = &group->oam[j]; @@ -931,7 +931,7 @@ void UpdateSphealEntityLogic(void) group->baseX = (gCurrentPinballGame->sphealPositionQ8[i].x / 256) - (gCurrentPinballGame->cameraXOffset + 12); group->baseY = (gCurrentPinballGame->sphealPositionQ8[i].y / 256) - (gCurrentPinballGame->cameraYOffset + 14); - DmaCopy16(3, gSphealFlyingEnemyVariantSprites[sphealFrameIx], (void *)0x06011EE0 + i * 0x120, 0x120); + DmaCopy16(3, gSphealFlyingEnemyVariantSprites[sphealFrameIx], OBJ_TILE_ADDR(TILE_INDEX(0, 7, 23 + 9 * i)), 0x120); for (j = 0; j < SPHEAL_SPRITE_SEGMENTS; j++) { oamSimple = &group->oam[j]; @@ -958,7 +958,7 @@ void UpdateSphealScoreAndDelivery(void) if (gCurrentPinballGame->scoreCountdownTimer < 22) var0 = gSphealScoreDigitSpriteIndices[gCurrentPinballGame->scoreCountdownTimer]; - DmaCopy16(3, gSphealNetGfx[var0], (void *)0x06010920, 0x200); + DmaCopy16(3, gSphealNetGfx[var0], OBJ_TILE_ADDR(TILE_INDEX(0, 2, 9)), 0x200); oamSimple = &group->oam[0]; gOamBuffer[oamSimple->oamId].x = oamSimple->xOffset + group->baseX; gOamBuffer[oamSimple->oamId].y = oamSimple->yOffset + group->baseY; @@ -969,7 +969,7 @@ void UpdateSphealScoreAndDelivery(void) { group->baseX = 104 - gCurrentPinballGame->cameraXOffset; group->baseY = 94 - gCurrentPinballGame->cameraYOffset; - DmaCopy16(3, gSphealNetFrontGfx[var0], (void *)0x06010B20, 0x180); + DmaCopy16(3, gSphealNetFrontGfx[var0], OBJ_TILE_ADDR(TILE_INDEX(0, 2, 25)), 0x180); for (i = 0; i < NET_FRONT_SPRITE_SEGMENTS; i++) { oamSimple = &group->oam[i]; @@ -1015,7 +1015,7 @@ void SphealBoard_WhiscashDeliversBall(void) group->baseX = 134 + offsets[2] - gCurrentPinballGame->cameraXOffset; group->baseY = 154 + offsets[3] - gCurrentPinballGame->cameraYOffset; var0 = offsets[0]; - DmaCopy16(3, gWhiscash_Gfx[var0], (void *)0x06012120, 0x460); + DmaCopy16(3, gWhiscash_Gfx[var0], OBJ_TILE_ADDR(TILE_INDEX(0, 8, 9)), 0x460); for (i = 0; i < WHISCASH_SPRITE_SEGMENTS; i++) { oamSimple = &group->oam[i]; @@ -1088,7 +1088,7 @@ void SphealBoard_PelipperDeliversBall(void) group->baseX = (gCurrentPinballGame->pelipperPosX / 10) - (gCurrentPinballGame->cameraXOffset - 146); group->baseY = (gCurrentPinballGame->pelipperPosY / 10) - (gCurrentPinballGame->cameraYOffset - 110) + (gCurrentPinballGame->pelipperYBobOffset / 10); index = gCurrentPinballGame->deliveryAnimFrameIndex; - DmaCopy16(3, gPelipper_Gfx[index], (void *)0x060125A0, 0x480); + DmaCopy16(3, gPelipper_Gfx[index], OBJ_TILE_ADDR(TILE_INDEX(0, 9, 13)), 0x480); for (i = 0; i < PELIPPER_SPRITE_SEGMENTS; i++) { oamSimple = &group->oam[i]; @@ -1473,7 +1473,7 @@ void AnimateSphealBackground(void) for (i = 0x100; i < 0x400; i++) gBG0TilemapBuffer[0x800 + i] = gSphealWaterBackgroundTilemap[i] + var0 * 4; - DmaCopy16(3, &gBG0TilemapBuffer[0x800], BG_CHAR_SCREEN_ADDR(0,0), BG_SCREEN_SIZE); + DmaCopy16(3, &gBG0TilemapBuffer[0x800], BG_TILE_ADDR(TILE_INDEX(0,0,0)), BG_SCREEN_SIZE); } diff --git a/src/titlescreen.c b/src/titlescreen.c index a33d9949..eda1bb71 100644 --- a/src/titlescreen.c +++ b/src/titlescreen.c @@ -52,24 +52,24 @@ void LoadTitlescreenGraphics(void) REG_DISPCNT |= DISPCNT_BG1_ON; gMain.dispcntBackup = REG_DISPCNT; - DmaCopy16(3, gTitlescreenBg_Gfx, BG_CHAR_ADDR(1), 0xA000); + DmaCopy16(3, gTitlescreenBg_Gfx, BG_TILE_ADDR(TILE_INDEX(1,0,0)), 0xA000); DmaCopy16(3, gTitlescreenBg_Pals, BG_PLTT, BG_PLTT_SIZE); - DmaCopy16(3, gTitlescreenBgTilemap, BG_SCREEN_ADDR(0), BG_SCREEN_SIZE); + DmaCopy16(3, gTitlescreenBgTilemap, BG_TILE_ADDR(TILE_INDEX(0,0,0)), BG_SCREEN_SIZE); SaveFile_ReadSavedGamePresent(); if (gMain.hasSavedGame == TRUE) { DmaCopy16(3, gTitlescreenSprites_Pals, OBJ_PLTT_SLOT(PAL_IX_0), 5*PLTT_SLOT_SIZE); - DmaCopy16(3, gTitlescreenSpritesSavedGame_Gfx, BG_CHAR_ADDR(4), 0x7000); + DmaCopy16(3, gTitlescreenSpritesSavedGame_Gfx, OBJ_TILE_ADDR(TILE_INDEX(0,0,0)), 0x7000); DmaCopy16(3, gGBAButtonIcons_Pals, OBJ_PLTT_SLOT(PAL_IX_5), 2*PLTT_SLOT_SIZE); - DmaCopy16(3, gOptionsSprites_Gfx, (void *)OBJ_VRAM0 + 0x7000, 0x400); + DmaCopy16(3, gOptionsSprites_Gfx, OBJ_TILE_ADDR(TILE_INDEX(1, 12, 0)), 0x400); } else { DmaCopy16(3, gTitlescreenSprites_Pals, OBJ_PLTT_SLOT(PAL_IX_0), 5*PLTT_SLOT_SIZE); - DmaCopy16(3, gTitlescreenSpritesNoSavedGame_Gfx, BG_CHAR_ADDR(4), 0x7000); + DmaCopy16(3, gTitlescreenSpritesNoSavedGame_Gfx, OBJ_TILE_ADDR(TILE_INDEX(0,0,0)), 0x7000); DmaCopy16(3, gGBAButtonIcons_Pals, OBJ_PLTT_SLOT(PAL_IX_5), 2*PLTT_SLOT_SIZE); - DmaCopy16(3, gOptionsSprites_Gfx, (void *)OBJ_VRAM0 + 0x7000, 0x400); + DmaCopy16(3, gOptionsSprites_Gfx, OBJ_TILE_ADDR(TILE_INDEX(1, 12, 0)), 0x400); } InitTitlescreenStates(); @@ -394,13 +394,13 @@ void TitleScreen7_ProcessMenuItemSelected_NoSavedGame(void) if (!gTitlescreen.animPhase) { gTitlescreen.animPhase = 1; - CopyBgTilesRect((void *)(OBJ_VRAM0 + 0x1E0 + gTitlescreen.menuCursorIndex * 0x800), gTempGfxBuffer, 8, 2); - CopyBgTilesRect((void *)(OBJ_VRAM0 + 0x61E0), (void *)(OBJ_VRAM0 + 0x1E0 + gTitlescreen.menuCursorIndex * 0x800), 8, 2); + CopyBgTilesRect((void *)(OBJ_TILE_ADDR(TILE_INDEX(0, 0, 15)) + gTitlescreen.menuCursorIndex * 0x800), gTempGfxBuffer, 8, 2); + CopyBgTilesRect((void *)OBJ_TILE_ADDR(TILE_INDEX(1, 8, 15)), (void *)(OBJ_TILE_ADDR(TILE_INDEX(0, 0, 15)) + gTitlescreen.menuCursorIndex * 0x800), 8, 2); } else { gTitlescreen.animPhase = 0; - CopyBgTilesRect(gTempGfxBuffer, (void *)(OBJ_VRAM0 + 0x1E0 + gTitlescreen.menuCursorIndex * 0x800), 8, 2); + CopyBgTilesRect(gTempGfxBuffer, (void *)(OBJ_TILE_ADDR(TILE_INDEX(0, 0, 15)) + gTitlescreen.menuCursorIndex * 0x800), 8, 2); } } @@ -495,13 +495,13 @@ void TitleScreen8_ProcessMenuItemSelected_SavedGame(void) if (!gTitlescreen.animPhase) { gTitlescreen.animPhase = 1; - CopyBgTilesRect((void *)(OBJ_VRAM0 + 0x1E0 + gTitlescreen.menuCursorIndex * 0x800), gTempGfxBuffer, 8, 2); - CopyBgTilesRect((void *)(OBJ_VRAM0 + 0x61E0), (void *)(OBJ_VRAM0 + 0x1E0 + gTitlescreen.menuCursorIndex * 0x800), 8, 2); + CopyBgTilesRect((void *)(OBJ_TILE_ADDR(TILE_INDEX(0, 0, 15)) + gTitlescreen.menuCursorIndex * 0x800), gTempGfxBuffer, 8, 2); + CopyBgTilesRect((void *)OBJ_TILE_ADDR(TILE_INDEX(1, 8, 15)), (void *)(OBJ_TILE_ADDR(TILE_INDEX(0, 0, 15)) + gTitlescreen.menuCursorIndex * 0x800), 8, 2); } else { gTitlescreen.animPhase = 0; - CopyBgTilesRect(gTempGfxBuffer, (void *)(OBJ_VRAM0 + 0x1E0 + gTitlescreen.menuCursorIndex * 0x800), 8, 2); + CopyBgTilesRect(gTempGfxBuffer, (void *)(OBJ_TILE_ADDR(TILE_INDEX(0, 0, 15)) + gTitlescreen.menuCursorIndex * 0x800), 8, 2); } } diff --git a/src/util.c b/src/util.c index 90fad548..603a40cb 100644 --- a/src/util.c +++ b/src/util.c @@ -49,7 +49,7 @@ void FadeOutScreen(void) gMain.dispcntBackup |= DISPCNT_FORCED_BLANK; REG_DISPCNT |= DISPCNT_FORCED_BLANK; - DmaFill16(3, 0, (void *)BG_VRAM, 0x18000); + DmaFill16(3, 0, (void *)BG_TILE_ADDR(TILE_INDEX(0,0,0)), 0x18000); REG_BG0HOFS = 0; REG_BG0VOFS = 0; REG_BG1HOFS = 0;