diff --git a/src/audio.asm b/src/audio.asm index a548a36..4f1fb92 100644 --- a/src/audio.asm +++ b/src/audio.asm @@ -491,7 +491,6 @@ _ContinueNote: beq _IncrementFramesAndReturn _ContinueTone: jsr Func_AudioCallInstrument ; preserves X, returns A - ;; TODO: Apply master volume. sta Hw_Channels_sChanRegs_arr5 + sChanRegs::Envelope_wo, x _IncrementFramesAndReturn: inc Ram_Music_sChanNote_arr + sChanNote::ElapsedFrames_u8, x diff --git a/src/breaker.asm b/src/breaker.asm index 74b6c35..db03145 100644 --- a/src/breaker.asm +++ b/src/breaker.asm @@ -105,7 +105,7 @@ Zp_BreakerBeingActivated_eFlag: .res 1 ;;; @prereq Explore mode is initialized. .PROC Main_Breaker_TraceCircuit jsr Func_FadeOutToBlack - ;; TODO: implement this + ;; TODO: implement circuit-tracing cutscene fall Main_Breaker_LoadCoreRoom .ENDPROC diff --git a/src/dialog.asm b/src/dialog.asm index daa4a5f..af6b678 100644 --- a/src/dialog.asm +++ b/src/dialog.asm @@ -143,6 +143,7 @@ .IMPORT DataA_Dialog_SewerPoolSign_sDialog .IMPORT DataA_Dialog_ShadowDrillScreen_sDialog .IMPORT DataA_Dialog_ShadowGateScreen_sDialog +.IMPORT DataA_Dialog_ShadowOfficeAcid_sDialog .IMPORT DataA_Dialog_ShadowOfficeFireball_sDialog .IMPORT DataA_Dialog_ShadowOfficeTeleport_sDialog .IMPORT DataA_Dialog_ShadowTeleportScreen_sDialog @@ -567,6 +568,7 @@ _Finish: d_entry t, SewerPoolSign, DataA_Dialog_SewerPoolSign_sDialog d_entry t, ShadowDrillScreen, DataA_Dialog_ShadowDrillScreen_sDialog d_entry t, ShadowGateScreen, DataA_Dialog_ShadowGateScreen_sDialog + d_entry t, ShadowOfficeAcid, DataA_Dialog_ShadowOfficeAcid_sDialog d_entry t, ShadowOfficeFireball, DataA_Dialog_ShadowOfficeFireball_sDialog d_entry t, ShadowOfficeTeleport, DataA_Dialog_ShadowOfficeTeleport_sDialog d_entry t, ShadowTeleportScreen, DataA_Dialog_ShadowTeleportScreen_sDialog diff --git a/src/dialog.inc b/src/dialog.inc index caa678f..5eb7601 100644 --- a/src/dialog.inc +++ b/src/dialog.inc @@ -218,6 +218,7 @@ kDialogEntryCutscene = $ff ; ends the dialog and starts a new cutscene SewerPoolSign ShadowDrillScreen ShadowGateScreen + ShadowOfficeAcid ShadowOfficeFireball ShadowOfficeTeleport ShadowTeleportScreen diff --git a/src/fake.asm b/src/fake.asm index f7c21be..772211b 100644 --- a/src/fake.asm +++ b/src/fake.asm @@ -27,7 +27,9 @@ .INCLUDE "machine.inc" .INCLUDE "machines/carriage.inc" .INCLUDE "machines/emitter.inc" +.INCLUDE "machines/field.inc" .INCLUDE "machines/lift.inc" +.INCLUDE "machines/multiplexer.inc" .INCLUDE "machines/semaphore.inc" .INCLUDE "machines/shared.inc" .INCLUDE "macros.inc" @@ -52,6 +54,8 @@ .IMPORT Func_Window_TransferBottomBorder .IMPORT Func_Window_TransferClearRow .IMPORT Main_Console_CloseWindow +.IMPORT Ppu_ChrObjAnnaNormal +.IMPORT Ppu_ChrObjBoss1 .IMPORT Ram_DeviceTarget_byte_arr .IMPORT Ram_PpuTransfer_arr .IMPORTZP Zp_ConsoleNeedsPower_u8 @@ -73,6 +77,18 @@ kFakeConsoleMessageRows = kMaxProgramLength / 2 ;;; The width of the fake console message box, in tiles. kFakeConsoleMessageCols = 19 +;;; The eDiagram value to use for the "CoreDump" fake console. The only thing +;;; that matters is that it have a first tile ID of $f0, so that it will use +;;; the proper row of tiles from the second half of Ppu_ChrObjBoss1. +.ASSERT kTileIdBgDiagramCarriageFirst = $f0, error +kDiagramCoreDump = eDiagram::Carriage + +;;; The eDiagram value to use for the "Corrupted" fake console. The only thing +;;; that matters is that it have a first tile ID of $f0, so that it will use +;;; the proper row of tiles from the first half of Ppu_ChrObjAnnaNormal. +.ASSERT kTileIdBgDiagramCarriageFirst = $f0, error +kDiagramCorrupted = eDiagram::Carriage + ;;;=========================================================================;;; .ZEROPAGE @@ -158,11 +174,11 @@ _InitWindow: jmp Func_PlaySfxWindowOpen _Chr0cBank_u8_arr: D_ARRAY .enum, eFake - d_byte CoreDump, $61 ; TODO - d_byte Corrupted, $61 ; TODO + d_byte CoreDump, <.bank(Ppu_ChrObjBoss1) + 1 ; second half + d_byte Corrupted, <.bank(Ppu_ChrObjAnnaNormal) + 0 ; first half d_byte EndThis, kChrBankDiagramCarriage - d_byte InsufficientData, $50 ; TODO - d_byte IsThisEthical, $60 ; TODO + d_byte InsufficientData, kChrBankDiagramMultiplexer + d_byte IsThisEthical, kChrBankDiagramField d_byte NoPower, kChrBankDiagramLift d_byte NoResponse, kChrBankDiagramSemaphoreComm D_END @@ -223,11 +239,11 @@ _DrawStatus: jmp FuncA_Console_WriteDiagramTransferDataForDiagram _Fake_eDiagram: D_ARRAY .enum, eFake - d_byte CoreDump, eDiagram::MinigunDown ; TODO - d_byte Corrupted, eDiagram::MinigunDown ; TODO + d_byte CoreDump, kDiagramCoreDump + d_byte Corrupted, kDiagramCorrupted d_byte EndThis, eDiagram::Carriage - d_byte InsufficientData, eDiagram::MinigunDown ; TODO - d_byte IsThisEthical, eDiagram::MinigunDown ; TODO + d_byte InsufficientData, eDiagram::Multiplexer + d_byte IsThisEthical, eDiagram::Field d_byte NoPower, eDiagram::Lift d_byte NoResponse, eDiagram::SemaphoreComm D_END diff --git a/src/rooms/shadow_flower.asm b/src/rooms/shadow_flower.asm index 75c5e5e..9a1eb4e 100644 --- a/src/rooms/shadow_flower.asm +++ b/src/rooms/shadow_flower.asm @@ -313,7 +313,7 @@ _MaybeKillFlowerBaddie: ldy #0 ; param: laser bottom (hi) jmp FuncA_Machine_LaserTryAct _LaserBottom_i16_0_arr: -: .byte $50, $c0, $90, $70, $c5, $70, $c5, $80, $c0, $30 +: .byte $50, $c0, $90, $70, $c0, $70, $80, $80, $c0, $30 .assert * - :- = kLaserMaxGoalX + 1, error .ENDPROC diff --git a/src/rooms/shadow_office.asm b/src/rooms/shadow_office.asm index 47f212c..e60a66a 100644 --- a/src/rooms/shadow_office.asm +++ b/src/rooms/shadow_office.asm @@ -44,6 +44,7 @@ .IMPORT FuncA_Terrain_FadeInShortRoomWithLava .IMPORT Func_BufferPpuTransfer .IMPORT Func_FindEmptyActorSlot +.IMPORT Func_InitActorDefault .IMPORT Func_InitActorProjFireball .IMPORT Func_InitActorSmokeExplosion .IMPORT Func_IsPointInPlatform @@ -62,10 +63,19 @@ .IMPORTZP Zp_AvatarPosX_i16 .IMPORTZP Zp_AvatarPosY_i16 .IMPORTZP Zp_PointX_i16 +.IMPORTZP Zp_PointY_i16 .IMPORTZP Zp_RoomState ;;;=========================================================================;;; +;;; How long between drips of acid, in frames. +.DEFINE kAcidDripSlowdown 8 + +;;; The total time for a full acid dripping sequence, in frames. +kAcidDripFrames = kAcidDripSlowdown * 4 + +;;;=========================================================================;;; + ;;; The actor index for the ghost in this room. kGhostActorIndex = 0 @@ -119,6 +129,8 @@ kLiftInitPlatformTop = kLiftMaxPlatformTop - kLiftInitGoalY * kBlockHeightPx ;;; Defines room-specific state data for this particular room. .STRUCT sState + ;; How many more frames until the acid console can be activated again. + AcidCooldown_u8 .byte ;; How many more frames until the fireball console can be activated again. FireballCooldown_u8 .byte ;; How many more frames until the teleport count resets. @@ -235,10 +247,10 @@ _Devices_sDevice_arr: d_byte Target_byte, eFake::CoreDump D_END D_STRUCT sDevice - d_byte Type_eDevice, eDevice::FakeConsole + d_byte Type_eDevice, eDevice::ScreenGreen d_byte BlockRow_u8, 2 d_byte BlockCol_u8, 6 - d_byte Target_byte, eFake::InsufficientData ; TODO shock vert + d_byte Target_byte, eDialog::ShadowOfficeAcid D_END D_STRUCT sDevice d_byte Type_eDevice, eDevice::FakeConsole @@ -330,6 +342,34 @@ _Passages_sPassage_arr: .SEGMENT "PRGA_Room" .PROC FuncA_Room_ShadowOffice_TickRoom +_Acid: + ;; Check if acid is currently dripping from the ceiling. + lda Zp_RoomState + sState::AcidCooldown_u8 + beq @done ; acid drip sequence is not active + ;; Drip one drop of acid every kAcidDripSlowdown frames. + dec Zp_RoomState + sState::AcidCooldown_u8 + mod #kAcidDripSlowdown + bne @done ; don't drip acid this frame + ;; Calculate the starting point for this drop of acid. + lda Zp_RoomState + sState::AcidCooldown_u8 + .assert $10 .mod kAcidDripSlowdown = 0, error + mul #$10 / kAcidDripSlowdown + and #$f0 + rsub #$78 + sta Zp_PointX_i16 + 0 + lda #$13 + sta Zp_PointY_i16 + 0 + lda #0 + sta Zp_PointX_i16 + 1 + sta Zp_PointY_i16 + 1 + ;; Spawn an acid projectile at the starting point. + jsr Func_FindEmptyActorSlot ; sets C on failure, returns X + bcs @done + jsr Func_SetActorCenterToPoint ; preserves X + ldy #eActor::ProjAcid ; param: actor type + jsr Func_InitActorDefault + ;; TODO: play a sound for dripping acid + @done: _CoolDownFireball: lda Zp_RoomState + sState::FireballCooldown_u8 beq @done @@ -445,6 +485,19 @@ _Return: .SEGMENT "PRGA_Dialog" +.EXPORT DataA_Dialog_ShadowOfficeAcid_sDialog +.PROC DataA_Dialog_ShadowOfficeAcid_sDialog + dlg_Call _DripAcid + dlg_Done +_DripAcid: + lda Zp_RoomState + sState::AcidCooldown_u8 + bne @done + lda #kAcidDripFrames + sta Zp_RoomState + sState::AcidCooldown_u8 + @done: + rts +.ENDPROC + .EXPORT DataA_Dialog_ShadowOfficeFireball_sDialog .PROC DataA_Dialog_ShadowOfficeFireball_sDialog dlg_Call _ShootFireball