Skip to content

Commit

Permalink
Move upgrade bottom tiles into shared OBJ tile bank
Browse files Browse the repository at this point in the history
  • Loading branch information
mdsteele committed Feb 9, 2024
1 parent 23329f5 commit f2973e7
Show file tree
Hide file tree
Showing 11 changed files with 72 additions and 71 deletions.
35 changes: 17 additions & 18 deletions src/chr.asm
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
.INCLUDE "machines/semaphore.inc"
.INCLUDE "machines/shared.inc"
.INCLUDE "machines/winch.inc"
.INCLUDE "pause.inc"
.INCLUDE "platforms/barrier.inc"
.INCLUDE "platforms/chex.inc"
.INCLUDE "platforms/column.inc"
Expand Down Expand Up @@ -638,8 +639,8 @@ _chr_begin:
.EXPORT Ppu_ChrBgPause
.PROC Ppu_ChrBgPause
CHR1_BANK $80
chr_inc "upgrade_bottom"
chr_inc "upgrade_ram"
chr_inc "upgrade_bottom", kTileIdBgUpgradeBottomFirst
chr_inc "upgrade_ram", kTileIdBgUpgradeRamFirst
chr_inc "upgrade_bremote"
chr_inc "upgrade_opif"
chr_inc "upgrade_optil"
Expand Down Expand Up @@ -1019,7 +1020,8 @@ _chr_begin:
.PROC Ppu_ChrObjAnnaFlower
CHR2_BANK $00
chr_inc "device"
chr_inc "player_flower", eAvatar::Standing
chr_inc "upgrade_bottom", kTileIdObjUpgradeBottomFirst
chr_inc "player_flower", eAvatar::Standing
chr_inc "font_hilight"
END_CHR_BANK
.ENDPROC
Expand All @@ -1032,7 +1034,8 @@ _chr_begin:
.PROC Ppu_ChrObjAnnaNormal
CHR2_BANK $00
chr_inc "device"
chr_inc "player_normal", eAvatar::Standing
chr_inc "upgrade_bottom", kTileIdObjUpgradeBottomFirst
chr_inc "player_normal", eAvatar::Standing
chr_inc "font_hilight"
END_CHR_BANK
.ENDPROC
Expand All @@ -1044,7 +1047,7 @@ _chr_begin:
.EXPORT Ppu_ChrObjBoss1
.PROC Ppu_ChrObjBoss1
CHR2_BANK $80
chr_inc "upgrade_bottom", kTileIdObjUpgradeBottomFirst
chr_res $02
chr_inc "upgrade_ram", kTileIdObjUpgradeRamFirst
chr_inc "breakball", kTileIdObjBreakballFirst
chr_inc "ember", kTileIdObjEmber
Expand Down Expand Up @@ -1084,8 +1087,7 @@ _chr_begin:
.EXPORT Ppu_ChrObjBoss2
.PROC Ppu_ChrObjBoss2
CHR2_BANK $80
chr_inc "upgrade_bottom", kTileIdObjUpgradeBottomFirst
chr_res $04
chr_res $06
chr_inc "upgrade_opif", kTileIdObjUpgradeOpIfFirst
chr_inc "cannon", kTileIdObjCannonFirst
chr_res $02
Expand Down Expand Up @@ -1117,7 +1119,7 @@ _chr_begin:
.EXPORT Ppu_ChrObjCity
.PROC Ppu_ChrObjCity
CHR2_BANK $80
chr_inc "upgrade_bottom", kTileIdObjUpgradeBottomFirst
chr_res $02
chr_inc "breakbomb", kTileIdObjBreakbombFirst
chr_inc "upgrade_bremote", kTileIdObjUpgradeBRemoteFirst
chr_inc "reloader", kTileIdObjReloaderFirst
Expand Down Expand Up @@ -1145,8 +1147,7 @@ _chr_begin:
.EXPORT Ppu_ChrObjCrypt
.PROC Ppu_ChrObjCrypt
CHR2_BANK $80
chr_inc "upgrade_bottom", kTileIdObjUpgradeBottomFirst
chr_res $10
chr_res $12
chr_inc "upgrade_opgoto", kTileIdObjUpgradeOpGotoFirst
chr_res $08
chr_inc "bat", kTileIdObjBatFirst
Expand All @@ -1168,7 +1169,7 @@ _chr_begin:
.EXPORT Ppu_ChrObjFactory
.PROC Ppu_ChrObjFactory
CHR2_BANK $80
chr_inc "upgrade_bottom", kTileIdObjUpgradeBottomFirst
chr_res $02
chr_inc "jet", kTileIdObjJetFirst
chr_inc "rotor", kTileIdObjRotorFirst
chr_res $07
Expand Down Expand Up @@ -1217,7 +1218,7 @@ _chr_begin:
.EXPORT Ppu_ChrObjLava
.PROC Ppu_ChrObjLava
CHR2_BANK $80
chr_inc "upgrade_bottom", kTileIdObjUpgradeBottomFirst
chr_res $02
chr_inc "upgrade_ram", kTileIdObjUpgradeRamFirst
chr_inc "platform_volcanic", kTileIdObjPlatformVolcanicFirst
chr_inc "ember", kTileIdObjEmber
Expand Down Expand Up @@ -1250,7 +1251,7 @@ _chr_begin:
.EXPORT Ppu_ChrObjMine
.PROC Ppu_ChrObjMine
CHR2_BANK $80
chr_inc "upgrade_bottom", kTileIdObjUpgradeBottomFirst
chr_res $02
chr_inc "upgrade_ram", kTileIdObjUpgradeRamFirst
chr_inc "hoist_obj", kTileIdObjHoistFirst
chr_inc "mine_cage", kTileIdObjMineCageFirst
Expand Down Expand Up @@ -1289,7 +1290,7 @@ _chr_begin:
.EXPORT Ppu_ChrObjSewer
.PROC Ppu_ChrObjSewer
CHR2_BANK $80
chr_inc "upgrade_bottom", kTileIdObjUpgradeBottomFirst
chr_res $02
chr_inc "multiplexer", kTileIdObjMultiplexerFirst
chr_inc "pump_light", kTileIdObjPumpLight
chr_inc "water", kTileIdObjWaterFirst
Expand Down Expand Up @@ -1318,8 +1319,7 @@ _chr_begin:
.EXPORT Ppu_ChrObjShadow
.PROC Ppu_ChrObjShadow
CHR2_BANK $80
chr_inc "upgrade_bottom", kTileIdObjUpgradeBottomFirst
chr_res $0c
chr_res $0e
chr_inc "upgrade_opmul", kTileIdObjUpgradeOpMulFirst
chr_res $20
chr_inc "orc_ghost", kTileIdObjOrcGhostFirst
Expand All @@ -1344,8 +1344,7 @@ _chr_begin:
.EXPORT Ppu_ChrObjTemple
.PROC Ppu_ChrObjTemple
CHR2_BANK $80
chr_inc "upgrade_bottom", kTileIdObjUpgradeBottomFirst
chr_res $02
chr_res $04
chr_inc "column", kTileIdObjColumnFirst
chr_res $02
chr_inc "upgrade_optil", kTileIdObjUpgradeOpTilFirst
Expand Down
4 changes: 2 additions & 2 deletions src/devices/console.asm
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
;;;=========================================================================;;;

;;; OBJ tile IDs used for drawing console devices.
kTileIdObjConsoleOk = $0a
kTileIdObjConsoleErr = $0b
kTileIdObjConsoleOk = $08
kTileIdObjConsoleErr = $09
kTileIdObjScreen = kTileIdObjConsoleOk

;;; OBJ palette numbers used for drawing console/screen devices.
Expand Down
4 changes: 2 additions & 2 deletions src/devices/flower.inc
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
kFlowerDeviceIndex = 0

;;; OBJ tile IDs used for drawing flower devices.
kTileIdObjFlowerTop = $0c
kTileIdObjFlowerBottom = $0d
kTileIdObjFlowerTop = $0a
kTileIdObjFlowerBottom = $0b

;;; OBJ palette numbers used for drawing flower devices.
kPaletteObjFlowerTop = 1
Expand Down
4 changes: 2 additions & 2 deletions src/devices/lever.asm
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
;;;=========================================================================;;;

;;; OBJ tile IDs used for drawing lever handles.
kTileIdObjLeverHandleDown = $0e
kTileIdObjLeverHandleUp = $0f
kTileIdObjLeverHandleDown = $0c
kTileIdObjLeverHandleUp = $0d

;;; The OBJ palette number used for drawing lever handles.
kPaletteObjLeverHandle = 0
Expand Down
2 changes: 1 addition & 1 deletion src/dialog.asm
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ kDialogWindowScrollSpeed = 4
;;; The OBJ palette number and tile ID used for the visual prompt that appears
;;; when dialog is paused.
kPaletteObjDialogPrompt = 1
kTileIdObjDialogPrompt = $08
kTileIdObjDialogPrompt = 'I'

;;; The tile row/col within the window where the "yes"/"no" options start.
kDialogYesNoWindowRow = 4
Expand Down
3 changes: 2 additions & 1 deletion src/explore.asm
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
;;;=========================================================================;;;

.INCLUDE "avatar.inc"
.INCLUDE "charmap.inc"
.INCLUDE "cpu.inc"
.INCLUDE "cutscene.inc"
.INCLUDE "device.inc"
Expand Down Expand Up @@ -99,7 +100,7 @@
;;; The OBJ palette number and tile ID used for the visual prompt that appears
;;; when the player avatar is near a device.
kPaletteObjDevicePrompt = 1
kTileIdObjDevicePrompt = $09
kTileIdObjDevicePrompt = 'O'

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

Expand Down
13 changes: 4 additions & 9 deletions src/pause.asm
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
.INCLUDE "minimap.inc"
.INCLUDE "mmc3.inc"
.INCLUDE "oam.inc"
.INCLUDE "pause.inc"
.INCLUDE "ppu.inc"
.INCLUDE "room.inc"
.INCLUDE "window.inc"
Expand Down Expand Up @@ -89,12 +90,6 @@ kPapersWindowTopGoal = \
;;; How fast the papers window scrolls up/down, in pixels per frame.
kPapersWindowScrollSpeed = 11

;;; The BG tile ID for the bottom-left tile for all upgrade symbols. Add 1 to
;;; this to get the the bottom-right tile ID for those symbols.
kTileIdBgUpgradeBottomLeft = $80
;;; The BG tile ID for the top-left tile of the symbol for RAM upgrades. Add 1
;;; to this to get the the top-right tile ID for that symbol.
kTileIdBgRamTopLeft = $82
;;; The BG tile ID for the top-left tile for the symbol of the first non-RAM
;;; upgrade. Add 1 to this to get the the top-right tile ID for that symbol,
;;; then add another 1 to get the top-left tile ID for the next upgrade, and so
Expand Down Expand Up @@ -453,8 +448,8 @@ _FinishLowerNametable:
and #$01
beq @top
@bottom:
lda #kTileIdBgUpgradeBottomLeft
.assert kTileIdBgUpgradeBottomLeft > 0, error
lda #kTileIdBgUpgradeBottomFirst
.assert kTileIdBgUpgradeBottomFirst > 0, error
bne @draw ; unconditional
@top:
txa ; upgrade eFlag
Expand All @@ -464,7 +459,7 @@ _FinishLowerNametable:
add #kTileIdBgRemainingTopLeft
bcc @draw ; unconditional
@isRamUpgrade:
lda #kTileIdBgRamTopLeft
lda #kTileIdBgUpgradeRamFirst
@draw:
;; Draw the upgrade.
sta Hw_PpuData_rw
Expand Down
24 changes: 24 additions & 0 deletions src/pause.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
;;;=========================================================================;;;
;;; 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/>. ;;;
;;;=========================================================================;;;

;;; Various BG tile IDs used for drawing upgrades on the pause screen.
kTileIdBgUpgradeBottomFirst = $80
kTileIdBgUpgradeRamFirst = $82

;;;=========================================================================;;;
20 changes: 1 addition & 19 deletions src/tiles/device.ahi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ahi1 f0 p1 i16 w8 h8
ahi1 f0 p1 i14 w8 h8

;0;982220;ECEEEC;FF0;FF0;007628;FF0;FF0;FF0;54;FF0;FF0;FF0;FF0;FF0

Expand Down Expand Up @@ -74,24 +74,6 @@ AA00A00A
11111111
11111111

00222200
02221220
22221222
22212122
22211122
22122122
02122120
00222200

00222200
02111220
22122122
22111222
22122122
22122122
02111220
00222200

00000000
00000000
00000000
Expand Down
32 changes: 16 additions & 16 deletions src/tiles/font_hilight.ahi
Original file line number Diff line number Diff line change
Expand Up @@ -218,14 +218,14 @@ ahi1 f0 p1 i48 w8 h8
23222322
02222222

02222222
22333222
22232222
22232223
22232222
22232223
22333222
02222222
00222200
02221220
22221222
22212122
22211122
22122122
02122120
00222200

02222222
22233322
Expand Down Expand Up @@ -272,14 +272,14 @@ ahi1 f0 p1 i48 w8 h8
23222322
02222222

02222222
22333222
23222322
23222323
23222322
23222323
22333222
02222222
00222200
02111220
22122122
22111222
22122122
22122122
02111220
00222200

02222222
23333222
Expand Down
2 changes: 1 addition & 1 deletion src/upgrade.inc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
;;;=========================================================================;;;

;;; Various OBJ tile IDs used for drawing upgrades.
kTileIdObjUpgradeBottomFirst = $80
kTileIdObjUpgradeBottomFirst = $0e
kTileIdObjUpgradeRamFirst = $82
kTileIdObjUpgradeBRemoteFirst = $84
kTileIdObjUpgradeOpIfFirst = $86
Expand Down

0 comments on commit f2973e7

Please sign in to comment.