Ryukojiro-apple1/apple1/main.c
Daniel Loffgren ac87480ce8 Got the project building, and used the sample v6502 implementation
git-svn-id: svn+ssh://svn.phoenixbox.net/svn/apple1/trunk@3 64f78de7-aa59-e511-a0e8-0002a5492df0
2015-09-13 00:17:41 +00:00

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);
}