Skip to content

Commit

Permalink
Make more use of room IDs
Browse files Browse the repository at this point in the history
  • Loading branch information
picosonic committed Nov 1, 2024
1 parent 1b047b6 commit 7340a49
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 18 deletions.
14 changes: 13 additions & 1 deletion beeb/consts.asm
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
26 changes: 13 additions & 13 deletions beeb/objects.asm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions beeb/varcode.asm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 7340a49

Please sign in to comment.