changeset 39:8fd288f0b01c

Fill in some various missing comments.
author William Astle <lost@l-w.ca>
date Sat, 27 Dec 2014 00:37:47 -0700
parents c8893fb9cacc
children 37d79ba45284
files dod.s
diffstat 1 files changed, 36 insertions(+), 36 deletions(-) [+]
line wrap: on
line diff
--- a/dod.s	Sat Dec 27 00:26:01 2014 -0700
+++ b/dod.s	Sat Dec 27 00:37:47 2014 -0700
@@ -3259,44 +3259,45 @@
 		updatedungeon			; update the display
 		rts				; return to caller
 LD489		cleargfx2			; clear graphics
-		ldx ,u
-		ldu #V380
-		stx ,u
+		ldx ,u				; get current text area start
+		ldu #V380			; point to info text area descriptor
+		stx ,u				; set text area start to the same place
 		dec V2B7			; set to nonstandard text rendering
-		rts
+		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
-		ldd #10				; set up to centre "IN THIS ROOM"
-		std 4,u
+		ldd #10				;* set up to centre "IN THIS ROOM"
+		std 4,u				;* column 10, row 0
 		renderstrimmp			; show the "IN THIS ROOM" heading
 		fcb $62,$5c,$0a,$21		; packed string "IN THIS ROOM"
 		fcb $33,$04,$9e,$f6
 		fcb $fc
-		ldd playerloc
-		jsr LCF82
-		beq LD4C0
-		ldx 4,u
-		leax 11,x
-		stx 4,u
+		ldd playerloc			; get player location
+		jsr LCF82			; get creature at player location
+		beq LD4C0			; brif no creature there
+		ldx 4,u				; get current text position
+		leax 11,x			; move 11 over
+		stx 4,u				; save new position
 		renderstrimmp			; show the "!CREATURE!" string if a creature is present
 		fcb $56,$c7,$22,$86		; packed string "!CREATURE!"
 		fcb $95,$91,$77,$f0
-LD4C0		clr V291
-LD4C2		ldd playerloc
-		jsr LCF53
-		beq LD4CD
-		bsr LD505
-		bra LD4C2
-LD4CD		tst V2B6
-		beq LD4D3
-		bsr LD4FE
+LD4C0		clr V291			; reset object iterator
+LD4C2		ldd playerloc			; get player location
+		jsr LCF53			; fetch next object
+		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?
+		beq LD4D3			; brif so
+		bsr LD4FE			; do a newline
 LD4D3		ldd #$1b20			; set up for displaying a row of !!!!
 LD4D6		renderchar			; display a !
 		decb				; done enough of them?
 		bne LD4D6			; brif not
-		ldx 4,u				; set up to centre "BACKPACK"
-		leax 12,x
-		stx 4,u
+		ldx 4,u				; get current text location
+		leax 12,x			; adjust for centering
+		stx 4,u				; save new text location
 		renderstrimmp			; display "BACKPACK" heading
 		fcb $40,$82,$35,$c0		; packed string "BACKPACK"
 		fcb $23,$5f,$c0
@@ -3309,16 +3310,16 @@
 LD4F7		bsr LD505			; display ojbect name
 		bra LD4ED			; go display another object
 LD4FB		clr V2B7			; reset to standard text rendering
-		rts
+		rts				; return to caller
 LD4FE		lda #$1f			; character code for newline
 		renderchar			; go move to next line
 		clr V2B6			; flag column 1
-		rts
+		rts				; return to caller
 LD505		pshs a,b,x			; save registers
 		jsr LC617			; fetch object name string (decoded)
 		renderstr			; display object name
-		lda levbgmask			; restore the proper text coloring
-		sta 6,u
+		lda levbgmask			; get current level mask
+		sta 6,u				; restore proper background
 		com V2B6			; are we on column 1 or 2?
 		beq LD51E			; brif back at column 1
 		ldd 4,u				; get cursor position
@@ -3961,14 +3962,13 @@
 		fdb img_wizardgen		; wizard's image
 		fdb img_wizard			; wizard
 ; This is the creature data table. Each entry is 8 bytes organized as follows:
-; 0
-; 1
-; 2
-; 3
-; 4
-; 5
-; 6	creature scheduling speed (movement)
-; 7
+; 0,1	creature power level
+; 2	creature magical attack strength
+; 3	creature magical defense strength
+; 4	creature physical attack strength
+; 5	creature physical defense strength
+; 6	creature scheduling speed (movement) (in tenths of a second)
+; 7	creature scheduling speed (attack) (in tenths of a second)
 LDABB		fcb $00,$20,$00,$FF,$80,$FF,$17,$0B ; spider
 		fcb $00,$38,$00,$FF,$50,$80,$0F,$07 ; viper
 		fcb $00,$C8,$00,$FF,$34,$C0,$1D,$17 ; club giant