Compare commits

...

30 Commits
v1.5 ... master

Author SHA1 Message Date
4am
a34bbf79e7 prep for 2.2 release 2024-02-27 11:26:29 -05:00
4am
385e514ce2
support ABM (#45)
Co-authored-by: Peter Ferrie <peter.ferrie@gmail.com>
2024-02-27 11:18:24 -05:00
4am
834efd426f prep for 2.1 release 2024-02-23 14:06:38 -05:00
4am
d4f81acf8b prep for 2.1 release 2024-02-23 14:04:56 -05:00
4am
bdbf06e59e prep for 2.1 release 2024-02-23 14:02:54 -05:00
Peter Ferrie
2afbe1ce50
fix detection of 13-sector disks (#43) 2024-02-23 14:00:08 -05:00
4am
e4c718f48e Merge branch 'master' of https://github.com/a2-4am/anti-m 2023-09-18 12:05:51 -04:00
4am
a4064c4bc1 2.0 release 2023-09-18 12:05:06 -04:00
Peter Ferrie
3a6b60cc72
strengthen drive 2 detection, set init A properly (fixes Micro League Basball) (#41) 2023-09-17 23:41:15 -04:00
Peter Ferrie
d739c08dab
fix bug in ProDOS tracer (#40) 2023-09-11 20:35:29 -04:00
4am
1ad0b3014a update version number for release 2023-05-15 17:05:33 -04:00
4am
e1295dee5a update version number for release 2023-05-15 17:03:54 -04:00
4am
513f8066d5
Update README.md 2023-05-15 16:53:13 -04:00
Peter Ferrie
6aa4146eb7
support Space Adventure (#39) 2023-05-15 16:50:31 -04:00
Peter Ferrie
e12b8fcfab
enable booting Ultracheckers from drive 2 (#38) 2022-04-19 21:18:36 -04:00
Peter Ferrie
9bee8fc449
support Disk Recovery (#37)
* support Disk Recovery

* enable booting Disk Recovery from drive 2
2022-03-21 21:22:17 -04:00
Peter Ferrie
d3c4100f32
fix drive 2 detection (#36) 2021-05-20 11:46:48 -04:00
4am
98e587d4d6 1.8 release 2020-11-10 15:45:34 -05:00
Peter Ferrie
4d636eddb5
fix Virtual II in 13-sector mode, too (#32) 2020-11-10 07:17:07 -05:00
Peter Ferrie
f1c81a1d5b
Master (#31)
* support Sensible Speller

* more Virtual II fixes
2020-11-08 23:24:38 -05:00
Peter Ferrie
009434aca3
support Sensible Speller (#30) 2020-10-15 21:02:57 -04:00
4am
6008129f5e update docs 2020-08-12 22:37:05 -04:00
Peter Ferrie
e2771b1b3c
fix World Karate Championship (#29) 2020-08-11 21:36:25 -04:00
Peter Ferrie
ef4f60166d
support Odin (#28) 2020-08-11 21:02:04 -04:00
4am
542ae06761 1.6 release 2019-11-09 11:34:24 -05:00
4am
3cea6246cb
Merge pull request #27 from peterferrie/master
support Personal Software titles
2019-11-09 11:27:19 -05:00
Peter Ferrie
4bcaa40903 fix regressions 2019-11-05 14:09:29 -08:00
Peter Ferrie
c4ff7c504f support Personal Software titles 2019-11-04 20:49:32 -08:00
4am
7658093d78
Merge pull request #26 from peterferrie/master
support Dogfight
2019-09-05 17:32:42 -04:00
Peter Ferrie
3d0d62f39e support Dogfight 2019-09-05 14:15:56 -07:00
9 changed files with 547 additions and 182 deletions

View File

@ -2,8 +2,8 @@
Boot any Apple II disk on any Apple II
[Download latest Anti-M disk image](https://github.com/a2-4am/anti-m/releases/download/v1.5/anti-m-v1.5-2019-06-11.dsk)
(version **1.5**, released **2019-06-11**, runs on any 48K Apple II)
[Download latest Anti-M disk image](https://github.com/a2-4am/anti-m/releases/latest/download/anti-m.dsk)
(version **2.2**, released **2024-02-27**, runs on any 48K Apple II)
## What is this?
@ -49,6 +49,7 @@ then press `<RETURN>`. The game should boot normally.
- Lazer Silk (Gebelli)
- Lunar Leepers (On-Line Systems)
- Neptune (Gebelli)
- Odin (Odesta)
- Orbitron (Sirius)
- Pest Patrol (On-Line Systems)
- Phaser Fire (Gebelli)
@ -56,13 +57,16 @@ then press `<RETURN>`. The game should boot normally.
- Red Alert (Broderbund)
- Russki Duck (Gebelli)
- Seafox (Broderbund)
- Sensible Speller (Sensible Software)
- Serpentine (Broderbund) (*)
- Sky Blazer (Broderbund)
- Space Adventure (Sierra Software)
- Space Eggs (Sirius)
- Space Quarks (Broderbund)
- Star Blazer (Broderbund)
- Star Thief (Cavalier)
- Trick Shot (IDSI)
- Typing Tutor (Microsoft)
- Zenith (Gebelli)
- all 13-sector disks (e.g. Epyx, Edu-Ware, many others)
- all ProDOS disks
@ -95,6 +99,42 @@ launching Anti-M.
## History
v2.2 - 2024-02-27
- add support for ABM
v2.1 - 2024-02-23
- fix detection of 13-sector disks (thanks John A. for the report)
v2.0 - 2023-09-18
- fix a crash when booting "Story Maker"
- fix a crash when booting "Micro League Baseball"
- further drive 2 fixes for AppleWin
v1.9 - 2023-05-15
- support "Disk Recovery"
- support "Space Adventure"
- fix drive 2 detection
v1.8 - 2020-11-10
- support "Sensible Speller"
- support "Typing Tutor"
- add some compatibility fixes for Virtual ][
v1.7 - 2020-08-11
- support "Odin"
- fix a crash when booting "World Karate Championship"
v1.6 - 2019-11-09
- support Personal Software 13-sector disks ("MicroChess 2.0," "Checker King,"
"Gammon Gambler")
v1.5 - 2019-06-11
- support "Lady Tut"

View File

@ -6,7 +6,7 @@
;-------------------------------
; Anti-M
; a 4am hack
; (c) 2019 by 4am
; (c) 2019-2024 by 4am
;
; Permission is hereby granted, free of charge, to any
; person obtaining a copy of this software and associated
@ -57,7 +57,7 @@ tmp = $FC ; byte
cmp #$60
bne Boot
jsr CheckDrive2
bne Boot2
bcs Boot2
@showprompt
jsr HOME
lda MACHINEID
@ -155,25 +155,103 @@ Boot
CheckDrive2
lda $C0E9
lda $C0EB
ldy #6
-- ldx #$11
- dex
bne -
sec
sbc #1
jsr @spinup
jsr @seek
ldx #21
ldy #0
--- iny
bne +
clc
dex
bmi @driveoff
+
- lda $C0EC
bpl -
-- cmp #$D5
bne ---
- lda $C0EC
bpl -
cmp #$AA
bne --
- lda $C0EC
bpl -
cmp #$AD
bne --
@driveoff
lda $C0E8
rts
step=$fd
phase=$fe
tmptrk=$ff
tmpsec=$3c
@seek
ldy #0
sty step
sty phase
lda #$44
sta tmptrk
@copy_cur
lda tmptrk
sta tmpsec
sec
sbc phase
beq +++
bcs +
eor #$ff
inc tmptrk
bcc ++
+ sbc #1
dec tmptrk
++ cmp step
bcc +
lda step
+ cmp #8
bcs +
tay
sec
+ jsr ++++
lda step1, y
jsr @delay
lda tmpsec
clc
jsr +++++
lda step2, y
jsr @delay
inc step
bne @copy_cur
+++ jsr @delay
clc
++++ lda tmptrk
+++++ and #3
rol
tax
lda $C0E0, x
rts
@spinup ldy #6
- jsr @delay
dey
bpl --
lda #$00
ldy #$00
- eor $C0EC
dey
bne -
sta $C0E8
cmp #$00
bpl -
@delay
-- ldx #$11
- dex
bne -
inc $46
bne +
inc $47
+ sec
sbc #1
bne --
@knownret
rts
step1 !byte 1, $30, $28, $24, $20, $1e, $1d, $1c
step2 !byte $70, $2c, $26, $22, $1f, $1e, $1d, $1c
Tracer
jsr IDBroderbund
bcc BeginTheBoot
@ -187,18 +265,46 @@ Tracer
bcc BeginTheBoot
jsr IDProgame
bcc BeginTheBoot
jsr IDAlphaBeta
bcc BeginTheBoot
; [execution falls through here]
; [and runs anyway]
BeginTheBoot
lda #$CD ;Virtual II fixes
sta $9D
sta $A2
lda #4
sta $AC
lda #$11 ;Virtual II fix
pha
plp ;match boot-time flags and registers
lda #1
lda $800 ;might not be 1
ldy #0
ldx #$60
jmp $0801
Tracer13
jsr PatchBoot13
jsr IDPersonal
bcc BeginTheBoot13
jsr IDBoot13
bcc BeginTheBoot13
jsr IDSensible
bcc BeginTheBoot13
; [execution falls through here]
; [and runs anyway]
BeginTheBoot13
lda #$CD ;Virtual II fixes
sta $9D
sta $A2
lda #4
sta $AC
ldx #$33 ;Sensible Software fix
ldy $0300
jmp $0301
PrintByID
cmp #STRINGCOUNT
bcs @exit
@ -240,7 +346,7 @@ StringTable
!word @mainmenu
@header
!text "Anti-M v1.5 by 4am 2019-06-11"
!text "Anti-M v2.2 by 4am 2024-02-27"
!text "________________________________________",$8D
!text $8D,$8D,$8D,$8D,$8D,$8D,$8D,$8D,$00
@mainmenu
@ -256,3 +362,6 @@ StringTable
!src "src/idboot.a"
!src "src/idprodos.a"
!src "src/idprogame.a"
!src "src/idpersonal.a"
!src "src/idalphabeta.a"
!src "src/idsensible.a"

37
src/idalphabeta.a Normal file
View File

@ -0,0 +1,37 @@
; Alpha-Beta tracer
; written by qkumba
;
; tested on
; - Odin
;
IDAlphaBeta
lda #8
ldx #1
ldy #15
jsr CompareMemory
!byte $48 ;PHA
!byte $28 ;PLP
!byte $8C,$F4,$03 ;STY $03F4
!byte $2C,$81,$C0 ;BIT $C081
!byte $2C,$81,$C0 ;BIT $C081
!byte $98 ;TYA
!byte $99,$08,$FF ;STA $FF08,Y
bcs @exit
; patch code to offer magic values
lda #$A9 ;LDA
sta $833
sta $83B
sta $841
ldx #$FA
stx $834
lda #$EA
sta $835
sta $83D
sta $843
inx
stx $83C
lda #3
sta $842
@exit
rts

View File

@ -10,6 +10,11 @@ IDBoot
ldy #$5C
sty @patch+1
bcc +
; we found D5 AA 96 T00S00 D5 AA ..
; check for weird Sensible Software 13-sector disk with D5 AA 96 sectors
cmp #$B5
beq ++
lda #$90
sta $867B
@ -29,7 +34,7 @@ IDBoot
bne @patch
; and loop anyway in case it's a hybrid disk and we missed the D5 AA 96
dec @retries
++ dec @retries
bne @patch
; found nothing but D5 AA B5, proceed as 13-sector
@ -37,138 +42,95 @@ IDBoot
sta $867B
; build 5-and-3 decoder table
ldx #$00
ldy #$AB
- tya
ldx #$20 ;now you know why the boot PROM
ldy #$00 ;starts with these magic values
-- lda #$03
sta $3C
lsr
ora $3C
cmp #$FF
bne +
clc
dey
tya
- bit $3C
beq --
rol $3C
bcc -
cpy #$D5
beq +
beq --
dex
txa
asl
asl
asl
sta $300,y
inx
+ iny
bne -
sta $800,y
bne --
; patch boot PROM to recognise 13-sector instead
lda #$B5
sta $8677
lda #$9A
sta $86A7
sty $86B0
inc $86B1
sty $86C2
inc $86C3
sty $86D1
inc $86D2
- lda @decode53,y
sta $86D5,y
lda @decode53+$100,y
sta $86D5+$100,y
iny
ldy #$B5
sty $8677
dec $86A1
ldy #$9A
sty $86A7
sta $86B0
ldy #$08
sty $86B1
sty $86B7
sta $86C2
sty $86C3
sta $86D1
sty $86D2
- lda @decode53,x
sta $86D5,x
lda @decode53 + $100,x
sta $86D5 + $100,x
inx
bne -
lda #$02
lda #$03
sta $27
sty $42
lda #$08
ldx #<@callback53
ldy #>@callback53
- sta $43
stx $44
sty $45
clc
jmp @run53
@callback53
lda $8FF
lsr
lsr
lsr
tay
iny
sty @patch53+1
ldy $8FE
tya
pha
lda #$FF
pha
iny
tya
ldx #<@callback53_2
ldy #>@callback53_2
bne -
sta $2A
ldx #$60
jsr $865D
jmp $86D6
@decode53 !pseudopc $86D5 {
@decode53x
ldx #$32
ldy #$00
- lda $300,x
lsr
rts
tay
-- ldx #$00
- lda $800,y
lsr
rol $3CC,x
lsr
rol $399,x
sta $3C
lsr
sta $2A
lsr
ora $200,x
sta ($42),y
lda ($26),y
asl
asl
asl
ora $3C
sta ($26),y
iny
lda $333,x
lsr
lsr
lsr
lsr
rol $3C
lsr
rol $2A
ora $233,x
sta ($42),y
iny
lda $366,x
lsr
lsr
lsr
lsr
rol $3C
lsr
rol $2A
ora $266,x
sta ($42),y
iny
lda $2A
and #7
ora $299,x
sta ($42),y
iny
lda $3C
and #7
ora $2CC,x
sta ($42),y
iny
dex
bpl -
lda $399
lsr
lsr
lsr
ora $2FF
sta ($42),y
inc $3D
inc $43
lda $3D
@patch53
cmp #$01
@run53
ldx #$60
bcs +
jmp $865D
+ jmp ($44)
inx
cpx #$33
bne -
dec $2A
bne --
cpy $300
- bne -
jmp Tracer13
IDBoot13
lda $33C
cmp #$AD
sec
bne +
lda #$4C
sta $33C
lda $33D
sta @dispatch+1
lda #<@callback53
sta $33D
lda $33E
sta @dispatch+2
lda #>@callback53
sta $33E
clc
+ rts
@CompareMemoryRel
sta cmp1+1
@ -203,9 +165,9 @@ IDBoot
ldx cmp1
rts
@callback53_2
@callback53
lda $85FF
beq @skip2
beq @jmp_dispatch
lda #$29
ldx #$6E
ldy #8
@ -215,8 +177,8 @@ IDBoot
!byte $BD,$8B,$C0 ;LDA $C08B,X
bcs @notinfocom
inc $296F
@skip2
rts
@jmp_dispatch
jmp @dispatch
@notinfocom
lda #$3D
@ -228,8 +190,7 @@ IDBoot
!byte $BD,$8B,$C0 ;LDA $C08B,X
bcs @notdos32a
inc $3D60
ldx #$60
rts
jmp @dispatch
@notdos32a
lda #$BD
@ -241,8 +202,7 @@ IDBoot
!byte $BD,$8B,$C0 ;LDA $C08B,X
bcs @notdos32b
inc $BD6F
ldx #$60
rts
jmp @dispatch
@notdos32b
lda #$3D
@ -254,8 +214,7 @@ IDBoot
!byte $BD,$8B,$C0 ;LDA $C08B,X
bcs @notdos32c
inc $3D6F
ldx #$60
rts
jmp @dispatch
@notdos32c
lda #$BD
@ -267,8 +226,7 @@ IDBoot
!byte $BD,$8B,$C0 ;LDA $C08B,X
bcs @notdos32d
inc $BD60
ldx #$60
rts
jmp @dispatch
@notdos32d
lda #$24
@ -280,8 +238,7 @@ IDBoot
!byte $BD,$8B,$C0 ;LDA $C08B,X
bcs @notdos32e
inc $246F
ldx #$60
rts
jmp @dispatch
@notdos32e
lda #$7D
@ -293,9 +250,61 @@ IDBoot
!byte $BD,$8B,$C0 ;LDA $C08B,X
bcs @notdos32f
inc $7D60
ldx #$60
rts
jmp @dispatch
@notdos32f
lda #$7D
ldx #$6E
ldy #8
jsr @CompareMemoryRel
!byte $BD,$8A,$C0 ;LDA $C08A,X
!byte $B0,$03 ;BCS *+5
!byte $BD,$8B,$C0 ;LDA $C08B,X
bcs @notdos32g
inc $7D6F
jmp @dispatch
@notdos32g
@dispatch
lda $d1d1 ;SMC
pha
lda #$ff
pha
ldx #$60
rts
}
PatchBoot13
lda #3
ldx #$1B
ldy #8
jsr CompareMemory
!byte $4A ;LSR
!byte $4A ;LSR
!byte $4A ;LSR
!byte $4A ;LSR
!byte $09,$C0 ;ORA #$C0
!byte $85,$3F ;STA $3F
bcs @retry
lda #$80
sta $320
bcc @exit
@retry
lda #3
ldx #$25
ldy #8
jsr CompareMemory
!byte $4A ;LSR
!byte $4A ;LSR
!byte $4A ;LSR
!byte $4A ;LSR
!byte $09,$C0 ;ORA #$C0
!byte $85,$3F ;STA $3F
bcs @exit
lda #$80
sta $32A
@exit
rts

View File

@ -24,6 +24,8 @@
; - Phaser Fire (Gebelli)
; - Russki Duck (Gebelli)
; - Zenith (Gebelli)
; - Disk Recovery (Sensible Software)
; - ABM (MUSE)
;
IDBroderbund
; first stage is just a standard hybrid DOS 3.2/3.3 bootloader
@ -266,9 +268,15 @@ IDBroderbund
ldx #<@DOS33Callback
ldy #>@DOS33Callback
cmp #$B6
beq @hookhybrid
ldx #<@MUSECallback
ldy #>@MUSECallback
cmp #$76
bne @jmpdos
@hookhybrid
lda #$0C
sta $300 ;Sensible Software page-wraparound fix
lda #$4C
sta $33C
stx $33D
@ -315,6 +323,16 @@ IDBroderbund
beq @skip2a
inc $3D60
@skip2a
+ ldy $371D
cpy $371F
bne +
dey
bne +
lda $371E
ora $3720
ora $3721
bne +
inc $371F ; select drive 2
+ jmp $3700 ; let it goooo...
@SpaceEggsCallback3 !pseudopc $300 {
@ -427,6 +445,24 @@ IDBroderbund
ldx #$60
jmp $B700
@MUSECallback
lda $85FF
beq @skip2f
lda #$7D
ldx #$5F
ldy #8
jsr CompareMemory
!byte $BD,$8A,$C0 ;LDA $C08A,X
!byte $B0,$03 ;BCS *+5
!byte $BD,$8B,$C0 ;LDA $C08B,X
bcs @notmuse
inc $7D60
@notmuse
@skip2f
ldx #$60
jmp $7700
@StarThiefCallback2 !pseudopc $110 {
@StarThiefCallback2x
lda #$4C

View File

@ -29,6 +29,7 @@ IDIDSI
rts
@callback1
ldx #$DF
lda $1057
cmp #$84
bne @hook2b
@ -37,22 +38,14 @@ IDIDSI
sta $10D4
lda #$2C
sta $1088
lda #<@callback2
sta $10F9
lda #>@callback2
sta $10FA
lda #$33
bne @patch3
ldx #$F9
@hook2b
lda #<@callback2
sta $10DF
sta $1000,X
lda #>@callback2
sta $10E0
lda #$3A
sta $1001,X
@patch3
sta @tracer2+(@tracer3-@tracer2x)+(@cb3patch+1-@tracer3x)
jmp $1000
@callback2
@ -84,30 +77,51 @@ IDIDSI
@tracer3
!pseudopc $BF00 {
@tracer3x
lda $196
sta @cb3patch1+1
sta @cb3patch2+1
sta @cb3patch3+1
sta @cb3patch4+1
ldx $197
stx @cb3patch3+2
stx @cb3patch4+2
dex
stx @cb3patch1+2
stx @cb3patch2+2
lda #<@callback3
sta $196
lda #>@callback3
sta $197
jmp $100
@callback3
@cb3patch
lda #$D1 ;SMC
sta @cb3jump+1
cmp #$3A
lda #0
ldx #$18
ldy #$BF
bcs +
sta $66A
stx $675
sty $62E
bne ++
+ sta $671
stx $67C
sty $635
++
ldx #$FB
@cb3patch1
lda $d1d1,X ;SMC
cmp #$c0
bne @cb3jump
ldy #<((@cb3_end + 1) & -2)
- tya
eor $bf00,y
sta $bf00,y
iny
iny
bne -
lda #$BF
@cb3patch2
sta $d1d1,X ;SMC
ldx #$37
lda #$00
@cb3patch3
sta $d1d1,X ;SMC
ldx #$42
lda #$18
@cb3patch4
sta $d1d1,X ;SMC
@cb3jump
jmp $6D1 ;SMC
jmp (@cb3patch3+1)
@cb3_end
}
@tracer3_e
}

58
src/idpersonal.a Normal file
View File

@ -0,0 +1,58 @@
; Personal Software tracer
; written by qkumba
;
; tested on
; - MicroChess
; - Gammon Gambler
; - Checker King
IDPersonal
lda #3
ldx #$3C
ldy #7
jsr CompareMemory
!byte $AD,$CC,$03 ;LDA $03CC
!byte $EA ;NOP
!byte $4C,$A5,$03 ;JMP $03A5
bcs @not_microchess
; patch code to regain control after decryption
lda #<@callback_microchess
sta $3bf
lda #>@callback_microchess
sta $3c0
@exit
rts
@callback_microchess
lda $85ff
beq +
inc $35c1
+ jmp $3500
@not_microchess
lda #3
ldx #$46
ldy #9
jsr CompareMemory
!byte $AD,$BB,$03 ;LDA $03BB
!byte $85,$3F ;STA $3F
!byte $E6,$3F ;INC $3F
!byte $A0,$4E ;LDY #$4E
bcs @exit2
; patch code to regain control after decryption
lda #$4c
sta $346
lda #<@callback_gammon
sta $347
lda #>@callback_gammon
sta $348
@exit2
rts
@callback_gammon
lda $85ff
beq +
inc $ba2
+ jmp $b00

View File

@ -12,17 +12,37 @@ IDProDOS
!byte $86,$43 ;STA $43
!byte $C9,$03 ;CMP #$03
bcs @exit
ldx #$60
stx $801
inc $3D
jsr $C65C
dec $27
dec $3D
dec $3D
lda #$38
sta $801
lda #9
ldx #$48
ldy #7
jsr CompareMemory
!byte $C9,$E7 ;CMP #$E7
!byte $D0,$F4 ;BCS *-$0B
!byte $BD,$8C,$C0 ;LDA $C08C,X
bcc @exit
ldy #@ProDOSCallback_e-@ProDOSCallback
- lda @ProDOSCallback-1,y
sta @ProDOSCallbackx-1,y
dey
bne -
lda #$4C
sta $8FC
lda #<@ProDOSCallbackx
sta $8FD
lda #>@ProDOSCallbackx
sta $8FE
clc
@exit
rts

42
src/idsensible.a Normal file
View File

@ -0,0 +1,42 @@
; Sensible Software tracer
; written by qkumba
;
; tested on
; - Sensible Speller
;
IDSensible
lda #3
ldx #1
ldy #6
jsr CompareMemory
!byte $29,$00 ;AND #$00
!byte $85,$3A ;STA $3A
!byte $9A ;TXS
!byte $08 ;PHP
bcs @exit
; patch encoded code to regain control after it loads sectors into $400+
lda #(<@pcallback) xor $99
sta $03A3
lda #(>@pcallback) xor $99
sta $03A4
@exit
rts
@pcallback
!word @callback
@callback
; disable ROM checksum-failure branching
lda $6CE
cmp #$4C
bne +
lda #$60
sta $6CE
; and nibble check which fails occasionally
lda #$2C
sta $79B
+ jmp ($0026)