src/mess/video/i82720cm.h
| r5991 | r5992 | |
| 1 | | /****************************************************************************** |
| 2 | | |
| 3 | | i82720cm.h |
| 4 | | Video driver for the Intel 82720 and NEC uPD7220 GDC. |
| 5 | | |
| 6 | | Per Ola Ingvarsson |
| 7 | | Tomas Karlsson |
| 8 | | |
| 9 | | ******************************************************************************/ |
| 10 | | |
| 11 | | enum I82720_GDC_COMMANDS |
| 12 | | { |
| 13 | | /* Video control commands */ |
| 14 | | CMD_RESET = 0x00, /* Resets the GDC to its idle mode */ |
| 15 | | CMD_SYNC_OFF = 0x0e, /* Specifies the video format and disables the display */ |
| 16 | | CMD_SYNC_ON = 0x0f, /* Specifies the video format and enables the display */ |
| 17 | | CMD_VSYNC_SLAVE = 0x6e, /* Selects slave video synchronization mode */ |
| 18 | | CMD_VSYNC_MASTER = 0x6f, /* Selects master video synchronization mode */ |
| 19 | | CMD_CCHAR = 0x4b, /* Specifies the cursor and character row heights */ |
| 20 | | |
| 21 | | /* Display control commands */ |
| 22 | | CMD_START = 0x6b, /* Ends idle mode and unblanks the display */ |
| 23 | | CMD_BCTRL_OFF = 0x0c, /* Controls the blanking and unblanking of the display */ |
| 24 | | CMD_BCTRL_ON = 0x0d, /* Controls the blanking and unblanking of the display */ |
| 25 | | CMD_ZOOM = 0x46, /* Specifies zoom factors for the display and graphics characters writing */ |
| 26 | | CMD_CURS = 0x49, /* Sets the position of the cursor in display memory */ |
| 27 | | CMD_PRAM_BITMASK = 0x70, /* Defines starting addresses and lengths of the display areas and specifies the eight bytes for the graphics character */ |
| 28 | | CMD_PITCH = 0x47, /* Specifies the width of the X dimension of the display memory */ |
| 29 | | |
| 30 | | /* Drawing control commands */ |
| 31 | | CMD_WDAT_BITMASK = 0x20, /* Writes data words or bytes into display memory */ |
| 32 | | CMD_MASK = 0x4a, /* Sets the MASK register contents */ |
| 33 | | CMD_FIGS = 0x4c, /* Specifies the parameters for the drawing processor */ |
| 34 | | CMD_FIGD = 0x6c, /* Draws the figure as specified above */ |
| 35 | | CMD_GCHRD = 0x68, /* Draws the graphics character into display */ |
| 36 | | |
| 37 | | /* Memory data read commands */ |
| 38 | | CMD_RDAT_BITMASK = 0xa0, /* Reads data words or bytes from display */ |
| 39 | | CMD_CURD = 0xe0, /* Reads the cursor position */ |
| 40 | | CMD_LPRD = 0xc0, /* Reads the light pen address */ |
| 41 | | |
| 42 | | /* Data control commands */ |
| 43 | | CMD_DMAR_BITMASK = 0xa4, /* Requests a DMA read transfer */ |
| 44 | | CMD_DMAW_BITMASK = 0x24 /* Requests a DMA write transfer */ |
| 45 | | }; |
| 46 | | |
| 47 | | |
| 48 | | enum I82720_GDC_STATUS |
| 49 | | |
| 50 | | { |
| 51 | | |
| 52 | | /* Status register flags */ |
| 53 | | |
| 54 | | GDC_DATA_READY = 0x01, /* Data ready */ |
| 55 | | |
| 56 | | GDC_FIFO_FULL = 0x02, /* FIFO full */ |
| 57 | | |
| 58 | | GDC_FIFO_EMPTY = 0x04, /* FIFO empty */ |
| 59 | | |
| 60 | | GDC_DRAWING = 0x08, /* Drawing in progress */ |
| 61 | | |
| 62 | | GDC_DMA_EXEC = 0x10, /* DMA execute */ |
| 63 | | |
| 64 | | GDC_VSYNC = 0x20, /* Vertical sync active */ |
| 65 | | |
| 66 | | GDC_HBLANK = 0x40, /* Horizontal blanking active */ |
| 67 | | |
| 68 | | GDC_LIGHT_PEN = 0x80 /* Light pen detect */ |
| 69 | | |
| 70 | | }; |
| 71 | | |
src/mess/video/i82720.c
| r5991 | r5992 | |
| 14 | 14 | |
| 15 | 15 | #include "driver.h" |
| 16 | 16 | #include "i82720.h" |
| 17 | | #include "i82720cm.h" |
| 18 | 17 | #include "memconv.h" |
| 19 | 18 | #include <math.h> |
| 20 | 19 | |
| r5991 | r5992 | |
| 30 | 29 | #define VERBOSE 1 |
| 31 | 30 | #define LOG(x) do { if (VERBOSE) logerror x; } while (0) |
| 32 | 31 | |
| 32 | |
| 33 | enum I82720_GDC_COMMANDS |
| 34 | { |
| 35 | /* Video control commands */ |
| 36 | CMD_RESET = 0x00, /* Resets the GDC to its idle mode */ |
| 37 | CMD_SYNC_OFF = 0x0e, /* Specifies the video format and disables the display */ |
| 38 | CMD_SYNC_ON = 0x0f, /* Specifies the video format and enables the display */ |
| 39 | CMD_VSYNC_SLAVE = 0x6e, /* Selects slave video synchronization mode */ |
| 40 | CMD_VSYNC_MASTER = 0x6f, /* Selects master video synchronization mode */ |
| 41 | CMD_CCHAR = 0x4b, /* Specifies the cursor and character row heights */ |
| 42 | |
| 43 | /* Display control commands */ |
| 44 | CMD_START = 0x6b, /* Ends idle mode and unblanks the display */ |
| 45 | CMD_BCTRL_OFF = 0x0c, /* Controls the blanking and unblanking of the display */ |
| 46 | CMD_BCTRL_ON = 0x0d, /* Controls the blanking and unblanking of the display */ |
| 47 | CMD_ZOOM = 0x46, /* Specifies zoom factors for the display and graphics characters writing */ |
| 48 | CMD_CURS = 0x49, /* Sets the position of the cursor in display memory */ |
| 49 | CMD_PRAM_BITMASK = 0x70, /* Defines starting addresses and lengths of the display areas and specifies the eight bytes for the graphics character */ |
| 50 | CMD_PITCH = 0x47, /* Specifies the width of the X dimension of the display memory */ |
| 51 | |
| 52 | /* Drawing control commands */ |
| 53 | CMD_WDAT_BITMASK = 0x20, /* Writes data words or bytes into display memory */ |
| 54 | CMD_MASK = 0x4a, /* Sets the MASK register contents */ |
| 55 | CMD_FIGS = 0x4c, /* Specifies the parameters for the drawing processor */ |
| 56 | CMD_FIGD = 0x6c, /* Draws the figure as specified above */ |
| 57 | CMD_GCHRD = 0x68, /* Draws the graphics character into display */ |
| 58 | |
| 59 | /* Memory data read commands */ |
| 60 | CMD_RDAT_BITMASK = 0xa0, /* Reads data words or bytes from display */ |
| 61 | CMD_CURD = 0xe0, /* Reads the cursor position */ |
| 62 | CMD_LPRD = 0xc0, /* Reads the light pen address */ |
| 63 | |
| 64 | /* Data control commands */ |
| 65 | CMD_DMAR_BITMASK = 0xa4, /* Requests a DMA read transfer */ |
| 66 | CMD_DMAW_BITMASK = 0x24 /* Requests a DMA write transfer */ |
| 67 | }; |
| 68 | |
| 69 | enum I82720_GDC_STATUS |
| 70 | { |
| 71 | /* Status register flags */ |
| 72 | GDC_DATA_READY = 0x01, /* Data ready */ |
| 73 | GDC_FIFO_FULL = 0x02, /* FIFO full */ |
| 74 | GDC_FIFO_EMPTY = 0x04, /* FIFO empty */ |
| 75 | GDC_DRAWING = 0x08, /* Drawing in progress */ |
| 76 | GDC_DMA_EXEC = 0x10, /* DMA execute */ |
| 77 | GDC_VSYNC = 0x20, /* Vertical sync active */ |
| 78 | GDC_HBLANK = 0x40, /* Horizontal blanking active */ |
| 79 | GDC_LIGHT_PEN = 0x80 /* Light pen detect */ |
| 80 | }; |
| 81 | |
| 33 | 82 | /* FIFO */ |
| 34 | 83 | typedef struct |
| 35 | 84 | { |