/[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 86 by dpavlin, Wed Aug 1 22:25:37 2007 UTC revision 87 by dpavlin, Thu Aug 2 11:08:10 2007 UTC
# Line 7  static PerlInterpreter *my_perl; Line 7  static PerlInterpreter *my_perl;
7    
8  static M6502 *R;  static M6502 *R;
9    
 void pull_R(void) {  
         R->A = SvIV( get_sv("M6502::A", FALSE) );  
         R->P = SvIV( get_sv("M6502::P", FALSE) );  
         R->X = SvIV( get_sv("M6502::X", FALSE) );  
         R->Y = SvIV( get_sv("M6502::Y", FALSE) );  
         R->S = SvIV( get_sv("M6502::S", FALSE) );  
         R->PC.W = SvIV( get_sv("M6502::PC", FALSE) );  
         R->IPeriod = SvIV( get_sv("M6502::IPeriod", FALSE) );  
         R->IRequest = SvIV( get_sv("M6502::IRequest", FALSE) );  
         R->IAutoReset = SvIV( get_sv("M6502::IAutoReset", FALSE) );  
         R->TrapBadOps = SvIV( get_sv("M6502::TrapBadOps", FALSE) );  
         R->Trap = SvIV( get_sv("M6502::Trap", FALSE) );  
         R->Trace = SvIV( get_sv("M6502::Trace", FALSE) );  
         printf("pull_R finished\n");  
         dump_R;  
 }  
   
 void push_R(void) {  
         debugf(("push_R"));  
         dSP;  
         ENTER;  
         SAVETMPS;  
         PUSHMARK(SP);  
         XPUSHs( sv_2mortal( newSViv( R->A ) ) );  
         XPUSHs( sv_2mortal( newSViv( R->P ) ) );  
         XPUSHs( sv_2mortal( newSViv( R->X ) ) );  
         XPUSHs( sv_2mortal( newSViv( R->Y ) ) );  
         XPUSHs( sv_2mortal( newSViv( R->S ) ) );  
         XPUSHs( sv_2mortal( newSViv( R->PC.W ) ) );  
         XPUSHs( sv_2mortal( newSViv( R->IPeriod ) ) );  
         XPUSHs( sv_2mortal( newSViv( R->ICount ) ) );  
         XPUSHs( sv_2mortal( newSViv( R->IRequest ) ) );  
         XPUSHs( sv_2mortal( newSViv( R->IAutoReset ) ) );  
         XPUSHs( sv_2mortal( newSViv( R->TrapBadOps ) ) );  
         XPUSHs( sv_2mortal( newSViv( R->Trap ) ) );  
         XPUSHs( sv_2mortal( newSViv( R->Trace ) ) );  
         PUTBACK;  
         call_pv("M6502::push_R", G_DISCARD );  
         debugf(("push_R called"));  
         dump_R;  
         FREETMPS;  
         LEAVE;  
 }  
   
10  byte Debug6502(M6502 *R) {  byte Debug6502(M6502 *R) {
11          dump_R;          dump_R;
12          return 1; // continue emulation          return 1; // continue emulation
# Line 77  byte mem(word Addr) { Line 33  byte mem(word Addr) {
33          count = call_pv("M6502::read", G_ARRAY | G_EVAL );          count = call_pv("M6502::read", G_ARRAY | G_EVAL );
34          debugf(("got %d values", count));          debugf(("got %d values", count));
35          SPAGAIN;          SPAGAIN;
36          if (SvTrue(ERRSV)) {          if (SvTRUE(ERRSV)) {
37                  display_message("ERROR: %s", SvPV_nolen( ERRSV ) );                  printf("ERROR: %s", SvPV_nolen( ERRSV ) );
38                  exit(1);                  exit(1);
39          }          }
40          if ( count != 1 ) {          if ( count != 1 ) {

Legend:
Removed from v.86  
changed lines
  Added in v.87

  ViewVC Help
Powered by ViewVC 1.1.26