Skip to content

Commit

Permalink
Add MineTunnel room
Browse files Browse the repository at this point in the history
  • Loading branch information
mdsteele committed Feb 21, 2024
1 parent 6cd155d commit e737140
Show file tree
Hide file tree
Showing 7 changed files with 169 additions and 24 deletions.
3 changes: 3 additions & 0 deletions src/room.asm
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@
.IMPORT DataC_Mine_North_sRoom
.IMPORT DataC_Mine_Pit_sRoom
.IMPORT DataC_Mine_South_sRoom
.IMPORT DataC_Mine_Tunnel_sRoom
.IMPORT DataC_Mine_West_sRoom
.IMPORT DataC_Prison_Cell_sRoom
.IMPORT DataC_Prison_Crossroad_sRoom
Expand Down Expand Up @@ -379,6 +380,7 @@ _LoadNewRoom:
d_entry table, MineNorth, DataC_Mine_North_sRoom
d_entry table, MinePit, DataC_Mine_Pit_sRoom
d_entry table, MineSouth, DataC_Mine_South_sRoom
d_entry table, MineTunnel, DataC_Mine_Tunnel_sRoom
d_entry table, MineWest, DataC_Mine_West_sRoom
d_entry table, PrisonCell, DataC_Prison_Cell_sRoom
d_entry table, PrisonCrossroad, DataC_Prison_Crossroad_sRoom
Expand Down Expand Up @@ -563,6 +565,7 @@ _PrisonMusic:
d_byte MineNorth, eMusic::Mine
d_byte MinePit, eMusic::Mine
d_byte MineSouth, eMusic::Mine
d_byte MineTunnel, eMusic::Mine
d_byte MineWest, eMusic::Mine
d_byte PrisonCell, bRoomMusic::Prison
d_byte PrisonCrossroad, bRoomMusic::Prison
Expand Down
1 change: 1 addition & 0 deletions src/room.inc
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ kMaxPassages = 8
MineNorth
MinePit
MineSouth
MineTunnel
MineWest
PrisonCell
PrisonCrossroad
Expand Down
22 changes: 15 additions & 7 deletions src/rooms/mine_collapse.asm
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,13 @@
.IMPORT Func_MovePlatformLeftTowardPointX
.IMPORT Func_MovePlatformTopTowardPointY
.IMPORT Func_Noop
.IMPORT Ppu_ChrBgAnimB0
.IMPORT Ppu_ChrObjMine
.IMPORT Ram_MachineGoalHorz_u8_arr
.IMPORT Ram_MachineGoalVert_u8_arr
.IMPORT Ram_PlatformLeft_i16_0_arr
.IMPORT Ram_PlatformTop_i16_0_arr
.IMPORTZP Zp_Chr04Bank_u8
.IMPORTZP Zp_PointX_i16
.IMPORTZP Zp_PointY_i16

Expand Down Expand Up @@ -95,7 +97,7 @@ kTrolleyMaxPlatformLeft = \
.PROC DataC_Mine_Collapse_sRoom
D_STRUCT sRoom
d_byte MinScrollX_u8, $00
d_word MaxScrollX_u16, $100
d_word MaxScrollX_u16, $0000
d_byte Flags_bRoom, eArea::Mine
d_byte MinimapStartRow_u8, 9
d_byte MinimapStartCol_u8, 18
Expand All @@ -115,11 +117,11 @@ _Ext_sRoomExt:
d_addr Enter_func_ptr, Func_Noop
d_addr FadeIn_func_ptr, Func_Noop
d_addr Tick_func_ptr, Func_Noop
d_addr Draw_func_ptr, Func_Noop
d_addr Draw_func_ptr, DataC_Mine_Collapse_DrawRoom
D_END
_TerrainData:
: .incbin "out/rooms/mine_collapse.room"
.assert * - :- = 33 * 15, error
.assert * - :- = 17 * 15, error
_Machines_sMachine_arr:
: .assert * - :- = kTrolleyMachineIndex * .sizeof(sMachine), error
D_STRUCT sMachine
Expand Down Expand Up @@ -194,22 +196,28 @@ _Devices_sDevice_arr:
D_END
D_STRUCT sDevice
d_byte Type_eDevice, eDevice::Door1Unlocked
d_byte BlockRow_u8, 12
d_byte BlockCol_u8, 2
d_byte BlockRow_u8, 11
d_byte BlockCol_u8, 3
d_byte Target_byte, eRoom::BossMine
D_END
.assert * - :- <= kMaxDevices * .sizeof(sDevice), error
.byte eDevice::None
_Passages_sPassage_arr:
: D_STRUCT sPassage
d_byte Exit_bPassage, ePassage::Eastern | 0
d_byte Destination_eRoom, eRoom::MineCollapse ; TODO
d_byte SpawnBlock_u8, 11
d_byte Destination_eRoom, eRoom::MineTunnel
d_byte SpawnBlock_u8, 10
d_byte SpawnAdjust_byte, 0
D_END
.assert * - :- <= kMaxPassages * .sizeof(sPassage), error
.ENDPROC

.PROC DataC_Mine_Collapse_DrawRoom
lda #<.bank(Ppu_ChrBgAnimB0)
sta Zp_Chr04Bank_u8
rts
.ENDPROC

.PROC FuncC_Mine_CollapseTrolley_InitReset
lda #kTrolleyInitGoalX
sta Ram_MachineGoalHorz_u8_arr + kTrolleyMachineIndex
Expand Down
33 changes: 17 additions & 16 deletions src/rooms/mine_collapse.bg
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
@BG 0 0 0 33x15
@BG 0 0 0 17x15
>mine_0
>mine_1
>mine_4
>mine_5
>mine_6

CMCMCMCMCMCMCMCMCMCMCMCMCMCMCMCMCMCMCMCMCMCMCMCMCMCMCMCMCMCMCMCMCM
CMCMCMCICFCFCFCFCFCFCFCFCJCICFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCJCM
CICFCFCDAFAFAFAFAFAFAFAFCCCD CGCM
CH CGCM
CH CGCM
CKDADBDBDH CGCM
CMCMCOCPCH CGCM
CMCNCMCMCH CGCM
CMCMCMCPCH CGCM
CICFCFCFCD CCCF
CH CC
CH AE ABAB
CH AG CACECECB CACECECE
CKCECECECECECECECECECECLCMCMCKCECECECECECECECECECECECECECECLCMCMCM
CMCMCMCMCMCMCMCMCMCMCMCMCMCMCMCMCMCMCMCMCMCMCMCMCMCMCMCMCMCMCMCMCM
CMCMCMCMCMCMCNCMCMCMCMCMCMCMCMCMCM
CMCMCICFCFCFCFCFCFCCCFCFCJCMCMCMCM
CMCMCDAFAFAFAFAFAFAFAFAFCCCFCJCNCM
CMCPCH AM CGCMCM
CFCFCD CCCOCM
DM AO CGCPCM
DBDBDBDCCH AM CCCFCF
CMCMCOCMCH
CMCMCMCPCHAN
CMCICFCFCD AN
CMCH AE AN
CMCH AG AP ABABCACECE
CMCKEFEGEEEB EAEGEFCLCMCM
CMCMCNCMCOCKCECECECECECLCOCMCOCMCM
CMCMCMCMCMCMCMCMCMCOCMCMCMCMCMCMCM
2 changes: 1 addition & 1 deletion src/rooms/mine_north.asm
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ _Devices_sDevice_arr:
_Passages_sPassage_arr:
: D_STRUCT sPassage
d_byte Exit_bPassage, ePassage::Western | 0
d_byte Destination_eRoom, eRoom::MineNorth ; TODO
d_byte Destination_eRoom, eRoom::MineTunnel
d_byte SpawnBlock_u8, 5
d_byte SpawnAdjust_byte, 0
D_END
Expand Down
108 changes: 108 additions & 0 deletions src/rooms/mine_tunnel.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
;;;=========================================================================;;;
;;; Copyright 2022 Matthew D. Steele <[email protected]> ;;;
;;; ;;;
;;; This file is part of Annalog. ;;;
;;; ;;;
;;; Annalog is free software: you can redistribute it and/or modify it ;;;
;;; under the terms of the GNU General Public License as published by the ;;;
;;; Free Software Foundation, either version 3 of the License, or (at your ;;;
;;; option) any later version. ;;;
;;; ;;;
;;; Annalog is distributed in the hope that it will be useful, but WITHOUT ;;;
;;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ;;;
;;; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ;;;
;;; for more details. ;;;
;;; ;;;
;;; You should have received a copy of the GNU General Public License along ;;;
;;; with Annalog. If not, see <http://www.gnu.org/licenses/>. ;;;
;;;=========================================================================;;;

.INCLUDE "../actor.inc"
.INCLUDE "../macros.inc"
.INCLUDE "../platform.inc"
.INCLUDE "../room.inc"

.IMPORT DataA_Room_Mine_sTileset
.IMPORT Data_Empty_sDevice_arr
.IMPORT Func_Noop
.IMPORT Ppu_ChrObjMine

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

.SEGMENT "PRGC_Mine"

.EXPORT DataC_Mine_Tunnel_sRoom
.PROC DataC_Mine_Tunnel_sRoom
D_STRUCT sRoom
d_byte MinScrollX_u8, $10
d_word MaxScrollX_u16, $0110
d_byte Flags_bRoom, eArea::Mine
d_byte MinimapStartRow_u8, 9
d_byte MinimapStartCol_u8, 19
d_addr TerrainData_ptr, _TerrainData
d_byte NumMachines_u8, 0
d_addr Machines_sMachine_arr_ptr, 0
d_byte Chr18Bank_u8, <.bank(Ppu_ChrObjMine)
d_addr Ext_sRoomExt_ptr, _Ext_sRoomExt
D_END
_Ext_sRoomExt:
D_STRUCT sRoomExt
d_addr Terrain_sTileset_ptr, DataA_Room_Mine_sTileset
d_addr Platforms_sPlatform_arr_ptr, _Platforms_sPlatform_arr
d_addr Actors_sActor_arr_ptr, _Actors_sActor_arr
d_addr Devices_sDevice_arr_ptr, Data_Empty_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
d_addr Tick_func_ptr, Func_Noop
d_addr Draw_func_ptr, Func_Noop
D_END
_TerrainData:
: .incbin "out/rooms/mine_tunnel.room"
.assert * - :- = 34 * 15, error
_Platforms_sPlatform_arr:
: D_STRUCT sPlatform
d_byte Type_ePlatform, ePlatform::Water
d_word WidthPx_u16, $70
d_byte HeightPx_u8, $20
d_word Left_i16, $0040
d_word Top_i16, $00c4
D_END
;; Terrain spikes:
D_STRUCT sPlatform
d_byte Type_ePlatform, ePlatform::Harm
d_word WidthPx_u16, $70
d_byte HeightPx_u8, $08
d_word Left_i16, $0040
d_word Top_i16, $00d6
D_END
D_STRUCT sPlatform
d_byte Type_ePlatform, ePlatform::Harm
d_word WidthPx_u16, $b0
d_byte HeightPx_u8, $08
d_word Left_i16, $0110
d_word Top_i16, $00de
D_END
.assert * - :- <= kMaxPlatforms * .sizeof(sPlatform), error
.byte ePlatform::None
_Actors_sActor_arr:
: ;; TODO: Add some baddies
.assert * - :- <= kMaxActors * .sizeof(sActor), error
.byte eActor::None
_Passages_sPassage_arr:
: D_STRUCT sPassage
d_byte Exit_bPassage, ePassage::Western | 0
d_byte Destination_eRoom, eRoom::MineCollapse
d_byte SpawnBlock_u8, 10
d_byte SpawnAdjust_byte, 0
D_END
D_STRUCT sPassage
d_byte Exit_bPassage, ePassage::Eastern | 0
d_byte Destination_eRoom, eRoom::MineNorth
d_byte SpawnBlock_u8, 5
d_byte SpawnAdjust_byte, 0
D_END
.assert * - :- <= kMaxPassages * .sizeof(sPassage), error
.ENDPROC

;;;=========================================================================;;;
24 changes: 24 additions & 0 deletions src/rooms/mine_tunnel.bg
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
@BG 0 0 0 34x15
>mine_0
>mine_1
>mine_2
>mine_3
>mine_4
>mine_5
>mine_6

EMEMEMEMEMENEMEMEMEMEMEMEPEMEMEMEMEMEMENEMEMEMEMEIEFEFEFEFEFEJEMEMEM
EMEMEMEMEIEFEFEJEMENEIEFEFEFEFECEFEFEFEFEJEPEMEIED ECEJEMEM
EMEMEMEIED DNEGEIEFED CECF ECEFEJEH BK EGEMEM
EMEMEOEDDL EGEH AN CGCH EGEH BJBOBI ECEFEF
EMEMEPEH EGEH BK CI EAEBDCDADDEGEH BL AM
EMEMEMEH AN EAEHBJBOBI CGCJ ECEDDEDBDFEGEH FM
EFEFEFED EAELEH BL EAEB EAELEHGL EAGAGGGFGGGG
EGENEKEB EGEH BK EGEIED EGEMEMEOEMEM
ECEJEIED EGED BJBOBI EAELEH AP GKECEJENEMEMEM
AN ECED GKEGEH BL EGEOEH ECEJEMEMEM
AO CKCP AN EGEKEB ECEFEDGL AN EGEMEMEM
EEEEEB COCL EAEEELEPEH AM CACB AM EGEPEMEM
EMEMEKEBAHAHAHAIAJAHAHEGENEMEMEKEB CCCD EAEEELEMEMEM
EMEPEMEKBNBNBNEEEEBNBNELEPEMEMEOEHBMBMBMEAEAEEEBBMBMBMBMEGEMEOEMEMEM
EMEMEMEMEOEMEMEMEOEMEMEMEMEMEMEMEKFPFPFPEOEMEMEKFPFPFPFPEOEMEMEMEMEM

0 comments on commit e737140

Please sign in to comment.