Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
dd159cc
1541 ROM calls documented using All About Your 1541 http://unusedino.…
Mar 22, 2024
48b2cc2
1541 disk driver with serial communication replaced by parallel (stan…
Mar 23, 2024
4ca8a9e
optimizations
Mar 23, 2024
212c42b
maximum drive code size is -bash400 (-bash300--bash6ff), calculate on…
Mar 23, 2024
001aa80
more macros and comments
Mar 23, 2024
d41c0e4
improve parallelism a bit
Mar 23, 2024
54cef02
fix Drv_SendByte_0 to send exactly two bytes as status: length (1) an…
Mar 25, 2024
c9c974a
optimized drive->host transfer procedure from 35 cycles down to 27/28
Mar 25, 2024
6e20bab
remarks and optimal interleave setting
Mar 25, 2024
794c87d
updated with drv1541parallel mentions
Mar 25, 2024
448e0c2
found that 6 is the optimum interleave value
Mar 30, 2024
b42dc4d
parallel version with otf-gcr decoding but will crash on write
Mar 30, 2024
b4d9205
optimal interleave
Mar 30, 2024
53773b7
working read/write version, buffer at 0x700 cached at 0x200 reloaded …
Mar 31, 2024
2c6bbaa
more comments, remove dead locations and code
Mar 31, 2024
b6e303e
faster turnaround for WriteBlock
Mar 31, 2024
3c09798
more general memory recieve routine
Mar 31, 2024
66c9ff6
faster code upload (forced after every ExitTurbo), make ExitTurbo res…
Mar 31, 2024
e85b4f5
simplify ExitTurbo (reset only), used gained space to check for missi…
Mar 31, 2024
0fb8343
corrected Enter/Exit/PurgeTurbo to correctly handle each case
Apr 2, 2024
c4f6f68
scan for 1541s on the bus and send M-W command to set port A as input
Apr 2, 2024
906bf88
more corrections for uploading code to drive, handle ReadBlock withou…
Apr 3, 2024
7049903
remove all code related to disk cache, no space for that
Apr 3, 2024
8782f75
correct ExitTurbo to preserve device number
Apr 3, 2024
a4113b9
don't send page 07xx twice, move ExitTurbo to the end to fit whole Wr…
Apr 3, 2024
1cdef91
reorder drivecode to send fewer bytes via slow M-W
Apr 4, 2024
9bc6028
docs
Apr 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion Makefile
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ else
D64_TEMPLATE = GEOS64.D64
endif

ASFLAGS = -I inc -I .
ASFLAGS = -I inc -I . --cpu 6502X

# code that is in front bank of all variants
KERNAL_SOURCES= \
Expand Down Expand Up @@ -233,6 +233,7 @@ endif

DRIVER_SOURCES= \
drv/drv1541.bin \
drv/drv1541parallel.bin \
drv/drv1571.bin \
drv/drv1581.bin \
input/joydrv.bin \
Expand Down Expand Up @@ -269,6 +270,7 @@ PREFIXED_RELOCATOR_OBJS = $(addprefix $(BUILD_DIR)/, $(RELOCATOR_OBJS))
ALL_BINS= \
$(BUILD_DIR)/kernal/kernal.bin \
$(BUILD_DIR)/drv/drv1541.bin \
$(BUILD_DIR)/drv/drv1541parallel.bin \
$(BUILD_DIR)/drv/drv1571.bin \
$(BUILD_DIR)/drv/drv1581.bin \
$(BUILD_DIR)/input/joydrv.bin \
Expand Down Expand Up @@ -379,6 +381,9 @@ endif
$(BUILD_DIR)/drv/drv1541.bin: $(BUILD_DIR)/drv/drv1541.o drv/drv1541.cfg $(DEPS)
$(LD) -C drv/drv1541.cfg $(BUILD_DIR)/drv/drv1541.o -o $@

$(BUILD_DIR)/drv/drv1541parallel.bin: $(BUILD_DIR)/drv/drv1541parallel.o drv/drv1541parallel.cfg $(DEPS)
$(LD) -C drv/drv1541parallel.cfg -m $(BUILD_DIR)/drv/drv1541parallel.map $(BUILD_DIR)/drv/drv1541parallel.o -o $@

$(BUILD_DIR)/drv/drv1571.bin: $(BUILD_DIR)/drv/drv1571.o drv/drv1571.cfg $(DEPS)
$(LD) -C drv/drv1571.cfg $(BUILD_DIR)/drv/drv1571.o -o $@

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Without pucrunch/c1541, you can still build an uncompressed KERNAL binary image.
Run `make` to build the original "BSW" GEOS for C64. This will create the following files in directory `build/bsw`:

* raw KERNAL components: `kernal.bin`, `lokernal.bin`, `init.bin`
* disk drive drivers: `drv1541.bin`, `drv1571.bin`, `drv1581.bin`
* disk drive drivers: `drv1541.bin`, `drv1541parallel.bin`, `drv1571.bin`, `drv1581.bin`
* input drivers: `amigamse.bin`, `joydrv.bin`, `lightpen.bin`, `mse1351.bin`, `koalapad.bin`, `pcanalog.bin`
* combined KERNAL image (`SYS 49155`): `kernal_combined.prg`
* compressed KERNAL image (`RUN`): `kernal_compressed.prg`
Expand Down Expand Up @@ -112,7 +112,7 @@ By default, the KERNAL image will contain the Commodore 1541 disk driver (`drv15

make DRIVE=<drive> INPUT=<input>

Supported drives are `drv1541`, `drv1571` and `drv1581`. Supported input devices are `amigamse`, `joydrv`, `koalapad`, `lightpen`, `mse1351` and `pcanalog`.
Supported drives are `drv1541`, `drv1541parallel`, `drv1571` and `drv1581`. Supported input devices are `amigamse`, `joydrv`, `koalapad`, `lightpen`, `mse1351` and `pcanalog`.


## Customization
Expand Down
2 changes: 2 additions & 0 deletions config.inc
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ REUPresent = 1

.if .defined(drv1541)
DRV_TYPE = 1 ; DRV_1541
.elseif .defined(drv1541parallel)
DRV_TYPE = 1; DRV_1541
.elseif .defined(drv1571)
DRV_TYPE = 2; DRV_1571
.elseif .defined(drv1581)
Expand Down
24 changes: 12 additions & 12 deletions drv/drv1541.s
Original file line number Diff line number Diff line change
Expand Up @@ -1298,7 +1298,7 @@ Drv_ExitTurbo:
jsr D_DUNK4_1
LoadB $33, 0
sta $1800
jsr $f98f
jsr $f98f ; turn drive motor off
LoadB $1c0c, $ec
pla
pla
Expand Down Expand Up @@ -1435,7 +1435,7 @@ Drv_NewDisk_4:
Drv_NewDisk_5:
txa
Drv_NewDisk_6:
jsr $f24b
jsr $f24b ; Establish number of sectors per track (in: A=track, out: A=number of sectors on that track)
sta $43
Drv_NewDisk_7:
lda $1c00
Expand Down Expand Up @@ -1528,23 +1528,23 @@ D_DUNK11_1:
beq D_DUNK11_3
cmp #$30
beq D_DUNK11_2
jmp $f4ca
jmp $f4ca ; Test command code further ($00=read, $10=write, $20=verify, other=read block header)
D_DUNK11_2:
jmp $f3b1
jmp $f3b1 ; Read block header, verify ID
D_DUNK11_3:
jsr $f5e9
jsr $f5e9 ; Calculate parity for data buffer ($30)
sta $3a
lda $1c00
and #$10
bne D_DUNK11_4
lda #$08
bne D_DUNK11_9
D_DUNK11_4:
jsr $f78f
jsr $f510
jsr $f78f ; Convert 260 bytes (256+4) to 325 bytes group code buffer $01BB-$01FF and ($30)
jsr $f510 ; Read block header (wait until needed block header arrives)
ldx #9
D_DUNK11_5:
bvc D_DUNK11_5
bvc D_DUNK11_5 ; skip over sync
clv
dex
bne D_DUNK11_5
Expand All @@ -1565,14 +1565,14 @@ D_DUNK11_6:
bne D_DUNK11_6
ldy #$bb
D_DUNK11_7:
lda $0100,y
lda $0100,y ; write data
bvc *
clv
sta $1c01
iny
bne D_DUNK11_7
D_DUNK11_8:
lda ($30),y
lda ($30),y ; write data, continued
bvc *
clv
sta $1c01
Expand All @@ -1593,9 +1593,9 @@ D_DUNK12:
lda $20
and #$20
bne D_DUNK12_3
jsr $f97e
jsr $f97e ; Turn drive motor on
D_DUNK12_1:
ldy #$80
ldy #$80 ; delay until it spins up
D_DUNK12_2:
dex
bne D_DUNK12_2
Expand Down
13 changes: 13 additions & 0 deletions drv/drv1541parallel.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
MEMORY {
DISK_BASE: start = $9000, size = $0D80, file = %O;

DRIVE0300: start = $0300, size = $0500, define = yes;
DRIVE0060: start = $0086, size = $70;
}

SEGMENTS {
drv1541: load = DISK_BASE, type = ro;
drv1541_drivecode: load = DISK_BASE, run = DRIVE0300, type = ro, define = yes;
drv1541_zp: load = DISK_BASE, run = DRIVE0060, type = ro, define = yes;
drv1541_b: load = DISK_BASE, type = ro;
}
Loading