Subversion Repositories pentevo

Rev

Rev 391 | Rev 486 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. #ifndef __MAIN_H__
  2. #define __MAIN_H__
  3.  
  4. /**
  5.  * @mainpage  General program for ATMEGA128 ZX Evolution.
  6.  *
  7.  * @section history Revision history
  8.  *
  9.  * @subsection current Current version.
  10.  *
  11.  *  - Add NMI button supporting.
  12.  *  - Fix PS/2 mouse initialization.
  13.  *
  14.  * @subsection ver_2011_05_11 Version 11.05.2011
  15.  *
  16.  * - Direct load UBRR on RS232 mode [if (DLM&0x80)!=0 ]
  17.  * - Control PLL (ICS501M) via PE2,PE3. Set it to 2X.
  18.  *
  19.  * @subsection ver_2011_04_26 Version 26.04.2011
  20.  *
  21.  * - Add RS232 supporting.
  22.  * - Increase delay for reset FPGA (nCONFIG pin) before download it.
  23.  *
  24.  * @subsection ver_2011_04_02 Version 02.04.2011
  25.  *
  26.  * - Add access to 0..EF cells of PC8583.
  27.  * - Fix RTC PC8583 dayweek 0..6 convert to DS12788 dayweek 1..7 and vice versa.
  28.  *
  29.  * @subsection ver_2010_12_07 Version 07.12.2010
  30.  *
  31.  * - Keyboard mapping without using RAM.
  32.  * - Add setting resolution for PS/2 mouse [1..4]
  33.  *   (left and right mouse buttons and pad'*' - default [1], pad'+' - increment, pad'-' - decrement).
  34.  * - Add PS/2 mouse resolution saving to RTC register.
  35.  *
  36.  * @subsection ver_2010_11_29 Version 29.11.2010
  37.  *
  38.  * - "NumLock" switch mode to beeper/pwm or tapeout ("NumLock" led light on tapeout mode).
  39.  * - Create full translation map (0x00-0x7f for extended scan codes).
  40.  *
  41.  * @subsection ver_2010_10_17 Version 17.10.2010
  42.  *
  43.  * - "F9","F10","F11" on PS/2 keyboard not used for reset function.
  44.  * - "F12" on PS/2 keyboard soft/hard reset. Short press (<5sec) - soft reset, long press (5sec) - hard reset.
  45.  * - "Ctrl-Alt-Del" on PS/2 keyboard reset ZX (hard reset). If all keys is mapped to ZX keyboard - function not work.
  46.  * - Create translation map (PS/2 to ZX keyboard) in eeprom (default in progmem).
  47.  * - Fix PS/2 mouse and keyboard send mode (without 'delay' function).
  48.  * - Support load from tape input.
  49.  *
  50.  * @subsection ver_2010_03_30 Version 30.03.2010
  51.  *
  52.  * - Fix fpga load and ZX part init (optimize).
  53.  *
  54.  * @subsection ver_2010_03_28 Version 28.03.2010
  55.  *
  56.  * - Fix PS/2 mouse error handler (analize error and reinit mouse if need it).
  57.  * - Add support for get version info (via Gluk cmos extra registers 0xF0..0xFF).
  58.  * - Optimize sources, some correction (log, fpga load).
  59.  * - Fix PS/2 timeout error handler.
  60.  *
  61.  * @subsection ver_2010_03_24 Version 24.03.2010
  62.  *
  63.  * - Fix Power Led behavior (it off while atx power off).
  64.  * - "Print Screen" PS2 keyboard key set NMI on ZX.
  65.  * - Soft reset (Z80 only) to service (0) page if pressed "softreset" key <5 seconds.
  66.  *
  67.  * @subsection ver_2010_03_10 Version 10.03.2010
  68.  *
  69.  * - Add PS2 keyboard led controlling: "Scroll Lock" led equal VGA mode.
  70.  * - Fix mapping gluk (DS12887) nvram to PCF8583.
  71.  * - Fix Update Flag in register C (emulation Gluk clock).
  72.  * - Add modes register and save/restore it to RTC NVRAM.
  73.  * - Add support for zx (mechanical) keyboard.
  74.  * - Add support for Kempston joystick.
  75.  *
  76.  * @subsection ver_2010_02_04 Version 04.02.2010 - base version (1.00 in SVN).
  77.  *
  78.  */
  79.  
  80. /**
  81.  * @file
  82.  * @brief Main module.
  83.  * @author http://www.nedopc.com
  84.  */
  85.  
  86. /** Common flag register. */
  87. extern volatile UBYTE flags_register;
  88. /** Direction for ps2 mouse data (0 - Receive/1 - Send). */
  89. #define FLAG_PS2MOUSE_DIRECTION 0x01
  90. /** Type of ps2 mouse (0 - classical [3bytes in packet]/1 - msoft [4bytes in packet]). */
  91. #define FLAG_PS2MOUSE_TYPE      0x02
  92. /** Ps2 mouse data for zx (0 - not ready/1 - ready). */
  93. #define FLAG_PS2MOUSE_ZX_READY  0x04
  94. /** Spi interrupt detected (0 - not received/1 - received). */
  95. #define FLAG_SPI_INT            0x08
  96. /** Direction for ps2 keyboard data (0 - Receive/1 - Send). */
  97. #define FLAG_PS2KEYBOARD_DIRECTION  0x10
  98. /** Version type (0 - BaseConf /1 - BootLoader). */
  99. #define FLAG_VERSION_TYPE       0x20
  100. /** Last tape in bit value. */
  101. #define FLAG_LAST_TAPE_VALUE    0x40
  102. /** Hard reset flag (1 - enable hard reset). */
  103. #define FLAG_HARD_RESET         0x80
  104.  
  105. /** Common extension flag register. */
  106. extern volatile UBYTE flags_ex_register;
  107. /** Ps2 mouse command (0 - not/1 - process). */
  108. #define FLAG_EX_PS2MOUSE_CMD    0x01
  109. /** Ps2 keyboard map (0 - default/1 - user). */
  110. #define FLAG_EX_PS2KEYBOARD_MAP 0x02
  111. /** NMI interrupt set (0 - not/1 - set). */
  112. #define FLAG_EX_NMI             0x04
  113.  
  114. /** Common modes register. */
  115. extern volatile UBYTE modes_register;
  116. /** VGA mode (0 - not set/1 - set). */
  117. #define MODE_VGA 0x01
  118. /** Tapeout mode (0 - beeper or pwm mode/1 - tapeout). */
  119. #define MODE_TAPEOUT 0x02
  120.  
  121. /** Data buffer. */
  122. extern UBYTE dbuf[];
  123.  
  124. /** FPGA data index. */
  125. extern volatile ULONG curFpga;
  126.  
  127. /**
  128.  * Writes specified length of buffer to SPI.
  129.  * @param size [in] - size of buffer.
  130.  */
  131. void put_buffer(UWORD size);
  132.  
  133. #endif //__MAIN_H__
  134.