Skip to content

Commit

Permalink
Add baddies and a paper to FactoryAccess/FactoryBridge rooms
Browse files Browse the repository at this point in the history
  • Loading branch information
mdsteele committed Mar 27, 2024
1 parent e345475 commit 91d3592
Show file tree
Hide file tree
Showing 6 changed files with 107 additions and 12 deletions.
2 changes: 2 additions & 0 deletions src/dialog.asm
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
.IMPORT DataA_Dialog_MermaidVillageFarmer_sDialog
.IMPORT DataA_Dialog_MermaidVillageGuard_sDialog
.IMPORT DataA_Dialog_PaperJerome01_sDialog
.IMPORT DataA_Dialog_PaperJerome07_sDialog
.IMPORT DataA_Dialog_PaperJerome08_sDialog
.IMPORT DataA_Dialog_PaperJerome09_sDialog
.IMPORT DataA_Dialog_PaperJerome10_sDialog
Expand Down Expand Up @@ -482,6 +483,7 @@ _Finish:
d_entry t, MermaidVillageFarmer, DataA_Dialog_MermaidVillageFarmer_sDialog
d_entry t, MermaidVillageGuard, DataA_Dialog_MermaidVillageGuard_sDialog
d_entry t, PaperJerome01, DataA_Dialog_PaperJerome01_sDialog
d_entry t, PaperJerome07, DataA_Dialog_PaperJerome07_sDialog
d_entry t, PaperJerome08, DataA_Dialog_PaperJerome08_sDialog
d_entry t, PaperJerome09, DataA_Dialog_PaperJerome09_sDialog
d_entry t, PaperJerome10, DataA_Dialog_PaperJerome10_sDialog
Expand Down
22 changes: 20 additions & 2 deletions src/dialog.inc
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,31 @@
;;; A sDialog struct is a variable-length sequence of one or more entries, with
;;; each entry consisting of one of the following:
;;; * The 1-byte kDialogEntryDone constant, indicating the end of the dialog.
;;; * The 1-byte kDialogEntryFunc constant, followed by a pointer to a
;;; function that will return YA with a pointer to another sDialog struct.
;;; * The 1-byte kDialogEntryCutscene constant, followed by an eCutscene
;;; value, indicating that dialog should end and the specified cutscene
;;; should begin.
;;; * A 1-byte ePortrait value, followed by a 16-bit word encoding a banked
;;; pointer to a pane of dialog text within one of the PRGA_Text? segments.
;;; The top 3 bits of the word hold the PRGA bank number (which must be
;;; 0-7), and the bottom 13 bits of the word hold the bottom 13 bits of the
;;; pointer (the top 3 bits of the pointer can be omitted, since they
;;; will always be %101 given that the address is within PRGA).
;;; * The 1-byte kDialogEntryGoto constant, followed by a pointer to another
;;; sDialog struct to jump to.
;;; * The 1-byte kDialogEntryFunc constant, followed by a pointer to a
;;; function that will return YA with a pointer to another sDialog struct
;;; to jump to.
;;; * The 1-byte kDialogEntryBranch constant, followed by a pointer to
;;; another sDialog struct, and then an eFlag. If the flag is set, dialog
;;; will jump to the other sDialog struct, otherwise it will continue to
;;; the next entry. As a special case, if the eFlag value is 0, the branch
;;; will instead be taken if they player answered "YES" to the previous
;;; YES/NO dialog question.
;;; * The 1-byte kDialogEntryCall constant, followed by a pointer to a
;;; function to call before continuing to the next entry.
;;; * The 1-byte kDialogEntryQuest constant, followed by an eFlag to set
;;; (while playing the "new quest" sound effect, if the flag was previously
;;; clear) before continuing to the next entry.

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

Expand Down Expand Up @@ -121,6 +138,7 @@ kDialogEntryCutscene = $ff ; ends the dialog and starts a new cutscene
MermaidVillageFarmer
MermaidVillageGuard
PaperJerome01
PaperJerome07
PaperJerome08
PaperJerome09
PaperJerome10
Expand Down
4 changes: 2 additions & 2 deletions src/paper.asm
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ Ram_CollectedPapers_u8_arr: .res kPaperGridCols
d_byte eFlag::PaperJerome04, 0 ; TODO
d_byte eFlag::PaperJerome05, 0 ; TODO
d_byte eFlag::PaperJerome06, 0 ; TODO
d_byte eFlag::PaperJerome07, 0 ; TODO
d_byte eFlag::PaperJerome07, eDialog::PaperJerome07
d_byte eFlag::PaperJerome08, eDialog::PaperJerome08
d_byte eFlag::PaperJerome09, eDialog::PaperJerome09
d_byte eFlag::PaperJerome10, eDialog::PaperJerome10
Expand Down Expand Up @@ -245,7 +245,7 @@ Ram_CollectedPapers_u8_arr: .res kPaperGridCols
d_byte eFlag::PaperJerome04, $ff ; TODO
d_byte eFlag::PaperJerome05, $ff ; TODO
d_byte eFlag::PaperJerome06, $ff ; TODO
d_byte eFlag::PaperJerome07, $ff ; TODO
d_byte eFlag::PaperJerome07, eArea::Factory ; room: FactoryBridge
d_byte eFlag::PaperJerome08, eArea::Crypt ; room: CryptCenter
d_byte eFlag::PaperJerome09, eArea::Mine ; room: MineNorth
d_byte eFlag::PaperJerome10, eArea::Lava ; room: LavaWest
Expand Down
14 changes: 13 additions & 1 deletion src/rooms/factory_access.asm
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
.INCLUDE "../machine.inc"
.INCLUDE "../machines/rotor.inc"
.INCLUDE "../macros.inc"
.INCLUDE "../oam.inc"
.INCLUDE "../platform.inc"
.INCLUDE "../program.inc"
.INCLUDE "../room.inc"
Expand Down Expand Up @@ -145,7 +146,18 @@ _Platforms_sPlatform_arr:
.assert * - :- <= kMaxPlatforms * .sizeof(sPlatform), error
.byte ePlatform::None
_Actors_sActor_arr:
: ;; TODO: add some baddies
: D_STRUCT sActor
d_byte Type_eActor, eActor::BadGrub
d_word PosX_i16, $00c0
d_word PosY_i16, $0108
d_byte Param_byte, 0
D_END
D_STRUCT sActor
d_byte Type_eActor, eActor::BadGrub
d_word PosX_i16, $00d8
d_word PosY_i16, $0138
d_byte Param_byte, bObj::FlipH
D_END
.assert * - :- <= kMaxActors * .sizeof(sActor), error
.byte eActor::None
_Devices_sDevice_arr:
Expand Down
73 changes: 68 additions & 5 deletions src/rooms/factory_bridge.asm
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,20 @@
;;;=========================================================================;;;

.INCLUDE "../actor.inc"
.INCLUDE "../actors/bird.inc"
.INCLUDE "../charmap.inc"
.INCLUDE "../device.inc"
.INCLUDE "../dialog.inc"
.INCLUDE "../flag.inc"
.INCLUDE "../macros.inc"
.INCLUDE "../oam.inc"
.INCLUDE "../platform.inc"
.INCLUDE "../room.inc"

.IMPORT DataA_Room_Factory_sTileset
.IMPORT Data_Empty_sDevice_arr
.IMPORT Data_Empty_sPlatform_arr
.IMPORT Func_Noop
.IMPORT Ppu_ChrObjFactory
.IMPORT Ppu_ChrObjSewer

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

Expand All @@ -44,15 +48,15 @@
d_addr TerrainData_ptr, _TerrainData
d_byte NumMachines_u8, 0
d_addr Machines_sMachine_arr_ptr, 0
d_byte Chr18Bank_u8, <.bank(Ppu_ChrObjFactory)
d_byte Chr18Bank_u8, <.bank(Ppu_ChrObjSewer)
d_addr Ext_sRoomExt_ptr, _Ext_sRoomExt
D_END
_Ext_sRoomExt:
D_STRUCT sRoomExt
d_addr Terrain_sTileset_ptr, DataA_Room_Factory_sTileset
d_addr Platforms_sPlatform_arr_ptr, Data_Empty_sPlatform_arr
d_addr Actors_sActor_arr_ptr, _Actors_sActor_arr
d_addr Devices_sDevice_arr_ptr, Data_Empty_sDevice_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 @@ -63,9 +67,41 @@ _TerrainData:
: .incbin "out/rooms/factory_bridge.room"
.assert * - :- = 18 * 15, error
_Actors_sActor_arr:
: ;; TODO: add some baddies
: D_STRUCT sActor
d_byte Type_eActor, eActor::BadGrub
d_word PosX_i16, $0060
d_word PosY_i16, $0058
d_byte Param_byte, bObj::FlipH
D_END
D_STRUCT sActor
d_byte Type_eActor, eActor::BadToad
d_word PosX_i16, $00c8
d_word PosY_i16, $0060
d_byte Param_byte, 0
D_END
D_STRUCT sActor
d_byte Type_eActor, eActor::BadBird
d_word PosX_i16, $00e8
d_word PosY_i16, $0098
d_byte Param_byte, bBadBird::FlipH | $7f
D_END
D_STRUCT sActor
d_byte Type_eActor, eActor::BadBird
d_word PosX_i16, $0038
d_word PosY_i16, $00b8
d_byte Param_byte, 0 | $7f
D_END
.assert * - :- <= kMaxActors * .sizeof(sActor), error
.byte eActor::None
_Devices_sDevice_arr:
: D_STRUCT sDevice
d_byte Type_eDevice, eDevice::Paper
d_byte BlockRow_u8, 12
d_byte BlockCol_u8, 12
d_byte Target_byte, eFlag::PaperJerome07
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 @@ -83,3 +119,30 @@ _Passages_sPassage_arr:
.ENDPROC

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

.SEGMENT "PRGA_Dialog"

.EXPORT DataA_Dialog_PaperJerome07_sDialog
.PROC DataA_Dialog_PaperJerome07_sDialog
dlg_Text Paper, DataA_Text1_PaperJerome07_Page1_u8_arr
dlg_Text Paper, DataA_Text1_PaperJerome07_Page2_u8_arr
dlg_Done
.ENDPROC

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

.SEGMENT "PRGA_Text1"

.PROC DataA_Text1_PaperJerome07_Page1_u8_arr
.byte "Day 7: At least, that$"
.byte "was the idea. Clearly,$"
.byte "it failed.#"
.ENDPROC

.PROC DataA_Text1_PaperJerome07_Page2_u8_arr
.byte "A cautionary tale, if$"
.byte "only there were anyone$"
.byte "left to caution.#"
.ENDPROC

;;;=========================================================================;;;
4 changes: 2 additions & 2 deletions src/rooms/temple_pit.asm
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ _Passages_sPassage_arr:

.PROC DataA_Text0_PaperJerome34_Page1_u8_arr
.byte "Day 34: Our technology$"
.byte "is amazing, but don't$"
.byte "forget, we're all$"
.byte "is amazing, but lest$"
.byte "we forget, we're all$"
.byte "still just mortals.#"
.ENDPROC

Expand Down

0 comments on commit 91d3592

Please sign in to comment.