home *** CD-ROM | disk | FTP | other *** search
/ ftp.whtech.com / ftp.whtech.com.7z / ftp.whtech.com / emulators / v9t9 / linux / sources / V9t9 / source / 9901.h < prev    next >
Encoding:
C/C++ Source or Header  |  2006-10-19  |  1.3 KB  |  53 lines

  1. #ifndef __9901_H__
  2. #define __9901_H__
  3.  
  4. #include "v9t9_types.h"
  5. #include "sound.h"
  6. #include "command.h"
  7.  
  8. #include "centry.h"
  9.  
  10. /*    9901 stuff     */
  11.  
  12. int        setup_9901(void);
  13. void    reset9901(void);
  14.  
  15. void    trigger9901int(u16 mask);    // set specific interrupt level
  16. void    reset9901int(u16 mask);        // reset specific interrupt level
  17. u16        read9901int(void);            // get level of most important interrupt 
  18.  
  19. void    handle9901tick(void);        // keyed off 3.0 MHz / 64 clock
  20.  
  21. void    setclockmode9901(u8 onoff);    // when accessing bit > 15 from CRU
  22.  
  23. #define M_INT_EXT    2    // peripheral
  24. #define M_INT_VDP     4    // VDP
  25. #define M_INT_CLOCK 8    // clock
  26.  
  27. typedef struct hw9901state
  28. {
  29. /*    9901 stuff     */
  30.     u16         int9901;        /* interrupt enable mask */
  31.     u16         currentints;    /* current pending interrupts */
  32.     u16         intlevel;        /* current top-level interrupt */
  33.  
  34.     u8          clockmode;        /* 0=ints enabled, 1=programming clock */
  35.  
  36.     u16         clockinvl;    /* clock interval, 0 to >3FFF */
  37.     u16         timer;        /* countdown timer value (from clockinvl9901 -> 0) */
  38.  
  39.     u16         latchedtimer;    /* timer latch -- inverted */
  40.     u16         latchedclockinvl;    /* clock interval latch -- inverted */
  41.  
  42. }    hw9901state;
  43.  
  44. extern AudioGate   audiogate;        /* audio gate info */
  45.  
  46. extern hw9901state hw9901;
  47.  
  48. DECL_SYMBOL_ACTION(hw9901_machine_state);
  49.  
  50. #include "cexit.h"
  51.  
  52. #endif
  53.