2019-03-09 20:09:16 +00:00
|
|
|
!cpu 6502
|
|
|
|
!ct "src/lcase.ct"
|
|
|
|
!to "build/ANTI.M.SYSTEM",plain
|
|
|
|
*=$2000
|
|
|
|
|
|
|
|
;-------------------------------
|
|
|
|
; Anti-M
|
|
|
|
; a 4am hack
|
|
|
|
; (c) 2019 by 4am
|
|
|
|
;
|
|
|
|
; Permission is hereby granted, free of charge, to any
|
|
|
|
; person obtaining a copy of this software and associated
|
|
|
|
; documentation files (the "Software"), to deal in the
|
|
|
|
; Software without restriction, including without limitation
|
|
|
|
; the rights to use, copy, modify, merge, publish,
|
|
|
|
; distribute, sublicense, and/or sell copies of the
|
|
|
|
; furnished to do so, subject to the following conditions:
|
|
|
|
;
|
|
|
|
; The above copyright notice and this permission notice
|
|
|
|
; shall be included in all copies or substantial portions of
|
|
|
|
; the Software.
|
|
|
|
;
|
|
|
|
; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
|
|
|
|
; KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
|
|
|
|
; WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
|
|
|
; PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
|
|
|
|
; OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
|
|
|
; OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
|
|
|
; OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
|
|
; SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
;
|
|
|
|
;-------------------------------
|
|
|
|
|
|
|
|
; Addresses we read/call
|
|
|
|
MLI = $BF00
|
|
|
|
KEY = $C000
|
|
|
|
STROBE = $C010
|
|
|
|
REBOOT = $FAA6
|
|
|
|
TEXT = $FB2F
|
|
|
|
HOME = $FC58
|
|
|
|
COUT = $FDED
|
2019-03-12 18:05:47 +00:00
|
|
|
DEVNUM = $BF30
|
2019-03-09 20:09:16 +00:00
|
|
|
|
2019-03-10 02:30:04 +00:00
|
|
|
cmp1 = $F8 ; word
|
|
|
|
cmp2 = $FA ; word
|
|
|
|
tmp = $FC ; byte
|
|
|
|
|
2019-03-09 20:09:16 +00:00
|
|
|
jsr TEXT
|
2019-03-12 18:05:47 +00:00
|
|
|
lda DEVNUM
|
|
|
|
cmp #$60
|
|
|
|
bne Boot
|
2019-03-12 18:09:17 +00:00
|
|
|
jsr HOME
|
|
|
|
lda #s_header
|
|
|
|
jsr PrintByID
|
2019-03-09 20:09:16 +00:00
|
|
|
lda #s_mainmenu
|
|
|
|
jsr PrintByID
|
|
|
|
@loop
|
|
|
|
bit STROBE
|
|
|
|
- lda KEY
|
|
|
|
bpl -
|
|
|
|
bit STROBE
|
|
|
|
cmp #$8D ; return
|
|
|
|
beq Boot
|
|
|
|
jsr MLI
|
|
|
|
!byte $65
|
|
|
|
!word .quitparm
|
|
|
|
.quitparm
|
|
|
|
!byte $04,$00,$00,$00,$00,$00,$00
|
|
|
|
|
|
|
|
Boot
|
2019-03-11 12:54:25 +00:00
|
|
|
jsr HOME
|
2019-03-09 20:09:16 +00:00
|
|
|
ldx #$00
|
|
|
|
- lda $C600,x
|
|
|
|
sta $1600,x
|
|
|
|
inx
|
|
|
|
bne -
|
2019-03-12 03:59:36 +00:00
|
|
|
lda $165C
|
|
|
|
cmp #$80
|
|
|
|
bne +
|
|
|
|
lda #$08
|
|
|
|
sta $165D
|
|
|
|
lda #$B7
|
|
|
|
sta $16A5
|
|
|
|
+ lda #<Tracer
|
2019-03-10 02:30:04 +00:00
|
|
|
ldx #>Tracer
|
2019-03-09 20:09:16 +00:00
|
|
|
ldy $16F8
|
|
|
|
cpy #$4C
|
|
|
|
bne @iigs
|
2019-03-09 21:53:54 +00:00
|
|
|
; entry point for Disk II controller
|
2019-03-09 20:09:16 +00:00
|
|
|
sta $16F9 ; lo byte of callback
|
|
|
|
stx $16FA ; hi byte of callback
|
2019-03-12 20:35:43 +00:00
|
|
|
beq @tryboot
|
2019-03-09 20:09:16 +00:00
|
|
|
@iigs
|
|
|
|
ldy $16FB
|
|
|
|
cpy #$4C
|
2019-03-10 17:03:51 +00:00
|
|
|
bne RebootImmediately
|
2019-03-09 21:53:54 +00:00
|
|
|
; entry point for IIgs smart controller
|
2019-03-09 20:09:16 +00:00
|
|
|
sta $16FC ; lo byte of callback
|
|
|
|
stx $16FD ; hi byte of callback
|
2019-03-12 20:35:43 +00:00
|
|
|
@tryboot
|
|
|
|
jmp IDBoot
|
2019-03-09 20:09:16 +00:00
|
|
|
@unknowncontroller
|
2019-03-10 17:11:01 +00:00
|
|
|
jmp RebootImmediately
|
2019-03-09 20:09:16 +00:00
|
|
|
|
2019-03-10 17:11:01 +00:00
|
|
|
Tracer
|
|
|
|
jsr IDBroderbund
|
|
|
|
bcc BeginTheBoot
|
|
|
|
jsr IDSpiraDisc
|
|
|
|
bcc BeginTheBoot
|
2019-03-11 01:16:41 +00:00
|
|
|
jsr IDIDSI
|
|
|
|
bcc BeginTheBoot
|
2019-03-11 19:30:59 +00:00
|
|
|
jsr IDSirius
|
|
|
|
bcc BeginTheBoot
|
2019-03-10 17:11:01 +00:00
|
|
|
; [execution falls through here]
|
2019-03-10 17:03:51 +00:00
|
|
|
Unsupported
|
|
|
|
lda $C082
|
2019-03-12 01:04:37 +00:00
|
|
|
lda $C0E8
|
2019-03-10 17:03:51 +00:00
|
|
|
jsr TEXT
|
|
|
|
jsr HOME
|
2019-03-12 01:04:37 +00:00
|
|
|
lda #s_header
|
|
|
|
jsr PrintByID
|
2019-03-10 17:03:51 +00:00
|
|
|
lda #s_unsupported
|
|
|
|
jsr PrintByID
|
|
|
|
bit STROBE
|
|
|
|
- lda KEY
|
|
|
|
bpl -
|
|
|
|
bit STROBE
|
|
|
|
RebootImmediately
|
|
|
|
jmp REBOOT
|
|
|
|
|
2019-03-10 17:11:01 +00:00
|
|
|
BeginTheBoot
|
2019-03-10 02:30:04 +00:00
|
|
|
sec ;match boot-time flags and registers
|
|
|
|
lda #1
|
|
|
|
ldy #0
|
|
|
|
ldx #$60
|
2019-03-09 20:09:16 +00:00
|
|
|
jmp $0801
|
|
|
|
|
|
|
|
PrintByID
|
|
|
|
cmp #STRINGCOUNT
|
|
|
|
bcs @exit
|
|
|
|
asl
|
|
|
|
tax
|
|
|
|
lda StringTable,x
|
|
|
|
sta @print+1
|
|
|
|
lda StringTable+1,x
|
|
|
|
sta @print+2
|
|
|
|
@print
|
|
|
|
lda $FFFF ; SMC
|
|
|
|
beq @done
|
|
|
|
jsr COUT
|
|
|
|
inc @print+1
|
|
|
|
bne @print
|
|
|
|
inc @print+2
|
|
|
|
bne @print
|
|
|
|
@done
|
|
|
|
clc
|
|
|
|
@exit
|
|
|
|
rts
|
|
|
|
|
|
|
|
;
|
|
|
|
; String IDs
|
|
|
|
; (pass in accumulator to PrintByID)
|
|
|
|
;
|
|
|
|
s_header = $00
|
|
|
|
s_mainmenu = $01
|
2019-03-10 17:03:51 +00:00
|
|
|
s_unsupported =$02
|
|
|
|
STRINGCOUNT = $03
|
2019-03-09 20:09:16 +00:00
|
|
|
|
|
|
|
StringTable
|
|
|
|
!word @header
|
|
|
|
!word @mainmenu
|
2019-03-10 17:03:51 +00:00
|
|
|
!word @unsupported
|
2019-03-09 20:09:16 +00:00
|
|
|
|
|
|
|
@header
|
2019-03-12 16:22:42 +00:00
|
|
|
!text "Anti-M v1.1-dev by 4am 2019-03-12"
|
2019-03-09 20:09:16 +00:00
|
|
|
!text "________________________________________",$8D
|
2019-03-12 01:04:37 +00:00
|
|
|
!text $8D,$8D,$8D,$8D,$8D,$8D,$8D,$8D,$00
|
|
|
|
@mainmenu
|
2019-03-09 20:09:16 +00:00
|
|
|
!text " Insert original disk in slot 6 drive 1",$8D
|
|
|
|
!text $8D
|
2019-03-10 14:28:28 +00:00
|
|
|
!text " and press <RETURN> to boot",$00
|
2019-03-10 17:03:51 +00:00
|
|
|
@unsupported
|
2019-03-12 01:04:37 +00:00
|
|
|
!text $8D
|
2019-03-10 17:03:51 +00:00
|
|
|
!text " Unsupported game (sorry)",$00
|
2019-03-10 02:30:04 +00:00
|
|
|
|
2019-03-10 14:28:28 +00:00
|
|
|
!src "src/compare.a"
|
2019-03-10 17:03:51 +00:00
|
|
|
!src "src/idbroderbund.a"
|
2019-03-10 14:28:28 +00:00
|
|
|
!src "src/idspiradisc.a"
|
2019-03-11 01:16:41 +00:00
|
|
|
!src "src/ididsi.a"
|
2019-03-11 19:34:46 +00:00
|
|
|
!src "src/idsirius.a"
|
2019-03-12 20:35:43 +00:00
|
|
|
!src "src/idboot.a"
|