!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 DEVNUM = $BF30 KEY = $C000 STROBE = $C010 BUTTON0 = $C061 BUTTON1 = $C062 TEXT = $FB2F MACHINEID = $FBB3 HOME = $FC58 COUT = $FDED cmp1 = $F8 ; word cmp2 = $FA ; word tmp = $FC ; byte lda #$00 sta $85FF ; boot drive 1 jsr TEXT lda BUTTON0 ora BUTTON1 bmi @showprompt lda DEVNUM cmp #$60 bne Boot jsr CheckDrive2 bne Boot2 @showprompt jsr HOME lda MACHINEID cmp #$06 beq @haslowercase lda #$DF sta kForceLower @haslowercase lda #s_header jsr PrintByID lda #s_mainmenu jsr PrintByID bit STROBE - lda KEY bpl - bit STROBE cmp #$8D ; return beq Boot cmp #$B2 ; 2 beq Boot2 jsr MLI !byte $65 !word .quitparm .quitparm !byte $04,$00,$00,$00,$00,$00,$00 Boot2 inc $85FF ; boot drive 2 Boot jsr HOME ldx #$00 - lda $C600,x sta $8600,x inx bne - lda $865C cmp #$80 bne @check2 lda #$18 sta $865C lda #$08 sta $865D lda #$F7 sta $8666 lda #$D9 sta $8682 lda #$BE sta $869D ldx #$B8 stx $86A3 dex stx $86A5 @check2 lda $85FF beq @skip2 ldx #$C8 lda $860F cmp #$5A bne + lda #$EA sta $860F stx $8616 ;select drive 2 on IIc + lda $8619 cmp #$78 bne + stx $8619 ;select drive 2 on IIGS + lda $8636 cmp #$8A bne @skip2 inc $8636 ;select drive 2 on II @skip2 lda #Tracer ldy $86F8 cpy #$4C bne @iigs ; entry point for Disk II controller sta $86F9 ; lo byte of callback stx $86FA ; hi byte of callback beq @tryboot @iigs ldy $86FB cpy #$4C bne @unknowncontroller ; entry point for IIgs smart controller sta $86FC ; lo byte of callback stx $86FD ; hi byte of callback @tryboot jmp IDBoot @unknowncontroller jmp $C600 CheckDrive2 lda $C0E9 lda $C0EB ldy #6 -- ldx #$11 - dex bne - sec sbc #1 bne -- dey bpl -- lda #$00 ldy #$00 - eor $C0EC dey bne - sta $C0E8 cmp #$00 @knownret rts Tracer jsr IDBroderbund bcc BeginTheBoot jsr IDSpiraDisc bcc BeginTheBoot jsr IDIDSI bcc BeginTheBoot jsr IDSirius bcc BeginTheBoot jsr IDProDOS bcc BeginTheBoot ; [execution falls through here] ; [and runs anyway] BeginTheBoot sec ;match boot-time flags and registers lda #1 ldy #0 ldx #$60 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 cmp #$E1 bcc @noforce and kForceLower @noforce jsr COUT inc @print+1 bne @print inc @print+2 bne @print @done clc @exit rts kForceLower !byte $FF ; AND mask for lowercase letters ; ; String IDs ; (pass in accumulator to PrintByID) ; s_header = $00 s_mainmenu = $01 STRINGCOUNT = $02 StringTable !word @header !word @mainmenu @header !text "Anti-M v1.3-pre by 4am 2019-04-11" !text "________________________________________",$8D !text $8D,$8D,$8D,$8D,$8D,$8D,$8D,$8D,$00 @mainmenu !text " Insert original disk in slot 6 drive 1",$8D !text $8D !text " and press to boot",$8D,$00 !src "src/compare.a" !src "src/idbroderbund.a" !src "src/idspiradisc.a" !src "src/ididsi.a" !src "src/idsirius.a" !src "src/idboot.a" !src "src/idprodos.a"