Adjusted Contiki download page content to the fact that there are now two disk images (apart from the larger D71 image for the C128).

This commit is contained in:
oliverschmidt 2010-02-14 17:41:05 +00:00
parent 46c7cd23fc
commit 94153a9508
2 changed files with 15 additions and 18 deletions

View File

@ -105,17 +105,12 @@
<td colspan="3" /> <td colspan="3" />
</tr><tr class="p"> </tr><tr class="p">
<td colspan="3"> <td colspan="3">
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td>
<input type="radio" name="disk" id="disk" value="1" checked="checked" />
<label for="disk">Complete Disk Image</label>
</td><td align="right">
<input type="radio" name="disk" id="conf" value="0" /> <input type="radio" name="disk" id="conf" value="0" />
<label for="conf">Configuration File Only</label> <label for="conf">Configuration File Only</label><br />
</td> <input type="radio" name="disk" id="disk-1" value="1" checked="checked" />
</tr> <label for="disk-1">Complete Image Of Disk 1</label><br />
</table> <input type="radio" name="disk" id="disk-2" value="2" />
<label for="disk-2">Complete Image Of Disk 2</label>
</td> </td>
</tr><tr class="bg"> </tr><tr class="bg">
<td colspan="3" /> <td colspan="3" />

View File

@ -5,23 +5,25 @@ $cfg .= chr($_GET['mask-a']).chr($_GET['mask-b']).chr($_GET['mask-c']).chr($_GET
$cfg .= chr($_GET['dgw-a']). chr($_GET['dgw-b']). chr($_GET['dgw-c']). chr($_GET['dgw-d']); $cfg .= chr($_GET['dgw-a']). chr($_GET['dgw-b']). chr($_GET['dgw-c']). chr($_GET['dgw-d']);
$cfg .= chr($_GET['dns-a']). chr($_GET['dns-b']). chr($_GET['dns-c']). chr($_GET['dns-d']); $cfg .= chr($_GET['dns-a']). chr($_GET['dns-b']). chr($_GET['dns-c']). chr($_GET['dns-d']);
$dsk = $_GET['disk'];
switch ($_GET['machine']) { switch ($_GET['machine']) {
case "apple2": case "apple2":
$hex = $_GET['apple2-addr']; $hex = $_GET['apple2-addr'];
$drv = $_GET['apple2-drv']; $drv = $_GET['apple2-drv'];
$ext = 'dsk'; $ext = '-' . $dsk . '.dsk';
$ofs = 0x05B00; $ofs = 0x05B00;
break; break;
case "c64": case "c64":
$hex = strtok($_GET['c64-addr-drv'], '-'); $hex = strtok($_GET['c64-addr-drv'], '-');
$drv = strtok('-'); $drv = strtok('-');
$ext = 'd64'; $ext = '-' . $dsk . '.d64';
$ofs = 0x15002; $ofs = 0x15002;
break; break;
case "c128": case "c128":
$hex = strtok($_GET['c128-addr-drv'], '-'); $hex = strtok($_GET['c128-addr-drv'], '-');
$drv = strtok('-'); $drv = strtok('-');
$ext = 'd71'; $ext = '.d71';
$ofs = 0x15002; $ofs = 0x15002;
break; break;
} }
@ -30,15 +32,15 @@ $addr = hexdec($hex);
$cfg .= chr($addr % 0x100).chr($addr / 0x100); $cfg .= chr($addr % 0x100).chr($addr / 0x100);
$cfg .= $drv; $cfg .= $drv;
if ($_GET['disk']) { if ($dsk) {
$out = substr_replace(file_get_contents('contiki.' . $ext), $cfg, $ofs, strlen($cfg)); $out = substr_replace(file_get_contents('contiki'. $ext), $cfg, $ofs, strlen($cfg));
} else { } else {
$ext = 'cfg'; $ext = '.cfg';
$out = $cfg; $out = $cfg;
} }
header('Content-Type: application/octetstream'); header('Content-Type: application/octetstream');
header('Content-Disposition: attachment; filename=contiki.' . $ext); header('Content-Disposition: attachment; filename=contiki' . $ext);
print($out); print($out);
?> ?>