Add wMapSpacesPointer to the map attributes (#4); create basic space macro to define the space layout of maps (#23)

This commit is contained in:
xCrystal 2023-10-17 18:27:28 +02:00
parent a31c114382
commit 806b048a9f
11 changed files with 106 additions and 49 deletions

View File

@ -10,9 +10,10 @@ MACRO map_attributes
db CURRENT_MAP_HEIGHT, CURRENT_MAP_WIDTH
db BANK(\1_Blocks)
dw \1_Blocks
db BANK(\1_MapScripts) ; aka BANK(\1_MapEvents)
db BANK(\1_MapScripts) ; aka BANK(\1_MapEvents), BANK(\1_MapSpaces)
dw \1_MapScripts
dw \1_MapEvents
dw \1_MapSpaces
db \4
ENDM

View File

@ -11,11 +11,11 @@ SpawnPoints:
spawn LEVEL_1_MAP_1, 3, 3 ; SPAWN_LEVEL_1
; spawn LEVEL_2_MAP_1, 5, 3 ; SPAWN_LEVEL_2
if DEF(_DEBUG)
spawn DEBUGLEVEL_1_MAP_1, 3, 3, ; SPAWN_DEBUGLEVEL_1
spawn DEBUGLEVEL_2_MAP_1, 3, 3, ; SPAWN_DEBUGLEVEL_2
spawn DEBUGLEVEL_3_MAP_1, 3, 3, ; SPAWN_DEBUGLEVEL_3
spawn DEBUGLEVEL_4_MAP_1, 3, 3, ; SPAWN_DEBUGLEVEL_4
spawn DEBUGLEVEL_5_MAP_1, 3, 3, ; SPAWN_DEBUGLEVEL_5
spawn DEBUGLEVEL_1_MAP_1, 3, 3 ; SPAWN_DEBUGLEVEL_1
spawn DEBUGLEVEL_2_MAP_1, 3, 3 ; SPAWN_DEBUGLEVEL_2
spawn DEBUGLEVEL_3_MAP_1, 3, 3 ; SPAWN_DEBUGLEVEL_3
spawn DEBUGLEVEL_4_MAP_1, 3, 3 ; SPAWN_DEBUGLEVEL_4
spawn DEBUGLEVEL_5_MAP_1, 2, 4 ; SPAWN_DEBUGLEVEL_5
endc
spawn N_A, -1, -1

View File

@ -131,6 +131,14 @@ MACRO object_event
endc
ENDM
MACRO space
;\1: x coord
;\2: y coord
;\3: effect (space type specific)
;\4: next space
db \1, \2, \3, \4
ENDM
MACRO trainer
;\1: trainer group
;\2: trainer id

View File

@ -10,6 +10,29 @@ DebugLevel1_Map1_MapScripts:
def_callbacks
DebugLevel1_Map1_MapEvents:
db 0, 0 ; filler
def_warp_events
warp_event 7, 0, LEVEL_1_MAP_1, 1
def_coord_events
def_bg_events
bg_event 2, 1, BGEVENT_UP, DebugLevel1_Map1_PCScript
bg_event 3, 1, BGEVENT_READ, DebugLevel1_Map1_RadioScript
bg_event 5, 1, BGEVENT_READ, DebugLevel1_Map1_BookshelfScript
bg_event 6, 0, BGEVENT_IFSET, DebugLevel1_Map1_PosterScript
def_object_events
object_event 4, 2, SPRITE_CONSOLE, SPRITEMOVEDATA_STILL, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, DebugLevel1_Map1_GameConsoleScript, -1
object_event 4, 4, SPRITE_DOLL_1, SPRITEMOVEDATA_STILL, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, DebugLevel1_Map1_Doll1Script, -1
object_event 5, 4, SPRITE_DOLL_2, SPRITEMOVEDATA_STILL, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, DebugLevel1_Map1_Doll2Script, -1
object_event 0, 1, SPRITE_BIG_DOLL, SPRITEMOVEDATA_BIGDOLL, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, DebugLevel1_Map1_BigDollScript, -1
object_event 6, 6, SPRITE_YOUNGSTER, SPRITEMOVEDATA_STANDING_DOWN, 0, 0, -1, -1, PAL_NPC_BLUE, OBJECTTYPE_TRAINER, 1, DebugLevel1_Map1_TrainerYoungsterMikey, -1
DebugLevel1_Map1_MapSpaces:
DebugLevel1_Map1_Doll1Script::
opentext
callasm .BoardMenu
@ -90,24 +113,3 @@ DebugLevel1_Map1_TrainerYoungsterMikey:
line "tle other people"
cont "to get better."
done
DebugLevel1_Map1_MapEvents:
db 0, 0 ; filler
def_warp_events
warp_event 7, 0, LEVEL_1_MAP_1, 1
def_coord_events
def_bg_events
bg_event 2, 1, BGEVENT_UP, DebugLevel1_Map1_PCScript
bg_event 3, 1, BGEVENT_READ, DebugLevel1_Map1_RadioScript
bg_event 5, 1, BGEVENT_READ, DebugLevel1_Map1_BookshelfScript
bg_event 6, 0, BGEVENT_IFSET, DebugLevel1_Map1_PosterScript
def_object_events
object_event 4, 2, SPRITE_CONSOLE, SPRITEMOVEDATA_STILL, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, DebugLevel1_Map1_GameConsoleScript, -1
object_event 4, 4, SPRITE_DOLL_1, SPRITEMOVEDATA_STILL, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, DebugLevel1_Map1_Doll1Script, -1
object_event 5, 4, SPRITE_DOLL_2, SPRITEMOVEDATA_STILL, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, DebugLevel1_Map1_Doll2Script, -1
object_event 0, 1, SPRITE_BIG_DOLL, SPRITEMOVEDATA_BIGDOLL, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, DebugLevel1_Map1_BigDollScript, -1
object_event 6, 6, SPRITE_YOUNGSTER, SPRITEMOVEDATA_STANDING_DOWN, 0, 0, -1, -1, PAL_NPC_BLUE, OBJECTTYPE_TRAINER, 1, DebugLevel1_Map1_TrainerYoungsterMikey, -1

View File

@ -15,3 +15,5 @@ DebugLevel2_Map1_MapEvents:
def_bg_events
def_object_events
DebugLevel2_Map1_MapSpaces:

View File

@ -15,3 +15,5 @@ DebugLevel3_Map1_MapEvents:
def_bg_events
def_object_events
DebugLevel3_Map1_MapSpaces:

View File

@ -15,3 +15,5 @@ DebugLevel4_Map1_MapEvents:
def_bg_events
def_object_events
DebugLevel4_Map1_MapSpaces:

View File

@ -15,3 +15,40 @@ DebugLevel5_Map1_MapEvents:
def_bg_events
def_object_events
DebugLevel5_Map1_MapSpaces:
space 2, 4, $0, 1 ; 0
space 4, 4, $0, 2 ; 1
space 6, 4, $0, 3 ; 2
space 8, 4, $0, 4 ; 3
space 10, 4, $0, 5 ; 4
space 12, 4, $0, 6 ; 5
space 14, 4, $0, 7 ; 6
space 16, 4, $0, 8 ; 7
space 18, 4, $0, 9 ; 8
space 20, 4, $0, 10 ; 9
space 22, 4, $0, 11 ; 10
space 24, 4, $0, 12 ; 11
space 24, 6, $0, 13 ; 12
space 24, 8, $0, 14 ; 13
space 24, 10, $0, 15 ; 14
space 24, 12, $0, 16 ; 15
space 24, 14, $0, 17 ; 16
space 22, 14, $0, 18 ; 17
space 20, 14, $0, 19 ; 18
space 18, 14, $0, 20 ; 19
space 16, 14, $0, 21 ; 20
space 14, 14, $0, 22 ; 21
space 12, 14, $0, 23 ; 22
space 10, 14, $0, 24 ; 23
space 8, 14, $0, 25 ; 24
space 6, 14, $0, 26 ; 25
space 4, 14, $0, 27 ; 26
space 4, 12, $0, 28 ; 27
space 4, 10, $0, 29 ; 28
space 4, 8, $0, 30 ; 29
space 6, 8, $0, 31 ; 30
space 8, 8, $0, 32 ; 31
space 10, 8, $0, 33 ; 32
space 12, 8, $0, 34 ; 33
space 14, 8, $0, 34 ; 34

View File

@ -1 +1 @@
€€ €°<EFBFBD><EFBFBD>΅Α΅ΑΑ €€°€Δ<02> ΅Α<> ° Α<C2A0>΅Α<CE85>
<EFBFBD>€€ €°<EFBFBD><EFBFBD>΅Α΅ΑΑ €€°€Δ<02> ΅Α<> ° Α<C2A0>΅Α<CE85>

View File

@ -10,6 +10,29 @@ Level1_Map1_MapScripts:
def_callbacks
Level1_Map1_MapEvents:
db 0, 0 ; filler
def_warp_events
warp_event 7, 0, LEVEL_1_MAP_1, 1
def_coord_events
def_bg_events
bg_event 2, 1, BGEVENT_UP, Level1_Map1_PCScript
bg_event 3, 1, BGEVENT_READ, Level1_Map1_RadioScript
bg_event 5, 1, BGEVENT_READ, Level1_Map1_BookshelfScript
bg_event 6, 0, BGEVENT_IFSET, Level1_Map1_PosterScript
def_object_events
object_event 4, 2, SPRITE_CONSOLE, SPRITEMOVEDATA_STILL, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, Level1_Map1_GameConsoleScript, -1
object_event 4, 4, SPRITE_DOLL_1, SPRITEMOVEDATA_STILL, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, Level1_Map1_Doll1Script, -1
object_event 5, 4, SPRITE_DOLL_2, SPRITEMOVEDATA_STILL, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, Level1_Map1_Doll2Script, -1
object_event 0, 1, SPRITE_BIG_DOLL, SPRITEMOVEDATA_BIGDOLL, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, Level1_Map1_BigDollScript, -1
object_event 6, 6, SPRITE_YOUNGSTER, SPRITEMOVEDATA_STANDING_DOWN, 0, 0, -1, -1, PAL_NPC_BLUE, OBJECTTYPE_TRAINER, 1, Level1_Map1_TrainerYoungsterMikey, -1
Level1_Map1_MapSpaces:
Level1_Map1_Doll1Script::
opentext
callasm .BoardMenu
@ -90,24 +113,3 @@ Level1_Map1_TrainerYoungsterMikey:
line "tle other people"
cont "to get better."
done
Level1_Map1_MapEvents:
db 0, 0 ; filler
def_warp_events
warp_event 7, 0, LEVEL_1_MAP_1, 1
def_coord_events
def_bg_events
bg_event 2, 1, BGEVENT_UP, Level1_Map1_PCScript
bg_event 3, 1, BGEVENT_READ, Level1_Map1_RadioScript
bg_event 5, 1, BGEVENT_READ, Level1_Map1_BookshelfScript
bg_event 6, 0, BGEVENT_IFSET, Level1_Map1_PosterScript
def_object_events
object_event 4, 2, SPRITE_CONSOLE, SPRITEMOVEDATA_STILL, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, Level1_Map1_GameConsoleScript, -1
object_event 4, 4, SPRITE_DOLL_1, SPRITEMOVEDATA_STILL, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, Level1_Map1_Doll1Script, -1
object_event 5, 4, SPRITE_DOLL_2, SPRITEMOVEDATA_STILL, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, Level1_Map1_Doll2Script, -1
object_event 0, 1, SPRITE_BIG_DOLL, SPRITEMOVEDATA_BIGDOLL, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, Level1_Map1_BigDollScript, -1
object_event 6, 6, SPRITE_YOUNGSTER, SPRITEMOVEDATA_STANDING_DOWN, 0, 0, -1, -1, PAL_NPC_BLUE, OBJECTTYPE_TRAINER, 1, Level1_Map1_TrainerYoungsterMikey, -1

View File

@ -1852,6 +1852,7 @@ wMapBlocksPointer:: dw
wMapScriptsBank:: db
wMapScriptsPointer:: dw
wMapEventsPointer:: dw
wMapSpacesPointer:: dw
; bit set
wMapConnections:: db
wMapAttributesEnd::