2022-04-22 10:16:48 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
require './fnc.php';
|
2022-07-27 00:10:59 +00:00
|
|
|
if(file_exists("./config.ini")) {
|
|
|
|
|
$conf = parse_ini_file("config.ini");
|
|
|
|
|
echo('<html style="background-color:'.$conf["bgcolor"].';">');
|
|
|
|
|
$romdirectory = $conf["rom_dir"];
|
|
|
|
|
if(is_dir($romdirectory)) {
|
|
|
|
|
$gamedata = buildRomList($romdirectory);
|
|
|
|
|
} else {
|
|
|
|
|
mkdir($romdirectory);
|
|
|
|
|
$gamedata = buildRomList($romdirectory);
|
|
|
|
|
}
|
|
|
|
|
echo("\r\n<div style='width:". 640*$conf["scale"] ."px;height:". 480*$conf["scale"] ."px;max-width:100%;margin:auto auto;'>");
|
|
|
|
|
} else {
|
|
|
|
|
echo('<html style="background-color:#333333;">');
|
|
|
|
|
$romdirectory = './roms/';
|
|
|
|
|
$gamedata = buildRomList($romdirectory);
|
|
|
|
|
echo("\r\n<div style='width:640px;height:480px;max-width:100%;margin:auto auto;'>");
|
|
|
|
|
}
|
2022-04-22 10:16:48 +00:00
|
|
|
$romlist = scandir($romdirectory);
|
|
|
|
|
for($i=0; $i<count($romlist)-2; $i++) {
|
|
|
|
|
$romlistfin[$i] = $romlist[$i + 2];
|
|
|
|
|
}
|
|
|
|
|
|
2022-07-27 00:10:59 +00:00
|
|
|
|
|
|
|
|
|
2022-04-22 10:16:48 +00:00
|
|
|
?>
|
|
|
|
|
|
2022-07-27 00:10:59 +00:00
|
|
|
|
2022-04-22 10:16:48 +00:00
|
|
|
<div id='game'></div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<script type='text/javascript'>
|
2022-07-27 02:59:10 +00:00
|
|
|
<?php if (isset($_GET['games'])) {
|
|
|
|
|
$gid = $_GET['games'];
|
|
|
|
|
} else {
|
|
|
|
|
$gid = 0;
|
|
|
|
|
}
|
|
|
|
|
?>
|
2022-04-22 10:16:48 +00:00
|
|
|
EJS_player = '#game';
|
2022-07-27 02:59:10 +00:00
|
|
|
EJS_core = <?php echo("'".$gamedata[$gid]["Console"]."'"); ?>;
|
|
|
|
|
EJS_gameUrl = <?php echo('"./roms/'.$romlistfin[$gid].'"'); ?>;
|
|
|
|
|
<?php if($gamedata[$gid]["Console"] == "psx") {
|
2022-07-27 00:10:59 +00:00
|
|
|
echo("EJS_biosUrl = './bios/psx.bin';\r\n");
|
|
|
|
|
}
|
|
|
|
|
?>
|
|
|
|
|
<?php if($conf["netplay"] == "true") {
|
2022-07-27 02:59:10 +00:00
|
|
|
echo("EJS_gameID = ".$gid.";\r\n");
|
2022-07-26 03:46:01 +00:00
|
|
|
}
|
2022-07-27 02:20:09 +00:00
|
|
|
if($conf["beta"] == "true") {
|
2022-07-27 02:59:10 +00:00
|
|
|
echo("EJS_BETA = true; \r\n");
|
2022-07-27 02:20:09 +00:00
|
|
|
}
|
2022-07-26 03:46:01 +00:00
|
|
|
?>
|
2022-07-27 02:59:10 +00:00
|
|
|
EJS_pathtodata = 'data/';
|
2022-04-22 10:16:48 +00:00
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<script src='data/loader.js'></script>
|