Subversion Repositories pentevo

Rev

Blame | Last modification | View Log | Download | RSS feed | ?url?

  1. #pragma once
  2. #include "sndrender/emul_2203.h"
  3. #include "sndrender/sndchip.h"
  4. #include "sndrender/saa1099.h"
  5.  
  6. #define ROMLED_TIME 16
  7.  
  8. //=============================================================================
  9. #pragma pack(8)
  10. struct PALETTE_OPTIONS
  11. { // custom palettes
  12.     char name[ 33];
  13.     unsigned ZZ,ZN,NN,NB,BB,ZB;
  14.     unsigned r11,r12,r13,r21,r22,r23,r31,r32,r33;
  15. };
  16. //=============================================================================
  17. #pragma pack()
  18. enum
  19. {
  20.     VK_LMB = 0x101,
  21.     VK_RMB,
  22.     VK_MMB,
  23.     VK_MWU,
  24.     VK_MWD,
  25.     VK_JLEFT,
  26.     VK_JRIGHT,
  27.     VK_JUP,
  28.     VK_JDOWN,
  29.     VK_JFIRE,
  30.     VK_JB0 = VK_JFIRE,
  31.     VK_JB1,
  32.     VK_JB2,
  33.     VK_JB3,
  34.     VK_JB4,
  35.     VK_JB5,
  36.     VK_JB6,
  37.     VK_JB7,
  38.     VK_JB8,
  39.     VK_JB9,
  40.     VK_JB10,
  41.     VK_JB11,
  42.     VK_JB12,
  43.     VK_JB13,
  44.     VK_JB14,
  45.     VK_JB15,
  46.     VK_JB16,
  47.     VK_JB17,
  48.     VK_JB18,
  49.     VK_JB19,
  50.     VK_JB20,
  51.     VK_JB21,
  52.     VK_JB22,
  53.     VK_JB23,
  54.     VK_JB24,
  55.     VK_JB25,
  56.     VK_JB26,
  57.     VK_JB27,
  58.     VK_JB28,
  59.     VK_JB29,
  60.     VK_JB30,
  61.     VK_JB31,
  62.     DIK_MENU,
  63.     DIK_CONTROL,
  64.     DIK_SHIFT,
  65.     VK_MAX
  66. };
  67. //=============================================================================
  68. // unsigned char membits[]
  69. enum
  70. {
  71.     MEMBITS_R = 0x01,           // ЇръЄ юсЁр∙хэш 
  72.     MEMBITS_W = 0x02,
  73.     MEMBITS_X = 0x04,
  74.     // Free
  75.     MEMBITS_BPR = 0x10,         // сЁ ъ
  76.     MEMBITS_BPW = 0x20,
  77.     MEMBITS_BPX = 0x40
  78.     // Free
  79. };
  80. //-----------------------------------------------------------------------------
  81. // unsigned char io_bits[]                                      // [NS]
  82. enum   
  83. {
  84.     IO_BITS_IN = 0x01,          // ЇръЄ юсЁр∙хэшх
  85.     IO_BITS_OUT = 0x02,
  86.     // Free
  87.     // Free
  88.     IO_BITS_BP_IN = 0x10,       // сЁ ъ
  89.     IO_BITS_BP_OUT = 0x20
  90.     // Free
  91.     // Free
  92. };
  93. //-----------------------------------------------------------------------------
  94. // unsigned char bp_disable_bits                                // [NS]
  95. enum
  96. {
  97.     BP_DISABLE_BPR = 0x01,
  98.     BP_DISABLE_BPW = 0x02,
  99.     BP_DISABLE_BPX = 0X04,
  100.     // Free
  101.     BP_DISABLE_BP_IN = 0x10,
  102.     BP_DISABLE_BP_OUT = 0x20
  103.     // Free
  104.     // Free
  105. };
  106. //=============================================================================
  107. struct GDIBMP
  108. {
  109.    BITMAPINFO header;
  110.    RGBQUAD waste[0x100];
  111. };
  112. //=============================================================================
  113. class TMainZ80 : public Z80
  114. {
  115. public:
  116.     TMainZ80(   u32 Idx,
  117.                 TBankNames BankNames,
  118.                 TStep Step,
  119.                 TDelta Delta,
  120.                 TSetLastT SetLastT,
  121.                   u8 *membits,
  122.                   u8 *io_bits,          // [NS]
  123.                   u8 *bp_disable_bits,  // [NS]
  124.                 const TMemIf *FastMemIf,
  125.                 const TMemIf *DbgMemIf
  126.             ) : Z80(    Idx,
  127.                         BankNames,
  128.                         Step,
  129.                         Delta,
  130.                         SetLastT,
  131.                           membits,              //
  132.                           io_bits,              // [NS]
  133.                           bp_disable_bits,      // [NS]
  134.                         FastMemIf,
  135.                         DbgMemIf ) { }
  136. /*
  137.     virtual unsigned char rm(unsigned addr) override;
  138.     virtual unsigned char dbgrm(unsigned addr) override;
  139.     virtual void wm(unsigned addr, unsigned char val) override;
  140.     virtual void dbgwm(unsigned addr, unsigned char val) override;
  141. */
  142.     virtual u8 *DirectMem( unsigned addr) const override; // get direct memory pointer in debuger
  143.  
  144.     virtual unsigned char m1_cycle() override;
  145.     virtual unsigned char in( unsigned port) override;
  146.     virtual void out( unsigned port, unsigned char val) override;
  147.     virtual u8 IntVec() override;
  148.     virtual void CheckNextFrame() override;
  149.     virtual void retn() override;
  150. };
  151. //=============================================================================
  152. extern PALETTE_OPTIONS pals[ 32];
  153.  
  154. extern CONFIG conf;
  155. extern COMPUTER comp;
  156. extern unsigned char memory[];
  157.  
  158. extern unsigned char cmos[ 0x100];
  159. extern unsigned char nvram[ 0x800];
  160.  
  161. extern char ininame[ 0x200];
  162. extern char helpname[ 0x200];
  163.  
  164. extern unsigned num_ula;
  165. extern char *ulapreset[ 64];
  166. extern char *setptr;
  167.  
  168. extern char *aystereo[ 64];
  169. extern char *ayvols[ 64];
  170. extern unsigned num_ayvols;
  171. extern unsigned num_aystereo;
  172.  
  173. extern DWORD WinVerMajor;
  174. extern DWORD WinVerMinor;
  175.  
  176. extern HWND wnd;
  177. extern HWND dlg;
  178. extern HINSTANCE hIn;
  179. extern unsigned nowait;
  180.  
  181. extern action ac_main[];
  182. extern action ac_main_xt[];
  183. extern action ac_mon[];         // [NS] р ¤ЄюЄ эрсюЁ шчэрўры№эю тшфшью ш с√ы юЄфхы№эю
  184. extern action ac_regs[];
  185. extern action ac_trace[];
  186. extern action ac_mem[];
  187. extern RENDER renders[];
  188. extern VOID_FUNC prebuffers[];
  189.  
  190. extern const TMemModel mem_model[ N_MM_MODELS];
  191.  
  192. extern zxkeymap zxk_maps[];
  193. extern const size_t zxk_maps_count;
  194.  
  195. extern virtkeyt pckeys[];
  196. extern const size_t pckeys_count;
  197.  
  198. extern keyports inports[VK_MAX];
  199.  
  200. extern unsigned trd_toload;     // drive to load
  201. extern unsigned DefaultDrive;   // ─шёъютюф яю єьюыўрэш■ т ъюЄюЁ√щ уЁєч Єё  юсЁрч√ фшёъют яЁш ёЄрЁЄх
  202.  
  203. extern unsigned char *base_sos_rom;
  204. extern unsigned char *base_dos_rom;
  205. extern unsigned char *base_128_rom;
  206. extern unsigned char *base_sys_rom;
  207.  
  208. extern ISA_MODEM modem;
  209. extern K_INPUT input;
  210.  
  211. extern unsigned brk_port_in;
  212. extern unsigned brk_port_out;
  213. extern unsigned char brk_port_val;
  214.  
  215. extern uintptr_t watch_script[4][64];
  216. extern unsigned char watch_enabled[4];
  217. extern unsigned char used_banks[ MAX_PAGES];
  218. extern unsigned char trace_rom;
  219. extern unsigned char trace_ram;
  220.  
  221. extern TMainZ80 cpu;
  222. extern unsigned char dbgbreak;
  223. extern unsigned char snbuf[ 4*1048576]; // large temporary buffer (for reading snapshots)
  224. extern unsigned char gdibuf[ 2*1048576];
  225. //ётющ сєЇхЁ фы  фхсрухЁр
  226. extern unsigned char gdi_dbg_buf[ 2*1048576];   // [NS]
  227.  
  228.  
  229. extern SNDCHIP ay[ 2];
  230.  
  231. extern unsigned char *bankr[ 4];
  232. extern unsigned char *bankw[ 4];
  233.  
  234. #ifdef MOD_GSBASS
  235. extern GSHLE gs;
  236. #endif
  237.  
  238. extern GDIBMP gdibmp;
  239. extern GDIBMP gdi_dbg_bmp;      // юЄфхы№э√щ фы  фхсрухЁр [NS]
  240.  
  241. extern unsigned char needclr;           // clear screenbuffer before rendering (фы  фхсрухЁр)
  242.  
  243. //-----------------------------------------------------------------------------
  244. extern DWORD mousepos;  // left-clicked point in monitor
  245.                         // 0x80000000 шёяюы№чєхЄёю ъръшьш Єю є°ыхяърьш
  246.                         // ъръ right click Їыру
  247.                         // эєцэю чрьхэшЄ№ эр debug_mouse_keys тхчфх
  248.                        
  249. extern DWORD debug_mouse_keys;  
  250.  
  251. #define DEBUG_MOUSE_LEFT_RES    0xFFFFFFF0      //     
  252. #define DEBUG_MOUSE_LEFT_ON     0x00000001      // left on              [NS]
  253. #define DEBUG_MOUSE_LEFT_DBL    0x00000002      // left double
  254. #define DEBUG_MOUSE_LEFT_OFF    0x00000004      // left off
  255. //                              0x00000008      //      
  256. #define DEBUG_MOUSE_RIGHT_RES   0xFFFFFF0F      //     
  257. #define DEBUG_MOUSE_RIGHT_ON    0x00000010      // right on
  258. #define DEBUG_MOUSE_RIGHT_DBL   0x00000020      // right double
  259. #define DEBUG_MOUSE_RIGHT_OFF   0x00000040      // right off
  260. //                              0x00000080      //
  261. #define DEBUG_MOUSE_MIDDLE_RES  0xFFFFF0FF      //     
  262. #define DEBUG_MOUSE_MIDDLE_ON   0x00000100      // middle on
  263. #define DEBUG_MOUSE_MIDDLE_DBL  0x00000200      // middle double
  264. #define DEBUG_MOUSE_MIDDLE_OFF  0x00000400      // middle off
  265. //                              0x00000800
  266. //-----------------------------------------------------------------------------
  267. extern PALETTEENTRY syspalette[ 0x100];
  268. extern unsigned char exitflag;          // avoid call exit() twice
  269.  
  270. #define PLAYBUFSIZE 16384
  271. extern unsigned sndplaybuf[PLAYBUFSIZE];
  272. extern unsigned spbsize;
  273. extern unsigned char savesndtype;       // 0-none
  274.                                         // 1-wave
  275.                                         // 2-vtx
  276. extern FILE *savesnd;
  277.  
  278. extern HBITMAP hbm;  // bitmap for repaint background
  279. extern DWORD bm_dx;
  280. extern DWORD bm_dy;
  281.  
  282. extern char droppedFile[ 512];
  283.  
  284. extern char statusline[ 128];
  285. extern unsigned statcnt;
  286.  
  287. extern bool normal_exit;
  288.  
  289. extern const char * const ay_schemes[];
  290.  
  291. //=============================================================================
  292. #ifdef MOD_GSZ80
  293. extern class TGsZ80 gscpu;
  294.  
  295. namespace z80gs
  296. {
  297.     extern SNDRENDER sound;
  298.     extern u8 membits[];
  299.     extern u8 io_bits[];                // [NS]
  300.     extern u8 bp_disable_bits[];        // [NS]
  301. }
  302. #endif
  303. //=============================================================================
  304.  
  305. extern ATA_PORT hdd;            // not in `comp' - not cleared in reset()
  306. extern char arcbuffer[0x2000];  // extensions and command lines for archivers
  307. extern char skiparc[0x400];     // ignore this files in archive
  308. extern char trd_loaded[4];      // used to get first free drive with no account of autoloaded images
  309.  
  310. extern unsigned char kbdpc[VK_MAX];                     // add cells for mouse & joystick
  311. extern unsigned char kbdpc_prev[ VK_MAX];       // thims zxevo_ps/2 NEDOREPO
  312. extern unsigned char kbdpcEX[6];                        // Dexus
  313.  
  314. extern char pressedit;          // Alone Coder
  315. extern int fmsoundon0;          // Alone Coder
  316. extern int tfmstatuson0;        // Alone Coder
  317.  
  318. //=============================================================================
  319. // for leds
  320. extern unsigned char trdos_load;
  321. extern unsigned char trdos_save;
  322. extern unsigned char trdos_format;
  323. extern unsigned char trdos_seek;
  324.  
  325. extern unsigned char membits[ 0x10000];         // фы  сЁ ъют ш ьхьюЁш схэфр
  326. extern unsigned char io_bits[ 0x10000];         // фы  IO [NS]
  327. extern unsigned char bp_disable_bits[ 0x10000]; // фы  юЄъы■ўхэш  сЁ ъют [NS]
  328.  
  329. //=============================================================================
  330. extern unsigned char *vtxbuf;
  331. extern unsigned vtxbufsize;
  332. extern unsigned vtxbuffilled;
  333. //=============================================================================
  334. extern unsigned snapsize;
  335.  
  336.  
  337.  
  338. extern int trdos_in_nmi;        // NEDOREPO
  339.  
  340. //=============================================================================
  341.