/[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 40 by dpavlin, Tue Jul 31 08:41:06 2007 UTC revision 42 by dpavlin, Tue Jul 31 09:37:01 2007 UTC
# Line 5  Line 5 
5    
6  #if DEBUGF  #if DEBUGF
7  #define debugf(x)  do {         \  #define debugf(x)  do {         \
8            PerlIO_stdoutf("#> ");  \
9          PerlIO_stdoutf x ;      \          PerlIO_stdoutf x ;      \
10  } while (0)  } while (0)
11  #else  #else
# Line 121  byte Op6502(register word Addr) { Line 122  byte Op6502(register word Addr) {
122  /** INT_NONE, INT_IRQ, INT_NMI, or INT_QUIT to exit the     **/  /** INT_NONE, INT_IRQ, INT_NMI, or INT_QUIT to exit the     **/
123  /** emulation loop.                                         **/  /** emulation loop.                                         **/
124  /************************************ TO BE WRITTEN BY USER **/  /************************************ TO BE WRITTEN BY USER **/
125    
126    int hw_int = INT_NONE;
127    
128  byte Loop6502(register M6502 *R) {  byte Loop6502(register M6502 *R) {
129          debugf(("Loop6502\n"));          debugf(("Loop6502\n"));
130          dump_R;          dump_R;
131          return INT_NONE;          return hw_int;
132  }  }
133    
134  /** Patch6502() **********************************************/  /** Patch6502() **********************************************/
# Line 172  int main(int argc, char **argv) { Line 176  int main(int argc, char **argv) {
176                  PUSHMARK(SP);                  PUSHMARK(SP);
177                  call_pv("Arch::init", G_DISCARD | G_NOARGS );                  call_pv("Arch::init", G_DISCARD | G_NOARGS );
178    
179                  pull_R(R);                  int cycles = 1;
180                  int cycles = SvIV( get_sv("M6502::run_for", FALSE) );                  while ( cycles ) {
181                  printf("run CPU for %d cycles\n", cycles);                          call_pv("Arch::cli", G_DISCARD | G_NOARGS );
182                  dump_R;                          pull_R(R);
183                  //Run6502(R);                          cycles = SvIV( get_sv("M6502::run_for", FALSE) );
184                  Exec6502(R, cycles);                          printf("run CPU for %d cycles\n", cycles);
185                  dump_R;                          dump_R;
186                  push_R(R);                          //Run6502(R);
187                  printf("end of CPU run\n");                          Exec6502(R, cycles);
188                            dump_R;
189                            push_R(R);
190                            printf("end of %d cycles CPU run\n", cycles);
191                    }
192          }          }
193          free(R);          free(R);
194          perl_destruct(my_perl);          perl_destruct(my_perl);

Legend:
Removed from v.40  
changed lines
  Added in v.42

  ViewVC Help
Powered by ViewVC 1.1.26