changeset 2:893efe2a0fd9

Added autostart to the BIN file Created an autostart routine that stops the disk drive and starts the game automatically. It intercepts RVEC12 (line input) to start the game. Since neither version of Disk Basic actually does anything with that vector (it's an RTS) and Daggorath completely takes over anyway, there's no need to preserve it. (Even the bits of the ROMs that Daggorath uses don't rely on the line input routine.)
author William Astle <lost@l-w.ca>
date Sun, 28 Dec 2014 11:00:33 -0700
parents 8ac2bb155049
children 154ca5ac37d3
files dod.s
diffstat 1 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/dod.s	Sun Dec 28 00:57:35 2014 -0700
+++ b/dod.s	Sun Dec 28 11:00:33 2014 -0700
@@ -4584,4 +4584,13 @@
 		fcb $2e,$e2,$11,$20,$2e,$22,$20,$00
 		fcb $fe
 		fcc 'KSK'
-		end START
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; This is an autostart loader. Theoretically, when LOADM completes, control should come here. It works by intercepting the
+; RAM vector used by the Basic line input routine. Once Daggorath starts, that routine is never used for anything. Also, under
+; both versions of Disk Basic, even though it is hooked by them it does nothing (just RTS). By setting the execution address
+; also to LOADER, it means that even if, for some reason, control doesn't transfer here, EXEC will still do so.
+LOADER		clr $FF40			; turn off drive motors
+		jmp START			; transfer control to the main stream code
+		org $182			; address of RVEC12
+		jmp LOADER			; transfer control to our loader
+		end LOADER