home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / programs / emulaton / trash80 / !Trash80 / c / EmuOpT < prev    next >
Text File  |  1992-08-28  |  1KB  |  66 lines

  1. #include <stdio.h>
  2. #include <string.h>
  3. #include <time.h>
  4.  
  5. #include "bbc.h"
  6.  
  7. #include "general.h"
  8. #include "Externals.h"
  9.  
  10. static BOOL EmuOp0(u_char pfx)
  11. {
  12. switch(pfx)
  13.     {
  14.     case 0x60:
  15.         Reg_A= Reg_B= Reg_C= 0;
  16.         Reg_F|= BITZ;
  17.         Reg_PC= 0x0065;
  18.         return(TRUE);
  19.     case 0xc4:
  20.         Reg_H= Reg_L= 0;
  21.         Reg_F&= ~BITZ;
  22.         Reg_PC= 0x00d4;
  23.         return(TRUE);
  24.     }
  25. return(FALSE);
  26. }
  27.  
  28. static BOOL EmuOp2(u_char pfx)
  29. {
  30. switch(pfx)
  31.     {
  32.     extern u_char Rdk7bit(u_char v);
  33.     extern void Wrk7byte(u_char v);
  34.     case 0x42: /* Read a bit from k7 */
  35.         Reg_A= Rdk7bit(Reg_A);
  36.         Reg_PC= 0x025f;
  37.         return(TRUE);
  38.     case 0x68: /* Write a byte to k7 */
  39.         Wrk7byte(Reg_A);
  40.         Reg_PC= 0x0279;
  41.         return(TRUE);
  42.     }
  43. return(FALSE);
  44. }
  45.  
  46. BOOL (*EmulOp[SIZE_CODE>>8])(u_char pfx) =
  47.     {
  48.     EmuOp0,0,EmuOp2,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0 */
  49.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 1 */
  50.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 2 */
  51.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 3 */
  52.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 4 */
  53.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 5 */
  54.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 6 */
  55.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 7 */
  56.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 8 */
  57.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 9 */
  58.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* a */
  59.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* b */
  60.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* c */
  61.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* d */
  62.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* e */
  63.     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0  /* f */
  64.     };
  65.  
  66.