/[VRac]/M6502/perl.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /M6502/perl.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 26 by dpavlin, Mon Jul 30 14:23:22 2007 UTC revision 27 by dpavlin, Mon Jul 30 15:45:03 2007 UTC
# Line 33  byte Rd6502(register word Addr) { Line 33  byte Rd6502(register word Addr) {
33          byte Value;          byte Value;
34          Value = 0x42;          Value = 0x42;
35          printf("Rd6502(%04x,%02x)\n", Addr, Value);          printf("Rd6502(%04x,%02x)\n", Addr, Value);
36    
37            int count;
38            dSP;
39            ENTER;
40            SAVETMPS;
41            PUSHMARK(SP);
42            XPUSHs( sv_2mortal( newSViv( Value ) ) );
43            PUTBACK;
44            count = call_pv("M6502::read", G_ARRAY );
45            if ( count != 1 ) {
46                    printf("expect 1 return value, got %d", count);
47                    exit(1);
48            }
49            printf("got %d values\n", count);
50            SPAGAIN;
51            SV *sv;
52            sv = POPs;
53            Value = SvIV(sv);
54    //      Value = savepv(SvPV_nolen(POPs));
55            FREETMPS;
56            LEAVE;
57            printf("Rd6502(%04x) = %02x\n", Addr, Value);
58            return Value;
59  }  }
60    
61  void Wr6502(register word Addr,register byte Value) {  void Wr6502(register word Addr,register byte Value) {
62          printf("Wr6502(%04x,%02x)\n", Addr, Value);          printf("Wr6502(%04x,%02x)\n", Addr, Value);
63            dSP;
64            ENTER;
65            SAVETMPS;
66            PUSHMARK(SP);
67            XPUSHs( sv_2mortal( newSViv( Addr ) ) );
68            XPUSHs( sv_2mortal( newSViv( Value ) ) );
69            PUTBACK;
70            call_pv("M6502::write", G_DISCARD );
71            FREETMPS;
72            LEAVE;
73  }  }
74    
75  byte Op6502(register word Addr) {  byte Op6502(register word Addr) {

Legend:
Removed from v.26  
changed lines
  Added in v.27

  ViewVC Help
Powered by ViewVC 1.1.26