Skip to content

Commit

Permalink
Shrink town tilesets and shift code to make space in PRGC_Boss
Browse files Browse the repository at this point in the history
  • Loading branch information
mdsteele committed Feb 10, 2024
1 parent 02a17f4 commit 485e6b5
Show file tree
Hide file tree
Showing 15 changed files with 157 additions and 151 deletions.
98 changes: 51 additions & 47 deletions src/rooms/boss_city.asm
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ _Ext_sRoomExt:
d_addr Devices_sDevice_arr_ptr, _Devices_sDevice_arr
d_addr Passages_sPassage_arr_ptr, 0
d_addr Enter_func_ptr, FuncA_Room_BossCity_EnterRoom
d_addr FadeIn_func_ptr, FuncC_Boss_City_FadeInRoom
d_addr FadeIn_func_ptr, FuncA_Terrain_BossCity_FadeInRoom
d_addr Tick_func_ptr, FuncC_Boss_City_TickRoom
d_addr Draw_func_ptr, FuncC_Boss_City_DrawRoom
D_END
Expand Down Expand Up @@ -552,46 +552,6 @@ _Devices_sDevice_arr:
.byte 0, 1, 1, 1, 2, 2, 2, 3, 3, 4, 5, 6, 6, 7, 7, 8, 8, 8, 9, 9, 9, 9, 8
.ENDPROC

.PROC DataC_Boss_CityInitTransfer_arr
.assert kBossBgWidthTiles = 8, error
.assert kBossBgHeightTiles = 6, error
;; Row 0:
.byte kPpuCtrlFlagsHorz
.dbyt Ppu_BossRow0Start + 1 ; transfer destination
.byte 6
.byte $4c, $4d, $4e, $4f, $50, $51
;; Row 1:
.byte kPpuCtrlFlagsHorz
.dbyt Ppu_BossRow1Start ; transfer destination
.byte 8
.byte $52, $53, $54, $55, $56, $57, $58, $59
;; Row 2:
.byte kPpuCtrlFlagsHorz
.dbyt Ppu_BossRow2Start + 1 ; transfer destination
.byte 6
.byte $40, $41, $42, $43, $44, $45
;; Row 3:
.byte kPpuCtrlFlagsHorz
.dbyt Ppu_BossRow3Start + 1 ; transfer destination
.byte 6
.byte $46, $47, $48, $49, $4a, $4b
;; Row 4:
.byte kPpuCtrlFlagsHorz
.dbyt Ppu_BossRow4Start ; transfer destination
.byte 8
.byte $5a, $5b, $5c, $5d, $5e, $5f, $60, $61
;; Row 5:
.byte kPpuCtrlFlagsHorz
.dbyt Ppu_BossRow5Start + 1 ; transfer destination
.byte 6
.byte $62, $63, $64, $65, $66, $67
;; Attributes:
.byte kPpuCtrlFlagsHorz
.dbyt Ppu_BossCoreAttrs ; transfer destination
.byte 1
.byte $11
.ENDPROC

.PROC DataC_Boss_CityBlinkTransfer_arr
;; Row 2:
.byte kPpuCtrlFlagsHorz
Expand All @@ -618,12 +578,6 @@ _Devices_sDevice_arr:
.byte $48, $49
.ENDPROC

.PROC FuncC_Boss_City_FadeInRoom
ldax #DataC_Boss_CityInitTransfer_arr ; param: data pointer
ldy #.sizeof(DataC_Boss_CityInitTransfer_arr) ; param: data length
jmp Func_BufferPpuTransfer
.ENDPROC

;;; Room tick function for the BossCity room.
;;; @prereq PRGA_Room is loaded.
.PROC FuncC_Boss_City_TickRoom
Expand Down Expand Up @@ -1214,6 +1168,56 @@ _Error:

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

.SEGMENT "PRGA_Terrain"

.PROC DataA_Terrain_BossCityInitTransfer_arr
.assert kBossBgWidthTiles = 8, error
.assert kBossBgHeightTiles = 6, error
;; Row 0:
.byte kPpuCtrlFlagsHorz
.dbyt Ppu_BossRow0Start + 1 ; transfer destination
.byte 6
.byte $4c, $4d, $4e, $4f, $50, $51
;; Row 1:
.byte kPpuCtrlFlagsHorz
.dbyt Ppu_BossRow1Start ; transfer destination
.byte 8
.byte $52, $53, $54, $55, $56, $57, $58, $59
;; Row 2:
.byte kPpuCtrlFlagsHorz
.dbyt Ppu_BossRow2Start + 1 ; transfer destination
.byte 6
.byte $40, $41, $42, $43, $44, $45
;; Row 3:
.byte kPpuCtrlFlagsHorz
.dbyt Ppu_BossRow3Start + 1 ; transfer destination
.byte 6
.byte $46, $47, $48, $49, $4a, $4b
;; Row 4:
.byte kPpuCtrlFlagsHorz
.dbyt Ppu_BossRow4Start ; transfer destination
.byte 8
.byte $5a, $5b, $5c, $5d, $5e, $5f, $60, $61
;; Row 5:
.byte kPpuCtrlFlagsHorz
.dbyt Ppu_BossRow5Start + 1 ; transfer destination
.byte 6
.byte $62, $63, $64, $65, $66, $67
;; Attributes:
.byte kPpuCtrlFlagsHorz
.dbyt Ppu_BossCoreAttrs ; transfer destination
.byte 1
.byte $11
.ENDPROC

.PROC FuncA_Terrain_BossCity_FadeInRoom
ldax #DataA_Terrain_BossCityInitTransfer_arr ; param: data pointer
ldy #.sizeof(DataA_Terrain_BossCityInitTransfer_arr) ; param: data length
jmp Func_BufferPpuTransfer
.ENDPROC

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

.SEGMENT "PRGE_Irq"

;;; HBlank IRQ handler function for the top of the boss's zone in the BossCity
Expand Down
106 changes: 55 additions & 51 deletions src/rooms/boss_crypt.asm
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ _Ext_sRoomExt:
d_addr Devices_sDevice_arr_ptr, _Devices_sDevice_arr
d_addr Passages_sPassage_arr_ptr, 0
d_addr Enter_func_ptr, FuncC_Boss_Crypt_EnterRoom
d_addr FadeIn_func_ptr, FuncC_Boss_Crypt_FadeInRoom
d_addr FadeIn_func_ptr, FuncA_Terrain_BossCrypt_FadeInRoom
d_addr Tick_func_ptr, FuncA_Room_BossCrypt_TickRoom
d_addr Draw_func_ptr, FuncA_Objects_DrawBoss
D_END
Expand Down Expand Up @@ -518,36 +518,6 @@ _Inner:
rts
.ENDPROC

.PROC DataC_Boss_CryptInitTransfer_arr
.assert kBossWidthTiles = 6, error
.assert kBossHeightTiles = 4, error
;; Row 0:
.byte kPpuCtrlFlagsHorz
.dbyt Ppu_BossRow0Start ; transfer destination
.byte 6
.byte $6c, $6d, $6e, $6f, $70, $71
;; Row 1:
.byte kPpuCtrlFlagsHorz
.dbyt Ppu_BossRow1Start ; transfer destination
.byte 6
.byte $72, $73, $a4, $a6, $74, $75
;; Row 2:
.byte kPpuCtrlFlagsHorz
.dbyt Ppu_BossRow2Start ; transfer destination
.byte 6
.byte $7c, $7d, $a5, $a7, $7e, $7f
;; Row 3:
.byte kPpuCtrlFlagsHorz
.dbyt Ppu_BossRow3Start ; transfer destination
.byte 6
.byte $76, $77, $78, $79, $7a, $7b
;; Nametable attributes to color eyeball red:
.byte kPpuCtrlFlagsHorz
.dbyt Ppu_BossEyeAttrs ; transfer destination
.byte 1
.byte $04
.ENDPROC

;;; Room init function for the BossCrypt room.
;;; @prereq PRGA_Room is loaded.
.PROC FuncC_Boss_Crypt_EnterRoom
Expand All @@ -571,16 +541,6 @@ _BossIsDead:
rts
.ENDPROC

.PROC FuncC_Boss_Crypt_FadeInRoom
ldx #4 ; param: num bytes to write
ldy #$50 ; param: attribute value
lda #$32 ; param: initial byte offset
jsr Func_WriteToUpperAttributeTable
ldax #DataC_Boss_CryptInitTransfer_arr ; param: data pointer
ldy #.sizeof(DataC_Boss_CryptInitTransfer_arr) ; param: data length
jmp Func_BufferPpuTransfer
.ENDPROC

;;; Performs per-frame upates for the boss in this room.
;;; @prereq PRGA_Room is loaded.
.PROC FuncC_Boss_Crypt_TickBoss
Expand Down Expand Up @@ -953,6 +913,60 @@ _Error:

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

.SEGMENT "PRGA_Terrain"

.PROC DataA_Terrain_BossCryptInitTransfer_arr
.assert kBossWidthTiles = 6, error
.assert kBossHeightTiles = 4, error
;; Row 0:
.byte kPpuCtrlFlagsHorz
.dbyt Ppu_BossRow0Start ; transfer destination
.byte 6
.byte $6c, $6d, $6e, $6f, $70, $71
;; Row 1:
.byte kPpuCtrlFlagsHorz
.dbyt Ppu_BossRow1Start ; transfer destination
.byte 6
.byte $72, $73, $a4, $a6, $74, $75
;; Row 2:
.byte kPpuCtrlFlagsHorz
.dbyt Ppu_BossRow2Start ; transfer destination
.byte 6
.byte $7c, $7d, $a5, $a7, $7e, $7f
;; Row 3:
.byte kPpuCtrlFlagsHorz
.dbyt Ppu_BossRow3Start ; transfer destination
.byte 6
.byte $76, $77, $78, $79, $7a, $7b
;; Nametable attributes to color eyeball red:
.byte kPpuCtrlFlagsHorz
.dbyt Ppu_BossEyeAttrs ; transfer destination
.byte 1
.byte $04
.ENDPROC

.PROC FuncA_Terrain_BossCrypt_FadeInRoom
ldx #4 ; param: num bytes to write
ldy #$50 ; param: attribute value
lda #$32 ; param: initial byte offset
jsr Func_WriteToUpperAttributeTable
ldax #DataA_Terrain_BossCryptInitTransfer_arr ; param: data pointer
ldy #.sizeof(DataA_Terrain_BossCryptInitTransfer_arr) ; param: data length
jmp Func_BufferPpuTransfer
.ENDPROC

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

.SEGMENT "PRGA_Objects"

;;; Draws the BossCryptWinch machine.
.PROC FuncA_Objects_BossCryptWinch_Draw
ldx #kSpikeballPlatformIndex ; param: spikeball platform index
jmp FuncA_Objects_DrawWinchMachineWithSpikeball
.ENDPROC

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

.SEGMENT "PRGE_Irq"

;;; HBlank IRQ handler function for the top of the boss's zone in the BossCrypt
Expand Down Expand Up @@ -1037,13 +1051,3 @@ _Error:
.ENDPROC

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

.SEGMENT "PRGA_Objects"

;;; Draws the BossCryptWinch machine.
.PROC FuncA_Objects_BossCryptWinch_Draw
ldx #kSpikeballPlatformIndex ; param: spikeball platform index
jmp FuncA_Objects_DrawWinchMachineWithSpikeball
.ENDPROC

;;;=========================================================================;;;
72 changes: 38 additions & 34 deletions src/rooms/boss_lava.asm
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ _Ext_sRoomExt:
d_addr Devices_sDevice_arr_ptr, _Devices_sDevice_arr
d_addr Passages_sPassage_arr_ptr, 0
d_addr Enter_func_ptr, FuncA_Room_BossLava_EnterRoom
d_addr FadeIn_func_ptr, FuncC_Boss_Lava_FadeInRoom
d_addr FadeIn_func_ptr, FuncA_Terrain_BossLava_FadeInRoom
d_addr Tick_func_ptr, FuncA_Room_BossLava_TickRoom
d_addr Draw_func_ptr, FuncC_Boss_Lava_DrawRoom
D_END
Expand Down Expand Up @@ -475,39 +475,6 @@ _Devices_sDevice_arr:
D_END
.ENDPROC

.PROC DataC_Boss_LavaInitTransfer_arr
.assert kBossFullWidthTiles = 8, error
.assert kBossHeightTiles = 4, error
.assert kTileIdBgAnimBossLavaFirst = $50, error
;; Row 0:
.byte kPpuCtrlFlagsHorz
.dbyt Ppu_BossRow0Start ; transfer destination
.byte 8
.byte $50, $54, $58, $b8, $b9, $5c, $60, $64
;; Row 1:
.byte kPpuCtrlFlagsHorz
.dbyt Ppu_BossRow1Start ; transfer destination
.byte 8
.byte $51, $55, $59, $ba, $bb, $5d, $61, $65
;; Row 2:
.byte kPpuCtrlFlagsHorz
.dbyt Ppu_BossRow2Start ; transfer destination
.byte 8
.byte $52, $56, $5a, $bc, $bd, $5e, $62, $66
;; Row 3:
.byte kPpuCtrlFlagsHorz
.dbyt Ppu_BossRow3Start ; transfer destination
.byte 8
.byte $53, $57, $5b, $be, $bf, $5f, $63, $67
.ENDPROC

.PROC FuncC_Boss_Lava_FadeInRoom
ldax #DataC_Boss_LavaInitTransfer_arr ; param: data pointer
ldy #.sizeof(DataC_Boss_LavaInitTransfer_arr) ; param: data length
jsr Func_BufferPpuTransfer
jmp FuncA_Terrain_FadeInShortRoomWithLava
.ENDPROC

;;; Performs per-frame upates for the boss in this room.
;;; @prereq PRGA_Room is loaded.
.PROC FuncC_Boss_Lava_TickBoss
Expand Down Expand Up @@ -1076,6 +1043,43 @@ _ValvePipePlatformIndex_u8_arr4:

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

.SEGMENT "PRGA_Terrain"

.PROC DataA_Terrain_BossLavaInitTransfer_arr
.assert kBossFullWidthTiles = 8, error
.assert kBossHeightTiles = 4, error
.assert kTileIdBgAnimBossLavaFirst = $50, error
;; Row 0:
.byte kPpuCtrlFlagsHorz
.dbyt Ppu_BossRow0Start ; transfer destination
.byte 8
.byte $50, $54, $58, $b8, $b9, $5c, $60, $64
;; Row 1:
.byte kPpuCtrlFlagsHorz
.dbyt Ppu_BossRow1Start ; transfer destination
.byte 8
.byte $51, $55, $59, $ba, $bb, $5d, $61, $65
;; Row 2:
.byte kPpuCtrlFlagsHorz
.dbyt Ppu_BossRow2Start ; transfer destination
.byte 8
.byte $52, $56, $5a, $bc, $bd, $5e, $62, $66
;; Row 3:
.byte kPpuCtrlFlagsHorz
.dbyt Ppu_BossRow3Start ; transfer destination
.byte 8
.byte $53, $57, $5b, $be, $bf, $5f, $63, $67
.ENDPROC

.PROC FuncA_Terrain_BossLava_FadeInRoom
ldax #DataA_Terrain_BossLavaInitTransfer_arr ; param: data pointer
ldy #.sizeof(DataA_Terrain_BossLavaInitTransfer_arr) ; param: data length
jsr Func_BufferPpuTransfer
jmp FuncA_Terrain_FadeInShortRoomWithLava
.ENDPROC

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

.SEGMENT "PRGE_Irq"

;;; HBlank IRQ handler function for the top of the boss's zone in the BossLava
Expand Down
2 changes: 1 addition & 1 deletion src/rooms/town_house1.bg
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@BG 0 0 0 16x15
>house_0
>house_1
>house_4
>house_2



Expand Down
2 changes: 1 addition & 1 deletion src/rooms/town_house2.bg
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@BG 0 0 0 16x15
>house_0
>house_1
>house_4
>house_2



Expand Down
2 changes: 1 addition & 1 deletion src/rooms/town_house3.bg
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@BG 0 0 0 16x15
>house_0
>house_1
>house_4
>house_2



Expand Down
2 changes: 1 addition & 1 deletion src/rooms/town_house4.bg
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@BG 0 0 0 16x15
>house_0
>house_1
>house_4
>house_2



Expand Down
Loading

0 comments on commit 485e6b5

Please sign in to comment.