38 lines
997 B
PHP
Executable file
38 lines
997 B
PHP
Executable file
#!/usr/bin/env php
|
|
<?php
|
|
namespace Aiko;
|
|
|
|
define('AIKO_STARTUP', microtime(true));
|
|
define('AIKO_ROOT', __DIR__);
|
|
define('AIKO_DEBUG', is_file(AIKO_ROOT . '/.debug'));
|
|
define('AIKO_SOURCE', AIKO_ROOT . '/src');
|
|
|
|
require_once AIKO_ROOT . '/vendor/autoload.php';
|
|
|
|
error_reporting(AIKO_DEBUG ? -1 : 0);
|
|
mb_internal_encoding('UTF-8');
|
|
date_default_timezone_set('GMT');
|
|
|
|
define('AIKO_ROM', '/home/flash/6502_65C02_functional_tests/bin_files/6502_functional_test.bin');
|
|
//define('AIKO_ROM', AIKO_ROOT . '/test.bin');
|
|
|
|
$cpu = new Cpu(
|
|
FileCpuIo::open(AIKO_ROM)
|
|
// new ClosureCpuIo(
|
|
// function(int $addr): int {
|
|
// printf('GET $%04X%s', $addr, PHP_EOL);
|
|
|
|
// return $addr & 0xFF;
|
|
// },
|
|
// function(int $addr, int $value): void {
|
|
// printf('SET $%04X -> $%02X %s', $addr, $value, PHP_EOL);
|
|
// }
|
|
// )
|
|
);
|
|
|
|
$cpu->state->pc = 0x400;
|
|
for(;;) {
|
|
printf('[ %s ]%s', $cpu->state, PHP_EOL);
|
|
$cpu->tick();
|
|
//usleep(10_000);
|
|
}
|