29 |
/** required if there is a #define FAST_RDOP. **/ |
/** required if there is a #define FAST_RDOP. **/ |
30 |
/************************************ TO BE WRITTEN BY USER **/ |
/************************************ TO BE WRITTEN BY USER **/ |
31 |
|
|
32 |
byte Rd6502(register word Addr) { |
byte mem(word Addr) { |
33 |
byte Value; |
byte byte; |
|
Value = 0x42; |
|
|
printf("Rd6502(%04x,%02x)\n", Addr, Value); |
|
|
|
|
34 |
int count; |
int count; |
35 |
dSP; |
dSP; |
36 |
ENTER; |
ENTER; |
37 |
SAVETMPS; |
SAVETMPS; |
38 |
PUSHMARK(SP); |
PUSHMARK(SP); |
39 |
XPUSHs( sv_2mortal( newSViv( Value ) ) ); |
XPUSHs( sv_2mortal( newSViv( Addr ) ) ); |
40 |
PUTBACK; |
PUTBACK; |
41 |
count = call_pv("M6502::read", G_ARRAY ); |
count = call_pv("M6502::read", G_ARRAY ); |
42 |
if ( count != 1 ) { |
if ( count != 1 ) { |
47 |
SPAGAIN; |
SPAGAIN; |
48 |
SV *sv; |
SV *sv; |
49 |
sv = POPs; |
sv = POPs; |
50 |
Value = SvIV(sv); |
byte = SvIV(sv); |
|
// Value = savepv(SvPV_nolen(POPs)); |
|
51 |
FREETMPS; |
FREETMPS; |
52 |
LEAVE; |
LEAVE; |
53 |
printf("Rd6502(%04x) = %02x\n", Addr, Value); |
printf("Rd6502(%04x) = %02x\n", Addr, byte); |
54 |
|
return byte; |
55 |
|
} |
56 |
|
|
57 |
|
byte Rd6502(register word Addr) { |
58 |
|
byte Value; |
59 |
|
Value = mem(Addr); |
60 |
return Value; |
return Value; |
61 |
} |
} |
62 |
|
|
76 |
|
|
77 |
byte Op6502(register word Addr) { |
byte Op6502(register word Addr) { |
78 |
byte Op; |
byte Op; |
79 |
Op = 0xff; |
Op = mem(Addr); |
80 |
printf("Op6502(%04x,%02x)\n", Addr, Op); |
printf("Op6502(%04x,%02x)\n", Addr, Op); |
81 |
dump_R; |
dump_R; |
82 |
} |
} |
91 |
byte Loop6502(register M6502 *R) { |
byte Loop6502(register M6502 *R) { |
92 |
printf("Loop6502\n"); |
printf("Loop6502\n"); |
93 |
dump_R; |
dump_R; |
94 |
|
return INT_NONE; |
95 |
} |
} |
96 |
|
|
97 |
/** Patch6502() **********************************************/ |
/** Patch6502() **********************************************/ |
104 |
byte Patch6502(register byte Op,register M6502 *R) { |
byte Patch6502(register byte Op,register M6502 *R) { |
105 |
printf("Patch6502(%02x)\n", Op); |
printf("Patch6502(%02x)\n", Op); |
106 |
dump_R; |
dump_R; |
107 |
|
return 0; |
108 |
} |
} |
109 |
|
|
110 |
/** |
/** |