diff options
| author | PikalaxALT <PikalaxALT@gmail.com> | 2015-10-24 19:49:19 -0400 | 
|---|---|---|
| committer | PikalaxALT <PikalaxALT@gmail.com> | 2015-10-24 19:49:19 -0400 | 
| commit | 4d17f6e1f6d41b91f5a5de71984a7c6f2bd0041c (patch) | |
| tree | f0e965465c782622f47a9394a03f25836c76f71a /engine | |
| parent | 69ee070021bfbc36cf30df446c802f3648b3d5fe (diff) | |
Address comments on PR 322
Diffstat (limited to 'engine')
| -rw-r--r-- | engine/battle_start.asm | 20 | ||||
| -rw-r--r-- | engine/credits.asm | 16 | ||||
| -rw-r--r-- | engine/events.asm | 32 | ||||
| -rw-r--r-- | engine/map_setup.asm | 284 | ||||
| -rw-r--r-- | engine/pack.asm | 108 | ||||
| -rw-r--r-- | engine/phone.asm | 24 | ||||
| -rw-r--r-- | engine/pokedex.asm | 44 | ||||
| -rw-r--r-- | engine/scripting.asm | 8 | ||||
| -rw-r--r-- | engine/title.asm | 2 | 
9 files changed, 271 insertions, 267 deletions
| diff --git a/engine/battle_start.asm b/engine/battle_start.asm index 430904552..4b12bb632 100644 --- a/engine/battle_start.asm +++ b/engine/battle_start.asm @@ -13,7 +13,7 @@ Predef_StartBattle: ; 8c20f  	ld [hl], $1  .loop -	ld a, [wJumptableEntryIndexBuffer] +	ld a, [wJumptableIndex]  	bit 7, a  	jr nz, .done  	call FlashyTransitionToBattle @@ -72,7 +72,7 @@ Function8c26d: ; 8c26d  	call DelayFrame  	xor a  	ld [hBGMapMode], a -	ld hl, wJumptableEntryIndexBuffer +	ld hl, wJumptableIndex  	xor a  rept 2  	ld [hli], a @@ -146,7 +146,7 @@ INCBIN "gfx/overworld/trainer_battle_pokeball_tiles.2bpp"  FlashyTransitionToBattle: ; 8c314 -	ld a, [wJumptableEntryIndexBuffer] +	ld a, [wJumptableIndex]  	ld e, a  	ld d, 0  	ld hl, .jumptable @@ -230,7 +230,7 @@ StartTrainerBattle_DetermineWhichAnimation: ; 8c365 (23:4365)  	ld hl, .StartingPoints  	add hl, de  	ld a, [hl] -	ld [wJumptableEntryIndexBuffer], a +	ld [wJumptableIndex], a  	ret  ; 8c38f (23:438f) @@ -242,11 +242,11 @@ StartTrainerBattle_DetermineWhichAnimation: ; 8c365 (23:4365)  StartTrainerBattle_Finish: ; 8c393 (23:4393)  	call ClearSprites  	ld a, $80 -	ld [wJumptableEntryIndexBuffer], a +	ld [wJumptableIndex], a  	ret  StartTrainerBattle_NextScene: ; 8c39c (23:439c) -	ld hl, wJumptableEntryIndexBuffer +	ld hl, wJumptableIndex  	inc [hl]  	ret @@ -331,7 +331,7 @@ StartTrainerBattle_SineWave: ; 8c408 (23:4408)  .end  	ld a, $20 -	ld [wJumptableEntryIndexBuffer], a +	ld [wJumptableIndex], a  	ret  .DoSineWave: ; 8c419 (23:4419) @@ -416,7 +416,7 @@ endr  	xor a  	ld [hBGMapMode], a ; $ff00+$d4  	ld a, $20 -	ld [wJumptableEntryIndexBuffer], a +	ld [wJumptableIndex], a  	ret  ; 8c490 (23:4490) @@ -540,7 +540,7 @@ StartTrainerBattle_SpeckleToBlack: ; 8c58f (23:458f)  	xor a  	ld [hBGMapMode], a ; $ff00+$d4  	ld a, $20 -	ld [wJumptableEntryIndexBuffer], a +	ld [wJumptableIndex], a  	ret  .BlackOutRandomTile: ; 8c5b8 (23:45b8) @@ -836,7 +836,7 @@ StartTrainerBattle_ZoomToBlack: ; 8c768 (23:4768)  .done  	ld a, $20 -	ld [wJumptableEntryIndexBuffer], a +	ld [wJumptableIndex], a  	ret  ; 8c792 (23:4792) diff --git a/engine/credits.asm b/engine/credits.asm index c6b0b9d56..5c0013e17 100644 --- a/engine/credits.asm +++ b/engine/credits.asm @@ -124,7 +124,7 @@ Function109847:: ; 109847  	jr z, .asm_10984f  	ld a, $40  .asm_10984f -	ld [wJumptableEntryIndexBuffer], a +	ld [wJumptableIndex], a  	ld a, [rSVBK]  	push af @@ -225,7 +225,7 @@ Function1098fd: ; 1098fd  	ld a, [hJoypadDown]  	and $1  	ret z -	ld a, [wJumptableEntryIndexBuffer] +	ld a, [wJumptableIndex]  	bit 7, a  	ret  ; 109908 @@ -234,7 +234,7 @@ Function109908: ; 109908  	ld a, [hJoypadDown]  	and $2  	ret z -	ld a, [wJumptableEntryIndexBuffer] +	ld a, [wJumptableIndex]  	bit 6, a  	ret z  	ld hl, CreditsPos @@ -255,7 +255,7 @@ Function109908: ; 109908  ; 109926  Function109926: ; 109926 -	ld a, [wJumptableEntryIndexBuffer] +	ld a, [wJumptableIndex]  	and $f  	ld e, a  	ld d, 0 @@ -287,12 +287,12 @@ Jumptable_109937: ; 109937 (42:5937)  Function109951: ; 109951 (42:5951) -	ld hl, wJumptableEntryIndexBuffer +	ld hl, wJumptableIndex  	inc [hl]  	ret  Function109956: ; 109956 (42:5956) -	ld hl, wJumptableEntryIndexBuffer +	ld hl, wJumptableIndex  	ld a, [hl]  	and $f0  	ld [hl], a @@ -348,7 +348,7 @@ Function1099a3: ; 1099a3 (42:59a3)  ParseCredits: ; 1099aa -	ld hl, wJumptableEntryIndexBuffer +	ld hl, wJumptableIndex  	bit 7, [hl]  	jp nz, .done @@ -488,7 +488,7 @@ endr  .end  ; Stop execution. -	ld hl, wJumptableEntryIndexBuffer +	ld hl, wJumptableIndex  	set 7, [hl]  	ld a, $20  	ld [MusicFade], a diff --git a/engine/events.asm b/engine/events.asm index cc5581e02..961a7f517 100644 --- a/engine/events.asm +++ b/engine/events.asm @@ -138,19 +138,19 @@ EnterMap: ; 9673e  	call ClearAllScriptFlags3  	ld a, [hMapEntryMethod] -	cp ($f << 4) + MAPSETUP_07 +	cp MAPSETUP_07  	jr nz, .dontset  	call SetAll_ScriptFlags3  .dontset  	ld a, [hMapEntryMethod] -	cp ($f << 4) + MAPSETUP_03 +	cp MAPSETUP_RELOADMAP  	jr nz, .dontresetpoison  	xor a  	ld [PoisonStepCount], a  .dontresetpoison -	xor a ; ($0 << 4) + MAPSETUP_00 +	xor a ; end map entry  	ld [hMapEntryMethod], a  	ld a, 2 ; HandleMap  	ld [MapStatus], a @@ -320,7 +320,7 @@ PlayerEvents: ; 9681f  	pop af  	ld [ScriptRunning], a -	call Function96beb +	call DoPlayerEvent  	ld a, [ScriptRunning]  	cp 4  	jr z, .ok2 @@ -361,7 +361,7 @@ CheckTileEvent: ; 96874  	callba CheckMovingOffEdgeOfMap  	jr c, .return4 -	call Function2238 +	call CheckWarpTile  	jr c, .return6  .bit2 @@ -436,7 +436,11 @@ SetUpFiveStepWildEncounterCooldown: ; 968d1  	ret  ; 968d7 -SetMinTwoStepWildEncounterCooldown: mobile ; 968d7 +ret_968d7: ; 968d7 +	ret +;968d8 + +SetMinTwoStepWildEncounterCooldown: ; 968d8  	ld a, [wWildEncounterCooldown]  	cp 2  	ret nc @@ -453,7 +457,7 @@ Dummy_CheckScriptFlags3Bit5: ; 968e4  ; 968ec  DoMapTrigger: ; 968ec -	ld a, [wdc07] +	ld a, [wCurrMapTriggerCount]  	and a  	jr z, .nope @@ -464,7 +468,7 @@ DoMapTrigger: ; 968ec  	ld e, a  	ld d, 0 -	ld hl, wdc08 +	ld hl, wCurrMapTriggerHeaderPointer  	ld a, [hli]  	ld h, [hl]  	ld l, a @@ -852,7 +856,7 @@ PlayerMovement: ; 96af0  ; 96b10  .seven ; 96b10 -	call SetMinTwoStepWildEncounterCooldown ; mobile +	call ret_968d7 ; mobile  	xor a  	ld c, a  	ret @@ -1040,7 +1044,7 @@ DoRepelStep: ; 96bd7  	ret  ; 96beb -Function96beb: ; 96beb +DoPlayerEvent: ; 96beb  	ld a, [ScriptRunning]  	and a  	ret z @@ -1093,16 +1097,16 @@ HatchEggScript: ; 96c2f  WarpToNewMapScript: ; 96c34  	warpsound -	newloadmap ($f << 4) + MAPSETUP_05 +	newloadmap MAPSETUP_05  	end  ; 96c38  FallIntoMapScript: ; 96c38 -	newloadmap ($f << 4) + MAPSETUP_06 +	newloadmap MAPSETUP_06  	playsound SFX_KINESIS  	applymovement PLAYER, MovementData_0x96c48  	playsound SFX_STRENGTH -	scall UnknownScript_0x96c4a +	scall LandAfterPitfallScript  	end  ; 96c48 @@ -1111,7 +1115,7 @@ MovementData_0x96c48: ; 96c48  	step_end  ; 96c4a -UnknownScript_0x96c4a: ; 96c4a +LandAfterPitfallScript: ; 96c4a  	earthquake 16  	end  ; 96c4d diff --git a/engine/map_setup.asm b/engine/map_setup.asm index 09c8cfe65..8b1e3a7fe 100644 --- a/engine/map_setup.asm +++ b/engine/map_setup.asm @@ -32,170 +32,170 @@ MapSetupScripts: ; 15377  ; 1538f  MapSetupScript4: ; 1538f -	map_prolong_sprites +	db map_prolong_sprites  MapSetupScript12: ; 15390 -	map_fade_out_palettes -	map_keep_roam +	db map_fade_out_palettes +	db map_keep_roam  MapSetupScript1: ; 15392 -	map_lcd_off -	map_sound_off -	map_load_spawn -	map_attributes -	map_change_callback -	map_spawn_coord -	map_player_coord -	map_anchor_screen -	map_load_blocks -	map_buffer_screen -	map_load_graphics -	map_time_of_day -	map_load_objects -	map_lcd_on -	map_palettes -	map_face_down -	map_sprites -	map_bike_music -	map_max_volume -	map_fade_in_palettes -	map_animations_on -	map_wildmons -	map_end_setup_script +	db map_lcd_off +	db map_sound_off +	db map_load_spawn +	db map_attributes +	db map_change_callback +	db map_spawn_coord +	db map_player_coord +	db map_anchor_screen +	db map_load_blocks +	db map_buffer_screen +	db map_load_graphics +	db map_time_of_day +	db map_load_objects +	db map_lcd_on +	db map_palettes +	db map_face_down +	db map_sprites +	db map_bike_music +	db map_max_volume +	db map_fade_in_palettes +	db map_animations_on +	db map_wildmons +	db map_end_setup_script  MapSetupScript11: ; 153a9 -	map_load_spawn -	map_attributes -	map_change_callback -	map_spawn_coord -	map_player_coord -	map_anchor_screen -	map_load_blocks -	map_buffer_screen -	map_lcd_off -	map_load_graphics -	map_time_of_day -	map_fade_out_music -	map_lcd_on -	map_load_objects -	map_palettes -	map_face_down -	map_sprites -	map_fade_music -	map_fade_in_palettes -	map_animations_on -	map_wildmons -	map_end_setup_script +	db map_load_spawn +	db map_attributes +	db map_change_callback +	db map_spawn_coord +	db map_player_coord +	db map_anchor_screen +	db map_load_blocks +	db map_buffer_screen +	db map_lcd_off +	db map_load_graphics +	db map_time_of_day +	db map_fade_out_music +	db map_lcd_on +	db map_load_objects +	db map_palettes +	db map_face_down +	db map_sprites +	db map_fade_music +	db map_fade_in_palettes +	db map_animations_on +	db map_wildmons +	db map_end_setup_script  MapSetupScript7: ; 153bf -	map_animations_off -	map_load_connection -	map_attributes -	map_change_callback -	map_player_coord -	map_load_blocks -	map_load_tileset_header -	map_save_screen -	map_load_objects -	map_fade_music -	map_palettes -	map_stop_script -	map_keep_palettes -	map_wildmons -	map_update_roam -	map_animations_on -	map_end_setup_script +	db map_animations_off +	db map_load_connection +	db map_attributes +	db map_change_callback +	db map_player_coord +	db map_load_blocks +	db map_load_tileset_header +	db map_save_screen +	db map_load_objects +	db map_fade_music +	db map_palettes +	db map_stop_script +	db map_keep_palettes +	db map_wildmons +	db map_update_roam +	db map_animations_on +	db map_end_setup_script  MapSetupScript6: ; 153d0 -	map_prolong_sprites +	db map_prolong_sprites  MapSetupScript5: ; 153d1 -	map_fade_out_palettes +	db map_fade_out_palettes  MapSetupScript9: ; 153d2 -	map_load_warp -	map_attributes -	map_warp_face -	map_change_callback -	map_player_coord -	map_load_blocks -	map_buffer_screen -	map_lcd_off -	map_load_graphics -	map_time_of_day -	map_fade_out_music -	map_lcd_on -	map_load_objects -	map_palettes -	map_sprites -	map_fade_music -	map_fade_in_palettes -	map_animations_on -	map_wildmons -	map_update_roam -	map_end_setup_script +	db map_load_warp +	db map_attributes +	db map_warp_face +	db map_change_callback +	db map_player_coord +	db map_load_blocks +	db map_buffer_screen +	db map_lcd_off +	db map_load_graphics +	db map_time_of_day +	db map_fade_out_music +	db map_lcd_on +	db map_load_objects +	db map_palettes +	db map_sprites +	db map_fade_music +	db map_fade_in_palettes +	db map_animations_on +	db map_wildmons +	db map_update_roam +	db map_end_setup_script  MapSetupScript3: ; 153e7 -	map_fade -	map_clear_bg_palettes -	map_lcd_off -	map_sound_off -	map_load_blocks -	map_connection_blocks -	map_load_graphics -	map_time_of_day -	map_lcd_on -	map_palettes -	map_sprites -	map_music_force -	map_fade_in_palettes -	map_animations_on -	map_wildmons -	map_end_setup_script +	db map_fade +	db map_clear_bg_palettes +	db map_lcd_off +	db map_sound_off +	db map_load_blocks +	db map_connection_blocks +	db map_load_graphics +	db map_time_of_day +	db map_lcd_on +	db map_palettes +	db map_sprites +	db map_music_force +	db map_fade_in_palettes +	db map_animations_on +	db map_wildmons +	db map_end_setup_script  MapSetupScript8: ; 153f7 -	map_fade -	map_lcd_off -	map_sound_off -	map_change_callback -	map_load_blocks -	map_buffer_screen -	map_load_graphics -	map_time_of_day -	map_lcd_on -	map_palettes -	map_sprites -	map_bike_music -	map_fade_in_palettes -	map_animations_on -	map_wildmons -	map_text_scroll_off -	map_end_setup_script +	db map_fade +	db map_lcd_off +	db map_sound_off +	db map_change_callback +	db map_load_blocks +	db map_buffer_screen +	db map_load_graphics +	db map_time_of_day +	db map_lcd_on +	db map_palettes +	db map_sprites +	db map_bike_music +	db map_fade_in_palettes +	db map_animations_on +	db map_wildmons +	db map_text_scroll_off +	db map_end_setup_script  MapSetupScript2: ; 15408 -	map_lcd_off -	map_sound_off -	map_attributes_2 -	map_anchor_screen -	map_start_callback -	map_load_blocks -	map_connection_blocks -	map_buffer_screen -	map_load_graphics -	map_time_of_day -	map_lcd_on -	map_palettes -	map_sprites -	map_bike_music -	map_fade_in_palettes -	map_animations_on -	map_wildmons -	map_end_setup_script +	db map_lcd_off +	db map_sound_off +	db map_attributes_2 +	db map_anchor_screen +	db map_start_callback +	db map_load_blocks +	db map_connection_blocks +	db map_buffer_screen +	db map_load_graphics +	db map_time_of_day +	db map_lcd_on +	db map_palettes +	db map_sprites +	db map_bike_music +	db map_fade_in_palettes +	db map_animations_on +	db map_wildmons +	db map_end_setup_script  MapSetupScript10: ; 1541a -	map_load_blocks -	map_connection_blocks -	map_end_setup_script +	db map_load_blocks +	db map_connection_blocks +	db map_end_setup_script  ReadMapSetupScript: ; 1541d diff --git a/engine/pack.asm b/engine/pack.asm index caf2badf6..ecdb35c74 100644 --- a/engine/pack.asm +++ b/engine/pack.asm @@ -5,7 +5,7 @@ Pack: ; 10000  	call Function1068a  .loop  	call JoyTextDelay -	ld a, [wJumptableEntryIndexBuffer] +	ld a, [wJumptableIndex]  	bit 7, a  	jr nz, .done  	call Function10026 @@ -21,7 +21,7 @@ Pack: ; 10000  ; 10026  Function10026: ; 10026 -	ld a, [wJumptableEntryIndexBuffer] +	ld a, [wJumptableIndex]  	ld hl, Jumptable_10030  	call Function1086b  	jp [hl] @@ -47,7 +47,7 @@ Function10046: ; 10046 (4:4046)  	ld [hBGMapMode], a ; $ff00+$d4  	call Function10955  	ld a, [wcf64] -	ld [wJumptableEntryIndexBuffer], a +	ld [wJumptableIndex], a  	call Function10a40  	ret @@ -63,15 +63,15 @@ Function10056: ; 10056 (4:4056)  Function10067: ; 10067 (4:4067)  	ld hl, MenuDataHeader_0x10a4f  	call CopyMenuDataHeader -	ld a, [wItemsPocketPointerLocation] -	ld [wPocketPointerLocationBuffer], a +	ld a, [wItemsPocketCursor] +	ld [wPocketCursorBuffer], a  	ld a, [wd0df]  	ld [wd0e4], a  	call Function350c  	ld a, [wd0e4]  	ld [wd0df], a  	ld a, [wcfa9] -	ld [wItemsPocketPointerLocation], a +	ld [wItemsPocketCursor], a  	ld b, $7  	ld c, $3  	call Function108d4 @@ -91,15 +91,15 @@ Function10094: ; 10094 (4:4094)  Function100a6: ; 100a6 (4:40a6)  	ld hl, MenuDataHeader_0x10a7f  	call CopyMenuDataHeader -	ld a, [wKeyItemsPocketPointerLocation] -	ld [wPocketPointerLocationBuffer], a +	ld a, [wKeyItemsPocketCursor] +	ld [wPocketCursorBuffer], a  	ld a, [wd0e0]  	ld [wd0e4], a  	call Function350c  	ld a, [wd0e4]  	ld [wd0e0], a  	ld a, [wcfa9] -	ld [wKeyItemsPocketPointerLocation], a +	ld [wKeyItemsPocketCursor], a  	ld b, $3  	ld c, $7  	call Function108d4 @@ -221,15 +221,15 @@ Function10186: ; 10186 (4:4186)  Function10198: ; 10198 (4:4198)  	ld hl, MenuDataHeader_0x10aaf  	call CopyMenuDataHeader -	ld a, [wBallsPocketPointerLocation] -	ld [wPocketPointerLocationBuffer], a +	ld a, [wBallsPocketCursor] +	ld [wPocketCursorBuffer], a  	ld a, [wd0e1]  	ld [wd0e4], a  	call Function350c  	ld a, [wd0e4]  	ld [wd0e1], a  	ld a, [wcfa9] -	ld [wBallsPocketPointerLocation], a +	ld [wBallsPocketCursor], a  	ld b, $1  	ld c, $5  	call Function108d4 @@ -494,7 +494,7 @@ Function10311: ; 10311  	and a  	jr z, .Oak  	ld a, $a -	ld [wJumptableEntryIndexBuffer], a +	ld [wJumptableIndex], a  	ret  ; 10364 (4:4364) @@ -537,19 +537,19 @@ Function1039d: ; 1039d  .asm_103aa  	xor a -	ld [wBallsPocketPointerLocation], a +	ld [wBallsPocketCursor], a  	ld [wd0e1], a  	ret  .asm_103b2  	xor a -	ld [wItemsPocketPointerLocation], a +	ld [wItemsPocketCursor], a  	ld [wd0df], a  	ret  .asm_103ba  	xor a -	ld [wKeyItemsPocketPointerLocation], a +	ld [wKeyItemsPocketCursor], a  	ld [wd0e0], a  	ret  ; 103c2 @@ -613,7 +613,7 @@ Function103fd: ; 103fd  	call PrintText  	jr .asm_10427  .asm_10453 -	ld a, [wJumptableEntryIndexBuffer] +	ld a, [wJumptableIndex]  	push af  	ld a, [wcf64]  	push af @@ -626,7 +626,7 @@ Function103fd: ; 103fd  	pop af  	ld [wcf64], a  	pop af -	ld [wJumptableEntryIndexBuffer], a +	ld [wJumptableIndex], a  .asm_10475  	pop af  	ld [Options], a @@ -660,7 +660,7 @@ BattlePack: ; 10493  	call Function1068a  .asm_1049b  	call JoyTextDelay -	ld a, [wJumptableEntryIndexBuffer] +	ld a, [wJumptableIndex]  	bit 7, a  	jr nz, .asm_104ad  	call Function104b9 @@ -676,7 +676,7 @@ BattlePack: ; 10493  ; 104b9  Function104b9: ; 104b9 -	ld a, [wJumptableEntryIndexBuffer] +	ld a, [wJumptableIndex]  	ld hl, Jumptable_104c3  	call Function1086b  	jp [hl] @@ -702,7 +702,7 @@ Function104d9: ; 104d9 (4:44d9)  	ld [hBGMapMode], a ; $ff00+$d4  	call Function10955  	ld a, [wcf64] -	ld [wJumptableEntryIndexBuffer], a +	ld [wJumptableIndex], a  	call Function10a40  	ret @@ -718,15 +718,15 @@ Function104e9: ; 104e9 (4:44e9)  Function104fa: ; 104fa (4:44fa)  	ld hl, MenuDataHeader_0x10a4f  	call CopyMenuDataHeader -	ld a, [wItemsPocketPointerLocation] -	ld [wPocketPointerLocationBuffer], a +	ld a, [wItemsPocketCursor] +	ld [wPocketCursorBuffer], a  	ld a, [wd0df]  	ld [wd0e4], a  	call Function350c  	ld a, [wd0e4]  	ld [wd0df], a  	ld a, [wcfa9] -	ld [wItemsPocketPointerLocation], a +	ld [wItemsPocketCursor], a  	ld b, $7  	ld c, $3  	call Function108d4 @@ -746,15 +746,15 @@ Function10527: ; 10527 (4:4527)  Function10539: ; 10539 (4:4539)  	ld hl, MenuDataHeader_0x10a7f  	call CopyMenuDataHeader -	ld a, [wKeyItemsPocketPointerLocation] -	ld [wPocketPointerLocationBuffer], a +	ld a, [wKeyItemsPocketCursor] +	ld [wPocketCursorBuffer], a  	ld a, [wd0e0]  	ld [wd0e4], a  	call Function350c  	ld a, [wd0e4]  	ld [wd0e0], a  	ld a, [wcfa9] -	ld [wKeyItemsPocketPointerLocation], a +	ld [wKeyItemsPocketCursor], a  	ld b, $3  	ld c, $7  	call Function108d4 @@ -797,15 +797,15 @@ Function10594: ; 10594 (4:4594)  Function105a6: ; 105a6 (4:45a6)  	ld hl, MenuDataHeader_0x10aaf  	call CopyMenuDataHeader -	ld a, [wBallsPocketPointerLocation] -	ld [wPocketPointerLocationBuffer], a +	ld a, [wBallsPocketCursor] +	ld [wPocketCursorBuffer], a  	ld a, [wd0e1]  	ld [wd0e4], a  	call Function350c  	ld a, [wd0e4]  	ld [wd0e1], a  	ld a, [wcfa9] -	ld [wBallsPocketPointerLocation], a +	ld [wBallsPocketCursor], a  	ld b, $1  	ld c, $5  	call Function108d4 @@ -931,7 +931,7 @@ Function105dc: ; 105dc (4:45dc)  	jr z, .asm_10684  .asm_1067e: ; 1067e (4:467e)  	ld a, $a -	ld [wJumptableEntryIndexBuffer], a +	ld [wJumptableIndex], a  	ret  .asm_10684: ; 10684 (4:4684) @@ -947,7 +947,7 @@ Function105dc: ; 105dc (4:45dc)  Function1068a: ; 1068a  	xor a -	ld [wJumptableEntryIndexBuffer], a +	ld [wJumptableIndex], a  	ld a, [wd0d6]  	and $3  	ld [wcf65], a @@ -965,7 +965,7 @@ Function1068a: ; 1068a  Function106a5: ; 106a5  	xor a  	ld [hBGMapMode], a -	ld [wJumptableEntryIndexBuffer], a +	ld [wJumptableIndex], a  	ld [wcf64], a  	ld [wcf65], a  	ld [wcf66], a @@ -984,7 +984,7 @@ Function106be: ; 106be  ; 106c7  Function106c7: ; 106c7 -	ld a, [wJumptableEntryIndexBuffer] +	ld a, [wJumptableIndex]  	ld hl, Jumptable_106d1  	call Function1086b  	jp [hl] @@ -1003,15 +1003,15 @@ Jumptable_106d1: ; 106d1 (4:46d1)  	call InitPocket  	ld hl, MenuDataHeader_0x10a67  	call CopyMenuDataHeader -	ld a, [wItemsPocketPointerLocation] -	ld [wPocketPointerLocationBuffer], a +	ld a, [wItemsPocketCursor] +	ld [wPocketCursorBuffer], a  	ld a, [wd0df]  	ld [wd0e4], a  	call Function350c  	ld a, [wd0e4]  	ld [wd0df], a  	ld a, [wcfa9] -	ld [wItemsPocketPointerLocation], a +	ld [wItemsPocketCursor], a  	ret  .KeyItemsPocket: ; 106ff (4:46ff) @@ -1019,15 +1019,15 @@ Jumptable_106d1: ; 106d1 (4:46d1)  	call InitPocket  	ld hl, MenuDataHeader_0x10a97  	call CopyMenuDataHeader -	ld a, [wKeyItemsPocketPointerLocation] -	ld [wPocketPointerLocationBuffer], a +	ld a, [wKeyItemsPocketCursor] +	ld [wPocketCursorBuffer], a  	ld a, [wd0e0]  	ld [wd0e4], a  	call Function350c  	ld a, [wd0e4]  	ld [wd0e0], a  	ld a, [wcfa9] -	ld [wKeyItemsPocketPointerLocation], a +	ld [wKeyItemsPocketCursor], a  	ret  .TMHMPocket: ; 10726 (4:4726) @@ -1044,15 +1044,15 @@ Jumptable_106d1: ; 106d1 (4:46d1)  	call InitPocket  	ld hl, MenuDataHeader_0x10ac7  	call CopyMenuDataHeader -	ld a, [wBallsPocketPointerLocation] -	ld [wPocketPointerLocationBuffer], a +	ld a, [wBallsPocketCursor] +	ld [wPocketCursorBuffer], a  	ld a, [wd0e1]  	ld [wd0e4], a  	call Function350c  	ld a, [wd0e4]  	ld [wd0e1], a  	ld a, [wcfa9] -	ld [wBallsPocketPointerLocation], a +	ld [wBallsPocketCursor], a  	ret  InitPocket: ; 10762 (4:4762) @@ -1093,10 +1093,10 @@ Function1076f: ; 1076f  	ret  .asm_10795 -	ld a, [wJumptableEntryIndexBuffer] +	ld a, [wJumptableIndex]  	dec a  	and $3 -	ld [wJumptableEntryIndexBuffer], a +	ld [wJumptableIndex], a  	push de  	ld de, SFX_UNKNOWN_62  	call PlaySFX @@ -1105,10 +1105,10 @@ Function1076f: ; 1076f  	ret  .asm_107a8 -	ld a, [wJumptableEntryIndexBuffer] +	ld a, [wJumptableIndex]  	inc a  	and $3 -	ld [wJumptableEntryIndexBuffer], a +	ld [wJumptableIndex], a  	push de  	ld de, SFX_UNKNOWN_62  	call PlaySFX @@ -1134,7 +1134,7 @@ Function107bb: ; 107bb  ; 107d7  Function107d7: ; 107d7 -	ld a, [wJumptableEntryIndexBuffer] +	ld a, [wJumptableIndex]  	ld hl, Jumptable_107e1  	call Function1086b  	jp [hl] @@ -1238,7 +1238,7 @@ Function1085a: ; 1085a (4:485a)  	ret  Function10866: ; 10866 (4:4866) -	ld hl, wJumptableEntryIndexBuffer +	ld hl, wJumptableIndex  	inc [hl]  	ret @@ -1255,14 +1255,14 @@ endr  ; 10874  Function10874: ; 10874 (4:4874) -	ld hl, wJumptableEntryIndexBuffer +	ld hl, wJumptableIndex  	set 7, [hl]  	xor a  	ld [wcf66], a  	ret  Function1087e: ; 1087e (4:487e) -	ld hl, wJumptableEntryIndexBuffer +	ld hl, wJumptableIndex  	set 7, [hl]  	ld a, $1  	ld [wcf66], a @@ -1346,12 +1346,12 @@ Function108d4: ; 108d4 (4:48d4)  	ret  .asm_108fa  	ld a, $9 -	ld [wJumptableEntryIndexBuffer], a +	ld [wJumptableIndex], a  	scf  	ret  .asm_10901  	ld a, b -	ld [wJumptableEntryIndexBuffer], a +	ld [wJumptableIndex], a  	ld [wcf64], a  	push de  	ld de, SFX_UNKNOWN_62 @@ -1361,7 +1361,7 @@ Function108d4: ; 108d4 (4:48d4)  	ret  .asm_10912  	ld a, c -	ld [wJumptableEntryIndexBuffer], a +	ld [wJumptableIndex], a  	ld [wcf64], a  	push de  	ld de, SFX_UNKNOWN_62 diff --git a/engine/phone.asm b/engine/phone.asm index 5abe54c95..0ba5cf6e1 100644 --- a/engine/phone.asm +++ b/engine/phone.asm @@ -99,7 +99,7 @@ GetRemainingSpaceInPhoneList: ; 90040  ; 90066  PermanentNumbers: ; 90066 -	db MOM_PHONE, ELM_PHONE, -1 +	db PHONECONTACT_MOM, PHONECONTACT_ELM, -1  ; 90069 @@ -428,7 +428,7 @@ LoadCallerScript: ; 9020d (24:420d)  ; 90233 (24:4233)  WrongNumber: ; 90233 -	db PHONE, PHONE_00 +	db TRAINER_NONE, PHONE_00  	dba .script  .script:  	writetext .text @@ -776,17 +776,17 @@ phone: MACRO  	dba \7 ; script 2  ENDM -	phone PHONE, PHONE_00, N_A,                          0, UnusedPhoneScript,   0, UnusedPhoneScript -	phone PHONE, MOM_PHONE, KRISS_HOUSE_1F,              7, MomPhoneScript,      0, UnusedPhoneScript -	phone PHONE, OAK_PHONE, OAKS_LAB,                    0, UnusedPhoneScript,   0, UnusedPhoneScript -	phone PHONE, BILL_PHONE, N_A,                        7, BillPhoneScript1,    0, BillPhoneScript2 -	phone PHONE, ELM_PHONE, ELMS_LAB,                    7, ElmPhoneScript1,     0, ElmPhoneScript2 +	phone TRAINER_NONE, PHONE_00, N_A,                          0, UnusedPhoneScript,   0, UnusedPhoneScript +	phone TRAINER_NONE, PHONECONTACT_MOM, KRISS_HOUSE_1F,              7, MomPhoneScript,      0, UnusedPhoneScript +	phone TRAINER_NONE, PHONECONTACT_BIKESHOP, OAKS_LAB,                    0, UnusedPhoneScript,   0, UnusedPhoneScript +	phone TRAINER_NONE, PHONECONTACT_BILL, N_A,                        7, BillPhoneScript1,    0, BillPhoneScript2 +	phone TRAINER_NONE, PHONECONTACT_ELM, ELMS_LAB,                    7, ElmPhoneScript1,     0, ElmPhoneScript2  	phone SCHOOLBOY, JACK1, NATIONAL_PARK,               7, JackPhoneScript1,    7, JackPhoneScript2  	phone POKEFANF, BEVERLY1, NATIONAL_PARK,             7, BeverlyPhoneScript1, 7, BeverlyPhoneScript2  	phone SAILOR, HUEY1, OLIVINE_LIGHTHOUSE_2F,          7, HueyPhoneScript1,    7, HueyPhoneScript2 -	phone PHONE, PHONE_00, N_A,                          0, UnusedPhoneScript,   0, UnusedPhoneScript -	phone PHONE, PHONE_00, N_A,                          0, UnusedPhoneScript,   0, UnusedPhoneScript -	phone PHONE, PHONE_00, N_A,                          0, UnusedPhoneScript,   0, UnusedPhoneScript +	phone TRAINER_NONE, PHONE_00, N_A,                          0, UnusedPhoneScript,   0, UnusedPhoneScript +	phone TRAINER_NONE, PHONE_00, N_A,                          0, UnusedPhoneScript,   0, UnusedPhoneScript +	phone TRAINER_NONE, PHONE_00, N_A,                          0, UnusedPhoneScript,   0, UnusedPhoneScript  	phone COOLTRAINERM, GAVEN3, ROUTE_26,                7, GavenPhoneScript1,   7, GavenPhoneScript2  	phone COOLTRAINERF, BETH1, ROUTE_26,                 7, BethPhoneScript1,    7, BethPhoneScript2  	phone BIRD_KEEPER, JOSE2, ROUTE_27,                  7, JosePhoneScript1,    7, JosePhoneScript2 @@ -801,7 +801,7 @@ ENDM  	phone JUGGLER, IRWIN1, ROUTE_35,                     7, IrwinPhoneScript1,   7, IrwinPhoneScript2  	phone BUG_CATCHER, ARNIE1, ROUTE_35,                 7, ArniePhoneScript1,   7, ArniePhoneScript2  	phone SCHOOLBOY, ALAN1, ROUTE_36,                    7, AlanPhoneScript1,    7, AlanPhoneScript2 -	phone PHONE, PHONE_00, N_A,                          0, UnusedPhoneScript,   0, UnusedPhoneScript +	phone TRAINER_NONE, PHONE_00, N_A,                          0, UnusedPhoneScript,   0, UnusedPhoneScript  	phone LASS, DANA1, ROUTE_38,                         7, DanaPhoneScript1,    7, DanaPhoneScript2  	phone SCHOOLBOY, CHAD1, ROUTE_38,                    7, ChadPhoneScript1,    7, ChadPhoneScript2  	phone POKEFANM, DEREK1, ROUTE_39,                    7, DerekPhoneScript1,   7, DerekPhoneScript2 @@ -813,7 +813,7 @@ ENDM  	phone BLACKBELT_T, KENJI3, ROUTE_45,                 7, KenjiPhoneScript1,   7, KenjiPhoneScript2  	phone HIKER, PARRY1, ROUTE_45,                       7, ParryPhoneScript1,   7, ParryPhoneScript2  	phone PICNICKER, ERIN1, ROUTE_46,                    7, ErinPhoneScript1,    7, ErinPhoneScript2 -	phone PHONE, BUENA_PHONE, GOLDENROD_DEPT_STORE_ROOF, 7, BuenaPhoneScript1,   7, BuenaPhoneScript2 +	phone TRAINER_NONE, PHONECONTACT_BUENA, GOLDENROD_DEPT_STORE_ROOF, 7, BuenaPhoneScript1,   7, BuenaPhoneScript2  ; 90627  SpecialPhoneCallList: ; 90627 diff --git a/engine/pokedex.asm b/engine/pokedex.asm index 4e9d137b4..dd58e940d 100644 --- a/engine/pokedex.asm +++ b/engine/pokedex.asm @@ -28,7 +28,7 @@ Pokedex: ; 40000  .main  	call JoyTextDelay -	ld a, [wJumptableEntryIndexBuffer] +	ld a, [wJumptableIndex]  	bit 7, a  	jr nz, .exit  	call Function4010b @@ -75,7 +75,7 @@ ENDC  	call ByteFill  	xor a -	ld [wJumptableEntryIndexBuffer], a +	ld [wJumptableIndex], a  	ld [wcf64], a  	ld [wcf65], a  	ld [wcf66], a @@ -173,7 +173,7 @@ Function400ed: ; 400ed  ; 4010b  Function4010b: ; 4010b -	ld a, [wJumptableEntryIndexBuffer] +	ld a, [wJumptableIndex]  	ld hl, Jumptable_40115  	call Function41432  	jp [hl] @@ -198,12 +198,12 @@ Jumptable_40115: ; 40115 (10:4115)  Function40131: ; 40131 (10:4131) -	ld hl, wJumptableEntryIndexBuffer +	ld hl, wJumptableIndex  	inc [hl]  	ret  Function40136: ; 40136 (10:4136) -	ld hl, wJumptableEntryIndexBuffer +	ld hl, wJumptableIndex  	set 7, [hl]  	ret @@ -283,7 +283,7 @@ Function401ae: ; 401ae (10:41ae)  	call Function40bd0  	ret z  	ld a, $2 -	ld [wJumptableEntryIndexBuffer], a +	ld [wJumptableIndex], a  	ld a, $0  	ld [wcf64], a  	ret @@ -291,7 +291,7 @@ Function401ae: ; 401ae (10:41ae)  .select  	call Function41401  	ld a, $7 -	ld [wJumptableEntryIndexBuffer], a +	ld [wJumptableIndex], a  	xor a  	ld [hSCX], a ; $ff00+$cf  	ld a, $a7 @@ -302,7 +302,7 @@ Function401ae: ; 401ae (10:41ae)  .start  	call Function41401  	ld a, $5 -	ld [wJumptableEntryIndexBuffer], a +	ld [wJumptableIndex], a  	xor a  	ld [hSCX], a ; $ff00+$cf  	ld a, $a7 @@ -312,7 +312,7 @@ Function401ae: ; 401ae (10:41ae)  .b  	ld a, $d -	ld [wJumptableEntryIndexBuffer], a +	ld [wJumptableIndex], a  	ret  Function40217: ; 40217 (10:4217) @@ -372,7 +372,7 @@ Function40258: ; 40258 (10:4258)  .asm_40288  	call MaxVolume  	ld a, [wcf64] -	ld [wJumptableEntryIndexBuffer], a +	ld [wJumptableIndex], a  	ret  ; 40292 (10:4292) @@ -408,7 +408,7 @@ Function402aa: ; 402aa (10:42aa)  	call Function41423  	ld a, [CurPartySpecies]  	call PlayCry -	ld hl, wJumptableEntryIndexBuffer +	ld hl, wJumptableIndex  	dec [hl]  	ret  ; 402e8 (10:42e8) @@ -478,11 +478,11 @@ Function4034f: ; 4034f  	push af  	ld a, [wcf64]  	push af -	ld a, [wJumptableEntryIndexBuffer] +	ld a, [wJumptableIndex]  	push af  	callba Function8442c  	pop af -	ld [wJumptableEntryIndexBuffer], a +	ld [wJumptableIndex], a  	pop af  	ld [wcf64], a  	pop af @@ -552,7 +552,7 @@ Function403be: ; 403be (10:43be)  .asm_403ea  	call Function41401  	ld a, $0 -	ld [wJumptableEntryIndexBuffer], a +	ld [wJumptableIndex], a  	ret  ; 403f3 (10:43f3) @@ -604,13 +604,13 @@ Function40417: ; 40417 (10:4417)  .asm_40431  	call Function41401  	ld a, $0 -	ld [wJumptableEntryIndexBuffer], a +	ld [wJumptableIndex], a  	ret  Function4043a: ; 4043a (10:443a)  	call Function41401  	ld a, $b -	ld [wJumptableEntryIndexBuffer], a +	ld [wJumptableIndex], a  	ret  Function40443: ; 40443 (10:4443) @@ -656,7 +656,7 @@ Function40471: ; 40471 (10:4471)  .asm_40495  	call Function41401  	ld a, $0 -	ld [wJumptableEntryIndexBuffer], a +	ld [wJumptableIndex], a  	ret  ; 4049e (10:449e) @@ -710,14 +710,14 @@ Function404b7: ; 404b7  	ld [wc7d1], a  	call Function41401  	ld a, $9 -	ld [wJumptableEntryIndexBuffer], a +	ld [wJumptableIndex], a  	ret  ; 40501  Function40501: ; 40501  	call Function41401  	ld a, $0 -	ld [wJumptableEntryIndexBuffer], a +	ld [wJumptableIndex], a  	ret  ; 4050a @@ -779,7 +779,7 @@ Function40562: ; 40562 (10:4562)  	call Function40bd0  	ret z  	ld a, $2 -	ld [wJumptableEntryIndexBuffer], a +	ld [wJumptableIndex], a  	ld a, $9  	ld [wcf64], a  	ret @@ -795,7 +795,7 @@ Function40562: ; 40562 (10:4562)  	call ClearSprites  	call Function40bdc  	ld a, $5 -	ld [wJumptableEntryIndexBuffer], a +	ld [wJumptableIndex], a  	xor a  	ld [hSCX], a ; $ff00+$cf  	ld a, $a7 @@ -827,7 +827,7 @@ Function405df: ; 405df (10:45df)  .asm_405eb  	call Function41401  	ld a, $7 -	ld [wJumptableEntryIndexBuffer], a +	ld [wJumptableIndex], a  	call DelayFrame  	call Function41a24  	jr nz, .asm_40603 diff --git a/engine/scripting.asm b/engine/scripting.asm index 82414a427..2dadafee1 100644 --- a/engine/scripting.asm +++ b/engine/scripting.asm @@ -529,7 +529,7 @@ Script_interpretmenu: ; 0x96f41  	ld a, [ScriptBank]  	ld hl, InterpretMenu  	rst FarCall -	ld a, [wPocketPointerLocationBuffer] +	ld a, [wPocketCursorBuffer]  	jr nc, .ok  	xor a  .ok @@ -1585,7 +1585,7 @@ Script_reloadmap: ; 0x97491  	xor a  	ld [wd459], a -	ld a, ($f << 4) + MAPSETUP_03 +	ld a, MAPSETUP_RELOADMAP  	ld [hMapEntryMethod], a  	ld a, $1  	call LoadMapStatus @@ -2840,7 +2840,7 @@ Script_warp: ; 0x97a1d  	ld [YCoord], a  	ld a, -1  	ld [wd001], a -	ld a, ($f << 4) + MAPSETUP_01 +	ld a, MAPSETUP_WARP  	ld [hMapEntryMethod], a  	ld a, 1  	call LoadMapStatus @@ -2852,7 +2852,7 @@ Script_warp: ; 0x97a1d  	call GetScriptByte  	ld a, -1  	ld [wd001], a -	ld a, ($f << 4) + MAPSETUP_11 +	ld a, MAPSETUP_BADWARP  	ld [hMapEntryMethod], a  	ld a, 1  	call LoadMapStatus diff --git a/engine/title.asm b/engine/title.asm index 8938ba0fa..d29c90a23 100644 --- a/engine/title.asm +++ b/engine/title.asm @@ -9,7 +9,7 @@ _TitleScreen: ; 10ed67  	ld [hBGMapMode], a  ; Reset timing variables -	ld hl, wJumptableEntryIndexBuffer +	ld hl, wJumptableIndex  	ld [hli], a ; cf63 ; Scene?  	ld [hli], a ; cf64  	ld [hli], a ; cf65 ; Timer lo | 
