Skip to content

Commit

Permalink
Add graphics for teleporter zap
Browse files Browse the repository at this point in the history
  • Loading branch information
mdsteele committed Mar 4, 2024
1 parent a4a9360 commit ad9827d
Show file tree
Hide file tree
Showing 20 changed files with 1,036 additions and 175 deletions.
2 changes: 1 addition & 1 deletion build/bg2tset.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ static const struct {
{0xb4, "drawbridge"},
{0x80, "factory1"},
{0x90, "factory2"},
{0xac, "field_bg"},
{0xa0, "fullcore1"},
{0xb0, "fullcore2"},
{0xa0, "furniture"},
Expand Down Expand Up @@ -104,6 +103,7 @@ static const struct {
{0xb0, "terrain_hoist"},
{0x00, "terrain_shared_0"},
{0x10, "terrain_shared_1"},
{0x40, "terrain_teleport"},
{0x50, "thorns_anim0"},
{0xaa, "tree"},
{0x90, "volcanic1"},
Expand Down
19 changes: 15 additions & 4 deletions src/chr.asm
Original file line number Diff line number Diff line change
Expand Up @@ -562,8 +562,7 @@ _chr_begin:
chr_inc "steam_pipes"
chr_inc "volcanic1"
chr_inc "volcanic2"
chr_res $06
chr_inc "field_bg"
chr_res $0a
chr_inc "arch"
chr_inc "boiler"
chr_inc "terrain_boss_lava"
Expand Down Expand Up @@ -963,14 +962,26 @@ _chr_begin:
chr_inc "shadow1"
chr_inc "shadow2"
chr_inc "shadow3"
chr_inc "field_bg"
chr_res $04
chr_inc "tank"
chr_res $06
END_CHR_BANK
.ENDPROC

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

.SEGMENT "CHR_BgTeleport"

.EXPORT Ppu_ChrBgTeleport
.PROC Ppu_ChrBgTeleport
CHR1_BANK $40
chr_inc "terrain_teleport"
chr_res $04
END_CHR_BANK
.ENDPROC

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

.SEGMENT "CHR_BgTemple"

.EXPORT Ppu_ChrBgTemple
Expand Down Expand Up @@ -1004,7 +1015,7 @@ _chr_begin:

.EXPORT Ppu_ChrBgWheel
.PROC Ppu_ChrBgWheel
CHR1_BANK $c0
CHR1_BANK $40
chr_inc "wheel1"
chr_inc "wheel2"
chr_inc "wheel3"
Expand Down
10 changes: 10 additions & 0 deletions src/cutscene.asm
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
.IMPORT Ram_ActorVelX_i16_1_arr
.IMPORT Ram_ActorVelY_i16_0_arr
.IMPORT Ram_ActorVelY_i16_1_arr
.IMPORT Ram_DeviceAnim_u8_arr
.IMPORTZP Zp_AvatarFlags_bObj
.IMPORTZP Zp_AvatarPosX_i16
.IMPORTZP Zp_AvatarPosY_i16
Expand Down Expand Up @@ -385,6 +386,7 @@ _InitMainFork:
d_entry table, SetAvatarVelX, _SetAvatarVelX
d_entry table, SetAvatarVelY, _SetAvatarVelY
d_entry table, SetCutsceneFlags, _SetCutsceneFlags
d_entry table, SetDeviceAnim, _SetDeviceAnim
d_entry table, SetScrollFlags, _SetScrollFlags
d_entry table, ShakeRoom, _ShakeRoom
d_entry table, SwimNpcAlex, _SwimNpcAlex
Expand Down Expand Up @@ -655,6 +657,14 @@ _SetAvatarVelY:
sta Zp_AvatarVelY_i16 + 1
iny
jmp FuncA_Cutscene_AdvanceForkAndExecute
_SetDeviceAnim:
lda (T1T0), y
tax ; device index
iny
lda (T1T0), y
sta Ram_DeviceAnim_u8_arr, x
iny
jmp FuncA_Cutscene_AdvanceForkAndExecute
_SetCutsceneFlags:
lda (T1T0), y
sta Zp_CutsceneFlags_bCutscene
Expand Down
7 changes: 7 additions & 0 deletions src/cutscene.inc
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,9 @@ kMaxForks = 4
;; Sets the cutscene tick flags to the specified value, then the current
;; cutscene fork immediately continues on to the next action.
SetCutsceneFlags ; args: bCutscene value
;; Sets a field on the specified device to the specified value, then the
;; current cutscene fork immediately continues on to the next action.
SetDeviceAnim ; args: device index, new anim value
;; Sets the camera scroll flags, then the current cutscene fork immediately
;; continues on to the next action.
SetScrollFlags ; args: bScroll value
Expand Down Expand Up @@ -312,6 +315,10 @@ kMaxForks = 4
.word $ffff & (VELY)
.ENDMACRO

.MACRO act_SetDeviceAnim INDEX, ANIM
.byte eAction::SetDeviceAnim, INDEX, ANIM
.ENDMACRO

.MACRO act_SetCutsceneFlags BCUTSCENE
.byte eAction::SetCutsceneFlags, BCUTSCENE
.ENDMACRO
Expand Down
3 changes: 2 additions & 1 deletion src/device.asm
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
.IMPORT FuncA_Objects_DrawLockedDoorDevice
.IMPORT FuncA_Objects_DrawPaperDevice
.IMPORT FuncA_Objects_DrawScreenDevice
.IMPORT FuncA_Objects_DrawTeleporterDevice
.IMPORT FuncA_Objects_DrawUnlockedDoorDevice
.IMPORT FuncA_Objects_DrawUpgradeDevice
.IMPORT Func_Noop
Expand Down Expand Up @@ -175,7 +176,7 @@ _Continue:
d_entry table, FlowerInert, FuncA_Objects_DrawFlowerDevice
d_entry table, Mousehole, Func_Noop
d_entry table, Placeholder, Func_Noop
d_entry table, Teleporter, Func_Noop
d_entry table, Teleporter, FuncA_Objects_DrawTeleporterDevice
d_entry table, BreakerReady, FuncA_Objects_DrawBreakerReadyDevice
d_entry table, Console, FuncA_Objects_DrawConsoleDevice
d_entry table, Door1Open, Func_Noop
Expand Down
Loading

0 comments on commit ad9827d

Please sign in to comment.