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
|
|
|
|
|
|
|
|
HOME = $FC58
|
|
|
|
COUT = $FDED
|
2016-12-08 04:05:07 +00:00
|
|
|
PRBYTE = $FDDA
|
2016-12-07 03:18:33 +00:00
|
|
|
|
|
|
|
main:
|
|
|
|
jsr HOME
|
|
|
|
jsr print
|
2016-12-08 04:05:07 +00:00
|
|
|
!text "APPLE II AUDIT",$8D,0
|
2016-12-07 03:18:33 +00:00
|
|
|
jsr print
|
2016-12-08 04:05:07 +00:00
|
|
|
!text "DETECTING MACHINE VERSION...",$8D,0
|
|
|
|
|
|
|
|
!zone detect {
|
|
|
|
jsr IDENTIFY
|
2016-12-09 02:21:17 +00:00
|
|
|
lda $C082 ; Put ROM back in place.
|
2016-12-08 04:05:07 +00:00
|
|
|
lda MACHINE
|
2016-12-08 21:44:38 +00:00
|
|
|
jsr PRBYTE
|
|
|
|
lda #$8D
|
|
|
|
jsr COUT
|
|
|
|
lda MACHINE
|
2016-12-08 04:05:07 +00:00
|
|
|
bne .known
|
|
|
|
;; MACHINE=0 - unknown machine
|
|
|
|
jsr print
|
2016-12-08 04:45:39 +00:00
|
|
|
!text "UNABLE TO IDENTIFY",$8D,0
|
2016-12-08 04:05:07 +00:00
|
|
|
jmp end
|
|
|
|
.known
|
|
|
|
cmp #IIeCard
|
|
|
|
bcc .leiic
|
|
|
|
bne .gs
|
|
|
|
;IIeCard
|
|
|
|
jsr print
|
|
|
|
!text "IIE EMULATION CARD",0
|
|
|
|
beq .notsupported
|
|
|
|
.gs ;PLUGH
|
|
|
|
jsr print
|
2016-12-09 02:34:43 +00:00
|
|
|
!text "APPLE IIGS",0
|
2016-12-08 04:05:07 +00:00
|
|
|
.notsupported
|
|
|
|
jsr print
|
|
|
|
!text " NOT SUPPORTED",$8D,0
|
|
|
|
jmp end
|
|
|
|
.leiic
|
|
|
|
cmp #IIe
|
|
|
|
bcc .leiii
|
|
|
|
beq .iie
|
|
|
|
;IIc
|
|
|
|
jsr print
|
|
|
|
!text "IIC",0
|
|
|
|
beq .notsupported
|
|
|
|
.iie
|
|
|
|
jsr print
|
2016-12-09 02:34:43 +00:00
|
|
|
!text "APPLE IIE",0
|
|
|
|
lda ROMLEVEL
|
|
|
|
cmp #1
|
|
|
|
beq +
|
|
|
|
jsr print
|
|
|
|
!text " (ENHANCED)",0
|
|
|
|
+ lda #$8D
|
|
|
|
jsr COUT
|
2016-12-08 04:05:07 +00:00
|
|
|
beq .done
|
|
|
|
.leiii
|
|
|
|
cmp #IIplus
|
|
|
|
bcc .iiplain
|
|
|
|
beq .iiplus
|
|
|
|
;iiiem
|
|
|
|
jsr print
|
|
|
|
!text "APPLE III IN EMULATION MODE",0
|
|
|
|
beq .notsupported
|
|
|
|
.iiplain
|
|
|
|
jsr print
|
|
|
|
!text "PLAIN APPLE II",$8D,0
|
|
|
|
beq .done
|
|
|
|
.iiplus
|
|
|
|
jsr print
|
|
|
|
!text "APPLE II PLUS",$8D,0
|
|
|
|
.done
|
|
|
|
} ;detect
|
|
|
|
|
2016-12-07 03:18:33 +00:00
|
|
|
end: jmp *
|
|
|
|
|
|
|
|
;;; print prints a null-terminated string from the address after the
|
|
|
|
;;; JSR that called it, returning to the address following the null.
|
|
|
|
print:
|
2016-12-08 04:05:07 +00:00
|
|
|
pla
|
2016-12-07 03:18:33 +00:00
|
|
|
sta getch+1
|
2016-12-08 04:05:07 +00:00
|
|
|
pla
|
2016-12-07 03:18:33 +00:00
|
|
|
sta getch+2
|
|
|
|
- inc getch+1
|
|
|
|
bne getch
|
|
|
|
inc getch+2
|
|
|
|
getch lda $FEED ; $FEED gets modified
|
|
|
|
beq +
|
|
|
|
jsr COUT
|
|
|
|
jmp -
|
2016-12-08 04:05:07 +00:00
|
|
|
+ lda getch+2
|
|
|
|
pha
|
|
|
|
lda getch+1
|
|
|
|
pha
|
|
|
|
lda #0 ; so we can always beq after print-ing
|
2016-12-07 03:18:33 +00:00
|
|
|
rts
|
2016-12-08 04:05:07 +00:00
|
|
|
|
|
|
|
!src "technote2.asm"
|