getting closer, properly toggling switches now!

This commit is contained in:
David Stancu 2018-01-17 01:07:57 -05:00
parent 71df806253
commit 955e361012
2 changed files with 138 additions and 12 deletions

View File

@ -28,6 +28,8 @@ There are a lot of good materials out there: here is what I used to make this ga
- [IIgs Hardware Architecture](http://www.goldstarsoftware.com/applesite/Documentation/AppleIIgsHardwareReferenceManual.PDF)
- p. 74 has a memory map
- [IIgs firmware reference](http://www.applelogic.org/files/GSFIRMWAREREF1.pdf)
- Importantly, overview on bank $00, D $0000
- [Scanlon's IIgs Assembly Programming](ftp://ftp.apple.asimov.net/pub/apple_II/documentation/programming/65816_gs/Apple%20IIGS%20Assembly%20Language%20Programming.pdf)
- Tremendously useful reference for QuickDraw and some tools
- [Programming the 65816 and 65xx family](https://apple2.gs/downloads/Programmanual.pdf)
@ -43,4 +45,5 @@ There are a lot of good materials out there: here is what I used to make this ga
- This is the humbling moment I take back every bad thing I ever said about GDB in my life ever.
- [SNES CPU overview, same CPU, nice insights](https://github.com/michielvoo/SNES/wiki/CPU)
- [SNES opcode list](http://wiki.metroidconstruction.com/doku.php?id=super:technical_information:asm_mnemonics)
- [65816 primer](http://softpixel.com/~cwright/sianse/docs/65816NFO.HTM)
- [65816 primer](http://softpixel.com/~cwright/sianse/docs/65816NFO.HTM)
- [Another 6502 reference, insightful](https://github.com/wiz-lang/wiz/wiki/Registers-and-Memory-(6502))

View File

@ -2,27 +2,91 @@
typ $B3
dsk main.l
; this doesn't actually modeset the cpu
mx %00
phk
plb
; 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
mx %11
sta $E0
; 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
pha
pld
lda $00
pha
plb
pld
sta $C000
sta $C054
mx %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
; load a char and write it to the 40 char text buffer
bois lda "B"
sta $E00400
sta $E00401
sta $E00402
jmp bois
lda $CF
sta $0400
sta $0480
*; 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
; Important locations
SPEAKER equ $E0C030
@ -122,6 +186,65 @@ QP adrl $0000