/[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 25 by dpavlin, Mon Jul 30 14:02:31 2007 UTC revision 26 by dpavlin, Mon Jul 30 14:23:22 2007 UTC
# Line 7  static PerlInterpreter *my_perl; Line 7  static PerlInterpreter *my_perl;
7    
8  static M6502 *R;  static M6502 *R;
9    
10  #define dump_R printf("PC: %04x A:%02x P:%02x X:%02x Y:%02x S:%02x", R->PC.W, R->A, R->P, R->X, R->Y, R->S );  #define dump_R printf("# PC: %04x A:%02x P:%02x X:%02x Y:%02x S:%02x\n", R->PC.W, R->A, R->P, R->X, R->Y, R->S );
11    
12  void update_R(M6502 *R) {  void update_R(M6502 *R) {
13          R->A = atoi( SvPV_nolen( get_sv("M6502::A", TRUE) ) );          R->A = atoi( SvPV_nolen( get_sv("M6502::A", FALSE) ) );
14          R->P = atoi( SvPV_nolen( get_sv("M6502::P", TRUE) ) );          R->P = atoi( SvPV_nolen( get_sv("M6502::P", FALSE) ) );
15          R->X = atoi( SvPV_nolen( get_sv("M6502::X", TRUE) ) );          R->X = atoi( SvPV_nolen( get_sv("M6502::X", FALSE) ) );
16          R->Y = atoi( SvPV_nolen( get_sv("M6502::Y", TRUE) ) );          R->Y = atoi( SvPV_nolen( get_sv("M6502::Y", FALSE) ) );
17          R->S = atoi( SvPV_nolen( get_sv("M6502::S", TRUE) ) );          R->S = atoi( SvPV_nolen( get_sv("M6502::S", FALSE) ) );
18          R->PC.W = atoi( SvPV_nolen( get_sv("M6502::PC", TRUE) ) );          R->PC.W = atoi( SvPV_nolen( get_sv("M6502::PC", FALSE) ) );
19          R->IPeriod = atoi( SvPV_nolen( get_sv("M6502::IPeriod", TRUE) ) );          R->IPeriod = atoi( SvPV_nolen( get_sv("M6502::IPeriod", FALSE) ) );
20          // ICount IRequest IAutoReset TrapBadOps Trap Trace          // ICount IRequest IAutoReset TrapBadOps Trap Trace
21          dump_R;          dump_R;
22  }  }
# Line 94  int main(int argc, char **argv) { Line 94  int main(int argc, char **argv) {
94                          printf("can't alloc %d bytes for M6502", sizeof(M6502));                          printf("can't alloc %d bytes for M6502", sizeof(M6502));
95                          exit(1);                          exit(1);
96                  }                  }
97    
98                  update_R(R);                  update_R(R);
99    
100                  printf("reset CPU\n");                  printf("reset CPU\n");
101                  Reset6502(R);                  Reset6502(R);
102                  printf("reset CPU\n");  
103                    printf("call M6502::init\n");
104                    dSP;
105                    PUSHMARK(SP);
106                    call_pv("M6502::init", G_DISCARD | G_NOARGS );
107    
108                    printf("run CPU\n");
109                  Run6502(R);                  Run6502(R);
110    
111          }          }

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

  ViewVC Help
Powered by ViewVC 1.1.26