Skip to content

Commit 6a147fb

Browse files
committed
Adds cfgload.bin to allow for larger CONFIG binaries.
1 parent 6701068 commit 6a147fb

File tree

3 files changed

+55
-12
lines changed

3 files changed

+55
-12
lines changed

Makefile.coco

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,17 @@ R2R_BIN=$(R2R_DIR)/$(DISK)
1313
$(TARGET_EXEC): check_wifi.o connect_wifi.o destination_host_slot.o hosts_and_devices.o main.o perform_copy.o select_file.o select_slot.o set_wifi.o show_info.o bar.o die.o input.o io.o mount_and_boot.o screen.o strrchr.o pause.o
1414
$(CC) -o $@ check_wifi.o connect_wifi.o destination_host_slot.o hosts_and_devices.o main.o perform_copy.o select_file.o select_slot.o set_wifi.o show_info.o bar.o die.o input.o io.o mount_and_boot.o screen.o strrchr.o pause.o
1515

16-
$(R2R_BIN): $(TARGET_EXEC) | $(R2R_DIR)
16+
cfgload.bin:
17+
$(AS) -o $@ src/coco/cfgload.asm
18+
19+
$(R2R_BIN): $(TARGET_EXEC) cfgload.bin dist.coco/autoexec.bas | $(R2R_DIR)
1720
$(RM) $@
1821
decb dskini $@
1922
decb copy -t -0 dist.coco/autoexec.bas $@,AUTOEXEC.BAS
23+
writecocofile $@ cfgload.bin
2024
writecocofile $@ $<
2125

22-
dist: $(R2R_BIN)
26+
dist: $(R2R_BIN) cfgload.bin
2327
$(CP) $< $(FIRMWARE_DIR)/data/webui/device_specific/BUILD_COCO/
2428
$(ECHO) Now, Do a Upload Filesystem task.
2529

@@ -88,5 +92,6 @@ screen.o: src/coco/screen.c
8892
clean:
8993
$(RM) *.o
9094
$(RM) coco/*.o
95+
$(RM) cfgload.bin
9196
$(RM) $(TARGET_EXEC)
9297
$(RM) $(DISK)

dist.coco/autoexec.bas

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1-
10 REM FUJINET CONFIG AUTOEXEC
2-
20 CLS 6
3-
22 REM POKE &H95AC,57:POKE &HFF22,PEEK(&HFF22) OR &H10
4-
23 REM POKE &H167,&H39
5-
40 PRINT @ 256, " LOADING FUJINET CONFIG... ";
6-
50 PRINTCHR$(219);
7-
60 FOR X=0 TO 30
8-
70 PRINT CHR$(211);
9-
80 NEXT X
10-
90 LOADM"CONFIG":EXEC
1+
100 REM FUJINET CONFIG AUTOEXEC
2+
110 C = PEEK(&HFFF8):D = PEEK(&HFFF9)
3+
120 REM IF WE ARE COCO3, CHECK SCREEN WIDTH
4+
130 IF C=&HFE AND D=&HF7 THEN W = PEEK(&H00E7) ELSE W = 0
5+
140 CLS 6
6+
150 REM 1 OR 2 MEANS 40 OR 80 COLUMN MODE
7+
160 IF W = 1 OR W = 2 THEN GOTO 230
8+
170 PRINT @ 256, " LOADING FUJINET CONFIG... ";
9+
180 PRINTCHR$(219);
10+
190 FOR X=0 TO 30
11+
200 PRINT CHR$(211);
12+
210 NEXT X
13+
220 GOTO 240
14+
230 PRINT "Loading FujiNet Config..."
15+
240 LOADM"CFGLOAD":EXEC

src/coco/cfgload.asm

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
****************************************************
2+
* CONFIG LOADER
3+
* BASED ON CODE FROM BY SIMON JONASSEN (AKA INVISIBLE MAN)
4+
*
5+
* PREREQUISITES:
6+
*
7+
* DECB FAT ETC INTACT AT $600 > $DFF
8+
* CB/ECB/DECB NOT SWITCHED OUT
9+
* DP=0
10+
****************************************************
11+
org $7c00
12+
lhook equ $cfc5
13+
fname equ $094c (8.3 notation) PADDED without "." ($20 pad)
14+
ftype equ $0957 $0200 for .bin file
15+
execsd equ $009D
16+
17+
start
18+
ldx #myfile
19+
ldu #fname
20+
dofname ldd ,x++
21+
std ,u++
22+
cmpx #endmy
23+
blo dofname
24+
ldd #$200
25+
std ftype ;bin file type right after name
26+
jsr lhook
27+
ldx execsd
28+
jmp ,x
29+
rts
30+
31+
myfile fcc 'CONFIG BIN'
32+
endmy equ *
33+
end start

0 commit comments

Comments
 (0)