2010-10-06 16:53:40 +00:00
|
|
|
#include "perfect6502.h"
|
2010-10-07 02:19:44 +00:00
|
|
|
#include "runtime.h"
|
|
|
|
#include "runtime_init.h"
|
2010-10-07 00:28:02 +00:00
|
|
|
|
2010-10-06 16:53:40 +00:00
|
|
|
int
|
|
|
|
main()
|
|
|
|
{
|
|
|
|
int clk = 0;
|
|
|
|
|
2014-12-01 10:00:30 +00:00
|
|
|
void *state = initAndResetChip();
|
2010-10-06 16:53:40 +00:00
|
|
|
|
|
|
|
/* set up memory for user program */
|
|
|
|
init_monitor();
|
|
|
|
|
|
|
|
/* emulate the 6502! */
|
|
|
|
for (;;) {
|
2014-12-01 10:00:30 +00:00
|
|
|
step(state);
|
2010-10-06 16:53:40 +00:00
|
|
|
clk = !clk;
|
|
|
|
if (clk)
|
2014-12-01 10:00:30 +00:00
|
|
|
handle_monitor(state);
|
2010-10-06 16:53:40 +00:00
|
|
|
|
2014-12-01 10:00:30 +00:00
|
|
|
// chipStatus(state);
|
2010-10-06 16:53:40 +00:00
|
|
|
//if (!(cycle % 1000)) printf("%d\n", cycle);
|
|
|
|
};
|
|
|
|
}
|