You've already forked pokecrystal-board
mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2025-04-09 05:44:44 -07:00
Trainer data structure and field move functions
Trainer data in map scripts is now a macro-defined structure. Field move functions in main.asm are now nearly completely annotated, with local references. Trailing white space deleted.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
; More overworld event handling.
|
||||
|
||||
|
||||
WarpToLastSpawn:: ; 97c28
|
||||
WarpToSpawnPoint:: ; 97c28
|
||||
ld hl, StatusFlags2
|
||||
res 1, [hl]
|
||||
res 2, [hl]
|
||||
|
@@ -2446,19 +2446,19 @@ Function503d: ; 503d
|
||||
; 5041
|
||||
|
||||
Function5041: ; 5041
|
||||
call Function5055
|
||||
call CopyMovementPointer
|
||||
.loop
|
||||
xor a
|
||||
ld [wc2ea], a
|
||||
call Function505e
|
||||
call Function506b
|
||||
call GetMovementByte
|
||||
call DoMovementFunction
|
||||
ld a, [wc2ea]
|
||||
and a
|
||||
jr nz, .loop
|
||||
ret
|
||||
; 5055
|
||||
|
||||
Function5055: ; 5055
|
||||
CopyMovementPointer: ; 5055
|
||||
ld a, l
|
||||
ld [wc2eb], a
|
||||
ld a, h
|
||||
@@ -2466,7 +2466,7 @@ Function5055: ; 5055
|
||||
ret
|
||||
; 505e
|
||||
|
||||
Function505e: ; 505e
|
||||
GetMovementByte: ; 505e
|
||||
ld hl, wc2eb
|
||||
ld a, [hli]
|
||||
ld h, [hl]
|
||||
@@ -2480,7 +2480,7 @@ Function5065: ; 5065
|
||||
ret
|
||||
; 506b
|
||||
|
||||
Function506b: ; 506b
|
||||
DoMovementFunction: ; 506b
|
||||
push af
|
||||
call Function54b8
|
||||
pop af
|
||||
|
@@ -130,7 +130,7 @@ Movement_step_wait5: ; 5145
|
||||
ld hl, $000b
|
||||
add hl, bc
|
||||
ld [hl], $4
|
||||
call Function505e
|
||||
call GetMovementByte
|
||||
ld hl, $000a
|
||||
add hl, bc
|
||||
ld [hl], a
|
||||
@@ -150,7 +150,7 @@ Function516a: ; 516a
|
||||
ld hl, $000c
|
||||
add hl, bc
|
||||
ld [hl], a
|
||||
call Function505e
|
||||
call GetMovementByte
|
||||
ld hl, $000a
|
||||
add hl, bc
|
||||
ld [hl], a
|
||||
@@ -174,7 +174,7 @@ Function5189: ; 5189
|
||||
; 5196
|
||||
|
||||
Function5196: ; 5196
|
||||
call Function505e
|
||||
call GetMovementByte
|
||||
ld hl, $000a
|
||||
add hl, bc
|
||||
ld [hl], a
|
||||
@@ -228,7 +228,7 @@ Function51db: ; 51db
|
||||
ld hl, $001b
|
||||
add hl, bc
|
||||
ld [hl], $0
|
||||
call Function505e
|
||||
call GetMovementByte
|
||||
ld hl, $000a
|
||||
add hl, bc
|
||||
ld [hl], a
|
||||
@@ -302,7 +302,7 @@ Movement_step_sleep: ; 5242
|
||||
; parameters:
|
||||
; duration (DecimalParam)
|
||||
|
||||
call Function505e
|
||||
call GetMovementByte
|
||||
jr Function5247
|
||||
|
||||
Function5247: ; 5247
|
||||
@@ -411,7 +411,7 @@ Movement_step_shake: ; 52d5
|
||||
; parameters:
|
||||
; displacement (DecimalParam)
|
||||
|
||||
call Function505e
|
||||
call GetMovementByte
|
||||
call Function5565
|
||||
jp Function5065
|
||||
; 52de
|
||||
|
@@ -500,7 +500,7 @@ Function10364: ; 10364
|
||||
jr c, .asm_1039c
|
||||
call Function10a1d
|
||||
ld hl, UnknownText_0x10ae9
|
||||
call Function1d4f
|
||||
call MenuTextBox
|
||||
call YesNoBox
|
||||
push af
|
||||
call Function1c07
|
||||
@@ -1673,7 +1673,7 @@ UnknownText_0x10b07: ; 0x10b07
|
||||
; 0x10b0c
|
||||
|
||||
UnknownText_0x10b0c: ; 0x10b0c
|
||||
;
|
||||
;
|
||||
text_jump UnknownText_0x1c0c83
|
||||
db "@"
|
||||
; 0x10b11
|
||||
|
@@ -912,12 +912,12 @@ Script_winlosstext: ; 0x9714c
|
||||
; win_text_pointer (TextPointerLabelParam)
|
||||
; loss_text_pointer (TextPointerLabelParam)
|
||||
|
||||
ld hl, WalkingTile
|
||||
ld hl, wWinTextPointer ; d047
|
||||
call GetScriptByte
|
||||
ld [hli], a
|
||||
call GetScriptByte
|
||||
ld [hli], a
|
||||
ld hl, wd048 + 1
|
||||
ld hl, wLossTextPointer ; d049; this is unnecessary
|
||||
call GetScriptByte
|
||||
ld [hli], a
|
||||
call GetScriptByte
|
||||
@@ -2675,7 +2675,7 @@ Script_setevent: ; 0x97988
|
||||
ld e, a
|
||||
call GetScriptByte
|
||||
ld d, a
|
||||
ld b, 1 ; set
|
||||
ld b, SET_FLAG
|
||||
call EventFlagAction
|
||||
ret
|
||||
; 0x97996
|
||||
@@ -2689,7 +2689,7 @@ Script_clearevent: ; 0x97996
|
||||
ld e, a
|
||||
call GetScriptByte
|
||||
ld d, a
|
||||
ld b, 0 ; clear
|
||||
ld b, RESET_FLAG
|
||||
call EventFlagAction
|
||||
ret
|
||||
; 0x979a4
|
||||
@@ -2703,7 +2703,7 @@ Script_checkevent: ; 0x979a4
|
||||
ld e, a
|
||||
call GetScriptByte
|
||||
ld d, a
|
||||
ld b, 2 ; check
|
||||
ld b, CHECK_FLAG
|
||||
call EventFlagAction
|
||||
ld a, c
|
||||
and a
|
||||
|
@@ -41,10 +41,10 @@ ENDM
|
||||
spawn BLACKTHORN, BLACKTHORN_CITY, 21, 30
|
||||
spawn MT_SILVER, SILVER_CAVE_OUTSIDE, 23, 20
|
||||
spawn FAST_SHIP, FAST_SHIP_CABINS_SW_SSW_NW, 6, 2
|
||||
NUM_SPAWNS EQU const_value
|
||||
const_value = -1
|
||||
spawn N_A, N_A, -1, -1
|
||||
|
||||
NUM_SPAWNS EQU const_value
|
||||
|
||||
|
||||
LoadSpawnPoint: ; 1531f
|
||||
|
@@ -14,7 +14,7 @@ Special:: ; c01b
|
||||
; c029
|
||||
|
||||
SpecialsPointers:: ; c029
|
||||
add_special WarpToLastSpawn
|
||||
add_special WarpToSpawnPoint
|
||||
|
||||
; Communications
|
||||
add_special Special_SetBitsForLinkTradeRequest
|
||||
@@ -58,7 +58,7 @@ SpecialsPointers:: ; c029
|
||||
add_special Function90913
|
||||
add_special Functionc2c0
|
||||
add_special Functionc2cd
|
||||
add_special Functionc355
|
||||
add_special MapRadio
|
||||
add_special Functionc360
|
||||
add_special Functionc373
|
||||
add_special Functionc380
|
||||
@@ -92,7 +92,7 @@ SpecialsPointers:: ; c029
|
||||
add_special Special_SelectRandomBugContestContestants
|
||||
add_special Functionc3fc
|
||||
add_special Function26feb
|
||||
add_special Function27043
|
||||
add_special ToggleDecorationsVisibility
|
||||
add_special SpecialGiveShuckle
|
||||
add_special SpecialReturnShuckle
|
||||
add_special Function73f7
|
||||
@@ -150,7 +150,7 @@ SpecialsPointers:: ; c029
|
||||
add_special Function101225
|
||||
add_special Function101231
|
||||
add_special Function4925b
|
||||
add_special Function8adef
|
||||
add_special SpecialOmanyteChamber
|
||||
add_special Function11c1ab
|
||||
add_special Function170687
|
||||
add_special Function8ae68
|
||||
@@ -367,10 +367,10 @@ BugContestJudging: ; c34a
|
||||
ret
|
||||
; c355
|
||||
|
||||
Functionc355: ; c355
|
||||
MapRadio: ; c355
|
||||
ld a, [ScriptVar]
|
||||
ld e, a
|
||||
callba Function91a53
|
||||
callba PlayRadio
|
||||
ret
|
||||
; c360
|
||||
|
||||
|
@@ -204,7 +204,7 @@ HomepageScript:
|
||||
Radio1Script:
|
||||
loadfont
|
||||
writebyte $0
|
||||
special Functionc355
|
||||
special MapRadio
|
||||
loadmovesprites
|
||||
end
|
||||
|
||||
@@ -212,7 +212,7 @@ Radio2Script:
|
||||
; Lucky Channel
|
||||
loadfont
|
||||
writebyte $4
|
||||
special Functionc355
|
||||
special MapRadio
|
||||
loadmovesprites
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user