From 424a15e90ed3f1103abcc473c98f7c5d351697c1 Mon Sep 17 00:00:00 2001 From: "Matthew D. Steele" Date: Thu, 9 May 2024 17:05:50 -0400 Subject: [PATCH] Add diagram for conveyor machines --- src/chr.asm | 18 +++++++++++++++-- src/diagram.asm | 3 +++ src/linker.cfg | 1 + src/machine.inc | 1 + src/machines/blaster.inc | 4 ++-- src/machines/conveyor.inc | 6 ++++++ src/rooms/mine_north.asm | 2 +- src/tiles/diagram_conveyor.ahi | 36 ++++++++++++++++++++++++++++++++++ 8 files changed, 66 insertions(+), 5 deletions(-) create mode 100644 src/tiles/diagram_conveyor.ahi diff --git a/src/chr.asm b/src/chr.asm index 391f9f17..f1166aeb 100644 --- a/src/chr.asm +++ b/src/chr.asm @@ -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" @@ -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 @@ -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 diff --git a/src/diagram.asm b/src/diagram.asm index af76e71f..4f1ae349 100644 --- a/src/diagram.asm +++ b/src/diagram.asm @@ -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" @@ -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 @@ -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 diff --git a/src/linker.cfg b/src/linker.cfg index ca26f5cb..c2248935 100644 --- a/src/linker.cfg +++ b/src/linker.cfg @@ -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; diff --git a/src/machine.inc b/src/machine.inc index eea1d1a4..5b24f002 100644 --- a/src/machine.inc +++ b/src/machine.inc @@ -36,6 +36,7 @@ kMachineRegNameB = $61 ; 'B' CannonLeft CannonRight Carriage + Conveyor Crane Debugger Field diff --git a/src/machines/blaster.inc b/src/machines/blaster.inc index a3987fd7..57a7361f 100644 --- a/src/machines/blaster.inc +++ b/src/machines/blaster.inc @@ -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 diff --git a/src/machines/conveyor.inc b/src/machines/conveyor.inc index fd25c357..7ff7883c 100644 --- a/src/machines/conveyor.inc +++ b/src/machines/conveyor.inc @@ -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 + ;;;=========================================================================;;; diff --git a/src/rooms/mine_north.asm b/src/rooms/mine_north.asm index aeb441b6..3bcdd47f 100644 --- a/src/rooms/mine_north.asm +++ b/src/rooms/mine_north.asm @@ -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 diff --git a/src/tiles/diagram_conveyor.ahi b/src/tiles/diagram_conveyor.ahi new file mode 100644 index 00000000..8ae05987 --- /dev/null +++ b/src/tiles/diagram_conveyor.ahi @@ -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