Skip to content

Commit

Permalink
Populate LavaVent room
Browse files Browse the repository at this point in the history
  • Loading branch information
mdsteele committed Mar 19, 2024
1 parent 9ed9705 commit 637b95d
Show file tree
Hide file tree
Showing 5 changed files with 177 additions and 31 deletions.
2 changes: 2 additions & 0 deletions src/dialog.asm
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
.IMPORT DataA_Dialog_GardenEastCorra_sDialog
.IMPORT DataA_Dialog_GardenShrineBreakerMine1_sDialog
.IMPORT DataA_Dialog_GardenShrineBreakerMine2_sDialog
.IMPORT DataA_Dialog_LavaVentSign_sDialog
.IMPORT DataA_Dialog_MermaidEntrySign_sDialog
.IMPORT DataA_Dialog_MermaidHut1AlexPetition_sDialog
.IMPORT DataA_Dialog_MermaidHut1BreakerCrypt1_sDialog
Expand Down Expand Up @@ -449,6 +450,7 @@ _Finish:
DataA_Dialog_GardenShrineBreakerMine1_sDialog
d_entry t, GardenShrineBreakerMine2, \
DataA_Dialog_GardenShrineBreakerMine2_sDialog
d_entry t, LavaVentSign, DataA_Dialog_LavaVentSign_sDialog
d_entry t, MermaidEntrySign, DataA_Dialog_MermaidEntrySign_sDialog
d_entry t, MermaidHut1AlexPetition, \
DataA_Dialog_MermaidHut1AlexPetition_sDialog
Expand Down
1 change: 1 addition & 0 deletions src/dialog.inc
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ kDialogEntryCutscene = $ff ; ends the dialog and starts a new cutscene
GardenEastCorra
GardenShrineBreakerMine1
GardenShrineBreakerMine2
LavaVentSign
MermaidEntrySign
MermaidHut1AlexPetition
MermaidHut1BreakerCrypt1
Expand Down
2 changes: 2 additions & 0 deletions src/program.inc
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,8 @@
TempleFoyerCarriage
TempleNaveLowerCarriage
TempleNaveUpperCarriage
;; TODO: Sort the below within the above once it won't disrupt playtesting.
LavaVentLift
NUM_VALUES
.ENDENUM

Expand Down
157 changes: 149 additions & 8 deletions src/rooms/lava_vent.asm
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,46 @@
;;;=========================================================================;;;

.INCLUDE "../actor.inc"
.INCLUDE "../charmap.inc"
.INCLUDE "../device.inc"
.INCLUDE "../dialog.inc"
.INCLUDE "../flag.inc"
.INCLUDE "../machine.inc"
.INCLUDE "../machines/lift.inc"
.INCLUDE "../macros.inc"
.INCLUDE "../oam.inc"
.INCLUDE "../platform.inc"
.INCLUDE "../ppu.inc"
.INCLUDE "../program.inc"
.INCLUDE "../room.inc"

.IMPORT DataA_Room_Lava_sTileset
.IMPORT Data_Empty_sActor_arr
.IMPORT Data_Empty_sDevice_arr
.IMPORT Data_Empty_sPlatform_arr
.IMPORT FuncA_Machine_Error
.IMPORT FuncA_Machine_LiftTick
.IMPORT FuncA_Machine_LiftTryMove
.IMPORT FuncA_Objects_DrawLiftMachine
.IMPORT Func_Noop
.IMPORT Ppu_ChrObjLava
.IMPORT Ram_MachineGoalVert_u8_arr
.IMPORT Ram_PlatformTop_i16_0_arr

;;;=========================================================================;;;

;;; The machine index for the LavaVentLift machine in this room.
kLiftMachineIndex = 0

;;; The platform index for the LavaVentLift machine.
kLiftPlatformIndex = 0

;;; The initial and maximum permitted vertical goal values for the lift.
kLiftInitGoalY = 7
kLiftMaxGoalY = 9

;;; The maximum, initial, and minimum Y-positions for the top of the lift
;;; platform.
kLiftMaxPlatformTop = $00f0
kLiftInitPlatformTop = kLiftMaxPlatformTop - kLiftInitGoalY * kBlockHeightPx
kLiftMinPlatformTop = kLiftMaxPlatformTop - kLiftMaxGoalY * kBlockHeightPx

;;;=========================================================================;;;

Expand All @@ -44,17 +72,17 @@
d_byte MinimapStartRow_u8, 12
d_byte MinimapStartCol_u8, 20
d_addr TerrainData_ptr, _TerrainData
d_byte NumMachines_u8, 0
d_addr Machines_sMachine_arr_ptr, 0
d_byte NumMachines_u8, 1
d_addr Machines_sMachine_arr_ptr, _Machines_sMachine_arr
d_byte Chr18Bank_u8, <.bank(Ppu_ChrObjLava)
d_addr Ext_sRoomExt_ptr, _Ext_sRoomExt
D_END
_Ext_sRoomExt:
D_STRUCT sRoomExt
d_addr Terrain_sTileset_ptr, DataA_Room_Lava_sTileset
d_addr Platforms_sPlatform_arr_ptr, Data_Empty_sPlatform_arr
d_addr Actors_sActor_arr_ptr, Data_Empty_sActor_arr
d_addr Devices_sDevice_arr_ptr, Data_Empty_sDevice_arr
d_addr Platforms_sPlatform_arr_ptr, _Platforms_sPlatform_arr
d_addr Actors_sActor_arr_ptr, _Actors_sActor_arr
d_addr Devices_sDevice_arr_ptr, _Devices_sDevice_arr
d_addr Passages_sPassage_arr_ptr, _Passages_sPassage_arr
d_addr Enter_func_ptr, Func_Noop
d_addr FadeIn_func_ptr, Func_Noop
Expand All @@ -64,6 +92,68 @@ _Ext_sRoomExt:
_TerrainData:
: .incbin "out/rooms/lava_vent.room"
.assert * - :- = 18 * 24, error
_Machines_sMachine_arr:
: .assert * - :- = kLiftMachineIndex * .sizeof(sMachine), error
D_STRUCT sMachine
d_byte Code_eProgram, eProgram::LavaVentLift
d_byte Breaker_eFlag, eFlag::BreakerLava
d_byte Flags_bMachine, bMachine::MoveV
d_byte Status_eDiagram, eDiagram::Lift
d_word ScrollGoalX_u16, $0010
d_byte ScrollGoalY_u8, $70
d_byte RegNames_u8_arr4, 0, 0, 0, "Y"
d_byte MainPlatform_u8, kLiftPlatformIndex
d_addr Init_func_ptr, FuncA_Room_LavaVentLift_InitReset
d_addr ReadReg_func_ptr, FuncC_Lava_VentLift_ReadReg
d_addr WriteReg_func_ptr, Func_Noop
d_addr TryMove_func_ptr, FuncA_Machine_LavaVentLift_TryMove
d_addr TryAct_func_ptr, FuncA_Machine_Error
d_addr Tick_func_ptr, FuncA_Machine_LavaVentLift_Tick
d_addr Draw_func_ptr, FuncA_Objects_DrawLiftMachine
d_addr Reset_func_ptr, FuncA_Room_LavaVentLift_InitReset
D_END
.assert * - :- <= kMaxMachines * .sizeof(sMachine), error
_Platforms_sPlatform_arr:
: .assert * - :- = kLiftPlatformIndex * .sizeof(sPlatform), error
D_STRUCT sPlatform
d_byte Type_ePlatform, ePlatform::Solid
d_word WidthPx_u16, kLiftMachineWidthPx
d_byte HeightPx_u8, kLiftMachineHeightPx
d_word Left_i16, $00b0
d_word Top_i16, kLiftInitPlatformTop
D_END
.assert * - :- <= kMaxPlatforms * .sizeof(sPlatform), error
.byte ePlatform::None
_Actors_sActor_arr:
: D_STRUCT sActor
d_byte Type_eActor, eActor::BadHotheadHorz
d_word PosX_i16, $0068
d_word PosY_i16, $0028
d_byte Param_byte, 0
D_END
D_STRUCT sActor
d_byte Type_eActor, eActor::BadHotheadVert
d_word PosX_i16, $0078
d_word PosY_i16, $0138
d_byte Param_byte, bObj::FlipV
D_END
.assert * - :- <= kMaxActors * .sizeof(sActor), error
.byte eActor::None
_Devices_sDevice_arr:
: D_STRUCT sDevice
d_byte Type_eDevice, eDevice::Console
d_byte BlockRow_u8, 20
d_byte BlockCol_u8, 10
d_byte Target_byte, kLiftMachineIndex
D_END
D_STRUCT sDevice
d_byte Type_eDevice, eDevice::Sign
d_byte BlockRow_u8, 8
d_byte BlockCol_u8, 4
d_byte Target_byte, eDialog::LavaVentSign
D_END
.assert * - :- <= kMaxDevices * .sizeof(sDevice), error
.byte eDevice::None
_Passages_sPassage_arr:
: D_STRUCT sPassage
d_byte Exit_bPassage, ePassage::Western | 0
Expand All @@ -86,4 +176,55 @@ _Passages_sPassage_arr:
.assert * - :- <= kMaxPassages * .sizeof(sPassage), error
.ENDPROC

.PROC FuncC_Lava_VentLift_ReadReg
lda #<(kLiftMaxPlatformTop + kTileHeightPx)
sub Ram_PlatformTop_i16_0_arr + kLiftPlatformIndex
div #kBlockHeightPx
rts
.ENDPROC

;;;=========================================================================;;;

.SEGMENT "PRGA_Room"

.PROC FuncA_Room_LavaVentLift_InitReset
lda #kLiftInitGoalY
sta Ram_MachineGoalVert_u8_arr + kLiftMachineIndex
rts
.ENDPROC

;;;=========================================================================;;;

.SEGMENT "PRGA_Machine"

.PROC FuncA_Machine_LavaVentLift_TryMove
lda #kLiftMaxGoalY ; param: max goal vert
jmp FuncA_Machine_LiftTryMove
.ENDPROC

.PROC FuncA_Machine_LavaVentLift_Tick
ldax #kLiftMaxPlatformTop ; param: max platform top
jmp FuncA_Machine_LiftTick
.ENDPROC

;;;=========================================================================;;;

.SEGMENT "PRGA_Dialog"

.EXPORT DataA_Dialog_LavaVentSign_sDialog
.PROC DataA_Dialog_LavaVentSign_sDialog
dlg_Text Sign, DataA_Text2_LavaVentSign_u8_arr
dlg_Done
.ENDPROC

;;;=========================================================================;;;

.SEGMENT "PRGA_Text2"

.PROC DataA_Text2_LavaVentSign_u8_arr
.byte "Salt Mines ", kTileIdBgArrowRight, "$"
.byte "$"
.byte kTileIdBgArrowLeft, " Geothermal Control#"
.ENDPROC

;;;=========================================================================;;;
46 changes: 23 additions & 23 deletions src/rooms/lava_vent.bg
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,27 @@
>lava_5
>lava_7

GAGAGAGAGAGAGAGAGAGAGAGAGAGAGAGAGAGA
GAGAGAGAGAGAGAGAGAGAGAGAGAGAGAGAGAGA
GAGA GAGAGA
GAGA GAGA
GAGA

GAGAGA
EAEAEA GAGAGA
ECECEC ECEC ECEC GAGA
ECEC ECEC
ECEC ECEC ECEC
ECEC ECEC
ECEC ECEC ECEC
ECEC ECEC
ECEC ECEC ECEC
ECEC ECEC
ECEC ECEC ECEC
ECEC ECEC
ECEC ECEC
ECEC
EAEAEA ECEC ECEC
ECECEC ECEC
ECECECECECECECECECECECECECECECECECEC
GAGAGAGCGAGAGAGAGCGAGAGAGAGAGAGAGDGA
GAGAGAGAGAGAGDGAGAGAGDGAGAGFGAGAGAGA
GAGAGAGE GCGAGA
GAGA CMGAGA GAGA
GAGA CO EAEA
ECEC
ECEC GAGAGA
EAEAEA EA EJEI GAGAGA
ECECEJ AD CM EI EIEC GAGA
ECECBK EN EC BKEC ECEC
ECEJ BH BDEJCN EM CMECEC
ECEC BEEAEC BK EIEC
ECEJBFBCCM EAECEC EAEA ECEC
ECECELEL CN EJEIEJ EJEI ECEC
ECECEJBK EIECBI ECEC BEECEC
ECEJBG EA BKEM ECEC EAECEC
ECEC CO EM ECEC EJEIEC
ECEJ BL EAEBEA EJEI EIECEC
BF EIECEJ EIEC BLEIEC
BF EAEA BK BKEM ECEC
EBEBEA EIEJ AB BL BBECEC
ECECECBABE BBEAEBEA EAECEC
ECECECEAEBEAEBEBEAEJEIECEAEBEBECECEC
ECECECECECECECECECECECECECECECECECEC

0 comments on commit 637b95d

Please sign in to comment.