changeset 25:5e2a87c2f9bc

Clean up formatting of comments Make all comments introduced by a ; for consistency.
author William Astle <lost@l-w.ca>
date Fri, 26 Dec 2014 10:35:07 -0700
parents 966dd9bc8659
children 4245a1b5c333
files dod.s
diffstat 1 files changed, 939 insertions(+), 939 deletions(-) [+]
line wrap: on
line diff
--- a/dod.s	Fri Dec 26 10:08:31 2014 -0700
+++ b/dod.s	Fri Dec 26 10:35:07 2014 -0700
@@ -223,17 +223,17 @@
 ; the direct page
 		org $200
 V1F4		equ $1f4
-zero		rmb 2				initialized to $0000
+zero		rmb 2				; initialized to $0000
 V202		rmb 1
-allones		rmb 2				initialized to $ffff
+allones		rmb 2				; initialized to $ffff
 V205		rmb 1
 V206		rmb 1
 V207		rmb 1
 V208		rmb 1
-screenvis	rmb 2				pointer to the parameter block of the currently shown screen
-screendraw	rmb 2				pointer to the parameter block of the screen to use for drawing
-V20D		rmb 2				pointer to demo game command sequence
-objectfree		rmb 2				; pointer to next free object data slot
+screenvis	rmb 2				; pointer to the parameter block of the currently shown screen
+screendraw	rmb 2				; pointer to the parameter block of the screen to use for drawing
+V20D		rmb 2				; pointer to demo game command sequence
+objectfree	rmb 2				; pointer to next free object data slot
 V211		rmb 2
 V213		rmb 1
 V214		rmb 1
@@ -252,22 +252,22 @@
 nokeyboard	rmb 1				; set if no keyboard operations should be done during IRQ
 backpack	rmb 2
 V22B		rmb 1
-levbgmask	rmb 1				the current level background colour mask
-lightlevel	rmb 1				the current light level, $ff means dark
-lightcount	rmb 1				counter between pixels when drawing lines
-ybeg		rmb 2				start Y coord for line drawing
-xbeg		rmb 2				start X coord for line drawing
-yend		rmb 2				end Y coord for line drawing
-xend		rmb 2				end X coord for line drawing
-xcur		rmb 3				current X coordinate when drawing line
-ycur		rmb 3				current Y coordinate when drawing line
-xpstep		rmb 3				difference in X coordinate between pixels when drawing line
-ypstep		rmb 3				difference in Y coordinate between pixels when drawing line
-pixelcount	rmb 2				number of pixels to draw in a line
-xbstep		rmb 1				the offset to add to pointer when moving to new byte (line drawing)
-xystep		rmb 1				the offset to add to pointer when moving to new row (line drawing)
-drawstart	rmb 2				start address of drawing area (line drawing)
-drawend		rmb 2				end address of drawing area (line drawing)
+levbgmask	rmb 1				; the current level background colour mask
+lightlevel	rmb 1				; the current light level, $ff means dark
+lightcount	rmb 1				; counter between pixels when drawing lines
+ybeg		rmb 2				; start Y coord for line drawing
+xbeg		rmb 2				; start X coord for line drawing
+yend		rmb 2				; end Y coord for line drawing
+xend		rmb 2				; end X coord for line drawing
+xcur		rmb 3				; current X coordinate when drawing line
+ycur		rmb 3				; current Y coordinate when drawing line
+xpstep		rmb 3				; difference in X coordinate between pixels when drawing line
+ypstep		rmb 3				; difference in Y coordinate between pixels when drawing line
+pixelcount	rmb 2				; number of pixels to draw in a line
+xbstep		rmb 1				; the offset to add to pointer when moving to new byte (line drawing)
+xystep		rmb 1				; the offset to add to pointer when moving to new row (line drawing)
+drawstart	rmb 2				; start address of drawing area (line drawing)
+drawend		rmb 2				; end address of drawing area (line drawing)
 V24B		rmb 4
 V24F		rmb 1
 V250		rmb 1
@@ -279,7 +279,7 @@
 V25B		rmb 2
 V25D		rmb 2
 V25F		rmb 2
-soundvol	rmb 1				sound: volume multiplier for sound playing
+soundvol	rmb 1				; sound: volume multiplier for sound playing
 V262		rmb 1
 V263		rmb 2
 V265		rmb 6
@@ -329,46 +329,46 @@
 V2B0		rmb 1
 V2B1		rmb 1
 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
+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
+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
-keybufread	rmb 1				keyboard buffer read offset
-keybufwrite	rmb 1				keyboard buffer write offset
+keybufread	rmb 1				; keyboard buffer read offset
+keybufwrite	rmb 1				; keyboard buffer write offset
 		rmb 3
-V2C1		rmb 1				temporary variable used during line drawing and division
-V2C2		rmb 1				temporary variable used during division
-V2C3		rmb 1				temporary variable used during division
+V2C1		rmb 1				; temporary variable used during line drawing and division
+V2C2		rmb 1				; temporary variable used during division
+V2C3		rmb 1				; temporary variable used during division
 V2C4		rmb 1
 V2C5		rmb 1
 V2C6		rmb 1
 V2C7		rmb 10
-keybuf		rmb 32				keyboard ring buffer
+keybuf		rmb 32				; keyboard ring buffer
 V2F1		rmb 32
 V311		rmb 2
-wordbuff		rmb 32
+wordbuff	rmb 32
 V333		rmb 2
-stringbuf	rmb 34				temporary buffer used for decoding immediate packed strings
-fontbuf		rmb 10				temporary buffer used for decoding font data
+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
+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
 V398		rmb 43
 V3C3		rmb 17
 V3D4		rmb $220
@@ -381,45 +381,45 @@
 
 
 		org $c000
-START		ldu #dodemo			point to the demo setup routine
-		bra LC008			go handle the game
-LC005		ldu #dogame			point to the real game setup routine
-LC008		lds #STACK			put the stack somewhere safe
-		ldx #PIA0			point at PIA0
-		ldd #$34fa			initializers for the PIA
-		sta 3,x				set data mode, interrupts disabled (side B)
-		sta 1,x				set data mode, interrupts disabled (side A)
-		ldx #PIA1			point at PIA1
-		sta 1,x				set data mode, interrupts disabled (side A)
-		clr 3,x				set direction mode for side B
-		stb 2,x				set VDG and single bit sound to output
-		lda #$3c			flags for data mode, no interrupts, sound enabled
-		sta 3,x				set side B for data mode
-		ldd #$2046			SAM value for "pmode 4" graphics, screen at $1000
-		jsr setSAM			go set the SAM register
-		lda #$f8			value for "pmode 4", color set 1
-		sta 2,x				set VDG mode
-		ldx #zero			point to start of variables
-LC030		clr ,x+				clear a byte
-		cmpx #TOPRAM			are we at the top of memory?
-		blo LC030			brif not
-		stu ,--s			set return address to the game initialization routine
-		lda #zero/256			point to MSB of direct page
-		tfr a,dp			set DP appropriately
-		setdp zero/256			tell the assembler about DP
-		ldy #LD7E8			point to variable initialization table
-LC041		lda ,y+				fetch number of bytes in this initializer
-		beq LC086			brif zero - we're done
-		ldx ,y++			get address to copy bytes to
-		bsr LC04B			go copy bytes
-		bra LC041			go handle another initializer
-LC04B		ldb ,y+				fetch source byte
-		stb ,x+				stow at destination
-		deca				are we done yet?
-		bne LC04B			brif not
-		rts				return to caller
-LC053		pshs cc,a,b,x,y,u		save registers and interrupt status
-		orcc #$10			disable IRQ
+START		ldu #dodemo			; point to the demo setup routine
+		bra LC008			; go handle the game
+LC005		ldu #dogame			; point to the real game setup routine
+LC008		lds #STACK			; put the stack somewhere safe
+		ldx #PIA0			; point at PIA0
+		ldd #$34fa			; initializers for the PIA
+		sta 3,x				; set data mode, interrupts disabled (side B)
+		sta 1,x				; set data mode, interrupts disabled (side A)
+		ldx #PIA1			; point at PIA1
+		sta 1,x				; set data mode, interrupts disabled (side A)
+		clr 3,x				; set direction mode for side B
+		stb 2,x				; set VDG and single bit sound to output
+		lda #$3c			; flags for data mode, no interrupts, sound enabled
+		sta 3,x				; set side B for data mode
+		ldd #$2046			; SAM value for "pmode 4" graphics, screen at $1000
+		jsr setSAM			; go set the SAM register
+		lda #$f8			; value for "pmode 4", color set 1
+		sta 2,x				; set VDG mode
+		ldx #zero			; point to start of variables
+LC030		clr ,x+				; clear a byte
+		cmpx #TOPRAM			; are we at the top of memory?
+		blo LC030			; brif not
+		stu ,--s			; set return address to the game initialization routine
+		lda #zero/256			; point to MSB of direct page
+		tfr a,dp			; set DP appropriately
+		setdp zero/256			; tell the assembler about DP
+		ldy #LD7E8			; point to variable initialization table
+LC041		lda ,y+				; fetch number of bytes in this initializer
+		beq LC086			; brif zero - we're done
+		ldx ,y++			; get address to copy bytes to
+		bsr LC04B			; go copy bytes
+		bra LC041			; go handle another initializer
+LC04B		ldb ,y+				; fetch source byte
+		stb ,x+				; stow at destination
+		deca				; are we done yet?
+		bne LC04B			; brif not
+		rts				; return to caller
+LC053		pshs cc,a,b,x,y,u		; save registers and interrupt status
+		orcc #$10			; disable IRQ
 		ldx #V29F
 LC05A		clr ,x+
 		cmpx #V2AD
@@ -462,17 +462,17 @@
 		inca
 		cmpu #LDAA3
 		blo LC08C
-		ldu #V388			point to text parameters for status area
-		dec V2B7			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"
+		ldu #V388			; point to text parameters for status area
+		dec V2B7			; 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"
 		fcb $27,$45,$00,$02
 		fcb $65,$c1,$03,$52
 		fcb $39,$3c,$00,$68
 		fcb $da,$cc,$63,$09
 		fcb $48
-		clr V2B7			reset text rendering to standard mode
+		clr V2B7			; reset text rendering to standard mode
 		rts					
 dodemo		dec waitnewgame			; flag demo game
 		bsr enablepiairq		; set up interrupts and sound
@@ -657,33 +657,33 @@
 ; 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
 ; to match the value in D.
-setSAM		pshs x,b,a			save registers
-		ldx #SAMREG			point to SAM register
-setSAM000	lsra				; shift the bit value to set to carry
-		rorb				;
-		bcs setSAM001			brif bit set
-		sta ,x				clear the bit
-		skip2				skip next instruction
-setSAM001	sta 1,x				set the bit
-		leax 2,x			move to next SAM register bit
-		cmpx #SAMREG+$14		are we at the end of the register?
-		blo setSAM000			brif not
-		puls a,b,x,pc			restore registers and return
+setSAM		pshs x,b,a			; save registers
+		ldx #SAMREG			; point to SAM register
+setSAM000	lsra				;* shift the bit value to set to carry
+		rorb				;*
+		bcs setSAM001			; brif bit set
+		sta ,x				; clear the bit
+		skip2				; skip next instruction
+setSAM001	sta 1,x				; set the bit
+		leax 2,x			; move to next SAM register bit
+		cmpx #SAMREG+$14		; are we at the end of the register?
+		blo setSAM000			; brif not
+		puls a,b,x,pc			; restore registers and return
 ; IRQ service routine
-LC27D		ldx #PIA1
-		lda -29,x
-		lbpl LC320
-		lda #2
-		tfr a,dp
-		tst pageswap			do we have a screen swap to do?
-		beq LC29D			brif not
-		ldd screenvis			get currently visible screen pointer
-		ldu screendraw			get newly drawn screen pointer
-		std screendraw			save current screen as screen to draw
-		stu screenvis			save drawn screen as current
-		ldd 4,u				get the SAM value for the new screen
-		bsr setSAM			go program the SAM
-		clr pageswap			flag no swap needed
+LC27D		ldx #PIA1			; point to PIA1
+		lda -29,x			; get interrupt status
+		lbpl LC320			; brif not VSYCN
+		lda #zero/256			; point to direct page MSB
+		tfr a,dp			; make sure DP is set correctly
+		tst pageswap			; do we have a screen swap to do?
+		beq LC29D			; brif not
+		ldd screenvis			; get currently visible screen pointer
+		ldu screendraw			; get newly drawn screen pointer
+		std screendraw			; save current screen as screen to draw
+		stu screenvis			; save drawn screen as current
+		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
@@ -747,58 +747,58 @@
 LC320		lda PIA0+2			; clear interrupt status
 		rti
 LC324		fcb $06,$0a,$3c,$3c,$18
-readkeybuf	pshs cc,b,x			save registers and interrupt status
-		orcc #$10			disable IRQ
-		clra				flag no key pressed
-		ldx #keybuf			point to keyboard ring buffer
-		ldb keybufread			get buffer read offset
-		cmpb keybufwrite		same as buffer write offset?
-		beq readkeybuf000		brif so - no key available
-		lda b,x				fetch key from buffer
-		incb				bump buffer pointer
-		andb #$1f			wrap around if needed
-		stb keybufread			save new buffer read offset
-readkeybuf000	puls cc,b,x,pc			restore registers and interrupts
+readkeybuf	pshs cc,b,x			; save registers and interrupt status
+		orcc #$10			; disable IRQ
+		clra				; flag no key pressed
+		ldx #keybuf			; point to keyboard ring buffer
+		ldb keybufread			; get buffer read offset
+		cmpb keybufwrite		; same as buffer write offset?
+		beq readkeybuf000		; brif so - no key available
+		lda b,x				; fetch key from buffer
+		incb				; bump buffer pointer
+		andb #$1f			; wrap around if needed
+		stb keybufread			; save new buffer read offset
+readkeybuf000	puls cc,b,x,pc			; restore registers and interrupts
 ; Add a keypress to the keyboard buffer. NOTE: this does not check for buffer overflow
 ; which means when the buffer gets full, it just rolls over and overwrites the previous
 ; data.
-writekeybuf	pshs cc,b,x			save registers and interrupt status
-		orcc #$10			disable IRQ
-		ldx #keybuf			point to keyboard ring buffer
-		ldb keybufwrite			get buffer write offset
-		sta b,x				stash new key
-		incb				bump buffer pointer
-		andb #$1f			wrap around if needed
-		stb keybufwrite			save new buffer write offset
-		puls cc,b,x,pc			restore registers and interrupts
+writekeybuf	pshs cc,b,x			; save registers and interrupt status
+		orcc #$10			; disable IRQ
+		ldx #keybuf			; point to keyboard ring buffer
+		ldb keybufwrite			; get buffer write offset
+		sta b,x				; stash new key
+		incb				; bump buffer pointer
+		andb #$1f			; wrap around if needed
+		stb keybufwrite			; save new buffer write offset
+		puls cc,b,x,pc			; restore registers and interrupts
 ; SWI handler
-LC352		andcc #$ef			re-enable IRQ - SWI disables it
-		ldx 10,s			get return address
-		lda ,x+				get operation code
-		stx 10,s			save new return address
-		ldx #LC384			point to first SWI routine
-		ldu #LC995			point to routine offset table
-LC360		ldb ,u+				get length of previous routine
-		abx				add to routine pointer
-		deca				are we at the right routine?
-		bpl LC360			brif not
-		stx ,--s			save routine address
-		ldd 3,s				restore D register
-		ldx 6,s				restore X register
-		ldu 10,s			restore U register
-		jsr [,s++]			call the routine
-		rti				return to caller
+LC352		andcc #$ef			; re-enable IRQ - SWI disables it
+		ldx 10,s			; get return address
+		lda ,x+				; get operation code
+		stx 10,s			; save new return address
+		ldx #LC384			; point to first SWI routine
+		ldu #LC995			; point to routine offset table
+LC360		ldb ,u+				; get length of previous routine
+		abx				; add to routine pointer
+		deca				; are we at the right routine?
+		bpl LC360			; brif not
+		stx ,--s			; save routine address
+		ldd 3,s				; restore D register
+		ldx 6,s				; restore X register
+		ldu 10,s			; restore U register
+		jsr [,s++]			; call the routine
+		rti				; return to caller
 ; SWI2 handler
-LC371		clrb				; restore direct page for ROM call
-		tfr b,dp			;
-		ldu 10,s			get return address
-		ldb ,u+				get ROM routine offset
-		stu 10,s			save new return address
-		ldu #ROMTAB			point to ROM vector table
-		jsr [b,u]			call the ROM routine
-		sta 1,s				; save return values
-		stx 4,s				;
-		rti				return to caller
+LC371		clrb				;* restore direct page for ROM call
+		tfr b,dp			;*
+		ldu 10,s			; get return address
+		ldb ,u+				; get ROM routine offset
+		stu 10,s			; save new return address
+		ldu #ROMTAB			; point to ROM vector table
+		jsr [b,u]			; call the ROM routine
+		sta 1,s				;* save return values
+		stx 4,s				;*
+		rti				; return to caller
 ; SWI 0 routine
 LC384		lda V26E
 		tst V275
@@ -855,190 +855,190 @@
 ; V251		nonzero if this is not the first coordinate in a polygon
 ; V252		the most recent absolute unscaled X coordinate
 ; V254		the most recent absolute unscaled Y coordinate
-LC3A2		clr V251			mark input as start of polygon
-		lda lightlevel			fetch dungeon light level
-		inca				is it $ff (dark)?
-		beq LC3F6			brif so - skip rendering
-LC3A9		ldb ,x				fetch input data
-		subb #$fa			adjust for operation codes
-		blo LC3CF			brif not operation code
-		leax 1,x			move on to next image data byte
-		ldy #LC3B9			point to jump table for operation codes
-		ldb b,y				get offset to operation routine
-		jmp b,y				execute operation routine
-LC3B9		fcb LC3C9-LC3B9			(FA) return from a "subroutine"
-		fcb LC3BF-LC3B9			(FB) call a "subroutine"
-		fcb LC417-LC3B9			(FC) polygon
-		fcb LC3C6-LC3B9			(FD) jump to a new "routine"
-		fcb LC3F6-LC3B9			(FE) end of input - return to caller
-		fcb LC3CB-LC3B9			(FF) next coordinates are start of new polygon
-LC3BF		ldd ,x++			get address of "subroutine" to call
-		stx ,--s			save return address
-		tfr d,x				set new "execution" address
-		skip2				skip next instruction
-LC3C6		ldx ,x				get address of "routine" to jump to
-		skip2				skip next instruction
-LC3C9		ldx ,s++			get back saved input location
-LC3CB		clr V251			reset polygon start flag to start
-		bra LC3A9			go process more input
-LC3CF		tst V251			is this the first coordinate in a polygon?
-		bne LC3D9			brif not
-		bsr LC3E2			fetch input coordinates and save them
-		dec V251			flag as not first coordinate
-		bra LC3A9			go process more input
-LC3D9		bsr LC3E0			set up coordinates to draw a line
-		jsr drawline			draw the line
-		bra LC3A9			go process more input
-LC3E0		bsr LC3F7			move last end coordinates to line start
-LC3E2		ldb ,x+				get the next Y coordinate and move pointer forward
-		stb V254			save unscaled Y coordinate
-		bsr LC400			scale the Y coordinate
-		addd V207			add in base Y coordinate
-		std yend			save scaled end coordinate for line
-		ldb ,x+				get the next X coordinate and move pointer forward
-		stb V252			save unscaled X coordinate
-		bsr LC406			scale the X coordinate
-		addd V205			add in base X coordinate
-		std xend			save scaled X coordinate for line
-LC3F6		rts				return to caller
-LC3F7		ldd yend			fetch last Y coordinate
-		std ybeg			save as begining of new line segment
-		ldd xend			fetch last X coordinate
-		std xbeg			save as beginning of new line segment
-		rts				return to caller
-LC400		lda V250			get desired vertical scaling factor
-		subb V208			find difference from Y base coordinate
-		bra LC40A			go finish calculating scale
-LC406		lda V24F			get desired horizontal scale factor
-		subb V206			find difference from X base coordinate
-LC40A		bcs LC40F			brif negative difference
-		mul				apply the scaling factor
-		bra LC414			normalize to an integer in D and return
-LC40F		negb				make coordinate difference positive
-		mul				apply the scaling factor
-		jsr LCA99			negate coordinate value
-LC414		jmp LD377			normalize to an integer in D and return
-LC417		lda ,x+				get next byte in input
-		beq LC3CB			brif NUL - end of values
-		bsr LC3F7			move last end coordinate to start coordinate for line
-		ldb -1,x			get the relative movement specifications
-		asrb				; fetch high nibble signed extended into B
-		asrb				;
-		asrb				;
-		asrb				;
-		lslb				and multiply by two
-		addb V254			add in previous Y coordinate
-		stb V254			save new Y coordinate
-		bsr LC400			go scale the Y coordinate
-		addd V207			add in the Y base coordinate
-		std yend			save new ending Y coordinate
-		ldb -1,x			get back the input byte again
-		andb #$0f			mask off the upper bits
-		bitb #8				is bit 3 set?
-		beq LC438			brif not
-		orb #$f0			sign extend to 8 bits
-LC438		lslb				multiply by two
-		addb V252			add in saved X coordinate
-		stb V252			save new X coordinate
-		bsr LC406			go scale the X coordinate
-		addd V205			add in base X coordinate
-		std xend			save new ending X coordinate
-		jsr drawline			go draw a line
-		bra LC417			look for another line segment
+LC3A2		clr V251			; mark input as start of polygon
+		lda lightlevel			; fetch dungeon light level
+		inca				; is it $ff (dark)?
+		beq LC3F6			; brif so - skip rendering
+LC3A9		ldb ,x				; fetch input data
+		subb #$fa			; adjust for operation codes
+		blo LC3CF			; brif not operation code
+		leax 1,x			; move on to next image data byte
+		ldy #LC3B9			; point to jump table for operation codes
+		ldb b,y				; get offset to operation routine
+		jmp b,y				; execute operation routine
+LC3B9		fcb LC3C9-LC3B9			; (FA) return from a "subroutine"
+		fcb LC3BF-LC3B9			; (FB) call a "subroutine"
+		fcb LC417-LC3B9			; (FC) polygon
+		fcb LC3C6-LC3B9			; (FD) jump to a new "routine"
+		fcb LC3F6-LC3B9			; (FE) end of input - return to caller
+		fcb LC3CB-LC3B9			; (FF) next coordinates are start of new polygon
+LC3BF		ldd ,x++			; get address of "subroutine" to call
+		stx ,--s			; save return address
+		tfr d,x				; set new "execution" address
+		skip2				; skip next instruction
+LC3C6		ldx ,x				; get address of "routine" to jump to
+		skip2				; skip next instruction
+LC3C9		ldx ,s++			; get back saved input location
+LC3CB		clr V251			; reset polygon start flag to start
+		bra LC3A9			; go process more input
+LC3CF		tst V251			; is this the first coordinate in a polygon?
+		bne LC3D9			; brif not
+		bsr LC3E2			; fetch input coordinates and save them
+		dec V251			; flag as not first coordinate
+		bra LC3A9			; go process more input
+LC3D9		bsr LC3E0			; set up coordinates to draw a line
+		jsr drawline			; draw the line
+		bra LC3A9			; go process more input
+LC3E0		bsr LC3F7			; move last end coordinates to line start
+LC3E2		ldb ,x+				; get the next Y coordinate and move pointer forward
+		stb V254			; save unscaled Y coordinate
+		bsr LC400			; scale the Y coordinate
+		addd V207			; add in base Y coordinate
+		std yend			; save scaled end coordinate for line
+		ldb ,x+				; get the next X coordinate and move pointer forward
+		stb V252			; save unscaled X coordinate
+		bsr LC406			; scale the X coordinate
+		addd V205			; add in base X coordinate
+		std xend			; save scaled X coordinate for line
+LC3F6		rts				; return to caller
+LC3F7		ldd yend			; fetch last Y coordinate
+		std ybeg			; save as begining of new line segment
+		ldd xend			; fetch last X coordinate
+		std xbeg			; save as beginning of new line segment
+		rts				; return to caller
+LC400		lda V250			; get desired vertical scaling factor
+		subb V208			; find difference from Y base coordinate
+		bra LC40A			; go finish calculating scale
+LC406		lda V24F			; get desired horizontal scale factor
+		subb V206			; find difference from X base coordinate
+LC40A		bcs LC40F			; brif negative difference
+		mul				; apply the scaling factor
+		bra LC414			; normalize to an integer in D and return
+LC40F		negb				; make coordinate difference positive
+		mul				; apply the scaling factor
+		jsr LCA99			; negate coordinate value
+LC414		jmp LD377			; normalize to an integer in D and return
+LC417		lda ,x+				; get next byte in input
+		beq LC3CB			; brif NUL - end of values
+		bsr LC3F7			; move last end coordinate to start coordinate for line
+		ldb -1,x			; get the relative movement specifications
+		asrb				;* fetch high nibble signed extended into B
+		asrb				;*
+		asrb				;*
+		asrb				;*
+		lslb				; and multiply by two
+		addb V254			; add in previous Y coordinate
+		stb V254			; save new Y coordinate
+		bsr LC400			; go scale the Y coordinate
+		addd V207			; add in the Y base coordinate
+		std yend			; save new ending Y coordinate
+		ldb -1,x			; get back the input byte again
+		andb #$0f			; mask off the upper bits
+		bitb #8				; is bit 3 set?
+		beq LC438			; brif not
+		orb #$f0			; sign extend to 8 bits
+LC438		lslb				; multiply by two
+		addb V252			; add in saved X coordinate
+		stb V252			; save new X coordinate
+		bsr LC406			; go scale the X coordinate
+		addd V205			; add in base X coordinate
+		std xend			; save new ending X coordinate
+		jsr drawline			; go draw a line
+		bra LC417			; look for another line segment
 ; swi 2 routine
 ; fetch a packed string immediately following the call and display it
-LC448		ldx 12,s			fetch return address - string address
-		decodestrsb			go decode string
-		stx 12,s			save new return address - after string
-		ldx #stringbuf			point to decoded string
-		skip2				skip the next instruction - nothing to display yet
-LC452		renderchar			display character in A
+LC448		ldx 12,s			; fetch return address - string address
+		decodestrsb			; go decode string
+		stx 12,s			; save new return address - after string
+		ldx #stringbuf			; point to decoded string
+		skip2				; skip the next instruction - nothing to display yet
+LC452		renderchar			; display character in A
 ; swi 3 routine
 ; display an unpacked string pointed to by X
-LC454		lda ,x+				fetch byte from string
-		bpl LC452			brif not end of string - display it
-		rts				return to caller
+LC454		lda ,x+				; fetch byte from string
+		bpl LC452			; brif not end of string - display it
+		rts				; return to caller
 ; swi 4 routine
 ; display character in A
-LC459		tst V2B7			are we looking for standard text mode?
-		bne LC460			brif not
-		ldu #V390			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?
-		blo LC46C			brif not
-		jsr LC9D4			go scroll the text area
-LC46C		stx 4,u				save new screen location
-		rts				return to caller
+LC459		tst V2B7			; are we looking for standard text mode?
+		bne LC460			; brif not
+		ldu #V390			; 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?
+		blo LC46C			; brif not
+		jsr LC9D4			; go scroll the text area
+LC46C		stx 4,u				; save new screen location
+		rts				; return to caller
 ; swi 5 routine - decode packed string at X to stringbuf
-LC46F		ldu #stringbuf			point to output buffer
+LC46F		ldu #stringbuf			; point to output buffer
 ; swi 6 routine - decode a packed string at X to U
 ; the first value is the length of the string less one
-LC472		leay -1,u			point to working data before buffer
-		clr ,y				initialize value counter
-		bsr LC48C			fetch a value
-		tfr b,a				save length
-LC47A		bsr LC48C			fetch a value
-		stb ,u+				save in output
-		deca				done yet?
-		bpl LC47A			brif not
-		sta ,u				flag end of string with $ff
-		tst ,y				did we consume an even number of bytes?
-		beq LC489			brif so
-		leax 1,x			move pointer forward
-LC489		stx 6,s				save pointer past end of input
-		rts				return to caller
-LC48C		pshs a,u			save registers
-		lda ,y				get value counter
-		ldu #LC4A2			point to value handlers
-		lda a,u				get offset to handler for this value
-		jsr a,u				call the handler for this value
-		lda ,y				get value counter
-		inca				bump it
-		anda #7				wrap it around - the pattern repeats every 8 values
-		sta ,y				save new value counter
-		andb #$1f			values are only 5 bits - clear out extra bits
-		puls a,u,pc			restore registers and return
-LC4A2		fcb LC4AA-LC4A2			value 0 handler
-		fcb LC4B0-LC4A2			value 1 handler
-		fcb LC4B5-LC4A2			value 2 handler
-		fcb LC4B9-LC4A2			value 3 handler
-		fcb LC4BE-LC4A2			value 4 handler
-		fcb LC4C3-LC4A2			value 5 handler
-		fcb LC4C7-LC4A2			value 6 handler
-		fcb LC4CC-LC4A2			value 7 handler
+LC472		leay -1,u			; point to working data before buffer
+		clr ,y				; initialize value counter
+		bsr LC48C			; fetch a value
+		tfr b,a				; save length
+LC47A		bsr LC48C			; fetch a value
+		stb ,u+				; save in output
+		deca				; done yet?
+		bpl LC47A			; brif not
+		sta ,u				; flag end of string with $ff
+		tst ,y				; did we consume an even number of bytes?
+		beq LC489			; brif so
+		leax 1,x			; move pointer forward
+LC489		stx 6,s				; save pointer past end of input
+		rts				; return to caller
+LC48C		pshs a,u			; save registers
+		lda ,y				; get value counter
+		ldu #LC4A2			; point to value handlers
+		lda a,u				; get offset to handler for this value
+		jsr a,u				; call the handler for this value
+		lda ,y				; get value counter
+		inca				; bump it
+		anda #7				; wrap it around - the pattern repeats every 8 values
+		sta ,y				; save new value counter
+		andb #$1f			; values are only 5 bits - clear out extra bits
+		puls a,u,pc			; restore registers and return
+LC4A2		fcb LC4AA-LC4A2			; value 0 handler
+		fcb LC4B0-LC4A2			; value 1 handler
+		fcb LC4B5-LC4A2			; value 2 handler
+		fcb LC4B9-LC4A2			; value 3 handler
+		fcb LC4BE-LC4A2			; value 4 handler
+		fcb LC4C3-LC4A2			; value 5 handler
+		fcb LC4C7-LC4A2			; value 6 handler
+		fcb LC4CC-LC4A2			; value 7 handler
 ; value 0: upper 5 bits of current input byte
-LC4AA		ldb ,x				fetch input byte
-		lsrb				; align in low bits of B
-LC4AD		lsrb				;
-LC4AE		lsrb				;
+LC4AA		ldb ,x				; fetch input byte
+		lsrb				;* align in low bits of B
+LC4AD		lsrb				;*
+LC4AE		lsrb				;*
 		rts				return to caller
 ; value 1: lower 3 bits of current input byte and upper 2 bits of next one
 ; consumes a byte
-LC4B0		ldd ,x+				fetch input data and consume a byte
+LC4B0		ldd ,x+				; fetch input data and consume a byte
 		jmp LD379			; align in low bits of B
 ; value 2: bits 5...1 of current input byte
-LC4B5		ldb ,x				fetch input byte
-		bra LC4AE			align in low bits of B
+LC4B5		ldb ,x				; fetch input byte
+		bra LC4AE			; align in low bits of B
 ; value 3: bits 0 of current byte and upper 4 bits of next one
 ; consumes a byte
-LC4B9		ldd ,x+				fetch input data and consume a byte
-		jmp LD37D			align in low bits of B
+LC4B9		ldd ,x+				; fetch input data and consume a byte
+		jmp LD37D			; align in low bits of B
 ; value 4: low 4 bits of input byte and high bit of next one
 ; consumes a byte
-LC4BE		ldd ,x+				fetch input data and consume a byte
-		jmp LD377			align in low bits of B
+LC4BE		ldd ,x+				; fetch input data and consume a byte
+		jmp LD377			; align in low bits of B
 ; value 5: bits 6...2 of current input byte
-LC4C3		ldb ,x				fetch input data
-		bra LC4AD			align in low bits of B
+LC4C3		ldb ,x				; fetch input data
+		bra LC4AD			; align in low bits of B
 ; value 6: low two bits of current input byte and high 3 bits of next one
 ; consums a byte
-LC4C7		ldd ,x+				fetch input data and consume a byte
-		jmp LD37B			align in low bits of B
+LC4C7		ldd ,x+				; fetch input data and consume a byte
+		jmp LD37B			; align in low bits of B
 ; value 7: low 5 bits of current input byte
 ; consumes a byte
-LC4CC		ldb ,x+				fetch input data - already aligned
-		rts				return to caller
+LC4CC		ldb ,x+				; fetch input data - already aligned
+		rts				; return to caller
 ; swi 7 routine
 LC4CF		ldx #8
 LC4D2		clrb
@@ -1060,35 +1060,35 @@
 		sta 3,s
 		rts
 ; swi 8 routine - clear first graphics screen
-LC4F3		ldu screenvis			point to first screen parameter block
-		skip2				skip next instruction
+LC4F3		ldu screenvis			; point to first screen parameter block
+		skip2				; skip next instruction
 ; swi 9 routine - clear second graphics screen
-LC4F6		ldu screendraw			point to second screen parameter block
-		ldb levbgmask			get current level background colour
-		bsr LC517			go clear the graphics area of the screen
-		stu 10,s			save pointer to parameter block for the caller
-		rts				return to caller
+LC4F6		ldu screendraw			; point to second screen parameter block
+		ldb levbgmask			; get current level background colour
+		bsr LC517			; go clear the graphics area of the screen
+		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
-		ldu #LD87C			point to screen address table for the status line
-		bra LC50D			go clear the status line
+LC4FF		ldx #V388			; 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
-		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				;
-		ldb 6,x				get background colour of text area
-		bsr LC517			go clear text area
-		leau 6,u			and repeat the process for the other graphics screen
-LC517		pshs a,b,x,y,u			save regsiters
-		sex				get background colour to A
-		tfr d,y				move it into Y too (4 bytes of background colour)
-		leax ,u				point to start of parameter area
-		ldu 2,u				get address of end of text area (+1)
-LC520		pshu a,b,y			blast 4 background bytes to area
-		cmpu ,x				are we at the start of the area?
-		bne LC520			brif not
-		puls a,b,x,y,u,pc		restore registers and return
+LC507		ldx #V390			; 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				;*
+		ldb 6,x				; get background colour of text area
+		bsr LC517			; go clear text area
+		leau 6,u			; and repeat the process for the other graphics screen
+LC517		pshs a,b,x,y,u			; save regsiters
+		sex				; get background colour to A
+		tfr d,y				; move it into Y too (4 bytes of background colour)
+		leax ,u				; point to start of parameter area
+		ldu 2,u				; get address of end of text area (+1)
+LC520		pshu a,b,y			; blast 4 background bytes to area
+		cmpu ,x				; are we at the start of the area?
+		bne LC520			; brif not
+		puls a,b,x,y,u,pc		; restore registers and return
 ; swi 12 routine
 LC529		clr V2C1
 		ldd powerlevel
@@ -1139,10 +1139,10 @@
 		cmpa #$f8
 		bgt LC578
 		cleargfx2
-		dec pageswap			set graphics swap required
+		dec pageswap			; set graphics swap required
 		dec nokeyboard
-		clr keybufread			; reset keyboard buffer
-		clr keybufwrite			;
+		clr keybufread			;* reset keyboard buffer
+		clr keybufwrite			;*
 		bra LC5AE
 LC595		cmpa #4
 		ble LC5AE
@@ -1165,7 +1165,7 @@
 		dec V29E
 		fadeinclrst
 		renderstrimmp
-		fcb $ff,$c1,$92,$d0		"YET ANOTHER DOES NOT RETURN..."
+		fcb $ff,$c1,$92,$d0		; packed "YET ANOTHER DOES NOT RETURN..." string
 		fcb $01,$73,$e8,$82
 		fcb $c8,$04,$79,$66
 		fcb $07,$3e,$80,$91
@@ -1251,95 +1251,95 @@
 		jsr [displayptr]		; update the main display area
 		puls a,b,x,y,u,pc
 ; swi 15 routine
-LC674		ldx #LC67A			point to newline followed by prompt
-		renderstr			go display the newline and prompt
-		rts				return to caller
-LC67A		fcb $1f,$1e			unpacked string CR PERIOD UNDERSCORE BS (including following)
-LC67C		fcb $1c,$24,$ff			unpacked string UNDERSCORE BS
+LC674		ldx #LC67A			; point to newline followed by prompt
+		renderstr			; go display the newline and prompt
+		rts				; return to caller
+LC67A		fcb $1f,$1e			; unpacked string CR PERIOD UNDERSCORE BS (including following)
+LC67C		fcb $1c,$24,$ff			; unpacked string UNDERSCORE BS
 
 ; swi 16 routine
 ; delay for 81 ticks (1.3 seconds)
-LC67F		ldb #$51			fetch delay tick count
-LC681		sync				wait for a tick
-		decb				are we done yet?
-		bne LC681			brif not
+LC67F		ldb #$51			; fetch delay tick count
+LC681		sync				; wait for a tick
+		decb				; are we done yet?
+		bne LC681			; brif not
 		rts
 ; these two routine clear an area to 0 (black) or $ff (white) starting at X and
 ; ending at U
 ; swi 17 routine
-LC686		clra				set area to $00 (clear to black)
-		skip2				skip next byte
+LC686		clra				; set area to $00 (clear to black)
+		skip2				; skip next byte
 ; swi 18 routine
-LC688		lda #$ff			set area to $FF (clear to white)
-LC68A		sta ,x+				clear a byte
-		cmpx 10,s			are we done yet?
-		bne LC68A			brif not
-		rts				return to caller
+LC688		lda #$ff			; set area to $FF (clear to white)
+LC68A		sta ,x+				; clear a byte
+		cmpx 10,s			; are we done yet?
+		bne LC68A			; brif not
+		rts				; return to caller
 ; This looks like a leftover from earlier development which had the
 ; rom calls as a SWI call instead of using SWI2. This routine cannot
 ; be reached through the SWI mechanism and it cannot be called directly
-LC691		clrb				; reset direct page for ROM call
-		tfr b,dp			;
-		ldu 12,s			fetch return address
-		ldb ,u+				fetch rom call wanted
-		stu 12,s			save new return address
-		ldu #ROMTAB			point to ROM vector table
-		jsr [b,u]			call the routine
-		sta 3,s				; save return values
-		stx 6,s				;
+LC691		clrb				;* reset direct page for ROM call
+		tfr b,dp			;*
+		ldu 12,s			; fetch return address
+		ldb ,u+				; fetch rom call wanted
+		stu 12,s			; save new return address
+		ldu #ROMTAB			; point to ROM vector table
+		jsr [b,u]			; call the routine
+		sta 3,s				;* save return values
+		stx 6,s				;*
 		rts
 ; swi 19 routine
 ; fade in the image specified by (X) with sound effects, clear status line and command area
 LC6A4		clr V2B1
-		clearstatus			clear the status area
+		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 V24F			;
+LC6A8		clearcommand			; clear the command area
+		ldd #$8080			;* set X and Y scale values to 1.0
+		std V24F			;*
 		ldb V29E
 		beq LC6B7
-		ldb #$20			set apparent lighting to 32 (less apparent)
+		ldb #$20			; set apparent lighting to 32 (less apparent)
 		dec V29C
-LC6B7		bsr LC6D7			go draw the image
-		decb				; reduce lighting count - make more apparent
-		decb				;
-		bpl LC6B7			brif not done 16 steps
+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
-LC6C1		playsoundimm $16
-		rts				return to caller
+LC6C1		playsoundimm $16		; play sound effect
+		rts				; return to caller
 ; swi 21 routine
 ; fade out the image specified by (X) with sound effects, clear command area
-LC6C5		clearcommand			clear the command entry area
+LC6C5		clearcommand			; clear the command entry area
 		bsr LC6C1
-		clrb				set apparent illumination to fully lit			
+		clrb				; set apparent illumination to fully lit			
 		dec V29C
-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
+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
-		rts				return to caller
-LC6D7		pshs x,u			save registers
-		stb lightlevel			set illumination value for graphic rendering
+		rts				; return to caller
+LC6D7		pshs x,u			; save registers
+		stb lightlevel			; set illumination value for graphic rendering
 		stb V29D
-		cleargfx2			clear second graphics screen
-		drawgraphic			go draw graphic
-		dec pageswap			flag graphics swap required
-		sync				wait for swap to happen
-		puls x,u,pc			restore registers and return
+		cleargfx2			; clear second graphics screen
+		drawgraphic			; go draw graphic
+		dec pageswap			; flag graphics swap required
+		sync				; wait for swap to happen
+		puls x,u,pc			; restore registers and return
 ; swi 22 routine - display the PREPARE! screen
-LC6E6		jsr LD489			clear second graphics screen and set up for text mode
-		ldd #$12c			; set cursor position to the middle of the screen
-		std 4,u				;
-		renderstrimmp			display the PREPARE! message
-		fcb $3c,$24,$58,$06		packed string "PREPARE!"
+LC6E6		jsr LD489			; clear second graphics screen and set up for text mode
+		ldd #$12c			;* set cursor position to the middle of the screen
+		std 4,u				;*
+		renderstrimmp			; display the PREPARE! message
+		fcb $3c,$24,$58,$06		; packed string "PREPARE!"
 		fcb $45,$d8
-		clr V2B7			reset to standard text rendering
-		dec pageswap			set graphic swap required
-		rts				return to caller
+		clr V2B7			; reset to standard text rendering
+		dec pageswap			; set graphic swap required
+		rts				; return to caller
 ; swi 23 routine
 LC6FB		ldu objectfree			; fetch free point in object table
 		stu 6,s				; save pointer for return
@@ -1406,9 +1406,9 @@
 		bpl LC76A
 		decb
 		bpl LC768
-		ldx #V3D4			get start address to clear
-		ldu #mazedata			get end address to clear
-		clearblock			go clear area to zeros
+		ldx #V3D4			; get start address to clear
+		ldu #mazedata			; get end address to clear
+		clearblock			; go clear area to zeros
 		jsr LC053
 		jsr LCC9C
 		ldu V282
@@ -1447,83 +1447,83 @@
 		rts
 ; swi 27 routine
 ; play a sound specified by the immediate identifier
-LC7C8		ldx 12,s			fetch return address
-		lda ,x+				fetch immediate data
-		stx 12,s			update return address
-		ldb #$ff			set to maximum volume
+LC7C8		ldx 12,s			; fetch return address
+		lda ,x+				; fetch immediate data
+		stx 12,s			; update return address
+		ldb #$ff			; set to maximum volume
 ; swi 28 routine
 ; play a sound specified by the value in A
-LC7D0		stb soundvol			set the volume for the sound playing routine
-		ldx #LC7DC			point to sound routine jump table
-		lsla				two bytes per jump table entry
-		jsr [a,x]			call the sound generator routine
-		clr PIA1			turn off sound output
-		rts				return to caller
+LC7D0		stb soundvol			; set the volume for the sound playing routine
+		ldx #LC7DC			; point to sound routine jump table
+		lsla				; two bytes per jump table entry
+		jsr [a,x]			; call the sound generator routine
+		clr PIA1			; turn off sound output
+		rts				; return to caller
 ; the jump table for sound routines
-LC7DC		fdb LC82B			sound 0
-		fdb LC850			sound 1
-		fdb LC951			sound 2
-		fdb LC83C			sound 3
-		fdb LC8E2			sound 4
-		fdb LC955			sound 5
-		fdb LC84A			sound 6
-		fdb LC8DE			sound 7
-		fdb LC84D			sound 8
-		fdb LC959			sound 9
-		fdb LC877			sound 10
-		fdb LC877			sound 11
-		fdb LC80A			sound 12 - flask sound
-		fdb LC811			sound 13 - ring sound
-		fdb LC827			sound 14 - scroll sound
-		fdb LC8DA			sound 15 - shield sound
-		fdb LC8A6			sound 16 - sword sound
-		fdb LC8B2			sound 17 - torch sound
-		fdb LC93F			sound 18 - attack hit
-		fdb LC8E6			sound 19
-		fdb LC872			sound 20
-		fdb LC86D			sound 21
-		fdb LC88A			sound 22 - wizard
+LC7DC		fdb LC82B			; sound 0
+		fdb LC850			; sound 1
+		fdb LC951			; sound 2
+		fdb LC83C			; sound 3
+		fdb LC8E2			; sound 4
+		fdb LC955			; sound 5
+		fdb LC84A			; sound 6
+		fdb LC8DE			; sound 7
+		fdb LC84D			; sound 8
+		fdb LC959			; sound 9
+		fdb LC877			; sound 10
+		fdb LC877			; sound 11
+		fdb LC80A			; sound 12 - flask sound
+		fdb LC811			; sound 13 - ring sound
+		fdb LC827			; sound 14 - scroll sound
+		fdb LC8DA			; sound 15 - shield sound
+		fdb LC8A6			; sound 16 - sword sound
+		fdb LC8B2			; sound 17 - torch sound
+		fdb LC93F			; sound 18 - attack hit
+		fdb LC8E6			; sound 19
+		fdb LC872			; sound 20
+		fdb LC86D			; sound 21
+		fdb LC88A			; sound 22 - wizard
 ; sound 12
-LC80A		ldu #LC823			point to 144Hz base tone
-		lda #4				repeat sound 4 times
-		bra LC816			go do the sound
+LC80A		ldu #LC823			; point to 144Hz base tone
+		lda #4				; repeat sound 4 times
+		bra LC816			; go do the sound
 ; sound 13
-LC811		ldu #LC81F			point to 288Hz base tone
-		lda #10				repeat sound 10 times
-LC816		sta V25F			set repeat counter
-LC818		jsr ,u				make a sound
-		dec V25F			have we done enough of them?
-		bne LC818			brif not
+LC811		ldu #LC81F			; point to 288Hz base tone
+		lda #10				; repeat sound 10 times
+LC816		sta V25F			; set repeat counter
+LC818		jsr ,u				; make a sound
+		dec V25F			; have we done enough of them?
+		bne LC818			; brif not
 		rts
 ; These routines produce a "sliding" tone starting at the base frequency. The specified base
 ; frequency is a rough estimate. The tones are created using square waves. After each full wave,
 ; the delay in reduced by one which increases the frequency. The last cycle is with the delay
 ; equal to 1 which yields an approximate frequency of 9520Hz.
-LC81F		ldx #$40			set low frequency of sliding tone to ~288Hz
+LC81F		ldx #$40			; set low frequency of sliding tone to ~288Hz
 		fcb $10
-LC823		ldx #$80			set low frequency of sliding tone to ~144Hz
+LC823		ldx #$80			; set low frequency of sliding tone to ~144Hz
 		fcb $10
 ; sound 14
-LC827		ldx #$100			set low frequency of sliding tone to ~72Hz
+LC827		ldx #$100			; set low frequency of sliding tone to ~72Hz
 		fcb $10
 ; sound 0
-LC82B		ldx #$20			set low frequency of sliding tone to ~566Hz
-LC82E		bsr LC835			do one square wave
-		leax -1,x			reduce delay (increase frequency)
-		bne LC82E			brif not yet reached maximum frequency
+LC82B		ldx #$20			; set low frequency of sliding tone to ~566Hz
+LC82E		bsr LC835			; do one square wave
+		leax -1,x			; reduce delay (increase frequency)
+		bne LC82E			; brif not yet reached maximum frequency
 		rts
 ; Output a square wave with wave time defined by delay in X
-LC835		lda #$ff			(2~) hold DAC high for delay in X
-		bsr LC869			(7~)
-		clra				(2~) hold DAC low for delay in X
-		bra LC869			(3~)
+LC835		lda #$ff			; (2~) hold DAC high for delay in X
+		bsr LC869			; (7~)
+		clra				; (2~) hold DAC low for delay in X
+		bra LC869			; (3~)
 ; sound 3
 ; Output a series of 16 ascending tones with a base frequency descending from 14.5Hz to 9Hz.
-LC83C		ldx #$500			set for an ascending tone from 14.5Hz
-LC83F		bsr LC835			go make the sound
-		leax $30,x			decrease starting tone frequency by a bit
-		cmpx #$800			have we reached 9Hz?
-		blo LC83F			brif not
+LC83C		ldx #$500			; set for an ascending tone from 14.5Hz
+LC83F		bsr LC835			; go make the sound
+		leax $30,x			; decrease starting tone frequency by a bit
+		cmpx #$800			; have we reached 9Hz?
+		blo LC83F			; brif not
 		rts
 ; sound 6
 LC84A		lda #2
@@ -1544,8 +1544,8 @@
 		bne LC854
 		rts
 LC867		bsr LC8CE
-LC869		bsr LC8C5			(7~) program the DAC
-		bra LC8BD			(3~) count down delay non-destructively
+LC869		bsr LC8C5			; (7~) program the DAC
+		bra LC8BD			; (3~) count down delay non-destructively
 ; sound 21
 LC86D		ldu #LDBDA
 		bra LC893
@@ -1591,15 +1591,15 @@
 LC8B6		bsr LC926
 		bra LC8B6
 LC8BA		ldx #$1000
-LC8BD		pshs x				(7~) save delay counter
-LC8BF		leax -1,x			(5~) has timer expired?
-		bne LC8BF			(3~) brif not
-LC8C3		puls x,pc			(9~) restore delay counter and return
-LC8C5		ldb soundvol			(5~) fetch volume multiplier for sound
-		mul				(11~) multiply it by the value we're trying to set
-		anda #$fc			(2~) lose the non-DAC bits
-		sta PIA1			(5~) set DAC
-		rts				(5~)
+LC8BD		pshs x				; (7~) save delay counter
+LC8BF		leax -1,x			; (5~) has timer expired?
+		bne LC8BF			; (3~) brif not
+LC8C3		puls x,pc			; (9~) restore delay counter and return
+LC8C5		ldb soundvol			; (5~) fetch volume multiplier for sound
+		mul				; (11~) multiply it by the value we're trying to set
+		anda #$fc			; (2~) lose the non-DAC bits
+		sta PIA1			; (5~) set DAC
+		rts				; (5~)
 LC8CE		ldd V256
 		lslb
 		rola
@@ -1639,7 +1639,7 @@
 		bra LC8F3
 LC90A		sta V259
 		bsr LC97E
-		bls LC8C3			skip the caller to this routine and return to its caller
+		bls LC8C3			; skip the caller to this routine and return to its caller
 		bsr LC8C5
 		lda V259
 		rts
@@ -1655,7 +1655,7 @@
 		bra LC98D
 LC926		bsr LC8CE
 LC928		bsr LC97E
-		bls LC8C3			skip the caller to this routine and return to its caller
+		bls LC8C3			; skip the caller to this routine and return to its caller
 		bra LC8C5
 LC92E		ldx allones
 		fcb $10
@@ -1715,7 +1715,7 @@
 		bra LC984
 ; this is the swi routine offset table - each byte is the difference between the entry point
 ; of the previous routine and itself
-LC995		fcb 0				first routine has nothing before it
+LC995		fcb 0				; first routine has nothing before it
 		fcb LC3A2-LC384
 		fcb LC448-LC3A2
 		fcb LC454-LC448
@@ -1769,140 +1769,140 @@
 ; 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.
-LC9B2		cmpa #$24			is it backspace?	
-		beq LC9BF			brif so
-		cmpa #$1f			vertical spacer?
-		beq LC9CA			brif so
-		bsr LCA17			go handle a glyph
-		leax 1,x			move to next character position
-		rts				return to caller
-LC9BF		leax -1,x			move display pointer back one
-		cmpx allones			did we wrap around negative?			
-		bne LC9C9			brif not
-		ldx 2,u				get end of text area
-		leax -1,x			move back one position to be in the text area
-LC9C9		rts				return to caller
-LC9CA		leax $20,x			move pointer forward one character row
-		exg d,x				move pointer so we can do math
-		andb #$e0			force pointer to the start of the line
-		exg d,x				put pointer back where it belongs
-		rts				return to caller
-LC9D4		pshs a,b,x,y			save registers
-		ldx ,u				get start of screen address
-		ldd 2,u				get end of text area
-		subd #$20			knock one character row off it
-		std 2,s				save new display location
-		bsr LCA10			multiply by 8 - 8 pixel rows per cell
-		tfr d,y				save counter
-LC9E3		ldd $100,x			get bytes 8 pixel rows ahead
-		tst 7,u				do we need to skip the second screen?
-		bne LC9EF			brif so
-		std $1800,x			save scroll data on second screen
-LC9EF		std ,x++			save scroll data and move pointer ahead
-		leay -2,y			are we done yet?
-		bne LC9E3			brif not
-		ldb 6,u				fetch current background colour
-		sex				and make A match
-		ldy #$100			number of bytes to blank bottom row
-LC9FC		tst 7,u				are we doing second screen too?
-		bne LCA04			brif not
-		std $1800,x			blank pixels in second screen
-LCA04		std ,x++			blank pixels and move pointer forward
-		leay -2,y			are we done yet?
-		bne LC9FC			brif not
-		puls a,b,x,y,pc			restore registers and return
-LCA0C		lslb				; enter here to shift D left 5 bits
-		rola				;
-		lslb				;
-		rola				;
-LCA10		lslb				; enter here to shift D left 3 bits
-		rola				;
-LCA12		lslb				; enter here to shift D left 2 bits
-		rola				;
-		lslb				;
-		rola				;
+LC9B2		cmpa #$24			; is it backspace?	
+		beq LC9BF			; brif so
+		cmpa #$1f			; vertical spacer?
+		beq LC9CA			; brif so
+		bsr LCA17			; go handle a glyph
+		leax 1,x			; move to next character position
+		rts				; return to caller
+LC9BF		leax -1,x			; move display pointer back one
+		cmpx allones			; did we wrap around negative?			
+		bne LC9C9			; brif not
+		ldx 2,u				; get end of text area
+		leax -1,x			; move back one position to be in the text area
+LC9C9		rts				; return to caller
+LC9CA		leax $20,x			; move pointer forward one character row
+		exg d,x				; move pointer so we can do math
+		andb #$e0			; force pointer to the start of the line
+		exg d,x				; put pointer back where it belongs
+		rts				; return to caller
+LC9D4		pshs a,b,x,y			; save registers
+		ldx ,u				; get start of screen address
+		ldd 2,u				; get end of text area
+		subd #$20			; knock one character row off it
+		std 2,s				; save new display location
+		bsr LCA10			; multiply by 8 - 8 pixel rows per cell
+		tfr d,y				; save counter
+LC9E3		ldd $100,x			; get bytes 8 pixel rows ahead
+		tst 7,u				; do we need to skip the second screen?
+		bne LC9EF			; brif so
+		std $1800,x			; save scroll data on second screen
+LC9EF		std ,x++			; save scroll data and move pointer ahead
+		leay -2,y			; are we done yet?
+		bne LC9E3			; brif not
+		ldb 6,u				; fetch current background colour
+		sex				; and make A match
+		ldy #$100			; number of bytes to blank bottom row
+LC9FC		tst 7,u				; are we doing second screen too?
+		bne LCA04			; brif not
+		std $1800,x			; blank pixels in second screen
+LCA04		std ,x++			; blank pixels and move pointer forward
+		leay -2,y			; are we done yet?
+		bne LC9FC			; brif not
+		puls a,b,x,y,pc			; restore registers and return
+LCA0C		lslb				;* enter here to shift D left 5 bits
+		rola				;*
+		lslb				;*
+		rola				;*
+LCA10		lslb				;* enter here to shift D left 3 bits
+		rola				;*
+LCA12		lslb				;* enter here to shift D left 2 bits
+		rola				;*
+		lslb				;*
+		rola				;*
 		rts
-LCA17		pshs a,b,x,y,u			save registers
-		cmpa #$20			is it a printing character?
-		blo LCA29			brif so
-		suba #$20			mask off printing characters
-		ldb #7				7 bytes per font table entry
-		mul				get offset in table
-		addd #LDBB6			add in base address of table
-		tfr d,x				put font pointer somewhere useful
-		bra LCA44			go draw glyph
-LCA29		ldb #5				5 bytes per font table entry
-		mul				get offset in table
-		addd #LDB1B			add in base address of table
-		tfr d,x				put pointer somewhere useful
-		ldu #fontbuf			point to buffer to decode glyph data
-		decodestr			go decode a packed string
-		ldx #fontbuf+7			point one past end of buffer
-LCA39		lsl ,-x				; centre glyph data in byte
-		lsl ,x				;
-		cmpx #fontbuf			at start of buffer?
-		bhi LCA39			brif not - keep centring
-		ldu 6,s				get back U value
-LCA44		ldd 4,u				get display address location
-		bsr LCA10			multiply by 8 - gets start of row in 11..8
-		lsrb				; and divide lsb by 8 again to get offset within
-		lsrb				; the row to bits 4..0
-		lsrb				; and force to top of character cell
-		addd ,u				add in start of text area
-		tfr d,y				put pointer somewhere useful
-		ldb #7				seven bytes to copy
-LCA51		lda ,x+				get byte from font data
-		eora 6,u			merge with background colour
-		sta ,y				save it on the screen
-		tst 7,u				do we need to update second screen?
-		bne LCA5F			brif not
-		sta $1800,y			save pixels on second screen
-LCA5F		leay $20,y			move display pointer down one pixel row
-		decb				are we done yet?
-		bne LCA51			brif not - do another
-		puls a,b,x,y,u,pc		restore registers and return
+LCA17		pshs a,b,x,y,u			; save registers
+		cmpa #$20			; is it a printing character?
+		blo LCA29			; brif so
+		suba #$20			; mask off printing characters
+		ldb #7				; 7 bytes per font table entry
+		mul				; get offset in table
+		addd #LDBB6			; add in base address of table
+		tfr d,x				; put font pointer somewhere useful
+		bra LCA44			; go draw glyph
+LCA29		ldb #5				; 5 bytes per font table entry
+		mul				; get offset in table
+		addd #LDB1B			; add in base address of table
+		tfr d,x				; put pointer somewhere useful
+		ldu #fontbuf			; point to buffer to decode glyph data
+		decodestr			; go decode a packed string
+		ldx #fontbuf+7			; point one past end of buffer
+LCA39		lsl ,-x				;* centre glyph data in byte
+		lsl ,x				;*
+		cmpx #fontbuf			; at start of buffer?
+		bhi LCA39			; brif not - keep centring
+		ldu 6,s				; get back U value
+LCA44		ldd 4,u				; get display address location
+		bsr LCA10			; multiply by 8 - gets start of row in 11..8
+		lsrb				;* and divide lsb by 8 again to get offset within
+		lsrb				;* the row to bits 4..0
+		lsrb				;* and force to top of character cell
+		addd ,u				; add in start of text area
+		tfr d,y				; put pointer somewhere useful
+		ldb #7				; seven bytes to copy
+LCA51		lda ,x+				; get byte from font data
+		eora 6,u			; merge with background colour
+		sta ,y				; save it on the screen
+		tst 7,u				; do we need to update second screen?
+		bne LCA5F			; brif not
+		sta $1800,y			; save pixels on second screen
+LCA5F		leay $20,y			; move display pointer down one pixel row
+		decb				; are we done yet?
+		bne LCA51			; brif not - do another
+		puls a,b,x,y,u,pc		; restore registers and return
 ; This routine divides a 16 bit unsigned value in D by a 16 bit unsigned value in X. The result
 ; will be in D with the binary point to the right of A.
-LCA67		pshs a,b,x			make hole for result and save divisor
-		clr ,s				; initialize quotient
-		clr 1,s				;
-		clr V2C1			use V2C1 for extra precision on dividend
-		std V2C2			save dividend
-		beq LCA97			brif dividend is zero - nothing to do
-		cmpd 2,s			is dividend equal to divisor?
-		bne LCA7C			brif not
-		inc ,s				set quotient to 1.0
-		bra LCA97			go return
-LCA7C		ldx #16				we need to do 16 iterations
-LCA7F		lsl V2C3			; shift dividend
-		rol V2C2			;
-		rol V2C1			;
-		lsl 1,s				= shift quotient
-		rol ,s				=
-		ldd V2C1			get dividend high word
-		subd 2,s			subtract out divisor
-		bcs LCA93			brif it doesn't go
-		std V2C1			save new dividend residue
-		inc 1,s				record the fact that it went
-LCA93		leax -1,x			have we done all 16 bits?
-		bne LCA7F			brif not
-LCA97		puls a,b,x,pc			fetch result, restore registers, and return
-LCA99		coma				; do a one's complement of D
-		comb				;
-		addd #1				adding 1 turns it into negation
-		rts				return to caller
-LCA9F		pshs a,b,x			save registers
-		ldx pixelcount			get number of pixels to draw
-		ldd ,s				get the difference
-		bpl LCAAE			brif positive
-		bsr LCA99			negate difference
-		bsr LCA67			divide by number of pixels
-		bsr LCA99			negate the result
-		skip2				skip next instruction
-LCAAE		bsr LCA67			divide by number of pixels
-		std ,s				save step value
-		puls a,b,x,pc			restore registers and return
-LCAB4		jmp LCB8A			go return from the line drawing routine
+LCA67		pshs a,b,x			; make hole for result and save divisor
+		clr ,s				;* initialize quotient
+		clr 1,s				;*
+		clr V2C1			; use V2C1 for extra precision on dividend
+		std V2C2			; save dividend
+		beq LCA97			; brif dividend is zero - nothing to do
+		cmpd 2,s			; is dividend equal to divisor?
+		bne LCA7C			; brif not
+		inc ,s				; set quotient to 1.0
+		bra LCA97			; go return
+LCA7C		ldx #16				; we need to do 16 iterations
+LCA7F		lsl V2C3			;* shift dividend
+		rol V2C2			;*
+		rol V2C1			;*
+		lsl 1,s				;= shift quotient
+		rol ,s				;=
+		ldd V2C1			; get dividend high word
+		subd 2,s			; subtract out divisor
+		bcs LCA93			; brif it doesn't go
+		std V2C1			; save new dividend residue
+		inc 1,s				; record the fact that it went
+LCA93		leax -1,x			; have we done all 16 bits?
+		bne LCA7F			; brif not
+LCA97		puls a,b,x,pc			; fetch result, restore registers, and return
+LCA99		coma				;* do a one's complement of D
+		comb				;*
+		addd #1				; adding 1 turns it into negation
+		rts				; return to caller
+LCA9F		pshs a,b,x			; save registers
+		ldx pixelcount			; get number of pixels to draw
+		ldd ,s				; get the difference
+		bpl LCAAE			; brif positive
+		bsr LCA99			; negate difference
+		bsr LCA67			; divide by number of pixels
+		bsr LCA99			; negate the result
+		skip2				; skip next instruction
+LCAAE		bsr LCA67			; divide by number of pixels
+		std ,s				; save step value
+		puls a,b,x,pc			; restore registers and return
+LCAB4		jmp LCB8A			; go return from the line drawing routine
 ; Draw a line from (xbeg,ybeg) to (xend,yend) respecting the light level in the dungeon (lightlevel)
 ; which is used as a step count between when to actually draw pixels.
 ;
@@ -1926,116 +1926,116 @@
 ;
 ; Note: ypstep+1 and xpstep+1 are also used as temporary holding values for the
 ; integer difference in the Y and X coordinates respectively.
-drawline	pshs a,b,x,y,u			save registers
-		inc lightlevel			are we completely dark?
-		beq LCAB4			brif so - we can short circuit drawing entirely
-		lda lightlevel			get light level in dungeon
-		sta lightcount			save in working count (skip count for pixel drawing)
-		ldd xend			get end X coordinate
-		subd xbeg			subtract start X coordinate
-		std xpstep+1			save coordinate difference
-		bpl LCACB			brif positive difference
-		bsr LCA99			negate the difference
-LCACB		std pixelcount			save absolute value of X difference as pixel count
-		ldd yend			get end Y coordinate
-		subd ybeg			subtract start Y coordinate
-		std ypstep+1			save coordinate difference
-		bpl LCAD7			brif positive difference
-		bsr LCA99			negate the difference
-LCAD7		cmpd pixelcount			is the Y difference bigger than X?
-		blt LCAE0			brif not
-		std pixelcount			save Y difference as pixel count
-		beq LCAB4			brif no pixels to draw - short circuit
-LCAE0		ldd xpstep+1			get X difference
-		bsr LCA9F			calculate X stepping value
-		std xpstep+1			save X stepping value
-		tfr a,b				save msb of difference
-		sex				sign extend it
-		ldb #1				X stepping value - 1 for ascending
-		sta xpstep			sign extend stepping difference to 24 bits
-		bpl LCAF0			brif positive
-		negb				set stepping value to -1
-LCAF0		stb xbstep			save X byte stepping value
-		ldd ypstep+1			get Y difference
-		bsr LCA9F			calculate Y step value
-		std ypstep+1			save result
-		tfr a,b				save msb of difference
-		sex				sign extend it
-		ldb #$20			Y byte stepping value - 32 bytes per line, ascending
-		sta ypstep			sign extend the difference to 24 bits
-		bpl LCB02			brif positive
-		negb				negate the difference - -32 bytes per line, descending
-LCB02		stb xystep			save Y byte stepping value
-		ldd xbeg			get start X coordinate
-		std xcur			save in X coordinate counter
-		ldd ybeg			get start Y coordinate
-		std ycur			save in Y coordinate counter
-		lda #$80			value for low 8 bits to make the values ".5"
-		sta xcur+2			set X coordinate to ".5"
-		sta ycur+2			set Y coordinate to ".5"
-		ldx 2,u				get end of graphics area address
-		stx drawend			save it for later
-		ldx ,u				get start of graphics area address
-		stx drawstart			save it for later
-		ldd ycur			get Y coordinate for pixel
-		jsr LCA0C			shift left 5 bits - 32 bytes per row
-		leax d,x			add to screen start address
-		ldd xcur			get X coordinate for pixel
-		jsr LD37F			shift right 3 bits - 8 pixels per byte
-		leax d,x			add to row start address
-		ldu #LCB8E			point to table of pixel masks
-		ldy pixelcount			get number of pixels to draw
-LCB2E		dec lightcount			are we ready to draw another pixel (due to light level)?
-		bne LCB54			brif not
-		lda lightlevel			get light level
-		sta lightcount			reset current "pixel delay"
-		tst xcur			is X coordinate off the right of the screen?
-		bne LCB54			brif so
-		cmpx drawstart			is the pixel address before the start of the graphics area?
-		blo LCB54			brif so
-		cmpx drawend			is the pixel address after the end of the graphics area?
-		bhs LCB54			brif so
-		ldb xcur+1			get X coordinate lsb
-		andb #7				mask off low 3 bits for offset in byte
-		lda b,u				get pixel mask to use
-		tst levbgmask			currently using black background?
-		beq LCB50			brif so
-		coma				invert mask for white background
-		anda ,x				merge in existing graphics data
-		skip2				skip next instruction
-LCB50		ora ,x				merge in existing graphics data (black background)
-		sta ,x				save new graphics data on the screen
-LCB54		lda xcur+1			get X coordinate lsb
-		anda #$f8			mask off the pixel offset in the byte
-		sta V2C1			save it for later
-		ldd xcur+1			get X coordinate low bits
-		addd xpstep+1			add in X difference
-		std xcur+1			save new low bits for X coordinate
-		ldb xcur			get X coordinate high bits
-		adcb xpstep			add in difference high bits
-		stb xcur			save new X coordinate high bits
-		anda #$f8			mask off pixel offset in data byte
-		cmpa V2C1			are we in the same byte?
-		beq LCB70			brif so
-		ldb xbstep			get byte X step value 
-		leax b,x			move pointer appropriately
-LCB70		ldd ycur+1			get Y coord low bits
-		sta V2C1			save screen Y coordinate
-		addd ypstep+1			add in Y step value low bits
-		std ycur+1			save new low bits
-		ldb ycur			get Y coord high bits
-		adcb ypstep			add in Y step value high bits
-		stb ycur			save new Y coord high bits
-		cmpa V2C1			are we on the same scren row?
-		beq LCB86			brif so
-		ldb xystep			get Y byte step value
-		leax b,x			move pointer appropriately
-LCB86		leay -1,y			have we drawn all the pixels?
-		bne LCB2E			brif not - draw another
-LCB8A		dec lightlevel			compensate for "inc" above
-		puls a,b,x,y,u,pc		restore registers and return
-LCB8E		fcb $80,$40,$20,$10		pixels 0, 1, 2, 3 (left to right) in byte
-		fcb $08,$04,$02,$01		pixels 4, 5, 6, 7 (left to right) in byte
+drawline	pshs a,b,x,y,u			; save registers
+		inc lightlevel			; are we completely dark?
+		beq LCAB4			; brif so - we can short circuit drawing entirely
+		lda lightlevel			; get light level in dungeon
+		sta lightcount			; save in working count (skip count for pixel drawing)
+		ldd xend			; get end X coordinate
+		subd xbeg			; subtract start X coordinate
+		std xpstep+1			; save coordinate difference
+		bpl LCACB			; brif positive difference
+		bsr LCA99			; negate the difference
+LCACB		std pixelcount			; save absolute value of X difference as pixel count
+		ldd yend			; get end Y coordinate
+		subd ybeg			; subtract start Y coordinate
+		std ypstep+1			; save coordinate difference
+		bpl LCAD7			; brif positive difference
+		bsr LCA99			; negate the difference
+LCAD7		cmpd pixelcount			; is the Y difference bigger than X?
+		blt LCAE0			; brif not
+		std pixelcount			; save Y difference as pixel count
+		beq LCAB4			; brif no pixels to draw - short circuit
+LCAE0		ldd xpstep+1			; get X difference
+		bsr LCA9F			; calculate X stepping value
+		std xpstep+1			; save X stepping value
+		tfr a,b				; save msb of difference
+		sex				; sign extend it
+		ldb #1				; X stepping value - 1 for ascending
+		sta xpstep			; sign extend stepping difference to 24 bits
+		bpl LCAF0			; brif positive
+		negb				; set stepping value to -1
+LCAF0		stb xbstep			; save X byte stepping value
+		ldd ypstep+1			; get Y difference
+		bsr LCA9F			; calculate Y step value
+		std ypstep+1			; save result
+		tfr a,b				; save msb of difference
+		sex				; sign extend it
+		ldb #$20			; Y byte stepping value - 32 bytes per line, ascending
+		sta ypstep			; sign extend the difference to 24 bits
+		bpl LCB02			; brif positive
+		negb				; negate the difference - -32 bytes per line, descending
+LCB02		stb xystep			; save Y byte stepping value
+		ldd xbeg			; get start X coordinate
+		std xcur			; save in X coordinate counter
+		ldd ybeg			; get start Y coordinate
+		std ycur			; save in Y coordinate counter
+		lda #$80			; value for low 8 bits to make the values ".5"
+		sta xcur+2			; set X coordinate to ".5"
+		sta ycur+2			; set Y coordinate to ".5"
+		ldx 2,u				; get end of graphics area address
+		stx drawend			; save it for later
+		ldx ,u				; get start of graphics area address
+		stx drawstart			; save it for later
+		ldd ycur			; get Y coordinate for pixel
+		jsr LCA0C			; shift left 5 bits - 32 bytes per row
+		leax d,x			; add to screen start address
+		ldd xcur			; get X coordinate for pixel
+		jsr LD37F			; shift right 3 bits - 8 pixels per byte
+		leax d,x			; add to row start address
+		ldu #LCB8E			; point to table of pixel masks
+		ldy pixelcount			; get number of pixels to draw
+LCB2E		dec lightcount			; are we ready to draw another pixel (due to light level)?
+		bne LCB54			; brif not
+		lda lightlevel			; get light level
+		sta lightcount			; reset current "pixel delay"
+		tst xcur			; is X coordinate off the right of the screen?
+		bne LCB54			; brif so
+		cmpx drawstart			; is the pixel address before the start of the graphics area?
+		blo LCB54			; brif so
+		cmpx drawend			; is the pixel address after the end of the graphics area?
+		bhs LCB54			; brif so
+		ldb xcur+1			; get X coordinate lsb
+		andb #7				; mask off low 3 bits for offset in byte
+		lda b,u				; get pixel mask to use
+		tst levbgmask			; currently using black background?
+		beq LCB50			; brif so
+		coma				; invert mask for white background
+		anda ,x				; merge in existing graphics data
+		skip2				; skip next instruction
+LCB50		ora ,x				; merge in existing graphics data (black background)
+		sta ,x				; save new graphics data on the screen
+LCB54		lda xcur+1			; get X coordinate lsb
+		anda #$f8			; mask off the pixel offset in the byte
+		sta V2C1			; save it for later
+		ldd xcur+1			; get X coordinate low bits
+		addd xpstep+1			; add in X difference
+		std xcur+1			; save new low bits for X coordinate
+		ldb xcur			; get X coordinate high bits
+		adcb xpstep			; add in difference high bits
+		stb xcur			; save new X coordinate high bits
+		anda #$f8			; mask off pixel offset in data byte
+		cmpa V2C1			; are we in the same byte?
+		beq LCB70			; brif so
+		ldb xbstep			; get byte X step value 
+		leax b,x			; move pointer appropriately
+LCB70		ldd ycur+1			; get Y coord low bits
+		sta V2C1			; save screen Y coordinate
+		addd ypstep+1			; add in Y step value low bits
+		std ycur+1			; save new low bits
+		ldb ycur			; get Y coord high bits
+		adcb ypstep			; add in Y step value high bits
+		stb ycur			; save new Y coord high bits
+		cmpa V2C1			; are we on the same scren row?
+		beq LCB86			; brif so
+		ldb xystep			; get Y byte step value
+		leax b,x			; move pointer appropriately
+LCB86		leay -1,y			; have we drawn all the pixels?
+		bne LCB2E			; brif not - draw another
+LCB8A		dec lightlevel			; compensate for "inc" above
+		puls a,b,x,y,u,pc		; restore registers and return
+LCB8E		fcb $80,$40,$20,$10		; pixels 0, 1, 2, 3 (left to right) in byte
+		fcb $08,$04,$02,$01		; pixels 4, 5, 6, 7 (left to right) in byte
 LCB96		pshs a,x,u			; save registers
 		ldx V211			; get input buffer/line pointer
 		ldu #wordbuff			; point to word buffer
@@ -2168,9 +2168,9 @@
 		andb #$1f
 		cmpb 1,s
 LCC9A		puls a,b,pc
-LCC9C		ldx #mazedata			get start address to set to $ff
-		ldu #V9F4			get end address
-		setblock			go set block to $ff
+LCC9C		ldx #mazedata			; get start address to set to $ff
+		ldu #V9F4			; get end address
+		setblock			; go set block to $ff
 		ldx #LCD9F
 		ldb V281
 		abx
@@ -2831,28 +2831,28 @@
 LD215		anda #$1f
 		bsr LD24C
 		bra LD1EF
-LD21B		ldy V20D			fetch pointer to command sequence
-		ldb ,y+				do we have a command to do?
-		bpl LD229			brif so
-		delay				wait for a bit
-		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
-		decodestr			decode the keyword
-		leau 1,u			move past the "object type" flag
-		delay				wait a bit
-		skip2				skip next instruction
+LD21B		ldy V20D			; fetch pointer to command sequence
+		ldb ,y+				; do we have a command to do?
+		bpl LD229			; brif so
+		delay				; wait for a bit
+		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
+		decodestr			; decode the keyword
+		leau 1,u			; move past the "object type" flag
+		delay				; wait a bit
+		skip2				; skip next instruction
 LD235		bsr LD24C
-		lda ,u+				fetch a character from the decoded string
-		bpl LD235			brif not end of string
-		clra				code for a space
+		lda ,u+				; fetch a character from the decoded string
+		bpl LD235			; brif not end of string
+		clra				; code for a space
 		bsr LD24C			
-		decb				have we consumed all the words in this command?
-		bne LD229			brif not - get another
-		lda #$1f			code for carriage return
+		decb				; have we consumed all the words in this command?
+		bne LD229			; brif not - get another
+		lda #$1f			; code for carriage return
 		bsr LD24C
-		sty V20D			save new command stream pointer
+		sty V20D			; save new command stream pointer
 LD248		ldd #$0102
 		rts
 LD24C		pshs a,b,x,y,u
@@ -3135,7 +3135,7 @@
 		ldx ,u
 		ldu #V380
 		stx ,u
-		dec V2B7			set to nonstandard text rendering
+		dec V2B7			; set to nonstandard text rendering
 		rts
 LD495		bsr LD489			; clear the graphics area and set up for text rendering
 		clr V2B6			; flag column zero in object list
@@ -3308,14 +3308,14 @@
 		dec V29E
 		fadeinclrst
 		renderstrimmp
-		fcb $ff,$c4,$54,$3d		packed string victory message line 1
+		fcb $ff,$c4,$54,$3d		; packed string victory message line 1
 		fcb $84,$d8,$08,$59
 		fcb $D1,$2e,$c8,$03
 		fcb $70,$a6,$93,$05
 		fcb $10,$50,$20,$2e
 		fcb $20
 		renderstrimmp
-		fcb $c8,$00,$00,$00		packed string victory message line 2
+		fcb $c8,$00,$00,$00		; packed string victory message line 2
 		fcb $00,$03,$cc,$00
 		fcb $81,$c5,$b8,$2e
 		fcb $9d,$06,$44,$f7
@@ -3356,8 +3356,8 @@
 		bsr LD66D
 		bsr LD684
 LD667		bsr LD684
-LD669		dec pageswap			set graoguc swao required
-		sync				wait for swap to happen
+LD669		dec pageswap			; set graoguc swao required
+		sync				; wait for swap to happen
 		rts
 LD66D		andb #3
 		stb V223
@@ -3439,8 +3439,8 @@
 		addd damagelevel
 		std damagelevel
 		dod S0C
-		dec pageswap			set graphics swap required
-		sync				wait for swap to happen
+		dec pageswap			; set graphics swap required
+		sync				; wait for swap to happen
 		rts
 LD720		pshs a,b
 		clr ,-s
@@ -3554,38 +3554,38 @@
 		jmp LC27D
 		fcb $17
 		fdb V202
-		fcb $01				V202
-		fdb $ffff			allones - 16 bit all ones value, or -1
-		fcb $00				V205
-		fcb $80				V206
-		fcb 0				V207
-		fcb $4c				V208
-		fdb LD870			screenvis - pointer to primary display screen info
-		fdb LD876			screendraw - pointer to secondary display screen info
-		fdb demogame			V20D - pointer to demo game command sequence
-		fdb objecttab			objectfree - next free object entry
-		fdb V2F1			V211
-		fcb $0c				V213
-		fcb $16				V214
-		fdb $23				carryweight - the weight of objects the player is carrying
-		fdb $17a0			powerlevel - player power level
+		fcb $01				; V202
+		fdb $ffff			; allones - 16 bit all ones value, or -1
+		fcb $00				; V205
+		fcb $80				; V206
+		fcb 0				; V207
+		fcb $4c				; V208
+		fdb LD870			; screenvis - pointer to primary display screen info
+		fdb LD876			; screendraw - pointer to secondary display screen info
+		fdb demogame			; V20D - pointer to demo game command sequence
+		fdb objecttab			; objectfree - next free object entry
+		fdb V2F1			; V211
+		fcb $0c				; V213
+		fcb $16				; V214
+		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 $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
 		fcb $09,$09,$04,$02
 		fcb $00,$00,$00,$00
 		fcb $00,$00,$00,$00
@@ -3607,153 +3607,153 @@
 		fcb 0
 
 ; these tables are used for clearing and otherwise setting up the graphics screens
-LD870		fdb $1000			primary screen start address
-		fdb $2300			primary screen gfx area end address
-		fdb $2046			primary screen SAM register value
-LD876		fdb $2800			secondary screen start address
-		fdb $3b00			secondary screen gfx area end address
-		fdb $20a6			secondary screen SAM register value
-LD87C		fdb $2300			start address of status line on first screen
-		fdb $2400			end address of status line on first screen
-		fdb 0				dummy (SAM regster setting)
-		fdb $3b00			start address of status line on second screen
-		fdb $3c00			end address of status line on second screen
-		fdb 0				dummy (SAM register setting)
-LD888		fdb $2400			start address of command area on first screen
-		fdb $2800			end address of command area on first screen
-		fdb 0				dummy (SAM register setting)
-		fdb $3c00			start address of command area on second screen
-		fdb $4000			end address of command area on second screen
-		fdb 0				dummy (SAM register setting)
+LD870		fdb $1000			; primary screen start address
+		fdb $2300			; primary screen gfx area end address
+		fdb $2046			; primary screen SAM register value
+LD876		fdb $2800			; secondary screen start address
+		fdb $3b00			; secondary screen gfx area end address
+		fdb $20a6			; secondary screen SAM register value
+LD87C		fdb $2300			; start address of status line on first screen
+		fdb $2400			; end address of status line on first screen
+		fdb 0				; dummy (SAM regster setting)
+		fdb $3b00			; start address of status line on second screen
+		fdb $3c00			; end address of status line on second screen
+		fdb 0				; dummy (SAM register setting)
+LD888		fdb $2400			; start address of command area on first screen
+		fdb $2800			; end address of command area on first screen
+		fdb 0				; dummy (SAM register setting)
+		fdb $3c00			; start address of command area on second screen
+		fdb $4000			; end address of command area on second screen
+		fdb 0				; dummy (SAM register setting)
 
 ; This is the keyword table used for command parsing. Each keyword is stored in packed format.
 ; Each keyword is preceded by a value which indicates the object type. Where the object type is
 ; not relevant, that value will be zero. The value is shown in parentheses below.
-kwlist_cmd	fcb 15				15 keywords in the command list
-kw_attack	fcb $30,$03,$4a,$04,$6b		"ATTACK" keyword
-		fcb $28,$06,$c4,$b4,$40		"CLIMB" keyword
-		fcb $20,$09,$27,$c0		"DROP" keyword
-kw_examine	fcb $38,$0b,$80,$b5,$2e,$28	"EXAMINE" keyword
-		fcb $18,$0e,$5a,$00		"GET" keyword
-		fcb $30,$12,$e1,$85,$d4		"INCANT" keyword
-kw_look		fcb $20,$18,$f7,$ac		"LOOK" keyword
-kw_move		fcb $20,$1A,$fb,$14		"MOVE" keyword
-kw_pull		fcb $20,$21,$56,$30		"PULL" keyword
-		fcb $30,$24,$5b,$14,$2c		"REVEAL" keyword
-		fcb $20,$27,$47,$dc		"STOW" keyword
-kw_turn		fcb $20,$29,$59,$38		"TURN" keyword
-kw_use		fcb $18,$2b,$32,$80		"USE" keyword
-		fcb $28,$34,$c7,$84,$80		"ZLOAD" keyword
-		fcb $28,$35,$30,$d8,$a0		"ZSAVE" keyword
-kwlist_dir	fcb 6				6 keywords in direction list
-kw_left		fcb $20,$18,$53,$50		"LEFT" keyword
-kw_right	fcb $28,$24,$93,$a2,$80		"RIGHT" keyword
-		fcb $20,$04,$11,$ac		"BACK" keyword
-		fcb $30,$03,$27,$d5,$c4		"AROUND" keyword		
-		fcb $10,$2b,$00			"UP" keyword
-		fcb $20,$08,$fb,$b8		"DOWN" keyword
-kwlist_adj	fcb 25				25 keywords in the misc keywords list
-kw_supreme	fcb $38,$67,$58,$48,$ad,$28	"SUPREME" keyword (1)
-		fcb $28,$54,$fa,$b0,$a0		"JOULE" keyword (1)
-		fcb $31,$0a,$cb,$26,$68		"ELVISH" keyword (4)
-		fcb $38,$da,$9a,$22,$49,$60	"MITHRIL" keyword (3)
-		fcb $20,$a6,$52,$c8		"SEER" keyword (2)
-		fcb $28,$28,$82,$de,$60		"THEWS" keyword (0)
-		fcb $20,$64,$96,$94		"RIME" keyword (1)
-		fcb $30,$ac,$99,$a5,$ee		"VISION" keyword (2)
-		fcb $20,$02,$2c,$94		"ABYE" keyword (0)
-		fcb $20,$10,$16,$14		"HALE" keyword (0)
-		fcb $29,$66,$f6,$06,$40		"SOLAR" keyword (5)
-		fcb $30,$c5,$27,$bb,$45		"BRONZE" keyword (3)
-		fcb $30,$6d,$56,$0c,$2e		"VULCAN" keyword (1)
-		fcb $21,$13,$27,$b8		"IRON" keyword (4)
-		fcb $29,$59,$57,$06,$40		"LUNAR" keyword (5)
-		fcb $21,$60,$97,$14		"PINE" keyword (5)
-		fcb $38,$d8,$50,$d1,$05,$90	"LEATHER" keyword (3)
-		fcb $31,$2e,$f7,$90,$ae		"WOODEN" keyword (4)
-		fcb $28,$4c,$97,$05,$80		"FINAL" keyword (1)
-		fcb $30,$4a,$e2,$c8,$f9		"ENERGY" keyword (1)
-		fcb $18,$52,$32,$80		"ICE" keyword (1)
-		fcb $20,$4c,$99,$14		"FIRE" keyword (1)
-		fcb $20,$4e,$f6,$10		"GOLD" keyword (1)
-		fcb $28,$0a,$d8,$53,$20		"EMPTY" keyword (0)
-		fcb $21,$48,$50,$90		"DEAD" keyword (5)
-kwlist_obj	fcb 6				6 object types in the following list
-kw_flask	fcb $28,$0c,$c0,$cd,$60		"FLASK" keyword (0)
-		fcb $20,$64,$97,$1c		"RING" keyword (1)
-		fcb $30,$a6,$39,$3d,$8c		"SCROLL" keyword (2)
-kw_shield	fcb $30,$e6,$84,$95,$84		"SHIELD" keyword (3)
-kw_sword	fcb $29,$27,$77,$c8,$80		"SWORD" keyword (4)
-kw_torch	fcb $29,$68,$f9,$0d,$00		"TORCH" keyword (5)
+kwlist_cmd	fcb 15				; 15 keywords in the command list
+kw_attack	fcb $30,$03,$4a,$04,$6b		; "ATTACK" keyword
+		fcb $28,$06,$c4,$b4,$40		; "CLIMB" keyword
+		fcb $20,$09,$27,$c0		; "DROP" keyword
+kw_examine	fcb $38,$0b,$80,$b5,$2e,$28	; "EXAMINE" keyword
+		fcb $18,$0e,$5a,$00		; "GET" keyword
+		fcb $30,$12,$e1,$85,$d4		; "INCANT" keyword
+kw_look		fcb $20,$18,$f7,$ac		; "LOOK" keyword
+kw_move		fcb $20,$1A,$fb,$14		; "MOVE" keyword
+kw_pull		fcb $20,$21,$56,$30		; "PULL" keyword
+		fcb $30,$24,$5b,$14,$2c		; "REVEAL" keyword
+		fcb $20,$27,$47,$dc		; "STOW" keyword
+kw_turn		fcb $20,$29,$59,$38		; "TURN" keyword
+kw_use		fcb $18,$2b,$32,$80		; "USE" keyword
+		fcb $28,$34,$c7,$84,$80		; "ZLOAD" keyword
+		fcb $28,$35,$30,$d8,$a0		; "ZSAVE" keyword
+kwlist_dir	fcb 6				; 6 keywords in direction list
+kw_left		fcb $20,$18,$53,$50		; "LEFT" keyword
+kw_right	fcb $28,$24,$93,$a2,$80		; "RIGHT" keyword
+		fcb $20,$04,$11,$ac		; "BACK" keyword
+		fcb $30,$03,$27,$d5,$c4		; "AROUND" keyword		
+		fcb $10,$2b,$00			; "UP" keyword
+		fcb $20,$08,$fb,$b8		; "DOWN" keyword
+kwlist_adj	fcb 25				; 25 keywords in the misc keywords list
+kw_supreme	fcb $38,$67,$58,$48,$ad,$28	; "SUPREME" keyword (1)
+		fcb $28,$54,$fa,$b0,$a0		; "JOULE" keyword (1)
+		fcb $31,$0a,$cb,$26,$68		; "ELVISH" keyword (4)
+		fcb $38,$da,$9a,$22,$49,$60	; "MITHRIL" keyword (3)
+		fcb $20,$a6,$52,$c8		; "SEER" keyword (2)
+		fcb $28,$28,$82,$de,$60		; "THEWS" keyword (0)
+		fcb $20,$64,$96,$94		; "RIME" keyword (1)
+		fcb $30,$ac,$99,$a5,$ee		; "VISION" keyword (2)
+		fcb $20,$02,$2c,$94		; "ABYE" keyword (0)
+		fcb $20,$10,$16,$14		; "HALE" keyword (0)
+		fcb $29,$66,$f6,$06,$40		; "SOLAR" keyword (5)
+		fcb $30,$c5,$27,$bb,$45		; "BRONZE" keyword (3)
+		fcb $30,$6d,$56,$0c,$2e		; "VULCAN" keyword (1)
+		fcb $21,$13,$27,$b8		; "IRON" keyword (4)
+		fcb $29,$59,$57,$06,$40		; "LUNAR" keyword (5)
+		fcb $21,$60,$97,$14		; "PINE" keyword (5)
+		fcb $38,$d8,$50,$d1,$05,$90	; "LEATHER" keyword (3)
+		fcb $31,$2e,$f7,$90,$ae		; "WOODEN" keyword (4)
+		fcb $28,$4c,$97,$05,$80		; "FINAL" keyword (1)
+		fcb $30,$4a,$e2,$c8,$f9		; "ENERGY" keyword (1)
+		fcb $18,$52,$32,$80		; "ICE" keyword (1)
+		fcb $20,$4c,$99,$14		; "FIRE" keyword (1)
+		fcb $20,$4e,$f6,$10		; "GOLD" keyword (1)
+		fcb $28,$0a,$d8,$53,$20		; "EMPTY" keyword (0)
+		fcb $21,$48,$50,$90		; "DEAD" keyword (5)
+kwlist_obj	fcb 6				; 6 object types in the following list
+kw_flask	fcb $28,$0c,$c0,$cd,$60		; "FLASK" keyword (0)
+		fcb $20,$64,$97,$1c		; "RING" keyword (1)
+		fcb $30,$a6,$39,$3d,$8c		; "SCROLL" keyword (2)
+kw_shield	fcb $30,$e6,$84,$95,$84		; "SHIELD" keyword (3)
+kw_sword	fcb $29,$27,$77,$c8,$80		; "SWORD" keyword (4)
+kw_torch	fcb $29,$68,$f9,$0d,$00		; "TORCH" keyword (5)
 ; The following is the sequence of commands used in the demo game
-demogame	fcb 1				EXAMINE
+demogame	fcb 1				; EXAMINE
 		fdb kw_examine
-		fcb 3				PULL RIGHT TORCH
+		fcb 3				; PULL RIGHT TORCH
 		fdb kw_pull
 		fdb kw_right
 		fdb kw_torch
-		fcb 2				USE RIGHT
+		fcb 2				; USE RIGHT
 		fdb kw_use
 		fdb kw_right
-		fcb 1				LOOK
+		fcb 1				; LOOK
 		fdb kw_look
-		fcb 1				MOVE
+		fcb 1				; MOVE
 		fdb kw_move
-		fcb 3				PULL LEFT SHIELD
+		fcb 3				; PULL LEFT SHIELD
 		fdb kw_pull
 		fdb kw_left
 		fdb kw_shield
-		fcb 3				PULL RIGHT SWORD
+		fcb 3				; PULL RIGHT SWORD
 		fdb kw_pull
 		fdb kw_right
 		fdb kw_sword
-		fcb 1				MOVE
+		fcb 1				; MOVE
 		fdb kw_move
-		fcb 1				MOVE
+		fcb 1				; MOVE
 		fdb kw_move
-		fcb 2				ATTACK RIGHT
+		fcb 2				; ATTACK RIGHT
 		fdb kw_attack
 		fdb kw_right
-		fcb 2				TURN RIGHT
+		fcb 2				; TURN RIGHT
 		fdb kw_turn
 		fdb kw_right
-		fcb 1				MOVE
+		fcb 1				; MOVE
 		fdb kw_move
-		fcb 1				MOVE
+		fcb 1				; MOVE
 		fdb kw_move
-		fcb 1				MOVE
+		fcb 1				; MOVE
 		fdb kw_move
-		fcb 2				TURN RIGHT
+		fcb 2				; TURN RIGHT
 		fdb kw_turn
 		fdb kw_right
-		fcb 1				MOVE
+		fcb 1				; MOVE
 		fdb kw_move
-		fcb 1				MOVE
+		fcb 1				; MOVE
 		fdb kw_move
 		fcb $ff
 ; jump table for commands
-LD9D0		fdb cmd_attack			ATTACK
-		fdb cmd_climb			CLIMB
-		fdb cmd_drop			DROP
-		fdb cmd_examine			EXAMINE
-		fdb cmd_get			GET
-		fdb cmd_incant			INCANT
-		fdb cmd_look			LOOK
-		fdb cmd_move			MOVE
-		fdb cmd_pull			PULL
-		fdb cmd_reveal			REVEAL
-		fdb cmd_stow			STOW
-		fdb cmd_turn			TURN
-		fdb cmd_use			USE
-		fdb cmd_zload			ZLOAD
-		fdb cmd_zsave			ZSAVE
+LD9D0		fdb cmd_attack			; ATTACK
+		fdb cmd_climb			; CLIMB
+		fdb cmd_drop			; DROP
+		fdb cmd_examine			; EXAMINE
+		fdb cmd_get			; GET
+		fdb cmd_incant			; INCANT
+		fdb cmd_look			; LOOK
+		fdb cmd_move			; MOVE
+		fdb cmd_pull			; PULL
+		fdb cmd_reveal			; REVEAL
+		fdb cmd_stow			; STOW
+		fdb cmd_turn			; TURN
+		fdb cmd_use			; USE
+		fdb cmd_zload			; ZLOAD
+		fdb cmd_zsave			; ZSAVE
 ; pointers to the image data for object types
-LD9EE		fdb img_flask			flask
-		fdb img_ring			ring
-		fdb img_scroll			scroll
-		fdb img_shield			shield
-		fdb img_sword			sword
-		fdb img_torch			torch
+LD9EE		fdb img_flask			; flask
+		fdb img_ring			; ring
+		fdb img_scroll			; scroll
+		fdb img_shield			; shield
+		fdb img_sword			; sword
+		fdb img_torch			; torch
 
 LD9FA		fcb $05,$01
 
@@ -3855,42 +3855,42 @@
 LDB18		fcb $00,$0D,$07
 
 ; This is the text font - these values are in packed format
-LDB1B		fcb $30,$00,$00,$00,$00		char code 0 - space
-		fcb $31,$15,$18,$fe,$31		char code 1 - A
-		fcb $37,$a3,$1f,$46,$3e		char code 2 - B
-		fcb $33,$a3,$08,$42,$2e		char code 3 - C
-		fcb $37,$a3,$18,$c6,$3e		char code 4 - D	
-		fcb $37,$e1,$0f,$42,$1f		char code 5 - E
-		fcb $37,$e1,$0f,$42,$10		char code 6 - F
-		fcb $33,$e3,$08,$4e,$2f		char code 7 - G
-		fcb $34,$63,$1f,$c6,$31		char code 8 - H
-		fcb $33,$88,$42,$10,$8e		char code 9 - I
-		fcb $30,$42,$10,$86,$2e		char code 10 - J
-		fcb $34,$65,$4c,$52,$51		char code 11 - K
-		fcb $34,$21,$08,$42,$1f		char code 12 - L
-		fcb $34,$77,$5a,$d6,$31		char code 13 - M
-		fcb $34,$63,$9a,$ce,$31		char code 14 - N
-		fcb $33,$a3,$18,$c6,$2e		char code 15 - O
-		fcb $37,$a3,$1f,$42,$10		char code 16 - P
-		fcb $33,$a3,$18,$d6,$4d		char code 17 - Q
-		fcb $37,$a3,$1f,$52,$51		char code 18 - R
-		fcb $33,$a3,$07,$06,$2e		char code 19 - S
-		fcb $37,$ea,$42,$10,$84		char code 20 - T
-		fcb $34,$63,$18,$c6,$2e		char code 21 - U
-		fcb $34,$63,$15,$28,$84		char code 22 - V
-		fcb $34,$63,$1a,$d7,$71		char code 23 - W
-		fcb $34,$62,$a2,$2a,$31		char code 24 - X
-		fcb $34,$62,$a2,$10,$84		char code 25 - Y
-		fcb $37,$c2,$22,$22,$1f		char code 26 - Z
-		fcb $31,$08,$42,$10,$04		char code 27 - !
-		fcb $30,$00,$00,$00,$1f		char code 28 - underscore
-		fcb $33,$a2,$13,$10,$04		char code 29 - ?
-		fcb $30,$00,$00,$00,$04		char code 30 - .
+LDB1B		fcb $30,$00,$00,$00,$00		; char code 0 - space
+		fcb $31,$15,$18,$fe,$31		; char code 1 - A
+		fcb $37,$a3,$1f,$46,$3e		; char code 2 - B
+		fcb $33,$a3,$08,$42,$2e		; char code 3 - C
+		fcb $37,$a3,$18,$c6,$3e		; char code 4 - D	
+		fcb $37,$e1,$0f,$42,$1f		; char code 5 - E
+		fcb $37,$e1,$0f,$42,$10		; char code 6 - F
+		fcb $33,$e3,$08,$4e,$2f		; char code 7 - G
+		fcb $34,$63,$1f,$c6,$31		; char code 8 - H
+		fcb $33,$88,$42,$10,$8e		; char code 9 - I
+		fcb $30,$42,$10,$86,$2e		; char code 10 - J
+		fcb $34,$65,$4c,$52,$51		; char code 11 - K
+		fcb $34,$21,$08,$42,$1f		; char code 12 - L
+		fcb $34,$77,$5a,$d6,$31		; char code 13 - M
+		fcb $34,$63,$9a,$ce,$31		; char code 14 - N
+		fcb $33,$a3,$18,$c6,$2e		; char code 15 - O
+		fcb $37,$a3,$1f,$42,$10		; char code 16 - P
+		fcb $33,$a3,$18,$d6,$4d		; char code 17 - Q
+		fcb $37,$a3,$1f,$52,$51		; char code 18 - R
+		fcb $33,$a3,$07,$06,$2e		; char code 19 - S
+		fcb $37,$ea,$42,$10,$84		; char code 20 - T
+		fcb $34,$63,$18,$c6,$2e		; char code 21 - U
+		fcb $34,$63,$15,$28,$84		; char code 22 - V
+		fcb $34,$63,$1a,$d7,$71		; char code 23 - W
+		fcb $34,$62,$a2,$2a,$31		; char code 24 - X
+		fcb $34,$62,$a2,$10,$84		; char code 25 - Y
+		fcb $37,$c2,$22,$22,$1f		; char code 26 - Z
+		fcb $31,$08,$42,$10,$04		; char code 27 - !
+		fcb $30,$00,$00,$00,$1f		; char code 28 - underscore
+		fcb $33,$a2,$13,$10,$04		; char code 29 - ?
+		fcb $30,$00,$00,$00,$04		; char code 30 - .
 ; some special glyphs
-LDBB6		fcb $00,$00,$01,$01,$00,$00,$00	char code 32 - left part of contracted heart
-		fcb $00,$a0,$f0,$f0,$e0,$40,$00	char code 33 - right part of contracted heart
-		fcb $00,$01,$03,$03,$01,$00,$00	char code 34 - left half of expanded heart
-		fcb $00,$b0,$f8,$f8,$f0,$e0,$40	char code 35 - right part of expanded heart
+LDBB6		fcb $00,$00,$01,$01,$00,$00,$00	; char code 32 - left part of contracted heart
+		fcb $00,$a0,$f0,$f0,$e0,$40,$00	; char code 33 - right part of contracted heart
+		fcb $00,$01,$03,$03,$01,$00,$00	; char code 34 - left half of expanded heart
+		fcb $00,$b0,$f8,$f8,$f0,$e0,$40	; char code 35 - right part of expanded heart
 
 LDBD2		fcb $00,$80