7 |
|
|
8 |
static M6502 *R; |
static M6502 *R; |
9 |
|
|
10 |
void pull_R(M6502 *R) { |
void pull_R(void) { |
11 |
R->A = SvIV( get_sv("M6502::A", FALSE) ); |
R->A = SvIV( get_sv("M6502::A", FALSE) ); |
12 |
R->P = SvIV( get_sv("M6502::P", FALSE) ); |
R->P = SvIV( get_sv("M6502::P", FALSE) ); |
13 |
R->X = SvIV( get_sv("M6502::X", FALSE) ); |
R->X = SvIV( get_sv("M6502::X", FALSE) ); |
24 |
dump_R; |
dump_R; |
25 |
} |
} |
26 |
|
|
27 |
void push_R(M6502 *R) { |
void push_R(void) { |
28 |
|
debugf(("push_R")); |
29 |
dSP; |
dSP; |
30 |
ENTER; |
ENTER; |
31 |
SAVETMPS; |
SAVETMPS; |
45 |
XPUSHs( sv_2mortal( newSViv( R->Trace ) ) ); |
XPUSHs( sv_2mortal( newSViv( R->Trace ) ) ); |
46 |
PUTBACK; |
PUTBACK; |
47 |
call_pv("M6502::push_R", G_DISCARD ); |
call_pv("M6502::push_R", G_DISCARD ); |
48 |
printf("push_R called\n"); |
debugf(("push_R called")); |
49 |
dump_R; |
dump_R; |
50 |
FREETMPS; |
FREETMPS; |
51 |
LEAVE; |
LEAVE; |
177 |
dSP; |
dSP; |
178 |
PUSHMARK(SP); |
PUSHMARK(SP); |
179 |
call_pv("Arch::cli", G_DISCARD | G_NOARGS ); |
call_pv("Arch::cli", G_DISCARD | G_NOARGS ); |
180 |
pull_R(R); |
pull_R; |
181 |
FREETMPS; |
FREETMPS; |
182 |
LEAVE; |
LEAVE; |
183 |
cycles = SvIV( get_sv("M6502::run_for", FALSE) ); |
cycles = SvIV( get_sv("M6502::run_for", FALSE) ); |
187 |
//Run6502(R); |
//Run6502(R); |
188 |
Exec6502(R, cycles); |
Exec6502(R, cycles); |
189 |
dump_R; |
dump_R; |
190 |
push_R(R); |
push_R; |
191 |
printf("end of %d cycles CPU run\n", cycles); |
printf("end of %d cycles CPU run\n", cycles); |
192 |
} else { |
} else { |
193 |
printf("no cpu cycles set for run\n"); |
printf("no cpu cycles set for run\n"); |