aboutsummaryrefslogtreecommitdiff
path: root/memsetup.asm
blob: 8e6b4df720f609a2811c9636a01e672e749ccf18 (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
34
; 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.

 *= $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
 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)

 ; give the SDMCTL change time to get applied by the OS
 lda $14    ; RTCLOK+2
loop
 cmp $14    ; wait until next frame
 beq loop
 rts

 *= $02e2  ; INITAD
 .word memsetup