changeset 51:a9e81b2a8672

Named most remaining variables. Identified and named most remaining variables. Those that are left either have no apparent purpose or are related to the sound routines which have not yet been decoded.
author William Astle <lost@l-w.ca>
date Sat, 27 Dec 2014 16:21:57 -0700
parents 644f5e9649b2
children 47ffee6789b1
files dod.s
diffstat 1 files changed, 267 insertions(+), 249 deletions(-) [+]
line wrap: on
line diff
--- a/dod.s	Sat Dec 27 14:55:19 2014 -0700
+++ b/dod.s	Sat Dec 27 16:21:57 2014 -0700
@@ -297,35 +297,41 @@
 polyfirst	rmb 1				; for rendering images - set if this is the first vertex
 lastunscalex	rmb 2				; most recent unscaled X coordinate for rendering
 lastunscaley	rmb 2				; most recent unscaled Y coordinate for rendering
-V256		rmb 3
-V259		rmb 2
-V25B		rmb 2
-V25D		rmb 2
-V25F		rmb 2
+V256		rmb 2				; sound:
+		rmb 1				; *unused*
+V259		rmb 1				; sound:
+		rmb 1				; *unused*
+V25B		rmb 2				; sound:
+V25D		rmb 2				; sound:
+V25F		rmb 2				; sound:
 soundvol	rmb 1				; sound: volume multiplier for sound playing
-V262		rmb 1
-V263		rmb 2
-V265		rmb 6
+V262		rmb 1				; sound:
+V263		rmb 2				; sound:
+V265		rmb 2				; sound:
+		rmb 4				; *unused*
 randomseed	rmb 3				; random number generator seed value
 effectivelight	rmb 1				; effective light level in dungeon
-V26F		rmb 1
-V270		rmb 3
+effectivemlight	rmb 1				; effective magical light level in dungeon (also used for alternative light schemes)
+savedefflight	rmb 1				; effective light level saved during fainting
+		rmb 2				; *unused*
 movehalf	rmb 1				; set if rendering half step for MOVE
 movebackhalf	rmb 1				; set if rendering half step for MOVE BACK
-V275		rmb 2
+rendermagic	rmb 1				; set if rendering should use magical illumination
+		rmb 1				; *unused*
 waitnewgame	rmb 1				; set if waiting for keypress to start new game
-V278		rmb 1
-V279		rmb 2
-V27B		rmb 1
-V27C		rmb 1
-V27D		rmb 1
-V27E		rmb 3
+kwmatch		rmb 1				; for tracking if a match is found when looking up a keyword
+kwcount		rmb 1				; counter during keyword list lookup
+		rmb 1				; *unused*
+kwexact		rmb 1				; set if keyword lookup matched exactly
+temploc		rmb 2				; working coordinates during various processing steps
+genpathlen	rmb 1				; number of steps to dig during maze generation
+		rmb 2				; *unused*
 currentlevel	rmb 1				; currently playing dungeon level
-creaturecountptr rmb 2				; pointer to creature count table for the current level
-V284		rmb 2
+creaturecntptr	rmb 2				; pointer to creature count table for the current level
+		rmb 2				; *unused*
 holetabptr	rmb 2				; pointer to the hole table for this level
-V288		rmb 2
-V28A		rmb 1
+gencurcoord	rmb 2				; current coordinates when generating maze 
+curdir		rmb 1				; current direction we're processing
 renderdist	rmb 1				; distance from "camera" for rendering
 objectcount	rmb 1				; number of objects of specific type to create when initializing
 objectlevel	rmb 1				; starting level (minimum) of object being created
@@ -335,68 +341,79 @@
 objiterstart	rmb 1				; for iterating over object list, zero means start, nonzero means underway
 objiterptr	rmb 2				; current pointer during object list iteration
 showseer	rmb 1				; nonzero means to show creatures when displaying a scroll
-V295		rmb 1				; 10Hz timer counter
-		rmb 1				; 1Hz timer counter
-V297		rmb 1				; 1 min timer counter
-		rmb 1				; 1 hour timer counter
-		rmb 1				; 1 day timer counter
-V29A		rmb 1
+clockctrs	rmb 1				; 60Hz tick (triggers 10 times per second)
+		rmb 1				; 10Hz tick (triggers once per second)
+		rmb 1				; 1Hz tick (triggers once per minute)
+		rmb 1				; 1 minute tick (triggers once per hour)
+		rmb 1				; 1 hour tick (triggers once per day)
+		rmb 1				; 1 day tick (overflows once every 256 days)
 disablesched	rmb 1				; set to nonzero to disable timer handling
-V29C		rmb 1
-V29D		rmb 1
-V29E		rmb 1
-V29F		rmb 2
-V2A1		rmb 2				; 60Hz tick event list
+dofadesound	rmb 1				; nonzero if we're doing the fade sound effect thing
+fadesoundval	rmb 1				; the DAC value to use for the fade sound (complemented every tick)
+enablefadesound	rmb 1				; nonzero means fading will be done with the sound effect
+schedlists	rmb 2				; notional "not active" queue?
+		rmb 2				; 60Hz tick event list
 		rmb 2				; 10Hz tick event list
 		rmb 2				; 1Hz tick event list
 		rmb 2				; 1 minute tick event list
 		rmb 2				; 1 hour tick event list
-V2AB		rmb 2				; the "ready" list (also 1 day tick event list)
-V2AD		rmb 1				; nonzero will cause the command processor to clear and reset on input
-V2AE		rmb 1
-V2AF		rmb 1
-V2B0		rmb 1
-V2B1		rmb 1
+		rmb 2				; the "ready" list (also 1 day tick event list)
+hidestatus	rmb 1				; nonzero will cause the command processor to clear and reset on input (status line hidden)
+heartctr	rmb 1				; number of ticks until next heart beat
+heartticks	rmb 1				; number of ticks between heart beat
+heartstate	rmb 1				; zero = contracted heart, ff = expanded heart
+enableheart	rmb 1				; nonzero means heartbeat is running
 displayptr	rmb 2				; pointer to routine to display the main dungeon area
 pageswap	rmb 1				; nonzero means we're ready to swap graphics screens during IRQ
-V2B5		rmb 1
-V2B6		rmb 1
-V2B7		rmb 1				; nonzero means nonstandard text location
-V2B8		rmb 1				; load/save flag - <0 = ZLOAD, >0 = ZSAVE, 0 = regular init
-V2B9		rmb 2
-V2BB		rmb 1
+dungeonchg	rmb 1				; nonzero if the dungeon display should be updated
+columnctr	rmb 1				; column counter/tracker for displaying inventory list
+textother	rmb 1				; nonzero means nonstandard text location
+loadsaveflag	rmb 1				; load/save flag - <0 = ZLOAD, >0 = ZSAVE, 0 = regular init
+schedtabfree	rmb 2				; pointer to next free entry in the scheduling table
+readylistchg	rmb 1				; nonzero if the ready list processing should be restarted
 keybufread	rmb 1				; keyboard buffer read offset
 keybufwrite	rmb 1				; keyboard buffer write offset
-		rmb 3
+		rmb 3				; *unused*
 accum0		rmb 3				; temporary 24 bit accumulator
 accum1		rmb 3				; temporary 24 bit accumulator
 accum2		rmb 1				; temporary 8 bit accumulator
-		rmb 9
+		rmb 9				; *unused*
 keybuf		rmb 32				; keyboard ring buffer
 linebuff	rmb 32				; line input buffer
 linebuffend	equ *				; end of line input buffer		
-		rmb 2
+		rmb 2				; *unused*
 wordbuff	rmb 32				; buffer used for parsing words from the line
 wordbuffend	equ *				; end of word buffer		
-		rmb 2
+		rmb 2				; *unused*
 stringbuf	rmb 34				; temporary buffer used for decoding immediate packed strings
 fontbuf		rmb 10				; temporary buffer used for decoding font data
-V361		rmb 31
-V380		rmb 2				; screen start address of info text area
-V382		rmb 2				; number of character cells in info text area
-V384		rmb 2				; current cursor position in info text area
-V386		rmb 1				; background colour mask for info text area
-V387		rmb 1				; nonzero if info text area should not be rendered on secondary screen
-V388		rmb 2				; screen start address of status line area
-V38A		rmb 2				; number of character cells in status line area
-V38C		rmb 2				; cursor position in status line area
-V38E		rmb 1				; background colour mask for status line area
-V38F		rmb 1				; nonzero if status line text should not be rendered on secondary screen
-V390		rmb 2				; start offset of the command entry area
-V392		rmb 2				; numer of character cells in command entry area
-V394		rmb 2				; current cursor position in entry area
-V396		rmb 1				; background colour mask of background area
-V397		rmb 1				; nonzero if main text should not be rendered on secondary screen
+cmddecodebuff	rmb 31				; buffer used for decoding commands
+; These are descriptors used for controlling the rendering engine. Each one is 8 bytes long and is defined as follows:
+; 0-1	start address of text area (memory)
+; 2-3	number of character cells in text area
+; 4-5	current cursor position within text area
+; 6	background colour mask for the text area
+; 7	whether to render text on the secondary screen
+;
+; There are three text areas:
+; infoarea	this is text rendered in the main dungeon display area
+; statusarea	this is text rendered on the status line
+; commandarea	this is text rendered in the command area
+infoarea	rmb 2				; screen start address of info text area
+		rmb 2				; number of character cells in info text area
+		rmb 2				; current cursor position in info text area
+		rmb 1				; background colour mask for info text area
+		rmb 1				; nonzero if info text area should not be rendered on secondary screen
+statusarea	rmb 2				; screen start address of status line area
+		rmb 2				; number of character cells in status line area
+		rmb 2				; cursor position in status line area
+		rmb 1				; background colour mask for status line area
+		rmb 1				; nonzero if status line text should not be rendered on secondary screen
+commandarea	rmb 2				; start offset of the command entry area
+		rmb 2				; numer of character cells in command entry area
+		rmb 2				; current cursor position in entry area
+		rmb 1				; background colour mask of background area
+		rmb 1				; nonzero if main text should not be rendered on secondary screen
 creaturecounts	rmb 12				; creature counts for level 1
 		rmb 12				; creature counts for level 2
 		rmb 12				; creature counts for level 3
@@ -451,17 +468,17 @@
 		rts				; return to caller
 LC053		pshs cc,a,b,x,y,u		; save registers and interrupt status
 		orcc #$10			; disable IRQ
-		ldx #V29F			; point to start of variables to clear for level creation
+		ldx #schedlists			; point to start of variables to clear for level creation
 LC05A		clr ,x+				; clear a byte
-		cmpx #V2AD			; are we finished clearing things?
+		cmpx #hidestatus			; are we finished clearing things?
 		blo LC05A			; brif not
-		ldx #schedtab			; start of the sceduling list
-		stx V2B9			; mark that as the end of it
+		ldx #schedtab			; start of the scheduling list
+		stx schedtabfree		; mark that as the end of it
 LC066		clr ,x+				; clear more data
 		cmpx #emptyhand			; end of area to clear?
 		blo LC066			; brif not
 		ldy #LD7DC			; point to list of entries to schedule
-		dec V2BB
+		dec readylistchg		; mark ready list as modified
 		ldd #12				; set tick count to 0 and list to "ready" list
 LC076		ldx ,y++			; get routine address
 		beq LC084			; brif end of list
@@ -493,8 +510,8 @@
 		inca				; move to next object type
 		cmpu #LDA91+18			; end of table?
 		blo LC08C			; brif not - go to next entry
-		ldu #V388			; point to text parameters for status area
-		dec V2B7			; indicate nonstandard text area
+		ldu #statusarea			; point to text parameters for status area
+		dec textother			; indicate nonstandard text area
 		clearstatus			; blank status line (where we'll put the copyright notice)
 		renderstrimmp			; display copyright message
 		fcb $f8,$df,$0c,$c9		; packed string "COPYRIGHT  DYNA MICRO  MCMLXXXII"
@@ -503,12 +520,12 @@
 		fcb $39,$3c,$00,$68
 		fcb $da,$cc,$63,$09
 		fcb $48
-		clr V2B7			; reset text rendering to standard mode
+		clr textother			; reset text rendering to standard mode
 		rts				; transfer control to correct game loop
 dodemo		dec waitnewgame			; flag demo game
 		bsr enablepiairq		; set up interrupts and sound
 		ldx #img_wizard			; point to wizard image
-		dec V29E
+		dec enablefadesound		; enable fade sound effect
 		fadein				; fade the wizard in
 		renderstrimmp			; display <CR>"I DARE YE ENTER..."<CR>
 		fcb $9f,$d2,$02,$06		; packed "\rI DARE YE ENTER...\r" string
@@ -626,13 +643,13 @@
 		bpl LC1E4			; brif it was still a data block
 		lds #STACK			; reset stack pointer
 LC1EC		jsr enablepiairq		; make sure PIAs are set right
-		clr V2B8			; flag regular operations
+		clr loadsaveflag		; flag regular operations
 		resetdisplay			; clear command and status areas, update appropriately
 		showprompt			; show command prompt
-LC1F5		ldu #V2AB			; point to ready list head
-		clr V2BB			; mark ready list restart not needed
+LC1F5		ldu #schedlists+12		; point to ready list head
+		clr readylistchg		; mark ready list restart not needed
 LC1FA		tfr u,y				; save ready list pointer
-LC1FC		tst V2B8			; are we loading or saving?
+LC1FC		tst loadsaveflag		; are we loading or saving?
 		bgt LC192			; brif saving
 		bmi LC1C1			; brif loading
 		ldu ,u				; are we at the end of the ready list?
@@ -640,7 +657,7 @@
 		pshs y,u			; save registers
 		jsr [3,u]			; call the registered routine
 		puls y,u			; restore registers
-		tst V2BB			; do we need to restart the ready list processing?
+		tst readylistchg		; do we need to restart the ready list processing?
 		bne LC1F5			; brif so
 		cmpb #12			; are we leaving the routine in the ready list?
 		beq LC1FA			; brif so - check next entry
@@ -651,7 +668,7 @@
 LC21D		pshs cc,a,b,x			; save flags and registers
 		orcc #$10			; disable IRQ
 		sta 2,u				; reset tick count
-		ldx #V29F			; pointer to routine base
+		ldx #schedlists			; pointer to routine base
 		abx				; add offset
 		clra				; NULL pointer
 		clrb
@@ -681,9 +698,9 @@
 		bra LC248			; go process next timer record
 LC25A		puls b,x,y,u,pc			; restore registers and return
 LC25C		pshs x				; save registers
-		ldu V2B9			; get open slot for scheduling
+		ldu schedtabfree		; get open slot for scheduling
 		leax 7,u			; point to next open slot
-		stx V2B9			; save new open slot for scheduling
+		stx schedtabfree		; save new open slot for scheduling
 		puls x,pc			; restore registers and return
 ; Set the SAM video mode and display offset register to the value in D. Starting at the lsb of
 ; D, the SAM bits are programmed from FFC0 upward. This sets bits 9-0 of the SAM register
@@ -715,43 +732,43 @@
 		ldd 4,u				; get the SAM value for the new screen
 		bsr setSAM			; go program the SAM
 		clr pageswap			; flag no swap needed
-LC29D		tst V29C
-		beq LC2A9
-		com V29D
-		lda V29D
-		lsla
-		lsla
-		sta ,x
-LC2A9		tst V2B1
-		beq LC2DC
-		dec V2AE
-		bne LC2DC
-		lda V2AF
-		sta V2AE
-		ldb 2,x
-		eorb #2
-		stb 2,x
-		tst V2AD
-		beq LC2DC
-		ldu #V388
-		ldx 4,u
-		ldd #15
-		std 4,u
-		lda #$20
-		com V2B0
-		beq LC2D1
-		lda #$22
-LC2D1		jsr LCA17
-		inc 5,u
-		inca
-		jsr LCA17
-		stx 4,u
-LC2DC		ldu #V2A1			; point to timer lists
+LC29D		tst dofadesound			; are we doing the "fade buzz" thing?
+		beq LC2A9			; brif not
+		com fadesoundval		; invert the bits of of the value
+		lda fadesoundval		; fetch new value
+		lsla				;* align to DAC bits
+		lsla				;*
+		sta ,x				; set DAC output
+LC2A9		tst enableheart			; is the heart beating?
+		beq LC2DC			; brif not
+		dec heartctr			; count down ticks till beat
+		bne LC2DC			; brif not expired
+		lda heartticks			; fetch ticks till next beat
+		sta heartctr			; reset counter
+		ldb 2,x				; fetch single bit sound register
+		eorb #2				; invert single bit sound output
+		stb 2,x				; set new sound output
+		tst hidestatus			; is the status line shown?
+		beq LC2DC			; brif not - don't update heart
+		ldu #statusarea			; point to status line text area descriptor
+		ldx 4,u				; fetch current text position
+		ldd #15				; position for centring heart
+		std 4,u				; save output position
+		lda #$20			; code for contracted heart (left)
+		com heartstate			; invert heart state
+		beq LC2D1			; brif contracted
+		lda #$22			; code for expanded heart (left)
+LC2D1		jsr LCA17			; render left half of heart
+		inc 5,u				; bump character position
+		inca				; code for right half of heart
+		jsr LCA17			; render right half of heart
+		stx 4,u				; save original text position
+LC2DC		ldu #schedlists+2		; point to timer lists
 		jsr LC242			; check if any records expired at 60Hz
-		ldx #V295			; point to timer records
+		ldx #clockctrs			; point to timer records
 		ldy #LC324			; point to timer max values
 LC2E9		inc ,x				; bump timer value
-		cmpx #V29A			; end of timer record?
+		cmpx #clockctrs+5		; end of timer record?
 		beq LC2FF			; brif so
 		lda ,x				; fetch new value
 		cmpa ,y+			; has timer maxed out?
@@ -837,12 +854,13 @@
 		stx 4,s				;*
 		rti				; return to caller
 ; SWI 0 routine
-; Calculate base light level in dungeon.
+; Calculate base light level in dungeon. Note that "magic lighting" is also used for simulating
+; the fadeout and fade in during fainting.
 LC384		lda effectivelight		; fetch effective light level in dungeon
-		tst V275			; are we checking for special lighting conditions?
+		tst rendermagic			; are we checking for special lighting conditions?
 		beq LC38E			; brif not
-		lda V26F			; get "passed out" fade state
-		clr V275			; undo special light level checking
+		lda effectivemlight		; get magical light level
+		clr rendermagic			; undo special light level checking
 LC38E		clrb				; default to full bright
 		suba #7				; adjust level based on the order of the table used
 		suba renderdist			; subtract render distance from light level
@@ -998,9 +1016,9 @@
 		rts				; return to caller
 ; swi 4 routine
 ; display character in A
-LC459		tst V2B7			; are we looking for standard text mode?
+LC459		tst textother			; are we looking for standard text mode?
 		bne LC460			; brif not
-		ldu #V390			; point to display state information
+		ldu #commandarea		; point to display state information
 LC460		ldx 4,u				; fetch current screen location
 		jsr LC9B2			; actually display the appropriate character
 		cmpx 2,u			; are we at the end of text area?
@@ -1108,11 +1126,11 @@
 		stu 10,s			; save pointer to parameter block for the caller
 		rts				; return to caller
 ; swi 10 routine - clear the status line
-LC4FF		ldx #V388			; point to text area parameters for the status line
+LC4FF		ldx #statusarea			; point to text area parameters for the status line
 		ldu #LD87C			; point to screen address table for the status line
 		bra LC50D			; go clear the status line
 ; swi 11 routine - clear the command entry area
-LC507		ldx #V390			; point to text area parameters for the command area
+LC507		ldx #commandarea		; point to text area parameters for the command area
 		ldu #LD888			; point to screen address table for the command area
 LC50D		clr 4,x				;* set current cursor to start of text area
 		clr 5,x				;*
@@ -1163,15 +1181,15 @@
 		bcc LC554			; brif no carry from addition - we haven't got a result yet
 		lda accum2			; get division result
 		suba #19			; subtract 19
-		sta V2AF			; save number of ticks before redoing the calculation
+		sta heartticks			; save number of ticks before redoing the calculation and also how fast heart beats
 		tst nokeyboard			; are we blocking the keyboard?
 		bne LC595			; brif so
 		cmpa #3				; is number of ticks > 3?
 		bgt LC5AE			; brif so
 		clearcommand			; clear the command area
 		lda effectivelight		; fetch the effective light level
-		sta V270			; save it
-LC578		dec V26F			; mark us as passed out
+		sta savedefflight		; save it
+LC578		dec effectivemlight		; mark us as passed out
 		jsr [displayptr]		; update the main display area
 		dec pageswap			; set graphics swap required
 		sync				; wait for swap to happen
@@ -1190,10 +1208,10 @@
 LC599		jsr [displayptr]		; update the main display area
 		dec pageswap			; set graphics swap required
 		sync				; wait for swap to happen
-		inc V26F			; mark as not passed out
+		inc effectivemlight		; mark as not passed out
 		inc effectivelight		; bump effective light level
 		lda effectivelight		; fetch new light level
-		cmpa V270			; are we at old intensity?
+		cmpa savedefflight		; are we at old intensity?
 		ble LC599			; brif not
 		clr nokeyboard			; re-enable keyboard
 		showprompt			; show the prompt
@@ -1203,7 +1221,7 @@
 		rts				; returnt o caller
 ; This routine handles player death
 LC5B5		ldx #img_wizard			; point to wizard image
-		dec V29E
+		dec enablefadesound		; neable fade sound effect
 		fadeinclrst			; fade in the wizard
 		renderstrimmp			; display "YET ANOTHER DOES NOT RETURN..."
 		fcb $ff,$c1,$92,$d0		; packed "YET ANOTHER DOES NOT RETURN..." string
@@ -1216,8 +1234,8 @@
 		dec waitnewgame			; set up to wait for keypress to start new game
 LC5D7		bra LC5D7			; wait forever (or until the IRQ does something)
 ; swi 13 routine
-LC5D9		ldu #V388			; point to parameters for status line
-		dec V2B7			; set to nonstandard text area
+LC5D9		ldu #statusarea			; point to parameters for status line
+		dec textother			; set to nonstandard text area
 		lda levbgmask			; get current level background
 		coma				; invert it for status line
 		sta 6,u				; set up for displaying status line
@@ -1239,7 +1257,7 @@
 		bpl LC5FD			; brif not - keep moving left
 		std 4,u				; save render position
 		renderstr			; display the right hand object
-		clr V2B7			; reset to standard text rendering
+		clr textother			; reset to standard text rendering
 		rts
 LC609		pshs a,b			; save registers
 		std 4,u				; save the start position
@@ -1331,23 +1349,23 @@
 		rts
 ; swi 19 routine
 ; fade in the image specified by (X) with sound effects, clear status line and command area
-LC6A4		clr V2B1
+LC6A4		clr enableheart			; disable heartbeat
 		clearstatus			; clear the status area
 ; swi 20 routine
 ; fade in the image specified by (X) with sound effects, clear command area
 LC6A8		clearcommand			; clear the command area
 		ldd #$8080			;* set X and Y scale values to 1.0
 		std horizscale			;*
-		ldb V29E
-		beq LC6B7
+		ldb enablefadesound		; are we doing sound effects on the fade?
+		beq LC6B7			; brif not
 		ldb #$20			; set apparent lighting to 32 (less apparent)
-		dec V29C
+		dec dofadesound			; enable fade sound effect
 LC6B7		bsr LC6D7			; go draw the image
 		decb				;* reduce lighting count - make more apparent
 		decb				;*
 		bpl LC6B7			; brif not done 16 steps
-		clr V29C
-		clr V29E
+		clr dofadesound			; disable fade sound effect
+		clr enablefadesound		; turn off fade sound effect
 LC6C1		playsoundimm $16		; play sound effect
 		rts				; return to caller
 ; swi 21 routine
@@ -1355,17 +1373,17 @@
 LC6C5		clearcommand			; clear the command entry area
 		bsr LC6C1
 		clrb				; set apparent illumination to fully lit			
-		dec V29C
+		dec dofadesound			; enable the fade buzz sound effect
 LC6CC		bsr LC6D7			; go draw the image
 		incb				;* bump lighting count (make less apparent)
 		incb				;*
 		cmpb #$20			; have we done 16 steps?
 		bne LC6CC			; brif not
-		clr V29C
+		clr dofadesound			; disable the fade buzz sound effect
 		rts				; return to caller
 LC6D7		pshs x,u			; save registers
 		stb lightlevel			; set illumination value for graphic rendering
-		stb V29D
+		stb fadesoundval		; save intensity for the fade sound
 		cleargfx2			; clear second graphics screen
 		drawgraphic			; go draw graphic
 		dec pageswap			; flag graphics swap required
@@ -1378,7 +1396,7 @@
 		renderstrimmp			; display the PREPARE! message
 		fcb $3c,$24,$58,$06		; packed string "PREPARE!"
 		fcb $45,$d8
-		clr V2B7			; reset to standard text rendering
+		clr textother			; reset to standard text rendering
 		dec pageswap			; set graphic swap required
 		rts				; return to caller
 ; swi 23 routine
@@ -1427,9 +1445,9 @@
 LC743		clearstatus			; clear the status line
 		clearcommand			; clear the command area
 		checkdamage			; update damage information
-		inc V2AE
-		dec V2AD			; set command processing to proceed normally
-		dec V2B1
+		inc heartctr			; bump count until next heart beat
+		dec hidestatus			; set command processing to proceed normally
+		dec enableheart			; enable heartbeat
 		updatestatus			; update status line to current information
 cmd_look	ldx #LCE66			; standard dungeon view routine
 		stx displayptr			; restore display to standard dungeon view
@@ -1440,7 +1458,7 @@
 		ldb #12				; number of entries in creature count table
 		mul				; calculate offset to creature counts for this level
 		addd #creaturecounts		; point to correct creature count table for this level
-		std creaturecountptr		; save pointer to creature count table
+		std creaturecntptr		; save pointer to creature count table
 		ldb currentlevel		; get back current level number
 		ldx #holetab			; point to hole/ladder table
 LC768		stx holetabptr			; save hole/ladder data pointer
@@ -1453,7 +1471,7 @@
 		clearblock			; go clear area to zeros
 		jsr LC053			; initialize data for new level
 		jsr createmaze			; create the maze
-		ldu creaturecountptr		; point to creature counts for this level
+		ldu creaturecntptr		; point to creature counts for this level
 		lda #11				; offset for wizard
 LC783		ldb a,u				; get number of creatures required
 		beq LC78D			; brif none
@@ -1482,10 +1500,10 @@
 		anda #1				; set to "1" for odd, "0" for even
 		nega				; negate - set to 00 for even, ff for odd
 		sta levbgmask			; set level background mask
-		sta V396			; set background mask for command area
-		sta V386			; set background mask for text area
+		sta commandarea+6		; set background mask for command area
+		sta infoarea+6			; set background mask for text area
 		coma				; invert mask
-		sta V38E			; set background mask for status line
+		sta statusarea+6		; set background mask for status line
 		rts				; return to caller
 ; swi 27 routine
 ; play a sound specified by the immediate identifier
@@ -1810,7 +1828,7 @@
 ; the scrollable area of the screen. At offset 4 is the current printing position. At offset 6 is a mask with
 ; all pixels set to the background colour. At offset 7 a flag which when nonzero inhibits rendering text to
 ; the secondary graphics screen area. For the ordinary command entry area at the bottom of the screen, this
-; will point to V390.
+; will point to commandarea.
 LC9B2		cmpa #$24			; is it backspace?	
 		beq LC9BF			; brif so
 		cmpa #$1f			; vertical spacer?
@@ -2125,10 +2143,10 @@
 		clrb				; initialize generic type to zero
 		bsr LCB96			; parse a word from the input line
 		bmi LCC2D			; brif no word present
-LCBF4		clr V278			; flag no match
-		clr V27B			; 
+LCBF4		clr kwmatch			; flag no match
+		clr kwexact			; flag incomplete match
 		ldb ,x+				; fetch number of keywords in list
-		stb V279			; save it in temp counter
+		stb kwcount			; save it in temp counter
 LCBFC		ldu #wordbuff			; point to decode buffer
 		decodestrsb			; decode the keyword string
 		ldy #stringbuf+1		; point to decoded keyword string (past the object code)
@@ -2140,16 +2158,16 @@
 		bpl LCC05			; brif not
 		tst ,u				; are we at the end of the word?
 		bpl LCC22			; brif not
-LCC15		dec V27B
-LCC17		tst V278			; do we already have a match?
+LCC15		dec kwexact			; flag complete match
+LCC17		tst kwmatch			; do we already have a match?
 		bne LCC2B			; brif so
-		inc V278			; mark match found
+		inc kwmatch			; mark match found
 		ldb stringbuf			; get the keyword code
 		std ,s				; save keyword number and object code
 LCC22		inca				; bump keyword count
-		dec V279			; have we reached the end of the list?
+		dec kwcount			; have we reached the end of the list?
 		bne LCBFC			; brif not - check another keyword
-		tst V278			; do we have a match?
+		tst kwmatch			; do we have a match?
 		bne LCC2F			; brif so
 LCC2B		ldd allones			; flag error (-1)
 LCC2D		std ,s				; save result
@@ -2224,24 +2242,24 @@
 		sta randomseed+2		; set random seed
 		ldy #500			; dig out 500 rooms
 		jsr LCC71			; fetch a random starting point
-		std V27C			; save starting pointer
+		std temploc			; save starting pointer
 LCCBB		getrandom			; get random number
 		anda #3				; select only 4 directions
-		sta V28A			; save direction we're going
+		sta curdir			; save direction we're going
 		getrandom			; get random number
 		anda #7				; convert to value from 1-8
 		inca
-		sta V27E			; save number of steps to dig out
+		sta genpathlen			; save number of steps to dig out
 		bra LCCD2			; go dig the tunnel
-LCCCA		ldd V288			; get current coordinate
-		std V27C			; save it as starting position
-		dec V27E			; have we gone far enough?
+LCCCA		ldd gencurcoord			; get current coordinate
+		std temploc			; save it as starting position
+		dec genpathlen			; have we gone far enough?
 		beq LCCBB			; brif so - select a new direction
-LCCD2		ldd V27C			; fetch maze coordinates
+LCCD2		ldd temploc			; fetch maze coordinates
 		jsr LD11B			; apply direction to coordinates
 		bsr LCC8E			; did we fall off the side of the map?
 		bne LCCBB			; brif so - select a new direction
-		std V288			; save new coordinate
+		std gencurcoord			; save new coordinate
 		tst ,x				; is this room open?
 		beq LCCCA			; brif so - move to next
 		ldu #neighbourbuff		; point to temporary storage area
@@ -2265,14 +2283,14 @@
 		clr ,x				; mark this room open
 		leay -1,y			; have we dug out enough rooms?
 		bne LCCCA			; brif not - keep digging
-		clr V27C			; set coordinates to top left
-		clr V27D
-LCD11		ldd V27C			; get current coordinates
+		clr temploc			; set coordinates to top left
+		clr temploc+1
+LCD11		ldd temploc			; get current coordinates
 		jsr LCC7B			; convert to pointer
 		lda ,x				; get room data
 		inca				; is ot open?
 		beq LCD41			; brif not
-		ldd V27C			; get coordinates
+		ldd temploc			; get coordinates
 		ldu #neighbourbuff		; point to temp area
 		jsr LCC49			; calculate neighbors
 		lda ,x				; get room data at current room
@@ -2291,12 +2309,12 @@
 		ora #$30			; flag as no exit S
 LCD3F		sta ,x				; save adjusted room data
 LCD41		ldb #32				; 32 rooms per row
-		inc V27D			; bump X coordinate
-		cmpb V27D			; did we wrap?
+		inc temploc+1			; bump X coordinate
+		cmpb temploc+1			; did we wrap?
 		bne LCD11			; brif not
-		clr V27D			; reset to left edge
-		inc V27C			; bump Y coordinate
-		cmpb V27C			; did we wrap?
+		clr temploc+1			; reset to left edge
+		inc temploc			; bump Y coordinate
+		cmpb temploc			; did we wrap?
 		bne LCD11			; brif not - fix another room's exits
 		ldb #70				; create 70 doors
 		ldu #doormasks			; pointer to routine to make a normal door
@@ -2308,7 +2326,7 @@
 LCD60		bsr LCD6D			; go create a door
 		decb				; done yet?
 		bne LCD60			; brif not
-		ldb V297			; get number of times to spin the random number generator (cycles once/minute)
+		ldb clockctrs+2			; get number of times to spin the random number generator (cycles once/minute)
 LCD67		getrandom			; fetch a random number
 		decb				; have we done enough randoms?
 		bne LCD67			; brif not, do another
@@ -2316,20 +2334,20 @@
 LCD6D		pshs a,b,x,y,u			; save registers
 		ldy #dirmasks			; point to direction masks
 LCD73		jsr LCC71			; get a random location
-		std V288			; save coordinates
+		std gencurcoord			; save coordinates
 		ldb ,x				; get room data at location
 		cmpb #$ff			; is there a room?
 		beq LCD73			; brif not - try again
 		getrandom			; get random number
 		anda #3				; normalize to direction
-		sta V28A			; save direction
+		sta curdir			; save direction
 		bitb a,y			; is there a door or wall at that direction?
 		bne LCD73			; brif so - try again
 		orb a,u				; mark the direction as having a door of desired type
 		stb ,x				; save new room data
-		ldd V288			; get back coordinates
+		ldd gencurcoord			; get back coordinates
 		jsr LD11B			; get pointer to neighbor
-		ldb V28A			; get direction back
+		ldb curdir			; get direction back
 		addb #2				; calculate opposite direction
 		andb #3
 		lda ,x				; get data at neighboring room
@@ -2352,11 +2370,11 @@
 ; If showseer is set to nonzero, it displays creature and object information (SEER SCROLL)
 ; otherwise it shows only the maze, holes, and player location (VISION SCROLL).
 ;
-; V27C is used as a temporary scratch counter for displaying the maze itself.
+; temploc is used as a temporary scratch counter for displaying the maze itself.
 displayscroll	ldu screendraw			; point to screen we're using to draw on
 		ldd #$1f1f			; maximum X and Y coordinates
-		std V27C			; save coordinates
-LCDB9		ldd V27C			; fetch current coordinates
+		std temploc			; save coordinates
+LCDB9		ldd temploc			; fetch current coordinates
 		bsr LCE11			; calculate absolute pointer to screen location
 		jsr LCC7B			; fetch pointer to room data
 		clrb				; initialize to black
@@ -2369,11 +2387,11 @@
 		leay $20,y			; move to next row
 		deca				; done all rows?
 		bne LCDC9			; brif not
-		dec V27D			; move left one space
+		dec temploc+1			; move left one space
 		bpl LCDB9			; brif not at left yet
 		lda #$1f			; max right coord
-		sta V27D			; reset X coordinate to far right
-		dec V27C			; move back a row
+		sta temploc+1			; reset X coordinate to far right
+		dec temploc			; move back a row
 		bpl LCDB9			; brif still in map
 		tst showseer			; are we showing creatures and objects?
 		beq LCE2B			; brif not
@@ -2440,9 +2458,9 @@
 LCE66		cleargfx2			; clear the graphics area
 		clr renderdist			; set render distance to immediate
 		ldd playerloc			; get player location
-		std V27C			; save current render location
+		std temploc			; save current render location
 LCE6E		bsr LCE47			; calculate scaling factor for current render location
-		ldd V27C			; fetch render location
+		ldd temploc			; fetch render location
 		jsr LCC7B			; get maze pointer
 		lda ,x				; get maze data for current location
 		ldu #neighbourbuff		; point to neighbor calculation buffer
@@ -2466,7 +2484,7 @@
 		cmpb #4				; is it a magic door?
 		bne LCEA9			; brif not
 		ldx b,y				; fetch graphic pointer
-		dec V275			; flag to render to magic light
+		dec rendermagic			; flag to render to magic light
 		bsr LCECE			; go draw the magic door
 		ldb #6				; change type to wall (invisible magic door)
 LCEA9		ldx b,y				; get graphic
@@ -2478,21 +2496,21 @@
 		tst b,u				; is there a door in that direction?
 		bne LCEB1			; brif so
 		addb facing			; calculate real direction
-		stb V28A			; save real direction
-		ldd V27C			; fetch render location
+		stb curdir			; save real direction
+		ldd temploc			; fetch render location
 		jsr LD11B			; get new coordinates and room pointer
 		jsr LCF82			; get creature in room
 		beq LCEB1			; brif no creature in room
 		exg x,y				; save creature pointer in Y, get original graphic pointer back
 LCEC8		tst 2,y				; is creature magical?
 		beq LCECE			; brif not - use physical ight
-		dec V275			; render magic light
+		dec rendermagic			; render magic light
 LCECE		pshs u				; save registers
 		setlighting			; set light level
 		ldu screendraw			; point to drawing screen
 		drawgraphic			; draw the selected graphic
 		puls u,pc			; restore registers and return
-LCED8		ldd V27C			; get render location
+LCED8		ldd temploc			; get render location
 		jsr LCF82			; get creature in room
 		beq LCEEB			; brif no creature
 		tfr x,y				; save creature pointer
@@ -2508,7 +2526,7 @@
 		ldx #LDCB9			; point to graphic
 		bsr LCEB2			; go render graphic if there's a door
 		ldx #LDD3C			; point to graphic
-		ldd V27C			; get current location
+		ldd temploc			; get current location
 		jsr LCFE1			; get hole information
 		bmi LCF09			; brif no hole
 		ldx #LDCC2			; point to graphic table for holes
@@ -2516,24 +2534,24 @@
 		ldx a,x				; get actual graphic for the hole present
 LCF09		bsr LCECE			; go render the graphic
 		clr objiterstart		; reset object iterator
-LCF0D		ldd V27C			; get current room
+LCF0D		ldd temploc			; get current room
 		jsr LCF53			; fetch next object on floor
 		beq LCF24			; brif no more objects
 		lda 10,x			; get object type
 		lsla				; double it - two bytes per pointer entry
 		ldx #LD9EE			; point to object images
 		ldx a,x				; get correct graphic image
-		dec V275
-		bsr LCECE			; render object
-		bsr LCECE			; render the object
+		dec rendermagic			; set to render magic light
+		bsr LCECE			; render object in magic light (why??)
+		bsr LCECE			; render object in physical light
 		bra LCF0D			; go handle another object in the room
 LCF24		tst ,u				; any door looking forward?
 		bne LCF3D			; brif so
 		lda facing			; get direction facing
-		sta V28A			; save direction going
-		ldd V27C			; get current direction
+		sta curdir			; save direction going
+		ldd temploc			; get current direction
 		jsr LD11B			; get pointer in that direction
-		std V27C			; save new location
+		std temploc			; save new location
 		inc renderdist			; bump render distance (next room going forward)
 		lda renderdist			; get distance
 		cmpa #9				; is it 9 steps out?
@@ -2654,7 +2672,7 @@
 ;
 ; It's worth noting that this can ONLY affect levels 1, 2, and 3 because there is no way to return
 ; to levels 4 (no holes up from 5) which means  level 5 can only be entered once.
-LD027		ldx creaturecountptr		; point to creature counts for this level
+LD027		ldx creaturecntptr		; point to creature counts for this level
 		ldb #11				; maximum creature number
 		clra				; initialize count
 LD02C		adda b,x			; add the number of this creature
@@ -2736,13 +2754,13 @@
 		suba playerloc			; calculate difference to player
 		bmi LD0D0			; brif player is south
 		clrb				; set north
-LD0D0		stb V28A			; save direction
+LD0D0		stb curdir			; save direction
 		ldd 15,y			; get creature location
 LD0D4		bsr LD136			; calculate new coordinates
 		bne LD0E4			; brif not a room
 		cmpd playerloc			; is the new room the player's place?
 		bne LD0D4			; brif not
-		ldb V28A			; get direction to move
+		ldb curdir			; get direction to move
 		stb 14,y			; set last movement direction to player direction
 		clrb				; select a last ditch direction
 		bra LD101			; go try the movement and continue
@@ -2767,13 +2785,13 @@
 		cmpx playerloc			; does it match the player?
 		bne LD111			; brif not - use movement rate
 		updatedungeon			; update the dungeon display immediately
-		clr V2B5			; mark dungeon update not required
+		clr dungeonchg			; mark dungeon update not required
 LD10F		lda 7,y				; get attack tick rate
 LD111		ldb #4				; and schedule for the 10Hz timer
 		rts				; return to caller
 LD114		fcb $00,$03,$01,$00,$01,$03,$00	; direction rotations for movement choices
 LD11B		pshs a,b			; save coordinates
-		ldb V28A			; get direction to move
+		ldb curdir			; get direction to move
 		andb #3				; force it to 0-3
 		lslb				; two bytes per direction adjuster
 		ldx #LD12E			; point to direction adjusters
@@ -2801,14 +2819,14 @@
 LD14F		pshs a,b,x			; save registers
 		addb 14,y			; add selected rotation to current movement direction
 		andb #3				; normalize to 0-3
-		stb V28A			; save new direction
+		stb curdir			; save new direction
 		ldd 15,y			; get creature location
 		bsr LD136			; calculate new coordinates
 		bne LD199			; brif no room there
 		jsr LCF82			; get creature in room
 		bne LD199			; brif there's a creature there - can't go
 		std 15,y			; save new creature location
-		ldb V28A			; get direction
+		ldb curdir			; get direction
 		stb 14,y			; save as last moved direction
 		ldd 15,y			; get new location
 		suba playerloc			; get distance from player (Y)
@@ -2835,7 +2853,7 @@
 		comb				; invert it so closer is louder
 		lda 13,y			; get creature number
 		playsound			; go make the creature's sound
-LD196		dec V2B5			; mark dungeon update required
+LD196		dec dungeonchg			; mark dungeon update required
 LD198		clra				; set Z for movement happened
 LD199		puls a,b,x,pc			; restore registers and return
 ; This is the routine that ticks down the torch.
@@ -2856,18 +2874,18 @@
 LD1B6		cmpa 8,u			; is time remaining less than magical light strength?
 		bge LD1BC			; brif not
 		sta 8,u				; tick down magical light strength
-LD1BC		dec V2B5			; mark update to dungeon required
+LD1BC		dec dungeonchg			; mark update to dungeon required
 		ldd #$0108			; reschedule for one minute
 		rts				; return to caller
 ; This is the routine that periodically updates the dungeon display (or scroll). It does not update
 ; unless something has marked the display changed OR a scroll is being displayed. It is called twice
 ; per second.
-LD1C2		tst V2B5			; check if we need to update dungeon display
+LD1C2		tst dungeonchg			; check if we need to update dungeon display
 		bne LD1CD			; brif so
 		ldx #displayscroll		; are we displaying a scroll?
 		cmpx displayptr
 		bne LD1D1			; brif not
-LD1CD		clr V2B5			; mark update not required
+LD1CD		clr dungeonchg			; mark update not required
 		updatedungeon			; update dungeon display
 LD1D1		ldd #$0304			; reschedule check for 0.5 seconds
 		rts				; return to caller
@@ -2882,7 +2900,7 @@
 		clrb
 LD1E2		std damagelevel			; save new damage level
 		checkdamage			; check damage level and calculate ticks until next recovery run
-		lda V2AF			; get ticks to reduce damage
+		lda heartticks			; get ticks to reduce damage (heart rate)
 		ldb #2				; requeue in the 60Hz ticker
 		rts				; return to caller
 ; This routine handles the keyboard input.
@@ -2918,7 +2936,7 @@
 		delay				; wait for a bit more
 		jmp START			; go start over again with the splash and demo
 LD229		ldx ,y++			; get pointer to the word
-		ldu #V361			; point to command decode buffer
+		ldu #cmddecodebuff		; point to command decode buffer
 		decodestr			; decode the keyword
 		leau 1,u			; move past the "object type" flag
 		delay				; wait a bit
@@ -2936,7 +2954,7 @@
 LD248		ldd #$0102			; reschedule for next tick
 		rts				; return to caller
 LD24C		pshs a,b,x,y,u			; save registers
-		tst V2AD			; are we starting a new command string?
+		tst hidestatus			; are we starting a new command string?
 		bne LD256			; brif not
 		resetdisplay			; clear command area, reset status, and redisplay dungeon
 		showprompt			; show the prompt
@@ -2975,7 +2993,7 @@
 		ldx #LD9D0			; point to command jump table
 		jsr [a,x]			; go handle command
 LD2A7		ldu #linebuff			; start of command buffer
-		tst V2AD			; have we been told to start a new command stream?
+		tst hidestatus			; have we been told to start a new command stream?
 		beq LD2B4			; brif so - don't display prompt
 		tst nokeyboard			; is keyboard disabled?
 		bne LD2B4			; brif so - no prompt
@@ -3043,7 +3061,7 @@
 		ldd 15,u			; get location of creature
 		std 2,x				; put the object there
 		bra LD32E			; go process next inventory item
-LD33A		ldx creaturecountptr		; point to creature count table for this level
+LD33A		ldx creaturecntptr		; point to creature count table for this level
 		ldb 13,u			; get type of creature killed
 		dec b,x				; reduce number of this creature type
 		clr 12,u			; flag creature as dead
@@ -3259,13 +3277,13 @@
 		rts				; return to caller
 LD489		cleargfx2			; clear graphics
 		ldx ,u				; get current text area start
-		ldu #V380			; point to info text area descriptor
+		ldu #infoarea			; point to info text area descriptor
 		stx ,u				; set text area start to the same place
-		dec V2B7			; set to nonstandard text rendering
+		dec textother			; set to nonstandard text rendering
 		rts				; return to caller
 ; This is the dungeon display routine that handles showing the inventory list.
 LD495		bsr LD489			; clear the graphics area and set up for text rendering
-		clr V2B6			; flag column zero in object list
+		clr columnctr			; flag column zero in object list
 		ldd #10				;* set up to centre "IN THIS ROOM"
 		std 4,u				;* column 10, row 0
 		renderstrimmp			; show the "IN THIS ROOM" heading
@@ -3287,7 +3305,7 @@
 		beq LD4CD			; brif no more objects
 		bsr LD505			; display object
 		bra LD4C2			; go handle another object
-LD4CD		tst V2B6			; are we at the start of a line?
+LD4CD		tst columnctr			; are we at the start of a line?
 		beq LD4D3			; brif so
 		bsr LD4FE			; do a newline
 LD4D3		ldd #$1b20			; set up for displaying a row of !!!!
@@ -3308,18 +3326,18 @@
 		com 6,u				; invert video if it is
 LD4F7		bsr LD505			; display ojbect name
 		bra LD4ED			; go display another object
-LD4FB		clr V2B7			; reset to standard text rendering
+LD4FB		clr textother			; reset to standard text rendering
 		rts				; return to caller
 LD4FE		lda #$1f			; character code for newline
 		renderchar			; go move to next line
-		clr V2B6			; flag column 1
+		clr columnctr			; flag column 1
 		rts				; return to caller
 LD505		pshs a,b,x			; save registers
 		jsr LC617			; fetch object name string (decoded)
 		renderstr			; display object name
 		lda levbgmask			; get current level mask
 		sta 6,u				; restore proper background
-		com V2B6			; are we on column 1 or 2?
+		com columnctr			; are we on column 1 or 2?
 		beq LD51E			; brif back at column 1
 		ldd 4,u				; get cursor position
 		addd #$10			; move right 16 cells
@@ -3409,9 +3427,9 @@
 cmd_incant	ldx #kwlist_adj			; point to object types list
 		jsr LCBEC			; look up object
 		ble LD5EF			; brif not found in list or no type specified
-		tst V27B			
-		beq LD5EF
-		std parseobjtype
+		tst kwexact			; was it a complete match?
+		beq LD5EF			; brif not
+		std parseobjtype		; save object type
 		ldu lefthand			; get left hand object
 		bsr LD5D0			; check if matching object is there
 		ldu righthand			; get right hand object and continue
@@ -3432,7 +3450,7 @@
 		beq LD5F0			; brif so
 LD5EF		rts				; return to caller
 LD5F0		ldx #img_goodwiz		; point to good wizard image
-		dec V29E
+		dec enablefadesound		; enable fade sound effect
 		fadeinclrst			; fade in the wizard
 		renderstrimmp			; display victory message line 1
 		fcb $ff,$c4,$54,$3d		; packed string victory message line 1
@@ -3577,7 +3595,7 @@
 		clr ,-s				; make a temp
 		addb facing			; add direction to current facing direction
 		andb #3				; normalize to 0-3
-		stb V28A			; save move direction
+		stb curdir			; save move direction
 		ldd playerloc			; get current player location
 		jsr LD136			; calculate movement
 		beq LD738			; brif movement succeeds
@@ -3643,13 +3661,13 @@
 		tst 11,u			; is flask revealed?
 		bne LD7B6			; brif not - do nothing
 		playsoundimm $0e		; play the scroll sound
-		clr V2AD			; flag command processor to do a "restart"
+		clr hidestatus			; flag command processor to do a "restart"
 		ldx #displayscroll		; point to scroll display routine
 		stx displayptr			; set the display handler
 		updatedungeon			; update display with scroll
 LD7B6		rts				; return to caller
 cmd_zload	bsr LD7BC			; parse the file name
-		dec V2B8			; flag ZLOAD
+		dec loadsaveflag		; flag ZLOAD
 		rts				; return to caller
 LD7BC		ldx #wordbuff			; get start address to set to $ff
 		leau $20,x			; set $20 bytes
@@ -3659,7 +3677,7 @@
 		stx CBUFAD			; point buffer to file name
 		ldd #$0f			;* set block type to header, length to 15
 		std BLKTYP			;*
-		inc V2B8			; flag ZSAVE
+		inc loadsaveflag		; flag ZSAVE
 		rts				; return to caller
 ; Objects in backpack for demo game
 startobjdemo	fcb 13				; iron sword
@@ -3699,22 +3717,22 @@
 		fdb $23				; carryweight - the weight of objects the player is carrying
 		fdb $17a0			; powerlevel - player power level
 		fcb $54	
-		fdb V380
-		fdb $1000			; V380 - text area starts at top of screen
-		fdb $0260			; V382 - text area ends after 19 lines
-		fdb 0				; V384 - text cursor position at top of screen
-		fcb 0				; V386 - black background
-		fcb $ff				; V387 - do not render on secondary screen
-		fdb $2300			; V388 - text area starts at row 19 on screen
-		fdb $40				; V38A - text area goes for two lines
-		fdb 0				; V38C - text cursor is at top of area
-		fcb $ff				; V38E - background is white
-		fcb 0				; V38F - do render on secondary screen
-		fdb $2400			; V390 - text area starts at row 20 on screen
-		fdb $80				; V392 - text area goes for four lines
-		fdb 0				; V394 - text cursor is at top of area
-		fcb 0				; V396 - background is black
-		fcb 0				; V397 - do render on secondary screen
+		fdb infoarea
+		fdb $1000			; infoarea - text area starts at top of screen
+		fdb $0260			; infoarea+2 - text area ends after 19 lines
+		fdb 0				; infoarea+4 - text cursor position at top of screen
+		fcb 0				; infoarea+6 - black background
+		fcb $ff				; infoarea+7 - do not render on secondary screen
+		fdb $2300			; statusarea - text area starts at row 19 on screen
+		fdb $40				; statusarea+2 - text area goes for two lines
+		fdb 0				; statusarea+4 - text cursor is at top of area
+		fcb $ff				; statusarea+6 - background is white
+		fcb 0				; statusarea+7 - do render on secondary screen
+		fdb $2400			; commandarea - text area starts at row 20 on screen
+		fdb $80				; commandarea+2 - text area goes for four lines
+		fdb 0				; commandarea+4 - text cursor is at top of area
+		fcb 0				; commandarea+6 - background is black
+		fcb 0				; commandarea+7 - do render on secondary screen
 		fcb 9,9,4,2,0,0,0,0,0,0,0,0	; initial creature counts for level 1
 		fcb 2,4,0,6,6,6,0,0,0,0,0,0	; initial creature counts for level 2
 		fcb 0,0,0,4,0,6,8,4,0,0,1,0	; initial creature counts for level 3