-
Notifications
You must be signed in to change notification settings - Fork 1
/
hipatch-code.src
129 lines (109 loc) · 2.51 KB
/
hipatch-code.src
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
; hipatch-code.src - 6502 high speed SIO code OS patch
;
; Copyright (c) 2006-2023 by Matthias Reichl <[email protected]>
;
; This program is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation; either version 2 of the License, or
; (at your option) any later version.
;
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License
; along with this program; if not, write to the Free Software
; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
;
; Changes:
; 2008-06-26 Matthias Reichl
; - add (optional) keyboard IRQ patch
;
; 2009-02-10 Matthias Reichl
; - added NMI patch (for insane speeds)
;
; 2009-05-01 Matthias Reichl
; - added coldstart/powerup patch: SHIFT+RESET does a coldstart
; - rearranged memory layout to fit code into $CCxx
;
; 2010-08-14 Matthias Reichl
; - removed NMI patch (obsoleted by new fast VBI code)
.include "hisio.inc"
.include "hipatch.inc"
* = PDEST
.BYTE 0
; patch program must fill this area with jump to standard SIO routine
STDSIO = PSTD
* = PPWRUP
; powerup/reset code: do a cold boot if SHIFT is pressed
LDA #3
STA $D20F
LDA $D20F
AND #$0C
EOR #4
BEQ ?DOCOLD
LDA $033D ; original instruction at $C3B3, was patched with "JMP PBOOT"
?DOCOLD JMP PUPCODE+3
* = PSIO
.if .def PATCHKEY
LDA HIENAB
BNE STDSIO
.endif
.if .def BT
.include "hisiodetbt.src"
.else
LDA DDEVIC
CMP #$31
BNE STDSIO
LDA DUNIT
BEQ STDSIO
.if .def MAXDRIVENO
CMP #MAXDRIVENO+1
.else
CMP #9
.endif
BCS STDSIO
.include "hisiodet.src"
.endif
.include "hisiocode.src"
.if .def PATCHKEY
* = PKEY
LDA $D209
CMP #$F4 ; shift-control-delete = coldstart
BNE PKEY1
JMP $E477
PKEY1 PHA
CMP #$FE ; shift-control-s = reset all variables
BNE PKEY3
TXA
PHA
LDA #0
LDX #8 ; HIENAB must be directly after speed table!
PKEY2 STA SPEEDTB,X ; clear drive speed table
DEX
BPL PKEY2
PLA
TAX
JMP PKEYX
PKEY3 CMP #$F9 ; shift-control-H = enable highspeed SIO
BNE PKEY4
LDA #0
STA HIENAB
BEQ PKEYX
PKEY4 CMP #$E3 ; shift-control-N = normal speed SIO
BNE PKEYX
LDA #$FF
STA HIENAB
PKEYX PLA
RTS
.endif
* = PHISIO
JMP DOHIENTRY
* = PVER
.BYTE "Hias 1.33 "
.if .def BT
.BYTE "SIO2BT"
.else
.BYTE "230525"
.endif