mirror of
https://github.com/RyuKojiro/apple1.git
synced 2024-06-18 03:29:30 +00:00
ac87480ce8
git-svn-id: svn+ssh://svn.phoenixbox.net/svn/apple1/trunk@3 64f78de7-aa59-e511-a0e8-0002a5492df0
35 lines
577 B
C
35 lines
577 B
C
//
|
|
// main.c
|
|
// apple1
|
|
//
|
|
// Created by Daniel Loffgren on 9/12/15.
|
|
// Copyright (c) 2015 Daniel Loffgren. All rights reserved.
|
|
//
|
|
|
|
#include <v6502/cpu.h>
|
|
#include <v6502/mem.h>
|
|
|
|
void fault(void *ctx, const char *e) {
|
|
(*(int *)ctx)++;
|
|
}
|
|
|
|
int main(int argc, const char * argv[])
|
|
{
|
|
int faulted = 0;
|
|
|
|
v6502_cpu *cpu = v6502_createCPU();
|
|
cpu->memory = v6502_createMemory(0xFFFF);
|
|
cpu->fault_callback = fault;
|
|
cpu->fault_context = &faulted;
|
|
|
|
v6502_reset(cpu);
|
|
|
|
while (!faulted) {
|
|
v6502_step(cpu);
|
|
}
|
|
|
|
|
|
v6502_destroyMemory(cpu->memory);
|
|
v6502_destroyCPU(cpu);
|
|
}
|