2018-01-17 00:52:31 +00:00
|
|
|
rel
|
|
|
|
typ $B3
|
|
|
|
dsk main.l
|
2018-01-15 15:58:58 +00:00
|
|
|
|
2018-01-17 06:07:57 +00:00
|
|
|
; this doesn't actually modeset the cpu
|
2018-01-17 00:52:31 +00:00
|
|
|
mx %00
|
|
|
|
phk
|
|
|
|
plb
|
2018-01-15 15:58:58 +00:00
|
|
|
|
2018-01-17 06:07:57 +00:00
|
|
|
; we're going to enter into emulation mode, so we can toggle softswitches
|
|
|
|
; doing so clobbers our stack pointer and supposedly other things so let's
|
|
|
|
; save the state of as many things as we can.
|
|
|
|
|
|
|
|
ncpui da
|
|
|
|
nstack da
|
|
|
|
|
|
|
|
; cpu status register first
|
|
|
|
php
|
|
|
|
pla
|
|
|
|
sta ncpui
|
|
|
|
|
|
|
|
; the stack pointer too
|
|
|
|
tsc
|
|
|
|
sta nstack
|
|
|
|
|
|
|
|
; enable emulation mode, tell merlin we did so
|
|
|
|
sec
|
|
|
|
xce
|
|
|
|
sep #$30
|
2018-01-17 00:52:31 +00:00
|
|
|
mx %11
|
2018-01-17 06:07:57 +00:00
|
|
|
|
|
|
|
; the manuals all seem to use zero page addresses, so we'll oblige and slide
|
|
|
|
; the DP offset all the way up and go to bank 00
|
|
|
|
lda $0000
|
2018-01-17 00:52:31 +00:00
|
|
|
pha
|
2018-01-17 06:07:57 +00:00
|
|
|
pld
|
|
|
|
lda $00
|
2018-01-17 00:52:31 +00:00
|
|
|
pha
|
|
|
|
plb
|
2018-01-15 15:58:58 +00:00
|
|
|
|
2018-01-17 06:07:57 +00:00
|
|
|
; toggle the softswitches; they don't take any values. some are only triggered
|
|
|
|
; by writes, $C054 can be triggered by a read
|
|
|
|
sta $C000 ; disable 80 column store?
|
|
|
|
sta $C00C ; disable 80 column hardware?!
|
|
|
|
* sta $C050 ; set standard apple ii gfx mode
|
|
|
|
sta $C051 ; select text mode only. "only"?
|
|
|
|
lda $C054 ; select text page 1 (there are 2)
|
|
|
|
* lda $C056 ; select "low res" graphics
|
|
|
|
|
|
|
|
|
|
|
|
lda $CF
|
|
|
|
sta $0400
|
|
|
|
sta $0480
|
2018-01-15 15:58:58 +00:00
|
|
|
|
2018-01-17 06:07:57 +00:00
|
|
|
|
|
|
|
*; let's write more interesting (broken)
|
|
|
|
*mood asc "this is excruciating"
|
|
|
|
*nult db
|
|
|
|
* lda $00
|
|
|
|
* sta nult ; i.e null terminator
|
|
|
|
|
|
|
|
*loop clc
|
|
|
|
* ldx #0
|
|
|
|
* lda mood,x
|
|
|
|
* cmp $00
|
|
|
|
|
|
|
|
* sta $040,x
|
|
|
|
|
|
|
|
* inx
|
|
|
|
* bcc loop
|
|
|
|
|
|
|
|
* brk
|
|
|
|
|
|
|
|
*EPOC2
|
|
|
|
|
|
|
|
* clc
|
|
|
|
* xce
|
|
|
|
* rep #$30
|
|
|
|
*; disable emulation mode
|
|
|
|
|
|
|
|
* mx %00
|
|
|
|
* brk
|
|
|
|
|
|
|
|
*; load a char and write it to the 40 char text buffer
|
|
|
|
*bois lda "B"
|
|
|
|
* sta $E00400
|
|
|
|
* sta $E00401
|
|
|
|
* sta $E00402
|
|
|
|
* jmp bois
|
2018-01-15 15:58:58 +00:00
|
|
|
|
2018-01-17 00:52:31 +00:00
|
|
|
; Important locations
|
|
|
|
SPEAKER equ $E0C030
|
|
|
|
PRODOS16 equ $E100A8
|
2018-01-15 15:58:58 +00:00
|
|
|
|
2018-01-17 00:52:31 +00:00
|
|
|
jsl PRODOS16
|
2018-01-15 15:58:58 +00:00
|
|
|
; This exit code is "device busy", why is it the only one
|
|
|
|
; that works?!
|
2018-01-17 00:52:31 +00:00
|
|
|
da $29
|
|
|
|
adrl QP
|
2018-01-15 15:58:58 +00:00
|
|
|
bcs ERROR
|
|
|
|
|
2018-01-17 00:52:31 +00:00
|
|
|
ERROR brk
|
2018-01-15 15:58:58 +00:00
|
|
|
|
|
|
|
QP adrl $0000
|
2018-01-17 00:52:31 +00:00
|
|
|
da $00
|
|
|
|
|
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