Adding bank14, good chunk of text transcribed and labelled in bank0d, renaming farcall to callab, and much more (#112)
Some checks failed
CI / build (push) Has been cancelled

* Sporadic constantifying and function naming

* Added bank 14

* Delete .DS_Store files

* Delete EOL whitespace

* Use Tab indents instead of four spaces

* Identify some routines

* Identify more stuff

* Identified party and box structs

* Identified wBattleMon and wEnemyMon structs

* Macro'd landmarks, cleaned up comments

---------

Co-authored-by: vulcandth <vulcandth@gmail.com>
This commit is contained in:
DrippingYellow 2025-01-16 12:12:38 -06:00 committed by GitHub
parent daff281646
commit ce247cc761
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
101 changed files with 5397 additions and 3332 deletions

3
.gitignore vendored
View File

@ -22,3 +22,6 @@ __pycache__
# utility output # utility output
/coverage.png /coverage.png
# macos files
.DS_STORE

View File

@ -128,6 +128,7 @@ $(BUILD)/%.tilemap: %.png | $$(dir $$@)
$(RGBGFX) -t $@ $< $(RGBGFX) -t $@ $<
.PRECIOUS: $(BUILD)/%.sgb.tilemap .PRECIOUS: $(BUILD)/%.sgb.tilemap
export LC_ALL=C
$(BUILD)/%.sgb.tilemap: %.bin | $$(dir $$@) $(BUILD)/%.sgb.tilemap: %.bin | $$(dir $$@)
tr < $< -d '\000' > $@ tr < $< -d '\000' > $@

View File

@ -654,7 +654,7 @@ Music_Bicycle_branch_ed7c9::
sound_loop 0, Music_Bicycle_branch_ed7c9 sound_loop 0, Music_Bicycle_branch_ed7c9
Music_Bicycle_Ch4:: Music_Bicycle_Ch4::
toggle_noise 1 toggle_noise 1
drum_speed 12 drum_speed 12
rest 2 rest 2

View File

@ -241,7 +241,7 @@ Music_NidorinoIntro_Ch3::
Music_NidorinoIntro_Ch4:: Music_NidorinoIntro_Ch4::
toggle_noise 2 toggle_noise 2
drum_speed 6 drum_speed 6
drum_note 4, 1 drum_note 4, 1
drum_note 4, 1 drum_note 4, 1

View File

@ -337,7 +337,7 @@ Music_OakIntro_branch_ec77c::
sound_ret sound_ret
Music_OakIntro_Ch4:: Music_OakIntro_Ch4::
toggle_noise 0 toggle_noise 0
Music_OakIntro_branch_ec7e9:: Music_OakIntro_branch_ec7e9::
drum_speed 12 drum_speed 12

View File

@ -590,7 +590,7 @@ Music_ViridianCity_branch_ec441::
sound_ret sound_ret
Music_ViridianCity_Ch4:: Music_ViridianCity_Ch4::
toggle_noise 0 toggle_noise 0
Music_ViridianCity_branch_ec464:: Music_ViridianCity_branch_ec464::
drum_speed 12 drum_speed 12

View File

@ -58,3 +58,6 @@ INCLUDE "constants/sgb_constants.asm"
INCLUDE "constants/map_object_constants.asm" INCLUDE "constants/map_object_constants.asm"
INCLUDE "constants/start_menu_constants.asm" INCLUDE "constants/start_menu_constants.asm"
INCLUDE "constants/movement_constants.asm" INCLUDE "constants/movement_constants.asm"
INCLUDE "constants/flypoint_constants.asm"
INCLUDE "constants/spawnpoint_constants.asm"

View File

@ -294,3 +294,13 @@
charmap "", $fd charmap "", $fd
charmap "", $fe charmap "", $fe
charmap "", $ff charmap "", $ff
; Actual characters (from gfx/font/font_battle_extra.png)
charmap "<LV>", $6e
charmap "<DO>", $70 ; hiragana small do, unused
charmap "◀", $71
charmap "<ID>", $73
charmap "№", $74

View File

@ -0,0 +1,25 @@
; Fly point indexes (see data/flypoint)
const_def
const FLY_POINT_SILENT_HILL ; 0
const FLY_POINT_OLD ; 1
const FLY_POINT_WEST ; 2
const FLY_POINT_HAITEKU ; 3
const FLY_POINT_FONTO ; 4
const FLY_POINT_BAADON ; 5
const FLY_POINT_NEWTYPE ; 6
const FLY_POINT_SUGAR ; 7
const FLY_POINT_BULL_FOREST ; 8
const FLY_POINT_STAND ; 9
const FLY_POINT_KANTO ; 10
const FLY_POINT_PRINCE ; 11
const FLY_POINT_MT_FUJI ; 12
const FLY_POINT_SOUTH ; 13
const FLY_POINT_NORTH ; 14
; Unused?
const FLY_POINT_ROUTE_15 ; 15
const FLY_POINT_ROUTE_18 ; 16
DEF FLY_POINT_N_A EQU $FF

View File

@ -43,3 +43,5 @@ DEF DOUBLESPRITEBUFFERSIZE EQU 2 * SPRITEBUFFERSIZE
const SPRITEOAMSTRUCT_ATTRIBUTES ; 3 const SPRITEOAMSTRUCT_ATTRIBUTES ; 3
DEF SPRITEOAMSTRUCT_LENGTH EQU const_value DEF SPRITEOAMSTRUCT_LENGTH EQU const_value
DEF NUM_SPRITE_OAM_STRUCTS EQU 40 ; see wShadowOAM DEF NUM_SPRITE_OAM_STRUCTS EQU 40 ; see wShadowOAM
DEF OAM_YCOORD_HIDDEN EQU 160 ; hides an OAM offscreen

View File

@ -51,14 +51,7 @@ DEF NUM_MAP_PALETTES EQU const_value
const FISHGROUP_REMORAID const FISHGROUP_REMORAID
const FISHGROUP_QWILFISH_NO_SWARM const FISHGROUP_QWILFISH_NO_SWARM
; connection directions (see data/maps/data.asm) ; wMapConnections / connection directions (see data/maps/data.asm)
const_def
const EAST_F
const WEST_F
const SOUTH_F
const NORTH_F
; wMapConnections
const_def const_def
shift_const EAST shift_const EAST
shift_const WEST shift_const WEST

View File

@ -5,13 +5,13 @@ DEF OBJECT_SPRITE_TILE rb ; 02
DEF OBJECT_MOVEMENT_TYPE rb ; 03 DEF OBJECT_MOVEMENT_TYPE rb ; 03
DEF OBJECT_FLAGS1 rb ; 04 DEF OBJECT_FLAGS1 rb ; 04
DEF OBJECT_FLAGS2 rb ; 05 DEF OBJECT_FLAGS2 rb ; 05
DEF OBJECT_PALETTE rb ; 06 DEF OBJECT_WALKING rb ; 06
DEF OBJECT_WALKING rb ; 07 DEF OBJECT_DIRECTION rb ; 07
DEF OBJECT_DIRECTION rb ; 08 DEF OBJECT_STEP_TYPE rb ; 08
DEF OBJECT_STEP_TYPE rb ; 09 DEF OBJECT_STEP_DURATION rb ; 09
DEF OBJECT_STEP_DURATION rb ; 0a DEF OBJECT_ACTION rb ; 0a
DEF OBJECT_ACTION rb ; 0b DEF OBJECT_STEP_FRAME rb ; 0b
DEF OBJECT_STEP_FRAME rb ; 0c DEF OBJECT_0C rb ; 0c
DEF OBJECT_FACING rb ; 0d DEF OBJECT_FACING rb ; 0d
DEF OBJECT_TILE rb ; 0e DEF OBJECT_TILE rb ; 0e
DEF OBJECT_LAST_TILE rb ; 0f DEF OBJECT_LAST_TILE rb ; 0f
@ -21,13 +21,13 @@ DEF OBJECT_LAST_MAP_X rb ; 12
DEF OBJECT_LAST_MAP_Y rb ; 13 DEF OBJECT_LAST_MAP_Y rb ; 13
DEF OBJECT_INIT_X rb ; 14 DEF OBJECT_INIT_X rb ; 14
DEF OBJECT_INIT_Y rb ; 15 DEF OBJECT_INIT_Y rb ; 15
DEF OBJECT_RADIUS rb ; 16 DEF OBJECT_RADIUS_X rb ; 16
DEF OBJECT_SPRITE_X rb ; 17 DEF OBJECT_RADIUS_Y rb ; 17
DEF OBJECT_SPRITE_Y rb ; 18 DEF OBJECT_SPRITE_X rb ; 18
DEF OBJECT_SPRITE_X_OFFSET rb ; 19 DEF OBJECT_SPRITE_Y rb ; 19
DEF OBJECT_SPRITE_Y_OFFSET rb ; 1a DEF OBJECT_SPRITE_X_OFFSET rb ; 1a
DEF OBJECT_MOVEMENT_INDEX rb ; 1b DEF OBJECT_SPRITE_Y_OFFSET rb ; 1b
DEF OBJECT_1C rb ; 1c DEF OBJECT_MOVEMENT_INDEX rb ; 1c
DEF OBJECT_1D rb ; 1d DEF OBJECT_1D rb ; 1d
DEF OBJECT_1E rb ; 1e DEF OBJECT_1E rb ; 1e
DEF OBJECT_1F rb ; 1f DEF OBJECT_1F rb ; 1f

View File

@ -1,11 +1,10 @@
; MenuHeader flags ; MenuHeader flags
const_def const_def
shift_const MENU_RESTORE_TILES ; Will be set if MENU_BACKUP_TILES(_2) is set. shift_const MENU_RESTORE_TILES ; Will be set if MENU_BACKUP_TILES(_2) is set.
shift_const MENU_UNUSED_1 const_skip 2
shift_const MENU_UNUSED_2
shift_const MENU_NO_CLICK_SFX shift_const MENU_NO_CLICK_SFX
shift_const MENU_SPRITE_ANIMS shift_const MENU_SPRITE_ANIMS
shift_const MENU_UNUSED_3 shift_const MENU_UNUSED
shift_const MENU_BACKUP_TILES shift_const MENU_BACKUP_TILES
shift_const MENU_BACKUP_TILES_2 shift_const MENU_BACKUP_TILES_2
@ -32,37 +31,49 @@
shift_const SCROLLINGMENU_ENABLE_START shift_const SCROLLINGMENU_ENABLE_START
shift_const SCROLLINGMENU_ENABLE_SELECT shift_const SCROLLINGMENU_ENABLE_SELECT
; _2DMenu more flags
const_def
shift_const _2DMENU_EXIT_RIGHT ; 0
shift_const _2DMENU_EXIT_LEFT ; 1
shift_const _2DMENU_EXIT_UP ; 2
shift_const _2DMENU_EXIT_DOWN ; 3
shift_const _2DMENU_WRAP_LEFT_RIGHT ; 4
shift_const _2DMENU_WRAP_UP_DOWN ; 5
shift_const _2DMENU_ENABLE_SPRITE_ANIMS ; 6
shift_const _2DMENU_DISABLE_JOYPAD_FILTER ; 7
; _2DMenu more flags 2
const_def
const_skip 7
shift_const _2DMENU_EXITING ; 7
; MonMenuOptions indexes (see data/mon_menu.asm) ; MonMenuOptions indexes (see data/mon_menu.asm)
; used by PokemonActionSubmenu (see engine/menus/start_menu.asm) ; used by PokemonActionSubmenu (see engine/menus/start_menu.asm)
const_def 1 const_def 1
; moves ; moves
const MONMENUITEM_CUT ; 1 const MONMENUITEM_CUT ; 1
const MONMENUITEM_FLY ; 2 const MONMENUITEM_FLY ; 2
const MONMENUITEM_SURF ; 3 const MONMENUITEM_SURF ; 3
const MONMENUITEM_STRENGTH ; 4 const MONMENUITEM_STRENGTH ; 4
const MONMENUITEM_WATERFALL ; 5 const MONMENUITEM_FLASH ; 5
const MONMENUITEM_FLASH ; 6 const MONMENUITEM_WHIRLPOOL ; 6
const MONMENUITEM_WHIRLPOOL ; 7 const MONMENUITEM_BOUNCE ; 7
const MONMENUITEM_DIG ; 8 const MONMENUITEM_DIG ; 8
const MONMENUITEM_TELEPORT ; 9 const MONMENUITEM_TELEPORT ; 9
const MONMENUITEM_SOFTBOILED ; 10 const MONMENUITEM_SOFTBOILED ; 10
const MONMENUITEM_HEADBUTT ; 11
const MONMENUITEM_ROCKSMASH ; 12
const MONMENUITEM_MILKDRINK ; 13
const MONMENUITEM_SWEETSCENT ; 14
; options ; options
const MONMENUITEM_STATS ; 15 const MONMENUITEM_STATS ; 11
const MONMENUITEM_SWITCH ; 16 const MONMENUITEM_SWITCH ; 12
const MONMENUITEM_ITEM ; 17 const MONMENUITEM_ITEM ; 13
const MONMENUITEM_CANCEL ; 18 const MONMENUITEM_CANCEL ; 14
const MONMENUITEM_MOVE ; 19 const MONMENUITEM_MOVE ; 15
const MONMENUITEM_MAIL ; 20 const MONMENUITEM_MAIL ; 16
const MONMENUITEM_ERROR ; 21 const MONMENUITEM_ERROR ; 17
; MonMenuOptions categories ; MonMenuOptions categories
DEF MONMENU_FIELD_MOVE EQU 0 DEF MONMENU_MENUOPTION EQU 0
DEF MONMENU_MENUOPTION EQU 1 DEF MONMENU_FIELD_MOVE EQU 1
DEF NUM_MONMENU_ITEMS EQU 8 DEF NUM_MONMENU_ITEMS EQU 8

View File

@ -192,3 +192,33 @@
const MON_BELLSPROUT ; bc const MON_BELLSPROUT ; bc
const MON_WEEPINBELL ; bd const MON_WEEPINBELL ; bd
const MON_VICTREEBEL ; be const MON_VICTREEBEL ; be
; Unown forms
const_def 1
const UNOWN_A ; 1
const UNOWN_B ; 2
const UNOWN_C ; 3
const UNOWN_D ; 4
const UNOWN_E ; 5
const UNOWN_F ; 6
const UNOWN_G ; 7
const UNOWN_H ; 8
const UNOWN_I ; 9
const UNOWN_J ; 10
const UNOWN_K ; 11
const UNOWN_L ; 12
const UNOWN_M ; 13
const UNOWN_N ; 14
const UNOWN_O ; 15
const UNOWN_P ; 16
const UNOWN_Q ; 17
const UNOWN_R ; 18
const UNOWN_S ; 19
const UNOWN_T ; 20
const UNOWN_U ; 21
const UNOWN_V ; 22
const UNOWN_W ; 23
const UNOWN_X ; 24
const UNOWN_Y ; 25
const UNOWN_Z ; 26
DEF NUM_UNOWN EQU const_value - 1 ; 26

View File

@ -100,8 +100,9 @@ DEF CAUGHT_EGG_LEVEL EQU 1
DEF PARTY_LENGTH EQU 6 DEF PARTY_LENGTH EQU 6
; boxes ; boxes
DEF MONS_PER_BOX EQU 20 ; The Japanese version fits more Pokémon into the boxes, but has less boxes total
DEF NUM_BOXES EQU 14 DEF MONS_PER_BOX EQU 30
DEF NUM_BOXES EQU 10
; hall of fame ; hall of fame
DEF HOF_MON_LENGTH EQUS "(wHallOfFamePokemonListMon1End - wHallOfFamePokemonListMon1)" DEF HOF_MON_LENGTH EQUS "(wHallOfFamePokemonListMon1End - wHallOfFamePokemonListMon1)"

View File

@ -0,0 +1,49 @@
; Spawn point indexes (see data/maps/landmarks.asm)
const_def
const SPAWN_POINT_NONE
const SPAWN_POINT_SILENT
const SPAWN_POINT_OLD
const SPAWN_POINT_WEST
const SPAWN_POINT_HIGH_TECH
const SPAWN_POINT_FOUNT
const SPAWN_POINT_BIRDON
const SPAWN_POINT_NEW_TYPE
const SPAWN_POINT_SUGAR
const SPAWN_POINT_BLUE_FOREST
const SPAWN_POINT_STAND
const SPAWN_POINT_KANTO
const SPAWN_POINT_PRINCE
const SPAWN_POINT_MT_FUJI
const SPAWN_POINT_SOUTH
const SPAWN_POINT_NORTH
const SPAWN_POINT_ROUTE_15
const SPAWN_POINT_ROUTE_18
const SPAWN_POINT_POWER_PLANT_1
const SPAWN_POINT_POWER_PLANT_2
const SPAWN_POINT_POWER_PLANT_3
const SPAWN_POINT_POWER_PLANT_4
const SPAWN_POINT_RUINS_1
const SPAWN_POINT_RUINS_2
const SPAWN_POINT_MINES_1
const SPAWN_POINT_MINES_2
const SPAWN_POINT_MINES_3
const SPAWN_POINT_MINES_4
const SPAWN_POINT_MINES_5
const SPAWN_POINT_MINES_6
const SPAWN_POINT_MINES_7
const SPAWN_POINT_HIDEOUT_1
const SPAWN_POINT_HIDEOUT_2
const SPAWN_POINT_HIDEOUT_3
const SPAWN_POINT_SLOWPOKE_WELL_1
const SPAWN_POINT_SLOWPOKE_WELL_2
const SPAWN_POINT_POKEMON_LEAGUE_1
const SPAWN_POINT_POKEMON_LEAGUE_1_2
const SPAWN_POINT_POKEMON_LEAGUE_2
const SPAWN_POINT_POKEMON_LEAGUE_3
const SPAWN_POINT_POKEMON_LEAGUE_4
const SPAWN_POINT_POKEMON_LEAGUE_5
const SPAWN_POINT_POKEMON_LEAGUE_6
const SPAWN_POINT_POKEMON_LEAGUE_7
const SPAWN_POINT_POKEMON_LEAGUE_7_2
const SPAWN_POINT_SILENT_HILL

View File

@ -3,7 +3,7 @@ DEF NAME_LENGTH EQU 11 ; English
DEF PLAYER_NAME_LENGTH EQU 6 ; Japanese DEF PLAYER_NAME_LENGTH EQU 6 ; Japanese
DEF BOX_NAME_LENGTH EQU 9 ; English DEF BOX_NAME_LENGTH EQU 9 ; English
DEF MON_NAME_LENGTH EQU 6 DEF MON_NAME_LENGTH EQU 6
DEF MOVE_NAME_LENGTH EQU 13 ; English DEF MOVE_NAME_LENGTH EQU 5
DEF ITEM_NAME_LENGTH EQU 11 DEF ITEM_NAME_LENGTH EQU 11
DEF TRAINER_CLASS_NAME_LENGTH EQU 13 ; English DEF TRAINER_CLASS_NAME_LENGTH EQU 13 ; English

27
data/maps/flypoints.asm Normal file
View File

@ -0,0 +1,27 @@
INCLUDE "constants.asm"
SECTION "data/maps/flypoints.asm", ROMX
;
; Table that the game reads for determining which Fly point to move to depending on D-Pad input.
; Each row corresponds to the index of a Fly point.
;
; db UP, DOWN, LEFT, RIGHT
;
FlyPointPaths:
db FLY_POINT_PRINCE, FLY_POINT_N_A, FLY_POINT_OLD, FLY_POINT_KANTO ; FLY_POINT_SILENT_HILL
db FLY_POINT_HAITEKU, FLY_POINT_SILENT_HILL, FLY_POINT_WEST, FLY_POINT_SILENT_HILL ; FLY_POINT_OLD
db FLY_POINT_BAADON, FLY_POINT_OLD, FLY_POINT_HAITEKU, FLY_POINT_OLD ; FLY_POINT_WEST
db FLY_POINT_FONTO, FLY_POINT_WEST, FLY_POINT_SOUTH, FLY_POINT_WEST ; FLY_POINT_HAITEKU
db FLY_POINT_SOUTH, FLY_POINT_HAITEKU, FLY_POINT_SOUTH, FLY_POINT_BAADON ; FLY_POINT_FONTO
db FLY_POINT_FONTO, FLY_POINT_WEST, FLY_POINT_FONTO, FLY_POINT_NEWTYPE ; FLY_POINT_BAADON
db FLY_POINT_SUGAR, FLY_POINT_N_A, FLY_POINT_BAADON, FLY_POINT_BULL_FOREST ; FLY_POINT_NEWTYPE
db FLY_POINT_N_A, FLY_POINT_NEWTYPE, FLY_POINT_N_A, FLY_POINT_N_A ; FLY_POINT_SUGAR
db FLY_POINT_NORTH, FLY_POINT_STAND, FLY_POINT_NEWTYPE, FLY_POINT_NORTH ; FLY_POINT_BULL_FOREST
db FLY_POINT_BULL_FOREST, FLY_POINT_KANTO, FLY_POINT_KANTO, FLY_POINT_BULL_FOREST ; FLY_POINT_STAND
db FLY_POINT_STAND, FLY_POINT_SILENT_HILL, FLY_POINT_SILENT_HILL, FLY_POINT_STAND ; FLY_POINT_KANTO
db FLY_POINT_MT_FUJI, FLY_POINT_SILENT_HILL, FLY_POINT_N_A, FLY_POINT_N_A ; FLY_POINT_PRINCE
db FLY_POINT_N_A, FLY_POINT_PRINCE, FLY_POINT_N_A, FLY_POINT_N_A ; FLY_POINT_MT_FUJI
db FLY_POINT_FONTO, FLY_POINT_HAITEKU, FLY_POINT_N_A, FLY_POINT_FONTO ; FLY_POINT_SOUTH
db FLY_POINT_N_A, FLY_POINT_BULL_FOREST, FLY_POINT_BULL_FOREST, FLY_POINT_N_A ; FLY_POINT_NORTH

View File

@ -1,7 +1,62 @@
INCLUDE "constants.asm" INCLUDE "constants.asm"
MACRO landmark
; X, Y.
; Unlike the final game, the prototype actually stores and reads the bytes swapped, with Y first and X second.
db \2 + 16, \1 + 8
ENDM
SECTION "data/maps/landmarks.asm", ROMX SECTION "data/maps/landmarks.asm", ROMX
LandmarkPositions:
landmark -8, -16 ; LANDMARK_NONE
landmark 148, 12 ; LANDMARK_NORTH
landmark 148, 24 ; LANDMARK_BULL_FOREST_ROUTE_3
landmark 148, 36 ; LANDMARK_BULL_FOREST
landmark 148, 48 ; LANDMARK_BULL_FOREST_ROUTE_2
landmark 148, 60 ; LANDMARK_STAND
landmark 148, 76 ; LANDMARK_STAND_ROUTE
landmark 140, 92 ; LANDMARK_KANTO_EAST_ROUTE
landmark 124, 92 ; LANDMARK_KANTO
landmark 112, 92 ; LANDMARK_ROUTE_SILENT_EAST
landmark 100, 92 ; LANDMARK_SILENT_HILL
landmark 100, 84 ; LANDMARK_PRINCE
landmark 100, 76 ; LANDMARK_MT_FUJI
landmark 92, 92 ; LANDMARK_ROUTE_1_P1
landmark 84, 92 ; LANDMARK_ROUTE_1_P2
landmark 84, 76 ; LANDMARK_OLD_CITY
landmark 72, 76 ; LANDMARK_ROUTE_2
landmark 60, 76 ; LANDMARK_WEST
landmark 60, 64 ; LANDMARK_BAADON_ROUTE_1
landmark 60, 52 ; LANDMARK_BAADON
landmark 84, 52 ; LANDMARK_BAADON_ROUTE_2
landmark 100, 52 ; LANDMARK_BAADON_ROUTE_3
landmark 108, 60 ; LANDMARK_ROUTE_15
landmark 116, 60 ; LANDMARK_NEWTYPE
landmark 116, 48 ; LANDMARK_SUGAR_ROUTE
landmark 116, 36 ; LANDMARK_SUGAR
landmark 124, 60 ; LANDMARK_NEWTYPE_ROUTE
landmark 132, 44 ; LANDMARK_ROUTE_18
landmark 140, 36 ; LANDMARK_BULL_FOREST_ROUTE_1
landmark 120, 76 ; LANDMARK_1C
landmark 96, 68 ; LANDMARK_1D
landmark 48, 44 ; LANDMARK_FONTO_ROUTE_3
landmark 36, 44 ; LANDMARK_FONTO
landmark 36, 36 ; LANDMARK_FONTO_ROUTE_2
landmark 24, 28 ; LANDMARK_FONTO_ROUTE_6
landmark 12, 36 ; LANDMARK_FONTO_ROUTE_5
landmark 12, 44 ; LANDMARK_SOUTH
landmark 24, 44 ; LANDMARK_FONTO_ROUTE_1
landmark 12, 56 ; LANDMARK_HAITEKU_WEST_ROUTE_OCEAN
landmark 20, 68 ; LANDMARK_HAITEKU_WEST_ROUTE
landmark 36, 68 ; LANDMARK_HAITEKU
landmark 48, 68 ; LANDMARK_WASTE_BRIDGE
landmark 60, 44 ; LANDMARK_FONTO_ROUTE_4
landmark 36, 56 ; LANDMARK_FONTO_BRIDGE
SECTION "data/maps/landmarks.asm@LandmarkNames", ROMX
LandmarkNames:: LandmarkNames::
db "サイレント@" ; SILENT db "サイレント@" ; SILENT
db "オールド@" ; OLD db "オールド@" ; OLD

View File

@ -0,0 +1,72 @@
INCLUDE "constants.asm"
SECTION "data/maps/spawn_points.asm", ROMX
;
; Spawn points used by Fly, Debug Warp, etc.
;
; Group, Map, X Position, Y Position
;
SpawnPoints:
; Fly destinations
db GROUP_SILENT_HILL, MAP_SILENT_HILL, $05, $05
db GROUP_OLD_CITY, MAP_OLD_CITY, $1b, $1d
db GROUP_WEST, MAP_WEST, $19, $0f
db GROUP_HAITEKU, MAP_HAITEKU, $1f, $0b
db GROUP_FONTO, MAP_FONTO, $03, $0d
db GROUP_BAADON, MAP_BAADON, $0f, $05
db GROUP_NEWTYPE, MAP_NEWTYPE, $07, $09
db GROUP_SUGAR, MAP_SUGAR, $09, $0b
db GROUP_BULL_FOREST, MAP_BULL_FOREST, $0d, $13
db GROUP_STAND, MAP_STAND, $21, $15
db GROUP_KANTO, MAP_KANTO, $31, $1f
db GROUP_PRINCE, MAP_PRINCE, $05, $05
db GROUP_MT_FUJI, MAP_MT_FUJI, $05, $05
db GROUP_SOUTH, MAP_SOUTH, $21, $0f
db GROUP_NORTH, MAP_NORTH, $0d, $0b
; Seemingly recognized as valid warps by hacking wFlyDestination, but inaccessible other than through debug Warp
db GROUP_NEWTYPE, MAP_ROUTE_15, $09, $0b
db GROUP_NEWTYPE, MAP_ROUTE_18, $0d, $1d
; Hidden warps (do not appear in debug menu normally)
db GROUP_POWER_PLANT_1, MAP_POWER_PLANT_1, $06, $06
db GROUP_POWER_PLANT_2, MAP_POWER_PLANT_2, $06, $06
db GROUP_POWER_PLANT_3, MAP_POWER_PLANT_3, $04, $10
db GROUP_POWER_PLANT_4, MAP_POWER_PLANT_4, $06, $06
db GROUP_RUINS_OF_ALPH_ENTRANCE, MAP_RUINS_OF_ALPH_ENTRANCE, $09, $0d
db GROUP_RUINS_OF_ALPH_MAIN, MAP_RUINS_OF_ALPH_MAIN, $17, $2f
db GROUP_CAVE_MINECARTS_1, MAP_CAVE_MINECARTS_1, $06, $0a
db GROUP_CAVE_MINECARTS_2, MAP_CAVE_MINECARTS_2, $06, $06
db GROUP_CAVE_MINECARTS_3, MAP_CAVE_MINECARTS_3, $06, $06
db GROUP_CAVE_MINECARTS_4, MAP_CAVE_MINECARTS_4, $06, $06
db GROUP_CAVE_MINECARTS_5, MAP_CAVE_MINECARTS_5, $06, $06
db GROUP_CAVE_MINECARTS_6, MAP_CAVE_MINECARTS_6, $06, $06
db GROUP_CAVE_MINECARTS_7, MAP_CAVE_MINECARTS_7, $06, $06
db GROUP_OFFICE_1, MAP_OFFICE_1, $10, $0d
db GROUP_OFFICE_2, MAP_OFFICE_2, $08, $08
db GROUP_OFFICE_3, MAP_OFFICE_3, $08, $08
db GROUP_SLOWPOKE_WELL_ENTRANCE, MAP_SLOWPOKE_WELL_ENTRANCE, $09, $0b
db GROUP_SLOWPOKE_WELL_MAIN, MAP_SLOWPOKE_WELL_MAIN, $09, $23
db GROUP_OLD_CITY_GYM, MAP_OLD_CITY_GYM, $06, $06
db GROUP_WEST_GYM, MAP_WEST_GYM, $06, $06
db GROUP_HAITEKU_LEAGUE_2F, MAP_HAITEKU_LEAGUE_2F, $06, $06
db GROUP_BAADON_LEAGUE_2F, MAP_BAADON_LEAGUE_2F, $06, $06
db GROUP_NEWTYPE_LEAGUE_2F, MAP_NEWTYPE_LEAGUE_2F, $06, $06
db GROUP_BULL_LEAGUE_2F, MAP_BULL_LEAGUE_2F, $06, $06
db GROUP_STAND_LEAGUE_2F, MAP_STAND_LEAGUE_2F, $06, $06
db GROUP_KANTO_LEAGUE_2F, MAP_KANTO_LEAGUE_2F, $06, $06
db GROUP_KANTO_LEAGUE_2_2F, MAP_KANTO_LEAGUE_2_2F, $06, $06
; Only appears in debug menu, likely for the purposes of testing the demo
db GROUP_SHIZUKANA_OKA, MAP_SHIZUKANA_OKA, $10, $10
db $ff, $ff, $ff, $ff

View File

@ -60,24 +60,24 @@ GiveItemPredef::
add_predef Function28d6e add_predef Function28d6e
add_predef Function40ac7 add_predef Function40ac7
add_predef Function40000 add_predef Function40000
add_predef Function40b5c ; 30 add_predef ConvertMon_1to2 ; 30
add_predef Function50000 add_predef CopyMonToTempMon
add_predef Function50bfe add_predef ListMoves
add_predef Function50bcd add_predef Function50bcd
add_predef Function50b92 add_predef Function50b92
add_predef Function508c4 add_predef Function508c4
add_predef Function50771 add_predef PartyMenuInBattle_Setup
add_predef Function50774 add_predef PartyMenuInBattle
add_predef Function5081f ; 38 add_predef Function5081f ; 38
add_predef Function506d4 add_predef ListMovePP
add_predef Function5069e add_predef GetGender
add_predef Function502b5 add_predef Function502b5
add_predef Function50244 add_predef DrawPlayerHP
add_predef Function50248 add_predef DrawEnemyHP
add_predef Function500c6 add_predef GetTypeName
add_predef Function500a0 add_predef PrintMoveType
add_predef Function50073 ; 40 add_predef PrintMonTypes ; 40
add_predef Function50ed9 add_predef GetUnownLetter
add_predef Functioncb6ff add_predef Functioncb6ff
add_predef Functioncb710 add_predef Functioncb710
add_predef Functioncb733 add_predef Functioncb733

View File

@ -40,7 +40,7 @@ DoBattleTransition:
ret ret
.InitGFX: .InitGFX:
callba ReanchorBGMap_NoOAMUpdate farcall ReanchorBGMap_NoOAMUpdate
call UpdateSprites call UpdateSprites
call ConvertTrainerBattlePokeballTilesTo2bpp call ConvertTrainerBattlePokeballTilesTo2bpp
call WaitBGMap call WaitBGMap

View File

@ -537,7 +537,7 @@ BattleBGEffect_HeadFollow:
ret ret
_QueueBattleAnimation: _QueueBattleAnimation:
callab QueueBattleAnimation callfar QueueBattleAnimation
ret ret
BattleBGEffect_27: BattleBGEffect_27:
@ -2340,12 +2340,12 @@ BattleBGEffects_CheckSGB:
BattleBGEffects_Sine: BattleBGEffects_Sine:
ld e, a ld e, a
callab BattleAnim_Sine_e callfar BattleAnim_Sine_e
ld a, e ld a, e
ret ret
BattleBGEffects_Cosine: BattleBGEffects_Cosine:
ld e, a ld e, a
callab BattleAnim_Cosine_e callfar BattleAnim_Cosine_e
ld a, e ld a, e
ret ret

View File

@ -84,11 +84,11 @@ DebugMenuOptionFight::
ret ret
DebugMenuOptionSubGames:: DebugMenuOptionSubGames::
callab CallSubGameMenu callfar CallSubGameMenu
jp DebugMenu jp DebugMenu
DebugMenuOptionMonsterTest:: DebugMenuOptionMonsterTest::
ld hl, wPokedexOwned ld hl, wPokedexCaught
ld de, wPokedexSeen ld de, wPokedexSeen
ld b, NUM_POKEMON / 8 ld b, NUM_POKEMON / 8
ld a, %11111111 ld a, %11111111
@ -101,7 +101,7 @@ DebugMenuOptionMonsterTest::
ld a, (1 << ((NUM_POKEMON - 1) % 8)) - 1 ; discount #251 ld a, (1 << ((NUM_POKEMON - 1) % 8)) - 1 ; discount #251
ld [hl], a ld [hl], a
ld [de], a ld [de], a
callab MonsterTest callfar MonsterTest
ld a, %11100100 ld a, %11100100
ldh [rBGP], a ldh [rBGP], a
@ -109,7 +109,7 @@ Function40eb::
jp DebugMenu jp DebugMenu
DebugMenuOptionName:: DebugMenuOptionName::
callab OpenTrainerGear callfar OpenTrainerGear
ld a, %11100100 ld a, %11100100
ldh [rBGP], a ldh [rBGP], a
jp DebugMenu jp DebugMenu
@ -292,22 +292,22 @@ CallSubGameMenu:
db "スロット@" db "スロット@"
SubGameMenu_PokerGame: SubGameMenu_PokerGame:
callab PokerMinigame callfar PokerMinigame
ret ret
SubGameMenu_PuzzleGame: SubGameMenu_PuzzleGame:
callab FifteenPuzzleMinigame callfar FifteenPuzzleMinigame
ret ret
SubGameMenu_CardFlipGame: SubGameMenu_CardFlipGame:
callab MemoryMinigame callfar MemoryMinigame
ret ret
SubGameMenu_PicrossGame: SubGameMenu_PicrossGame:
callab PicrossMinigame callfar PicrossMinigame
ret ret
SubGameMenu_SlotMachineGame: SubGameMenu_SlotMachineGame:
callab SlotMachineGame callfar SlotMachineGame
ret ret

View File

@ -37,7 +37,7 @@ FieldDebug_ChangeTransportation:
call MenuTextBox call MenuTextBox
.update_sprite .update_sprite
callab GetPlayerSprite callfar GetPlayerSprite
ld a, BUTTONS ld a, BUTTONS
call FieldDebug_WaitJoypadInput call FieldDebug_WaitJoypadInput
call CloseWindow call CloseWindow
@ -149,7 +149,7 @@ FieldDebug_CheckFacingSurfable:
ret ret
FieldDebug_SetSurfDirection: FieldDebug_SetSurfDirection:
ld a, [wPlayerWalking] ld a, [wPlayerDirection]
srl a srl a
srl a srl a
ld e, a ld e, a

View File

@ -36,7 +36,7 @@ FieldDebug_FollowNPCTest:
ret ret
.asm_fc9a5: .asm_fc9a5:
callab SpawnFollower callfar SetFollowerDefaultAttributes
ld a, 1 ld a, 1
call Function15ed call Function15ed
ld a, 1 ld a, 1
@ -50,7 +50,7 @@ FieldDebug_FollowNPCTest:
.asm_fc9c2: .asm_fc9c2:
call Function18cc call Function18cc
ld a, 1 ld a, 1
call Function169f call DeleteMapObject
ret ret
.MenuHeader: .MenuHeader:

View File

@ -166,9 +166,9 @@ FieldDebug_ItemTest:
.DetermineItemTossable: .DetermineItemTossable:
push hl push hl
callab _CheckTossableItem callfar _CheckTossableItem
pop hl pop hl
ld a, [wItemAttributeParamBuffer] ld a, [wItemAttributeValue]
and a and a
jr nz, .not_tossable jr nz, .not_tossable
call .tossable call .tossable
@ -183,7 +183,7 @@ FieldDebug_ItemTest:
.tossable .tossable
push hl push hl
callab SelectQuantityToToss callfar SelectQuantityToToss
jr c, .cancel_toss jr c, .cancel_toss
call .load_item call .load_item
ld hl, .TossConfirmText ld hl, .TossConfirmText

View File

@ -57,7 +57,7 @@ DebugMapViewer::
jr c, .continue jr c, .continue
call Function2c4a call Function2c4a
jr nc, .loop jr nc, .loop
callab Function824c callfar Function824c
jr .loop jr .loop
.continue .continue
@ -141,7 +141,7 @@ DebugMapViewer::
ld d, 2 ld d, 2
ld b, 1 ld b, 1
ld c, 0 ld c, 0
callab Function83a2 callfar Function83a2
ld a, DEBUGMAPVIEWER_WAIT_FINISHED_MOVING ld a, DEBUGMAPVIEWER_WAIT_FINISHED_MOVING
ldh [hDebugMapViewerJumptable], a ldh [hDebugMapViewerJumptable], a
and a and a
@ -159,7 +159,7 @@ DebugMapViewer::
.Cleanup: .Cleanup:
ld a, 1 ld a, 1
call Function169f call DeleteMapObject
call Function18cc call Function18cc
ld a, 0 ld a, 0
call Function1908 call Function1908
@ -190,7 +190,7 @@ DebugMapViewer_ShowSelectedDetails:
ld a, 0 ld a, 0
ldh [hTextBoxCursorBlinkInterval], a ldh [hTextBoxCursorBlinkInterval], a
ld bc, wObjectStructs ld bc, wObjectStructs
callab Function77a1 callfar Function77a1
jr nc, .skip jr nc, .skip
call RefreshScreen call RefreshScreen
call .DisplayActorCastID call .DisplayActorCastID
@ -323,7 +323,7 @@ DebugMapViewer_DoMovement:
ret ret
DebugMapViewer_ReplacePlayerObject: DebugMapViewer_ReplacePlayerObject:
callab Function807b callfar DebugMapViewer_SetupCursor
ld a, 1 ld a, 1
call Function15ed call Function15ed
ld a, 1 ld a, 1

View File

@ -18,7 +18,7 @@ FieldDebug_PokemonFollowing:
ld a, [wPlayerStructEnd] ld a, [wPlayerStructEnd]
and a and a
jr nz, .ShowUnableText jr nz, .ShowUnableText
callab Function8031 callfar SpawnFollower
ld de, SFX_24 ld de, SFX_24
call PlaySFX call PlaySFX
call CloseWindow call CloseWindow
@ -27,7 +27,7 @@ FieldDebug_PokemonFollowing:
ret ret
.remove .remove
callab Function806c callfar DeleteFollower
ld de, SFX_25 ld de, SFX_25
call PlaySFX call PlaySFX
jr .done jr .done

View File

@ -32,7 +32,7 @@ FieldDebug_MoveToRoute1Entrance:
ld e, $d ld e, $d
ld b, 0 ld b, 0
ld c, 1 ld c, 1
callab Function833a callfar Function833a
ld a, 0 ld a, 0
ld hl, wMovementBuffer ld hl, wMovementBuffer
call LoadMovementDataPointer call LoadMovementDataPointer

View File

@ -8,7 +8,7 @@ FieldDebug_PokemartMenu:
.DoPokemartMenu: .DoPokemartMenu:
call LoadStandardMenuHeader call LoadStandardMenuHeader
callab asm_24860 callfar asm_24860
ld hl, DebugMart_PokemartMenuText ld hl, DebugMart_PokemartMenuText
call PrintText call PrintText
ld hl, .MenuHeader ld hl, .MenuHeader
@ -68,7 +68,7 @@ DebugMart_BuyMenuHeader:
ld a, [wScrollingMenuCursorPosition] ld a, [wScrollingMenuCursorPosition]
ld c, a ld c, a
ld b, 0 ld b, 0
ld hl, wcc40 ld hl, wcc3a
add hl, bc add hl, bc
add hl, bc add hl, bc
add hl, bc add hl, bc
@ -122,7 +122,7 @@ DebugMart_Buy:
ld [wItemQuantityBuffer], a ld [wItemQuantityBuffer], a
ld hl, .HowManyText ld hl, .HowManyText
call PrintText call PrintText
callab asm_24c64 callfar asm_24c64
call ExitMenu call ExitMenu
jr c, .done jr c, .done
predef LoadItemData predef LoadItemData
@ -172,14 +172,14 @@ DebugMart_Sell:
ret ret
; unused ; unused
callab CheckItemsQuantity callfar CheckItemsQuantity
jp c, .no_items jp c, .no_items
call LoadStandardMenuHeader call LoadStandardMenuHeader
xor a xor a
ld [wActiveBackpackPocket], a ld [wActiveBackpackPocket], a
.bag_loop .bag_loop
callab DrawBackpack callfar DrawBackpack
callab DebugBackpackLoop callfar DebugBackpackLoop
jr c, .close_bag jr c, .close_bag
call .DoBagFunctions call .DoBagFunctions
jr nc, .bag_loop jr nc, .bag_loop
@ -191,8 +191,8 @@ DebugMart_Sell:
ret ret
.DoBagFunctions: .DoBagFunctions:
callab CheckItemMenu callfar CheckItemMenu
ld a, [wItemAttributeParamBuffer] ld a, [wItemAttributeValue]
ld hl, .BagJumptable ld hl, .BagJumptable
call CallJumptable call CallJumptable
ret ret
@ -207,7 +207,7 @@ DebugMart_Sell:
dw .CheckSellableItem dw .CheckSellableItem
.FlipPocket: .FlipPocket:
callab FlipPocket2Status callfar FlipPocket2Status
xor a xor a
ld [wSelectedSwapPosition], a ld [wSelectedSwapPosition], a
ret ret
@ -223,14 +223,14 @@ DebugMart_Sell:
prompt prompt
.BallPocket: .BallPocket:
callab BallPocket callfar BallPocket
jr nc, .CheckSellableItem jr nc, .CheckSellableItem
and a and a
ret ret
.CheckSellableItem: .CheckSellableItem:
callab _CheckTossableItem callfar _CheckTossableItem
ld a, [wItemAttributeParamBuffer] ld a, [wItemAttributeValue]
and a and a
jr nz, .not_sellable jr nz, .not_sellable
jp .ItemQuantityPrompt jp .ItemQuantityPrompt
@ -260,7 +260,7 @@ DebugMart_Sell:
.ItemQuantityPrompt: .ItemQuantityPrompt:
ld hl, .HowManyItemsText ld hl, .HowManyItemsText
call PrintText call PrintText
callab asm_24c64 callfar asm_24c64
jr c, .got_quantity jr c, .got_quantity
jr .CannotSellItem jr .CannotSellItem
@ -280,7 +280,7 @@ DebugMart_LoadItems:
ld [hli], a ld [hli], a
cp -1 cp -1
jr nz, .load_loop jr nz, .load_loop
ld hl, wcc40 ld hl, wcc3a
ld de, wcd60 + 1 ld de, wcd60 + 1
.load_loop2 .load_loop2
ld a, [de] ld a, [de]
@ -298,7 +298,7 @@ DebugMart_LoadItems:
.GetPrice: .GetPrice:
push hl push hl
ld [wCurItem], a ld [wCurItem], a
callab GetItemPrice callfar GetItemPrice
ld a, d ld a, d
ld [wcdc3], a ld [wcdc3], a
ld a, e ld a, e

View File

@ -36,7 +36,7 @@ FieldDebug_SpriteViewer:
ld [wSpriteViewerMenuStartingItem], a ld [wSpriteViewerMenuStartingItem], a
ld a, 1 ld a, 1
ldh [hTextBoxCursorBlinkInterval], a ldh [hTextBoxCursorBlinkInterval], a
callab Function77ad callfar Function77ad
ret nc ret nc
ldh a, [hEventID] ldh a, [hEventID]
call GetObjectStruct call GetObjectStruct
@ -110,8 +110,8 @@ FieldDebug_SpriteViewer:
ret ret
.SetFollowing: .SetFollowing:
ld hl, Function8031 ld hl, SpawnFollower
ld a, BANK(Function8031) ld a, BANK(SpawnFollower)
call QueueScript call QueueScript
; Exits immediately after setting sprite to follow the player ; Exits immediately after setting sprite to follow the player
@ -259,7 +259,7 @@ FieldDebug_SpriteViewer:
call PlaceString call PlaceString
call .SetStartingPoint call .SetStartingPoint
ld c, a ld c, a
callab Function14144 callfar Function14144
ld hl, vSprites + $c0 ld hl, vSprites + $c0
ld de, vFont ld de, vFont
ld bc, 12 ld bc, 12

View File

@ -8,7 +8,7 @@ FieldDebug_Teleport:
ld d, a ld d, a
ld a, [wMapId] ld a, [wMapId]
ld e, a ld e, a
callab IsSpawnPoint callfar IsSpawnPoint
jr nc, .not_spawn_point jr nc, .not_spawn_point
ld a, [wMapGroup] ld a, [wMapGroup]
ld [wLastSpawnMapGroup], a ld [wLastSpawnMapGroup], a

View File

@ -29,10 +29,10 @@ FieldDebug_Toolgear:
jr .UpdateDayNightCycle jr .UpdateDayNightCycle
.ChangeRTC: .ChangeRTC:
callab SetTime callfar SetTime
.UpdateDayNightCycle: .UpdateDayNightCycle:
callab Function8c325 callfar Function8c325
call UpdateTimePals call UpdateTimePals
ld a, FIELDDEBUG_RETURN_CLOSE ld a, FIELDDEBUG_RETURN_CLOSE
ret ret

View File

@ -75,9 +75,9 @@ ENDM
Functionfd91e: ; unused? Functionfd91e: ; unused?
call .asm_fd930 call .asm_fd930
ld a, [wCountSetBitsResult] ld a, [wNumSetBits]
ld [wMonDexIndex], a ld [wCurPartySpecies], a
callab Pokepic callfar Pokepic
ret ret
.asm_fd930 .asm_fd930
@ -85,6 +85,6 @@ Functionfd91e: ; unused?
cp 251 cp 251
jr nc, .asm_fd930 jr nc, .asm_fd930
inc a inc a
ld [wCountSetBitsResult], a ld [wNumSetBits], a
ret ret

View File

@ -114,7 +114,7 @@ FieldDebug_DoVRAMViewer:
call .LoadTilesetsCommon call .LoadTilesetsCommon
call DisableLCD call DisableLCD
call LoadFont call LoadFont
callab LoadBackpackGraphics callfar LoadBackpackGraphics
call EnableLCD call EnableLCD
ret ret
@ -136,7 +136,7 @@ FieldDebug_DoVRAMViewer:
call DisableLCD call DisableLCD
call LoadFontsBattleExtra call LoadFontsBattleExtra
call LoadFont call LoadFont
callab LoadPokemonStatsGraphics callfar LoadPokemonStatsGraphics
xor a xor a
ldh [hMapAnims], a ldh [hMapAnims], a
call EnableLCD call EnableLCD
@ -151,7 +151,7 @@ FieldDebug_DoVRAMViewer:
ld bc, $180 tiles ld bc, $180 tiles
call ByteFill call ByteFill
call LoadFont call LoadFont
callab Call_LoadBattleGraphics callfar Call_LoadBattleGraphics
xor a xor a
ldh [hMapAnims], a ldh [hMapAnims], a
call EnableLCD call EnableLCD
@ -159,15 +159,15 @@ FieldDebug_DoVRAMViewer:
call .LoadPokemon call .LoadPokemon
ld de, $9310 ld de, $9310
ld a, 3 ld a, 3
ld [wcdd8], a ld [wTempBattleMonSpecies], a
predef Function3f04a predef Function3f04a
ret ret
.LoadPokemon: .LoadPokemon:
ld a, 3 ld a, 3
ld [wce37], a ld [wce37], a
ld [wMonDexIndex], a ld [wCurPartySpecies], a
call GetMonHeader call GetBaseData
call LoadMonFrontSprite call LoadMonFrontSprite
ret ret
@ -180,7 +180,7 @@ FieldDebug_DoVRAMViewer:
call LoadTilesetGFX call LoadTilesetGFX
ld a, 1 ld a, 1
ldh [hMapAnims], a ldh [hMapAnims], a
callab LoadUsedSpritesGfx callfar LoadUsedSpritesGfx
call LoadFontExtra call LoadFontExtra
call EnableLCD call EnableLCD
ret ret

View File

@ -174,7 +174,7 @@ FieldDebug_Reset:
ret ret
FieldDebug_ShowTrainerCard: ; unreferenced? FieldDebug_ShowTrainerCard: ; unreferenced?
callab _TrainerCard callfar _TrainerCard
ld a, FIELDDEBUG_RETURN_REOPEN ld a, FIELDDEBUG_RETURN_REOPEN
ret ret
@ -185,7 +185,7 @@ INCLUDE "engine/debug/field/change_tileset.inc"
FieldDebug_TownMap: FieldDebug_TownMap:
call LoadStandardMenuHeader call LoadStandardMenuHeader
call ClearSprites call ClearSprites
callab FlyMap callfar FlyMap
call ClearPalettes call ClearPalettes
call Function3657 call Function3657
call LoadFontExtra call LoadFontExtra
@ -201,7 +201,7 @@ FieldDebug_NamePlayer:
call LoadStandardMenuHeader call LoadStandardMenuHeader
ld de, wPlayerName ld de, wPlayerName
ld b, 1 ld b, 1
callab NamingScreen callfar NamingScreen
call ClearBGPalettes call ClearBGPalettes
call ClearTileMap call ClearTileMap
call CloseWindow call CloseWindow
@ -229,7 +229,7 @@ FieldDebug_HealPokemon:
prompt prompt
FieldDebug_CableClub: FieldDebug_CableClub:
callab Function29abf callfar Function29abf
ld a, FIELDDEBUG_RETURN_REOPEN ld a, FIELDDEBUG_RETURN_REOPEN
ret ret
@ -256,9 +256,9 @@ FieldDebug_TrainerGear:
.OpenTrainerGear: .OpenTrainerGear:
call LoadStandardMenuHeader call LoadStandardMenuHeader
callab OpenTrainerGear callfar OpenTrainerGear
call ClearPalettes call ClearPalettes
callab StartMenuLoadSprites callfar StartMenuLoadSprites
call CloseWindow call CloseWindow
ret ret
@ -267,7 +267,7 @@ INCLUDE "engine/debug/field/map_viewer.inc"
INCLUDE "engine/debug/field/item_test.inc" INCLUDE "engine/debug/field/item_test.inc"
FieldDebug_PCMenu: FieldDebug_PCMenu:
callab PokemonCenterPC callfar PokemonCenterPC
ld a, FIELDDEBUG_RETURN_REOPEN ld a, FIELDDEBUG_RETURN_REOPEN
ret ret

View File

@ -3020,7 +3020,7 @@ LoadFonts_NoOAMUpdate:
Function6445: Function6445:
call BackUpTilesToBuffer call BackUpTilesToBuffer
ld a, [wWhichPokemon] ld a, [wCurPartyMon]
ld hl, wPartyMonNicknames ld hl, wPartyMonNicknames
call GetNick call GetNick
ld hl, wStringBuffer1 ld hl, wStringBuffer1
@ -3029,8 +3029,8 @@ Function6445:
call CopyBytes call CopyBytes
.sub_645d .sub_645d
ld hl, wPartyMon1Moves ld hl, wPartyMon1Moves
ld bc, $0030 ld bc, PARTYMON_STRUCT_LENGTH
ld a, [wWhichPokemon] ld a, [wCurPartyMon]
call AddNTimes call AddNTimes
ld d, h ld d, h
ld e, l ld e, l
@ -3043,7 +3043,7 @@ Function6445:
dec b dec b
jr nz, .sub_646d jr nz, .sub_646d
push de push de
call .sub_64f4 call ForgetMove
pop de pop de
jp c, .sub_64d6 jp c, .sub_64d6
push hl push hl
@ -3073,19 +3073,19 @@ Function6445:
ld a, [wBattleMode] ld a, [wBattleMode]
and a and a
jp z, .sub_64eb jp z, .sub_64eb
ld a, [wWhichPokemon] ld a, [wCurPartyMon]
ld b, a ld b, a
ld a, [wcd41] ld a, [wCurBattleMon]
cp b cp b
jp nz, .sub_64eb jp nz, .sub_64eb
ld h, d ld h, d
ld l, e ld l, e
ld de, wca04 ld de, wBattleMonMoves
ld bc, $0004 ld bc, $0004
call CopyBytes call CopyBytes
ld bc, $0011 ld bc, $0011
add hl, bc add hl, bc
ld de, wca0a ld de, wBattleMonPP
ld bc, $0004 ld bc, $0004
call CopyBytes call CopyBytes
jp .sub_64eb jp .sub_64eb
@ -3103,38 +3103,38 @@ Function6445:
call PrintText call PrintText
ld b, $01 ld b, $01
ret ret
.sub_64f4
ForgetMove::
push hl push hl
ld hl, Text65f0 ld hl, AskForgetMoveText
call PrintText call PrintText
call YesNoBox call YesNoBox
pop hl pop hl
ret c ret c
ld bc, $fffc ld bc, -NUM_MOVES
add hl, bc add hl, bc
push hl push hl
ld de, wce2e ld de, wListMoves_MoveIndicesBuffer
ld bc, $0004 ld bc, NUM_MOVES
call CopyBytes call CopyBytes
pop hl pop hl
.sub_650f .sub_650f
push hl push hl
ld hl, Text65a8 ld hl, MoveAskForgetText
call PrintText call PrintText
coord hl, 10, 8 coord hl, 10, 8
ld b, $08 ld b, $08
ld c, $08 ld c, $08
call DrawTextBox call DrawTextBox
coord hl, 12, 10 coord hl, 12, 10
ld a, $28 ld a, SCREEN_WIDTH*2
ld [wFieldMoveScriptID], a ld [wListMovesLineSpacing], a
ld a, $32 predef ListMoves
call Predef
ld a, $0a ld a, $0a
ld [w2DMenuCursorInitY], a ld [w2DMenuCursorInitY], a
ld a, $0b ld a, $0b
ld [w2DMenuCursorInitX], a ld [w2DMenuCursorInitX], a
ld a, [wcd57] ld a, [wNumMoves]
inc a inc a
ld [w2DMenuNumRows], a ld [w2DMenuNumRows], a
ld a, $01 ld a, $01
@ -3199,7 +3199,7 @@ Text65a5:
text_waitbutton text_waitbutton
text_end text_end
Text65a8: MoveAskForgetText:
text "どの わざを" text "どの わざを"
next "わすれさせたい?" next "わすれさせたい?"
done done
@ -3225,26 +3225,20 @@ Text65de:
line "おぼえずに おわった!" line "おぼえずに おわった!"
prompt prompt
Text65f0: AskForgetMoveText:
text_from_ram wcd11 text_from_ram wcd11
text "は あたらしく" text "は あたらしく"
line "" line ""
text_end text_end
Text65fd:
text_from_ram wStringBuffer2 text_from_ram wStringBuffer2
text "を おぼえたい<⋯⋯>" text "を おぼえたい<⋯⋯>"
para "しかし " para "しかし "
text_end text_end
Text6610:
text_from_ram wcd11 text_from_ram wcd11
text "は わざを 4つ" text "は わざを 4つ"
line "おぼえるので せいいっぱいだ!" line "おぼえるので せいいっぱいだ!"
para "" para ""
text_end text_end
Text662e:
text_from_ram wStringBuffer2 text_from_ram wStringBuffer2
text "の かわりに" text "の かわりに"
line "ほかの わざを わすれさせますか?" line "ほかの わざを わすれさせますか?"
@ -3359,7 +3353,7 @@ Function6713:
ld b, $04 ld b, $04
ld c, $0a ld c, $0a
call z, ClearBox call z, ClearBox
ld a, [wMonDexIndex] ld a, [wCurPartySpecies]
ld [wce37], a ld [wce37], a
call GetPokemonName call GetPokemonName
ld a, [wDebugFlags] ld a, [wDebugFlags]
@ -3390,9 +3384,7 @@ Function6713:
call Function3657 call Function3657
jr .sub_6773 jr .sub_6773
.sub_676b .sub_676b
ld hl, Function3e3a7 callfar Function3e3a7
ld a, BANK(Function3e3a7)
call FarCall_hl
.sub_6773 .sub_6773
pop hl pop hl
ld a, [hl] ld a, [hl]
@ -3430,7 +3422,7 @@ Function679d:
jr z, .sub_67d3 jr z, .sub_67d3
ld hl, wPartyMonNicknames ld hl, wPartyMonNicknames
ld bc, $0006 ld bc, $0006
ld a, [wWhichPokemon] ld a, [wCurPartyMon]
call AddNTimes call AddNTimes
ld e, l ld e, l
ld d, h ld d, h
@ -3741,7 +3733,7 @@ Function78f0:
ld a, [hl] ld a, [hl]
xor $08 xor $08
ld [hl], a ld [hl], a
callab UpdateSGBBorder callfar UpdateSGBBorder
call LoadFont call LoadFont
call LoadFontExtra call LoadFontExtra
ld c, $70 ld c, $70

View File

@ -22,18 +22,18 @@ PlayerObjectTemplate:
object_event -4, -4, SPRITE_GOLD, $10, 14, 14, 0, 0, 0, 0, 0, 0, 0, 0 object_event -4, -4, SPRITE_GOLD, $10, 14, 14, 0, 0, 0, 0, 0, 0, 0, 0
db $00, $00 db $00, $00
Function8031: SpawnFollower:
call SpawnFollower call SetFollowerDefaultAttributes
ld a, [wUsedSprites+1] ld a, [wUsedSprites+1]
ld [wMap1ObjectSprite], a ld [wMap1ObjectSprite], a
ld a, $01 ld a, FOLLOWER
call Function1602 call Function1602
ld b, PLAYER ld b, PLAYER
ld c, FOLLOWER ld c, FOLLOWER
call StartFollow call StartFollow
ret ret
SpawnFollower: SetFollowerDefaultAttributes:
ld a, FOLLOWER ld a, FOLLOWER
ld hl, FollowerObjectTemplate ld hl, FollowerObjectTemplate
call CopyPlayerObjectTemplate call CopyPlayerObjectTemplate
@ -48,16 +48,16 @@ FollowerObjectTemplate:
object_event -4, -4, SPRITE_RHYDON, $18, 15, 15, 0, 0, 0, 0, 0, 0, 0, 0 object_event -4, -4, SPRITE_RHYDON, $18, 15, 15, 0, 0, 0, 0, 0, 0, 0, 0
db $00, $00 db $00, $00
Function806c: DeleteFollower:
ld a, $01 ld a, FOLLOWER
call Function169f call DeleteMapObject
xor a xor a
ld [wObjectFollow_Follower], a ld [wObjectFollow_Follower], a
ld a, $ff ld a, $ff
ld [wObjectFollow_Leader], a ld [wObjectFollow_Leader], a
ret ret
Function807b: DebugMapViewer_SetupCursor:
ld a, $01 ld a, $01
ld hl, Data8089 ld hl, Data8089
call CopyPlayerObjectTemplate call CopyPlayerObjectTemplate
@ -183,7 +183,7 @@ Function8125:
ret ret
Function8131: Function8131:
ldh a, [hConnectionStripLength] ldh a, [hMapObjectIndex]
ld e, a ld e, a
ld d, $00 ld d, $00
ld hl, wUnknownWordcc9c ld hl, wUnknownWordcc9c
@ -202,7 +202,7 @@ CopyMapObjectToObjectStruct:
add hl, bc add hl, bc
ld [hl], a ld [hl], a
ld hl, OBJECT_DIRECTION ld hl, OBJECT_STEP_TYPE
add hl, de add hl, de
ld [hl], $00 ld [hl], $00
@ -220,7 +220,7 @@ CopyMapObjectToObjectStruct:
sub [hl] sub [hl]
and $f and $f
swap a swap a
ld hl, OBJECT_SPRITE_X_OFFSET ld hl, OBJECT_SPRITE_Y
add hl, de add hl, de
ld [hl], a ld [hl], a
@ -238,7 +238,7 @@ CopyMapObjectToObjectStruct:
sub [hl] sub [hl]
and $f and $f
swap a swap a
ld hl, OBJECT_SPRITE_Y ld hl, OBJECT_SPRITE_X
add hl, de add hl, de
ld [hl], a ld [hl], a
@ -255,11 +255,11 @@ CopyMapObjectToObjectStruct:
add hl, de add hl, de
ld [hl], -1 ld [hl], -1
ld hl, OBJECT_STEP_DURATION ld hl, OBJECT_ACTION
add hl, de add hl, de
ld [hl], 0 ld [hl], 0
ld hl, OBJECT_WALKING ld hl, OBJECT_DIRECTION
add hl, de add hl, de
ld [hl], 0 ld [hl], 0
@ -278,7 +278,7 @@ CopyMapObjectToObjectStruct:
ld hl, MAPOBJECT_RADIUS ld hl, MAPOBJECT_RADIUS
add hl, bc add hl, bc
ld a, [hl] ld a, [hl]
call Function81f8 call CopyMapObject_Radius
ld hl, MAPOBJECT_SCRIPT_POINTER + 1 ld hl, MAPOBJECT_SCRIPT_POINTER + 1
add hl, bc add hl, bc
@ -317,18 +317,18 @@ InitObjectFlags:
set 4, [hl] set 4, [hl]
ret ret
Function81f8: CopyMapObject_Radius:
push af push af
swap a swap a
and $0f and $0f
inc a inc a
ld hl, OBJECT_RADIUS ld hl, OBJECT_RADIUS_X
add hl, de add hl, de
ld [hl], a ld [hl], a
pop af pop af
and $0f and $0f
inc a inc a
ld hl, OBJECT_SPRITE_X ld hl, OBJECT_RADIUS_Y
add hl, de add hl, de
ld [hl], a ld [hl], a
ret ret
@ -961,9 +961,9 @@ FlyMap:
.sub_86fc .sub_86fc
call DelayFrame call DelayFrame
call GetJoypadDebounced call GetJoypadDebounced
ld hl, EffectObjectJumpNoDelay
ld a, BANK(EffectObjectJumpNoDelay) callfar EffectObjectJumpNoDelay
call FarCall_hl
ld hl, hJoyDown ld hl, hJoyDown
ld a, [hl] ld a, [hl]
and $02 and $02
@ -972,11 +972,11 @@ FlyMap:
and $01 and $01
jr nz, .sub_8743 jr nz, .sub_8743
call Function8747 call Function8747
ld hl, Functionc77d
ld a, BANK(Functionc77d) callfar GetFlyPointMapLocation
call FarCall_hl
ld d, $00 ld d, $00
ld hl, Data8a53 ld hl, LandmarkPositions
add hl, de add hl, de
add hl, de add hl, de
ld d, [hl] ld d, [hl]
@ -1001,29 +1001,29 @@ FlyMap:
ldh [hJoyDebounceSrc], a ldh [hJoyDebounceSrc], a
ret ret
Function8747: Function8747: ; Choose fly destination based on D-Pad input
ld a, [wFlyDestination] ld a, [wFlyDestination]
ld l, a ld l, a
ld h, $00 ld h, $00
add hl, hl add hl, hl
add hl, hl add hl, hl
ld de, Data8a17 ld de, FlyPointPaths
add hl, de add hl, de
ld de, hJoySum ld de, hJoySum
ld a, [de] ld a, [de]
and $40 and D_UP
jr nz, .sub_876e jr nz, .sub_876e
inc hl inc hl
ld a, [de] ld a, [de]
and $80 and D_DOWN
jr nz, .sub_876e jr nz, .sub_876e
inc hl inc hl
ld a, [de] ld a, [de]
and $20 and D_LEFT
jr nz, .sub_876e jr nz, .sub_876e
inc hl inc hl
ld a, [de] ld a, [de]
and $10 and D_RIGHT
jr nz, .sub_876e jr nz, .sub_876e
ret ret
.sub_876e .sub_876e
@ -1095,7 +1095,7 @@ Function87ea:
push hl push hl
ld e, a ld e, a
ld d, $00 ld d, $00
ld hl, Data8a53 ld hl, LandmarkPositions
add hl, de add hl, de
add hl, de add hl, de
ld e, l ld e, l
@ -1167,7 +1167,7 @@ PlaceGoldInMap:
ld hl, vChars0 ld hl, vChars0
lb bc, BANK(GoldSpriteGFX), $04 lb bc, BANK(GoldSpriteGFX), $04
call Request2bpp call Request2bpp
ld de, GoldSpriteGFX + $c0 ld de, GoldSpriteGFX + LEN_2BPP_TILE * 12 ; Gold's front-facing walking sprite
ld hl, vChars0 + $40 ld hl, vChars0 + $40
lb bc, BANK(GoldSpriteGFX), $04 lb bc, BANK(GoldSpriteGFX), $04
call Request2bpp call Request2bpp
@ -1185,7 +1185,7 @@ PlaceGoldInMap:
call GetWorldMapLocation call GetWorldMapLocation
ld e, a ld e, a
ld d, $00 ld d, $00
ld hl, Data8a53 ld hl, LandmarkPositions
add hl, de add hl, de
add hl, de add hl, de
ld d, [hl] ld d, [hl]
@ -1219,57 +1219,3 @@ Function88b3:
TownMapTilemap: TownMapTilemap:
INCBIN "gfx/trainer_gear/town_map.tilemap.rle" INCBIN "gfx/trainer_gear/town_map.tilemap.rle"
SECTION "engine/dumps/bank02.asm@Data8a17", ROMX
Data8a17:
db $0b
db $ff
db $01, $0a, $03, $00, $02, $00, $05, $01, $03, $01, $04, $02, $0d, $02
db $0d, $03, $0d, $05, $04, $02, $04, $06, $07
db $ff
db $05, $08
db $ff
db $06
db $ff
db $ff
db $0e, $09, $06, $0e, $08, $0a, $0a
db $08, $09, $00, $00, $09, $0c, $00
db $ff
db $ff
db $ff
db $0b
db $ff
db $ff
db $04, $03
db $ff
db $04
db $ff
db $08, $08
db $ff
Data8a53:
db $00, $00, $1c, $9c, $28, $9c, $34, $9c
db $40, $9c, $4c, $9c, $5c, $9c, $6c, $94
db $6c, $84, $6c, $78, $6c, $6c, $64, $6c
db $5c, $6c, $6c, $64, $6c, $5c, $5c, $5c
db $5c, $50, $5c, $44, $50, $44, $44, $44
db $44, $5c, $44, $6c, $4c, $74, $4c, $7c
db $40, $7c, $34, $7c, $4c, $84, $3c, $8c
db $34, $94, $5c, $80, $54, $68, $3c, $38
db $3c, $2c, $34, $2c, $2c, $20, $34, $14
db $3c, $14, $3c, $20, $48, $14, $54, $1c
db $54, $2c, $54, $38, $3c, $44, $48, $2c

File diff suppressed because it is too large Load Diff

View File

@ -344,7 +344,7 @@ UpdateItemDescription::
ld c, $12 ld c, $12
call DrawTextBox call DrawTextBox
decoord 1, 14 decoord 1, 14
callab ShowItemDescription callfar ShowItemDescription
ret ret
Pokepic: Pokepic:
@ -358,9 +358,9 @@ Pokepic:
call GetSGBLayout call GetSGBLayout
xor a xor a
ldh [hBGMapMode], a ldh [hBGMapMode], a
ld a, [wMonDexIndex] ld a, [wCurPartySpecies]
ld [wCurSpecies], a ld [wCurSpecies], a
call GetMonHeader call GetBaseData
ld de, vFont ld de, vFont
call LoadMonFrontSprite call LoadMonFrontSprite
ld a, [wMenuBorderTopCoord] ld a, [wMenuBorderTopCoord]
@ -551,7 +551,7 @@ asm_2438a:
ld a, [wMenuDataItems] ld a, [wMenuDataItems]
add [hl] add [hl]
ld b, a ld b, a
ld a, [wcdbc] ld a, [wScrollingMenuListSize]
cp b cp b
jp c, ClearAccumulator jp c, ClearAccumulator
inc [hl] inc [hl]
@ -585,13 +585,13 @@ asm_243c3:
ld l, a ld l, a
ld a, [wMenuDataDisplayFunctionPointer] ld a, [wMenuDataDisplayFunctionPointer]
call GetFarByte call GetFarByte
ld [wcdbc], a ld [wScrollingMenuListSize], a
ld a, [wMenuScrollPosition] ld a, [wMenuScrollPosition]
ld c, a ld c, a
ld a, [wMenuCursorBuffer] ld a, [wMenuCursorBuffer]
add c add c
ld b, a ld b, a
ld a, [wcdbc] ld a, [wScrollingMenuListSize]
inc a inc a
cp b cp b
jr c, .asm_243f2 jr c, .asm_243f2
@ -600,7 +600,7 @@ asm_243c3:
ld a, [wMenuDataItems] ld a, [wMenuDataItems]
add c add c
ld b, a ld b, a
ld a, [wcdbc] ld a, [wScrollingMenuListSize]
inc a inc a
cp b cp b
jr nc, .asm_243fb jr nc, .asm_243fb
@ -615,7 +615,7 @@ asm_243c3:
asm_243fc: asm_243fc:
ld a, [wMenuDataHeaderEnd] ld a, [wMenuDataHeaderEnd]
ld c, a ld c, a
ld a, [wcdbc] ld a, [wScrollingMenuListSize]
ld b, a ld b, a
ld a, [wMenuBorderTopCoord] ld a, [wMenuBorderTopCoord]
add $01 add $01
@ -849,7 +849,7 @@ asm_24576:
ret ret
asm_24590: asm_24590:
ld a, [wcdbc] ld a, [wScrollingMenuListSize]
ld d, a ld d, a
ld a, e ld a, e
cp d cp d
@ -868,7 +868,7 @@ asm_2459b:
push bc push bc
push hl push hl
ld c, d ld c, d
callab GetBallByIndex callfar GetBallByIndex
ld d, c ld d, c
pop hl pop hl
pop bc pop bc
@ -1125,8 +1125,8 @@ Function2473b::
cp $ff cp $ff
jr z, .asm_24762 jr z, .asm_24762
push de push de
callab CheckItemMenu callfar CheckItemMenu
ld a, [wItemAttributeParamBuffer] ld a, [wItemAttributeValue]
ld e, a ld e, a
ld d, $00 ld d, $00
ld hl, .data_2475b ld hl, .data_2475b
@ -1163,8 +1163,8 @@ PlaceMenuItemQuantity::
push de push de
ld a, [wMenuSelection] ld a, [wMenuSelection]
ld [wCurItem], a ld [wCurItem], a
callab _CheckTossableItem callfar _CheckTossableItem
ld a, [wItemAttributeParamBuffer] ld a, [wItemAttributeValue]
pop hl pop hl
and a and a
jr nz, .done jr nz, .done
@ -1177,9 +1177,9 @@ PlaceMenuItemQuantity::
ret ret
asm_247a6: asm_247a6:
ld hl, wPartyMonOTEnd ld hl, wPartyMonNicknames
jr .asm_247ae jr .asm_247ae
ld hl, wdf17 ld hl, wBoxMonNicknames
.asm_247ae .asm_247ae
push de push de
ld a, [wScrollingMenuCursorPosition] ld a, [wScrollingMenuCursorPosition]
@ -1197,8 +1197,8 @@ asm_247ba:
.asm_247c6 .asm_247c6
push de push de
ld a, [wScrollingMenuCursorPosition] ld a, [wScrollingMenuCursorPosition]
ld [wWhichPokemon], a ld [wCurPartyMon], a
predef Function50000 predef CopyMonToTempMon
pop hl pop hl
call PrintLevel call PrintLevel
ret ret
@ -1222,7 +1222,7 @@ asm_247d8:
add hl, de add hl, de
push hl push hl
ld a, [wScrollingMenuCursorPosition] ld a, [wScrollingMenuCursorPosition]
ld hl, wdf17 ld hl, wBoxMonNicknames
call GetNick call GetNick
pop hl pop hl
call PlaceString call PlaceString
@ -1230,11 +1230,10 @@ asm_247d8:
add hl, de add hl, de
push hl push hl
ld a, [wScrollingMenuCursorPosition] ld a, [wScrollingMenuCursorPosition]
ld [wWhichPokemon], a ld [wCurPartyMon], a
ld a, $02 ld a, $02
ld [wMonType], a ld [wMonType], a
ld a, $31 predef CopyMonToTempMon
call Predef
pop hl pop hl
push hl push hl
call PrintLevel call PrintLevel
@ -1242,7 +1241,7 @@ asm_247d8:
ld de, 3 ld de, 3
add hl, de add hl, de
push hl push hl
callab Function5069e callfar GetGender
ld a, $ef ld a, $ef
jr c, .asm_2482e jr c, .asm_2482e
ld a, $f5 ld a, $f5
@ -1257,9 +1256,9 @@ asm_4831:
call MenuBox call MenuBox
call PlaceVerticalMenuItems call PlaceVerticalMenuItems
call MenuBoxCoord2Tile call MenuBoxCoord2Tile
ld de, $0015 ld de, SCREEN_WIDTH + 1
add hl, de add hl, de
ld de, wd15d ld de, wMoney
ld bc, $4306 ld bc, $4306
call PrintNumber call PrintNumber
ret ret
@ -1288,9 +1287,9 @@ asm_24868:
asm_24872: asm_24872:
call MenuBox call MenuBox
call MenuBoxCoord2Tile call MenuBoxCoord2Tile
ld de, $0015 ld de, SCREEN_WIDTH + 1
add hl, de add hl, de
ld de, wd15d ld de, wMoney
ld bc, $4306 ld bc, $4306
call PrintNumber call PrintNumber
ld [hl], $f0 ld [hl], $f0
@ -1302,99 +1301,115 @@ MenuHeader24888:
dw 0 dw 0
db 1 db 1
asm_24890: UnreferencedMenu_24890:
ld hl, .MenuHeader2489a ; An unreferenced, nonfunctional menu that resembles the field debug menu.
ld hl, .MenuData
call LoadMenuHeader call LoadMenuHeader
call VerticalMenu call VerticalMenu
ret ret
.MenuHeader2489a: .MenuData:
db MENU_BACKUP_TILES db MENU_BACKUP_TILES
menu_coords 0, 0, 6, 10 menu_coords 0, 0, 6, 10
dw .text_248a2 dw .MenuText
db 1 db 1
.text_248a2: .MenuText:
db "たエ゛うる@" db (STATICMENU_CURSOR | STATICMENU_NO_TOP_SPACING)
db "かう@" db 3 ; amount of options
db "やめる@" db "うる@" ; Switch
db "くさかり@" db "かう@" ; Buy
db "とんでけ@" db "やめる@" ; Cancel
db "どんぶらこ@" db "くさかり@" ; "Mower"? (replaced by Uproot)
db "フルパワー@" db "とんでけ@" ; "Flight"? (replaced by Wind Ride)
db "ひかりゴケ@" db "どんぶらこ@" ; "Splash"? (replaced by Water Sport)
db "うずしお@" db "フルパワー@" ; "Full Power" (replaced by Strong Arm)
db "とびはねる@" db "ひかりゴケ@" ; Bright Moss
db "あなをほる@" db "うずしお@" ; Whirlpool
db "テレポート@" db "とびはねる@" ; Bounce
db "タマゴうみ@" db "あなをほる@" ; Dig
db "テレポート@" ; Teleport
db "タマゴうみ@" ; Softboiled
Text248e7: ; MonMenuOptionStrings indexes
db "つよさをみる@" const_def 1
db "ならびかえ@" const MONMENUVALUE_STATS ; 1
db "そうび@" const MONMENUVALUE_SWITCH ; 2
db "キャンセル@" const MONMENUVALUE_ITEM ; 3
db "もちわざ@" const MONMENUVALUE_CANCEL ; 4
db "メール@" const MONMENUVALUE_MOVE ; 5
db "エラー!@" const MONMENUVALUE_MAIL ; 6
const MONMENUVALUE_ERROR ; 7
DEF NUM_MONMENUVALUES EQU const_value - 1
Data2490c: MonMenuOptionStrings:
db $f5, $01 db "つよさをみる@" ; Stats
db $f6, $02 db "ならびかえ@" ; Switch
db $f7, $03 db "そうび@" ; Item
db $f8, $04 db "キャンセル@" ; Cancel
db $f9, $05 db "もちわざ@" ; Moves
db $fa, $06 db "メール@" ; Mail
db $fb, $07 db "エラー!@" ; Error!
db $5b, $08
db $64, $09
db $87, $0a
db $ff
Data24921: Unreferenced_FieldMoveList:
db $01, $01, $f5 ; Possibly how the
db $01, $02, $f6 db MOVE_UPROOT, MONMENUITEM_CUT
db $01, $03, $f7 db MOVE_WIND_RIDE, MONMENUITEM_FLY
db $01, $04, $f8 db MOVE_WATER_SPORT, MONMENUITEM_SURF
db $01, $05, $f9 db MOVE_STRONG_ARM, MONMENUITEM_STRENGTH
db $01, $06, $fa db MOVE_BRIGHT_MOSS, MONMENUITEM_FLASH
db $01, $07, $fb db MOVE_WHIRLPOOL, MONMENUITEM_WHIRLPOOL
db $01, $08, $5b db MOVE_BOUNCE, MONMENUITEM_BOUNCE
db $01, $09, $64 db MOVE_DIG, MONMENUITEM_DIG
db $01, $0a, $87 db MOVE_TELEPORT, MONMENUITEM_TELEPORT
db $00, $0b, $01 db MOVE_SOFTBOILED, MONMENUITEM_SOFTBOILED
db $00, $0c, $02 db -1
db $00, $0d, $03
db $00, $0e, $04
db $00, $0f, $05
db $00, $10, $06
db $00, $11, $07
db $ff
Function24955:: MonMenuOptions:
db MONMENU_FIELD_MOVE, MONMENUITEM_CUT, MOVE_UPROOT
db MONMENU_FIELD_MOVE, MONMENUITEM_FLY, MOVE_WIND_RIDE
db MONMENU_FIELD_MOVE, MONMENUITEM_SURF, MOVE_WATER_SPORT
db MONMENU_FIELD_MOVE, MONMENUITEM_STRENGTH, MOVE_STRONG_ARM
db MONMENU_FIELD_MOVE, MONMENUITEM_FLASH, MOVE_BRIGHT_MOSS
db MONMENU_FIELD_MOVE, MONMENUITEM_WHIRLPOOL, MOVE_WHIRLPOOL
db MONMENU_FIELD_MOVE, MONMENUITEM_BOUNCE, MOVE_BOUNCE
db MONMENU_FIELD_MOVE, MONMENUITEM_DIG, MOVE_DIG
db MONMENU_FIELD_MOVE, MONMENUITEM_TELEPORT, MOVE_TELEPORT
db MONMENU_FIELD_MOVE, MONMENUITEM_SOFTBOILED, MOVE_SOFTBOILED
db MONMENU_MENUOPTION, MONMENUITEM_STATS, MONMENUVALUE_STATS
db MONMENU_MENUOPTION, MONMENUITEM_SWITCH, MONMENUVALUE_SWITCH
db MONMENU_MENUOPTION, MONMENUITEM_ITEM, MONMENUVALUE_ITEM
db MONMENU_MENUOPTION, MONMENUITEM_CANCEL, MONMENUVALUE_CANCEL
db MONMENU_MENUOPTION, MONMENUITEM_MOVE, MONMENUVALUE_MOVE
db MONMENU_MENUOPTION, MONMENUITEM_MAIL, MONMENUVALUE_MAIL
db MONMENU_MENUOPTION, MONMENUITEM_ERROR, MONMENUVALUE_ERROR
db -1
MonSubmenu::
xor a xor a
ldh [hBGMapMode], a ldh [hBGMapMode], a
call asm_24a0c call GetMonSubmenuItems
callab Function_8f1cb callfar FreezeMonIcons
ld hl, .MenuHeader2497d ld hl, .MenuHeader
call LoadMenuHeader call LoadMenuHeader
call asm_24985 call .GetTopCoord
call asm_249c9 call PopulateMonMenu
ld a, 1 ld a, 1
ldh [hBGMapMode], a ldh [hBGMapMode], a
call asm_24997 call MonMenuLoop
ld [wMenuSelection], a ld [wMenuSelection], a
call CloseWindow call CloseWindow
ret ret
.MenuHeader2497d: .MenuHeader:
db $40 db MENU_BACKUP_TILES ; flags
menu_coords 11, 0, $13, $11 menu_coords 11, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1
dw 0 dw 0
db 1 db 1 ; default option
asm_24985: .GetTopCoord:
ld a, [wFieldMoveScriptID] ld a, [wMonSubmenuCount]
inc a inc a
add a add a
ld b, a ld b, a
@ -1405,179 +1420,193 @@ asm_24985:
call MenuBox call MenuBox
ret ret
asm_24997: MonMenuLoop:
ld a, $a0 ld a, (STATICMENU_CURSOR | STATICMENU_WRAP)
ld [wMenuDataHeaderEnd], a ld [wMenuDataFlags], a
ld a, [wFieldMoveScriptID] ld a, [wMonSubmenuCount]
ld [wMenuDataItems], a ld [wMenuDataItems], a
call InitVerticalMenuCursor call InitVerticalMenuCursor
ld hl, w2DMenuFlags ld hl, w2DMenuFlags
set 6, [hl] set _2DMENU_ENABLE_SPRITE_ANIMS_F, [hl]
call Get2DMenuJoypad call Get2DMenuJoypad
ldh a, [hJoyDown] ldh a, [hJoyDown]
bit 0, a bit A_BUTTON_F, a
jr nz, asm_249bc jr nz, .select
bit 1, a bit B_BUTTON_F, a
jr nz, asm_249b9 jr nz, .cancel
jr asm_24997 jr MonMenuLoop
asm_249b9:
ld a, $0e .cancel:
ld a, MONMENUITEM_CANCEL
ret ret
asm_249bc: .select:
ld a, [w2DMenuDataEnd] ld a, [wMenuCursorY]
dec a dec a
ld c, a ld c, a
ld b, $00 ld b, 0
ld hl, wMapBlocksAddress ld hl, wMonSubmenuItems
add hl, bc add hl, bc
ld a, [hl] ld a, [hl]
ret ret
asm_249c9: PopulateMonMenu:
call MenuBoxCoord2Tile call MenuBoxCoord2Tile
ld bc, $002a ld bc, 2*SCREEN_WIDTH + 2
add hl, bc add hl, bc
ld de, wMapBlocksAddress ld de, wMonSubmenuItems
asm_249d3: .loop
ld a, [de] ld a, [de]
inc de inc de
cp $ff cp $ff
ret z ret z
push de push de
push hl push hl
call asm_249e8 call GetMonMenuString
pop hl pop hl
call PlaceString call PlaceString
ld bc, $0028 ld bc, 2*SCREEN_WIDTH
add hl, bc add hl, bc
pop de pop de
jr asm_249d3 jr .loop
asm_249e8:
GetMonMenuString:
dec a dec a
ld b, a ld b, a
add a add a
add b add b
ld c, a ld c, a
ld b, $00 ld b, $00
ld hl, Data24921 ld hl, MonMenuOptions
add hl, bc add hl, bc
ld a, [hli] ld a, [hli]
and a and a ; if MONMENU_MENUOPTION
jr z, asm_24a00 jr z, .NotMove
inc hl inc hl
ld a, [hl] ld a, [hl]
ld [wNamedObjectIndexBuffer], a ld [wNamedObjectIndexBuffer], a
call Unreferenced_GetMoveName call Unreferenced_GetMoveName
ret ret
asm_24a00: .NotMove:
inc hl inc hl
ld a, [hl] ld a, [hl]
dec a dec a
ld hl, Text248e7 ld hl, MonMenuOptionStrings
call GetNthString call GetNthString
ld d, h ld d, h
ld e, l ld e, l
ret ret
asm_24a0c: GetMonSubmenuItems:
call asm_24a78 call ResetMonSubmenu
ld a, $02 ld a, MON_MOVES
call GetPartyParamLocation call GetPartyParamLocation
ld d, h ld d, h
ld e, l ld e, l
ld hl, wMapBlocksAddress ld hl, wMonSubmenuItems
ld c, $04 ld c, NUM_MOVES
asm_24a1b:
.loop
push bc push bc
push de push de
ld a, [de] ld a, [de]
and a and a ; no move in this slot
jr z, asm_24a2b jr z, .next
push hl push hl
call asm_24a63 call IsFieldMove
pop hl pop hl
jr nc, asm_24a2b jr nc, .next
call asm_24a93 call AddMonMenuItem
asm_24a2b:
.next
pop de pop de
inc de inc de
pop bc pop bc
dec c dec c
jr nz, asm_24a1b jr nz, .loop
ld a, $0b
call asm_24a93 ld a, MONMENUITEM_STATS
ld a, $0c call AddMonMenuItem
call asm_24a93 ld a, MONMENUITEM_SWITCH
ld a, $0f call AddMonMenuItem
call asm_24a93 ld a, MONMENUITEM_MOVE
call AddMonMenuItem
push hl push hl
ld a, $01 ld a, MON_ITEM
call GetPartyParamLocation call GetPartyParamLocation
ld a, [hl] ld a, [hl]
pop hl pop hl
cp $9e cp ITEM_MAIL
ld a, $0d ld a, MONMENUITEM_ITEM
jr nz, asm_24a50 jr nz, .notmail
ld a, $10 ld a, MONMENUITEM_MAIL
asm_24a50:
call asm_24a93 .notmail
ld a, [wFieldMoveScriptID] call AddMonMenuItem
cp $08 ld a, [wMonSubmenuCount]
jr z, asm_24a5f cp NUM_MONMENU_ITEMS
ld a, $0e jr z, .maxitems
call asm_24a93
asm_24a5f: ld a, MONMENUITEM_CANCEL
call asm_24a86 call AddMonMenuItem
.maxitems
call TerminateMonSubmenu
ret ret
asm_24a63: IsFieldMove:
ld b, a ld b, a
ld hl, Data24921 ld hl, MonMenuOptions
asm_24a67: .next
ld a, [hli] ld a, [hli]
cp $ff cp -1
jr z, asm_24a77 jr z, .nope
and a and a ; MONMENU_MENUOPTION
jr z, asm_24a77 jr z, .nope
ld d, [hl] ld d, [hl]
inc hl inc hl
ld a, [hli] ld a, [hli]
cp b cp b
jr nz, asm_24a67 jr nz, .next
ld a, d ld a, d
scf scf
asm_24a77:
.nope
ret ret
asm_24a78: ResetMonSubmenu:
xor a xor a
ld [wFieldMoveScriptID], a ld [wMonSubmenuCount], a
ld hl, wMapBlocksAddress ld hl, wMonSubmenuItems
ld bc, $9 ld bc, NUM_MONMENU_ITEMS + 1
call ByteFill call ByteFill
ret ret
asm_24a86: TerminateMonSubmenu:
ld a, [wFieldMoveScriptID] ld a, [wMonSubmenuCount]
ld e, a ld e, a
ld d, $00 ld d, 0
ld hl, wMapBlocksAddress ld hl, wMonSubmenuItems
add hl, de add hl, de
ld [hl], $ff ld [hl], -1
ret ret
asm_24a93: AddMonMenuItem:
push hl push hl
push de push de
push af push af
ld a, [wFieldMoveScriptID] ld a, [wMonSubmenuCount]
ld e, a ld e, a
inc a inc a
ld [wFieldMoveScriptID], a ld [wMonSubmenuCount], a
ld d, $00 ld d, $00
ld hl, wMapBlocksAddress ld hl, wMonSubmenuItems
add hl, de add hl, de
pop af pop af
ld [hl], a ld [hl], a
@ -1585,8 +1614,8 @@ asm_24a93:
pop hl pop hl
ret ret
asm_24aa9: BattleMonMenu:
ld hl, .MenuHeader24ae9 ld hl, .MenuHeader
call CopyMenuHeader call CopyMenuHeader
xor a xor a
ldh [hBGMapMode], a ldh [hBGMapMode], a
@ -1594,45 +1623,50 @@ asm_24aa9:
call UpdateSprites call UpdateSprites
call PlaceVerticalMenuItems call PlaceVerticalMenuItems
call WaitBGMap call WaitBGMap
ld hl, wMenuDataPointer ld hl, wMenuDataPointer
ld a, [hli] ld a, [hli]
ld h, [hl] ld h, [hl]
ld l, a ld l, a
ld de, wMenuDataHeaderEnd ld de, wMenuData2
ld bc, $8 ld bc, $8 ; TODO: constantify
call CopyBytes call CopyBytes
ld a, [wMenuDataHeaderEnd]
bit 7, a ld a, [wMenuDataFlags]
jr z, .asm_24ae4 bit STATICMENU_CURSOR_F, a
jr z, .set_carry
call InitVerticalMenuCursor call InitVerticalMenuCursor
ld hl, w2DMenuFlags ld hl, w2DMenuFlags
set 6, [hl] set _2DMENU_ENABLE_SPRITE_ANIMS_F, [hl]
call Get2DMenuJoypad call Get2DMenuJoypad
bit 1, a bit B_BUTTON_F, a
jr z, .asm_24ae6 jr z, .clear_carry
ret z ret z
.asm_24ae4:
.set_carry:
scf scf
ret ret
.asm_24ae6: .clear_carry:
and a and a
ret ret
ret ret
.MenuHeader24ae9: .MenuHeader:
db 0 db 0 ; flags
menu_coords 11, 11, $13, $11 menu_coords 11, 11, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1
dw .text_24af1 dw .MenuText
db 1 db 1 ; default option
.text_24af1: .MenuText:
db "たエ゛とりかえる@" db (STATICMENU_CURSOR | STATICMENU_NO_TOP_SPACING)
db "つよさをみる@" db 3
db "キャンセル@" db "とりかえる@" ; Switch
db "つよさをみる@" ; Stats
db "キャンセル@" ; Cancel
asm_24b06: LoadBattleMenu:
ld hl, MenuHeader24b24 ld hl, MenuHeader24b24
jr asm_24b0e jr asm_24b0e
@ -1655,10 +1689,13 @@ MenuHeader24b24:
db 1 db 1
.text_24b2c: .text_24b2c:
db "ア<TA!>ガたたかう@" db STATICMENU_CURSOR
db "どうぐ@" dn 2, 2
db "#@" db 5
db "にげる@" db "たたかう@" ; "FIGHT"
db "どうぐ@" ; "ITEM"
db "#@" ; "<PK><MN>"
db "にげる@" ; "RUN"
MenuHeader24b3e: MenuHeader24b3e:
db MENU_BACKUP_TILES db MENU_BACKUP_TILES
@ -1667,10 +1704,13 @@ MenuHeader24b3e:
db 1 db 1
.text_24b46: .text_24b46:
db "ア<TA!>ジサファりボール×   @" db STATICMENU_CURSOR
db "エサをなげる@" dn 2, 2
db "いしをなげる@" db 11
db "にげる@" db "サファりボール×   @" ; "SAFARI BALL× @"
db "エサをなげる@" ; "BAIT"
db "いしをなげる@" ; "THROW ROCK"
db "にげる@" ; "RUN"
asm_24b67: asm_24b67:
call CopyMenuData call CopyMenuData
@ -1838,7 +1878,7 @@ SelectQuantityToToss::
ret ret
asm_24c64: asm_24c64:
callab GetItemPrice callfar GetItemPrice
ld a, d ld a, d
ld [wFieldMoveScriptID], a ld [wFieldMoveScriptID], a
ld a, e ld a, e

View File

@ -71,7 +71,7 @@ asm_2d36c:
ld a, $1a ld a, $1a
call Predef call Predef
push bc push bc
ld a, [wWhichPokemon] ld a, [wCurPartyMon]
ld hl, wPartyMonNicknames ld hl, wPartyMonNicknames
call GetNick call GetNick
pop bc pop bc
@ -87,7 +87,7 @@ asm_2d36c:
jr asm_2d33e jr asm_2d33e
asm_2d390: asm_2d390:
callab Functionfdab callfar Functionfdab
jr c, asm_2d33e jr c, asm_2d33e
ld a, $0 ld a, $0
call Predef call Predef
@ -217,8 +217,7 @@ asm_2d4a3:
ld [wCurSpecies], a ld [wCurSpecies], a
ld b, a ld b, a
ld hl, $c395 ld hl, $c395
ld a, $3f predef PrintMoveType
call Predef
ld hl, $c3b9 ld hl, $c3b9
call Function2d663 call Function2d663
ld hl, $c39b ld hl, $c39b
@ -226,10 +225,10 @@ asm_2d4a3:
call PlaceString call PlaceString
ld a, [wCurSpecies] ld a, [wCurSpecies]
dec a dec a
ld hl, Data418b8 ld hl, Moves + MOVE_POWER
ld bc, $7 ld bc, MOVE_LENGTH
call AddNTimes call AddNTimes
ld a, BANK(Data418b8) ld a, BANK(Moves)
call GetFarByte call GetFarByte
ld hl, $c3a0 ld hl, $c3a0
cp $2 cp $2

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

2130
engine/dumps/bank14.asm Normal file

File diff suppressed because it is too large Load Diff

View File

@ -152,7 +152,7 @@ CutScript:
ld hl, wPartyMonNicknames ld hl, wPartyMonNicknames
ld a, BOXMON ld a, BOXMON
ld [wMonType], a ld [wMonType], a
ld a, [wWhichPokemon] ld a, [wCurPartyMon]
call GetNick call GetNick
call CopyStringToStringBuffer2 call CopyStringToStringBuffer2
ld hl, Text_CutItDown ld hl, Text_CutItDown
@ -242,7 +242,7 @@ SurfScript:
ld hl, wPartyMonNicknames ld hl, wPartyMonNicknames
ld a, BOXMON ld a, BOXMON
ld [wMonType], a ld [wMonType], a
ld a, [wWhichPokemon] ld a, [wCurPartyMon]
call GetNick call GetNick
call CopyStringToStringBuffer2 call CopyStringToStringBuffer2
ld hl, Text_UsedSurf ld hl, Text_UsedSurf
@ -273,7 +273,7 @@ MovePlayerIntoWater:
ld hl, wMovementBuffer ld hl, wMovementBuffer
call LoadMovementDataPointer call LoadMovementDataPointer
.get_movement_direction .get_movement_direction
ld a, [wPlayerWalking] ld a, [wPlayerDirection]
srl a srl a
srl a srl a
ld e, a ld e, a
@ -328,7 +328,7 @@ TryFly:
ShowFlyMap: ShowFlyMap:
call LoadStandardMenuHeader call LoadStandardMenuHeader
call ClearSprites call ClearSprites
callab FlyMap callfar FlyMap
call ClearPalettes call ClearPalettes
call GetMemSGBLayout call GetMemSGBLayout
call ExitMenu call ExitMenu
@ -375,7 +375,7 @@ Text_CantUseFlyHere:
FlyScript: FlyScript:
ld a, MAPSETUP_TELEPORT ld a, MAPSETUP_TELEPORT
ldh [hMapEntryMethod], a ldh [hMapEntryMethod], a
jpab Functionfcc24 jpfar Functionfcc24
DigFunction: DigFunction:
@ -441,7 +441,7 @@ DigScript:
call CopyBytes call CopyBytes
ld a, MAPSETUP_WARP ld a, MAPSETUP_WARP
ldh [hMapEntryMethod], a ldh [hMapEntryMethod], a
jpab Functionfcc24 jpfar Functionfcc24
EmptyFunctiond2da: EmptyFunctiond2da:
ret ret
@ -487,7 +487,7 @@ CheckIfSpawnPoint:
ld d, a ld d, a
ld a, [wLastSpawnMapNumber] ld a, [wLastSpawnMapNumber]
ld e, a ld e, a
callab IsSpawnPoint callfar IsSpawnPoint
jr c, .not_spawn jr c, .not_spawn
ld hl, Text_CantFindDestination ld hl, Text_CantFindDestination
call MenuTextBoxBackup call MenuTextBoxBackup
@ -534,7 +534,7 @@ TeleportScript:
call Function1fea call Function1fea
ld a, MAPSETUP_TELEPORT ld a, MAPSETUP_TELEPORT
ldh [hMapEntryMethod], a ldh [hMapEntryMethod], a
jpab Functionfcc24 jpfar Functionfcc24
Text_ReturnToLastMonCenter: Text_ReturnToLastMonCenter:
text "さいごに たちよった" text "さいごに たちよった"

View File

@ -139,7 +139,7 @@ PC_Demo:
done done
BillsPC: BillsPC:
callab _BillsPC callfar _BillsPC
and a and a
ret ret
@ -241,8 +241,8 @@ PlayerWithdrawItemMenu:
ret ret
.Submenu: .Submenu:
callab _CheckTossableItem callfar _CheckTossableItem
ld a, [wItemAttributeParamBuffer] ld a, [wItemAttributeValue]
and a and a
jr z, .AskQuantity jr z, .AskQuantity
ld a, 1 ld a, 1
@ -252,7 +252,7 @@ PlayerWithdrawItemMenu:
.AskQuantity: .AskQuantity:
ld hl, .HowManyToWithdrawText ld hl, .HowManyToWithdrawText
call MenuTextBox call MenuTextBox
callab SelectQuantityToToss callfar SelectQuantityToToss
call ExitMenu call ExitMenu
call ExitMenu call ExitMenu
jr c, .done jr c, .done
@ -307,7 +307,7 @@ PlayerTossItemMenu:
call PCItemsJoypad call PCItemsJoypad
jr c, .quit jr c, .quit
ld de, wUnknownListLengthd1ea ld de, wUnknownListLengthd1ea
callab TryTossItem callfar TryTossItem
jr .loop jr .loop
.quit .quit
ld hl, wVramState ld hl, wVramState
@ -324,10 +324,10 @@ PlayerDepositItemMenu:
call .CheckItemsInBag call .CheckItemsInBag
ret c ret c
call LoadStandardMenuHeader call LoadStandardMenuHeader
callab GetPocket2Status callfar GetPocket2Status
callab DrawBackpack callfar DrawBackpack
.loop .loop
callab DebugBackpackLoop callfar DebugBackpackLoop
jr c, .quit jr c, .quit
call .TryDepositItem call .TryDepositItem
jr .loop jr .loop
@ -340,7 +340,7 @@ PlayerDepositItemMenu:
ret ret
.CheckItemsInBag: .CheckItemsInBag:
callab CheckItemsQuantity callfar CheckItemsQuantity
ret nc ret nc
; no item to deposit ; no item to deposit
@ -355,8 +355,8 @@ PlayerDepositItemMenu:
prompt prompt
.TryDepositItem: .TryDepositItem:
callab CheckItemMenu callfar CheckItemMenu
ld a, [wItemAttributeParamBuffer] ld a, [wItemAttributeValue]
ld hl, .Jumptable ld hl, .Jumptable
jp CallJumptable jp CallJumptable
@ -390,7 +390,7 @@ PlayerDepositItemMenu:
prompt prompt
.SwapPockets: .SwapPockets:
callab FlipPocket2Status callfar FlipPocket2Status
xor a xor a
ld [wSelectedSwapPosition], a ld [wSelectedSwapPosition], a
ret ret
@ -400,8 +400,8 @@ PlayerDepositItemMenu:
ret ret
.DepositItem: .DepositItem:
callab _CheckTossableItem callfar _CheckTossableItem
ld a, [wItemAttributeParamBuffer] ld a, [wItemAttributeValue]
and a and a
jr z, .AskQuantity jr z, .AskQuantity
ld a, 1 ld a, 1
@ -411,7 +411,7 @@ PlayerDepositItemMenu:
.AskQuantity: .AskQuantity:
ld hl, .HowManyDepositText ld hl, .HowManyDepositText
call MenuTextBox call MenuTextBox
callab SelectQuantityToToss callfar SelectQuantityToToss
push af push af
call ExitMenu call ExitMenu
call ExitMenu call ExitMenu
@ -479,12 +479,12 @@ PCItemsJoypad:
jr z, .select jr z, .select
jr .next jr .next
.select .select
callab SwitchItemsInBag callfar SwitchItemsInBag
jp .next jp .next
.next .next
jp PCItemsJoypad jp PCItemsJoypad
.a_button .a_button
callab ScrollingMenu_ClearLeftColumn callfar ScrollingMenu_ClearLeftColumn
call PlaceHollowCursor call PlaceHollowCursor
and a and a
ret ret

View File

@ -35,7 +35,7 @@ MemoryMinigame:
call DisableLCD call DisableLCD
ld b, SGB_DIPLOMA ld b, SGB_DIPLOMA
call GetSGBLayout call GetSGBLayout
callab InitEffectObject callfar InitEffectObject
ld hl, MemoryGameGFX ld hl, MemoryGameGFX
ld de, vChars2 ld de, vChars2
@ -79,7 +79,7 @@ MemoryMinigame:
bit MEMORYGAME_END_LOOP_F, a bit MEMORYGAME_END_LOOP_F, a
jr nz, .quit jr nz, .quit
call .ExecuteJumptable call .ExecuteJumptable
callab EffectObjectJumpNoDelay callfar EffectObjectJumpNoDelay
call DelayFrame call DelayFrame
and a and a
ret ret

View File

@ -43,7 +43,7 @@ PicrossMinigame:
.Init: .Init:
call DisableLCD call DisableLCD
callba InitEffectObject farcall InitEffectObject
call .InitGFX call .InitGFX
call .PlacePlayerBG call .PlacePlayerBG
call .InitRAM call .InitRAM
@ -203,13 +203,13 @@ PicrossMinigame:
; load Gold sprites ; load Gold sprites
ld de, vSprites + $100 ld de, vSprites + $100
ld hl, GoldSpriteGFX + $40 ld hl, GoldSpriteGFX + LEN_2BPP_TILE * 4 ; Gold's back-facing standing sprite
ld bc, 4 tiles ld bc, 4 tiles
ld a, BANK(GoldSpriteGFX) ld a, BANK(GoldSpriteGFX)
call FarCopyData call FarCopyData
ld de, vSprites + $140 ld de, vSprites + $140
ld hl, GoldSpriteGFX + $100 ld hl, GoldSpriteGFX + LEN_2BPP_TILE * 16 ; Gold's back-facing walking sprite
ld bc, 4 tiles ld bc, 4 tiles
ld a, BANK(GoldSpriteGFX) ld a, BANK(GoldSpriteGFX)
call FarCopyData call FarCopyData
@ -265,7 +265,7 @@ PicrossMinigame:
jr nz, .quit jr nz, .quit
call .ExecuteJumptable call .ExecuteJumptable
callba EffectObjectJumpNoDelay farcall EffectObjectJumpNoDelay
call DelayFrame call DelayFrame
and a and a
ret ret

View File

@ -38,7 +38,7 @@ PikachuMiniGame::
call DisableLCD call DisableLCD
ld b, SGB_PIKACHU_MINIGAME ld b, SGB_PIKACHU_MINIGAME
call GetSGBLayout call GetSGBLayout
callab InitEffectObject callfar InitEffectObject
call PikachuMiniGame_ClearBothTilemaps call PikachuMiniGame_ClearBothTilemaps
ld hl, IntroForestGFX ld hl, IntroForestGFX
@ -362,7 +362,7 @@ PikachuMiniGame_RunFrame:
.skip_playing_sfx .skip_playing_sfx
call PikachuMiniGame_PerformGameFunction call PikachuMiniGame_PerformGameFunction
callba EffectObjectJumpNoDelay farcall EffectObjectJumpNoDelay
ld a, 1 ld a, 1
ldh [hBGMapMode], a ldh [hBGMapMode], a
@ -382,7 +382,7 @@ PikachuMiniGame_RunFrame:
ret ret
.Done: .Done:
callab InitEffectObject callfar InitEffectObject
ld hl, wShadowOAM ld hl, wShadowOAM
ld c, SPRITEOAMSTRUCT_LENGTH * NUM_SPRITE_OAM_STRUCTS ld c, SPRITEOAMSTRUCT_LENGTH * NUM_SPRITE_OAM_STRUCTS
@ -857,7 +857,7 @@ MinigamePikachuDoMovement::
dec [hl] dec [hl]
ld d, $30 ld d, $30
ld e, a ld e, a
callba BattleAnim_Sine_e farcall BattleAnim_Sine_e
ld a, e ld a, e
ld hl, SPRITEANIMSTRUCT_YOFFSET ld hl, SPRITEANIMSTRUCT_YOFFSET
add hl, bc add hl, bc

View File

@ -111,7 +111,7 @@ SlotMachineGame_Init:
call DisableLCD call DisableLCD
ld b, SGB_SLOT_MACHINE ld b, SGB_SLOT_MACHINE
call GetSGBLayout call GetSGBLayout
callab InitEffectObject callfar InitEffectObject
ld hl, wSlots ld hl, wSlots
ld bc, wSlotsDataEnd - wSlots ld bc, wSlotsDataEnd - wSlots
xor a xor a
@ -193,7 +193,7 @@ SlotsLoop:
call Slots_SpinReels call Slots_SpinReels
ld a, $60 ld a, $60
ld [wc4bd], a ld [wc4bd], a
callab DoNextFrameForFirst16Sprites callfar DoNextFrameForFirst16Sprites
call Slots_PrintCoinsAndPayout call Slots_PrintCoinsAndPayout
call Slots_FlashPaletteOnMatchingSevens call Slots_FlashPaletteOnMatchingSevens
call Slots_AnimateReelSpritesAfterSpin call Slots_AnimateReelSpritesAfterSpin
@ -2030,7 +2030,7 @@ Slots_AnimateGolem:
dec [hl] dec [hl]
ld e, a ld e, a
ld d, 14 * 8 ld d, 14 * 8
callba BattleAnim_Sine_e farcall BattleAnim_Sine_e
ld a, e ld a, e
ld hl, SPRITEANIMSTRUCT_YOFFSET ld hl, SPRITEANIMSTRUCT_YOFFSET
add hl, bc add hl, bc

View File

@ -58,7 +58,7 @@ SGB_BattleColors:
call CopyBytes call CopyBytes
ld a, [wca3f] ld a, [wca3f]
ld hl, wca02 ld hl, wBattleMon
call Function9567 call Function9567
jr c, .sub_92f7 jr c, .sub_92f7
@ -67,7 +67,7 @@ SGB_BattleColors:
.sub_92f7 .sub_92f7
ld b, a ld b, a
ld a, [wca44] ld a, [wca44]
ld hl, wcdd7 ld hl, wTempEnemyMonSpecies
call Function9567 call Function9567
jr c, .sub_9308 jr c, .sub_9308
ld e, $01 ld e, $01
@ -120,7 +120,7 @@ SGB_StatsScreenHPPals:
ld de, wcce1 ld de, wcce1
ld bc, PALPACKET_LENGTH ld bc, PALPACKET_LENGTH
call CopyBytes call CopyBytes
ld a, [wMonDexIndex] ld a, [wCurPartySpecies]
call Function956d call Function956d
call Function957e call Function957e
push af push af
@ -145,7 +145,7 @@ SGB_Pokedex:
ld de, wcce1 ld de, wcce1
ld bc, PALPACKET_LENGTH ld bc, PALPACKET_LENGTH
call CopyBytes call CopyBytes
ld a, [wMonDexIndex] ld a, [wCurPartySpecies]
call Function956d call Function956d
ld hl, wcce4 ld hl, wcce4
ld [hl], a ld [hl], a
@ -264,7 +264,7 @@ SGB12:
call GetMapPalsIndex call GetMapPalsIndex
ld hl, wcce2 ld hl, wcce2
ld [hl], a ld [hl], a
ld a, [wMonDexIndex] ld a, [wCurPartySpecies]
call Function956d call Function956d
ld hl, wcce4 ld hl, wcce4
ld [hl], a ld [hl], a
@ -436,7 +436,7 @@ Function957e:
push bc push bc
push af push af
ld hl, wPartyMon1DVs ld hl, wPartyMon1DVs
ld a, [wWhichPokemon] ld a, [wCurPartyMon]
ld bc, $0030 ld bc, $0030
call AddNTimes call AddNTimes
call Function95b0 call Function95b0
@ -490,11 +490,11 @@ Function95b0:
ret ret
Function95cc: Function95cc:
ld hl, wcddf ld hl, wEnemyMonDVs
ldh a, [hBattleTurn] ldh a, [hBattleTurn]
and a and a
jr nz, .sub_95d7 jr nz, .sub_95d7
ld hl, wca08 ld hl, wBattleMonDVs
.sub_95d7 .sub_95d7
call Function95b0 call Function95b0
ld hl, wcae1 ld hl, wcae1

View File

@ -6,8 +6,8 @@ _ReceiveItem:
call DoesHLEqualwNumBagItems call DoesHLEqualwNumBagItems
jp nz, PutItemInPocket jp nz, PutItemInPocket
push hl push hl
callab CheckItemPocket callfar CheckItemPocket
ld a, [wItemAttributeParamBuffer] ld a, [wItemAttributeValue]
dec a dec a
ld hl, .Pockets ld hl, .Pockets
jp CallJumptable jp CallJumptable
@ -45,8 +45,8 @@ _TossItem:
call DoesHLEqualwNumBagItems call DoesHLEqualwNumBagItems
jr nz, .remove_item jr nz, .remove_item
push hl push hl
callab CheckItemPocket callfar CheckItemPocket
ld a, [wItemAttributeParamBuffer] ld a, [wItemAttributeValue]
dec a dec a
ld hl, .Pockets ld hl, .Pockets
jp CallJumptable jp CallJumptable
@ -86,8 +86,8 @@ _CheckItem:
call DoesHLEqualwNumBagItems call DoesHLEqualwNumBagItems
jr nz, .not_bag jr nz, .not_bag
push hl push hl
callab CheckItemPocket callfar CheckItemPocket
ld a, [wItemAttributeParamBuffer] ld a, [wItemAttributeValue]
dec a dec a
ld hl, .Pockets ld hl, .Pockets
jp CallJumptable jp CallJumptable
@ -636,7 +636,7 @@ CheckAmountInKeyItems:
SECTION "engine/items/inventory.asm@_CheckTossableItem", ROMX SECTION "engine/items/inventory.asm@_CheckTossableItem", ROMX
; Return 1 in wItemAttributeParamBuffer and ; Return 1 in wItemAttributeValue and
; carry if wCurItem can't be removed from the bag. ; carry if wCurItem can't be removed from the bag.
_CheckTossableItem: _CheckTossableItem:
ld a, ITEMATTR_PERMISSIONS ld a, ITEMATTR_PERMISSIONS
@ -646,7 +646,7 @@ _CheckTossableItem:
and a and a
ret ret
; Return 1 in wItemAttributeParamBuffer ; Return 1 in wItemAttributeValue
; and carry if wCurItem can't be selected. ; and carry if wCurItem can't be selected.
CheckSelectableItem: CheckSelectableItem:
ld a, ITEMATTR_PERMISSIONS ld a, ITEMATTR_PERMISSIONS
@ -656,29 +656,29 @@ CheckSelectableItem:
and a and a
ret ret
; Return the pocket for wCurItem in wItemAttributeParamBuffer. ; Return the pocket for wCurItem in wItemAttributeValue.
CheckItemPocket: CheckItemPocket:
ld a, ITEMATTR_POCKET ld a, ITEMATTR_POCKET
call GetItemAttr call GetItemAttr
and $f and $f
ld [wItemAttributeParamBuffer], a ld [wItemAttributeValue], a
ret ret
; Return the context for wCurItem in wItemAttributeParamBuffer. ; Return the context for wCurItem in wItemAttributeValue.
CheckItemContext: CheckItemContext:
ld a, ITEMATTR_HELP ld a, ITEMATTR_HELP
call GetItemAttr call GetItemAttr
and $f and $f
ld [wItemAttributeParamBuffer], a ld [wItemAttributeValue], a
ret ret
; Return the menu for wCurItem in wItemAttributeParamBuffer. ; Return the menu for wCurItem in wItemAttributeValue.
CheckItemMenu: CheckItemMenu:
ld a, ITEMATTR_HELP ld a, ITEMATTR_HELP
call GetItemAttr call GetItemAttr
swap a swap a
and $f and $f
ld [wItemAttributeParamBuffer], a ld [wItemAttributeValue], a
ret ret
; Get attribute a of wCurItem. ; Get attribute a of wCurItem.
@ -690,7 +690,7 @@ GetItemAttr:
ld b, 0 ld b, 0
add hl, bc add hl, bc
xor a xor a
ld [wItemAttributeParamBuffer], a ld [wItemAttributeValue], a
ld a, [wCurItem] ld a, [wCurItem]
dec a dec a
ld c, a ld c, a
@ -704,7 +704,7 @@ GetItemAttr:
ItemAttr_ReturnCarry: ItemAttr_ReturnCarry:
ld a, 1 ld a, 1
ld [wItemAttributeParamBuffer], a ld [wItemAttributeValue], a
scf scf
ret ret

View File

@ -4,16 +4,16 @@ SECTION "engine/items/tmhm.asm", ROMX
CanLearnTMHMMove: CanLearnTMHMMove:
; Gets the index of TM or HM with move ID wce32, ; Gets the index of TM or HM with move ID wce32,
; then checks the corresponding flag in wMonDexIndex's learnset. ; then checks the corresponding flag in wCurPartySpecies's learnset.
; Sets register c to 1 if TM/HM is in learnset OR if debug is enabled. ; Sets register c to 1 if TM/HM is in learnset OR if debug is enabled.
ld a, [wDebugFlags] ld a, [wDebugFlags]
ld c, 01 ld c, 01
bit 1, a bit 1, a
ret nz ret nz
ld a, [wMonDexIndex] ld a, [wCurPartySpecies]
ld [wCurSpecies], a ld [wCurSpecies], a
call GetMonHeader call GetBaseData
ld hl, wMonHLearnset ld hl, wMonHLearnset
push hl push hl

View File

@ -36,7 +36,7 @@ DebugMenu_WarpMenuHeader::
db 4 ; items db 4 ; items
dw $0100 ; ??? dw $0100 ; ???
dba Data_3f_4bc6 dba WarpMenuOptions
dba PlaceSelectedMapName dba PlaceSelectedMapName
db $00, $00, $00 ; ??? db $00, $00, $00 ; ???
@ -60,51 +60,58 @@ GetLandmarkName::
SECTION "engine/landmarks.asm@2", ROMX SECTION "engine/landmarks.asm@2", ROMX
Data_3f_4bc6:: WarpMenuOptions::
db 16 ; #
db $01 db 16 ; Number of options in the menu - 43 total stored in data, but most are unused
db $02
db $03 db SPAWN_POINT_SILENT
db $04 db SPAWN_POINT_OLD
db $05 db SPAWN_POINT_WEST
db $06 db SPAWN_POINT_HIGH_TECH
db $07 db SPAWN_POINT_FOUNT
db $08 db SPAWN_POINT_BIRDON
db $09 db SPAWN_POINT_NEW_TYPE
db $0a db SPAWN_POINT_SUGAR
db $0b db SPAWN_POINT_BLUE_FOREST
db $0e db SPAWN_POINT_STAND
db $0f db SPAWN_POINT_KANTO
db $10
db $11 ; PRINCE and MT_FUJI are skipped in the menu
db $2d
db SPAWN_POINT_SOUTH
db SPAWN_POINT_NORTH
db SPAWN_POINT_ROUTE_15
db SPAWN_POINT_ROUTE_18
db SPAWN_POINT_SILENT_HILL
db $ff db $ff
db $12 ; The demo's options stop here, but the spawn points included actually extend far beyond what is available
db $13
db $14 db SPAWN_POINT_POWER_PLANT_1
db $15 db SPAWN_POINT_POWER_PLANT_2
db $16 db SPAWN_POINT_POWER_PLANT_3
db $17 db SPAWN_POINT_POWER_PLANT_4
db $18 db SPAWN_POINT_RUINS_1
db $19 db SPAWN_POINT_RUINS_2
db $1a db SPAWN_POINT_MINES_1
db $1b db SPAWN_POINT_MINES_2
db $1c db SPAWN_POINT_MINES_3
db $1d db SPAWN_POINT_MINES_4
db $1e db SPAWN_POINT_MINES_5
db $1f db SPAWN_POINT_MINES_6
db $20 db SPAWN_POINT_MINES_7
db $21 db SPAWN_POINT_HIDEOUT_1
db $22 db SPAWN_POINT_HIDEOUT_2
db $23 db SPAWN_POINT_HIDEOUT_3
db $24 db SPAWN_POINT_SLOWPOKE_WELL_1
db $25 db SPAWN_POINT_SLOWPOKE_WELL_2
db $26 db SPAWN_POINT_POKEMON_LEAGUE_1
db $27 db SPAWN_POINT_POKEMON_LEAGUE_1_2
db $28 db SPAWN_POINT_POKEMON_LEAGUE_2
db $29 db SPAWN_POINT_POKEMON_LEAGUE_3
db $2a db SPAWN_POINT_POKEMON_LEAGUE_4
db $2b db SPAWN_POINT_POKEMON_LEAGUE_5
db $2c db SPAWN_POINT_POKEMON_LEAGUE_6
db SPAWN_POINT_POKEMON_LEAGUE_7
db SPAWN_POINT_POKEMON_LEAGUE_7_2
db $ff db $ff

View File

@ -42,13 +42,13 @@ InitializeNewGameWRAM:
call DelayFrame call DelayFrame
ldh a, [hRandomSub] ldh a, [hRandomSub]
ld [wce73], a ld [wPlayerID], a
ldh a, [rLY] ldh a, [rLY]
ldh [hRTCRandom], a ldh [hRTCRandom], a
call DelayFrame call DelayFrame
ldh a, [hRandomAdd] ldh a, [hRandomAdd]
ld [wce74], a ld [wPlayerID + 1], a
ld hl, wPartyCount ld hl, wPartyCount
call InitializeByteList call InitializeByteList
@ -67,13 +67,13 @@ InitializeNewGameWRAM:
ld [wKantoBadges], a ld [wKantoBadges], a
ld [wCoins], a ld [wCoins], a
ld [wd15c], a ld [wd15c], a
ld [wd15d], a ld [wMoney], a
ld a, $0B ld a, $0B
ld [wd15e], a ld [wMoney + 1], a
ld a, $B8 ld a, $B8
ld [wd15f], a ld [wMoney + 2], a
ld hl, wUnknownListLengthd1ea ld hl, wUnknownListLengthd1ea
ld a, ITEM_REPEL ld a, ITEM_REPEL
@ -192,11 +192,11 @@ PlayPokemonSetTimeMenu:
db -1 db -1
MainMenuOptionSetTime:: MainMenuOptionSetTime::
callab SetTime callfar SetTime
ret ret
MainMenuOptionContinue:: MainMenuOptionContinue::
callab Function14624 callfar Function14624
call DisplayContinueGameInfo call DisplayContinueGameInfo
.loop .loop
call ClearJoypad call ClearJoypad
@ -256,17 +256,17 @@ PrintNumBadges::
ld b, $01 ; only Johto Badges ld b, $01 ; only Johto Badges
call CountSetBits call CountSetBits
pop hl pop hl
ld de, wCountSetBitsResult ld de, wNumSetBits
ld bc, $0102 ; flags and constants for this? 1 byte source, 2 digit display ld bc, $0102 ; flags and constants for this? 1 byte source, 2 digit display
jp PrintNumber jp PrintNumber
PrintNumOwnedMons:: PrintNumOwnedMons::
push hl push hl
ld hl, wPokedexOwned ld hl, wPokedexCaught
ld b, $20 ; flag_array NUM_POKEMON? ld b, $20 ; flag_array NUM_POKEMON?
call CountSetBits call CountSetBits
pop hl pop hl
ld de, wCountSetBitsResult ld de, wNumSetBits
ld bc, $0103 ; 1 byte, 3 digit ld bc, $0103 ; 1 byte, 3 digit
jp PrintNumber jp PrintNumber
@ -295,7 +295,7 @@ StartNewGame::
call LoadFontExtra call LoadFontExtra
xor a xor a
ldh [hBGMapMode], a ldh [hBGMapMode], a
callba InitializeNewGameWRAM farcall InitializeNewGameWRAM
call ClearTileMap call ClearTileMap
call ClearWindowData call ClearWindowData
xor a xor a

View File

@ -174,14 +174,17 @@ StartMenu_Exit:
ret ret
StartMenu_SetFrame: StartMenu_SetFrame:
callab FrameTypeDialog callfar FrameTypeDialog
ld a, 0 ld a, 0
ret ret
StartMenu_Reset: StartMenu_Reset:
; This SHOULD be the setup for a FarCall_hl to DisplayResetDialog.
; Instead, it mistakenly calls DisplayResetDialog prior to loading its bank.
; This causes it to read data as code, specifically from the middle of MapGroup_Newtype in vanilla.
ld hl, DisplayResetDialog ld hl, DisplayResetDialog
ld a, BANK(DisplayResetDialog) ld a, BANK(DisplayResetDialog)
call DisplayResetDialog ; should be farcall call DisplayResetDialog ; the problematic line
ld a, 0 ld a, 0
ret ret
@ -197,7 +200,7 @@ StartMenu_Settings:
ldh [hBGMapMode], a ldh [hBGMapMode], a
call ClearTileMap call ClearTileMap
call UpdateSprites call UpdateSprites
callab MenuCallSettings callfar MenuCallSettings
call ClearPalettes call ClearPalettes
call Call_ExitMenu call Call_ExitMenu
call LoadTilesetGFX call LoadTilesetGFX
@ -219,7 +222,7 @@ _TrainerCard:
push af push af
xor a xor a
ldh [hMapAnims], a ldh [hMapAnims], a
callab TrainerCardLoop callfar TrainerCardLoop
call ClearPalettes call ClearPalettes
call LoadFont call LoadFont
call ReloadFontAndTileset call ReloadFontAndTileset
@ -338,7 +341,7 @@ DrawBackpack:
res 0, [hl] res 0, [hl]
call ClearSprites call ClearSprites
call ClearTileMap call ClearTileMap
callab LoadBackpackGraphics callfar LoadBackpackGraphics
hlcoord 2, 2 hlcoord 2, 2
ld b, 08 ld b, 08
ld c, $0F ld c, $0F
@ -476,7 +479,7 @@ HandleBackpackInput:
jp .exit jp .exit
.BackpackSelect .BackpackSelect
callab SwitchItemsInBag callfar SwitchItemsInBag
jp .exit jp .exit
.exit .exit
@ -496,11 +499,11 @@ HandleBackpackInput:
ret ret
BackpackSelected: BackpackSelected:
callab ScrollingMenu_ClearLeftColumn callfar ScrollingMenu_ClearLeftColumn
call PlaceHollowCursor call PlaceHollowCursor
call LoadItemData call LoadItemData
callab CheckItemMenu callfar CheckItemMenu
ld a, [wItemAttributeParamBuffer] ld a, [wItemAttributeValue]
ld hl, .BagSelectJumptable ld hl, .BagSelectJumptable
jp CallJumptable jp CallJumptable
@ -522,7 +525,7 @@ BackpackSelected:
.UnknownSelection .UnknownSelection
call LoadStandardMenuHeader call LoadStandardMenuHeader
callab Function2d2fc callfar Function2d2fc
call ExitMenu call ExitMenu
call DrawBackpack call DrawBackpack
and a and a
@ -577,7 +580,7 @@ DebugSelectedItemMenu:
db 01 db 01
.DebugSelectedItemMenuText .DebugSelectedItemMenuText
db $C0 db (STATICMENU_CURSOR | STATICMENU_NO_TOP_SPACING)
db 3 db 3
db "つかう@" ; use db "つかう@" ; use
db "すてる@" ; toss db "すてる@" ; toss
@ -590,7 +593,7 @@ SelectedItemMenu:
db 01 db 01
.SelectedItemMenuText .SelectedItemMenuText
db $C0 db (STATICMENU_CURSOR | STATICMENU_NO_TOP_SPACING)
db 2 db 2
db "つかう@" ; use db "つかう@" ; use
db "すてる@" ; toss db "すてる@" ; toss
@ -607,8 +610,8 @@ RegisterItemSelection:
ret ret
UseItemSelection: UseItemSelection:
callab CheckItemMenu callfar CheckItemMenu
ld a, [wItemAttributeParamBuffer] ld a, [wItemAttributeValue]
ld hl, .UseItemJumptable ld hl, .UseItemJumptable
jp CallJumptable jp CallJumptable
@ -658,13 +661,13 @@ UseItemSelection:
TryTossItem: TryTossItem:
push de push de
call LoadItemData call LoadItemData
callab _CheckTossableItem callfar _CheckTossableItem
ld a, [wItemAttributeParamBuffer] ld a, [wItemAttributeValue]
and a and a
jr nz, .TossFail jr nz, .TossFail
ld hl, .TossedText ld hl, .TossedText
call MenuTextBox call MenuTextBox
callab SelectQuantityToToss callfar SelectQuantityToToss
push af push af
call CloseWindow call CloseWindow
call ExitMenu call ExitMenu
@ -823,7 +826,7 @@ StartMenuLoadSprites:
call DisableLCD call DisableLCD
ld a, 6 ld a, 6
call UpdateSoundNTimes call UpdateSoundNTimes
callab Function140d9 callfar Function140d9
call LoadTilesetGFX call LoadTilesetGFX
call LoadFontExtra call LoadFontExtra
call ClearSprites call ClearSprites
@ -835,8 +838,8 @@ StartMenuLoadSprites:
ret ret
TryRegisterItem: TryRegisterItem:
callab CheckItemMenu callfar CheckItemMenu
ld a, [wItemAttributeParamBuffer] ld a, [wItemAttributeValue]
ld hl, .RegisterItemJumptable ld hl, .RegisterItemJumptable
jp CallJumptable jp CallJumptable
@ -892,23 +895,23 @@ StartMenu_Party:
ret ret
.partynonzero .partynonzero
call LoadStandardMenuHeader call LoadStandardMenuHeader
callab Function50756 callfar ClearGraphicsForPartyMenu
HandleSelectedPokemon: HandleSelectedPokemon:
xor a xor a
ld [wcdb9], a ld [wcdb9], a
ld [wSelectedSwapPosition], a ld [wSelectedSwapPosition], a
predef Function50774 predef PartyMenuInBattle
jr PartyPrompt.partypromptreturn jr PartyPrompt.partypromptreturn
PartyPrompt: PartyPrompt:
ld a, [wWhichPokemon] ld a, [wCurPartyMon]
inc a inc a
ld [wSelectedSwapPosition], a ld [wSelectedSwapPosition], a
callab Function8f1f2 callfar Function8f1f2
ld a, 4 ld a, 4
ld [wcdb9], a ld [wcdb9], a
predef Function50774 predef PartyMenuInBattle
.partypromptreturn .partypromptreturn
jr c, .return jr c, .return
jp SelectedPokemonSubmenu jp SelectedPokemonSubmenu
@ -932,7 +935,7 @@ SelectedPokemonSubmenu:
hlcoord 1, 13 hlcoord 1, 13
lb bc, 4, $12 lb bc, 4, $12
call ClearBox call ClearBox
callab Function24955 callfar MonSubmenu
call GetCurNick call GetCurNick
ld a, [wMenuSelection] ld a, [wMenuSelection]
ld hl, PartyJumpTable ld hl, PartyJumpTable
@ -972,7 +975,7 @@ PartyCheckLessThanTwo:
jp PartyPrompt jp PartyPrompt
PartyHeldItem: PartyHeldItem:
callab Function_8f1cb callfar FreezeMonIcons
ld hl, .HoldItemMenu ld hl, .HoldItemMenu
call LoadMenuHeader call LoadMenuHeader
call VerticalMenu call VerticalMenu
@ -1009,7 +1012,7 @@ PartyHeldItem:
call SpeechTextBox call SpeechTextBox
call LoadItemData call LoadItemData
call CheckTossableItem call CheckTossableItem
ld a, [wItemAttributeParamBuffer] ld a, [wItemAttributeValue]
and a and a
jp nz, .CantGive jp nz, .CantGive
call GetPartyItemOffset call GetPartyItemOffset
@ -1198,8 +1201,8 @@ PartyRecieveItem:
ret ret
UnusedHandleItemJumptable: UnusedHandleItemJumptable:
callab CheckItemMenu callfar CheckItemMenu
ld a, [wItemAttributeParamBuffer] ld a, [wItemAttributeValue]
ld hl, UnusedItemJumptable ld hl, UnusedItemJumptable
jp CallJumptable jp CallJumptable
@ -1233,13 +1236,13 @@ PartyBallPocket:
PartyGiveMail: PartyGiveMail:
call LoadStandardMenuHeader call LoadStandardMenuHeader
ld de, wMovementBufferCount ld de, wMovementBufferCount
callab ComposeMailMessage callfar ComposeMailMessage
xor a xor a
ldh [hBGMapMode], a ldh [hBGMapMode], a
call LoadFontsBattleExtra call LoadFontsBattleExtra
call Call_ExitMenu call Call_ExitMenu
call WaitBGMap call WaitBGMap
ld a, [wWhichPokemon] ld a, [wCurPartyMon]
ld hl, $BA68 ld hl, $BA68
ld bc, $0028 ld bc, $0028
call AddNTimes call AddNTimes
@ -1269,7 +1272,7 @@ PartyMailMenu:
call YesNoBox call YesNoBox
call CloseWindow call CloseWindow
jp c, .exit jp c, .exit
ld a, [wWhichPokemon] ld a, [wCurPartyMon]
ld hl, wPartyMon1 + MON_ITEM ld hl, wPartyMon1 + MON_ITEM
ld bc, $0030 ld bc, $0030
call AddNTimes call AddNTimes
@ -1289,7 +1292,7 @@ PartyMailMenu:
call MenuTextBoxBackup call MenuTextBoxBackup
jr .exit jr .exit
.GiveMail .GiveMail
ld a, [wWhichPokemon] ld a, [wCurPartyMon]
ld hl, $BA68 ld hl, $BA68
ld bc, $0028 ld bc, $0028
call AddNTimes call AddNTimes
@ -1365,7 +1368,7 @@ PartyPokemonSummary:
jp HandleSelectedPokemon jp HandleSelectedPokemon
PartyTryCut: PartyTryCut:
callab CutFunction callfar CutFunction
ld a, [wFieldMoveSucceeded] ld a, [wFieldMoveSucceeded]
cp $F cp $F
jp nz, HandleSelectedPokemon jp nz, HandleSelectedPokemon
@ -1375,7 +1378,7 @@ PartyTryCut:
PartyTryFly: PartyTryFly:
bit 2, a bit 2, a
jp z, PrintNeedNewBadgeText jp z, PrintNeedNewBadgeText
callab FlyFunction callfar FlyFunction
ld a, [wFieldMoveSucceeded] ld a, [wFieldMoveSucceeded]
cp $F cp $F
jp nz, HandleSelectedPokemon jp nz, HandleSelectedPokemon
@ -1387,7 +1390,7 @@ PartyCantUseMove:
jp HandleSelectedPokemon jp HandleSelectedPokemon
PartyTryTeleport: PartyTryTeleport:
callab TeleportFunction callfar TeleportFunction
ld a, [wFieldMoveSucceeded] ld a, [wFieldMoveSucceeded]
and a and a
jp z, HandleSelectedPokemon jp z, HandleSelectedPokemon
@ -1397,7 +1400,7 @@ PartyTryTeleport:
PartyTrySurf: PartyTrySurf:
bit 4, a bit 4, a
jp z, PrintNeedNewBadgeText jp z, PrintNeedNewBadgeText
callab SurfFunction callfar SurfFunction
ld a, [wFieldMoveSucceeded] ld a, [wFieldMoveSucceeded]
and a and a
jp z, HandleSelectedPokemon jp z, HandleSelectedPokemon
@ -1405,7 +1408,7 @@ PartyTrySurf:
jp PartyPromptExit jp PartyPromptExit
PartyTryDig: PartyTryDig:
callab DigFunction callfar DigFunction
ld a, [wFieldMoveSucceeded] ld a, [wFieldMoveSucceeded]
cp $F cp $F
jp nz, HandleSelectedPokemon jp nz, HandleSelectedPokemon
@ -1429,9 +1432,9 @@ PartyCalculateHealth:
sub [hl] sub [hl]
dec hl dec hl
ldh a, [hQuotient + 1] ldh a, [hQuotient + 1]
sbc a, [hl] sbc [hl]
jp nc, PrintNotHealthyEnoughText jp nc, PrintNotHealthyEnoughText
callab Functionf218 callfar Functionf218
jp HandleSelectedPokemon jp HandleSelectedPokemon
PrintNotHealthyEnoughText: PrintNotHealthyEnoughText:
@ -1468,9 +1471,9 @@ PokeSummary:
call ClearSprites call ClearSprites
xor a xor a
ldh [hBGMapMode], a ldh [hBGMapMode], a
callab LoadOnlyPokemonStatsGraphics callfar LoadOnlyPokemonStatsGraphics
callab Function8f0cc callfar Function8f0cc
ld a, [wWhichPokemon] ld a, [wCurPartyMon]
ld e, a ld e, a
ld d, 0 ld d, 0
ld hl, wPartySpecies ld hl, wPartySpecies
@ -1498,7 +1501,7 @@ PokeSummary:
lb bc, 1, 9 lb bc, 1, 9
call ClearBox call ClearBox
hlcoord 16, 0 hlcoord 16, 0
ld a, [wWhichPokemon] ld a, [wCurPartyMon]
and a and a
jr z, .FirstPokeChosen jr z, .FirstPokeChosen
ld [hl], "」" ld [hl], "」"
@ -1519,20 +1522,20 @@ SummaryDrawPoke:
ldh [hBGMapMode], a ldh [hBGMapMode], a
ld [wSelectedSwapPosition], a ld [wSelectedSwapPosition], a
ld [wMonType], a ld [wMonType], a
predef Function50000 predef CopyMonToTempMon
ld hl, wcd81 ld hl, wTempMonMoves
ld de, wce2e ld de, wListMoves_MoveIndicesBuffer
ld bc, $0004 ld bc, $0004
call CopyBytes call CopyBytes
ld a, $28 ld a, $28
ld [wHPBarMaxHP], a ld [wHPBarMaxHP], a
hlcoord 2, 3 hlcoord 2, 3
predef Function50bfe predef ListMoves
hlcoord 11, 3 hlcoord 11, 3
predef Function506d4 predef ListMovePP
call WaitBGMap call WaitBGMap
call SetPalettes call SetPalettes
ld a, [wcd57] ld a, [wNumMoves]
inc a inc a
ld [w2DMenuNumRows], a ld [w2DMenuNumRows], a
hlcoord 0, 10 hlcoord 0, 10
@ -1555,7 +1558,7 @@ PartySelectionInputs:
.PartySelectSkipInputs .PartySelectSkipInputs
ld hl, wPartyMon1 + MON_MOVES ld hl, wPartyMon1 + MON_MOVES
lb bc, 0, $30 lb bc, 0, $30
ld a, [wWhichPokemon] ld a, [wCurPartyMon]
call AddNTimes call AddNTimes
ld a, [wMenuCursorY] ld a, [wMenuCursorY]
dec a dec a
@ -1576,13 +1579,13 @@ PartySelectionInputs:
ld a, [wCurSpecies] ld a, [wCurSpecies]
ld b, a ld b, a
hlcoord 5, 12 hlcoord 5, 12
predef Function500a0 predef PrintMoveType
ld a, [wCurSpecies] ld a, [wCurSpecies]
dec a dec a
ld hl, Data418b8 ld hl, Moves + MOVE_POWER
ld bc, $7 ld bc, MOVE_LENGTH
call AddNTimes call AddNTimes
ld a, BANK(Data418b8) ld a, BANK(Moves)
call GetFarByte call GetFarByte
hlcoord 15, 12 hlcoord 15, 12
cp 2 cp 2
@ -1610,7 +1613,7 @@ PartySelectionInputs:
jp PartySelectionInputs jp PartySelectionInputs
.PartyPokeDetailsAdvancePage .PartyPokeDetailsAdvancePage
ld hl, wWhichPokemon ld hl, wCurPartyMon
inc [hl] inc [hl]
ld a, [wPartyCount] ld a, [wPartyCount]
cp [hl] cp [hl]
@ -1619,7 +1622,7 @@ PartySelectionInputs:
jp PartySelectionInputs jp PartySelectionInputs
.PartyPokeDetailsBackPage .PartyPokeDetailsBackPage
ld hl, wWhichPokemon ld hl, wCurPartyMon
ld a, [hl] ld a, [hl]
and a and a
jp z, PartySelectionInputs jp z, PartySelectionInputs
@ -1637,7 +1640,7 @@ PartySelectionInputs:
.swap .swap
ld hl, wPartyMon1 + MON_MOVES ld hl, wPartyMon1 + MON_MOVES
ld bc, $0030 ld bc, $0030
ld a, [wWhichPokemon] ld a, [wCurPartyMon]
call AddNTimes call AddNTimes
push hl push hl
call SwapEntries call SwapEntries
@ -1647,9 +1650,9 @@ PartySelectionInputs:
call SwapEntries call SwapEntries
ld a, [wBattleMode] ld a, [wBattleMode]
jr z, .NotInBattle jr z, .NotInBattle
ld hl, wca04 ld hl, wBattleMonMoves
ld bc, $0020 ld bc, $0020
ld a, [wWhichPokemon] ld a, [wCurPartyMon]
call AddNTimes call AddNTimes
push hl push hl
call SwapEntries call SwapEntries
@ -1792,8 +1795,8 @@ GetRegisteredItemID:
ret ret
UseRegisteredItem: UseRegisteredItem:
callab CheckItemMenu callfar CheckItemMenu
ld a, [wItemAttributeParamBuffer] ld a, [wItemAttributeValue]
ld hl, .RegisteredItemJumptable ld hl, .RegisteredItemJumptable
jp CallJumptable jp CallJumptable
@ -2110,15 +2113,15 @@ DrawTrainerCardMainPage:
ld de, wPlayerName ld de, wPlayerName
call PlaceString call PlaceString
hlcoord 5, 4 hlcoord 5, 4
ld de, wce73 ld de, wPlayerID
lb bc, 2, 5 lb bc, 2, 5
call PrintNumber call PrintNumber
hlcoord 7, 6 hlcoord 7, 6
ld de, wd15d ld de, wMoney
lb bc, 3, 6 lb bc, 3, 6
call PrintNumber call PrintNumber
ld [hl], $F0 ld [hl], $F0
ld hl, wPokedexOwned ld hl, wPokedexCaught
ld b, $1C ld b, $1C
call CountSetBits call CountSetBits
ld de, wce37 ld de, wce37

View File

@ -247,7 +247,7 @@ NamingScreenJoypadLoop:
bit 7, a bit 7, a
jr nz, .leap jr nz, .leap
call .RunJumpTable call .RunJumpTable
callba PlaySpriteAnimationsAndDelayFrame farcall PlaySpriteAnimationsAndDelayFrame
call .UpdateStringEntry call .UpdateStringEntry
call DelayFrame call DelayFrame
and a and a
@ -255,7 +255,7 @@ NamingScreenJoypadLoop:
.leap .leap
; kills sprites and resets screen position ; kills sprites and resets screen position
callab InitEffectObject callfar InitEffectObject
call ClearSprites call ClearSprites
xor a xor a
ldh [hSCX], a ldh [hSCX], a
@ -620,7 +620,7 @@ NamingScreenGetLastCharacter:
LoadNamingScreenGFX: LoadNamingScreenGFX:
call ClearSprites call ClearSprites
callab InitEffectObject callfar InitEffectObject
call LoadFont call LoadFont
ld de, TextScreenGFX_End ld de, TextScreenGFX_End
@ -811,14 +811,14 @@ DoMailEntry:
bit 7, a bit 7, a
jr nz, .exit_mail jr nz, .exit_mail
call .DoJumpTable call .DoJumpTable
callba PlaySpriteAnimationsAndDelayFrame farcall PlaySpriteAnimationsAndDelayFrame
call .Update call .Update
call DelayFrame call DelayFrame
and a and a
ret ret
.exit_mail .exit_mail
callab InitEffectObject callfar InitEffectObject
call ClearSprites call ClearSprites
xor a xor a
ldh [hSCX], a ldh [hSCX], a

View File

@ -26,7 +26,7 @@ GameFreakIntro::
ld b, SGB_GF_INTRO ld b, SGB_GF_INTRO
call GetSGBLayout call GetSGBLayout
callab IntroCopyRightInfo callfar IntroCopyRightInfo
ld a, 1 ld a, 1
ldh [hBGMapMode], a ldh [hBGMapMode], a
@ -77,7 +77,7 @@ GameFreakIntro::
ld a, BANK(GameFreakLogoSparkleGFX) ld a, BANK(GameFreakLogoSparkleGFX)
call FarCopyData call FarCopyData
callba InitEffectObject farcall InitEffectObject
ld hl, wSpriteAnimDict ld hl, wSpriteAnimDict
ld a, SPRITE_ANIM_DICT_GS_SPLASH ld a, SPRITE_ANIM_DICT_GS_SPLASH
@ -119,7 +119,7 @@ GameFreakIntro::
bit 7, a bit 7, a
jr nz, .Finished jr nz, .Finished
callba EffectObjectJumpNoDelay farcall EffectObjectJumpNoDelay
call GameFreakPresentsScene call GameFreakPresentsScene
call DelayFrame call DelayFrame
@ -131,7 +131,7 @@ GameFreakIntro::
set 6, [hl] set 6, [hl]
.Finished: .Finished:
callab InitEffectObject callfar InitEffectObject
call ClearTileMap call ClearTileMap
call ClearSprites call ClearSprites

View File

@ -31,8 +31,8 @@ GameStart::
call ClearTileMap call ClearTileMap
ld a, DEX_YADOKING ld a, DEX_YADOKING
ld [wCurSpecies], a ld [wCurSpecies], a
ld [wMonDexIndex], a ld [wCurPartySpecies], a
call GetMonHeader call GetBaseData
hlcoord 6, 4 hlcoord 6, 4
hlcoord 6, 4 hlcoord 6, 4
call PrepMonFrontpic call PrepMonFrontpic
@ -69,7 +69,7 @@ GameStart::
call FadeInIntroPic call FadeInIntroPic
ld hl, OakSpeech6 ld hl, OakSpeech6
call PrintText call PrintText
callba SetClockDialog farcall SetClockDialog
call Function04ac call Function04ac
call GBFadeOutToWhite call GBFadeOutToWhite
call ClearTileMap call ClearTileMap
@ -162,11 +162,11 @@ GameStartPlacement::
DebugSetUpPlayer:: DebugSetUpPlayer::
call SetPlayerNamesDebug call SetPlayerNamesDebug
ld a, $0F ld a, $0F
ld [wd15d], a ld [wMoney], a
ld a, $42 ld a, $42
ld [wd15e], a ld [wMoney + 1], a
ld a, $3F ld a, $3F
ld [wd15f], a ld [wMoney + 2], a
ld a, $FF ; give all badges ld a, $FF ; give all badges
ld [wJohtoBadges], a ld [wJohtoBadges], a
ld [wKantoBadges], a ld [wKantoBadges], a
@ -176,11 +176,11 @@ DebugSetUpPlayer::
call FillTMs call FillTMs
ld de, DebugBagItems ld de, DebugBagItems
call FillBagWithList call FillBagWithList
ld hl, wPokedexOwned ld hl, wPokedexCaught
call DebugFillPokedex call DebugFillPokedex
ld hl, wPokedexSeen ld hl, wPokedexSeen
call DebugFillPokedex call DebugFillPokedex
ld hl, wAnnonDex ld hl, wUnownDex
ld [hl], $01 ld [hl], $01
call Function40fd call Function40fd
ret ret
@ -276,7 +276,7 @@ GiveKantoStarters::
ret ret
GivePokemon:: GivePokemon::
ld [wMonDexIndex], a ld [wCurPartySpecies], a
ld a, b ld a, b
ld [wCurPartyLevel], a ld [wCurPartyLevel], a
ld a, $10 ld a, $10
@ -291,13 +291,13 @@ AddRandomPokemonToBox:
xor a xor a
ld [wca44], a ld [wca44], a
call RandomUnder246 call RandomUnder246
ld [wcdd7], a ld [wTempEnemyMonSpecies], a
ld a, $05 ld a, $05
ld [wCurPartyLevel], a ld [wCurPartyLevel], a
callab AddPokemonToBox callfar AddPokemonToBox
ld a, [wcdd7] ld a, [wTempEnemyMonSpecies]
ld [wMonDexIndex], a ld [wCurPartySpecies], a
callab Functiondd5c callfar Functiondd5c
pop af pop af
dec a dec a
jr nz, .loop jr nz, .loop
@ -494,7 +494,7 @@ ChoosePlayerName::
.loop .loop
ld b, $01 ld b, $01
ld de, wPlayerName ld de, wPlayerName
callba NamingScreen farcall NamingScreen
ld a, [wPlayerName] ld a, [wPlayerName]
cp "@" cp "@"
jr z, .loop jr z, .loop
@ -547,7 +547,7 @@ ChooseRivalName::
.loop .loop
ld b, $02 ld b, $02
ld de, wRivalName ld de, wRivalName
callba NamingScreen farcall NamingScreen
ld a, [wRivalName] ld a, [wRivalName]
cp "@" cp "@"
jr z, .loop jr z, .loop
@ -599,14 +599,14 @@ MomNamePrompt::
.loop .loop
ld b, $03 ld b, $03
ld de, wMomsName ld de, wMomsName
callba NamingScreen farcall NamingScreen
ld a, [wMomsName] ld a, [wMomsName]
cp "@" cp "@"
jr z, .loop jr z, .loop
call ClearPalettes call ClearPalettes
call ClearTileMap call ClearTileMap
callab Function140d9 callfar Function140d9
call LoadFontExtra call LoadFontExtra
call GetMemSGBLayout call GetMemSGBLayout
call WaitBGMap call WaitBGMap

View File

@ -10,7 +10,7 @@ OpeningCutscene::
ret ret
.Init: .Init:
callba InitEffectObject farcall InitEffectObject
xor a xor a
ld [wIntroJumptableIndex], a ld [wIntroJumptableIndex], a
ldh [hBGMapMode], a ldh [hBGMapMode], a
@ -27,14 +27,14 @@ OpeningCutscene::
bit 7, a bit 7, a
jr nz, .Finish jr nz, .Finish
callba EffectObjectJumpNoDelay farcall EffectObjectJumpNoDelay
call IntroSceneJumper call IntroSceneJumper
call DelayFrame call DelayFrame
and a and a
ret ret
.Finish: .Finish:
callab InitEffectObject callfar InitEffectObject
call ClearSprites call ClearSprites
call DelayFrame call DelayFrame
xor a xor a
@ -80,7 +80,7 @@ IntroScene1:
ld c, 0 ld c, 0
call GetSGBLayout call GetSGBLayout
callab InitEffectObject callfar InitEffectObject
call Intro_ResetLYOverrides call Intro_ResetLYOverrides
@ -330,7 +330,7 @@ IntroScene3_Jumper:
call Intro_InitMagikarps call Intro_InitMagikarps
ret ret
.load_palettes .load_palettes
callab LoadMagikarpPalettes_Intro callfar LoadMagikarpPalettes_Intro
ret ret
.scene3_5: .scene3_5:
@ -547,7 +547,7 @@ Intro_InitSineLYOverrides:
.loop .loop
push af push af
push de push de
callba BattleAnim_Sine_e farcall BattleAnim_Sine_e
ld a, e ld a, e
ld [bc], a ld [bc], a
inc bc inc bc
@ -602,7 +602,7 @@ IntroScene6:
ld b, SGB_GS_INTRO ld b, SGB_GS_INTRO
ld c, 1 ld c, 1
call GetSGBLayout call GetSGBLayout
callab InitEffectObject callfar InitEffectObject
call Intro_ResetLYOverrides call Intro_ResetLYOverrides
ld hl, vChars2 ld hl, vChars2
ld de, IntroForestGFX ld de, IntroForestGFX
@ -700,7 +700,7 @@ IntroScene8:
ld [wIntroFrameCounter1], a ld [wIntroFrameCounter1], a
ld hl, wIntroJumptableIndex ld hl, wIntroJumptableIndex
inc [hl] inc [hl]
callab LoadForestPalettes2_Intro callfar LoadForestPalettes2_Intro
ret ret
IntroScene9: IntroScene9:
@ -791,7 +791,7 @@ IntroScene10:
ld b, SGB_GS_INTRO ld b, SGB_GS_INTRO
ld c, 2 ld c, 2
call GetSGBLayout call GetSGBLayout
callab InitEffectObject callfar InitEffectObject
call Intro_ResetLYOverrides call Intro_ResetLYOverrides
call Intro_BlankTilemapAndBGMap call Intro_BlankTilemapAndBGMap
@ -1057,11 +1057,11 @@ Intro_FlashSilhouette:
ret ret
Intro_LoadVenusaurPalette: Intro_LoadVenusaurPalette:
callab LoadVenusaurPalettes_Intro callfar LoadVenusaurPalettes_Intro
ret ret
Intro_LoadCharizardPalette: Intro_LoadCharizardPalette:
callab LoadCharizardPalettes_Intro callfar LoadCharizardPalettes_Intro
ret ret
DrawIntroCharizardGraphic: DrawIntroCharizardGraphic:

View File

@ -3,22 +3,22 @@ INCLUDE "constants.asm"
SECTION "engine/movie/title.asm@Title screen", ROMX SECTION "engine/movie/title.asm@Title screen", ROMX
IntroSequence:: IntroSequence::
callab GameFreakIntro callfar GameFreakIntro
jr c, TitleSequenceStart jr c, TitleSequenceStart
ld a, [wTitleSequenceOpeningType] ld a, [wTitleSequenceOpeningType]
and a and a
jr z, .opening_sequence jr z, .opening_sequence
.pikachu_minigame .pikachu_minigame
callab PikachuMiniGame callfar PikachuMiniGame
jr TitleSequenceStart jr TitleSequenceStart
.opening_sequence .opening_sequence
callab OpeningCutscene callfar OpeningCutscene
TitleSequenceStart:: TitleSequenceStart::
call TitleSequenceInit call TitleSequenceInit
callab SetTitleBGDecorationBorder callfar SetTitleBGDecorationBorder
.loop .loop
call TitleScreenMain call TitleScreenMain
@ -64,7 +64,7 @@ TitleSequenceInit::
call DisableLCD call DisableLCD
call ClearSprites call ClearSprites
callba InitEffectObject farcall InitEffectObject
ld hl, vChars0 ld hl, vChars0
ld bc, vBGMap0 - vChars0 ld bc, vBGMap0 - vChars0
@ -176,7 +176,7 @@ TitleScreenMain::
bit 7, a bit 7, a
jr nz, .exit jr nz, .exit
call TitleScreenSequence call TitleScreenSequence
callba EffectObjectJumpNoDelay farcall EffectObjectJumpNoDelay
call DelayFrame call DelayFrame
and a and a
ret ret
@ -540,7 +540,7 @@ SRAMClearMenu::
cp $01 cp $01
jp z, Init jp z, Init
callab InitAllSRAMBanks callfar InitAllSRAMBanks
jp Init jp Init
SRAMClear_Message:: SRAMClear_Message::

View File

@ -8,7 +8,7 @@ OverworldMovementCheck::
UnusedOverworldMovementCheck:: UnusedOverworldMovementCheck::
ld a, PLAYER_OBJECT_INDEX ld a, PLAYER_OBJECT_INDEX
ldh [hEventCollisionException], a ldh [hEventCollisionException], a
ld a, [wPlayerDirection] ld a, [wPlayerStepType]
and a and a
jr z, SetPlayerIdle ; player movement is disabled jr z, SetPlayerIdle ; player movement is disabled
ldh a, [hJoyState] ldh a, [hJoyState]
@ -514,7 +514,7 @@ IsPlayerCollisionTileSolid::
; c - solid/sometimes solid ; c - solid/sometimes solid
push de push de
ld bc, wPlayerStruct ld bc, wPlayerStruct
callab _IsObjectCollisionTileSolid callfar _IsObjectCollisionTileSolid
ld a, e ld a, e
pop de pop de
ret ret
@ -526,7 +526,7 @@ CheckPlayerObjectCollision::
; nc - no collision ; nc - no collision
; c - collision ; c - collision
push de push de
callab _CheckPlayerObjectCollision callfar _CheckPlayerObjectCollision
pop de pop de
ret nc ret nc
jp CheckCompanionObjectCollision jp CheckCompanionObjectCollision
@ -565,7 +565,7 @@ CheckCompanionObjectCollision::
_OverworldMovementCheck:: _OverworldMovementCheck::
ld a, PLAYER_OBJECT_INDEX ld a, PLAYER_OBJECT_INDEX
ldh [hEventCollisionException], a ldh [hEventCollisionException], a
ld a, [wPlayerDirection] ld a, [wPlayerStepType]
and a and a
jp z, SetPlayerIdle jp z, SetPlayerIdle
ldh a, [hJoyState] ldh a, [hJoyState]
@ -1040,7 +1040,7 @@ CheckObjectCollision::
ld a, [wPlayerMapY] ld a, [wPlayerMapY]
add e add e
ld e, a ld e, a
callab _CheckObjectCollision callfar _CheckObjectCollision
ret nc ret nc
jp CheckCompanionObjectCollision jp CheckCompanionObjectCollision

View File

@ -80,7 +80,7 @@ HealParty:
.party_done .party_done
xor a xor a
ld [wWhichPokemon], a ld [wCurPartyMon], a
ld [wce37], a ld [wce37], a
ld a, [wPartyCount] ld a, [wPartyCount]
ld b, a ld b, a
@ -89,7 +89,7 @@ HealParty:
push bc push bc
call ApplyPPUp call ApplyPPUp
pop bc pop bc
ld hl, wWhichPokemon ld hl, wCurPartyMon
inc [hl] inc [hl]
dec b dec b
jr nz, .pp_up jr nz, .pp_up
@ -236,7 +236,7 @@ UpdateHPBar_AnimateHPBar:
push af push af
push de push de
ld d, HP_BAR_LENGTH ld d, HP_BAR_LENGTH
ld a, [wHPBarType] ld a, [wWhichHPBar]
and BATTLE_HP_BAR and BATTLE_HP_BAR
ld b, a ld b, a
call DrawBattleHPBar call DrawBattleHPBar
@ -300,7 +300,7 @@ UpdateHPBar_CalcHPDifference:
UpdateHPBar_PrintHPNumber: UpdateHPBar_PrintHPNumber:
push af push af
push de push de
ld a, [wHPBarType] ld a, [wWhichHPBar]
and a and a
jr z, .done jr z, .done
ld a, [wHPBarOldHP] ld a, [wHPBarOldHP]

View File

@ -107,25 +107,25 @@ AddOutdoorSprites:
ret ret
Function140d9: Function140d9:
ld hl, wcdaf ld hl, wSpriteFlags
ld a, [hl] ld a, [hl]
push af push af
res 7, [hl] res 7, [hl]
set 6, [hl] set 6, [hl]
call LoadUsedSpritesGfx call LoadUsedSpritesGfx
pop af pop af
ld [wcdaf], a ld [wSpriteFlags], a
ret ret
Function140ea: Function140ea:
ld hl, wcdaf ld hl, wSpriteFlags
ld a, [hl] ld a, [hl]
push af push af
set 7, [hl] set 7, [hl]
res 6, [hl] res 6, [hl]
call LoadUsedSpritesGfx call LoadUsedSpritesGfx
pop af pop af
ld [wcdaf], a ld [wSpriteFlags], a
ret ret
LoadUsedSpritesGfx: LoadUsedSpritesGfx:
@ -197,7 +197,7 @@ LoadOverworldSprite:
push bc push bc
push hl push hl
push de push de
ld a, [wcdaf] ld a, [wSpriteFlags]
bit 7, a bit 7, a
jr nz, .dont_copy jr nz, .dont_copy
call Get2bpp call Get2bpp
@ -214,7 +214,7 @@ LoadOverworldSprite:
pop af pop af
call IsAnimatedSprite call IsAnimatedSprite
ret c ret c
ld a, [wcdaf] ld a, [wSpriteFlags]
bit 6, a bit 6, a
ret nz ret nz
call Get2bpp call Get2bpp

View File

@ -169,13 +169,13 @@ TrainerGear_Loop:
bit TRAINERGEAR_END_LOOP_F, a bit TRAINERGEAR_END_LOOP_F, a
jr nz, .done jr nz, .done
call TrainerGear_Jumptable call TrainerGear_Jumptable
callba EffectObjectJumpNoDelay farcall EffectObjectJumpNoDelay
call TrainerGear_UpdateTime call TrainerGear_UpdateTime
call DelayFrame call DelayFrame
and a and a
ret ret
.done .done
callab InitEffectObject callfar InitEffectObject
call ClearSprites call ClearSprites
xor a xor a
ldh [hSCX], a ldh [hSCX], a
@ -224,7 +224,7 @@ TrainerGear_Next:
ret ret
TrainerGear_InitPointerSprite: TrainerGear_InitPointerSprite:
callab InitEffectObject callfar InitEffectObject
ld de, PointerGFX ld de, PointerGFX
ld hl, vChars0 tile TRAINERGEAR_GFX_POINTER ld hl, vChars0 tile TRAINERGEAR_GFX_POINTER
lb bc, BANK(PointerGFX), 4 lb bc, BANK(PointerGFX), 4
@ -623,7 +623,7 @@ TrainerGear_PhoneJoypad:
ret ret
TrainerGear_ClearView: TrainerGear_ClearView:
callab InitEffectObject callfar InitEffectObject
call ClearSprites call ClearSprites
call WaitForAutoBgMapTransfer call WaitForAutoBgMapTransfer
coord hl, 0, 3 coord hl, 0, 3

View File

@ -10,13 +10,13 @@ Function1130b:
cp PARTY_LENGTH cp PARTY_LENGTH
jr c, .bigjump jr c, .bigjump
ld a, [wBoxListLength] ld a, [wBoxListLength]
cp $1E cp MONS_PER_BOX
jr nc, .fullbox jr nc, .fullbox
xor a xor a
ld [wca44], a ld [wca44], a
ld a, [wMonDexIndex] ld a, [wCurPartySpecies]
ld [wcdd7], a ld [wTempEnemyMonSpecies], a
callab AddPokemonToBox callfar AddPokemonToBox
call RecievePokemon call RecievePokemon
predef Functiondd5c predef Functiondd5c
and $7F and $7F
@ -40,12 +40,12 @@ Function1130b:
ret ret
RecievePokemon: RecievePokemon:
ld a, [wMonDexIndex] ld a, [wCurPartySpecies]
push af push af
ld [wNamedObjectIndexBuffer], a ld [wNamedObjectIndexBuffer], a
dec a dec a
ld c, a ld c, a
ld hl, wPokedexOwned ld hl, wPokedexCaught
ld b, 01 ;SET_FLAG ld b, 01 ;SET_FLAG
predef SmallFarFlagAction predef SmallFarFlagAction
pop af pop af

View File

@ -3,19 +3,19 @@ INCLUDE "constants.asm"
SECTION "home/copy2.asm", ROM0 SECTION "home/copy2.asm", ROM0
RedrawPlayerSprite:: RedrawPlayerSprite::
jpab _RedrawPlayerSprite jpfar _RedrawPlayerSprite
LoadFont:: LoadFont::
jpab LoadFontGraphics jpfar LoadFontGraphics
LoadFontsBattleExtra:: LoadFontsBattleExtra::
jpab LoadPokemonMenuGraphics jpfar LoadPokemonMenuGraphics
LoadFontExtra:: LoadFontExtra::
jpab LoadFontExtraGraphicsWithCursor jpfar LoadFontExtraGraphicsWithCursor
LoadToolgearGraphics:: LoadToolgearGraphics::
jpab LoadToolgearGraphicsDebug jpfar LoadToolgearGraphicsDebug
FarCopyData: FarCopyData:
; Identical to FarCopyBytes except for tail call optimization. ; Identical to FarCopyBytes except for tail call optimization.

View File

@ -64,7 +64,7 @@ GetCryIndex::
push af push af
ld a, d ld a, d
ld [wce37], a ld [wce37], a
callba Function40b45 farcall ConvertMon_2to1
ld a, [wce37] ld a, [wce37]
dec a dec a
ld c, a ld c, a
@ -77,7 +77,7 @@ PrintLevel::
ld a, $6e ; ":L" ld a, $6e ; ":L"
ld [hli], a ld [hli], a
ld c, 2 ld c, 2
ld a, [wLoadedMonLevel] ld a, [wTempMonLevel]
cp 100 cp 100
jr c, _PrintLevelCommon jr c, _PrintLevelCommon
dec hl dec hl
@ -88,15 +88,15 @@ PrintLevelFullWidth::
ld a, $6e ; ":L" ld a, $6e ; ":L"
ld [hli], a ld [hli], a
ld c, 3 ld c, 3
ld a, [wLoadedMonLevel] ld a, [wTempMonLevel]
_PrintLevelCommon: _PrintLevelCommon:
ld [wce37], a ld [wce37], a
ld de, wce37 ld de, wce37
ld b, PRINTNUM_RIGHTALIGN | 1 ld b, PRINTNUM_RIGHTALIGN | 1
jp PrintNumber jp PrintNumber
Function3a42:: GetNthMove:: ; unreferenced?
ld hl, wce2e ld hl, wListMoves_MoveIndicesBuffer
ld c, a ld c, a
ld b, 0 ld b, 0
add hl, bc add hl, bc

View File

@ -325,13 +325,13 @@ MapSetup_22af::
ret ret
MapSetup_22de:: MapSetup_22de::
callab OverworldFadeOut callfar OverworldFadeOut
MapSetup_Continue:: MapSetup_Continue::
call DisableLCD call DisableLCD
call DisableAudio call DisableAudio
call VolumeOff call VolumeOff
callab LoadSpawnPoint callfar LoadSpawnPoint
call CopyMapPartialAndAttributes call CopyMapPartialAndAttributes
call SetUpMapBuffer call SetUpMapBuffer
call InitUnknownBuffercc9e call InitUnknownBuffercc9e
@ -348,19 +348,19 @@ MapSetup_Continue::
ld b, 9 ; TODO: constantify this ld b, 9 ; TODO: constantify this
call GetSGBLayout call GetSGBLayout
call LoadWildMons call LoadWildMons
call $242C ; TODO call Function242c ; TODO
call FadeIn call FadeIn
ret ret
MapSetup_Warp:: MapSetup_Warp::
callab OverworldFadeOut callfar OverworldFadeOut
call DisableLCD call DisableLCD
call Function27C7 ; TODO call Function27C7 ; TODO
ld a, [wNextWarp] ld a, [wNextWarp]
ld [wWarpNumber], a ld [wWarpNumber], a
ld a, [wNextMapGroup] ld a, [wNextMapGroup]
ld [wMapGroup], a ld [wMapGroup], a
ld a, [wNextMapId] ld a, [wNextMapNumber]
ld [wMapId], a ld [wMapId], a
call CopyMapPartialAndAttributes call CopyMapPartialAndAttributes
call SetUpMapBuffer call SetUpMapBuffer
@ -381,7 +381,7 @@ MapSetup_Warp::
ret ret
LoadMapTimeOfDay:: LoadMapTimeOfDay::
callab ReplaceTimeOfDayPals callfar ReplaceTimeOfDayPals
call LoadMapPart call LoadMapPart
call .ClearBGMap call .ClearBGMap
call .PushAttrMap call .PushAttrMap
@ -422,18 +422,18 @@ LoadMapTimeOfDay::
ret ret
LoadWildMons:: LoadWildMons::
callab _LoadWildMons callfar _LoadWildMons
ret ret
LoadGraphics:: LoadGraphics::
call LoadTileset call LoadTileset
call LoadTilesetGFX call LoadTilesetGFX
callba RefreshSprites farcall RefreshSprites
call LoadFontExtra call LoadFontExtra
ret ret
InitializeVisibleSprites:: InitializeVisibleSprites::
callab _InitializeVisibleSprites callfar _InitializeVisibleSprites
ret ret
FadeIn:: ; This is not OverworldFadeIn, but I don't know what it is FadeIn:: ; This is not OverworldFadeIn, but I don't know what it is
@ -442,16 +442,16 @@ FadeIn:: ; This is not OverworldFadeIn, but I don't know what it is
ld hl, wVramState ld hl, wVramState
set 0, [hl] set 0, [hl]
call Function2407 call Function2407
callab _UpdateSprites callfar _UpdateSprites
call DelayFrame call DelayFrame
callab OverworldFadeIn callfar OverworldFadeIn
ret ret
Function2407:: Function2407::
ld a, NO_MOVEMENT ld a, NO_MOVEMENT
ld [wPlayerMovement], a ld [wPlayerMovement], a
xor a xor a
ld [wPlayerAction], a ld [wPlayerStepFrame], a
ld a, [wPlayerFacing] ld a, [wPlayerFacing]
and $c and $c
ld [wPlayerFacing], a ld [wPlayerFacing], a
@ -466,6 +466,7 @@ Function2407::
ret z ret z
cp $78 cp $78
ret z ret z
Function242c::
ld a, $0 ld a, $0
ld [wPlayerFacing], a ld [wPlayerFacing], a
ld a, $0 ld a, $0
@ -692,7 +693,7 @@ WarpCheck::
ld a, [hli] ld a, [hli]
ld [wNextMapGroup], a ld [wNextMapGroup], a
ld a, [hli] ld a, [hli]
ld [wNextMapId], a ld [wNextMapNumber], a
ld a, c ld a, c
ld [wPrevWarp], a ld [wPrevWarp], a
ld a, MAPSETUP_WARP ld a, MAPSETUP_WARP
@ -894,7 +895,7 @@ ReadObjectEvents::
.skip .skip
ld a, [wCurrMapObjectCount] ld a, [wCurrMapObjectCount]
ld c, a ld c, a
ld a, NUM_OBJECTS ld a, NUM_OBJECTS
sub c sub c
jr z, .finish jr z, .finish
@ -1092,7 +1093,7 @@ Function27C7:: ; TODO
.interior .interior
ld a, [wNextMapGroup] ld a, [wNextMapGroup]
ld b, a ld b, a
ld a, [wNextMapId] ld a, [wNextMapNumber]
ld c, a ld c, a
call GetAnyMapEnvironment call GetAnyMapEnvironment
cp 3 cp 3
@ -1114,7 +1115,7 @@ Function27C7:: ; TODO
ret ret
LoadMapPart:: LoadMapPart::
callab UpdateTimeOfDayPal callfar UpdateTimeOfDayPal
ldh a, [hROMBank] ldh a, [hROMBank]
push af push af
@ -1612,13 +1613,13 @@ Function2ae5::
ret nz ret nz
call OverworldStartButtonCheck call OverworldStartButtonCheck
ret nz ret nz
callab OverworldMovementCheck callfar OverworldMovementCheck
ldh a, [hMapEntryMethod] ldh a, [hMapEntryMethod]
and a and a
ret nz ret nz
call Function2c4a call Function2c4a
jr nc, .loop jr nc, .loop
callba Function824c farcall Function824c
ld a, [wc5ed] ld a, [wc5ed]
bit 6, a bit 6, a
jr nz, .loop jr nz, .loop
@ -1652,7 +1653,7 @@ Function2b52::
ret nz ret nz
call Function2c4a call Function2c4a
jr nc, .asm_2b52 jr nc, .asm_2b52
callba Function824c farcall Function824c
call CheckMovingOffEdgeOfMap call CheckMovingOffEdgeOfMap
ret c ret c
call WarpCheck call WarpCheck
@ -1666,7 +1667,7 @@ Function2b78::
ret ret
Function2b79:: Function2b79::
callab DebugMapViewer callfar DebugMapViewer
ld a, $4 ld a, $4
call WriteIntod637 call WriteIntod637
ret ret
@ -1677,10 +1678,10 @@ Function2b87::
call GetJoypad call GetJoypad
call OverworldStartButtonCheck call OverworldStartButtonCheck
ret nz ret nz
callab OverworldMovementCheck callfar OverworldMovementCheck
call Function2ba8 call Function2ba8
jr nc, .asm_2b87 jr nc, .asm_2b87
callba Function824c farcall Function824c
jr .asm_2b87 jr .asm_2b87
Function2ba8:: Function2ba8::

View File

@ -3,7 +3,7 @@ INCLUDE "constants.asm"
SECTION "home/map_objects.asm", ROM0 SECTION "home/map_objects.asm", ROM0
Function15b5:: Function15b5::
callab SpawnPlayer callfar SpawnPlayer
ret ret
GetMapObject:: GetMapObject::
@ -28,7 +28,7 @@ Function15d1::
Function15da:: Function15da::
ldh [hMapObjectIndex], a ldh [hMapObjectIndex], a
callab Function8131 callfar Function8131
ldh a, [hMapObjectIndex] ldh a, [hMapObjectIndex]
call GetMapObject call GetMapObject
call Function40eb call Function40eb
@ -40,7 +40,7 @@ Function15ed::
ld a, $0 ld a, $0
ldh [hObjectStructIndex], a ldh [hObjectStructIndex], a
ld de, wObjectStructs ld de, wObjectStructs
callab CopyMapObjectToObjectStruct callfar CopyMapObjectToObjectStruct
ret ret
Function1602:: Function1602::
@ -49,7 +49,7 @@ Function1602::
ld a, FOLLOWER_STRUCT ld a, FOLLOWER_STRUCT
ldh [hObjectStructIndex], a ldh [hObjectStructIndex], a
ld de, wObject1Struct ld de, wObject1Struct
callab CopyMapObjectToObjectStruct callfar CopyMapObjectToObjectStruct
ret ret
Function1617:: Function1617::
@ -84,7 +84,7 @@ Function1617::
Function164a:: Function164a::
call Function1617 call Function1617
callab Function8125 callfar Function8125
ret ret
CopyPlayerObjectTemplate:: CopyPlayerObjectTemplate::
@ -134,7 +134,7 @@ Function1680::
and a and a
ret ret
Function169f:: DeleteMapObject::
call GetMapObject call GetMapObject
ld hl, MAPOBJECT_OBJECT_STRUCT_ID ld hl, MAPOBJECT_OBJECT_STRUCT_ID
add hl, bc add hl, bc
@ -200,7 +200,7 @@ Function16fb::
ld hl, OBJECT_MOVEMENT_TYPE ld hl, OBJECT_MOVEMENT_TYPE
add hl, bc add hl, bc
ld [hl], $19 ld [hl], $19
ld hl, OBJECT_DIRECTION ld hl, OBJECT_STEP_TYPE
add hl, bc add hl, bc
ld [hl], $0 ld [hl], $0
.asm_171f: .asm_171f:
@ -310,8 +310,8 @@ UpdateSprites::
ld a, [wVramState] ld a, [wVramState]
bit 0, a bit 0, a
ret z ret z
callab Function5007 callfar Function5007
callab _UpdateSprites callfar _UpdateSprites
ret ret
GetObjectStruct:: GetObjectStruct::
@ -522,12 +522,12 @@ Function18cc::
res 5, [hl] res 5, [hl]
ld hl, wPlayerMovementType ld hl, wPlayerMovementType
ld [hl], $10 ld [hl], $10
ld hl, wPlayerDirection ld hl, wPlayerStepType
ld [hl], $0 ld [hl], $0
ret ret
Function18e5:: Function18e5::
ld hl, OBJECT_WALKING ld hl, OBJECT_DIRECTION
add hl, bc add hl, bc
ld a, [hl] ld a, [hl]
srl a srl a
@ -541,7 +541,7 @@ Function18e5::
ld hl, OBJECT_MOVEMENT_TYPE ld hl, OBJECT_MOVEMENT_TYPE
add hl, bc add hl, bc
ld [hl], a ld [hl], a
ld hl, OBJECT_DIRECTION ld hl, OBJECT_STEP_TYPE
add hl, bc add hl, bc
ld [hl], $0 ld [hl], $0
ret ret
@ -581,7 +581,7 @@ StartFollow::
pop bc pop bc
ld a, c ld a, c
call SetFollowerIfVisible call SetFollowerIfVisible
callab QueueFollowerFirstStep callfar QueueFollowerFirstStep
ret ret
SetLeaderIfVisible:: SetLeaderIfVisible::
@ -605,7 +605,7 @@ SetFollowerIfVisible::
ld hl, OBJECT_MOVEMENT_TYPE ld hl, OBJECT_MOVEMENT_TYPE
add hl, bc add hl, bc
ld [hl], $18 ld [hl], $18
ld hl, OBJECT_DIRECTION ld hl, OBJECT_STEP_TYPE
add hl, bc add hl, bc
ld [hl], $0 ld [hl], $0
ldh a, [hObjectStructIndex] ldh a, [hObjectStructIndex]
@ -680,7 +680,7 @@ SetObjectFacing::
add a add a
add a add a
and $c and $c
ld hl, OBJECT_WALKING ld hl, OBJECT_DIRECTION
add hl, bc add hl, bc
ld [hl], a ld [hl], a
ret ret

View File

@ -5,7 +5,7 @@ SECTION "home/math.asm", ROM0
Multiply:: Multiply::
push hl push hl
push bc push bc
callab _Multiply callfar _Multiply
pop bc pop bc
pop hl pop hl
ret ret

View File

@ -69,7 +69,7 @@ Menu_WasButtonPressed::
ld a, [w2DMenuFlags] ld a, [w2DMenuFlags]
bit 6, a bit 6, a
jr z, .asm_1ad6 jr z, .asm_1ad6
callba PlaySpriteAnimationsAndDelayFrame farcall PlaySpriteAnimationsAndDelayFrame
.asm_1ad6: .asm_1ad6:
call GetJoypadDebounced call GetJoypadDebounced
ldh a, [hJoySum] ldh a, [hJoySum]
@ -285,7 +285,7 @@ PushWindow::
ExitMenu:: ExitMenu::
push af push af
callab _ExitMenu callfar _ExitMenu
call Function1c0a call Function1c0a
pop af pop af
ret ret
@ -327,7 +327,7 @@ Function1c0a::
ret ret
InitVerticalMenuCursor:: InitVerticalMenuCursor::
jpab _InitVerticalMenuCursor jpfar _InitVerticalMenuCursor
CloseWindow:: CloseWindow::
push af push af
@ -338,7 +338,7 @@ CloseWindow::
ret ret
Function1c58:: Function1c58::
jpab Function24185 jpfar Function24185
RestoreTileBackup:: RestoreTileBackup::
call MenuBoxCoord2Tile call MenuBoxCoord2Tile

View File

@ -28,12 +28,12 @@ SECTION "home/misc_32c8.asm@Unknown 3686", ROM0
GiveMonToPlayer:: GiveMonToPlayer::
; Give to the player Pokemon of species b at level c. ; Give to the player Pokemon of species b at level c.
ld a, b ld a, b
ld [wMonDexIndex], a ld [wCurPartySpecies], a
ld a, c ld a, c
ld [wCurPartyLevel], a ld [wCurPartyLevel], a
xor a xor a
ld [wMonType], a ld [wMonType], a
jpba Function1130a farjp Function1130a
WaitPressedAny:: WaitPressedAny::
; Waits for one of the buttons in d to be pressed. ; Waits for one of the buttons in d to be pressed.
@ -70,7 +70,7 @@ WaitPressedAny::
CountSetBits:: CountSetBits::
; Count the number of bits set in b bytes at hl. ; Count the number of bits set in b bytes at hl.
; Return to a, c, and wCountSetBitsResult. ; Return to a, c, and wNumSetBits.
ld c, $0 ld c, $0
.asm_36b3: .asm_36b3:
ld a, [hli] ld a, [hli]
@ -86,5 +86,5 @@ CountSetBits::
dec b dec b
jr nz, .asm_36b3 jr nz, .asm_36b3
ld a, c ld a, c
ld [wCountSetBitsResult], a ld [wNumSetBits], a
ret ret

View File

@ -10,19 +10,19 @@ GetPartyParamLocation::
ld b, 0 ld b, 0
add hl, bc add hl, bc
ld bc, PARTYMON_STRUCT_LENGTH ld bc, PARTYMON_STRUCT_LENGTH
ld a, [wWhichPokemon] ld a, [wCurPartyMon]
call AddNTimes call AddNTimes
pop bc pop bc
ret ret
UseItem:: UseItem::
jpba _UseItem farjp _UseItem
CheckTossableItem:: CheckTossableItem::
push hl push hl
push de push de
push bc push bc
callab _CheckTossableItem callfar _CheckTossableItem
pop bc pop bc
pop de pop de
pop hl pop hl

View File

@ -53,7 +53,7 @@ PrepMonFrontpic::
ld a, $1 ld a, $1
ld [wSpriteFlipped], a ld [wSpriteFlipped], a
_PrepMonFrontpic:: _PrepMonFrontpic::
ld a, [wMonDexIndex] ld a, [wCurPartySpecies]
and a and a
jr z, .asm_39a8 jr z, .asm_39a8
cp NUM_POKEMON + 1 cp NUM_POKEMON + 1
@ -74,5 +74,5 @@ _PrepMonFrontpic::
xor a xor a
ld [wSpriteFlipped], a ld [wSpriteFlipped], a
inc a inc a
ld [wMonDexIndex], a ld [wCurPartySpecies], a
ret ret

View File

@ -9,7 +9,7 @@ NamesPointers::
dba MoveNames ; MOVE_NAME dba MoveNames ; MOVE_NAME
dbw 0, 0 ; DUMMY_NAME dbw 0, 0 ; DUMMY_NAME
dba ItemNames ; ITEM_NAME dba ItemNames ; ITEM_NAME
dbw $00, wPartyMonOT ; PARTY_OT_NAME dbw $00, wPartyMonOTs ; PARTY_OT_NAME
dbw $00, wOTPartyMonOT ; ENEMY_OT_NAME dbw $00, wOTPartyMonOT ; ENEMY_OT_NAME
dba TrainerClassNames ; TRAINER_NAME dba TrainerClassNames ; TRAINER_NAME
dbw $04, $5677 ; MOVE_DESC_NAME_BROKEN (wrong bank..?) dbw $04, $5677 ; MOVE_DESC_NAME_BROKEN (wrong bank..?)
@ -245,7 +245,7 @@ Unreferenced_GetMoveName::
SECTION "home/names.asm@GetNick", ROM0 SECTION "home/names.asm@GetNick", ROM0
GetCurNick:: GetCurNick::
ld a, [wWhichPokemon] ld a, [wCurPartyMon]
ld hl, wPartyMonNicknames ld hl, wPartyMonNicknames
GetNick: GetNick:
@ -258,7 +258,7 @@ GetNick:
ld bc, MON_NAME_LENGTH ld bc, MON_NAME_LENGTH
call CopyBytes call CopyBytes
pop de pop de
callab CorrectNickErrors callfar CorrectNickErrors
pop bc pop bc
pop hl pop hl
ret ret

View File

@ -13,13 +13,13 @@ OverworldStartButtonCheck::
ld a, [wDebugFlags] ld a, [wDebugFlags]
bit DEBUG_FIELD_F, a bit DEBUG_FIELD_F, a
ret z ; debug disabled ret z ; debug disabled
callba FieldDebugMenu farcall FieldDebugMenu
jr CheckStartmenuSelectHook jr CheckStartmenuSelectHook
.regularMenu .regularMenu
callba DisplayStartMenu farcall DisplayStartMenu
jr CheckStartmenuSelectHook jr CheckStartmenuSelectHook
SelectButtonFunction:: SelectButtonFunction::
callab CheckRegisteredItem callfar CheckRegisteredItem
CheckStartmenuSelectHook: CheckStartmenuSelectHook:
ldh a, [hStartmenuCloseAndSelectHookEnable] ldh a, [hStartmenuCloseAndSelectHookEnable]
and a and a

View File

@ -3,7 +3,7 @@ INCLUDE "constants.asm"
SECTION "home/pokemon.asm@3A4B", ROM0 SECTION "home/pokemon.asm@3A4B", ROM0
GetMonHeader:: GetBaseData::
; copies the base stat data of a pokemon to wMonHeader ; copies the base stat data of a pokemon to wMonHeader
; INPUT: ; INPUT:
; [wCurSpecies] = pokemon ID in dex order ; [wCurSpecies] = pokemon ID in dex order
@ -14,9 +14,13 @@ GetMonHeader::
push af push af
ld a, BANK(BaseData) ld a, BANK(BaseData)
call Bankswitch call Bankswitch
; Egg doesn't have BaseData
ld a, [wCurSpecies] ld a, [wCurSpecies]
cp DEX_EGG cp DEX_EGG
jr z, .egg jr z, .egg
; Get BaseData
dec a dec a
ld bc, BaseData.FirstEntryEnd - BaseData ld bc, BaseData.FirstEntryEnd - BaseData
ld hl, BaseData ld hl, BaseData
@ -24,20 +28,27 @@ GetMonHeader::
ld de, wMonHeader ld de, wMonHeader
ld bc, BaseData.FirstEntryEnd - BaseData ld bc, BaseData.FirstEntryEnd - BaseData
call CopyBytes call CopyBytes
jr .done jr .end
.egg .egg
ld de, EggPicFront ld de, EggPicFront
; Sprite dimensions
ln b, 5, 5 ; egg sprite dimension ln b, 5, 5 ; egg sprite dimension
ld hl, wMonHSpriteDim ld hl, wMonHSpriteDim
ld [hl], b ld [hl], b
; front sprite
ld hl, wMonHFrontSprite ld hl, wMonHFrontSprite
ld [hl], e ld [hl], e
inc hl inc hl
ld [hl], d ld [hl], d
jr .done ; useless jr .end ; useless
.done
.end
ld a, [wCurSpecies] ld a, [wCurSpecies]
ld [wMonHIndex], a ld [wMonHIndex], a
pop af pop af
call Bankswitch call Bankswitch
pop hl pop hl
@ -52,7 +63,7 @@ UncompressMonSprite::
; Uncompresses the front or back sprite of the specified mon ; Uncompresses the front or back sprite of the specified mon
; assumes the corresponding mon header is already loaded ; assumes the corresponding mon header is already loaded
; hl contains offset to sprite pointer ($b for front or $d for back) ; hl contains offset to sprite pointer ($b for front or $d for back)
ld a, [wMonDexIndex] ld a, [wCurPartySpecies]
and a and a
ret z ret z
ld bc, wMonHeader ld bc, wMonHeader
@ -64,7 +75,7 @@ UncompressMonSprite::
ld a, [hl] ld a, [hl]
ld [wSpriteInputPtr + 1], a ld [wSpriteInputPtr + 1], a
ld hl, MonSpriteBankList ld hl, MonSpriteBankList
ld a, [wMonDexIndex] ld a, [wCurPartySpecies]
ld b, a ld b, a
; get Pokémon picture bank pointer from list ; get Pokémon picture bank pointer from list
.loop .loop

View File

@ -9,9 +9,9 @@ UpdateTimeOfDayPalettes:
; fallthrough ; fallthrough
TimeOfDayPals:: TimeOfDayPals::
callab _TimeOfDayPals callfar _TimeOfDayPals
ret ret
UpdateTimePals:: UpdateTimePals::
callab _UpdateTimePals callfar _UpdateTimePals
ret ret

View File

@ -59,7 +59,7 @@ Function385a::
jr asm_3865 jr asm_3865
Function385d:: Function385d::
callab Function_8f1cb callfar FreezeMonIcons
asm_3865: asm_3865:
pop hl pop hl
call MenuTextBox call MenuTextBox
@ -73,7 +73,7 @@ Function3872::
jr asm_387d jr asm_387d
Function3875:: Function3875::
callab PlaySpriteAnimationsAndDelayFrame callfar PlaySpriteAnimationsAndDelayFrame
asm_387d: asm_387d:
pop bc pop bc
call GetJoypad call GetJoypad

View File

@ -237,7 +237,7 @@ Serial_ExchangeLinkMenuSelection::
Serial_PrintWaitingTextAndSyncAndExchangeNybble:: Serial_PrintWaitingTextAndSyncAndExchangeNybble::
call BackUpTilesToBuffer call BackUpTilesToBuffer
callab PlaceWaitingText callfar PlaceWaitingText
call WaitLinkTransfer call WaitLinkTransfer
jp ReloadTilesFromBuffer jp ReloadTilesFromBuffer

View File

@ -147,7 +147,7 @@ Function30e8::
ret ret
GetFacingPersonText:: GetFacingPersonText::
callba Function776e farcall Function776e
ret nc ret nc
call TurnNPCTalkingTo call TurnNPCTalkingTo
scf scf
@ -208,7 +208,7 @@ PrepareTextbox::
ret ret
TextboxCleanup: TextboxCleanup:
callab ReanchorBGMap_NoOAMUpdate callfar ReanchorBGMap_NoOAMUpdate
call UpdateSprites call UpdateSprites
xor a xor a
ldh [hBGMapMode], a ldh [hBGMapMode], a
@ -221,7 +221,7 @@ TextboxCleanup:
ret ret
Function318f: Function318f:
callab Function140ea callfar Function140ea
call RedrawPlayerSprite call RedrawPlayerSprite
ret ret
@ -234,9 +234,9 @@ TurnNPCTalkingTo::
ld a, [hl] ld a, [hl]
call IsAnimatedSprite call IsAnimatedSprite
jr c, .Jump jr c, .Jump
ld a, [wPlayerWalking] ld a, [wPlayerDirection]
xor 04 xor 04
ld hl, OBJECT_WALKING ld hl, OBJECT_DIRECTION
add hl, bc add hl, bc
ld [hl], a ld [hl], a
push bc push bc

View File

@ -267,7 +267,7 @@ asm_0fbb:
push de push de
and a and a
jr nz, .asm_0fc4 jr nz, .asm_0fc4
ld de, wEnemyMonNickname ld de, wBattleMonNickname
jr PlaceCommandCharacter jr PlaceCommandCharacter
.asm_0fc4: .asm_0fc4:
@ -275,7 +275,7 @@ asm_0fbb:
call PlaceString call PlaceString
ld h, b ld h, b
ld l, c ld l, c
ld de, wBattleMonNickname ld de, wEnemyMonNickname
PlaceCommandCharacter: PlaceCommandCharacter:
call PlaceString call PlaceString
ld h, b ld h, b

View File

@ -59,7 +59,7 @@ SetHPPal::
Function3657:: Function3657::
call DisableLCD call DisableLCD
callab Function140d9 callfar Function140d9
call LoadFont call LoadFont
call UpdateSprites call UpdateSprites
call EnableLCD call EnableLCD

View File

@ -250,7 +250,7 @@ RefreshTiles::
GetFacingTileCoord:: GetFacingTileCoord::
ld a, [wPlayerWalking] ; TODO: wPlayerDirection in Crystal. Not here? ld a, [wPlayerDirection] ; TODO: wPlayerDirection in Crystal. Not here?
and %1100 and %1100
srl a srl a
srl a srl a

View File

@ -6,35 +6,35 @@ Function388f::
ret ret
Function3890:: Function3890::
callba Function14cac farcall Function14cac
ret ret
Function3899:: Function3899::
callba Function14dac farcall Function14dac
ret ret
Function38a2:: Function38a2::
callba Function14dc4 farcall Function14dc4
ret ret
Function38ab:: Function38ab::
callba Function14ddd farcall Function14ddd
ret ret
Function38b4:: Function38b4::
callba Function14e00 farcall Function14e00
ret ret
Function38bd:: Function38bd::
callba Function14e5f farcall Function14e5f
ret ret
Function38c6:: Function38c6::
callba Function14e27 farcall Function14e27
ret ret
Function38cf:: Function38cf::
callba Function14e4a farcall Function14e4a
ret ret
Function38d8:: Function38d8::
@ -50,7 +50,7 @@ TestWildBattleStart::
ret z ; if no directions are down, don't try and trigger a wild encounter ret z ; if no directions are down, don't try and trigger a wild encounter
call CheckBPressedDebug call CheckBPressedDebug
jp nz, ClearAccumulator ; if b button is down, clear acc jp nz, ClearAccumulator ; if b button is down, clear acc
callab Function3ee3e callfar Function3ee3e
ld a, [wBattleMode] ld a, [wBattleMode]
and a and a
ret z ; if no battle, return ret z ; if no battle, return

View File

@ -123,7 +123,10 @@ ROMX $02
"gfx.asm@Bank 2 Misc GFX" "gfx.asm@Bank 2 Misc GFX"
"engine/dumps/bank02.asm@QueueFollowerFirstStep" "engine/dumps/bank02.asm@QueueFollowerFirstStep"
"gfx.asm@Mon Nest Icon" "gfx.asm@Mon Nest Icon"
"engine/dumps/bank02.asm@Data8a17"
"data/maps/flypoints.asm"
"data/maps/landmarks.asm"
"engine/trainer_gear.asm@OpenTrainerGear" "engine/trainer_gear.asm@OpenTrainerGear"
"gfx.asm@Trainer Gear GFX" "gfx.asm@Trainer Gear GFX"
"engine/trainer_gear.asm@TrainerGear_RadioText" "engine/trainer_gear.asm@TrainerGear_RadioText"
@ -140,9 +143,9 @@ ROMX $03
"engine/overworld/player_movement.asm@Player Movement" "engine/overworld/player_movement.asm@Player Movement"
"data/collision/collision_type_table.asm" "data/collision/collision_type_table.asm"
"engine/overworld/player_movement.asm@Rest of Player Movement" "engine/overworld/player_movement.asm@Rest of Player Movement"
"engine/dumps/bank03.asm@Functionc77d" "engine/dumps/bank03.asm@GetFlyPointMapLocation"
"engine/overworld/spawn_points.asm" "engine/overworld/spawn_points.asm"
"engine/dumps/bank03.asm@SpawnPoints" "data/maps/spawn_points.asm"
"data/tileset_headers.asm" "data/tileset_headers.asm"
"engine/dumps/bank03.asm@Functionc9c1" "engine/dumps/bank03.asm@Functionc9c1"
"engine/items/inventory.asm@Inventory" "engine/items/inventory.asm@Inventory"
@ -155,7 +158,7 @@ ROMX $03
"engine/items/inventory.asm@_CheckTossableItem" "engine/items/inventory.asm@_CheckTossableItem"
"engine/dumps/bank03.asm@Functiond41d" "engine/dumps/bank03.asm@Functiond41d"
"engine/items/item_effects.asm" "engine/items/item_effects.asm"
"engine/dumps/bank03.asm@Functionf960" "engine/dumps/bank03.asm@GetMaxPPOfMove"
ROMX $04 ROMX $04
org $4000 org $4000
@ -307,8 +310,13 @@ ROMX $13
ROMX $14 ROMX $14
org $4000 org $4000
"engine/dumps/bank14.asm@CopyMonToTempMon"
org $40dd org $40dd
"data/types/names.asm" "data/types/names.asm"
org $4162
"engine/dumps/bank14.asm@GetTrainerClassName_Old"
org $4756
"engine/dumps/bank14.asm@Party Menu Routines"
org $4f10 org $4f10
"data/pokemon/base_stats.asm" "data/pokemon/base_stats.asm"
"data/pokemon/names.asm" "data/pokemon/names.asm"
@ -951,7 +959,7 @@ ROMX $3f
"engine/menu/reset_dialog.asm" "engine/menu/reset_dialog.asm"
"engine/debug/field/change_tileset.inc@FieldDebug_ChangeTileset" "engine/debug/field/change_tileset.inc@FieldDebug_ChangeTileset"
"engine/landmarks.asm@1" "engine/landmarks.asm@1"
"data/maps/landmarks.asm" "data/maps/landmarks.asm@LandmarkNames"
"engine/landmarks.asm@2" "engine/landmarks.asm@2"
"engine/debug/field/warp.inc@FieldDebug_ShowWarpToText" "engine/debug/field/warp.inc@FieldDebug_ShowWarpToText"
"gfx.asm@Town Map Cursor" "gfx.asm@Town Map Cursor"

View File

@ -20,7 +20,7 @@ ENDM
MACRO shift_const MACRO shift_const
DEF \1 EQU (1 << const_value) DEF \1 EQU (1 << const_value)
DEF const_value += const_inc const \1_F
ENDM ENDM
MACRO const_skip MACRO const_skip

View File

@ -1,11 +1,11 @@
MACRO callba ; bank, address MACRO farcall ; bank, address
ld a, BANK(\1) ld a, BANK(\1)
ld hl, \1 ld hl, \1
call FarCall_hl call FarCall_hl
ENDM ENDM
MACRO callab ; address, bank MACRO callfar ; address, bank
ld hl, \1 ld hl, \1
ld a, BANK(\1) ld a, BANK(\1)
call FarCall_hl call FarCall_hl
@ -21,13 +21,13 @@ MACRO homecall
call Bankswitch call Bankswitch
ENDM ENDM
MACRO jpba MACRO farjp
ld a, BANK(\1) ld a, BANK(\1)
ld hl, \1 ld hl, \1
jp FarCall_hl jp FarCall_hl
ENDM ENDM
MACRO jpab MACRO jpfar
ld hl, \1 ld hl, \1
ld a, BANK(\1) ld a, BANK(\1)
jp FarCall_hl jp FarCall_hl

View File

@ -265,13 +265,13 @@ MACRO object_struct
\1SpriteTile:: db \1SpriteTile:: db
\1MovementType:: db \1MovementType:: db
\1Flags:: dw \1Flags:: dw
\1Palette:: db
\1Walking:: db \1Walking:: db
\1Direction:: db \1Direction:: db
\1StepType:: db \1StepType:: db
\1StepDuration:: db \1StepDuration:: db
\1Action:: db \1Action:: db
\1StepFrame:: db \1StepFrame:: db
\1Object12:: db
\1Facing:: db \1Facing:: db
\1Tile:: db ; collision \1Tile:: db ; collision
\1LastTile:: db ; collision \1LastTile:: db ; collision
@ -281,13 +281,13 @@ MACRO object_struct
\1LastMapY:: db \1LastMapY:: db
\1InitX:: db \1InitX:: db
\1InitY:: db \1InitY:: db
\1Radius:: db \1RadiusX:: db
\1RadiusY:: db
\1SpriteX:: db \1SpriteX:: db
\1SpriteY:: db \1SpriteY:: db
\1SpriteXOffset:: db \1SpriteXOffset:: db
\1SpriteYOffset:: db \1SpriteYOffset:: db
\1MovementIndex:: db \1MovementIndex:: db
\1Object28:: db
\1Object29:: db \1Object29:: db
\1Object30:: db \1Object30:: db
\1Object31:: db \1Object31:: db
@ -305,7 +305,7 @@ MACRO map_object
\1ObjectRadius:: db \1ObjectRadius:: db
\1ObjectHour:: db \1ObjectHour:: db
\1ObjectTimeOfDay:: db \1ObjectTimeOfDay:: db
\1ObjectPalette:: db \1ObjectPalette:: db ; ...Questionable. Needs investigation
\1ObjectSightRange:: db \1ObjectSightRange:: db
\1ObjectScript:: dw \1ObjectScript:: dw
\1ObjectEventFlag:: dw \1ObjectEventFlag:: dw

View File

@ -91,7 +91,7 @@ SECTION "OAM Buffer", WRAM0
wShadowOAM:: wShadowOAM::
; wShadowOAMSprite00 - wShadowOAMSprite39 ; wShadowOAMSprite00 - wShadowOAMSprite39
for n, NUM_SPRITE_OAM_STRUCTS for n, NUM_SPRITE_OAM_STRUCTS
wShadowOAMSprite{02d:n}:: sprite_oam_struct wShadowOAMSprite{02d:n} wShadowOAMSprite{02d:n}:: sprite_oam_struct wShadowOAMSprite{02d:n}
endr endr
wShadowOAMEnd:: wShadowOAMEnd::
@ -375,83 +375,25 @@ wBattleAnimEnd::
ds $1a3 ; TODO ds $1a3 ; TODO
wc9e8:: ds 1 wBattle::
wc9e9:: ds 1 wEnemyMoveStruct:: move_struct wEnemyMoveStruct
wc9ea:: ds 1 wPlayerMoveStruct:: move_struct wPlayerMoveStruct
wc9eb:: ds 1
wc9ec:: ds 1
wc9ed:: ds 1
wc9ee:: ds 1
wc9ef:: ds 1
wc9f0:: ds 1
wc9f1:: ds 1
wc9f2:: ds 1
wc9f3:: ds 1
ds 1
wc9f5:: ds 1
wBattleMonNickname:: ds 6
wEnemyMonNickname:: ds 6 wEnemyMonNickname:: ds 6
wBattleMonNickname:: ds 6
wca02:: ds 1
wca03:: ds 1
wca04:: ds 1
wca05:: ds 1
ds 2
wca08:: ds 1
wca09:: ds 1
wca0a:: ds 1
ds 3
wca0e:: ds 1
wca0f:: ds 1
wIntroJumptableIndex::
wca10:: ds 1
UNION UNION
wBattleMon:: battle_struct wBattleMon
NEXTU
ds 14
wIntroJumptableIndex:: db
wIntroBGMapPointer:: ds 2 wIntroBGMapPointer:: ds 2
NEXTU
wca11:: ds 1
wca12:: ds 1
ENDU
UNION
wIntroTilemapPointer:: ds 2 wIntroTilemapPointer:: ds 2
NEXTU
wca13:: ds 1
wca14:: ds 1
ENDU
UNION
wIntroTilesPointer:: ds 2 wIntroTilesPointer:: ds 2
wIntroFrameCounter1:: ds 1 wIntroFrameCounter1:: ds 1
NEXTU
wca15:: ds 1
wca16:: ds 1
wca17:: ds 1
ENDU
wca18::
wIntroFrameCounter2:: ds 1 wIntroFrameCounter2:: ds 1
wIntroSpriteStateFlag:: ds 1 wIntroSpriteStateFlag:: ds 1
ENDU
wca1a:: ds 1
wca1b:: ds 1
wca1c:: ds 1
ds 1
wca1e:: ds 1
ds 1
wca20:: ds 1
wca21:: ds 1
wca22:: ds 1 wca22:: ds 1
wca23:: ds 1 wca23:: ds 1
wca24:: ds 1 wca24:: ds 1
@ -508,7 +450,10 @@ wca58:: ds 1
wca59:: ds 1 wca59:: ds 1
wca5a:: ds 1 wca5a:: ds 1
wca5b:: ds 1 wca5b:: ds 1
wBattleAnimParam::
wca5c:: ds 1 wca5c:: ds 1
wca5d:: ds 1 wca5d:: ds 1
ds $1d ds $1d
@ -557,7 +502,11 @@ wcabe:: ds 1
ds 1 ds 1
wcac0:: ds 1 wcac0:: ds 1
wCurPlayerSelectedMove::
wcac1:: ds 1 wcac1:: ds 1
wCurEnemySelectedMove::
wcac2:: ds 1 wcac2:: ds 1
wLinkBattleRNCount:: db wLinkBattleRNCount:: db
@ -569,11 +518,15 @@ wcac4:: ds 1
wcac7:: ds 1 wcac7:: ds 1
wcac8:: ds 1 wcac8:: ds 1
wcac9:: ds 1 wcac9:: ds 1
UNION
wPayDayMoney:: ds 3
NEXTU
wcaca:: ds 1 wcaca:: ds 1
wcacb:: ds 1
ds 1
wcacc:: ds 1 wcacc:: ds 1
ENDU
wcacd:: ds 1 wcacd:: ds 1
wcace:: ds 1 wcace:: ds 1
@ -581,12 +534,21 @@ wcace:: ds 1
wcad0:: ds 1 wcad0:: ds 1
wcad1:: ds 1 wcad1:: ds 1
wAlreadyDisobeyed::
wcad2:: ds 1 wcad2:: ds 1
wcad3:: ds 1 wcad3:: ds 1
wcad4:: ds 1 wcad4:: ds 1
wcad5:: ds 1 wcad5:: ds 1
UNION
wCurPlayerMove:: ds 1
wCurEnemyMove:: ds 1
NEXTU
wcad6:: ds 1 wcad6:: ds 1
wcad7:: ds 1 wcad7:: ds 1
ENDU
wcad8:: ds 1 wcad8:: ds 1
wcad9:: ds 1 wcad9:: ds 1
wcada:: ds 1 wcada:: ds 1
@ -770,10 +732,10 @@ wDefaultSpawnPoint::
UNION UNION
wcc40:: ; XXX fix this to cc3a wcc3a::
wMovementBufferCount:: db wMovementBufferCount:: db
wcc41:: ; XXX fix this to cc3b wcc3b::
wMovementBufferObject:: db wMovementBufferObject:: db
ptrba wMovementBufferPointer ptrba wMovementBufferPointer
@ -822,8 +784,8 @@ wSpriteOutputPtrCached:: ds 2
wSpriteDecodeTable0Ptr:: ds 2 wSpriteDecodeTable0Ptr:: ds 2
wSpriteDecodeTable1Ptr:: ds 2 wSpriteDecodeTable1Ptr:: ds 2
wccc0:: ds 1 wFXAnimID:: dw
wccc1:: ds 1
wccc2:: ds 1 wccc2:: ds 1
wccc3:: ds 1 wccc3:: ds 1
wccc4:: ds 1 wccc4:: ds 1
@ -838,7 +800,7 @@ wBGP:: db
wOBP0:: db wOBP0:: db
wOBP1:: db wOBP1:: db
wcccd:: ds 1 wNumHits:: db
wDisableVBlankWYUpdate:: db wDisableVBlankWYUpdate:: db
wSGB:: db wSGB:: db
@ -884,6 +846,11 @@ wcd1d:: ds 8
wStringBuffer1:: ds 1 ; How long is this? wStringBuffer1:: ds 1 ; How long is this?
wcd27:: ds 1 wcd27:: ds 1
ds 1
wcd29:: ds 1
wcd2a:: ds 1
SECTION "CD31", WRAM0[$CD31] SECTION "CD31", WRAM0[$CD31]
UNION UNION
@ -910,8 +877,10 @@ SECTION "CD3C", WRAM0[$CD3C]
wcd3c:: db wcd3c:: db
wRegularItemsCursor:: db wRegularItemsCursor:: db
wBackpackAndKeyItemsCursor:: db wBackpackAndKeyItemsCursor:: db
wBattleMenuCursorPosition::
wStartmenuCursor:: db wStartmenuCursor:: db
wcd40:: db wcd40:: db
wCurBattleMon::
wcd41:: db wcd41:: db
wcd42:: db wcd42:: db
wFieldDebugMenuCursorBuffer:: wFieldDebugMenuCursorBuffer::
@ -941,7 +910,11 @@ wFarCallBCBuffer::
dw dw
wcd56:: ds 1 wcd56:: ds 1
wNumMoves::
wcd57:: ds 1 wcd57:: ds 1
wItemEffectSucceeded::
wBattlePlayerAction::
wFieldMoveSucceeded:: db wFieldMoveSucceeded:: db
wVramState:: db wVramState:: db
@ -960,36 +933,20 @@ wcd75:: db
wCurItem:: db wCurItem:: db
wItemIndex:: db wItemIndex:: db
wMonDexIndex: db wCurPartySpecies: db
wWhichPokemon: db wCurPartyMon: db
SECTION "CD7B", WRAM0[$CD7B] SECTION "CD7B", WRAM0[$CD7B]
wHPBarType:: db wWhichHPBar:: db
wcd7c:: ds 1 wPokemonWithdrawDepositParameter:: ds 1
wItemQuantity:: db wItemQuantity:: db
wItemQuantityBuffer:: db wItemQuantityBuffer:: db
wcd7f:: db
wcd80:: db
wcd81:: db
ds 7 wTempMon:: party_struct wTempMon
wcd89:: db wSpriteFlags:: db
ds 10
wcd94:: db
ds 9
wLoadedMonLevel:: db
wcd9f:: db
ds 15
wcdaf:: db
wTalkingTargetType:: db wTalkingTargetType:: db
;bit 0 = has engaged NPC in dialogue ;bit 0 = has engaged NPC in dialogue
@ -1008,9 +965,12 @@ wcdb6:: ds 1
wcdb9:: ds 1 wcdb9:: ds 1
wItemAttributeParamBuffer:: db wItemAttributeValue:: db
wCurPartyLevel:: db wCurPartyLevel:: db
wcdbc:: db
wScrollingMenuListSize:: db
wLinkMode:: db wLinkMode:: db
; 00 - ; 00 -
; 01 - ; 01 -
@ -1019,20 +979,27 @@ wLinkMode:: db
wNextWarp:: db wNextWarp:: db
wNextMapGroup:: db wNextMapGroup:: db
wNextMapId:: db wNextMapNumber:: db
wPrevWarp:: db wPrevWarp:: db
wcdc2:: db wcdc2:: db
UNION UNION
wListMovesLineSpacing::
wFieldMoveScriptID:: db wFieldMoveScriptID:: db
wMapBlocksAddress:: dw wMapBlocksAddress:: dw
wReplacementBlock:: db wReplacementBlock:: db
NEXTU
wMonSubmenuCount:: db
wMonSubmenuItems:: ds NUM_MONMENU_ITEMS + 1
NEXTU NEXTU
wHPBarMaxHP:: dw wHPBarMaxHP:: dw
wHPBarOldHP:: dw wHPBarOldHP:: dw
wHPBarNewHP:: dw
wHPBarDelta:: dw
wHPBarHPDifference:: dw
NEXTU NEXTU
@ -1044,27 +1011,20 @@ NEXTU
wEnemyEffectivenessVsPlayerMons:: db wEnemyEffectivenessVsPlayerMons:: db
wPlayerEffectivenessVsEnemyMons:: db wPlayerEffectivenessVsEnemyMons:: db
ds 1 ds 1
wcdc6:: db wcdc6:: db
ENDU
UNION
wHPBarNewHP:: dw
NEXTU
wcdc7:: db wcdc7:: db
wcdc8:: db wcdc8:: db
ds 1
wcdca:: db
ENDU ENDU
wHPBarDelta:: db
wcdca:: db
wHPBarHPDifference:: dw
UNION UNION
@ -1079,53 +1039,14 @@ wcdd4: ds 1
ds 1 ds 1
ENDU ENDU
wcdd7:: ds 1 wTempEnemyMonSpecies:: ds 1
wcdd8:: ds 1 wTempBattleMonSpecies:: ds 1
wcdd9:: ds 1
wcdda:: ds 1
wcddb:: ds 1
wcddc:: ds 1
wcddd:: ds 1
wcdde:: ds 1
wcddf:: ds 1
wcde0:: ds 1
wcde1:: ds 1
wcde2:: ds 1
wcde3:: ds 1
wcde4:: ds 1
wcde5:: ds 1
wcde6:: ds 1
wcde7:: ds 1
wcde8:: ds 1
wcde9:: ds 1
wcdea:: ds 1
wcdeb:: ds 1
wcdec:: ds 1
wcded:: ds 1
wcdee:: ds 1
wcdef:: ds 1
ds 1
wcdf1:: ds 1 wEnemyMon:: battle_struct wEnemyMon
wcdf2:: ds 1 wEnemyMonBaseStats:: ds NUM_EXP_STATS
wcdf3:: ds 1
ds 1 wEnemyMonCatchRate:: db
wcdf5:: ds 1
ds 1
wcdf7:: ds 1
ds 1
wcdf9:: ds 1
ds 4
wcdfe:: ds 1
wcdff:: ds 1 wcdff:: ds 1
wBattleMode:: db wBattleMode:: db
wce01:: ds 1 wce01:: ds 1
@ -1210,10 +1131,8 @@ wce2a:: ds 1
ds 2 ds 2
wce2d:: ds 1 wce2d:: ds 1
wce2e:: ds 1
wce2f:: ds 1 wListMoves_MoveIndicesBuffer:: ds NUM_MOVES
wce30:: ds 1
wce31:: ds 1
wce32:: ds 1 wce32:: ds 1
wce33:: ds 1 wce33:: ds 1
wce34:: ds 1 wce34:: ds 1
@ -1221,11 +1140,15 @@ wce35:: ds 1
wce36:: ds 1 wce36:: ds 1
wNamedObjectIndexBuffer:: wNamedObjectIndexBuffer::
wCountSetBitsResult:: wNumSetBits::
wMoveGrammar::
wTempByteValue::
wce37:: wce37::
db db
wce38:: ds 1 wce38:: ds 1
wNumFleeAttempts::
wce39:: ds 1 wce39:: ds 1
SECTION "CE3A", WRAM0[$CE3A] SECTION "CE3A", WRAM0[$CE3A]
@ -1275,8 +1198,12 @@ wMomsName:: ds 6
SECTION "CE73", WRAM0[$CE73] SECTION "CE73", WRAM0[$CE73]
UNION
wPlayerID:: dw
NEXTU
wce73: ds 1 wce73: ds 1
wce74: ds 1 wce74: ds 1
ENDU
wce75: ds 1 wce75: ds 1
wObjectFollow_Leader:: wObjectFollow_Leader::
@ -1352,11 +1279,13 @@ wCoins:: db
wd15c:: db wd15c:: db
wd15d:: db wMoney:: ds 3
wd15e:: db ;wd15d:: db
wd15f:: db ;wd15e:: db
;wd15f:: db
SECTION "D163", WRAM0[$D163] SECTION "D163", WRAM0[$D163]
@ -1590,44 +1519,48 @@ wTilesetAnim::
ds 2 ; TODO ds 2 ; TODO
wTilesetEnd:: wTilesetEnd::
wPokemonData::
wPartyCount:: db wPartyCount:: db
wPartySpecies:: ds PARTY_LENGTH wPartySpecies:: ds PARTY_LENGTH
wPartyEnd:: db wPartyEnd:: db
wPartyMons:: wPartyMons::
wPartyMon1:: party_struct wPartyMon1 ; wPartyMon1 - wPartyMon6
wPartyMon2:: party_struct wPartyMon2 for n, 1, PARTY_LENGTH + 1
wPartyMon3:: party_struct wPartyMon3 wPartyMon{d:n}:: party_struct wPartyMon{d:n}
wPartyMon4:: party_struct wPartyMon4 endr
wPartyMon5:: party_struct wPartyMon5
wPartyMon6:: party_struct wPartyMon6
wPlayerPartyEnd::
wPartyMonOT:: wPartyMonOTs::
ds PARTY_LENGTH * 6 ; wPartyMon1OT - wPartyMon6OT
wPartyMonOTEnd:: for n, 1, PARTY_LENGTH + 1
wPartyMon{d:n}OT:: ds PLAYER_NAME_LENGTH
endr
wPartyMonNicknames:: wPartyMonNicknames::
ds PARTY_LENGTH * MON_NAME_LENGTH ; = $24 ; wPartyMon1Nickname - wPartyMon6Nickname
for n, 1, PARTY_LENGTH + 1
wPartyMon{d:n}Nickname:: ds MON_NAME_LENGTH
endr
wPartyMonNicknamesEnd:: wPartyMonNicknamesEnd::
wPokedexOwned:: wPokedexCaught:: flag_array NUM_POKEMON
flag_array NUM_POKEMON wEndPokedexCaught::
wPokedexOwnedEnd::
wPokedexSeen:: wPokedexSeen:: flag_array NUM_POKEMON
flag_array NUM_POKEMON wEndPokedexSeen::
wPokedexSeenEnd::
wAnnonDex:: ds 26 wUnownDex:: ds NUM_UNOWN
wAnnonID:: ds 1 wAnnonID:: ds 1
wd875:: ds 1 wd875:: ds 1
wBufferMonNickname::
wd876:: ds 1 wd876:: ds 1
ds 5 ds 5
wBufferMonOT::
wd87c:: ds 1 wd87c:: ds 1
ds 5 ds 5
@ -1641,37 +1574,14 @@ SECTION "D8A2", WRAM0[$D8A2]
wd8a2:: ds 1 wd8a2:: ds 1
wd8a3:: ds 1 wd8a3:: ds 1
wd8a4:: ds 1 wd8a4:: ds 1
wd8a5:: ds 1
ds 5 wBreedMon1Nickname:: ds MON_NAME_LENGTH
wBreedMon1OT:: ds PLAYER_NAME_LENGTH
wBreedMon1:: box_struct wBreedMon1
wd8ab:: ds 1 wBreedMon2Nickname:: ds MON_NAME_LENGTH
wBreedMon2OT:: ds PLAYER_NAME_LENGTH
SECTION "wd8b1", WRAM0[$D8B1] wBreedMon2:: box_struct wBreedMon2
wd8b1:: ds 1
ds 5
wd8b7:: ds 1
wd8b8:: ds 1
SECTION "D8D1", WRAM0[$D8D1]
wd8d1:: ds 1
ds 5
wd8d7:: ds 1
ds 5
wd8dd:: ds 1
SECTION "D8E3", WRAM0[$D8E3]
wd8e3:: ds 1
wd8e4:: ds 1
SECTION "D8FD", WRAM0[$D8FD] SECTION "D8FD", WRAM0[$D8FD]
@ -1680,7 +1590,9 @@ wd8fe:: ds 1
SECTION "D913", WRAM0[$D913] SECTION "D913", WRAM0[$D913]
wd913:: ds 1 wOTPartyCount:: db
wOTPartySpecies:: ds PARTY_LENGTH
wOTPartySpeciesEnd:: db
SECTION "Wild mon buffer", WRAM0[$D91B] SECTION "Wild mon buffer", WRAM0[$D91B]
@ -1688,48 +1600,57 @@ UNION
wWildMons:: wWildMons::
ds 41 ds 41
NEXTU NEXTU
ds 1 wOTPartyMons::
wd91c:: ds 1 ; wOTPartyMon1 - wOTPartyMon6
wd91d:: ds 1 for n, 1, PARTY_LENGTH + 1
wd91e:: ds 1 wOTPartyMon{d:n}:: party_struct wOTPartyMon{d:n}
ds 19 endr
wd932:: ds 1
ds 7 wOTPartyMonOT::
wd93a:: ds 1 ; wOTPartyMon1OT - wOTPartyMon6OT
wd93b:: ds 1 for n, 1, PARTY_LENGTH + 1
ds 1 wOTPartyMon{d:n}OT:: ds PLAYER_NAME_LENGTH
wd93d:: ds 1 endr
wd93e:: ds 1
wd93f:: ds 1 wOTPartyMonNicknames::
; wOTPartyMon1Nickname - wOTPartyMon6Nickname
for n, 1, PARTY_LENGTH + 1
wOTPartyMon{d:n}Nickname:: ds MON_NAME_LENGTH
endr
wOTPartyDataEnd::
ENDU ENDU
SECTION "DA3B", WRAM0[$DA3B]
wOTPartyMonOT:: db
SECTION "DA5F", WRAM0[$DA5F]
wda5f:: db
SECTION "DA83", WRAM0[$DA83] SECTION "DA83", WRAM0[$DA83]
wBoxListLength:: db wBoxListLength:: db
wBoxList:: ds MONS_PER_BOX wBoxList:: ds MONS_PER_BOX
wBoxListEnd:: db
SECTION "DAA3", WRAM0[$DAA3] SECTION "DAA3", WRAM0[$DAA3]
wdaa3:: db wBoxMons::
wdaa4:: db ; wBoxMon1 - wBoxMon30
wdaa5:: db for n, 1, MONS_PER_BOX + 1
wBoxMon{d:n}:: box_struct wBoxMon{d:n}
endr
wBoxDataEnd::
SECTION "DE63", WRAM0[$DE63] SECTION "DE63", WRAM0[$DE63]
wde63:: db wBoxMonOT::
; wBoxMon1OT - wBoxMon30OT
for n, 1, MONS_PER_BOX + 1
wBoxMon{d:n}OT:: ds PLAYER_NAME_LENGTH
endr
wBoxMonOTEnd::
SECTION "DF17", WRAM0[$DF17] wBoxMonNicknames::
wdf17:: ds 1 ; wBoxMon1Nick - wBoxMon30Nick
for n, 1, MONS_PER_BOX + 1
SECTION "DFCB", WRAM0[$DFCB] wBoxMon{d:n}Nick:: ds MON_NAME_LENGTH
endr
wBoxMonNicknamesEnd::
wdfcb:: ds 1 wdfcb:: ds 1
SECTION "Stack Bottom", WRAM0 SECTION "Stack Bottom", WRAM0

View File

@ -36,7 +36,7 @@ OldCityPokecenter2FText1:
ld [wce37], a ld [wce37], a
ld hl, wJoypadFlags ld hl, wJoypadFlags
set 5, [hl] set 5, [hl]
callab Function29abf callfar Function29abf
ld hl, wJoypadFlags ld hl, wJoypadFlags
res 5, [hl] res 5, [hl]
ret ret
@ -46,7 +46,7 @@ OldCityPokecenter2FText2:
ld [wce37], a ld [wce37], a
ld hl, wJoypadFlags ld hl, wJoypadFlags
set 5, [hl] set 5, [hl]
callab Function29abf callfar Function29abf
ld hl, wJoypadFlags ld hl, wJoypadFlags
res 5, [hl] res 5, [hl]
ret ret
@ -63,15 +63,15 @@ Text947e3:
OldCityPokecenter2FText4: OldCityPokecenter2FText4:
ld hl, OldCityPokecenter2FTextString4 ld hl, OldCityPokecenter2FTextString4
call OpenTextbox call OpenTextbox
callab Function29a1f callfar Function29a1f
jr c, .asm_9480c jr c, .asm_9480c
ld a, $05 ld a, $05
call Function169f ; something related to follow call DeleteMapObject
jr .asm_9480c jr .asm_9480c
; unreferenced? ; unreferenced?
ld hl, Data14824 ld hl, Data14824
ld a, $5 ld a, $5
call Function16fb call Function16fb ; something related to follow
ld hl, $0000 ld hl, $0000
nop nop
.asm_9480c .asm_9480c

View File

@ -34,7 +34,7 @@ OldCityPokecenterBattleText1:
call OpenTextbox call OpenTextbox
ld hl, wJoypadFlags ld hl, wJoypadFlags
res 5, [hl] res 5, [hl]
callab Function28000 callfar Function28000
ret ret
OldCityPokecenterBattleTextString1: OldCityPokecenterBattleTextString1:

View File

@ -31,5 +31,5 @@ OldCityPokecenterTimeMachine_TextPointers:
OldCityPokecenterTimeMachineText1: OldCityPokecenterTimeMachineText1:
xor a xor a
ld [wce37], a ld [wce37], a
callab Function29abf callfar Function29abf
ret ret

View File

@ -34,7 +34,7 @@ OldCityPokecenterTradeText1:
call OpenTextbox call OpenTextbox
ld hl, wJoypadFlags ld hl, wJoypadFlags
res 5, [hl] res 5, [hl]
callab Function28000 callfar Function28000
ret ret
OldCityPokecenterTradeTextString1: OldCityPokecenterTradeTextString1:

View File

@ -120,7 +120,7 @@ PlayerHouse2FComputerText:
.jump .jump
call RefreshScreen call RefreshScreen
callab PokemonCenterPC callfar PokemonCenterPC
call Function1fea call Function1fea
ret ret

View File

@ -343,7 +343,7 @@ SilentHillTextRival1:
LoadMomNamePromptUnused: LoadMomNamePromptUnused:
call LoadStandardMenuHeader call LoadStandardMenuHeader
callab MomNamePrompt callfar MomNamePrompt
call CloseWindow call CloseWindow
call GetMemSGBLayout call GetMemSGBLayout
call UpdateSprites call UpdateSprites

View File

@ -61,7 +61,7 @@ SilentHillHouseNPCText1:
.jump .jump
call RefreshScreen call RefreshScreen
callab PokemonCenterPC callfar PokemonCenterPC
call Function1fea call Function1fea
ret ret

View File

@ -219,10 +219,10 @@ ConfirmPokemonSelection:
ld hl, wJoypadFlags ld hl, wJoypadFlags
set 5, [hl] set 5, [hl]
ld a, [wd265] ld a, [wd265]
ld [wMonDexIndex], a ld [wCurPartySpecies], a
ld a, 5 ld a, 5
ld [wCurPartyLevel], a ld [wCurPartyLevel], a
callab Function60a0 callfar Function60a0
xor a xor a
ld [wPartyMon1 + 1], a ld [wPartyMon1 + 1], a
ld a, 3 ld a, 3
@ -311,7 +311,7 @@ SilentHillLabBackFunc4:
ld [wd265], a ld [wd265], a
push hl push hl
ld [wNamedObjectIndexBuffer], a ld [wNamedObjectIndexBuffer], a
callba Function6734 farcall Function6734
ld a, [wd265] ld a, [wd265]
ld [wNamedObjectIndexBuffer], a ld [wNamedObjectIndexBuffer], a
call GetPokemonName call GetPokemonName

Some files were not shown because too many files have changed in this diff Show More