anti-m/src/anti-m.a

177 lines
4.5 KiB
Plaintext
Raw Normal View History

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-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
jsr HOME
MainMenu
ldx #$FF
txs
jsr HOME
lda #s_header
jsr PrintByID
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
ldx #$00
- lda $C600,x
sta $1600,x
inx
bne -
2019-03-10 02:30:04 +00:00
lda #<Tracer
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
jmp $1600
@iigs
ldy $16FB
cpy #$4C
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
jmp $1600
@unknowncontroller
jmp RebootImmediately
2019-03-09 20:09:16 +00:00
Tracer
jsr IDBroderbund
bcc BeginTheBoot
jsr IDSpiraDisc
bcc BeginTheBoot
2019-03-11 01:16:41 +00:00
jsr IDIDSI
bcc BeginTheBoot
; [execution falls through here]
Unsupported
lda $C082
jsr TEXT
jsr HOME
lda #s_unsupported
jsr PrintByID
bit STROBE
- lda KEY
bpl -
bit STROBE
RebootImmediately
jmp REBOOT
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
s_unsupported =$02
STRINGCOUNT = $03
2019-03-09 20:09:16 +00:00
StringTable
!word @header
!word @mainmenu
!word @unsupported
2019-03-09 20:09:16 +00:00
@header
2019-03-10 14:28:28 +00:00
!text "Anti-M by 4am 2019-03-10",$00
2019-03-09 20:09:16 +00:00
@mainmenu
!text "________________________________________",$8D
!text $8D,$8D,$8D,$8D,$8D,$8D,$8D,$8D
!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
@unsupported
!text $8D,$8D,$8D,$8D,$8D,$8D,$8D,$8D,$8D,$8D,$8D
!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"
!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"