changeset 35:48ad2dd3b1e9

Add credits command and display by default in pause mode.
author William Astle <lost@l-w.ca>
date Fri, 02 Jan 2015 18:52:22 -0700
parents 31983aaad910
children dd3c541ae75b
files dod.s
diffstat 1 files changed, 37 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/dod.s	Fri Jan 02 18:31:30 2015 -0700
+++ b/dod.s	Fri Jan 02 18:52:22 2015 -0700
@@ -438,6 +438,7 @@
 textother	rmb 1				; nonzero means nonstandard text location
 loadsaveflag	rmb 1				; load/save flag - <0 = ZLOAD, >0 = ZSAVE, 0 = regular init
 pausemode	rmb 1				; nonzero = game paused
+pausedispptr	rmb 2				; saved dungeon display pointer in pause
 schedtabfree	rmb 2				; pointer to next free entry in the scheduling table
 readylistchg	rmb 1				; nonzero if the ready list processing should be restarted
 keybufread	rmb 1				; keyboard buffer read offset
@@ -5467,7 +5468,18 @@
 		fcn '**PAUSED**'
 		clr textother			; reset display parameters
 		dec pausemode			; mark game paused
-		rts
+		ldx displayptr			; fetch current display routine
+		stx pausedispptr		; save it for later restoration
+		ldx #pausedisplay		; set dungeon display update to NOP
+		stx displayptr
+		jsr LD489			; set up graphics area for text rendering
+		clr 4,u				; reset to start of display
+		clr 5,u
+		jsr pcmd_credits		; display credits
+		ldx #resumemess			; advertise resuming
+		jsr prendertext
+		dec pageswap			; swap live
+pausedisplay	rts
 ; This is the puase mode command handler
 pausemodecmd	ldx #kwlist_pcmd		; point to command list
 		jsr lookup_word			; look up word in command list
@@ -5480,17 +5492,39 @@
 		jsr [a,x]			; go handle command
 		jmp LD2A7			; go handle new command
 ; Pause mode command list
-kwlist_pcmd	fcb 1
+kwlist_pcmd	fcb 2
 		fcb 0				; RESUME
 		fcn 'RESUME'
+		fcb 0				; CREDITS
+		fcn 'CREDITS'
 ; Pause mode command jump table
 pausecmd_jump	fdb pcmd_resume			; RESUME command
+		fdb pcmd_credits
+; Resume message
+resumemess	fcn 'Use the RESUME command to\rreturn to your game.\r\r'
+; The credits display12345678901234567890123456789012
+credits		fcc 'Dungeons of Daggorath\r\r'
+		fcc 'Original game copyright 1982 by\r'
+		fcc 'Dyna Micro. Modifications made\r'
+		fcc 'by Lost Wizard Enterprises\r'
+		fcc 'Incorporated copyright 2015.\r'
+		fcn '\r' 
 ; This is the resume command
-pcmd_resume	updatestatus			; update the status line
+pcmd_resume	ldx pausedispptr		; restore the dungeon display routine
+		stx displayptr
+		resetdisplay			; redisplay dungeon
 		dec enableheart			; enable heartbeat
 		clr disablesched		; re-enable scheduler
 		clr pausemode			; turn off pause mode
 		rts
+; This displays the credits
+pcmd_credits	ldx #credits			; point to credits text
+; This renders text to the dungeon area
+prendertext	ldu #infoarea			; point to info area
+		dec textother			; set to nonstandard text rendering
+		jsr putstr			; display the string
+		clr textother			; restore text rendering
+		rts
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ; This is the bit that intercepts RVEC12. It requires at least Extended Basic to work because it relies on multi-origin binaries.
 ; That will always be the case for Disk Basic. Theoretically, with just this, a loader will work from tape in Extended Basic