Skip to content

Commit

Permalink
Add diagram for conveyor machines
Browse files Browse the repository at this point in the history
  • Loading branch information
mdsteele committed May 9, 2024
1 parent c94ff0f commit 424a15e
Show file tree
Hide file tree
Showing 8 changed files with 66 additions and 5 deletions.
18 changes: 16 additions & 2 deletions src/chr.asm
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
.INCLUDE "machines/bridge.inc"
.INCLUDE "machines/cannon.inc"
.INCLUDE "machines/carriage.inc"
.INCLUDE "machines/conveyor.inc"
.INCLUDE "machines/crane.inc"
.INCLUDE "machines/emitter.inc"
.INCLUDE "machines/field.inc"
Expand Down Expand Up @@ -910,8 +911,8 @@ _chr_begin:
chr_res $10
.assert .bank(*) = kChrBankDiagramRotor, error
chr_inc "diagram_rotor", kTileIdBgDiagramRotorFirst
.assert .bank(*) = kChrBankDiagramBlaster, error
chr_inc "diagram_blaster", kTileIdBgDiagramBlasterFirst
.assert .bank(*) = kChrBankDiagramConveyor, error
chr_inc "diagram_conveyor", kTileIdBgDiagramConveyorFirst
END_CHR_BANK
.ENDPROC

Expand All @@ -933,6 +934,19 @@ _chr_begin:

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

.SEGMENT "CHR_BgPortrait11"

.PROC Ppu_ChrBgPortrait11
CHR1_BANK $c0
chr_res $20
.assert .bank(*) = kChrBankDiagramBlaster, error
chr_inc "diagram_blaster", kTileIdBgDiagramBlasterFirst
chr_res $10
END_CHR_BANK
.ENDPROC

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

.SEGMENT "CHR_BgPrison"

.EXPORT Ppu_ChrBgPrison
Expand Down
3 changes: 3 additions & 0 deletions src/diagram.asm
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
.INCLUDE "machines/bridge.inc"
.INCLUDE "machines/cannon.inc"
.INCLUDE "machines/carriage.inc"
.INCLUDE "machines/conveyor.inc"
.INCLUDE "machines/crane.inc"
.INCLUDE "machines/field.inc"
.INCLUDE "machines/hoist.inc"
Expand Down Expand Up @@ -84,6 +85,7 @@ kNoPowerWidthTiles = 19
d_byte CannonLeft, kChrBankDiagramCannonLeft
d_byte CannonRight, kChrBankDiagramCannonRight
d_byte Carriage, kChrBankDiagramCarriage
d_byte Conveyor, kChrBankDiagramConveyor
d_byte Crane, kChrBankDiagramCrane
d_byte Debugger, kChrBankDiagramDebugger
d_byte Field, kChrBankDiagramField
Expand Down Expand Up @@ -121,6 +123,7 @@ kNoPowerWidthTiles = 19
d_byte CannonLeft, kTileIdBgDiagramCannonLeftFirst
d_byte CannonRight, kTileIdBgDiagramCannonRightFirst
d_byte Carriage, kTileIdBgDiagramCarriageFirst
d_byte Conveyor, kTileIdBgDiagramConveyorFirst
d_byte Crane, kTileIdBgDiagramCraneFirst
d_byte Debugger, 0
d_byte Field, kTileIdBgDiagramFieldFirst
Expand Down
1 change: 1 addition & 0 deletions src/linker.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ SEGMENTS {
CHR_BgPortrait0E: load=CHR1_0E, type=ro;
CHR_BgPortrait0F: load=CHR1_0F, type=ro;
CHR_BgPortrait10: load=CHR1_10, type=ro;
CHR_BgPortrait11: load=CHR1_11, type=ro;
CHR_BgFontUpper: load=CHR1_1F, type=ro;
CHR_BgBuilding: load=CHR1_20, type=ro;
CHR_BgCity: load=CHR1_21, type=ro;
Expand Down
1 change: 1 addition & 0 deletions src/machine.inc
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ kMachineRegNameB = $61 ; 'B'
CannonLeft
CannonRight
Carriage
Conveyor
Crane
Debugger
Field
Expand Down
4 changes: 2 additions & 2 deletions src/machines/blaster.inc
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ kBlasterMachineHeightPx = $10
.DEFINE kBlasterMirrorAnimSlowdown 2

;;; The CHR bank number containing the diagram for blaster machines.
kChrBankDiagramBlaster = $0f
kChrBankDiagramBlaster = $11

;;; BG tile IDs for blaster machine diagrams.
kTileIdBgDiagramBlasterFirst = $f0
kTileIdBgDiagramBlasterFirst = $e0

;;; OBJ tile IDs used for drawing blaster machines.
kTileIdObjBlasterFirst = $98
Expand Down
6 changes: 6 additions & 0 deletions src/machines/conveyor.inc
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,10 @@
kConveyorMainPlatformWidthPx = $08
kConveyorMainPlatformHeightPx = $08

;;; The CHR bank number containing the diagram for conveyor machines.
kChrBankDiagramConveyor = $0f

;;; BG tile IDs for conveyor machine diagrams.
kTileIdBgDiagramConveyorFirst = $f0

;;;=========================================================================;;;
2 changes: 1 addition & 1 deletion src/rooms/mine_north.asm
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ _Machines_sMachine_arr:
d_byte Code_eProgram, eProgram::MineNorthConveyor
d_byte Breaker_eFlag, 0
d_byte Flags_bMachine, bMachine::WriteCDE
d_byte Status_eDiagram, eDiagram::HoistRight ; TODO
d_byte Status_eDiagram, eDiagram::Conveyor
d_word ScrollGoalX_u16, $100
d_byte ScrollGoalY_u8, $70
d_byte RegNames_u8_arr4, "U", "G", "L", 0
Expand Down
36 changes: 36 additions & 0 deletions src/tiles/diagram_conveyor.ahi
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
ahi1 f0 p1 i1 w32 h32

0;FF0;FF0;ECEEEC;FF0;FF0;FF0;FF0;FF0;FF0;FF0;FF0;FF0;FF0;FF0;FF0

00000000000000000000000000000000
03303330330030303330303033303300
30003030303030303000303030303030
30003030303030303300030030303300
30003030303030303000030030303030
03303330303033003330030033303030
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
03333300033333333333333333333330
30000030303300003300003300003303
30330030330330030330030330030333
30300030333030033030033030033033
30000030303300003300003300003303
30000030033333333333333333333330
30000030000000000000000000000000
30000003333330000000033000000000
30033000000003000000033000000000
30300300000003000000000000000000
30300300000303000033033033030303
30033000003303000033033033000000
30000000000003000000000000000000
03333333333330000033033033033033
00000000000000000033033033000000
00030003033000000000000000000000
00033033030000000033033033033333
00003003003000000033033033000000
00000000000000300000000000000300
00000000000003000030000003000030
00000000000033333330000003333333
00000000000003000000000000000030
00000000000000300000000000000300

0 comments on commit 424a15e

Please sign in to comment.