summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--charmap.asm (renamed from macros/charmap.asm)0
-rw-r--r--constants.asm8
-rwxr-xr-xconstants/collision_constants.asm129
-rwxr-xr-xconstants/hardware_constants.asm164
-rw-r--r--constants/item_constants.asm577
-rwxr-xr-xconstants/mart_constants.asm43
-rw-r--r--constants/script_constants.asm2
-rw-r--r--constants/tilemap_constants.asm6
-rwxr-xr-xdata/collision_permissions.asm261
-rwxr-xr-xdata/events/collision_stdscripts.asm13
-rw-r--r--data/pokemon/egg_moves.asm4
-rw-r--r--data/pokemon/evos_attacks.asm6
-rwxr-xr-xdata/predef_pointers.asm79
-rwxr-xr-x[-rw-r--r--]data/text/battle.asm110
-rwxr-xr-x[-rw-r--r--]data/text/common_1.asm242
-rw-r--r--data/text/common_2.asm200
-rw-r--r--data/text/common_3.asm74
-rw-r--r--engine/billspctop.asm28
-rwxr-xr-xengine/color.asm6
-rwxr-xr-xengine/events/bug_contest/contest.asm41
-rw-r--r--engine/events/daycare.asm56
-rwxr-xr-xengine/events/forced_movement.asm51
-rwxr-xr-xengine/events/happiness_egg.asm2
-rwxr-xr-xengine/events/heal_machine_anim.asm262
-rwxr-xr-xengine/events/misc_scripts.asm55
-rwxr-xr-xengine/events/misc_scripts_2.asm48
-rwxr-xr-xengine/events/overworld.asm102
-rwxr-xr-xengine/events/std_collision.asm29
-rwxr-xr-xengine/events/whiteout.asm76
-rw-r--r--engine/facings.asm3
-rwxr-xr-xengine/health.asm2
-rw-r--r--engine/learn.asm20
-rwxr-xr-xengine/learn_tm.asm2
-rwxr-xr-xengine/link/place_waiting_text.asm24
-rwxr-xr-xengine/main_menu.asm58
-rwxr-xr-xengine/move_mon.asm60
-rw-r--r--engine/namingscreen.asm12
-rwxr-xr-xengine/overworld/map_objects.asm14
-rwxr-xr-xengine/overworld/player_movement.asm2
-rwxr-xr-xengine/overworld/time.asm4
-rwxr-xr-xengine/pack.asm80
-rwxr-xr-xengine/predef.asm100
-rw-r--r--engine/sine.asm2
-rwxr-xr-xengine/specials.asm52
-rwxr-xr-xengine/sprites_dump.asm0
-rwxr-xr-xengine/step_types.asm2
-rwxr-xr-xengine/title.asm16
-rwxr-xr-xgfx/overworld/heal_machine.pal4
-rwxr-xr-xgfx/overworld/heal_machine.pngbin0 -> 93 bytes
-rw-r--r--home.asm23
-rw-r--r--home/battle.asm4
-rw-r--r--home/copy.asm8
-rw-r--r--home/flag.asm2
-rw-r--r--home/init.asm6
-rw-r--r--home/item.asm4
-rw-r--r--home/joypad.asm4
-rw-r--r--home/map.asm48
-rw-r--r--home/map_objects.asm14
-rw-r--r--home/math.asm2
-rw-r--r--home/pokedex_flags.asm2
-rw-r--r--home/predef.asm46
-rw-r--r--home/random.asm4
-rw-r--r--home/rtc.asm4
-rw-r--r--home/serial.asm4
-rw-r--r--home/text.asm62
-rwxr-xr-x[-rw-r--r--]home/tilemap.asm12
-rw-r--r--home/time.asm4
-rw-r--r--home/window.asm4
-rw-r--r--includes.asm2
-rwxr-xr-xitems/item_effects.asm170
-rw-r--r--macros.asm272
-rw-r--r--macros/basestats.asm30
-rwxr-xr-xmacros/coords.asm52
-rwxr-xr-xmacros/data.asm126
-rwxr-xr-x[-rw-r--r--]macros/enum.asm22
-rwxr-xr-xmacros/gfx.asm24
-rwxr-xr-x[-rw-r--r--]macros/predef.asm8
-rwxr-xr-x[-rw-r--r--]macros/rst.asm16
-rw-r--r--macros/scripts/movement.asm (renamed from macros/movement.asm)0
-rwxr-xr-xmacros/scripts/text.asm145
-rwxr-xr-xmacros/scripts/trade_anims.asm (renamed from macros/trade_anim.asm)0
-rw-r--r--macros/text.asm143
-rw-r--r--main.asm98
-rw-r--r--maps/BillsHouse.asm2
-rw-r--r--maps/BluesHouse.asm2
-rw-r--r--maps/CeladonCafe.asm2
-rw-r--r--maps/CeladonDeptStore6F.asm2
-rw-r--r--maps/CeladonGameCornerPrizeRoom.asm2
-rw-r--r--maps/DragonsDenB1F.asm2
-rw-r--r--maps/ElmsLab.asm2
-rw-r--r--maps/GoldenrodDeptStore6F.asm2
-rw-r--r--maps/GoldenrodGameCorner.asm2
-rw-r--r--maps/GoldenrodHappinessRater.asm2
-rw-r--r--maps/GoldenrodUnderground.asm6
-rw-r--r--maps/LakeOfRageMagikarpHouse.asm4
-rw-r--r--maps/Pokecenter2F.asm8
-rw-r--r--maps/RadioTower1F.asm2
-rw-r--r--maps/Route35NationalParkGate.asm6
-rw-r--r--maps/Route36NationalParkGate.asm6
-rw-r--r--maps/TrainerHouseB1F.asm2
-rwxr-xr-xpredef/sgb.asm2
-rw-r--r--wram.asm169
102 files changed, 2907 insertions, 1814 deletions
diff --git a/macros/charmap.asm b/charmap.asm
index 2f0b813b..2f0b813b 100644
--- a/macros/charmap.asm
+++ b/charmap.asm
diff --git a/constants.asm b/constants.asm
index 855e2940..4b3402e9 100644
--- a/constants.asm
+++ b/constants.asm
@@ -1,14 +1,17 @@
+INCLUDE "charmap.asm"
+
INCLUDE "macros.asm"
-INCLUDE "gbhw.asm"
INCLUDE "hram.asm"
+INCLUDE "constants/hardware_constants.asm"
INCLUDE "constants/wram_constants.asm"
INCLUDE "constants/sram_constants.asm"
INCLUDE "constants/pokemon_constants.asm"
INCLUDE "constants/type_constants.asm"
INCLUDE "constants/move_constants.asm"
INCLUDE "constants/battle_constants.asm"
+INCLUDE "constants/collision_constants.asm"
INCLUDE "constants/map_constants.asm"
INCLUDE "constants/map_setup_constants.asm"
INCLUDE "constants/landmark_constants.asm"
@@ -42,6 +45,7 @@ INCLUDE "constants/map_data_constants.asm"
INCLUDE "constants/input_constants.asm"
INCLUDE "constants/sprite_data_constants.asm"
INCLUDE "constants/serial_constants.asm"
+INCLUDE "constants/mart_constants.asm"
INCLUDE "constants/menu_constants.asm"
INCLUDE "constants/scene_constants.asm"
-INCLUDE "constants/npc_trade_constants.asm"
+INCLUDE "constants/npc_trade_constants.asm" \ No newline at end of file
diff --git a/constants/collision_constants.asm b/constants/collision_constants.asm
new file mode 100755
index 00000000..f9724da6
--- /dev/null
+++ b/constants/collision_constants.asm
@@ -0,0 +1,129 @@
+; collision permissions (see data/collision_permissions.asm)
+LANDTILE EQU $00
+WATERTILE EQU $01
+WALLTILE EQU $0f
+TALK EQU $10
+
+; collision data types (see data/tilesets/*_collision.asm)
+; TileCollisionTable indexes (see data/collision_permissions.asm)
+COLL_FLOOR EQU $00
+COLL_01 EQU $01 ; garbage
+COLL_03 EQU $03 ; garbage
+COLL_04 EQU $04 ; garbage
+COLL_WALL EQU $07
+COLL_CUT_08 EQU $08 ; unused
+COLL_TALL_GRASS_10 EQU $10 ; unused
+COLL_CUT_TREE EQU $12
+COLL_LONG_GRASS EQU $14
+COLL_HEADBUTT_TREE EQU $15
+COLL_TALL_GRASS EQU $18
+COLL_CUT_TREE_1A EQU $1a ; unused
+COLL_LONG_GRASS_1C EQU $1c ; unused
+COLL_HEADBUTT_TREE_1D EQU $1d ; unused
+COLL_WATER_21 EQU $21 ; ???
+COLL_ICE EQU $23
+COLL_WHIRLPOOL EQU $24
+COLL_BUOY EQU $27
+COLL_CUT_28 EQU $28 ; garbage
+COLL_WATER EQU $29
+COLL_ICE_2B EQU $2b ; unused
+COLL_WHIRLPOOL_2C EQU $2c ; unused
+COLL_WATERFALL_RIGHT EQU $30 ; unused
+COLL_WATERFALL_LEFT EQU $31 ; unused
+COLL_WATERFALL_UP EQU $32 ; unused
+COLL_WATERFALL EQU $33
+COLL_CURRENT_RIGHT EQU $38 ; unused
+COLL_CURRENT_LEFT EQU $39 ; unused
+COLL_CURRENT_UP EQU $3a ; unused
+COLL_CURRENT_DOWN EQU $3b ; unused
+COLL_BRAKE EQU $40 ; unused
+COLL_WALK_RIGHT EQU $41 ; unused
+COLL_WALK_LEFT EQU $42 ; unused
+COLL_WALK_UP EQU $43 ; unused
+COLL_WALK_DOWN EQU $44 ; unused
+COLL_BRAKE_45 EQU $45 ; garbage
+COLL_BRAKE_46 EQU $46 ; unused
+COLL_BRAKE_47 EQU $47 ; unused
+COLL_GRASS_48 EQU $48 ; unused
+COLL_GRASS_49 EQU $49 ; unused
+COLL_GRASS_4A EQU $4a ; garbage
+COLL_GRASS_4B EQU $4b ; garbage
+COLL_GRASS_4C EQU $4c ; unused
+COLL_WALK_RIGHT_ALT EQU $50 ; unused
+COLL_WALK_LEFT_ALT EQU $51 ; unused
+COLL_WALK_UP_ALT EQU $52 ; unused
+COLL_WALK_DOWN_ALT EQU $53 ; unused
+COLL_BRAKE_ALT EQU $54 ; unused
+COLL_BRAKE_55 EQU $55 ; unused
+COLL_BRAKE_56 EQU $56 ; unused
+COLL_BRAKE_57 EQU $57 ; unused
+COLL_5B EQU $5b ; garbage
+COLL_PIT EQU $60
+COLL_VIRTUAL_BOY EQU $61 ; garbage
+COLL_64 EQU $64 ; garbage
+COLL_65 EQU $65 ; garbage
+COLL_PIT_68 EQU $68 ; unused
+COLL_WARP_CARPET_DOWN EQU $70
+COLL_DOOR EQU $71
+COLL_LADDER EQU $72
+COLL_STAIRCASE_73 EQU $73 ; unused
+COLL_CAVE_74 EQU $74 ; unused
+COLL_DOOR_75 EQU $75 ; unused
+COLL_WARP_CARPET_LEFT EQU $76
+COLL_WARP_77 EQU $77 ; unused
+COLL_WARP_CARPET_UP EQU $78
+COLL_DOOR_79 EQU $79 ; unused
+COLL_STAIRCASE EQU $7a
+COLL_CAVE EQU $7b
+COLL_WARP_PANEL EQU $7c
+COLL_DOOR_7D EQU $7d ; unused
+COLL_WARP_CARPET_RIGHT EQU $7e
+COLL_WARP_7F EQU $7f ; unused
+COLL_COUNTER EQU $90
+COLL_BOOKSHELF EQU $91
+COLL_PC EQU $93
+COLL_RADIO EQU $94
+COLL_TOWN_MAP EQU $95
+COLL_MART_SHELF EQU $96
+COLL_TV EQU $97
+COLL_COUNTER_98 EQU $98 ; unused
+COLL_9C EQU $9c ; garbage
+COLL_WINDOW EQU $9d
+COLL_INCENSE_BURNER EQU $9f
+COLL_HOP_RIGHT EQU $a0
+COLL_HOP_LEFT EQU $a1
+COLL_HOP_UP EQU $a2 ; unused
+COLL_HOP_DOWN EQU $a3
+COLL_HOP_DOWN_RIGHT EQU $a4
+COLL_HOP_DOWN_LEFT EQU $a5
+COLL_HOP_UP_RIGHT EQU $a6 ; unused
+COLL_HOP_UP_LEFT EQU $a7 ; unused
+COLL_RIGHT_WALL EQU $b0
+COLL_LEFT_WALL EQU $b1
+COLL_UP_WALL EQU $b2
+COLL_DOWN_WALL EQU $b3 ; unused
+COLL_DOWN_RIGHT_WALL EQU $b4 ; unused
+COLL_DOWN_LEFT_WALL EQU $b5 ; unused
+COLL_UP_RIGHT_WALL EQU $b6 ; unused
+COLL_UP_LEFT_WALL EQU $b7 ; unused
+COLL_RIGHT_BUOY EQU $c0 ; unused
+COLL_LEFT_BUOY EQU $c1 ; unused
+COLL_UP_BUOY EQU $c2 ; unused
+COLL_DOWN_BUOY EQU $c3 ; unused
+COLL_DOWN_RIGHT_BUOY EQU $c4 ; unused
+COLL_DOWN_LEFT_BUOY EQU $c5 ; unused
+COLL_UP_RIGHT_BUOY EQU $c6 ; unused
+COLL_UP_LEFT_BUOY EQU $c7 ; unused
+COLL_FF EQU $ff ; garbage
+
+; collision data type nybbles
+LO_NYBBLE_GRASS EQU $07
+HI_NYBBLE_TALL_GRASS EQU $10
+HI_NYBBLE_WATER EQU $20
+HI_NYBBLE_CURRENT EQU $30
+HI_NYBBLE_WALK EQU $40
+HI_NYBBLE_WALK_ALT EQU $50
+HI_NYBBLE_WARPS EQU $70
+HI_NYBBLE_LEDGES EQU $a0
+HI_NYBBLE_SIDE_WALLS EQU $b0
+HI_NYBBLE_SIDE_BUOYS EQU $c0
diff --git a/constants/hardware_constants.asm b/constants/hardware_constants.asm
new file mode 100755
index 00000000..6205a1d7
--- /dev/null
+++ b/constants/hardware_constants.asm
@@ -0,0 +1,164 @@
+; Graciously aped from:
+; http://nocash.emubase.de/pandocs.htm
+; http://gameboy.mongenel.com/dmg/asmmemmap.html
+
+; memory map
+VRAM_Begin EQU $8000
+VRAM_End EQU $a000
+SRAM_Begin EQU $a000
+SRAM_End EQU $c000
+WRAM0_Begin EQU $c000
+WRAM0_End EQU $d000
+WRAM1_Begin EQU $d000
+WRAM1_End EQU $e000
+; hardware registers $ff00-$ff80 (see below)
+HRAM_Begin EQU $ff80
+HRAM_End EQU $ffff
+
+; MBC3
+MBC3SRamEnable EQU $0000
+MBC3RomBank EQU $2000
+MBC3SRamBank EQU $4000
+MBC3LatchClock EQU $6000
+MBC3RTC EQU $a000
+
+SRAM_DISABLE EQU $00
+SRAM_ENABLE EQU $0a
+
+NUM_SRAM_BANKS EQU 4
+
+RTC_S EQU $08 ; Seconds 0-59 (0-3Bh)
+RTC_M EQU $09 ; Minutes 0-59 (0-3Bh)
+RTC_H EQU $0a ; Hours 0-23 (0-17h)
+RTC_DL EQU $0b ; Lower 8 bits of Day Counter (0-FFh)
+RTC_DH EQU $0c ; Upper 1 bit of Day Counter, Carry Bit, Halt Flag
+ ; Bit 0 Most significant bit of Day Counter (Bit 8)
+ ; Bit 6 Halt (0=Active, 1=Stop Timer)
+ ; Bit 7 Day Counter Carry Bit (1=Counter Overflow)
+
+; interrupt flags
+VBLANK EQU 0
+LCD_STAT EQU 1
+TIMER EQU 2
+SERIAL EQU 3
+JOYPAD EQU 4
+IE_DEFAULT EQU (1 << SERIAL) | (1 << TIMER) | (1 << LCD_STAT) | (1 << VBLANK)
+
+; OAM attribute flags
+OAM_TILE_BANK EQU 3
+OAM_OBP_NUM EQU 4 ; non CGB Mode Only
+OAM_X_FLIP EQU 5
+OAM_Y_FLIP EQU 6
+OAM_PRIORITY EQU 7 ; 0: OBJ above BG, 1: OBJ behind BG (colors 1-3)
+
+; BG Map attribute flags
+PALETTE_MASK EQU %111
+VRAM_BANK_1 EQU 1 << OAM_TILE_BANK ; $08
+OBP_NUM EQU 1 << OAM_OBP_NUM ; $10
+X_FLIP EQU 1 << OAM_X_FLIP ; $20
+Y_FLIP EQU 1 << OAM_Y_FLIP ; $40
+PRIORITY EQU 1 << OAM_PRIORITY ; $80
+
+; Hardware registers
+rJOYP EQU $ff00 ; Joypad (R/W)
+rSB EQU $ff01 ; Serial transfer data (R/W)
+rSC EQU $ff02 ; Serial Transfer Control (R/W)
+rSC_ON EQU 7
+rSC_CGB EQU 1
+rSC_CLOCK EQU 0
+rDIV EQU $ff04 ; Divider Register (R/W)
+rTIMA EQU $ff05 ; Timer counter (R/W)
+rTMA EQU $ff06 ; Timer Modulo (R/W)
+rTAC EQU $ff07 ; Timer Control (R/W)
+rTAC_ON EQU 2
+rTAC_4096_HZ EQU 0
+rTAC_262144_HZ EQU 1
+rTAC_65536_HZ EQU 2
+rTAC_16384_HZ EQU 3
+rIF EQU $ff0f ; Interrupt Flag (R/W)
+rNR10 EQU $ff10 ; Channel 1 Sweep register (R/W)
+rNR11 EQU $ff11 ; Channel 1 Sound length/Wave pattern duty (R/W)
+rNR12 EQU $ff12 ; Channel 1 Volume Envelope (R/W)
+rNR13 EQU $ff13 ; Channel 1 Frequency lo (Write Only)
+rNR14 EQU $ff14 ; Channel 1 Frequency hi (R/W)
+rNR20 EQU $ff15 ; Channel 2 Sweep register (R/W)
+rNR21 EQU $ff16 ; Channel 2 Sound Length/Wave Pattern Duty (R/W)
+rNR22 EQU $ff17 ; Channel 2 Volume Envelope (R/W)
+rNR23 EQU $ff18 ; Channel 2 Frequency lo data (W)
+rNR24 EQU $ff19 ; Channel 2 Frequency hi data (R/W)
+rNR30 EQU $ff1a ; Channel 3 Sound on/off (R/W)
+rNR31 EQU $ff1b ; Channel 3 Sound Length
+rNR32 EQU $ff1c ; Channel 3 Select output level (R/W)
+rNR33 EQU $ff1d ; Channel 3 Frequency's lower data (W)
+rNR34 EQU $ff1e ; Channel 3 Frequency's higher data (R/W)
+rNR40 EQU $ff1f ; Channel 4 Sweep register (R/W)
+rNR41 EQU $ff20 ; Channel 4 Sound Length (R/W)
+rNR42 EQU $ff21 ; Channel 4 Volume Envelope (R/W)
+rNR43 EQU $ff22 ; Channel 4 Polynomial Counter (R/W)
+rNR44 EQU $ff23 ; Channel 4 Counter/consecutive; Inital (R/W)
+rNR50 EQU $ff24 ; Channel control / ON-OFF / Volume (R/W)
+rNR51 EQU $ff25 ; Selection of Sound output terminal (R/W)
+rNR52 EQU $ff26 ; Sound on/off
+rWave_0 EQU $ff30
+rWave_1 EQU $ff31
+rWave_2 EQU $ff32
+rWave_3 EQU $ff33
+rWave_4 EQU $ff34
+rWave_5 EQU $ff35
+rWave_6 EQU $ff36
+rWave_7 EQU $ff37
+rWave_8 EQU $ff38
+rWave_9 EQU $ff39
+rWave_a EQU $ff3a
+rWave_b EQU $ff3b
+rWave_c EQU $ff3c
+rWave_d EQU $ff3d
+rWave_e EQU $ff3e
+rWave_f EQU $ff3f
+rLCDC EQU $ff40 ; LCD Control (R/W)
+rLCDC_BG_PRIORITY EQU 0 ; 0=Off, 1=On
+rLCDC_SPRITES_ENABLE EQU 1 ; 0=Off, 1=On
+rLCDC_SPRITE_SIZE EQU 2 ; 0=8x8, 1=8x16
+rLCDC_BG_TILEMAP EQU 3 ; 0=9800-9BFF, 1=9C00-9FFF
+rLCDC_TILE_DATA EQU 4 ; 0=8800-97FF, 1=8000-8FFF
+rLCDC_WINDOW_ENABLE EQU 5 ; 0=Off, 1=On
+rLCDC_WINDOW_TILEMAP EQU 6 ; 0=9800-9BFF, 1=9C00-9FFF
+rLCDC_ENABLE EQU 7 ; 0=Off, 1=On
+LCDC_DEFAULT EQU (1 << rLCDC_ENABLE) | (1 << rLCDC_WINDOW_TILEMAP) | (1 << rLCDC_WINDOW_ENABLE) | (1 << rLCDC_SPRITES_ENABLE) | (1 << rLCDC_BG_PRIORITY)
+rSTAT EQU $ff41 ; LCDC Status (R/W)
+rSCY EQU $ff42 ; Scroll Y (R/W)
+rSCX EQU $ff43 ; Scroll X (R/W)
+rLY EQU $ff44 ; LCDC Y-Coordinate (R)
+LY_VBLANK EQU 144
+rLYC EQU $ff45 ; LY Compare (R/W)
+rDMA EQU $ff46 ; DMA Transfer and Start Address (W)
+rBGP EQU $ff47 ; BG Palette Data (R/W) - Non CGB Mode Only
+rOBP0 EQU $ff48 ; Object Palette 0 Data (R/W) - Non CGB Mode Only
+rOBP1 EQU $ff49 ; Object Palette 1 Data (R/W) - Non CGB Mode Only
+rWY EQU $ff4a ; Window Y Position (R/W)
+rWX EQU $ff4b ; Window X Position minus 7 (R/W)
+rLCDMODE EQU $ff4c
+rKEY1 EQU $ff4d ; CGB Mode Only - Prepare Speed Switch
+rVBK EQU $ff4f ; CGB Mode Only - VRAM Bank
+rBLCK EQU $ff50
+rHDMA1 EQU $ff51 ; CGB Mode Only - New DMA Source, High
+rHDMA2 EQU $ff52 ; CGB Mode Only - New DMA Source, Low
+rHDMA3 EQU $ff53 ; CGB Mode Only - New DMA Destination, High
+rHDMA4 EQU $ff54 ; CGB Mode Only - New DMA Destination, Low
+rHDMA5 EQU $ff55 ; CGB Mode Only - New DMA Length/Mode/Start
+rRP EQU $ff56 ; CGB Mode Only - Infrared Communications Port
+rBGPI EQU $ff68 ; CGB Mode Only - Background Palette Index
+rBGPI_AUTO_INCREMENT EQU 7 ; increment rBGPI after write to rBGPD
+rBGPD EQU $ff69 ; CGB Mode Only - Background Palette Data
+rOBPI EQU $ff6a ; CGB Mode Only - Sprite Palette Index
+rOBPI_AUTO_INCREMENT EQU 7 ; increment rOBPI after write to rOBPD
+rOBPD EQU $ff6b ; CGB Mode Only - Sprite Palette Data
+rUNKNOWN1 EQU $ff6c ; (FEh) Bit 0 (Read/Write) - CGB Mode Only
+rSVBK EQU $ff70 ; CGB Mode Only - WRAM Bank
+rUNKNOWN2 EQU $ff72 ; (00h) - Bit 0-7 (Read/Write)
+rUNKNOWN3 EQU $ff73 ; (00h) - Bit 0-7 (Read/Write)
+rUNKNOWN4 EQU $ff74 ; (00h) - Bit 0-7 (Read/Write) - CGB Mode Only
+rUNKNOWN5 EQU $ff75 ; (8Fh) - Bit 4-6 (Read/Write)
+rUNKNOWN6 EQU $ff76 ; (00h) - Always 00h (Read Only)
+rUNKNOWN7 EQU $ff77 ; (00h) - Always 00h (Read Only)
+rIE EQU $ffff ; Interrupt Enable (R/W)
diff --git a/constants/item_constants.asm b/constants/item_constants.asm
index f8429010..480ab577 100644
--- a/constants/item_constants.asm
+++ b/constants/item_constants.asm
@@ -5,310 +5,285 @@
; - ItemAttributes (see data/items/attributes.asm)
; - ItemEffects (see engine/items/item_effects.asm)
const_def
- const NO_ITEM ; $00
- const MASTER_BALL ; $01
- const ULTRA_BALL ; $02
- const BRIGHTPOWDER ; $03
- const GREAT_BALL ; $04
- const POKE_BALL ; $05
- const TOWN_MAP ; $06
- const BICYCLE ; $07
- const MOON_STONE ; $08
- const ANTIDOTE ; $09
- const BURN_HEAL ; $0A
- const ICE_HEAL ; $0B
- const AWAKENING ; $0C
- const PARLYZ_HEAL ; $0D
- const FULL_RESTORE ; $0E
- const MAX_POTION ; $0F
- const HYPER_POTION ; $10
- const SUPER_POTION ; $11
- const POTION ; $12
- const ESCAPE_ROPE ; $13
- const REPEL ; $14
- const MAX_ELIXER ; $15
- const FIRE_STONE ; $16
- const THUNDERSTONE ; $17
- const WATER_STONE ; $18
- const ITEM_19 ; $19
- const HP_UP ; $1A
- const PROTEIN ; $1B
- const IRON ; $1C
- const CARBOS ; $1D
- const LUCKY_PUNCH ; $1E
- const CALCIUM ; $1F
- const RARE_CANDY ; $20
- const X_ACCURACY ; $21
- const LEAF_STONE ; $22
- const METAL_POWDER ; $23
- const NUGGET ; $24
- const POKE_DOLL ; $25
- const FULL_HEAL ; $26
- const REVIVE ; $27
- const MAX_REVIVE ; $28
- const GUARD_SPEC ; $29
- const SUPER_REPEL ; $2A
- const MAX_REPEL ; $2B
- const DIRE_HIT ; $2C
- const ITEM_2D ; $2D
- const FRESH_WATER ; $2E
- const SODA_POP ; $2F
- const LEMONADE ; $30
- const X_ATTACK ; $31
- const ITEM_32 ; $32
- const X_DEFEND ; $33
- const X_SPEED ; $34
- const X_SPECIAL ; $35
- const COIN_CASE ; $36
- const ITEMFINDER ; $37
- const POKE_FLUTE ; $38
- const EXP_SHARE ; $39
- const OLD_ROD ; $3A
- const GOOD_ROD ; $3B
- const SILVER_LEAF ; $3C
- const SUPER_ROD ; $3D
- const PP_UP ; $3E
- const ETHER ; $3F
- const MAX_ETHER ; $40
- const ELIXER ; $41
- const RED_SCALE ; $42
- const SECRETPOTION ; $43
- const S_S_TICKET ; $44
- const MYSTERY_EGG ; $45
- const ITEM_46 ; $46
- const SILVER_WING ; $47
- const MOOMOO_MILK ; $48
- const QUICK_CLAW ; $49
- const PSNCUREBERRY ; $4A
- const GOLD_LEAF ; $4B
- const SOFT_SAND ; $4C
- const SHARP_BEAK ; $4D
- const PRZCUREBERRY ; $4E
- const BURNT_BERRY ; $4F
- const ICE_BERRY ; $50
- const POISON_BARB ; $51
- const KINGS_ROCK ; $52
- const BITTER_BERRY ; $53
- const MINT_BERRY ; $54
- const RED_APRICORN ; $55
- const TINYMUSHROOM ; $56
- const BIG_MUSHROOM ; $57
- const SILVERPOWDER ; $58
- const BLU_APRICORN ; $59
- const ITEM_5A ; $5A
- const AMULET_COIN ; $5B
- const YLW_APRICORN ; $5C
- const GRN_APRICORN ; $5D
- const CLEANSE_TAG ; $5E
- const MYSTIC_WATER ; $5F
- const TWISTEDSPOON ; $60
- const WHT_APRICORN ; $61
- const BLACKBELT ; $62
- const BLK_APRICORN ; $63
- const ITEM_64 ; $64
- const PNK_APRICORN ; $65
- const BLACKGLASSES ; $66
- const SLOWPOKETAIL ; $67
- const PINK_BOW ; $68
- const STICK ; $69
- const SMOKE_BALL ; $6A
- const NEVERMELTICE ; $6B
- const MAGNET ; $6C
- const MIRACLEBERRY ; $6D
- const PEARL ; $6E
- const BIG_PEARL ; $6F
- const EVERSTONE ; $70
- const SPELL_TAG ; $71
- const RAGECANDYBAR ; $72
- const ITEM_73 ; $73
- const ITEM_74 ; $74
- const MIRACLE_SEED ; $75
- const THICK_CLUB ; $76
- const FOCUS_BAND ; $77
- const ITEM_78 ; $78
- const ENERGYPOWDER ; $79
- const ENERGY_ROOT ; $7A
- const HEAL_POWDER ; $7B
- const REVIVAL_HERB ; $7C
- const HARD_STONE ; $7D
- const LUCKY_EGG ; $7E
- const CARD_KEY ; $7F
- const MACHINE_PART ; $80
- const ITEM_81 ; $81
- const LOST_ITEM ; $82
- const STARDUST ; $83
- const STAR_PIECE ; $84
- const BASEMENT_KEY ; $85
- const PASS ; $86
- const ITEM_87 ; $87
- const ITEM_88 ; $88
- const ITEM_89 ; $89
- const CHARCOAL ; $8A
- const BERRY_JUICE ; $8B
- const SCOPE_LENS ; $8C
- const ITEM_8D ; $8D
- const ITEM_8E ; $8E
- const METAL_COAT ; $8F
- const DRAGON_FANG ; $90
- const ITEM_91 ; $91
- const LEFTOVERS ; $92
- const ITEM_93 ; $93
- const ITEM_94 ; $94
- const ITEM_95 ; $95
- const MYSTERYBERRY ; $96
- const DRAGON_SCALE ; $97
- const BERSERK_GENE ; $98
- const ITEM_99 ; $99
- const ITEM_9A ; $9A
- const ITEM_9B ; $9B
- const SACRED_ASH ; $9C
- const HEAVY_BALL ; $9D
- const FLOWER_MAIL ; $9E
- const LEVEL_BALL ; $9F
- const LURE_BALL ; $A0
- const FAST_BALL ; $A1
- const ITEM_A2 ; $A2
- const LIGHT_BALL ; $A3
- const FRIEND_BALL ; $A4
- const MOON_BALL ; $A5
- const LOVE_BALL ; $A6
- const NORMAL_BOX ; $A7
- const GORGEOUS_BOX ; $A8
- const SUN_STONE ; $A9
- const POLKADOT_BOW ; $AA
- const ITEM_AB ; $AB
- const UP_GRADE ; $AC
- const BERRY ; $AD
- const GOLD_BERRY ; $AE
- const SQUIRTBOTTLE ; $AF
- const ITEM_B0 ; $B0
- const PARK_BALL ; $B1
- const RAINBOW_WING ; $B2
- const ITEM_B3 ; $B3
- const BRICK_PIECE ; $B4
- const SURF_MAIL ; $B5
- const LITEBLUEMAIL ; $B6
- const PORTRAITMAIL ; $B7
- const LOVELY_MAIL ; $B8
- const EON_MAIL ; $B9
- const MORPH_MAIL ; $BA
- const BLUESKY_MAIL ; $BB
- const MUSIC_MAIL ; $BC
- const MIRAGE_MAIL ; $BD
- const ITEM_BE ; $BE
+ const NO_ITEM ; 00
+ const MASTER_BALL ; 01
+ const ULTRA_BALL ; 02
+ const BRIGHTPOWDER ; 03
+ const GREAT_BALL ; 04
+ const POKE_BALL ; 05
+ const TOWN_MAP ; 06
+ const BICYCLE ; 07
+ const MOON_STONE ; 08
+ const ANTIDOTE ; 09
+ const BURN_HEAL ; 0a
+ const ICE_HEAL ; 0b
+ const AWAKENING ; 0c
+ const PARLYZ_HEAL ; 0d
+ const FULL_RESTORE ; 0e
+ const MAX_POTION ; 0f
+ const HYPER_POTION ; 10
+ const SUPER_POTION ; 11
+ const POTION ; 12
+ const ESCAPE_ROPE ; 13
+ const REPEL ; 14
+ const MAX_ELIXER ; 15
+ const FIRE_STONE ; 16
+ const THUNDERSTONE ; 17
+ const WATER_STONE ; 18
+ const ITEM_19 ; 19
+ const HP_UP ; 1a
+ const PROTEIN ; 1b
+ const IRON ; 1c
+ const CARBOS ; 1d
+ const LUCKY_PUNCH ; 1e
+ const CALCIUM ; 1f
+ const RARE_CANDY ; 20
+ const X_ACCURACY ; 21
+ const LEAF_STONE ; 22
+ const METAL_POWDER ; 23
+ const NUGGET ; 24
+ const POKE_DOLL ; 25
+ const FULL_HEAL ; 26
+ const REVIVE ; 27
+ const MAX_REVIVE ; 28
+ const GUARD_SPEC ; 29
+ const SUPER_REPEL ; 2a
+ const MAX_REPEL ; 2b
+ const DIRE_HIT ; 2c
+ const ITEM_2D ; 2d
+ const FRESH_WATER ; 2e
+ const SODA_POP ; 2f
+ const LEMONADE ; 30
+ const X_ATTACK ; 31
+ const ITEM_32 ; 32
+ const X_DEFEND ; 33
+ const X_SPEED ; 34
+ const X_SPECIAL ; 35
+ const COIN_CASE ; 36
+ const ITEMFINDER ; 37
+ const POKE_FLUTE ; 38
+ const EXP_SHARE ; 39
+ const OLD_ROD ; 3a
+ const GOOD_ROD ; 3b
+ const SILVER_LEAF ; 3c
+ const SUPER_ROD ; 3d
+ const PP_UP ; 3e
+ const ETHER ; 3f
+ const MAX_ETHER ; 40
+ const ELIXER ; 41
+ const RED_SCALE ; 42
+ const SECRETPOTION ; 43
+ const S_S_TICKET ; 44
+ const MYSTERY_EGG ; 45
+ const ITEM_46 ; 46
+ const SILVER_WING ; 47
+ const MOOMOO_MILK ; 48
+ const QUICK_CLAW ; 49
+ const PSNCUREBERRY ; 4a
+ const GOLD_LEAF ; 4b
+ const SOFT_SAND ; 4c
+ const SHARP_BEAK ; 4d
+ const PRZCUREBERRY ; 4e
+ const BURNT_BERRY ; 4f
+ const ICE_BERRY ; 50
+ const POISON_BARB ; 51
+ const KINGS_ROCK ; 52
+ const BITTER_BERRY ; 53
+ const MINT_BERRY ; 54
+ const RED_APRICORN ; 55
+ const TINYMUSHROOM ; 56
+ const BIG_MUSHROOM ; 57
+ const SILVERPOWDER ; 58
+ const BLU_APRICORN ; 59
+ const ITEM_5A ; 5a
+ const AMULET_COIN ; 5b
+ const YLW_APRICORN ; 5c
+ const GRN_APRICORN ; 5d
+ const CLEANSE_TAG ; 5e
+ const MYSTIC_WATER ; 5f
+ const TWISTEDSPOON ; 60
+ const WHT_APRICORN ; 61
+ const BLACKBELT ; 62
+ const BLK_APRICORN ; 63
+ const ITEM_64 ; 64
+ const PNK_APRICORN ; 65
+ const BLACKGLASSES ; 66
+ const SLOWPOKETAIL ; 67
+ const PINK_BOW ; 68
+ const STICK ; 69
+ const SMOKE_BALL ; 6a
+ const NEVERMELTICE ; 6b
+ const MAGNET ; 6c
+ const MIRACLEBERRY ; 6d
+ const PEARL ; 6e
+ const BIG_PEARL ; 6f
+ const EVERSTONE ; 70
+ const SPELL_TAG ; 71
+ const RAGECANDYBAR ; 72
+ const ITEM_73 ; 73
+ const ITEM_74 ; 74
+ const MIRACLE_SEED ; 75
+ const THICK_CLUB ; 76
+ const FOCUS_BAND ; 77
+ const ITEM_78 ; 78
+ const ENERGYPOWDER ; 79
+ const ENERGY_ROOT ; 7a
+ const HEAL_POWDER ; 7b
+ const REVIVAL_HERB ; 7c
+ const HARD_STONE ; 7d
+ const LUCKY_EGG ; 7e
+ const CARD_KEY ; 7f
+ const MACHINE_PART ; 80
+ const ITEM_81 ; 81
+ const LOST_ITEM ; 82
+ const STARDUST ; 83
+ const STAR_PIECE ; 84
+ const BASEMENT_KEY ; 85
+ const PASS ; 86
+ const ITEM_87 ; 87
+ const ITEM_88 ; 88
+ const ITEM_89 ; 89
+ const CHARCOAL ; 8a
+ const BERRY_JUICE ; 8b
+ const SCOPE_LENS ; 8c
+ const ITEM_8D ; 8d
+ const ITEM_8E ; 8e
+ const METAL_COAT ; 8f
+ const DRAGON_FANG ; 90
+ const ITEM_91 ; 91
+ const LEFTOVERS ; 92
+ const ITEM_93 ; 93
+ const ITEM_94 ; 94
+ const ITEM_95 ; 95
+ const MYSTERYBERRY ; 96
+ const DRAGON_SCALE ; 97
+ const BERSERK_GENE ; 98
+ const ITEM_99 ; 99
+ const ITEM_9A ; 9a
+ const ITEM_9B ; 9b
+ const SACRED_ASH ; 9c
+ const HEAVY_BALL ; 9d
+ const FLOWER_MAIL ; 9e
+ const LEVEL_BALL ; 9f
+ const LURE_BALL ; a0
+ const FAST_BALL ; a1
+ const ITEM_A2 ; a2
+ const LIGHT_BALL ; a3
+ const FRIEND_BALL ; a4
+ const MOON_BALL ; a5
+ const LOVE_BALL ; a6
+ const NORMAL_BOX ; a7
+ const GORGEOUS_BOX ; a8
+ const SUN_STONE ; a9
+ const POLKADOT_BOW ; aa
+ const ITEM_AB ; ab
+ const UP_GRADE ; ac
+ const BERRY ; ad
+ const GOLD_BERRY ; ae
+ const SQUIRTBOTTLE ; af
+ const ITEM_B0 ; b0
+ const PARK_BALL ; b1
+ const RAINBOW_WING ; b2
+ const ITEM_B3 ; b3
+ const BRICK_PIECE ; b4
+ const SURF_MAIL ; b5
+ const LITEBLUEMAIL ; b6
+ const PORTRAITMAIL ; b7
+ const LOVELY_MAIL ; b8
+ const EON_MAIL ; b9
+ const MORPH_MAIL ; ba
+ const BLUESKY_MAIL ; bb
+ const MUSIC_MAIL ; bc
+ const MIRAGE_MAIL ; bd
+ const ITEM_BE ; be
- add_tm DYNAMICPUNCH ; $BF
- add_tm HEADBUTT ; $C0
- add_tm CURSE ; $C1
- add_tm ROLLOUT ; $C2
- const ITEM_C3 ; $C3
- add_tm ROAR ; $C4
- add_tm TOXIC ; $C5
- add_tm ZAP_CANNON ; $C6
- add_tm ROCK_SMASH ; $C7
- add_tm PSYCH_UP ; $C8
- add_tm HIDDEN_POWER ; $C9
- add_tm SUNNY_DAY ; $CA
- add_tm SWEET_SCENT ; $CB
- add_tm SNORE ; $CC
- add_tm BLIZZARD ; $CD
- add_tm HYPER_BEAM ; $CE
- add_tm ICY_WIND ; $CF
- add_tm PROTECT ; $D0
- add_tm RAIN_DANCE ; $D1
- add_tm GIGA_DRAIN ; $D2
- add_tm ENDURE ; $D3
- add_tm FRUSTRATION ; $D4
- add_tm SOLARBEAM ; $D5
- add_tm IRON_TAIL ; $D6
- add_tm DRAGONBREATH ; $D7
- add_tm THUNDER ; $D8
- add_tm EARTHQUAKE ; $D9
- add_tm RETURN ; $DA
- add_tm DIG ; $DB
- const ITEM_DC ; $DC
- add_tm PSYCHIC_M ; $DD
- add_tm SHADOW_BALL ; $DE
- add_tm MUD_SLAP ; $DF
- add_tm DOUBLE_TEAM ; $E0
- add_tm ICE_PUNCH ; $E1
- add_tm SWAGGER ; $E2
- add_tm SLEEP_TALK ; $E3
- add_tm SLUDGE_BOMB ; $E4
- add_tm SANDSTORM ; $E5
- add_tm FIRE_BLAST ; $E6
- add_tm SWIFT ; $E7
- add_tm DEFENSE_CURL ; $E8
- add_tm THUNDERPUNCH ; $E9
- add_tm DREAM_EATER ; $EA
- add_tm DETECT ; $EB
- add_tm REST ; $EC
- add_tm ATTRACT ; $ED
- add_tm THIEF ; $EE
- add_tm STEEL_WING ; $EF
- add_tm FIRE_PUNCH ; $F0
- add_tm FURY_CUTTER ; $F1
- add_tm NIGHTMARE ; $F2
-NUM_TMS = const_value - TM01 - 2
+add_tm: MACRO
+if !DEF(TM01)
+TM01 EQU const_value
+ enum_start 1
+endc
+ define _\@_1, "TM_\1"
+ const _\@_1
+ enum \1_TMNUM
+ENDM
- add_hm CUT ; $F3
- add_hm FLY ; $F4
- add_hm SURF ; $F5
- add_hm STRENGTH ; $F6
- add_hm FLASH ; $F7
- add_hm WHIRLPOOL ; $F8
- add_hm WATERFALL ; $F9
-NUM_HMS = const_value - HM01
- const HM_08 ; $FA
+; see data/moves/tmhm_moves.asm for moves
+ add_tm DYNAMICPUNCH ; bf
+ add_tm HEADBUTT ; c0
+ add_tm CURSE ; c1
+ add_tm ROLLOUT ; c2
+ const ITEM_C3 ; c3
+ add_tm ROAR ; c4
+ add_tm TOXIC ; c5
+ add_tm ZAP_CANNON ; c6
+ add_tm ROCK_SMASH ; c7
+ add_tm PSYCH_UP ; c8
+ add_tm HIDDEN_POWER ; c9
+ add_tm SUNNY_DAY ; ca
+ add_tm SWEET_SCENT ; cb
+ add_tm SNORE ; cc
+ add_tm BLIZZARD ; cd
+ add_tm HYPER_BEAM ; ce
+ add_tm ICY_WIND ; cf
+ add_tm PROTECT ; d0
+ add_tm RAIN_DANCE ; d1
+ add_tm GIGA_DRAIN ; d2
+ add_tm ENDURE ; d3
+ add_tm FRUSTRATION ; d4
+ add_tm SOLARBEAM ; d5
+ add_tm IRON_TAIL ; d6
+ add_tm DRAGONBREATH ; d7
+ add_tm THUNDER ; d8
+ add_tm EARTHQUAKE ; d9
+ add_tm RETURN ; da
+ add_tm DIG ; db
+ const ITEM_DC ; dc
+ add_tm PSYCHIC_M ; dd
+ add_tm SHADOW_BALL ; de
+ add_tm MUD_SLAP ; df
+ add_tm DOUBLE_TEAM ; e0
+ add_tm ICE_PUNCH ; e1
+ add_tm SWAGGER ; e2
+ add_tm SLEEP_TALK ; e3
+ add_tm SLUDGE_BOMB ; e4
+ add_tm SANDSTORM ; e5
+ add_tm FIRE_BLAST ; e6
+ add_tm SWIFT ; e7
+ add_tm DEFENSE_CURL ; e8
+ add_tm THUNDERPUNCH ; e9
+ add_tm DREAM_EATER ; ea
+ add_tm DETECT ; eb
+ add_tm REST ; ec
+ add_tm ATTRACT ; ed
+ add_tm THIEF ; ee
+ add_tm STEEL_WING ; ef
+ add_tm FIRE_PUNCH ; f0
+ add_tm FURY_CUTTER ; f1
+ add_tm NIGHTMARE ; f2
+NUM_TMS EQU const_value - TM01 - 2 ; discount ITEM_C3 and ITEM_DC
-ITEM_FROM_MEM EQU $ff
+add_hm: MACRO
+if !DEF(HM01)
+HM01 EQU const_value
+endc
+ define _\@_1, "HM_\1"
+ const _\@_1
+ enum \1_TMNUM
+ENDM
+ add_hm CUT ; f3
+ add_hm FLY ; f4
+ add_hm SURF ; f5
+ add_hm STRENGTH ; f6
+ add_hm FLASH ; f7
+ add_hm WHIRLPOOL ; f8
+ add_hm WATERFALL ; f9
+NUM_HMS EQU const_value - HM01
-; leftovers from red
-SAFARI_BALL EQU 8 ; MOON_STONE
-MOON_STONE_RED EQU 10 ; BURN_HEAL
-FULL_HEAL_RED EQU 52 ; X_SPEED
-MAIL_MAX_LENGTH EQU $20
-
- const_def
- const MARTTYPE_STANDARD
- const MARTTYPE_BITTER
- const MARTTYPE_BARGAIN
- const MARTTYPE_PHARMACY
- const MARTTYPE_ROOFTOP
+USE_SCRIPT_VAR EQU $00
+ITEM_FROM_MEM EQU $ff
- const_def
- const MART_CHERRYGROVE
- const MART_CHERRYGROVE_DEX
- const MART_VIOLET
- const MART_AZALEA
- const MART_CIANWOOD
- const MART_GOLDENROD_2F_1
- const MART_GOLDENROD_2F_2
- const MART_GOLDENROD_3F
- const MART_GOLDENROD_4F
- const MART_GOLDENROD_5F_1
- const MART_GOLDENROD_5F_2
- const MART_GOLDENROD_5F_3
- const MART_GOLDENROD_5F_4
- const MART_OLIVINE
- const MART_ECRUTEAK
- const MART_MAHOGANY_1
- const MART_MAHOGANY_2
- const MART_BLACKTHORN
- const MART_VIRIDIAN
- const MART_PEWTER
- const MART_CERULEAN
- const MART_LAVENDER
- const MART_VERMILION
- const MART_CELADON_2F_1
- const MART_CELADON_2F_2
- const MART_CELADON_3F
- const MART_CELADON_4F
- const MART_CELADON_5F_1
- const MART_CELADON_5F_2
- const MART_FUCHSIA
- const MART_SAFFRON
- const MART_MT_MOON
- const MART_INDIGO_PLATEAU
- const MART_UNDERGROUND
+; leftovers from red
+SAFARI_BALL EQU $08 ; MOON_STONE
+MOON_STONE_RED EQU $0a ; BURN_HEAL
+FULL_HEAL_RED EQU $34 ; X_SPEED \ No newline at end of file
diff --git a/constants/mart_constants.asm b/constants/mart_constants.asm
new file mode 100755
index 00000000..cffdfae0
--- /dev/null
+++ b/constants/mart_constants.asm
@@ -0,0 +1,43 @@
+; mart types (see engine/items/mart.asm)
+ const_def
+ const MARTTYPE_STANDARD
+ const MARTTYPE_BITTER
+ const MARTTYPE_BARGAIN
+ const MARTTYPE_PHARMACY
+
+; Marts indexes (see data/items/marts.asm)
+ const_def
+ const MART_CHERRYGROVE
+ const MART_CHERRYGROVE_DEX
+ const MART_VIOLET
+ const MART_AZALEA
+ const MART_CIANWOOD
+ const MART_GOLDENROD_2F_1
+ const MART_GOLDENROD_2F_2
+ const MART_GOLDENROD_3F
+ const MART_GOLDENROD_4F
+ const MART_GOLDENROD_5F_1
+ const MART_GOLDENROD_5F_2
+ const MART_GOLDENROD_5F_3
+ const MART_GOLDENROD_5F_4
+ const MART_OLIVINE
+ const MART_ECRUTEAK
+ const MART_MAHOGANY_1
+ const MART_MAHOGANY_2
+ const MART_BLACKTHORN
+ const MART_VIRIDIAN
+ const MART_PEWTER
+ const MART_CERULEAN
+ const MART_LAVENDER
+ const MART_VERMILION
+ const MART_CELADON_2F_1
+ const MART_CELADON_2F_2
+ const MART_CELADON_3F
+ const MART_CELADON_4F
+ const MART_CELADON_5F_1
+ const MART_CELADON_5F_2
+ const MART_FUCHSIA
+ const MART_SAFFRON
+ const MART_MT_MOON
+ const MART_INDIGO_PLATEAU
+ const MART_UNDERGROUND
diff --git a/constants/script_constants.asm b/constants/script_constants.asm
index 7870fc84..b0db4e70 100644
--- a/constants/script_constants.asm
+++ b/constants/script_constants.asm
@@ -270,4 +270,4 @@ NUM_UNOWN_PUZZLES EQU const_value
const_def 1
const MOVETUTOR_FLAMETHROWER ; 1
const MOVETUTOR_THUNDERBOLT ; 2
- const MOVETUTOR_ICE_BEAM ; 3
+ const MOVETUTOR_ICE_BEAM ; 3 \ No newline at end of file
diff --git a/constants/tilemap_constants.asm b/constants/tilemap_constants.asm
index 5fe2beb9..0ead1444 100644
--- a/constants/tilemap_constants.asm
+++ b/constants/tilemap_constants.asm
@@ -1,9 +1,3 @@
-LANDTILE EQU 0
-WALLTILE EQU 1
-WATRTILE EQU 15
-
-TALK EQU 1 << 4
-
const_value SET 1
const_def 1
const TILESET_JOHTO ; 01
diff --git a/data/collision_permissions.asm b/data/collision_permissions.asm
new file mode 100755
index 00000000..82ebb770
--- /dev/null
+++ b/data/collision_permissions.asm
@@ -0,0 +1,261 @@
+NONTALKABLE EQUS "db"
+TALKABLE EQUS "db TALK +"
+
+TileCollisionTable::
+; entries correspond to COLL_* constants
+ NONTALKABLE LANDTILE ; COLL_FLOOR
+ NONTALKABLE LANDTILE ; COLL_01
+ NONTALKABLE LANDTILE ; 02
+ NONTALKABLE LANDTILE ; COLL_03
+ NONTALKABLE LANDTILE ; COLL_04
+ NONTALKABLE LANDTILE ; 05
+ NONTALKABLE LANDTILE ; 06
+ NONTALKABLE WALLTILE ; COLL_WALL
+ NONTALKABLE LANDTILE ; COLL_CUT_08
+ NONTALKABLE LANDTILE ; 09
+ NONTALKABLE LANDTILE ; 0a
+ NONTALKABLE LANDTILE ; 0b
+ NONTALKABLE LANDTILE ; 0c
+ NONTALKABLE LANDTILE ; 0d
+ NONTALKABLE LANDTILE ; 0e
+ NONTALKABLE WALLTILE ; 0f
+ NONTALKABLE LANDTILE ; COLL_TALL_GRASS_10
+ NONTALKABLE LANDTILE ; 11
+ TALKABLE WALLTILE ; COLL_CUT_TREE
+ NONTALKABLE LANDTILE ; 13
+ NONTALKABLE LANDTILE ; COLL_LONG_GRASS
+ TALKABLE WALLTILE ; COLL_HEADBUTT_TREE
+ NONTALKABLE LANDTILE ; 16
+ NONTALKABLE LANDTILE ; 17
+ NONTALKABLE LANDTILE ; COLL_TALL_GRASS
+ NONTALKABLE LANDTILE ; 19
+ TALKABLE WALLTILE ; COLL_CUT_TREE_1A
+ NONTALKABLE LANDTILE ; 1b
+ NONTALKABLE LANDTILE ; COLL_LONG_GRASS_1C
+ TALKABLE WALLTILE ; COLL_HEADBUTT_TREE_1D
+ NONTALKABLE LANDTILE ; 1e
+ NONTALKABLE LANDTILE ; 1f
+ NONTALKABLE WATERTILE ; 20
+ NONTALKABLE WATERTILE ; COLL_WATER_21
+ TALKABLE WATERTILE ; 22
+ NONTALKABLE LANDTILE ; COLL_ICE
+ TALKABLE WATERTILE ; COLL_WHIRLPOOL
+ NONTALKABLE WATERTILE ; 25
+ NONTALKABLE WATERTILE ; 26
+ NONTALKABLE WALLTILE ; COLL_BUOY
+ NONTALKABLE WATERTILE ; COLL_CUT_28
+ NONTALKABLE WATERTILE ; COLL_WATER
+ TALKABLE WATERTILE ; 2a
+ NONTALKABLE LANDTILE ; COLL_ICE_2B
+ TALKABLE WATERTILE ; COLL_WHIRLPOOL_2C
+ NONTALKABLE WATERTILE ; 2d
+ NONTALKABLE WATERTILE ; 2e
+ NONTALKABLE WALLTILE ; 2f
+ NONTALKABLE WATERTILE ; COLL_WATERFALL_RIGHT
+ NONTALKABLE WATERTILE ; COLL_WATERFALL_LEFT
+ NONTALKABLE WATERTILE ; COLL_WATERFALL_UP
+ NONTALKABLE WATERTILE ; COLL_WATERFALL
+ NONTALKABLE WATERTILE ; 34
+ NONTALKABLE WATERTILE ; 35
+ NONTALKABLE WATERTILE ; 36
+ NONTALKABLE WATERTILE ; 37
+ NONTALKABLE WATERTILE ; COLL_CURRENT_RIGHT
+ NONTALKABLE WATERTILE ; COLL_CURRENT_LEFT
+ NONTALKABLE WATERTILE ; COLL_CURRENT_UP
+ NONTALKABLE WATERTILE ; COLL_CURRENT_DOWN
+ NONTALKABLE WATERTILE ; 3c
+ NONTALKABLE WATERTILE ; 3d
+ NONTALKABLE WATERTILE ; 3e
+ NONTALKABLE WATERTILE ; 3f
+ NONTALKABLE LANDTILE ; COLL_BRAKE
+ NONTALKABLE LANDTILE ; COLL_WALK_RIGHT
+ NONTALKABLE LANDTILE ; COLL_WALK_LEFT
+ NONTALKABLE LANDTILE ; COLL_WALK_UP
+ NONTALKABLE LANDTILE ; COLL_WALK_DOWN
+ NONTALKABLE LANDTILE ; COLL_BRAKE_45
+ NONTALKABLE LANDTILE ; COLL_BRAKE_46
+ NONTALKABLE LANDTILE ; COLL_BRAKE_47
+ NONTALKABLE LANDTILE ; COLL_GRASS_48
+ NONTALKABLE LANDTILE ; COLL_GRASS_49
+ NONTALKABLE LANDTILE ; COLL_GRASS_4A
+ NONTALKABLE LANDTILE ; COLL_GRASS_4B
+ NONTALKABLE LANDTILE ; COLL_GRASS_4C
+ NONTALKABLE LANDTILE ; 4d
+ NONTALKABLE LANDTILE ; 4e
+ NONTALKABLE LANDTILE ; 4f
+ NONTALKABLE LANDTILE ; COLL_WALK_RIGHT_ALT
+ NONTALKABLE LANDTILE ; COLL_WALK_LEFT_ALT
+ NONTALKABLE LANDTILE ; COLL_WALK_UP_ALT
+ NONTALKABLE LANDTILE ; COLL_WALK_DOWN_ALT
+ NONTALKABLE LANDTILE ; COLL_BRAKE_ALT
+ NONTALKABLE LANDTILE ; COLL_BRAKE_55
+ NONTALKABLE LANDTILE ; COLL_BRAKE_56
+ NONTALKABLE LANDTILE ; COLL_BRAKE_57
+ NONTALKABLE LANDTILE ; 58
+ NONTALKABLE LANDTILE ; 59
+ NONTALKABLE LANDTILE ; 5a
+ NONTALKABLE LANDTILE ; COLL_5B
+ NONTALKABLE LANDTILE ; 5c
+ NONTALKABLE LANDTILE ; 5d
+ NONTALKABLE LANDTILE ; 5e
+ NONTALKABLE LANDTILE ; 5f
+ NONTALKABLE LANDTILE ; COLL_PIT
+ NONTALKABLE LANDTILE ; COLL_VIRTUAL_BOY
+ NONTALKABLE WALLTILE ; 62
+ NONTALKABLE LANDTILE ; 63
+ NONTALKABLE LANDTILE ; COLL_64
+ NONTALKABLE LANDTILE ; COLL_65
+ NONTALKABLE LANDTILE ; 66
+ NONTALKABLE LANDTILE ; 67
+ NONTALKABLE LANDTILE ; COLL_PIT_68
+ NONTALKABLE LANDTILE ; 69
+ NONTALKABLE WALLTILE ; 6a
+ NONTALKABLE LANDTILE ; 6b
+ NONTALKABLE LANDTILE ; 6c
+ NONTALKABLE LANDTILE ; 6d
+ NONTALKABLE LANDTILE ; 6e
+ NONTALKABLE LANDTILE ; 6f
+ NONTALKABLE LANDTILE ; COLL_WARP_CARPET_DOWN
+ NONTALKABLE LANDTILE ; COLL_DOOR
+ NONTALKABLE LANDTILE ; COLL_LADDER
+ NONTALKABLE LANDTILE ; COLL_STAIRCASE_73
+ NONTALKABLE LANDTILE ; COLL_CAVE_74
+ NONTALKABLE LANDTILE ; COLL_DOOR_75
+ NONTALKABLE LANDTILE ; COLL_WARP_CARPET_LEFT
+ NONTALKABLE LANDTILE ; COLL_WARP_77
+ NONTALKABLE LANDTILE ; COLL_WARP_CARPET_UP
+ NONTALKABLE LANDTILE ; COLL_DOOR_79
+ NONTALKABLE LANDTILE ; COLL_STAIRCASE
+ NONTALKABLE LANDTILE ; COLL_CAVE
+ NONTALKABLE LANDTILE ; COLL_WARP_PANEL
+ NONTALKABLE LANDTILE ; COLL_DOOR_7D
+ NONTALKABLE LANDTILE ; COLL_WARP_CARPET_RIGHT
+ NONTALKABLE LANDTILE ; COLL_WARP_7F
+ NONTALKABLE WALLTILE ; 80
+ NONTALKABLE WALLTILE ; 81
+ NONTALKABLE WALLTILE ; 82
+ NONTALKABLE WALLTILE ; 83
+ NONTALKABLE WALLTILE ; 84
+ NONTALKABLE LANDTILE ; 85
+ NONTALKABLE LANDTILE ; 86
+ NONTALKABLE LANDTILE ; 87
+ NONTALKABLE WALLTILE ; 88
+ NONTALKABLE WALLTILE ; 89
+ NONTALKABLE WALLTILE ; 8a
+ NONTALKABLE WALLTILE ; 8b
+ NONTALKABLE WALLTILE ; 8c
+ NONTALKABLE LANDTILE ; 8d
+ NONTALKABLE LANDTILE ; 8e
+ NONTALKABLE LANDTILE ; 8f
+ NONTALKABLE WALLTILE ; COLL_COUNTER
+ NONTALKABLE WALLTILE ; COLL_BOOKSHELF
+ NONTALKABLE WALLTILE ; 92
+ NONTALKABLE WALLTILE ; COLL_PC
+ NONTALKABLE WALLTILE ; COLL_RADIO
+ NONTALKABLE WALLTILE ; COLL_TOWN_MAP
+ NONTALKABLE WALLTILE ; COLL_MART_SHELF
+ NONTALKABLE WALLTILE ; COLL_TV
+ NONTALKABLE WALLTILE ; COLL_COUNTER_98
+ NONTALKABLE WALLTILE ; 99
+ NONTALKABLE WALLTILE ; 9a
+ NONTALKABLE WALLTILE ; 9b
+ NONTALKABLE WALLTILE ; COLL_9C
+ NONTALKABLE WALLTILE ; COLL_WINDOW
+ NONTALKABLE WALLTILE ; 9e
+ NONTALKABLE WALLTILE ; COLL_INCENSE_BURNER
+ NONTALKABLE LANDTILE ; COLL_HOP_RIGHT
+ NONTALKABLE LANDTILE ; COLL_HOP_LEFT
+ NONTALKABLE LANDTILE ; COLL_HOP_UP
+ NONTALKABLE LANDTILE ; COLL_HOP_DOWN
+ NONTALKABLE LANDTILE ; COLL_HOP_DOWN_RIGHT
+ NONTALKABLE LANDTILE ; COLL_HOP_DOWN_LEFT
+ NONTALKABLE LANDTILE ; COLL_HOP_UP_RIGHT
+ NONTALKABLE LANDTILE ; COLL_HOP_UP_LEFT
+ NONTALKABLE LANDTILE ; a8
+ NONTALKABLE LANDTILE ; a9
+ NONTALKABLE LANDTILE ; aa
+ NONTALKABLE LANDTILE ; ab
+ NONTALKABLE LANDTILE ; ac
+ NONTALKABLE LANDTILE ; ad
+ NONTALKABLE LANDTILE ; ae
+ NONTALKABLE LANDTILE ; af
+ NONTALKABLE LANDTILE ; COLL_RIGHT_WALL
+ NONTALKABLE LANDTILE ; COLL_LEFT_WALL
+ NONTALKABLE LANDTILE ; COLL_UP_WALL
+ NONTALKABLE LANDTILE ; COLL_DOWN_WALL
+ NONTALKABLE LANDTILE ; COLL_DOWN_RIGHT_WALL
+ NONTALKABLE LANDTILE ; COLL_DOWN_LEFT_WALL
+ NONTALKABLE LANDTILE ; COLL_UP_RIGHT_WALL
+ NONTALKABLE LANDTILE ; COLL_UP_LEFT_WALL
+ NONTALKABLE LANDTILE ; b8
+ NONTALKABLE LANDTILE ; b9
+ NONTALKABLE LANDTILE ; ba
+ NONTALKABLE LANDTILE ; bb
+ NONTALKABLE LANDTILE ; bc
+ NONTALKABLE LANDTILE ; bd
+ NONTALKABLE LANDTILE ; be
+ NONTALKABLE LANDTILE ; bf
+ NONTALKABLE WATERTILE ; COLL_RIGHT_BUOY
+ NONTALKABLE WATERTILE ; COLL_LEFT_BUOY
+ NONTALKABLE WATERTILE ; COLL_UP_BUOY
+ NONTALKABLE WATERTILE ; COLL_DOWN_BUOY
+ NONTALKABLE WATERTILE ; COLL_DOWN_RIGHT_BUOY
+ NONTALKABLE WATERTILE ; COLL_DOWN_LEFT_BUOY
+ NONTALKABLE WATERTILE ; COLL_UP_RIGHT_BUOY
+ NONTALKABLE WATERTILE ; COLL_UP_LEFT_BUOY
+ NONTALKABLE WATERTILE ; c8
+ NONTALKABLE WATERTILE ; c9
+ NONTALKABLE WATERTILE ; ca
+ NONTALKABLE WATERTILE ; cb
+ NONTALKABLE WATERTILE ; cc
+ NONTALKABLE WATERTILE ; cd
+ NONTALKABLE WATERTILE ; ce
+ NONTALKABLE WATERTILE ; cf
+ NONTALKABLE LANDTILE ; d0
+ NONTALKABLE LANDTILE ; d1
+ NONTALKABLE LANDTILE ; d2
+ NONTALKABLE LANDTILE ; d3
+ NONTALKABLE LANDTILE ; d4
+ NONTALKABLE LANDTILE ; d5
+ NONTALKABLE LANDTILE ; d6
+ NONTALKABLE LANDTILE ; d7
+ NONTALKABLE LANDTILE ; d8
+ NONTALKABLE LANDTILE ; d9
+ NONTALKABLE LANDTILE ; da
+ NONTALKABLE LANDTILE ; db
+ NONTALKABLE LANDTILE ; dc
+ NONTALKABLE LANDTILE ; dd
+ NONTALKABLE LANDTILE ; de
+ NONTALKABLE LANDTILE ; df
+ NONTALKABLE LANDTILE ; e0
+ NONTALKABLE LANDTILE ; e1
+ NONTALKABLE LANDTILE ; e2
+ NONTALKABLE LANDTILE ; e3
+ NONTALKABLE LANDTILE ; e4
+ NONTALKABLE LANDTILE ; e5
+ NONTALKABLE LANDTILE ; e6
+ NONTALKABLE LANDTILE ; e7
+ NONTALKABLE LANDTILE ; e8
+ NONTALKABLE LANDTILE ; e9
+ NONTALKABLE LANDTILE ; ea
+ NONTALKABLE LANDTILE ; eb
+ NONTALKABLE LANDTILE ; ec
+ NONTALKABLE LANDTILE ; ed
+ NONTALKABLE LANDTILE ; ee
+ NONTALKABLE LANDTILE ; ef
+ NONTALKABLE LANDTILE ; f0
+ NONTALKABLE LANDTILE ; f1
+ NONTALKABLE LANDTILE ; f2
+ NONTALKABLE LANDTILE ; f3
+ NONTALKABLE LANDTILE ; f4
+ NONTALKABLE LANDTILE ; f5
+ NONTALKABLE LANDTILE ; f6
+ NONTALKABLE LANDTILE ; f7
+ NONTALKABLE LANDTILE ; f8
+ NONTALKABLE LANDTILE ; f9
+ NONTALKABLE LANDTILE ; fa
+ NONTALKABLE LANDTILE ; fb
+ NONTALKABLE LANDTILE ; fc
+ NONTALKABLE LANDTILE ; fd
+ NONTALKABLE LANDTILE ; fe
+ NONTALKABLE WALLTILE ; COLL_FF
diff --git a/data/events/collision_stdscripts.asm b/data/events/collision_stdscripts.asm
new file mode 100755
index 00000000..7e208d2f
--- /dev/null
+++ b/data/events/collision_stdscripts.asm
@@ -0,0 +1,13 @@
+; stdscripts associated with tile collisions
+
+TileCollisionStdScripts:
+ ; collision type, stdscript
+ dbw COLL_BOOKSHELF, magazinebookshelf
+ dbw COLL_PC, pcscript
+ dbw COLL_RADIO, radio1
+ dbw COLL_TOWN_MAP, townmap
+ dbw COLL_MART_SHELF, merchandiseshelf
+ dbw COLL_TV, tv
+ dbw COLL_WINDOW, window
+ dbw COLL_INCENSE_BURNER, incenseburner
+ db -1 ; end \ No newline at end of file
diff --git a/data/pokemon/egg_moves.asm b/data/pokemon/egg_moves.asm
index 6145e560..3e353ba4 100644
--- a/data/pokemon/egg_moves.asm
+++ b/data/pokemon/egg_moves.asm
@@ -1,5 +1,5 @@
-INCLUDE "includes.asm"
-
+INCLUDE "contents.asm"
+INCLUDE "constants.asm"
SECTION "Egg Moves", ROMX, BANK[EGG_MOVES]
diff --git a/data/pokemon/evos_attacks.asm b/data/pokemon/evos_attacks.asm
index ab181be8..8fc93897 100644
--- a/data/pokemon/evos_attacks.asm
+++ b/data/pokemon/evos_attacks.asm
@@ -1,12 +1,10 @@
-INCLUDE "includes.asm"
-
+INCLUDE "contents.asm"
+INCLUDE "constants.asm"
SECTION "Evolutions and Attacks", ROMX, BANK[EVOS_ATTACKS]
-
INCLUDE "data/pokemon/evos_attacks_pointers.asm"
-
EvosAttacks::
BulbasaurEvosAttacks:
diff --git a/data/predef_pointers.asm b/data/predef_pointers.asm
new file mode 100755
index 00000000..8e4dac0f
--- /dev/null
+++ b/data/predef_pointers.asm
@@ -0,0 +1,79 @@
+; Predef routines can be used with the "predef" and "predef_jump" macros.
+; This preserves registers bc, de, hl and f.
+
+add_predef: MACRO
+\1Predef::
+ dab \1
+ENDM
+
+PredefPointers::
+ add_predef LearnMove ; $0
+ add_predef DummyPredef1
+ add_predef HealParty ; this is both a special and a predef
+ add_predef SmallFarFlagAction
+ add_predef ComputeHPBarPixels
+ add_predef FillPP
+ add_predef TryAddMonToParty
+ add_predef AddTempmonToParty
+ add_predef SendGetMonIntoFromBox
+ add_predef SendMonIntoBox
+ add_predef GiveEgg
+ add_predef AnimateHPBar
+ add_predef CalcMonStats
+ add_predef CalcMonStatC
+ add_predef CanLearnTMHMMove
+ add_predef GetTMHMMove
+ add_predef LinkTextboxAtHL ; $ 10
+ add_predef PrintMoveDesc
+ add_predef UpdatePlayerHUD
+ add_predef PlaceGraphic
+ add_predef CheckPlayerPartyForFitMon
+ add_predef UpdateEnemyHUD
+ add_predef StartBattle
+ add_predef FillInExpBar
+ add_predef GetBattleMonBackpic ; $18
+ add_predef GetEnemyMonFrontpic
+ add_predef LearnLevelMoves
+ add_predef FillMoves
+ add_predef EvolveAfterBattle
+ add_predef TradeAnimationPlayer2
+ add_predef TradeAnimation
+ add_predef CopyMonToTempMon
+ add_predef ListMoves ; $20
+ add_predef PlaceNonFaintStatus
+ add_predef Unused_PlaceEnemyHPLevel
+ add_predef ListMovePP
+ add_predef GetGender
+ add_predef StatsScreenInit
+ add_predef DrawPlayerHP
+ add_predef DrawEnemyHP
+ add_predef PrintTempMonStats ; $28
+ add_predef GetTypeName
+ add_predef PrintMoveType
+ add_predef PrintType
+ add_predef PrintMonTypes
+ add_predef GetUnownLetter
+ add_predef LoadPoisonBGPals
+ add_predef DummyPredef2F
+ add_predef InitSGBBorder ; $30
+ add_predef LoadSGBLayout
+ add_predef Pokedex_GetArea
+ add_predef Unused_CheckShininess
+ add_predef DoBattleTransition
+ add_predef DummyPredef35
+ add_predef DummyPredef36
+ add_predef PlayBattleAnim
+ add_predef DummyPredef38 ; $38
+ add_predef DummyPredef39
+ add_predef DummyPredef3A
+ add_predef PartyMonItemName
+ add_predef GetMonFrontpic
+ add_predef GetMonBackpic
+ add_predef GetTrainerPic
+ add_predef DecompressGet2bpp
+ add_predef CheckTypeMatchup ; $40
+ add_predef ConvertMon_1to2
+ add_predef NewPokedexEntry
+ add_predef FrontpicPredef
+ add_predef UpdateTimePredef
+ dbw -1, InexplicablyEmptyFunction ; ???
diff --git a/data/text/battle.asm b/data/text/battle.asm
index 0f21e800..a222cac5 100644..100755
--- a/data/text/battle.asm
+++ b/data/text/battle.asm
@@ -3,13 +3,13 @@ BattleText:: ; used only for BANK(BattleText)
BattleText_PlayerPickedUpPayDayMoney:
text "<PLAYER> picked up"
line "¥@"
- deciram wPayDayMoney, 3, 6
+ text_decimal wPayDayMoney, 3, 6
text "!"
prompt
WildPokemonAppearedText:
text "Wild @"
- text_from_ram wEnemyMonNick
+ text_ram wEnemyMonNick
text_start
line "appeared!"
prompt
@@ -17,13 +17,13 @@ WildPokemonAppearedText:
HookedPokemonAttackedText:
text "The hooked"
line "@"
- text_from_ram wEnemyMonNick
+ text_ram wEnemyMonNick
text_start
cont "attacked!"
prompt
PokemonFellFromTreeText:
- text_from_ram wEnemyMonNick
+ text_ram wEnemyMonNick
text " fell"
line "out of the tree!"
prompt
@@ -35,14 +35,14 @@ WantsToBattleText::
BattleText_WildFled:
text "Wild @"
- text_from_ram wEnemyMonNick
+ text_ram wEnemyMonNick
text_start
line "fled!"
prompt
BattleText_EnemyFled:
text "Enemy @"
- text_from_ram wEnemyMonNick
+ text_ram wEnemyMonNick
text_start
line "fled!"
prompt
@@ -80,7 +80,7 @@ SandstormHitsText:
PerishCountText:
text "<USER>'s"
line "PERISH count is @"
- deciram wDeciramBuffer, 1, 1
+ text_decimal wDeciramBuffer, 1, 1
text "!"
prompt
@@ -88,7 +88,7 @@ BattleText_TargetRecoveredWithItem:
text "<TARGET>"
line "recovered with"
cont "@"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text "."
prompt
@@ -96,7 +96,7 @@ BattleText_UserRecoveredPPUsing:
text "<USER>"
line "recovered PP using"
cont "@"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text "."
prompt
@@ -112,13 +112,13 @@ BattleText_SafeguardFaded:
prompt
BattleText_MonsLightScreenFell:
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text " #MON's"
line "LIGHT SCREEN fell!"
prompt
BattleText_MonsReflectFaded:
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text " #MON's"
line "REFLECT faded!"
prompt
@@ -154,14 +154,14 @@ BattleText_TheSandstormSubsided:
BattleText_EnemyMonFainted:
text "Enemy @"
- text_from_ram wEnemyMonNick
+ text_ram wEnemyMonNick
text_start
line "fainted!"
prompt
GotMoneyForWinningText:
text "<PLAYER> got ¥@"
- deciram wBattleReward, 3, 6
+ text_decimal wBattleReward, 3, 6
text_start
line "for winning!"
prompt
@@ -178,7 +178,7 @@ TiedAgainstText:
SentSomeToMomText:
text "<PLAYER> got ¥@"
- deciram wBattleReward, 3, 6
+ text_decimal wBattleReward, 3, 6
text_start
line "for winning!"
cont "Sent some to MOM!"
@@ -199,7 +199,7 @@ BattleText_0x80a4f:
prompt
BattleText_MonFainted:
- text_from_ram wBattleMonNick
+ text_ram wBattleMonNick
text_start
line "fainted!"
prompt
@@ -223,7 +223,7 @@ BattleText_EnemyIsAboutToUseWillPlayerChangeMon:
text "<ENEMY>"
line "is about to use"
cont "@"
- text_from_ram wEnemyMonNick
+ text_ram wEnemyMonNick
text "."
para "Will <PLAYER>"
@@ -234,7 +234,7 @@ BattleText_EnemySentOut:
text "<ENEMY>"
line "sent out"
cont "@"
- text_from_ram wEnemyMonNick
+ text_ram wEnemyMonNick
text "!"
done
@@ -266,7 +266,7 @@ BattleText_UserFledUsingAStringBuffer1:
text "<USER>"
line "fled using a"
cont "@"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text "!"
prompt
@@ -283,14 +283,14 @@ RecoveredUsingText:
text "<TARGET>"
line "recovered using a"
cont "@"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text "!"
prompt
BattleText_UsersStringBuffer1Activated:
text "<USER>'s"
line "@"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text_start
cont "activated!"
prompt
@@ -301,13 +301,13 @@ BattleText_ItemsCantBeUsedHere:
prompt
BattleText_MonIsAlreadyOut:
- text_from_ram wBattleMonNick
+ text_ram wBattleMonNick
text_start
line "is already out."
prompt
BattleText_MonCantBeRecalled:
- text_from_ram wBattleMonNick
+ text_ram wBattleMonNick
text_start
line "can't be recalled!"
prompt
@@ -323,7 +323,7 @@ BattleText_TheMoveIsDisabled:
prompt
BattleText_MonHasNoMovesLeft:
- text_from_ram wBattleMonNick
+ text_ram wBattleMonNick
text_start
line "has no moves left!"
done
@@ -334,24 +334,24 @@ BattleText_TargetsEncoreEnded:
prompt
BattleText_StringBuffer1GrewToLevel:
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text " grew to"
line "level @"
- deciram wCurPartyLevel, 1, 3
+ text_decimal wCurPartyLevel, 1, 3
text "!@"
sound_dex_fanfare_50_79
db "@"
BattleText_WildMonIsEating:
text "Wild @"
- text_from_ram wEnemyMonNick
+ text_ram wEnemyMonNick
text_start
line "is eating!"
prompt
BattleText_WildMonIsAngry:
text "Wild @"
- text_from_ram wEnemyMonNick
+ text_ram wEnemyMonNick
text_start
line "is angry!"
prompt
@@ -409,7 +409,7 @@ BecameConfusedText:
BattleText_ItemHealedConfusion: ; ItemHealedConfusion
text "A @"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text " rid"
line "<TARGET>"
cont "of its confusion."
@@ -424,7 +424,7 @@ BattleText_UsersHurtByStringBuffer1:
text "<USER>'s"
line "hurt by"
cont "@"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text "!"
prompt
@@ -432,7 +432,7 @@ BattleText_UserWasReleasedFromStringBuffer1:
text "<USER>"
line "was released from"
cont "@"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text "!"
prompt
@@ -473,7 +473,7 @@ HungOnText:
text "<TARGET>"
line "hung on with"
cont "@"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text "!"
prompt
@@ -497,43 +497,43 @@ InfatuationText:
DisabledMoveText:
text "<USER>'s"
line "@"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text " is"
cont "DISABLED!"
prompt
LoafingAroundText:
- text_from_ram wBattleMonNick
+ text_ram wBattleMonNick
text " is"
line "loafing around."
prompt
BeganToNapText:
- text_from_ram wBattleMonNick
+ text_ram wBattleMonNick
text " began"
line "to nap!"
prompt
WontObeyText:
- text_from_ram wBattleMonNick
+ text_ram wBattleMonNick
text " won't"
line "obey!"
prompt
TurnedAwayText:
- text_from_ram wBattleMonNick
+ text_ram wBattleMonNick
text " turned"
line "away!"
prompt
IgnoredOrdersText:
- text_from_ram wBattleMonNick
+ text_ram wBattleMonNick
text " ignored"
line "orders!"
prompt
IgnoredSleepingText:
- text_from_ram wBattleMonNick
+ text_ram wBattleMonNick
text " ignored"
line "orders…sleeping!"
prompt
@@ -547,7 +547,7 @@ HasNoPPLeftText:
text "<USER>"
line "has no PP left for"
cont "@"
- text_from_ram wStringBuffer2
+ text_ram wStringBuffer2
text "!"
prompt
@@ -641,7 +641,7 @@ SketchedText:
text "<USER>"
line "SKETCHED"
cont "@"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text "!"
prompt
@@ -654,10 +654,10 @@ DestinyBondEffectText:
SpiteEffectText:
text "<TARGET>'s"
line "@"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text " was"
cont "reduced by @"
- deciram wDeciramBuffer, 1, 1
+ text_decimal wDeciramBuffer, 1, 1
text "!"
prompt
@@ -719,7 +719,7 @@ WasFrozenText:
WontRiseAnymoreText:
text "<USER>'s"
line "@"
- text_from_ram wStringBuffer2
+ text_ram wStringBuffer2
text " won't"
cont "rise anymore!"
prompt
@@ -727,7 +727,7 @@ WontRiseAnymoreText:
WontDropAnymoreText:
text "<TARGET>'s"
line "@"
- text_from_ram wStringBuffer2
+ text_ram wStringBuffer2
text " won't"
cont "drop anymore!"
prompt
@@ -749,13 +749,13 @@ BlownAwayText:
PlayerHitTimesText:
text "Hit @"
- deciram wPlayerDamageTaken, 1, 1
+ text_decimal wPlayerDamageTaken, 1, 1
text " times!"
prompt
EnemyHitTimesText:
text "Hit @"
- deciram wEnemyDamageTaken, 1, 1
+ text_decimal wEnemyDamageTaken, 1, 1
text " times!"
prompt
@@ -770,7 +770,7 @@ ProtectedByMistText:
prompt
GettingPumpedText:
- interpret_data
+ text_pause
text "<USER>'s"
line "getting pumped!"
prompt
@@ -810,7 +810,7 @@ LearnedMoveText:
text "<USER>"
line "learned"
cont "@"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text "!"
prompt
@@ -827,7 +827,7 @@ EvadedText:
WasDisabledText:
text "<TARGET>'s"
line "@"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text " was"
cont "DISABLED!"
prompt
@@ -841,7 +841,7 @@ TransformedTypeText:
text "<USER>"
line "transformed into"
cont "the @"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text "-type!"
prompt
@@ -854,7 +854,7 @@ TransformedText:
text "<USER>"
line "TRANSFORMED into"
cont "@"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text "!"
prompt
@@ -921,7 +921,7 @@ ProtectedByText:
text "<TARGET>'s"
line "protected by"
cont "@"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text "!"
prompt
@@ -933,7 +933,7 @@ MirrorMoveFailedText:
StoleText:
text "<USER>"
line "stole @"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text_start
cont "from its foe!"
prompt
@@ -1017,7 +1017,7 @@ SafeguardProtectText:
MagnitudeText:
text "Magnitude @"
- deciram wDeciramBuffer, 1, 1
+ text_decimal wDeciramBuffer, 1, 1
text "!"
prompt
@@ -1067,7 +1067,7 @@ ForesawAttackText:
prompt
BeatUpAttackText:
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text "'s"
line "attack!"
done
diff --git a/data/text/common_1.asm b/data/text/common_1.asm
index 6012cdbc..40f4bb79 100644..100755
--- a/data/text/common_1.asm
+++ b/data/text/common_1.asm
@@ -6,14 +6,14 @@ _FruitBearingTreeText::
_HeyItsFruitText::
text "Hey! It's"
line "@"
- text_from_ram wStringBuffer3
+ text_ram wStringBuffer3
text "!"
done
_ObtainedFruitText::
text "Obtained"
line "@"
- text_from_ram wStringBuffer3
+ text_ram wStringBuffer3
text "!"
done
@@ -28,67 +28,67 @@ _NothingHereText::
done
UnknownText_0x1bc0a2::
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text_start
line "recovered @"
- deciram wLinkBuffer, 2, 3
+ text_decimal wLinkBuffer, 2, 3
text "HP!"
done
UnknownText_0x1bc0bb::
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text "'s"
line "cured of poison."
done
UnknownText_0x1bc0d2::
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text "'s"
line "rid of paralysis."
done
UnknownText_0x1bc0ea::
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text "'s"
line "burn was healed."
done
UnknownText_0x1bc101::
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text_start
line "was defrosted."
done
UnknownText_0x1bc115::
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text_start
line "woke up."
done
UnknownText_0x1bc123::
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text "'s"
line "health returned."
done
UnknownText_0x1bc13a::
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text_start
line "is revitalized."
done
UnknownText_0x1bc14f::
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text " grew to"
line "level @"
- deciram wCurPartyLevel, 1, 3
+ text_decimal wCurPartyLevel, 1, 3
text "!@"
sound_dex_fanfare_50_79
- text_waitbutton
+ text_promptbutton
db "@"
UnknownText_0x1bc16e::
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text " came"
line "to its senses."
done
@@ -153,17 +153,17 @@ Text_EnemyWithdrew::
text "<ENEMY>"
line "withdrew"
cont "@"
- text_from_ram wEnemyMonNick
+ text_ram wEnemyMonNick
text "!"
prompt
Text_EnemyUsedOn::
text "<ENEMY>"
line "used @"
- text_from_ram wMonOrItemNameBuffer
+ text_ram wMonOrItemNameBuffer
text_start
cont "on @"
- text_from_ram wEnemyMonNick
+ text_ram wEnemyMonNick
text "!"
prompt
@@ -179,7 +179,7 @@ Text_ThatItemCantBePutInThePack::
Text_TheItemWasPutInThePack::
text "The @"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text_start
line "was put in the"
cont "PACK."
@@ -206,7 +206,7 @@ UnknownText_0x1bd05e::
UnknownText_0x1bd07f::
text "Will you play with"
line "@"
- text_from_ram wStringBuffer2
+ text_ram wStringBuffer2
text "?"
done
@@ -223,7 +223,7 @@ Text_BreedingIsNotPossible::
UnknownText_0x1bd0d8::
text "The compatibility"
line "is @"
- deciram wTempNumBuffer, 1, 3
+ text_decimal wTempNumBuffer, 1, 3
text "."
cont "Should they breed?"
done
@@ -241,7 +241,7 @@ UnknownText_0x1bd11c::
UnknownText_0x1bd131::
text "Test event"
line "@"
- deciram wStringBuffer2, 1, 2
+ text_decimal wStringBuffer2, 1, 2
text "?"
done
@@ -298,7 +298,7 @@ UnknownText_0x1bc4b2::
UnknownText_0x1bc4d7::
text "Put away the"
line "@"
- text_from_ram wStringBuffer3
+ text_ram wStringBuffer3
text "."
prompt
@@ -310,19 +310,19 @@ UnknownText_0x1bc4ec::
UnknownText_0x1bc509::
text "Set up the"
line "@"
- text_from_ram wStringBuffer3
+ text_ram wStringBuffer3
text "."
prompt
UnknownText_0x1bc51c::
text "Put away the"
line "@"
- text_from_ram wStringBuffer3
+ text_ram wStringBuffer3
text_start
para "and set up the"
line "@"
- text_from_ram wStringBuffer4
+ text_ram wStringBuffer4
text "."
prompt
@@ -353,7 +353,7 @@ UnknownText_0x1bc5b3::
UnknownText_0x1bc5d7::
text "It's an adorable"
line "@"
- text_from_ram wStringBuffer3
+ text_ram wStringBuffer3
text "."
done
@@ -394,10 +394,10 @@ UnknownText_0x1bc6c7::
done
UnknownText_0x1bc6e9::
- text_from_ram wPlayerTrademonSpeciesName
+ text_ram wPlayerTrademonSpeciesName
text " was"
line "sent to @"
- text_from_ram wOTTrademonSenderName
+ text_ram wOTTrademonSenderName
text "."
done
@@ -406,53 +406,53 @@ UnknownText_0x1bc701::
done
UnknownText_0x1bc703::
- text_from_ram wOTTrademonSenderName
+ text_ram wOTTrademonSenderName
text " bids"
line "farewell to"
done
UnknownText_0x1bc719::
- text_from_ram wOTTrademonSpeciesName
+ text_ram wOTTrademonSpeciesName
text "."
done
UnknownText_0x1bc71f::
text "Take good care of"
line "@"
- text_from_ram wOTTrademonSpeciesName
+ text_ram wOTTrademonSpeciesName
text "."
done
UnknownText_0x1bc739::
text "For @"
- text_from_ram wPlayerTrademonSenderName
+ text_ram wPlayerTrademonSenderName
text "'s"
line "@"
- text_from_ram wPlayerTrademonSpeciesName
+ text_ram wPlayerTrademonSpeciesName
text ","
done
UnknownText_0x1bc74c::
- text_from_ram wOTTrademonSenderName
+ text_ram wOTTrademonSenderName
text " sends"
line "@"
- text_from_ram wOTTrademonSpeciesName
+ text_ram wOTTrademonSpeciesName
text "."
done
UnknownText_0x1bc75e::
- text_from_ram wOTTrademonSenderName
+ text_ram wOTTrademonSenderName
text " will"
line "trade @"
- text_from_ram wOTTrademonSpeciesName
+ text_ram wOTTrademonSpeciesName
db "@@"
UnknownText_0x1bc774::
text "for @"
- text_from_ram wPlayerTrademonSenderName
+ text_ram wPlayerTrademonSenderName
text "'s"
line "@"
- text_from_ram wPlayerTrademonSpeciesName
+ text_ram wPlayerTrademonSpeciesName
text "."
done
@@ -476,7 +476,7 @@ _OPT_IntroText3::
_OPT_OakText1::
text_start
line "OAK: @"
- text_from_ram wMonOrItemNameBuffer
+ text_ram wMonOrItemNameBuffer
db "@@"
_OPT_OakText2::
@@ -487,14 +487,14 @@ _OPT_OakText2::
_OPT_OakText3::
text_start
line "@"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text "."
done
_OPT_MaryText1::
text_start
line "MARY: @"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text "'s"
done
@@ -665,7 +665,7 @@ _OPT_PokemonChannelText::
_PokedexShowText::
text_start
line "@"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
db "@"
; Pokémon Music Channel / Pokémusic
@@ -698,7 +698,7 @@ _FernIntroText2::
_BenFernText1::
text_start
line "Today's @"
- current_day
+ text_today
text ","
done
@@ -762,8 +762,8 @@ _LC_Text7::
_LC_Text8::
text_start
line "Number is @"
- interpret_data
- text_from_ram wStringBuffer1
+ text_pause
+ text_ram wStringBuffer1
text "!"
done
@@ -812,9 +812,9 @@ _PnP_Text3::
_PnP_Text4::
text_start
line "@"
- text_from_ram wStringBuffer2
+ text_ram wStringBuffer2
text " @"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
db "@@"
_PnP_cute::
@@ -900,7 +900,7 @@ _PnP_odd::
_PnP_Text5::
text_start
line "@"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
db "@@"
_RocketRadioText1::
@@ -936,28 +936,28 @@ _RocketRadioText6::
_RocketRadioText7::
text_start
line "GIOVANNI! @"
- interpret_data
+ text_pause
text "Can you"
done
_RocketRadioText8::
text_start
line "hear?@"
- interpret_data
+ text_pause
text " We did it!"
done
_RocketRadioText9::
text_start
line "@"
- interpret_data
+ text_pause
text "Where is our Boss?"
done
_RocketRadioText10::
text_start
line "@"
- interpret_data
+ text_pause
text "Is he listening?"
done
@@ -965,30 +965,30 @@ UnknownText_0x1bd2bc::
text "Which floor?"
done
-UnknownText_0x1bd2ca::
+_BugCatchingContestTimeUpText::
text "ANNOUNCER: BEEEP!"
para "Time's up!"
done
-UnknownText_0x1bd2e7::
+_BugCatchingContestIsOverText::
text "ANNOUNCER: The"
line "Contest is over!"
done
-UnknownText_0x1bd308::
+_RepelWoreOffText::
text "REPEL's effect"
line "wore off."
done
-UnknownText_0x1bd321::
+_PlayerFoundItemText::
text "<PLAYER> found"
line "@"
- text_from_ram wStringBuffer3
+ text_ram wStringBuffer3
text "."
done
-UnknownText_0x1bd331::
+_ButNoSpaceText::
text "But <PLAYER> has"
line "no space left…"
done
@@ -996,10 +996,10 @@ UnknownText_0x1bd331::
UnknownText_0x1bd34b::
text "I just saw some"
line "rare @"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text " in"
cont "@"
- text_from_ram wStringBuffer2
+ text_ram wStringBuffer2
text "."
para "I'll call you if I"
@@ -1013,13 +1013,13 @@ UnknownText_0x1bd39e::
done
ReceivedMysteryGiftText_::
- text_from_ram wPlayerName
+ text_ram wPlayerName
text " received"
line "@"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text "!@"
sound_item
- text_waitbutton
+ text_promptbutton
db "@"
NoCoinsText_::
@@ -1039,27 +1039,27 @@ UnknownText_0x1bd407::
UnknownText_0x1bd429::
text "<PLAYER> traded"
line "@"
- text_from_ram wStringBuffer2
+ text_ram wStringBuffer2
text " for"
cont "@"
- text_from_ram wMonOrItemNameBuffer
+ text_ram wMonOrItemNameBuffer
text ".@@"
UnknownText_0x1bd445::
sound_dex_fanfare_80_109
- interpret_data
+ text_pause
db "@"
UnknownText_0x1bd449::
text "I collect #MON."
line "Do you have"
cont "@"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text "?"
para "Want to trade it"
line "for my @"
- text_from_ram wStringBuffer2
+ text_ram wStringBuffer2
text "?"
done
@@ -1071,7 +1071,7 @@ UnknownText_0x1bd48c::
UnknownText_0x1bd4aa::
text "Huh? That's not"
line "@"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text ". "
cont "What a letdown…"
done
@@ -1079,7 +1079,7 @@ UnknownText_0x1bd4aa::
UnknownText_0x1bd4d2::
text "Yay! I got myself"
line "@"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text "!"
cont "Thanks!"
done
@@ -1087,7 +1087,7 @@ UnknownText_0x1bd4d2::
UnknownText_0x1bd4f4::
text "Hi, how's my old"
line "@"
- text_from_ram wStringBuffer2
+ text_ram wStringBuffer2
text " doing?"
done
@@ -1097,12 +1097,12 @@ UnknownText_0x1bd512::
para "If you have"
line "@"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text ", would"
para "you trade it for"
line "my @"
- text_from_ram wStringBuffer2
+ text_ram wStringBuffer2
text "?"
done
@@ -1117,7 +1117,7 @@ UnknownText_0x1bd565::
UnknownText_0x1bd5a1::
text "You don't have"
line "@"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text "? That's"
cont "too bad, then."
done
@@ -1127,31 +1127,31 @@ UnknownText_0x1bd5cc::
para "I finally got"
line "@"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text "."
done
UnknownText_0x1bd5f4::
text "Hi! The @"
- text_from_ram wMonOrItemNameBuffer
+ text_ram wMonOrItemNameBuffer
text_start
line "you traded me is"
cont "doing great!"
done
UnknownText_0x1bd621::
- text_from_ram wMonOrItemNameBuffer
+ text_ram wMonOrItemNameBuffer
text "'s cute,"
line "but I don't have"
para "it. Do you have"
line "@"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text "?"
para "Want to trade it"
line "for my @"
- text_from_ram wStringBuffer2
+ text_ram wStringBuffer2
text "?"
done
@@ -1163,7 +1163,7 @@ UnknownText_0x1bd673::
UnknownText_0x1bd696::
text "That's not"
line "@"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text "."
para "Please trade with"
@@ -1174,19 +1174,19 @@ UnknownText_0x1bd6cd::
text "Wow! Thank you!"
line "I always wanted"
cont "@"
- text_from_ram wMonOrItemNameBuffer
+ text_ram wMonOrItemNameBuffer
text "!"
done
UnknownText_0x1bd6f5::
text "How is that"
line "@"
- text_from_ram wStringBuffer2
+ text_ram wStringBuffer2
text " I"
cont "traded you doing?"
para "Your @"
- text_from_ram wMonOrItemNameBuffer
+ text_ram wMonOrItemNameBuffer
text "'s"
line "so cute!"
done
@@ -1396,7 +1396,7 @@ _LastHealthyMonText::
_IllRaiseYourMonText::
text "OK. I'll raise"
line "your @"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text "."
prompt
@@ -1409,25 +1409,25 @@ _AreWeGeniusesText::
text "Are we geniuses or"
line "what? Want to see"
cont "your @"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text "?"
done
_YourMonHasGrownText::
text "Your @"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text_start
line "has grown a lot."
para "By level, it's"
line "grown by @"
- deciram wStringBuffer2 + 1, 1, 3
+ text_decimal wStringBuffer2 + 1, 1, 3
text "."
para "If you want your"
line "#MON back, it"
cont "will cost ¥@"
- deciram wStringBuffer2 + 2, 3, 4
+ text_decimal wStringBuffer2 + 2, 3, 4
text "."
done
@@ -1439,14 +1439,14 @@ _PerfectHeresYourMonText::
_GotBackMonText::
text "<PLAYER> got back"
line "@"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text "."
prompt
_BackAlreadyText::
text "Huh? Back already?"
line "Your @"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text_start
para "needs a little"
line "more time with us."
@@ -1563,7 +1563,7 @@ UnknownText_0x1c00a0::
UnknownText_0x1c00cd::
text "Hm… @"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text "…"
line "That's a fairly"
cont "decent name."
@@ -1595,13 +1595,13 @@ UnknownText_0x1c019e::
done
text "Hm… @"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text "?"
line "What a great name!"
cont "It's perfect."
para "Treat @"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text_start
line "with loving care."
done
@@ -1625,57 +1625,57 @@ UnknownText_0x1c0272::
text "All right. This"
line "#MON is now"
cont "named @"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text "."
prompt
Text_Gained::
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text " gained@@"
Text_ABoostedStringBuffer2ExpPoints::
text_start
line "a boosted"
cont "@"
- deciram wStringBuffer2, 2, 4
+ text_decimal wStringBuffer2, 2, 4
text " EXP. Points!"
prompt
Text_StringBuffer2ExpPoints::
text_start
line "@"
- deciram wStringBuffer2, 2, 4
+ text_decimal wStringBuffer2, 2, 4
text " EXP. Points!"
prompt
Text_GoMon::
text "Go! @"
- text_from_ram wBattleMonNick
+ text_ram wBattleMonNick
text "!"
done
Text_DoItMon::
text "Do it! @"
- text_from_ram wBattleMonNick
+ text_ram wBattleMonNick
text "!"
done
Text_GoForItMon::
text "Go for it,"
line "@"
- text_from_ram wBattleMonNick
+ text_ram wBattleMonNick
text "!"
done
Text_YourFoesWeakGetmMon::
text "Your foe's weak!"
line "Get'm, @"
- text_from_ram wBattleMonNick
+ text_ram wBattleMonNick
text "!"
done
Text_ThatsEnoughComeBack::
- text_from_ram wBattleMonNick
+ text_ram wBattleMonNick
text ",@@"
text " that's"
line "enough! Come back!"
@@ -1699,7 +1699,7 @@ Text_ComeBack::
BattleText_PlayerPickedUpPayDayMoney:
text "<PLAYER> picked up"
line "¥@"
- deciram wPayDayMoney, 3, 6
+ text_decimal wPayDayMoney, 3, 6
text "!"
prompt
@@ -1714,26 +1714,26 @@ UnknownText_0x1c0384::
UnknownText_0x1c0396::
text "It contained"
line "@"
- text_from_ram wStringBuffer2
+ text_ram wStringBuffer2
text "."
para "Teach @"
- text_from_ram wStringBuffer2
+ text_ram wStringBuffer2
text_start
line "to a #MON?"
done
UnknownText_0x1c03c2::
- text_from_ram wStringBuffer2
+ text_ram wStringBuffer2
text " is"
line "not compatible"
cont "with @"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text "."
para "It can't learn"
line "@"
- text_from_ram wStringBuffer2
+ text_ram wStringBuffer2
text "."
prompt
@@ -1741,14 +1741,14 @@ UnknownText_0x1c03fa::
text "You have no room"
line "for any more"
cont "@"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text "S."
prompt
UnknownText_0x1c0421::
text "You received"
line "@"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text "!"
prompt
@@ -1783,21 +1783,21 @@ UnknownText_0x1c04c6::
prompt
UnknownText_0x1c04e9::
- text_from_ram wMysteryGiftPartnerName
+ text_ram wMysteryGiftPartnerName
text " sent"
line "@"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text "."
prompt
UnknownText_0x1c04fa::
- text_from_ram wMysteryGiftPartnerName
+ text_ram wMysteryGiftPartnerName
text " sent"
line "@"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text_start
cont "to @"
- text_from_ram wMysteryGiftPlayerName
+ text_ram wMysteryGiftPlayerName
text "'s home."
prompt
@@ -1812,7 +1812,7 @@ CantUseFieldMoveHereText_::
prompt
Text_UsedCut_::
- text_from_ram wStringBuffer2
+ text_ram wStringBuffer2
text " used"
line "CUT!"
prompt
@@ -1825,11 +1825,11 @@ Text_NothingToCut_::
Text_UsedFlash_::
text "A blinding FLASH"
line "lights the area!@"
- text_waitbutton
+ text_promptbutton
db "@@"
UsedSurfText_::
- text_from_ram wStringBuffer2
+ text_ram wStringBuffer2
text " used"
line "SURF!"
- done
+ done \ No newline at end of file
diff --git a/data/text/common_2.asm b/data/text/common_2.asm
index 4bffc8ed..c8b243be 100644
--- a/data/text/common_2.asm
+++ b/data/text/common_2.asm
@@ -14,7 +14,7 @@ AskSurfText_::
done
Text_UsedWaterfall_::
- text_from_ram wStringBuffer2
+ text_ram wStringBuffer2
text " used"
line "WATERFALL!"
done
@@ -30,7 +30,7 @@ Text_AskUseWaterfall_::
done
Text_UsedDig_::
- text_from_ram wStringBuffer2
+ text_ram wStringBuffer2
text " used"
line "DIG!"
done
@@ -63,13 +63,13 @@ Text_AlreadyUsingStrength_::
prompt
Text_UsedStrength_::
- text_from_ram wStringBuffer2
+ text_ram wStringBuffer2
text " used"
line "STRENGTH!"
done
Text_AllowedToMoveBoulders_::
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text " can"
line "move boulders."
prompt
@@ -93,7 +93,7 @@ Text_MonMayBeAbleToMove_::
done
Text_UsedWhirlpool_::
- text_from_ram wStringBuffer2
+ text_ram wStringBuffer2
text " used"
line "WHIRLPOOL!"
prompt
@@ -115,7 +115,7 @@ Text_AskWhirlpool_::
done
Text_DidAHeadbutt_::
- text_from_ram wStringBuffer2
+ text_ram wStringBuffer2
text " did a"
line "HEADBUTT!"
prompt
@@ -133,7 +133,7 @@ Text_AskHeadbutt_::
done
Text_UsedRockSmash_::
- text_from_ram wStringBuffer2
+ text_ram wStringBuffer2
text " used"
line "ROCK SMASH!"
prompt
@@ -173,14 +173,14 @@ Text_CantGetOffBike_::
Text_GotOnTheBike_::
text "<PLAYER> got on the"
line "@"
- text_from_ram wStringBuffer2
+ text_ram wStringBuffer2
text "."
done
Text_GotOffTheBike_::
text "<PLAYER> got off"
line "the @"
- text_from_ram wStringBuffer2
+ text_ram wStringBuffer2
text "."
done
@@ -196,14 +196,14 @@ Text_MonCanCutThis_::
line "CUT!"
done
-UnknownText_0x1c0a1c::
+_FoundItemText::
text "<PLAYER> found"
line "@"
- text_from_ram wStringBuffer3
+ text_ram wStringBuffer3
text "!"
done
-UnknownText_0x1c0a2c::
+_CantCarryItemText::
text "But <PLAYER> can't"
line "carry any more"
cont "items!"
@@ -229,7 +229,7 @@ UnknownText_0x1c0aa9::
prompt
UnknownText_0x1c0acc::
- text_from_ram wStringBuffer3
+ text_ram wStringBuffer3
text_start
line "fainted!"
prompt
@@ -243,7 +243,7 @@ UnknownText_0x1c0ada::
prompt
UnknownText_0x1c0b03::
- text_from_ram wStringBuffer3
+ text_ram wStringBuffer3
text " used"
line "SWEET SCENT!"
done
@@ -282,17 +282,17 @@ Text_ThrowAwayHowMany_::
Text_ConfirmThrowAway_::
text "Throw away @"
- deciram wItemQuantityChangeBuffer, 1, 2
+ text_decimal wItemQuantityChangeBuffer, 1, 2
text_start
line "@"
- text_from_ram wStringBuffer2
+ text_ram wStringBuffer2
text "(S)?"
done
Text_ThrewAway_::
text "Threw away"
line "@"
- text_from_ram wStringBuffer2
+ text_ram wStringBuffer2
text "(S)."
prompt
@@ -310,7 +310,7 @@ Text_YouDontHaveAMon::
Text_RegisteredTheItem_::
text "Registered the"
line "@"
- text_from_ram wStringBuffer2
+ text_ram wStringBuffer2
text "."
prompt
@@ -349,7 +349,7 @@ _UsedInsteadText::
cont "@@"
_MoveNameText::
- text_from_ram wStringBuffer2
+ text_ram wStringBuffer2
db "@@"
_EndUsedMove1Text::
@@ -375,11 +375,11 @@ _EndUsedMove5Text::
UnknownText_0x1c0cc6::
text "<USER>'s"
line "@"
- text_from_ram wStringBuffer2
+ text_ram wStringBuffer2
db "@@"
UnknownText_0x1c0cd0::
- interpret_data
+ text_pause
text "<SCROLL>went way up!"
prompt
@@ -390,11 +390,11 @@ UnknownText_0x1c0ce0::
UnknownText_0x1c0ceb::
text "<TARGET>'s"
line "@"
- text_from_ram wStringBuffer2
+ text_ram wStringBuffer2
db "@@"
UnknownText_0x1c0cf5::
- interpret_data
+ text_pause
text "<SCROLL>sharply fell!"
prompt
@@ -445,23 +445,23 @@ UnknownText_0x1c0db8::
done
UnknownText_0x1c0dba::
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text " came"
line "out of its EGG!@"
sound_caught_mon
- text_waitbutton
+ text_promptbutton
db "@"
UnknownText_0x1c0dd8::
text "Give a nickname to"
line "@"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text "?"
done
UnknownText_0x1c0df3::
text "It's @"
- text_from_ram wBreedMon2Nick
+ text_ram wBreedMon2Nick
text_start
line "that was left with"
cont "the DAY-CARE LADY."
@@ -469,7 +469,7 @@ UnknownText_0x1c0df3::
UnknownText_0x1c0e24::
text "It's @"
- text_from_ram wDayCareMan + 1
+ text_ram wDayCareMan + 1
text_start
line "that was left with"
cont "the DAY-CARE MAN."
@@ -483,28 +483,28 @@ UnknownText_0x1c0e54::
UnknownText_0x1c0e6f::
text "It has no interest"
line "in @"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text "."
prompt
UnknownText_0x1c0e8d::
text "It appears to care"
line "for @"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text "."
prompt
UnknownText_0x1c0eac::
text "It's friendly with"
line "@"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text "."
prompt
UnknownText_0x1c0ec6::
text "It shows interest"
line "in @"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text "."
prompt
@@ -543,7 +543,7 @@ MailMovedFromBoxText::
prompt
Text_WasSentToBillsPC::
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text " was"
line "sent to BILL's PC."
prompt
@@ -582,7 +582,7 @@ Text_CantTakeAnyMorePokemon_::
Text_CaughtBugMon_::
text "Caught @"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text "!"
prompt
@@ -593,22 +593,22 @@ UnknownText_0x1c10cf::
UnknownText_0x1c10dd::
text "You already caught"
line "a @"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text "."
prompt
ContestJudging_FirstPlaceText::
text "This Bug-Catching"
line "Contest winner is@"
- interpret_data
+ text_pause
text "…"
para "@"
- text_from_ram wBugContestWinnerName
+ text_ram wBugContestWinnerName
text ","
line "who caught a"
cont "@"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text "!@@"
ContestJudging_FirstPlaceScoreText::
@@ -616,19 +616,19 @@ ContestJudging_FirstPlaceScoreText::
para "The winning score"
line "was @"
- deciram wBugContestFirstPlaceScore, 2, 3
+ text_decimal wBugContestFirstPlaceScore, 2, 3
text " points!"
prompt
ContestJudging_SecondPlaceText::
text "Placing second was"
line "@"
- text_from_ram wBugContestWinnerName
+ text_ram wBugContestWinnerName
text ","
para "who caught a"
line "@"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text "!@@"
ContestJudging_SecondPlaceScoreText::
@@ -636,19 +636,19 @@ ContestJudging_SecondPlaceScoreText::
para "The score was"
line "@"
- deciram wBugContestSecondPlaceScore, 2, 3
+ text_decimal wBugContestSecondPlaceScore, 2, 3
text " points!"
prompt
ContestJudging_ThirdPlaceText::
text "Placing third was"
line "@"
- text_from_ram wBugContestWinnerName
+ text_ram wBugContestWinnerName
text ","
para "who caught a"
line "@"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text "!@@"
ContestJudging_ThirdPlaceScoreText::
@@ -656,7 +656,7 @@ ContestJudging_ThirdPlaceScoreText::
para "The score was"
line "@"
- deciram wBugContestThirdPlaceScore, 2, 3
+ text_decimal wBugContestThirdPlaceScore, 2, 3
text " points!"
prompt
@@ -666,7 +666,7 @@ UnknownText_0x1c1203::
para "…Hm, it measures"
line "@"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text "."
prompt
@@ -674,11 +674,11 @@ UnknownText_0x1c123a::
text "CURRENT RECORD"
para "@"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text " caught by"
line "@"
- text_from_ram wMagikarpRecordHoldersName
- text_waitbutton
+ text_ram wMagikarpRecordHoldersName
+ text_promptbutton
db "@"
UnknownText_0x1c1261::
@@ -688,7 +688,7 @@ UnknownText_0x1c1261::
line "with the ID number"
para "of @"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text " in"
line "your party."
prompt
@@ -700,7 +700,7 @@ UnknownText_0x1c12ae::
line "with the ID number"
para "of @"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text " in"
line "your PC BOX."
prompt
@@ -708,7 +708,7 @@ UnknownText_0x1c12ae::
UnknownText_0x1c12fc::
text "Give a nickname to"
line "the @"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text " you"
cont "received?"
done
@@ -736,10 +736,10 @@ _PlayersPCHowManyWithdrawText::
_PlayersPCWithdrewItemsText::
text "Withdrew @"
- deciram wItemQuantityChangeBuffer, 1, 2
+ text_decimal wItemQuantityChangeBuffer, 1, 2
text_start
line "@"
- text_from_ram wStringBuffer2
+ text_ram wStringBuffer2
text "(S)."
prompt
@@ -759,10 +759,10 @@ _PlayersPCHowManyDepositText::
_PlayersPCDepositItemsText::
text "Deposited @"
- deciram wItemQuantityChangeBuffer, 1, 2
+ text_decimal wItemQuantityChangeBuffer, 1, 2
text_start
line "@"
- text_from_ram wStringBuffer2
+ text_ram wStringBuffer2
text "(S)."
prompt
@@ -819,10 +819,10 @@ _OakPCText2::
prompt
_OakPCText3::
- text_from_ram wStringBuffer3
+ text_ram wStringBuffer3
text " #MON seen"
line "@"
- text_from_ram wStringBuffer4
+ text_ram wStringBuffer4
text " #MON owned"
para "PROF.OAK's"
@@ -989,23 +989,23 @@ UnknownText_0x1c1a6c::
UnknownText_0x1c1a90::
text "Toss out how many"
line "@"
- text_from_ram wStringBuffer2
+ text_ram wStringBuffer2
text "(S)?"
done
UnknownText_0x1c1aad::
text "Throw away @"
- deciram wItemQuantityChangeBuffer, 1, 2
+ text_decimal wItemQuantityChangeBuffer, 1, 2
text_start
line "@"
- text_from_ram wStringBuffer2
+ text_ram wStringBuffer2
text "(S)?"
done
UnknownText_0x1c1aca::
text "Discarded"
line "@"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text "(S)."
prompt
@@ -1022,24 +1022,24 @@ UnknownText_0x1c1b03::
UnknownText_0x1c1b2c::
text "Took @"
- text_from_ram wMonOrItemNameBuffer
+ text_ram wMonOrItemNameBuffer
text "'s"
line "@"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text " and"
para "made it hold"
line "@"
- text_from_ram wStringBuffer2
+ text_ram wStringBuffer2
text "."
prompt
UnknownText_0x1c1b57::
text "Made @"
- text_from_ram wMonOrItemNameBuffer
+ text_ram wMonOrItemNameBuffer
text_start
line "hold @"
- text_from_ram wStringBuffer2
+ text_ram wStringBuffer2
text "."
prompt
@@ -1049,7 +1049,7 @@ UnknownText_0x1c1b6f::
prompt
UnknownText_0x1c1b8e::
- text_from_ram wMonOrItemNameBuffer
+ text_ram wMonOrItemNameBuffer
text " isn't"
line "holding anything."
prompt
@@ -1061,20 +1061,20 @@ UnknownText_0x1c1baa::
UnknownText_0x1c1bc4::
text "Took @"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text_start
line "from @"
- text_from_ram wMonOrItemNameBuffer
+ text_ram wMonOrItemNameBuffer
text "."
prompt
UnknownText_0x1c1bdc::
- text_from_ram wMonOrItemNameBuffer
+ text_ram wMonOrItemNameBuffer
text " is"
line "already holding"
para "@"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text "."
line "Switch items?"
done
@@ -1092,7 +1092,7 @@ UnknownText_0x1c1c22::
UnknownText_0x1c1c47::
text "MAIL detached from"
line "@"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text "."
prompt
@@ -1152,7 +1152,7 @@ _OakText2::
cont "#MON.@@"
_OakText3::
- text_waitbutton
+ text_promptbutton
db "@"
_OakText4::
@@ -1247,17 +1247,17 @@ UnknownText_0x1c41b1::
UnknownText_0x1c41e6::
text "Your friend's"
line "@"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text " appears"
cont "to be abnormal!"
prompt
UnknownText_0x1c4212::
text "Trade @"
- text_from_ram wTemporaryBuffer
+ text_ram wTemporaryBuffer
text_start
line "for @"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text "?"
done
@@ -1334,23 +1334,23 @@ CoordinatesEventText_::
UnknownText_0x1c4719::
text "<PLAYER> received"
line "@"
- text_from_ram wStringBuffer4
+ text_ram wStringBuffer4
text "."
done
UnknownText_0x1c472c::
text "<PLAYER> put the"
line "@"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text " in"
cont "the @"
- text_from_ram wStringBuffer3
+ text_ram wStringBuffer3
text "."
prompt
UnknownText_0x1c474b::
text "The @"
- text_from_ram wStringBuffer3
+ text_ram wStringBuffer3
text_start
line "is full…"
prompt
@@ -1358,7 +1358,7 @@ UnknownText_0x1c474b::
UnknownText_0x1c4b92::
text "Congratulations!"
line "Your @"
- text_from_ram wStringBuffer2
+ text_ram wStringBuffer2
db "@@"
UnknownText_0x1c4baf::
@@ -1366,20 +1366,20 @@ UnknownText_0x1c4baf::
para "evolved into"
line "@"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text "!"
done
UnknownText_0x1c4bc5::
text "Huh? @"
- text_from_ram wStringBuffer2
+ text_ram wStringBuffer2
text_start
line "stopped evolving!"
prompt
UnknownText_0x1c4be3::
text "What? @"
- text_from_ram wStringBuffer2
+ text_ram wStringBuffer2
text_start
line "is evolving!"
done
@@ -1389,12 +1389,12 @@ UnknownText_0x1c4bfd::
done
UnknownText_0x1c4c08::
- deciram wItemQuantityChangeBuffer, 1, 2
+ text_decimal wItemQuantityChangeBuffer, 1, 2
text " @"
- text_from_ram wStringBuffer2
+ text_ram wStringBuffer2
text "(S)"
line "will be ¥@"
- deciram hMoneyTemp, 3, 6
+ text_decimal hMoneyTemp, 3, 6
text "."
done
@@ -1418,12 +1418,12 @@ UnknownText_0x1c4ca3::
done
UnknownText_0x1c4cae::
- deciram wItemQuantityChangeBuffer, 1, 2
+ text_decimal wItemQuantityChangeBuffer, 1, 2
text " @"
- text_from_ram wStringBuffer2
+ text_ram wStringBuffer2
text "(S)"
line "will be ¥@"
- deciram hMoneyTemp, 3, 6
+ text_decimal hMoneyTemp, 3, 6
text "."
done
@@ -1459,10 +1459,10 @@ UnknownText_0x1c4d47::
done
UnknownText_0x1c4db0::
- text_from_ram wStringBuffer2
+ text_ram wStringBuffer2
text " costs"
line "¥@"
- deciram hMoneyTemp, 3, 6
+ text_decimal hMoneyTemp, 3, 6
text ". Want it?"
done
@@ -1501,12 +1501,12 @@ UnknownText_0x1c4e7e::
done
UnknownText_0x1c4e89::
- deciram wItemQuantityChangeBuffer, 1, 2
+ text_decimal wItemQuantityChangeBuffer, 1, 2
text " @"
- text_from_ram wStringBuffer2
+ text_ram wStringBuffer2
text "(S)"
line "will cost ¥@"
- deciram hMoneyTemp, 3, 6
+ text_decimal hMoneyTemp, 3, 6
text "."
done
@@ -1541,7 +1541,7 @@ UnknownText_0x1c4f33::
UnknownText_0x1c4f3e::
text "I can pay you"
line "¥@"
- deciram hMoneyTemp, 3, 6
+ text_decimal hMoneyTemp, 3, 6
text "."
para "Is that OK?"
@@ -1583,14 +1583,14 @@ UnknownText_0x1c500d::
UnknownText_0x1c502e::
text "Got ¥@"
- deciram hMoneyTemp, 3, 6
+ text_decimal hMoneyTemp, 3, 6
text " for"
line "@"
- text_from_ram wStringBuffer2
+ text_ram wStringBuffer2
text "(S)."
done
UnknownText_0x1c5049::
text "Bet how many"
line "coins?"
- done
+ done \ No newline at end of file
diff --git a/data/text/common_3.asm b/data/text/common_3.asm
index 7f21819a..503d5a76 100644
--- a/data/text/common_3.asm
+++ b/data/text/common_3.asm
@@ -19,7 +19,7 @@ UnknownText_0x1c5092::
UnknownText_0x1c509f::
text "lined up!"
line "Won @"
- text_from_ram wStringBuffer2
+ text_ram wStringBuffer2
text " coins!"
done
@@ -28,7 +28,7 @@ UnknownText_0x1c50bb::
done
UnknownText_0x1c5821::
- current_day
+ text_today
db "@"
UnknownText_0x1c5824::
@@ -111,13 +111,13 @@ UnknownText_0x1c564a::
done
Text_LearnedMove_::
- text_from_ram wMonOrItemNameBuffer
+ text_ram wMonOrItemNameBuffer
text " learned"
line "@"
- text_from_ram wStringBuffer2
+ text_ram wStringBuffer2
text "!@"
sound_dex_fanfare_50_79
- text_waitbutton
+ text_promptbutton
db "@"
Text_ForgetWhich_::
@@ -128,29 +128,29 @@ Text_ForgetWhich_::
Text_StopLearning_::
text "Stop learning"
line "@"
- text_from_ram wStringBuffer2
+ text_ram wStringBuffer2
text "?"
done
Text_DidNotLearn_::
- text_from_ram wMonOrItemNameBuffer
+ text_ram wMonOrItemNameBuffer
text_start
line "did not learn"
cont "@"
- text_from_ram wStringBuffer2
+ text_ram wStringBuffer2
text "."
prompt
Text_TryingToLearn_::
- text_from_ram wMonOrItemNameBuffer
+ text_ram wMonOrItemNameBuffer
text " is"
line "trying to learn"
cont "@"
- text_from_ram wStringBuffer2
+ text_ram wStringBuffer2
text "."
para "But @"
- text_from_ram wMonOrItemNameBuffer
+ text_ram wMonOrItemNameBuffer
text_start
line "can't learn more"
cont "than four moves."
@@ -158,25 +158,25 @@ Text_TryingToLearn_::
para "Delete an older"
line "move to make room"
cont "for @"
- text_from_ram wStringBuffer2
+ text_ram wStringBuffer2
text "?"
done
Text_1_2_and_Poof_::
text "1, 2 and…@"
- interpret_data
+ text_pause
db "@@"
Text_PoofForgot_::
text " Poof!@"
- interpret_data
+ text_pause
text_start
para "@"
- text_from_ram wMonOrItemNameBuffer
+ text_ram wMonOrItemNameBuffer
text " forgot"
line "@"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text "."
para "And…"
@@ -257,43 +257,43 @@ Text_ShootItWasSoCloseToo_::
Text_GotchaMonWasCaught_::
text "Gotcha! @"
- text_from_ram wEnemyMonNick
+ text_ram wEnemyMonNick
text_start
line "was caught!@"
sound_caught_mon
db "@@"
-Text_Waitbutton_2::
- text_waitbutton
+Text_Promptbutton_2::
+ text_promptbutton
db "@"
Text_SentToBillsPC_::
- text_from_ram wMonOrItemNameBuffer
+ text_ram wMonOrItemNameBuffer
text " was"
line "sent to BILL's PC."
prompt
Text_MonNewlyAddedToPokedex_::
- text_from_ram wEnemyMonNick
+ text_ram wEnemyMonNick
text "'s data"
line "was newly added to"
cont "the #DEX.@"
sound_slot_machine_start
- text_waitbutton
+ text_promptbutton
db "@"
Text_AskNicknameNewlyCaughtMon_::
text "Give a nickname to"
line "@"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text "?"
done
Text_StatRoseFromVitamin_::
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text "'s"
line "@"
- text_from_ram wStringBuffer2
+ text_ram wStringBuffer2
text " rose."
prompt
@@ -324,13 +324,13 @@ Text_AllSleepingMonWokeUp_::
Text_PlayedThePokeFlute_::
text "<PLAYER> played the"
line "# FLUTE.@"
- text_waitbutton
+ text_promptbutton
db "@@"
Text_CoinCase_::
text "Coins:"
line "@"
- deciram wCoins, 2, 4
+ text_decimal wCoins, 2, 4
done
Text_RaiseThePPOfWhichMove_::
@@ -344,13 +344,13 @@ Text_RestoreThePPOfWhichMove_::
done
Text_PPIsMaxedOut_::
- text_from_ram wStringBuffer2
+ text_ram wStringBuffer2
text "'s PP"
line "is maxed out."
prompt
Text_PPsIncreased_::
- text_from_ram wStringBuffer2
+ text_ram wStringBuffer2
text "'s PP"
line "increased."
prompt
@@ -366,7 +366,7 @@ Text_TrophyInside_::
text_start
para "@"
- text_from_ram wPlayerName
+ text_ram wPlayerName
text " sent the"
line "trophy home."
prompt
@@ -413,7 +413,7 @@ Text_CyclingIsntAllowed_::
Text_CantGetOnYourItemNow_::
text "Can't get on your"
line "@"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text " now."
prompt
@@ -426,14 +426,14 @@ Text_CantUseBallBoxIsFull_::
Text_UsedItem_::
text "<PLAYER> used the"
line "@"
- text_from_ram wStringBuffer2
+ text_ram wStringBuffer2
text "."
done
Text_GotOnItem_::
text "<PLAYER> got on the@"
text_low
- text_from_ram wStringBuffer2
+ text_ram wStringBuffer2
text "."
prompt
@@ -441,15 +441,15 @@ Text_GotOffItem_::
text "<PLAYER> got off@"
text_low
text "the @"
- text_from_ram wStringBuffer2
+ text_ram wStringBuffer2
text "."
prompt
Text_KnowsMove_::
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text " knows"
line "@"
- text_from_ram wStringBuffer2
+ text_ram wStringBuffer2
text "."
prompt
@@ -461,7 +461,7 @@ UnknownText_0x1c5eba::
UnknownText_0x1c5eda::
text "Oh, make it forget"
line "@"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text "?"
done
diff --git a/engine/billspctop.asm b/engine/billspctop.asm
index c3fe6322..65403656 100644
--- a/engine/billspctop.asm
+++ b/engine/billspctop.asm
@@ -15,7 +15,7 @@ BillsPC_CheckHavePokemon: ; e3e5 (3:63e5)
ret
Text_GottaHavePokemon:
- text_jump Text_GottaHavePokemon_
+ text_far Text_GottaHavePokemon_
db "@"
BillsPC_LogIn: ; e3f7 (3:63f7)
@@ -35,7 +35,7 @@ BillsPC_LogIn: ; e3f7 (3:63f7)
ret
Text_BillsPCWhat:
- text_jump Text_BillsPCWhat_
+ text_far Text_BillsPCWhat_
db "@"
BillsPC_LogOut: ; e41a (3:641a)
@@ -105,16 +105,16 @@ BillsPC_SeeYa:
BillsPC_MovePKMNMenu:
call LoadStandardMenuDataHeader
- callba IsAnyPokemonHoldingMail ; 11:488c
+ farcall IsAnyPokemonHoldingMail ; 11:488c
jr nc, .asm_e4bb
ld hl, Text_PleaseRemoveMailBeforeMovePkmnWOMail
call PrintText
jr .asm_e4cf
.asm_e4bb
- callba StartMovePkmnWOMail_SaveGame ; 5:4bd2
+ farcall StartMovePkmnWOMail_SaveGame ; 5:4bd2
jr c, .asm_e4cf
- callba MovePKMNWithoutMail_ ; 38:6f47
+ farcall MovePKMNWithoutMail_ ; 38:6f47
call ReturnToMapFromSubmenu
call Functione566
.asm_e4cf
@@ -123,12 +123,12 @@ BillsPC_MovePKMNMenu:
ret
Text_PleaseRemoveMailBeforeMovePkmnWOMail:
- text_jump Text_PleaseRemoveMailBeforeMovePkmnWOMail_
+ text_far Text_PleaseRemoveMailBeforeMovePkmnWOMail_
db "@"
BillsPC_DepositMenu:
call LoadStandardMenuDataHeader
- callba DepositPokemon_ ; 38:6b9e
+ farcall DepositPokemon_ ; 38:6b9e
call ReturnToMapFromSubmenu
call Functione566
call CloseWindow
@@ -157,11 +157,11 @@ Functione4ed:
ret
Text_YouDontHaveASinglePokemon:
- text_jump Text_YouDontHaveASinglePokemon_
+ text_far Text_YouDontHaveASinglePokemon_
db "@"
Text_ItsYourLastPokemon:
- text_jump Text_ItsYourLastPokemon_
+ text_far Text_ItsYourLastPokemon_
db "@"
CheckCurPartyMonFainted: ; e513 (3:6513)
@@ -194,7 +194,7 @@ CheckCurPartyMonFainted: ; e513 (3:6513)
BillsPC_WithdrawMenu:
call LoadStandardMenuDataHeader
- callba WithdrawPokemon_ ; 38:6d71
+ farcall WithdrawPokemon_ ; 38:6d71
call ReturnToMapFromSubmenu
call Functione566
call CloseWindow
@@ -215,11 +215,11 @@ Functione548:
ret
Text_CantTakeAnyMorePokemon:
- text_jump Text_CantTakeAnyMorePokemon_
+ text_far Text_CantTakeAnyMorePokemon_
db "@"
BillsPC_ChangeBoxMenu:
- callba ChangeBox_ ; 38:7d25
+ farcall ChangeBox_ ; 38:7d25
and a
ret
@@ -235,10 +235,10 @@ Functione566: ; e566 (3:6566)
call ByteFill
hlcoord 0, 0
lb bc, 10, 18
- call TextBox
+ call Textbox
hlcoord 0, 12
ld bc, IncGradGBPalTable_13
- call TextBox
+ call Textbox
call Function3456
call SetPalettes
ret
diff --git a/engine/color.asm b/engine/color.asm
index 057c48a4..25f7179b 100755
--- a/engine/color.asm
+++ b/engine/color.asm
@@ -31,7 +31,7 @@ CheckShininess:
and a
ret
-CheckContestMon: ; 9072 (2:5072)
+Unused_CheckShininess: ; 9072 (2:5072)
ld a, [hl]
cp $a0
jr c, .asm_908c
@@ -634,7 +634,7 @@ Function9b9c: ; 9b9c (2:5b9c)
Function9ba9: ; 9ba9 (2:5ba9)
push de
- callba Function3d8f5
+ farcall Function3d8f5
ld c, l
ld b, h
ld a, [wd0ee]
@@ -644,7 +644,7 @@ Function9ba9: ; 9ba9 (2:5ba9)
Function9bba: ; 9bba (2:5bba)
push de
- callba Function3d907
+ farcall Function3d907
ld c, l
ld b, h
ld a, [wTempEnemyMonSpecies]
diff --git a/engine/events/bug_contest/contest.asm b/engine/events/bug_contest/contest.asm
new file mode 100755
index 00000000..88c300e9
--- /dev/null
+++ b/engine/events/bug_contest/contest.asm
@@ -0,0 +1,41 @@
+GiveParkBalls:
+ xor a
+ ld [wContestMon], a
+ ld a, 20
+ ld [wParkBalls], a
+ farcall StartBugContestTimer
+ ret
+
+BugCatchingContestBattleScript::
+ writecode VAR_BATTLETYPE, BATTLETYPE_CONTEST
+ randomwildmon
+ startbattle
+ reloadmapafterbattle
+ copybytetovar wParkBalls
+ iffalse BugCatchingContestOutOfBallsScript
+ end
+
+BugCatchingContestOverScript::
+ playsound SFX_ELEVATOR_END
+ opentext
+ writetext BugCatchingContestTimeUpText
+ waitbutton
+ jump $79CD
+
+BugCatchingContestOutOfBallsScript:
+ playsound SFX_ELEVATOR_END
+ opentext
+ writetext BugCatchingContestIsOverText
+ waitbutton
+
+BugCatchingContestReturnToGateScript:
+ closetext
+ jumpstd bugcontestresultswarp
+
+BugCatchingContestTimeUpText:
+ text_far _BugCatchingContestTimeUpText
+ db "@"
+
+BugCatchingContestIsOverText:
+ text_far _BugCatchingContestIsOverText
+ db "@" \ No newline at end of file
diff --git a/engine/events/daycare.asm b/engine/events/daycare.asm
index 32a7665d..4cd12087 100644
--- a/engine/events/daycare.asm
+++ b/engine/events/daycare.asm
@@ -162,7 +162,7 @@ DayCareAskDepositPokemon:
.DummyText:
;
- text_jump _DaycareDummyText
+ text_far _DaycareDummyText
db "@"
DayCare_DepositPokemonText:
@@ -291,102 +291,102 @@ PrintDayCareText:
.DayCareManIntro:
; I'm the DAY-CARE MAN. Want me to raise a #MON?
- text_jump _DayCareManIntroText
+ text_far _DayCareManIntroText
db "@"
.DayCareManOddEgg:
; I'm the DAY-CARE MAN. Do you know about EGGS? I was raising #MON with my wife, you see. We were shocked to find an EGG! How incredible is that? So, want me to raise a #MON?
- text_jump _DayCareManOddEggText
+ text_far _DayCareManOddEggText
db "@"
.DayCareLadyIntro:
; I'm the DAY-CARE LADY. Should I raise a #MON for you?
- text_jump _DayCareLadyIntroText
+ text_far _DayCareLadyIntroText
db "@"
.DayCareLadyOddEgg:
; I'm the DAY-CARE LADY. Do you know about EGGS? My husband and I were raising some #MON, you see. We were shocked to find an EGG! How incredible could that be? Should I raise a #MON for you?
- text_jump _DayCareLadyOddEggText
+ text_far _DayCareLadyOddEggText
db "@"
.WhichOne:
; What should I raise for you?
- text_jump _WhatShouldIRaiseText
+ text_far _WhatShouldIRaiseText
db "@"
.JustOneMon:
; Oh? But you have just one #MON.
- text_jump _OnlyOneMonText
+ text_far _OnlyOneMonText
db "@"
.CantAcceptEgg:
; Sorry, but I can't accept an EGG.
- text_jump _CantRaiseEggText
+ text_far _CantRaiseEggText
db "@"
.RemoveMail:
; Remove MAIL before you come see me.
- text_jump _RemoveMailText
+ text_far _RemoveMailText
db "@"
.LastHealthyMon:
; If you give me that, what will you battle with?
- text_jump _LastHealthyMonText
+ text_far _LastHealthyMonText
db "@"
.OkayIllRaiseYourMon:
; OK. I'll raise your @ .
- text_jump _IllRaiseYourMonText
+ text_far _IllRaiseYourMonText
db "@"
.ComeBackForItLater:
; Come back for it later.
- text_jump _ComeBackLaterText
+ text_far _ComeBackLaterText
db "@"
.AreWeGeniusesOrWhat:
; Are we geniuses or what? Want to see your @ ?
- text_jump _AreWeGeniusesText
+ text_far _AreWeGeniusesText
db "@"
.AskRetrieveMon:
; Your @ has grown a lot. By level, it's grown by @ . If you want your #MON back, it will cost ¥@ .
- text_jump _YourMonHasGrownText
+ text_far _YourMonHasGrownText
db "@"
.PerfectHeresYourMon:
; Perfect! Here's your #MON.
- text_jump _PerfectHeresYourMonText
+ text_far _PerfectHeresYourMonText
db "@"
.GotBackMon:
; got back @ .
- text_jump _GotBackMonText
+ text_far _GotBackMonText
db "@"
.ImmediatelyWithdrawMon:
; Huh? Back already? Your @ needs a little more time with us. If you want your #MON back, it will cost ¥100.
- text_jump _BackAlreadyText
+ text_far _BackAlreadyText
db "@"
.PartyFull:
; You have no room for it.
- text_jump _HaveNoRoomText
+ text_far _HaveNoRoomText
db "@"
.NotEnoughMoney:
; You don't have enough money.
- text_jump _DCNotEnoughMoneyText
+ text_far _DCNotEnoughMoneyText
db "@"
.OhFineThen:
; Oh, fine then.
- text_jump _OhFineThenText
+ text_far _OhFineThenText
db "@"
.ComeAgain:
; Come again.
- text_jump _ComeAgainText
+ text_far _ComeAgainText
db "@"
DayCareManOutside:
@@ -399,7 +399,7 @@ DayCareManOutside:
.NotYet:
; Not yet…
- text_jump _NotYetText
+ text_far _NotYetText
db "@"
.AskGiveEgg:
@@ -441,27 +441,27 @@ DayCareManOutside:
.IntroText:
; Ah, it's you! We were raising your #MON, and my goodness, were we surprised! Your #MON had an EGG! We don't know how it got there, but your #MON had it. You want it?
- text_jump _FoundAnEggText
+ text_far _FoundAnEggText
db "@"
.GotEggText:
; received the EGG!
- text_jump _ReceivedEggText
+ text_far _ReceivedEggText
db "@"
.TakeGoodCareOfItText:
; Take good care of it.
- text_jump _TakeGoodCareOfEggText
+ text_far _TakeGoodCareOfEggText
db "@"
.IllKeepItThanksText:
; Well then, I'll keep it. Thanks!
- text_jump _RefuseEggText
+ text_far _RefuseEggText
db "@"
.PartyFullText:
; You have no room in your party. Come back later.
- text_jump _NoRoomForEggText
+ text_far _NoRoomForEggText
db "@"
DayCare_GiveEgg:
@@ -522,7 +522,7 @@ DayCare_GiveEgg:
pop hl
push bc
ld b, FALSE
- predef CalcPkmnStats
+ predef CalcMonStats
pop bc
ld hl, MON_HP
add hl, bc
diff --git a/engine/events/forced_movement.asm b/engine/events/forced_movement.asm
new file mode 100755
index 00000000..69f27bfe
--- /dev/null
+++ b/engine/events/forced_movement.asm
@@ -0,0 +1,51 @@
+Script_ForcedMovement::
+ checkcode VAR_FACING
+ ifequal DOWN, .down
+ ifequal UP, .up
+ ifequal LEFT, .left
+ ifequal RIGHT, .right
+ end
+
+.up
+ applymovement PLAYER, .MovementData_up
+ end
+
+.down
+ applymovement PLAYER, .MovementData_down
+ end
+
+.right
+ applymovement PLAYER, .MovementData_right
+ end
+
+.left
+ applymovement PLAYER, .MovementData_left
+ end
+
+.MovementData_up:
+ step_dig 16
+ turn_in DOWN
+ step_dig 16
+ turn_head DOWN
+ step_end
+
+.MovementData_down:
+ step_dig 16
+ turn_in UP
+ step_dig 16
+ turn_head UP
+ step_end
+
+.MovementData_right:
+ step_dig 16
+ turn_in LEFT
+ step_dig 16
+ turn_head LEFT
+ step_end
+
+.MovementData_left:
+ step_dig 16
+ turn_in RIGHT
+ step_dig 16
+ turn_head RIGHT
+ step_end
diff --git a/engine/events/happiness_egg.asm b/engine/events/happiness_egg.asm
index 5281691d..6c8b918c 100755
--- a/engine/events/happiness_egg.asm
+++ b/engine/events/happiness_egg.asm
@@ -193,7 +193,7 @@ DaycareStep::
call Random
ld [hl], a
- callab CheckBreedmonCompatibility
+ callfar CheckBreedmonCompatibility
ld a, [wd151]
cp 230
ld b, -1 + 32 percent
diff --git a/engine/events/heal_machine_anim.asm b/engine/events/heal_machine_anim.asm
new file mode 100755
index 00000000..9770c35b
--- /dev/null
+++ b/engine/events/heal_machine_anim.asm
@@ -0,0 +1,262 @@
+; HealMachineAnim.Jumptable indexes
+ const_def
+ const HEALMACHINESTATE_LOADGFX
+ const HEALMACHINESTATE_PCLOADBALLS
+ const HEALMACHINESTATE_HOFLOADBALLS
+ const HEALMACHINESTATE_PLAYMUSIC
+ const HEALMACHINESTATE_HOFPLAYSFX
+ const HEALMACHINESTATE_FINISH
+
+HealMachineAnim:
+ ; If you have no Pokemon, don't change the buffer. This can lead to some glitchy effects if you have no Pokemon.
+ ld a, [wPartyCount]
+ and a
+ ret z
+ ; The location of the healing machine relative to the player is stored in wScriptVar.
+ ; 0: Up and left (Pokemon Center)
+ ; 1: Left (Elm's Lab)
+ ; 2: Up (Hall of Fame)
+ ld a, [wScriptVar]
+ ld [wBuffer1], a
+ ldh a, [rOBP1]
+ ld [wBuffer2], a
+ call .DoJumptableFunctions
+ ld a, [wBuffer2]
+ call DmgToCgbObjPal1
+ ret
+
+.DoJumptableFunctions:
+ xor a
+ ld [wBuffer3], a
+.jumpable_loop
+ ld a, [wBuffer1]
+ ld e, a
+ ld d, 0
+ ld hl, .Pointers
+ add hl, de
+ add hl, de
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ ld a, [wBuffer3]
+ ld e, a
+ inc a
+ ld [wBuffer3], a
+ add hl, de
+ ld a, [hl]
+ cp HEALMACHINESTATE_FINISH
+ jr z, .finish
+ ld hl, .Jumptable
+ rst JumpTable
+ jr .jumpable_loop
+
+.finish
+ ret
+
+.Pointers:
+; entries correspond to HEALMACHINE_* constants
+ dw .Pokecenter
+ dw .ElmLab
+ dw .HallOfFame
+
+healmachineanimseq: MACRO
+rept _NARG
+ db HEALMACHINESTATE_\1
+ shift
+endr
+ENDM
+
+.Pokecenter:
+ healmachineanimseq LOADGFX, PCLOADBALLS, PLAYMUSIC, FINISH
+.ElmLab:
+ healmachineanimseq LOADGFX, PCLOADBALLS, PLAYMUSIC, FINISH
+.HallOfFame:
+ healmachineanimseq LOADGFX, HOFLOADBALLS, HOFPLAYSFX, FINISH
+
+.Jumptable:
+; entries correspond to HEALMACHINESTATE_* constants
+ dw .LoadGFX
+ dw .PC_LoadBallsOntoMachine
+ dw .HOF_LoadBallsOntoMachine
+ dw .PlayHealMusic
+ dw .HOF_PlaySFX
+ dw .dummy_5 ; never encountered
+
+.LoadGFX:
+ call .LoadPalettes
+ ld de, .HealMachineGFX
+ ld hl, vTiles0 tile $7c
+ lb bc, BANK(.HealMachineGFX), 2
+ call Request2bpp
+ ret
+
+.PC_LoadBallsOntoMachine:
+ ld hl, wVirtualOAMSprite32
+ ld de, .PC_ElmsLab_OAM
+ call .PlaceHealingMachineTile
+ call .PlaceHealingMachineTile
+ jr .LoadBallsOntoMachine
+
+.HOF_LoadBallsOntoMachine:
+ ld hl, wVirtualOAMSprite32
+ ld de, .HOF_OAM
+
+.LoadBallsOntoMachine:
+ ld a, [wPartyCount]
+ ld b, a
+.party_loop
+ call .PlaceHealingMachineTile
+ push de
+ ld de, SFX_SECOND_PART_OF_ITEMFINDER
+ call PlaySFX
+ pop de
+ ld c, 30
+ call DelayFrames
+ dec b
+ jr nz, .party_loop
+ ret
+
+.PlayHealMusic:
+ ld de, MUSIC_HEAL
+ call PlayMusic
+ jp .FlashPalettes8Times
+
+.HOF_PlaySFX:
+ ld de, SFX_GAME_FREAK_LOGO_GS
+ call PlaySFX
+ call .FlashPalettes8Times
+ call WaitSFX
+ ld de, SFX_BOOT_PC
+ call PlaySFX
+ ret
+
+.dummy_5
+ ret
+
+.PC_ElmsLab_OAM:
+ dsprite 4, 0, 4, 2, $7c, PAL_OW_TREE | OBP_NUM
+ dsprite 4, 0, 4, 6, $7c, PAL_OW_TREE | OBP_NUM
+ dsprite 4, 6, 4, 0, $7d, PAL_OW_TREE | OBP_NUM
+ dsprite 4, 6, 5, 0, $7d, PAL_OW_TREE | OBP_NUM | X_FLIP
+ dsprite 5, 3, 4, 0, $7d, PAL_OW_TREE | OBP_NUM
+ dsprite 5, 3, 5, 0, $7d, PAL_OW_TREE | OBP_NUM | X_FLIP
+ dsprite 6, 0, 4, 0, $7d, PAL_OW_TREE | OBP_NUM
+ dsprite 6, 0, 5, 0, $7d, PAL_OW_TREE | OBP_NUM | X_FLIP
+
+.HealMachineGFX:
+INCBIN "gfx/overworld/heal_machine.2bpp"
+
+.HOF_OAM:
+ dsprite 7, 4, 10, 1, $7d, PAL_OW_TREE | OBP_NUM
+ dsprite 7, 4, 10, 6, $7d, PAL_OW_TREE | OBP_NUM
+ dsprite 7, 3, 9, 5, $7d, PAL_OW_TREE | OBP_NUM
+ dsprite 7, 3, 11, 2, $7d, PAL_OW_TREE | OBP_NUM
+ dsprite 7, 1, 9, 1, $7d, PAL_OW_TREE | OBP_NUM
+ dsprite 7, 1, 11, 5, $7d, PAL_OW_TREE | OBP_NUM
+
+.LoadPalettes:
+ call IsCGB
+ jr nz, .cgb
+ ld a, %11100000
+ ldh [rOBP1], a
+ ret
+
+.cgb
+ ld hl, .palettes
+ ld de, wOBPal6
+ ld bc, 1 palettes
+ call CopyBytes
+ ld a, $1
+ ldh [hCGBPalUpdate], a
+ ret
+
+.palettes
+ rst $38
+ ld a, a
+ ld a, a
+ ld a, [hl+]
+ rst $38
+ inc b
+ nop
+ nop
+;INCLUDE "gfx/overworld/heal_machine.pal"
+
+.FlashPalettes8Times:
+ ld c, 8
+.palette_loop
+ push bc
+ call .FlashPalettes
+ ld c, 10
+ call DelayFrames
+ pop bc
+ dec c
+ jr nz, .palette_loop
+ ret
+
+.FlashPalettes:
+ call IsCGB
+ jr nz, .go
+ ldh a, [rOBP1]
+ xor %00101000
+ ldh [rOBP1], a
+ ret
+
+.go
+ ld hl, wOBPal6
+ ld a, [hli]
+ ld e, a
+ ld a, [hli]
+ ld d, a
+ push de
+ ld c, $3
+.palette_loop_2
+ ld a, [hli]
+ ld e, a
+ ld a, [hld]
+ ld d, a
+ dec hl
+ ld a, d
+ ld [hld], a
+ ld a, e
+ ld [hli], a
+ inc hl
+ inc hl
+ inc hl
+ dec c
+ jr nz, .palette_loop_2
+ pop de
+ dec hl
+ ld a, d
+ ld [hld], a
+ ld a, e
+ ld [hl], a
+
+ ld a, $1
+ ldh [hCGBPalUpdate], a
+ ret
+
+.PlaceHealingMachineTile:
+ push bc
+ ld a, [wBuffer1]
+ bcpixel 2, 4
+ cp HEALMACHINE_ELMS_LAB
+ jr z, .okay
+ bcpixel 0, 0
+
+.okay
+ ld a, [de]
+ add c
+ inc de
+ ld [hli], a ; y
+ ld a, [de]
+ add b
+ inc de
+ ld [hli], a ; x
+ ld a, [de]
+ inc de
+ ld [hli], a ; tile id
+ ld a, [de]
+ inc de
+ ld [hli], a ; attributes
+ pop bc
+ ret
diff --git a/engine/events/misc_scripts.asm b/engine/events/misc_scripts.asm
new file mode 100755
index 00000000..f9ba459f
--- /dev/null
+++ b/engine/events/misc_scripts.asm
@@ -0,0 +1,55 @@
+Script_AbortBugContest:
+ checkflag ENGINE_BUG_CONTEST_TIMER
+ iffalse .finish
+ setflag ENGINE_DAILY_BUG_CONTEST
+ special ContestReturnMons
+.finish
+ end
+
+FindItemInBallScript::
+ callasm .TryReceiveItem
+ iffalse .no_room
+ disappear LAST_TALKED
+ opentext
+ writetext .FoundItemText
+ playsound SFX_ITEM
+ pause 60
+ itemnotify
+ closetext
+ end
+
+.no_room
+ opentext
+ writetext .FoundItemText
+ waitbutton
+ writetext .CantCarryItemText
+ waitbutton
+ closetext
+ end
+
+.FoundItemText:
+ text_far _FoundItemText
+ db "@"
+
+.CantCarryItemText:
+ text_far _CantCarryItemText
+ db "@"
+
+.TryReceiveItem:
+ xor a
+ ld [wScriptVar], a
+ ld a, [wcf29]
+ ld [wDeciramBuffer], a
+ call GetItemName
+ ld hl, wStringBuffer3
+ call CopyName2
+ ld a, [wcf29]
+ ld [wd002], a
+ ld a, [wcf2a]
+ ld [wItemQuantityChangeBuffer], a
+ ld hl, wNumItems
+ call ReceiveItem
+ ret nc
+ ld a, $1
+ ld [wScriptVar], a
+ ret \ No newline at end of file
diff --git a/engine/events/misc_scripts_2.asm b/engine/events/misc_scripts_2.asm
new file mode 100755
index 00000000..ac0f7e31
--- /dev/null
+++ b/engine/events/misc_scripts_2.asm
@@ -0,0 +1,48 @@
+RepelWoreOffScript::
+ opentext
+ writetext .RepelWoreOffText
+ waitbutton
+ closetext
+ end
+
+.RepelWoreOffText:
+ text_far _RepelWoreOffText
+ db "@"
+
+HiddenItemScript::
+ opentext
+ copybytetovar wcf2b
+ itemtotext MEM_BUFFER_0, USE_SCRIPT_VAR
+ writetext .PlayerFoundItemText
+ giveitem ITEM_FROM_MEM
+ iffalse .bag_full
+ callasm SetMemEvent
+ specialsound
+ itemnotify
+ jump .finish
+
+.bag_full
+ buttonsound
+ writetext .ButNoSpaceText
+ waitbutton
+
+.finish
+ closetext
+ end
+
+.PlayerFoundItemText:
+ text_far _PlayerFoundItemText
+ db "@"
+
+.ButNoSpaceText:
+ text_far _ButNoSpaceText
+ db "@"
+
+SetMemEvent:
+ ld hl, wcf29
+ ld a, [hli]
+ ld d, [hl]
+ ld e, a
+ ld b, SET_FLAG
+ call EventFlagAction
+ ret
diff --git a/engine/events/overworld.asm b/engine/events/overworld.asm
index f12aad03..c4967028 100755
--- a/engine/events/overworld.asm
+++ b/engine/events/overworld.asm
@@ -33,7 +33,7 @@ FieldMoveGetPartyNick: ; c74b (3:474b)
FieldMoveEngineFlagCheck: ; c766 (3:4766)
ld b, CHECK_FLAG
- callba EngineFlagAction ; same bank
+ farcall EngineFlagAction ; same bank
ld a, c
and a
jr nz, .asm_c774
@@ -53,7 +53,7 @@ FieldMoveBadgeCheck: ; c776 (3:4776)
ret
.BadgeRequiredText:
- text_jump BadgeRequiredText_
+ text_far BadgeRequiredText_
db "@"
FieldMovePartyCheck: ; c787 (3:4787)
@@ -103,7 +103,7 @@ FieldMoveFailed: ; c7be (3:47be)
ret
.CantUseHereText:
- text_jump CantUseFieldMoveHereText_
+ text_far CantUseFieldMoveHereText_
db "@"
CutFunction::
@@ -151,18 +151,18 @@ FailToCut:
ret
Text_UsedCut:
- text_jump Text_UsedCut_
+ text_far Text_UsedCut_
db "@"
Text_NothingToCut:
- text_jump Text_NothingToCut_
+ text_far Text_NothingToCut_
db "@"
CheckMapForSomethingToCut: ; c813 (3:4813)
call GetFacingTileCoord
ld c, a
push de
- callba CheckCutCollision
+ farcall CheckCutCollision
pop de
jr nc, .asm_c841
call GetBlockLocation
@@ -212,7 +212,7 @@ CutDownTreeOrGrass:
call DelayFrame
ld a, [wBuffer6]
ld e, a
- callba OWCutAnimation
+ farcall OWCutAnimation
call BufferScreen
call GetMovementPermissions
ret
@@ -297,7 +297,7 @@ FlashFunction:
CheckUseFlash: ; c8f1 (3:48f1)
ld de, ENGINE_ZEPHYRBADGE
- callba FieldMoveBadgeCheck ; same bank
+ farcall FieldMoveBadgeCheck ; same bank
jr c, .asm_c90f
ld a, [wd56e]
cp $ff
@@ -328,8 +328,8 @@ Script_UseFlash:
end
Text_UsedFlash:
- text_jump Text_UsedFlash_
- start_asm
+ text_far Text_UsedFlash_
+ text_asm
call WaitSFX
ld de, SFX_FLASH
call PlaySFX
@@ -422,15 +422,15 @@ UsedSurfScript:
end
UsedSurfText:
- text_jump UsedSurfText_
+ text_far UsedSurfText_
db "@"
CantSurfText:
- text_jump CantSurfText_
+ text_far CantSurfText_
db "@"
AlreadySurfingText:
- text_jump AlreadySurfingText_
+ text_far AlreadySurfingText_
db "@"
GetSurfType: ; c9d7 (3:49d7)
@@ -513,7 +513,7 @@ AskSurfScript:
end
AskSurfText:
- text_jump AskSurfText_
+ text_far AskSurfText_
db "@"
FlyFunction:
@@ -588,7 +588,7 @@ FlyScript:
callasm HideSprites
special UpdateTimePals
callasm FlyFromAnimation
- farscall AbortBugCatchingContest
+ farscall Script_AbortBugContest
special WarpToSpawnPoint
callasm DelayLoadingNewSprites ; 1560c
writecode VAR_MOVEMENT, PLAYER_NORMAL
@@ -607,7 +607,7 @@ WaterfallFunction: ; caed
TryWaterfall: ; caf6 (3:4af6)
ld de, ENGINE_RISINGBADGE
- callba FieldMoveBadgeCheck ; same bank
+ farcall FieldMoveBadgeCheck ; same bank
ld a, $80
ret c
call CheckMapCanWaterfall
@@ -667,7 +667,7 @@ CheckContinueWaterfall: ;cb49
ret
Text_UsedWaterfall:
- text_jump Text_UsedWaterfall_
+ text_far Text_UsedWaterfall_
db "@"
TryWaterfallOW:
@@ -696,7 +696,7 @@ Script_CantDoWaterfall:;cb87
jumptext Text_CantDoWaterfall
Text_CantDoWaterfall:
- text_jump Text_CantDoWaterfall_
+ text_far Text_CantDoWaterfall_
db "@"
Script_AskWaterfall:
@@ -708,7 +708,7 @@ Script_AskWaterfall:
end
Text_AskUseWaterfall:
- text_jump Text_AskUseWaterfall_
+ text_far Text_AskUseWaterfall_
db "@"
EscapeRopeFunction:
@@ -791,15 +791,15 @@ FailToEscapeFromDungeon:
ret
Text_UsedDig: ; cc1f
- text_jump Text_UsedDig_
+ text_far Text_UsedDig_
db "@"
Text_UsedEscapeRope:
- text_jump Text_UsedEscapeRope_
+ text_far Text_UsedEscapeRope_
db "@"
Text_CantUseDigEscapeRopeHere:
- text_jump Text_CantUseDigEscapeRopeHere_
+ text_far Text_CantUseDigEscapeRopeHere_
db "@"
UsedEscapeRopeScript: ; cc2e reloadmappart
@@ -817,7 +817,7 @@ ContinueDigEscapeRopeScript:
closetext
playsound SFX_WARP_TO
applymovement PLAYER, DigOutMovementData
- farscall AbortBugCatchingContest
+ farscall Script_AbortBugContest
special WarpToSpawnPoint
writecode VAR_MOVEMENT, PLAYER_NORMAL
newloadmap MAPSETUP_DOOR
@@ -887,11 +887,11 @@ FailTeleport:
ret
Text_ReturnToLastMonCenter:
- text_jump Text_ReturnToLastMonCenter_
+ text_far Text_ReturnToLastMonCenter_
db "@"
Text_CantUseTeleportHere:
- text_jump Text_CantUseTeleportHere_
+ text_far Text_CantUseTeleportHere_
db "@"
TeleportScript: ; ccbe
@@ -903,7 +903,7 @@ TeleportScript: ; ccbe
closetext
playsound SFX_WARP_TO
applymovement PLAYER, TeleportFromMovementData
- farscall AbortBugCatchingContest
+ farscall Script_AbortBugContest
special WarpToSpawnPoint
writecode VAR_MOVEMENT, PLAYER_NORMAL
newloadmap MAPSETUP_TELEPORT
@@ -937,7 +937,7 @@ Functionccf1: ; ccf1 (3:4cf1)
ret
Text_AlreadyUsingStrength:
- text_jump Text_AlreadyUsingStrength_
+ text_far Text_AlreadyUsingStrength_
db "@"
asm_cd09
@@ -976,11 +976,11 @@ Script_UsedStrength:
end
Text_UsedStrength: ; cd44
- text_jump Text_UsedStrength_
+ text_far Text_UsedStrength_
db "@"
Text_AllowedToMoveBoulders:
- text_jump Text_AllowedToMoveBoulders_
+ text_far Text_AllowedToMoveBoulders_
db "@"
AskStrengthScript: ; cd4e
@@ -1004,15 +1004,15 @@ AskStrengthScript: ; cd4e
end
Text_AskStrength:
- text_jump Text_AskStrength_
+ text_far Text_AskStrength_
db "@"
Text_BouldersMayNowBeMoved:
- text_jump Text_BouldersMayNowBeMoved_
+ text_far Text_BouldersMayNowBeMoved_
db "@"
Text_MonMayBeAbleToMove:
- text_jump Text_MonMayBeAbleToMove_
+ text_far Text_MonMayBeAbleToMove_
db "@"
TryStrengthOW:
@@ -1083,7 +1083,7 @@ FailWhirlpool:
ret
Text_UsedWhirlpool:
- text_jump Text_UsedWhirlpool_
+ text_far Text_UsedWhirlpool_
db "@"
TryWhirlpoolMenu: ; cde1 (3:4de1)
@@ -1138,7 +1138,7 @@ DisappearWhirlpool: ; 4e20
call OverworldTextModeSwitch
ld a, [wBuffer6]
ld e, a
- callba PlayWhirlpoolSound
+ farcall PlayWhirlpoolSound
call BufferScreen
call GetMovementPermissions
ret
@@ -1169,7 +1169,7 @@ Script_MightyWhirlpool:
jumptext Text_MightyWhirlpool
Text_MightyWhirlpool:
- text_jump Text_MightyWhirlpool_
+ text_far Text_MightyWhirlpool_
db "@"
Script_AskWhirlpoolOW: ; ce71
@@ -1181,7 +1181,7 @@ Script_AskWhirlpoolOW: ; ce71
end
Text_AskWhirlpool: ; ce7b
- text_jump Text_AskWhirlpool_
+ text_far Text_AskWhirlpool_
db "@"
HeadbuttFunction:
@@ -1206,11 +1206,11 @@ TryHeadbuttFromMenu: ; ce89 (3:4e89)
; ceaa
Text_DidAHeadbutt:
- text_jump Text_DidAHeadbutt_
+ text_far Text_DidAHeadbutt_
db "@"
Text_NothingFromHeadbutt:
- text_jump Text_NothingFromHeadbutt_
+ text_far Text_NothingFromHeadbutt_
db "@"
HeadbuttFromMenuScript:
@@ -1258,7 +1258,7 @@ AskHeadbuttScript:
end
Text_AskHeadbutt: ; cee9
- text_jump Text_AskHeadbutt_
+ text_far Text_AskHeadbutt_
db "@"
call TryRockSmashFromMenu
@@ -1283,7 +1283,7 @@ TryRockSmashFromMenu: ; cef7 (3:4ef7)
ret
GetFacingObject: ; cf10 (3:4f10)
- callba CheckFacingObject
+ farcall CheckFacingObject
jr nc, .asm_cf2f
ld a, [hObjectStructIndexBuffer]
call GetObjectStruct
@@ -1329,7 +1329,7 @@ RockSmashMovementData:
step_end
Text_UsedRockSmash:
- text_jump Text_UsedRockSmash_
+ text_far Text_UsedRockSmash_
db "@"
; cf60
AskRockSmashScript:
@@ -1345,11 +1345,11 @@ AskRockSmashScript:
jumptext Text_MayBeBreakable
Text_MayBeBreakable:
- text_jump Text_MayBeBreakable_
+ text_far Text_MayBeBreakable_
db "@"
Text_AskRockSmash:
- text_jump Text_AskRockSmash_
+ text_far Text_AskRockSmash_
db "@"
TryRockSmashOW: ; cf7f
@@ -1555,15 +1555,15 @@ PutTheRodAway: ; d096
ret
Text_OhABite:
- text_jump Text_OhABite_
+ text_far Text_OhABite_
db "@"
Text_NotEvenANibble:
- text_jump Text_NotEvenANibble_
+ text_far Text_NotEvenANibble_
db "@"
Text_NothingHereToFish:
- text_jump Text_NothingHereToFish_
+ text_far Text_NothingHereToFish_
db "@"
BicycleFunction:
@@ -1694,15 +1694,15 @@ Script_CantGetOffBike: ; d17e
end
Text_CantGetOffBike:
- text_jump Text_CantGetOffBike_
+ text_far Text_CantGetOffBike_
db "@"
Text_GotOnTheBike:
- text_jump Text_GotOnTheBike_
+ text_far Text_GotOnTheBike_
db "@"
Text_GotOffTheBike:
- text_jump Text_GotOffTheBike_
+ text_far Text_GotOffTheBike_
db "@"
@@ -1747,12 +1747,12 @@ CheckMapForSomethingToCut_: ; d1c7
ret
Text_AskCut:
- text_jump Text_AskCut_
+ text_far Text_AskCut_
db "@"
CantCutScript: ; d1da
jumptext Text_MonCanCutThis
Text_MonCanCutThis:
- text_jump Text_MonCanCutThis_
+ text_far Text_MonCanCutThis_
db "@"
diff --git a/engine/events/std_collision.asm b/engine/events/std_collision.asm
new file mode 100755
index 00000000..932f4db8
--- /dev/null
+++ b/engine/events/std_collision.asm
@@ -0,0 +1,29 @@
+CheckFacingTileForStdScript::
+; Checks to see if the tile you're facing has a std script associated with it. If so, executes the script and returns carry.
+ ld a, c
+ ld de, 3
+ ld hl, TileCollisionStdScripts
+ call IsInArray
+ jr nc, .notintable
+
+ ld a, jumpstd_command
+ ld [wcf2a], a
+ inc hl
+ ld a, [hli]
+ ld [wcf2b], a
+ ld a, [hli]
+ ld [wTempTrainerHeader], a
+ ld a, BANK(Script_JumpStdFromRAM)
+ ld hl, Script_JumpStdFromRAM
+ call CallScript
+ scf
+ ret
+
+.notintable
+ xor a
+ ret
+
+INCLUDE "data/events/collision_stdscripts.asm"
+
+Script_JumpStdFromRAM:
+ jump wcf2a \ No newline at end of file
diff --git a/engine/events/whiteout.asm b/engine/events/whiteout.asm
new file mode 100755
index 00000000..33098f13
--- /dev/null
+++ b/engine/events/whiteout.asm
@@ -0,0 +1,76 @@
+Script_BattleWhiteout::
+ callasm BattleBGMap
+ jump Script_Whiteout
+
+Script_OverworldWhiteout::
+ refreshscreen
+ callasm OverworldBGMap
+
+Script_Whiteout:
+ writetext .WhitedOutText
+ waitbutton
+ special FadeOutPalettes
+ pause 40
+ special HealParty
+ checkflag ENGINE_BUG_CONTEST_TIMER
+ iftrue .bug_contest
+ callasm HalveMoney
+ callasm GetWhiteoutSpawn
+ farscall Script_AbortBugContest
+ special WarpToSpawnPoint
+ newloadmap MAPSETUP_WARP
+ endall
+
+.bug_contest
+ jumpstd bugcontestresultswarp
+
+.WhitedOutText:
+ ; is out of useable #MON! whited out!
+ text_far UnknownText_0x1c0a4e
+ db "@"
+
+OverworldBGMap:
+ call ClearPalettes
+ call FillScreenWithTextboxPal
+ call Function3456
+ call HideSprites
+ call RotateThreePalettesLeft
+ ret
+
+BattleBGMap:
+ ld b, SCGB_BATTLE_GRAYSCALE
+ call GetSGBLayout
+ call SetPalettes
+ ret
+
+HalveMoney:
+; Halve the player's money.
+ ld hl, wMoney
+ ld a, [hl]
+ srl a
+ ld [hli], a
+ ld a, [hl]
+ rra
+ ld [hli], a
+ ld a, [hl]
+ rra
+ ld [hl], a
+ ret
+
+GetWhiteoutSpawn:
+ ld a, [wd9fb]
+ ld d, a
+ ld a, [wd9fc]
+ ld e, a
+
+ ld a, $05
+ ld hl, $5465
+ rst $08
+
+ ld a, c
+ jr c, .yes
+ xor a ; SPAWN_HOME
+
+.yes
+ ld [wceec], a
+ ret
diff --git a/engine/facings.asm b/engine/facings.asm
index 871b0985..a5669c2b 100644
--- a/engine/facings.asm
+++ b/engine/facings.asm
@@ -42,11 +42,8 @@ NUM_FACINGS EQU (FacingsEnd - Facings) / 2
; db y, x, attributes, tile index
; Attributes:
-X_FLIP EQU 1 << OAM_X_FLIP
-Y_FLIP EQU 1 << OAM_Y_FLIP
BEHIND_BG EQU 1 << OAM_PRIORITY
-
Facing00:
Facing02:
Facing24:
diff --git a/engine/health.asm b/engine/health.asm
index 83fea353..506d5a9d 100755
--- a/engine/health.asm
+++ b/engine/health.asm
@@ -41,7 +41,7 @@ Functionc6bc: ; c6bc (3:46bc)
inc bc
ld a, [hl]
ld [bc], a
- callba Functionf900
+ farcall Functionf900
ret
ComputeHPBarPixels: ; c6de (3:46de)
diff --git a/engine/learn.asm b/engine/learn.asm
index f6e06572..d285d326 100644
--- a/engine/learn.asm
+++ b/engine/learn.asm
@@ -121,7 +121,7 @@ LearnMove:
hlcoord 5, 2
ld b, $8
ld c, $d
- call TextBox
+ call Textbox
hlcoord 7, 4
ld a, $28
ld [wBuffer1], a
@@ -182,28 +182,28 @@ LearnMove:
ret
Text_LearnedMove:
- text_jump Text_LearnedMove_
+ text_far Text_LearnedMove_
db "@"
Text_ForgetWhich:
- text_jump Text_ForgetWhich_
+ text_far Text_ForgetWhich_
db "@"
Text_StopLearning:
- text_jump Text_StopLearning_
+ text_far Text_StopLearning_
db "@"
Text_DidNotLearn:
- text_jump Text_DidNotLearn_
+ text_far Text_DidNotLearn_
db "@"
Text_TryingToLearn:
- text_jump Text_TryingToLearn_
+ text_far Text_TryingToLearn_
db "@"
Text_1_2_and_Poof:
- text_jump Text_1_2_and_Poof_
- start_asm
+ text_far Text_1_2_and_Poof_
+ text_asm
push de
ld de, SFX_SWITCH_POKEMON
call PlaySFX
@@ -212,9 +212,9 @@ Text_1_2_and_Poof:
ret
.PoofForgot:
- text_jump Text_PoofForgot_
+ text_far Text_PoofForgot_
db "@"
Text_CantForgetHM:
- text_jump Text_CantForgetHM_
+ text_far Text_CantForgetHM_
db "@"
diff --git a/engine/learn_tm.asm b/engine/learn_tm.asm
index 3116a6db..530ecf41 100755
--- a/engine/learn_tm.asm
+++ b/engine/learn_tm.asm
@@ -22,7 +22,7 @@ CanLearnTMHMMove: ; 11a25 (4:5a25)
ld b, CHECK_FLAG
push de
ld d, $0
- predef FlagPredef
+ predef SmallFarFlagAction
pop de
ret
diff --git a/engine/link/place_waiting_text.asm b/engine/link/place_waiting_text.asm
new file mode 100755
index 00000000..dc1fe215
--- /dev/null
+++ b/engine/link/place_waiting_text.asm
@@ -0,0 +1,24 @@
+PlaceWaitingText::
+ hlcoord 3, 10
+ ld b, 1
+ ld c, 11
+
+ ld a, [wBattleMode]
+ and a
+ jr z, .notinbattle
+
+ call Textbox
+ jr .proceed
+
+.notinbattle
+ predef LinkTextboxAtHL
+
+.proceed
+ hlcoord 4, 11
+ ld de, .Waiting
+ call PlaceString
+ ld c, 50
+ jp DelayFrames
+
+.Waiting:
+ db "Waiting...!@"
diff --git a/engine/main_menu.asm b/engine/main_menu.asm
index 73debf65..0bd56b1a 100755
--- a/engine/main_menu.asm
+++ b/engine/main_menu.asm
@@ -152,11 +152,11 @@ Function5b45: ; 5b45 (1:5b45)
hlcoord 0, 12
ld b, $4
ld c, $d
- call TextBox
+ call Textbox
ret
.asm_5b57
- call SpeechTextBox
+ call SpeechTextbox
ret
Function5b5b: ; 5b5b (1:5b5b)
@@ -177,7 +177,7 @@ Function5b5b: ; 5b5b (1:5b5b)
decoord 4, 16
ld a, [hHours]
ld c, a
- callba PrintHour
+ farcall PrintHour
ld [hl], $9c
inc hl
ld de, hMinutes
@@ -198,7 +198,7 @@ Function5b9c: ; 5b9c (1:5b9c)
db "TIME NOT SET@"
.UnusedText
- text_jump _ClockTimeUnknownText
+ text_far _ClockTimeUnknownText
db "@"
Function5bb8: ; 5bb8 (1:5bb8)
@@ -238,12 +238,12 @@ Function5bf7: ; 5bf7 (1:5bf7)
MainMenu_MysteryGift:
call UpdateTime
- callba Function11934
- callba Function29dff
+ farcall Function11934
+ farcall Function29dff
ret
MainMenu_Options:
- callba OptionsMenu
+ farcall OptionsMenu
ret
MainMenu_NewGame:
@@ -366,9 +366,9 @@ ENDC
call Function5d5d
- callba InitDecorations
+ farcall InitDecorations
- callba DeletePartyMonMail
+ farcall DeletePartyMonMail
call ResetGameTime
ret
@@ -446,8 +446,8 @@ Function5d5d: ; 5d5d (1:5d5d)
InitializeWorld: ; 5d97 (1:5d97)
call ShrinkPlayer
- callba SpawnPlayer
- callba InitializeStartDay_
+ farcall SpawnPlayer
+ farcall InitializeStartDay_
ret
LoadOrRegenerateLuckyIDNumber: ; 5da7 (1:5da7)
@@ -476,7 +476,7 @@ LoadOrRegenerateLuckyIDNumber: ; 5da7 (1:5da7)
jp CloseSRAM
MainMenu_Continue:
- callba TryLoadSaveFile
+ farcall TryLoadSaveFile
jr c, .asm_5e41
call LoadStandardMenuDataHeader
call DisplaySaveInfoOnContinue
@@ -507,9 +507,9 @@ MainMenu_Continue:
call ClearTileMap
ld c, 20
call DelayFrames
- callba JumpRoamMons
- callba MysteryGift_CopyReceivedDecosToPC
- callba ClockContinue
+ farcall JumpRoamMons
+ farcall MysteryGift_CopyReceivedDecosToPC
+ farcall ClockContinue
ld a, [wd1db]
cp $1
jr z, .asm_5e42
@@ -572,7 +572,7 @@ FinishContinueFunction: ; 5e84 (1:5e84)
ld [wDontPlayMapMusicOnReload], a
ld hl, wGameTimerPause
set 0, [hl]
- callba OverworldLoop
+ farcall OverworldLoop
ld a, [wd1db]
cp $2
jr z, .asm_5e9d
@@ -721,7 +721,7 @@ Continue_DisplayGameTime: ; 5f90 (1:5f90)
jp PrintNum
OakSpeech: ; 5fa5 (1:5fa5)
- callba InitClock ; What time is it?
+ farcall InitClock ; What time is it?
call RotateFourPalettesLeft
call ClearTileMap
@@ -812,12 +812,12 @@ OakSpeech: ; 5fa5 (1:5fa5)
ret
OakText1:
- text_jump _OakText1
+ text_far _OakText1
db "@"
OakText2:
- text_jump _OakText2
- start_asm
+ text_far _OakText2
+ text_asm
ld a, MARILL
call PlayMonCry
call WaitSFX
@@ -825,23 +825,23 @@ OakText2:
ret
OakText3:
- text_jump _OakText3
+ text_far _OakText3
db "@"
OakText4:
- text_jump _OakText4
+ text_far _OakText4
db "@"
OakText5:
- text_jump _OakText5
+ text_far _OakText5
db "@"
OakText6:
- text_jump _OakText6
+ text_far _OakText6
db "@"
OakText7:
- text_jump _OakText7
+ text_far _OakText7
db "@"
NamePlayer: ; 6085 (1:6085)
@@ -853,14 +853,14 @@ NamePlayer: ; 6085 (1:6085)
jr z, .NewName
ld de, wPlayerName
call StorePlayerName
- callba ApplyMonOrTrainerPals
+ farcall ApplyMonOrTrainerPals
call MovePlayerPicLeft
ret
.NewName
ld b, $1
ld de, wPlayerName
- callba NamingScreen
+ farcall NamingScreen
call RotateThreePalettesRight
call ClearTileMap
call LoadFontsExtra
@@ -929,7 +929,7 @@ ShrinkPlayer: ; 6123 (1:6123)
ld a, e
ld [wMusicFadeID], a
ld a, d
- ld [wMusicFadeIDHi], a
+ ld [wMusicFadeID + 1], a
ld de, SFX_ESCAPE_ROPE
call PlaySFX
@@ -1051,7 +1051,7 @@ Intro_PrepTrainerPic: ; 61df, 61e0 (1:61df, 1:61e0)
ShrinkFrame: ; 61f7 (1:61f7)
ld de, $9000
ld c, $31
- predef DecompressPredef
+ predef DecompressGet2bpp
xor a
ld [hGraphicStartTile], a
hlcoord 6, 4
diff --git a/engine/move_mon.asm b/engine/move_mon.asm
index 28cda6ef..bbfea25e 100755
--- a/engine/move_mon.asm
+++ b/engine/move_mon.asm
@@ -126,7 +126,7 @@ GeneratePartyMonStats:
push de
ld a, [wCurPartyLevel]
ld d, a
- callab CalcExpAtLevel ; 14:5550
+ callfar CalcExpAtLevel ; 14:5550
pop de
ld a, [hPrintNum2]
ld [de], a
@@ -150,7 +150,7 @@ GeneratePartyMonStats:
and $f
jr z, .asm_d998
push hl
- callba GetTrainerDVs ; 9:7271
+ farcall GetTrainerDVs ; 9:7271
pop hl
jr .asm_d9bb
@@ -214,7 +214,7 @@ GeneratePartyMonStats:
ld a, $1
ld c, a
ld b, $0
- call CalcPkmnStatC
+ call CalcMonStatC
ld a, [hStringCmpString2]
ld [de], a
inc de
@@ -281,7 +281,7 @@ GeneratePartyMonStats:
ld bc, $a
add hl, bc
ld b, $0
- call CalcPkmnStats
+ call CalcMonStats
.asm_da4b
ld a, [wMonType]
and $f
@@ -295,7 +295,7 @@ GeneratePartyMonStats:
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
predef GetUnownLetter
- callab UpdateUnownDex
+ callfar UpdateUnownDex
.asm_da71
scf
ret
@@ -396,7 +396,7 @@ AddTempmonToParty: ; da9c (3:5a9c)
ld bc, PARTYMON_STRUCT_LENGTH
call AddNTimes
predef GetUnownLetter
- callab UpdateUnownDex
+ callfar UpdateUnownDex
ld a, [wFirstUnownSeen]
and a
jr nz, .asm_db43
@@ -406,7 +406,7 @@ AddTempmonToParty: ; da9c (3:5a9c)
and a
ret
-SentGetPkmnIntoFromBox: ; db45 (3:5b45)
+SendGetMonIntoFromBox: ; db45 (3:5b45)
ld a, $1
call OpenSRAM
ld a, [wPokemonWithdrawDepositParameter]
@@ -544,8 +544,8 @@ SentGetPkmnIntoFromBox: ; db45 (3:5b45)
srl a
add $2
ld [wMonType], a
- predef CopyPkmnToTempMon
- callab CalcLevel
+ predef CopyMonToTempMon
+ callfar CalcLevel
ld a, d
ld [wCurPartyLevel], a
pop hl
@@ -562,7 +562,7 @@ SentGetPkmnIntoFromBox: ; db45 (3:5b45)
add hl, bc
push bc
ld b, $1
- call CalcPkmnStats
+ call CalcMonStats
pop bc
ld a, [wPokemonWithdrawDepositParameter]
and a
@@ -649,7 +649,7 @@ Functiondcbc: ; dcbc (3:5cbc)
push bc
push hl
push de
- callba GetMaxPPOfMove ; same bank
+ farcall GetMaxPPOfMove ; same bank
pop de
pop hl
ld a, [wd151]
@@ -766,7 +766,7 @@ Functiondd6a: ; dd6a (3:5d6a)
add hl, bc
push bc
ld b, $1
- call CalcPkmnStats
+ call CalcMonStats
ld hl, wPartyMon1Moves
ld a, [wPokemonData]
dec a
@@ -780,10 +780,10 @@ Functiondd6a: ; dd6a (3:5d6a)
ld a, [wPartyCount]
dec a
ld [wCurPartyMon], a
- callba Functionc6bc ; same bank
+ farcall Functionc6bc ; same bank
ld a, [wCurPartyLevel]
ld d, a
- callab CalcExpAtLevel
+ callfar CalcExpAtLevel
pop bc
ld hl, $8
add hl, bc
@@ -836,7 +836,7 @@ Functionde4a: ; de4a (3:5e4a)
ld bc, BOXMON_STRUCT_LENGTH
jp CopyBytes
-SentPkmnIntoBox: ; de74 (3:5e74)
+SendMonIntoBox: ; de74 (3:5e74)
ld a, $1
call OpenSRAM
ld de, sBoxCount
@@ -884,7 +884,7 @@ SentPkmnIntoBox: ; de74 (3:5e74)
push de
ld a, [wCurPartyLevel]
ld d, a
- callab CalcExpAtLevel
+ callfar CalcExpAtLevel
pop de
ld a, [hQuotient]
ld [de], a
@@ -930,7 +930,7 @@ SentPkmnIntoBox: ; de74 (3:5e74)
jr nz, .asm_df26
ld hl, sBoxMon1DVs
predef GetUnownLetter
- callab UpdateUnownDex
+ callfar UpdateUnownDex
.asm_df26
ld hl, sBoxMon1Moves
ld de, wTempMonMoves
@@ -995,8 +995,8 @@ Functiondf65: ; df65 (3:5f65)
GiveEgg: ; df92 (3:5f92)
ld a, [wCurPartySpecies]
push af
- callab GetPreEvolution
- callab GetPreEvolution
+ callfar GetPreEvolution
+ callfar GetPreEvolution
ld a, [wCurPartySpecies]
dec a
push af
@@ -1016,7 +1016,7 @@ GiveEgg: ; df92 (3:5f92)
ld d, $0
ld hl, wPokedexCaught
ld b, RESET_FLAG
- predef FlagPredef
+ predef SmallFarFlagAction
.asm_dfc9
pop bc
ld a, c
@@ -1028,7 +1028,7 @@ GiveEgg: ; df92 (3:5f92)
ld d, $0
ld hl, wPokedexSeen
ld b, RESET_FLAG
- predef FlagPredef
+ predef SmallFarFlagAction
.asm_dfdf
pop af
ld [wCurPartySpecies], a
@@ -1234,7 +1234,7 @@ ComputeNPCTrademonStats:
ld a, MON_STAT_EXP - 1
call GetPartyParamLocation
ld b, $1
- call CalcPkmnStats
+ call CalcMonStats
pop de
ld a, MON_HP
call GetPartyParamLocation
@@ -1245,7 +1245,7 @@ ComputeNPCTrademonStats:
ld [hl], a
ret
-CalcPkmnStats: ; e16d
+CalcMonStats: ; e16d
; Calculates all 6 Stats of a Pkmn
; b: Take into account stat EXP if TRUE
; 'c' counts from 1-6 and points with 'BaseStats' to the base value
@@ -1255,7 +1255,7 @@ CalcPkmnStats: ; e16d
ld c, $0
.loop
inc c
- call CalcPkmnStatC
+ call CalcMonStatC
ld a, [hMultiplicand + 1]
ld [de], a
inc de
@@ -1268,7 +1268,7 @@ CalcPkmnStats: ; e16d
ret
; e17b
-CalcPkmnStatC: ; e181
+CalcMonStatC: ; e181
; 'c' is 1-6 and points to the BaseStat
; 1: HP
; 2: Attack
@@ -1510,8 +1510,8 @@ GivePoke: ; Give a Pokemon from script
.asm_e2c9
ld a, [wCurPartySpecies]
ld [wTempEnemyMonSpecies], a
- callab LoadEnemyMon
- call SentPkmnIntoBox
+ callfar LoadEnemyMon
+ call SendMonIntoBox
jp nc, Functione3af
ld a, BOXMON
ld [wMonType], a
@@ -1596,7 +1596,7 @@ GivePoke: ; Give a Pokemon from script
jr .asm_e38d
.asm_e381
- callab Functionc7cd0
+ callfar Functionc7cd0
pop de
jr c, .asm_e38d
call InitNickname
@@ -1625,7 +1625,7 @@ Functione3af: ; e3af (3:63af)
ret
TextJump_WasSentToBillsPC:
- text_jump Text_WasSentToBillsPC
+ text_far Text_WasSentToBillsPC
db "@"
InitNickname: ; e3b9 (3:63b9)
@@ -1635,7 +1635,7 @@ InitNickname: ; e3b9 (3:63b9)
pop de
push de
ld b, $0
- callba NamingScreen
+ farcall NamingScreen
pop hl
ld de, wStringBuffer1
call InitName
diff --git a/engine/namingscreen.asm b/engine/namingscreen.asm
index 54147ee9..52cc06c7 100644
--- a/engine/namingscreen.asm
+++ b/engine/namingscreen.asm
@@ -95,7 +95,7 @@ Function11b2a:
inc de
hlcoord 5, 4
call PlaceString
- callba GetGender
+ farcall GetGender
jr c, .asm_11b68
ld a, "♂"
jr nz, .place_gender
@@ -290,14 +290,14 @@ Function11cd4: ; 11cd4 (4:5cd4)
bit 7, a
jr nz, .asm_11cef
call Function11d27
- callba AnimatedObjects_PlayFrameAndDelay
+ farcall AnimatedObjects_PlayFrameAndDelay
call Function11cff
call DelayFrame
and a
ret
.asm_11cef
- callab ClearAnimatedObjectBuffer
+ callfar ClearAnimatedObjectBuffer
call ClearSprites
xor a
ld [hSCX], a
@@ -817,7 +817,7 @@ Function11fde: ; 11fde (4:5fde)
Function1201e: ; 1201e (4:601e)
call ClearSprites
- callab ClearAnimatedObjectBuffer
+ callfar ClearAnimatedObjectBuffer
call Functiond9e
call LoadFontsExtra
ld de, NamingScreenGFX_MiddleLine ; $6232
@@ -1005,14 +1005,14 @@ Function1238d: ; 1238d (4:638d)
bit 7, a
jr nz, .asm_123a8
call Function123d5
- callba AnimatedObjects_PlayFrameAndDelay
+ farcall AnimatedObjects_PlayFrameAndDelay
call Function123b8
call DelayFrame
and a
ret
.asm_123a8
- callab ClearAnimatedObjectBuffer
+ callfar ClearAnimatedObjectBuffer
call ClearSprites
xor a
ld [hSCX], a
diff --git a/engine/overworld/map_objects.asm b/engine/overworld/map_objects.asm
index 2bf5fda2..593a1d75 100755
--- a/engine/overworld/map_objects.asm
+++ b/engine/overworld/map_objects.asm
@@ -605,7 +605,7 @@ Function554b: ; 554b (1:554b)
ret nc
ld d, h
ld e, l
- callba CopyTempObjectToObjectStruct
+ farcall CopyTempObjectToObjectStruct
ret
Function5558: ; 5558 (1:5558)
@@ -717,14 +717,14 @@ Function55ef: ; 55ef (1:55ef)
call Function5636
jr c, Function5613
call Function561b
- callba Function4441 ; same bank
+ farcall Function4441 ; same bank
xor a
ret
Function5606: ; 5606 (1:5606)
call Function5636
jr c, Function5613
- callba Function4441 ; same bank
+ farcall Function4441 ; same bank
xor a
ret
@@ -748,7 +748,7 @@ Function561b: ; 561b (1:561b)
ld hl, $e
add hl, bc
ld [hl], a
- callba UpdateGrassPriority ; same bank
+ farcall UpdateGrassPriority ; same bank
ret
Function5636: ; 5636 (1:5636)
@@ -931,7 +931,7 @@ Function5730:: ; 5730 (1:5730)
ld [wcf39], a
ld [wPlayerObjectStepFrame], a
call Function574f
- callba Function14a44
+ farcall Function14a44
call c, Function5770
call Function5761
ret
@@ -974,7 +974,7 @@ StartFollow::
ret c
ld a, c
call Function57a2
- callba QueueFollowerFirstStep
+ farcall QueueFollowerFirstStep
ret
Function578b: ; 578b (1:578b)
@@ -1015,7 +1015,7 @@ Function57bd: ; 57bd (1:57bd)
cp $ff
ret z
call GetObjectStruct
- callba Function5859 ; same bank
+ farcall Function5859 ; same bank
ld a, $ff
ld [wObjectFollow_Follower], a
ret
diff --git a/engine/overworld/player_movement.asm b/engine/overworld/player_movement.asm
index 1fdec4e2..8af7c726 100755
--- a/engine/overworld/player_movement.asm
+++ b/engine/overworld/player_movement.asm
@@ -576,7 +576,7 @@ Function10341: ; 10341 (4:4341)
add e
ld e, a
ld bc, wPlayerSprite
- callba Function7120
+ farcall Function7120
jr nc, .asm_10369
call Function1036f
jr c, .asm_1036c
diff --git a/engine/overworld/time.asm b/engine/overworld/time.asm
index 7ad065fc..ce847b18 100755
--- a/engine/overworld/time.asm
+++ b/engine/overworld/time.asm
@@ -148,7 +148,7 @@ CheckPokerusTick:
and a
jr z, .asm_118e6
ld b, a
- callba ApplyPokerusTick ; same bank
+ farcall ApplyPokerusTick ; same bank
.asm_118e6
xor a
ret
@@ -217,7 +217,7 @@ Function11934: ; 11934 (4:5934)
ld hl, wCurHPAnimMaxHP
call Function1182e
call CloseSRAM
- callba Function2a4f6
+ farcall Function2a4f6
.asm_1195e
ld a, BANK(sMysteryGiftTimer)
call OpenSRAM
diff --git a/engine/pack.asm b/engine/pack.asm
index b8e4725e..27db7cd2 100755
--- a/engine/pack.asm
+++ b/engine/pack.asm
@@ -115,12 +115,12 @@ Pack_InitTMHMPocket:
ret
Pack_TMHMPocketMenu:
- callba Pack_TMHMPocketMenu_
+ farcall Pack_TMHMPocketMenu_
ld b, $5
ld c, $1
call Function10cef
ret c
- callba CheckTossableItem_
+ farcall CheckTossableItem_
ld a, [wItemAttributeParamBuffer]
and a
jr nz, .asm_1053a
@@ -180,15 +180,15 @@ TMHMPocketSubmenuJumptable_Give:
dw QuitItemSubmenu
UseTMorHM:
- callba AskTeachTMHM
+ farcall AskTeachTMHM
ret c
- callba ChooseMonToLearnTMHM
+ farcall ChooseMonToLearnTMHM
jr c, .asm_105a9
ld hl, wOptions
ld a, [hl]
push af
res 4, [hl]
- callba TeachTMHM
+ farcall TeachTMHM
pop af
ld [wOptions], a
.asm_105a9
@@ -228,29 +228,29 @@ Pack_BallsPocketMenu:
ret
Function105f5: ; 105f5 (4:45f5)
- callba CheckTossableItem_
+ farcall CheckTossableItem_
ld a, [wItemAttributeParamBuffer]
and a
jr nz, .asm_10629
- callba CheckSelectableItem
+ farcall CheckSelectableItem
ld a, [wItemAttributeParamBuffer]
and a
jr nz, .asm_1061b
- callba CheckItemMenu
+ farcall CheckItemMenu
ld a, [wItemAttributeParamBuffer]
and a
jr nz, .asm_10637
jr .asm_10657
.asm_1061b
- callba CheckItemMenu
+ farcall CheckItemMenu
ld a, [wItemAttributeParamBuffer]
and a
jr nz, .asm_1063f
jr .asm_1065f
.asm_10629
- callba CheckSelectableItem
+ farcall CheckSelectableItem
ld a, [wItemAttributeParamBuffer]
and a
jr nz, .asm_10647
@@ -417,7 +417,7 @@ ItemSubmenuJumptable_GiveTossQuit:
dw QuitItemSubmenu
UseItem:
- callba CheckItemMenu
+ farcall CheckItemMenu
ld a, [wItemAttributeParamBuffer]
ld hl, .Jumptable
rst JumpTable
@@ -470,7 +470,7 @@ UseItem:
TossMenu:
ld hl, Text_ThrowAwayHowMany
call Function10cb9
- callba SelectQuantityToToss ; 9:4f20
+ farcall SelectQuantityToToss ; 9:4f20
push af
call ExitMenu
pop af
@@ -521,7 +521,7 @@ Function107cd:
ret
RegisterItem:
- callba CheckSelectableItem
+ farcall CheckSelectableItem
ld a, [wItemAttributeParamBuffer]
and a
jr nz, .asm_10826
@@ -560,16 +560,16 @@ GiveItem:
ld a, $8
ld [wPartyMenuActionText], a
call ClearBGPalettes
- callba LoadPartyMenuGFX
- callba InitPartyMenuWithCancel
- callba InitPartyMenuGFX
+ farcall LoadPartyMenuGFX
+ farcall InitPartyMenuWithCancel
+ farcall InitPartyMenuGFX
.asm_10857
- callba WritePartyMenuTilemap
- callba PrintPartyMenuText
+ farcall WritePartyMenuTilemap
+ farcall PrintPartyMenuText
call WaitBGMap
call SetPalettes
call DelayFrame
- callba PartyMenuSelect
+ farcall PartyMenuSelect
jr c, .asm_108a5
ld a, [wCurPartySpecies]
cp EGG
@@ -609,7 +609,7 @@ Function108b6: ; 108b6 (4:48b6)
ret
Text_AnEggCantHoldAnItem:
- text_jump Text_AnEGGCantHoldAnItem
+ text_far Text_AnEGGCantHoldAnItem
db "@"
QuitItemSubmenu:
@@ -733,7 +733,7 @@ BattlePack_InitTMHMPocket:
ret
BattlePack_TMHMPocketMenu:
- callba Pack_TMHMPocketMenu_ ; b:457a
+ farcall Pack_TMHMPocketMenu_ ; b:457a
ld b, $5
ld c, $1
call Function10cef
@@ -771,7 +771,7 @@ BattlePack_BallsPocketMenu:
ret
Function10a03: ; 10a03 (4:4a03)
- callba CheckItemContext
+ farcall CheckItemContext
ld a, [wItemAttributeParamBuffer]
Function10a0c: ; 10a0c (4:4a0c)
and a
@@ -828,7 +828,7 @@ BattlePackQuitJumptable:
dw BattlePack_QuitSubmenu
BattlePack_UseItem:
- callba CheckItemContext
+ farcall CheckItemContext
ld a, [wItemAttributeParamBuffer]
ld hl, $4a67
rst JumpTable
@@ -972,7 +972,7 @@ DepositOrSell_TMHMPocket:
ld a, $3
call Function10b92
call Function10cca
- callba Pack_TMHMPocketMenu_ ; b:457a
+ farcall Pack_TMHMPocketMenu_ ; b:457a
ld a, [wd002]
ld [wd002], a
ret
@@ -1058,7 +1058,7 @@ TutorialPack:
ld a, [wInputType]
or a
jr z, .asm_10bfa
- callba DudeAutoInput_RightA ; 70:4dee
+ farcall DudeAutoInput_RightA ; 70:4dee
.asm_10bfa
call Function10c07
call Function10b9f
@@ -1125,7 +1125,7 @@ TutorialTMHM:
ld a, $3
call Function10b92
call Function10cca
- callba Pack_TMHMPocketMenu_
+ farcall Pack_TMHMPocketMenu_
ld a, [wd002]
ld [wd002], a
ret
@@ -1278,7 +1278,7 @@ Function10cef: ; 10cef (4:4cef)
ret
.asm_10d3e
- callba SwitchItemsInBag ; 9:4834
+ farcall SwitchItemsInBag ; 9:4834
ld hl, Text_MoveItemWhere
call Function10cb9
scf
@@ -1295,7 +1295,7 @@ Function10cef: ; 10cef (4:4cef)
ret
.asm_10d58
- callba SwitchItemsInBag ; 9:4834
+ farcall SwitchItemsInBag ; 9:4834
ld de, SFX_SWITCH_POKEMON
call WaitPlaySFX
ld de, SFX_SWITCH_POKEMON
@@ -1335,7 +1335,7 @@ Function10d70: ; 10d70 (4:4d70)
call Function10dc0
hlcoord 0, 12
ld bc, IncGradGBPalTable_13
- call TextBox
+ call Textbox
call EnableLCD
call Function10ccd
ret
@@ -1525,47 +1525,47 @@ PC_Mart_BallsPocketMenuDataHeader:
dba UpdateItemDescription ; 9:43eb
Text_PackNoItems:
- text_jump Text_PackNoItems_
+ text_far Text_PackNoItems_
db "@"
Text_ThrowAwayHowMany:
- text_jump Text_ThrowAwayHowMany_
+ text_far Text_ThrowAwayHowMany_
db "@"
Text_ConfirmThrowAway:
- text_jump Text_ConfirmThrowAway_
+ text_far Text_ConfirmThrowAway_
db "@"
Text_ThrewAway:
- text_jump Text_ThrewAway_
+ text_far Text_ThrewAway_
db "@"
Text_ThisIsntTheTime:
- text_jump Text_ThisIsntTheTime_
+ text_far Text_ThisIsntTheTime_
db "@"
Text_YouDontHaveAPokemon:
- text_jump Text_YouDontHaveAMon
+ text_far Text_YouDontHaveAMon
db "@"
Text_RegisteredTheItem:
- text_jump Text_RegisteredTheItem_
+ text_far Text_RegisteredTheItem_
db "@"
Text_CantRegisterThatItem:
- text_jump Text_CantRegisterThatItem_
+ text_far Text_CantRegisterThatItem_
db "@"
Text_MoveItemWhere:
- text_jump Text_MoveItemWhere_
+ text_far Text_MoveItemWhere_
db "@"
Text_PackEmptyString:
- text_jump Text_PackEmptyString_
+ text_far Text_PackEmptyString_
db "@"
Text_CantUseItInABattle:
- text_jump Text_YouCantUseItInABattle
+ text_far Text_YouCantUseItInABattle
db "@"
PackMenuGFX: INCBIN "gfx/misc/pack_menu.2bpp"
diff --git a/engine/predef.asm b/engine/predef.asm
index 4e386f98..b0d0eb56 100755
--- a/engine/predef.asm
+++ b/engine/predef.asm
@@ -1,102 +1,28 @@
-GetPredefPointer:: ; 8b3b (2:4b3b)
+GetPredefPointer::
+; Return the bank and address of wPredefID in a and wPredefAddress.
+
+; Save hl for later (back in Predef)
ld a, h
- ld [wPredefHLBuffer], a
+ ld [wPredefTemp], a
ld a, l
- ld [wPredefHLBuffer + 1], a
+ ld [wPredefTemp + 1], a
+
push de
ld a, [wPredefID]
ld e, a
- ld d, $0
+ ld d, 0
ld hl, PredefPointers
add hl, de
add hl, de
add hl, de
pop de
+
ld a, [hli]
- ld [wPredefPointerBuffer + 1], a
+ ld [wPredefAddress + 1], a
ld a, [hli]
- ld [wPredefPointerBuffer], a
+ ld [wPredefAddress], a
ld a, [hl]
- ret
-PredefPointers::
-; temp macro
-predef_pointer: macro
-IF DEF(GOLD)
- dwb \1, \3
-ENDC
-IF DEF(SILVER)
- dwb \2, \3
-ENDC
-endm
+ ret
- add_predef LearnMove ; $0
- add_predef Predef1 ; $1
- add_predef HealParty
- add_predef FlagPredef
- add_predef ComputeHPBarPixels
- add_predef FillPP
- add_predef TryAddMonToParty
- add_predef AddTempmonToParty
- add_predef SentGetPkmnIntoFromBox
- add_predef SentPkmnIntoBox
- add_predef GiveEgg
- add_predef AnimateHPBar
- add_predef CalcPkmnStats
- add_predef CalcPkmnStatC
- add_predef CanLearnTMHMMove
- add_predef GetTMHMMove
- add_predef Predef_LinkTextbox ; $ 10
- add_predef PrintMoveDesc
- add_predef UpdatePlayerHUD
- add_predef PlaceGraphic
- add_predef CheckPlayerPartyForFitPkmn
- add_predef UpdateEnemyHUD
- add_predef StartBattle
- add_predef FillInExpBar
- add_predef GetMonBackpic ; $18
- add_predef GetMonFrontpic
- add_predef LearnLevelMoves
- add_predef FillMoves
- add_predef EvolveAfterBattle
- add_predef TradeAnimationPlayer2
- add_predef TradeAnimation
- add_predef CopyPkmnToTempMon
- add_predef ListMoves ; $20
- add_predef PlaceNonFaintStatus
- add_predef Predef22
- add_predef ListMovePP
- add_predef GetGender
- add_predef StatsScreenInit
- add_predef DrawPlayerHP
- add_predef DrawEnemyHP
- add_predef PrintTempMonStats ; $28
- add_predef GetTypeName
- add_predef PrintMoveType
- add_predef PrintType
- add_predef PrintMonTypes
- add_predef GetUnownLetter
- add_predef LoadPoisonBGPals
- add_predef Predef2F
- add_predef InitSGBBorder ; $30
- add_predef Predef_LoadSGBLayout
- add_predef Area_
- add_predef CheckContestMon
- add_predef Predef_StartBattle
- add_predef Predef35
- add_predef Predef36
- add_predef PlayBattleAnim
- add_predef Predef38 ; $38
- add_predef Predef39
- add_predef Predef3A
- add_predef PartyMonItemName
- add_predef GetFrontpic
- add_predef GetBackpic
- add_predef GetTrainerPic
- add_predef DecompressPredef
- add_predef CheckTypeMatchup ; $40
- add_predef ConvertMon_1to2
- add_predef NewPokedexEntry
- add_predef FrontpicPredef
- add_predef UpdateTimePredef
- dbw $ff, InexplicablyEmptyFunction
+INCLUDE "data/predef_pointers.asm" \ No newline at end of file
diff --git a/engine/sine.asm b/engine/sine.asm
index 4341e848..9a730219 100644
--- a/engine/sine.asm
+++ b/engine/sine.asm
@@ -37,4 +37,4 @@ Sine_e:: ; 8ac9 (2:4ac9)
ret
.SineWave:
- sine_wave $100
+ sine_table $100
diff --git a/engine/specials.asm b/engine/specials.asm
index b26b6bf1..aa8aefdd 100755
--- a/engine/specials.asm
+++ b/engine/specials.asm
@@ -157,7 +157,7 @@ GameCornerPrizeMonCheckDex: ; c38a
call FadeToMenu
ld a, [wScriptVar]
ld [wd151], a
- callba NewPokedexEntry
+ farcall NewPokedexEntry
call ExitAllMenus
ret
@@ -170,28 +170,28 @@ UnusedSetSeenMon: ; c3ac
FindPartyMonAboveLevel: ; c3b4
ld a, [wScriptVar]
ld b, a
- callba PartySearch_MaximumLevel ; same bank
+ farcall PartySearch_MaximumLevel ; same bank
jr z, asm_c3f2
jr asm_c3ec
FindPartyMonAtLeastThatHappy: ; c3c2
ld a, [wScriptVar]
ld b, a
- callba PartySearch_MinimumHappiness ; same bank
+ farcall PartySearch_MinimumHappiness ; same bank
jr z, asm_c3f2
jr asm_c3ec
FindPartyMonThatSpecies: ; c3d0
ld a, [wScriptVar]
ld b, a
- callba PartySearch_SameSpecies ; same bank
+ farcall PartySearch_SameSpecies ; same bank
jr z, asm_c3f2
jr asm_c3ec
FindPartyMonThatSpeciesYourTrainerID: ; c3de
ld a, [wScriptVar]
ld b, a
- callba PartySearch_SameSpeciesAndYourID ; same bank
+ farcall PartySearch_SameSpeciesAndYourID ; same bank
jr z, asm_c3f2
jr asm_c3ec
@@ -208,7 +208,7 @@ asm_c3f2
NameRival: ; c3f7
ld b, $2
ld de, wRivalName
- callba NamingScreen_
+ farcall NamingScreen_
ld hl, wRivalName
ld de, .DefaultName
call InitName
@@ -224,31 +224,31 @@ IF DEF(SILVER)
ENDC
NameRater:
- callba _NameRater
+ farcall _NameRater
ret
OverworldTownMap: ; c41a (3:441a)
call FadeToMenu
- callba Function9188a
+ farcall Function9188a
call ExitAllMenus
ret
UnownPrinter: ; c427 (3:4427)
call FadeToMenu
- callba Function16e3a
+ farcall Function16e3a
call ExitAllMenus
ret
DisplayLinkRecord: ; c434 (3:4434)
call FadeToMenu
- callba Function3f55d
+ farcall Function3f55d
call ExitAllMenus
ret
PlayersHousePC: ; c441 (3:4441)
xor a
ld [wScriptVar], a
- callba Function159b0
+ farcall Function159b0
ld a, c
ld [wScriptVar], a
ret
@@ -294,11 +294,11 @@ GetMysteryGiftItem: ; c463 (3:4463)
ret
ReceivedMysteryGiftText:
- text_jump ReceivedMysteryGiftText_
+ text_far ReceivedMysteryGiftText_
db "@"
BugContestJudging: ; c4a4 (3:44a4)
- callba Function13a5f
+ farcall Function13a5f
ld a, b
ld [wScriptVar], a
ret
@@ -306,12 +306,12 @@ BugContestJudging: ; c4a4 (3:44a4)
MapRadio: ; c4af (3:44af)
ld a, [wScriptVar]
ld e, a
- callba Function919c1
+ farcall Function919c1
ret
UnownPuzzle: ; c4ba (3:44ba)
call FadeToMenu
- callba Functione199d
+ farcall Functione199d
ld a, [wFieldMoveSucceeded]
ld [wScriptVar], a
call ExitAllMenus
@@ -380,11 +380,11 @@ Functionc508: ; c508 (3:4508)
ret
.NoCoinsText:
- text_jump NoCoinsText_
+ text_far NoCoinsText_
db "@"
.NoCoinCaseText:
- text_jump NoCoinCaseText_
+ text_far NoCoinCaseText_
db "@"
ClearBGPalettesBufferScreen: ; c535 (3:4535)
@@ -404,7 +404,7 @@ Functionc53c: ; c53c (3:453c)
ret
UnusedCheckUnusedTwoDayTimer: ; c549 (3:4549)
- callba Function118f8
+ farcall Function118f8
ld a, [wUnusedTwoDayTimer]
ld [wScriptVar], a
ret
@@ -440,17 +440,17 @@ Functionc56c:
ret
CheckPokerus: ; c588 (3:4588)
- callba Functionc7a40
+ farcall Functionc7a40
jp Functionc53c
ResetLuckyNumberShowFlag: ; c591 (3:4591)
- callba Function11917
+ farcall Function11917
ClearFlag ENGINE_LUCKY_NUMBER_SHOW
- callba LoadOrRegenerateLuckyIDNumber
+ farcall LoadOrRegenerateLuckyIDNumber
ret
CheckLuckyNumberShowFlag: ; c5a3 (3:45a3)
- callba Function1192e
+ farcall Function1192e
jp Functionc53c
CountUnown: ; c5ac (3:45ac)
@@ -467,7 +467,7 @@ CountUnown: ; c5ac (3:45ac)
ret
SelectApricornForKurt: ; c5bb (3:45bb)
- callba Function24b8d
+ farcall Function24b8d
ld a, c
ld [wScriptVar], a
and a
@@ -547,20 +547,20 @@ FadeOutMusic: ; c628 (3:4628)
ld a, $0
ld [wMusicFadeID], a
ld a, $0
- ld [wMusicFadeIDHi], a
+ ld [wMusicFadeID + 1], a
ld a, $2
ld [wMusicFade], a
ret
Diploma: ; c638 (3:4638)
call FadeToMenu
- callba Functione0002
+ farcall Functione0002
call ExitAllMenus
ret
PrintDiploma: ; c645 (3:4645)
call FadeToMenu
- callba Function84684
+ farcall Function84684
call ExitAllMenus
ret
diff --git a/engine/sprites_dump.asm b/engine/sprites_dump.asm
deleted file mode 100755
index e69de29b..00000000
--- a/engine/sprites_dump.asm
+++ /dev/null
diff --git a/engine/step_types.asm b/engine/step_types.asm
index 98ae1964..91858f98 100755
--- a/engine/step_types.asm
+++ b/engine/step_types.asm
@@ -560,7 +560,7 @@ Function4ea4: ; 4ea4 (1:4ea4)
add hl, bc
ld a, [hl]
ld b, a
- callba CopyDECoordsToMapObject
+ farcall CopyDECoordsToMapObject
pop bc
ld hl, $5
add hl, bc
diff --git a/engine/title.asm b/engine/title.asm
index 4e9a2d3a..8427dfc9 100755
--- a/engine/title.asm
+++ b/engine/title.asm
@@ -1,7 +1,7 @@
IntroSequence: ; 6241 (1:6241)
- callab Copyright_GFPresents
+ callfar Copyright_GFPresents
jr c, StartTitleScreen
- callab GoldSilverIntro
+ callfar GoldSilverIntro
StartTitleScreen:
call InitTitleScreen
call DelayFrame
@@ -58,7 +58,7 @@ InitTitleScreen: ; 6291 (1:6291)
ld bc, $2000
xor a
call ByteFill
- callba ClearAnimatedObjectBuffer
+ farcall ClearAnimatedObjectBuffer
ld hl, TitleScreenGFX1
ld de, $9000
@@ -237,7 +237,7 @@ TitleScreenFrame: ; 63da (1:63da)
call Function640f
ld a, $1
ld [hOAMUpdate], a
- callba AnimatedObjects_PlayFrame
+ farcall AnimatedObjects_PlayFrame
xor a
ld [hOAMUpdate], a
call Function64b1
@@ -341,8 +341,8 @@ Function6434:
ld hl, wce63
inc [hl]
xor a
- ld [wMusicFadeIDLo], a
- ld [wMusicFadeIDHi], a
+ ld [wMusicFadeID], a
+ ld [wMusicFadeID + 1], a
ld hl, wMusicFade
ld [hl], $8
ld hl, wce65
@@ -369,11 +369,11 @@ Function648b:
ret
DeleteSaveData:
- callba DeleteSaveData_
+ farcall DeleteSaveData_
jp Init
ResetClock:
- callba ResetClock_
+ farcall ResetClock_
jp Init
Function64b1: ; 64b1 (1:64b1)
diff --git a/gfx/overworld/heal_machine.pal b/gfx/overworld/heal_machine.pal
new file mode 100755
index 00000000..9a32250d
--- /dev/null
+++ b/gfx/overworld/heal_machine.pal
@@ -0,0 +1,4 @@
+ RGB 31, 31, 31
+ RGB 21, 21, 21
+ RGB 10, 10, 10
+ RGB 00, 00, 00
diff --git a/gfx/overworld/heal_machine.png b/gfx/overworld/heal_machine.png
new file mode 100755
index 00000000..dbf51348
--- /dev/null
+++ b/gfx/overworld/heal_machine.png
Binary files differ
diff --git a/home.asm b/home.asm
index 9d4722d2..a76992d3 100644
--- a/home.asm
+++ b/home.asm
@@ -1,4 +1,5 @@
-INCLUDE "includes.asm"
+INCLUDE "contents.asm"
+INCLUDE "constants.asm"
; rst vectors
INCLUDE "home/rst.asm"
@@ -160,7 +161,7 @@ Function2ffe:: ; 2ffe (0:2ffe)
push de
push bc
ld d, $0
- predef FlagPredef
+ predef SmallFarFlagAction
pop bc
pop de
.next
@@ -270,7 +271,7 @@ Function31e2:: ; 31e2 (0:31e2)
ld a, [wOptions]
bit 4, a
ret nz
- ld a, [wTextBoxFlags]
+ ld a, [wTextboxFlags]
bit 1, a
ret z
push hl
@@ -280,7 +281,7 @@ Function31e2:: ; 31e2 (0:31e2)
ld a, [hl]
push af
ld [hl], a
- ld a, [wTextBoxFlags]
+ ld a, [wTextboxFlags]
bit 0, a
jr z, .asm_3205
ld a, [wOptions]
@@ -729,7 +730,7 @@ Function3456:: ; 3456 (0:3456)
call DelayFrames
ret
-CheckCGB::
+IsCGB::
ld a, [hCGB]
and a
ret
@@ -873,7 +874,7 @@ GetSGBLayout:: ; 3583 (0:3583)
and a
ret z
.asm_358c
- predef_jump Predef_LoadSGBLayout
+ predef_jump LoadSGBLayout
SetHPPal::
call GetHPPal
@@ -1082,7 +1083,7 @@ GetTMHMName:: ; 36cc (0:36cc)
push de
ld a, [wd151]
ld c, a
- callab GetTMHMNumber
+ callfar GetTMHMNumber
pop de
pop af
ld a, c
@@ -1184,7 +1185,7 @@ DrawScrollingMenu::
push de
call Coord2Tile
pop bc
- jp TextBox
+ jp Textbox
ScrollingMenuJoyTextDelay::
call DelayFrame
@@ -1230,7 +1231,7 @@ StoneQueueWarpAction:: ; 37b9 (0:37b9)
call IsThisObjectInTheStoneTable
jr nc, .asm_37dc
call CallMapScript
- callba EnableScriptMode
+ farcall EnableScriptMode
scf
ret
@@ -1610,7 +1611,7 @@ PrepMonFrontpic_::
.egg
push hl
ld de, $9000
- predef GetFrontpic
+ predef GetMonFrontpic
pop hl
xor a
ld [hGraphicStartTile], a
@@ -1715,7 +1716,7 @@ GetNick::
ld bc, $b
call CopyBytes
pop de
- callab CheckNickErrors
+ callfar CheckNickErrors
pop bc
pop hl
ret
diff --git a/home/battle.asm b/home/battle.asm
index d7d56dda..a29db60f 100644
--- a/home/battle.asm
+++ b/home/battle.asm
@@ -101,8 +101,8 @@ RefreshBattleHuds::
jp WaitBGMap
UpdateBattleHuds:: ; 3bf8 (0:3bf8)
- callba UpdatePlayerHUD
- callba UpdateEnemyHUD
+ farcall UpdatePlayerHUD
+ farcall UpdateEnemyHUD
ret
GetBattleVar::
diff --git a/home/copy.asm b/home/copy.asm
index a3017fd4..50f25e15 100644
--- a/home/copy.asm
+++ b/home/copy.asm
@@ -25,19 +25,19 @@ Functiond70:: ; d70 (0:0d70)
ret
ReplacePlayerSprite::
- callba Function1413c
+ farcall Function1413c
ret
Functiond9e::
- callba Functionf8000
+ farcall Functionf8000
ret
Functionda5::
- callba Functionf8032
+ farcall Functionf8032
ret
LoadFontsExtra::
- callba Functionf800c
+ farcall Functionf800c
ret
DecompressRequest2bpp::
diff --git a/home/flag.asm b/home/flag.asm
index 8f01d8ef..2b455439 100644
--- a/home/flag.asm
+++ b/home/flag.asm
@@ -99,7 +99,7 @@ FlagAction:: ; 2f36 (0:2f36)
CheckReceivedDex::
ld de, ENGINE_POKEDEX
ld b, CHECK_FLAG
- callba EngineFlagAction
+ farcall EngineFlagAction
ld a, c
and a
ret
diff --git a/home/init.asm b/home/init.asm
index cf5c18c9..747d7817 100644
--- a/home/init.asm
+++ b/home/init.asm
@@ -47,7 +47,7 @@ Init:: ; 5d1 (0:05d1)
ld [rLCDC], a
; Clear WRAM
- ld hl, wc000
+ ld hl, wMusicPlaying
ld bc, $2000
.ByteFill
ld [hl], $0
@@ -101,14 +101,14 @@ Init:: ; 5d1 (0:05d1)
ld h, $9c
call BlankBGMap
- callab InitCGBPals
+ callfar InitCGBPals
ld a, $9c
ld [hBGMapAddress + 1], a
xor a
ld [hBGMapAddress], a
- callba StartClock
+ farcall StartClock
ld a, SRAM_ENABLE
ld [MBC3SRamEnable], a
diff --git a/home/item.asm b/home/item.asm
index bee5f678..abad27f2 100644
--- a/home/item.asm
+++ b/home/item.asm
@@ -1,12 +1,12 @@
DoItemEffect::
- callba DoItemEffect_
+ farcall DoItemEffect_
ret
CheckTossableItem::
push hl
push de
push bc
- callba CheckTossableItem_
+ farcall CheckTossableItem_
pop bc
pop de
pop hl
diff --git a/home/joypad.asm b/home/joypad.asm
index 3f3a0b43..4f629a9f 100644
--- a/home/joypad.asm
+++ b/home/joypad.asm
@@ -289,7 +289,7 @@ JoyWaitInput:: ; a77 (0:0a77)
ld a, [wInputType]
or a
jr z, .wait_loop
- callba DudeAutoInput_A
+ farcall DudeAutoInput_A
.wait_loop
call JoyBlinkCursor
@@ -318,7 +318,7 @@ JoyBlinkCursor:: ; aa6 (0:0aa6)
.cursor_off
ld a, "─"
.load_cursor_state
- Coorda 18, 17
+ ldcoord_a 18, 17
ret
BlinkCursor:: ; ab6 (0:0ab6)
diff --git a/home/map.asm b/home/map.asm
index ea4b5a26..2766878b 100644
--- a/home/map.asm
+++ b/home/map.asm
@@ -187,7 +187,7 @@ endr
ReturnToMapFromSubmenu::
ld a, $fa
ld [hMapEntryMethod], a
- callba RunMapSetupScript
+ farcall RunMapSetupScript
xor a
ld [hMapEntryMethod], a
ret
@@ -200,7 +200,7 @@ Function2086::
call ResetBikeFlags
ld a, $5
call RunMapCallback
- callba Function97c2a
+ farcall Function97c2a
ld a, $3
call RunMapCallback
call GetMapHeaderTimeOfDayNybble
@@ -210,8 +210,8 @@ Function2086::
Function20ac::
ld a, $1
ld [wRTCEnabled], a
- callba Function8c3e9
- callba UpdateTimeOfDayPal
+ farcall Function8c3e9
+ farcall UpdateTimeOfDayPal
call OverworldTextModeSwitch
call Function20c7
call Function20e6
@@ -224,7 +224,7 @@ Function20c7:: ; 20c7 (0:20c7)
ld [wd05b], a
ld [hSCY], a
ld [hSCX], a
- callba ApplyBGMapAnchorToObjects
+ farcall ApplyBGMapAnchorToObjects
ld a, $60
ld bc, $400
ld hl, $9800
@@ -268,7 +268,7 @@ Function2112::
ld [hMapAnims], a
xor a
ld [hTileAnimFrame], a
- callba Function1416d
+ farcall Function1416d
call LoadFontsExtra
ret
@@ -280,8 +280,8 @@ Function212d::
call ClearSprites
call ResetBGWindow
call GetMovementPermissions
- callba Function5730
- callba Function15612
+ farcall Function5730
+ farcall Function15612
ld hl, wd182
bit 6, [hl]
jr nz, .asm_2151
@@ -484,7 +484,7 @@ Function2293::
call Function22ad
ret nc
push bc
- callba Function14a2d
+ farcall Function14a2d
pop bc
ret nc
call Function2302
@@ -498,7 +498,7 @@ Function22a5::
ret
Function22ad:: ; 22ad (0:22ad)
- callba Function14a18
+ farcall Function14a18
ret nc
ld a, [hROMBank]
push af
@@ -1304,15 +1304,15 @@ FindCallback:: ; 277c (0:277c)
ret
ExecuteCallbackScript:: ; 279d (0:279d)
- callba CallCallback
+ farcall CallCallback
ld a, [wd15e]
push af
ld hl, wd15b
ld a, [hl]
push af
set 1, [hl]
- callba EnableScriptMode
- callba ScriptEvents
+ farcall EnableScriptMode
+ farcall ScriptEvents
pop af
ld [wd15b], a
pop af
@@ -1324,10 +1324,10 @@ MapTextbox::
push af
ld a, b
rst Bankswitch
- call SetUpTextBox
+ call SetUpTextbox
ld a, $1
ld [hOAMUpdate], a
- call PrintTextBoxText
+ call PrintTextboxText
xor a
ld [hOAMUpdate], a
pop af
@@ -1389,21 +1389,21 @@ ObjectEvent::
jumptextfaceplayer ObjectEventText
ObjectEventText::
- text_jump _ObjectEventText
+ text_far _ObjectEventText
db "@"
BGEvent::
jumptext BGEventText
BGEventText::
- text_jump BGEventText_
+ text_far BGEventText_
db "@"
CoordinatesEvent::
jumptext CoordinatesEventText
CoordinatesEventText::
- text_jump CoordinatesEventText_
+ text_far CoordinatesEventText_
db "@"
CheckObjectMask::
@@ -1616,7 +1616,7 @@ LoadTileset:: ; 2944 (0:2944)
jr .asm_2966
.asm_2960
- callba LoadMapGroupRoof
+ farcall LoadMapGroupRoof
.asm_2966
xor a
ld [hTileAnimFrame], a
@@ -2098,7 +2098,7 @@ FadeToMenu::
xor a
ld [hBGMapMode], a
call LoadStandardMenuDataHeader
- callba FadeOutPalettes
+ farcall FadeOutPalettes
call ClearSprites
call DisableSpriteUpdates
ret
@@ -2121,7 +2121,7 @@ FinishExitMenu::
ld b, $9
call GetSGBLayout
call Function3456
- callba FadeInPalettes
+ farcall FadeInPalettes
call EnableSpriteUpdates
ret
@@ -2134,7 +2134,7 @@ ReturnToMapWithSpeechTextbox::
call ReloadTilesetAndPalettes
hlcoord 0, 12
lb bc, 4, 18
- call TextBox
+ call Textbox
ld hl, wVramState
set 0, [hl]
call UpdateSprites
@@ -2151,7 +2151,7 @@ ReturnToMapWithSpeechTextbox::
ReloadTilesetAndPalettes:: ; 2c87 (0:2c87)
call DisableLCD
call ClearSprites
- callba RefreshSprites
+ farcall RefreshSprites
call Functiond9e
call LoadFontsExtra
ld a, [hROMBank]
@@ -2161,7 +2161,7 @@ ReloadTilesetAndPalettes:: ; 2c87 (0:2c87)
ld a, [wMapNumber]
ld c, a
call SwitchToAnyMapBank
- callba UpdateTimeOfDayPal
+ farcall UpdateTimeOfDayPal
call OverworldTextModeSwitch
call LoadTileset
ld a, $8
diff --git a/home/map_objects.asm b/home/map_objects.asm
index 94fe60f4..8742ed5e 100644
--- a/home/map_objects.asm
+++ b/home/map_objects.asm
@@ -3,7 +3,7 @@ GetSpritePalette:: ; 169c
push de
push bc
ld c, a
- callba GetSpritePalette_
+ farcall GetSpritePalette_
ld a, c
pop bc
pop de
@@ -292,7 +292,7 @@ CopyObjectStruct::
call UnmaskObject
ld a, [hConnectionStripLength]
call GetMapObject
- callba CopyObjectStruct_
+ farcall CopyObjectStruct_
ret
ApplyDeletionToMapObject:: ; 1804 (0:1804)
@@ -308,7 +308,7 @@ ApplyDeletionToMapObject:: ; 1804 (0:1804)
call DeleteOject_CheckStopFollow
pop af
call GetObjectStruct
- callba DeleteMapObject
+ farcall DeleteMapObject
ret
DeleteOject_CheckStopFollow:: ; 1822 (0:1822)
@@ -319,7 +319,7 @@ DeleteOject_CheckStopFollow:: ; 1822 (0:1822)
cp [hl]
ret nz
.asm_182d
- callba StopFollow
+ farcall StopFollow
ld a, $ff
ld [wObjectFollow_Leader], a
ld [wObjectFollow_Follower], a
@@ -368,7 +368,7 @@ Function1855::
.asm_187b
ld a, b
call GetObjectStruct
- callba DeleteMapObject
+ farcall DeleteMapObject
ret
LoadMovementDataPointer::
@@ -556,8 +556,8 @@ UpdateSprites:: ; 196f (0:196f)
ld a, [wVramState]
bit 0, a
ret z
- callba Function557f
- callba UpdateSprites_
+ farcall Function557f
+ farcall UpdateSprites_
ret
GetObjectStruct:: ; 1982 (0:1982)
diff --git a/home/math.asm b/home/math.asm
index 1be69c33..ffa3c282 100644
--- a/home/math.asm
+++ b/home/math.asm
@@ -44,7 +44,7 @@ Multiply::
push hl
push bc
- callab Multiply_ ; 1:67bd
+ callfar Multiply_ ; 1:67bd
pop bc
pop hl
diff --git a/home/pokedex_flags.asm b/home/pokedex_flags.asm
index 39bdd48f..424fee13 100644
--- a/home/pokedex_flags.asm
+++ b/home/pokedex_flags.asm
@@ -23,7 +23,7 @@ CheckSeenMon::
ld b, CHECK_FLAG
PokedexFlagAction:: ; 35e4 (0:35e4)
ld d, 0
- predef FlagPredef
+ predef SmallFarFlagAction
ld a, c
and a
ret
diff --git a/home/predef.asm b/home/predef.asm
index 6b478b56..2796cb67 100644
--- a/home/predef.asm
+++ b/home/predef.asm
@@ -1,34 +1,52 @@
-Predef:: ; 2e49 (0:2e49)
+Predef::
+; Call predefined function a.
+; Preserves bc, de, hl and f.
+
ld [wPredefID], a
- ld a, [hROMBank]
+ ldh a, [hROMBank]
push af
+
ld a, BANK(GetPredefPointer)
rst Bankswitch
- call GetPredefPointer
+ call GetPredefPointer ; stores hl in wPredefTemp
+
+; Switch to the new function's bank
rst Bankswitch
- ld hl, .return
+
+; Instead of directly calling stuff,
+; push it to the stack in reverse.
+
+ ld hl, .Return
push hl
- ld a, [wPredefPointerBuffer]
+
+; Call the Predef function
+ ld a, [wPredefAddress]
ld h, a
- ld a, [wPredefPointerBuffer + 1]
+ ld a, [wPredefAddress + 1]
ld l, a
push hl
- ld a, [wPredefHLBuffer]
+
+; Get hl back
+ ld a, [wPredefTemp]
ld h, a
- ld a, [wPredefHLBuffer + 1]
+ ld a, [wPredefTemp + 1]
ld l, a
ret
-.return
+.Return:
+; Clean up after the Predef call
+
ld a, h
- ld [wPredefHLBuffer], a
+ ld [wPredefTemp], a
ld a, l
- ld [wPredefHLBuffer + 1], a
+ ld [wPredefTemp + 1], a
+
pop hl
ld a, h
rst Bankswitch
- ld a, [wPredefHLBuffer]
+
+ ld a, [wPredefTemp]
ld h, a
- ld a, [wPredefHLBuffer + 1]
+ ld a, [wPredefTemp + 1]
ld l, a
- ret
+ ret \ No newline at end of file
diff --git a/home/random.asm b/home/random.asm
index f96718b2..3c2972af 100644
--- a/home/random.asm
+++ b/home/random.asm
@@ -19,10 +19,10 @@ BattleRandom::
ld a, BANK(BattleRandom_)
rst Bankswitch
call BattleRandom_
- ld [wPredefHLBuffer + 1], a
+ ld [wPredefTemp + 1], a
pop af
rst Bankswitch
- ld a, [wPredefHLBuffer + 1]
+ ld a, [wPredefTemp + 1]
ret
RandomRange::
diff --git a/home/rtc.asm b/home/rtc.asm
index ca014e46..afe9028e 100644
--- a/home/rtc.asm
+++ b/home/rtc.asm
@@ -14,9 +14,9 @@ RTC:: ; 343
ret z
TimeOfDayPals:: ; 352
- callab _TimeOfDayPals
+ callfar _TimeOfDayPals
ret
UpdateTimePals:: ; 359
- callab _UpdateTimePals
+ callfar _UpdateTimePals
ret
diff --git a/home/serial.asm b/home/serial.asm
index 645f531f..c57d77ee 100644
--- a/home/serial.asm
+++ b/home/serial.asm
@@ -256,13 +256,13 @@ Function7ec:: ; 7ec
Function813:: ; 813
call BackUpTilesToBuffer
- callab PlaceWaitingText
+ callfar PlaceWaitingText
call WaitLinkTransfer
jp ReloadTilesFromBuffer
Function822:: ; 822
call BackUpTilesToBuffer
- callab PlaceWaitingText
+ callfar PlaceWaitingText
jp WaitLinkTransfer
; One "giant" leap for machinekind
diff --git a/home/text.asm b/home/text.asm
index 994cc7e5..a1bc5b08 100644
--- a/home/text.asm
+++ b/home/text.asm
@@ -35,20 +35,20 @@ FillScreenWithTextboxPal::
call ByteFill
jr ClearTileMap
-TextBox:: ; eef (0:0eef)
+Textbox:: ; eef (0:0eef)
push bc
push hl
- call TextBoxBorder
+ call TextboxBorder
pop hl
pop bc
- jr TextBoxPalette
+ jr TextboxPalette
-TextBoxBorder:: ; ef8 (0:0ef8)
+TextboxBorder:: ; ef8 (0:0ef8)
push hl
ld a, "┌"
ld [hli], a
inc a
- call TextBoxBorder_PlaceTiles
+ call TextboxBorder_PlaceTiles
inc a
ld [hl], a
pop hl
@@ -61,7 +61,7 @@ TextBoxBorder:: ; ef8 (0:0ef8)
ld a, "│"
ld [hli], a
ld a, " "
- call TextBoxBorder_PlaceTiles
+ call TextboxBorder_PlaceTiles
ld [hl], "│"
pop hl
@@ -74,11 +74,11 @@ TextBoxBorder:: ; ef8 (0:0ef8)
ld a, "└"
ld [hli], a
ld a, "─"
- call TextBoxBorder_PlaceTiles
+ call TextboxBorder_PlaceTiles
ld [hl], "┘"
ret
-TextBoxBorder_PlaceTiles:: ; f25 (0:0f25)
+TextboxBorder_PlaceTiles:: ; f25 (0:0f25)
ld d, c
.loop
ld [hli], a
@@ -86,7 +86,7 @@ TextBoxBorder_PlaceTiles:: ; f25 (0:0f25)
jr nz, .loop
ret
-TextBoxPalette
+TextboxPalette
ld de, wAttrMap - wTileMap
add hl, de
inc b
@@ -109,11 +109,11 @@ TextBoxPalette
jr nz, .col
ret
-SpeechTextBox:: ; f45 (0:0f45)
+SpeechTextbox:: ; f45 (0:0f45)
hlcoord TEXTBOX_X, TEXTBOX_Y
ld b, TEXTBOX_INNERH
ld c, TEXTBOX_INNERW
- jp TextBox
+ jp Textbox
TestText::
text "ゲームフりーク!"
@@ -126,15 +126,15 @@ RadioTerminator:: ; 1052
.stop db "@"
PrintText::
- call SetUpTextBox
-PrintTextBoxText::
+ call SetUpTextbox
+PrintTextboxText::
bccoord TEXTBOX_INNERX, TEXTBOX_INNERY
call PlaceHLTextAtBC
ret
-SetUpTextBox:: ; f68 (0:0f68)
+SetUpTextbox:: ; f68 (0:0f68)
push hl
- call SpeechTextBox
+ call SpeechTextbox
call UpdateSprites
call ApplyTilemap
pop hl
@@ -315,7 +315,7 @@ PlaceEnemysName:: ; 10fb (0:10fb)
call PlaceString
push bc
- callab Battle_GetTrainerName
+ callfar Battle_GetTrainerName
pop hl
ld de, wStringBuffer1
@@ -483,7 +483,7 @@ NullChar:: ; 120c (0:120c)
ret
.ErrorText
- deciram hObjectStructIndexBuffer, 1, 2
+ text_decimal hObjectStructIndexBuffer, 1, 2
text "エラー"
done
@@ -525,12 +525,12 @@ Diacritic:: ; 124a (0:124a)
LoadBlinkingCursor:: ; 1255 (0:1255)
ld a, "▼"
- Coorda 18, 17
+ ldcoord_a 18, 17
ret
UnloadBlinkingCursor:: ; 125b (0:125b)
ld a, "─"
- Coorda 18, 17
+ ldcoord_a 18, 17
ret
FarString::
@@ -551,15 +551,15 @@ PokeFluteTerminatorCharacter::
.stop db "@"
PlaceHLTextAtBC:: ; 1272 (0:1272)
- ld a, [wTextBoxFlags]
+ ld a, [wTextboxFlags]
push af
set 1, a
- ld [wTextBoxFlags], a
+ ld [wTextboxFlags], a
call DoTextUntilTerminator
pop af
- ld [wTextBoxFlags], a
+ ld [wTextboxFlags], a
ret
DoTextUntilTerminator:: ; 1283 (0:1283)
@@ -690,7 +690,7 @@ Text_TX_BOX:: ; 1318 (0:1318)
push hl
ld h, d
ld l, e
- call TextBox
+ call Textbox
pop hl
ret
@@ -802,14 +802,14 @@ Text_TX_CRY
pop bc
ret
-TextSFX:: ; 13ad (0:13ad)
- dbw TX_SOUND_0B, SFX_DEX_FANFARE_50_79
- dbw TX_SOUND_12, SFX_FANFARE
- dbw TX_SOUND_0E, SFX_DEX_FANFARE_20_49
- dbw TX_SOUND_0F, SFX_ITEM
- dbw TX_SOUND_10, SFX_CAUGHT_MON
- dbw TX_SOUND_11, SFX_DEX_FANFARE_80_109
- dbw TX_SOUND_13, SFX_SLOT_MACHINE_START
+TextSFX::
+ dbw TX_SOUND_DEX_FANFARE_50_79, SFX_DEX_FANFARE_50_79
+ dbw TX_SOUND_FANFARE, SFX_FANFARE
+ dbw TX_SOUND_DEX_FANFARE_20_49, SFX_DEX_FANFARE_20_49
+ dbw TX_SOUND_ITEM, SFX_ITEM
+ dbw TX_SOUND_CAUGHT_MON, SFX_CAUGHT_MON
+ dbw TX_SOUND_DEX_FANFARE_80_109, SFX_DEX_FANFARE_80_109
+ dbw TX_SOUND_SLOT_MACHINE_START, SFX_SLOT_MACHINE_START
db -1
Text_TX_DOTS:: ; 13c3 (0:13c3)
diff --git a/home/tilemap.asm b/home/tilemap.asm
index 9b2a41da..4cccbb61 100644..100755
--- a/home/tilemap.asm
+++ b/home/tilemap.asm
@@ -21,12 +21,12 @@ SetMenuAttributes:: ; 1a4e
ret
StaticMenuJoypad:: ; 1a66 (0:1a66)
- callab StaticMenuJoypad_
+ callfar StaticMenuJoypad_
call GetMenuJoypad
ret
ScrollingMenuJoypad:: ; 1a70 (0:1a70)
- callab ScrollingMenuJoypad_
+ callfar ScrollingMenuJoypad_
call GetMenuJoypad
ret
@@ -62,17 +62,17 @@ HideCursor::
ret
PushWindow:: ; 1a9d (0:1a9d)
- callab PushWindow_
+ callfar PushWindow_
ret
ExitMenu:: ; 1aa4 (0:1aa4)
push af
- callab ExitMenu_
+ callfar ExitMenu_
pop af
ret
InitVerticalMenuCursor:: ; 1aad (0:1aad)
- callab InitVerticalMenuCursor_
+ callfar InitVerticalMenuCursor_
ret
CloseWindow:: ; 1ab4 (0:1ab4)
@@ -195,7 +195,7 @@ MenuBox:: ; 1b4e (0:1b4e)
call GetMenuBoxDims
dec b
dec c
- jp TextBox
+ jp Textbox
GetMenuTextStartCoord:: ; 1b59 (0:1b59)
ld a, [wMenuBorderTopCoord]
diff --git a/home/time.asm b/home/time.asm
index fc5cf13d..8acc72d9 100644
--- a/home/time.asm
+++ b/home/time.asm
@@ -12,7 +12,7 @@ UpdateTime:: ; 467 (0:0467)
call GetClock
call FixDays
call FixTime
- callba Function14032
+ farcall Function14032
ret
GetClock:: ; 477 (0:0477)
@@ -136,7 +136,7 @@ SetDayOfWeek::
jr InitTime
InitTime::
- callba Function140ff
+ farcall Function140ff
ret
PanicResetClock::
diff --git a/home/window.asm b/home/window.asm
index d7f1d9df..67326091 100644
--- a/home/window.asm
+++ b/home/window.asm
@@ -32,7 +32,7 @@ CloseText
call SafeUpdateSprites
ld a, $90
ld [hWY], a
- callba Function1415c
+ farcall Function1415c
call ReplacePlayerSprite
ld hl, wd565
res 7, [hl]
@@ -46,7 +46,7 @@ OpenText::
ld a, BANK(ReanchorBGMap_NoOAMUpdate) ; and BANK(LoadFonts_NoOAMUpdate)
rst Bankswitch
call ReanchorBGMap_NoOAMUpdate
- call SpeechTextBox
+ call SpeechTextbox
call _OpenAndCloseMenu_HDMATransferTileMapAndAttrMap
call LoadFonts_NoOAMUpdate
pop af
diff --git a/includes.asm b/includes.asm
deleted file mode 100644
index 456623d9..00000000
--- a/includes.asm
+++ /dev/null
@@ -1,2 +0,0 @@
-INCLUDE "contents.asm"
-INCLUDE "constants.asm"
diff --git a/items/item_effects.asm b/items/item_effects.asm
index 51523d62..7689720b 100755
--- a/items/item_effects.asm
+++ b/items/item_effects.asm
@@ -345,7 +345,7 @@ UltraBall: ; e926
ld d, a
push de
- ; BUG: callba overwrites a,
+ ; BUG: farcall overwrites a,
; and GetItemHeldEffect takes b anyway.
; This is probably the reason
@@ -356,7 +356,7 @@ UltraBall: ; e926
ld a, [wBattleMonItem]
; ld b, a
- callba GetItemHeldEffect ; d:7e9b
+ farcall GetItemHeldEffect ; d:7e9b
ld a, b
cp HELD_CATCH_CHANCE
pop de
@@ -450,7 +450,7 @@ UltraBall: ; e926
ld [wCurPartySpecies], a
ld a, [wEnemyMonLevel]
ld [wCurPartyLevel], a
- callba LoadEnemyMon
+ farcall LoadEnemyMon
pop af
ld [wEnemySubStatus5], a
pop hl
@@ -546,7 +546,7 @@ UltraBall: ; e926
xor a
ld [wMonType], a
ld b, $0
- callba NamingScreen
+ farcall NamingScreen
call RotateThreePalettesRight
call Functiond9e
pop hl
@@ -556,7 +556,7 @@ UltraBall: ; e926
.send_mon_to_pc
call ClearSprites
- predef SentPkmnIntoBox
+ predef SendMonIntoBox
ld a, BANK(sBoxCount)
call OpenSRAM
ld a, [sBoxCount]
@@ -585,7 +585,7 @@ UltraBall: ; e926
ld [wMonType], a
ld de, wMonOrItemNameBuffer
ld b, $0
- callba NamingScreen
+ farcall NamingScreen
ld a, $1
call OpenSRAM
ld hl, wMonOrItemNameBuffer
@@ -611,7 +611,7 @@ UltraBall: ; e926
jr .end_ball_function
.catch_bug_contest_mon
- callba BugContest_SetCaughtContestMon ; same bank
+ farcall BugContest_SetCaughtContestMon ; same bank
jr .end_ball_function
.finish_tutorial
@@ -842,7 +842,7 @@ LoveBallMultiplier:
ld [wMonType], a
ld a, [wCurBattleMon]
ld [wCurPartyMon], a
- callba GetGender ; 14:52f1
+ farcall GetGender ; 14:52f1
jr c, .asm_edba
ld d, $0
jr nz, .asm_ed8d
@@ -853,7 +853,7 @@ LoveBallMultiplier:
ld [wCurPartySpecies], a
ld a, $4
ld [wMonType], a
- callba GetGender ; 14:52f1
+ farcall GetGender ; 14:52f1
jr c, .asm_edb9
ld d, $0
jr nz, .asm_eda6
@@ -940,32 +940,32 @@ LevelBallMultiplier:
; They are not used in gen 2, and are dummied out.
Text_ThisMonCantBeCaught:
- text_jump Text_ThisMonCantBeCaught_
+ text_far Text_ThisMonCantBeCaught_
db "@"
Text_YouMissedThePokemon:
- text_jump Text_YouMissedThePokemon_
+ text_far Text_YouMissedThePokemon_
db "@"
Text_ThePokemonBrokeFree:
- text_jump Text_ThePokemonBrokeFree_
+ text_far Text_ThePokemonBrokeFree_
db "@"
Text_AppearedToBeCaught:
- text_jump Text_AppearedToBeCaught_
+ text_far Text_AppearedToBeCaught_
db "@"
Text_AarghAlmostHadIt:
- text_jump Text_AarghAlmostHadIt_
+ text_far Text_AarghAlmostHadIt_
db "@"
Text_ShootItWasSoCloseToo:
- text_jump Text_ShootItWasSoCloseToo_
+ text_far Text_ShootItWasSoCloseToo_
db "@"
Text_GotchaMonWasCaught:
- text_jump Text_GotchaMonWasCaught_
- start_asm
+ text_far Text_GotchaMonWasCaught_
+ text_asm
call WaitSFX
push bc
ld de, MUSIC_NONE
@@ -978,31 +978,31 @@ Text_GotchaMonWasCaught:
ret
Text_CaughtMonWaitbutton:
- text_jump Text_Waitbutton_2
+ text_far Text_Promptbutton_2
db "@"
Text_SentToBillsPC:
- text_jump Text_SentToBillsPC_
+ text_far Text_SentToBillsPC_
db "@"
Text_MonNewlyAddedToPokedex:
- text_jump Text_MonNewlyAddedToPokedex_
+ text_far Text_MonNewlyAddedToPokedex_
db "@"
Text_AskNicknameNewlyCaughtMon:
- text_jump Text_AskNicknameNewlyCaughtMon_
+ text_far Text_AskNicknameNewlyCaughtMon_
db "@"
ReturnToBattle_UseBall: ; ee4e (3:6e4e)
- callba ReturnToBattle_UseBall_ ; 9:7307
+ farcall ReturnToBattle_UseBall_ ; 9:7307
ret
TownMap: ; ee55 (3:6e55)
- callba TownMap_ ; 24:5a4f
+ farcall TownMap_ ; 24:5a4f
ret
Bicycle: ; ee5c
- callba BicycleFunction ; same bank
+ farcall BicycleFunction ; same bank
ret
FireStone: ; ee63
@@ -1021,7 +1021,7 @@ WaterStone: ; ee63
jr z, .failed
ld a, $1
ld [wd0d2], a
- callba EvolvePokemon ; 10:61db
+ farcall EvolvePokemon ; 10:61db
ld a, [wd154]
and a
jr z, .failed
@@ -1067,7 +1067,7 @@ Protein: ; ee91
ld hl, Text_StatRoseFromVitamin ; $6efa
call PrintText
ld c, HAPPINESS_USEDITEM
- callba ChangeHappiness
+ farcall ChangeHappiness
jp Functionf7dc
Functioneed7:
@@ -1083,7 +1083,7 @@ Functioneee0: ; eee0 (3:6ee0)
ld a, MON_STAT_EXP - 1
call GetPartyParamLocation
ld b, $1
- predef_jump CalcPkmnStats
+ predef_jump CalcMonStats
Functioneef3: ; eef3 (3:6ef3)
xor a
@@ -1091,7 +1091,7 @@ Functioneef3: ; eef3 (3:6ef3)
jp ClearPalettes
Text_StatRoseFromVitamin:
- text_jump Text_StatRoseFromVitamin_
+ text_far Text_StatRoseFromVitamin_
db "@"
StatStrings:
@@ -1159,7 +1159,7 @@ RareCandy: ; ef68 (3:6f68)
ld [wCurPartyLevel], a
push de
ld d, a
- callba CalcExpAtLevel
+ farcall CalcExpAtLevel
pop de
ld a, $8
call GetPartyParamLocation
@@ -1193,16 +1193,16 @@ RareCandy: ; ef68 (3:6f68)
adc b
ld [hl], a
ld c, $1
- callba ChangeHappiness
+ farcall ChangeHappiness
ld a, PARTYMENUTEXT_LEVEL_UP
call Functionf2a0
xor a
ld [wMonType], a
- predef CopyPkmnToTempMon
+ predef CopyMonToTempMon
hlcoord 9, 0
ld b, 10
ld c, 9
- call TextBox
+ call Textbox
hlcoord 11, 1
ld bc, $4
predef PrintTempMonStats
@@ -1214,7 +1214,7 @@ RareCandy: ; ef68 (3:6f68)
predef LearnLevelMoves
xor a
ld [wd0d2], a
- callba EvolvePokemon
+ farcall EvolvePokemon
jp Functionf7dc
HealPowder: ; f003 (3:7003)
@@ -1225,7 +1225,7 @@ HealPowder: ; f003 (3:7003)
cp $0
jr nz, .asm_f01f
ld c, $f
- callba ChangeHappiness
+ farcall ChangeHappiness
call Functionf81d
ld a, $0
.asm_f01f
@@ -1320,7 +1320,7 @@ Functionf086: ; f086 (3:7086)
res 7, [hl]
.asm_f0a5
push bc
- callba CalcPlayerStats ; d:66f6
+ farcall CalcPlayerStats ; d:66f6
pop bc
ret
@@ -1380,7 +1380,7 @@ RevivalHerb: ; f0ff
cp $0
jr nz, .asm_f11b
ld c, $11
- callba ChangeHappiness
+ farcall ChangeHappiness
call Functionf81d
ld a, $0
.asm_f11b
@@ -1406,7 +1406,7 @@ Functionf12c: ; f12c (3:712c)
ld d, $0
ld hl, wcbda
ld b, CHECK_FLAG
- predef FlagPredef
+ predef SmallFarFlagAction
ld a, c
and a
jr z, .asm_f15a
@@ -1414,7 +1414,7 @@ Functionf12c: ; f12c (3:712c)
ld c, a
ld hl, wcb42
ld b, SET_FLAG
- predef FlagPredef
+ predef SmallFarFlagAction
.asm_f15a
xor a
ld [wLowHealthAlarm], a
@@ -1510,7 +1510,7 @@ asm_f1e8
pop bc
cp $0
jr nz, .asm_f1fc
- callba ChangeHappiness
+ farcall ChangeHappiness
call Functionf81d
ld a, $0
.asm_f1fc
@@ -1581,15 +1581,15 @@ Functionf261: ; f261 (3:7261)
ret
Functionf272: ; f272 (3:7272)
- callba LoadPartyMenuGFX
- callba InitPartyMenuWithCancel
- callba InitPartyMenuGFX
- callba WritePartyMenuTilemap
- callba PrintPartyMenuText
+ farcall LoadPartyMenuGFX
+ farcall InitPartyMenuWithCancel
+ farcall InitPartyMenuGFX
+ farcall WritePartyMenuTilemap
+ farcall PrintPartyMenuText
call WaitBGMap
call SetPalettes
call DelayFrame
- callba PartyMenuSelect
+ farcall PartyMenuSelect
ret
Functionf2a0: ; f2a0 (3:72a0)
@@ -1601,8 +1601,8 @@ Functionf2a0: ; f2a0 (3:72a0)
push hl
push de
push bc
- callba WritePartyMenuTilemap
- callba PrintPartyMenuActionText
+ farcall WritePartyMenuTilemap
+ farcall PrintPartyMenuActionText
call WaitBGMap
call SetPalettes
call DelayFrame
@@ -1922,13 +1922,13 @@ Functionf46f: ; f46f (3:746f)
jr Functionf46f
Text_MilkDrinkCantBeUsed:
- text_jump Text_MilkDrinkCantBeUsed_
+ text_far Text_MilkDrinkCantBeUsed_
db "@"
EscapeRope: ; f4a5 (3:74a5)
xor a
ld [wFieldMoveSucceeded], a
- callba EscapeRopeFunction ; same bank
+ farcall EscapeRopeFunction ; same bank
ld a, [wFieldMoveSucceeded]
cp $1
call z, Functionf7dc
@@ -1954,7 +1954,7 @@ asm_f4c2
jp Functionf7d0
Text_RepelsEffectsStillLinger:
- text_jump Text_RepelUsedEarlierIsStillInEffect
+ text_far Text_RepelUsedEarlierIsStillInEffect
db "@"
XAccuracy: ; f4d8 (3:74d8)
@@ -2014,14 +2014,14 @@ XSpeed: ; f515
ld [hBattleTurn], a
ld [wcb45], a
ld [wcbeb], a
- callba CheckIfStatCanBeRaised
+ farcall CheckIfStatCanBeRaised
call WaitSFX
- callba BattleCommand_StatUpMessage
- callba BattleCommand_StatUpFailText
+ farcall BattleCommand_StatUpMessage
+ farcall BattleCommand_StatUpFailText
ld a, [wCurBattleMon]
ld [wCurPartyMon], a
ld c, HAPPINESS_USEDXITEM
- callba ChangeHappiness
+ farcall ChangeHappiness
ret
.x_item_table
@@ -2087,16 +2087,16 @@ Functionf5a4: ; f5a4 (3:75a4)
ret
Text_NowThatsACatchyTune:
- text_jump Text_NowThatsACatchyTune_
+ text_far Text_NowThatsACatchyTune_
db "@"
Text_AllSleepingMonWokeUp:
- text_jump Text_AllSleepingMonWokeUp_
+ text_far Text_AllSleepingMonWokeUp_
db "@"
Text_PlayedThePokeFlute:
- text_jump Text_PlayedThePokeFlute_
- start_asm
+ text_far Text_PlayedThePokeFlute_
+ text_asm
ld a, [wBattleMode]
and a
jr nz, .asm_f5dc
@@ -2116,7 +2116,7 @@ CoinCase: ; f5e1 (3:75e1)
jp MenuTextBoxWaitButton
Text_CoinCase:
- text_jump Text_CoinCase_
+ text_far Text_CoinCase_
db "@"
OldRod: ; f5ec (3:75ec)
@@ -2132,11 +2132,11 @@ SuperRod: ; f5f4 (3:75f4)
jr UseRod
UseRod:
- callba FishingRodFunction ; same bank
+ farcall FishingRodFunction ; same bank
ret
Itemfinder: ; f5ff (3:75ff)
- callba ItemfinderFunction
+ farcall ItemfinderFunction
ret
Elixer: ; f606
@@ -2353,39 +2353,39 @@ Functionf72f: ; f72f (3:772f)
ret
Text_RaiseThePPOfWhichMove:
- text_jump Text_RaiseThePPOfWhichMove_
+ text_far Text_RaiseThePPOfWhichMove_
db "@"
Text_RestoreThePPOfWhichMove:
- text_jump Text_RestoreThePPOfWhichMove_
+ text_far Text_RestoreThePPOfWhichMove_
db "@"
Text_PPIsMaxedOut:
- text_jump Text_PPIsMaxedOut_
+ text_far Text_PPIsMaxedOut_
db "@"
Text_PPsIncreased:
- text_jump Text_PPsIncreased_
+ text_far Text_PPsIncreased_
db "@"
Text_PPWasRestored:
- text_jump Text_PPWasRestored_
+ text_far Text_PPWasRestored_
db "@"
Squirtbottle: ; f785 (3:7785)
- callba SquirtbottleFunction ; 14:4763
+ farcall SquirtbottleFunction ; 14:4763
ret
CardKey: ; f78c (3:778c)
- callba CardKeyFunction ; 14:47ac
+ farcall CardKeyFunction ; 14:47ac
ret
BasementKey: ; f793 (3:7793)
- callba BasementKeyFunction ; 14:47e7
+ farcall BasementKeyFunction ; 14:47e7
ret
SacredAsh: ; f79a (3:779a)
- callba SacredAshFunction ; 14:4819
+ farcall SacredAshFunction ; 14:4819
ld a, [wFieldMoveSucceeded]
cp $1
ret nz
@@ -2399,13 +2399,13 @@ NormalBox: ; f7aa (3:77aa)
GorgeousBox: ; f7ae (3:77ae)
ld c, DECOFLAG_GOLD_TROPHY_DOLL
asm_f7b0
- callba ReceiveDecorationC ; 9:70d5
+ farcall ReceiveDecorationC ; 9:70d5
ld hl, Text_TrophyInside ; $77bf
call PrintText
jp Functionf7dc
Text_TrophyInside:
- text_jump Text_TrophyInside_
+ text_far Text_TrophyInside_
db "@"
AmuletCoin: ; f7c4
@@ -2583,55 +2583,55 @@ asm_f84b
jp PrintText
Text_LooksBitter:
- text_jump Text_LooksBitter_
+ text_far Text_LooksBitter_
db "@"
Text_CantUseOnEgg:
- text_jump Text_CantUseOnEgg_
+ text_far Text_CantUseOnEgg_
db "@"
Text_IsntTheTimeToUseThat:
- text_jump Text_IsntTheTimeToUseThat_
+ text_far Text_IsntTheTimeToUseThat_
db "@"
Text_BelongsToSomeoneElse:
- text_jump Text_BelongsToSomeoneElse_
+ text_far Text_BelongsToSomeoneElse_
db "@"
Text_WontHaveAnyEffect:
- text_jump Text_WontHaveAnyEffect_
+ text_far Text_WontHaveAnyEffect_
db "@"
Text_BlockedTheBall:
- text_jump Text_BlockedTheBall_
+ text_far Text_BlockedTheBall_
db "@"
Text_DontBeAThief:
- text_jump Text_DontBeAThief_
+ text_far Text_DontBeAThief_
db "@"
Text_CyclingIsntAllowed:
- text_jump Text_CyclingIsntAllowed_
+ text_far Text_CyclingIsntAllowed_
db "@"
Text_CantGetOnYourItemNow:
- text_jump Text_CantGetOnYourItemNow_
+ text_far Text_CantGetOnYourItemNow_
db "@"
Text_CantUseBallBoxIsFull:
- text_jump Text_CantUseBallBoxIsFull_
+ text_far Text_CantUseBallBoxIsFull_
db "@"
Text_UsedItem:
- text_jump Text_UsedItem_
+ text_far Text_UsedItem_
db "@"
Text_GotOnItem:
- text_jump Text_GotOnItem_
+ text_far Text_GotOnItem_
db "@"
Text_GotOffItem:
- text_jump Text_GotOffItem_
+ text_far Text_GotOffItem_
db "@"
Functionf893: ; f893 (3:7893)
diff --git a/macros.asm b/macros.asm
index f3070d40..ad584206 100644
--- a/macros.asm
+++ b/macros.asm
@@ -1,23 +1,27 @@
INCLUDE "macros/enum.asm"
-INCLUDE "macros/basestats.asm"
+INCLUDE "macros/predef.asm"
+INCLUDE "macros/rst.asm"
+INCLUDE "macros/data.asm"
INCLUDE "macros/code.asm"
+INCLUDE "macros/gfx.asm"
+INCLUDE "macros/coords.asm"
INCLUDE "macros/scripts/audio.asm"
INCLUDE "macros/scripts/maps.asm"
INCLUDE "macros/scripts/events.asm"
-INCLUDE "macros/text.asm"
-INCLUDE "macros/charmap.asm"
+INCLUDE "macros/scripts/text.asm"
+INCLUDE "macros/scripts/movement.asm"
+INCLUDE "macros/scripts/trade_anims.asm"
+
INCLUDE "macros/move_effect.asm"
INCLUDE "macros/move_anim.asm"
-INCLUDE "macros/movement.asm"
INCLUDE "macros/pic.asm"
-INCLUDE "macros/predef.asm"
-INCLUDE "macros/rst.asm"
INCLUDE "macros/mobile.asm"
-INCLUDE "macros/trade_anim.asm"
INCLUDE "macros/pals.asm"
INCLUDE "macros/flag.asm"
+;INCLUDE "macros/legacy.asm"
+
dr: macro
IF DEF(GOLD)
INCBIN "baserom-gold.gbc", \1, \2 +- \1
@@ -27,257 +31,3 @@ INCBIN "baserom-silver.gbc", \1, \2 +- \1
ENDC
ENDC
ENDM
-
-RGB: MACRO
- dw ((\3) << 10) + ((\2) << 5) + (\1)
- ENDM
-
-
-percent EQUS "* $ff / 100"
-
-
-dwb: MACRO
- dw \1
- db \2
- ENDM
-
-dbw: MACRO
- db \1
- dw \2
- ENDM
-
-dbbw: MACRO
- db \1, \2
- dw \3
- ENDM
-
-dbww: MACRO
- db \1
- dw \2, \3
- ENDM
-
-dbwww: MACRO
- db \1
- dw \2, \3, \4
- ENDM
-
-dn: MACRO
- rept _NARG / 2
- db (\1) << 4 + (\2)
- shift
- shift
- endr
- ENDM
-
-dx: MACRO
-x = 8 * ((\1) - 1)
- rept \1
- db ((\2) >> x) & $ff
-x = x + -8
- endr
- ENDM
-
-dt: MACRO ; three-byte (big-endian)
- dx 3, \1
- ENDM
-
-dd: MACRO ; four-byte (big-endian)
- dx 4, \1
- ENDM
-
-bigdw: MACRO ; big-endian word
- dx 2, \1
- ENDM
-
-dba: MACRO ; dbw bank, address
- rept _NARG
- dbw BANK(\1), \1
- shift
- endr
- ENDM
-
-dab: MACRO ; dwb address, bank
- rept _NARG
- dwb \1, BANK(\1)
- shift
- endr
- ENDM
-
-bccoord equs "coord bc,"
-decoord equs "coord de,"
-hlcoord equs "coord hl,"
-
-coord: MACRO
-; register, x, y[, origin]
- if _NARG < 4
- ld \1, wTileMap + SCREEN_WIDTH * (\3) + (\2)
- else
- ld \1, \4 + SCREEN_WIDTH * (\3) + (\2)
- endc
- ENDM
-
-dwcoord: MACRO
- rept _NARG / 2
- dw wTileMap + SCREEN_WIDTH * (\2) + (\1)
- shift
- shift
- endr
- ENDM
-
-Coorda: MACRO
- if _NARG < 3
- ld [wTileMap + SCREEN_WIDTH * (\2) + (\1)], a
- else
- ld [\3 + SCREEN_WIDTH * (\2) + (\1)], a
- endc
- ENDM
-
-aCoord: MACRO
- if _NARG < 3
- ld a, [wTileMap + SCREEN_WIDTH * (\2) + (\1)]
- else
- ld a, [\3 + SCREEN_WIDTH * (\2) + (\1)]
- endc
- ENDM
-
-; pic animations
-frame: MACRO
- db \1
-x = \2
-IF _NARG > 2
-rept _NARG +- 2
-x = x | (1 << (\3 + 1))
- shift
-endr
-endc
- db x
- ENDM
-setrepeat: MACRO
- db $fe
- db \1
- ENDM
-dorepeat: MACRO
- db $fd
- db \1
- ENDM
-endanim: MACRO
- db $ff
- ENDM
-
-
-delanim: MACRO
- db $fc
- ENDM
-dorestart: MACRO
- db $fe
- ENDM
-
-sine_wave: MACRO
-; \1: amplitude
-
-x = 0
- rept $20
- ; Round up.
- dw (sin(x) + (sin(x) & $ff)) >> 8
-x = x + (\1) * $40000
- endr
-ENDM
-
-
-bcd: MACRO
- rept _NARG
- dn ((\1) % 100) / 10, (\1) % 10
- shift
- endr
-ENDM
-
-tiles EQUS "* $10"
-tile EQUS "+ $10 *"
-
-partymon: MACRO
- db \1
- db \2
- db \3, \4, \5, \6
- dw \7
- dt \8
-rept 8
- shift
-endr
-rept 5
- bigdw \1
- shift
-endr
- db \1, \2
- db \3, \4, \5, \6
-rept 6
- shift
-endr
- db \1
- db \2, \3, \4
- db \5
- db \6, \7
-rept 7
- shift
-endr
-rept 7
- bigdw \1
- shift
-endr
- db \1
-ENDM
-
-palettes EQUS "* 8"
-
-dbpixel: MACRO
-if _NARG >= 4
- db \1 * 8 + \3, \2 * 8 + \4
-else
- db \1 * 8, \2 * 8
-endc
-endm
-
-bgcoord: MACRO
-IF _NARG >= 4
- ld \1, \3 * $20 + \2 + \4
-ELSE
- ld \1, \3 * $20 + \2 + VBGMap0
-ENDC
-ENDM
-
-hlbgcoord EQUS "bgcoord hl,"
-debgcoord EQUS "bgcoord de,"
-bcbgcoord EQUS "bgcoord bc,"
-bgrows EQUS "* $20"
-
-palred EQUS "$0001 *"
-palgreen EQUS "$0020 *"
-palblue EQUS "$0400 *"
-
-dsprite: MACRO
-; conditional segment is there because not every instance of
-; this macro is directly OAM
-if _NARG >= 7 ; y tile, y pxl, x tile, x pxl, vtile offset, flags, palette
- db (\1 * 8) % $100 + \2, (\3 * 8) % $100 + \4, \5, (\6 << 3) + (\7 & 7)
-else
- db (\1 * 8) % $100 + \2, (\3 * 8) % $100 + \4, \5, \6
-endc
-endm
-
-menu_coords: MACRO
-; x1, y1, x2, y2
- db \2, \1 ; start coords
- db \4, \3 ; end coords
-ENDM
-
-homecall: MACRO
- ld a, [hROMBank]
- push af
- ld a, BANK(\1)
- rst Bankswitch
-
- call \1
-
- pop af
- rst Bankswitch
-ENDM
-
diff --git a/macros/basestats.asm b/macros/basestats.asm
deleted file mode 100644
index f2fbbee9..00000000
--- a/macros/basestats.asm
+++ /dev/null
@@ -1,30 +0,0 @@
-define: macro
-if !def(\1)
-\1 equs \2
-endc
-endm
-
-const_value = 0
-
-add_tm: MACRO
-if !def(TM01)
-TM01 = const_value
- enum_start 1
-endc
- define _\@_1, "TM_\1"
- const _\@_1
- enum \1_TMNUM
-ENDM
-
-add_hm: MACRO
-if !def(HM01)
-HM01 = const_value
-endc
- define _\@_1, "HM_\1"
- const _\@_1
- enum \1_TMNUM
-ENDM
-
-add_mt: MACRO
- enum \1_TMNUM
-ENDM
diff --git a/macros/coords.asm b/macros/coords.asm
new file mode 100755
index 00000000..0833c242
--- /dev/null
+++ b/macros/coords.asm
@@ -0,0 +1,52 @@
+hlcoord EQUS "coord hl,"
+bccoord EQUS "coord bc,"
+decoord EQUS "coord de,"
+
+coord: MACRO
+; register, x, y[, origin]
+ if _NARG < 4
+ ld \1, (\3) * SCREEN_WIDTH + (\2) + wTileMap
+ else
+ ld \1, (\3) * SCREEN_WIDTH + (\2) + \4
+ endc
+ENDM
+
+hlbgcoord EQUS "bgcoord hl,"
+bcbgcoord EQUS "bgcoord bc,"
+debgcoord EQUS "bgcoord de,"
+
+bgcoord: MACRO
+; register, x, y[, origin]
+ if _NARG < 4
+ ld \1, (\3) * BG_MAP_WIDTH + (\2) + vBGMap0
+ else
+ ld \1, (\3) * BG_MAP_WIDTH + (\2) + \4
+ endc
+ENDM
+
+dwcoord: MACRO
+; x, y
+rept _NARG / 2
+ dw (\2) * SCREEN_WIDTH + (\1) + wTileMap
+ shift
+ shift
+endr
+ENDM
+
+ldcoord_a: MACRO
+; x, y[, origin]
+ if _NARG < 3
+ ld [(\2) * SCREEN_WIDTH + (\1) + wTileMap], a
+ else
+ ld [(\2) * SCREEN_WIDTH + (\1) + \3], a
+ endc
+ENDM
+
+lda_coord: MACRO
+; x, y[, origin]
+ if _NARG < 3
+ ld a, [(\2) * SCREEN_WIDTH + (\1) + wTileMap]
+ else
+ ld a, [(\2) * SCREEN_WIDTH + (\1) + \3]
+ endc
+ENDM
diff --git a/macros/data.asm b/macros/data.asm
new file mode 100755
index 00000000..32903b0f
--- /dev/null
+++ b/macros/data.asm
@@ -0,0 +1,126 @@
+; Value macros
+
+percent EQUS "* $ff / 100"
+
+; Constant data (db, dw, dl) macros
+
+dwb: MACRO
+ dw \1
+ db \2
+ENDM
+
+dbw: MACRO
+ db \1
+ dw \2
+ENDM
+
+dbbw: MACRO
+ db \1, \2
+ dw \3
+ENDM
+
+dbww: MACRO
+ db \1
+ dw \2, \3
+ENDM
+
+dbwww: MACRO
+ db \1
+ dw \2, \3, \4
+ENDM
+
+dn: MACRO ; nybbles
+rept _NARG / 2
+ db ((\1) << 4) | (\2)
+ shift
+ shift
+endr
+ENDM
+
+dc: MACRO ; "crumbs"
+rept _NARG / 4
+ db ((\1) << 6) | ((\2) << 4) | ((\3) << 2) | (\4)
+ shift
+ shift
+ shift
+ shift
+endr
+ENDM
+
+dx: MACRO
+x = 8 * ((\1) - 1)
+rept \1
+ db ((\2) >> x) & $ff
+x = x + -8
+endr
+ENDM
+
+dt: MACRO ; three-byte (big-endian)
+ dx 3, \1
+ENDM
+
+dd: MACRO ; four-byte (big-endian)
+ dx 4, \1
+ENDM
+
+bigdw: MACRO ; big-endian word
+ dx 2, \1 ; db HIGH(\1), LOW(\1)
+ENDM
+
+dba: MACRO ; dbw bank, address
+rept _NARG
+ dbw BANK(\1), \1
+ shift
+endr
+ENDM
+
+dab: MACRO ; dwb address, bank
+rept _NARG
+ dwb \1, BANK(\1)
+ shift
+endr
+ENDM
+
+dba_pic: MACRO ; dbw bank, address
+ db BANK(\1) - PICS_FIX
+ dw \1
+ENDM
+
+dbpixel: MACRO
+if _NARG >= 4
+; x tile, x pxl, y tile, y pxl
+ db \1 * 8 + \3, \2 * 8 + \4
+else
+; x, y
+ db \1 * 8, \2 * 8
+endc
+ENDM
+
+dsprite: MACRO
+; y tile, y pxl, x tile, x pxl, vtile offset, attributes
+ db (\1 * 8) % $100 + \2, (\3 * 8) % $100 + \4, \5, \6
+ENDM
+
+menu_coords: MACRO
+; x1, y1, x2, y2
+ db \2, \1 ; start coords
+ db \4, \3 ; end coords
+ENDM
+
+bcd: MACRO
+rept _NARG
+ dn ((\1) % 100) / 10, (\1) % 10
+ shift
+endr
+ENDM
+
+sine_table: MACRO
+; \1: amplitude
+
+x = 0
+ rept $20
+ ; Round up.
+ dw (sin(x) + (sin(x) & $ff)) >> 8
+x = x + (\1) * $40000
+ endr
+ENDM
diff --git a/macros/enum.asm b/macros/enum.asm
index 4830c339..003445be 100644..100755
--- a/macros/enum.asm
+++ b/macros/enum.asm
@@ -1,6 +1,6 @@
; Enumerate variables
-enum_start: macro
+enum_start: MACRO
if _NARG >= 1
__enum__ = \1
else
@@ -11,16 +11,16 @@ __enumdir__ = \2
else
__enumdir__ = +1
endc
-endm
+ENDM
-enum: macro
-\1 = __enum__
+enum: MACRO
+\1 EQU __enum__
__enum__ = __enum__ + __enumdir__
-endm
+ENDM
-enum_set: macro
+enum_set: MACRO
__enum__ = \1
-endm
+ENDM
; Enumerate constants
@@ -41,3 +41,11 @@ shift_const: MACRO
\1 EQU (1 << const_value)
const_value = const_value + 1
ENDM
+
+; Enumerate strings
+
+define: MACRO
+if !DEF(\1)
+\1 EQUS \2
+endc
+ENDM
diff --git a/macros/gfx.asm b/macros/gfx.asm
new file mode 100755
index 00000000..2753373e
--- /dev/null
+++ b/macros/gfx.asm
@@ -0,0 +1,24 @@
+RGB: MACRO
+rept _NARG / 3
+ dw palred (\1) + palgreen (\2) + palblue (\3)
+ shift
+ shift
+ shift
+endr
+ENDM
+
+palred EQUS "(1 << 0) *"
+palgreen EQUS "(1 << 5) *"
+palblue EQUS "(1 << 10) *"
+
+palettes EQUS "* PALETTE_SIZE"
+palette EQUS "+ PALETTE_SIZE *"
+color EQUS "+ PAL_COLOR_SIZE *"
+
+tiles EQUS "* LEN_2BPP_TILE"
+tile EQUS "+ LEN_2BPP_TILE *"
+
+; extracts the middle two colors from a 2bpp binary palette
+; example usage:
+; INCBIN "foo.gbcpal", middle_colors
+middle_colors EQUS "PAL_COLOR_SIZE, PAL_COLOR_SIZE * 2"
diff --git a/macros/predef.asm b/macros/predef.asm
index 147c6fb9..7850350a 100644..100755
--- a/macros/predef.asm
+++ b/macros/predef.asm
@@ -1,11 +1,3 @@
-predef_const: MACRO
- enum \1Predef
-ENDM
-
-add_predef: MACRO
-\1Predef:: dab \1
-ENDM
-
predef_id: MACRO
; Some functions load the predef id
; without immediately calling Predef.
diff --git a/macros/rst.asm b/macros/rst.asm
index 23c821d9..773a5c60 100644..100755
--- a/macros/rst.asm
+++ b/macros/rst.asm
@@ -6,7 +6,7 @@ farcall: MACRO ; bank, address
ld a, BANK(\1)
ld hl, \1
rst FarCall
- ENDM
+ENDM
callfar: MACRO ; address, bank
ld hl, \1
@@ -14,10 +14,12 @@ callfar: MACRO ; address, bank
rst FarCall
ENDM
-callba EQUS "farcall"
-
-callab: MACRO ; address, bank
- ld hl, \1
+homecall: MACRO
+ ldh a, [hROMBank]
+ push af
ld a, BANK(\1)
- rst FarCall
- ENDM
+ rst Bankswitch
+ call \1
+ pop af
+ rst Bankswitch
+ENDM
diff --git a/macros/movement.asm b/macros/scripts/movement.asm
index 49d95f82..49d95f82 100644
--- a/macros/movement.asm
+++ b/macros/scripts/movement.asm
diff --git a/macros/scripts/text.asm b/macros/scripts/text.asm
new file mode 100755
index 00000000..bb1701f8
--- /dev/null
+++ b/macros/scripts/text.asm
@@ -0,0 +1,145 @@
+text EQUS "db TX_START," ; Start writing text.
+next EQUS "db \"<NEXT>\"," ; Move a line down.
+line EQUS "db \"<LINE>\"," ; Start writing at the bottom line.
+page EQUS "db \"@\"," ; Start a new Pokédex page.
+para EQUS "db \"<PARA>\"," ; Start a new paragraph.
+cont EQUS "db \"<CONT>\"," ; Scroll to the next line.
+done EQUS "db \"<DONE>\"" ; End a text box.
+prompt EQUS "db \"<PROMPT>\"" ; Prompt the player to end a text box (initiating some other event).
+
+; TextCommands indexes (see home/text.asm)
+ enum_start
+
+ enum TX_START ; $00
+text_start: MACRO
+ db TX_START
+ENDM
+
+ enum TX_RAM ; $01
+text_ram: MACRO
+ db TX_RAM
+ dw \1
+ENDM
+
+ enum TX_BCD ; $02
+text_bcd: MACRO
+ db TX_BCD
+ dw \1
+ db \2
+ENDM
+
+ enum TX_MOVE ; $03
+text_move: MACRO
+ db TX_MOVE
+ dw \1
+ENDM
+
+ enum TX_BOX ; $04
+text_box: MACRO
+ db TX_BOX
+ dw \1
+ db \2, \3
+ENDM
+
+ enum TX_LOW ; $05
+text_low: MACRO
+ db TX_LOW
+ENDM
+
+ enum TX_PROMPT_BUTTON ; $06
+text_promptbutton: MACRO
+ db TX_PROMPT_BUTTON
+ENDM
+
+ enum TX_SCROLL ; $07
+text_scroll: MACRO
+ db TX_SCROLL
+ENDM
+
+ enum TX_START_ASM ; $08
+text_asm: MACRO
+ db TX_START_ASM
+ENDM
+
+ enum TX_NUM ; $09
+text_decimal: MACRO
+ db TX_NUM
+ dw \1 ; address
+ dn \2, \3 ; bytes, digits
+ENDM
+
+ enum TX_PAUSE ; $0a
+text_pause: MACRO
+ db TX_PAUSE
+ENDM
+
+ enum TX_SOUND_DEX_FANFARE_50_79 ; $0b
+sound_dex_fanfare_50_79: MACRO
+ db TX_SOUND_DEX_FANFARE_50_79
+ENDM
+
+ enum TX_DOTS ; $0c
+text_dots: MACRO
+ db TX_DOTS
+ db \1
+ENDM
+
+ enum TX_LINK_PROMPT_BUTTON ; $0d
+text_linkpromptbutton: MACRO
+ db TX_LINK_PROMPT_BUTTON
+ENDM
+
+ enum TX_SOUND_DEX_FANFARE_20_49 ; $0e
+sound_dex_fanfare_20_49: MACRO
+ db TX_SOUND_DEX_FANFARE_20_49
+ENDM
+
+ enum TX_SOUND_ITEM ; $0f
+sound_item: MACRO
+ db TX_SOUND_ITEM
+ENDM
+
+ enum TX_SOUND_CAUGHT_MON ; $10
+sound_caught_mon: MACRO
+ db TX_SOUND_CAUGHT_MON
+ENDM
+
+ enum TX_SOUND_DEX_FANFARE_80_109 ; $11
+sound_dex_fanfare_80_109: MACRO
+ db TX_SOUND_DEX_FANFARE_80_109
+ENDM
+
+ enum TX_SOUND_FANFARE ; $12
+sound_fanfare: MACRO
+ db TX_SOUND_FANFARE
+ENDM
+
+ enum TX_SOUND_SLOT_MACHINE_START ; $13
+sound_slot_machine_start: MACRO
+ db TX_SOUND_SLOT_MACHINE_START
+ENDM
+
+ enum TX_STRINGBUFFER ; $14
+text_buffer: MACRO
+ db TX_STRINGBUFFER
+ db \1
+ENDM
+
+ enum TX_DAY ; $15
+text_today: MACRO
+ db TX_DAY
+ENDM
+
+ enum TX_FAR ; $16
+text_far: MACRO
+ db TX_FAR
+ dw \1
+ db BANK(\1)
+ENDM
+
+ enum_set $50
+
+ enum TX_END ; $50
+text_end: MACRO
+ db TX_END
+ENDM
diff --git a/macros/trade_anim.asm b/macros/scripts/trade_anims.asm
index c590cb62..c590cb62 100755
--- a/macros/trade_anim.asm
+++ b/macros/scripts/trade_anims.asm
diff --git a/macros/text.asm b/macros/text.asm
deleted file mode 100644
index 8cda714a..00000000
--- a/macros/text.asm
+++ /dev/null
@@ -1,143 +0,0 @@
-text EQUS "db $00," ; Start writing text.
-next EQUS "db $4e," ; Move a line down.
-line EQUS "db $4f," ; Start writing at the bottom line.
-para EQUS "db $51," ; Start a new paragraph.
-cont EQUS "db $55," ; Scroll to the next line.
-done EQUS "db $57" ; End a text box.
-prompt EQUS "db $58" ; Prompt the player to end a text box (initiating some other event).
-
-; Pokedex text commands are only used with pokered.
-; They are included for compatibility.
-page EQUS "db $50," ; Start a new Pokedex page.
-dex EQUS "db $e8, $50" ; End a Pokedex entry.
-
-; TX_RAM EQU $01
-; TX_FAR EQU $16
- enum_start
-
- enum TX_START
-text_start: MACRO ; 00
- db TX_START
-ENDM
-
- enum TX_RAM
-text_from_ram: MACRO ; 01
- db TX_RAM
- dw \1
- ENDM
-
- enum TX_BCD
-text_bcd: macro ; 02
- db TX_BCD
- dw \1
- db \2
- ENDM
-
- enum TX_MOVE
-text_move: macro ; 03
- db TX_MOVE
- dw \1
- ENDM
-
- enum TX_BOX
-text_box: macro ; 04
- db TX_BOX
- dw \1
- db \2, \3
- ENDM
-
- enum TX_LOW
-text_low: macro ; 05
- db TX_LOW
- endm
-
- enum WAIT_BUTTON
-text_waitbutton: macro ; 06
- db WAIT_BUTTON
- endm
-
- enum TX_SCROLL
-text_scroll: macro ; 07
- db TX_SCROLL
- endm
-
- enum START_ASM
-start_asm: macro ; 08
- db START_ASM
- endm
-
- enum TX_NUM
-deciram: macro ; 09
- db TX_NUM
- dw \1 ; address
- dn \2, \3 ; bytes, digits
- endm
-
- enum TX_EXIT
-interpret_data: macro ; 0a
- db TX_EXIT
- endm
-
- enum TX_SOUND_0B
-sound_dex_fanfare_50_79: macro ; 0b
- db TX_SOUND_0B
- endm
-
- enum TX_DOTS
-limited_interpret_data: macro ; 0c
- db TX_DOTS
- db \1
- endm
-
- enum TX_LINK_WAIT_BUTTON
-link_wait_button: macro ; 0d
- db TX_LINK_WAIT_BUTTON
- endm
-
- enum TX_SOUND_0E
-sound_dex_fanfare_20_49: macro ; 0e
- db TX_SOUND_0E
- endm
-
- enum TX_SOUND_0F
-sound_item: macro ; 0f
- db TX_SOUND_0F
- endm
-
- enum TX_SOUND_10
-sound_caught_mon: macro ; 10
- db TX_SOUND_10
- endm
-
- enum TX_SOUND_11
-sound_dex_fanfare_80_109: macro ; 11
- db TX_SOUND_11
- endm
-
- enum TX_SOUND_12
-sound_fanfare: macro ; 12
- db TX_SOUND_12
- endm
-
- enum TX_SOUND_13
-sound_slot_machine_start: macro ; 13
- db TX_SOUND_13
- endm
-
- enum TX_STRINGBUFFER
-text_buffer: macro ; 14
- db TX_STRINGBUFFER
- db \1
- endm
-
- enum TX_DAY
-current_day: macro ; 15
- db TX_DAY
- endm
-
- enum TX_FAR
-text_jump: MACRO ; 16
- db TX_FAR
- dw \1
- db BANK(\1)
- ENDM
diff --git a/main.asm b/main.asm
index 83d9c1d9..4cfa848f 100644
--- a/main.asm
+++ b/main.asm
@@ -1,29 +1,12 @@
-INCLUDE "includes.asm"
-
-SECTION "bank1", ROMX, BANK[$1]
-PlaceWaitingText:: ; 4000 (1:4000)
- hlcoord 3, 10
- ld b, $1
- ld c, $b
- ld a, [wBattleMode]
- and a
- jr z, .asm_4012
- call TextBox
- jr .asm_4017
-
-.asm_4012
- predef Predef_LinkTextbox
-.asm_4017
- hlcoord 4, 11
- ld de, .Waiting
- call PlaceString
- ld c, 50
- jp DelayFrames
-
-.Waiting:
- db "Waiting...!@"
-
-Predef1:
+INCLUDE "contents.asm"
+INCLUDE "constants.asm"
+
+
+SECTION "bank1", ROMX
+
+INCLUDE "engine/link/place_waiting_text.asm"
+
+DummyPredef1:
ret
LoadPushOAM:: ; 4032 (1:4032)
@@ -353,7 +336,7 @@ INCLUDE "engine/specials.asm"
Functionc660:
nop
-FlagPredef:
+SmallFarFlagAction:
push hl
push bc
push bc
@@ -420,7 +403,7 @@ GetBreedMon1LevelGrowth:
ld de, wTempMonSpecies
ld bc, $20
call CopyBytes
- callab CalcLevel
+ callfar CalcLevel
ld a, [wBreedMon1Level]
ld b, a
ld a, d
@@ -434,7 +417,7 @@ GetBreedMon2LevelGrowth:
ld de, wTempMon
ld bc, $20
call CopyBytes
- callab CalcLevel
+ callfar CalcLevel
ld a, [wBreedMon2Level]
ld b, a
ld a, d
@@ -573,8 +556,8 @@ BugContest_SetCaughtContestMon:
and a
jr z, .asm_e76e
ld [wd151], a
- callba DisplayAlreadyCaughtText
- callba DisplayCaughtContestMonStats
+ farcall DisplayAlreadyCaughtText
+ farcall DisplayCaughtContestMonStats
lb bc, 14, 7
call PlaceYesNoBox
ret c
@@ -603,7 +586,7 @@ GenerateBugContestMonStats: ; e781 (3:6781)
Text_CaughtBugMon:
; Caught @ !
- text_jump Text_CaughtBugMon_
+ text_far Text_CaughtBugMon_
db "@"
INCLUDE "items/item_effects.asm"
@@ -630,7 +613,7 @@ KnowsMove:
ret
Text_KnowsMove:
- text_jump Text_KnowsMove_
+ text_far Text_KnowsMove_
db "@"
SECTION "bank4", ROMX, BANK[$4]
@@ -640,12 +623,10 @@ INCLUDE "engine/pack.asm"
INCLUDE "engine/overworld/time.asm"
INCLUDE "engine/learn_tm.asm"
INCLUDE "engine/namingscreen.asm"
-
-AbortBugCatchingContest::
- dr $1269a, $126fd
-HealMachineAnim:
- dr $126fd, $12947
-
+INCLUDE "engine/events/misc_scripts.asm"
+INCLUDE "engine/events/heal_machine_anim.asm"
+INCLUDE "engine/events/whiteout.asm"
+INCLUDE "engine/events/forced_movement.asm"
ItemfinderFunction:
dr $12947, $12e33
@@ -653,8 +634,9 @@ PartyMonItemName::
dr $12e33, $12fa0
Function12fa0:
dr $12fa0, $1399d
-GiveParkBalls:
- dr $1399d, $13a5f
+INCLUDE "engine/events/bug_contest/contest.asm"
+INCLUDE "engine/events/misc_scripts_2.asm"
+INCLUDE "engine/events/std_collision.asm"
Function13a5f:
dr $13a5f, $13d44
ApplyPokerusTick:
@@ -799,7 +781,7 @@ ReturnToBattle_UseBall_:
SECTION "banka", ROMX, BANK[$a]
dr $28000, $28d88
-Predef_LinkTextbox::
+LinkTextboxAtHL::
dr $28d88, $28dea
TradeAnimation::
@@ -916,7 +898,7 @@ SECTION "bankf", ROMX, BANK[$f]
FleeMons::
dr $3c551, $3d70a
-CheckPlayerPartyForFitPkmn::
+CheckPlayerPartyForFitMon::
dr $3d70a, $3d8f5
Function3d8f5:
@@ -939,10 +921,10 @@ BattleRandom_:: ; 3ec11
FillInExpBar::
dr $3f196, $3f243
-GetMonBackpic::
+GetBattleMonBackpic::
dr $3f243, $3f282
-GetMonFrontpic::
+GetEnemyMonFrontpic::
dr $3f282, $3f2c7
StartBattle::
@@ -1036,7 +1018,7 @@ BasementKeyFunction:
SacredAshFunction:
dr $50819, $5087d
-CopyPkmnToTempMon::
+CopyMonToTempMon::
dr $5087d, $50940
PrintMonTypes::
@@ -1069,7 +1051,7 @@ GetGender::
ListMovePP::
dr $51364, $513e4
-Predef22::
+Unused_PlaceEnemyHPLevel::
dr $513e4, $51437
PlaceNonFaintStatus::
@@ -1087,19 +1069,19 @@ CalcExpAtLevel:
GetUnownLetter::
dr $51749, $51780
-GetFrontpic::
+GetMonFrontpic::
dr $51780, $51786
FrontpicPredef::
dr $51786, $51803
-GetBackpic::
+GetMonBackpic::
dr $51803, $518a0
GetTrainerPic::
dr $518a0, $518fa
-DecompressPredef::
+DecompressGet2bpp::
dr $518fa, $51b0b
INCLUDE "data/pokemon/base_stats.asm"
@@ -1167,8 +1149,8 @@ ResetClock_:
DeleteSaveData_:
dr $8c310, $8c355
-Predef35::
-Predef36::
+DummyPredef35::
+DummyPredef36::
ret
UpdateTimeOfDayPal:: ; 8c356
@@ -1195,7 +1177,7 @@ FadeBlackQuickly:
Function8c3e9:: ; 8c3e9
dr $8c3e9, $8c513
-Predef_StartBattle::
+DoBattleTransition::
dr $8c513, $8ca5e
PlayWhirlpoolSound:
@@ -1268,7 +1250,7 @@ Function919c1:
TownMap_:
dr $91a4f, $91c7f
-Area_::
+Pokedex_GetArea::
dr $91c7f, $92c36
Function92c36:
dr $92c36, $94000
@@ -1372,7 +1354,7 @@ Functionc7cd0:
SECTION "bank32", ROMX, BANK[$32]
dr $c8000, $c80d6
-Predef2F::
+DummyPredef2F::
dr $c80d6, $c900a
INCLUDE "data/moves/animations.asm"
@@ -1387,8 +1369,8 @@ DisplayCaughtContestMonStats:
DisplayAlreadyCaughtText:
dr $cc0c8, $cc0d6
-Predef38::
-Predef39::
+DummyPredef38::
+DummyPredef39::
ret
PlayBattleAnim::
@@ -1496,7 +1478,7 @@ MagikarpHouseSign:
SECTION "bank3f", ROMX, BANK[$3f]
nop
-Predef3A::
+DummyPredef3A::
ret
dr $fc002, $100000
diff --git a/maps/BillsHouse.asm b/maps/BillsHouse.asm
index ff83b797..69a7fda7 100644
--- a/maps/BillsHouse.asm
+++ b/maps/BillsHouse.asm
@@ -239,7 +239,7 @@ BillsGrandpaYouDontHaveItTextText:
BillsGrandpaShownPokemonText:
text "Ah, so that is"
line "@"
- text_from_ram wStringBuffer3
+ text_ram wStringBuffer3
text "?"
para "Isn't it cute!"
diff --git a/maps/BluesHouse.asm b/maps/BluesHouse.asm
index e402d0c9..27d46e07 100644
--- a/maps/BluesHouse.asm
+++ b/maps/BluesHouse.asm
@@ -104,7 +104,7 @@ DaisyAlrightText:
done
GroomedMonLooksContentText:
- text_from_ram wStringBuffer3
+ text_ram wStringBuffer3
text " looks"
line "content."
done
diff --git a/maps/CeladonCafe.asm b/maps/CeladonCafe.asm
index 90e655d2..77227fbe 100644
--- a/maps/CeladonCafe.asm
+++ b/maps/CeladonCafe.asm
@@ -196,7 +196,7 @@ EatathonContestPosterText:
FoundLeftoversText:
text "<PLAYER> found a"
line "@"
- text_from_ram wStringBuffer3
+ text_ram wStringBuffer3
text "."
done
diff --git a/maps/CeladonDeptStore6F.asm b/maps/CeladonDeptStore6F.asm
index d30f23f1..80c810f9 100644
--- a/maps/CeladonDeptStore6F.asm
+++ b/maps/CeladonDeptStore6F.asm
@@ -102,7 +102,7 @@ CeladonClangText:
text "Clang!"
para "@"
- text_from_ram wStringBuffer3
+ text_ram wStringBuffer3
text_start
line "popped out."
done
diff --git a/maps/CeladonGameCornerPrizeRoom.asm b/maps/CeladonGameCornerPrizeRoom.asm
index 0ddca0a0..82642f83 100644
--- a/maps/CeladonGameCornerPrizeRoom.asm
+++ b/maps/CeladonGameCornerPrizeRoom.asm
@@ -233,7 +233,7 @@ CeladonPrizeRoom_AskWhichPrizeText:
CeladonPrizeRoom_ConfirmPurchaseText:
text "OK, so you wanted"
line "a @"
- text_from_ram wStringBuffer3
+ text_ram wStringBuffer3
text "?"
done
diff --git a/maps/DragonsDenB1F.asm b/maps/DragonsDenB1F.asm
index 13d20b01..0496893a 100644
--- a/maps/DragonsDenB1F.asm
+++ b/maps/DragonsDenB1F.asm
@@ -259,7 +259,7 @@ SilverText_Training2:
Text_FoundDragonFang:
text "<PLAYER> found a"
line "@"
- text_from_ram wStringBuffer3
+ text_ram wStringBuffer3
text "!"
done
diff --git a/maps/ElmsLab.asm b/maps/ElmsLab.asm
index a74212f4..4f7ef7b5 100644
--- a/maps/ElmsLab.asm
+++ b/maps/ElmsLab.asm
@@ -754,7 +754,7 @@ ChoseStarterText:
ReceivedStarterText:
text "<PLAYER> received"
line "@"
- text_from_ram wStringBuffer3
+ text_ram wStringBuffer3
text "!"
done
diff --git a/maps/GoldenrodDeptStore6F.asm b/maps/GoldenrodDeptStore6F.asm
index e718b4ee..b11be1ed 100644
--- a/maps/GoldenrodDeptStore6F.asm
+++ b/maps/GoldenrodDeptStore6F.asm
@@ -100,7 +100,7 @@ GoldenrodVendingText:
GoldenrodClangText:
text "Clang! A can of"
line "@"
- text_from_ram wStringBuffer3
+ text_ram wStringBuffer3
text_start
cont "popped out!"
done
diff --git a/maps/GoldenrodGameCorner.asm b/maps/GoldenrodGameCorner.asm
index 89e9c0c9..ea87b115 100644
--- a/maps/GoldenrodGameCorner.asm
+++ b/maps/GoldenrodGameCorner.asm
@@ -374,7 +374,7 @@ GoldenrodGameCornerPrizeVendorWhichPrizeText:
done
GoldenrodGameCornerPrizeVendorConfirmPrizeText:
- text_from_ram wStringBuffer3
+ text_ram wStringBuffer3
text "."
line "Is that right?"
done
diff --git a/maps/GoldenrodHappinessRater.asm b/maps/GoldenrodHappinessRater.asm
index 2b2093a2..0918b6b7 100644
--- a/maps/GoldenrodHappinessRater.asm
+++ b/maps/GoldenrodHappinessRater.asm
@@ -78,7 +78,7 @@ GoldenrodHappinessRaterTeacherText:
para "Oh? Let me see"
line "your @"
- text_from_ram wStringBuffer3
+ text_ram wStringBuffer3
text "…"
done
diff --git a/maps/GoldenrodUnderground.asm b/maps/GoldenrodUnderground.asm
index 1e629348..eaecc1c5 100644
--- a/maps/GoldenrodUnderground.asm
+++ b/maps/GoldenrodUnderground.asm
@@ -617,19 +617,19 @@ UnknownText_0x7c87b:
done
HaircutBrosText_SlightlyHappier:
- text_from_ram wStringBuffer3
+ text_ram wStringBuffer3
text " looks a"
line "little happier."
done
HaircutBrosText_Happier:
- text_from_ram wStringBuffer3
+ text_ram wStringBuffer3
text " looks"
line "happy."
done
HaircutBrosText_MuchHappier:
- text_from_ram wStringBuffer3
+ text_ram wStringBuffer3
text " looks"
line "delighted!"
done
diff --git a/maps/LakeOfRageMagikarpHouse.asm b/maps/LakeOfRageMagikarpHouse.asm
index 52c5a1e0..4731ec48 100644
--- a/maps/LakeOfRageMagikarpHouse.asm
+++ b/maps/LakeOfRageMagikarpHouse.asm
@@ -199,10 +199,10 @@ LakeOfRageMagikarpHouseUnusedRecordText:
text "CURRENT RECORD"
para "@"
- text_from_ram wStringBuffer3
+ text_ram wStringBuffer3
text " caught by"
line "@"
- text_from_ram wStringBuffer4
+ text_ram wStringBuffer4
db "@@"
LakeOfRageMagikarpHouse_MapEvents:
diff --git a/maps/Pokecenter2F.asm b/maps/Pokecenter2F.asm
index 82b63a39..4d3d7413 100644
--- a/maps/Pokecenter2F.asm
+++ b/maps/Pokecenter2F.asm
@@ -499,7 +499,7 @@ Text_PleaseEnter:
Text_RejectNewMon:
text "Sorry--@"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text_start
line "can't be taken."
prompt
@@ -507,17 +507,17 @@ Text_RejectNewMon:
Text_RejectMonWithNewMove:
text "You can't take the"
line "@"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text " with a"
cont "@"
- text_from_ram wStringBuffer2
+ text_ram wStringBuffer2
text "."
prompt
Text_RejectMonWithMail:
text "You can't take the"
line "@"
- text_from_ram wStringBuffer1
+ text_ram wStringBuffer1
text " that"
cont "has MAIL with you."
prompt
diff --git a/maps/RadioTower1F.asm b/maps/RadioTower1F.asm
index 7caa1e5d..0350ae51 100644
--- a/maps/RadioTower1F.asm
+++ b/maps/RadioTower1F.asm
@@ -237,7 +237,7 @@ UnknownText_0x5ceba:
UnknownText_0x5cf3a:
text "This week's ID"
line "number is @"
- text_from_ram wStringBuffer3
+ text_ram wStringBuffer3
text "."
done
diff --git a/maps/Route35NationalParkGate.asm b/maps/Route35NationalParkGate.asm
index 35040564..18520fdd 100644
--- a/maps/Route35NationalParkGate.asm
+++ b/maps/Route35NationalParkGate.asm
@@ -224,7 +224,7 @@ MovementData_0x6a2e9:
UnknownText_0x6a2eb:
text "Today's @"
- text_from_ram wStringBuffer3
+ text_ram wStringBuffer3
text "."
line "That means the"
@@ -287,7 +287,7 @@ UnknownText_0x6a4c6:
para "You'll have to use"
line "@"
- text_from_ram wStringBuffer3
+ text_ram wStringBuffer3
text ", the"
para "first #MON in"
@@ -371,7 +371,7 @@ UnknownText_0x6a71f:
UnknownText_0x6a79a:
text "You still have @"
- text_from_ram wStringBuffer3
+ text_ram wStringBuffer3
text_start
line "minute(s) left."
diff --git a/maps/Route36NationalParkGate.asm b/maps/Route36NationalParkGate.asm
index 52fc9ac2..8e967b6c 100644
--- a/maps/Route36NationalParkGate.asm
+++ b/maps/Route36NationalParkGate.asm
@@ -475,7 +475,7 @@ MovementData_0x6add1:
UnknownText_0x6add5:
text "Today's @"
- text_from_ram wStringBuffer3
+ text_ram wStringBuffer3
text "."
line "That means the"
@@ -538,7 +538,7 @@ UnknownText_0x6afb0:
para "You'll have to use"
line "@"
- text_from_ram wStringBuffer3
+ text_ram wStringBuffer3
text ", the"
para "first #MON in"
@@ -622,7 +622,7 @@ UnknownText_0x6b209:
UnknownText_0x6b284:
text "You still have @"
- text_from_ram wStringBuffer3
+ text_ram wStringBuffer3
text_start
line "minutes left."
diff --git a/maps/TrainerHouseB1F.asm b/maps/TrainerHouseB1F.asm
index 00de895a..1380d805 100644
--- a/maps/TrainerHouseB1F.asm
+++ b/maps/TrainerHouseB1F.asm
@@ -119,7 +119,7 @@ TrainerHouseB1FIntroText:
done
TrainerHouseB1FYourOpponentIsText:
- text_from_ram wStringBuffer3
+ text_ram wStringBuffer3
text " is your"
line "opponent today."
done
diff --git a/predef/sgb.asm b/predef/sgb.asm
index bd1480c2..eee36a80 100755
--- a/predef/sgb.asm
+++ b/predef/sgb.asm
@@ -1,4 +1,4 @@
-Predef_LoadSGBLayout: ; 8c2d (2:4c2d)
+LoadSGBLayout: ; 8c2d (2:4c2d)
call CheckCGB
jp nz, Predef_LoadSGBLayoutCGB
ld a, b
diff --git a/wram.asm b/wram.asm
index a154bc94..53e3d02b 100644
--- a/wram.asm
+++ b/wram.asm
@@ -1,13 +1,16 @@
-INCLUDE "includes.asm"
+INCLUDE "contents.asm"
+INCLUDE "constants.asm"
+
INCLUDE "macros/wram.asm"
+
INCLUDE "vram.asm"
SECTION "Audio RAM", WRAM0
-wc000::
+
wMusic::
-wMusicPlaying:: ; c000
+
; nonzero if playing
- ds 1
+wMusicPlaying:: db ; c100
wChannels::
wChannel1:: channel_struct wChannel1 ; c101
@@ -18,121 +21,113 @@ wChannel4:: channel_struct wChannel4 ; c197
wSFXChannels::
wChannel5:: channel_struct wChannel5 ; c1c9
wChannel6:: channel_struct wChannel6 ; c1fb
-wChannel7:: channel_struct wChannel7 ; c12d
-wChannel8:: channel_struct wChannel8 ; c15f
+wChannel7:: channel_struct wChannel7 ; c22d
+wChannel8:: channel_struct wChannel8 ; c25f
+
+ ds 1 ; c291
- ds 1 ; c191
-wCurTrackDuty:: ds 1
-wCurTrackIntensity:: ds 1
+wCurTrackDuty:: db
+wCurTrackIntensity:: db
wCurTrackFrequency:: dw
wUnusedBCDNumber:: db ; BCD value, dummied out
-wCurNoteDuration:: ds 1 ; used in MusicE0 and LoadNote
+wCurNoteDuration:: db ; used in MusicE0 and LoadNote
-wCurMusicByte:: ; c198
- ds 1
-wCurChannel:: ; c199
- ds 1
-wVolume:: ; c19a
-; corresponds to $ff24
+wCurMusicByte:: db ; c298
+wCurChannel:: db ; c299
+wVolume:: ; c29a
+; corresponds to rNR50
; Channel control / ON-OFF / Volume (R/W)
; bit 7 - Vin->SO2 ON/OFF
; bit 6-4 - SO2 output level (volume) (# 0-7)
; bit 3 - Vin->SO1 ON/OFF
; bit 2-0 - SO1 output level (volume) (# 0-7)
- ds 1
-wSoundOutput:: ; c19b
-; corresponds to $ff25
+ db
+wSoundOutput:: ; c29b
+; corresponds to rNR51
; bit 4-7: ch1-4 so2 on/off
; bit 0-3: ch1-4 so1 on/off
- ds 1
-wSoundInput:: ; c19c
-; corresponds to $ff26
+ db
+wSoundInput:: ; c29c
+; corresponds to rNR52
; bit 7: global on/off
; bit 0: ch1 on/off
; bit 1: ch2 on/off
; bit 2: ch3 on/off
; bit 3: ch4 on/off
- ds 1
+ db
-wMusicID::
-wMusicIDLo:: ; c19d
- ds 1
-wMusicIDHi:: ; c19e
- ds 1
-wMusicBank:: ; c19f
- ds 1
-wNoiseSampleAddress::
-wNoiseSampleAddressLo:: ; c1a0
- ds 1
-wNoiseSampleAddressHi:: ; c1a1
- ds 1
-wNoiseSampleDelay:: ; noise delay? ; c1a2
- ds 1
-; c1a3
- ds 1
-wMusicNoiseSampleSet:: ; c1a4
- ds 1
-wSFXNoiseSampleSet:: ; c1a5
- ds 1
-wLowHealthAlarm:: ; c1a6
+wMusicID:: dw ; c29d
+wMusicBank:: db ; c29f
+wNoiseSampleAddress:: dw ; c2a0
+wNoiseSampleDelay:: db ; c2a2
+ ds 1 ; c2a3
+wMusicNoiseSampleSet:: db ; c2a4
+wSFXNoiseSampleSet:: db ; c2a5
+
+wLowHealthAlarm:: ; c2a6
; bit 7: on/off
; bit 4: pitch
; bit 0-3: counter
- ds 1
-wMusicFade:: ; c1a7
+ db
+
+wMusicFade:: ; c2a7
; fades volume over x frames
; bit 7: fade in/out
; bit 0-5: number of frames for each volume level
; $00 = none (default)
- ds 1
-wMusicFadeCount:: ; c1a8
- ds 1
-wMusicFadeID::
-wMusicFadeIDLo:: ; c1a9
- ds 1
-wMusicFadeIDHi:: ; c1aa
- ds 1
+ db
+wMusicFadeCount:: db ; c2a8
+wMusicFadeID:: dw ; c2a9
+
ds 5
-wCryPitch:: ; c1b0
- ds 2
-wCryLength:: ; c1b2
- ds 2
-wLastVolume:: ; c1b4
- ds 1
-wUnusedMusicF9Flag:: ds 1 ; c1b5
-wSFXPriority:: ; c1b6
+
+wCryPitch:: dw ; c2b0
+wCryLength:: dw ; c2b2
+
+wLastVolume:: db ; c2b4
+wUnusedMusicF9Flag:: db ; c2b5
+
+wSFXPriority:: ; c2b6
; if nonzero, turn off music when playing sfx
+ db
+
ds 1
- ds 1
-wChannel1JumpCondition:: ds 1
-wChannel2JumpCondition:: ds 1
-wChannel3JumpCondition:: ds 1
-wChannel4JumpCondition:: ds 1
-wStereoPanningMask:: ds 1 ; c1bc
-wCryTracks:: ; c1bd
+
+wChannel1JumpCondition:: db
+wChannel2JumpCondition:: db
+wChannel3JumpCondition:: db
+wChannel4JumpCondition:: db
+
+wStereoPanningMask:: db ; c2bc
+
+wCryTracks:: ; c2bd
; plays only in left or right track depending on what side the monster is on
; both tracks active outside of battle
- ds 1
-wSFXDuration:: ds 1
-wCurSFX:: ; c1bf
+ db
+
+wSFXDuration:: db
+wCurSFX:: ; c2bf
; id of sfx currently playing
- ds 1
+ db
wChannelsEnd::
-wMapMusic:: ; c1c0
- ds 1
-wDontPlayMapMusicOnReload:: ds 1
+wMapMusic:: db ; c2c0
+
+wDontPlayMapMusicOnReload:: db
wMusicEnd::
+
SECTION "WRAM", WRAM0
-wLZAddress:: dw ; c1c2
-wLZBank:: ds 1 ; c1c4
-wc1c5:: ds 1 ; c1c5
-wInputType:: ds 1 ; c1c6
-wAutoInputAddress:: dw ; c1c7
-wAutoInputBank:: ds 1 ; c1c9
-wAutoInputLength:: ds 1 ; c1ca
+wLZAddress:: dw ; c2c2
+wLZBank:: db ; c2c4
+
+wBoxAlignment:: db
+
+wInputType:: db ; c2c6
+wAutoInputAddress:: dw ; c2c7
+wAutoInputBank:: db ; c2c9
+wAutoInputLength:: db ; c2ca
wMonStatusFlags:: ds 1 ; c1cb
wGameLogicPaused:: ds 1 ; c1cc
@@ -2433,8 +2428,8 @@ wcfd8:: ds 1 ; cfd8
wcfd9:: ds 1 ; cfd9
wcfda:: ds 1 ; cfda
wPredefID:: ds 1 ; cfdb
-wPredefHLBuffer:: dw ; cfdc
-wPredefPointerBuffer:: dw ; cfde
+wPredefTemp:: dw ; cfdc
+wPredefAddress:: dw ; cfde
wFarCallBCBuffer:: dw ; cfe0
wcfe2:: ds 1 ; cfe2
wcfe3:: ds 1 ; cfe3
@@ -2841,11 +2836,11 @@ wOptions:: ; d199
ds 1
wSaveFileExists:: ds 1 ; d19a
-wTextBoxFrame:: ; d19b
+wTextboxFrame:: ; d19b
; bits 0-2: textbox frame 0-7
ds 1
-wTextBoxFlags:: ; d19c
+wTextboxFlags:: ; d19c
; bit 0: 1-frame text delay
; bit 1: when unset, no text delay
ds 1