Merge pull request #322 from PikalaxALT/master

Split out and comment phone and animation code.
This commit is contained in:
yenatch 2015-10-25 20:48:44 -04:00
commit 0d17d4a758
445 changed files with 17054 additions and 16431 deletions

2
.gitmodules vendored
View File

@ -1,3 +1,3 @@
[submodule "extras"]
path = extras
url = git://github.com/kanzure/pokemon-reverse-engineering-tools.git
url = git://github.com/pret/pokemon-reverse-engineering-tools.git

View File

@ -1,11 +1,11 @@
AI_SwitchOrTryItem: ; 38000
and a
ld a, [IsInBattle]
ld a, [wBattleMode]
dec a
ret z
ld a, [InLinkBattle]
ld a, [wLinkMode]
and a
ret nz
@ -731,7 +731,7 @@ AI_Switch: ; 3846c
callba Function3d57a
xor a
ld [wd264], a
ld a, [InLinkBattle]
ld a, [wLinkMode]
and a
ret nz
scf

View File

@ -237,16 +237,16 @@ Functioncc220: ; cc220
; Appears to be unused.
xor a
ld [hBGMapMode], a
ld a, $80
ld a, (VBGMap0 tile $28) % $100
ld [hBGMapAddress], a
ld a, $9a
ld a, (VBGMap0 tile $28) / $100
ld [hBGMapAddress + 1], a
call Function3200
ld a, $60
ld [hWY], a
xor a
ld [hBGMapAddress], a
ld a, $98
ld a, VBGMap0 / $100
ld [hBGMapAddress + 1], a
call BattleAnimDelayFrame
ret
@ -709,7 +709,7 @@ BattleAnimCmd_D5: ; cc485 (33:4485)
rept 4
add hl, hl
endr
ld de, $8310
ld de, VTiles0 tile $31
add hl, de
ld a, [BattleAnimByte]
call Functionce846
@ -817,13 +817,13 @@ endr
ld a, $49
ld [hl], a
ld hl, $8730
ld de, $9060
ld hl, VTiles0 tile $73
ld de, VTiles2 tile $06
ld a, $70
ld [BattleAnimTemps], a
ld a, $7
call Functioncc561
ld de, $9310
ld de, VTiles2 tile $31
ld a, $60
ld [BattleAnimTemps], a
ld a, $6
@ -873,13 +873,13 @@ endr
ld a, $43
ld [hl], a
ld hl, $8660
ld de, $9050
ld hl, VTiles0 tile $66
ld de, VTiles2 tile $05
ld a, $70
ld [BattleAnimTemps], a
ld a, $7
call Functioncc5b3
ld de, $9310
ld de, VTiles2 tile $31
ld a, $60
ld [BattleAnimTemps], a
ld a, $6
@ -932,7 +932,7 @@ BattleAnimCmd_DC: ; cc5dc (33:45dc)
ld [CurPartySpecies], a ; CurPartySpecies
ld hl, BattleMonDVs ; BattleMonDVs
predef GetUnownLetter
ld de, $8000
ld de, VTiles0 tile $00
predef GetFrontpic
jr .done
@ -941,7 +941,7 @@ BattleAnimCmd_DC: ; cc5dc (33:45dc)
ld [CurPartySpecies], a ; CurPartySpecies
ld hl, EnemyMonDVs ; EnemyMonDVs
predef GetUnownLetter
ld de, $8000
ld de, VTiles0 tile $00
predef GetBackpic
.done
@ -953,19 +953,19 @@ BattleAnimCmd_DC: ; cc5dc (33:45dc)
BattleAnimCmd_E8: ; cc622 (33:4622)
ld de, $8000
ld de, VTiles0 tile $00
ld a, [hBattleTurn] ; $ff00+$e4
and a
jr z, .player
ld hl, $9000
ld hl, VTiles2 tile $00
ld b, 0
ld c, $31
call Request2bpp
ret
.player
ld hl, $9310
ld hl, VTiles2 tile $31
ld b, 0
ld c, $24
call Request2bpp
@ -1009,7 +1009,7 @@ GetSubstitutePic: ; cc64c
ld de, sScratch + $1b0
call CopyMonsterSpriteTile
ld hl, $9000
ld hl, VTiles2 tile $00
ld de, sScratch
lb bc, BANK(GetSubstitutePic), 7 * 7
call Request2bpp
@ -1029,7 +1029,7 @@ GetSubstitutePic: ; cc64c
ld de, sScratch + $170
call CopyMonsterSpriteTile
ld hl, $9310
ld hl, VTiles2 tile $31
ld de, sScratch
lb bc, BANK(GetSubstitutePic), 6 * 6
call Request2bpp
@ -1077,7 +1077,7 @@ GetMinimizePic: ; cc6e7 (33:46e7)
ld de, sScratch + $1a0
call CopyMinimizePic
ld hl, $9000
ld hl, VTiles2 tile $00
ld de, sScratch
lb bc, BANK(GetMinimizePic), $31
ret
@ -1085,7 +1085,7 @@ GetMinimizePic: ; cc6e7 (33:46e7)
.player
ld de, sScratch + $160
call CopyMinimizePic
ld hl, $9310
ld hl, VTiles2 tile $31
ld de, sScratch
lb bc, BANK(GetMinimizePic), $24
ret
@ -1110,7 +1110,7 @@ BattleAnimCmd_E9: ; cc735 (33:4735)
xor a
call GetSRAMBank
call GetMinimizePic
ld hl, $8000
ld hl, VTiles0 tile $00
call Request2bpp
call CloseSRAM
pop af
@ -1159,14 +1159,14 @@ BattleAnimCmd_E6: ; cc776 (33:4776)
ld hl, BattleMonDVs ; BattleMonDVs
predef GetUnownLetter
ld de, $9000
ld de, VTiles2 tile $00
predef GetFrontpic
jr .done
.player
ld hl, EnemyMonDVs ; EnemyMonDVs
predef GetUnownLetter
ld de, $9310
ld de, VTiles2 tile $31
predef GetBackpic
.done

File diff suppressed because it is too large Load Diff

View File

@ -12,7 +12,7 @@ DoPlayerTurn: ; 34000
DoEnemyTurn: ; 3400a
call SetEnemyTurn
ld a, [InLinkBattle]
ld a, [wLinkMode]
and a
jr z, DoTurn
@ -696,7 +696,7 @@ BattleCommand02: ; 343db
; No obedience in link battles
; (since no handling exists for enemy)
ld a, [InLinkBattle]
ld a, [wLinkMode]
and a
ret nz
@ -1080,7 +1080,7 @@ endr
jr z, .asm_345a4
; skip this part entirely if wildbattle
ld a, [IsInBattle]
ld a, [wBattleMode]
dec a
jr z, .asm_345c5
@ -3521,7 +3521,7 @@ Function3534d: ; 3534d
inc l
.asm_3536b
ld a, [InLinkBattle]
ld a, [wLinkMode]
cp 3
jr z, .done
@ -3835,11 +3835,11 @@ BattleCommanda1: ; 35461
sub b
ld [DefaultFlypoint], a
.asm_3550d
ld a, [IsInBattle]
ld a, [wBattleMode]
dec a
jr z, .asm_3556b
ld a, [InLinkBattle]
ld a, [wLinkMode]
and a
jr nz, .asm_35532
@ -4825,7 +4825,7 @@ BattleCommand46: ; 35a74
call Function372d8
ld a, [InLinkBattle]
ld a, [wLinkMode]
and a
jr z, .asm_35a83
call AnimateFailedMove
@ -4888,7 +4888,7 @@ BattleCommand46: ; 35a74
ld a, [hBattleTurn]
and a
jr z, .asm_35af6
ld a, [IsInBattle]
ld a, [wBattleMode]
dec a
jr nz, .asm_35af6
ld a, [hl]
@ -5180,7 +5180,7 @@ endr
ld a, [hBattleTurn]
and a
jr nz, .asm_35c81
ld a, [IsInBattle]
ld a, [wBattleMode]
dec a
jr nz, .asm_35c81
ld hl, wc739
@ -5585,7 +5585,7 @@ Function35ece: ; 35ece
jr z, .asm_35eec
; Not in link battle
ld a, [InLinkBattle]
ld a, [wLinkMode]
and a
jr nz, .asm_35eec
@ -5683,7 +5683,7 @@ BattleCommand2f: ; 35f2c
and a
jr z, .asm_35f89
ld a, [InLinkBattle]
ld a, [wLinkMode]
and a
jr nz, .asm_35f89
@ -6331,7 +6331,7 @@ BattleCommand1d: ; 362e3
and a
jr z, .DidntMiss
ld a, [InLinkBattle]
ld a, [wLinkMode]
and a
jr nz, .DidntMiss
@ -7124,7 +7124,7 @@ BattleCommanda0: ; 36778
ld a, [hBattleTurn]
and a
jr nz, .asm_367bf
ld a, [IsInBattle]
ld a, [wBattleMode]
dec a
jr nz, .failed
ld a, [CurPartyLevel]
@ -7149,7 +7149,7 @@ BattleCommanda0: ; 36778
jp PrintButItFailed
.asm_367bf
ld a, [IsInBattle]
ld a, [wBattleMode]
dec a
jr nz, .failed
ld a, [BattleMonLevel]
@ -7188,10 +7188,10 @@ BattleCommanda0: ; 36778
Function36804: ; 36804
ld a, [wd0ee]
ld a, [wBattleResult]
and $c0
or $2
ld [wd0ee], a
ld [wBattleResult], a
ret
; 3680f
@ -7214,7 +7214,7 @@ BattleCommand23: ; 3680f
ld a, [AttackMissed]
and a
jr nz, .asm_36852 ; 36830 $20
ld a, [IsInBattle]
ld a, [wBattleMode]
dec a
jr nz, .asm_36869 ; 36836 $31
ld a, [CurPartyLevel]
@ -7300,7 +7300,7 @@ BattleCommand23: ; 3680f
and a
jr nz, .asm_368f3
ld a, [IsInBattle]
ld a, [wBattleMode]
dec a
jr nz, .asm_36908
@ -7496,7 +7496,7 @@ BattleCommand24: ; 369b6
dec a
jr .asm_36a3a
.asm_36a0b
ld a, [IsInBattle]
ld a, [wBattleMode]
cp $1
jp z, .asm_36a1e
ld a, [OTPartyCount]
@ -8177,7 +8177,7 @@ BattleCommand30: ; 36dc7
and a
jr z, .asm_36e0e
ld a, [InLinkBattle]
ld a, [wLinkMode]
and a
jr nz, .asm_36e0e
@ -8519,7 +8519,7 @@ BattleCommand35: ; 36f9d
BattleCommand36: ; 36fe1
call AnimateCurrentMove
callba Function1060e5
callba MobileFn_1060e5
jp PrintNothingHappened
; 36fed
@ -9152,7 +9152,7 @@ CheckSubstituteOpp: ; 37378
BattleCommand1a: ; 37380
callba Function10610d
callba MobileFn_10610d
ld a, $4
ld [wcfca], a
ld c, $3
@ -9281,7 +9281,7 @@ BattleCommand53: ; 37563
and a
jr z, .party
ld a, [IsInBattle]
ld a, [wBattleMode]
dec a
jr z, .done
@ -9493,7 +9493,7 @@ BattleCommand60: ; 3784b
BattleCommand61: ; 37874
; present
ld a, [InLinkBattle]
ld a, [wLinkMode]
cp $3
jr z, .asm_3787d
push bc
@ -9502,7 +9502,7 @@ BattleCommand61: ; 37874
call BattleCommand07
ld a, [InLinkBattle]
ld a, [wLinkMode]
cp $3
jr z, .asm_37889
pop de
@ -9765,7 +9765,7 @@ BattleCommand67: ; 379c9
.Enemy
; Wildmons don't have anything to switch to
ld a, [IsInBattle]
ld a, [wBattleMode]
dec a ; WILDMON
jp z, FailedBatonPass
@ -9800,7 +9800,7 @@ BattleCommand67: ; 379c9
BatonPass_LinkPlayerSwitch: ; 37a67
ld a, [InLinkBattle]
ld a, [wLinkMode]
and a
ret z
@ -9819,7 +9819,7 @@ BatonPass_LinkPlayerSwitch: ; 37a67
BatonPass_LinkEnemySwitch: ; 37a82
ld a, [InLinkBattle]
ld a, [wLinkMode]
and a
ret z
@ -10057,7 +10057,7 @@ BattleCommand6a6c: ; 37b7e
jr z, .Full
; Don't factor in time of day in link battles.
ld a, [InLinkBattle]
ld a, [wLinkMode]
and a
jr nz, .Weather

View File

@ -30,11 +30,11 @@ BattleCommand50: ; 37492
and a
ret nz
ld a, [InLinkBattle]
ld a, [wLinkMode]
and a
jr z, .stealenemyitem
ld a, [IsInBattle]
ld a, [wBattleMode]
dec a
ret z

215
battle/magikarp_length.asm Normal file
View File

@ -0,0 +1,215 @@
CalcMagikarpLength: ; fbbfc
; Return Magikarp's length (in mm) at MagikarpLength (big endian).
;
; input:
; de: EnemyMonDVs
; bc: PlayerID
; This function is poorly commented.
; In short, it generates a value between 190 and 1786 using
; a Magikarp's DVs and its trainer ID. This value is further
; filtered in LoadEnemyMon to make longer Magikarp even rarer.
; The value is generated from a lookup table.
; The index is determined by the dv xored with the player's trainer id.
; bc = rrc(dv[0]) ++ rrc(dv[1]) ^ rrc(id)
; if bc < 10: [MagikarpLength] = c + 190
; if bc >= $ff00: [MagikarpLength] = c + 1370
; else: [MagikarpLength] = z * 100 + (bc - x) / y
; X, Y, and Z depend on the value of b as follows:
; if b = 0: x = 310, y = 2, z = 3
; if b = 1: x = 710, y = 4, z = 4
; if b = 2-9: x = 2710, y = 20, z = 5
; if b = 10-29: x = 7710, y = 50, z = 6
; if b = 30-68: x = 17710, y = 100, z = 7
; if b = 69-126: x = 32710, y = 150, z = 8
; if b = 127-185: x = 47710, y = 150, z = 9
; if b = 186-224: x = 57710, y = 100, z = 10
; if b = 225-243: x = 62710, y = 50, z = 11
; if b = 244-251: x = 64710, y = 20, z = 12
; if b = 252-253: x = 65210, y = 5, z = 13
; if b = 254: x = 65410, y = 2, z = 14
; bc = rrc(dv[0]) ++ rrc(dv[1]) ^ rrc(id)
; id
ld h, b
ld l, c
ld a, [hli]
ld b, a
ld c, [hl]
rrc b
rrc c
; dv
ld a, [de]
inc de
rrca
rrca
xor b
ld b, a
ld a, [de]
rrca
rrca
xor c
ld c, a
; if bc < 10:
; de = bc + 190
; break
ld a, b
and a
jr nz, .no
ld a, c
cp 10
jr nc, .no
ld hl, 190
add hl, bc
ld d, h
ld e, l
jr .done
.no
ld hl, .Lengths
ld a, 2
ld [wd265], a
.read
ld a, [hli]
ld e, a
ld a, [hli]
ld d, a
call .BCLessThanDE
jr nc, .next
; c = (bc - de) / [hl]
call .BCMinusDE
ld a, b
ld [hDividend + 0], a
ld a, c
ld [hDividend + 1], a
ld a, [hl]
ld [hDivisor], a
ld b, 2
call Divide
ld a, [hQuotient + 2]
ld c, a
; de = c + 100 * (2 + i)
xor a
ld [hMultiplicand + 0], a
ld [hMultiplicand + 1], a
ld a, 100
ld [hMultiplicand + 2], a
ld a, [wd265]
ld [hMultiplier], a
call Multiply
ld b, 0
ld a, [hProduct + 3]
add c
ld e, a
ld a, [hProduct + 2]
adc b
ld d, a
jr .done
.next
inc hl ; align to next triplet
ld a, [wd265]
inc a
ld [wd265], a
cp 16
jr c, .read
call .BCMinusDE
ld hl, 1600
add hl, bc
ld d, h
ld e, l
.done
; hl = de * 10
ld h, d
ld l, e
rept 2
add hl, hl
endr
add hl, de
add hl, hl
; hl = hl / 254
ld de, -254
ld a, -1
.div_254
inc a
add hl, de
jr c, .div_254
; d, e = hl / 12, hl % 12
ld d, 0
.mod_12
cp 12
jr c, .ok
sub 12
inc d
jr .mod_12
.ok
ld e, a
ld hl, MagikarpLength
ld [hl], d
inc hl
ld [hl], e
ret
; fbc9a
.BCLessThanDE: ; fbc9a
; Intention: Return bc < de.
; Reality: Return b < d.
ld a, b
cp d
ret c
ret nc ; whoops
ld a, c
cp e
ret
; fbca1
.BCMinusDE: ; fbca1
; bc -= de
ld a, c
sub e
ld c, a
ld a, b
sbc d
ld b, a
ret
; fbca8
.Lengths: ; fbca8
; ????, divisor
dwb 110, 1
dwb 310, 2
dwb 710, 4
dwb 2710, 20
dwb 7710, 50
dwb 17710, 100
dwb 32710, 150
dwb 47710, 150
dwb 57710, 100
dwb 62710, 50
dwb 64710, 20
dwb 65210, 5
dwb 65410, 2
dwb 65510, 1 ; not used
; fbcd2

View File

@ -161,7 +161,7 @@ endr
DoBadgeTypeBoosts: ; fbe24
ld a, [InLinkBattle]
ld a, [wLinkMode]
and a
ret nz

View File

@ -10,6 +10,7 @@ INCLUDE "constants/type_constants.asm"
INCLUDE "constants/move_constants.asm"
INCLUDE "constants/battle_constants.asm"
INCLUDE "constants/map_constants.asm"
INCLUDE "constants/map_setup_constants.asm"
INCLUDE "constants/landmark_constants.asm"
INCLUDE "constants/item_constants.asm"
INCLUDE "constants/trainer_constants.asm"
@ -26,3 +27,5 @@ INCLUDE "constants/misc_constants.asm"
INCLUDE "constants/std_constants.asm"
INCLUDE "constants/deco_constants.asm"
INCLUDE "constants/radio_constants.asm"
INCLUDE "constants/sprite_constants.asm"
INCLUDE "constants/tilemap_constants.asm"

View File

@ -315,3 +315,32 @@ SUBSTATUS_CURLED EQU 0
const EFFECT_BEAT_UP
const EFFECT_FLY
const EFFECT_DEFENSE_CURL
; Battle vars used in home/battle.asm
const_def
const PLAYER_SUBSTATUS_1
const ENEMY_SUBSTATUS_1
const PLAYER_SUBSTATUS_2
const ENEMY_SUBSTATUS_2
const PLAYER_SUBSTATUS_3
const ENEMY_SUBSTATUS_3
const PLAYER_SUBSTATUS_4
const ENEMY_SUBSTATUS_4
const PLAYER_SUBSTATUS_5
const ENEMY_SUBSTATUS_5
const PLAYER_STATUS
const ENEMY_STATUS
const PLAYER_MOVE_ANIMATION
const ENEMY_MOVE_ANIMATION
const PLAYER_MOVE_EFFECT
const ENEMY_MOVE_EFFECT
const PLAYER_MOVE_POWER
const ENEMY_MOVE_POWER
const PLAYER_MOVE_TYPE
const ENEMY_MOVE_TYPE
const PLAYER_CUR_MOVE
const ENEMY_CUR_MOVE
const PLAYER_COUNTER_MOVE
const ENEMY_COUNTER_MOVE
const PLAYER_LAST_MOVE
const ENEMY_LAST_MOVE

View File

@ -352,7 +352,7 @@ const_value SET 70
const HELD_TRADE_EVOLVE
const HELD_AMULET_COIN
const HELD_BRIGHTPOWDER
const HELD_4E
const HELD_78
const HELD_FOCUS_BAND
const_def
@ -364,3 +364,8 @@ const_value SET 70
const ITEMATTR_POCKET
const ITEMATTR_HELP
NUM_ITEMATTRS EQU const_value
ITEMMENU_NOUSE EQU 0
ITEMMENU_CURRENT EQU 4
ITEMMENU_PARTY EQU 5
ITEMMENU_CLOSE EQU 6

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,64 @@
const_value SET $f0
const MAPSETUP_00
const MAPSETUP_WARP
const MAPSETUP_02
const MAPSETUP_RELOADMAP
const MAPSETUP_04
const MAPSETUP_05
const MAPSETUP_06
const MAPSETUP_07
const MAPSETUP_08
const MAPSETUP_09
const MAPSETUP_10
const MAPSETUP_BADWARP
; Command descriptions from Condensation water's scripting compendium. const_def
const_def
const map_lcd_on
const map_lcd_off
const map_sound_off
const map_music
const map_start_music
const map_fade_music
const map_fade
const map_bike_music
const map_music_force
const map_max_volume
const map_load_blocks
const map_connection_blocks
const map_save_screen
const map_buffer_screen
const map_load_graphics
const map_load_tileset_header
const map_time_of_day
const map_palettes
const map_wildmons
const map_sprites
const map_change_callback
const map_start_callback
const map_load_objects
const map_load_spawn
const map_load_connection
const map_load_warp
const map_attributes
const map_attributes_2
const map_clear_bg_palettes
const map_fade_out_palettes
const map_fade_in_palettes
const map_anchor_screen
const map_warp_face
const map_face_down
const map_spawn_coord
const map_player_coord
const map_prolong_sprites
const map_delay_sprites
const map_update_roam
const map_keep_roam
const map_fade_out_music
const map_animations_on
const map_animations_off
const map_keep_palettes
const map_text_scroll_off
const map_stop_script
map_end_setup_script EQU -1

View File

@ -46,8 +46,6 @@ CHECK_FLAG EQU 2
; joypad
BUTTONS EQU %00010000
D_PAD EQU %00100000
NO_INPUT EQU %00000000
A_BUTTON EQU %00000001
@ -59,6 +57,11 @@ D_LEFT EQU %00100000
D_UP EQU %01000000
D_DOWN EQU %10000000
BUTTONS EQU A_BUTTON | B_BUTTON | SELECT | START
D_PAD EQU D_RIGHT | D_LEFT | D_UP | D_DOWN
R_DPAD EQU %00100000
R_BUTTONS EQU %00010000
; screen
HP_BAR_LENGTH EQU 6
@ -146,3 +149,13 @@ const_value = 1
const HAPPINESS_MASSAGE ; 12
const HAPPINESS_GAINLEVELATHOME ; 13
const_def
const LINK_NULL
const LINK_TIMECAPSULE
const LINK_TRADECENTER
const LINK_COLOSSEUM
const LINK_MOBILE
HMENURETURN_SCRIPT EQU %10000000
HMENURETURN_ASM EQU %11111111

View File

@ -40,13 +40,28 @@
const PHONE_BUENA
const_def
const ELMCALL_NONE
const ELMCALL_POKERUS
const ELMCALL_ROBBED
const ELMCALL_ASSISTANT
const ELMCALL_WEIRDBROADCAST
const ELMCALL_SSTICKET
const ELMCALL_UNKNOWN
const MOMCALL_WORRIED
const ELMCALL_MASTERBALL
const SPECIALCALL_NONE
const SPECIALCALL_POKERUS
const SPECIALCALL_ROBBED
const SPECIALCALL_ASSISTANT
const SPECIALCALL_WEIRDBROADCAST
const SPECIALCALL_SSTICKET
const SPECIALCALL_BIKESHOP
const SPECIALCALL_WORRIED
const SPECIALCALL_MASTERBALL
const_def
const PHONE_CONTACT_TRAINER_CLASS
const PHONE_CONTACT_TRAINER_NUMBER
const PHONE_CONTACT_MAP_GROUP
const PHONE_CONTACT_MAP_NUMBER
const PHONE_CONTACT_SCRIPT1_TIME
const PHONE_CONTACT_SCRIPT1_BANK
const PHONE_CONTACT_SCRIPT1_ADDR_LO
const PHONE_CONTACT_SCRIPT1_ADDR_HI
const PHONE_CONTACT_SCRIPT2_TIME
const PHONE_CONTACT_SCRIPT2_BANK
const PHONE_CONTACT_SCRIPT2_ADDR_LO
const PHONE_CONTACT_SCRIPT2_ADDR_HI
PHONE_TABLE_WIDTH EQU const_value
CONTACT_LIST_SIZE EQU 10

View File

@ -5,7 +5,7 @@ LAST_TALKED EQU -2
const_def
const VAR_STRINGBUFFER2
const VAR_PARTYCOUNT
const VAR_02
const VAR_BATTLERESULT
const VAR_BATTLETYPE
const VAR_TIMEOFDAY
const VAR_DEXCAUGHT
@ -23,11 +23,15 @@ LAST_TALKED EQU -2
const VAR_CONTESTMINUTES
const VAR_XCOORD
const VAR_YCOORD
const VAR_POKERUS
const VAR_SPECIALPHONECALL
const VAR_15
const VAR_16
const VAR_KURT_APRICORNS
const VAR_CALLERID
const VAR_BLUECARDBALANCE
const VAR_19
const VAR_BUENASPASSWORD
const VAR_KENJI_BREAK
NUM_VARS EQU const_value
RETVAR_STRBUF2 EQU (0 << 6)
RETVAR_ADDR_DE EQU (1 << 6)
RETVAR_EXECUTE EQU (2 << 6)

View File

@ -0,0 +1,219 @@
; sprites
const_def
const SPRITE_NONE ; 00
const SPRITE_CHRIS ; 01
const SPRITE_CHRIS_BIKE ; 02
const SPRITE_GAMEBOY_KID ; 03
const SPRITE_SILVER ; 04
const SPRITE_OAK ; 05
const SPRITE_RED ; 06
const SPRITE_BLUE ; 07
const SPRITE_BILL ; 08
const SPRITE_ELDER ; 09
const SPRITE_JANINE ; 0a
const SPRITE_KURT ; 0b
const SPRITE_MOM ; 0c
const SPRITE_BLAINE ; 0d
const SPRITE_REDS_MOM ; 0e
const SPRITE_DAISY ; 0f
const SPRITE_ELM ; 10
const SPRITE_WILL ; 11
const SPRITE_FALKNER ; 12
const SPRITE_WHITNEY ; 13
const SPRITE_BUGSY ; 14
const SPRITE_MORTY ; 15
const SPRITE_CHUCK ; 16
const SPRITE_JASMINE ; 17
const SPRITE_PRYCE ; 18
const SPRITE_CLAIR ; 19
const SPRITE_BROCK ; 1a
const SPRITE_KAREN ; 1b
const SPRITE_BRUNO ; 1c
const SPRITE_MISTY ; 1d
const SPRITE_LANCE ; 1e
const SPRITE_SURGE ; 1f
const SPRITE_ERIKA ; 20
const SPRITE_KOGA ; 21
const SPRITE_SABRINA ; 22
const SPRITE_COOLTRAINER_M ; 23
const SPRITE_COOLTRAINER_F ; 24
const SPRITE_BUG_CATCHER ; 25
const SPRITE_TWIN ; 26
const SPRITE_YOUNGSTER ; 27
const SPRITE_LASS ; 28
const SPRITE_TEACHER ; 29
const SPRITE_BUENA ; 2a
const SPRITE_SUPER_NERD ; 2b
const SPRITE_ROCKER ; 2c
const SPRITE_POKEFAN_M ; 2d
const SPRITE_POKEFAN_F ; 2e
const SPRITE_GRAMPS ; 2f
const SPRITE_GRANNY ; 30
const SPRITE_SWIMMER_GUY ; 31
const SPRITE_SWIMMER_GIRL ; 32
const SPRITE_BIG_SNORLAX ; 33
const SPRITE_SURFING_PIKACHU ; 34
const SPRITE_ROCKET ; 35
const SPRITE_ROCKET_GIRL ; 36
const SPRITE_NURSE ; 37
const SPRITE_LINK_RECEPTIONIST ; 38
const SPRITE_CLERK ; 39
const SPRITE_FISHER ; 3a
const SPRITE_FISHING_GURU ; 3b
const SPRITE_SCIENTIST ; 3c
const SPRITE_KIMONO_GIRL ; 3d
const SPRITE_SAGE ; 3e
const SPRITE_UNUSED_GUY ; 3f
const SPRITE_GENTLEMAN ; 40
const SPRITE_BLACK_BELT ; 41
const SPRITE_RECEPTIONIST ; 42
const SPRITE_OFFICER ; 43
const SPRITE_CAL ; 44
const SPRITE_SLOWPOKE ; 45
const SPRITE_CAPTAIN ; 46
const SPRITE_BIG_LAPRAS ; 47
const SPRITE_GYM_GUY ; 48
const SPRITE_SAILOR ; 49
const SPRITE_BIKER ; 4a
const SPRITE_PHARMACIST ; 4b
const SPRITE_MONSTER ; 4c
const SPRITE_FAIRY ; 4d
const SPRITE_BIRD ; 4e
const SPRITE_DRAGON ; 4f
const SPRITE_BIG_ONIX ; 50
const SPRITE_N64 ; 51
const SPRITE_SUDOWOODO ; 52
const SPRITE_SURF ; 53
const SPRITE_POKE_BALL ; 54
const SPRITE_POKEDEX ; 55
const SPRITE_PAPER ; 56
const SPRITE_VIRTUAL_BOY ; 57
const SPRITE_OLD_LINK_RECEPTIONIST ; 58
const SPRITE_ROCK ; 59
const SPRITE_BOULDER ; 5a
const SPRITE_SNES ; 5b
const SPRITE_FAMICOM ; 5c
const SPRITE_FRUIT_TREE ; 5d
const SPRITE_GOLD_TROPHY ; 5e
const SPRITE_SILVER_TROPHY ; 5f
const SPRITE_KRIS ; 60
const SPRITE_KRIS_BIKE ; 61
const SPRITE_KURT_OUTSIDE ; 62
const SPRITE_SUICUNE ; 63
const SPRITE_ENTEI ; 64
const SPRITE_RAIKOU ; 65
const SPRITE_STANDING_YOUNGSTER ; 66
const_value SET $80
SPRITE_POKEMON EQU const_value
const SPRITE_UNOWN ; 80
const SPRITE_GEODUDE ; 81
const SPRITE_GROWLITHE ; 82
const SPRITE_WEEDLE ; 83
const SPRITE_SHELLDER ; 84
const SPRITE_ODDISH ; 85
const SPRITE_GENGAR ; 86
const SPRITE_ZUBAT ; 87
const SPRITE_MAGIKARP ; 88
const SPRITE_SQUIRTLE ; 89
const SPRITE_TOGEPI ; 8a
const SPRITE_BUTTERFREE ; 8b
const SPRITE_DIGLETT ; 8c
const SPRITE_POLIWAG ; 8d
const SPRITE_PIKACHU ; 8e
const SPRITE_CLEFAIRY ; 8f
const SPRITE_CHARMANDER ; 90
const SPRITE_JYNX ; 91
const SPRITE_STARMIE ; 92
const SPRITE_BULBASAUR ; 93
const SPRITE_JIGGLYPUFF ; 94
const SPRITE_GRIMER ; 95
const SPRITE_EKANS ; 96
const SPRITE_PARAS ; 97
const SPRITE_TENTACOOL ; 98
const SPRITE_TAUROS ; 99
const SPRITE_MACHOP ; 9a
const SPRITE_VOLTORB ; 9b
const SPRITE_LAPRAS ; 9c
const SPRITE_RHYDON ; 9d
const SPRITE_MOLTRES ; 9e
const SPRITE_SNORLAX ; 9f
const SPRITE_GYARADOS ; a0
const SPRITE_LUGIA ; a1
const SPRITE_HO_OH ; a2
const_value SET $e0
const SPRITE_DAYCARE_MON_1 ; e0
const SPRITE_DAYCARE_MON_2 ; e1
const_value SET $f0
SPRITE_VARS EQU const_value
const SPRITE_CONSOLE ; f0
const SPRITE_DOLL_1 ; f1
const SPRITE_DOLL_2 ; f2
const SPRITE_BIG_DOLL ; f3
const SPRITE_WEIRD_TREE ; f4
const SPRITE_OLIVINE_RIVAL ; f5
const SPRITE_AZALEA_ROCKET ; f6
const SPRITE_FUCHSIA_GYM_1 ; f7
const SPRITE_FUCHSIA_GYM_2 ; f8
const SPRITE_FUCHSIA_GYM_3 ; f9
const SPRITE_FUCHSIA_GYM_4 ; fa
const SPRITE_COPYCAT ; fb
const SPRITE_JANINE_IMPERSONATOR ; fc
; sprite types
const_value SET 1
const WALKING_SPRITE
const STANDING_SPRITE
const STILL_SPRITE
; sprite palettes
const_def
const PAL_OW_RED
const PAL_OW_BLUE
const PAL_OW_GREEN
const PAL_OW_BROWN
const PAL_OW_PINK
const PAL_OW_SILVER
const PAL_OW_TREE
const PAL_OW_ROCK
; sprite movements
const_def
const SPRITEMOVEFN_00
const SPRITEMOVEFN_01
const SPRITEMOVEFN_02
const SPRITEMOVEFN_03
const SPRITEMOVEFN_04
const SPRITEMOVEFN_05
const SPRITEMOVEFN_06
const SPRITEMOVEFN_07
const SPRITEMOVEFN_08
const SPRITEMOVEFN_09
const SPRITEMOVEFN_0A
const SPRITEMOVEFN_0B
const SPRITEMOVEFN_0C
const SPRITEMOVEFN_0D
const SPRITEMOVEFN_0E
const SPRITEMOVEFN_0F
const SPRITEMOVEFN_10
const SPRITEMOVEFN_11
const SPRITEMOVEFN_12
const SPRITEMOVEFN_13
const SPRITEMOVEFN_14
const SPRITEMOVEFN_15
const SPRITEMOVEFN_16
const SPRITEMOVEFN_17
const SPRITEMOVEFN_18
const SPRITEMOVEFN_19
const SPRITEMOVEFN_1A
const SPRITEMOVEFN_1B
const SPRITEMOVEFN_1C
const SPRITEMOVEFN_1D
const SPRITEMOVEFN_1E
const SPRITEMOVEFN_1F
const SPRITEMOVEFN_20
const SPRITEMOVEFN_21

View File

@ -0,0 +1,5 @@
LANDTILE EQU 0
WALLTILE EQU 1
WATRTILE EQU 15
TALK EQU 1 << 4

View File

@ -1,5 +1,12 @@
; trainer groups
enum_start 1
enum_start
trainerclass TRAINER_NONE ; 0
const PHONECONTACT_MOM
const PHONECONTACT_BIKESHOP
const PHONECONTACT_BILL
const PHONECONTACT_ELM
const PHONECONTACT_BUENA
trainerclass FALKNER ; 1
trainerclass WHITNEY ; 2
@ -607,3 +614,33 @@
const EUSINE
NUM_TRAINER_CLASSES EQU __enum__
const_def
const NO_AI
const_value = 0
shift_const AI_BASIC
shift_const AI_SETUP
shift_const AI_TYPES
shift_const AI_OFFENSIVE
shift_const AI_SMART
shift_const AI_OPPORTUNIST
shift_const AI_AGGRESSIVE
shift_const AI_CAUTIOUS
shift_const AI_STATUS
shift_const AI_RISKY
shift_const AI_10
shift_const AI_11
shift_const AI_12
shift_const AI_13
shift_const AI_14
shift_const AI_15
const_def
const TRNATTR_ITEM1
const TRNATTR_ITEM2
const TRNATTR_BASEMONEY
const TRNATTR_AI1
const TRNATTR_AI2
const TRNATTR_AI3
const TRNATTR_AI4
NUM_TRAINER_ATTRIBUTES EQU const_value

View File

@ -34,7 +34,6 @@ POKEDEX_ENTRIES_4 EQU $74
; engine/events.o
; engine/scripting.o
; engine/events_2.o
EVENTS EQU $25

View File

@ -134,14 +134,14 @@ GetFishGroupHeader: ; 9245b
ret
.group11
ld a, [wdfce]
ld a, [wFishingSwarmFlag]
cp 1
jr nz, .end
ld d, 6
jr .end
.group12
ld a, [wdfce]
ld a, [wFishingSwarmFlag]
cp 2
jr nz, .end
ld d, 7

872
engine/battle_start.asm Normal file
View File

@ -0,0 +1,872 @@
Predef_StartBattle: ; 8c20f
call Function8c26d
ld a, [rBGP]
ld [wcfc7], a
ld a, [rOBP0]
ld [wcfc8], a
ld a, [rOBP1]
ld [wcfc9], a
call DelayFrame
ld hl, hVBlank
ld a, [hl]
push af
ld [hl], $1
.loop
ld a, [wJumptableIndex]
bit 7, a
jr nz, .done
call FlashyTransitionToBattle
call DelayFrame
jr .loop
.done
ld a, [rSVBK]
push af
ld a, $5
ld [rSVBK], a
ld hl, Unkn1Pals
ld bc, $0040
xor a
call ByteFill
pop af
ld [rSVBK], a
ld a, %11111111
ld [wcfc7], a
call DmgToCgbBGPals
call DelayFrame
xor a
ld [hLCDStatCustom], a
ld [hLCDStatCustom + 1], a
ld [hLCDStatCustom + 2], a
ld [hSCY], a
ld a, $1
ld [rSVBK], a
pop af
ld [hVBlank], a
call DelayFrame
ret
; 8c26d
Function8c26d: ; 8c26d
ld a, [wLinkMode]
cp LINK_MOBILE
jr z, .mobile
callba Function6454
call UpdateSprites
call DelayFrame
call Function8c2a0
call Function8cf4f
jr .resume
.mobile
call LoadTrainerBattlePokeballTiles
.resume
ld a, SCREEN_HEIGHT_PX
ld [hWY], a
call DelayFrame
xor a
ld [hBGMapMode], a
ld hl, wJumptableIndex
xor a
rept 2
ld [hli], a
endr
ld [hl], a
call WipeLYOverrides
ret
; 8c2a0
Function8c2a0: ; 8c2a0
call LoadTrainerBattlePokeballTiles
ld hl, VBGMap0
call Function8c2cf
ret
; 8c2aa
LoadTrainerBattlePokeballTiles:
; Load the tiles used in the Pokeball Graphic that fills the screen
; at the start of every Trainer battle.
ld de, TrainerBattlePokeballTiles
ld hl, VTiles1 tile $7e
ld b, BANK(TrainerBattlePokeballTiles)
ld c, 2
call Request2bpp
ld a, [rVBK]
push af
ld a, $1
ld [rVBK], a
ld de, TrainerBattlePokeballTiles
ld hl, VTiles4 tile $7e
ld b, BANK(TrainerBattlePokeballTiles)
ld c, 2
call Request2bpp
pop af
ld [rVBK], a
ret
; 8c2cf
Function8c2cf: ; 8c2cf
ld a, [rSVBK]
push af
ld a, $6
ld [rSVBK], a
push hl
ld hl, w6_d000
ld bc, $28 * $10
.loop
ld [hl], -1
inc hl
dec bc
ld a, c
or b
jr nz, .loop
pop hl
ld de, w6_d000
ld b, BANK(Function8c2cf) ; BANK(@)
ld c, $28
call Request2bpp
pop af
ld [rSVBK], a
ret
; 8c2f4
TrainerBattlePokeballTiles: ; 8c2f4
INCBIN "gfx/overworld/trainer_battle_pokeball_tiles.2bpp"
FlashyTransitionToBattle: ; 8c314
ld a, [wJumptableIndex]
ld e, a
ld d, 0
ld hl, .jumptable
rept 2
add hl, de
endr
ld a, [hli]
ld h, [hl]
ld l, a
jp [hl]
; 8c323
.jumptable: ; 8c323 (23:4323)
dw StartTrainerBattle_DetermineWhichAnimation ; 00
; Animation 1: cave
dw StartTrainerBattle_LoadPokeBallGraphics ; 01
dw StartTrainerBattle_SetUpBGMap ; 02
dw StartTrainerBattle_Flash ; 03
dw StartTrainerBattle_Flash ; 04
dw StartTrainerBattle_Flash ; 05
dw StartTrainerBattle_NextScene ; 06
dw StartTrainerBattle_SetUpForWavyOutro ; 07
dw StartTrainerBattle_SineWave ; 08
; Animation 2: cave, stronger
dw StartTrainerBattle_LoadPokeBallGraphics ; 09
dw StartTrainerBattle_SetUpBGMap ; 0a
dw StartTrainerBattle_Flash ; 0b
dw StartTrainerBattle_Flash ; 0c
dw StartTrainerBattle_Flash ; 0d
dw StartTrainerBattle_NextScene ; 0e
; There is no setup for this one
dw StartTrainerBattle_ZoomToBlack ; 0f
; Animation 3: no cave
dw StartTrainerBattle_LoadPokeBallGraphics ; 10
dw StartTrainerBattle_SetUpBGMap ; 11
dw StartTrainerBattle_Flash ; 12
dw StartTrainerBattle_Flash ; 13
dw StartTrainerBattle_Flash ; 14
dw StartTrainerBattle_NextScene ; 15
dw StartTrainerBattle_SetUpForSpinOutro ; 16
dw StartTrainerBattle_SpinToBlack ; 17
; Animation 4: no cave, stronger
dw StartTrainerBattle_LoadPokeBallGraphics ; 18
dw StartTrainerBattle_SetUpBGMap ; 19
dw StartTrainerBattle_Flash ; 1a
dw StartTrainerBattle_Flash ; 1b
dw StartTrainerBattle_Flash ; 1c
dw StartTrainerBattle_NextScene ; 1d
dw StartTrainerBattle_SetUpForRandomScatterOutro ; 1e
dw StartTrainerBattle_SpeckleToBlack ; 1f
; All animations jump to here.
dw StartTrainerBattle_Finish ; 20
StartTrainerBattle_DetermineWhichAnimation: ; 8c365 (23:4365)
; The screen flashes a different number of
; times depending on the level of your lead
; Pokemon relative to the opponent's.
ld de, 0
ld a, [BattleMonLevel]
add 3
ld hl, EnemyMonLevel
cp [hl]
jr nc, .okay
set 0, e
.okay
ld a, [wPermission]
cp CAVE
jr z, .okay2
cp PERM_5
jr z, .okay2
cp DUNGEON
jr z, .okay2
set 1, e
.okay2
ld hl, .StartingPoints
add hl, de
ld a, [hl]
ld [wJumptableIndex], a
ret
; 8c38f (23:438f)
.StartingPoints: ; 8c38f
db 1, 9
db 16, 24
; 8c393
StartTrainerBattle_Finish: ; 8c393 (23:4393)
call ClearSprites
ld a, $80
ld [wJumptableIndex], a
ret
StartTrainerBattle_NextScene: ; 8c39c (23:439c)
ld hl, wJumptableIndex
inc [hl]
ret
StartTrainerBattle_SetUpBGMap: ; 8c3a1 (23:43a1)
call StartTrainerBattle_NextScene
xor a
ld [wcf64], a
ld [hBGMapMode], a ; $ff00+$d4
ret
StartTrainerBattle_Flash: ; 8c3ab (23:43ab)
call .DoFlashAnimation
ret nc
call StartTrainerBattle_NextScene
ret
.DoFlashAnimation: ; 8c3b3 (23:43b3)
ld a, [wd847]
cp -1
jr z, .done
ld hl, wcf64
ld a, [hl]
inc [hl]
srl a
ld e, a
ld d, 0
ld hl, .pals
add hl, de
ld a, [hl]
cp %00000001
jr z, .done
ld [wcfc7], a
call DmgToCgbBGPals
and a
ret
.done
xor a
ld [wcf64], a
scf
ret
; 8c3db (23:43db)
.pals: ; 8c3db
db %11111001 ; 3321
db %11111110 ; 3332
db %11111111 ; 3333
db %11111110 ; 3332
db %11111001 ; 3321
db %11100100 ; 3210
db %10010000 ; 2100
db %01000000 ; 1000
db %00000000 ; 0000
db %01000000 ; 1000
db %10010000 ; 2100
db %11100100 ; 3210
db %00000001 ; 0001
; 8c3e8
StartTrainerBattle_SetUpForWavyOutro: ; 8c3e8 (23:43e8)
callba Function5602
ld a, $5
ld [rSVBK], a ; $ff00+$70
call StartTrainerBattle_NextScene
ld a, $43
ld [hLCDStatCustom], a ; $ff00+$c6
xor a
ld [hLCDStatCustom + 1], a
ld a, $90
ld [hLCDStatCustom + 2], a
xor a
ld [wcf64], a
ld [wcf65], a
ret
StartTrainerBattle_SineWave: ; 8c408 (23:4408)
ld a, [wcf64]
cp $60
jr nc, .end
call .DoSineWave
ret
.end
ld a, $20
ld [wJumptableIndex], a
ret
.DoSineWave: ; 8c419 (23:4419)
ld hl, wcf65
ld a, [hl]
inc [hl]
ld hl, wcf64
ld d, [hl]
add [hl]
ld [hl], a
ld a, $90
ld bc, wd100
ld e, $0
.loop
push af
push de
ld a, e
call StartTrainerBattle_DrawSineWave
ld [bc], a
inc bc
pop de
ld a, e
add $2
ld e, a
pop af
dec a
jr nz, .loop
ret
StartTrainerBattle_SetUpForSpinOutro: ; 8c43d (23:443d)
callba Function5602
ld a, $5
ld [rSVBK], a ; $ff00+$70
call StartTrainerBattle_NextScene
xor a
ld [wcf64], a
ret
spintable_entry: MACRO
db \1
dw .wedge\2
dwcoord \3, \4
ENDM
; quadrants
const_def
const UPPER_LEFT
const UPPER_RIGHT
const LOWER_LEFT
const LOWER_RIGHT
StartTrainerBattle_SpinToBlack: ; 8c44f (23:444f)
xor a
ld [hBGMapMode], a ; $ff00+$d4
ld a, [wcf64]
ld e, a
ld d, 0
ld hl, .spintable
rept 5
add hl, de
endr
ld a, [hli]
cp -1
jr z, .end
ld [wcf65], a
call .load
ld a, $1
ld [hBGMapMode], a ; $ff00+$d4
call DelayFrame
call DelayFrame
ld hl, wcf64
inc [hl]
ret
.end
ld a, $1
ld [hBGMapMode], a ; $ff00+$d4
call DelayFrame
call DelayFrame
call DelayFrame
xor a
ld [hBGMapMode], a ; $ff00+$d4
ld a, $20
ld [wJumptableIndex], a
ret
; 8c490 (23:4490)
.spintable: ; 8c490
spintable_entry UPPER_LEFT, 1, 1, 6
spintable_entry UPPER_LEFT, 2, 0, 3
spintable_entry UPPER_LEFT, 3, 1, 0
spintable_entry UPPER_LEFT, 4, 5, 0
spintable_entry UPPER_LEFT, 5, 9, 0
spintable_entry UPPER_RIGHT, 5, 10, 0
spintable_entry UPPER_RIGHT, 4, 14, 0
spintable_entry UPPER_RIGHT, 3, 18, 0
spintable_entry UPPER_RIGHT, 2, 19, 3
spintable_entry UPPER_RIGHT, 1, 18, 6
spintable_entry LOWER_RIGHT, 1, 18, 11
spintable_entry LOWER_RIGHT, 2, 19, 14
spintable_entry LOWER_RIGHT, 3, 18, 17
spintable_entry LOWER_RIGHT, 4, 14, 17
spintable_entry LOWER_RIGHT, 5, 10, 17
spintable_entry LOWER_LEFT, 5, 9, 17
spintable_entry LOWER_LEFT, 4, 5, 17
spintable_entry LOWER_LEFT, 3, 1, 17
spintable_entry LOWER_LEFT, 2, 0, 14
spintable_entry LOWER_LEFT, 1, 1, 11
db -1
; 8c4f5
.load: ; 8c4f5 (23:44f5)
ld a, [hli]
ld e, a
ld a, [hli]
ld d, a
ld a, [hli]
ld h, [hl]
ld l, a
.loop
push hl
ld a, [de]
ld c, a
inc de
.loop1
ld [hl], $ff
ld a, [wcf65]
bit 0, a
jr z, .leftside
inc hl
jr .okay1
.leftside
dec hl
.okay1
dec c
jr nz, .loop1
pop hl
ld a, [wcf65]
bit 1, a
ld bc, SCREEN_WIDTH
jr z, .upper
ld bc, -SCREEN_WIDTH
.upper
add hl, bc
ld a, [de]
inc de
cp -1
ret z
and a
jr z, .loop
ld c, a
.loop2
ld a, [wcf65]
bit 0, a
jr z, .leftside2
dec hl
jr .okay2
.leftside2
inc hl
.okay2
dec c
jr nz, .loop2
jr .loop
; 8c538 (23:4538)
.wedge1: db 2, 3, 5, 4, 9, -1
.wedge2: db 1, 1, 2, 2, 4, 2, 4, 2, 3, -1
.wedge3: db 2, 1, 3, 1, 4, 1, 4, 1, 4, 1, 3, 1, 2, 1, 1, 1, 1, -1
.wedge4: db 4, 1, 4, 0, 3, 1, 3, 0, 2, 1, 2, 0, 1, -1
.wedge5: db 4, 0, 3, 0, 3, 0, 2, 0, 2, 0, 1, 0, 1, 0, 1, -1
; 8c578
StartTrainerBattle_SetUpForRandomScatterOutro: ; 8c578 (23:4578)
callba Function5602
ld a, $5
ld [rSVBK], a ; $ff00+$70
call StartTrainerBattle_NextScene
ld a, $10
ld [wcf64], a
ld a, $1
ld [hBGMapMode], a ; $ff00+$d4
ret
StartTrainerBattle_SpeckleToBlack: ; 8c58f (23:458f)
ld hl, wcf64
ld a, [hl]
and a
jr z, .done
dec [hl]
ld c, $c
.loop
push bc
call .BlackOutRandomTile
pop bc
dec c
jr nz, .loop
ret
.done
ld a, $1
ld [hBGMapMode], a ; $ff00+$d4
call DelayFrame
call DelayFrame
call DelayFrame
xor a
ld [hBGMapMode], a ; $ff00+$d4
ld a, $20
ld [wJumptableIndex], a
ret
.BlackOutRandomTile: ; 8c5b8 (23:45b8)
.y_loop
call Random
cp SCREEN_HEIGHT
jr nc, .y_loop
ld b, a
.x_loop
call Random
cp SCREEN_WIDTH
jr nc, .x_loop
ld c, a
hlcoord 0, -1
ld de, SCREEN_WIDTH
inc b
.row_loop
add hl, de
dec b
jr nz, .row_loop
add hl, bc
; If the tile has already been blacked out,
; sample a new tile
ld a, [hl]
cp $ff
jr z, .y_loop
ld [hl], $ff
ret
StartTrainerBattle_LoadPokeBallGraphics: ; 8c5dc (23:45dc)
ld a, [OtherTrainerClass]
and a
jp z, .nextscene
xor a
ld [hBGMapMode], a ; $ff00+$d4
hlcoord 0, 0, AttrMap
ld bc, SCREEN_HEIGHT * SCREEN_WIDTH
inc b
inc c
jr .enter_loop_midway
.loop
ld a, [hl]
or %00000111
ld [hli], a
.enter_loop_midway
dec c
jr nz, .loop
dec b
jr nz, .loop
call .loadpokeballgfx ; load a, [OtherTrainerClass] \ ld de, PokeBallTransition
hlcoord 2, 1
ld b, SCREEN_WIDTH - 4
.loop2
push hl
ld c, 2
.loop3
push hl
ld a, [de]
inc de
.loop4
; Loading is done bit by bit
and a
jr z, .done
sla a
jr nc, .no_load
ld [hl], $fe ; "8"
.no_load
inc hl
jr .loop4
.done
pop hl
push bc
ld bc, (SCREEN_WIDTH - 4) / 2
add hl, bc
pop bc
dec c
jr nz, .loop3
pop hl
push bc
ld bc, SCREEN_WIDTH
add hl, bc
pop bc
dec b
jr nz, .loop2
ld a, [hCGB] ; $ff00+$e6
and a
jr nz, .cgb
ld a, $1
ld [hBGMapMode], a ; $ff00+$d4
call DelayFrame
call DelayFrame
jr .nextscene
.cgb
ld hl, .daypals
ld a, [TimeOfDayPal]
and (1 << 2) - 1
cp 3
jr nz, .daytime
ld hl, .nightpals
.daytime
ld a, [rSVBK] ; $ff00+$70
push af
ld a, $5 ; WRAM5 = palettes
ld [rSVBK], a ; $ff00+$70
call .copypals
push hl
ld de, Unkn1Pals + 8 * 7
ld bc, $8
call CopyBytes
pop hl
ld de, BGPals + 8 * 7
ld bc, $8
call CopyBytes
pop af
ld [rSVBK], a ; $ff00+$70
ld a, $1
ld [hCGBPalUpdate], a ; $ff00+$e5
call DelayFrame
call Function8cf4f
.nextscene: ; 8c673 (23:4673)
call StartTrainerBattle_NextScene
ret
.copypals: ; 8c677 (23:4677)
ld de, Unkn1Pals + 8 * 7
call .copy
ld de, BGPals + 8 * 7
call .copy
ld de, Unkn2Pals + 8 * 6
call .copy
ld de, OBPals + 8 * 6
call .copy
ld de, Unkn2Pals + 8 * 7
call .copy
ld de, OBPals + 8 * 7
.copy: ; 8c698 (23:4698)
push hl
ld bc, $8
call CopyBytes
pop hl
ret
; 8c6a1 (23:46a1)
.daypals: ; 8c6a1
RGB 31, 18, 29
RGB 31, 11, 15
RGB 31, 05, 05
RGB 07, 07, 07
; 8c6a9
.nightpals: ; 8c6a9
RGB 31, 18, 29
RGB 31, 05, 05
RGB 31, 05, 05
RGB 31, 05, 05
.loadpokeballgfx:
ld a, [OtherTrainerClass]
ld de, PokeBallTransition
ret
PokeBallTransition:
db %00000011, %11000000
db %00001111, %11110000
db %00111100, %00111100
db %00110000, %00001100
db %01100000, %00000110
db %01100011, %11000110
db %11000110, %01100011
db %11111100, %00111111
db %11111100, %00111111
db %11000110, %01100011
db %01100011, %11000110
db %01100000, %00000110
db %00110000, %00001100
db %00111100, %00111100
db %00001111, %11110000
db %00000011, %11000000
WipeLYOverrides: ; 8c6d8
ld a, [rSVBK]
push af
ld a, $5
ld [rSVBK], a
ld hl, LYOverrides
call .wipe
ld hl, LYOverridesBackup
call .wipe
pop af
ld [rSVBK], a
ret
; 8c6ef
.wipe: ; 8c6ef
xor a
ld c, SCREEN_HEIGHT_PX
.loop
ld [hli], a
dec c
jr nz, .loop
ret
; 8c6f7
StartTrainerBattle_DrawSineWave: ; 8c6f7 (23:46f7)
and (1 << 6) - 1
cp 1 << 5
jr nc, .okay
call .DoSineWave
ld a, h
ret
.okay
and (1 << 5) - 1
call .DoSineWave
ld a, h
xor -1 ; cpl
inc a
ret
.DoSineWave: ; 8c70c (23:470c)
ld e, a
ld a, d
ld d, 0
ld hl, .sinewave
rept 2
add hl, de
endr
ld e, [hl]
inc hl
ld d, [hl]
ld hl, 0
.loop
srl a
jr nc, .skip
add hl, de
.skip
sla e
rl d
and a
jr nz, .loop
ret
; 8c728 (23:4728)
.sinewave: ; 8c728
sine_wave $100
; 8c768
zoombox: macro
; width, height, start y, start x
db \1, \2
dwcoord \3, \4
endm
StartTrainerBattle_ZoomToBlack: ; 8c768 (23:4768)
callba Function5602
ld de, .boxes
.loop
ld a, [de]
cp -1
jr z, .done
inc de
ld c, a
ld a, [de]
inc de
ld b, a
ld a, [de]
inc de
ld l, a
ld a, [de]
inc de
ld h, a
xor a
ld [hBGMapMode], a ; $ff00+$d4
call .Copy
call WaitBGMap
jr .loop
.done
ld a, $20
ld [wJumptableIndex], a
ret
; 8c792 (23:4792)
.boxes: ; 8c792
zoombox 4, 2, 8, 8
zoombox 6, 4, 7, 7
zoombox 8, 6, 6, 6
zoombox 10, 8, 5, 5
zoombox 12, 10, 4, 4
zoombox 14, 12, 3, 3
zoombox 16, 14, 2, 2
zoombox 18, 16, 1, 1
zoombox 20, 18, 0, 0
db -1
; 8c7b7
.Copy: ; 8c7b7 (23:47b7)
ld a, $ff
.row
push bc
push hl
.col
ld [hli], a
dec c
jr nz, .col
pop hl
ld bc, SCREEN_WIDTH
add hl, bc
pop bc
dec b
jr nz, .row
ret
; 8c7c9 (23:47c9)

View File

@ -83,7 +83,7 @@ Function8aa4: ; 8aa4
push bc
ld hl, PalPacket_9ce6
ld de, wcda9
ld bc, $0010
ld bc, PalPacket_9cf6 - PalPacket_9ce6
call CopyBytes
pop bc
pop de
@ -105,7 +105,7 @@ Function8aa4: ; 8aa4
Function8ad1: ; 8ad1
ld hl, PalPacket_9c56 + 1
call Function9610
call CopyFourPalettes
call Function971a
call Function9699
ret
@ -196,8 +196,8 @@ Function8b4d: ; 8b4d
.asm_8b5c
ld de, Unkn2Pals
ld a, $3b
call Function9625
jp Function9630
call GetAthPalletFromPalettes9df6
jp LoadHLPaletteIntoDE
; 8b67
Function8b67: ; 8b67
@ -212,8 +212,8 @@ Function8b67: ; 8b67
.asm_8b76
ld de, Unkn2Pals
ld a, $3c
call Function9625
jp Function9630
call GetAthPalletFromPalettes9df6
jp LoadHLPaletteIntoDE
; 8b81
Function8b81: ; 8b81
@ -309,7 +309,7 @@ Function8bec: ; 8bec
.asm_8c0b
ld b, $0
add hl, bc
ld bc, $0604
lb bc, 6, 4
ld a, [EnemySafeguardCount]
and $3
call Function9663
@ -386,7 +386,7 @@ endr
jr .asm_8c7b
.asm_8c82
ld bc, $0208
lb bc, 2, 8
ld a, e
call Function9663
ret
@ -520,7 +520,7 @@ INCLUDE "predef/cgb.asm"
Function95f0: ; 95f0
ld hl, Palette_9608
ld de, Unkn1Pals
ld bc, $0008
ld bc, 8
ld a, $5
call FarCopyWRAM
call Function96a4
@ -537,28 +537,29 @@ Palette_9608: ; 9608
; 9610
Function9610: ; 9610
CopyFourPalettes: ; 9610
ld de, Unkn1Pals
ld c, $4
Function9615: ; 9615
CopyPalettes: ; 9615
.loop
push bc
ld a, [hli]
push hl
call Function9625
call Function9630
call GetAthPalletFromPalettes9df6
call LoadHLPaletteIntoDE
pop hl
inc hl
pop bc
dec c
jr nz, Function9615
jr nz, .loop
ret
; 9625
Function9625: ; 9625
GetAthPalletFromPalettes9df6: ; 9625
ld l, a
ld h, $0
rept 3
rept 3 ; multiply by 8
add hl, hl
endr
ld bc, Palettes_9df6
@ -566,18 +567,18 @@ endr
ret
; 9630
Function9630: ; 9630
LoadHLPaletteIntoDE: ; 9630
ld a, [rSVBK]
push af
ld a, $5
ld [rSVBK], a
ld c, $8
.asm_9639
.loop
ld a, [hli]
ld [de], a
inc de
dec c
jr nz, .asm_9639
jr nz, .loop
pop af
ld [rSVBK], a
ret
@ -595,12 +596,12 @@ Function9643: ; 9643
ld [de], a
inc de
ld c, $4
.asm_9654
.loop
ld a, [hli]
ld [de], a
inc de
dec c
jr nz, .asm_9654
jr nz, .loop
xor a
ld [de], a
inc de
@ -612,19 +613,19 @@ Function9643: ; 9643
; 9663
Function9663: ; 9663
.asm_9663
.row
push bc
push hl
.asm_9665
.col
ld [hli], a
dec c
jr nz, .asm_9665
jr nz, .col
pop hl
ld bc, $0014
ld bc, SCREEN_WIDTH
add hl, bc
pop bc
dec b
jr nz, .asm_9663
jr nz, .row
ret
; 9673
@ -743,7 +744,7 @@ Function96f3: ; 96f3
jr .asm_970b
.asm_9712
ld bc, $0208
lb bc, 2, 8
ld a, e
call Function9663
ret
@ -784,16 +785,16 @@ Function973a: ; 973a
Function974b: ; 974b
and a
jp nz, Function97f9
ld a, [wd45b]
ld a, [wPlayerSpriteSetupFlags]
bit 2, a
jr nz, .asm_9760
jr nz, .male
ld a, [PlayerGender]
and a
jr z, .asm_9760
jr z, .male
ld hl, KrisPalette
ret
.asm_9760
.male
ld hl, PlayerPalette
ret
; 9764
@ -876,21 +877,21 @@ Function97cc: ; 97cc
ld a, $90
ld [rOBPI], a
ld a, $1c
call Function9625
call GetAthPalletFromPalettes9df6
call Function97e5
ld a, $21
call Function9625
call GetAthPalletFromPalettes9df6
call Function97e5
ret
; 97e5
Function97e5: ; 97e5
ld c, $8
.asm_97e7
.loop
ld a, [hli]
ld [rOBPD], a
dec c
jr nz, .asm_97e7
jr nz, .loop
ret
; 97ee
@ -935,32 +936,32 @@ Function981a: ; 981a
and $7
ret z
ld b, a
.asm_981f
.loop
push bc
xor a
ld [rJOYP], a
ld a, $30
ld [rJOYP], a
ld b, $10
.asm_9829
.loop2
ld e, $8
ld a, [hli]
ld d, a
.asm_982d
.loop3
bit 0, d
ld a, $10
jr nz, .asm_9835
jr nz, .okay
ld a, $20
.asm_9835
.okay
ld [rJOYP], a
ld a, $30
ld [rJOYP], a
rr d
dec e
jr nz, .asm_982d
jr nz, .loop3
dec b
jr nz, .asm_9829
jr nz, .loop2
ld a, $20
ld [rJOYP], a
ld a, $30
@ -968,7 +969,7 @@ Function981a: ; 981a
call Function9a7a
pop bc
dec b
jr nz, .asm_981f
jr nz, .loop
ret
; 9853

View File

@ -124,7 +124,7 @@ Function109847:: ; 109847
jr z, .asm_10984f
ld a, $40
.asm_10984f
ld [wcf63], a
ld [wJumptableIndex], a
ld a, [rSVBK]
push af
@ -148,17 +148,17 @@ Function109847:: ; 109847
jr nz, .asm_10986a
ld de, CreditsBorderGFX
ld hl, $9200
ld hl, VTiles2 tile $20
lb bc, BANK(CreditsBorderGFX), $09
call Request2bpp
ld de, CopyrightGFX
ld hl, $9600
ld hl, VTiles2 tile $60
lb bc, BANK(CopyrightGFX), $1d
call Request2bpp
ld de, TheEndGFX
ld hl, $9400
ld hl, VTiles2 tile $40
lb bc, BANK(TheEndGFX), $10
call Request2bpp
@ -193,7 +193,7 @@ Function109847:: ; 109847
ld a, $5
ld [hVBlank], a
ld a, $1
ld [$ffaa], a
ld [hInMenu], a
xor a
ld [hBGMapMode], a
ld [CreditsPos], a
@ -225,7 +225,7 @@ Function1098fd: ; 1098fd
ld a, [hJoypadDown]
and $1
ret z
ld a, [wcf63]
ld a, [wJumptableIndex]
bit 7, a
ret
; 109908
@ -234,7 +234,7 @@ Function109908: ; 109908
ld a, [hJoypadDown]
and $2
ret z
ld a, [wcf63]
ld a, [wJumptableIndex]
bit 6, a
ret z
ld hl, CreditsPos
@ -255,7 +255,7 @@ Function109908: ; 109908
; 109926
Function109926: ; 109926
ld a, [wcf63]
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, wcf63
ld hl, wJumptableIndex
inc [hl]
ret
Function109956: ; 109956 (42:5956)
ld hl, wcf63
ld hl, wJumptableIndex
ld a, [hl]
and $f0
ld [hl], a
@ -348,7 +348,7 @@ Function1099a3: ; 1099a3 (42:59a3)
ParseCredits: ; 1099aa
ld hl, wcf63
ld hl, wJumptableIndex
bit 7, [hl]
jp nz, .done
@ -488,7 +488,7 @@ endr
.end
; Stop execution.
ld hl, wcf63
ld hl, wJumptableIndex
set 7, [hl]
ld a, $20
ld [MusicFade], a

View File

@ -1,198 +1,200 @@
; All locations are in WRAM bank 1.
engine_flag: MACRO
dwb \1, 1 << \2
ENDM
; location, bit
; pokegear
dwb wPokegearFlags, %00000010 ; radio card ; $0
dwb wPokegearFlags, %00000001 ; map card
dwb wPokegearFlags, %00000100 ; phone card
dwb wPokegearFlags, %00001000 ; expn card
dwb wPokegearFlags, %10000000 ; on/off
engine_flag wPokegearFlags, 1 ; radio card ; $0
engine_flag wPokegearFlags, 0 ; map card
engine_flag wPokegearFlags, 2 ; phone card
engine_flag wPokegearFlags, 3 ; expn card
engine_flag wPokegearFlags, 7 ; on/off
; wDaycareMan, %10000000 ; daycare 1 on
dwb wDaycareMan, %01000000 ; monster 1 and 2 are compatible
; wDaycareMan, %00100000 ; egg is ready
dwb wDaycareMan, %00000001 ; monster 1 in daycare
; wDaycareMan, 7 ; daycare 1 on
engine_flag wDaycareMan, 6 ; monster 1 and 2 are compatible
; wDaycareMan, 5 ; egg is ready
engine_flag wDaycareMan, 0 ; monster 1 in daycare
; wDaycareLady, %10000000 = daycare 2 on
dwb wDaycareLady, %00000001 ; monster 2 in daycare
; wDaycareLady, 7 = daycare 2 on
engine_flag wDaycareLady, 0 ; monster 2 in daycare
dwb wMomSavingMoney, %00000001 ; mom saving money ; $8
dwb wMomSavingMoney, %10000000 ; dst
engine_flag wMomSavingMoney, 0 ; mom saving money ; $8
engine_flag wMomSavingMoney, 7 ; dst
dwb wdc39, %00000001
engine_flag wdc39, 0
dwb StatusFlags, %00000001 ; pokedex
dwb StatusFlags, %00000010 ; unown dex
dwb StatusFlags, %00001000 ; pokerus
dwb StatusFlags, %00010000 ; rocket signal on ch20
dwb StatusFlags, %01000000 ; credits skip
dwb StatusFlags, %10000000 ; bug contest on ; $10
dwb StatusFlags2, %00000100 ; bug contest timer
dwb StatusFlags2, %00000010
dwb StatusFlags2, %00000001 ; rockets in radio tower
dwb StatusFlags2, %00010000 ; bike shop call enabled (1024 bike steps reqd)
dwb StatusFlags2, %00100000 ; give pokerus; berry -> berry juice when trading?
dwb StatusFlags2, %01000000
dwb StatusFlags2, %10000000 ; rockets in mahogany
engine_flag StatusFlags, 0 ; pokedex
engine_flag StatusFlags, 1 ; unown dex
engine_flag StatusFlags, 3 ; pokerus
engine_flag StatusFlags, 4 ; rocket signal on ch20
engine_flag StatusFlags, 6 ; credits skip
engine_flag StatusFlags, 7 ; bug contest on ; $10
engine_flag StatusFlags2, 2 ; bug contest timer
engine_flag StatusFlags2, 1
engine_flag StatusFlags2, 0 ; rockets in radio tower
engine_flag StatusFlags2, 4 ; bike shop call enabled (1024 bike steps reqd)
engine_flag StatusFlags2, 5 ; give pokerus
engine_flag StatusFlags2, 6 ; berry -> berry juice when trading?
engine_flag StatusFlags2, 7 ; rockets in mahogany
dwb BikeFlags, %00000001 ; strength active ; $18
dwb BikeFlags, %00000010 ; always on bike (cant surf)
dwb BikeFlags, %00000100 ; downhill (cycling road)
engine_flag BikeFlags, 0 ; strength active ; $18
engine_flag BikeFlags, 1 ; always on bike (cant surf)
engine_flag BikeFlags, 2 ; downhill (cycling road)
dwb JohtoBadges, %00000001 ; zephyrbadge
dwb JohtoBadges, %00000010 ; hivebadge
dwb JohtoBadges, %00000100 ; plainbadge
dwb JohtoBadges, %00001000 ; fogbadge
dwb JohtoBadges, %00010000 ; mineralbadge
dwb JohtoBadges, %00100000 ; stormbadge ; $20
dwb JohtoBadges, %01000000 ; glacierbadge
dwb JohtoBadges, %10000000 ; risingbadge
engine_flag JohtoBadges, 0 ; zephyrbadge
engine_flag JohtoBadges, 1 ; hivebadge
engine_flag JohtoBadges, 2 ; plainbadge
engine_flag JohtoBadges, 3 ; fogbadge
engine_flag JohtoBadges, 4 ; mineralbadge
engine_flag JohtoBadges, 5 ; stormbadge ; $20
engine_flag JohtoBadges, 6 ; glacierbadge
engine_flag JohtoBadges, 7 ; risingbadge
dwb KantoBadges, %00000001 ; boulderbadge
dwb KantoBadges, %00000010 ; cascadebadge
dwb KantoBadges, %00000100 ; thunderbadge
dwb KantoBadges, %00001000 ; rainbowbadge
dwb KantoBadges, %00010000 ; soulbadge
dwb KantoBadges, %00100000 ; marshbadge ; $28
dwb KantoBadges, %01000000 ; volcanobadge
dwb KantoBadges, %10000000 ; earthbadge
engine_flag KantoBadges, 0 ; boulderbadge
engine_flag KantoBadges, 1 ; cascadebadge
engine_flag KantoBadges, 2 ; thunderbadge
engine_flag KantoBadges, 3 ; rainbowbadge
engine_flag KantoBadges, 4 ; soulbadge
engine_flag KantoBadges, 5 ; marshbadge ; $28
engine_flag KantoBadges, 6 ; volcanobadge
engine_flag KantoBadges, 7 ; earthbadge
; unown sets
dwb UnlockedUnowns, %00000001 ; 1
dwb UnlockedUnowns, %00000010 ; 2
dwb UnlockedUnowns, %00000100 ; 3
dwb UnlockedUnowns, %00001000 ; 4
dwb UnlockedUnowns, %00010000 ; 5
dwb UnlockedUnowns, %00100000 ; 6 ; $30
dwb UnlockedUnowns, %01000000 ; 7
dwb UnlockedUnowns, %10000000 ; 8
engine_flag UnlockedUnowns, 0 ; 1
engine_flag UnlockedUnowns, 1 ; 2
engine_flag UnlockedUnowns, 2 ; 3
engine_flag UnlockedUnowns, 3 ; 4
engine_flag UnlockedUnowns, 4 ; 5
engine_flag UnlockedUnowns, 5 ; 6 ; $30
engine_flag UnlockedUnowns, 6 ; 7
engine_flag UnlockedUnowns, 7 ; 8
; fly
dwb VisitedSpawns, %00000001 ; your house
dwb VisitedSpawns, %00000010 ; viridian pokecenter
dwb VisitedSpawns, %00000100 ; pallet
dwb VisitedSpawns, %00001000 ; viridian
dwb VisitedSpawns, %00010000 ; pewter
dwb VisitedSpawns, %00100000 ; cerulean ; $38
dwb VisitedSpawns, %01000000 ; rock tunnel
dwb VisitedSpawns, %10000000 ; vermilion
dwb VisitedSpawns + 1, %00000001 ; lavender
dwb VisitedSpawns + 1, %00000010 ; saffron
dwb VisitedSpawns + 1, %00000100 ; celadon
dwb VisitedSpawns + 1, %00001000 ; fuchsia
dwb VisitedSpawns + 1, %00010000 ; cinnabar
dwb VisitedSpawns + 1, %00100000 ; indigo plateau ; $40
dwb VisitedSpawns + 1, %01000000 ; new bark
dwb VisitedSpawns + 1, %10000000 ; cherrygrove
dwb VisitedSpawns + 2, %00000001 ; violet
dwb VisitedSpawns + 2, %00000100 ; azalea
dwb VisitedSpawns + 2, %00001000 ; cianwood
dwb VisitedSpawns + 2, %00010000 ; goldenrod
dwb VisitedSpawns + 2, %00100000 ; olivine
dwb VisitedSpawns + 2, %01000000 ; ecruteak ; $48
dwb VisitedSpawns + 2, %10000000 ; mahogany
dwb VisitedSpawns + 3, %00000001 ; lake of rage
dwb VisitedSpawns + 3, %00000010 ; blackthorn
dwb VisitedSpawns + 3, %00000100 ; silver cave
dwb VisitedSpawns + 3, %00010000 ; unused
engine_flag VisitedSpawns, 0 ; your house
engine_flag VisitedSpawns, 1 ; viridian pokecenter
engine_flag VisitedSpawns, 2 ; pallet
engine_flag VisitedSpawns, 3 ; viridian
engine_flag VisitedSpawns, 4 ; pewter
engine_flag VisitedSpawns, 5 ; cerulean ; $38
engine_flag VisitedSpawns, 6 ; rock tunnel
engine_flag VisitedSpawns, 7 ; vermilion
engine_flag VisitedSpawns + 1, 0 ; lavender
engine_flag VisitedSpawns + 1, 1 ; saffron
engine_flag VisitedSpawns + 1, 2 ; celadon
engine_flag VisitedSpawns + 1, 3 ; fuchsia
engine_flag VisitedSpawns + 1, 4 ; cinnabar
engine_flag VisitedSpawns + 1, 5 ; indigo plateau ; $40
engine_flag VisitedSpawns + 1, 6 ; new bark
engine_flag VisitedSpawns + 1, 7 ; cherrygrove
engine_flag VisitedSpawns + 2, 0 ; violet
engine_flag VisitedSpawns + 2, 2 ; azalea
engine_flag VisitedSpawns + 2, 3 ; cianwood
engine_flag VisitedSpawns + 2, 4 ; goldenrod
engine_flag VisitedSpawns + 2, 5 ; olivine
engine_flag VisitedSpawns + 2, 6 ; ecruteak ; $48
engine_flag VisitedSpawns + 2, 7 ; mahogany
engine_flag VisitedSpawns + 3, 0 ; lake of rage
engine_flag VisitedSpawns + 3, 1 ; blackthorn
engine_flag VisitedSpawns + 3, 2 ; silver cave
engine_flag VisitedSpawns + 3, 4 ; unused
dwb wLuckyNumberShowFlag, %00000001 ; lucky number show
dwb StatusFlags2, %00001000
engine_flag wLuckyNumberShowFlag, 0 ; lucky number show
engine_flag StatusFlags2, 3 ; ????
dwb DailyFlags, %00000001 ; kurt making balls ; $50
dwb DailyFlags, %00000010
dwb DailyFlags, %00000100 ; special wilddata?
dwb DailyFlags, %00001000 ; time capsule (24h wait)
dwb DailyFlags, %00010000 ; all fruit trees
dwb DailyFlags, %00100000 ; shuckle given
dwb DailyFlags, %01000000 ; goldenrod underground merchant closed
dwb DailyFlags, %10000000 ; fought in trainer hall today
engine_flag DailyFlags, 0 ; kurt making balls ; $50
engine_flag DailyFlags, 1 ; ????
engine_flag DailyFlags, 2 ; special wilddata?
engine_flag DailyFlags, 3 ; time capsule (24h wait)
engine_flag DailyFlags, 4 ; all fruit trees
engine_flag DailyFlags, 5 ; shuckle given
engine_flag DailyFlags, 6 ; goldenrod underground merchant closed
engine_flag DailyFlags, 7 ; fought in trainer hall today
dwb WeeklyFlags, %00000001 ; mt moon square clefairy ; $58
dwb WeeklyFlags, %00000010 ; union cave lapras
dwb WeeklyFlags, %00000100 ; goldenrod underground haircut used
dwb WeeklyFlags, %00001000 ; goldenrod mall happiness event floor05 person07
dwb WeeklyFlags, %00010000 ; tea in blues house
dwb WeeklyFlags, %00100000 ; indigo plateau rival fight
dwb WeeklyFlags, %01000000 ; move tutor
dwb WeeklyFlags, %10000000 ; buenas password
engine_flag WeeklyFlags, 0 ; mt moon square clefairy ; $58
engine_flag WeeklyFlags, 1 ; union cave lapras
engine_flag WeeklyFlags, 2 ; goldenrod underground haircut used
engine_flag WeeklyFlags, 3 ; goldenrod mall happiness event floor05 person07
engine_flag WeeklyFlags, 4 ; tea in blues house
engine_flag WeeklyFlags, 5 ; indigo plateau rival fight
engine_flag WeeklyFlags, 6 ; move tutor
engine_flag WeeklyFlags, 7 ; buenas password
dwb SwarmFlags, %00000001 ; $60
dwb SwarmFlags, %00000010 ; goldenrod dept store sale is on
engine_flag SwarmFlags, 0 ; $60
engine_flag SwarmFlags, 1 ; goldenrod dept store sale is on
dwb GameTimerPause, %10000000 ; $62
engine_flag GameTimerPause, 7 ; $62
dwb PlayerGender, %00000001 ; player is female
engine_flag PlayerGender, 0 ; player is female
dwb wdbf3, %00000100 ; have gs ball after kurt examined it
engine_flag wCelebiEvent, 2 ; have gs ball after kurt examined it
; rematches
dwb wDailyRematchFlags, %00000001 ; jack
dwb wDailyRematchFlags, %00000010 ; huey
dwb wDailyRematchFlags, %00000100 ; gaven
dwb wDailyRematchFlags, %00001000 ; beth ; $68
dwb wDailyRematchFlags, %00010000 ; jose
dwb wDailyRematchFlags, %00100000 ; reena
dwb wDailyRematchFlags, %01000000 ; joey
dwb wDailyRematchFlags, %10000000 ; wade
dwb wDailyRematchFlags + 1, %00000001 ; ralph
dwb wDailyRematchFlags + 1, %00000010 ; liz
dwb wDailyRematchFlags + 1, %00000100 ; anthony
dwb wDailyRematchFlags + 1, %00001000 ; todd ; $70
dwb wDailyRematchFlags + 1, %00010000 ; gina
dwb wDailyRematchFlags + 1, %00100000 ; arnie
dwb wDailyRematchFlags + 1, %01000000 ; alan
dwb wDailyRematchFlags + 1, %10000000 ; dana
dwb wDailyRematchFlags + 2, %00000001 ; chad
dwb wDailyRematchFlags + 2, %00000010 ; tully
dwb wDailyRematchFlags + 2, %00000100 ; brent
dwb wDailyRematchFlags + 2, %00001000 ; tiffany ; $78
dwb wDailyRematchFlags + 2, %00010000 ; vance
dwb wDailyRematchFlags + 2, %00100000 ; wilton
dwb wDailyRematchFlags + 2, %01000000 ; parry
dwb wDailyRematchFlags + 2, %10000000 ; erin
engine_flag wDailyRematchFlags, 0 ; jack
engine_flag wDailyRematchFlags, 1 ; huey
engine_flag wDailyRematchFlags, 2 ; gaven
engine_flag wDailyRematchFlags, 3 ; beth ; $68
engine_flag wDailyRematchFlags, 4 ; jose
engine_flag wDailyRematchFlags, 5 ; reena
engine_flag wDailyRematchFlags, 6 ; joey
engine_flag wDailyRematchFlags, 7 ; wade
engine_flag wDailyRematchFlags + 1, 0 ; ralph
engine_flag wDailyRematchFlags + 1, 1 ; liz
engine_flag wDailyRematchFlags + 1, 2 ; anthony
engine_flag wDailyRematchFlags + 1, 3 ; todd ; $70
engine_flag wDailyRematchFlags + 1, 4 ; gina
engine_flag wDailyRematchFlags + 1, 5 ; arnie
engine_flag wDailyRematchFlags + 1, 6 ; alan
engine_flag wDailyRematchFlags + 1, 7 ; dana
engine_flag wDailyRematchFlags + 2, 0 ; chad
engine_flag wDailyRematchFlags + 2, 1 ; tully
engine_flag wDailyRematchFlags + 2, 2 ; brent
engine_flag wDailyRematchFlags + 2, 3 ; tiffany ; $78
engine_flag wDailyRematchFlags + 2, 4 ; vance
engine_flag wDailyRematchFlags + 2, 5 ; wilton
engine_flag wDailyRematchFlags + 2, 6 ; parry
engine_flag wDailyRematchFlags + 2, 7 ; erin
dwb wDailyPhoneItemFlags, %00000001 ; beverly has nugget
dwb wDailyPhoneItemFlags, %00000010 ; jose has star piece
dwb wDailyPhoneItemFlags, %00000100 ; wade has item (see bittable1 $032b-e)
dwb wDailyPhoneItemFlags, %00001000 ; gina has leaf stone ; $80
dwb wDailyPhoneItemFlags, %00010000 ; alan has fire stone
dwb wDailyPhoneItemFlags, %00100000 ; liz has thunderstone
dwb wDailyPhoneItemFlags, %01000000 ; derek has nugget
dwb wDailyPhoneItemFlags, %10000000 ; tully has water stone
engine_flag wDailyPhoneItemFlags, 0 ; beverly has nugget
engine_flag wDailyPhoneItemFlags, 1 ; jose has star piece
engine_flag wDailyPhoneItemFlags, 2 ; wade has item (see bittable1 $032b-e)
engine_flag wDailyPhoneItemFlags, 3 ; gina has leaf stone ; $80
engine_flag wDailyPhoneItemFlags, 4 ; alan has fire stone
engine_flag wDailyPhoneItemFlags, 5 ; liz has thunderstone
engine_flag wDailyPhoneItemFlags, 6 ; derek has nugget
engine_flag wDailyPhoneItemFlags, 7 ; tully has water stone
dwb wDailyPhoneItemFlags + 1, %00000001 ; tiffany has pink bow
dwb wDailyPhoneItemFlags + 1, %00000010 ; wilton has item (see bittable1 $032f-31)
engine_flag wDailyPhoneItemFlags + 1, 0 ; tiffany has pink bow
engine_flag wDailyPhoneItemFlags + 1, 1 ; wilton has item (see bittable1 $032f-31)
dwb wDailyPhoneTimeOfDayFlags, %00000001
dwb wDailyPhoneTimeOfDayFlags, %00000010 ; $88
dwb wDailyPhoneTimeOfDayFlags, %00000100
dwb wDailyPhoneTimeOfDayFlags, %00001000
dwb wDailyPhoneTimeOfDayFlags, %00010000
dwb wDailyPhoneTimeOfDayFlags, %00100000
dwb wDailyPhoneTimeOfDayFlags, %01000000
dwb wDailyPhoneTimeOfDayFlags, %10000000
engine_flag wDailyPhoneTimeOfDayFlags, 0
engine_flag wDailyPhoneTimeOfDayFlags, 1 ; $88
engine_flag wDailyPhoneTimeOfDayFlags, 2
engine_flag wDailyPhoneTimeOfDayFlags, 3
engine_flag wDailyPhoneTimeOfDayFlags, 4
engine_flag wDailyPhoneTimeOfDayFlags, 5
engine_flag wDailyPhoneTimeOfDayFlags, 6
engine_flag wDailyPhoneTimeOfDayFlags, 7
dwb wDailyPhoneTimeOfDayFlags + 1, %00000001
dwb wDailyPhoneTimeOfDayFlags + 1, %00000010 ; $90
dwb wDailyPhoneTimeOfDayFlags + 1, %00000100
dwb wDailyPhoneTimeOfDayFlags + 1, %00001000
dwb wDailyPhoneTimeOfDayFlags + 1, %00010000
dwb wDailyPhoneTimeOfDayFlags + 1, %00100000
dwb wDailyPhoneTimeOfDayFlags + 1, %01000000
dwb wDailyPhoneTimeOfDayFlags + 1, %10000000
engine_flag wDailyPhoneTimeOfDayFlags + 1, 0
engine_flag wDailyPhoneTimeOfDayFlags + 1, 1 ; $90
engine_flag wDailyPhoneTimeOfDayFlags + 1, 2
engine_flag wDailyPhoneTimeOfDayFlags + 1, 3
engine_flag wDailyPhoneTimeOfDayFlags + 1, 4
engine_flag wDailyPhoneTimeOfDayFlags + 1, 5
engine_flag wDailyPhoneTimeOfDayFlags + 1, 6
engine_flag wDailyPhoneTimeOfDayFlags + 1, 7
dwb wDailyPhoneTimeOfDayFlags + 2, %00000001
dwb wDailyPhoneTimeOfDayFlags + 2, %00000010 ; $98
dwb wDailyPhoneTimeOfDayFlags + 2, %00000100
dwb wDailyPhoneTimeOfDayFlags + 2, %00001000
dwb wDailyPhoneTimeOfDayFlags + 2, %00010000
dwb wDailyPhoneTimeOfDayFlags + 2, %00100000
dwb wDailyPhoneTimeOfDayFlags + 2, %01000000
dwb wDailyPhoneTimeOfDayFlags + 2, %10000000
engine_flag wDailyPhoneTimeOfDayFlags + 2, 0
engine_flag wDailyPhoneTimeOfDayFlags + 2, 1 ; $98
engine_flag wDailyPhoneTimeOfDayFlags + 2, 2
engine_flag wDailyPhoneTimeOfDayFlags + 2, 3
engine_flag wDailyPhoneTimeOfDayFlags + 2, 4
engine_flag wDailyPhoneTimeOfDayFlags + 2, 5
engine_flag wDailyPhoneTimeOfDayFlags + 2, 6
engine_flag wDailyPhoneTimeOfDayFlags + 2, 7
dwb wd45b, %00000100 ; female player has been transformed into male
engine_flag wPlayerSpriteSetupFlags, 2 ; female player has been transformed into male
dwb SwarmFlags, %00000100 ; dunsparce swarm ; $a0
dwb SwarmFlags, %00001000 ; yanma swarm
engine_flag SwarmFlags, 2 ; dunsparce swarm ; $a0
engine_flag SwarmFlags, 3 ; yanma swarm

View File

@ -123,7 +123,7 @@ StartMap: ; 96724
ld hl, MapStatus
ld bc, $3e ; 62
call ByteFill
callba Function113e5
callba InitCallReceiveDelay
call ClearJoypad
; fallthrough
; 9673e
@ -138,19 +138,19 @@ EnterMap: ; 9673e
call ClearAllScriptFlags3
ld a, [hMapEntryMethod]
cp $f7
cp MAPSETUP_07
jr nz, .dontset
call SetAll_ScriptFlags3
.dontset
ld a, [hMapEntryMethod]
cp $f3
cp MAPSETUP_RELOADMAP
jr nz, .dontresetpoison
xor a
ld [PoisonStepCount], a
.dontresetpoison
xor a
xor a ; end map entry
ld [hMapEntryMethod], a
ld a, 2 ; HandleMap
ld [MapStatus], a
@ -285,12 +285,12 @@ Function96812: ; 96812
PlayerEvents: ; 9681f
xor a
; If there's already a player event, don't interrupt it.
ld a, [ScriptRunning]
and a
ret nz
call Function968e4
call Dummy_CheckScriptFlags3Bit5 ; This is a waste of time
call CheckTrainerBattle3
jr c, .ok
@ -298,13 +298,13 @@ PlayerEvents: ; 9681f
call CheckTileEvent
jr c, .ok
call Function97c30
call RunMemScript
jr c, .ok
call Function968ec
call DoMapTrigger
jr c, .ok
call Function9693a
call CheckTimeEvents
jr c, .ok
call OWPlayerInput
@ -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,11 +436,11 @@ SetUpFiveStepWildEncounterCooldown: ; 968d1
ret
; 968d7
Function968d7: ; 968d7
ret_968d7: ; 968d7
ret
; 968d8
;968d8
Function968d8: ; 968d8
SetMinTwoStepWildEncounterCooldown: ; 968d8
ld a, [wWildEncounterCooldown]
cp 2
ret nc
@ -449,15 +449,15 @@ Function968d8: ; 968d8
ret
; 968e4
Function968e4: ; 968e4
Dummy_CheckScriptFlags3Bit5: ; 968e4
call CheckBit5_ScriptFlags3
ret z
call Function2f3e
call ret_2f3e
ret
; 968ec
Function968ec: ; 968ec
ld a, [wdc07]
DoMapTrigger: ; 968ec
ld a, [wCurrMapTriggerCount]
and a
jr z, .nope
@ -468,7 +468,7 @@ Function968ec: ; 968ec
ld e, a
ld d, 0
ld hl, wdc07 + 1
ld hl, wCurrMapTriggerHeaderPointer
ld a, [hli]
ld h, [hl]
ld l, a
@ -505,23 +505,23 @@ endr
ret
; 9693a
Function9693a: ; 9693a
ld a, [InLinkBattle]
CheckTimeEvents: ; 9693a
ld a, [wLinkMode]
and a
jr nz, .nothing
ld hl, StatusFlags2
bit 2, [hl]
jr z, .asm_96951
jr z, .do_daily
callba Function114a4
jr c, .elevator
callba CheckBugContestTimer
jr c, .end_bug_contest
xor a
ret
.asm_96951
callba Function11452
callba Function114e7
.do_daily
callba CheckDailyResetTimer
callba CheckPokerusTrick
callba CheckPhoneCall
ret c
@ -529,7 +529,7 @@ Function9693a: ; 9693a
xor a
ret
.elevator
.end_bug_contest
ld a, BANK(BugCatchingContestOverScript)
ld hl, BugCatchingContestOverScript
call CallScript
@ -537,7 +537,7 @@ Function9693a: ; 9693a
ret
; 96970
Function96970: ; 96970
.unused ; 96970
ld a, 8
scf
ret
@ -856,7 +856,7 @@ PlayerMovement: ; 96af0
; 96b10
.seven ; 96b10
call Function968d7 ; empty
call ret_968d7 ; mobile
xor a
ld c, a
ret
@ -898,7 +898,7 @@ PlayerMovement: ; 96af0
CheckMenuOW: ; 96b30
xor a
ld [$ffa0], a
ld [hMenuReturn], a
ld [$ffa1], a
ld a, [hJoyPressed]
@ -940,9 +940,9 @@ SelectMenuScript: ; 96b5f
StartMenuCallback:
SelectMenuCallback: ; 96b66
copybytetovar $ffa0
if_equal %10000000, .Script
if_equal -1, .Asm
copybytetovar hMenuReturn
if_equal HMENURETURN_SCRIPT, .Script
if_equal HMENURETURN_ASM, .Asm
end
; 96b72
@ -957,75 +957,85 @@ SelectMenuCallback: ; 96b66
CountStep: ; 96b79
ld a, [InLinkBattle]
; Don't count steps in link communication rooms.
ld a, [wLinkMode]
and a
jr nz, .done
callba Function90136
jr c, .setminus1
; If there is a special phone call, don't count the step.
callba CheckSpecialPhoneCall
jr c, .doscript
call Function96bd7
jr c, .setminus1
; If Repel wore off, don't count the step.
call DoRepelStep
jr c, .doscript
; Count the step for poison and total steps
ld hl, PoisonStepCount
inc [hl]
ld hl, StepCount
inc [hl]
jr nz, .asm_96b9c
; Every 256 steps, increase the happiness of all your Pokemon.
jr nz, .skip_happiness
callba StepHappiness
.asm_96b9c
.skip_happiness
; Every 256 steps, offset from the happiness incrementor by 128 steps,
; decrease the hatch counter of all your eggs until you reach the first
; one that is ready to hatch.
ld a, [StepCount]
cp $80
jr nz, .asm_96bab
jr nz, .skip_egg
callba Function16f3e
jr nz, .set8
callba DoEggStep
jr nz, .hatch
.asm_96bab
.skip_egg
; Increase the EXP of (both) DayCare Pokemon by 1.
callba DaycareStep
; Every four steps, deal damage to all Poisoned Pokemon
ld hl, PoisonStepCount
ld a, [hl]
cp 4
jr c, .poisoned
jr c, .skip_poison
ld [hl], 0
callba Function505da
jr c, .setminus1
callba DoPoisonStep
jr c, .doscript
.poisoned
callba Function97db3
.skip_poison
callba DoBikeStep
.done
xor a
ret
.setminus1
.doscript
ld a, -1
scf
ret
.set8
.hatch
ld a, 8
scf
ret
; 96bd3
Function96bd3: ; 96bd3
.unreferenced: ; 96bd3
ld a, 7
scf
ret
; 96bd7
Function96bd7: ; 96bd7
ld a, [wdca1]
DoRepelStep: ; 96bd7
ld a, [wRepelEffect]
and a
ret z
dec a
ld [wdca1], a
ld [wRepelEffect], a
ret nz
ld a, BANK(RepelWoreOffScript)
ld hl, RepelWoreOffScript
@ -1034,11 +1044,11 @@ Function96bd7: ; 96bd7
ret
; 96beb
Function96beb: ; 96beb
DoPlayerEvent: ; 96beb
ld a, [ScriptRunning]
and a
ret z
cp -1
cp -1 ; run script
ret z
cp 10
ret nc
@ -1059,17 +1069,17 @@ endr
; 96c0c
ScriptPointers96c0c: ; 96c0c
dbw BANK(Invalid_0x96c2d), Invalid_0x96c2d
dbw BANK(SeenByTrainerScript), SeenByTrainerScript
dbw BANK(TalkToTrainerScript), TalkToTrainerScript
dbw BANK(FindItemInBallScript), FindItemInBallScript
dbw BANK(UnknownScript_0x96c4d), UnknownScript_0x96c4d
dbw BANK(WarpToNewMapScript), WarpToNewMapScript
dbw BANK(FallIntoMapScript), FallIntoMapScript
dbw BANK(UnknownScript_0x124c8), UnknownScript_0x124c8
dbw BANK(HatchEggScript), HatchEggScript
dbw BANK(UnknownScript_0x96c4f), UnknownScript_0x96c4f
dbw BANK(Invalid_0x96c2d), Invalid_0x96c2d
dba Invalid_0x96c2d
dba SeenByTrainerScript
dba TalkToTrainerScript
dba FindItemInBallScript
dba UnknownScript_0x96c4d
dba WarpToNewMapScript
dba FallIntoMapScript
dba UnknownScript_0x124c8
dba HatchEggScript
dba UnknownScript_0x96c4f
dba Invalid_0x96c2d
; 96c2d
Invalid_0x96c2d: ; 96c2d
@ -1087,16 +1097,16 @@ HatchEggScript: ; 96c2f
WarpToNewMapScript: ; 96c34
warpsound
newloadmap $f5
newloadmap MAPSETUP_05
end
; 96c38
FallIntoMapScript: ; 96c38
newloadmap $f6
newloadmap MAPSETUP_06
playsound SFX_KINESIS
applymovement PLAYER, MovementData_0x96c48
playsound SFX_STRENGTH
scall UnknownScript_0x96c4a
scall LandAfterPitfallScript
end
; 96c48
@ -1105,7 +1115,7 @@ MovementData_0x96c48: ; 96c48
step_end
; 96c4a
UnknownScript_0x96c4a: ; 96c4a
LandAfterPitfallScript: ; 96c4a
earthquake 16
end
; 96c4d

View File

@ -8,33 +8,39 @@ WarpToSpawnPoint:: ; 97c28
ret
; 97c30
Function97c30:: ; 97c30
ld a, [wd45c]
RunMemScript:: ; 97c30
; If there is no script here, we don't need to be here.
ld a, [wMapReentryScriptQueueFlag]
and a
ret z
ld hl, wd45c + 2
; Execute the script at (wMapReentryScriptBank):(wMapReentryScriptAddress).
ld hl, wMapReentryScriptAddress
ld a, [hli]
ld h, [hl]
ld l, a
ld a, [wd45c + 1]
ld a, [wMapReentryScriptBank]
call CallScript
scf
; Clear the buffer for the next script.
push af
xor a
ld hl, wd45c
ld hl, wMapReentryScriptQueueFlag
ld bc, 8
call ByteFill
pop af
ret
; 97c4f
Function97c4f:: ; 97c4f
ld hl, wd45c
LoadScriptBDE:: ; 97c4f
; If there's already a script here, don't overwrite.
ld hl, wMapReentryScriptQueueFlag
ld a, [hl]
and a
ret nz
; Set the flag
ld [hl], 1
inc hl
; Load the script pointer b:de into (wMapReentryScriptBank):(wMapReentryScriptAddress)
ld [hl], b
inc hl
ld [hl], e
@ -262,46 +268,60 @@ ContestMons: ; 97d87
db -1, VENOMOTH, 30, 40
; 97db3
Function97db3:: ; 97db3
DoBikeStep:: ; 97db3
nop
nop
; fallthrough
; 97db5
Function97db5: ; 97db5
; If the bike shop owner doesn't have our number, or
; if we've already gotten the call, we don't have to
; be here.
ld hl, StatusFlags2
bit 4, [hl]
jr z, .NoCall
; If we're not on the bike, we don't have to be here.
ld a, [PlayerState]
cp 1
cp PLAYER_BIKE
jr nz, .NoCall
; If we're not in an area of phone service, we don't
; have to be here.
call GetMapHeaderPhoneServiceNybble
and a
jr nz, .NoCall
ld hl, wdca1 + 1
; Check the bike step count and check whether we've
; taken 65536 of them yet.
ld hl, wBikeStep
ld a, [hli]
ld d, a
ld e, [hl]
cp -1
jr nz, .asm_97dd8
cp 255
jr nz, .increment
ld a, e
cp -1
jr z, .asm_97ddc
cp 255
jr z, .dont_increment
.asm_97dd8
.increment
inc de
ld [hl], e
dec hl
ld [hl], d
.asm_97ddc
.dont_increment
; If we've taken at least 1024 steps, have the bike
; shop owner try to call us.
ld a, d
cp $4
cp 1024 >> 8
jr c, .NoCall
; If a call has already been queued, don't overwrite
; that call.
ld a, [wSpecialPhoneCallID]
and a
jr nz, .NoCall
ld a, 6
; Queue the call.
ld a, SPECIALCALL_BIKESHOP
ld [wSpecialPhoneCallID], a
xor a
ld [wSpecialPhoneCallID + 1], a
@ -488,7 +508,7 @@ Function97eb7: ; 97eb7
; 97eb8
Function97eb8: ; 97eb8
call Function2f3e
call ret_2f3e
ret
; 97ebc

View File

@ -58,7 +58,7 @@ CheckFruitTree: ; 44055
; 4405f
PickedFruitTree: ; 4405f
callba Function10609b ; empty function
callba MobileFn_10609b ; empty function
ld b, 1
jp GetFruitTreeFlag
; 4406a

View File

@ -2196,7 +2196,7 @@ Function4ecd: ; 4ecd
add hl, bc
ld a, [hl]
ld b, a
callba Function807e
callba CopyDECoordsToMapObject
pop bc
ld hl, OBJECT_FLAGS
add hl, bc
@ -3064,7 +3064,7 @@ Function579d: ; 579d
; 57bc
Function57bc: ; 57bc
ld hl, wd45b
ld hl, wPlayerSpriteSetupFlags
bit 7, [hl]
jr nz, .ok
ret
@ -3076,10 +3076,10 @@ Function57bc: ; 57bc
; 57ca
Function57ca: ; 57ca
ld hl, wd45b
ld hl, wPlayerSpriteSetupFlags
bit 5, [hl]
ret z
ld a, [wd45b]
ld a, [wPlayerSpriteSetupFlags]
and 3
rept 2
add a
@ -3137,7 +3137,7 @@ Function5803:: ; 5803
Function5815: ; 5815
call Function18de
ret c
ld a, [$ffb0]
ld a, [hConnectedMapWidth]
ld [wd4cd], a
ret
; 581f
@ -3166,7 +3166,7 @@ Function582c: ; 582c
ld hl, OBJECT_09
add hl, bc
ld [hl], 0
ld a, [$ffb0]
ld a, [hConnectedMapWidth]
ld [wd4ce], a
ret
; 5847

View File

@ -31,57 +31,6 @@ MapSetupScripts: ; 15377
dw MapSetupScript12
; 1538f
; Command descriptions from Condensation water's scripting compendium.
const_def
const map_lcd_on ; 00 = Turn LCD on
const map_lcd_off ; 01 = Turn LCD off
const map_sound_off ; 02 = Turn speakers off
const map_music ; 03 = Music check for current map/ special check for bug catcher contest
const map_start_music ; 04 = Start map music anew
const map_fade_music ; 05 = Music check for current map / special check for Bug Contest/ music with FadeOut (old) and FadeIn
const map_fade ; 06 = Fade out music + screen
const map_bike_music ; 07 = If HIRO is on bike = bike music, else play map music
const map_music_force ; 08 = Play map music
const map_max_volume ; 09 = Turn music to highest volume
const map_load_blocks ; 0A = Write map data to MapRAM
const map_connection_blocks ; 0B = Compute maps connection pars and write into MapRAM
const map_save_screen ; 0C = Write current part of map into temporary memory
const map_buffer_screen ; 0D = Write current part of map into read-from memory
const map_load_graphics ; 0E = Write tileset header to ram/ load tileset/ load sprite tiles/ load special tiles
const map_load_tileset_header ; 0F = Write tileset header to ram
const map_time_of_day ; 10 = Compute time of day/ Update screen
const map_palettes ; 11 = Load map palettes
const map_wildmons ; 12 = Load probabilities for wild Pokémon battles
const map_sprites ; 13 = Delete sprite data and draw new sprites
const map_change_callback ; 14 = Check 2nd script header for 05 and 03 callbacks
const map_start_callback ; 15 = Check 2nd script header for 03 callbacks
const map_load_objects ; 16 = Analyze people data anew and check 2nd script header for 02 callbacks
const map_load_spawn ; 17 = Writes arrival data for arrival by flying/Blackout from table 05:5319 to ram
const map_load_connection ; 18 = Writes arrival data for entering a map by connection to ram
const map_load_warp ; 19 = Write warp data to ram when entering warp
const map_attributes ; 1A = Load complete map data (primary, secondary, event, script headers)
const map_attributes_2 ; 1B = Same as 1A, but some settings arent loaded new from the rom, such as hide function of the people events
const map_clear_bg_palettes ; 1C = Fill palette data with FFFF (=white)
const map_fade_out_palettes ; 1D = All BG pallet color are converted to 0|0 (Pal0, Col0), all sprite colors to x|0 (FadeOut)
const map_fade_in_palettes ; 1E = Palette FadeIn
const map_anchor_screen ; 1F = Compute position of upper left-most block visible on screen
const map_warp_face ; 20 = Position computation when HIRO leaves a warp
const map_face_down ; 21 = Set HIROs facing to “down”
const map_spawn_coord ; 22 = Prepare HIRO data for arrival by flight
const map_player_coord ; 23 = Compute HIRO x/y data anew
const map_prolong_sprites ; 24 = Prolong old sprites before removing them
const map_delay_sprites ; 25 = Delay rendering new sprites
const map_update_roam ; 26 = Compute chances to meet Raikou, Entei or Suicune
const map_keep_roam ; 27 = Recover chances to meet Raikou, Entei or Suicune
const map_fade_out_music ; 28 = Temporarily stop music playing
const map_animations_on ; 29 = Activate animations
const map_animations_off ; 2A = Deactivate animations
const map_keep_palettes ; 2B = Recover all palettes
const map_text_scroll_off ; 2C = Turn off text scroll (for town name overlays)
const map_stop_script ; 2D = Deactivate code prolonging
MapSetupScript4: ; 1538f
db map_prolong_sprites
@ -112,7 +61,7 @@ MapSetupScript1: ; 15392
db map_fade_in_palettes
db map_animations_on
db map_wildmons
db -1
db map_end_setup_script
MapSetupScript11: ; 153a9
db map_load_spawn
@ -136,7 +85,7 @@ MapSetupScript11: ; 153a9
db map_fade_in_palettes
db map_animations_on
db map_wildmons
db -1
db map_end_setup_script
MapSetupScript7: ; 153bf
db map_animations_off
@ -155,7 +104,7 @@ MapSetupScript7: ; 153bf
db map_wildmons
db map_update_roam
db map_animations_on
db -1
db map_end_setup_script
MapSetupScript6: ; 153d0
db map_prolong_sprites
@ -184,7 +133,7 @@ MapSetupScript9: ; 153d2
db map_animations_on
db map_wildmons
db map_update_roam
db -1
db map_end_setup_script
MapSetupScript3: ; 153e7
db map_fade
@ -202,7 +151,7 @@ MapSetupScript3: ; 153e7
db map_fade_in_palettes
db map_animations_on
db map_wildmons
db -1
db map_end_setup_script
MapSetupScript8: ; 153f7
db map_fade
@ -221,7 +170,7 @@ MapSetupScript8: ; 153f7
db map_animations_on
db map_wildmons
db map_text_scroll_off
db -1
db map_end_setup_script
MapSetupScript2: ; 15408
db map_lcd_off
@ -241,12 +190,12 @@ MapSetupScript2: ; 15408
db map_fade_in_palettes
db map_animations_on
db map_wildmons
db -1
db map_end_setup_script
MapSetupScript10: ; 1541a
db map_load_blocks
db map_connection_blocks
db -1
db map_end_setup_script
ReadMapSetupScript: ; 1541d
@ -374,13 +323,13 @@ Function154ea: ; 154ea
; 154eb
DelayClearingOldSprites: ; 154eb
ld hl, wd45b
ld hl, wPlayerSpriteSetupFlags
set 7, [hl]
ret
; 154f1
DelayLoadingNewSprites: ; 154f1
ld hl, wd45b
ld hl, wPlayerSpriteSetupFlags
set 6, [hl]
ret

View File

@ -1656,5 +1656,5 @@ UnknownScript_0xa0b04:
BikeShopPhoneScript:
farwritetext UnknownText_0x174000
clearflag ENGINE_BIKE_SHOP_CALL_ENABLED
specialphonecall ELMCALL_NONE
specialphonecall SPECIALCALL_NONE
end

File diff suppressed because it is too large Load Diff

884
engine/phone.asm Normal file
View File

@ -0,0 +1,884 @@
AddPhoneNumber:: ; 90000
call _CheckCellNum
jr c, .cant_add
call Phone_FindOpenSlot
jr nc, .cant_add
ld [hl], c
xor a
ret
.cant_add
scf
ret
; 9000f
DelCellNum:: ; 9000f
call _CheckCellNum
jr nc, .not_in_list
xor a
ld [hl], a
ret
.not_in_list
scf
ret
; 90019
CheckCellNum:: ; 90019
jp _CheckCellNum ; wtf
; 9001c
_CheckCellNum: ; 9001c
ld hl, wPhoneList
ld b, CONTACT_LIST_SIZE
.loop
ld a, [hli]
cp c
jr z, .got_it
dec b
jr nz, .loop
xor a
ret
.got_it
dec hl
scf
ret
; 9002d
Phone_FindOpenSlot: ; 9002d
call GetRemainingSpaceInPhoneList
ld b, a
ld hl, wPhoneList
.loop
ld a, [hli]
and a
jr z, .FoundOpenSpace
dec b
jr nz, .loop
xor a
ret
.FoundOpenSpace
dec hl
scf
ret
; 90040
GetRemainingSpaceInPhoneList: ; 90040
xor a
ld [Buffer1], a
ld hl, PermanentNumbers
.loop
ld a, [hli]
cp -1
jr z, .done
cp c
jr z, .elm_or_mom
push bc
push hl
ld c, a
call _CheckCellNum
jr c, .elm_or_mom_in_list
ld hl, Buffer1
inc [hl]
.elm_or_mom_in_list
pop hl
pop bc
.elm_or_mom
jr .loop
.done
ld a, CONTACT_LIST_SIZE
ld hl, Buffer1
sub [hl]
ret
; 90066
PermanentNumbers: ; 90066
db PHONECONTACT_MOM, PHONECONTACT_ELM, -1
; 90069
FarPlaceString: ; 90069
ld a, [hROMBank]
push af
ld a, b
rst Bankswitch
call PlaceString
pop af
rst Bankswitch
ret
; 90074
CheckPhoneCall:: ; 90074 (24:4074)
; Check if the phone is ringing in the overworld.
call CheckStandingOnEntrance
jr z, .no_call
call .timecheck
nop
jr nc, .no_call
call Random
ld b, a
and 50 percent
cp b
jr nz, .no_call
call GetMapHeaderPhoneServiceNybble
and a
jr nz, .no_call
call GetAvailableCallers
call ChooseRandomCaller
jr nc, .no_call
ld e, a
call LoadCallerScript
ld a, BANK(Script_ReceivePhoneCall)
ld hl, Script_ReceivePhoneCall
call CallScript
scf
ret
.no_call
xor a
ret
.timecheck: ; 900a6 (24:40a6)
callba CheckReceiveCallTimer
ret
CheckPhoneContactTimeOfDay: ; 900ad (24:40ad)
push hl
push bc
push de
push af
callba CheckTime
pop af
and (1 << MORN) + (1 << DAY) + (1 << NITE)
and c
pop de
pop bc
pop hl
ret
ChooseRandomCaller: ; 900bf (24:40bf)
; If no one is available to call, don't return anything.
ld a, [EngineBuffer3]
and a
jr z, .NothingToSample
; Sample a random number between 0 and 31.
ld c, a
call Random
ld a, [hRandomAdd] ; $ff00+$e1
swap a
and $1f
; Compute that number modulo the number of available callers.
call SimpleDivide
; Return the caller ID you just sampled.
ld c, a
ld b, 0
ld hl, EngineBuffer4
add hl, bc
ld a, [hl]
scf
ret
.NothingToSample
xor a
ret
GetAvailableCallers: ; 900de (24:40de)
callba CheckTime
ld a, c
ld [EngineBuffer1], a ; wd03e (aliases: MenuItemsList, CurFruitTree, CurInput)
ld hl, EngineBuffer3
ld bc, 11
xor a
call ByteFill
ld de, wPhoneList
ld a, CONTACT_LIST_SIZE
.loop
ld [EngineBuffer2], a
ld a, [de]
and a
jr z, .not_good_for_call
ld hl, PhoneContacts + PHONE_CONTACT_SCRIPT2_TIME
ld bc, PHONE_TABLE_WIDTH
call AddNTimes
ld a, [EngineBuffer1] ; wd03e (aliases: MenuItemsList, CurFruitTree, CurInput)
and [hl]
jr z, .not_good_for_call
ld bc, PHONE_CONTACT_MAP_GROUP - PHONE_CONTACT_SCRIPT2_TIME
add hl, bc
ld a, [MapGroup]
cp [hl]
jr nz, .different_map
inc hl
ld a, [MapNumber]
cp [hl]
jr z, .not_good_for_call
.different_map
ld a, [EngineBuffer3]
ld c, a
ld b, $0
inc a
ld [EngineBuffer3], a
ld hl, EngineBuffer4
add hl, bc
ld a, [de]
ld [hl], a
.not_good_for_call
inc de
ld a, [EngineBuffer2]
dec a
jr nz, .loop
ret
CheckSpecialPhoneCall:: ; 90136 (24:4136)
ld a, [wSpecialPhoneCallID]
and a
jr z, .NoPhoneCall
dec a
ld c, a
ld b, 0
ld hl, SpecialPhoneCallList
ld a, 6
call AddNTimes
ld a, [hli]
ld h, [hl]
ld l, a
call _hl_
jr nc, .NoPhoneCall
call .DoSpecialPhoneCall
rept 2
inc hl
endr
ld a, [hli]
ld e, a
push hl
call LoadCallerScript
pop hl
ld de, wd048
ld a, [hli]
ld [de], a
inc de
ld a, [hli]
ld [de], a
inc de
ld a, [hli]
ld [de], a
ld a, BANK(.script)
ld hl, .script
call CallScript
scf
ret
.NoPhoneCall
xor a
ret
; 90173 (24:4173)
.script: ; 0x90173
pause 30
jump Script_ReceivePhoneCall
; 0x90178
.DoSpecialPhoneCall: ; 90178 (24:4178)
ld a, [wSpecialPhoneCallID]
dec a
ld c, a
ld b, 0
ld hl, SpecialPhoneCallList
ld a, 6
call AddNTimes
ret
SpecialCallOnlyWhenOutside: ; 90188
ld a, [wPermission]
cp TOWN
jr z, .outside
cp ROUTE
jr z, .outside
xor a
ret
.outside
scf
ret
SpecialCallWhereverYouAre: ; 90197
scf
ret
Function90199: ; 90199 (24:4199)
; Don't do the call if you're in a link communication
ld a, [wLinkMode]
and a
jr nz, .OutOfArea
; If you're in an area without phone service, don't do the call
call GetMapHeaderPhoneServiceNybble
and a
jr nz, .OutOfArea
; If the person can't take a call at that time, don't do the call
ld a, b
ld [wCurrentCaller], a
ld hl, PhoneContacts
ld bc, PHONE_TABLE_WIDTH
call AddNTimes
ld d, h
ld e, l
ld hl, PHONE_CONTACT_SCRIPT1_TIME
add hl, de
ld a, [hl]
call CheckPhoneContactTimeOfDay
jr z, .OutOfArea
; If we're in the same map as the person we're calling,
; use the "Just talk to that person" script.
ld hl, PHONE_CONTACT_MAP_GROUP
add hl, de
ld a, [MapGroup]
cp [hl]
jr nz, .GetPhoneScript
ld hl, PHONE_CONTACT_MAP_NUMBER
add hl, de
ld a, [MapNumber]
cp [hl]
jr nz, .GetPhoneScript
ld b, BANK(PhoneScript_JustTalkToThem)
ld hl, PhoneScript_JustTalkToThem
jr .DoPhoneCall
.GetPhoneScript
ld hl, PHONE_CONTACT_SCRIPT1_BANK
add hl, de
ld b, [hl]
ld hl, PHONE_CONTACT_SCRIPT1_ADDR_LO
add hl, de
ld a, [hli]
ld h, [hl]
ld l, a
jr .DoPhoneCall
.OutOfArea
ld b, BANK(UnknownScript_0x90209)
ld de, UnknownScript_0x90209
call ExecuteCallbackScript
ret
.DoPhoneCall
ld a, b
ld [wd002], a
ld a, l
ld [wd003], a
ld a, h
ld [wd004], a
ld b, BANK(UnknownScript_0x90205)
ld de, UnknownScript_0x90205
call ExecuteCallbackScript
ret
; 90205 (24:4205)
UnknownScript_0x90205: ; 0x90205
ptcall wd002
return
; 0x90209
UnknownScript_0x90209: ; 0x90209
scall UnknownScript_0x90657
return
; 0x9020d
LoadCallerScript: ; 9020d (24:420d)
nop
nop
ld a, e
ld [wCurrentCaller], a
and a
jr nz, .actualcaller
ld a, BANK(WrongNumber)
ld hl, WrongNumber
jr .proceed
.actualcaller
ld hl, PhoneContacts
ld bc, 12
ld a, e
call AddNTimes
ld a, BANK(PhoneContacts)
.proceed
ld de, EngineBuffer2
ld bc, 12
call FarCopyBytes
ret
; 90233 (24:4233)
WrongNumber: ; 90233
db TRAINER_NONE, PHONE_00
dba .script
.script:
writetext .text
end
.text:
; Huh? Sorry, wrong number!
text_jump UnknownText_0x1c5565
db "@"
; 90241
Script_ReceivePhoneCall: ; 0x90241
refreshscreen $0
callasm RingTwice_StartCall
ptcall wd048
closetext
callasm HangUp
loadmovesprites
callasm InitCallReceiveDelay
end
; 0x90255
Script_SpecialBillCall:: ; 0x90255
callasm Function9025c
jump Script_ReceivePhoneCall
; 0x9025c
Function9025c: ; 9025c
ld e, PHONE_BILL
jp LoadCallerScript
; 90261
UnknownScript_0x90261: ; 0x90261
callasm Function9026a
pause 30
jump Script_ReceivePhoneCall
; 0x9026a
Function9026a: ; 9026a
ld e, PHONE_ELM
jp LoadCallerScript
; 9026f
RingTwice_StartCall: ; 9026f
call .Ring
call .Ring
callba MobileFn_1060d3
ret
; 9027c
.Ring: ; 9027c (24:427c)
call Phone_StartRinging
call Phone_Wait20Frames
call Phone_CallerTextboxWithName
call Phone_Wait20Frames
call Phone_CallerTextbox
call Phone_Wait20Frames
call Phone_CallerTextboxWithName
ret
Phone_CallerTextboxWithName: ; 90292 (24:4292)
ld a, [wCurrentCaller]
ld b, a
call Function90363
ret
PhoneCall:: ; 9029a
ld a, b
ld [PhoneScriptBank], a
ld a, e
ld [PhoneCallerLo], a
ld a, d
ld [PhoneCallerHi], a
call Phone_FirstOfTwoRings
call Phone_FirstOfTwoRings
callba MobileFn_1060d3
ret
; 902b3
Phone_FirstOfTwoRings: ; 902b3
call Phone_StartRinging
call Phone_Wait20Frames
call Phone_CallerTextboxWithName2
call Phone_Wait20Frames
call Phone_CallerTextbox
call Phone_Wait20Frames
call Phone_CallerTextboxWithName2
ret
; 902c9
Phone_CallerTextboxWithName2: ; 902c9
call Phone_CallerTextbox
hlcoord 1, 2
ld [hl], $62
rept 2
inc hl
endr
ld a, [PhoneScriptBank]
ld b, a
ld a, [PhoneCallerLo]
ld e, a
ld a, [PhoneCallerHi]
ld d, a
call FarPlaceString
ret
; 902e3
Phone_NoSignal: ; 902e3 (24:42e3)
ld de, SFX_NO_SIGNAL
call PlaySFX
jr Phone_CallEnd
HangUp:: ; 902eb
call HangUp_Beep
call HangUp_Wait20Frames
Phone_CallEnd:
call HangUp_BoopOn
call HangUp_Wait20Frames
call HangUp_BoopOff
call HangUp_Wait20Frames
call HangUp_BoopOn
call HangUp_Wait20Frames
call HangUp_BoopOff
call HangUp_Wait20Frames
call HangUp_BoopOn
call HangUp_Wait20Frames
call HangUp_BoopOff
call HangUp_Wait20Frames
ret
; 90316
Function90316: ; 90316
ld de, SFX_SHUT_DOWN_PC
call PlaySFX
ret
; 9031d
HangUp_Beep: ; 9031d
ld hl, UnknownText_0x9032a
call PrintText
ld de, SFX_HANG_UP
call PlaySFX
ret
; 9032a
UnknownText_0x9032a: ; 9032a
text_jump UnknownText_0x1c5580
db "@"
; 9032f
HangUp_BoopOn: ; 9032f
ld hl, UnknownText_0x90336
call PrintText
ret
; 90336
UnknownText_0x90336: ; 0x90336
text_jump UnknownText_0x1c5588
db "@"
; 0x9033b
HangUp_BoopOff: ; 9033b
call SpeechTextBox
ret
; 9033f
Phone_StartRinging: ; 9033f
call WaitSFX
ld de, SFX_CALL
call PlaySFX
call Phone_CallerTextbox
call UpdateSprites
callba Function4d188
ret
; 90355
HangUp_Wait20Frames: ; 90355
jr Phone_Wait20Frames
Phone_Wait20Frames
ld c, 20
call DelayFrames
callba Function4d188
ret
; 90363
Function90363: ; 90363 (24:4363)
push bc
call Phone_CallerTextbox
hlcoord 1, 1
ld [hl], $62
rept 2
inc hl
endr
ld d, h
ld e, l
pop bc
call Function90380
ret
Phone_CallerTextbox: ; 90375
hlcoord 0, 0
ld b, 2
ld c, SCREEN_WIDTH - 2
call TextBox
ret
; 90380
Function90380: ; 90380 (24:4380)
ld h, d
ld l, e
ld a, b
call GetCallerTrainerClass
call GetCallerName
ret
Function9038a: ; 9038a (24:438a)
ld a, c
call GetCallerTrainerClass
ld a, c
ret nz
ld a, b
cp $1
ret z
cp $4
ret z
ld c, $1
ret
GetCallerTrainerClass: ; 9039a
push hl
ld hl, PhoneContacts + PHONE_CONTACT_TRAINER_CLASS
ld bc, PHONE_TABLE_WIDTH
call AddNTimes
ld a, [hli]
ld b, [hl]
ld c, a
pop hl
ret
; 903a9
GetCallerName: ; 903a9 (24:43a9)
ld a, c
and a
jr z, .NotTrainer
call Phone_GetTrainerName
push hl
push bc
call PlaceString
ld a, ":"
ld [bc], a
pop bc
pop hl
ld de, SCREEN_WIDTH + 3
add hl, de
call Phone_GetTrainerClassName
call PlaceString
ret
.NotTrainer
push hl
ld c, b
ld b, 0
ld hl, NonTrainerCallerNames
rept 2
add hl, bc
endr
ld a, [hli]
ld e, a
ld d, [hl]
pop hl
call PlaceString
ret
; 903d6 (24:43d6)
NonTrainerCallerNames: ; 903d6
dw .none
dw .mom
dw .bikeshop
dw .bill
dw .elm
dw .buena
.none: db "----------@"
.mom: db "MOM:@"
.bill: db "BILL:@"
.elm: db "PROF.ELM:@"
.bikeshop: db "BIKE SHOP:@"
.buena: db "BUENA:", $22, " DISC JOCKEY@"
; 90423
Phone_GetTrainerName: ; 90423 (24:4423)
push hl
push bc
callba GetTrainerName
pop bc
pop hl
ret
Phone_GetTrainerClassName: ; 9042e (24:442e)
push hl
push bc
callba GetTrainerClassName
pop bc
pop hl
ret
GetCallerLocation: ; 90439
ld a, [wCurrentCaller]
call GetCallerTrainerClass
ld d, c
ld e, b
push de
ld a, [wCurrentCaller]
ld hl, PhoneContacts + PHONE_CONTACT_MAP_GROUP
ld bc, PHONE_TABLE_WIDTH
call AddNTimes
ld b, [hl]
inc hl
ld c, [hl]
push bc
call GetWorldMapLocation
ld e, a
callba GetLandmarkName
pop bc
pop de
ret
; 9045f
PhoneContacts: ; 9045f
phone: MACRO
db \1, \2 ; trainer
map \3 ; map
db \4
dba \5 ; script 1
db \6
dba \7 ; script 2
ENDM
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 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
phone COOLTRAINERF, REENA1, ROUTE_27, 7, ReenaPhoneScript1, 7, ReenaPhoneScript2
phone YOUNGSTER, JOEY1, ROUTE_30, 7, JoeyPhoneScript1, 7, JoeyPhoneScript2
phone BUG_CATCHER, WADE1, ROUTE_31, 7, WadePhoneScript1, 7, WadePhoneScript2
phone FISHER, RALPH1, ROUTE_32, 7, RalphPhoneScript1, 7, RalphPhoneScript2
phone PICNICKER, LIZ1, ROUTE_32, 7, LizPhoneScript1, 7, LizPhoneScript2
phone HIKER, ANTHONY2, ROUTE_33, 7, AnthonyPhoneScript1, 7, AnthonyPhoneScript2
phone CAMPER, TODD1, ROUTE_34, 7, ToddPhoneScript1, 7, ToddPhoneScript2
phone PICNICKER, GINA1, ROUTE_34, 7, GinaPhoneScript1, 7, GinaPhoneScript2
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 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
phone FISHER, TULLY1, ROUTE_42, 7, TullyPhoneScript1, 7, TullyPhoneScript2
phone POKEMANIAC, BRENT1, ROUTE_43, 7, BrentPhoneScript1, 7, BrentPhoneScript2
phone PICNICKER, TIFFANY3, ROUTE_43, 7, TiffanyPhoneScript1, 7, TiffanyPhoneScript2
phone BIRD_KEEPER, VANCE1, ROUTE_44, 7, VancePhoneScript1, 7, VancePhoneScript2
phone FISHER, WILTON1, ROUTE_44, 7, WiltonPhoneScript1, 7, WiltonPhoneScript2
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 TRAINER_NONE, PHONECONTACT_BUENA, GOLDENROD_DEPT_STORE_ROOF, 7, BuenaPhoneScript1, 7, BuenaPhoneScript2
; 90627
SpecialPhoneCallList: ; 90627
dw SpecialCallOnlyWhenOutside
db PHONE_ELM
dba ElmPhoneScript2
dw SpecialCallOnlyWhenOutside
db PHONE_ELM
dba ElmPhoneScript2
dw SpecialCallOnlyWhenOutside
db PHONE_ELM
dba ElmPhoneScript2
dw SpecialCallOnlyWhenOutside
db PHONE_ELM
dba ElmPhoneScript2
dw SpecialCallWhereverYouAre
db PHONE_ELM
dba ElmPhoneScript2
dw SpecialCallWhereverYouAre
db PHONE_OAK ; ????????
dba BikeShopPhoneScript ; bike shop
dw SpecialCallWhereverYouAre
db PHONE_MOM
dba MomPhoneLectureScript
dw SpecialCallOnlyWhenOutside
db PHONE_ELM
dba ElmPhoneScript2
; 90657
UnknownScript_0x90657: ; 0x90657
writetext UnknownText_0x9065b
end
; 0x9065b
UnknownText_0x9065b: ; 0x9065b
; That number is out of the area.
text_jump UnknownText_0x1c558b
db "@"
; 0x90660
PhoneScript_JustTalkToThem: ; 0x90660
writetext UnknownText_0x90664
end
; 0x90664
UnknownText_0x90664: ; 0x90664
; Just go talk to that person!
text_jump UnknownText_0x1c55ac
db "@"
; 0x90669
UnknownScript_0x90669: ; 0x90669
writetext UnknownText_0x9066d
end
; 0x9066d
UnknownText_0x9066d: ; 0x9066d
; Thank you!
text_jump UnknownText_0x1c55ca
db "@"
; 0x90672

View File

@ -141,7 +141,7 @@ MomPhoneNoGymQuestScript: ; 0xbcfac
MomPhoneLectureScript: ; 0xbcfb1
setevent EVENT_TALKED_TO_MOM_AFTER_MYSTERY_EGG_QUEST
setflag ENGINE_DST
specialphonecall ELMCALL_NONE
specialphonecall SPECIALCALL_NONE
farwritetext MomPhoneLectureText
yesorno
iftrue MomPhoneSaveMoneyScript
@ -194,7 +194,7 @@ BillPhoneScript2: ; 0xbd007
; Elm
ElmPhoneScript1: ; 0xbd00d
checkcode VAR_POKERUS
checkcode VAR_SPECIALPHONECALL
if_equal $1, .pokerus
checkevent EVENT_SHOWED_TOGEPI_TO_ELM
iftrue .discovery
@ -253,46 +253,46 @@ ElmPhoneScript1: ; 0xbd00d
.pokerus ; 0xbd079
farwritetext ElmPhonePokerusText
specialphonecall ELMCALL_NONE
specialphonecall SPECIALCALL_NONE
end
ElmPhoneScript2: ; 0xbd081
checkcode VAR_POKERUS
checkcode VAR_SPECIALPHONECALL
if_equal $2, .disaster
if_equal $3, .assistant
if_equal $4, .rocket
if_equal $5, .gift
if_equal $8, .gift
farwritetext ElmPhonePokerusText
specialphonecall ELMCALL_NONE
specialphonecall SPECIALCALL_NONE
end
.disaster ; 0xbd09f
farwritetext ElmPhoneDisasterText
specialphonecall ELMCALL_NONE
specialphonecall SPECIALCALL_NONE
setevent EVENT_ELM_CALLED_ABOUT_STOLEN_POKEMON
end
.assistant ; 0xbd0aa
farwritetext ElmPhoneEggAssistantText
specialphonecall ELMCALL_NONE
specialphonecall SPECIALCALL_NONE
clearevent EVENT_ELMS_AIDE_IN_VIOLET_POKEMON_CENTER
setevent EVENT_ELMS_AIDE_IN_LAB
end
.rocket ; 0xbd0b8
farwritetext ElmPhoneRocketText
specialphonecall ELMCALL_NONE
specialphonecall SPECIALCALL_NONE
end
.gift ; 0xbd0c0
farwritetext ElmPhoneGiftText
specialphonecall ELMCALL_NONE
specialphonecall SPECIALCALL_NONE
end
.unused ; 0xbd0c8
farwritetext ElmPhoneUnusedText
specialphonecall ELMCALL_NONE
specialphonecall SPECIALCALL_NONE
end
; bd0d0
@ -833,7 +833,7 @@ UnknownScript_0xbd544:
pokenamemem QWILFISH, $1
displaylocation ROUTE_32, $2
writebyte $1
special Functionc3fc
special Special_ActivateFishingSwarm
farjump UnknownScript_0xa05d6
UnknownScript_0xbd55c:

View File

@ -16,10 +16,10 @@ Pokedex: ; 40000
push af
xor a
ld [VramState], a
ld a, [$ffaa]
ld a, [hInMenu]
push af
ld a, $1
ld [$ffaa], a
ld [hInMenu], a
xor a
ld [$ffde], a
@ -27,8 +27,8 @@ Pokedex: ; 40000
call DelayFrame
.main
call Functiona57
ld a, [wcf63]
call JoyTextDelay
ld a, [wJumptableIndex]
bit 7, a
jr nz, .exit
call Function4010b
@ -44,7 +44,7 @@ Pokedex: ; 40000
ld [wd959], a
pop af
ld [$ffaa], a
ld [hInMenu], a
pop af
ld [VramState], a
pop af
@ -75,7 +75,7 @@ ENDC
call ByteFill
xor a
ld [wcf63], a
ld [wJumptableIndex], a
ld [wcf64], a
ld [wcf65], a
ld [wcf66], a
@ -173,7 +173,7 @@ Function400ed: ; 400ed
; 4010b
Function4010b: ; 4010b
ld a, [wcf63]
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, wcf63
ld hl, wJumptableIndex
inc [hl]
ret
Function40136: ; 40136 (10:4136)
ld hl, wcf63
ld hl, wJumptableIndex
set 7, [hl]
ret
@ -283,7 +283,7 @@ Function401ae: ; 401ae (10:41ae)
call Function40bd0
ret z
ld a, $2
ld [wcf63], 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 [wcf63], 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 [wcf63], 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 [wcf63], 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 [wcf63], 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, wcf63
ld hl, wJumptableIndex
dec [hl]
ret
; 402e8 (10:42e8)
@ -478,11 +478,11 @@ Function4034f: ; 4034f
push af
ld a, [wcf64]
push af
ld a, [wcf63]
ld a, [wJumptableIndex]
push af
callba Function8442c
pop af
ld [wcf63], 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 [wcf63], a
ld [wJumptableIndex], a
ret
; 403f3 (10:43f3)
@ -604,13 +604,13 @@ Function40417: ; 40417 (10:4417)
.asm_40431
call Function41401
ld a, $0
ld [wcf63], a
ld [wJumptableIndex], a
ret
Function4043a: ; 4043a (10:443a)
call Function41401
ld a, $b
ld [wcf63], 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 [wcf63], a
ld [wJumptableIndex], a
ret
; 4049e (10:449e)
@ -710,14 +710,14 @@ Function404b7: ; 404b7
ld [wc7d1], a
call Function41401
ld a, $9
ld [wcf63], a
ld [wJumptableIndex], a
ret
; 40501
Function40501: ; 40501
call Function41401
ld a, $0
ld [wcf63], a
ld [wJumptableIndex], a
ret
; 4050a
@ -779,7 +779,7 @@ Function40562: ; 40562 (10:4562)
call Function40bd0
ret z
ld a, $2
ld [wcf63], 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 [wcf63], 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 [wcf63], a
ld [wJumptableIndex], a
call DelayFrame
call Function41a24
jr nz, .asm_40603
@ -836,7 +836,7 @@ Function405df: ; 405df (10:45df)
.asm_40603
ld hl, PokedexLZ
ld de, $9310
ld de, VTiles2 tile $31
lb bc, BANK(PokedexLZ), $3a
call Functione73
@ -844,7 +844,7 @@ Function405df: ; 405df (10:45df)
ret
Function40610: ; 40610 (10:4610)
ld hl, $ffa9
ld hl, hJoyLast
ld a, [hl]
and D_RIGHT
jr nz, .right
@ -913,7 +913,7 @@ Function4066c: ; 4066c (10:466c)
ld [wc7e2], a
ld a, [wc7d0]
ld [wc7e3], a
ld hl, $ffa9
ld hl, hJoyLast
ld a, [hl]
and D_UP
jr nz, .up
@ -964,7 +964,7 @@ Function406c5: ; 406c5 (10:46c5)
ld d, a
ld a, [wc7d2]
ld e, a
ld hl, $ffa9
ld hl, hJoyLast
ld a, [hl]
and D_UP
jr nz, Function406ea
@ -1799,7 +1799,7 @@ Function40f4f: ; 40f4f (10:4f4f)
ld a, [wc7d8]
cp $2
jr nc, .asm_40f63
ld hl, $ffa9
ld hl, hJoyLast
ld a, [hl]
and $20
jr nz, .asm_40f65
@ -2274,7 +2274,7 @@ Function4135a: ; 4135a (10:535a)
jr nz, .asm_413c1
call Function413f5
jr c, .asm_413bf
ld hl, $ffa9
ld hl, hJoyLast
ld a, [hl]
and D_LEFT | D_UP
and b
@ -2460,7 +2460,7 @@ Function4147b: ; 4147b
push hl
ld e, l
ld d, h
ld hl, $9620
ld hl, VTiles2 tile $62
lb bc, BANK(Footprints), 2
call Request1bpp
pop hl
@ -2472,7 +2472,7 @@ Function4147b: ; 4147b
ld e, l
ld d, h
ld hl, $9640
ld hl, VTiles2 tile $64
lb bc, BANK(Footprints), 2
call Request1bpp
@ -2488,7 +2488,7 @@ Function414b7: ; 414b7
call ByteFill
call Function414fb
call Functione5f
ld hl, $9600
ld hl, VTiles2 tile $60
ld bc, $0200
call Function41504
call Function41a24
@ -2498,7 +2498,7 @@ Function414b7: ; 414b7
.asm_414e0
ld hl, PokedexLZ
ld de, $9310
ld de, VTiles2 tile $31
call Decompress
.asm_414e9
@ -2554,7 +2554,7 @@ Function41a2c: ; 41a2c
ld bc, $1b0
call Function41504
ld de, sScratch + $188
ld hl, $9400
ld hl, VTiles2 tile $40
lb bc, BANK(Function41a2c), $1b
call Request2bpp
call CloseSRAM
@ -2575,7 +2575,7 @@ Function41a58: ; 41a58 (10:5a58)
ld a, UNOWN
ld [CurPartySpecies], a
call GetBaseData
ld de, $9000
ld de, VTiles2 tile $00
predef GetFrontpic
pop af
ld [UnownLetter], a

View File

@ -82,9 +82,9 @@ PredefPointers:: ; 856b
add_predef Predef_LoadSGBLayout
add_predef Function91d11
add_predef CheckContestMon
add_predef Function8c20f
add_predef Function8c000
add_predef Function8c000_2
add_predef Predef_StartBattle
add_predef Predef35
add_predef Predef36
add_predef PlayBattleAnim
add_predef Predef38 ; $38
add_predef Predef39

View File

@ -1707,7 +1707,7 @@ BuenasPassword3: ; b8f47 (2e:4f47)
BuenasPassword4: ; b8f55 (2e:4f55)
call BuenasPasswordCheckMidnight
jp c, BuenasPassword8
ld a, [wdc4a]
ld a, [wBuenasPassword]
; If we already generated the password today, we don't need to generate a new one.
ld hl, WeeklyFlags
bit 7, [hl]
@ -1727,9 +1727,9 @@ BuenasPassword4: ; b8f55 (2e:4f55)
and $3
cp $3
jr nc, .greater_than_three
; The high nybble of wdc4a will now contain the password group index, and the low nybble contains the actual password.
; The high nybble of wBuenasPassword will now contain the password group index, and the low nybble contains the actual password.
add e
ld [wdc4a], a
ld [wBuenasPassword], a
; Set the flag so that we don't generate a new password this week.
ld hl, WeeklyFlags
set 7, [hl]

View File

@ -380,7 +380,7 @@ ErasePreviousSave: ; 14cbb
ld [sStackTop + 1], a
call CloseSRAM
ld a, $1
ld [wd4b4], a
ld [wSavedAtLeastOnce], a
ret
; 14ce2
@ -486,7 +486,7 @@ Function14d93: ; 14d93
Function14da0: ; 14da0
ld a, [wd4b4]
ld a, [wSavedAtLeastOnce]
and a
ret nz
call ErasePreviousSave

View File

@ -529,7 +529,7 @@ Script_interpretmenu: ; 0x96f41
ld a, [ScriptBank]
ld hl, InterpretMenu
rst FarCall
ld a, [wcf88]
ld a, [wPocketCursorBuffer]
jr nc, .ok
xor a
.ok
@ -651,7 +651,7 @@ Script_specialsound: ; 0x96fe4
; script command 0x88
callba CheckItemPocket
ld a, [wd142]
ld a, [wItemAttributeParamBuffer]
cp TM_HM
ld de, SFX_GET_TM
jr z, .play
@ -665,7 +665,7 @@ Script_specialsound: ; 0x96fe4
GetPocketName: ; 96ffe
callba CheckItemPocket
ld a, [wd142]
ld a, [wItemAttributeParamBuffer]
dec a
ld hl, .Pockets
and 3
@ -1338,12 +1338,12 @@ Script_moveperson: ; 0x97341
call GetScriptPerson
ld b, a
call GetScriptByte
add $4
add 4
ld d, a
call GetScriptByte
add $4
add 4
ld e, a
callba Function807e
callba CopyDECoordsToMapObject
ret
; 0x9735b
@ -1385,10 +1385,10 @@ Script_loademote: ; 0x97384
; bubble (SingleByteParam)
call GetScriptByte
cp $ff
jr nz, .asm_9738e ; 0x97389 $3
cp -1
jr nz, .not_var_emote ; 0x97389 $3
ld a, [ScriptVar]
.asm_9738e
.not_var_emote
ld c, a
callba Function1442f
ret
@ -1417,7 +1417,7 @@ Script_showemote: ; 0x97396
; 0x973b6
ShowEmoteScript: ; 973b6
loademote $ff
loademote -1
applymovement2 .Show
pause 0
applymovement2 .Hide
@ -1448,12 +1448,12 @@ Script_earthquake: ; 0x973c7
ld [wd003], a
and $3f
ld [wd005], a
ld b, BANK(UnknownScript_0x973e6)
ld de, UnknownScript_0x973e6
ld b, BANK(.script)
ld de, .script
jp ScriptCall
; 0x973e6
UnknownScript_0x973e6: ; 973e6
.script: ; 973e6
applymovement PLAYER, wd002
end
; 973eb
@ -1487,7 +1487,7 @@ Script_battlecheck: ; 0x973fb
Script_loadtrainerdata: ; 0x97400
; script command 0x5c
ld a, $81
ld a, (1 << 7) | 1
ld [wd459], a
ld a, [WalkingDirection]
ld [OtherTrainerClass], a
@ -1502,7 +1502,7 @@ Script_loadpokedata: ; 0x97412
; pokemon (PokemonParam)
; level (DecimalParam)
ld a, $80
ld a, (1 << 7)
ld [wd459], a
call GetScriptByte
ld [TempWildMonSpecies], a
@ -1517,7 +1517,7 @@ Script_loadtrainer: ; 0x97424
; trainer_group (TrainerGroupParam)
; trainer_id (TrainerIdParam)
ld a, $81
ld a, (1 << 7) | 1
ld [wd459], a
call GetScriptByte
ld [OtherTrainerClass], a
@ -1531,7 +1531,7 @@ Script_startbattle: ; 0x97436
call BufferScreen
predef StartBattle
ld a, [wd0ee]
ld a, [wBattleResult]
and $3f
ld [ScriptVar], a
ret
@ -1555,26 +1555,28 @@ Script_returnafterbattle: ; 0x97459
ld hl, wd459
ld d, [hl]
ld [hl], $0
ld a, [wd0ee]
ld a, [wBattleResult]
and $3f
cp $1
jr nz, .asm_97470 ; 0x97466 $8
jr nz, .notblackedout ; 0x97466 $8
ld b, BANK(UnknownScript_0x124c1)
ld hl, UnknownScript_0x124c1
jp ScriptJump
.asm_97470
.notblackedout
bit 0, d
jr z, .asm_9747c ; 0x97472 $8
callba Functionfcfec
jr .asm_9748e ; 0x9747a $12
.asm_9747c
ld a, [wd0ee]
jr z, .was_wild ; 0x97472 $8
callba MomTriesToBuySomething
jr .done ; 0x9747a $12
.was_wild
ld a, [wBattleResult]
bit 7, a
jr z, .asm_9748e ; 0x97481 $b
ld b, BANK(UnknownScript_0x90255)
ld de, UnknownScript_0x90255
callba Function97c4f
.asm_9748e
jr z, .done ; 0x97481 $b
ld b, BANK(Script_SpecialBillCall)
ld de, Script_SpecialBillCall
callba LoadScriptBDE
.done
jp Script_reloadmap
; 0x97491
@ -1583,7 +1585,7 @@ Script_reloadmap: ; 0x97491
xor a
ld [wd459], a
ld a, $f3
ld a, MAPSETUP_RELOADMAP
ld [hMapEntryMethod], a
ld a, $1
call LoadMapStatus
@ -2202,7 +2204,7 @@ Script_name: ; 0x97716
; memory (SingleByteParam)
call GetScriptByte
ld [wcf61], a
ld [wNamedObjectTypeBuffer], a
ContinueToGetName: ; 0x9771c
call GetScriptByte
@ -2219,7 +2221,7 @@ Script_trainerclassname: ; 0x9772b
; memory (SingleByteParam)
ld a, TRAINER_NAME
ld [wcf61], a
ld [wNamedObjectTypeBuffer], a
jr ContinueToGetName ; 0x97730 $ea
; 0x97732
@ -2811,10 +2813,10 @@ Script_warpfacing: ; 0x97a0e
call GetScriptByte
and $3
ld c, a
ld a, [wd45b]
ld a, [wPlayerSpriteSetupFlags]
set 5, a
or c
ld [wd45b], a
ld [wPlayerSpriteSetupFlags], a
; fall through
Script_warp: ; 0x97a1d
@ -2838,7 +2840,7 @@ Script_warp: ; 0x97a1d
ld [YCoord], a
ld a, -1
ld [wd001], a
ld a, -15
ld a, MAPSETUP_WARP
ld [hMapEntryMethod], a
ld a, 1
call LoadMapStatus
@ -2850,7 +2852,7 @@ Script_warp: ; 0x97a1d
call GetScriptByte
ld a, -1
ld [wd001], a
ld a, -5
ld a, MAPSETUP_BADWARP
ld [hMapEntryMethod], a
ld a, 1
call LoadMapStatus
@ -2966,7 +2968,7 @@ Script_reloadmappart:: ; 0x97ae3
; script command 0x7c
xor a
ld [$ffd4], a
ld [hBGMapMode], a
call Function2173
call Function2914
callba Function104061
@ -3011,7 +3013,7 @@ Script_reloadandreturn: ; 0x97b16
Script_loadfont: ; 0x97b1c
; script command 0x47
call Function2e08
call LoadFont
ret
; 0x97b20
@ -3044,7 +3046,7 @@ Script_loadmovesprites: ; 0x97b2f
; script command 0x49
call Function2e20
call Function2dcf
call LoadMoveSprites
ret
; 0x97b36

View File

@ -39,7 +39,7 @@ SpecialsPointers:: ; c029
add_special Special_GetMysteryGiftItem
add_special Special_UnlockMysteryGift
; Bug Catching Contest
; Map Events
add_special BugContestJudging
add_special CheckPartyFullAfterContest
add_special CheckFirstMonFainted
@ -88,25 +88,25 @@ SpecialsPointers:: ; c029
add_special Special_FindAtLeastThatHappy
add_special Special_FindThatSpecies
add_special Special_FindThatSpeciesYourTrainerID
add_special Functionc3ef
add_special Function17421
add_special Function17440
add_special Special_CheckUnusedTwoDayTimer ; unreferenced
add_special Special_DayCareMon1
add_special Special_DayCareMon2
add_special Special_SelectRandomBugContestContestants
add_special Functionc3fc
add_special Special_ActivateFishingSwarm
add_special ToggleMaptileDecorations
add_special ToggleDecorationsVisibility
add_special SpecialGiveShuckle
add_special SpecialReturnShuckle
add_special Function73f7
add_special Special_BillsGrandfather
add_special SpecialCheckPokerus
add_special Function24b25
add_special Function24b4e
add_special Special_DisplayCoinCaseBalance
add_special Special_DisplayMoneyAndCoinBalance
add_special Function24ae8
add_special Special_CheckForLuckyNumberWinners
add_special Special_CheckLuckyNumberShowFlag
add_special Special_ResetLuckyNumberShowFlag
add_special Function4d9d3
add_special Function88018
add_special Special_PrintTodaysLuckyNumber
add_special Special_SelectApricornForKurt
add_special SpecialNameRater
add_special Functionc2da
add_special GetFirstPokemonHappiness
@ -169,7 +169,7 @@ SpecialsPointers:: ; c029
add_special SpecialBuenasPassword
add_special SpecialBuenaPrize
add_special SpecialDratini
add_special Function11485
add_special Special_SampleKenjiBreakCountdown
add_special SpecialBeastsCheck
add_special SpecialMonCheck
add_special Functionc225
@ -482,16 +482,16 @@ ScriptReturnCarry: ; c3e2
ret
; c3ef
Functionc3ef: ; c3ef
callba Function1150c
ld a, [wdc3a]
Special_CheckUnusedTwoDayTimer: ; c3ef
callba CheckUnusedTwoDayTimer
ld a, [wUnusedTwoDayTimer]
ld [ScriptVar], a
ret
; c3fc
Functionc3fc: ; c3fc
Special_ActivateFishingSwarm: ; c3fc
ld a, [ScriptVar]
ld [wdfce], a
ld [wFishingSwarmFlag], a
ret
; c403
@ -523,7 +523,7 @@ SpecialCheckPokerus: ; c419
; c422
Special_ResetLuckyNumberShowFlag: ; c422
callba Function1152b
callba RestartLuckyNumberCountdown
ld hl, wLuckyNumberShowFlag
res 0, [hl]
callba LoadOrRegenerateLuckyIDNumber
@ -531,7 +531,7 @@ Special_ResetLuckyNumberShowFlag: ; c422
; c434
Special_CheckLuckyNumberShowFlag: ; c434
callba Function11542
callba CheckLuckyNumberShowFlag
jp ScriptReturnCarry
; c43d

View File

@ -159,7 +159,7 @@ PokeCenterNurseScript:
.pokerus_done
setflag ENGINE_POKERUS
specialphonecall ELMCALL_POKERUS
specialphonecall SPECIALCALL_POKERUS
end
DifficultBookshelfScript:
@ -297,7 +297,7 @@ RadioTowerRocketsScript:
clearevent EVENT_RADIO_TOWER_ROCKET_TAKEOVER
clearevent EVENT_USED_THE_CARD_KEY_IN_THE_RADIO_TOWER
setevent EVENT_MAHOGANY_TOWN_POKEFAN_M_BLOCKS_EAST
specialphonecall ELMCALL_WEIRDBROADCAST
specialphonecall SPECIALCALL_WEIRDBROADCAST
domaptrigger MAHOGANY_TOWN, $1
end
@ -1809,7 +1809,7 @@ CoinVendor_IntroScript: ; 0xbcde0
farwritetext CoinVendor_IntroText
CoinVendor_SellCoinsMenuScript: ; 0xbcde4
special Function24b4e
special Special_DisplayMoneyAndCoinBalance
loadmenudata CoinVendor_MenuDataHeader
interpretmenu2
writebackup

View File

@ -1,104 +1,104 @@
Function113d6: ; 113d6
call Function114dd
_InitializeStartDay: ; 113d6
call InitializeStartDay
ret
; 113da
Function113da: ; 113da
ClearDailyTimers: ; 113da
xor a
ld [wLuckyNumberDayBuffer], a
ld [wdc3a], a
ld [wdc1c], a
ld [wUnusedTwoDayTimer], a
ld [wDailyResetTimer], a
ret
; 113e5
Function113e5:: ; 113e5
InitCallReceiveDelay:: ; 113e5
xor a
ld [wd464], a
ld [wTimeCyclesSinceLastCall], a
Function113e9: ; 113e9
ld a, [wd464]
NextCallReceiveDelay: ; 113e9
ld a, [wTimeCyclesSinceLastCall]
cp 3
jr c, .asm_113f2
jr c, .okay
ld a, 3
.asm_113f2
.okay
ld e, a
ld d, 0
ld hl, .data_113fd
ld hl, .ReceiveCallDelays
add hl, de
ld a, [hl]
jp Function1142e
jp RestartReceiveCallDelay
; 113fd
.data_113fd
.ReceiveCallDelays
db 20, 10, 5, 3
; 11401
Function11401: ; 11401
call Function1143c
CheckReceiveCallTimer: ; 11401
call CheckReceiveCallDelay ; check timer
ret nc
ld hl, wd464
ld hl, wTimeCyclesSinceLastCall
ld a, [hl]
cp 3
jr nc, .asm_1140e
jr nc, .ok
inc [hl]
.asm_1140e
call Function113e9
.ok
call NextCallReceiveDelay ; restart timer
scf
ret
; 11413
Function11413: ; 11413
InitOneDayCountdown: ; 11413
ld a, 1
Function11415: ; 11415
InitNDaysCountdown: ; 11415
ld [hl], a
push hl
call UpdateTime
pop hl
inc hl
call Function11621
call CopyDayToHL
ret
; 11420
Function11420: ; 11420
CheckDayDependentEventHL: ; 11420
inc hl
push hl
call Function115cf
call Function115c8
call CalcDaysSince
call GetDaysSince
pop hl
dec hl
call Function11586
call UpdateTimeRemaining
ret
; 1142e
Function1142e: ; 1142e
ld hl, wd465
RestartReceiveCallDelay: ; 1142e
ld hl, wReceiveCallDelay_MinsRemaining
ld [hl], a
call UpdateTime
ld hl, wd466
call Function1162e
ld hl, wReceiveCallDelay_StartTime
call CopyDayHourMinToHL
ret
; 1143c
Function1143c: ; 1143c
ld hl, wd466
call Function115d6
call Function115ae
ld hl, wd465
call Function11586
CheckReceiveCallDelay: ; 1143c
ld hl, wReceiveCallDelay_StartTime
call CalcMinsHoursDaysSince
call GetMinutesSinceIfLessThan60
ld hl, wReceiveCallDelay_MinsRemaining
call UpdateTimeRemaining
ret
; 1144c
Function1144c: ; 1144c
ld hl, wdc1c
jp Function11413
RestartDailyResetTimer: ; 1144c
ld hl, wDailyResetTimer
jp InitOneDayCountdown
; 11452
Function11452:: ; 11452
ld hl, wdc1c
call Function11420
CheckDailyResetTimer:: ; 11452
ld hl, wDailyResetTimer
call CheckDayDependentEventHL
ret nc
xor a
ld hl, DailyFlags
@ -121,18 +121,19 @@ endr
ld hl, wdc58
ld a, [hl]
and a
jr z, .asm_11480
jr z, .RestartKenjiBreakCountdown
dec [hl]
jr nz, .asm_11483
jr nz, .DontRestartKenjiBreakCountdown
.asm_11480
call Function11485
.RestartKenjiBreakCountdown
call Special_SampleKenjiBreakCountdown
.asm_11483
jr Function1144c
.DontRestartKenjiBreakCountdown
jr RestartDailyResetTimer
; 11485
Function11485: ; 11485
Special_SampleKenjiBreakCountdown: ; 11485
; Generate a random number between 3 and 5
call Random
and 3
add 3
@ -140,99 +141,101 @@ Function11485: ; 11485
ret
; 11490
Function11490: ; 11490
ld a, $14
ld [wd46c], a
ld a, $0
ld [wd46d], a
StartBugContestTimer: ; 11490
ld a, 20
ld [wBugContestMinsRemaining], a
ld a, 0
ld [wBugContestSecsRemaining], a
call UpdateTime
ld hl, wdc35
call Function11613
ld hl, wBugContestStartTime
call CopyDayHourMinSecToHL
ret
; 114a4
Function114a4:: ; 114a4 (4:54a4)
ld hl, wdc35
call Function115db
ld a, [wcfd7]
CheckBugContestTimer:: ; 114a4 (4:54a4)
ld hl, wBugContestStartTime
call CalcSecsMinsHoursDaysSince
ld a, [wDaysSince]
and a
jr nz, .asm_114d4
ld a, [wcfd6]
jr nz, .timed_out
ld a, [wHoursSince]
and a
jr nz, .asm_114d4
ld a, [wcfd4]
jr nz, .timed_out
ld a, [wSecondsSince]
ld b, a
ld a, [wd46d]
ld a, [wBugContestSecsRemaining]
sub b
jr nc, .asm_114c2
add $3c
.asm_114c2
ld [wd46d], a
ld a, [wcfd5]
jr nc, .okay
add 60
.okay
ld [wBugContestSecsRemaining], a
ld a, [wMinutesSince]
ld b, a
ld a, [wd46c]
ld a, [wBugContestMinsRemaining]
sbc b
ld [wd46c], a
jr c, .asm_114d4
ld [wBugContestMinsRemaining], a
jr c, .timed_out
and a
ret
.asm_114d4
.timed_out
xor a
ld [wd46c], a
ld [wd46d], a
ld [wBugContestMinsRemaining], a
ld [wBugContestSecsRemaining], a
scf
ret
Function114dd: ; 114dd
InitializeStartDay: ; 114dd
call UpdateTime
ld hl, wdc23
call Function11621
ld hl, wStartDay
call CopyDayToHL
ret
; 114e7
Function114e7:: ; 114e7
ld hl, wdc23
call Function115cf
call Function115c8
CheckPokerusTrick:: ; 114e7
ld hl, wStartDay
call CalcDaysSince
call GetDaysSince
and a
jr z, .asm_114fa
jr z, .done
ld b, a
callba ApplyPokerusTick
.asm_114fa
.done
xor a
ret
; 114fc
Function114fc: ; 114fc
ld a, $2
ld hl, wdc3a
SetUnusedTwoDayTimer: ; 114fc
ld a, 2
ld hl, wUnusedTwoDayTimer
ld [hl], a
call UpdateTime
ld hl, wdc3b
call Function11621
ld hl, wUnusedTwoDayTimerStartDate
call CopyDayToHL
ret
; 1150c
Function1150c: ; 1150c
ld hl, wdc3b
call Function115cf
call Function115c8
ld hl, wdc3a
call Function11586
CheckUnusedTwoDayTimer: ; 1150c
ld hl, wUnusedTwoDayTimerStartDate
call CalcDaysSince
call GetDaysSince
ld hl, wUnusedTwoDayTimer
call UpdateTimeRemaining
ret
; 1151c
Function1151c: ; 1151c
Function1151c: ; unreferenced
ld hl, DailyFlags
set 2, [hl]
ret
; 11522
Function11522: ; 11522
Function11522: ; unreferenced
and a
ld hl, DailyFlags
bit 2, [hl]
@ -241,10 +244,10 @@ Function11522: ; 11522
ret
; 1152b
Function1152b: ; 1152b
RestartLuckyNumberCountdown: ; 1152b
call .GetDaysUntilNextFriday
ld hl, wLuckyNumberDayBuffer
jp Function11415
jp InitNDaysCountdown
; 11534
.GetDaysUntilNextFriday: ; 11534
@ -262,172 +265,175 @@ Function1152b: ; 1152b
ret
; 11542
Function11542: ; 11542
CheckLuckyNumberShowFlag: ; 11542
ld hl, wLuckyNumberDayBuffer
jp Function11420
jp CheckDayDependentEventHL
; 11548
Function11548: ; 11548
ld a, BANK(s0_abfa)
DoMysteryGiftIfDayHasPassed: ; 11548
ld a, BANK(sMysteryGiftTimer)
call GetSRAMBank
ld hl, s0_abfa
ld hl, sMysteryGiftTimer
ld a, [hli]
ld [Buffer1], a
ld a, [hl]
ld [Buffer2], a
call CloseSRAM
ld hl, Buffer1
call Function11420
jr nc, .asm_11572
call CheckDayDependentEventHL
jr nc, .not_timed_out
ld hl, Buffer1
call Function11413
call InitOneDayCountdown
call CloseSRAM
callba Function1050c8
.asm_11572
ld a, BANK(s0_abfa)
.not_timed_out
ld a, BANK(sMysteryGiftTimer)
call GetSRAMBank
ld hl, Buffer1
ld a, [hli]
ld [s0_abfa], a
ld [sMysteryGiftTimer], a
ld a, [hl]
ld [s0_abfa + 1], a
ld [sMysteryGiftTimer + 1], a
call CloseSRAM
ret
; 11586
Function11586: ; 11586
UpdateTimeRemaining: ; 11586
; If the amount of time elapsed exceeds the capacity of its
; unit, skip this part.
cp -1
jr z, .skip
jr z, .set_carry
ld c, a
ld a, [hl]
ld a, [hl] ; time remaining
sub c
jr nc, .ok
xor a
.ok
ld [hl], a
jr z, .skip
jr z, .set_carry
xor a
ret
.skip
.set_carry
xor a
ld [hl], a
scf
ret
; 11599
Function11599: ; 11599
ld a, [wcfd7]
GetSecondsSinceIfLessThan60: ; 11599
ld a, [wDaysSince]
and a
jr nz, Function115cc
ld a, [wcfd6]
jr nz, GetTimeElapsed_ExceedsUnitLimit
ld a, [wHoursSince]
and a
jr nz, Function115cc
ld a, [wcfd5]
jr nz, Function115cc
ld a, [wcfd4]
jr nz, GetTimeElapsed_ExceedsUnitLimit
ld a, [wMinutesSince]
jr nz, GetTimeElapsed_ExceedsUnitLimit
ld a, [wSecondsSince]
ret
; 115ae
Function115ae: ; 115ae
ld a, [wcfd7]
GetMinutesSinceIfLessThan60: ; 115ae
ld a, [wDaysSince]
and a
jr nz, Function115cc
ld a, [wcfd6]
jr nz, GetTimeElapsed_ExceedsUnitLimit
ld a, [wHoursSince]
and a
jr nz, Function115cc
ld a, [wcfd5]
jr nz, GetTimeElapsed_ExceedsUnitLimit
ld a, [wMinutesSince]
ret
; 115be
Function115be: ; 115be
ld a, [wcfd7]
GetHoursSinceIfLessThan24: ; 115be
ld a, [wDaysSince]
and a
jr nz, Function115cc
ld a, [wcfd6]
jr nz, GetTimeElapsed_ExceedsUnitLimit
ld a, [wHoursSince]
ret
; 115c8
Function115c8: ; 115c8
ld a, [wcfd7]
GetDaysSince: ; 115c8
ld a, [wDaysSince]
ret
; 115cc
Function115cc: ; 115cc
ld a, $ff
GetTimeElapsed_ExceedsUnitLimit: ; 115cc
ld a, -1
ret
; 115cf
Function115cf: ; 115cf
CalcDaysSince: ; 115cf
xor a
jr Function11605
jr _CalcDaysSince
; 115d2
Function115d2: ; 115d2
CalcHoursDaysSince: ; 115d2
inc hl
xor a
jr Function115f8
jr _CalcHoursDaysSince
; 115d6
Function115d6: ; 115d6
CalcMinsHoursDaysSince: ; 115d6
rept 2
inc hl
endr
xor a
jr Function115eb
jr _CalcMinsHoursDaysSince
; 115db
Function115db: ; 115db
CalcSecsMinsHoursDaysSince: ; 115db
rept 3
inc hl
endr
ld a, [hSeconds]
ld c, a
sub [hl]
jr nc, .asm_115e6
jr nc, .skip
add 60
.asm_115e6
ld [hl], c
.skip
ld [hl], c ; current seconds
dec hl
ld [wcfd4], a
ld [wSecondsSince], a ; seconds since
Function115eb: ; 115eb
_CalcMinsHoursDaysSince: ; 115eb
ld a, [hMinutes]
ld c, a
sbc [hl]
jr nc, .asm_115f3
jr nc, .skip
add 60
.asm_115f3
ld [hl], c
.skip
ld [hl], c ; current minutes
dec hl
ld [wcfd5], a
ld [wMinutesSince], a ; minutes since
Function115f8: ; 115f8
_CalcHoursDaysSince: ; 115f8
ld a, [hHours]
ld c, a
sbc [hl]
jr nc, .asm_11600
jr nc, .skip
add 24
.asm_11600
ld [hl], c
.skip
ld [hl], c ; current hours
dec hl
ld [wcfd6], a
ld [wHoursSince], a ; hours since
Function11605
_CalcDaysSince:
ld a, [CurDay]
ld c, a
sbc [hl]
jr nc, .skip
add 20 * 7
.skip
ld [hl], c
ld [wcfd7], a
ld [hl], c ; current days
ld [wDaysSince], a ; days since
ret
; 11613
Function11613: ; 11613
CopyDayHourMinSecToHL: ; 11613
ld a, [CurDay]
ld [hli], a
ld a, [hHours]
@ -439,13 +445,13 @@ Function11613: ; 11613
ret
; 11621
Function11621: ; 11621
CopyDayToHL: ; 11621
ld a, [CurDay]
ld [hl], a
ret
; 11626
Function11626: ; 11626
CopyDayHourToHL: ; 11626
ld a, [CurDay]
ld [hli], a
ld a, [hHours]
@ -453,7 +459,7 @@ Function11626: ; 11626
ret
; 1162e
Function1162e: ; 1162e
CopyDayHourMinToHL: ; 1162e
ld a, [CurDay]
ld [hli], a
ld a, [hHours]

414
engine/timeofdaypals.asm Normal file
View File

@ -0,0 +1,414 @@
Function8c001:: ; 8c001
call UpdateTime
ld a, [TimeOfDay]
ld [CurTimeOfDay], a
call GetTimePalette
ld [TimeOfDayPal], a
ret
; 8c011
_TimeOfDayPals:: ; 8c011
; return carry if pals are changed
; forced pals?
ld hl, wd846
bit 7, [hl]
jr nz, .dontchange
; do we need to bother updating?
ld a, [TimeOfDay]
ld hl, CurTimeOfDay
cp [hl]
jr z, .dontchange
; if so, the time of day has changed
ld a, [TimeOfDay]
ld [CurTimeOfDay], a
; get palette id
call GetTimePalette
; same palette as before?
ld hl, TimeOfDayPal
cp [hl]
jr z, .dontchange
; update palette id
ld [TimeOfDayPal], a
; save bg palette 8
ld hl, Unkn1Pals + 8 * 7 ; Unkn1Pals + 7 pals
; save wram bank
ld a, [rSVBK]
ld b, a
; wram bank 5
ld a, 5
ld [rSVBK], a
; push palette
ld c, 4 ; NUM_PAL_COLORS
.push
ld d, [hl]
inc hl
ld e, [hl]
inc hl
push de
dec c
jr nz, .push
; restore wram bank
ld a, b
ld [rSVBK], a
; update sgb pals
ld b, $9
call GetSGBLayout
; restore bg palette 8
ld hl, Unkn2Pals - 1 ; last byte in Unkn1Pals
; save wram bank
ld a, [rSVBK]
ld d, a
; wram bank 5
ld a, 5
ld [rSVBK], a
; pop palette
ld e, 4 ; NUM_PAL_COLORS
.pop
pop bc
ld [hl], c
dec hl
ld [hl], b
dec hl
dec e
jr nz, .pop
; restore wram bank
ld a, d
ld [rSVBK], a
; update palettes
call _UpdateTimePals
call DelayFrame
; successful change
scf
ret
.dontchange
; no change occurred
and a
ret
; 8c070
_UpdateTimePals:: ; 8c070
ld c, $9 ; normal
call GetTimePalFade
call DmgToCgbTimePals
ret
; 8c079
FadeInBGMap:: ; 8c079
ld c, $12
call GetTimePalFade
ld b, $4
call ConvertTimePalsDecHL
ret
; 8c084
FadeBlackBGMap:: ; 8c084
call Function8c0c1
ld c, $9
call GetTimePalFade
ld b, $4
call ConvertTimePalsIncHL
ret
; 8c092
Special_BattleTowerFade: ; 8c092
call Function8c0c1
ld c, $9
call GetTimePalFade
ld b, $4
.asm_8c09c
call DmgToCgbTimePals
rept 3
inc hl
endr
ld c, $7
call DelayFrames
dec b
jr nz, .asm_8c09c
ret
; 8c0ab
Special_FadeInQuickly: ; 8c0ab
ld c, $0
call GetTimePalFade
ld b, $4
call ConvertTimePalsIncHL
ret
; 8c0b6
Special_FadeBlackQuickly: ; 8c0b6
ld c, $9
call GetTimePalFade
ld b, $4
call ConvertTimePalsDecHL
ret
; 8c0c1
Function8c0c1: ; 8c0c1
ld a, [rSVBK]
push af
ld a, $5
ld [rSVBK], a
ld hl, Unkn1Pals
ld a, [hli]
ld e, a
ld a, [hli]
ld d, a
ld hl, Unkn1Pals + 8
ld c, $6
.asm_8c0d4
ld a, e
ld [hli], a
ld a, d
ld [hli], a
rept 6
inc hl
endr
dec c
jr nz, .asm_8c0d4
pop af
ld [rSVBK], a
ret
; 8c0e5
brightlevel: MACRO
db (\1 << 6) | (\2 << 4) | (\3 << 2) | \4
ENDM
Function8c0e5: ; 8c0e5
ld hl, .BrightnessLevels
ld a, [wc2d0]
cp $4 ; Dark cave, needs Flash
jr z, .DarkCave
and $7
add l
ld l, a
ld a, $0
adc h
ld h, a
ld a, [hl]
ld [wd847], a
ret
.DarkCave
ld a, [StatusFlags]
bit 2, a
jr nz, .UsedFlash
ld a, $ff ; 3, 3, 3, 3
ld [wd847], a
ret
.UsedFlash
ld a, $aa ; 2, 2, 2, 2
ld [wd847], a
ret
; 8c10f (23:410f)
.BrightnessLevels: ; 8c10f
brightlevel 3, 2, 1, 0
brightlevel 1, 1, 1, 1
brightlevel 2, 2, 2, 2
brightlevel 0, 0, 0, 0
brightlevel 3, 3, 3, 3
brightlevel 3, 2, 1, 0
brightlevel 3, 2, 1, 0
brightlevel 3, 2, 1, 0
; 8c117
GetTimePalette: ; 8c117
ld a, [TimeOfDay]
ld e, a
ld d, 0
ld hl, .TimePalettes
rept 2
add hl, de
endr
ld a, [hli]
ld h, [hl]
ld l, a
jp [hl]
; 8c126
.TimePalettes
dw .MorningPalette
dw .DayPalette
dw .NitePalette
dw .DarknessPalette
.MorningPalette
ld a, [wd847]
and %00000011 ; 0
ret
.DayPalette
ld a, [wd847]
and %00001100 ; 1
srl a
srl a
ret
.NitePalette
ld a, [wd847]
and %00110000 ; 2
swap a
ret
.DarknessPalette
ld a, [wd847]
and %11000000 ; 3
rlca
rlca
ret
; 8c14e
DmgToCgbTimePals: ; 8c14e
push hl
push de
ld a, [hli]
call DmgToCgbBGPals
ld a, [hli]
ld e, a
ld a, [hli]
ld d, a
call DmgToCgbObjPals
pop de
pop hl
ret
; 8c15e
ConvertTimePalsIncHL: ; 8c15e
.loop
call DmgToCgbTimePals
rept 3
inc hl
endr
ld c, $2
call DelayFrames
dec b
jr nz, .loop
ret
; 8c16d
ConvertTimePalsDecHL: ; 8c16d
.loop
call DmgToCgbTimePals
rept 3
dec hl
endr
ld c, $2
call DelayFrames
dec b
jr nz, .loop
ret
; 8c17c
GetTimePalFade: ; 8c17c
; check cgb
ld a, [hCGB]
and a
jr nz, .cgb
; else: dmg
; index
ld a, [TimeOfDayPal]
and %11
; get fade table
push bc
ld c, a
ld b, $0
ld hl, .dmgfades
rept 2
add hl, bc
endr
ld a, [hli]
ld h, [hl]
ld l, a
pop bc
; get place in fade table
ld b, $0
add hl, bc
ret
.cgb
ld hl, .cgbfade
ld b, $0
add hl, bc
ret
.dmgfades
dw .morn
dw .day
dw .nite
dw .darkness
.morn
db %11111111, %11111111, %11111111
db %11111110, %11111110, %11111110
db %11111001, %11100100, %11100100
db %11100100, %11010000, %11010000
db %10010000, %10000000, %10000000
db %01000000, %01000000, %01000000
db %00000000, %00000000, %00000000
.day
db %11111111, %11111111, %11111111
db %11111110, %11111110, %11111110
db %11111001, %11100100, %11100100
db %11100100, %11010000, %11010000
db %10010000, %10000000, %10000000
db %01000000, %01000000, %01000000
db %00000000, %00000000, %00000000
.nite
db %11111111, %11111111, %11111111
db %11111110, %11111110, %11111110
db %11111001, %11100100, %11100100
db %11101001, %11010000, %11010000
db %10010000, %10000000, %10000000
db %01000000, %01000000, %01000000
db %00000000, %00000000, %00000000
.darkness
db %11111111, %11111111, %11111111
db %11111110, %11111110, %11111111
db %11111110, %11100100, %11111111
db %11111101, %11010000, %11111111
db %11111101, %10000000, %11111111
db %00000000, %01000000, %00000000
db %00000000, %00000000, %00000000
.cgbfade
db %11111111, %11111111, %11111111
db %11111110, %11111110, %11111110
db %11111001, %11111001, %11111001
db %11100100, %11100100, %11100100
db %10010000, %10010000, %10010000
db %01000000, %01000000, %01000000
db %00000000, %00000000, %00000000
; 8c20f

View File

@ -9,7 +9,7 @@ _TitleScreen: ; 10ed67
ld [hBGMapMode], a
; Reset timing variables
ld hl, wcf63
ld hl, wJumptableIndex
ld [hli], a ; cf63 ; Scene?
ld [hli], a ; cf64
ld [hli], a ; cf65 ; Timer lo
@ -53,27 +53,27 @@ _TitleScreen: ; 10ed67
; Apply logo gradient:
; lines 3-4
ld hl, $9860 ; (0,3)
ld hl, VBGMap0 tile $06 ; (0,3)
ld bc, $0040 ; 2 rows
ld a, 2
call ByteFill
; line 5
ld hl, $98a0 ; (0,5)
ld hl, VBGMap0 tile $0a ; (0,5)
ld bc, $0020 ; 1 row
ld a, 3
call ByteFill
; line 6
ld hl, $98c0 ; (0,6)
ld hl, VBGMap0 tile $0c ; (0,6)
ld bc, $0020 ; 1 row
ld a, 4
call ByteFill
; line 7
ld hl, $98e0 ; (0,7)
ld hl, VBGMap0 tile $0e ; (0,7)
ld bc, $0020 ; 1 row
ld a, 5
call ByteFill
; lines 8-9
ld hl, $9900 ; (0,8)
ld hl, VBGMap0 tile $10 ; (0,8)
ld bc, $0040 ; 2 rows
ld a, 6
call ByteFill
@ -86,7 +86,7 @@ _TitleScreen: ; 10ed67
call ByteFill
; Suicune gfx
ld hl, $9980 ; (0,12)
ld hl, VBGMap0 tile $18 ; (0,12)
ld bc, $00c0 ; the rest of the screen
ld a, 8
call ByteFill
@ -130,10 +130,10 @@ _TitleScreen: ; 10ed67
; Initialize running Suicune?
ld d, $0
call Function10eed2
call LoadSuicuneFrame
; Initialize background crystal
call Function10ef06
call InitializeBackground
; Save WRAM bank
ld a, [rSVBK]
@ -145,12 +145,12 @@ _TitleScreen: ; 10ed67
; Update palette colors
ld hl, TitleScreenPalettes
ld de, Unkn1Pals
ld bc, $0080
ld bc, 4 * 32
call CopyBytes
ld hl, TitleScreenPalettes
ld de, BGPals
ld bc, $0080
ld bc, 4 * 32
call CopyBytes
; Restore WRAM bank
@ -220,7 +220,7 @@ _TitleScreen: ; 10ed67
ld [hBGMapMode], a
xor a
ld [DefaultFlypoint], a
ld [Unkn1Pals + 2], a
; Play starting sound effect
call SFXChannelsOff
@ -230,25 +230,28 @@ _TitleScreen: ; 10ed67
ret
; 10eea7
Function10eea7: ; 10eea7
ld hl, DefaultFlypoint
SuicuneFrameIterator: ; 10eea7
ld hl, Unkn1Pals + 2
ld a, [hl]
ld c, a
inc [hl]
and $7
; Only do this once every eight frames
and (1 << 3) - 1
ret nz
ld a, c
and $18
and 3 << 3
sla a
swap a
ld e, a
ld d, $0
ld hl, Unknown_10eece
ld hl, .Frames
add hl, de
ld d, [hl]
xor a
ld [hBGMapMode], a
call Function10eed2
call LoadSuicuneFrame
ld a, $1
ld [hBGMapMode], a
ld a, $3
@ -256,33 +259,36 @@ Function10eea7: ; 10eea7
ret
; 10eece
Unknown_10eece: ; 10eece
db $80, $88, $00, $08
.Frames: ; 10eece
db $80 ; VTiles4 tile $00
db $88 ; VTiles4 tile $08
db $00 ; VTiles5 tile $00
db $08 ; VTiles5 tile $08
; 10eed2
Function10eed2: ; 10eed2
LoadSuicuneFrame: ; 10eed2
hlcoord 6, 12
ld b, $6
.asm_10eed7
ld c, $8
.asm_10eed9
ld b, 6
.row
ld c, 8
.col
ld a, d
ld [hli], a
inc d
dec c
jr nz, .asm_10eed9
ld a, $c
jr nz, .col
ld a, SCREEN_WIDTH - 8
add l
ld l, a
ld a, $0
ld a, 0
adc h
ld h, a
ld a, $8
ld a, 8
add d
ld d, a
dec b
jr nz, .asm_10eed7
jr nz, .row
ret
; 10eeef
@ -293,18 +299,18 @@ DrawTitleGraphic: ; 10eeef
; c: width
; d: tile to start drawing from
; e: number of tiles to advance for each row
.asm_10eeef
.row
push de
push bc
push hl
.asm_10eef2
.col
ld a, d
ld [hli], a
inc d
dec c
jr nz, .asm_10eef2
jr nz, .col
pop hl
ld bc, $0014
ld bc, SCREEN_WIDTH
add hl, bc
pop bc
pop de
@ -312,31 +318,31 @@ DrawTitleGraphic: ; 10eeef
add d
ld d, a
dec b
jr nz, .asm_10eeef
jr nz, .row
ret
; 10ef06
Function10ef06: ; 10ef06
InitializeBackground: ; 10ef06
ld hl, Sprites
ld d, $de
ld d, -$22
ld e, $0
ld c, $5
.asm_10ef0f
ld c, 5
.loop
push bc
call Function10ef1c
call .InitColumn
pop bc
ld a, $10
add d
ld d, a
dec c
jr nz, .asm_10ef0f
jr nz, .loop
ret
; 10ef1c
Function10ef1c: ; 10ef1c
.InitColumn: ; 10ef1c
ld c, $6
ld b, $40
.asm_10ef20
.loop2
ld a, d
ld [hli], a
ld a, b
@ -351,7 +357,7 @@ endr
ld a, $80
ld [hli], a
dec c
jr nz, .asm_10ef20
jr nz, .loop2
ret
; 10ef32
@ -363,7 +369,7 @@ AnimateTitleCrystal: ; 10ef32
; y is really from the bottom of the sprite, which is two tiles high
ld hl, Sprites
ld a, [hl]
cp 6 + 16
cp 6 + $10
ret z
; Move all 30 parts of the crystal down by 2

344
event/battle_tower.asm Normal file
View File

@ -0,0 +1,344 @@
Function8b1e1: ; 8b1e1
ld de, Unknown_8b1ed
call Function8b25b
ret z
call Function8b231
scf
ret
; 8b1ed
Unknown_8b1ed: ; 8b1ed
db 2
dw Unknown_8b1f2
dw Unknown_8b1f6
Unknown_8b1f2: ; 8b1f2
dw Function8b2bb
dw Function8b2c1
; 8b1f6
Unknown_8b1f6: ; 8b1f6
dw UnknownText_0x8b1fc
dw UnknownText_0x8b23d
dw UnknownText_0x8b242
; 8b1fc
UnknownText_0x8b1fc: ; 0x8b1fc
; Excuse me!
text_jump UnknownText_0x1c5937
db "@"
; 0x8b201
CheckForBattleTowerRules: ; 8b201
ld hl, StringBuffer2
ld [hl], "3"
inc hl
ld [hl], "@"
ld de, CheckForBattleTowerRules_FunctionsText
call Function8b25b
ret z
call Function8b231
scf
ret
; 8b215
CheckForBattleTowerRules_FunctionsText: ; 8b215
db 4
dw CheckForBattleTowerRules_Functions
dw CheckForBattleTowerRules_Text
CheckForBattleTowerRules_Functions: ; 8b21a
dw Function_PartyCountEq3
dw Function_PartySpeciesAreUnique
dw Function_PartyItemsAreUnique
dw Function_HasPartyAnEgg
; 8b222
CheckForBattleTowerRules_Text: ; 8b222
dw JumpText_ExcuseMeYoureNotReady
dw JumpText_OnlyThreePkmnMayBeEntered
dw JumpText_ThePkmnMustAllBeDifferentKinds
dw JumpText_ThePkmnMustNotHoldTheSameItems
dw JumpText_YouCantTakeAnEgg
; 8b22c
JumpText_ExcuseMeYoureNotReady: ; 0x8b22c
; Excuse me. You're not ready.
text_jump Text_ExcuseMeYoureNotReady
db "@"
; 0x8b231
Function8b231: ; 8b231
ld hl, UnknownText_0x8b238
call PrintText
ret
; 8b238
UnknownText_0x8b238: ; 0x8b238
; Please return when you're ready.
text_jump UnknownText_0x1c5962
db "@"
; 0x8b23d
UnknownText_0x8b23d: ; 0x8b23d
; You need at least three #MON.
text_jump UnknownText_0x1c5983
db "@"
; 0x8b242
UnknownText_0x8b242: ; 0x8b242
; Sorry, an EGG doesn't qualify.
text_jump UnknownText_0x1c59a3
db "@"
; 0x8b247
JumpText_OnlyThreePkmnMayBeEntered: ; 0x8b247
; Only three #MON may be entered.
text_jump Text_OnlyThreePkmnMayBeEntered
db "@"
; 0x8b24c
JumpText_ThePkmnMustAllBeDifferentKinds: ; 0x8b24c
; The @ #MON must all be different kinds.
text_jump Text_ThePkmnMustAllBeDifferentKinds
db "@"
; 0x8b251
JumpText_ThePkmnMustNotHoldTheSameItems: ; 0x8b251
; The @ #MON must not hold the same items.
text_jump Text_ThePkmnMustNotHoldTheSameItems
db "@"
; 0x8b256
JumpText_YouCantTakeAnEgg: ; 0x8b256
; You can't take an EGG!
text_jump Text_YouCantTakeAnEgg
db "@"
; 0x8b25b
Function8b25b: ; 8b25b
ld bc, $0000
.asm_8b25e
call Function8b26c
call c, Function8b28e
call Function8b276
jr nz, .asm_8b25e
ld a, b
and a
ret
; 8b26c
Function8b26c: ; 8b26c
push de
push bc
call Function8b27a
ld a, c
rst JumpTable
pop bc
pop de
ret
; 8b276
Function8b276: ; 8b276
inc c
ld a, [de]
cp c
ret
; 8b27a
Function8b27a: ; 8b27a
inc de
ld a, [de]
ld l, a
inc de
ld a, [de]
ld h, a
ret
; 8b281
Function8b281: ; 8b281
rept 3
inc de
endr
ld a, [de]
ld l, a
inc de
ld a, [de]
ld h, a
ret
; 8b28a
Function8b28a: ; 8b28a
ld a, [hli]
ld h, [hl]
ld l, a
ret
; 8b28e
Function8b28e: ; 8b28e
push de
push bc
ld a, b
and a
call z, Function8b29d
pop bc
call Function8b2a9
ld b, $1
pop de
ret
; 8b29d
Function8b29d: ; 8b29d
push de
call Function8b281
call Function8b28a
call PrintText
pop de
ret
; 8b2a9
Function8b2a9: ; 8b2a9
push bc
call Function8b281
rept 2
inc hl
endr
ld b, $0
rept 2
add hl, bc
endr
call Function8b28a
call PrintText
pop bc
ret
; 8b2bb
Function8b2bb: ; 8b2bb
ld a, [PartyCount]
cp 3
ret
; 8b2c1
Function8b2c1: ; 8b2c1
ld hl, PartyCount
ld a, [hli]
ld b, $0
ld c, a
.asm_8b2c8
ld a, [hli]
cp EGG
jr z, .asm_8b2ce
inc b
.asm_8b2ce
dec c
jr nz, .asm_8b2c8
ld a, [PartyCount]
cp b
ret z
ld a, b
cp 3
ret
; 8b2da
Function_PartyCountEq3: ; 8b2da
ld a, [PartyCount]
cp 3
ret z
scf
ret
; 8b2e2
Function_PartySpeciesAreUnique: ; 8b2e2
ld hl, PartyMon1Species
call VerifyUniqueness
ret
; 8b2e9
VerifyUniqueness: ; 8b2e9
ld de, PartyCount
ld a, [de]
inc de
dec a
jr z, .done
ld b, a
.loop
push hl
push de
ld c, b
call .isegg
jr z, .next
ld a, [hl]
and a
jr z, .next
.loop2
call .nextmon
call .isegg
jr z, .next2
cp [hl]
jr z, .gotcha
.next2
dec c
jr nz, .loop2
.next
pop de
pop hl
call .nextmon
dec b
jr nz, .loop
.done
and a
ret
.gotcha
pop de
pop hl
scf
ret
; 8b31a
.nextmon: ; 8b31a
push bc
ld bc, PartyMon2 - PartyMon1
add hl, bc
inc de
pop bc
ret
; 8b322
.isegg: ; 8b322
push bc
ld b, a
ld a, [de]
cp EGG
ld a, b
pop bc
ret
; 8b32a
Function_PartyItemsAreUnique: ; 8b32a
ld hl, PartyMon1Item
call VerifyUniqueness
ret
; 8b331
Function_HasPartyAnEgg: ; 8b331
ld hl, PartyCount
ld a, [hli]
ld c, a
.loop
ld a, [hli]
cp EGG
jr z, .found
dec c
jr nz, .loop
and a
ret
.found
scf
ret
; 8b342

342
event/buena.asm Normal file
View File

@ -0,0 +1,342 @@
SpecialBuenasPassword: ; 8af6b
xor a
ld [wcf76], a
ld hl, MenuDataHeader_0x8afa9
call CopyMenuDataHeader
ld a, [wBuenasPassword]
ld c, a
callba GetBuenasPassword
ld a, [wMenuBorderLeftCoord]
add c
add $2
ld [wMenuBorderRightCoord], a
call BackUpTiles
call Function1e5d
callba Function4ae5e
ld b, $0
ld a, [MenuSelection]
ld c, a
ld a, [wBuenasPassword]
and $3
cp c
jr nz, .asm_8afa4
ld b, $1
.asm_8afa4
ld a, b
ld [ScriptVar], a
ret
; 8afa9
MenuDataHeader_0x8afa9: ; 0x8afa9
db $40 ; flags
db 00, 00 ; start coords
db 07, 10 ; end coords
dw MenuData2_0x8afb2
db 1 ; default option
; 0x8afb1
db 0
MenuData2_0x8afb2: ; 0x8afb2
db $81 ; flags
db 0 ; items
dw Unknown_8afb8
dw Function8afbd
; 0x8afb4
Unknown_8afb8: ; 8afb8
db 3
db 0, 1, 2
db -1
Function8afbd: ; 8afbd
push de
ld a, [wBuenasPassword]
and $f0
ld c, a
ld a, [MenuSelection]
add c
ld c, a
callba GetBuenasPassword
pop hl
call PlaceString
ret
; 8afd4
SpecialBuenaPrize: ; 8afd4
xor a
ld [wd0e4], a
ld a, $1
ld [MenuSelection], a
call Function8b0d6
call Function8b090
ld hl, UnknownText_0x8b072
call PrintText
jr .asm_8aff1
.asm_8afeb
ld hl, UnknownText_0x8b072
call Function105a
.asm_8aff1
call DelayFrame
call UpdateSprites
call Function8b097
call Function8b0e2
jr z, .asm_8b05f
ld [wcf75], a
call Buena_getprize
ld a, [hl]
ld [wd265], a
call GetItemName
ld hl, UnknownText_0x8b077
call Function105a
call YesNoBox
jr c, .asm_8afeb
ld a, [wcf75]
call Buena_getprize
inc hl
ld a, [hld]
ld c, a
ld a, [wBlueCardBalance]
cp c
jr c, .InsufficientBalance
ld a, [hli]
push hl
ld [CurItem], a
ld a, $1
ld [wd10c], a
ld hl, NumItems
call ReceiveItem
pop hl
jr nc, .asm_8b04c
ld a, [hl]
ld c, a
ld a, [wBlueCardBalance]
sub c
ld [wBlueCardBalance], a
call Function8b097
jr .asm_8b051
.InsufficientBalance
ld hl, UnknownText_0x8b081
jr .asm_8b05a
.asm_8b04c
ld hl, UnknownText_0x8b086
jr .asm_8b05a
.asm_8b051
ld de, SFX_TRANSACTION
call PlaySFX
ld hl, UnknownText_0x8b07c
.asm_8b05a
call Function105a
jr .asm_8afeb
.asm_8b05f
call WriteBackup
call WriteBackup
ld hl, UnknownText_0x8b08b
call PrintText
call JoyWaitAorB
call PlayClickSFX
ret
; 8b072
UnknownText_0x8b072: ; 0x8b072
; Which prize would you like?
text_jump UnknownText_0x1c589f
db "@"
; 0x8b077
UnknownText_0x8b077: ; 0x8b077
; ? Is that right?
text_jump UnknownText_0x1c58bc
db "@"
; 0x8b07c
UnknownText_0x8b07c: ; 0x8b07c
; Here you go!
text_jump UnknownText_0x1c58d1
db "@"
; 0x8b081
UnknownText_0x8b081: ; 0x8b081
; You don't have enough points.
text_jump UnknownText_0x1c58e0
db "@"
; 0x8b086
UnknownText_0x8b086: ; 0x8b086
; You have no room for it.
text_jump UnknownText_0x1c58ff
db "@"
; 0x8b08b
UnknownText_0x8b08b: ; 0x8b08b
; Oh. Please come back again!
text_jump UnknownText_0x1c591a
db "@"
; 0x8b090
Function8b090: ; 8b090
ld hl, MenuDataHeader_0x8b0d1
call LoadMenuDataHeader
ret
; 8b097
Function8b097: ; 8b097
ld de, wBlueCardBalance
call Function8b09e
ret
; 8b09e
Function8b09e: ; 8b09e
push de
xor a
ld [hBGMapMode], a
ld hl, MenuDataHeader_0x8b0d1
call CopyMenuDataHeader
call Function1cbb
call UpdateSprites
call GetMemTileCoord
ld bc, $0015
add hl, bc
ld de, .Points_string
call PlaceString
ld h, b
ld l, c
inc hl
ld a, $7f
ld [hli], a
ld [hld], a
pop de
lb bc, 1, 2
call PrintNum
ret
; 8b0ca
.Points_string:
db "Points@"
; 8b0d1
MenuDataHeader_0x8b0d1: ; 0x8b0d1
db $40 ; flags
db 11, 00 ; start coords
db 13, 11 ; end coords
; 8b0d6
Function8b0d6: ; 8b0d6
ld hl, .menudataheader
call LoadMenuDataHeader
ret
; 8b0dd
.menudataheader: ; 0x8b0dd
db $40 ; flags
db 00, 00 ; start coords
db 11, 17 ; end coords
; 8b0e2
Function8b0e2: ; 8b0e2
ld hl, .MenuDataHeader
call CopyMenuDataHeader
ld a, [MenuSelection]
ld [wPocketCursorBuffer], a
xor a
ld [wcf76], a
ld [hBGMapMode], a
call Function352f
call UpdateSprites
call Function350c
ld a, [MenuSelection]
ld c, a
ld a, [wcfa9]
ld [MenuSelection], a
ld a, [wcf73]
cp $2
jr z, .asm_8b111
ld a, c
and a
ret nz
.asm_8b111
xor a
ret
; 8b113
.MenuDataHeader: ; 0x8b113
db $40 ; flags
db 01, 01 ; start coords
db 09, 16 ; end coords
dw .MenuData2
db 1 ; default option
; 0x8b11b
db 0
.MenuData2: ; 0x8b11c
db $10 ; flags
db 4 ; items
db $d, $1
dba .indices
dba .prizeitem
dba .prizepoints
; 8b129
.indices: ; 8b129
db 9
db 1, 2, 3, 4, 5, 6, 7, 8, 9
db -1
; 8b134
.prizeitem: ; 8b134
ld a, [MenuSelection]
call Buena_getprize
ld a, [hl]
push de
ld [wNamedObjectIndexBuffer], a
call GetItemName
pop hl
call PlaceString
ret
; 8b147
.prizepoints: ; 8b147
ld a, [MenuSelection]
call Buena_getprize
inc hl
ld a, [hl]
ld c, "0"
add c
ld [de], a
ret
; 8b154
Buena_getprize: ; 8b154
dec a
ld hl, .prizes
ld b, 0
ld c, a
rept 2
add hl, bc
endr
ret
; 8b15e
.prizes: ; 8b15e
db ULTRA_BALL, 2
db FULL_RESTORE, 2
db NUGGET, 3
db RARE_CANDY, 3
db PROTEIN, 5
db IRON, 5
db CARBOS, 5
db CALCIUM, 5
db HP_UP, 5
; 8b170

415
event/kurt.asm Normal file
View File

@ -0,0 +1,415 @@
Kurt_PrintTextWhichApricorn: ; 88000
ld hl, UnknownText_0x88007
call PrintText
ret
; 88007
UnknownText_0x88007: ; 0x88007
; Which APRICORN should I use?
text_jump UnknownText_0x1bc06b
db "@"
; 0x8800c
Kurt_PrintTextHowMany: ; 8800c
ld hl, UnknownText_0x88013
call PrintText
ret
; 88013
UnknownText_0x88013: ; 0x88013
; How many should I make?
text_jump UnknownText_0x1bc089
db "@"
; 0x88018
Special_SelectApricornForKurt: ; 88018
call Function1d6e
ld c, $1
xor a
ld [wd0e4], a
ld [wKurtApricornQuantity], a
.loop
push bc
call Kurt_PrintTextWhichApricorn
pop bc
ld a, c
ld [MenuSelection], a
call Kurt_SelectApricorn
ld a, c
ld [ScriptVar], a
and a
jr z, .done
ld [CurItem], a
ld a, [wcfa9]
ld c, a
push bc
call Kurt_PrintTextHowMany
call Kurt_SelectQuantity
pop bc
jr nc, .loop
ld a, [wd10c]
ld [wKurtApricornQuantity], a
call Kurt_GiveUpSelectedQuantityOfSelectedApricorn
.done
call Function1d7d
ret
; 88055
Kurt_SelectApricorn: ; 88055
callba FindApricornsInBag
jr c, .nope
ld hl, .MenuDataHeader
call CopyMenuDataHeader
ld a, [MenuSelection]
ld [wPocketCursorBuffer], a
xor a
ld [hBGMapMode], a
call Function352f
call UpdateSprites
call Function350c
ld a, [wcf73]
cp $2
jr z, .nope
ld a, [MenuSelection]
cp -1
jr nz, .done
.nope
xor a
.done
ld c, a
ret
; 88086
.MenuDataHeader: ; 0x88086
db $40 ; flags
db 01, 01 ; start coords
db 10, 13 ; end coords
dw .MenuData2
db 1 ; default option
; 0x8808e
db 0
.MenuData2: ; 0x8808f
db $10 ; flags
db 4, 7
db 1
dbw 0, Buffer1
dbw BANK(.Name), .Name
dbw BANK(.Quantity), .Quantity
dbw BANK(NULL), NULL
.Name: ; 8809f
ld a, [MenuSelection]
and a
ret z
callba PlaceMenuItemName
ret
; 880ab
.Quantity: ; 880ab
ld a, [MenuSelection]
ld [CurItem], a
call Kurt_GetQuantityOfApricorn
ret z
ld a, [wd10c]
ld [wcf75], a
callba PlaceMenuItemQuantity
ret
; 880c2
Kurt_SelectQuantity: ; 880c2
ld a, [CurItem]
ld [MenuSelection], a
call Kurt_GetQuantityOfApricorn
jr z, .done
ld a, [wd10c]
ld [wd10d], a
ld a, $1
ld [wd10c], a
ld hl, .MenuDataHeader
call LoadMenuDataHeader
.loop
xor a
ld [hBGMapMode], a
call Function1cbb
call UpdateSprites
call .PlaceApricornName
call PlaceApricornQuantity
call Function321c
callba Function27a28
jr nc, .loop
push bc
call PlayClickSFX
pop bc
ld a, b
cp -1
jr z, .done
ld a, [wd10c]
ld [wd10c], a ; What is the point of this operation?
scf
.done
call WriteBackup
ret
; 8810d
.MenuDataHeader: ; 0x8810d
db $40 ; flags
db 09, 06 ; start coords
db 12, 19 ; end coords
db 0, 0, -1, 0 ; XXX
.PlaceApricornName: ; 88116
call GetMemTileCoord
ld de, $0015
add hl, de
ld d, h
ld e, l
callba PlaceMenuItemName
ret
; 88126
PlaceApricornQuantity: ; 88126
call GetMemTileCoord
ld de, $0032
add hl, de
ld [hl], "×"
inc hl
ld de, wd10c
lb bc, PRINTNUM_LEADINGZEROS | 1, 2
jp PrintNum
; 88139
Kurt_GetQuantityOfApricorn: ; 88139
push bc
ld hl, NumItems
ld a, [CurItem]
ld c, a
ld b, $0
.loop
inc hl
ld a, [hli]
cp -1
jr z, .done
cp c
jr nz, .loop
ld a, [hl]
add b
ld b, a
jr nc, .loop
ld b, -1
.done
ld a, b
sub 99
jr c, .done2
ld b, 99
.done2
ld a, b
ld [wd10c], a
and a
pop bc
ret
; 88161
Kurt_GiveUpSelectedQuantityOfSelectedApricorn: ; 88161
; Get the quantity of Apricorns of type [CurItem]
; in the bag. Compatible with multiple stacks.
; Initialize the search.
push de
push bc
ld hl, NumItems
ld a, [CurItem]
ld c, a
ld e, $0
xor a
ld [ItemCountBuffer], a
ld a, -1
ld [MiscBuffer2], a
; Search for [CurItem] in the bag.
.loop1
; Increase the total count.
ld a, [ItemCountBuffer]
inc a
ld [ItemCountBuffer], a
; Get the index of the next item.
inc hl
ld a, [hli]
; If we've reached the end of the pocket, break.
cp -1
jr z, .okay1
; If we haven't found what we're looking for, continue.
cp c
jr nz, .loop1
; Increment the result counter and store the bag index of the match.
ld d, $0
push hl
ld hl, MiscBuffer2
add hl, de
inc e
ld a, [ItemCountBuffer]
dec a
ld [hli], a
ld a, -1
ld [hl], a
pop hl
jr .loop1
.okay1
; How many stacks have we found?
ld a, e
and a
jr z, .done
dec a
jr z, .OnlyOne
ld hl, MiscBuffer2
.loop2
ld a, [hl]
ld c, a
push hl
.loop3
inc hl
ld a, [hl]
cp -1
jr z, .okay2
ld b, a
ld a, c
call Kurt_GetAddressOfApricornQuantity
ld e, a
ld a, b
call Kurt_GetAddressOfApricornQuantity
sub e
jr z, .equal
jr c, .less
jr .loop3
.equal
ld a, c
sub b
jr nc, .loop3
.less
ld a, c
ld c, b
ld [hl], a
ld a, c
pop hl
ld [hl], a
push hl
jr .loop3
.okay2
pop hl
inc hl
ld a, [hl]
cp -1
jr nz, .loop2
.OnlyOne
ld hl, MiscBuffer2
.loop4
ld a, [hl]
cp -1
jr z, .done
push hl
ld [ItemCountBuffer], a
call Kurt_GetRidOfItem
pop hl
ld a, [wd10c]
and a
jr z, .done
push hl
ld a, [hli]
ld c, a
.loop5
ld a, [hli]
cp -1
jr z, .okay3
cp c
jr c, .loop5
dec a
dec hl
ld [hli], a
jr .loop5
.okay3
pop hl
inc hl
jr .loop4
.done
ld a, [wd10c]
and a
pop bc
pop de
ret
; 88201
Kurt_GetAddressOfApricornQuantity: ; 88201
push hl
push bc
ld hl, NumItems
inc hl
ld c, a
ld b, $0
rept 2
add hl, bc
endr
inc hl
ld a, [hl]
pop bc
pop hl
ret
; 88211
Kurt_GetRidOfItem: ; 88211
push bc
ld hl, NumItems
ld a, [ItemCountBuffer]
ld c, a
ld b, $0
inc hl
rept 2
add hl, bc
endr
ld a, [CurItem]
ld c, a
ld a, [hli]
cp -1
jr z, .done
cp c
jr nz, .done
ld a, [wd10c]
ld c, a
ld a, [hl]
sub c
ld b, c
jr nc, .okay
add c
ld b, a
.okay
push bc
ld hl, NumItems
ld a, b
ld [wd10c], a
call TossItem
pop bc
ld a, c
sub b
.done
ld [wd10c], a
pop bc
ret
; 88248

View File

@ -1,12 +1,12 @@
Special_BankOfMom: ; 16218
ld a, [$ffaa]
ld a, [hInMenu]
push af
ld a, $1
ld [$ffaa], a
ld [hInMenu], a
xor a
ld [wcf63], a
ld [wJumptableIndex], a
.asm_16223
ld a, [wcf63]
ld a, [wJumptableIndex]
bit 7, a
jr nz, .asm_1622f
call Function16233
@ -14,15 +14,15 @@ Special_BankOfMom: ; 16218
.asm_1622f
pop af
ld [$ffaa], a
ld [hInMenu], a
ret
; 16233
Function16233: ; 16233
ld a, [wcf63]
ld a, [wJumptableIndex]
ld e, a
ld d, 0
ld hl, Jumptable_16242
ld hl, .jumptable
rept 2
add hl, de
endr
@ -32,75 +32,75 @@ endr
jp [hl]
; 16242
Jumptable_16242: ; 16242
dw Function16254
dw Function1626a
dw Function16290
dw Function162a8
dw Function162e0
dw Function16373
dw Function16406
dw Function1642d
dw Function16433
.jumptable: ; 16242
dw .CheckIfBankInitialized
dw .InitializeBank
dw .IsThisAboutYourMoney
dw .AccessBankOfMom
dw .StoreMoney
dw .TakeMoney
dw .StopOrStartSavingMoney
dw .AskDST
dw .JustDoWhatYouCan
; 16254
Function16254: ; 16254
ld a, [wd854]
.CheckIfBankInitialized: ; 16254
ld a, [wBankOfMomMode]
bit 7, a
jr nz, .asm_16264
jr nz, .savingmoneyalready
set 7, a
ld [wd854], a
ld [wBankOfMomMode], a
ld a, $1
jr .asm_16266
jr .done_0
.asm_16264
.savingmoneyalready
ld a, $2
.asm_16266
ld [wcf63], a
.done_0
ld [wJumptableIndex], a
ret
; 1626a
Function1626a: ; 1626a
.InitializeBank: ; 1626a
ld hl, UnknownText_0x16649
call PrintText
call YesNoBox
jr c, .asm_1627f
jr c, .DontSaveMoney
ld hl, UnknownText_0x1664e
call PrintText
ld a, $81
jr .asm_16281
ld a, %10000001
jr .done_1
.asm_1627f
ld a, $80
.DontSaveMoney
ld a, %10000000
.asm_16281
ld [wd854], a
.done_1
ld [wBankOfMomMode], a
ld hl, UnknownText_0x16653
call PrintText
ld a, $8
ld [wcf63], a
ld [wJumptableIndex], a
ret
; 16290
Function16290: ; 16290
.IsThisAboutYourMoney: ; 16290
ld hl, UnknownText_0x16658
call PrintText
call YesNoBox
jr c, .asm_1629f
jr c, .nope
ld a, $3
jr .asm_162a4
jr .done_2
.asm_1629f
.nope
call DSTChecks
ld a, $7
.asm_162a4
ld [wcf63], a
.done_2
ld [wJumptableIndex], a
ret
; 162a8
Function162a8: ; 162a8
.AccessBankOfMom: ; 162a8
ld hl, UnknownText_0x1665d
call PrintText
call Function1d6e
@ -108,36 +108,36 @@ Function162a8: ; 162a8
call CopyMenuDataHeader
call InterpretMenu2
call WriteBackup
jr c, .asm_162ce
jr c, .cancel
ld a, [wcfa9]
cp $1
jr z, .asm_162d2
jr z, .withdraw
cp $2
jr z, .asm_162d6
jr z, .deposit
cp $3
jr z, .asm_162da
jr z, .stopsaving
.asm_162ce
.cancel
ld a, $7
jr .asm_162dc
jr .done_3
.asm_162d2
.withdraw
ld a, $5
jr .asm_162dc
jr .done_3
.asm_162d6
.deposit
ld a, $4
jr .asm_162dc
jr .done_3
.asm_162da
.stopsaving
ld a, $6
.asm_162dc
ld [wcf63], a
.done_3
ld [wJumptableIndex], a
ret
; 162e0
Function162e0: ; 162e0
.StoreMoney: ; 162e0
ld hl, UnknownText_0x16662
call PrintText
xor a
@ -153,31 +153,31 @@ endr
call Function1656b
call Function16571
call WriteBackup
jr c, .asm_1636d
jr c, .CancelDeposit
ld hl, StringBuffer2
ld a, [hli]
or [hl]
inc hl
or [hl]
jr z, .asm_1636d
jr z, .CancelDeposit
ld de, Money
ld bc, StringBuffer2
callba CheckMoney
jr c, .asm_1635f
jr c, .DontHaveThatMuchToDeposit
ld hl, StringBuffer2
ld de, StringBuffer2 + 3
ld bc, $0003
ld bc, 3
call CopyBytes
ld bc, wd851
ld de, StringBuffer2
callba GiveMoney
jr c, .asm_16366
jr c, .CantDepositThatMuch
ld bc, StringBuffer2 + 3
ld de, Money
callba TakeMoney
ld hl, StringBuffer2
ld de, wd851
ld bc, $0003
ld bc, 3
call CopyBytes
ld de, SFX_TRANSACTION
call PlaySFX
@ -185,27 +185,27 @@ endr
ld hl, UnknownText_0x1668a
call PrintText
ld a, $8
jr .asm_1636f
jr .done_4
.asm_1635f
.DontHaveThatMuchToDeposit
ld hl, UnknownText_0x1667b
call PrintText
ret
.asm_16366
.CantDepositThatMuch
ld hl, UnknownText_0x16680
call PrintText
ret
.asm_1636d
.CancelDeposit
ld a, $7
.asm_1636f
ld [wcf63], a
.done_4
ld [wJumptableIndex], a
ret
; 16373
Function16373: ; 16373
.TakeMoney: ; 16373
ld hl, UnknownText_0x16667
call PrintText
xor a
@ -221,13 +221,13 @@ endr
call Function1656b
call Function16571
call WriteBackup
jr c, .asm_16400
jr c, .CancelWithdraw
ld hl, StringBuffer2
ld a, [hli]
or [hl]
inc hl
or [hl]
jr z, .asm_16400
jr z, .CancelWithdraw
ld hl, StringBuffer2
ld de, StringBuffer2 + 3
ld bc, 3
@ -235,11 +235,11 @@ endr
ld de, wd851
ld bc, StringBuffer2
callba CheckMoney
jr c, .asm_163f2
jr c, .InsufficientFundsInBank
ld bc, Money
ld de, StringBuffer2
callba GiveMoney
jr c, .asm_163f9
jr c, .NotEnoughRoomInWallet
ld bc, StringBuffer2 + 3
ld de, wd851
callba TakeMoney
@ -253,53 +253,53 @@ endr
ld hl, UnknownText_0x1668f
call PrintText
ld a, $8
jr .asm_16402
jr .done_5
.asm_163f2
.InsufficientFundsInBank
ld hl, UnknownText_0x16671
call PrintText
ret
.asm_163f9
.NotEnoughRoomInWallet
ld hl, UnknownText_0x16676
call PrintText
ret
.asm_16400
ld a, 7
.CancelWithdraw
ld a, $7
.asm_16402
ld [wcf63], a
.done_5
ld [wJumptableIndex], a
ret
; 16406
Function16406: ; 16406
.StopOrStartSavingMoney: ; 16406
ld hl, UnknownText_0x1666c
call PrintText
call YesNoBox
jr c, .asm_16422
jr c, .StopSavingMoney
ld a, $81
ld [wd854], a
ld [wBankOfMomMode], a
ld hl, UnknownText_0x16685
call PrintText
ld a, $8
ld [wcf63], a
ld [wJumptableIndex], a
ret
.asm_16422
.StopSavingMoney
ld a, $80
ld [wd854], a
ld [wBankOfMomMode], a
ld a, $7
ld [wcf63], a
ld [wJumptableIndex], a
ret
; 1642d
Function1642d: ; 1642d
.AskDST: ; 1642d
ld hl, UnknownText_0x16694
call PrintText
Function16433: ; 16433
ld hl, wcf63
.JustDoWhatYouCan: ; 16433
ld hl, wJumptableIndex
set 7, [hl]
ret
; 16439
@ -491,7 +491,7 @@ Function1656b: ; 1656b
Function16571: ; 16571
.loop
call Functiona57
call JoyTextDelay
ld hl, hJoyPressed
ld a, [hl]
and B_BUTTON

View File

@ -11,7 +11,7 @@ SEER_LEVEL_ONLY EQU 7
SpecialPokeSeer: ; 4f0bc
ld a, SEER_INTRO
call PrintSeerText
call Functiona36
call JoyWaitAorB
ld b, $6
callba SelectMonFromParty

300
event/unown.asm Normal file
View File

@ -0,0 +1,300 @@
SpecialHoOhChamber: ; 0x8addb
ld hl, PartySpecies
ld a, [hl]
cp HO_OH ; is Ho-oh the first Pokémon in the party?
jr nz, .done ; if not, we're done
call GetSecondaryMapHeaderPointer
ld de, EVENT_WALL_OPENED_IN_HO_OH_CHAMBER
ld b, SET_FLAG
call EventFlagAction
.done
ret
; 0x8adef
SpecialOmanyteChamber: ; 8adef
call GetSecondaryMapHeaderPointer
ld de, EVENT_WALL_OPENED_IN_OMANYTE_CHAMBER
ld b, CHECK_FLAG
call EventFlagAction
ld a, c
and a
jr nz, .nope
ld a, WATER_STONE
ld [CurItem], a
ld hl, NumItems
call CheckItem
jr c, .open
ld a, [PartyCount]
ld b, a
inc b
.loop
dec b
jr z, .nope
ld a, b
dec a
ld [CurPartyMon], a
push bc
ld a, PartyMon1Item - PartyMon1
call GetPartyParamLocation
pop bc
ld a, [hl]
cp WATER_STONE
jr nz, .loop
.open
call GetSecondaryMapHeaderPointer
ld de, EVENT_WALL_OPENED_IN_OMANYTE_CHAMBER
ld b, SET_FLAG
call EventFlagAction
.nope
ret
; 8ae30
SpecialAerodactylChamber: ; 8ae30
push de
push bc
call GetSecondaryMapHeaderPointer
ld a, h
cp RuinsofAlphAerodactylChamber_SecondMapHeader / $100
jr nz, .nope
ld a, l
cp RuinsofAlphAerodactylChamber_SecondMapHeader % $100
jr nz, .nope
ld de, EVENT_WALL_OPENED_IN_AERODACTYL_CHAMBER
ld b, SET_FLAG
call EventFlagAction
scf
jr .done
.nope
and a
.done
pop bc
pop de
ret
; 8ae4e
SpecialKabutoChamber: ; 8ae4e
push hl
push de
call GetSecondaryMapHeaderPointer
ld a, h
cp RuinsofAlphKabutoChamber_SecondMapHeader / $100
jr nz, .done
ld a, l
cp RuinsofAlphKabutoChamber_SecondMapHeader % $100
jr nz, .done
ld de, EVENT_WALL_OPENED_IN_KABUTO_CHAMBER
ld b, SET_FLAG
call EventFlagAction
.done
pop de
pop hl
ret
; 8ae68
Special_DisplayUnownWords: ; 8ae68
ld a, [ScriptVar]
ld hl, MenuDataHeader_0x8aed5
and a
jr z, .asm_8ae79
ld d, $0
ld e, $5
.asm_8ae75
add hl, de
dec a
jr nz, .asm_8ae75
.asm_8ae79
call LoadMenuDataHeader
xor a
ld [hBGMapMode], a
call Function1cbb
call UpdateSprites
call Function321c
call GetMemTileCoord
inc hl
ld d, $0
ld e, $14
rept 2
add hl, de
endr
ld a, [ScriptVar]
ld c, a
ld de, Unknown_8aebc
and a
jr z, .asm_8aea5
.asm_8ae9c
ld a, [de]
inc de
cp $ff
jr nz, .asm_8ae9c
dec c
jr nz, .asm_8ae9c
.asm_8aea5
call Function8af09
ld bc, AttrMap - TileMap
add hl, bc
call Function8aee9
call Function3200
call JoyWaitAorB
call PlayClickSFX
call WriteBackup
ret
; 8aebc
Unknown_8aebc: ; 8aebc
db $08, $44, $04, $00, $2e, $08, $ff
db $26, $20, $0c, $0e, $46, $ff
db $4c, $00, $46, $08, $42, $ff
db $0e, $2c, $64, $2c, $0e, $ff
; 8aed5
MenuDataHeader_0x8aed5: ; 0x8aed5
db $40 ; flags
db 04, 03 ; start coords
db 09, 16 ; end coords
MenuDataHeader_0x8aeda: ; 0x8aeda
db $40 ; flags
db 04, 04 ; start coords
db 09, 15 ; end coords
MenuDataHeader_0x8aedf: ; 0x8aedf
db $40 ; flags
db 04, 04 ; start coords
db 09, 15 ; end coords
MenuDataHeader_0x8aee4: ; 0x8aee4
db $40 ; flags
db 04, 04 ; start coords
db 09, 15 ; end coords
; 8aee9
Function8aee9: ; 8aee9
.asm_8aee9
ld a, [de]
cp $ff
ret z
cp $60
ld a, $d
jr c, .asm_8aef5
ld a, $5
.asm_8aef5
call Function8aefd
rept 2
inc hl
endr
inc de
jr .asm_8aee9
; 8aefd
Function8aefd: ; 8aefd
push hl
ld [hli], a
ld [hld], a
ld b, $0
ld c, $14
add hl, bc
ld [hli], a
ld [hl], a
pop hl
ret
; 8af09
Function8af09: ; 8af09
push hl
push de
.asm_8af0b
ld a, [de]
cp $ff
jr z, .asm_8af19
ld c, a
call Function8af1c
rept 2
inc hl
endr
inc de
jr .asm_8af0b
.asm_8af19
pop de
pop hl
ret
; 8af1c
Function8af1c: ; 8af1c
push hl
ld a, c
cp $60
jr z, .asm_8af3b
cp $62
jr z, .asm_8af4b
cp $64
jr z, .asm_8af5b
ld [hli], a
inc a
ld [hld], a
dec a
ld b, $0
ld c, $14
add hl, bc
ld c, $10
add c
ld [hli], a
inc a
ld [hl], a
pop hl
ret
.asm_8af3b
ld [hl], $5b
inc hl
ld [hl], $5c
ld bc, $0013
add hl, bc
ld [hl], $4d
inc hl
ld [hl], $5d
pop hl
ret
.asm_8af4b
ld [hl], $4e
inc hl
ld [hl], $4f
ld bc, $0013
add hl, bc
ld [hl], $5e
inc hl
ld [hl], $5f
pop hl
ret
.asm_8af5b
ld [hl], $2
inc hl
ld [hl], $3
ld bc, $0013
add hl, bc
ld [hl], $3
inc hl
ld [hl], $2
pop hl
ret
; 8af6b

Binary file not shown.

Before

Width:  |  Height:  |  Size: 139 B

After

Width:  |  Height:  |  Size: 153 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 348 B

After

Width:  |  Height:  |  Size: 388 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 180 B

After

Width:  |  Height:  |  Size: 195 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 282 B

After

Width:  |  Height:  |  Size: 373 B

View File

@ -3,7 +3,7 @@
Functiond0000: ; d0000
hlcoord 12, 0
ld a, [IsInBattle]
ld a, [wBattleMode]
cp $1
jr z, .asm_d0012
ld e, $0

View File

@ -95,7 +95,7 @@ Function2ecb:: ; 2ecb
; 2ed3
Function2ed3:: ; 0x2ed3
DisableSpriteUpdates:: ; 0x2ed3
; disables overworld sprite updating?
xor a
ld [$ffde], a
@ -107,7 +107,7 @@ Function2ed3:: ; 0x2ed3
ret
; 0x2ee4
Function2ee4:: ; 2ee4
EnableSpriteUpdates:: ; 2ee4
ld a, $1
ld [wc2ce], a
ld a, [VramState]
@ -157,7 +157,7 @@ IsInJohto:: ; 2f17
; 2f3e
Function2f3e:: ; 2f3e
ret_2f3e:: ; 2f3e
ret
; 2f3f
@ -605,24 +605,27 @@ Function3246:: ; 3246
push af
xor a
ld [hBGMapMode], a
ld a, [$ffde]
push af
xor a
ld [$ffde], a
.wait
ld a, [rLY]
cp $7f
jr c, .wait
di
ld a, $1
ld a, 1 ; BANK(VTiles3)
ld [rVBK], a
hlcoord 0, 0, AttrMap
call Function327b
ld a, $0
ld a, 0 ; BANK(VTiles0)
ld [rVBK], a
hlcoord 0, 0
call Function327b
.wait2
ld a, [rLY]
cp $7f
@ -637,30 +640,33 @@ Function3246:: ; 3246
; 327b
Function327b:: ; 327b
; Copy all tiles to VBGMap
ld [hSPBuffer], sp
ld sp, hl
ld a, [$ffd7]
ld a, [hBGMapAddress + 1]
ld h, a
ld l, 0
ld a, 18
ld a, SCREEN_HEIGHT
ld [$ffd3], a
ld b, 1 << 1 ; not in v/hblank
ld c, rSTAT % $100
.loop
rept 20 / 2
rept SCREEN_WIDTH / 2
pop de
; if in v/hblank, wait until not in v/hblank
.loop\@
ld a, [$ff00+c]
and b
jr nz, .loop\@
; load BGMap0
ld [hl], e
inc l
ld [hl], d
inc l
endr
ld de, 32 - 20
ld de, $20 - SCREEN_WIDTH
add hl, de
ld a, [$ffd3]
dec a
@ -836,7 +842,7 @@ Function33c0:
; 33c3
GetName:: ; 33c3
; Return name CurSpecies from name list wcf61 in StringBuffer1.
; Return name CurSpecies from name list wNamedObjectTypeBuffer in StringBuffer1.
ld a, [hROMBank]
push af
@ -844,7 +850,7 @@ GetName:: ; 33c3
push bc
push de
ld a, [wcf61]
ld a, [wNamedObjectTypeBuffer]
cp PKMN_NAME
jr nz, .NotPokeName
@ -858,7 +864,7 @@ GetName:: ; 33c3
jr .done
.NotPokeName
ld a, [wcf61]
ld a, [wNamedObjectTypeBuffer]
dec a
ld e, a
ld d, 0
@ -994,7 +1000,7 @@ GetItemName:: ; 3468
ld [CurSpecies], a
ld a, ITEM_NAME
ld [wcf61], a
ld [wNamedObjectTypeBuffer], a
call GetName
jr .Copied
.TM
@ -1123,7 +1129,7 @@ GetMoveName:: ; 34f8
push hl
ld a, MOVE_NAME
ld [wcf61], a
ld [wNamedObjectTypeBuffer], a
ld a, [wNamedObjectIndexBuffer] ; move id
ld [CurSpecies], a
@ -1163,16 +1169,16 @@ Function3524:: ; 3524
; 352f
Function352f:: ; 352f
ld a, [wcf82]
ld a, [wMenuBorderTopCoord]
dec a
ld b, a
ld a, [wcf84]
ld a, [wMenuBorderBottomCoord]
sub b
ld d, a
ld a, [wcf83]
ld a, [wMenuBorderLeftCoord]
dec a
ld c, a
ld a, [wcf85]
ld a, [wMenuBorderRightCoord]
sub c
ld e, a
push de
@ -1184,15 +1190,15 @@ Function352f:: ; 352f
Function354b:: ; 354b
call DelayFrame
ld a, [$ffaa]
ld a, [hInMenu]
push af
ld a, $1
ld [$ffaa], a
call Functiona57
ld [hInMenu], a
call JoyTextDelay
pop af
ld [$ffaa], a
ld [hInMenu], a
ld a, [$ffa9]
ld a, [hJoyLast]
and D_RIGHT + D_LEFT + D_UP + D_DOWN
ld c, a
ld a, [hJoyPressed]
@ -1599,7 +1605,7 @@ Function3718:: ; 3718
jr .ok
.canlose
ld a, [wd0ee]
ld a, [wBattleResult]
ld hl, WalkingTile
and $f
jr z, .ok
@ -1736,7 +1742,7 @@ PrintLevel:: ; 382d
; Print TempMonLevel at hl
ld a, [TempMonLevel]
ld [hl], LV_CHAR
ld [hl], "<LV>"
inc hl
; How many digits?
@ -1752,7 +1758,7 @@ PrintLevel:: ; 382d
Function383d:: ; 383d
; Print :L and all 3 digits
ld [hl], LV_CHAR
ld [hl], "<LV>"
inc hl
ld c, 3
; 3842
@ -1766,7 +1772,7 @@ Function3842:: ; 3842
Function384d:: ; 384d
ld hl, wd25e
ld hl, wListMoves_MoveIndicesBuffer
ld c, a
ld b, 0
add hl, bc
@ -2220,8 +2226,8 @@ Function3f6e:: ; 3f6e
; 3f7c
Function3f7c:: ; 3f7c
call Function1cfd
call Function1c53
call GetMemTileCoord
call GetMenuBoxDims
dec b
dec c
call Function3eea

View File

@ -106,7 +106,7 @@ UpdateEnemyMonInParty:: ; 39b0
; Update level, status, current HP
; No wildmons.
ld a, [IsInBattle]
ld a, [wBattleMode]
dec a
ret z
@ -194,34 +194,6 @@ endr
dw .status, .statusopp, .animation, .effect, .power, .type
dw .curmove, .lastcounter, .lastcounteropp, .lastmove, .lastmoveopp
const_def
const PLAYER_SUBSTATUS_1
const ENEMY_SUBSTATUS_1
const PLAYER_SUBSTATUS_2
const ENEMY_SUBSTATUS_2
const PLAYER_SUBSTATUS_3
const ENEMY_SUBSTATUS_3
const PLAYER_SUBSTATUS_4
const ENEMY_SUBSTATUS_4
const PLAYER_SUBSTATUS_5
const ENEMY_SUBSTATUS_5
const PLAYER_STATUS
const ENEMY_STATUS
const PLAYER_MOVE_ANIMATION
const ENEMY_MOVE_ANIMATION
const PLAYER_MOVE_EFFECT
const ENEMY_MOVE_EFFECT
const PLAYER_MOVE_POWER
const ENEMY_MOVE_POWER
const PLAYER_MOVE_TYPE
const ENEMY_MOVE_TYPE
const PLAYER_CUR_MOVE
const ENEMY_CUR_MOVE
const PLAYER_COUNTER_MOVE
const ENEMY_COUNTER_MOVE
const PLAYER_LAST_MOVE
const ENEMY_LAST_MOVE
; player enemy
.substatus1 db PLAYER_SUBSTATUS_1, ENEMY_SUBSTATUS_1
.substatus1opp db ENEMY_SUBSTATUS_1, PLAYER_SUBSTATUS_1
@ -293,8 +265,8 @@ CELL_PHONE_TOP EQU $5e
CELL_PHONE_BOTTOM EQU $5f
; For mobile link battles only.
ld a, [InLinkBattle]
cp 4
ld a, [wLinkMode]
cp LINK_MOBILE
ret c
; Draw a cell phone icon at the

View File

@ -117,8 +117,8 @@ Functione51:: ; e51
ret
; e58
Functione58:: ; e58
callba Functionfb4be
LoadFontsBattleExtra:: ; e58
callba _LoadFontsBattleExtra
ret
; e5f
@ -211,6 +211,7 @@ endr
Request2bpp:: ; eba
; Load 2bpp at b:de to occupy c tiles of hl.
ld a, [hBGMapMode]
push af
xor a
@ -223,19 +224,19 @@ Request2bpp:: ; eba
ld a, [$ffd3]
push af
ld a, $8
ld [$ffd3], a
ld a, [InLinkBattle]
cp $4
jr nz, .asm_edc
ld a, [$ffe9]
ld a, [wLinkMode]
cp LINK_MOBILE
jr nz, .NotMobile
ld a, [hMobile]
and a
jr nz, .asm_edc
jr nz, .NotMobile
ld a, $6
ld [$ffd3], a
.asm_edc
.NotMobile
ld a, e
ld [Requested2bppSource], a
ld a, d
@ -244,12 +245,11 @@ Request2bpp:: ; eba
ld [Requested2bppDest], a
ld a, h
ld [Requested2bppDest + 1], a
.asm_eec
.loop
ld a, c
ld hl, $ffd3
cp [hl]
jr nc, .asm_f08
jr nc, .iterate
ld [Requested2bpp], a
.wait
@ -268,19 +268,21 @@ Request2bpp:: ; eba
ld [hBGMapMode], a
ret
.asm_f08
.iterate
ld a, [$ffd3]
ld [Requested2bpp], a
.asm_f0d
.wait2
call DelayFrame
ld a, [Requested2bpp]
and a
jr nz, .asm_f0d
jr nz, .wait2
ld a, c
ld hl, $ffd3
sub [hl]
ld c, a
jr .asm_eec
jr .loop
; f1e
@ -300,16 +302,16 @@ Request1bpp:: ; f1e
ld a, $8
ld [$ffd3], a
ld a, [InLinkBattle]
cp $4
jr nz, .asm_f40
ld a, [$ffe9]
ld a, [wLinkMode]
cp LINK_MOBILE
jr nz, .NotMobile
ld a, [hMobile]
and a
jr nz, .asm_f40
jr nz, .NotMobile
ld a, $6
ld [$ffd3], a
.asm_f40
.NotMobile
ld a, e
ld [Requested1bppSource], a
ld a, d
@ -318,11 +320,11 @@ Request1bpp:: ; f1e
ld [Requested1bppDest], a
ld a, h
ld [Requested1bppDest + 1], a
.asm_f50
.loop
ld a, c
ld hl, $ffd3
cp [hl]
jr nc, .asm_f6c
jr nc, .iterate
ld [Requested1bpp], a
.wait
@ -341,19 +343,21 @@ Request1bpp:: ; f1e
ld [hBGMapMode], a
ret
.asm_f6c
.iterate
ld a, [$ffd3]
ld [Requested1bpp], a
.asm_f71
.wait2
call DelayFrame
ld a, [Requested1bpp]
and a
jr nz, .asm_f71
jr nz, .wait2
ld a, c
ld hl, $ffd3
sub [hl]
ld c, a
jr .asm_f50
jr .loop
; f82

View File

@ -136,15 +136,14 @@ Init:: ; 17d
; BG on
ld [rLCDC], a
ld a, $ff
ld a, -1
ld [$ffcb], a
callba Function9890
ld a, $9c
ld [$ffd7], a
xor a
ld a, VBGMap1 / $100
ld [hBGMapAddress + 1], a
xor a ; VBGMap1 % $100
ld [hBGMapAddress], a
callba StartClock

View File

@ -39,7 +39,7 @@ Joypad:: ; 935
; We can only get four inputs at a time.
; We take d-pad first for no particular reason.
ld a, D_PAD
ld a, R_DPAD
ld [rJOYP], a
; Read twice to give the request time to take.
rept 2
@ -57,7 +57,7 @@ endr
; Buttons make 8 total inputs (A, B, Select, Start).
; We can fit this into one byte.
ld a, BUTTONS
ld a, R_BUTTONS
ld [rJOYP], a
; Wait for input to stabilize.
rept 6
@ -198,14 +198,14 @@ GetJoypad:: ; 984
.updateauto
; An input of $ff will end the stream.
ld a, [hli]
cp a, $ff
cp a, -1
jr z, .stopauto
ld b, a
; A duration of $ff will end the stream indefinitely.
ld a, [hli]
ld [AutoInputLength], a
cp a, $ff
cp a, -1
jr nz, .next
; The current input is overwritten.
@ -273,42 +273,44 @@ StopAutoInput:: ; a0a
; a1b
Functiona1b:: ; a1b
JoyTitleScreenInput:: ; a1b
.loop
call DelayFrame
push bc
call Functiona57
call JoyTextDelay
pop bc
ld a, [hJoyDown]
cp D_UP | SELECT | B_BUTTON
jr z, .asm_a34
jr z, .keycombo
ld a, [$ffa9]
ld a, [hJoyLast]
and START | A_BUTTON
jr nz, .asm_a34
jr nz, .keycombo
dec c
jr nz, Functiona1b
jr nz, .loop
and a
ret
.asm_a34
.keycombo
scf
ret
; a36
Functiona36:: ; a36
JoyWaitAorB:: ; a36
.loop
call DelayFrame
call GetJoypad
ld a, [hJoyPressed]
and A_BUTTON | B_BUTTON
ret nz
call RTC
jr Functiona36
jr .loop
; a46
CloseText:: ; a46
@ -317,37 +319,37 @@ CloseText:: ; a46
ld a, 1
ld [hOAMUpdate], a
call WaitBGMap
call Functiona36
call JoyWaitAorB
pop af
ld [hOAMUpdate], a
ret
; a57
Functiona57:: ; a57
JoyTextDelay:: ; a57
call GetJoypad
ld a, [$ffaa]
ld a, [hInMenu]
and a
ld a, [hJoyPressed]
jr z, .asm_a63
jr z, .ok
ld a, [hJoyDown]
.asm_a63
.ok
ld [hJoyLast], a
ld a, [hJoyPressed]
and a
jr z, .asm_a70
jr z, .checkframedelay
ld a, 15
ld [TextDelayFrames], a
ret
.asm_a70
.checkframedelay
ld a, [TextDelayFrames]
and a
jr z, .asm_a7a
jr z, .restartframedelay
xor a
ld [hJoyLast], a
ret
.asm_a7a
.restartframedelay
ld a, 5
ld [TextDelayFrames], a
ret
@ -356,90 +358,95 @@ Functiona57:: ; a57
Functiona80:: ; a80
ld a, [hConnectionStripLength]
push af
ld a, [$ffb0]
ld a, [hConnectedMapWidth]
push af
xor a
ld [hConnectionStripLength], a
ld a, $6
ld [$ffb0], a
.asm_a8d
ld a, 6
ld [hConnectedMapWidth], a
.loop
push hl
hlcoord 18, 17
call Functionb06
pop hl
call Functiona57
ld a, [$ffa9]
and $3
jr z, .asm_a8d
call JoyTextDelay
ld a, [hJoyLast]
and A_BUTTON | B_BUTTON
jr z, .loop
pop af
ld [$ffb0], a
ld [hConnectedMapWidth], a
pop af
ld [hConnectionStripLength], a
ret
; aa5
Functionaa5:: ; aa5
call Functiona57
ld a, [$ffa9]
.loop
call JoyTextDelay
ld a, [hJoyLast]
and A_BUTTON | B_BUTTON
jr z, Functionaa5
jr z, .loop
ret
; aaf
KeepTextOpen:: ; aaf
ld a, [InLinkBattle]
ld a, [wLinkMode]
and a
jr nz, .asm_ac1
call Functionac6
jr nz, .link
call .wait_input
push de
ld de, SFX_READ_TEXT_2
call PlaySFX
pop de
ret
.asm_ac1
.link
ld c, 65
jp DelayFrames
; ac6
Functionac6:: ; ac6
.wait_input: ; ac6
ld a, [hOAMUpdate]
push af
ld a, $1
ld [hOAMUpdate], a
ld a, [InputType]
or a
jr z, .asm_ad9
callba Function1de28a
.asm_ad9
call Functionaf5
call Functiona57
jr z, .input_wait_loop
callba _DudeAutoInput_A
.input_wait_loop
call .blink_cursor
call JoyTextDelay
ld a, [hJoyPressed]
and $3
jr nz, .asm_af1
and A_BUTTON | B_BUTTON
jr nz, .received_input
call RTC
ld a, $1
ld [hBGMapMode], a
call DelayFrame
jr .asm_ad9
jr .input_wait_loop
.asm_af1
.received_input
pop af
ld [hOAMUpdate], a
ret
; af5
Functionaf5:: ; af5
.blink_cursor: ; af5
ld a, [$ff9b]
and $10
jr z, .asm_aff
ld a, $ee
jr .asm_b02
and %00010000 ; bit 4, a
jr z, .cursor_off
ld a, "▼"
jr .load_cursor_state
.asm_aff
.cursor_off
ld a, [TileMap + 17 + 17 * SCREEN_WIDTH]
.asm_b02
.load_cursor_state
ld [TileMap + 18 + 17 * SCREEN_WIDTH], a
ret
; b06
@ -448,7 +455,7 @@ Functionb06:: ; b06
push bc
ld a, [hl]
ld b, a
ld a, $ee
ld a, "▼"
cp b
pop bc
jr nz, .asm_b27
@ -456,16 +463,16 @@ Functionb06:: ; b06
dec a
ld [hConnectionStripLength], a
ret nz
ld a, [$ffb0]
ld a, [hConnectedMapWidth]
dec a
ld [$ffb0], a
ld [hConnectedMapWidth], a
ret nz
ld a, $7a
ld a, "─"
ld [hl], a
ld a, $ff
ld a, -1
ld [hConnectionStripLength], a
ld a, $6
ld [$ffb0], a
ld a, 6
ld [hConnectedMapWidth], a
ret
.asm_b27
@ -477,12 +484,12 @@ Functionb06:: ; b06
ret nz
dec a
ld [hConnectionStripLength], a
ld a, [$ffb0]
ld a, [hConnectedMapWidth]
dec a
ld [$ffb0], a
ld [hConnectedMapWidth], a
ret nz
ld a, $6
ld [$ffb0], a
ld [hConnectedMapWidth], a
ld a, $ee
ld [hl], a
ret

View File

@ -214,7 +214,7 @@ Function222a:: ; 222a
ret
; 2238
Function2238:: ; 2238
CheckWarpTile:: ; 2238
call Function2252
ret nc
push bc
@ -258,11 +258,11 @@ Function2266:: ; 2266
ld a, [MapX]
sub $4
ld d, a
ld a, [wdbfb]
ld a, [wCurrMapWarpCount]
and a
ret z
ld c, a
ld hl, wdbfc
ld hl, wCurrMapWarpHeaderPointer
ld a, [hli]
ld h, [hl]
ld l, a
@ -294,7 +294,7 @@ Function2266:: ; 2266
pop hl
call Function22a3
ret nc
ld a, [wdbfb]
ld a, [wCurrMapWarpCount]
inc a
sub c
ld c, a
@ -325,7 +325,7 @@ Function22a7:: ; 22a7
Function22b4:: ; 22b4
push bc
ld hl, wdbfc
ld hl, wCurrMapWarpHeaderPointer
ld a, [hli]
ld h, [hl]
ld l, a
@ -439,8 +439,8 @@ Function234f:: ; 234f
ld a, [hli]
ld h, [hl]
ld l, a
call Function23ac
call Function23c3
call ReadMapTriggers
call ReadMapCallbacks
ret
; 235c
@ -507,34 +507,36 @@ GetMapConnection:: ; 23a3
; 23ac
Function23ac:: ; 23ac
ld a, [hli]
ReadMapTriggers:: ; 23ac
ld a, [hli] ; trigger count
ld c, a
ld [wdc07], a
ld [wCurrMapTriggerCount], a ; current map trigger count
ld a, l
ld [wdc07 + 1], a
ld [wCurrMapTriggerHeaderPointer], a ; map trigger pointer
ld a, h
ld [wdc09], a
ld a, c
and a
ret z
ld bc, $0004
ld bc, 4 ; size of a map trigger header entry
call AddNTimes
ret
; 23c3
Function23c3:: ; 23c3
ReadMapCallbacks:: ; 23c3
ld a, [hli]
ld c, a
ld [wdc0a], a
ld [wCurrMapCallbackCount], a
ld a, l
ld [wdc0b], a
ld [wCurrMapCallbackHeaderPointer], a
ld a, h
ld [wdc0b + 1], a
ld [wCurrMapCallbackHeaderPointer + 1], a
ld a, c
and a
ret z
ld bc, $0003
ld bc, 3
call AddNTimes
ret
; 23da
@ -542,9 +544,9 @@ Function23c3:: ; 23c3
ReadWarps:: ; 23da
ld a, [hli]
ld c, a
ld [wdbfb], a
ld [wCurrMapWarpCount], a
ld a, l
ld [wdbfc], a
ld [wCurrMapWarpHeaderPointer], a
ld a, h
ld [wdbfd], a
ld a, c
@ -560,7 +562,7 @@ ReadCoordEvents:: ; 23f1
ld c, a
ld [wCurrentMapXYTriggerCount], a
ld a, l
ld [wdbff], a
ld [wCurrentMapXYTriggerHeaderPointer], a
ld a, h
ld [wdc00], a
ld a, c
@ -1000,11 +1002,11 @@ RunMapCallback:: ; 263b
; 2653
Function2653:: ; 2653
ld a, [wdc0a]
ld a, [wCurrMapCallbackCount]
ld c, a
and a
ret z
ld hl, wdc0b
ld hl, wCurrMapCallbackHeaderPointer
ld a, [hli]
ld h, [hl]
ld l, a
@ -1896,7 +1898,7 @@ CheckCurrentMapXYTriggers:: ; 2ad4
CheckStandingOnXYTrigger:: ; 2ae7
; Checks to see if you are standing on an xy-trigger. If yes, copies the trigger to EngineBuffer1 and sets carry.
ld hl, wdbff
ld hl, wCurrentMapXYTriggerHeaderPointer
ld a, [hli]
ld h, [hl]
ld l, a
@ -1958,7 +1960,7 @@ FadeToMenu:: ; 2b29
call Function1d6e
callba FadeBlackBGMap
call ClearSprites
call Function2ed3
call DisableSpriteUpdates
ret
; 2b3c
@ -1986,7 +1988,7 @@ Function2b5c:: ; 2b5c
callba Function49409
call Function3200
callba FadeInBGMap
call Function2ee4
call EnableSpriteUpdates
ret
; 2b74

View File

@ -1,14 +1,14 @@
; Functions used in displaying and handling menus.
LoadMenuDataHeader:: ; 0x1d35
LoadMenuDataHeader::
call CopyMenuDataHeader
call Function1c00
call BackUpTiles
ret
CopyMenuDataHeader:: ; 0x1d3c
CopyMenuDataHeader::
ld de, wcf81
ld bc, $0010
ld bc, 16
call CopyBytes
ld a, [hROMBank]
ld [wcf8a], a
@ -16,7 +16,7 @@ CopyMenuDataHeader:: ; 0x1d3c
; 0x1d4b
Function1d4b:: ; 1d4b
ld [wcf88], a
ld [wPocketCursorBuffer], a
ret
; 1d4f
@ -71,7 +71,7 @@ Function1d7d:: ; 1d7d
ret
; 1d81
InterpretMenu2:: ; 0x1d81
InterpretMenu2::
xor a
ld [hBGMapMode], a
call Function1cbb
@ -81,16 +81,16 @@ InterpretMenu2:: ; 0x1d81
call Function1c66
ld a, [wcf91]
bit 7, a
jr z, .asm_1da7 ; 0x1d98 $d
jr z, .cancel
call Function1c10
call Function1bc9
call Function1ff8
bit 1, a
jr z, .asm_1da9 ; 0x1da5 $2
.asm_1da7
jr z, .okay
.cancel
scf
ret
.asm_1da9
.okay
and a
ret
; 0x1dab
@ -103,7 +103,7 @@ GetMenu2:: ; 1dab
ret
; 1db8
Function1db8:: ; 0x1db8
Function1db8::
push hl
push bc
push af
@ -131,9 +131,9 @@ YesNoBox:: ; 1dcf
PlaceYesNoBox:: ; 1dd2
jr _YesNoBox
Function1dd4:: ; 1dd4
PlaceGenericTwoOptionBox:: ; 1dd4
call LoadMenuDataHeader
jr Function1dfe
jr InterpretTwoOptionMenu
_YesNoBox:: ; 1dd9
; Return nc (yes) or c (no).
@ -141,39 +141,41 @@ _YesNoBox:: ; 1dd9
ld hl, YesNoMenuDataHeader
call CopyMenuDataHeader
pop bc
; This seems to be an overflow prevention, but
; it was coded wrong.
ld a, b
cp $e
jr nz, .asm_1de9
ld a, $e
cp SCREEN_WIDTH - 6
jr nz, .okay ; should this be "jr nc"?
ld a, SCREEN_WIDTH - 6
ld b, a
.asm_1de9
.okay
ld a, b
ld [wcf83], a
ld [wMenuBorderLeftCoord], a
add $5
ld [wcf85], a
ld [wMenuBorderRightCoord], a
ld a, c
ld [wcf82], a
ld [wMenuBorderTopCoord], a
add $4
ld [wcf84], a
call Function1c00
ld [wMenuBorderBottomCoord], a
call BackUpTiles
Function1dfe:: ; 1dfe
InterpretTwoOptionMenu:: ; 1dfe
call InterpretMenu2
push af
ld c, $f
call DelayFrames
call WriteBackup
pop af
jr c, .asm_1e16
jr c, .no
ld a, [wcfa9]
cp 2 ; no
jr z, .asm_1e16
jr z, .no
and a
ret
.asm_1e16
ld a, $2
.no
ld a, 2
ld [wcfa9], a
scf
ret
@ -196,7 +198,7 @@ YesNoMenuData2:: ; 1e25
Function1e2e:: ; 1e2e
call Function1e35
call Function1c00
call BackUpTiles
ret
; 1e35
@ -204,24 +206,24 @@ Function1e35:: ; 1e35
push de
call CopyMenuDataHeader
pop de
ld a, [wcf83]
ld a, [wMenuBorderLeftCoord]
ld h, a
ld a, [wcf85]
ld a, [wMenuBorderRightCoord]
sub h
ld h, a
ld a, d
ld [wcf83], a
ld [wMenuBorderLeftCoord], a
add h
ld [wcf85], a
ld a, [wcf82]
ld [wMenuBorderRightCoord], a
ld a, [wMenuBorderTopCoord]
ld l, a
ld a, [wcf84]
ld a, [wMenuBorderBottomCoord]
sub l
ld l, a
ld a, e
ld [wcf82], a
ld [wMenuBorderTopCoord], a
add l
ld [wcf84], a
ld [wMenuBorderBottomCoord], a
ret
; 1e5d
@ -243,14 +245,14 @@ SetUpMenu:: ; 1e70
set 7, [hl]
ret
MenuFunc_1e7f:: ; 0x1e7f
MenuFunc_1e7f::
call Function1c66
call Function1ebd
call Function1ea6
call Function1cbb
ret
MenuWriteText:: ; 0x1e8c
MenuWriteText::
xor a
ld [hBGMapMode], a
call Function1ebd ; sort out the text
@ -267,18 +269,18 @@ MenuWriteText:: ; 0x1e8c
; 0x1ea6
Function1ea6:: ; 1ea6
ld a, [wcf83]
ld a, [wMenuBorderLeftCoord]
ld c, a
ld a, [wcf85]
ld a, [wMenuBorderRightCoord]
sub c
ld c, a
ld a, [wcf92]
add a
inc a
ld b, a
ld a, [wcf82]
ld a, [wMenuBorderTopCoord]
add b
ld [wcf84], a
ld [wMenuBorderBottomCoord], a
ret
; 1ebd
@ -308,7 +310,7 @@ Function1ebd:: ; 1ebd
; 1eda
Function1eda:: ; 1eda
call Function1cfd
call GetMemTileCoord
ld bc, $002a
add hl, bc
.asm_1ee1
@ -408,7 +410,7 @@ Function1f2a:: ; 1f2a
ld a, [hl]
ld [MenuSelection], a
ld a, [wcfa9]
ld [wcf88], a
ld [wPocketCursorBuffer], a
and a
ret
@ -484,21 +486,23 @@ endr
ret
; 1fbf
Function1fbf:: ; 1fbf
ResetTextRelatedRAM:: ; 1fbf
ld hl, wcf71
call Function1ff0
call .bytefill
ld hl, wcf81
call Function1ff0
call .bytefill
ld hl, wcf91
call Function1ff0
call .bytefill
ld hl, wcfa1
call Function1ff0
call .bytefill
ld a, [rSVBK]
push af
ld a, $7
ld [rSVBK], a
xor a
ld hl, $dfff
ld hl, w7_dfff
rept 2
ld [hld], a
endr
@ -506,12 +510,13 @@ endr
ld [wcf71], a
ld a, h
ld [wcf72], a
pop af
ld [rSVBK], a
ret
; 1ff0
Function1ff0:: ; 1ff0
.bytefill: ; 1ff0
ld bc, $0010
xor a
call ByteFill
@ -521,13 +526,13 @@ Function1ff0:: ; 1ff0
Function1ff8:: ; 1ff8
push af
and $3
jr z, .asm_2007
jr z, .nosound
ld hl, wcf81
bit 3, [hl]
jr nz, .asm_2007
jr nz, .nosound
call PlayClickSFX
.asm_2007
.nosound
pop af
ret
; 2009
@ -566,7 +571,7 @@ InterpretMenu:: ; 202a
ld a, [hROMBank]
ld [wcf94], a
callba Function2400e
ld a, [wcf88]
ld a, [wPocketCursorBuffer]
ret
; 2039
@ -574,7 +579,7 @@ Function2039:: ; 2039
ld a, [hROMBank]
ld [wcf94], a
callba Function24022
ld a, [wcf88]
ld a, [wPocketCursorBuffer]
ret
; 2048
@ -582,7 +587,7 @@ Function2048:: ; 2048
ld a, [hROMBank]
ld [wcf94], a
callba Function2403c
ld a, [wcf88]
ld a, [wPocketCursorBuffer]
ret
; 2057

View File

@ -74,9 +74,9 @@ Timer:: ; 3e93
push de
push hl
ld a, [$ffe9]
ld a, [hMobile]
and a
jr z, .asm_3ed2
jr z, .pop_ret
xor a
ld [rTAC], a
@ -88,15 +88,15 @@ Timer:: ; 3e93
ld a, [$c86a]
or a
jr z, .asm_3ed2
jr z, .pop_ret
ld a, [$c822]
bit 1, a
jr nz, .asm_3eca
jr nz, .skip_Function1118de
ld a, [rSC]
and 1 << rSC_ON
jr nz, .asm_3eca
jr nz, .skip_Function1118de
ld a, [hROMBank]
push af
@ -111,14 +111,14 @@ Timer:: ; 3e93
ld [$c981], a
rst Bankswitch
.asm_3eca
.skip_Function1118de
ld a, [rTMA]
ld [rTIMA], a
ld a, 1 << rTAC_ON | rTAC_65536_HZ
ld [rTAC], a
.asm_3ed2
.pop_ret
pop hl
pop de
pop bc

View File

@ -159,11 +159,11 @@ Function1bd3:: ; 1bd3
Function1bdd:: ; 1bdd
push bc
push af
ld a, [$ffa9]
and $f0
ld a, [hJoyLast]
and D_PAD
ld b, a
ld a, [hJoyPressed]
and $f
and BUTTONS
or b
ld b, a
pop af
@ -190,33 +190,3 @@ Function1bf7:: ; 1bf7
ret
; 1c00
Function1c00:: ; 1c00
callab Function24374
ret
; 1c07
ExitMenu:: ; 0x1c07
push af
callab Function243e8
pop af
ret
Function1c10:: ; 0x1c10
callab Function2446d
ret
WriteBackup:: ; 0x1c17
push af
call ExitMenu
call Function321c
call UpdateSprites
pop af
ret
Function1c23:: ; 0x1c23
call Function1cfd
call Function1c30
call Function1d19
call Function1c30
ret
; 0x1c30

View File

@ -79,6 +79,7 @@ DmgToCgbBGPals:: ; c9f
ld [rBGP], a
push af
; Don't need to be here if CGB
ld a, [hCGB]
and a
jr z, .end
@ -89,7 +90,7 @@ DmgToCgbBGPals:: ; c9f
ld a, [rSVBK]
push af
ld a, 5
ld a, 5 ; gfx
ld [rSVBK], a
; copy & reorder bg pal buffer
@ -165,16 +166,21 @@ DmgToCgbObjPals:: ; ccb
Functioncf8:: ; cf8
ld [rOBP0], a
push af
; Don't need to be here if CGB
ld a, [hCGB]
and a
jr z, .asm_d22
jr z, .done
push hl
push de
push bc
ld a, [rSVBK]
push af
ld a, $5
ld a, 5 ; gfx
ld [rSVBK], a
ld hl, OBPals
ld de, Unkn2Pals
ld a, [rOBP0]
@ -183,13 +189,15 @@ Functioncf8:: ; cf8
call CopyPals
ld a, $1
ld [hCGBPalUpdate], a
pop af
ld [rSVBK], a
pop bc
pop de
pop hl
.asm_d22
.done
pop af
ret
; d24

View File

@ -15,7 +15,7 @@ Serial:: ; 6ef
jr nz, .asm_721
ld a, [$ffcb]
inc a
inc a ; is it equal to -1?
jr z, .asm_726
ld a, [rSB]
@ -334,7 +334,7 @@ Function87d:: ; 87d
Function8c1:: ; 8c1
push bc
ld b, $60
ld a, [InLinkBattle]
ld a, [wLinkMode]
cp $1
jr z, .asm_8d7
ld b, $60
@ -391,7 +391,7 @@ Function908:: ; 908
; 919
Function919:: ; 919
ld a, [InLinkBattle]
ld a, [wLinkMode]
and a
ret nz
ld a, $2

View File

@ -17,19 +17,19 @@ ClearBox:: ; fb6
ld a, " "
FillBoxWithByte::
.col
.row
push bc
push hl
.row
.col
ld [hli], a
dec c
jr nz, .row
jr nz, .col
pop hl
ld bc, SCREEN_WIDTH
add hl, bc
pop bc
dec b
jr nz, .col
jr nz, .row
ret
; fc8
@ -61,8 +61,11 @@ ClearScreen:: ; fdb
TextBox:: ; fe8
; Draw a text box width c height b at hl.
; Dimensions do not include the border.
; Draw a text box at hl with room for
; b lines of c characters each.
; Places a border around the textbox,
; then switches the palette to the
; text black-and-white scheme.
push bc
push hl
call TextBoxBorder
@ -263,14 +266,14 @@ endm
dict "<ROCKET>", RocketChar
dict "<TM>", TMChar
dict "<TRNER>", TrainerChar
dict $23, Char23
dict $22, Char22
dict $23, PlaceKougeki
dict "<LNBRK>", Char22
dict "<CONT>", ContText
dict "<......>", SixDotsChar
dict "<DONE>", DoneText
dict "<PROMPT>", PromptText
dict "<PKMN>", PlacePKMN
dict $24, PlacePOKE
dict "<POKE>", PlacePOKE
dict $25, NextChar
dict2 $1f, " "
dict "<DEXEND>", PlaceDexEnd
@ -349,7 +352,7 @@ TMChar: print_name TMCharText ; 11b0
PCChar: print_name PCCharText ; 11b7
RocketChar: print_name RocketCharText ; 11be
PlacePOKe: print_name PlacePOKeText ; 11c5
Char23: print_name Char23Text ; 11cc
PlaceKougeki: print_name KougekiText ; 11cc
SixDotsChar: print_name SixDotsCharText ; 11d3
PlacePKMN: print_name PlacePKMNText ; 11da
PlacePOKE: print_name PlacePOKEText ; 11e1
@ -386,7 +389,7 @@ PlaceMoveTargetsName_5A: ; 1205
PlaceEnemysName:: ; 121b
push de
ld a, [InLinkBattle]
ld a, [wLinkMode]
and a
jr nz, .linkbattle
@ -425,9 +428,9 @@ PlaceGenderedPlayerName:: ; 1252
ld l, c
ld a, [PlayerGender]
bit 0, a
ld de, String12a5
ld de, String_kun
jr z, PlaceCommandCharacter
ld de, String12a6
ld de, String_chan
jr PlaceCommandCharacter
@ -444,7 +447,7 @@ TrainerCharText:: db "TRAINER@" ; 1276
PCCharText:: db "PC@" ; 127e
RocketCharText:: db "ROCKET@" ; 1281
PlacePOKeText:: db "POKé@" ; 1288
Char23Text:: db "こうげき@" ; 128d
KougekiText:: db "こうげき@" ; 128d
SixDotsCharText:: db "……@" ; 1292
EnemyText:: db "Enemy @" ; 1295
PlacePKMNText:: db "<PK><MN>@" ; PK MN ; 129c
@ -453,8 +456,8 @@ String12a2:: db " @" ; 12a2
Char35Text::
Char36Text::
Char37Text:: db "@" ; 12a4
String12a5:: db "@" ; 12a5
String12a6:: db "@" ; 12a6
String_kun:: db "@" ; 12a5
String_chan:: db "@" ; 12a6
; 12a7
NextLineChar:: ; 12a7
@ -480,31 +483,31 @@ TextFar:: ; 12b9
add hl, bc
ld de, -SCREEN_WIDTH
ld c, 1
.asm_12c4
.loop
ld a, h
and a
jr nz, .asm_12cd
jr nz, .next
ld a, l
cp SCREEN_WIDTH
jr c, .asm_12d1
jr c, .done
.asm_12cd
.next
add hl, de
inc c
jr .asm_12c4
jr .loop
.asm_12d1
.done
hlcoord 0, 0
ld de, SCREEN_WIDTH
ld a, c
.asm_12d8
.loop2
and a
jr z, .asm_12df
jr z, .done2
add hl, de
dec a
jr .asm_12d8
jr .loop2
.asm_12df
.done2
pop de
inc de
ld a, [de]
@ -526,20 +529,20 @@ LineChar:: ; 12ea
Paragraph:: ; 12f2
push de
ld a, [InLinkBattle]
cp $3
jr z, .asm_1301
cp $4
jr z, .asm_1301
call Function13c7
.asm_1301
ld a, [wLinkMode]
cp LINK_COLOSSEUM
jr z, .linkbattle
cp LINK_MOBILE
jr z, .linkbattle
call LoadBlinkingCursor
.linkbattle
call Function13b6
call KeepTextOpen
hlcoord TEXTBOX_INNERX, TEXTBOX_INNERY
lb bc, TEXTBOX_INNERH - 1, TEXTBOX_INNERW
call ClearBox
call Function13cd
call UnloadBlinkingCursor
ld c, 20
call DelayFrames
hlcoord TEXTBOX_INNERX, TEXTBOX_INNERY
@ -549,26 +552,26 @@ Paragraph:: ; 12f2
Char4B:: ; 131f
ld a, [InLinkBattle]
ld a, [wLinkMode]
or a
jr nz, .asm_1328
call Function13c7
.asm_1328
jr nz, .communication
call LoadBlinkingCursor
.communication
call Function13b6
push de
call KeepTextOpen
pop de
ld a, [InLinkBattle]
ld a, [wLinkMode]
or a
call z, Function13cd
call z, UnloadBlinkingCursor
Char4C:: ; 1337
push de
call Function138c
call Function138c
call TextScroll
call TextScroll
hlcoord TEXTBOX_INNERX, TEXTBOX_INNERY + 2
pop de
jp NextChar
@ -599,22 +602,22 @@ PlaceDexEnd:: ; 1356
; 135a
PromptText:: ; 135a
ld a, [InLinkBattle]
cp $3
ld a, [wLinkMode]
cp LINK_COLOSSEUM
jr z, .ok
cp $4
cp LINK_MOBILE
jr z, .ok
call Function13c7
.ok
call LoadBlinkingCursor
.ok
call Function13b6
call KeepTextOpen
ld a, [InLinkBattle]
cp $3
ld a, [wLinkMode]
cp LINK_COLOSSEUM
jr z, DoneText
cp $4
cp LINK_MOBILE
jr z, DoneText
call Function13cd
call UnloadBlinkingCursor
DoneText:: ; 137c
pop hl
@ -631,19 +634,22 @@ NullChar:: ; 1383
jp NextChar
; 138c
Function138c:: ; 138c
TextScroll:: ; 138c
hlcoord TEXTBOX_INNERX, TEXTBOX_INNERY
decoord TEXTBOX_INNERX, TEXTBOX_INNERY - 1
ld a, TEXTBOX_INNERH - 1
.col
push af
ld c, TEXTBOX_INNERW
.row
ld a, [hli]
ld [de], a
inc de
dec c
jr nz, .row
rept 2
inc de
endr
@ -653,6 +659,7 @@ endr
pop af
dec a
jr nz, .col
hlcoord TEXTBOX_INNERX, TEXTBOX_INNERY + 2
ld a, " "
ld bc, TEXTBOX_INNERW
@ -668,7 +675,9 @@ Function13b6:: ; 13b6
push af
ld a, 1
ld [hOAMUpdate], a
call WaitBGMap
pop af
ld [hOAMUpdate], a
pop bc
@ -679,15 +688,15 @@ Diacritic:: ; 13c6
ret
; 13c7
Function13c7:: ; 13c7
LoadBlinkingCursor:: ; 13c7
ld a, "▼"
ld [TileMap + 18 + 17 * SCREEN_WIDTH], a
ldcoord_a 18, 17
ret
; 13cd
Function13cd:: ; 13cd
ld a, [TileMap + 17 + 17 * SCREEN_WIDTH]
ld [TileMap + 18 + 17 * SCREEN_WIDTH], a
UnloadBlinkingCursor:: ; 13cd
lda_coord 17, 17
ldcoord_a 18, 17
ret
; 13d4
@ -719,19 +728,19 @@ PlaceWholeStringInBoxAtOnce:: ; 13e5
set 1, a
ld [TextBoxFrame + 1], a
call Function13f6
call DoTextUntilTerminator
pop af
ld [TextBoxFrame + 1], a
ret
; 13f6
Function13f6:: ; 13f6
DoTextUntilTerminator:: ; 13f6
ld a, [hli]
cp "@"
ret z
call .TextCommand
jr Function13f6
jr DoTextUntilTerminator
.TextCommand:
push hl
@ -754,19 +763,19 @@ endr
; 1410
TextCommands:: ; 1410
dw Text_00
dw Text_01
dw Text_02
dw Text_03
dw Text_04
dw Text_05
dw Text_06
dw Text_07
dw Text_08
dw Text_09
dw Text_0A
dw Text_TX
dw Text_TX_RAM
dw Text_TX_BCD
dw Text_TX_MOVE
dw Text_TX_BOX
dw Text_TX_LOW
dw Text_WAIT_BUTTON
dw Text_TX_SCROLL
dw Text_START_ASM
dw Text_TX_NUM
dw Text_TX_EXIT
dw Text_PlaySound ; $0b
dw Text_0C
dw Text_TX_DOTS
dw Text_0D
dw Text_PlaySound ; $0e
dw Text_PlaySound ; $0f
@ -774,12 +783,12 @@ TextCommands:: ; 1410
dw Text_PlaySound ; $11
dw Text_PlaySound ; $12
dw Text_PlaySound ; $13
dw Text_14
dw Text_15
dw Text_16
dw Text_TX_STRINGBUFFER
dw Text_TX_DAY
dw Text_TX_FAR
; 143e
Text_00:: ; 143e
Text_TX:: ; 143e
; TX
; write text until "@"
; [$00]["...@"]
@ -795,7 +804,7 @@ Text_00:: ; 143e
ret
; 1449
Text_01:: ; 1449
Text_TX_RAM:: ; 1449
; text_from_ram
; write text from a ram address
; little endian
@ -813,7 +822,7 @@ Text_01:: ; 1449
ret
; 1455
Text_16:: ; 1455
Text_TX_FAR:: ; 1455
; text_jump
; write text from a different bank
; little endian
@ -834,7 +843,7 @@ Text_16:: ; 1455
push hl
ld h, d
ld l, e
call Function13f6
call DoTextUntilTerminator
pop hl
pop af
@ -843,7 +852,7 @@ Text_16:: ; 1455
ret
; 1470
Text_02:: ; 1470
Text_TX_BCD:: ; 1470
; TX_BCD
; write bcd from address, typically ram
; [$02][addr][flags]
@ -865,7 +874,7 @@ Text_02:: ; 1470
ret
; 1480
Text_03:: ; 1480
Text_TX_MOVE:: ; 1480
; TX_MOVE
; move to a new tile
; [$03][addr]
@ -879,7 +888,7 @@ Text_03:: ; 1480
ret
; 148b
Text_04:: ; 148b
Text_TX_BOX:: ; 148b
; TX_BOX
; draw a box
; little endian
@ -901,7 +910,7 @@ Text_04:: ; 148b
ret
; 149b
Text_05:: ; 149b
Text_TX_LOW:: ; 149b
; TX_LOW
; write text at (1,16)
; [$05]
@ -910,39 +919,41 @@ Text_05:: ; 149b
ret
; 149f
Text_06:: ; 149f
Text_WAIT_BUTTON:: ; 149f
; TX_WAITBUTTON
; wait for button press
; show arrow
; [06]
ld a, [InLinkBattle]
cp $3
ld a, [wLinkMode]
cp LINK_COLOSSEUM
jp z, Text_0D
cp $4
cp LINK_MOBILE
jp z, Text_0D
push hl
call Function13c7
call LoadBlinkingCursor
push bc
call KeepTextOpen
pop bc
call Function13cd
call UnloadBlinkingCursor
pop hl
ret
; 14ba
Text_07:: ; 14ba
Text_TX_SCROLL:: ; 14ba
; pushes text up two lines and sets the BC cursor to the border tile
; below the first character column of the text box.
push hl
call Function13cd
call Function138c
call Function138c
call UnloadBlinkingCursor
call TextScroll
call TextScroll
pop hl
bccoord TEXTBOX_INNERX, TEXTBOX_INNERY + 2
ret
; 14c9
Text_08:: ; 14c9
Text_START_ASM:: ; 14c9
; TX_ASM
bit 7, h
@ -955,7 +966,7 @@ Text_08:: ; 14c9
ret
; 14d2
Text_09:: ; 14d2
Text_TX_NUM:: ; 14d2
; TX_NUM
; [$09][addr][hi:bytes lo:digits]
ld a, [hli]
@ -981,7 +992,7 @@ Text_09:: ; 14d2
ret
; 14ed
Text_0A:: ; 14ed
Text_TX_EXIT:: ; 14ed
push hl
push bc
call GetJoypad
@ -1056,13 +1067,14 @@ TextSFX:: ; 152d
db -1
; 1543
Text_0C:: ; 1543
Text_TX_DOTS:: ; 1543
; [$0C][num]
ld a, [hli]
ld d, a
push hl
ld h, b
ld l, c
.loop
push de
ld a, "…"
@ -1077,6 +1089,7 @@ Text_0C:: ; 1543
pop de
dec d
jr nz, .loop
ld b, h
ld c, l
pop hl
@ -1094,7 +1107,7 @@ Text_0D:: ; 1562
ret
; 156a
Text_14:: ; 156a
Text_TX_STRINGBUFFER:: ; 156a
; Print a string from one of the following:
; 0: StringBuffer3
; 1: StringBuffer4
@ -1124,7 +1137,7 @@ endr
ret
; 1582
Text_15:: ; 1582
Text_TX_DAY:: ; 1582
; TX_DAY
call GetWeekday

View File

@ -1,44 +1,79 @@
Function1c30:: ; 0x1c30
call Function1c53
BackUpTiles:: ; 1c00
callab _BackUpTiles
ret
; 1c07
ExitMenu:: ; 0x1c07
push af
callab Function243e8
pop af
ret
Function1c10:: ; 0x1c10
callab Function2446d
ret
WriteBackup:: ; 0x1c17
push af
call ExitMenu
call Function321c
call UpdateSprites
pop af
ret
RestoreTileBackup:: ; 0x1c23
call GetMemTileCoord
call .copy
call GetMemAttrCoord
call .copy
ret
; 0x1c30
.copy: ; 0x1c30
call GetMenuBoxDims
inc b
inc c
.asm_1c35
.row
push bc
push hl
.asm_1c37
.col
ld a, [de]
ld [hli], a
dec de
dec c
jr nz, .asm_1c37 ; 0x1c3b $fa
jr nz, .col ; 0x1c3b $fa
pop hl
ld bc, $0014
ld bc, SCREEN_WIDTH
add hl, bc
pop bc
dec b
jr nz, .asm_1c35 ; 0x1c44 $ef
jr nz, .row ; 0x1c44 $ef
ret
Function1c47:: ; 0x1c47
ld b, $10
ld de, wcf81
.asm_1c4c
.loop
ld a, [hld]
ld [de], a
inc de
dec b
jr nz, .asm_1c4c ; 0x1c50 $fa
jr nz, .loop ; 0x1c50 $fa
ret
Function1c53:: ; 0x1c53
ld a, [wcf82]
GetMenuBoxDims:: ; 0x1c53
ld a, [wMenuBorderTopCoord] ; top
ld b, a
ld a, [wcf84]
ld a, [wMenuBorderBottomCoord] ; bottom
sub b
ld b, a
ld a, [wcf83]
ld a, [wMenuBorderLeftCoord] ; left
ld c, a
ld a, [wcf85]
ld a, [wMenuBorderRightCoord] ; right
sub c
ld c, a
ret
@ -99,7 +134,7 @@ Function1c89:: ; 1c89
ld a, [wcf91]
bit 4, a
ret z
call Function1cfd
call GetMemTileCoord
ld a, [de]
ld c, a
inc de
@ -109,18 +144,18 @@ Function1c89:: ; 1c89
; 1cbb
Function1cbb:: ; 1cbb
call Function1cfd
call Function1c53
call GetMemTileCoord
call GetMenuBoxDims
dec b
dec c
jp TextBox
; 1cc6
Function1cc6:: ; 1cc6
ld a, [wcf82]
ld a, [wMenuBorderTopCoord]
ld b, a
inc b
ld a, [wcf83]
ld a, [wMenuBorderLeftCoord]
ld c, a
inc c
ld a, [wcf91]
@ -139,10 +174,10 @@ Function1cc6:: ; 1cc6
; 1ce1
Function1ce1:: ; 1ce1
call Function1cfd
call GetMemTileCoord
ld bc, $0015
add hl, bc
call Function1c53
call GetMenuBoxDims
dec b
dec c
call ClearBox
@ -150,8 +185,8 @@ Function1ce1:: ; 1ce1
; 1cf1
Function1cf1:: ; 1cf1
call Function1cfd
call Function1c53
call GetMemTileCoord
call GetMenuBoxDims
inc c
inc b
call ClearBox
@ -159,10 +194,10 @@ Function1cf1:: ; 1cf1
; 1cfd
Function1cfd:: ; 1cfd
ld a, [wcf83]
GetMemTileCoord:: ; 1cfd
ld a, [wMenuBorderLeftCoord]
ld c, a
ld a, [wcf82]
ld a, [wMenuBorderTopCoord]
ld b, a
; 1d05
@ -191,10 +226,10 @@ endr
ret
; 1d19
Function1d19:: ; 1d19
ld a, [wcf83]
GetMemAttrCoord:: ; 1d19
ld a, [wMenuBorderLeftCoord]
ld c, a
ld a, [wcf82]
ld a, [wMenuBorderTopCoord]
ld b, a
GetAttrCoord:: ; 1d21

View File

@ -3,7 +3,7 @@
AskTimer:: ; 591
push af
ld a, [$ffe9]
ld a, [hMobile]
and a
jr z, .asm_59a
call Timer

View File

@ -146,7 +146,7 @@ VBlank0:: ; 2b1
rst Bankswitch
ld a, [hSeconds]
ld [$ffe3], a
ld [hSecondsBackup], a
ret
; 325

View File

@ -1,6 +1,6 @@
ResetWindow:: ; 2dba
call Function1fbf
call ResetTextRelatedRAM
ld a, [hROMBank]
push af
ld a, BANK(Function6454) ; and BANK(Function64bf)
@ -16,12 +16,14 @@ ResetWindow:: ; 2dba
; 2dcf
Function2dcf:: ; 2dcf
LoadMoveSprites:: ; 2dcf
ld a, [hOAMUpdate]
push af
ld a, $1
ld [hOAMUpdate], a
call Function2de2
pop af
ld [hOAMUpdate], a
ld hl, VramState
@ -30,7 +32,7 @@ Function2dcf:: ; 2dcf
; 2de2
Function2de2:: ; 2de2
call Function1fbf
call ResetTextRelatedRAM
xor a
ld [hBGMapMode], a
call Function2173
@ -46,8 +48,8 @@ Function2de2:: ; 2de2
ret
; 2e08
Function2e08:: ; 2e08
call Function1fbf
LoadFont:: ; 2e08
call ResetTextRelatedRAM
ld a, [hROMBank]
push af
ld a, BANK(Function6454) ; and BANK(Function64bf)
@ -68,7 +70,9 @@ Function2e20:: ; 2e20
push af
ld a, $1
ld [hOAMUpdate], a
callba Function104110
pop af
ld [hOAMUpdate], a
ret

View File

@ -15,9 +15,12 @@ hMinutes EQU $ff96
hSeconds EQU $ff98
hVBlankCounter EQU $ff9b
hROMBank EQU $ff9d
hVBlank EQU $ff9e
hMapEntryMethod EQU $ff9f
hMenuReturn EQU $ffa0
hJoypadReleased EQU $ffa2
hJoypadPressed EQU $ffa3
@ -27,6 +30,7 @@ hJoyReleased EQU $ffa6
hJoyPressed EQU $ffa7
hJoyDown EQU $ffa8
hJoyLast EQU $ffa9
hInMenu EQU $ffaa
hConnectionStripLength EQU $ffaf
hConnectedMapWidth EQU $ffb0
@ -44,6 +48,8 @@ hMultiplicand EQU $ffb4 ; 3 bytes long
hMultiplier EQU $ffb7 ; 1 byte long
hProduct EQU $ffb3 ; result (4 bytes long)
hMathBuffer EQU $ffb8
hPrintNum1 EQU $ffb3
hPrintNum2 EQU $ffb4
hPrintNum3 EQU $ffb5
@ -51,7 +57,6 @@ hPrintNum4 EQU $ffb6
hPrintNum5 EQU $ffb7
hPrintNum6 EQU $ffb8
hPrintNum7 EQU $ffb9
hMathBuffer EQU $ffb8
hMoneyTemp EQU $ffc3
@ -81,9 +86,10 @@ hLastTalked EQU $ffe0
hRandom EQU $ffe1
hRandomAdd EQU $ffe1
hRandomSub EQU $ffe2
hSecondsBackup EQU $ffe3
hBattleTurn EQU $ffe4
hCGBPalUpdate EQU $ffe5
hCGB EQU $ffe6
hSGB EQU $ffe7
hDMATransfer EQU $ffe8
hMobile EQU $ffe9

File diff suppressed because it is too large Load Diff

View File

@ -208,7 +208,7 @@ FriendBall:
MoonBall:
LoveBall:
ParkBall: ; e8a2
ld a, [IsInBattle]
ld a, [wBattleMode]
dec a
jp nz, Functionf7a0
@ -512,7 +512,7 @@ endr
cp BATTLETYPE_TUTORIAL
jp z, .asm_ebd9
callba Function10607f
callba MobileFn_10607f
ld hl, UnknownText_0xedc9
call PrintText
@ -550,7 +550,7 @@ endr
jp z, .asm_ebd1
cp BATTLETYPE_CELEBI
jr nz, .asm_eac8
ld hl, wd0ee
ld hl, wBattleResult
set 6, [hl]
.asm_eac8
@ -628,7 +628,7 @@ endr
ld a, [sBoxCount]
cp MONS_PER_BOX
jr nz, .asm_eb5b
ld hl, wd0ee
ld hl, wBattleResult
set 7, [hl]
.asm_eb5b
ld a, [CurItem]
@ -1657,7 +1657,7 @@ Functionf0d6: ; f0d6
call Functionf30d
ld a, 1
ret nz
ld a, [IsInBattle]
ld a, [wBattleMode]
and a
jr z, .asm_f104
@ -1936,7 +1936,7 @@ Functionf2a2: ; f2a2 (3:72a2)
ret
Functionf2a6: ; f2a6 (3:72a6)
ld a, [IsInBattle]
ld a, [wBattleMode]
and a
ret z
ld a, [CurPartyMon]
@ -2181,7 +2181,7 @@ Functionf3df: ; f3df (3:73df)
call Functionf1db
ld a, $f5
call Functionf24a
call Functiona36
call JoyWaitAorB
.asm_f413
ld a, b
inc a
@ -2254,12 +2254,12 @@ Repel: ; f46a
; f46c
Function_0xf46c: ; f46c
ld a, [wdca1]
ld a, [wRepelEffect]
and a
ld hl, UnknownText_0xf47d
jp nz, PrintText
ld a, b
ld [wdca1], a
ld [wRepelEffect], a
jp Functionf789
; f47d
@ -2280,15 +2280,15 @@ XAccuracy: ; f482
PokeDoll: ; f48f
ld a, [IsInBattle]
ld a, [wBattleMode]
dec a
jr nz, .asm_f4a6
inc a
ld [wd232], a
ld a, [wd0ee]
and $c0
ld a, [wBattleResult]
and 3 << 6
or $2
ld [wd0ee], a
ld [wBattleResult], a
jp Functionf789
.asm_f4a6
@ -2362,20 +2362,20 @@ Tablef504: ; f504
PokeFlute: ; f50c
ld a, [IsInBattle]
ld a, [wBattleMode]
and a
jr nz, .asm_f512
.asm_f512
xor a
ld [wd002], a
ld [MiscBuffer2], a
ld b, $ff ^ SLP
ld hl, PartyMon1Status
call .Functionf554
ld a, [IsInBattle]
ld a, [wBattleMode]
cp WILD_BATTLE
jr z, .asm_f52b
ld hl, OTPartyMon1Status
@ -2391,7 +2391,7 @@ PokeFlute: ; f50c
and b
ld [hl], a
ld a, [wd002]
ld a, [MiscBuffer2]
and a
ld hl, UnknownText_0xf56c
jp z, PrintText
@ -2416,7 +2416,7 @@ PokeFlute: ; f50c
and SLP
jr z, .asm_f564
ld a, 1
ld [wd002], a
ld [MiscBuffer2], a
.asm_f564
pop af
and b
@ -2448,7 +2448,7 @@ UnknownText_0xf576: ; 0xf576
Function_0xf57b: ; f57b
ld a, [IsInBattle]
ld a, [wBattleMode]
and a
jr nz, .asm_f58c
@ -2517,27 +2517,27 @@ MaxEther:
Elixer:
Mysteryberry: ; f5bf
ld a, [CurItem]
ld [wd002], a
ld [MiscBuffer2], a
.asm_f5c5
.loop
ld b, $1
call Functionf1f9
jp c, Functionf6e0
.asm_f5cd
ld a, [wd002]
.loop2
ld a, [MiscBuffer2]
cp MAX_ELIXER
jp z, Functionf6af
jp z, Elixer_RestorePPofAllMoves
cp ELIXER
jp z, Functionf6af
jp z, Elixer_RestorePPofAllMoves
ld hl, UnknownText_0xf725
ld a, [wd002]
ld a, [MiscBuffer2]
cp PP_UP
jr z, .asm_f5e7
jr z, .ppup
ld hl, UnknownText_0xf72a
.asm_f5e7
.ppup
call PrintText
ld a, [CurMoveNum]
@ -2551,10 +2551,10 @@ Mysteryberry: ; f5bf
pop bc
ld a, b
ld [CurMoveNum], a
jr nz, .asm_f5c5
jr nz, .loop
ld hl, PartyMon1Moves
ld bc, PartyMon2 - PartyMon1
call Functionf963
call GetMthMoveOfNthPartymon
push hl
ld a, [hl]
@ -2563,28 +2563,28 @@ Mysteryberry: ; f5bf
call CopyName1
pop hl
ld a, [wd002]
ld a, [MiscBuffer2]
cp PP_UP
jp nz, Functionf6a7
ld a, [hl]
cp $a6
jr z, .asm_f62f
cp SKETCH
jr z, .CantUsePPUpOnSketch
ld bc, $0015
add hl, bc
ld a, [hl]
cp $c0
jr c, .asm_f637
cp 3 << 6
jr c, .do_ppup
.asm_f62f
.CantUsePPUpOnSketch
ld hl, UnknownText_0xf72f
call PrintText
jr .asm_f5cd
jr .loop2
.asm_f637
.do_ppup
ld a, [hl]
add $40
add 1 << 6
ld [hl], a
ld a, $1
ld [wd265], a
@ -2600,7 +2600,7 @@ Functionf64c: ; f64c
; f652
Functionf652: ; f652
ld a, [IsInBattle]
ld a, [wBattleMode]
and a
jr z, .asm_f66c
ld a, [CurPartyMon]
@ -2657,37 +2657,37 @@ Functionf652: ; f652
; f6a7
Functionf6a7: ; f6a7
call Functionf6e8
call RestorePP
jr nz, Functionf652
jp Functionf6dd
; f6af
Functionf6af: ; f6af
Elixer_RestorePPofAllMoves: ; f6af
xor a
ld hl, wcfa9
ld [hli], a
ld [hl], a
ld b, NUM_MOVES
.asm_f6b7
.moveLoop
push bc
ld hl, PartyMon1Moves
ld bc, PartyMon2 - PartyMon1
call Functionf963
call GetMthMoveOfNthPartymon
ld a, [hl]
and a
jr z, .asm_f6ce
jr z, .cant_restore_pp
call Functionf6e8
jr z, .asm_f6ce
call RestorePP
jr z, .cant_restore_pp
ld hl, wcfaa
inc [hl]
.asm_f6ce
.cant_restore_pp
ld hl, wcfa9
inc [hl]
pop bc
dec b
jr nz, .asm_f6b7
jr nz, .moveLoop
ld a, [wcfaa]
and a
jp nz, Functionf652
@ -2702,48 +2702,48 @@ Functionf6e0: ; f6e0
ret
; f6e8
Functionf6e8: ; f6e8
RestorePP: ; f6e8
xor a ; PARTYMON
ld [MonType], a
call Functionf8ec
ld hl, PartyMon1PP
ld bc, PartyMon2 - PartyMon1
call Functionf963
call GetMthMoveOfNthPartymon
ld a, [wd265]
ld b, a
ld a, [hl]
and $3f
and (1 << 6) - 1
cp b
jr nc, .asm_f723
jr nc, .dont_restore
ld a, [wd002]
ld a, [MiscBuffer2]
cp MAX_ELIXER
jr z, .asm_f71d
jr z, .restore_all
cp MAX_ETHER
jr z, .asm_f71d
jr z, .restore_all
ld c, 5
cp MYSTERYBERRY
jr z, .asm_f715
jr z, .restore_some
ld c, 10
.asm_f715
.restore_some
ld a, [hl]
and $3f
and (1 << 6) - 1
add c
cp b
jr nc, .asm_f71d
jr nc, .restore_all
ld b, a
.asm_f71d
.restore_all
ld a, [hl]
and $c0
and 3 << 6
or b
ld [hl], a
ret
.asm_f723
.dont_restore
xor a
ret
; f725
@ -3127,9 +3127,9 @@ Functionf84c: ; f84c
.asm_f876
ld a, [hl]
and $c0
ld a, [de]
call nz, Functionf881
and 3 << 6
ld a, [de] ; wasted cycle
call nz, ComputeMaxPP
.asm_f87d
inc hl
@ -3139,8 +3139,9 @@ Functionf84c: ; f84c
Functionf881: ; f881
ComputeMaxPP: ; f881
push bc
; Divide the base PP by 5.
ld a, [de]
ld [hDividend + 3], a
xor a
@ -3151,6 +3152,7 @@ Functionf881: ; f881
ld [hDivisor], a
ld b, 4
call Divide
; Get the number of PP, which are bits 6 and 7 of the PP value stored in RAM.
ld a, [hl]
ld b, a
swap a
@ -3158,24 +3160,30 @@ Functionf881: ; f881
srl a
srl a
ld c, a
; If this value is 0, we are done
and a
jr z, .asm_f8b6
.asm_f8a3
ld a, [$ffb6]
jr z, .NoPPUp
.loop
; Normally, a move with 40 PP would have 64 PP with three PP Ups.
; Since this would overflow into bit 6, we prevent that from happening
; by decreasing the extra amount of PP each PP Up provides, resulting
; in a maximum of 61.
ld a, [hQuotient + 2]
cp $8
jr c, .asm_f8ab
jr c, .okay
ld a, $7
.asm_f8ab
.okay
add b
ld b, a
ld a, [wd265]
dec a
jr z, .asm_f8b6
jr z, .NoPPUp
dec c
jr nz, .asm_f8a3
jr nz, .loop
.asm_f8b6
.NoPPUp
ld [hl], b
pop bc
ret
@ -3203,7 +3211,7 @@ Functionf8b9: ; f8b9
pop bc
pop de
ld a, [de]
and $c0
and 3 << 6
ld b, a
ld a, [wd265]
add b
@ -3229,30 +3237,30 @@ Functionf8ec: ; f8ec
ld hl, PartyMon1Moves
ld bc, PartyMon2 - PartyMon1
jr z, .asm_f91a ; PARTYMON
jr z, .got_partymon ; PARTYMON
ld hl, OTPartyMon1Moves
dec a
jr z, .asm_f91a ; OTPARTYMON
jr z, .got_partymon ; OTPARTYMON
ld hl, TempMonMoves
dec a
jr z, .asm_f915 ; BOXMON
jr z, .got_nonpartymon ; BOXMON
ld hl, TempMonMoves ; Wasted cycles
dec a
jr z, .asm_f915 ; BREEDMON
jr z, .got_nonpartymon ; BREEDMON
ld hl, BattleMonMoves ; WILDMON
.asm_f915 ; BOXMON, BREEDMON, WILDMON
call Functionf969
jr .asm_f91d
.got_nonpartymon ; BOXMON, BREEDMON, WILDMON
call GetMthMoveOfCurrentMon
jr .gotdatmove
.asm_f91a ; PARTYMON, OTPARTYMON
call Functionf963
.got_partymon ; PARTYMON, OTPARTYMON
call GetMthMoveOfNthPartymon
.asm_f91d
.gotdatmove
ld a, [hl]
dec a
@ -3271,12 +3279,12 @@ Functionf8ec: ; f8ec
ld bc, PartyMon1PP - PartyMon1Moves
ld a, [MonType]
cp WILDMON
jr nz, .asm_f942
jr nz, .notwild
ld bc, EnemyMonPP - EnemyMonMoves
.asm_f942
.notwild
add hl, bc
ld a, [hl]
and $c0
and 3 << 6
pop bc
or b
@ -3284,10 +3292,10 @@ Functionf8ec: ; f8ec
ld [hl], a
xor a
ld [wd265], a
ld a, b
call Functionf881
ld a, b ; this gets lost anyway
call ComputeMaxPP
ld a, [hl]
and $3f
and (1 << 6) - 1
ld [wd265], a
pop af
@ -3297,11 +3305,11 @@ Functionf8ec: ; f8ec
ret
; f963
Functionf963: ; f963
GetMthMoveOfNthPartymon: ; f963
ld a, [CurPartyMon]
call AddNTimes
Functionf969: ; f969
GetMthMoveOfCurrentMon: ; f969
ld a, [wcfa9]
ld c, a
ld b, 0

View File

@ -6,43 +6,53 @@ INCLUDE "gbhw.asm"
SECTION "Main", ROMX
Function110000: ; 110000 (44:4000)
; Copy b bytes from hl to de
.loop
ld a, [hli]
ld [de], a
inc de
dec b
jr nz, Function110000
jr nz, .loop
ret
; 110007 (44:4007)
Function110007: ; 110007
.asm_110007
; Copy bytes from hl to de until a 0 is encountered.
; Include the 0 in the copy, and count the number of
; nonzero bytes copied. Keep the de pointer at the
; copied zero.
.loop
ld a, [hli]
ld [de], a
or a
ret z
inc de
inc bc
jr .asm_110007
jr .loop
; 11000f
Function11000f: ; 11000f
; Copy bytes from hl to de until a 0 is encountered,
; or a bytes have been copied, whichever comes first.
; Add the byte count to the count previously stored
; in bc.
push bc
ld c, $0
ld b, a
dec b
.asm_110014
.loop
ld a, [hli]
ld [de], a
or a
jr z, .asm_110020
jr z, .done
inc de
inc c
dec b
jr nz, .asm_110014
jr nz, .loop
xor a
ld [de], a
.asm_110020
.done
ld a, c
pop bc
add c
@ -54,6 +64,7 @@ Function11000f: ; 11000f
; 110029
Function110029: ; 110029 (44:4029)
; Clear two bytes at $ca3a.
xor a
ld hl, $ca3a
ld [hli], a
@ -61,21 +72,25 @@ Function110029: ; 110029 (44:4029)
ret
Function110030:: ; 110030 (44:4030)
; Use the byte at $c988 as a parameter
; for a jumptable.
; If [$c988] in {12, 14, 16},
; clear [$c835].
push de
ld a, [$c988]
cp $c
jr z, .asm_110047
cp $e
jr z, .asm_110047
cp $10
jr z, .asm_110047
cp 2 * 6
jr z, .noreset
cp 2 * 7
jr z, .noreset
cp 2 * 8
jr z, .noreset
xor a
ld [$c835], a
ld a, [$c988]
.asm_110047
.noreset
ld d, $0
ld e, a
ld hl, Jumptable_110070
ld hl, .jumptable
add hl, de
ld a, [hli]
ld [$c988], a
@ -89,19 +104,19 @@ Function110030:: ; 110030 (44:4030)
push hl
ld a, $36
cp l
jr nz, .asm_110066
jr nz, .okay
ld a, $42
cp h
.asm_110066
.okay
call nz, Function1100b4
ld hl, $c986
ld a, [hli]
ld h, [hl]
ld l, a
ret
ret ; indirectly jump to the function loaded from the jumptable, which returns to Function3e60.
; 110070 (44:4070)
Jumptable_110070: ; 110070
.jumptable: ; 110070
dw Function110115
dw Function110236
dw Function110291
@ -140,7 +155,7 @@ Jumptable_110070: ; 110070
Function1100b4: ; 1100b4 (44:40b4)
push bc
.asm_1100b5
.loop
di
ld a, [$c800]
ld b, a
@ -150,19 +165,19 @@ Function1100b4: ; 1100b4 (44:40b4)
ei
or a
bit 0, a
jr z, .asm_1100da
jr z, .done
ld a, b
or a
jr nz, .asm_1100b5
jr nz, .loop
ld a, c
cp $4
jr z, .asm_1100b5
jr z, .loop
xor a
ld [$c80f], a
ld hl, $c821
set 1, [hl]
scf
.asm_1100da
.done
pop bc
ret
; 1100dc (44:40dc)

View File

@ -78,17 +78,28 @@ bigdw: MACRO ; big-endian word
dx 2, \1
ENDM
dba: MACRO ; dbw bank, address
dbw BANK(\1), \1
ENDM
dab: MACRO ; dwb address, bank
dwb \1, BANK(\1)
ENDM
lb: MACRO ; r, hi, lo
ld \1, (\2) << 8 + (\3)
ENDM
ln: MACRO ; r, hi, lo
ld \1, (\2) << 4 + (\3)
ENDM
bccoord equs "coord bc,"
decoord equs "coord de,"
hlcoord equs "coord hl,"
coord: MACRO
; register, x, y[, origin]
if _NARG < 4
ld \1, TileMap + SCREEN_WIDTH * (\3) + (\2)
else
@ -104,7 +115,7 @@ dwcoord: MACRO
endr
ENDM
ldcoord: MACRO
ldcoord_a: MACRO
if _NARG < 3
ld [TileMap + SCREEN_WIDTH * (\2) + (\1)], a
else
@ -112,6 +123,14 @@ ldcoord: MACRO
endc
ENDM
lda_coord: MACRO
if _NARG < 3
ld a, [TileMap + SCREEN_WIDTH * (\2) + (\1)]
else
ld a, [\3 + SCREEN_WIDTH * (\2) + (\1)]
endc
ENDM
; pic animations
frame: MACRO
db \1
@ -150,28 +169,4 @@ bcd: MACRO
endr
ENDM
ln: MACRO
if _NARG == 5
lb \1, \2 << 4 + \3, \4 << 4 + \5
else
if _NARG == 3
ld \1, \2 << 4 + \3
else
fail "incorrect number of arguments for ln"
endc
endc
ENDM
dwtile: MACRO
dw (\1 << 4) + \2
if _NARG > 2
rept _NARG + -2
dw \3
shift
endr
endc
ENDM
ldtile: MACRO
ld \1, (\2 << 4) + \3
ENDM
tile EQUS "+ $10 *"

View File

@ -1,125 +1,164 @@
charmap "@", $50
; Control characters
charmap "<START>", $00
charmap "<PLAY_G>", $14 ; <PLAYER> + gender
charmap "<DAY>", $15
charmap "<LNBRK>", $22
charmap "<POKE>", $24
charmap "<RED>", $38
charmap "<GREEN>", $39
charmap "<ENEMY>", $3f
charmap "<MOM>", $49
charmap "<PKMN>", $4a
charmap "<NEXT>", $4e
charmap "<LINE>", $4f
charmap "#", $54
charmap "№", $74
charmap "…", $75
charmap "┌", $79
charmap "─", $7a
charmap "┐", $7b
charmap "│", $7c
charmap "└", $7d
charmap "┘", $7e
charmap " ", $7f
charmap "", $6e
charmap "″", $6f
charmap "@", $50
charmap "<PARA>", $51
charmap "<PLAYER>", $52
charmap "<RIVAL>", $53
charmap "#", $54
charmap "<CONT>", $55
charmap "<......>", $56
charmap "<DONE>", $57
charmap "<PROMPT>", $58
charmap "<TARGET>", $59
charmap "<USER>", $5a
charmap "<PC>", $5b
charmap "<TM>", $5c
charmap "<TRNER>", $5d
charmap "<ROCKET>", $5e
charmap "<DEXEND>", $5f
charmap "A", $80
charmap "B", $81
charmap "C", $82
charmap "D", $83
charmap "E", $84
charmap "F", $85
charmap "G", $86
charmap "H", $87
charmap "I", $88
charmap "J", $89
charmap "K", $8a
charmap "L", $8b
charmap "M", $8c
charmap "N", $8d
charmap "O", $8e
charmap "P", $8f
charmap "Q", $90
charmap "R", $91
charmap "S", $92
charmap "T", $93
charmap "U", $94
charmap "V", $95
charmap "W", $96
charmap "X", $97
charmap "Y", $98
charmap "Z", $99
; Actual characters
charmap "", $6e
charmap "<LV>", $6e
charmap "″", $6f
charmap "(", $9a
charmap ")", $9b
charmap ":", $9c
charmap ";", $9d
charmap "[", $9e
charmap "]", $9f
charmap "<PO>", $70
charmap "<KE>", $71
charmap "№", $74
charmap "…", $75
charmap "a", $a0
charmap "b", $a1
charmap "c", $a2
charmap "d", $a3
charmap "e", $a4
charmap "f", $a5
charmap "g", $a6
charmap "h", $a7
charmap "i", $a8
charmap "j", $a9
charmap "k", $aa
charmap "l", $ab
charmap "m", $ac
charmap "n", $ad
charmap "o", $ae
charmap "p", $af
charmap "q", $b0
charmap "r", $b1
charmap "s", $b2
charmap "t", $b3
charmap "u", $b4
charmap "v", $b5
charmap "w", $b6
charmap "x", $b7
charmap "y", $b8
charmap "z", $b9
charmap "┌", $79
charmap "─", $7a
charmap "┐", $7b
charmap "│", $7c
charmap "└", $7d
charmap "┘", $7e
charmap " ", $7f
charmap "Ä", $c0
charmap "Ö", $c1
charmap "Ü", $c2
charmap "ä", $c3
charmap "ö", $c4
charmap "ü", $c5
charmap "A", $80
charmap "B", $81
charmap "C", $82
charmap "D", $83
charmap "E", $84
charmap "F", $85
charmap "G", $86
charmap "H", $87
charmap "I", $88
charmap "J", $89
charmap "K", $8a
charmap "L", $8b
charmap "M", $8c
charmap "N", $8d
charmap "O", $8e
charmap "P", $8f
charmap "Q", $90
charmap "R", $91
charmap "S", $92
charmap "T", $93
charmap "U", $94
charmap "V", $95
charmap "W", $96
charmap "X", $97
charmap "Y", $98
charmap "Z", $99
charmap "'d", $d0
charmap "'l", $d1
charmap "'m", $d2
charmap "'r", $d3
charmap "'s", $d4
charmap "'t", $d5
charmap "'v", $d6
charmap "(", $9a
charmap ")", $9b
charmap ":", $9c
charmap ";", $9d
charmap "[", $9e
charmap "]", $9f
charmap "'", $e0
charmap "-", $e3
charmap "a", $a0
charmap "b", $a1
charmap "c", $a2
charmap "d", $a3
charmap "e", $a4
charmap "f", $a5
charmap "g", $a6
charmap "h", $a7
charmap "i", $a8
charmap "j", $a9
charmap "k", $aa
charmap "l", $ab
charmap "m", $ac
charmap "n", $ad
charmap "o", $ae
charmap "p", $af
charmap "q", $b0
charmap "r", $b1
charmap "s", $b2
charmap "t", $b3
charmap "u", $b4
charmap "v", $b5
charmap "w", $b6
charmap "x", $b7
charmap "y", $b8
charmap "z", $b9
charmap "?", $e6
charmap "!", $e7
charmap ".", $e8
charmap "&", $e9
charmap "Ä", $c0
charmap "Ö", $c1
charmap "Ü", $c2
charmap "ä", $c3
charmap "ö", $c4
charmap "ü", $c5
charmap "é", $ea
charmap "→", $eb
charmap "▷", $ec
charmap "▶", $ed
charmap "▼", $ee
charmap "♂", $ef
charmap "¥", $f0
charmap "×", $f1
charmap "/", $f3
charmap ",", $f4
charmap "♀", $f5
charmap "'d", $d0
charmap "'l", $d1
charmap "'m", $d2
charmap "'r", $d3
charmap "'s", $d4
charmap "'t", $d5
charmap "'v", $d6
charmap "0", $f6
charmap "1", $f7
charmap "2", $f8
charmap "3", $f9
charmap "4", $fa
charmap "5", $fb
charmap "6", $fc
charmap "7", $fd
charmap "8", $fe
charmap "9", $ff
charmap "'", $e0
charmap "<PK>", $e1
charmap "<MN>", $e2
charmap "-", $e3
charmap "?", $e6
charmap "!", $e7
charmap ".", $e8
charmap "&", $e9
charmap "é", $ea
charmap "→", $eb
charmap "▷", $ec
charmap "▶", $ed
charmap "▼", $ee
charmap "♂", $ef
charmap "¥", $f0
charmap "×", $f1
charmap "·", $f2
charmap "/", $f3
charmap ",", $f4
charmap "♀", $f5
charmap "0", $f6
charmap "1", $f7
charmap "2", $f8
charmap "3", $f9
charmap "4", $fa
charmap "5", $fb
charmap "6", $fc
charmap "7", $fd
charmap "8", $fe
charmap "9", $ff
; Japanese, for those bits of text that
; were not translated to English.
charmap "ガ", $5
charmap "ギ", $6
@ -276,33 +315,3 @@
charmap "ー", $e3
charmap "ァ", $e9
charmap "<PLAYER>", $52
charmap "<RIVAL>", $53
charmap "<RED>", $38
charmap "<GREEN>", $39
charmap "<TARGET>", $59
charmap "<USER>", $5a
charmap "<ENEMY>", $3f
charmap "<PKMN>", $4a
charmap "<PK>", $e1
charmap "<MN>", $e2
charmap "<PO>", $70
charmap "<KE>", $71
charmap "<MOM>", $49
charmap "<POKE>", $24
charmap "<PLAY_G>", $14 ; <PLAYER> + gender
charmap "<PARA>", $51
charmap "<LINE>", $4f
charmap "<NEXT>", $4e
charmap "<CONT>", $55
charmap "<DONE>", $57
charmap "<PROMPT>", $58
charmap "<DAY>", $15
charmap "<PC>", $5b
charmap "<TM>", $5c
charmap "<TRNER>", $5d
charmap "<ROCKET>", $5e
charmap "<......>", $56
charmap "<START>", $00
charmap "<DEXEND>", $5f

View File

@ -18,8 +18,8 @@ ENDM
person_event: macro
db \1 ; sprite
db \2 ; y
db \3 ; x
db \2 + 4 ; y
db \3 + 4 ; x
db \4 ; movement function
dn \5, \6 ; radius: y, x
db \7 ; clock_hour

13575
main.asm

File diff suppressed because it is too large Load Diff

View File

@ -371,10 +371,10 @@ AzaleaGym_MapEventHeader:
.PersonEvents:
db 7
person_event SPRITE_BUGSY, 11, 9, $3, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, BugsyScript_0x18ec1e, -1
person_event SPRITE_BUG_CATCHER, 7, 9, $a, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 2, 2, TrainerBug_catcherBug_catcher_benny, -1
person_event SPRITE_BUG_CATCHER, 12, 12, $6, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 2, 3, TrainerBug_catcherAl, -1
person_event SPRITE_BUG_CATCHER, 6, 4, $6, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 2, 3, TrainerBug_catcherJosh, -1
person_event SPRITE_TWIN, 14, 8, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 1, TrainerTwinsAmyandmay1, -1
person_event SPRITE_TWIN, 14, 9, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 1, TrainerTwinsAmyandmay2, -1
person_event SPRITE_GYM_GUY, 17, 11, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, AzaleaGymGuyScript, -1
person_event SPRITE_BUGSY, 7, 5, $3, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, BugsyScript_0x18ec1e, -1
person_event SPRITE_BUG_CATCHER, 3, 5, $a, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 2, 2, TrainerBug_catcherBug_catcher_benny, -1
person_event SPRITE_BUG_CATCHER, 8, 8, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 2, 3, TrainerBug_catcherAl, -1
person_event SPRITE_BUG_CATCHER, 2, 0, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 2, 3, TrainerBug_catcherJosh, -1
person_event SPRITE_TWIN, 10, 4, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 1, TrainerTwinsAmyandmay1, -1
person_event SPRITE_TWIN, 10, 5, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 1, TrainerTwinsAmyandmay2, -1
person_event SPRITE_GYM_GUY, 13, 7, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, AzaleaGymGuyScript, -1

View File

@ -57,6 +57,6 @@ AzaleaMart_MapEventHeader:
.PersonEvents:
db 3
person_event SPRITE_CLERK, 7, 5, $9, 0, 0, -1, -1, 0, 0, 0, ClerkScript_0x18e040, -1
person_event SPRITE_COOLTRAINER_M, 9, 6, $7, 0, 0, -1, -1, 0, 0, 0, CooltrainerMScript_0x18e047, -1
person_event SPRITE_BUG_CATCHER, 6, 11, $5, 0, 2, -1, -1, 8 + PAL_OW_RED, 0, 0, BugCatcherScript_0x18e04a, -1
person_event SPRITE_CLERK, 3, 1, $9, 0, 0, -1, -1, 0, 0, 0, ClerkScript_0x18e040, -1
person_event SPRITE_COOLTRAINER_M, 5, 2, $7, 0, 0, -1, -1, 0, 0, 0, CooltrainerMScript_0x18e047, -1
person_event SPRITE_BUG_CATCHER, 2, 7, $5, 0, 2, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, BugCatcherScript_0x18e04a, -1

View File

@ -90,7 +90,7 @@ AzaleaPokeCenter1F_MapEventHeader:
.PersonEvents:
db 4
person_event SPRITE_NURSE, 5, 7, $6, 0, 0, -1, -1, 0, 0, 0, NurseScript_0x18db28, -1
person_event SPRITE_GENTLEMAN, 10, 13, $4, 1, 0, -1, -1, 0, 0, 0, GentlemanScript_0x18db2b, -1
person_event SPRITE_FISHING_GURU, 5, 10, $6, 0, 0, -1, -1, 0, 0, 0, FishingGuruScript_0x18db2e, -1
person_event SPRITE_POKEFAN_F, 8, 5, $2, 2, 1, -1, -1, 0, 0, 0, PokefanFScript_0x18db31, -1
person_event SPRITE_NURSE, 1, 3, $6, 0, 0, -1, -1, 0, 0, 0, NurseScript_0x18db28, -1
person_event SPRITE_GENTLEMAN, 6, 9, $4, 1, 0, -1, -1, 0, 0, 0, GentlemanScript_0x18db2b, -1
person_event SPRITE_FISHING_GURU, 1, 6, $6, 0, 0, -1, -1, 0, 0, 0, FishingGuruScript_0x18db2e, -1
person_event SPRITE_POKEFAN_F, 4, 1, $2, 2, 1, -1, -1, 0, 0, 0, PokefanFScript_0x18db31, -1

View File

@ -481,15 +481,15 @@ AzaleaTown_MapEventHeader:
.PersonEvents:
db 12
person_event SPRITE_AZALEA_ROCKET, 13, 35, $6, 0, 0, -1, -1, 0, 0, 0, AzaleaRocketScript_0x1980ab, EVENT_AZALEA_TOWN_SLOWPOKETAIL_ROCKET
person_event SPRITE_GRAMPS, 13, 25, $2, 2, 1, -1, -1, 0, 0, 0, GrampsScript_0x1980b1, -1
person_event SPRITE_TEACHER, 17, 19, $4, 2, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, TeacherScript_0x1980c5, -1
person_event SPRITE_YOUNGSTER, 13, 11, $5, 0, 1, -1, -1, 8 + PAL_OW_GREEN, 0, 0, YoungsterScript_0x1980c8, -1
person_event SPRITE_SLOWPOKE, 21, 12, $1, 0, 0, -1, -1, 0, 0, 0, SlowpokeScript_0x1980cb, EVENT_AZALEA_TOWN_SLOWPOKES
person_event SPRITE_SLOWPOKE, 13, 22, $1, 0, 0, -1, -1, 0, 0, 0, SlowpokeScript_0x1980cb, EVENT_AZALEA_TOWN_SLOWPOKES
person_event SPRITE_SLOWPOKE, 13, 33, $1, 0, 0, -1, -1, 0, 0, 0, SlowpokeScript_0x1980cb, EVENT_AZALEA_TOWN_SLOWPOKES
person_event SPRITE_SLOWPOKE, 19, 19, $1, 0, 0, -1, -1, 0, 0, 0, SlowpokeScript_0x1980cb, EVENT_AZALEA_TOWN_SLOWPOKES
person_event SPRITE_FRUIT_TREE, 6, 12, $1, 0, 0, -1, -1, 0, 0, 0, WhiteApricornTree, -1
person_event SPRITE_AZALEA_ROCKET, 14, 15, $8, 0, 0, -1, -1, 0, 0, 0, ObjectEvent, EVENT_RIVAL_AZALEA_TOWN
person_event SPRITE_AZALEA_ROCKET, 20, 14, $6, 0, 0, -1, -1, 0, 0, 0, AzaleaRocketScript_0x1980ae, EVENT_SLOWPOKE_WELL_ROCKETS
person_event SPRITE_KURT_OUTSIDE, 9, 10, $8, 0, 0, -1, -1, 0, 0, 0, KurtOutsideScript_0x19810c, EVENT_AZALEA_TOWN_KURT
person_event SPRITE_AZALEA_ROCKET, 9, 31, $6, 0, 0, -1, -1, 0, 0, 0, AzaleaRocketScript_0x1980ab, EVENT_AZALEA_TOWN_SLOWPOKETAIL_ROCKET
person_event SPRITE_GRAMPS, 9, 21, $2, 2, 1, -1, -1, 0, 0, 0, GrampsScript_0x1980b1, -1
person_event SPRITE_TEACHER, 13, 15, $4, 2, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, TeacherScript_0x1980c5, -1
person_event SPRITE_YOUNGSTER, 9, 7, $5, 0, 1, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, YoungsterScript_0x1980c8, -1
person_event SPRITE_SLOWPOKE, 17, 8, $1, 0, 0, -1, -1, 0, 0, 0, SlowpokeScript_0x1980cb, EVENT_AZALEA_TOWN_SLOWPOKES
person_event SPRITE_SLOWPOKE, 9, 18, $1, 0, 0, -1, -1, 0, 0, 0, SlowpokeScript_0x1980cb, EVENT_AZALEA_TOWN_SLOWPOKES
person_event SPRITE_SLOWPOKE, 9, 29, $1, 0, 0, -1, -1, 0, 0, 0, SlowpokeScript_0x1980cb, EVENT_AZALEA_TOWN_SLOWPOKES
person_event SPRITE_SLOWPOKE, 15, 15, $1, 0, 0, -1, -1, 0, 0, 0, SlowpokeScript_0x1980cb, EVENT_AZALEA_TOWN_SLOWPOKES
person_event SPRITE_FRUIT_TREE, 2, 8, $1, 0, 0, -1, -1, 0, 0, 0, WhiteApricornTree, -1
person_event SPRITE_AZALEA_ROCKET, 10, 11, $8, 0, 0, -1, -1, 0, 0, 0, ObjectEvent, EVENT_RIVAL_AZALEA_TOWN
person_event SPRITE_AZALEA_ROCKET, 16, 10, $6, 0, 0, -1, -1, 0, 0, 0, AzaleaRocketScript_0x1980ae, EVENT_SLOWPOKE_WELL_ROCKETS
person_event SPRITE_KURT_OUTSIDE, 5, 6, $8, 0, 0, -1, -1, 0, 0, 0, KurtOutsideScript_0x19810c, EVENT_AZALEA_TOWN_KURT

View File

@ -810,8 +810,8 @@ BattleTower1F_MapEventHeader:
.PersonEvents:
db 5
person_event SPRITE_RECEPTIONIST, 10, 11, $6, 0, 0, -1, -1, 0, 0, 0, ReceptionistScript_0x9e3e2, -1
person_event SPRITE_YOUNGSTER, 13, 18, $9, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 0, 0, YoungsterScript_0x9e55d, -1
person_event SPRITE_COOLTRAINER_F, 13, 8, $5, 0, 1, -1, -1, 8 + PAL_OW_RED, 0, 0, CooltrainerFScript_0x9e568, -1
person_event SPRITE_BUG_CATCHER, 7, 5, $2, 1, 1, -1, -1, 8 + PAL_OW_BLUE, 0, 0, BugCatcherScript_0x9e56b, -1
person_event SPRITE_GRANNY, 7, 18, $4, 1, 0, -1, -1, 0, 0, 0, GrannyScript_0x9e56e, -1
person_event SPRITE_RECEPTIONIST, 6, 7, $6, 0, 0, -1, -1, 0, 0, 0, ReceptionistScript_0x9e3e2, -1
person_event SPRITE_YOUNGSTER, 9, 14, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 0, 0, YoungsterScript_0x9e55d, -1
person_event SPRITE_COOLTRAINER_F, 9, 4, $5, 0, 1, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, CooltrainerFScript_0x9e568, -1
person_event SPRITE_BUG_CATCHER, 3, 1, $2, 1, 1, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, BugCatcherScript_0x9e56b, -1
person_event SPRITE_GRANNY, 3, 14, $4, 1, 0, -1, -1, 0, 0, 0, GrannyScript_0x9e56e, -1

View File

@ -155,5 +155,5 @@ BattleTowerBattleRoom_MapEventHeader:
.PersonEvents:
db 2
person_event SPRITE_YOUNGSTER, 4, 8, $6, 0, 0, -1, -1, 0, 0, 0, ObjectEvent, EVENT_BATTLE_TOWER_BATTLE_ROOM_YOUNGSTER
person_event SPRITE_RECEPTIONIST, 10, 5, $9, 0, 0, -1, -1, 0, 0, 0, ObjectEvent, -1
person_event SPRITE_YOUNGSTER, 0, 4, $6, 0, 0, -1, -1, 0, 0, 0, ObjectEvent, EVENT_BATTLE_TOWER_BATTLE_ROOM_YOUNGSTER
person_event SPRITE_RECEPTIONIST, 6, 1, $9, 0, 0, -1, -1, 0, 0, 0, ObjectEvent, -1

View File

@ -60,4 +60,4 @@ BattleTowerElevator_MapEventHeader:
.PersonEvents:
db 1
person_event SPRITE_RECEPTIONIST, 6, 5, $9, 0, 0, -1, -1, 0, 0, 0, MovementData_0x9f58f, -1
person_event SPRITE_RECEPTIONIST, 2, 1, $9, 0, 0, -1, -1, 0, 0, 0, MovementData_0x9f58f, -1

View File

@ -98,4 +98,4 @@ BattleTowerHallway_MapEventHeader:
.PersonEvents:
db 1
person_event SPRITE_RECEPTIONIST, 6, 15, $6, 0, 0, -1, -1, 0, 0, 0, BattleTowerHallway_MapEventHeader, -1
person_event SPRITE_RECEPTIONIST, 2, 11, $6, 0, 0, -1, -1, 0, 0, 0, BattleTowerHallway_MapEventHeader, -1

View File

@ -142,7 +142,7 @@ BattleTowerOutside_MapEventHeader:
.PersonEvents:
db 4
person_event SPRITE_STANDING_YOUNGSTER, 16, 10, $7, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, StandingYoungsterScript_0x9f85f, -1
person_event SPRITE_BUENA, 15, 17, $2, 1, 1, -1, -1, 8 + PAL_OW_GREEN, 0, 0, BuenaScript_0x9f862, -1
person_event SPRITE_SAILOR, 22, 16, $5, 0, 1, -1, -1, 0, 0, 0, SailorScript_0x9f865, EVENT_BATTLE_TOWER_OUTSIDE_SAILOR
person_event SPRITE_LASS, 28, 16, $3, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, ObjectEvent, -1
person_event SPRITE_STANDING_YOUNGSTER, 12, 6, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, StandingYoungsterScript_0x9f85f, -1
person_event SPRITE_BUENA, 11, 13, $2, 1, 1, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, BuenaScript_0x9f862, -1
person_event SPRITE_SAILOR, 18, 12, $5, 0, 1, -1, -1, 0, 0, 0, SailorScript_0x9f865, EVENT_BATTLE_TOWER_OUTSIDE_SAILOR
person_event SPRITE_LASS, 24, 12, $3, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, ObjectEvent, -1

View File

@ -34,7 +34,7 @@ UnknownScript_0x189553:
yesorno
iffalse UnknownScript_0x1896aa
scall UnknownScript_0x1896a5
special Function73f7
special Special_BillsGrandfather
iffalse UnknownScript_0x1896aa
if_not_equal LICKITUNG, UnknownScript_0x1896c6
scall UnknownScript_0x1896b0
@ -48,7 +48,7 @@ UnknownScript_0x189592:
yesorno
iffalse UnknownScript_0x1896aa
scall UnknownScript_0x1896a5
special Function73f7
special Special_BillsGrandfather
iffalse UnknownScript_0x1896aa
if_not_equal ODDISH, UnknownScript_0x1896c6
scall UnknownScript_0x1896b0
@ -62,7 +62,7 @@ UnknownScript_0x1895b3:
yesorno
iffalse UnknownScript_0x1896aa
scall UnknownScript_0x1896a5
special Function73f7
special Special_BillsGrandfather
iffalse UnknownScript_0x1896aa
if_not_equal STARYU, UnknownScript_0x1896c6
scall UnknownScript_0x1896b0
@ -78,7 +78,7 @@ UnknownScript_0x1895d4:
yesorno
iffalse UnknownScript_0x1896aa
scall UnknownScript_0x1896a5
special Function73f7
special Special_BillsGrandfather
iffalse UnknownScript_0x1896aa
if_not_equal GROWLITHE, UnknownScript_0x1896c6
scall UnknownScript_0x1896b0
@ -92,7 +92,7 @@ UnknownScript_0x1895f9:
yesorno
iffalse UnknownScript_0x1896aa
scall UnknownScript_0x1896a5
special Function73f7
special Special_BillsGrandfather
iffalse UnknownScript_0x1896aa
if_not_equal VULPIX, UnknownScript_0x1896c6
scall UnknownScript_0x1896b0
@ -106,7 +106,7 @@ UnknownScript_0x18961a:
yesorno
iffalse UnknownScript_0x1896aa
scall UnknownScript_0x1896a5
special Function73f7
special Special_BillsGrandfather
iffalse UnknownScript_0x1896aa
if_not_equal PICHU, UnknownScript_0x1896c6
scall UnknownScript_0x1896b0
@ -367,4 +367,4 @@ BillsHouse_MapEventHeader:
.PersonEvents:
db 1
person_event SPRITE_GRAMPS, 7, 6, $7, 2, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, GrampsScript_0x189538, -1
person_event SPRITE_GRAMPS, 3, 2, $7, 2, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, GrampsScript_0x189538, -1

View File

@ -333,12 +333,12 @@ BlackthornCity_MapEventHeader:
.PersonEvents:
db 9
person_event SPRITE_SUPER_NERD, 16, 22, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, SuperNerdScript_0x1a46e8, EVENT_BLACKTHORN_CITY_SUPER_NERD_BLOCKS_GYM
person_event SPRITE_SUPER_NERD, 16, 23, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, SuperNerdScript_0x1a46e8, EVENT_BLACKTHORN_CITY_SUPER_NERD_DOES_NOT_BLOCK_GYM
person_event SPRITE_GRAMPS, 6, 24, $6, 0, 0, -1, -1, 0, 0, 0, GrampsScript_0x1a4708, EVENT_BLACKTHORN_CITY_GRAMPS_BLOCKS_DRAGONS_DEN
person_event SPRITE_GRAMPS, 6, 25, $8, 0, 0, -1, -1, 0, 0, 0, GrampsScript_0x1a470b, EVENT_BLACKTHORN_CITY_GRAMPS_NOT_BLOCKING_DRAGONS_DEN
person_event SPRITE_BLACK_BELT, 35, 28, $5, 0, 1, -1, -1, 8 + PAL_OW_BLUE, 0, 0, BlackBeltScript_0x1a470e, -1
person_event SPRITE_COOLTRAINER_F, 29, 13, $5, 0, 2, -1, -1, 8 + PAL_OW_RED, 0, 0, CooltrainerFScript_0x1a4722, -1
person_event SPRITE_YOUNGSTER, 19, 17, $5, 0, 1, -1, -1, 0, 0, 0, YoungsterScript_0x1a4725, -1
person_event SPRITE_YOUNGSTER, 24, 26, $6, 0, 0, -1, -1, 0, 0, 0, SantosScript, EVENT_BLACKTHORN_CITY_SANTOS_OF_SATURDAY
person_event SPRITE_COOLTRAINER_F, 23, 39, $7, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, CooltrainerFScript_0x1a4728, -1
person_event SPRITE_SUPER_NERD, 12, 18, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, SuperNerdScript_0x1a46e8, EVENT_BLACKTHORN_CITY_SUPER_NERD_BLOCKS_GYM
person_event SPRITE_SUPER_NERD, 12, 19, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, SuperNerdScript_0x1a46e8, EVENT_BLACKTHORN_CITY_SUPER_NERD_DOES_NOT_BLOCK_GYM
person_event SPRITE_GRAMPS, 2, 20, $6, 0, 0, -1, -1, 0, 0, 0, GrampsScript_0x1a4708, EVENT_BLACKTHORN_CITY_GRAMPS_BLOCKS_DRAGONS_DEN
person_event SPRITE_GRAMPS, 2, 21, $8, 0, 0, -1, -1, 0, 0, 0, GrampsScript_0x1a470b, EVENT_BLACKTHORN_CITY_GRAMPS_NOT_BLOCKING_DRAGONS_DEN
person_event SPRITE_BLACK_BELT, 31, 24, $5, 0, 1, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, BlackBeltScript_0x1a470e, -1
person_event SPRITE_COOLTRAINER_F, 25, 9, $5, 0, 2, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, CooltrainerFScript_0x1a4722, -1
person_event SPRITE_YOUNGSTER, 15, 13, $5, 0, 1, -1, -1, 0, 0, 0, YoungsterScript_0x1a4725, -1
person_event SPRITE_YOUNGSTER, 20, 22, $6, 0, 0, -1, -1, 0, 0, 0, SantosScript, EVENT_BLACKTHORN_CITY_SANTOS_OF_SATURDAY
person_event SPRITE_COOLTRAINER_F, 19, 35, $7, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, CooltrainerFScript_0x1a4728, -1

View File

@ -35,4 +35,4 @@ BlackthornDodrioTradeHouse_MapEventHeader:
.PersonEvents:
db 1
person_event SPRITE_LASS, 7, 6, $3, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, Emy, -1
person_event SPRITE_LASS, 3, 2, $3, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, Emy, -1

View File

@ -58,5 +58,5 @@ BlackthornDragonSpeechHouse_MapEventHeader:
.PersonEvents:
db 2
person_event SPRITE_GRANNY, 7, 6, $3, 0, 0, -1, -1, 0, 0, 0, GrannyScript_0x195949, -1
person_event SPRITE_EKANS, 9, 9, $16, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, EkansScript_0x19594c, -1
person_event SPRITE_GRANNY, 3, 2, $3, 0, 0, -1, -1, 0, 0, 0, GrannyScript_0x195949, -1
person_event SPRITE_EKANS, 5, 5, $16, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, EkansScript_0x19594c, -1

View File

@ -404,8 +404,8 @@ BlackthornGym1F_MapEventHeader:
.PersonEvents:
db 5
person_event SPRITE_CLAIR, 7, 9, $6, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, ClairScript_0x194e24, -1
person_event SPRITE_COOLTRAINER_M, 10, 10, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 3, TrainerCooltrainermMike, -1
person_event SPRITE_COOLTRAINER_M, 18, 5, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 3, TrainerCooltrainermPaul, -1
person_event SPRITE_COOLTRAINER_F, 6, 13, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 1, TrainerCooltrainerfLola, -1
person_event SPRITE_GYM_GUY, 19, 11, $6, 0, 0, -1, -1, 8 + PAL_OW_RED, 0, 0, BlackthornGymGuyScript, -1
person_event SPRITE_CLAIR, 3, 5, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, ClairScript_0x194e24, -1
person_event SPRITE_COOLTRAINER_M, 6, 6, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 3, TrainerCooltrainermMike, -1
person_event SPRITE_COOLTRAINER_M, 14, 1, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 3, TrainerCooltrainermPaul, -1
person_event SPRITE_COOLTRAINER_F, 2, 9, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 1, TrainerCooltrainerfLola, -1
person_event SPRITE_GYM_GUY, 15, 7, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, BlackthornGymGuyScript, -1

View File

@ -145,11 +145,11 @@ BlackthornGym2F_MapEventHeader:
.PersonEvents:
db 8
person_event SPRITE_COOLTRAINER_M, 5, 8, $9, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 1, TrainerCooltrainermCody, -1
person_event SPRITE_COOLTRAINER_F, 15, 8, $8, 0, 0, -1, -1, 8 + PAL_OW_RED, 2, 1, TrainerCooltrainerfFran, -1
person_event SPRITE_BOULDER, 6, 12, $19, 0, 0, -1, -1, 0, 0, 0, BlackthornGymBoulder, EVENT_BOULDER_IN_BLACKTHORN_GYM_1
person_event SPRITE_BOULDER, 7, 6, $19, 0, 0, -1, -1, 0, 0, 0, BlackthornGymBoulder, EVENT_BOULDER_IN_BLACKTHORN_GYM_2
person_event SPRITE_BOULDER, 20, 10, $19, 0, 0, -1, -1, 0, 0, 0, BlackthornGymBoulder, EVENT_BOULDER_IN_BLACKTHORN_GYM_3
person_event SPRITE_BOULDER, 7, 7, $19, 0, 0, -1, -1, 0, 0, 0, BlackthornGymBoulder, -1
person_event SPRITE_BOULDER, 5, 10, $19, 0, 0, -1, -1, 0, 0, 0, BlackthornGymBoulder, -1
person_event SPRITE_BOULDER, 18, 12, $19, 0, 0, -1, -1, 0, 0, 0, BlackthornGymBoulder, -1
person_event SPRITE_COOLTRAINER_M, 1, 4, $9, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 1, TrainerCooltrainermCody, -1
person_event SPRITE_COOLTRAINER_F, 11, 4, $8, 0, 0, -1, -1, (1 << 3) | PAL_OW_RED, 2, 1, TrainerCooltrainerfFran, -1
person_event SPRITE_BOULDER, 2, 8, $19, 0, 0, -1, -1, 0, 0, 0, BlackthornGymBoulder, EVENT_BOULDER_IN_BLACKTHORN_GYM_1
person_event SPRITE_BOULDER, 3, 2, $19, 0, 0, -1, -1, 0, 0, 0, BlackthornGymBoulder, EVENT_BOULDER_IN_BLACKTHORN_GYM_2
person_event SPRITE_BOULDER, 16, 6, $19, 0, 0, -1, -1, 0, 0, 0, BlackthornGymBoulder, EVENT_BOULDER_IN_BLACKTHORN_GYM_3
person_event SPRITE_BOULDER, 3, 3, $19, 0, 0, -1, -1, 0, 0, 0, BlackthornGymBoulder, -1
person_event SPRITE_BOULDER, 1, 6, $19, 0, 0, -1, -1, 0, 0, 0, BlackthornGymBoulder, -1
person_event SPRITE_BOULDER, 14, 8, $19, 0, 0, -1, -1, 0, 0, 0, BlackthornGymBoulder, -1

View File

@ -58,6 +58,6 @@ BlackthornMart_MapEventHeader:
.PersonEvents:
db 3
person_event SPRITE_CLERK, 7, 5, $9, 0, 0, -1, -1, 0, 0, 0, ClerkScript_0x195a5d, -1
person_event SPRITE_COOLTRAINER_M, 10, 11, $5, 0, 2, -1, -1, 0, 0, 0, CooltrainerMScript_0x195a64, -1
person_event SPRITE_BLACK_BELT, 6, 9, $6, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, BlackBeltScript_0x195a67, -1
person_event SPRITE_CLERK, 3, 1, $9, 0, 0, -1, -1, 0, 0, 0, ClerkScript_0x195a5d, -1
person_event SPRITE_COOLTRAINER_M, 6, 7, $5, 0, 2, -1, -1, 0, 0, 0, CooltrainerMScript_0x195a64, -1
person_event SPRITE_BLACK_BELT, 2, 5, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, BlackBeltScript_0x195a67, -1

View File

@ -61,7 +61,7 @@ BlackthornPokeCenter1F_MapEventHeader:
.PersonEvents:
db 4
person_event SPRITE_NURSE, 5, 7, $6, 0, 0, -1, -1, 0, 0, 0, NurseScript_0x195b79, -1
person_event SPRITE_GENTLEMAN, 7, 9, $6, 0, 0, -1, -1, 0, 0, 0, GentlemanScript_0x195b7c, -1
person_event SPRITE_TWIN, 8, 5, $3, 0, 0, -1, -1, 8 + PAL_OW_GREEN, 0, 0, TwinScript_0x195b7f, -1
person_event SPRITE_COOLTRAINER_M, 10, 11, $5, 0, 1, -1, -1, 8 + PAL_OW_RED, 0, 0, CooltrainerMScript_0x195b82, -1
person_event SPRITE_NURSE, 1, 3, $6, 0, 0, -1, -1, 0, 0, 0, NurseScript_0x195b79, -1
person_event SPRITE_GENTLEMAN, 3, 5, $6, 0, 0, -1, -1, 0, 0, 0, GentlemanScript_0x195b7c, -1
person_event SPRITE_TWIN, 4, 1, $3, 0, 0, -1, -1, (1 << 3) | PAL_OW_GREEN, 0, 0, TwinScript_0x195b7f, -1
person_event SPRITE_COOLTRAINER_M, 6, 7, $5, 0, 1, -1, -1, (1 << 3) | PAL_OW_RED, 0, 0, CooltrainerMScript_0x195b82, -1

View File

@ -158,4 +158,4 @@ BluesHouse_MapEventHeader:
.PersonEvents:
db 1
person_event SPRITE_DAISY, 7, 6, $3, 0, 0, -1, -1, 0, 0, 0, DaisyScript_0x19b0d0, -1
person_event SPRITE_DAISY, 3, 2, $3, 0, 0, -1, -1, 0, 0, 0, DaisyScript_0x19b0d0, -1

View File

@ -145,4 +145,4 @@ BrunosRoom_MapEventHeader:
.PersonEvents:
db 1
person_event SPRITE_BRUNO, 11, 9, $6, 0, 0, -1, -1, 8 + PAL_OW_BROWN, 0, 0, BrunoScript_0x1809c5, -1
person_event SPRITE_BRUNO, 7, 5, $6, 0, 0, -1, -1, (1 << 3) | PAL_OW_BROWN, 0, 0, BrunoScript_0x1809c5, -1

View File

@ -309,8 +309,8 @@ BurnedTower1F_MapEventHeader:
.PersonEvents:
db 5
person_event SPRITE_ROCK, 8, 19, $18, 0, 0, -1, -1, 0, 0, 0, BurnedTower1FRock, -1
person_event SPRITE_SUPER_NERD, 16, 16, $3, 0, 0, -1, -1, 8 + PAL_OW_BLUE, 0, 0, SuperNerdScript_0x185cbc, EVENT_BURNED_TOWER_1F_EUSINE
person_event SPRITE_SILVER, 13, 12, $8, 0, 0, -1, -1, 0, 2, 3, ObjectEvent, EVENT_RIVAL_BURNED_TOWER
person_event SPRITE_MORTY, 18, 18, $2, 1, 1, -1, -1, 8 + PAL_OW_BROWN, 0, 0, MortyScript_0x185cbf, EVENT_BURNED_TOWER_MORTY
person_event SPRITE_POKE_BALL, 6, 18, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x185ccb, EVENT_BURNED_TOWER_1F_HP_UP
person_event SPRITE_ROCK, 4, 15, $18, 0, 0, -1, -1, 0, 0, 0, BurnedTower1FRock, -1
person_event SPRITE_SUPER_NERD, 12, 12, $3, 0, 0, -1, -1, (1 << 3) | PAL_OW_BLUE, 0, 0, SuperNerdScript_0x185cbc, EVENT_BURNED_TOWER_1F_EUSINE
person_event SPRITE_SILVER, 9, 8, $8, 0, 0, -1, -1, 0, 2, 3, ObjectEvent, EVENT_RIVAL_BURNED_TOWER
person_event SPRITE_MORTY, 14, 14, $2, 1, 1, -1, -1, (1 << 3) | PAL_OW_BROWN, 0, 0, MortyScript_0x185cbf, EVENT_BURNED_TOWER_MORTY
person_event SPRITE_POKE_BALL, 2, 14, $1, 0, 0, -1, -1, 0, 1, 0, ItemFragment_0x185ccb, EVENT_BURNED_TOWER_1F_HP_UP

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