/[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 83 by dpavlin, Wed Aug 1 21:46:23 2007 UTC revision 84 by dpavlin, Wed Aug 1 22:01:15 2007 UTC
# Line 73  byte mem(word Addr) { Line 73  byte mem(word Addr) {
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  }  }

Legend:
Removed from v.83  
changed lines
  Added in v.84

  ViewVC Help
Powered by ViewVC 1.1.26