2024-12-14 04:47:34 +00:00
|
|
|
#!/usr/bin/env php
|
2024-12-09 03:51:28 +00:00
|
|
|
<?php
|
|
|
|
namespace Aiko;
|
|
|
|
|
2024-12-14 20:50:46 +00:00
|
|
|
require_once __DIR__ . '/vendor/autoload.php';
|
2024-12-09 03:51:28 +00:00
|
|
|
|
2024-12-14 20:50:46 +00:00
|
|
|
error_reporting(-1);
|
2024-12-09 03:51:28 +00:00
|
|
|
|
|
|
|
define('AIKO_ROM', '/home/flash/6502_65C02_functional_tests/bin_files/6502_functional_test.bin');
|
2024-12-14 20:50:46 +00:00
|
|
|
//define('AIKO_ROM', __DIR__ . '/test.bin');
|
2024-12-09 03:51:28 +00:00
|
|
|
|
|
|
|
$cpu = new Cpu(
|
2024-12-14 20:57:14 +00:00
|
|
|
FileMemory::open(AIKO_ROM)
|
|
|
|
// new ClosureMemory(
|
2024-12-09 03:51:28 +00:00
|
|
|
// 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();
|
2024-12-14 04:47:34 +00:00
|
|
|
//usleep(10_000);
|
2024-12-09 03:51:28 +00:00
|
|
|
}
|