Browse Source

integrated Wheels 64 KERNAL patches

pull/2/merge
Michael Steil 2 years ago
parent
commit
4f19a7987e
83 changed files with 26769 additions and 230 deletions
  1. 2
    5
      .gitignore
  2. 102
    64
      Makefile
  3. 27
    11
      README.md
  4. 76
    6
      config.inc
  5. 5
    0
      inc/c64.inc
  6. 2
    0
      inc/const.inc
  7. 30
    2
      inc/diskdrv.inc
  8. 15
    1
      inc/jumptab.inc
  9. 70
    0
      inc/jumptab_wheels.inc
  10. 28
    3
      inc/kernal.inc
  11. 109
    10
      kernal/bswfont.s
  12. 27
    4
      kernal/conio.s
  13. 499
    13
      kernal/dlgbox.s
  14. 847
    22
      kernal/filesys.s
  15. 53
    2
      kernal/fonts.s
  16. 253
    13
      kernal/graph.s
  17. 35
    6
      kernal/header.s
  18. 13
    0
      kernal/hw.s
  19. 21
    3
      kernal/icon.s
  20. 66
    4
      kernal/init.s
  21. 12
    2
      kernal/irq.s
  22. 72
    1
      kernal/jumptable.s
  23. 16
    8
      kernal/kernal_bsw.cfg
  24. 134
    0
      kernal/kernal_wheels.cfg
  25. 138
    7
      kernal/keyboard.s
  26. 135
    7
      kernal/load.s
  27. 29
    5
      kernal/mainloop.s
  28. 24
    1
      kernal/math.s
  29. 41
    3
      kernal/memory.s
  30. 122
    7
      kernal/menu.s
  31. 6
    0
      kernal/misc.s
  32. 53
    0
      kernal/mouse.s
  33. 26
    3
      kernal/panic.s
  34. 69
    1
      kernal/process.s
  35. 48
    2
      kernal/reu.s
  36. 7
    0
      kernal/serial.s
  37. 24
    0
      kernal/sprites.s
  38. 32
    5
      kernal/time.s
  39. 6
    2
      kernal/tobasic.s
  40. 16
    1
      kernal/vars.s
  41. 941
    0
      kernal/wheels/copydisk.s
  42. 923
    0
      kernal/wheels/copyfile.s
  43. 191
    0
      kernal/wheels/devnum.s
  44. 275
    0
      kernal/wheels/directory.s
  45. 1561
    0
      kernal/wheels/format.s
  46. 719
    0
      kernal/wheels/loadb.s
  47. 1320
    0
      kernal/wheels/partition.s
  48. 413
    0
      kernal/wheels/ram.s
  49. 133
    0
      kernal/wheels/reux.s
  50. 869
    0
      kernal/wheels/tmp/reu0.s
  51. 621
    0
      kernal/wheels/tmp/reu1.s
  52. 1185
    0
      kernal/wheels/tmp/reu10.s
  53. 521
    0
      kernal/wheels/tmp/reu10_7900.s
  54. 749
    0
      kernal/wheels/tmp/reu11.s
  55. 2112
    0
      kernal/wheels/tmp/reu2.s
  56. 686
    0
      kernal/wheels/tmp/reu3.s
  57. 640
    0
      kernal/wheels/tmp/reu4.s
  58. 1824
    0
      kernal/wheels/tmp/reu5.s
  59. 708
    0
      kernal/wheels/tmp/reu6.s
  60. 1117
    0
      kernal/wheels/tmp/reu7.s
  61. 1416
    0
      kernal/wheels/tmp/reu8.s
  62. 862
    0
      kernal/wheels/tmp/reu8_7900.s
  63. 1387
    0
      kernal/wheels/tmp/reu9.s
  64. 762
    0
      kernal/wheels/tmp/reu9_7900.s
  65. 248
    0
      kernal/wheels/tobasicb.s
  66. 650
    0
      kernal/wheels/validate.s
  67. 610
    0
      kernal/wheels/wheels.s
  68. BIN
      reference/wheels/kernal.bin
  69. BIN
      reference/wheels/reu0.bin
  70. BIN
      reference/wheels/reu1.bin
  71. BIN
      reference/wheels/reu10.bin
  72. BIN
      reference/wheels/reu11.bin
  73. BIN
      reference/wheels/reu2.bin
  74. BIN
      reference/wheels/reu3.bin
  75. BIN
      reference/wheels/reu4.bin
  76. BIN
      reference/wheels/reu5.bin
  77. BIN
      reference/wheels/reu6.bin
  78. BIN
      reference/wheels/reu7.bin
  79. BIN
      reference/wheels/reu8.bin
  80. BIN
      reference/wheels/reu9.bin
  81. BIN
      reference/wheels/reux.bin
  82. BIN
      reference/wheels/wheels.reu
  83. 36
    6
      regress.sh

+ 2
- 5
.gitignore View File

@@ -1,6 +1,3 @@
1
-*.o
2
-*.bin
3
-*.prg
4
-*.d64
1
+GEOS64.D64
5 2
 desktop.cvt
6
-kernal.map
3
+build

+ 102
- 64
Makefile View File

@@ -1,3 +1,6 @@
1
+
2
+VARIANT ?= bsw
3
+
1 4
 AS=ca65
2 5
 LD=ld65
3 6
 
@@ -35,7 +38,30 @@ KERNAL_SOURCES= \
35 38
 	kernal/start.s \
36 39
 	kernal/time.s \
37 40
 	kernal/tobasic.s \
38
-	kernal/vars.s
41
+	kernal/vars.s \
42
+	kernal/wheels/wheels.s \
43
+	kernal/wheels/ram.s \
44
+	kernal/wheels/devnum.s \
45
+	kernal/wheels/format.s \
46
+	kernal/wheels/partition.s \
47
+	kernal/wheels/directory.s \
48
+	kernal/wheels/validate.s \
49
+	kernal/wheels/copydisk.s \
50
+	kernal/wheels/copyfile.s \
51
+	kernal/wheels/loadb.s \
52
+	kernal/wheels/tobasicb.s \
53
+	kernal/wheels/reux.s \
54
+
55
+DRIVER_SOURCES= \
56
+	drv/drv1541.bin \
57
+	drv/drv1571.bin \
58
+	drv/drv1581.bin \
59
+	input/joydrv.bin \
60
+	input/amigamse.bin \
61
+	input/lightpen.bin \
62
+	input/mse1531.bin \
63
+	input/koalapad.bin \
64
+	input/pcanalog.bin
39 65
 
40 66
 DEPS= \
41 67
 	inc/c64.inc \
@@ -48,88 +74,100 @@ DEPS= \
48 74
 	inc/kernal.inc \
49 75
 	inc/printdrv.inc
50 76
 
51
-KERNAL_OBJECTS=$(KERNAL_SOURCES:.s=.o)
77
+KERNAL_OBJS=$(KERNAL_SOURCES:.s=.o)
78
+DRIVER_OBJS=$(DRIVER_SOURCES:.s=.o)
79
+ALL_OBJS=$(KERNAL_OBJS) $(DRIVER_OBJS)
80
+
81
+BUILD_DIR=build/$(VARIANT)
82
+
83
+PREFIXED_KERNAL_OBJS = $(addprefix $(BUILD_DIR)/, $(KERNAL_OBJS))
52 84
 
53 85
 ALL_BINS= \
54
-	kernal.bin \
55
-	lokernal.bin \
56
-	start.bin \
57
-	drv1541.bin \
58
-	drv1571.bin \
59
-	drv1581.bin \
60
-	amigamse.bin \
61
-	joydrv.bin \
62
-	lightpen.bin \
63
-	mse1531.bin \
64
-	koalapad.bin \
65
-	pcanalog.bin
66
-
67
-all: geos.d64
86
+	$(BUILD_DIR)/kernal/kernal.bin \
87
+	$(BUILD_DIR)/drv/drv1541.bin \
88
+	$(BUILD_DIR)/drv/drv1571.bin \
89
+	$(BUILD_DIR)/drv/drv1581.bin \
90
+	$(BUILD_DIR)/input/joydrv.bin \
91
+	$(BUILD_DIR)/input/amigamse.bin \
92
+	$(BUILD_DIR)/input/lightpen.bin \
93
+	$(BUILD_DIR)/input/mse1531.bin \
94
+	$(BUILD_DIR)/input/koalapad.bin \
95
+	$(BUILD_DIR)/input/pcanalog.bin
96
+
97
+
98
+all: $(BUILD_DIR)/geos.d64
99
+
100
+regress:
101
+	@echo "********** Building variant 'bsw'"
102
+	@$(MAKE) VARIANT=bsw all
103
+	./regress.sh bsw
104
+	@echo "********** Building variant 'wheels'"
105
+	@$(MAKE) VARIANT=wheels all
106
+	./regress.sh wheels
68 107
 
69 108
 clean:
70
-	rm -f $(KERNAL_OBJECTS) drv/*.o input/*.o $(ALL_BINS) combined.prg compressed.prg geos.d64
71
-
72
-geos.d64: compressed.prg
73
-	if [ -e GEOS64.D64 ]; then \
74
-		cp GEOS64.D64 geos.d64; \
75
-		echo delete geos geoboot | c1541 geos.d64 >/dev/null; \
76
-		echo write compressed.prg geos | c1541 geos.d64 >/dev/null; \
77
-		echo \*\*\* Created geos.d64 based on GEOS64.D64.; \
109
+	rm -rf build
110
+
111
+$(BUILD_DIR)/geos.d64: $(BUILD_DIR)/kernal_compressed.prg
112
+	@if [ -e GEOS64.D64 ]; then \
113
+		cp GEOS64.D64 $@; \
114
+		echo delete geos geoboot | c1541 $@ >/dev/null; \
115
+		echo write $< geos | c1541 $@ >/dev/null; \
116
+		echo \*\*\* Created $@ based on GEOS64.D64.; \
78 117
 	else \
79
-		echo format geos,00 d64 geos.d64 | c1541 >/dev/null; \
80
-		echo write compressed.prg geos | c1541 geos.d64 >/dev/null; \
81
-		if [ -e desktop.cvt ]; then echo geoswrite desktop.cvt | c1541 geos.d64; fi >/dev/null; \
82
-		echo \*\*\* Created fresh geos.d64.; \
118
+		echo format geos,00 d64 $@ | c1541 >/dev/null; \
119
+		echo write $< geos | c1541 $@ >/dev/null; \
120
+		if [ -e desktop.cvt ]; then echo geoswrite desktop.cvt | c1541 $@; fi >/dev/null; \
121
+		echo \*\*\* Created fresh $@.; \
83 122
 	fi;
84 123
 
85
-compressed.prg: combined.prg
86
-	pucrunch -f -c64 -x0x5000 $< $@
87
-
88
-combined.prg: $(ALL_BINS)
89
-	printf "\x00\x50" > tmp.bin
90
-	cat start.bin /dev/zero | dd bs=1 count=16384 >> tmp.bin 2> /dev/null
91
-	cat drv1541.bin /dev/zero | dd bs=1 count=3456 >> tmp.bin 2> /dev/null
92
-	cat lokernal.bin /dev/zero | dd bs=1 count=8640 >> tmp.bin 2> /dev/null
93
-	cat kernal.bin /dev/zero | dd bs=1 count=16192 >> tmp.bin 2> /dev/null
94
-	cat joydrv.bin >> tmp.bin 2> /dev/null
95
-	mv tmp.bin combined.prg
96
-
97
-kernal.bin: $(KERNAL_OBJECTS) kernal/kernal.cfg
98
-	$(LD) -C kernal/kernal.cfg $(KERNAL_OBJECTS) -o $@ -m kernal.map
124
+$(BUILD_DIR)/kernal_compressed.prg: $(BUILD_DIR)/kernal_combined.prg
125
+	@echo Creating $@
126
+	pucrunch -f -c64 -x0x5000 $< $@ 2> /dev/null
99 127
 
100
-lokernal.bin: kernal.bin
128
+$(BUILD_DIR)/kernal_combined.prg: $(ALL_BINS)
129
+	@echo Creating $@
130
+	@printf "\x00\x50" > $(BUILD_DIR)/tmp.bin
131
+	@dd if=$(BUILD_DIR)/kernal/kernal.bin bs=1 count=16384 >> $(BUILD_DIR)/tmp.bin 2> /dev/null
132
+	@cat $(BUILD_DIR)/drv/drv1541.bin /dev/zero | dd bs=1 count=3456 >> $(BUILD_DIR)/tmp.bin 2> /dev/null
133
+	@cat $(BUILD_DIR)/kernal/kernal.bin /dev/zero | dd bs=1 count=24832 skip=19840 >> $(BUILD_DIR)/tmp.bin 2> /dev/null
134
+	@cat $(BUILD_DIR)/input/joydrv.bin >> $(BUILD_DIR)/tmp.bin 2> /dev/null
135
+	@mv $(BUILD_DIR)/tmp.bin $(BUILD_DIR)/kernal_combined.prg
101 136
 
102
-start.bin: kernal.bin
137
+$(BUILD_DIR)/drv/drv1541.bin: $(BUILD_DIR)/drv/drv1541.o drv/drv1541.cfg $(DEPS)
138
+	$(LD) -C drv/drv1541.cfg $(BUILD_DIR)/drv/drv1541.o -o $@
103 139
 
104
-drv1541.bin: drv/drv1541.o drv/drv1541.cfg $(DEPS)
105
-	$(LD) -C drv/drv1541.cfg drv/drv1541.o -o $@
140
+$(BUILD_DIR)/drv/drv1571.bin: $(BUILD_DIR)/drv/drv1571.o drv/drv1571.cfg $(DEPS)
141
+	$(LD) -C drv/drv1571.cfg $(BUILD_DIR)/drv/drv1571.o -o $@
106 142
 
107
-drv1571.bin: drv/drv1571.o drv/drv1571.cfg $(DEPS)
108
-	$(LD) -C drv/drv1571.cfg drv/drv1571.o -o $@
143
+$(BUILD_DIR)/drv/drv1581.bin: $(BUILD_DIR)/drv/drv1581.o drv/drv1581.cfg $(DEPS)
144
+	$(LD) -C drv/drv1581.cfg $(BUILD_DIR)/drv/drv1581.o -o $@
109 145
 
110
-drv1581.bin: drv/drv1581.o drv/drv1581.cfg $(DEPS)
111
-	$(LD) -C drv/drv1581.cfg drv/drv1581.o -o $@
146
+$(BUILD_DIR)/input/amigamse.bin: $(BUILD_DIR)/input/amigamse.o input/amigamse.cfg $(DEPS)
147
+	$(LD) -C input/amigamse.cfg $(BUILD_DIR)/input/amigamse.o -o $@
112 148
 
113
-amigamse.bin: input/amigamse.o input/amigamse.cfg $(DEPS)
114
-	$(LD) -C input/amigamse.cfg input/amigamse.o -o $@
149
+$(BUILD_DIR)/input/joydrv.bin: $(BUILD_DIR)/input/joydrv.o input/joydrv.cfg $(DEPS)
150
+	$(LD) -C input/joydrv.cfg $(BUILD_DIR)/input/joydrv.o -o $@
115 151
 
116
-joydrv.bin: input/joydrv.o input/joydrv.cfg $(DEPS)
117
-	$(LD) -C input/joydrv.cfg input/joydrv.o -o $@
152
+$(BUILD_DIR)/input/lightpen.bin: $(BUILD_DIR)/input/lightpen.o input/lightpen.cfg $(DEPS)
153
+	$(LD) -C input/lightpen.cfg $(BUILD_DIR)/input/lightpen.o -o $@
118 154
 
119
-lightpen.bin: input/lightpen.o input/lightpen.cfg $(DEPS)
120
-	$(LD) -C input/lightpen.cfg input/lightpen.o -o $@
155
+$(BUILD_DIR)/input/mse1531.bin: $(BUILD_DIR)/input/mse1531.o input/mse1531.cfg $(DEPS)
156
+	$(LD) -C input/mse1531.cfg $(BUILD_DIR)/input/mse1531.o -o $@
121 157
 
122
-mse1531.bin: input/mse1531.o input/mse1531.cfg $(DEPS)
123
-	$(LD) -C input/mse1531.cfg input/mse1531.o -o $@
158
+$(BUILD_DIR)/input/koalapad.bin: $(BUILD_DIR)/input/koalapad.o input/koalapad.cfg $(DEPS)
159
+	$(LD) -C input/koalapad.cfg $(BUILD_DIR)/input/koalapad.o -o $@
124 160
 
125
-koalapad.bin: input/koalapad.o input/koalapad.cfg $(DEPS)
126
-	$(LD) -C input/koalapad.cfg input/koalapad.o -o $@
161
+$(BUILD_DIR)/input/pcanalog.bin: $(BUILD_DIR)/input/pcanalog.o input/pcanalog.cfg $(DEPS)
162
+	$(LD) -C input/pcanalog.cfg $(BUILD_DIR)/input/pcanalog.o -o $@
127 163
 
128
-pcanalog.bin: input/pcanalog.o input/pcanalog.cfg $(DEPS)
129
-	$(LD) -C input/pcanalog.cfg input/pcanalog.o -o $@
164
+$(BUILD_DIR)/%.o: %.s
165
+	@mkdir -p `dirname $@`
166
+	$(AS) -D $(VARIANT)=1 $(ASFLAGS) $< -o $@
130 167
 
131
-%.o: %.s $(DEPS)
132
-	$(AS) $(ASFLAGS) $< -o $@
168
+$(BUILD_DIR)/kernal/kernal.bin: $(PREFIXED_KERNAL_OBJS) kernal/kernal_$(VARIANT).cfg
169
+	@mkdir -p $$(dirname $@)
170
+	$(LD) -C kernal/kernal_$(VARIANT).cfg $(PREFIXED_KERNAL_OBJS) -o $@ -m $(BUILD_DIR)/kernal/kernal.map
133 171
 
134 172
 # a must!
135 173
 love:	

+ 27
- 11
README.md View File

@@ -78,25 +78,35 @@ Without pucrunch/c1541, you can still build an uncompressed KERNAL binary image.
78 78
 
79 79
 ## Building
80 80
 
81
-Run `make` to build GEOS. This will create the following files:
81
+Run `make` to build the original "BSW" "GEOS. This will create the following files in directory `build/bsw`:
82 82
 
83 83
 * raw KERNAL components: `kernal.bin`, `lokernal.bin`, `init.bin`
84 84
 * disk drive drivers: `drv1541.bin`, `drv1571.bin`, `drv1581.bin`
85 85
 * input drivers: `amigamse.bin`, `joydrv.bin`, `lightpen.bin`, `mse1531.bin`, `koalapad.bin`, `pcanalog.bin`
86
-* combined KERNAL image (`SYS 49155`): `combined.prg`
87
-* compressed KERNAL image (`RUN`): `compressed.prg`
86
+* combined KERNAL image (`SYS 49155`): `kernal_combined.prg`
87
+* compressed KERNAL image (`RUN`): `kernal_compressed.prg`
88 88
 * disk image: `geos.d64`
89 89
 
90 90
 If you have the [cbmfiles.com](http://www.cbmfiles.com/) `GEOS64.D64` image in the current directory, the disk image will be based on that one, with the `GEOS` and `GEOBOOT` files deleted and the newly built kernel added. Otherwise, it will be a new disk image with the kernel, and, if you have a `desktop.cvt` file in the current directory, with `DESK TOP` added.
91 91
 
92
-## Customization
92
+## Variants
93
+
94
+The build system supports the following variants:
95
+
96
+* `bsw` (default): Berkeley Softworks GEOS 64 2.0 variant
97
+* `cbmfiles`: The [cbmfiles.com](http://www.cbmfiles.com/) version. It starts out with a different date, and has some variables in the kernel pre-filled.
98
+* `gateway`: The patched KERNEL shipped by gateWay 2.51. It contains a slightly modified BSW font, has the `Panic` code replaced with code to swap the disk driver on a RESTORE press, and it loads `GATEWAY` instead of `DESK TOP` as the shell.
99
+* `wheels`: The Wheels 64 variant. It is heavily patched, optimized for size and speed, and contains additional features. It requires a RAM extension. The current version compiles into the same binary, but won't actually run because of missing boot code. More work is needed here.
100
+
101
+You can build a specific variant like this:
102
+
103
+    make VARIANT=<variant>
93 104
 
94
-`config.inc` contains lots of compile time options. Most of them have not been tested recently and may not work.
105
+All output will be put into `build/<variant>`.
95 106
 
96
-By default, the "BSW" version of GEOS is built, which is the same binary as English GEOS 2.0. The following options can be set to 1 to build different versions:
107
+## Customization
97 108
 
98
-* `cbmfiles = 1`: The [cbmfiles.com](http://www.cbmfiles.com/) version. It starts out with a different date, and has some variables in the kernel pre-filled.
99
-* `gateway = 1`: The patched KERNEL shipped by gateWay 2.51. It contains a slightly modified BSW font, has the `Panic` code replaced with code to swap the disk driver on a RESTORE press, and it loads `GATEWAY` instead of `DESK TOP` as the shell.
109
+If you want to customize your KERNAL, you can do so by flipping switches in `config.inc`, which contains lots of compile time options. Some them have not been tested recently and may not work.
100 110
 
101 111
 The following options can be enabled:
102 112
 
@@ -170,7 +180,11 @@ The original GEOS was copy protected in three ways:
170 180
 
171 181
 ## Contributing
172 182
 
173
-Pull requests are greatly appreciated. Please keep in mind that a default build should always recreate the orginal binaries (use `regress.sh` to check), so for smaller changes use conditional assembly using `.if`, and for larger changes create new source files that are conditionally compiled.
183
+Pull requests are greatly appreciated. Please keep in mind that a default build should always recreate the orginal binaries, so for smaller changes use conditional assembly using `.if`, and for larger changes create new source files that are conditionally compiled.
184
+
185
+The following command line will build the `bsw` and `wheels` variants of GEOS and compare the resulting binaries with reference binaries:
186
+
187
+    make regress
174 188
 
175 189
 ## TODO
176 190
 
@@ -179,7 +193,10 @@ Pull requests are greatly appreciated. Please keep in mind that a default build
179 193
 	* `boot.s` should be based on the original GEOS version
180 194
 	* REU detection is missing from `boot.s`
181 195
 	* The 1541 driver is hardcoded. We should create one version per drive.
182
-	* Most of Maciej's original changes/improvements have bitrotten and need to be resurrected
196
+	* Some of Maciej's original changes/improvements have bitrotten and need to be resurrected
197
+	* Wheels
198
+		* The Wheels variant needs boot code to start up correctly.
199
+		* The additional Wheels code needs to be reverse engineered properly.
183 200
 * Integrate other versions as compile time options
184 201
 	* Localized versions
185 202
 	* Plus/4 version
@@ -187,7 +204,6 @@ Pull requests are greatly appreciated. Please keep in mind that a default build
187 204
 	* Apple II version (includes new APIs)
188 205
 * Integrate existing patches as compile time options
189 206
 	* megaPatch
190
-	* Wheels
191 207
 	* SuperCPU
192 208
 	* Flash 8
193 209
 	* [misc](http://www.zimmers.net/anonftp/pub/cbm/geos/patches/index.html)

+ 76
- 6
config.inc View File

@@ -1,14 +1,84 @@
1 1
 ; GEOS System build configuration
2 2
 ; by Maciej Witkowiak
3 3
 
4
+;------------------------
4 5
 ; which variant to build
5
-cbmfiles = 0 ; the cbmfiles.com variant
6
-gateway  = 0 ; the gateWay 2.51 variant
7
-; if all of these are 0, the BSW variant will be built
6
+;------------------------
7
+; use "make TARGET=<variant>" to build a specific variant
8
+
9
+;------------------------
10
+; the Berkeley Softworks GEOS 64 2.0 variant
11
+;------------------------
12
+.ifdef bsw
13
+	; BSW traps to counter tampering
14
+	trap = 1
15
+.endif
16
+
17
+;------------------------
18
+; the cbmfiles.com variant of GEOS 64 2.0
19
+;------------------------
20
+.ifdef cbmfiles
21
+	trap = 1
22
+
23
+	; additionally, there are ".ifdef cbmfiles" checks
24
+	; throughout the code
25
+.endif
26
+
27
+;------------------------
28
+; the gateWay 2.51 variant
29
+;------------------------
30
+.ifdef gateway
31
+	trap = 1
32
+	gateway_font = 1
33
+
34
+	; additionally, there are ".ifdef gateway" checks
35
+	; throughout the code
36
+.endif
37
+
38
+;------------------------
39
+; the Wheels 64 variant
40
+;------------------------
41
+.ifdef wheels
42
+	; size optimizations that have no significant speed impact
43
+	wheels_size = 1
44
+
45
+	; optimizations that benefit both size and speed
46
+	wheels_size_and_speed = 1
47
+
48
+	; fixes for bugs in the BSW version
49
+	wheels_fixes = 1
8 50
 
9
-; The original GEOS binary contains a few traps to counter tampering.
10
-; They can be turned off with this global switch
11
-trap = 1
51
+	; dialog box buttons can be selected using "o" for
52
+	; "Open" etc.
53
+	wheels_button_shortcuts = 1
54
+
55
+	; misc dialog box features, requires RAM extension
56
+	wheels_dlgbox_features = 1
57
+
58
+	; dialog box double click support
59
+	wheels_dlgbox_dblclick = 1
60
+
61
+	; support for chdir in dialogs
62
+	wheels_dialog_chdir = 1
63
+
64
+	; screensaver support
65
+	wheels_screensaver = 1
66
+
67
+	; ReadFile and WriteFile are in a "NewKernal" group
68
+	wheels_external_readwrite_file = 1
69
+
70
+	; allows applications to check whether modifier keys are pressed
71
+	wheels_expose_mod_keys = 1
72
+
73
+	; changes that are actually bad ideas
74
+	wheels_bad_ideas = 1
75
+
76
+	; German keyboard layout
77
+	german_keyboard = 1
78
+
79
+	; additionally, there are ".ifdef wheels" checks
80
+	; throughout the code
81
+.endif
12 82
 
13 83
 ; general code generation/optimization control:
14 84
 onlyVLIR        =       0               ; only VLIR and SEQ supported

+ 5
- 0
inc/c64.inc View File

@@ -75,6 +75,11 @@ mob7clr                 =       $d02e
75 75
 keyreg                  =       $d02f
76 76
 clkreg                  =       $d030
77 77
 
78
+scpu_base               =       $d074
79
+scpu_turbo              =       $d07b
80
+scpu_hwreg_enable       =       $d07e
81
+scpu_hwreg_disable      =       $d07f
82
+
78 83
 ;
79 84
 vdcreg                  =       $d600
80 85
 vdcdata                 =       $d601

+ 2
- 0
inc/const.inc View File

@@ -398,6 +398,8 @@ SET_SURPRESS            =       %01000000
398 398
 SET_RIGHTJUST           =       %00000000
399 399
 SET_LEFTJUST            =       %10000000
400 400
 
401
+CLICK_COUNT             =       30
402
+
401 403
 ; icons, menus status flags
402 404
 ST_FLASH                =       $80
403 405
 ST_INVERT               =       $40

+ 30
- 2
inc/diskdrv.inc View File

@@ -34,7 +34,35 @@ GetBorder               =       $9036
34 34
 AddDirBlock             =       $9039
35 35
 ReadBuff                =       $903c
36 36
 WriteBuff               =       $903f
37
-;??? = $9042
38
-;??? = $9045
37
+SendTSBytes             =       $9042
38
+CheckErrors             =       $9045
39 39
 AllocateBlock           =       $9048
40 40
 ReadLink                =       $904b
41
+
42
+; Wheels only
43
+ddriveType              =       $904e
44
+driverVersion           =       $904f
45
+OpenRoot                =       $9050
46
+OpenDirectory           =       $9053
47
+GetBamBlock             =       $9056
48
+PutBamBlock             =       $9059
49
+dirHeadTrack            =       $905c
50
+dirHeadSector           =       $905d
51
+curBamBlock             =       $905e
52
+lastBamByte             =       $905f
53
+lastBamSector           =       $9060
54
+bamAltered              =       $9061
55
+highestTrack            =       $9062
56
+GetHeadTS               =       $9063
57
+PutHeadTS               =       $9066
58
+GetLink                 =       $9069
59
+GetSysDirBlk            =       $906c
60
+startBank               =       $906f
61
+startPage               =       $9070
62
+pagesUsed               =       $9071
63
+cableType               =       $9073
64
+ckdBrdrYet              =       $9074 ; $ff means GetNxtDirEntry is working
65
+                                      ; in the system directory. (read only)
66
+dir3Head                =       $9c80 ; to be used by the disk drivers only.
67
+                                      ; It resides within each driver.
68
+                                      ; ($9c80-$9d7f)

+ 15
- 1
inc/jumptab.inc View File

@@ -175,4 +175,18 @@ AccessCache             =       $c2ef
175 175
 HideOnlyMouse           =       $c2f2
176 176
 SetColorMode            =       $c2f5
177 177
 ColorCard               =       $c2f8
178
-ColorRectangle          =       $c2fb
178
+ColorRectangle          =       $c2fb ; Wheels renames this to ColorBox
179
+
180
+; only in Wheels
181
+InitMachine             =       $c2fe
182
+GEOSOptimize            =       $c301
183
+DEFOptimize             =       $c304
184
+DoOptimize              =       $c307
185
+NFindFTypes             =       $c30a
186
+ReadXYPot               =       $c30d
187
+MainIRQ                 =       $c310
188
+ColorRectangle_W        =       $c313 ; Original name is ColorRectangle
189
+i_ColorRectangle        =       $c316
190
+SaveColor               =       $c319
191
+RstrColor               =       $c31c
192
+ConvToCards             =       $c31f

+ 70
- 0
inc/jumptab_wheels.inc View File

@@ -0,0 +1,70 @@
1
+; Wheels
2
+; these are addresses to routines that are in the extended
3
+; kernal that get loaded in at $5000 in groups.
4
+
5
+; group 0
6
+GetRAMBam               =       $5000
7
+PutRAMBam               =       $5003
8
+AllocAllRAM             =       $5006
9
+AllocRAMBlock           =       $5009
10
+FreeRAMBlock            =       $500c
11
+GetRAMInfo              =       $500f
12
+RamBlkAlloc             =       $5012
13
+RemoveDrive             =       $5015
14
+SvRamDevice             =       $5018
15
+DelRamDevice            =       $501b
16
+RamDevInfo              =       $501e
17
+
18
+; group 1
19
+DevNumChange            =       $5000
20
+SwapDrives              =       $5003
21
+
22
+; group 2
23
+NSetGEOSDisk            =       $5000
24
+DBFormat                =       $5000+3
25
+FormatDisk              =       $5000+6
26
+DBEraseDisk             =       $5000+9
27
+EraseDisk               =       $5000+12
28
+
29
+; group 3
30
+OReadFile               =       $5000
31
+
32
+; group 4
33
+OWriteFile              =       $5000
34
+
35
+; group 5
36
+ChgParType              =       $5000
37
+ChPartition             =       $5000+3
38
+ChSubdir                =       $5000+6
39
+ChDiskDirectory         =       $5000+9
40
+GetFEntries             =       $5000+12
41
+TopDirectory            =       $5000+15
42
+UpDirectory             =       $5000+18
43
+DownDirectory           =       $5000+21
44
+GoPartition             =       $5000+24
45
+ChPartOnly              =       $5000+30
46
+FindRamLink             =       $5000+39
47
+
48
+; group 6
49
+MakeDirectory           =       $5000
50
+MakeSysDir              =       $5003
51
+
52
+; group 7
53
+ValDisk                 =       $5000
54
+
55
+; group 8
56
+CopyDisk                =       $5000
57
+TestCompatibility       =       $5003
58
+
59
+; group 9
60
+CopyFile                =       $5000
61
+
62
+; group 10
63
+NewDesktop              =       $5000
64
+OEnterDesktop           =       $5003
65
+InstallDriver           =       $5006
66
+FindDesktop             =       $5009
67
+FindAFile               =       $500c
68
+
69
+; group 11
70
+KToBasic                =       $5000

+ 28
- 3
inc/kernal.inc View File

@@ -21,12 +21,27 @@ DBoxDesc        =       $43
21 21
 DBoxDescL       =       $43
22 22
 DBoxDescH       =       $44
23 23
 
24
+; Wheels internal vars
25
+
26
+; bit 7    = time out, run the screensaver.
27
+; bit 6    = saver blocked, don't run it yet.
28
+; bit 5    = stop the timer.
29
+; bit 4    = timer off. Screensaver will never run.
30
+; bits 2,3 = unused.
31
+; bit 1    = if set then ignore mouse movement.
32
+; bit 0    = screensaver is running.
33
+saverStatus     =       $88b4
34
+saverTimer      =       $88b5 ; time remaining before screensaver.
35
+saverCount      =       $88b7 ; user defined countdown to screensaver.
36
+saverBank       =       $88b9 ; bank in reu holding screensaver.
37
+vdcRamType      =       $88ba ; bit7 1=64K VDC ram, 0=16K ram.
38
+
24 39
 ; GEOS Kernal internal vars (not for use by apps)
25 40
 
26 41
 savedmoby2      =       $88bb ; ---
27 42
 scr80polar      =       $88bc ; ---
28 43
 scr80colors     =       $88bd ; ---
29
-vdcClrMode      =       $88be ; ---
44
+vdcClrMode      =       $88be ; --- (used with 128 only)
30 45
 driveData       =       $88bf ; drv
31 46
 ramExpSize      =       $88c3 ; reu
32 47
 sysRAMFlg       =       $88c4 ; drv, filesys, memory, tobasic
@@ -62,7 +77,7 @@ obj7Pointer     =       $8fff ; ---
62 77
 BVBuff          =       $0400
63 78
 RunREU          =       $6000
64 79
 
65
-; locations to be defined later
80
+keyScanChar     =       $87ea ; character fetched during the last interrupt. (Wheels)
66 81
 E87FC           =       $87fc
67 82
 E87FD           =       $87fd
68 83
 E87FE           =       $87fe
@@ -72,10 +87,20 @@ A885D           =       $885d
72 87
 A885E           =       $885e
73 88
 A885F           =       $885f
74 89
 A8860           =       $8860
75
-e88b7           =       $88b7   ;4 bytes indexed by curDrive, 1571 disk type (SS/DS)
90
+dblDBData       =       $88a7   ; icon number used for double clicking
91
+                                ; in the file requestor. Default is OPEN.
92
+minKeyRepeat    =       $88b0   ; minimum key repeat value during accel. (Wheels)
93
+keyAccFlag      =       $88b1   ; zero turns off key acceleration. (Wheels)
94
+keyAccel        =       $88b2   ; used during key acceleration. (Wheels)
95
+keyRptCount     =       $88b3   ; user defined key repeat delay. (Wheels)
96
+e88b7           =       $88b7   ; 4 bytes indexed by curDrive, 1571 disk type (SS/DS)
76 97
 A8FE8           =       $8fe8
77 98
 A8FF0           =       $8ff0
78 99
 
100
+; Wheels
101
+prtHdrStorage   =       $f700   ; print driver header stored here.
102
+prtCodeStorage  =       $f800   ; print driver code stored here.
103
+
79 104
 ; RamExp stats block structure
80 105
 DACC_ST_ADDR    =       $80     ;deskAccessory load addr
81 106
 DACC_LGH        =       $82     ;deskAccessory lenght

+ 109
- 10
kernal/bswfont.s View File

@@ -10,6 +10,104 @@
10 10
 .segment "bswfont"
11 11
 
12 12
 BSWFont:
13
+.ifdef wheels
14
+	.byte $06,$3c,$00,$09,$08,$00,$cc,$00
15
+	.byte $00,$00,$05,$00,$07,$00,$0b,$00
16
+	.byte $11,$00,$17,$00,$1d,$00,$23,$00
17
+	.byte $25,$00,$29,$00,$2d,$00,$33,$00
18
+	.byte $39,$00,$3c,$00,$41,$00,$43,$00
19
+	.byte $4a,$00,$4f,$00,$52,$00,$56,$00
20
+	.byte $5a,$00,$5f,$00,$63,$00,$68,$00
21
+	.byte $6d,$00,$72,$00,$77,$00,$79,$00
22
+	.byte $7c,$00,$80,$00,$84,$00,$88,$00
23
+	.byte $8e,$00,$94,$00,$9a,$00,$9f,$00
24
+	.byte $a4,$00,$a9,$00,$ad,$00,$b1,$00
25
+	.byte $b6,$00,$bc,$00,$be,$00,$c2,$00
26
+	.byte $c8,$00,$cc,$00,$d4,$00,$da,$00
27
+	.byte $e0,$00,$e5,$00,$eb,$00,$f0,$00
28
+	.byte $f5,$00,$f9,$00,$fe,$00,$04,$01
29
+	.byte $0c,$01,$12,$01,$18,$01,$1e,$01
30
+	.byte $23,$01,$28,$01,$2d,$01,$33,$01
31
+	.byte $3b,$01,$3f,$01,$44,$01,$49,$01
32
+	.byte $4e,$01,$53,$01,$58,$01,$5b,$01
33
+	.byte $60,$01,$65,$01,$67,$01,$69,$01
34
+	.byte $6e,$01,$70,$01,$78,$01,$7d,$01
35
+	.byte $83,$01,$88,$01,$8d,$01,$90,$01
36
+	.byte $94,$01,$97,$01,$9c,$01,$a2,$01
37
+	.byte $aa,$01,$b0,$01,$b5,$01,$ba,$01
38
+	.byte $bf,$01,$c4,$01,$c9,$01,$ce,$01
39
+	.byte $d7,$01,$e0,$01,$02,$a5,$1e,$c1
40
+	.byte $88,$a0,$80,$00,$00,$0c,$59,$82
41
+	.byte $e2,$79,$8c,$00,$00,$38,$01,$1c
42
+	.byte $67,$3b,$99,$14,$51,$44,$14,$4e
43
+	.byte $71,$ce,$3b,$a5,$14,$14,$51,$7d
44
+	.byte $29,$48,$00,$08,$04,$00,$20,$20
45
+	.byte $42,$a1,$00,$00,$00,$00,$00,$00
46
+	.byte $00,$00,$00,$00,$00,$18,$00,$38
47
+	.byte $02,$a5,$28,$ca,$09,$12,$a0,$00
48
+	.byte $00,$52,$c4,$46,$84,$0a,$52,$01
49
+	.byte $04,$44,$e2,$92,$94,$a2,$25,$14
50
+	.byte $52,$46,$36,$51,$4a,$29,$41,$25
51
+	.byte $14,$14,$51,$04,$00,$00,$00,$04
52
+	.byte $04,$00,$20,$40,$40,$21,$00,$00
53
+	.byte $00,$00,$04,$00,$00,$00,$00,$12
54
+	.byte $94,$a4,$00,$78,$02,$0f,$98,$12
55
+	.byte $42,$09,$c2,$00,$00,$96,$44,$4a
56
+	.byte $c8,$12,$52,$02,$72,$08,$84,$52
57
+	.byte $84,$a2,$21,$14,$54,$45,$55,$51
58
+	.byte $4a,$29,$21,$25,$14,$12,$91,$08
59
+	.byte $c6,$48,$80,$02,$77,$18,$e6,$67
60
+	.byte $72,$a5,$76,$71,$ce,$39,$36,$94
61
+	.byte $52,$51,$4b,$cc,$00,$24,$00,$c7
62
+	.byte $02,$05,$08,$21,$e2,$0b,$e2,$00
63
+	.byte $01,$1a,$48,$92,$2e,$21,$8e,$94
64
+	.byte $01,$11,$c4,$5c,$84,$bb,$a1,$f4
65
+	.byte $58,$44,$94,$d1,$4a,$29,$11,$25
66
+	.byte $14,$91,$0a,$11,$29,$49,$40,$00
67
+	.byte $94,$a5,$29,$49,$4a,$a9,$49,$4a
68
+	.byte $29,$4a,$44,$94,$52,$4a,$48,$82
69
+	.byte $64,$a8,$00,$c0,$02,$0f,$8c,$42
70
+	.byte $42,$09,$cf,$87,$82,$12,$50,$5e
71
+	.byte $29,$22,$42,$02,$72,$11,$27,$d2
72
+	.byte $84,$a2,$2d,$14,$54,$44,$14,$51
73
+	.byte $72,$2e,$09,$25,$15,$52,$84,$21
74
+	.byte $e9,$4a,$20,$00,$94,$a1,$2f,$49
75
+	.byte $4a,$b1,$49,$4a,$29,$4a,$24,$94
76
+	.byte $52,$44,$49,$0e
77
+	.byte $94,$a4,$00,$c7,$00,$05,$0a,$9a
78
+	.byte $42,$0a,$a2,$00,$04,$12,$50,$42
79
+	.byte $29,$22,$44,$01,$04
80
+	.byte $00
81
+	.byte $e4,$52,$84,$a2,$25,$14,$52,$44
82
+	.byte $14,$51,$42,$2a,$09,$24,$a6,$34
83
+	.byte $44,$41,$29,$48,$00,$00,$94,$a1
84
+	.byte $28,$49,$4a,$a9,$49,$4a,$29,$4a
85
+	.byte $14,$92,$92,$4a,$4a,$12,$94,$a4
86
+	.byte $00,$78,$02,$05,$3c,$19,$c1,$10
87
+	.byte $82,$10,$28,$0c,$5d,$82,$c6,$21
88
+	.byte $88,$90,$00,$10,$44,$5c,$77,$3a
89
+	.byte $1d,$15,$91,$74,$14,$4e,$41,$c9
90
+	.byte $71,$1c,$44,$14,$44,$7d,$26,$30
91
+	.byte $00,$00,$57,$1c,$e7,$47,$4a,$a5
92
+	.byte $49,$49,$ce,$3a,$62,$71,$0d,$91
93
+	.byte $3b,$ce,$63,$28,$00,$38,$00,$00
94
+	.byte $08,$00,$00,$a0,$00,$20,$00,$00
95
+	.byte $00,$00,$00,$00,$00,$20,$00,$01
96
+	.byte $c0,$00,$00,$00,$00,$00,$00,$00
97
+	.byte $00,$00,$00,$40,$00,$00,$00,$00
98
+	.byte $00,$00,$00,$00,$00,$00,$00,$00
99
+	.byte $00,$01,$00,$80,$00,$00,$08,$08
100
+	.byte $00,$00,$00,$00,$08,$00,$00,$20
101
+	.byte $00,$00,$00,$00,$00,$00,$00,$00
102
+	.byte $00,$00,$00,$00,$00,$00,$00,$00
103
+	.byte $00,$00,$00,$00,$00,$00,$00,$00
104
+	.byte $00,$00,$00,$00,$00,$00,$00,$20
105
+	.byte $00,$00,$00,$00,$00,$00,$00,$00
106
+	.byte $1f,$e0,$00,$00,$00,$02,$01,$00
107
+	.byte $00,$00,$08,$08,$00,$00,$00,$00
108
+	.byte $10,$00,$00,$00,$00,$00,$00,$00
109
+	.byte $00,$00,$00,$00,$00,$00,$00
110
+.else
13 111
 	.byte $06, $3c, $00, $09, $08, $00, $cc, $00, $00, $00, $05, $00, $07, $00, $0b, $00
14 112
 	.byte $11, $00, $17, $00, $1d, $00, $23, $00, $25, $00, $29, $00, $2d, $00, $33, $00
15 113
 	.byte $39, $00, $3c, $00, $41, $00, $43, $00, $4a, $00, $4f, $00, $52, $00, $56, $00
@@ -22,7 +120,7 @@ BSWFont:
22 120
 	.byte $4d, $01, $52, $01, $57, $01, $5a, $01, $5f, $01, $64, $01, $66, $01, $68, $01
23 121
 	.byte $6d, $01, $6f, $01, $77, $01, $7c, $01, $82, $01, $87, $01, $8c, $01, $8f, $01
24 122
 	.byte $93, $01, $96, $01, $9b, $01, $a1, $01, $a9, $01, $af, $01, $b4, $01
25
-.if gateway
123
+.ifdef gateway_font
26 124
 	.byte $b9, $01, $bd, $01, $bf, $01, $c3, $01, $c9, $01, $d1, $01, $dc
27 125
 .else
28 126
 	.byte $ba, $01, $be, $01, $c0, $01, $c4, $01, $ca, $01, $d2, $01, $dd
@@ -32,7 +130,7 @@ BSWFont:
32 130
 	.byte $67, $3b, $99, $14, $51, $44, $14, $4e, $71, $ce, $3b, $a5, $14, $14, $51, $7d
33 131
 	.byte $a0, $30, $00, $10, $08, $00, $40, $40, $85, $42, $00, $00, $00, $00, $00, $00
34 132
 	.byte $00, $00, $00
35
-.if gateway
133
+.ifdef gateway_font
36 134
 	.byte $0a, $84, $80, $1c, $00
37 135
 .else
38 136
 	.byte $05, $42, $40, $07, $80
@@ -41,7 +139,7 @@ BSWFont:
41 139
 	.byte $00, $52, $c4, $46, $84, $0a, $52, $01, $04, $45, $12, $92, $94, $a2, $25, $14
42 140
 	.byte $52, $46, $36, $51, $4a, $29, $41, $25, $14, $14, $51, $05, $10, $10, $00, $08
43 141
 	.byte $08, $00, $40, $80, $80, $42, $00, $00, $00, $00, $08, $00, $00, $00, $00
44
-.if gateway
142
+.ifdef gateway_font
45 143
 	.byte $12, $4b, $00, $3c, $00
46 144
 .else
47 145
 	.byte $09, $25, $80, $0f, $80
@@ -50,7 +148,7 @@ BSWFont:
50 148
 	.byte $c8, $12, $52, $02, $72, $09, $74, $52, $84, $a2, $21, $14, $54, $45, $55, $51
51 149
 	.byte $4a, $29, $21, $25, $14, $12, $91, $09, $08, $11, $00, $04, $ee, $31, $cc, $ce
52 150
 	.byte $e5, $4a, $ec, $e3, $9c, $72, $6d, $28, $a4, $a2, $97
53
-.if gateway
151
+.ifdef gateway_font
54 152
 	.byte $92, $40, $00, $77, $00
55 153
 .else
56 154
 	.byte $89, $20, $00, $1c, $70
@@ -59,7 +157,7 @@ BSWFont:
59 157
 	.byte $01, $11, $54, $5c, $84, $bb, $a1, $f4, $58, $44, $94, $d1, $4a, $29, $11, $25
60 158
 	.byte $14, $91, $0a, $11, $04, $12, $80, $01, $29, $4a, $52, $92, $95, $52, $92, $94
61 159
 	.byte $52, $94, $89, $28, $a4, $94, $91
62
-.if gateway
160
+.ifdef gateway_font
63 161
 	.byte $22, $20, $00, $70
64 162
 .else
65 163
 	.byte $11, $10, $00, $1c
@@ -69,7 +167,7 @@ BSWFont:
69 167
 	.byte $84, $a2, $2d, $14, $54, $44, $14, $51, $72, $2e, $09, $25, $15, $52, $84, $21
70 168
 	.byte $02, $14, $40, $01, $29, $42, $5e, $92, $95, $62, $92, $94, $52, $94, $49, $28
71 169
 	.byte $a4, $88, $92
72
-.if gateway
170
+.ifdef gateway_font
73 171
 	.byte $22, $20, $00, $77, $00
74 172
 .else
75 173
 	.byte $11, $10, $00, $1c, $70
@@ -78,7 +176,7 @@ BSWFont:
78 176
 	.byte $04, $12, $50, $42, $29, $22, $44, $01, $04, $01, $04, $52, $84, $a2, $25, $14
79 177
 	.byte $52, $44, $14, $51, $42, $2a, $09, $24, $a6, $34, $44, $41, $01, $10, $00, $01
80 178
 	.byte $29, $42, $50, $92, $95, $52, $92, $94, $52, $94, $29, $25, $24, $94, $94
81
-.if gateway
179
+.ifdef gateway_font
82 180
 	.byte $12, $40, $00, $3c, $00
83 181
 .else
84 182
 	.byte $09, $20, $00, $0f, $80
@@ -87,7 +185,7 @@ BSWFont:
87 185
 	.byte $c6, $21, $88, $90, $00, $10, $e4, $5c, $77, $3a, $1d, $15, $91, $74, $14, $4e
88 186
 	.byte $41, $c9, $71, $1c, $44, $14, $44, $7d, $00, $90, $00, $00, $ae, $39, $ce, $8e
89 187
 	.byte $95, $4a, $92, $93, $9c, $74, $c4, $e2, $1b, $22, $77
90
-.if gateway
188
+.ifdef gateway_font
91 189
 	.byte $92, $40, $00, $1c, $00
92 190
 .else
93 191
 	.byte $89, $20, $00, $07, $80
@@ -96,7 +194,7 @@ BSWFont:
96 194
 	.byte $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $40, $00, $00
97 195
 	.byte $00, $00, $00, $01, $80, $30, $00, $00, $00, $00, $00, $02, $01, $00, $00, $00
98 196
 	.byte $10, $10, $00, $00, $00, $00, $10
99
-.if gateway
197
+.ifdef gateway_font
100 198
 	.byte $0a, $80
101 199
 .else
102 200
 	.byte $05, $40
@@ -106,9 +204,10 @@ BSWFont:
106 204
 	.byte $00, $00, $00, $00, $00, $00, $00, $00, $00, $20, $00, $00, $00, $00, $00, $00
107 205
 	.byte $00, $00, $3f, $c0, $00, $00, $00, $04, $02, $00, $00, $00, $10, $10, $00, $00
108 206
 	.byte $00, $00, $20
109
-.if gateway
207
+.ifdef gateway_font
110 208
 	.byte $02
111 209
 .else
112 210
 	.byte $01
113 211
 .endif
114 212
 	.byte $00, $00, $00, $00
213
+.endif

+ 27
- 4
kernal/conio.s View File

@@ -36,7 +36,7 @@
36 36
 .import stringMargCtrl
37 37
 .import PrvCharWidth
38 38
 
39
-.if (trap)
39
+.ifdef trap
40 40
 ; filesys.s
41 41
 .import SerialHiCompare
42 42
 ; serial.s
@@ -118,12 +118,15 @@ _SmallPutChar:
118 118
 	jmp FontPutChar
119 119
 
120 120
 DoTAB:
121
-	lda #0
121
+.ifndef wheels_size_and_speed ; no-op
122
+	lda #0 ; XXX was this a constant in the source?
122 123
 	add r11L
123 124
 	sta r11L
124 125
 	bcc @1
125 126
 	inc r11H
126
-@1:	rts
127
+@1:
128
+.endif
129
+	rts
127 130
 
128 131
 DoLF:
129 132
 	lda r1H
@@ -230,8 +233,12 @@ DoESC_GRAPHICS:
230 233
 	ldx #r0
231 234
 	jsr Ddec
232 235
 	ldx #r0
236
+.ifdef wheels_size_and_speed ; tail call
237
+	jmp Ddec
238
+.else
233 239
 	jsr Ddec
234 240
 	rts
241
+.endif
235 242
 
236 243
 _i_PutString:
237 244
 	PopB r0L
@@ -285,7 +292,7 @@ _LoadCharSet:
285 292
 	AddW r0, curIndexTable
286 293
 	AddW r0, cardDataPntr
287 294
 
288
-.if (trap)
295
+.ifdef trap
289 296
 	; copy high-byte of serial
290 297
 	lda SerialHiCompare
291 298
 	bne @2
@@ -388,7 +395,12 @@ GSSkeyVector:
388 395
 	beq @5
389 396
 	sta (string),y
390 397
 	PushB dispBufferOn
398
+.ifdef wheels_size_and_speed ; duplicate read of dispBufferOn
399
+	and #$20
400
+        beq @3
401
+.else
391 402
 	bbrf 5, dispBufferOn, @3
403
+.endif
392 404
 	LoadB dispBufferOn, (ST_WR_FORE | ST_WRGS_FORE)
393 405
 @3:	PushB r1H
394 406
 	clc
@@ -406,7 +418,9 @@ GSSkeyVector:
406 418
 	stx stringX
407 419
 	bra @5
408 420
 @4:	jsr GSHelp1
421
+.ifndef wheels_size_and_speed ; no op
409 422
 	bra @5
423
+.endif
410 424
 @5:	jmp _PromptOn
411 425
 @6:	sei
412 426
 	jsr _PromptOff
@@ -532,7 +546,11 @@ CalcDecimal:
532 546
 	bcc @3
533 547
 	sta r0H
534 548
 	iny
549
+.ifdef wheels_size_and_speed ; Y can't be 0
550
+	bne @2
551
+.else
535 552
 	bra @2
553
+.endif
536 554
 @3:	lda r0L
537 555
 	adc DecTabL,x
538 556
 	sta r0L
@@ -580,8 +598,13 @@ DecTabH:
580 598
 ;---------------------------------------------------------------
581 599
 _PutDecimal:
582 600
 	jsr CalcDecimal
601
+.ifdef wheels_size_and_speed ; duplicate load
602
+	lda r2L
603
+	bmi @1
604
+.else
583 605
 	bbsf 7, r2L, @1
584 606
 	lda r2L
607
+.endif
585 608
 	and #$3f
586 609
 	sub r3H
587 610
 	add r11L

+ 499
- 13
kernal/dlgbox.s View File

@@ -10,6 +10,9 @@
10 10
 .include "kernal.inc"
11 11
 .include "jumptab.inc"
12 12
 .include "c64.inc"
13
+.ifdef wheels_dlgbox_features
14
+.include "jumptab_wheels.inc"
15
+.endif
13 16
 
14 17
 ; conio.s
15 18
 .import _UseSystemFont
@@ -26,6 +29,11 @@
26 29
 ; mouse.s
27 30
 .import _StartMouseMode
28 31
 
32
+.ifdef wheels_fixes
33
+; mouse.s
34
+.import DoESC_RULER
35
+.endif
36
+
29 37
 ; var.s
30 38
 .import menuOptNumber
31 39
 .import TimersTab
@@ -56,7 +64,13 @@ _DoDlgBox:
56 64
 	bne @1
57 65
 	jsr DlgBoxPrep
58 66
 	jsr DrawDlgBox
67
+.ifdef wheels_size_and_speed ; duplicate LDA #0
68
+	lda #0
69
+	sta r11H
70
+	sta r11L
71
+.else
59 72
 	LoadW__ r11, 0
73
+.endif
60 74
 	jsr _StartMouseMode
61 75
 	jsr _UseSystemFont
62 76
 	ldx #11
@@ -103,20 +117,50 @@ _DoDlgBox:
103 117
 	jmp MainLoop
104 118
 
105 119
 .define DlgBoxProc1 DBDoIcons, DBDoIcons, DBDoIcons, DBDoIcons, DBDoIcons, DBDoIcons
120
+.ifdef wheels_fixes ; fix: have commands 7-10 (undefined) point to RTS
121
+.define DlgBoxProc2 DoESC_RULER, DoESC_RULER, DoESC_RULER, DoESC_RULER
122
+.else
106 123
 .define DlgBoxProc2 DBDoIcons, DBDoIcons, DBDoIcons, DBDoIcons
124
+.endif
107 125
 .define DlgBoxProc3 DBDoTXTSTR, DBDoVARSTR, DBDoGETSTR, DBDoSYSOPV, DBDoGRPHSTR, DBDoGETFILES, DBDoOPVEC, DBDoUSRICON, DBDoUSR_ROUT
108 126
 
109
-
110 127
 DlgBoxProcL:
111 128
 	.lobytes DlgBoxProc1
112 129
 	.lobytes DlgBoxProc2 ; not used
113 130
 	.lobytes DlgBoxProc3
114 131
 DlgBoxProcH:
115 132
 	.hibytes DlgBoxProc1
133
+.ifdef wheels_fixes ; fix: correct pointers
134
+	.hibytes DlgBoxProc2
135
+.else
116 136
 	.lobytes DlgBoxProc2 ; yes, lobytes!! -- not used
137
+.endif
117 138
 	.hibytes DlgBoxProc3
118 139
 
119 140
 DlgBoxPrep:
141
+.ifdef wheels_size ; Dialog_2 was folded into this
142
+	sec
143
+	jsr DlgBoxPrep2
144
+	LoadB sysDBData, NULL
145
+	jmp InitGEOEnv
146
+
147
+Dialog_2:
148
+	clc
149
+DlgBoxPrep2:
150
+	PushB CPU_DATA
151
+ASSERT_NOT_BELOW_IO
152
+	LoadB CPU_DATA, IO_IN
153
+	LoadW r4, dlgBoxRamBuf
154
+	bcc @1
155
+	jsr DialogSave
156
+	LoadB mobenble, 1
157
+	bne @2
158
+@1:	jsr DialogRestore
159
+@2:	pla
160
+	sta CPU_DATA
161
+ASSERT_NOT_BELOW_IO
162
+	rts
163
+.else
120 164
 ASSERT_NOT_BELOW_IO
121 165
 	PushB CPU_DATA
122 166
 	LoadB CPU_DATA, IO_IN
@@ -128,6 +172,7 @@ ASSERT_NOT_BELOW_IO
128 172
 	jsr InitGEOEnv
129 173
 	LoadB sysDBData, NULL
130 174
 	rts
175
+.endif
131 176
 
132 177
 DrawDlgBox:
133 178
 	LoadB dispBufferOn, ST_WR_FORE | ST_WRGS_FORE
@@ -198,14 +243,18 @@ DrwDlgSpd1:
198 243
 	jsr CalcDialogCoords
199 244
 	MoveW r4, rightMargin
200 245
 	jsr Rectangle
246
+.ifndef wheels_size_and_speed ; redundant
201 247
 	clc
202 248
 	jsr CalcDialogCoords
249
+.endif
203 250
 	lda #$ff
204 251
 	jsr FrameRectangle
205 252
 	lda #0
206 253
 	sta defIconTab
254
+.ifndef wheels_size_and_speed ; single 0 = no icons
207 255
 	sta defIconTab+1
208 256
 	sta defIconTab+2
257
+.endif
209 258
 	rts
210 259
 
211 260
 Dialog_1:
@@ -278,6 +327,7 @@ _RstrFrmDialogue:
278 327
 	PushW dlgBoxCallerPC
279 328
 	rts
280 329
 
330
+.ifndef wheels_size ; folded into DlgBoxPrep
281 331
 Dialog_2:
282 332
 ASSERT_NOT_BELOW_IO
283 333
 	PushB CPU_DATA
@@ -287,6 +337,7 @@ ASSERT_NOT_BELOW_IO
287 337
 	PopB CPU_DATA
288 338
 ASSERT_NOT_BELOW_IO
289 339
 	rts
340
+.endif
290 341
 
291 342
 DialogSave:
292 343
 	ldx #0
@@ -324,6 +375,15 @@ DialogNextSaveRestoreEntry:
324 375
 	bcc @1
325 376
 	inc r4H
326 377
 @1:	ldy #0
378
+.ifdef wheels_size_and_speed ; 17 vs. 21 bytes and faster
379
+	lda DialogCopyTab3,x
380
+	beq @2
381
+	sta r3L
382
+	lda DialogCopyTab1,x
383
+	sta r2L
384
+	lda DialogCopyTab2,x
385
+	sta r2H
386
+.else
327 387
 	lda DialogCopyTab,x
328 388
 	sta r2L
329 389
 	inx
@@ -334,10 +394,32 @@ DialogNextSaveRestoreEntry:
334 394
 	beq @2
335 395
 	lda DialogCopyTab,x
336 396
 	sta r3L
397
+.endif
337 398
 	inx
338 399
 @2:	rts
339 400
 
340 401
 ; pointer & length tuples of memory regions to save and restore
402
+.ifdef wheels_size_and_speed
403
+.define DialogCopyTab curPattern, appMain, IconDescVec, menuOptNumber, TimersTab, obj0Pointer, mob0xpos, mobenble, mobprior, mcmclr0, mob1clr, moby2
404
+DialogCopyTab1:
405
+	.lobytes DialogCopyTab
406
+DialogCopyTab2:
407
+	.hibytes DialogCopyTab
408
+DialogCopyTab3:
409
+	.byte 23
410
+	.byte 38
411
+	.byte 2
412
+	.byte 49
413
+	.byte 227
414
+	.byte 8
415
+	.byte 17
416
+	.byte 1
417
+	.byte 3
418
+	.byte 2
419
+	.byte 7
420
+	.byte 1
421
+	.byte NULL
422
+.else
341 423
 DialogCopyTab:
342 424
 	.word curPattern
343 425
 	.byte 23
@@ -364,18 +446,28 @@ DialogCopyTab:
364 446
 	.word moby2
365 447
 	.byte 1
366 448
 	.word NULL
449
+.endif
367 450
 
451
+; handler for commands 1-6
368 452
 DBDoIcons:
369
-	dey
370
-	bne @1
453
+.ifdef wheels_button_shortcuts ; install keyVector for all button types
454
+	lda keyVector+1
455
+.else
456
+	dey ; command-1: "OK"==0
457
+	bne @1 ; not "OK"
371 458
 	lda keyVector
372 459
 	ora keyVector+1
460
+.endif
373 461
 	bne @1
374 462
 	lda #>DBKeyVector
375 463
 	sta keyVector+1
376 464
 	lda #<DBKeyVector
377 465
 	sta keyVector
378
-@1:	tya
466
+@1:
467
+.ifdef wheels_button_shortcuts
468
+	dey
469
+.endif
470
+	tya
379 471
 	asl
380 472
 	asl
381 473
 	asl
@@ -451,6 +543,7 @@ DBDefIconsTab:
451 543
 	.word DBIcPicOK
452 544
 	.word 0
453 545
 	.byte 6, 16
546
+DBDefIconsTabRoutine:
454 547
 	.word DBIcOK
455 548
 
456 549
 	.word DBIcPicCANCEL
@@ -479,9 +572,90 @@ DBDefIconsTab:
479 572
 	.word DBIcDISK
480 573
 
481 574
 DBKeyVector:
575
+.ifdef wheels_button_shortcuts
576
+	lda keyData
577
+	ldy #ShortcutKeysEnd - ShortcutKeys - 1
578
+@1:	cmp ShortcutKeys,y
579
+	beq DoKeyboardShortcut
580
+	dey
581
+	bpl @1
582
+	rts
583
+
584
+DoKeyboardShortcut:
585
+	tya
586
+	asl
587
+	asl
588
+	asl
589
+	tay
590
+	lda #0
591
+	sta r0L
592
+LF4AC:	tax
593
+	lda defIconTab+4,x
594
+	cmp DBDefIconsTab,y
595
+	bne LF4BD
596
+	lda defIconTab+4+1,x
597
+	cmp DBDefIconsTab+1,y
598
+	beq LF4CC
599
+LF4BD:	inc r0L
600
+	lda r0L
601
+	cmp defIconTab
602
+	bcs LF4CB
603
+	asl
604
+	asl
605
+	asl
606
+	bne LF4AC
607
+LF4CB:	rts
608
+LF4CC:	lda DBDefIconsTabRoutine,y
609
+	ldx DBDefIconsTabRoutine+1,y
610
+	jmp CallRoutine
611
+
612
+ShortcutKeys:
613
+	.byte 13, "cynod"; ok, cancel, yes, no, open, disk
614
+ShortcutKeysEnd:
615
+.else
482 616
 	CmpBI keyData, CR
483 617
 	beq DBIcOK
484 618
 	rts
619
+.endif
620
+
621
+.ifdef wheels_size
622
+DBIcDISK:
623
+.ifdef wheels_dialog_chdir ; "Disk" button can change directory
624
+; Maurice says: If your application includes a dialogue box
625
+; with the "DISK" icon, that's all you really need to let the
626
+; user select any partition or subdirectory on a CMD device or
627
+; a subdirectory on a native ramdisk.
628
+; ATTN: *requires* wheels_size!!!
629
+.import GetNewKernal
630
+.import RstrKernal
631
+	lda #$40 + 5
632
+	jsr GetNewKernal
633
+	jsr ChDiskDirectory
634
+	jsr RstrKernal
635
+.endif
636
+	lda #DISK
637
+	.byte $2c
638
+DBIcOK:
639
+	lda #OK
640
+	.byte $2c
641
+DBIcCANCEL:
642
+	lda #CANCEL
643
+	.byte $2c
644
+DBIcYES:
645
+	lda #YES
646
+	.byte $2c
647
+DBIcNO:
648
+	lda #NO
649
+	.byte $2c
650
+DBIcOPEN:
651
+	lda #OPEN
652
+	.byte $2c
653
+DBStringFaultVec2:
654
+	lda #DBSYSOPV
655
+	.byte $2c
656
+DBKeyVector2:
657
+	lda #DBGETSTRING
658
+.else
485 659
 DBIcOK:
486 660
 	lda #OK
487 661
 	bne DBKeyVec1
@@ -499,8 +673,9 @@ DBIcOPEN:
499 673
 	bne DBKeyVec1
500 674
 DBIcDISK:
501 675
 	lda #DISK
502
-	bne DBKeyVec1
676
+	bne DBKeyVec1 ; ???
503 677
 DBKeyVec1:
678
+.endif
504 679
 	sta sysDBData
505 680
 	jmp RstrFrmDialogue
506 681
 
@@ -513,9 +688,13 @@ DBDoSYSOPV:
513 688
 
514 689
 DBStringFaultVec:
515 690
 	bbsf 7, mouseData, DBDoOPVEC_rts
691
+.ifdef wheels_size ; reuse common code
692
+	jmp DBStringFaultVec2
693
+.else
516 694
 	lda #DBSYSOPV
517 695
 	sta sysDBData
518 696
 	jmp RstrFrmDialogue
697
+.endif
519 698
 
520 699
 DBDoOPVEC:
521 700
 	ldy r1L
@@ -532,6 +711,9 @@ DBDoOPVEC_rts:
532 711
 
533 712
 DBDoGRPHSTR:
534 713
 	ldy r1L
714
+.ifdef wheels_size
715
+	jsr StringGetNext
716
+.else
535 717
 	lda (DBoxDesc),y
536 718
 	sta r0L
537 719
 	iny
@@ -539,6 +721,7 @@ DBDoGRPHSTR:
539 721
 	sta r0H
540 722
 	iny
541 723
 	tya
724
+.endif
542 725
 	pha
543 726
 	jsr GraphicsString
544 727
 	PopB r1L
@@ -546,6 +729,17 @@ DBDoGRPHSTR:
546 729
 
547 730
 DBDoUSR_ROUT:
548 731
 	ldy r1L
732
+.ifdef wheels_size_and_speed ; 13->11 bytes, 25->23 cycles
733
+	iny
734
+	iny
735
+	tya
736
+	pha
737
+	dey
738
+	lda (DBoxDesc),y
739
+	tax
740
+	dey
741
+	lda (DBoxDesc),y
742
+.else
549 743
 	lda (DBoxDesc),y
550 744
 	sta r0L
551 745
 	iny
@@ -555,6 +749,7 @@ DBDoUSR_ROUT:
555 749
 	tya
556 750
 	pha
557 751
 	lda r0L
752
+.endif
558 753
 	jsr CallRoutine
559 754
 	PopB r1L
560 755
 	rts
@@ -563,6 +758,9 @@ DBDoTXTSTR:
563 758
 	clc
564 759
 	jsr CalcDialogCoords
565 760
 	jsr DBTextCoords
761
+.ifdef wheels_size
762
+	jsr StringGetNext
763
+.else
566 764
 	lda (DBoxDesc),y
567 765
 	sta r0L
568 766
 	iny
@@ -570,11 +768,24 @@ DBDoTXTSTR:
570 768
 	sta r0H
571 769
 	iny
572 770
 	tya
771
+.endif
573 772
 	pha
574 773
 	jsr PutString
575 774
 	PopB r1L
576 775
 	rts
577 776
 
777
+.ifdef wheels_size
778
+StringGetNext:
779
+	lda (DBoxDesc),y
780
+	sta r0L
781
+	iny
782
+	lda (DBoxDesc),y
783
+	sta r0H
784
+	iny
785
+	tya
786
+	rts
787
+.endif
788
+
578 789
 DBDoVARSTR:
579 790
 	clc
580 791
 	jsr CalcDialogCoords
@@ -617,9 +828,11 @@ DBDoGETSTR:
617 828
 	PopB r1L
618 829
 	rts
619 830
 
831
+.ifndef wheels_size ; code reuse
620 832
 DBKeyVector2:
621 833
 	LoadB sysDBData, DBGETSTRING
622 834
 	jmp RstrFrmDialogue
835
+.endif
623 836
 
624 837
 DBTextCoords:
625 838
 	ldy r1L
@@ -654,10 +867,18 @@ DBDoGETFILES:
654 867
 	ror
655 868
 	lsr
656 869
 	lsr
870
+.ifdef wheels_dlgbox_features ; ???
871
+	addv 4
872
+.else
657 873
 	addv 7
874
+.endif
658 875
 	pha
659 876
 	lda r2H
877
+.ifdef wheels_dlgbox_features ; ???
878
+	subv 12
879
+.else
660 880
 	subv 14
881
+.endif
661 882
 	pha
662 883
 	PushB r7L
663 884
 	PushW r10
@@ -671,6 +892,38 @@ DBDoGETFILES:
671 892
 	jsr HorizontalLine
672 893
 	PopW r10
673 894
 	PopB r7L
895
+.ifdef wheels_dlgbox_features ; ???
896
+.import extKrnlIn
897
+.import TmpFilename
898
+	lda extKrnlIn
899
+	cmp #5
900
+	beq @B
901
+	PushB r10L ; r10: source string
902
+	sta r5L
903
+	PushB r10H
904
+	sta r5H
905
+	ora r5L
906
+	beq @A ; null ptr
907
+	LoadW r10, TmpFilename
908
+	ldx #r5
909
+	ldy #r10
910
+	jsr CopyString
911
+@A:	lda #$40 + 5
912
+	jsr GetNewKernal
913
+	jsr GetFEntries
914
+	jsr RstrKernal
915
+	PopW r10
916
+	bra @C
917
+@B:	jsr GetFEntries
918
+@C:	PopB r2L
919
+	PopB r3L
920
+	sta DBGFArrowX
921
+	lda #0
922
+	sta DBGFileSelected
923
+	sta DBGFTableIndex
924
+	lda DBGFilesFound
925
+	beq @2
926
+.else
674 927
 	LoadB r7H, 15
675 928
 	LoadW r6, fileTrScTab
676 929
 	jsr FindFTypes
@@ -681,23 +934,27 @@ DBDoGETFILES:
681 934
 	sub r7H
682 935
 	beq @2
683 936
 	sta DBGFilesFound
937
+.endif
684 938
 	cmp #6
685 939
 	bcc @1
686
-	lda #>DBGFilesArrowsIcons
687
-	sta r5H
688
-	lda #<DBGFilesArrowsIcons
689
-	sta r5L
940
+	LoadW r5, DBGFilesArrowsIcons
690 941
 	jsr DBIconsHelp2
691
-@1:	lda #>DBGFPressVector
692
-	sta otherPressVec+1
693
-	lda #<DBGFPressVector
694
-	sta otherPressVec
942
+@1:
943
+.ifdef wheels_dlgbox_features ; ???
944
+	lda #0
945
+	jsr SetupRAMOpCall
946
+	jsr FetchRAM
947
+.endif
948
+	LoadW otherPressVec, DBGFPressVector
949
+.ifndef wheels_dlgbox_features ; ???
695 950
 	jsr DBGFilesHelp1
951
+.endif
696 952
 	jsr DBGFilesHelp5
697 953
 	jsr DBGFilesHelp2
698 954
 @2:	PopB r1L
699 955
 	rts
700 956
 
957
+.ifndef wheels_dlgbox_features ; xxx
701 958
 DBGFilesHelp1:
702 959
 	PushB DBGFilesFound
703 960
 @1:	pla
@@ -719,15 +976,39 @@ DBGFilesHelp1:
719 976
 	lda #0
720 977
 @4:	sta DBGFTableIndex
721 978
 @5:	rts
979
+.endif
722 980
 
723 981
 DBGFilesArrowsIcons:
724 982
 	.word DBGFArrowPic
725 983
 DBGFArrowX:
726 984
 	.word 0
985
+.ifdef wheels_dlgbox_features
986
+	.byte 8, 8
987
+.else
727 988
 	.byte 3, 12
989
+.endif
728 990
 	.word DBGFDoArrow
729 991
 
730 992
 DBGFArrowPic:
993
+.ifdef wheels_dlgbox_features
994
+	.byte 10, %11111111 ; repeat 10
995
+	.byte $80+2 ; 2 data bytes
996
+	.byte                     %10000000, %00000001
997
+	.byte 4, %10000001 ; repeat 4
998
+	.byte $80 + 36
999
+	;     %11111111,%11111111,%11111111,%11111111,%11111111,%11111111,%11111111,%11111111
1000
+	;     %11111111,%11111111,%10000000,%00000001,%10000001,%10000001,%10000001,%10000001
1001
+	.byte %11111111,%11111111,%10000000,%00000001,%10000011,%11000001,%10000001,%10000001
1002
+	.byte %10000000,%00000001,%10000000,%00000001,%10000111,%11100001,%10001111,%11110001
1003
+	.byte %10000000,%00000001,%10000000,%00000001,%10001111,%11110001,%10000111,%11100001
1004
+	.byte %10000000,%00000001,%11111111,%11111111,%10000001,%10000001,%10000011,%11000001
1005
+	.byte %10000000,%00000001,%11111111,%11111111;%10000001,%10000001,%10000001,%10000001
1006
+	;     %11111111,%11111111,%11111111,%11111111,%11111111,%11111111,%11111111,%11111111
1007
+	.byte 4, %10000001 ; repeat 4
1008
+	.byte 8, %11111111 ; repeat 8
1009
+
1010
+	.byte 8, $bf ; ??? unused
1011
+.else
731 1012
 	.byte 3, %11111111, $80+(10*3)
732 1013
 	     ;%11111111, %11111111, %11111111
733 1014
 	.byte %10000000, %00000000, %00000001 ;1
@@ -742,6 +1023,7 @@ DBGFArrowPic:
742 1023
 	.byte %10000000, %00000000, %00000001 ;10
743 1024
 	     ;%11111111, %11111111, %11111111
744 1025
 	.byte 3, %11111111
1026
+.endif
745 1027
 
746 1028
 DBGFPressVector:
747 1029
 	lda mouseData
@@ -774,9 +1056,116 @@ DBGFPressVector:
774 1056
 @1:	sta DBGFileSelected
775 1057
 	jsr DBGFilesHelp6
776 1058
 	jsr DBGFilesHelp2
1059
+.ifdef wheels_dlgbox_dblclick
1060
+	lda dblClickCount
1061
+	beq @X
1062
+	ldy dblDBData
1063
+	dey
1064
+	jmp DoKeyboardShortcut
1065
+@X:	lda #CLICK_COUNT
1066
+	sta dblClickCount
1067
+.endif
777 1068
 @2:	rts
778 1069
 
779 1070
 DBGFDoArrow:
1071
+.ifdef wheels_dlgbox_features
1072
+.import dbFieldWidth
1073
+	; which icon inside the top/bot/up/down image was the mouse on?
1074
+	lda mouseXPos+1
1075
+	lsr
1076
+	lda mouseXPos
1077
+	ror
1078
+	lsr
1079
+	lsr ; / 16
1080
+	sec
1081
+	sbc DBGFArrowX
1082
+	lsr
1083
+	tay
1084
+	cpy #4
1085
+	bcc @1
1086
+	rts
1087
+@1:	lda DoArrowTabL,y
1088
+	ldx DoArrowTabH,y
1089
+	jmp CallRoutine
1090
+
1091
+.define DoArrowTab DBGFDoArrowTop, DBGFDoArrowBottom, DBGFDoArrowUp, DBGFDoArrowDown
1092
+
1093
+DoArrowTabL:
1094
+	.lobytes DoArrowTab
1095
+DoArrowTabH:
1096
+	.hibytes DoArrowTab
1097
+
1098
+DBGFDoArrowTop:
1099
+	lda DBGFTableIndex
1100
+	bne @1
1101
+	rts
1102
+@1:	lda #0
1103
+	beq DBGFDoArrowFuncCommon
1104
+
1105
+DBGFDoArrowBottom:
1106
+	ldx DBGFilesFound
1107
+	dex
1108
+	stx r0L
1109
+	lda #0
1110
+	sta r0H
1111
+	sta r1H
1112
+	lda #5
1113
+	sta r1L
1114
+	ldx #r0
1115
+	ldy #r1
1116
+	jsr Ddiv
1117
+	jsr BBMult
1118
+	lda r0L
1119
+	bra DBGFDoArrowFuncCommon
1120
+
1121
+DBGFDoArrowDown:
1122
+	lda DBGFTableIndex
1123
+	clc
1124
+	adc #5
1125
+	cmp DBGFilesFound
1126
+	bcc DBGFDoArrowFuncCommon
1127
+	rts
1128
+
1129
+DBGFDoArrowUp:
1130
+	lda DBGFTableIndex
1131
+	bne @1
1132
+	rts
1133
+@1:	sec
1134
+	sbc #5
1135
+DBGFDoArrowFuncCommon:
1136
+	sta DBGFTableIndex+1
1137
+	sta DBGFTableIndex
1138
+	jsr SetupRAMOpCall
1139
+	jsr FetchRAM
1140
+	jsr DBGFilesHelp2
1141
+	jmp DBGFilesHelp5
1142
+
1143
+SetupRAMOpCall:
1144
+	sta r1L
1145
+	lda #5
1146
+	sta r0L
1147
+	lda dbFieldWidth
1148
+	sta r2L
1149
+	ldx #r2
1150
+	ldy #r0L
1151
+	jsr BBMult ; r2 = 5 * dbFieldWidth (count)
1152
+	lda dbFieldWidth
1153
+	sta r0L
1154
+	ldx #r1
1155
+	ldy #r0L
1156
+	jsr BBMult ; r1 = arg * dbFieldWidth (REU offset)
1157
+	clc
1158
+	lda r1L
1159
+	adc #<$E080
1160
+	sta r1L
1161
+	lda r1H
1162
+	adc #>$E080 ; REU address
1163
+	sta r1H
1164
+	LoadW r0, fileTrScTab ; CBM address
1165
+	sta r3L ; REU bank 0
1166
+	rts
1167
+.else
1168
+; DBGFDoArrow:
780 1169
 	jsr DBGFilesHelp6
781 1170
 	LoadB r0H, 0
782 1171
 	lda DBGFArrowX
@@ -808,8 +1197,19 @@ DBGFDoArrow:
808 1197
 	sta DBGFileSelected
809 1198
 @6:	jsr DBGFilesHelp2
810 1199
 	jmp DBGFilesHelp5
1200
+.endif
811 1201
 
812 1202
 DBGFilesHelp2:
1203
+.ifdef wheels_dlgbox_features
1204
+	lda DBGFTableIndex+1
1205
+	sec
1206
+	sbc DBGFTableIndex
1207
+	ldx #r0
1208
+	jsr DBGFilesHelp4
1209
+	MoveW DBGFNameTable, r5
1210
+	ldy #r5
1211
+	jmp CopyString
1212
+.else
813 1213
 	lda DBGFileSelected
814 1214
 	jsr DBGFilesHelp3
815 1215
 	ldy #r1
@@ -820,10 +1220,15 @@ DBGFilesHelp3:
820 1220
 	jsr DBGFilesHelp4
821 1221
 	MoveW DBGFNameTable, r1
822 1222
 	rts
1223
+.endif
823 1224
 
824 1225
 DBGFilesHelp4:
825 1226
 	sta r0L
1227
+.ifdef wheels_dlgbox_features
1228
+	MoveB dbFieldWidth, r1L
1229
+.else
826 1230
 	LoadB r1L, 17
1231
+.endif
827 1232
 	txa
828 1233
 	pha
829 1234
 	ldy #r0
@@ -832,27 +1237,87 @@ DBGFilesHelp4:
832 1237
 	pla
833 1238
 	tax
834 1239
 	lda r1L
1240
+.ifdef wheels_size_and_speed
1241
+	sta zpage,x
1242
+	.assert <fileTrScTab = 0, error, "fileTrScTab must be page-aligned!"
1243
+	lda #>fileTrScTab
1244
+.else
835 1245
 	clc
836 1246
 	adc #<fileTrScTab
837 1247
 	sta zpage,x
838 1248
 	lda #>fileTrScTab
839 1249
 	adc #0
1250
+.endif
840 1251
 	sta zpage+1,x
841 1252
 	rts
842 1253
 
843 1254
 DBGFilesHelp5:
1255
+.ifdef wheels_dlgbox_features
1256
+	PushW rightMargin
1257
+	PushB currentMode
1258
+	LoadB currentMode, $40
1259
+	lda #0
1260
+	jsr DBGFilesHelp8
1261
+	clc
1262
+	lda r2H
1263
+	adc #$38
1264
+	sta r2H
1265
+	lda #0
1266
+	jsr SetPattern
1267
+	jsr Rectangle
1268
+	lda #0
1269
+	lda r4H
1270
+	sta rightMargin+1
1271
+	lda r4L
1272
+	sta rightMargin
1273
+	lda #0
1274
+	sta r15L
1275
+	ldx #30
1276
+	jsr DBGFilesHelp4
1277
+LF843:	lda r15L
1278
+	jsr DBGFilesHelp8
1279
+	lda r3H
1280
+	sta r11H
1281
+	lda r3L
1282
+	sta r11L
1283
+	lda r2L
1284
+	clc
1285
+	adc #9
1286
+	sta r1H
1287
+	lda r14H
1288
+	sta r0H
1289
+	lda r14L
1290
+	sta r0L
1291
+	jsr PutString
1292
+	clc
1293
+	lda dbFieldWidth
1294
+	adc r14L
1295
+	sta r14L
1296
+	bcc LF86E
1297
+	inc r14H
1298
+LF86E:	inc r15L
1299
+	lda r15L
1300
+	cmp #5
1301
+	bne LF843
1302
+	jsr DBGFilesHelp6
1303
+	PopB currentMode
1304
+	PopW rightMargin
1305
+	rts
1306
+.else
844 1307
 	PushW rightMargin
845 1308
 	lda #0
846 1309
 	jsr DBGFilesHelp8
847 1310
 	MoveW r4, rightMargin
848 1311
 	LoadB r15L, 0
849 1312
 	jsr SetPattern
1313
+
850 1314
 	lda DBGFTableIndex
851 1315
 	ldx #r14
852 1316
 	jsr DBGFilesHelp4
853 1317
 	LoadB currentMode, SET_BOLD
854 1318
 @1:	lda r15L
855 1319
 	jsr DBGFilesHelp8
1320
+
856 1321
 	jsr Rectangle
857 1322
 	MoveW r3, r11
858 1323
 	lda r2L
@@ -868,6 +1333,7 @@ DBGFilesHelp5:
868 1333
 	LoadB currentMode, NULL
869 1334
 	PopW rightMargin
870 1335
 	rts
1336
+.endif
871 1337
 
872 1338
 DBGFilesHelp6:
873 1339
 	lda DBGFileSelected
@@ -900,16 +1366,36 @@ DBGFilesHelp8:
900 1366
 	jsr DBGFilesHelp7
901 1367
 	AddB r0L, r2L
902 1368
 	clc
1369
+.ifdef wheels_dlgbox_features
1370
+	adc #13
1371
+.else
903 1372
 	adc #14
1373
+.endif
904 1374
 	sta r2H
905 1375
 	inc r2L
1376
+.ifdef wheels_size ; code reuse
1377
+	jsr IncR3
1378
+.else
906 1379
 	dec r2H
907 1380
 	inc r3L
908 1381
 	bne @1
909 1382
 	inc r3H
1383
+.endif
910 1384
 @1:	ldx #r4
1385
+.ifdef wheels_size_and_speed
1386
+	jmp Ddec
1387
+.else
911 1388
 	jsr Ddec
912 1389
 	rts
1390
+.endif
1391
+
1392
+.ifdef wheels_size ; code reuse
1393
+.global IncR3
1394
+IncR3:	inc r3L
1395
+	bne @1
1396
+	inc r3H
1397
+@1:	rts
1398
+.endif
913 1399
 
914 1400
 DBIcPicNO:
915 1401
 	.byte 5, %11111111, $80+1, %11111110, $db+8, 2, $80+6

+ 847
- 22
kernal/filesys.s
File diff suppressed because it is too large
View File


+ 53
- 2
kernal/fonts.s View File

@@ -62,6 +62,7 @@ ID110:
62 62
 ;            a   baseline offset
63 63
 ; Destroyed: nothing
64 64
 ;---------------------------------------------------------------
65
+.ifndef wheels ; moved
65 66
 _GetRealSize:
66 67
 	subv 32
67 68
 	jsr GetChWdth1
@@ -84,6 +85,12 @@ _GetRealSize:
84 85
 	rts
85 86
 @2:	lda baselineOffset
86 87
 	rts
88
+.endif
89
+
90
+.ifdef wheels
91
+FontTVar1 = $8886
92
+FontTVar2 = $8887
93
+.endif
87 94
 
88 95
 Font_1:
89 96
 	ldy r1H
@@ -369,6 +376,36 @@ Font_tab2:
369 376
 	.byte <(e6-base)
370 377
 	.byte <(e7-base)
371 378
 
379
+.ifdef wheels
380
+	.res 9, 0 ; XXX
381
+.endif
382
+
383
+.ifdef wheels ; xxx moved, but unchanged
384
+_GetRealSize:
385
+	subv 32
386
+	jsr GetChWdth1
387
+	tay
388
+	txa
389
+	ldx curHeight
390
+	pha
391
+	and #$40
392
+	beq @1
393
+	iny
394
+@1:	pla
395
+	and #8
396
+	beq @2
397
+	inx
398
+	inx
399
+	iny
400
+	iny
401
+	lda baselineOffset
402
+	addv 2
403
+	rts
404
+@2:	lda baselineOffset
405
+	rts
406
+
407
+.endif
408
+
372 409
 ; called if currentMode & (SET_UNDERLINE | SET_ITALIC)
373 410
 Font_3:
374 411
 	lda currentMode
@@ -382,7 +419,15 @@ Font_3:
382 419
 @1:	lda r10L
383 420
 	eor #$ff
384 421
 	sta r10L
385
-@2:	bbrf ITALIC_BIT, currentMode, clc_rts
422
+@2:
423
+.ifdef wheels
424
+	bbsf ITALIC_BIT, currentMode, @X
425
+	clc
426
+	rts
427
+@X:
428
+.else
429
+	bbrf ITALIC_BIT, currentMode, clc_rts
430
+.endif
386 431
 	lda r10H
387 432
 	lsr
388 433
 	bcs @5
@@ -568,7 +613,9 @@ Font_9:
568 613
 ; central character printing, called from conio.s
569 614
 ; character - 32 in A
570 615
 FontPutChar:
616
+.ifndef wheels_size_and_speed
571 617
 	nop
618
+.endif
572 619
 	tay
573 620
 	PushB r1H
574 621
 	tya
@@ -795,10 +842,14 @@ FontGt4_2:
795 842
 	sta Z45+2,y
796 843
 	beq FontGt2_1
797 844
 
845
+.ifndef wheels
798 846
 FontTVar1:
847
+.endif
799 848
 	.byte 0
849
+.ifndef wheels
800 850
 FontTVar2:
801
-.if cbmfiles
851
+.endif
852
+.ifdef cbmfiles
802 853
 	; This should be initialized to 0, and will
803 854
 	; be changed at runtime.
804 855
 	; The cbmfiles version was created by dumping

+ 253
- 13
kernal/graph.s View File

@@ -59,6 +59,7 @@ GraphPenXH = GraphPenX+1
59 59
 
60 60
 .segment "graph1"
61 61
 
62
+.ifndef wheels
62 63
 ;---------------------------------------------------------------
63 64
 ; used by EnterDesktop
64 65
 ;---------------------------------------------------------------
@@ -83,6 +84,7 @@ ClrScr2:
83 84
 	dex
84 85
 	bne ClrScr1
85 86
 	rts
87
+.endif
86 88
 
87 89
 .segment "graph2"
88 90
 
@@ -107,6 +109,82 @@ PrepareXCoord:
107 109
 	sta r4L
108 110
 	rts
109 111
 
112
+.ifdef wheels_size
113
+.import WheelsTemp
114
+_HorizontalLine:
115
+	sta r7L
116
+	lda #0
117
+	.byte $2c
118
+_InvertLine:
119
+	lda #$80
120
+	sta WheelsTemp
121
+	PushW r3
122
+	PushW r4
123
+	jsr PrepareXCoord
124
+	ldy r3L
125
+	lda r3H
126
+	beq @1
127
+	inc r5H
128
+	inc r6H
129
+@1:	lda r3H
130
+	cmp r4H
131
+	bne @2
132
+	lda r3L
133
+	cmp r4L
134
+@2:	beq @7
135
+	jsr LineHelp2
136
+	lda r8L
137
+	bit WheelsTemp
138
+	bmi @3
139
+	jsr LineCommon
140
+	bra @4
141
+@3:	eor (r5),y
142
+@4:	bit WheelsTemp
143
+	bpl @5
144
+	eor #$FF
145
+@5:	sta (r6),y
146
+	sta (r5),y
147
+	tya
148
+	clc
149
+	adc #8
150
+	tay
151
+	bcc @6
152
+	inc r5H
153
+	inc r6H
154
+@6:	dec r4L
155
+	beq @8
156
+	lda r7L
157
+	bit WheelsTemp
158
+	bpl @4
159
+	lda (r5),y
160
+	bra @4
161
+@7:	lda r8L
162
+	ora r8H
163
+	bra @9
164
+@8:	lda r8H
165
+@9:	bit WheelsTemp
166
+	bmi @A
167
+	jsr LineCommon
168
+	jmp @B
169
+@A:	eor #$FF
170
+	eor (r5),y
171
+@B:	sta (r6),y
172
+	sta (r5),y
173
+LineEnd:
174
+	PopW r4
175
+	PopW r3
176
+	rts
177
+
178
+LineCommon:
179
+	sta r11H
180
+	and (r6),y
181
+	sta r7H
182
+	lda r11H
183
+	eor #$FF
184
+	and r7L
185
+	ora r7H
186
+	rts
187
+.else
110 188
 ;---------------------------------------------------------------
111 189
 ; HorizontalLine                                          $C118
112 190
 ;
@@ -170,6 +248,7 @@ HLineHelp:
170 248
 	and r7L
171 249
 	ora r7H
172 250
 	rts
251
+
173 252
 ;---------------------------------------------------------------
174 253
 ; InvertLine                                              $C11B
175 254
 ;
@@ -235,6 +314,7 @@ ImprintLine:
235 314
 	sta r6H
236 315
 	sty r5H
237 316
 	bra RLin0
317
+.endif
238 318
 
239 319
 ;---------------------------------------------------------------
240 320
 ; RecoverLine                                             $C11E
@@ -247,6 +327,79 @@ ImprintLine:
247 327
 ; Destroyed: a, x, y, r5 - r8
248 328
 ;---------------------------------------------------------------
249 329
 _RecoverLine:
330
+.ifdef wheels_size
331
+	lda #$18 ; clc
332
+	.byte $2c
333
+ImprintLine:
334
+	lda #$38 ; sec
335
+	sta @1
336
+	PushW r3
337
+	PushW r4
338
+	lda dispBufferOn
339
+	pha
340
+	ora #ST_WR_FORE | ST_WR_BACK
341
+	sta dispBufferOn
342
+	jsr PrepareXCoord
343
+	pla
344
+	sta dispBufferOn
345
+@1:	clc
346
+	bcc @2
347
+	lda r5L
348
+	ldy r6L
349
+	sta r6L
350
+	sty r5L
351
+	lda r5H
352
+	ldy r6H
353
+	sta r6H
354
+	sty r5H
355
+@2:	ldy r3L
356
+	lda r3H
357
+	beq @3
358
+	inc r5H
359
+	inc r6H
360
+@3:	CmpW r3, r4
361
+	beq @6
362
+	jsr LineHelp2
363
+	lda r8L
364
+	jsr LineHelp1
365
+@4:	tya
366
+	clc
367
+	adc #8
368
+	tay
369
+	bcc @5
370
+	inc r5H
371
+	inc r6H
372
+@5:	dec r4L
373
+	beq @7
374
+	lda (r6),y
375
+	sta (r5),y
376
+	bra @4
377
+@6:	lda r8L
378
+	ora r8H
379
+	bra @8
380
+@7:	lda r8H
381
+@8:	jsr LineHelp1
382
+	jmp LineEnd
383
+
384
+LineHelp1:
385
+	sta r7L
386
+	and (r5),y
387
+	sta r7H
388
+	lda r7L
389
+	eor #$FF
390
+	and (r6),y
391
+	ora r7H
392
+	sta (r5),y
393
+	rts
394
+
395
+LineHelp2:
396
+	SubW r3, r4
397
+	lsr r4H
398
+	ror r4L
399
+	lsr r4L
400
+	lsr r4L
401
+	rts
402
+.else
250 403
 	PushW r3
251 404
 	PushW r4
252 405
 	PushB dispBufferOn
@@ -254,7 +407,6 @@ _RecoverLine:
254 407
 	sta dispBufferOn
255 408
 	jsr PrepareXCoord
256 409
 	PopB dispBufferOn
257
-
258 410
 RLin0:
259 411
 	ldy r3L
260 412
 	lda r3H
@@ -298,6 +450,7 @@ RecLineHelp:
298 450
 	ora r7H
299 451
 	sta (r5),Y
300 452
 	rts
453
+.endif
301 454
 
302 455
 ;---------------------------------------------------------------
303 456
 ; VerticalLine                                            $C121
@@ -355,6 +508,10 @@ _VerticalLine:
355 508
 _i_Rectangle:
356 509
 	jsr GetInlineDrwParms
357 510
 	jsr _Rectangle
511
+.ifdef wheels_size
512
+.global DoInlineReturn7
513
+DoInlineReturn7:
514
+.endif
358 515
 	php
359 516
 	lda #7
360 517
 	jmp DoInlineReturn
@@ -409,9 +566,13 @@ _InvertRectangle:
409 566
 _i_RecoverRectangle:
410 567
 	jsr GetInlineDrwParms
411 568
 	jsr _RecoverRectangle
569
+.ifdef wheels_size
570
+	jmp DoInlineReturn7
571
+.else
412 572
 	php
413 573
 	lda #7
414 574
 	jmp DoInlineReturn
575
+.endif
415 576
 
416 577
 ;---------------------------------------------------------------
417 578
 ; RecoverRectangle                                        $C12D
@@ -440,9 +601,13 @@ _RecoverRectangle:
440 601
 _i_ImprintRectangle:
441 602
 	jsr GetInlineDrwParms
442 603
 	jsr _ImprintRectangle
604
+.ifdef wheels_size
605
+	jmp DoInlineReturn7
606
+.else
443 607
 	php
444 608
 	lda #7
445 609
 	jmp DoInlineReturn
610
+.endif
446 611
 
447 612
 ;---------------------------------------------------------------
448 613
 ; ImprintRectangle                                        $C250
@@ -512,6 +677,14 @@ _FrameRectangle:
512 677
 GetInlineDrwParms:
513 678
 	PopW r5
514 679
 	PopW returnAddress
680
+.ifdef wheels_size
681
+	ldy #0
682
+@1:	iny
683
+	lda (returnAddress),y
684
+	sta r1H,y
685
+	cpy #6
686
+	bne @1
687
+.else
515 688
 	ldy #1
516 689
 	lda (returnAddress),Y
517 690
 	sta r2L
@@ -530,6 +703,7 @@ GetInlineDrwParms:
530 703
 	iny
531 704
 	lda (returnAddress),Y
532 705
 	sta r4H
706
+.endif
533 707
 	PushW r5
534 708
 	rts
535 709
 
@@ -566,12 +740,17 @@ _i_GraphicsString:
566 740
 ; Destroyed: a, x, y, r0 - r15
567 741
 ;---------------------------------------------------------------
568 742
 _GraphicsString:
569
-	jsr Getr0AndInc
743
+	jsr GetR0AndInc
744
+.ifdef wheels_size_and_speed
745
+	tay
746
+	beq @1
747
+.else
570 748
 	beq @1
571 749
 	tay
750
+.endif
572 751
 	dey
573
-	lda GStrTL,Y
574
-	ldx GStrTH,Y
752
+	lda GStrTL,y
753
+	ldx GStrTH,y
575 754
 	jsr CallRoutine
576 755
 	bra _GraphicsString
577 756
 @1:	rts
@@ -587,6 +766,9 @@ _DoMovePenTo:
587 766
 	sta GraphPenY
588 767
 	stx GraphPenXL
589 768
 	sty GraphPenXH
769
+.ifdef wheels_size
770
+_DoNothing:
771
+.endif
590 772
 	rts
591 773
 
592 774
 _DoLineTo:
@@ -604,22 +786,28 @@ _DoRectangleTo:
604 786
 	jsr GrStSetCoords
605 787
 	jmp _Rectangle
606 788
 
789
+.ifndef wheels_size
607 790
 _DoNothing:
608 791
 	rts
792
+.endif
609 793
 
610 794
 _DoNewPattern:
611
-	jsr Getr0AndInc
795
+	jsr GetR0AndInc
612 796
 	jmp _SetPattern
613 797
 
614 798
 _DoESC_PutString:
615
-	jsr Getr0AndInc
799
+	jsr GetR0AndInc
616 800
 	sta r11L
617
-	jsr Getr0AndInc
801
+	jsr GetR0AndInc
618 802
 	sta r11H
619
-	jsr Getr0AndInc
803
+	jsr GetR0AndInc
620 804
 	sta r1H
805
+.ifdef wheels_size_and_speed
806
+	jmp _PutString
807
+.else
621 808
 	jsr _PutString
622 809
 	rts
810
+.endif
623 811
 
624 812
 _DoFrame_RecTo:
625 813
 	jsr GrStSetCoords
@@ -628,7 +816,11 @@ _DoFrame_RecTo:
628 816
 
629 817
 _DoPenXYDelta:
630 818
 	ldx #1
819
+.ifdef wheels_size
820
+	.byte $2c
821
+.else
631 822
 	bne DPXD0
823
+.endif
632 824
 _DoPenXDelta:
633 825
 	ldx #0
634 826
 DPXD0:
@@ -701,7 +893,11 @@ _SetPattern:
701 893
 	asl
702 894
 	asl
703 895
 	asl
896
+.ifdef wheels_size_and_speed
897
+	.assert <PatternTab = 0, error, "PatternTab must be page-aligned!"
898
+.else
704 899
 	adc #<PatternTab
900
+.endif
705 901
 	sta curPattern
706 902
 	lda #0
707 903
 	adc #>PatternTab
@@ -709,21 +905,28 @@ _SetPattern:
709 905
 	rts
710 906
 
711 907
 GetCoords:
712
-	jsr Getr0AndInc
908
+	jsr GetR0AndInc
713 909
 	tax
714
-	jsr Getr0AndInc
910
+	jsr GetR0AndInc
715 911
 	sta r2L
716
-	jsr Getr0AndInc
912
+	jsr GetR0AndInc
717 913
 	ldy r2L
718 914
 	rts ;x/y - x, a - y
719 915
 
720
-Getr0AndInc:
916
+GetR0AndInc:
721 917
 	ldy #0
722 918
 	lda (r0),Y
919
+.ifdef wheels_size
920
+.global IncR0
921
+IncR0:
922
+.endif
723 923
 	inc r0L
724 924
 	bne @1
725 925
 	inc r0H
726
-@1:	cmp #0
926
+@1:
927
+.ifndef wheels_size_and_speed ; only one caller needed this
928
+	cmp #0
929
+.endif
727 930
 	rts
728 931
 
729 932
 ;---------------------------------------------------------------
@@ -739,22 +942,36 @@ Getr0AndInc:
739 942
 _GetScanLine:
740 943
 	txa
741 944
 	pha
945
+.ifndef wheels_size_and_speed
742 946
 	pha
947
+.endif
743 948
 	and #%00000111
744 949
 	sta r6H
950
+.ifdef wheels_size_and_speed
951
+	txa
952
+.else
745 953
 	pla
954
+.endif
746 955
 	lsr
747 956
 	lsr
748 957
 	lsr
749 958
 	tax
750 959
 	bbrf 7, dispBufferOn, @2 ; ST_WR_FORE
751 960
 	bbsf 6, dispBufferOn, @1 ; ST_WR_BACK
961
+	; xxx the macros above do "BIT dispBufferOn" twice
752 962
 	lda LineTabL,x
753 963
 	ora r6H
754 964
 	sta r5L
965
+.ifdef wheels_size_and_speed
966
+	sta r6L
967
+.endif
755 968
 	lda LineTabH,x
756 969
 	sta r5H
970
+.ifdef wheels_size_and_speed
971
+	sta r6H
972
+.else
757 973
 	MoveW r5, r6
974
+.endif
758 975
 	pla
759 976
 	tax
760 977
 	rts
@@ -773,10 +990,17 @@ _GetScanLine:
773 990
 	lda LineTabL,x
774 991
 	ora r6H
775 992
 	sta r6L
993
+.ifdef wheels_size_and_speed
994
+	sta r5L
995
+.endif
776 996
 	lda LineTabH,x
777 997
 	subv >(SCREEN_BASE-BACK_SCR_BASE)
778 998
 	sta r6H
999
+.ifdef wheels_size_and_speed
1000
+	sta r5H
1001
+.else
779 1002
 	MoveW r6, r5
1003
+.endif
780 1004
 	pla
781 1005
 	tax
782 1006
 	rts
@@ -818,7 +1042,11 @@ LineTabH:
818 1042
 ;---------------------------------------------------------------
819 1043
 _BitOtherClip:
820 1044
 	ldx #$ff
1045
+.ifdef wheels_size
1046
+	.byte $2c
1047
+.else
821 1048
 	jmp BitmClp1
1049
+.endif
822 1050
 
823 1051
 ;---------------------------------------------------------------
824 1052
 ; BitmapClip                                              $C2AA
@@ -922,7 +1150,9 @@ _i_BitmapUp:
922 1150
 _BitmapUp:
923 1151
 	PushB r9H
924 1152
 	LoadB r9H, NULL
1153
+.ifndef wheels_size_and_speed
925 1154
 	lda #0
1155
+.endif
926 1156
 	sta r3L
927 1157
 	sta r4L
928 1158
 @1:	jsr BitmapUpHelp
@@ -992,6 +1222,14 @@ BitmapDecode:
992 1222
 	sta r7H
993 1223
 	bra BitmapDecode
994 1224
 
1225
+.ifdef wheels ; moved, but identical
1226
+IndirectR13:
1227
+	jmp (r13)
1228
+
1229
+IndirectR14:
1230
+	jmp (r14)
1231
+.endif
1232
+
995 1233
 BitmapDecode2:
996 1234
 	bit r9H
997 1235
 	bpl @1
@@ -1015,11 +1253,13 @@ BitmapDecode2:
1015 1253
 	dec r4L
1016 1254
 @3:	rts
1017 1255
 
1256
+.ifndef wheels ; moved
1018 1257
 IndirectR13:
1019 1258
 	jmp (r13)
1020 1259
 
1021 1260
 IndirectR14:
1022 1261
 	jmp (r14)
1262
+.endif
1023 1263
 
1024 1264
 .segment "graph4"
1025 1265
 

+ 35
- 6
kernal/header.s View File

@@ -21,30 +21,57 @@
21 21
 .assert * = $C000, error, "Header not at $C000"
22 22
 
23 23
 BootGEOS:
24
+.ifdef wheels
25
+	rts
26
+	nop
27
+	nop
28
+.else
24 29
 	jmp _BootGEOS
30
+.endif
25 31
 ResetHandle:
32
+.ifdef wheels
33
+	rts
34
+	nop
35
+	nop
36
+.else
26 37
 	jmp _ResetHandle
38
+.endif
27 39
 
28 40
 bootName:
29
-.if gateway
41
+.ifdef gateway
30 42
 	.byte "GATEWAY "
31 43
 	.byte 5 ; PADDING
32 44
 .else
33 45
 	.byte "GEOS BOOT"
34 46
 .endif
35 47
 version:
48
+.ifdef wheels
49
+	.byte $41
50
+.else
36 51
 	.byte $20
52
+.endif
37 53
 nationality:
38
-	.byte $00,$00
54
+.ifdef wheels
55
+	.word 1 ; GERMAN
56
+.else
57
+	.word 0
58
+.endif
39 59
 sysFlgCopy:
40
-	.byte $00
60
+	.byte 0
41 61
 c128Flag:
42
-	.byte $00
62
+	.byte 0
43 63
 
44
-	.byte $05,$00,$00,$00 ; ???
64
+.ifdef wheels
65
+	.byte 0
66
+.else
67
+	.byte 5
68
+.endif
69
+	.byte 0, 0, 0 ; ???
45 70
 
46 71
 dateCopy:
47
-.if cbmfiles
72
+.ifdef wheels
73
+	.byte 99,1,1
74
+.elseif .defined(cbmfiles) || .defined(gateway)
48 75
 	; The cbmfiles version was created by dumping
49 76
 	; KERNAL from memory after it had been running,
50 77
 	; so it a different date here.
@@ -53,6 +80,7 @@ dateCopy:
53 80
 	.byte 88,4,20
54 81
 .endif
55 82
 
83
+.ifndef wheels
56 84
 _BootGEOS:
57 85
 	bbsf 5, sysFlgCopy, @1
58 86
 	jsr KERNALSETMSG
@@ -83,3 +111,4 @@ BootREUTab:
83 111
 	.word $007e
84 112
 	.word $0500
85 113
 	.word $0000
114
+.endif

+ 13
- 0
kernal/hw.s View File

@@ -39,6 +39,9 @@ _DoFirstInitIO:
39 39
 	LoadB CPU_DDR, $2f
40 40
 ASSERT_NOT_BELOW_IO
41 41
 	LoadB CPU_DATA, KRNL_IO_IN
42
+.ifdef wheels
43
+	sta scpu_turbo
44
+.endif
42 45
 	ldx #7
43 46
 	lda #$ff
44 47
 @1:	sta KbdDMltTab,x
@@ -68,13 +71,22 @@ ASSERT_NOT_BELOW_IO
68 71
 	LoadW r0, VIC_IniTbl
69 72
 	ldy #VIC_IniTbl_end - VIC_IniTbl
70 73
 	jsr SetVICRegs
74
+.ifdef wheels_size_and_speed ; inlined
75
+	ldx #32
76
+@3:	lda KERNALVecTab-1,x
77
+	sta irqvec-1,x
78
+	dex
79
+	bne @3
80
+.else
71 81
 	jsr Init_KRNLVec
82
+.endif
72 83
 	LoadB CPU_DATA, RAM_64K
73 84
 ASSERT_NOT_BELOW_IO
74 85
 	jmp ResetMseRegion
75 86
 
76 87
 .segment "hw2"
77 88
 
89
+.ifndef wheels_size_and_speed ; inlined instead
78 90
 Init_KRNLVec:
79 91
 	ldx #32
80 92
 @1:	lda KERNALVecTab-1,x
@@ -82,6 +94,7 @@ Init_KRNLVec:
82 94
 	dex
83 95
 	bne @1
84 96
 	rts
97
+.endif
85 98
 
86 99
 .segment "hw3"
87 100
 

+ 21
- 3
kernal/icon.s View File

@@ -3,6 +3,7 @@
3 3
 ;
4 4
 ; Icons
5 5
 
6
+.include "config.inc"
6 7
 .include "const.inc"
7 8
 .include "geossym.inc"
8 9
 .include "geosmac.inc"
@@ -58,12 +59,19 @@ _DoIcons:
58 59
 	jsr Icons_1
59 60
 	jsr ResetMseRegion
60 61
 	lda mouseOn
62
+.ifdef wheels_size_and_speed
63
+	bmi @1
64
+.else
61 65
 	and #SET_MSE_ON
62 66
 	bne @1
63 67
 	lda mouseOn
68
+.endif
64 69
 	and #%10111111
65 70
 	sta mouseOn
66
-@1:	lda mouseOn
71
+@1:
72
+.ifndef wheels_size_and_speed
73
+	lda mouseOn
74
+.endif
67 75
 	ora #SET_ICONSON
68 76
 	sta mouseOn
69 77
 	ldy #1
@@ -91,7 +99,10 @@ CalcIconDescTab:
91 99
 
92 100
 Icons_1:
93 101
 	LoadB r10L, NULL
94
-@1:	lda r10L
102
+@1:
103
+.ifndef wheels_size_and_speed
104
+	lda r10L
105
+.endif
95 106
 	jsr CalcIconDescTab
96 107
 	ldx #0
97 108
 @2:	lda (IconDescVec),y
@@ -164,7 +175,10 @@ ProcessClick:
164 175
 
165 176
 FindClkIcon:
166 177
 	LoadB r0L, NULL
167
-@1:	lda r0L
178
+@1:
179
+.ifndef wheels_size_and_speed
180
+	lda r0L
181
+.endif
168 182
 	jsr CalcIconDescTab
169 183
 	lda (IconDescVec),y