2016-12-07 03:18:33 +00:00
|
|
|
;;; Apple II audit routines
|
|
|
|
;;; Copyright © 2016 Zellyn Hunter <zellyn@gmail.com>
|
|
|
|
|
|
|
|
!convtab <apple ii/convtab.bin>
|
|
|
|
!to "audit.o", plain
|
|
|
|
* = $6000
|
2017-01-17 03:45:29 +00:00
|
|
|
START = *
|
2016-12-07 03:18:33 +00:00
|
|
|
|
2017-01-17 03:45:29 +00:00
|
|
|
;; Zero-page locations.
|
2017-01-10 02:41:06 +00:00
|
|
|
CSW = $36
|
|
|
|
KSW = $38
|
2017-01-17 03:45:29 +00:00
|
|
|
|
2017-01-18 02:44:31 +00:00
|
|
|
LCRESULT = $10
|
2017-01-19 01:57:26 +00:00
|
|
|
LCRESULT1 = $11
|
2017-01-18 02:44:31 +00:00
|
|
|
AUXRESULT = $12
|
|
|
|
|
|
|
|
;; AUXMOVE locations
|
|
|
|
;; $3C
|
|
|
|
;; $3D
|
|
|
|
;; $3E
|
|
|
|
;; $3F
|
|
|
|
;; $42
|
|
|
|
;; $43
|
|
|
|
|
|
|
|
;; SHASUM locations
|
|
|
|
!addr SRC = $06
|
|
|
|
!addr DST = $08
|
|
|
|
!addr SHAINPUT = $eb
|
|
|
|
!addr SHALENGTH = $ee
|
|
|
|
|
2017-01-17 03:45:29 +00:00
|
|
|
;; Softswitch locations.
|
2017-01-18 02:44:31 +00:00
|
|
|
_80STORE_OFF_W = $C000
|
|
|
|
_80STORE_ON_W = $C001
|
2017-01-17 03:45:29 +00:00
|
|
|
_80STORE_READ = $C018
|
2017-01-18 02:44:31 +00:00
|
|
|
RAMRD_OFF_W = $C002
|
|
|
|
RAMRD_ON_W = $C003
|
2017-01-17 03:45:29 +00:00
|
|
|
RAMRD_READ = $C013
|
2017-01-18 02:44:31 +00:00
|
|
|
RAMWRT_OFF_W = $C004
|
|
|
|
RAMWRT_ON_W = $C005
|
2017-01-17 03:45:29 +00:00
|
|
|
RAMWRT_READ = $C014
|
2017-01-18 02:44:31 +00:00
|
|
|
INTCXROM_OFF_W = $C006
|
|
|
|
INTCXROM_ON_W = $C007
|
2017-01-17 03:45:29 +00:00
|
|
|
INTCXROM_READ = $C015
|
2017-01-18 02:44:31 +00:00
|
|
|
ALTZP_OFF_W = $C008
|
|
|
|
ALTZP_ON_W = $C009
|
2017-01-17 03:45:29 +00:00
|
|
|
ALTZP_READ = $C016
|
2017-01-18 02:44:31 +00:00
|
|
|
SLOTC3ROM_OFF_W = $C00A
|
|
|
|
SLOTC3ROM_ON_W = $C00B
|
2017-01-17 03:45:29 +00:00
|
|
|
SLOTC3ROM_READ = $C017
|
|
|
|
SLOTRESET = $CFFF
|
|
|
|
|
|
|
|
;; CXXX utility routine locations
|
|
|
|
AUXMOVE = $C311
|
|
|
|
;; Monitor locations.
|
2016-12-07 03:18:33 +00:00
|
|
|
HOME = $FC58
|
|
|
|
COUT = $FDED
|
2017-01-10 02:41:06 +00:00
|
|
|
COUT1 = $FDF0
|
|
|
|
KEYIN = $FD1B
|
2016-12-17 03:32:35 +00:00
|
|
|
CROUT = $FD8E
|
2016-12-08 04:05:07 +00:00
|
|
|
PRBYTE = $FDDA
|
2016-12-17 03:32:35 +00:00
|
|
|
PRNTYX = $F940
|
2016-12-07 03:18:33 +00:00
|
|
|
|
2016-12-14 02:26:45 +00:00
|
|
|
STRINGS = $7000
|
|
|
|
!set LASTSTRING = $7000
|
|
|
|
|
2016-12-15 01:16:55 +00:00
|
|
|
;; Printing and error macros.
|
|
|
|
!src "macros.asm"
|
2017-01-10 02:41:06 +00:00
|
|
|
|
2016-12-07 03:18:33 +00:00
|
|
|
main:
|
2017-01-17 03:45:29 +00:00
|
|
|
;; Initialize stack to the top.
|
|
|
|
ldx $ff
|
|
|
|
txs
|
|
|
|
|
2017-01-10 02:41:06 +00:00
|
|
|
jsr standard_fixup
|
|
|
|
|
2016-12-07 03:18:33 +00:00
|
|
|
jsr HOME
|
2016-12-14 02:26:45 +00:00
|
|
|
+print
|
|
|
|
!text "APPLE II AUDIT",$8D,$8D
|
|
|
|
+printed
|
2016-12-11 03:23:36 +00:00
|
|
|
|
2016-12-15 01:16:55 +00:00
|
|
|
;; Detection and reporting of model and memory.
|
|
|
|
!src "detect.asm"
|
2016-12-11 03:23:36 +00:00
|
|
|
|
2016-12-15 01:16:55 +00:00
|
|
|
;; Language card tests.
|
2017-01-06 02:47:49 +00:00
|
|
|
jsr LANGCARDTESTS
|
2017-01-10 02:41:06 +00:00
|
|
|
|
|
|
|
;; Auxiliary memory card tests.
|
|
|
|
jsr AUXMEMTESTS
|
|
|
|
|
|
|
|
;; ROM SHA-1 checks.
|
|
|
|
;; jsr SHASUMTESTS - do this later, because it's SLOW!
|
|
|
|
|
2017-01-18 02:44:31 +00:00
|
|
|
end:
|
|
|
|
+print
|
|
|
|
!text "END"
|
|
|
|
+printed
|
|
|
|
jmp *
|
2016-12-07 03:18:33 +00:00
|
|
|
|
2017-01-06 02:47:49 +00:00
|
|
|
!src "langcard.asm"
|
2017-01-10 02:41:06 +00:00
|
|
|
!src "auxmem.asm"
|
2017-01-18 02:44:31 +00:00
|
|
|
;!src "shasumtests.asm"
|
2017-01-17 03:45:29 +00:00
|
|
|
!src "resetall.asm"
|
2017-01-06 02:47:49 +00:00
|
|
|
|
2016-12-16 03:20:54 +00:00
|
|
|
print
|
2016-12-14 02:26:45 +00:00
|
|
|
lda $C081
|
|
|
|
lda $C081
|
2016-12-16 03:20:54 +00:00
|
|
|
pla
|
|
|
|
sta getch+1
|
|
|
|
pla
|
|
|
|
sta getch+2
|
|
|
|
- inc getch+1
|
|
|
|
bne getch
|
|
|
|
inc getch+2
|
|
|
|
getch lda $FEED ; FEED gets modified
|
2016-12-07 03:18:33 +00:00
|
|
|
beq +
|
|
|
|
jsr COUT
|
2016-12-16 03:20:54 +00:00
|
|
|
jmp -
|
2016-12-14 02:26:45 +00:00
|
|
|
+ rts
|
2016-12-17 03:32:35 +00:00
|
|
|
|
2017-01-10 02:41:06 +00:00
|
|
|
;;; Print a string of bytes, as hex.
|
|
|
|
;;; Address in SRC, count in A.
|
|
|
|
;;; Burns A,Y.
|
|
|
|
prbytes:
|
|
|
|
ldy #0
|
|
|
|
- pha
|
|
|
|
lda (SRC),y
|
|
|
|
jsr PRBYTE
|
|
|
|
iny
|
|
|
|
pla
|
|
|
|
adc #$ff
|
|
|
|
bne -
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
2016-12-17 03:32:35 +00:00
|
|
|
errora
|
|
|
|
pha
|
|
|
|
lda $C082
|
|
|
|
lda #'A'
|
|
|
|
jsr COUT
|
|
|
|
lda #':'
|
|
|
|
jsr COUT
|
|
|
|
pla
|
|
|
|
jsr PRBYTE
|
|
|
|
jsr CROUT
|
|
|
|
error
|
|
|
|
lda $C082
|
|
|
|
pla
|
|
|
|
sta getche+1
|
|
|
|
pla
|
|
|
|
sta getche+2
|
|
|
|
- inc getche+1
|
|
|
|
bne getche
|
|
|
|
inc getche+2
|
|
|
|
getche lda $FEED ; FEED gets modified
|
|
|
|
beq +
|
|
|
|
jsr COUT
|
|
|
|
jmp -
|
2017-01-10 02:41:06 +00:00
|
|
|
+
|
2016-12-17 03:32:35 +00:00
|
|
|
+print
|
|
|
|
!text "ZELLYN.COM/A2AUDIT/V0#E",0
|
|
|
|
+printed
|
|
|
|
jsr PRNTYX
|
2017-01-10 02:41:06 +00:00
|
|
|
lda #$8D
|
|
|
|
jsr COUT
|
2016-12-17 03:32:35 +00:00
|
|
|
rts
|
2016-12-15 03:57:37 +00:00
|
|
|
!src "technote2.asm"
|
2017-01-18 02:44:31 +00:00
|
|
|
;!src "../shasum/shasum.asm"
|
2017-01-10 02:41:06 +00:00
|
|
|
|
|
|
|
;;; If we loaded via standard delivery, turn the motor off and fix up
|
|
|
|
;;; CSW and KSW (in case the user typed PR#6 or IN#6 to boot).
|
|
|
|
standard_fixup:
|
|
|
|
;; TODO(zellyn): actually check for standard delivery.
|
|
|
|
;; Turn drive motor off - do this regardless, since it doesn't hurt.
|
|
|
|
ldx $2B
|
|
|
|
lda $C088,X
|
|
|
|
|
|
|
|
;; If we typed PR#6 or IN#6 or something similar, the low byte
|
|
|
|
;; of CSW or KSW will be 0.
|
|
|
|
|
|
|
|
;; Fixup CSW
|
|
|
|
lda CSW
|
|
|
|
bne +
|
|
|
|
;; Point COUT at COUT1
|
|
|
|
lda #<COUT1
|
|
|
|
sta CSW
|
|
|
|
lda #>COUT1
|
|
|
|
sta CSW+1
|
|
|
|
|
|
|
|
;; Fixup KSW
|
|
|
|
+ lda KSW
|
|
|
|
bne +
|
|
|
|
lda #<KEYIN
|
|
|
|
sta KSW
|
|
|
|
lda #>KEYIN
|
|
|
|
sta KSW+1
|
|
|
|
+ rts
|
2017-01-17 03:45:29 +00:00
|
|
|
|
|
|
|
COPYTOAUX
|
|
|
|
;; Use AUXMOVE routine to copy the whole program to AUX memory.
|
2017-01-18 02:44:31 +00:00
|
|
|
sta SLOTC3ROM_OFF_W
|
2017-01-17 03:45:29 +00:00
|
|
|
lda #<START
|
|
|
|
sta $3C
|
|
|
|
sta $42
|
|
|
|
lda #>START
|
|
|
|
sta $3D
|
|
|
|
sta $43
|
2017-01-18 02:44:31 +00:00
|
|
|
lda #<(LASTSTRING-1)
|
2017-01-17 03:45:29 +00:00
|
|
|
sta $3E
|
2017-01-18 02:44:31 +00:00
|
|
|
lda #>(LASTSTRING-1)
|
2017-01-17 03:45:29 +00:00
|
|
|
sta $3F
|
|
|
|
sec ; Move from main to aux memory.
|
|
|
|
jsr AUXMOVE
|
|
|
|
rts
|
|
|
|
|
|
|
|
; !if * != STRINGS {
|
|
|
|
; !error "Expected STRINGS to be ", *
|
|
|
|
; }
|
|
|
|
|
|
|
|
!if * > STRINGS {
|
|
|
|
!error "End of compilation passed STRINGS:", *
|
|
|
|
}
|