Merge pull request #157 from yenatch/overworld

overworld loop and movement
This commit is contained in:
Bryan Bishop 2013-07-12 19:16:49 -07:00
commit bb8990dc3c
10 changed files with 2724 additions and 673 deletions

View File

@ -13,7 +13,7 @@ clean:
rm -f pokecrystal.o pokecrystal.gbc
@echo 'rm -f $(TEXTFILES:.asm=.tx)'
@rm -f $(TEXTFILES:.asm=.tx)
pokecrystal.o: $(TEXTFILES:.asm=.tx) $(LZ_GFX) $(TWOBPP_GFX)
pokecrystal.o: $(TEXTFILES:.asm=.tx) wram.asm constants.asm $(shell find constants/ -type f -name '*constants.asm') hram.asm gbhw.asm $(LZ_GFX) $(TWOBPP_GFX)
python prequeue.py $(TEXTQUEUE)
rgbasm -o pokecrystal.o pokecrystal.asm
.asm.tx:

View File

@ -6796,7 +6796,7 @@ BattleCommandac: ; 3658f
; jump
dec a
ld hl, .ptrs
rst $28
rst JumpTable
ret
.ptrs
dw BattleCommand19 ; paralyze
@ -9953,7 +9953,7 @@ Function0x377f5: ; 377f5
ld [$d123], a
ld a, [hl]
ld [$d124], a
ld a, $3
ld a, 3
ld [MonType], a
ld a, $14
ld hl, $4bdd

View File

@ -1,5 +1,11 @@
_CRYSTAL EQU 1
if _CRYSTAL
VERSION EQU 0
else
VERSION EQU 1
endc
INCLUDE "constants/pokemon_constants.asm"
INCLUDE "constants/move_constants.asm"
INCLUDE "constants/battle_constants.asm"
@ -10,9 +16,10 @@ INCLUDE "constants/script_constants.asm"
INCLUDE "constants/music_constants.asm"
; rst vectors
; macros require rst vectors to be defined
FarCall EQU $08
Bankswitch EQU $10
JumpTable EQU $28
dwb: MACRO
@ -184,22 +191,6 @@ ICON_SUDOWOODO EQU $25
ICON_BIGMON EQU $26
; days of the week
SUNDAY EQU 0
MONDAY EQU 1
TUESDAY EQU 2
WEDNESDAY EQU 3
THURSDAY EQU 4
FRIDAY EQU 5
SATURDAY EQU 6
; time of day
MORN EQU 0
DAY EQU 1
NITE EQU 2
DARKNESS EQU 3
; evolution types
EVOLVE_LEVEL EQU 1
EVOLVE_ITEM EQU 2
@ -220,23 +211,6 @@ ATK_LT_DEF EQU 2
ATK_EQ_DEF EQU 3
; main menu
CONTINUE EQU 0
NEW_GAME EQU 1
OPTION EQU 2
MYSTERY_GIFT EQU 3
MOBILE EQU 4
MOBILE_STUDIUM EQU 5
; kris's pc menu items
WITHDRAW_ITEM EQU 0
DEPOSIT_ITEM EQU 1
TOSS_ITEM EQU 2
MAIL_BOX EQU 3
DECORATION EQU 4
TURN_OFF EQU 5
LOG_OFF EQU 6
; name length
PLAYER_NAME_LENGTH EQU 8
PKMN_NAME_LENGTH EQU 11
@ -258,20 +232,10 @@ SET_FLAG EQU 1
CHECK_FLAG EQU 2
; player states
PLAYER_NORMAL EQU 0
PLAYER_BIKE EQU 1
PLAYER_SLIP EQU 2
PLAYER_SURF EQU 4
PLAYER_SURF_PIKA EQU 8
; joypad
BUTTONS EQU %00010000
D_PAD EQU %00100000
AUTO_INPUT EQU $ff
NO_INPUT EQU %00000000
BUTTON_A EQU %00000001
BUTTON_B EQU %00000010
@ -284,12 +248,6 @@ D_DOWN EQU %10000000
; movement
STANDING EQU -1
DOWN EQU 0
UP EQU 1
LEFT EQU 2
RIGHT EQU 3
STEP_SLOW EQU 0
STEP_WALK EQU 1
STEP_BIKE EQU 2
@ -299,19 +257,4 @@ STEP_TURN EQU 5
STEP_BACK_LEDGE EQU 6
STEP_WALK_IN_PLACE EQU 7
; facing
FACE_CURRENT EQU 0
FACE_DOWN EQU 8
FACE_UP EQU 4
FACE_LEFT EQU 2
FACE_RIGHT EQU 1
; Provisional wram bank 5 labels:
; 8 4-color palettes
Unkn1Pals EQU $d000
Unkn2Pals EQU $d040
BGPals EQU $d080
OBPals EQU $d0c0

View File

@ -171,21 +171,21 @@ ScriptCommandTable: ; 0x96cb1
dw Script_unknown0xa9
; 0x96e05
Unknown_0x96e05: ; 0x96e05
ld hl, $d434
set 2, [hl]
StartScript: ; 0x96e05
ld hl, ScriptFlags
set SCRIPT_RUNNING, [hl]
ret
; 0x96e0b
Unknown_0x96e0b: ; 0x96e0b
ld hl, $d434
bit 2, [hl]
CheckScript: ; 0x96e0b
ld hl, ScriptFlags
bit SCRIPT_RUNNING, [hl]
ret
; 0x96e11
Unknown_0x96e11: ; 0x96e11
ld hl, $d434
res 2, [hl]
StopScript: ; 0x96e11
ld hl, ScriptFlags
res SCRIPT_RUNNING, [hl]
ret
; 0x96e17
@ -250,8 +250,8 @@ Script_jumptextfaceplayer: ; 0x96e45
ld [$d44f], a
call GetScriptByte
ld [$d450], a
ld b, $25
ld hl, $6e79
ld b, BANK(JumpTextFacePlayerScript)
ld hl, JumpTextFacePlayerScript
jp ScriptJump
; 0x96e5f
@ -266,12 +266,20 @@ Script_jumptext: ; 0x96e5f
ld [$d44f], a
call GetScriptByte
ld [$d450], a
ld b, $25
ld hl, $6e7a
ld b, BANK(JumpTextScript)
ld hl, JumpTextScript
jp ScriptJump
; 0x96e79
INCBIN "baserom.gbc",$96e79,$96e81 - $96e79
JumpTextFacePlayerScript: ; 0x96e79
faceplayer
JumpTextScript: ; 0x96e7a
loadfont
repeattext $ff, $ff
closetext
loadmovesprites
end
; 0x96e81
Script_3jumptext: ; 0x96e81
; script command 0x52
@ -284,8 +292,8 @@ Script_3jumptext: ; 0x96e81
ld [$d44f], a
call GetScriptByte
ld [$d450], a
ld b, $25
ld hl, $6e7a
ld b, BANK(JumpTextScript)
ld hl, JumpTextScript
jp ScriptJump
; 0x96e9b
@ -478,16 +486,41 @@ Script_verbosegiveitem: ; 0x96f60
; quantity (DecimalParam)
call $77ca
call $7051
ld de, $d073
call CurItemName
ld de, StringBuffer1
ld a, $1
call $76c8
ld b, $25
ld de, $6f77
jp $74cb
ld b, BANK(GiveItemScript)
ld de, GiveItemScript
jp ScriptCall
; 0x96f76
INCBIN "baserom.gbc",$96f76,$96f8e - $96f76
Function96f76: ; 96f76
ret
; 96f77
GiveItemScript: ; 96f77
3callasm BANK(Function96f76), Function96f76
2writetext ReceivedItemText
iffalse .Full
waitbutton
specialsound
closetext
itemnotify
end
.Full
keeptextopen
pocketisfull
end
; 96f89
ReceivedItemText: ; 96f89
text_jump UnknownText_0x1c4719, BANK(UnknownText_0x1c4719)
db "@"
; 96f8e
Script_verbosegiveitem2: ; 0x96f8e
; script command 0x9f
@ -512,22 +545,22 @@ Script_verbosegiveitem2: ; 0x96f8e
xor a
.asm_96fb0
ld [$c2dd], a
call $7051
ld de, $d073
call CurItemName
ld de, StringBuffer1
ld a, $1
call $76c8
ld b, $25
ld de, $6f77
jp $74cb
ld b, BANK(GiveItemScript)
ld de, GiveItemScript
jp ScriptCall
; 0x96fc6
Script_itemnotify: ; 0x96fc6
; script command 0x45
call $6ffe
call $7051
ld b, $25
ld hl, $705b
call GetPocketName
call CurItemName
ld b, BANK(PutItemInPocketText)
ld hl, PutItemInPocketText
call $269a
ret
; 0x96fd5
@ -535,10 +568,10 @@ Script_itemnotify: ; 0x96fc6
Script_pocketisfull: ; 0x96fd5
; script command 0x46
call $6ffe
call $7051
ld b, $25
ld hl, $7060
call GetPocketName
call CurItemName
ld b, BANK(PocketIsFullText)
ld hl, PocketIsFullText
call $269a
ret
; 0x96fe4
@ -560,7 +593,58 @@ Script_specialsound: ; 0x96fe4
ret
; 0x96ffe
INCBIN "baserom.gbc",$96ffe,$97065 - $96ffe
GetPocketName: ; 96ffe
callba CheckItemPocket
ld a, [$d142]
dec a
ld hl, .Pockets
and 3
add a
ld e, a
ld d, 0
add hl, de
ld a, [hli]
ld d, [hl]
ld e, a
ld hl, StringBuffer3
call CopyName2
ret
.Pockets
dw .Item
dw .Key
dw .Ball
dw .TM
.Item
db "ITEM POCKET@"
.Key
db "KEY POCKET@"
.Ball
db "BALL POCKET@"
.TM
db "TM POCKET@"
; 97051
CurItemName: ; 97051
ld a, [CurItem]
ld [$d265], a
call GetItemName
ret
; 9705b
PutItemInPocketText: ; 9705b
text_jump UnknownText_0x1c472c, BANK(UnknownText_0x1c472c)
db "@"
; 97060
PocketIsFullText: ; 97060
text_jump UnknownText_0x1c474b, BANK(UnknownText_0x1c474b)
db "@"
; 97065
Script_pokemart: ; 0x97065
; script command 0x94
@ -793,7 +877,7 @@ Script_talkaftercancel: ; 0x97163
ld a, [$d04d]
and a
ret z
jp $7b74
jp Script_end
; 0x9716b
Script_talkaftercheck: ; 0x9716b
@ -954,9 +1038,9 @@ Script_applymovement: ; 0x971f3
ld b, a
call $26c7
ret c
ld a, $2
ld [$d437], a
call Unknown_0x96e11
ld a, SCRIPT_WAIT_MOVEMENT
ld [ScriptMode], a
call StopScript
ret
; 0x97221
@ -1291,33 +1375,61 @@ Script_showemote: ; 0x97396
ld [$ffe0], a
.asm_973a8
call GetScriptByte
ld [$d44d], a
ld b, $25
ld de, $73b6
jp $74cb
ld [ScriptDelay], a
ld b, BANK(ShowEmoteScript)
ld de, ShowEmoteScript
jp ScriptCall
; 0x973b6
INCBIN "baserom.gbc",$973b6,$973c7 - $973b6
ShowEmoteScript: ; 973b6
loademote $ff
applymovement2 .Show
pause 0
applymovement2 .Hide
end
.Show
show_emote
show_person
step_end
.Hide
hide_emote
show_person
step_end
; 973c7
Script_earthquake: ; 0x973c7
; script command 0x78
; parameters:
; param (DecimalParam)
ld hl, $73eb
ld hl, EarthquakeMovement
ld de, $d002
ld bc, $0005
ld bc, EarthquakeMovementEnd - EarthquakeMovement
call CopyBytes
call GetScriptByte
ld [$d003], a
and $3f
ld [$d005], a
ld b, $25
ld de, $73e6
jp $74cb
ld b, BANK(UnknownScript_0x973e6)
ld de, UnknownScript_0x973e6
jp ScriptCall
; 0x973e6
INCBIN "baserom.gbc",$973e6,$973f0 - $973e6
UnknownScript_0x973e6: ; 973e6
applymovement $0, $d002
end
; 973eb
EarthquakeMovement: ; 973eb
step_shake 16
step_sleep 16
step_end
EarthquakeMovementEnd
; 973f0
Script_loadpikachudata: ; 0x973f0
; script command 0x5a
@ -1402,7 +1514,7 @@ Script_catchtutorial: ; 0x97447
ld a, $13
ld hl, $6554
rst $8
jp $7491
jp Script_reloadmap
; 0x97459
Script_returnafterbattle: ; 0x97459
@ -1435,7 +1547,7 @@ Script_returnafterbattle: ; 0x97459
ld hl, $7c4f
rst $8
.asm_9748e
jp $7491
jp Script_reloadmap
; 0x97491
Script_reloadmap: ; 0x97491
@ -1447,7 +1559,7 @@ Script_reloadmap: ; 0x97491
ld [$ff9f], a
ld a, $1
call $261b
call Unknown_0x96e11
call StopScript
ret
; 0x974a2
@ -1525,7 +1637,7 @@ Unknown_0x974f3: ; 0x974f3
ld a, [ScriptBank]
or $80
ld [ScriptBank], a
jp $74cb
jp ScriptCall
; 0x974fe
Script_2jump: ; 0x974fe
@ -1580,7 +1692,7 @@ Script_iffalse: ; 0x9752c
ld a, [$c2dd]
and a
jp nz, $7596
jp nz, SkipTwoScriptBytes
jp Script_2jump
; 0x97536
@ -1592,7 +1704,7 @@ Script_iftrue: ; 0x97536
ld a, [$c2dd]
and a
jp nz, Script_2jump
jp $7596
jp SkipTwoScriptBytes
; 0x97540
Script_if_equal: ; 0x97540
@ -1605,7 +1717,7 @@ Script_if_equal: ; 0x97540
ld hl, $c2dd
cp [hl]
jr z, Script_2jump ; 0x97547 $b5
jr Unknown_97596 ; 0x97549 $4b
jr SkipTwoScriptBytes ; 0x97549 $4b
; 0x9754b
Script_if_not_equal: ; 0x9754b
@ -1618,7 +1730,7 @@ Script_if_not_equal: ; 0x9754b
ld hl, $c2dd
cp [hl]
jr nz, Script_2jump ; 0x97552 $aa
jr Unknown_97596 ; 0x97554 $40
jr SkipTwoScriptBytes ; 0x97554 $40
; 0x97556
Script_if_less_than: ; 0x97556
@ -1632,7 +1744,7 @@ Script_if_less_than: ; 0x97556
call GetScriptByte
cp b
jr c, Script_2jump ; 0x9755e $9e
jr Unknown_97596 ; 0x97560 $34
jr SkipTwoScriptBytes ; 0x97560 $34
; 0x97562
Script_if_greater_than: ; 0x97562
@ -1646,7 +1758,7 @@ Script_if_greater_than: ; 0x97562
ld a, [$c2dd]
cp b
jr c, Script_2jump ; 0x9756a $92
jr Unknown_97596 ; 0x9756c $28
jr SkipTwoScriptBytes ; 0x9756c $28
; 0x9756e
Script_jumpstd: ; 0x9756e
@ -1654,7 +1766,7 @@ Script_jumpstd: ; 0x9756e
; parameters:
; predefined_script (MultiByteParam)
call $757b
call StdScript
jr ScriptJump ; 0x97571 $2a
; 0x97573
@ -1663,31 +1775,31 @@ Script_callstd: ; 0x97573
; parameters:
; predefined_script (MultiByteParam)
call $757b
call StdScript
ld d, h
ld e, l
jp $74cb
jp ScriptCall
; 0x9757b
Unknown_0x9757b: ; 0x9757b
StdScript: ; 0x9757b
call GetScriptByte
ld e, a
call GetScriptByte
ld d, a
ld hl, $4000
ld hl, $4000 ; StdScripts
add hl, de
add hl, de
add hl, de
ld a, $2f
ld a, $2f ; BANK(StdScripts)
call GetFarByte
ld b, a
inc hl
ld a, $2f
ld a, $2f ; BANK(StdScripts)
call GetFarHalfword
ret
; 0x97596
Unknown_97596: ; 0x97596
SkipTwoScriptBytes: ; 0x97596
call GetScriptByte
call GetScriptByte
ret
@ -1714,7 +1826,7 @@ Script_priorityjump: ; 0x975aa
ld [$d44f], a
call GetScriptByte
ld [$d450], a
ld hl, $d434
ld hl, ScriptFlags
set 3, [hl]
ret
; 0x975c2
@ -1957,12 +2069,14 @@ Unknown_0x9769e: ; 0x9769e
Script_checkver: ; 0x976a6
; script command 0x18
ld a, [$76ad]
ld a, [Version]
ld [$c2dd], a
ret
; 0x976ad
INCBIN "baserom.gbc",$976ad,$976ae - $976ad
Version: ; 976ad
db VERSION
; 976ae
Script_pokenamemem: ; 0x976ae
; script command 0x40
@ -1977,7 +2091,7 @@ Script_pokenamemem: ; 0x976ae
.asm_976b7
ld [$d265], a
call $343b
ld de, $d073
ld de, StringBuffer1
Unknown_976c0: ; 0x976c0
call GetScriptByte
@ -1985,8 +2099,8 @@ Unknown_976c0: ; 0x976c0
jr c, .asm_976c8 ; 0x976c5 $1
xor a
.asm_976c8
ld hl, $d099
ld bc, $0013
ld hl, StringBuffer3
ld bc, 19
call AddNTimes
call CopyName2
ret
@ -2005,7 +2119,7 @@ Script_itemtotext: ; 0x976d5
.asm_976de
ld [$d265], a
call GetItemName
ld de, $d073
ld de, StringBuffer1
jr Unknown_976c0 ; 0x976e7 $d7
; 0x976e9
@ -2025,8 +2139,8 @@ Unknown_976f4: ; 0x976f4
ld a, $72
ld hl, $68a5
rst $8
ld de, $d073
jp $76c0
ld de, StringBuffer1
jp Unknown_976c0
; 0x97701
Script_displaylocation: ; 0x97701
@ -2065,8 +2179,8 @@ Unknown_9771c: ; 0x9771c
call GetScriptByte
ld [$cf60], a
call GetName
ld de, $d073
jp $76c0
ld de, StringBuffer1
jp Unknown_976c0
; 0x9772b
Script_unknown0xa6: ; 0x9772b
@ -2085,11 +2199,11 @@ Script_readmoney: ; 0x97732
call $7771
call $7861
ld hl, $d073
ld hl, StringBuffer1
ld bc, $4306
call $3198
ld de, $d073
jp $76c0
ld de, StringBuffer1
jp Unknown_976c0
; 0x97747
Script_readcoins: ; 0x97747
@ -2098,12 +2212,12 @@ Script_readcoins: ; 0x97747
; memory (SingleByteParam)
call $7771
ld hl, $d073
ld hl, StringBuffer1
ld de, $d855
ld bc, $4206
call $3198
ld de, $d073
jp $76c0
ld de, StringBuffer1
jp Unknown_976c0
; 0x9775c
Script_RAM2MEM: ; 0x9775c
@ -2113,17 +2227,17 @@ Script_RAM2MEM: ; 0x9775c
call $7771
ld de, $c2dd
ld hl, $d073
ld hl, StringBuffer1
ld bc, $4103
call $3198
ld de, $d073
jp $76c0
ld de, StringBuffer1
jp Unknown_976c0
; 0x97771
Unknown_0x97771: ; 0x97771
ld hl, $d073
ld hl, StringBuffer1
ld bc, $000b
ld a, $50
ld a, "@"
call ByteFill
ret
; 0x9777d
@ -2141,8 +2255,8 @@ Script_stringtotext: ; 0x9777d
ld a, [ScriptBank]
ld hl, $30d6
rst $8
ld de, $d086
jp $76c0
ld de, StringBuffer2
jp Unknown_976c0
; 0x97792
Script_givepokeitem: ; 0x97792
@ -2719,7 +2833,7 @@ Script_warp: ; 0x97a1d
ld [$ff9f], a
ld a, $1
call $261b
call Unknown_0x96e11
call StopScript
ret
.asm_97a4a
call GetScriptByte
@ -2731,7 +2845,7 @@ Script_warp: ; 0x97a1d
ld [$ff9f], a
ld a, $1
call $261b
call Unknown_0x96e11
call StopScript
ret
; 0x97a65
@ -2884,7 +2998,7 @@ Script_newloadmap: ; 0x97b08
ld [$ff9f], a
ld a, $1
call $261b
call Unknown_0x96e11
call StopScript
ret
; 0x97b16
@ -2892,7 +3006,7 @@ Script_reloadandreturn: ; 0x97b16
; script command 0x92
call $7b08
jp $7b74
jp Script_end
; 0x97b1c
Script_loadfont: ; 0x97b1c
@ -2922,7 +3036,10 @@ Script_loadbytec1ce: ; 0x97b27
ret
; 0x97b2e
INCBIN "baserom.gbc",$97b2e,$97b2f - $97b2e
LoadMoveSpritesScript: ; 97b2e
loadmovesprites
; 97b2f
Script_loadmovesprites: ; 0x97b2f
; script command 0x49
@ -2932,6 +3049,7 @@ Script_loadmovesprites: ; 0x97b2f
ret
; 0x97b36
Script_passtoengine: ; 0x97b36
; script command 0x89
; parameters:
@ -2956,11 +3074,11 @@ Script_pause: ; 0x97b47
call GetScriptByte
and a
jr z, .asm_97b50 ; 0x97b4b $3
ld [$d44d], a
ld [ScriptDelay], a
.asm_97b50
ld c, $2
ld c, 2
call DelayFrames
ld hl, $d44d
ld hl, ScriptDelay
dec [hl]
jr nz, .asm_97b50 ; 0x97b59 $f5
ret
@ -2974,11 +3092,11 @@ Script_deactivatefacing: ; 0x97b5c
call GetScriptByte
and a
jr z, .asm_97b65 ; 0x97b60 $3
ld [$d44d], a
ld [ScriptDelay], a
.asm_97b65
ld a, $3
ld [$d437], a
call Unknown_0x96e11
ld a, SCRIPT_WAIT
ld [ScriptMode], a
call StopScript
ret
; 0x97b6e
@ -2987,40 +3105,42 @@ Script_ptpriorityjump: ; 0x97b6e
; parameters:
; pointer (ScriptPointerLabelParam)
call Unknown_0x96e11
call StopScript
jp Script_2jump
; 0x97b74
Script_end: ; 0x97b74
; script command 0x91
call $7b9a
jr c, .asm_97b7a ; 0x97b77 $1
call ExitScriptSubroutine
jr c, .asm_97b7a
ret
.asm_97b7a
xor a
ld [$d438], a
ld a, $0
ld [$d437], a
ld hl, $d434
ld [ScriptRunning], a
ld a, SCRIPT_OFF
ld [ScriptMode], a
ld hl, ScriptFlags
res 0, [hl]
call Unknown_0x96e11
call StopScript
ret
; 0x97b8c
Script_return: ; 0x97b8c
; script command 0x90
call $7b9a
jr c, .asm_97b91 ; 0x97b8f $0
call ExitScriptSubroutine
jr c, .asm_97b91
.asm_97b91
ld hl, $d434
ld hl, ScriptFlags
res 0, [hl]
call Unknown_0x96e11
call StopScript
ret
; 0x97b9a
Unknown_0x97b9a: ; 0x97b9a
ExitScriptSubroutine: ; 0x97b9a
; Return carry if there's no parent to return to.
ld hl, $d43c
ld a, [hl]
and a
@ -3054,12 +3174,12 @@ Script_resetfuncs: ; 0x97bc0
xor a
ld [$d43c], a
ld [$d438], a
ld a, $0
ld [$d437], a
ld hl, $d434
ld [ScriptRunning], a
ld a, SCRIPT_OFF
ld [ScriptMode], a
ld hl, ScriptFlags
res 0, [hl]
call Unknown_0x96e11
call StopScript
ret
; 0x97bd5
@ -3068,15 +3188,9 @@ Script_halloffame: ; 0x97bd5
ld hl, $cfbc
res 0, [hl]
ld a, BANK(HallOfFame1)
ld hl, HallOfFame1
rst $8
ld a, BANK(HallOfFame2)
ld hl, HallOfFame2
rst $8
ld a, BANK(HallOfFame3)
ld hl, HallOfFame3
rst $8
callba HallOfFame1
callba HallOfFame2
callba HallOfFame3
ld hl, $cfbc
set 0, [hl]
jr DisplayCredits
@ -3093,7 +3207,7 @@ DisplayCredits:
call $7bc0
ld a, $3
call $261b
call Unknown_0x96e11
call StopScript
ret
; 0x97c05
@ -3106,7 +3220,7 @@ Script_unknown0xa8: ; 0x97c05
call GetScriptByte
.asm_97c09
push af
ld c, $6
ld c, 6
call DelayFrames
pop af
dec a
@ -3125,3 +3239,4 @@ Script_unknown0xa9: ; 0x97c15
ld [$c2dd], a
ret
; 0x97c20

View File

@ -98,6 +98,7 @@ chars = {
0xE9: "&",
0xEA: "é",
0xEB: "",
0xEC: "",
0xED: "",
0xEE: "",
0xEF: "",

View File

@ -1989,6 +1989,7 @@ movement_command_bases = {
0x3A: "remove_fixed_facing",
0x3B: "fix_facing",
0x3D: "hide_person",
0x3E: "show_person",
0x45: "accelerate_last",
0x46: ["step_sleep", ["duration", DecimalParam]],
0x47: "step_end",
@ -2000,6 +2001,8 @@ movement_command_bases = {
0x4E: "skyfall",
0x4F: "step_wait5",
0x53: "hide_emote",
0x54: "show_emote",
0x55: ["step_shake", ["displacement", DecimalParam]],
}

View File

@ -448,7 +448,7 @@ ParkBall: ; e8a2
xor a
ld [CurPartyMon], a
ld a, $2
ld a, BOXMON
ld [MonType], a
ld de, $d050
ld b, $0
@ -775,7 +775,7 @@ Function_0xed12: ; ed12
push de
ld a, [TempEnemyMonSpecies]
ld [CurPartySpecies], a
ld a, $4
ld a, WILDMON
ld [MonType], a
ld a, $14
ld hl, $4bdd

2449
main.asm

File diff suppressed because it is too large Load Diff

View File

@ -286,6 +286,7 @@ chars = {
"&": 0xE9,
"é": 0xEA,
"": 0xEB,
"": 0xEC,
"": 0xED,
"": 0xEE,
"": 0xEF,

137
wram.asm
View File

@ -10,12 +10,14 @@ SECTION "bgmap1",VRAM[$9C00]
VBGMap1:
; So far, WRAM banks 0 and 1 are included in this file.
; Any bank 2-7 labels are in constants.asm.
; WRAM banks 0 and 1 are included as BSS labels.
; Other WRAM banks (2-7) are constants for now.
SECTION "WRAMBank0",BSS[$c000]
SECTION "stack",BSS[$c000]
ds 256
ds $100
Stack: ; c100
@ -65,10 +67,7 @@ Channel1MusicAddress: ; c107
Channel1LastMusicAddress: ; c109
ds 2
; could have been meant as a third-level address
; unused? ; c10b
ds 1
; unused? ; c10c
ds 1
ds 2
Channel1NoteFlags: ; c10d
; 0:
; 1:
@ -312,8 +311,7 @@ CurMusic: ; c2c0
SECTION "auto",BSS[$c2c7]
InputType: ; c2c7
; 00 normal
; ff auto
AUTO_INPUT EQU $ff
ds 1
AutoInputAddress: ; c2c8
ds 2
@ -824,11 +822,10 @@ AttrMap: ; cdd9
ds 30
MonType: ; cf5f
; 0 partymon
; 1 otpartymon
; 2 boxmon
; 3 ????mon
; 4 wildmon
PARTYMON EQU 0
OTPARTYMON EQU 1
BOXMON EQU 2
WILDMON EQU 4
ds 1
CurSpecies: ; cf60
@ -839,7 +836,7 @@ CurSpecies: ; cf60
MenuSelection:; cf74
ds 1
ds $cf82-$cf74
ds 14
TileY: ; cf82
ds 1
@ -907,7 +904,9 @@ Options2: ; cfd1
ds 46
; d000
SECTION "WRAMBank1",BSS[$d000]
ds 2
DefaultFlypoint: ; d002
@ -937,10 +936,23 @@ CurFruit: ; d03f
MovementAnimation: ; d042
ds 1
WalkingDirection: ; d043
STANDING EQU -1
DOWN EQU 0
UP EQU 1
LEFT EQU 2
RIGHT EQU 3
ds 1
FacingDirection: ; d044
FACE_CURRENT EQU 0
FACE_DOWN EQU 8
FACE_UP EQU 4
FACE_LEFT EQU 2
FACE_RIGHT EQU 1
ds 1
WalkingX: ; d045
ds 1
WalkingY: ; d046
@ -1058,13 +1070,12 @@ TempMonSpclAtk: ; d13a
ds 2
TempMonSpclDef: ; d13c
ds 2
TempMonEnd: ; d13e
TempMonEnd ; d13e
ds 3
PartyMenuActionText ; d141
PartyMenuActionText: ; d141
ds 1
ds 1
CurPartyLevel: ; d143
@ -1379,10 +1390,10 @@ CurDamage: ; d256
SECTION "TimeOfDay",BSS[$d269]
TimeOfDay: ; d269
; 0 morn
; 1 day
; 2 nite
; 3 darkness
MORN EQU 0
DAY EQU 1
NITE EQU 2
DARKNESS EQU 3
ds 1
SECTION "OTParty",BSS[$d280]
@ -1515,13 +1526,31 @@ OTPartyMon5Nickname: ; d416
OTPartyMon6Nickname: ; d421
ds 11
SECTION "Scripting",BSS[$d439]
SECTION "Scripting",BSS[$d434]
ScriptFlags: ; d434
SCRIPT_RUNNING EQU 2
ds 1
ds 2
ScriptMode: ; d437
SCRIPT_OFF EQU 0
SCRIPT_READ EQU 1
SCRIPT_WAIT_MOVEMENT EQU 2
SCRIPT_WAIT EQU 3
ds 1
ScriptRunning: ; d438
ds 1
ScriptBank: ; d439
ds 1
ScriptPos: ; d43a
ds 2
ds 17
ScriptDelay: ; d44d
ds 1
SECTION "Player",BSS[$d472]
PlayerGender: ; d472
; bit 0:
@ -1569,6 +1598,13 @@ GameTimeFrames: ; d4c8
ds 2
CurDay: ; d4cb
SUNDAY EQU 0
MONDAY EQU 1
TUESDAY EQU 2
WEDNESDAY EQU 3
THURSDAY EQU 4
FRIDAY EQU 5
SATURDAY EQU 6
ds 1
ds 12
@ -1612,6 +1648,16 @@ PlayerSpriteY: ; d4ee
ds 1
SECTION "Objects",BSS[$d71e]
MapObjects: ; d71e
PLAYER_OBJECT EQU 0
NUM_OBJECTS EQU $10
OBJECT_LENGTH EQU $10
ds OBJECT_LENGTH * NUM_OBJECTS
SECTION "Status",BSS[$d841]
TimeOfDayPal: ; d841
ds 1
@ -1622,7 +1668,12 @@ TimeOfDayPal: ; d841
CurTimeOfDay: ; d848
ds 1
ds 5
ds 3
StatusFlags: ; d84c
ds 1
StatusFlags2: ; d84d
ds 1
Money: ; d84e
ds 3
@ -1642,24 +1693,32 @@ TMsHMs: ; d859
NumItems: ; d892
ds 1
Items: ; d893
ds 69
ds 41
NumKeyItems: ; d8bc
ds 1
KeyItems: ; d8bd
ds 13
ds 26
NumBalls: ; d8d7
ds 1
Balls: ; d8d8
ds 25
SECTION "overworld",BSS[$d95d]
SECTION "overworld",BSS[$d95b]
WhichRegisteredItem: ; d95b
REGISTERED_POCKET EQU %11000000
REGISTERED_NUMBER EQU %00111111
ds 1
RegisteredItem: ; d95c
ds 1
PlayerState: ; d95d
; $00: normal
; $01: bicycle
; $04: surf
; $08: surf (pikachu)
PLAYER_NORMAL EQU 0
PLAYER_BIKE EQU 1
PLAYER_SLIP EQU 2
PLAYER_SURF EQU 4
PLAYER_SURF_PIKA EQU 8
ds 1
SECTION "scriptram",BSS[$d962]
@ -2001,3 +2060,17 @@ RoamMon3CurHP: ; dfe1
ds 1
RoamMon3DVs: ; dfe2
ds 2
; SECTION "WRAMBank5",BSS[$d000]
; 8 4-color palettes
Unkn1Pals EQU $d000
Unkn2Pals EQU $d040
BGPals EQU $d080
OBPals EQU $d0c0