73 |
PUSHMARK(SP); |
PUSHMARK(SP); |
74 |
XPUSHs( sv_2mortal( newSViv( Addr ) ) ); |
XPUSHs( sv_2mortal( newSViv( Addr ) ) ); |
75 |
PUTBACK; |
PUTBACK; |
76 |
count = call_pv("Arch::read", G_ARRAY ); |
count = call_pv("M6502::read", G_ARRAY | G_EVAL ); |
77 |
|
debugf(("got %d values\n", count)); |
78 |
|
SPAGAIN; |
79 |
|
if (SvTrue(ERRSV)) { |
80 |
|
display_message("ERROR: %s", SvPV_nolen( ERRSV ) ); |
81 |
|
exit(1); |
82 |
|
} |
83 |
if ( count != 1 ) { |
if ( count != 1 ) { |
84 |
printf("expect 1 return value, got %d", count); |
printf("expect 1 return value, got %d", count); |
85 |
exit(1); |
exit(1); |
86 |
} |
} |
|
//debugf(("got %d values\n", count)); |
|
|
SPAGAIN; |
|
87 |
SV *sv; |
SV *sv; |
88 |
sv = POPs; |
sv = POPs; |
89 |
byte = SvIV(sv); |
byte = SvIV(sv); |
90 |
FREETMPS; |
FREETMPS; |
91 |
LEAVE; |
LEAVE; |
92 |
//debugf(("mem(%04x) = %02x\n", Addr, byte)); |
debugf(("mem(%04x) = %02x\n", Addr, byte)); |
93 |
return byte; |
return byte; |
94 |
} |
} |
95 |
|
|
96 |
byte Rd6502(register word Addr) { |
byte Rd6502(register word Addr) { |
97 |
byte Value; |
byte Value; |
98 |
Value = mem(Addr); |
// Value = mem(Addr); |
99 |
|
Value = 0x42; |
100 |
debugf(("Rd6502(%04x) = %02x\n", Addr, Value)); |
debugf(("Rd6502(%04x) = %02x\n", Addr, Value)); |
101 |
return Value; |
return Value; |
102 |
} |
} |