diff --git a/tools/6502/contiki.html b/tools/6502/contiki.html index 66920a377..4e6185866 100644 --- a/tools/6502/contiki.html +++ b/tools/6502/contiki.html @@ -11,7 +11,7 @@
-

Download your custom generated Contiki configuration

+

Download your custom generated Contiki

+ + +
@@ -103,6 +103,22 @@
+
+ + + + +
+ + + + + +
+
@@ -111,4 +127,4 @@
- + diff --git a/tools/6502/download.php b/tools/6502/download.php index c62b9577a..f83614b97 100644 --- a/tools/6502/download.php +++ b/tools/6502/download.php @@ -9,14 +9,20 @@ switch ($_GET['machine']) { case "apple2": $hex = $_GET['apple2-addr']; $drv = $_GET['apple2-drv']; + $ext = 'dsk'; + $ofs = 0x0B500; break; case "c64": $hex = strtok($_GET['c64-addr-drv'], '-'); $drv = strtok('-'); + $ext = 'd64'; + $ofs = 0x17802; break; case "c128": $hex = strtok($_GET['c128-addr-drv'], '-'); $drv = strtok('-'); + $ext = 'd71'; + $ofs = 0x17802; break; } @@ -24,8 +30,15 @@ $addr = hexdec($hex); $cfg .= chr($addr % 0x100).chr($addr / 0x100); $cfg .= $drv; -header('Content-Type: application/octetstream'); -header('Content-Disposition: attachment; filename=contiki.cfg'); -print($cfg); +if ($_GET['disk']) { + $out = substr_replace(file_get_contents('contiki.' . $ext), $cfg, $ofs, strlen($cfg)); +} else { + $ext = 'cfg'; + $out = $cfg; +} -?> \ No newline at end of file +header('Content-Type: application/octetstream'); +header('Content-Disposition: attachment; filename=contiki.' . $ext); +print($out); + +?>