From 7340a49a2725aa131b852f4bece4169a4bfdd801 Mon Sep 17 00:00:00 2001 From: Jasper Renow-Clarke Date: Fri, 1 Nov 2024 17:09:12 +0000 Subject: [PATCH] Make more use of room IDs --- beeb/consts.asm | 14 +++++++++++++- beeb/objects.asm | 26 +++++++++++++------------- beeb/varcode.asm | 8 ++++---- 3 files changed, 30 insertions(+), 18 deletions(-) diff --git a/beeb/consts.asm b/beeb/consts.asm index c833cf1..de0a694 100644 --- a/beeb/consts.asm +++ b/beeb/consts.asm @@ -72,17 +72,29 @@ PRT_PEN = 16 ; Room related ROOM_EMPTY = 70 BIGGESTROOM = 919 ; In bytes - Room 22 + TITLEROOM = 0 BEANSTALKROOM = 1 FIREROOM = 2 HEARTSROOM = 3 UNDERAUSROOM = 7 +MARKETSQUAREROOM = 22 STRANGENEWROOM = 23 -GAMESTARTROOM = 36 +CASTLEDUNGEONROOM = 36 WELLROOM = 39 +DRAGONSLAIRROOM = 40 +BROKENBRIDGEROOM = 48 ENTRANCEHALLROOM = 52 +WIDEEYEDDRAGONROOM = 54 TOPWELLROOM = 55 +LIFTCONTROLROOM = 56 ALLOTMENTROOM = 58 +DAISYSHUTROOM = 73 +ACTIVEVOLCANOROOM = 77 +CASTLESTAIRCASEROOM = 84 +DAISYSPRISONROOM = 94 + +GAMESTARTROOM = CASTLEDUNGEONROOM DIZZY_WIDTH = (3*8) diff --git a/beeb/objects.asm b/beeb/objects.asm index ecb61da..626b066 100644 --- a/beeb/objects.asm +++ b/beeb/objects.asm @@ -1222,7 +1222,7 @@ dylantalking = duffmem .trytostartbreathing { ; Check if this the fire-breathing dragon - LDA roomno:CMP #54:BEQ justrandomfire + LDA roomno:CMP #WIDEEYEDDRAGONROOM:BEQ justrandomfire ; This is the dragon in the mine, so see check where golden egg is LDA goldenegghere1+room:CMP #OFFMAP:BNE done @@ -1443,7 +1443,7 @@ endif LDA roomno LDX #50 - CMP #40 ; Is this the dragon in the mine? + CMP #DRAGONSLAIRROOM ; Is this the dragon in the mine? BNE gotfirelim LDX #40 @@ -1925,7 +1925,7 @@ turnonfullbucket = movingsize+room .shopkeeperrou { ; See if we are in room 22 (market square) - LDA roomno:CMP #22:BNE done + LDA roomno:CMP #MARKETSQUAREROOM:BNE done ; If we're at 0 do nothing LDA shopkeepercount:BEQ done @@ -1934,7 +1934,7 @@ turnonfullbucket = movingsize+room SEC:SBC #&01:STA shopkeepercount:BNE done ; Make shop keeper appear in room 22 (market square) - LDA #22 + LDA #MARKETSQUAREROOM STA shopkeeperhere+room ; Left side STA shopkeeperhere1+room ; Right side @@ -2000,14 +2000,14 @@ turnonfullbucket = movingsize+room { LDA roomno - CMP #40:BNE keepgoing ; dragon's lair - LIFT 2 + CMP #DRAGONSLAIRROOM:BNE keepgoing ; dragon's lair - LIFT 2 LDA #56:BNE done -.keepgoing - CMP #56:BNE keepgoing2 ; lift control room - LIFT 4 +.keepgoing + CMP #LIFTCONTROLROOM:BNE keepgoing2 ; lift control room - LIFT 4 LDA #104:BNE done -.keepgoing2 +.keepgoing2 LDA #48 ; key1 / key3 / cloudcastle .done @@ -2440,7 +2440,7 @@ turnonfullbucket = movingsize+room ; Set up for message when in dungeon LDA #STR_getbackintheremess:JSR findroomstr - LDA roomno:CMP #36:BEQ showmessage + LDA roomno:CMP #CASTLEDUNGEONROOM:BEQ showmessage ; See if the miner has already given the message LDY #var1:LDA (zptr4), Y:BNE done @@ -2475,12 +2475,12 @@ turnonfullbucket = movingsize+room BEQ done LDA roomno - CMP #94 ; Are we in the cloud prison + CMP #DAISYSPRISONROOM ; Are we in the cloud prison BEQ roomdagok ; We are down the dagger pit in room (castle room 69) ; So put Dizzy out of the pit in room 84 - LDA #84:STA startroom + LDA #CASTLESTAIRCASEROOM:STA startroom LDA #56:STA startx LDA #176:STA starty @@ -2664,13 +2664,13 @@ turnonfullbucket = movingsize+room JSR theheartdemo ; Get back to cloud prison - LDA #94:STA roomno + LDA #DAISYSPRISONROOM:STA roomno ; Remove Daisy from prison LDA #OFFMAP:STA daisyhere+room ; Place Daisy in treehouse village - LDA #73:STA daisy1here+room + LDA #DAISYSHUTROOM:STA daisy1here+room ; Let Dizzy know that Daisy has gone LDA #STR_daisyrunsmess:JSR findroomstr diff --git a/beeb/varcode.asm b/beeb/varcode.asm index e399102..e045a19 100644 --- a/beeb/varcode.asm +++ b/beeb/varcode.asm @@ -107,7 +107,7 @@ JSR checkkeys ; resets left & right LDA #STR_killedbyvolcano:STA deathmsg ; Set death message to show - LDA roomno:CMP #77:BEQ yesfellinlava + LDA roomno:CMP #ACTIVEVOLCANOROOM:BEQ yesfellinlava LDA #STR_killedbywater:STA deathmsg ; Set death message to show .yesfellinlava ; TODO - re-enable liquid death @@ -194,7 +194,7 @@ LDA #3:STA ztmp6 ; Check if we're at the broken bridge - LDA roomno:CMP #48:BNE normalwater + LDA roomno:CMP #BROKENBRIDGEROOM:BNE normalwater LDA waterheight EOR #&FF:CLC:ADC #1+168 ; Negate then add 168 @@ -496,12 +496,12 @@ scanline_time = scanline_pal_change*us_per_scanline .checkfireout { - LDA roomno:CMP #GAMESTARTROOM:BNE done ; Make sure we are in the dungeon + LDA roomno:CMP #CASTLEDUNGEONROOM:BNE done ; Make sure we are in the dungeon LDA fireout:BNE done ; Check status of fire LDA #FIREROOM:STA roomno:JSR drawfullroom ; Draw fire - LDA #GAMESTARTROOM:STA roomno ; Reset current room to be dungeon + LDA #CASTLEDUNGEONROOM:STA roomno ; Reset current room to be dungeon .done RTS