trunk/src/mess/drivers/c65.c
| r243220 | r243221 | |
| 7 | 7 | Attempt at rewriting the driver ... |
| 8 | 8 | |
| 9 | 9 | TODO: |
| 10 | | - Dies as soon as it enters into DOS ROM (bp 0x9d1a, it never returns due of a bad stack pointer read); |
| 10 | - I need to subtract border color to -1 in order to get blue color (-> register is 6 and blue color is 5 in palette array). |
| 11 | Also top-left logo seems to draw wrong palette for entries 4,5,6,7. CPU core bug? |
| 11 | 12 | |
| 12 | 13 | Note: |
| 13 | 14 | - VIC-4567 will be eventually be added via compile switch, once that I |
| r243220 | r243221 | |
| 80 | 81 | virtual void video_start(); |
| 81 | 82 | private: |
| 82 | 83 | UINT8 m_VIC2_IRQPend, m_VIC2_IRQMask; |
| 83 | | UINT8 m_VIC3_ControlA,m_VIC3_ControlB; |
| 84 | /* 0x20: border color (TODO: different thread?) */ |
| 85 | UINT8 m_VIC2_EXTColor; |
| 86 | /* 0x30: banking + PAL + EXT SYNC */ |
| 87 | UINT8 m_VIC3_ControlA; |
| 88 | /* 0x31: video modes */ |
| 89 | UINT8 m_VIC3_ControlB; |
| 84 | 90 | void PalEntryFlush(UINT8 offset); |
| 85 | 91 | void DMAgicExecute(address_space &space,UINT32 address); |
| 86 | 92 | int inner_x_char(int xoffs); |
| r243220 | r243221 | |
| 105 | 111 | UINT32 c65_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ) |
| 106 | 112 | { |
| 107 | 113 | int y,x; |
| 108 | | |
| 114 | int border_color = (m_VIC2_EXTColor-1) & 0xf; // TODO: -1!? |
| 115 | |
| 109 | 116 | // TODO: border area |
| 110 | 117 | for(y=0;y<m_screen->height();y++) |
| 111 | 118 | { |
| r243220 | r243221 | |
| 122 | 129 | |
| 123 | 130 | //if(cliprect.contains(x, y)) |
| 124 | 131 | |
| 125 | | bitmap.pix16(y, x) = m_palette->pen((enable_dot) ? attr & 0xf : 0); |
| 132 | bitmap.pix16(y, x) = m_palette->pen((enable_dot) ? attr & 0xf : border_color); |
| 126 | 133 | |
| 127 | 134 | |
| 128 | 135 | //gfx->opaque(bitmap,cliprect,tile,0,0,0,x*8,y*8); |
| r243220 | r243221 | |
| 145 | 152 | case 0x12: |
| 146 | 153 | res = (m_screen->vpos() & 0xff); |
| 147 | 154 | return res; |
| 155 | case 0x20: |
| 156 | return m_VIC2_EXTColor; |
| 148 | 157 | case 0x19: |
| 149 | 158 | return m_VIC2_IRQPend; |
| 150 | 159 | case 0x30: |
| r243220 | r243221 | |
| 168 | 177 | case 0x1a: |
| 169 | 178 | m_VIC2_IRQMask = data & 0xf; |
| 170 | 179 | break; |
| 180 | case 0x20: |
| 181 | m_VIC2_EXTColor = data & 0xf; |
| 182 | break; |
| 171 | 183 | /* KEY register, handles vic-iii and vic-ii modes via two consecutive writes |
| 172 | 184 | 0xa5 -> 0x96 vic-iii mode |
| 173 | 185 | any other write vic-ii mode |