home *** CD-ROM | disk | FTP | other *** search
/ ftp.whtech.com / ftp.whtech.com.tar / ftp.whtech.com / Geneve / 9640news / CAT36 / EMULSRC.ZIP / TI99EMUL.H < prev    next >
Text File  |  1993-04-28  |  3KB  |  115 lines

  1. /* HEADER FILE. This file contains the headers of all functional parts
  2.    of the emulator, including all global variables. */
  3.  
  4. #define GROM_MEMSIZE 0xFFFF
  5. #define CPU_MEMSIZE 0xFFFF
  6. #define VDP_MEMSIZE 0x4000
  7.  
  8. typedef unsigned short int word;
  9. typedef unsigned long  int longword;
  10. typedef unsigned char byte;
  11.  
  12. /* boot.h */
  13.  
  14. void load_roms(char[]);
  15. void load_byte_memory_from_file(byte *,word,char[],word,word);
  16. void load_word_memory_from_file(word *,word,char[],word,word);
  17.  
  18. /* grom.h */
  19.  
  20. void init_grom(void);        /* nescessary initialisations */
  21. word grom_read(word);        /* returns databyte as MSbyte of a word.
  22.                    argument is >9C02 or >9C00 */
  23. void grom_write(word,word);     /* writes MSbyte from word to adress */
  24. word GromAddressCounter=0;      /* The address counter */
  25. byte *grom;            /* The grom memory pointer */
  26.  
  27. /* memory.h */
  28.  
  29. void init_cpu(void);
  30. word memory_read(word);        /* read a 16-bit word from memory */
  31. void memory_write(word,word);    /* write a 16-bit word to memory  */
  32. void vdp_interrupt(void);    /* do some nescessary incs & decs */
  33.  
  34. word     *mem,            /* CPU memory pointer */
  35.     paging=0;        /* 7000-7FFF paging enable flag */
  36.  
  37. /* kscan.h */
  38.  
  39. void KSCAN(void);
  40.  
  41. /* operands.h */
  42.  
  43. word    SourceOpAdr,    /* address in memory of source operand */
  44.     SourceVal,    /* contents of source operand */
  45.     DestOpAdr,    /* address in memory of destination operand */
  46.     DestVal;    /* value of destination operand */
  47.  
  48. void typeIoperands(void);
  49. void typeIIIoperands(void);
  50. void typeIVoperands(void);
  51. void typeVoperands(void);
  52. void typeVIoperands(void);
  53. void typeVIIoperands(void);
  54. void typeVIIIoperands(void);
  55. void typeIXoperands(void);
  56. void typeXoperands(void);
  57. void get_source_operand(void);
  58. void get_dest_operand(void);
  59. word add(word,word);
  60.  
  61. /* processor.h */
  62.  
  63. #define TRUE  1
  64. #define FALSE 0
  65.  
  66. #define R0  WP
  67. #define R11 WP+22
  68. #define R12 WP+24
  69. #define R13 WP+26
  70. #define R14 WP+28
  71. #define R15 WP+30
  72.  
  73. #define CURSOR_SPEED 8
  74.  
  75. void do_jump(void);
  76.  
  77. word     WP,    /* Workspace pointer */
  78.     PC,    /* Program counter */
  79.     STATUS, /* Status register (16 bits) */
  80.     IR,     /* Instruction register */
  81.  
  82.     LGT,AGT,EQ,CY,OV,OP,X,IMASK;    /* the bits in the status reg. */
  83.  
  84. /* status.h */
  85.  
  86. void set_status(word);
  87. void get_status(void);
  88. void set_parity(word);
  89. void compare(word,word);
  90.  
  91. /* vdp.h */
  92.  
  93. #define DEFAULT_VDP_STATUS     00
  94.  
  95. void init_vdp(void);        /* clear screen         */
  96. word vdp_read(word);            /* read data or status         */
  97. void vdp_write(word,word);    /* write address or data     */
  98. void update_crt(byte);        /* write char to screen     */
  99. void vdp_write_to_register(word);    /* change register (dummy) */
  100.  
  101. word VdpAddressCounter=0;    /* Vdp address counter */
  102. byte *vdp;            /* Vdp memory */
  103. word CRT_ROWS,CRT_COLS,CRT_SIZE;
  104.  
  105. /* DSK1.H */
  106.  
  107. void DISK(void);
  108. void DISK_ERROR(word,word);
  109.  
  110. /* SOUND.H */
  111.  
  112. void sound_access(word);
  113. void sound_handler(void);
  114. byte soundbyte(word);
  115.