Subversion Repositories pentevo

Rev

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

  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.  * - "F9","F10","F11" on PS/2 keyboard not used for reset function.
  12.  * - "F12" on PS/2 keyboard soft/hard reset. Short press (<5sec) - soft reset, long press (5sec) - hard reset.
  13.  * - "Ctrl-Alt-Del" on PS/2 keyboard reset ZX (hard reset). If all keys is mapped to ZX keyboard - function not work.
  14.  * - Create translating map (PS/2 to ZX keyboard) in eeprom (default in progmem).
  15.  * - Fix PS/2 mouse and keyboard send mode (without 'delay' function).
  16.  * - Support load from tape input.
  17.  *
  18.  * @subsection ver_2010_03_30 Version 30.03.2010
  19.  *
  20.  * - Fix fpga load and ZX part init (optimize).
  21.  *
  22.  * @subsection ver_2010_03_28 Version 28.03.2010
  23.  *
  24.  * - Fix PS/2 mouse error handler (analize error and reinit mouse if need it).
  25.  * - Add support for get version info (via Gluk cmos extra registers 0xF0..0xFF).
  26.  * - Optimize sources, some correction (log, fpga load).
  27.  * - Fix PS/2 timeout error handler.
  28.  *
  29.  * @subsection ver_2010_03_24 Version 24.03.2010
  30.  *
  31.  * - Fix Power Led behavior (it off while atx power off).
  32.  * - "Print Screen" PS2 keyboard key set NMI on ZX.
  33.  * - Soft reset (Z80 only) to service (0) page if pressed "softreset" key <5 seconds.
  34.  *
  35.  * @subsection ver_2010_03_10 Version 10.03.2010
  36.  *
  37.  * - Add PS2 keyboard led controlling: "Scroll Lock" led equal VGA mode.
  38.  * - Fix mapping gluk (DS12887) nvram to PCF8583.
  39.  * - Fix Update Flag in register C (emulation Gluk clock).
  40.  * - Add modes register and save/restore it to RTC NVRAM.
  41.  * - Add support for zx (mechanical) keyboard.
  42.  * - Add support for Kempston joystick.
  43.  *
  44.  * @subsection ver_2010_02_04 Version 04.02.2010 - base version (1.00 in SVN).
  45.  *
  46.  */
  47.  
  48. /**
  49.  * @file
  50.  * @brief Main module.
  51.  * @author http://www.nedopc.com
  52.  */
  53.  
  54. /** Common flag register. */
  55. extern volatile UBYTE flags_register;
  56. /** Direction for ps2 mouse data (0 - Receive/1 - Send). */
  57. #define FLAG_PS2MOUSE_DIRECTION 0x01
  58. /** Type of ps2 mouse (0 - classical [3bytes in packet]/1 - msoft [4bytes in packet]). */
  59. #define FLAG_PS2MOUSE_TYPE      0x02
  60. /** Ps2 mouse data for zx (0 - not ready/1 - ready). */
  61. #define FLAG_PS2MOUSE_ZX_READY  0x04
  62. /** Spi interrupt detected (0 - not received/1 - received). */
  63. #define FLAG_SPI_INT            0x08
  64. /** Direction for ps2 keyboard data (0 - Receive/1 - Send). */
  65. #define FLAG_PS2KEYBOARD_DIRECTION  0x10
  66. /** Version type (0 - BaseConf /1 - BootLoader). */
  67. #define FLAG_VERSION_TYPE       0x20
  68. /** Last tape in bit value. */
  69. #define FLAG_LAST_TAPE_VALUE    0x40
  70. /** Hard reset flag (1 - enable hard reset). */
  71. #define FLAG_HARD_RESET         0x80
  72.  
  73. /** Common modes register. */
  74. extern volatile UBYTE modes_register;
  75. /** VGA mode (0 - not set/1 - set). */
  76. #define MODE_VGA 0x01
  77.  
  78. /** Data buffer. */
  79. extern UBYTE dbuf[];
  80.  
  81. /** FPGA data index. */
  82. extern volatile ULONG curFpga;
  83.  
  84. /**
  85.  * Writes specified length of buffer to SPI.
  86.  * @param size [in] - size of buffer.
  87.  */
  88. void put_buffer(UWORD size);
  89.  
  90. #endif //__MAIN_H__
  91.