aboutsummaryrefslogtreecommitdiff
path: root/memsetup.asm
blob: de9c7d9b5330714f53559f1adf83d3b2ee988668 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
; Initial load segment for the fnchat.exe executable. Sets MEMTOP and
; 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
 lda $d301  ; PORTB
 ora #$02   ; disable BASIC (XL/XE only)
 sta $d301
 lda #$80
 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
 lda $14    ; RTCLOK+2
loop
 cmp $14    ; wait until next frame
 beq loop
 rts

 *= $02e2  ; INITAD
 .word memsetup