2008-05-16 00:39:30 +02:00
|
|
|
<?php
|
|
|
|
|
2010-08-06 00:50:19 +02:00
|
|
|
error_reporting(0);
|
|
|
|
|
2008-05-16 00:39:30 +02:00
|
|
|
$cfg = chr($_GET['addr-a']).chr($_GET['addr-b']).chr($_GET['addr-c']).chr($_GET['addr-d']);
|
|
|
|
$cfg .= chr($_GET['mask-a']).chr($_GET['mask-b']).chr($_GET['mask-c']).chr($_GET['mask-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']);
|
|
|
|
|
|
|
|
switch ($_GET['machine']) {
|
2010-08-06 00:50:19 +02:00
|
|
|
case 'apple2':
|
2008-05-16 00:39:30 +02:00
|
|
|
$hex = $_GET['apple2-addr'];
|
|
|
|
$drv = $_GET['apple2-drv'];
|
|
|
|
break;
|
2010-08-06 00:50:19 +02:00
|
|
|
case 'c64':
|
2008-05-16 00:39:30 +02:00
|
|
|
$hex = strtok($_GET['c64-addr-drv'], '-');
|
|
|
|
$drv = strtok('-');
|
|
|
|
break;
|
2010-08-06 00:50:19 +02:00
|
|
|
case 'c128':
|
2008-05-16 00:39:30 +02:00
|
|
|
$hex = strtok($_GET['c128-addr-drv'], '-');
|
|
|
|
$drv = strtok('-');
|
|
|
|
break;
|
2010-09-30 22:32:07 +02:00
|
|
|
case 'atari':
|
|
|
|
$hex = strtok($_GET['atari-addr-drv'], '-');
|
|
|
|
$drv = strtok('-');
|
|
|
|
break;
|
2008-05-16 00:39:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
$addr = hexdec($hex);
|
|
|
|
$cfg .= chr($addr % 0x100).chr($addr / 0x100);
|
|
|
|
$cfg .= $drv;
|
|
|
|
|
|
|
|
header('Content-Type: application/octetstream');
|
2013-02-01 23:19:12 +01:00
|
|
|
header('Content-Disposition: attachment; filename=contiki.cfg');
|
|
|
|
print($cfg);
|
2008-05-16 00:39:30 +02:00
|
|
|
|
2008-06-07 02:26:44 +02:00
|
|
|
?>
|