Skip to content

Commit

Permalink
Replace bootloader tools with files from v6 zip file
Browse files Browse the repository at this point in the history
  • Loading branch information
stople committed Oct 13, 2024
1 parent 8a39bc3 commit 788aadf
Show file tree
Hide file tree
Showing 12 changed files with 61 additions and 5 deletions.
Binary file added tools/BOOT3.BIN
Binary file not shown.
Binary file removed tools/SMCBLD2.PRG
Binary file not shown.
24 changes: 23 additions & 1 deletion tools/SMCBLD2.BAS → tools/SMCBLD7.BAS
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
5 REM COPYRIGHT 2024 EIRIK STOPLE
10 PRINT "DUMP SMC FLASH TO $7E00-$7FFF"
10 PRINT "DUMP SMC BOOTLOADER TO $7E00-$7FFF"
20 OFFSET=$1E00
21 RAM=$7E00
24 REM SET SMC PAGE TO BOOTLOADER (120)
Expand All @@ -20,6 +20,7 @@
130 PRINT "DUMPED TO $7E00-$7FFF"
140 PRINT "DUMP TO SD CARD WITH THE COMMAND"
150 PRINT "BSAVE " CHR$($22) "DUMPSMC.BIN" CHR$($22) ",8,1,$7E00,$7FFF"
151 GOSUB 2000
160 END
1000 REM COMPUTE AND EVALUATE CHECKSUM FROM 7E00 TO 7FFF
1010 POKE 2,0
Expand All @@ -32,5 +33,26 @@
1080 IF CRC16 = $19B5 THEN PRINT "BOOTLOADER V1":RETURN
1090 IF CRC16 = $15C7 THEN PRINT "BOOTLOADER V2":RETURN
1100 IF CRC16 = $7594 THEN PRINT "BOOTLOADER V2 (BAD)":RETURN
1101 IF CRC16 = $4DA7 THEN PRINT "BOOTLOADER V3P0 (222654)":RETURN
1102 IF CRC16 = $0CD0 THEN PRINT "BOOTLOADER V3P1 (8B70F5)":RETURN
1103 IF CRC16 = $34C7 THEN PRINT "BOOTLOADER V3P2 (A9A75F)":RETURN
1104 IF CRC16 = $B135 THEN PRINT "BOOTLOADER V3P3 (06E330)":RETURN
1105 IF CRC16 = $6222 THEN PRINT "BOOTLOADER V3P4 (08A724)":RETURN
1106 IF CRC16 = $C340 THEN PRINT "BOOTLOADER V3P5 (952878)":RETURN
1107 IF CRC16 = $BC21 THEN PRINT "BOOTLOADER V3P6 (BCF522)":RETURN
1108 IF CRC16 = $BF63 THEN PRINT "BOOTLOADER V3":RETURN
1110 IF CRC16 = $6995 THEN PRINT "BOOTLOADER MISSING":RETURN
1120 PRINT "CRC-16 NOT RECOGNIZED":RETURN
2000 PRINT "BOOT V3 FAILSAFE: ";
2010 REM DUMP RESET VECTOR
2020 REM SET SMC PAGE TO START (0)
2030 I2CPOKE $42,$90,0
2040 LO=I2CPEEK($42,$91)
2050 HI=I2CPEEK($42,$91)
2060 IF LO <> $FF GOTO 2200
2070 IF HI <> $CE GOTO 2200
2080 PRINT "INSTALLED"
2090 PRINT "NB: DO NOT INSTALL OLDER BOOTLOADER THAN V3"
2100 RETURN
2200 PRINT "NOT INSTALLED"
2210 RETURN
Binary file added tools/SMCBLD7.PRG
Binary file not shown.
Binary file removed tools/SMCBLW16.PRG
Binary file not shown.
21 changes: 17 additions & 4 deletions tools/SMCBLW16.BAS → tools/SMCBLW19.BAS
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
5 COPYRIGHT 2024 EIRIK STOPLE
10 A$ = "BOOT2.BIN"
5 REM COPYRIGHT 2024 EIRIK STOPLE
10 A$ = "BOOT3.BIN"
20 PRINT "BOOTLOADER PROGRAMMER FOR SMC"
25 GOSUB 5000
30 PRINT "SELECTED FILE: " CHR$($22) A$ CHR$($22)
40 BLOAD A$,8,1,$7C00
50 OFFSET=$1E00
Expand Down Expand Up @@ -30,11 +31,12 @@
290 IF B$ = "Y" GOTO 2000
300 END
310 INPUT "FILE"; A$
320 GOTO 30
320 GOTO 25
1000 REM EVALUATE CHECKSUM
1010 IF CRC16 = $19B5 THEN PRINT "BOOTLOADER V1":RETURN
1020 IF CRC16 = $15C7 THEN PRINT "BOOTLOADER V2":RETURN
1030 IF CRC16 = $7594 THEN PRINT "BOOTLOADER V2 (BAD)":RETURN
1038 IF CRC16 = $BF63 THEN PRINT "BOOTLOADER V3":RETURN
1040 IF CRC16 = $6995 THEN PRINT "BOOTLOADER MISSING":RETURN
1050 PRINT "CRC-16 NOT RECOGNIZED":RETURN
2000 REM CHECK IF FLASH MANIPULATION IS ACTIVATED
Expand Down Expand Up @@ -70,6 +72,17 @@
4150 RAM=RAM+1
4160 IF RAM < $7E00 GOTO 4140
4170 PRINT "PROGRAMMING SUCCEEDED"
4180 GOTO 9000
5000 REM WARN THE USER IF BOOT V3 FAILSAFE IS INSTALLED
5010 REM COMPARE RESET VECTOR WITH CEFF
5020 REM SET SMC PAGE TO START (0)
5030 I2CPOKE $42,$90,0
5040 LO=I2CPEEK($42,$91)
5050 HI=I2CPEEK($42,$91)
5060 IF LO <> $FF THEN RETURN
5070 IF HI <> $CE THEN RETURN
5080 PRINT "NB: BOOT V3 FAILSAFE INSTALLED, DO NOT INSTALL OLDER THAN V3"
5090 RETURN
9000 REM LOCK SMC, WILL ALSO ENABLE POWER BUTTON AGAIN
9010 I2CPOKE $42,$93,0
9020 END
9020 END
Binary file added tools/SMCBLW19.PRG
Binary file not shown.
Binary file added tools/extra/BOOT1.BIN
Binary file not shown.
Binary file added tools/extra/BOOT2.BIN
Binary file not shown.
Binary file added tools/extra/BOOT2BAD.BIN
Binary file not shown.
21 changes: 21 additions & 0 deletions tools/extra/SMCDMP8.BAS
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
5 REM COPYRIGHT 2024 EIRIK STOPLE
10 PRINT "DUMP SMC FLASH TO $6000-$7FFF"
20 OFFSET=0
21 RAM=$6000
24 REM SET SMC PAGE TO FIRST PAGE (0)
25 I2CPOKE $42,$90,0
30 REM START A NEW LINE
40 IF OFFSET < 256 THEN PRINT "00";
50 PRINT HEX$(OFFSET) " ";
60 FOR I=0 TO 15
65 BYTE=I2CPEEK($42,$91)
68 POKE RAM,BYTE
70 PRINT " " HEX$(BYTE);
80 RAM=RAM+1
90 NEXT
100 PRINT " "
110 OFFSET = OFFSET + 16
120 IF OFFSET < 8192 GOTO 40
130 PRINT "DUMPED TO $6000-$7FFF"
140 PRINT "DUMP TO SD CARD WITH THE COMMAND"
150 PRINT "BSAVE " CHR$($22) "DUMPSMC.BIN" CHR$($22) ",8,1,$6000,$7FFF"
Binary file added tools/extra/SMCDMP8.PRG
Binary file not shown.

0 comments on commit 788aadf

Please sign in to comment.