aboutsummaryrefslogtreecommitdiff
path: root/memsetup.asm
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2026-03-10 03:30:13 -0400
committerB. Watson <urchlay@slackware.uk>2026-03-10 03:30:13 -0400
commitb4d44860c237c05447f5641f83f19cece2ac9975 (patch)
treefd79e2404405507f35ec2a92804b3d75bd863dab /memsetup.asm
parentbe4cb6d2a1d1c857fc67eb155788717db167f625 (diff)
downloadfujinet-chat-b4d44860c237c05447f5641f83f19cece2ac9975.tar.gz
really fix the brokenness with MyDOS (close E: device at startup).
Diffstat (limited to 'memsetup.asm')
-rw-r--r--memsetup.asm23
1 files changed, 12 insertions, 11 deletions
diff --git a/memsetup.asm b/memsetup.asm
index de9c7d9..8e6b4df 100644
--- a/memsetup.asm
+++ b/memsetup.asm
@@ -2,27 +2,28 @@
; RAMTOP to $6A00, disables BASIC (on XL/XE), disables ANTIC DMA, then
; returns so the rest of the .xex continues to load.
-; This is pretty weird: when loading fnchat.xex from MyDOS 4.50 or
-; (apparently) Spartados X, a 0 byte gets written to our display
-; list. It's up in the $BFxx area, which is to say, where the GR.0
-; screen used by DOS lives... and somehow these DOSes are writing a
-; 0 byte to the screen (a space) in the middle of loading the file.
-; Setting SAVMSC to something else ($0600, here) avoids this.
-
*= $2000
memsetup
+ ; close the E: device
+ lda #$0c ; CIO CLOSE command
+ sta $0342 ; ICCOM
+ ldx #0 ; channel 0
+ jsr $E456 ; CIOV
+
+ ; disable BASIC (XL/XE only)
lda $d301 ; PORTB
- ora #$02 ; disable BASIC (XL/XE only)
+ ora #$02
sta $d301
lda #$80
+
+ ; set up everything else
sta $6a ; RAMTOP
sta $02e6 ; MEMTOP high
lda #0
sta $02e5 ; MEMTOP low
sta $022f ; SDMCTL (turn off screen)
- sta $58 ; SAVMSC
- lda #$06
- sta $59 ; SAVMSC+1
+
+ ; give the SDMCTL change time to get applied by the OS
lda $14 ; RTCLOK+2
loop
cmp $14 ; wait until next frame