aiko-php/aiko

31 lines
742 B
PHP
Executable file

#!/usr/bin/env php
<?php
namespace Aiko;
require_once __DIR__ . '/vendor/autoload.php';
error_reporting(-1);
define('AIKO_ROM', '/home/flash/6502_65C02_functional_tests/bin_files/6502_functional_test.bin');
//define('AIKO_ROM', __DIR__ . '/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);
}