/[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 84 by dpavlin, Wed Aug 1 22:01:15 2007 UTC revision 85 by dpavlin, Wed Aug 1 22:02:09 2007 UTC
# Line 66  byte Debug6502(M6502 *R) { Line 66  byte Debug6502(M6502 *R) {
66  byte mem(word Addr) {  byte mem(word Addr) {
67          byte byte;          byte byte;
68          int count;          int count;
69          debugf(("mem(%04x)\n", Addr));          debugf(("mem(%04x)", Addr));
70          dSP;          dSP;
71          ENTER;          ENTER;
72          SAVETMPS;          SAVETMPS;
# Line 74  byte mem(word Addr) { Line 74  byte mem(word Addr) {
74          XPUSHs( sv_2mortal( newSViv( Addr ) ) );          XPUSHs( sv_2mortal( newSViv( Addr ) ) );
75          PUTBACK;          PUTBACK;
76          count = call_pv("M6502::read", G_ARRAY | G_EVAL );          count = call_pv("M6502::read", G_ARRAY | G_EVAL );
77          debugf(("got %d values\n", count));          debugf(("got %d values", count));
78          SPAGAIN;          SPAGAIN;
79          if (SvTrue(ERRSV)) {          if (SvTrue(ERRSV)) {
80                  display_message("ERROR: %s", SvPV_nolen( ERRSV ) );                  display_message("ERROR: %s", SvPV_nolen( ERRSV ) );
# Line 89  byte mem(word Addr) { Line 89  byte mem(word Addr) {
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", Addr, byte));
93          return byte;          return byte;
94  }  }
95    
# Line 97  byte Rd6502(register word Addr) { Line 97  byte Rd6502(register word Addr) {
97          byte Value;          byte Value;
98  //      Value = mem(Addr);  //      Value = mem(Addr);
99          Value = 0x42;          Value = 0x42;
100          debugf(("Rd6502(%04x) = %02x\n", Addr, Value));          debugf(("Rd6502(%04x) = %02x", Addr, Value));
101          return Value;          return Value;
102  }  }
103    
104  void Wr6502(register word Addr,register byte Value) {  void Wr6502(register word Addr,register byte Value) {
105          debugf(("Wr6502(%04x,%02x)\n", Addr, Value));          debugf(("Wr6502(%04x,%02x)", Addr, Value));
106          dSP;          dSP;
107          ENTER;          ENTER;
108          SAVETMPS;          SAVETMPS;
# Line 118  void Wr6502(register word Addr,register Line 118  void Wr6502(register word Addr,register
118  byte Op6502(register word Addr) {  byte Op6502(register word Addr) {
119          byte Op;          byte Op;
120          Op = mem(Addr);          Op = mem(Addr);
121          debugf(("Op6502(%04x,%02x) PC:%04x\n", Addr, Op, R->PC.W));          debugf(("Op6502(%04x,%02x) PC:%04x", Addr, Op, R->PC.W));
122          return Op;          return Op;
123  }  }
124    
# Line 133  byte Op6502(register word Addr) { Line 133  byte Op6502(register word Addr) {
133  int hw_int = INT_NONE;  int hw_int = INT_NONE;
134    
135  byte Loop6502(register M6502 *R) {  byte Loop6502(register M6502 *R) {
136          debugf(("Loop6502\n"));          debugf(("Loop6502"));
137          dump_R;          dump_R;
138          return hw_int;          return hw_int;
139  }  }
# Line 146  byte Loop6502(register M6502 *R) { Line 146  byte Loop6502(register M6502 *R) {
146  /** or 0 if the opcode was truly illegal.                   **/  /** or 0 if the opcode was truly illegal.                   **/
147  /************************************ TO BE WRITTEN BY USER **/  /************************************ TO BE WRITTEN BY USER **/
148  byte Patch6502(register byte Op,register M6502 *R) {  byte Patch6502(register byte Op,register M6502 *R) {
149          debugf(("Patch6502(%02x)\n", Op));          debugf(("Patch6502(%02x)", Op));
150          dump_R;          dump_R;
151          hw_int = INT_QUIT;          hw_int = INT_QUIT;
152          return 0;          return 0;

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

  ViewVC Help
Powered by ViewVC 1.1.26