src/mess/drivers/pasopia.c
| r8512 | r8513 | |
| 4 | 4 | |
| 5 | 5 | preliminary driver by Angelo Salese |
| 6 | 6 | |
| 7 | TODO: |
| 8 | - cursor seems too slow, missing irqs? |
| 9 | |
| 7 | 10 | ****************************************************************************/ |
| 8 | 11 | |
| 9 | 12 | #include "emu.h" |
| r8512 | r8513 | |
| 16 | 19 | static UINT8 vram_sel; |
| 17 | 20 | static UINT8 *p7_vram; |
| 18 | 21 | static UINT8 bank_reg; |
| 22 | static UINT16 cursor_addr; |
| 23 | static UINT8 cursor_blink; |
| 19 | 24 | |
| 20 | 25 | static VIDEO_START( paso7 ) |
| 21 | 26 | { |
| r8512 | r8513 | |
| 36 | 41 | |
| 37 | 42 | drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0],tile,0,0,0,x*8,y*8); |
| 38 | 43 | |
| 44 | if(((cursor_addr*8) == count) && !cursor_blink) // draw cursor |
| 45 | drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0],0x5f,0,0,0,x*8,y*8); |
| 46 | |
| 39 | 47 | count+=8; |
| 40 | 48 | } |
| 41 | 49 | } |
| 42 | 50 | |
| 43 | | |
| 44 | 51 | return 0; |
| 45 | 52 | } |
| 46 | 53 | |
| r8512 | r8513 | |
| 151 | 158 | cpu[offset] = data; |
| 152 | 159 | } |
| 153 | 160 | |
| 161 | static WRITE8_HANDLER( pasopia7_6845_w ) |
| 162 | { |
| 163 | static int addr_latch; |
| 164 | |
| 165 | if(offset == 0) |
| 166 | { |
| 167 | addr_latch = data; |
| 168 | mc6845_address_w(devtag_get_device(space->machine, "crtc"), 0,data); |
| 169 | } |
| 170 | else |
| 171 | { |
| 172 | /* FIXME: this should be inside the MC6845 core! */ |
| 173 | if(addr_latch == 0x0e) |
| 174 | cursor_addr = ((data<<8) & 0x3f00) | (cursor_addr & 0xff); |
| 175 | else if(addr_latch == 0x0f) |
| 176 | cursor_addr = (cursor_addr & 0x3f00) | (data & 0xff); |
| 177 | |
| 178 | mc6845_register_w(devtag_get_device(space->machine, "crtc"), 0,data); |
| 179 | } |
| 180 | } |
| 181 | |
| 182 | |
| 154 | 183 | static ADDRESS_MAP_START(paso7_mem, ADDRESS_SPACE_PROGRAM, 8) |
| 155 | 184 | ADDRESS_MAP_UNMAP_HIGH |
| 156 | 185 | AM_RANGE( 0x0000, 0x7fff ) AM_WRITE( ram_bank_w ) |
| r8512 | r8513 | |
| 165 | 194 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 166 | 195 | AM_RANGE( 0x08, 0x0b ) AM_DEVREADWRITE("ppi8255_0", i8255a_r, i8255a_w) |
| 167 | 196 | AM_RANGE( 0x0c, 0x0f ) AM_DEVREADWRITE("ppi8255_1", i8255a_r, i8255a_w) |
| 168 | | AM_RANGE( 0x10, 0x10 ) AM_DEVWRITE("crtc", mc6845_address_w) |
| 169 | | AM_RANGE( 0x11, 0x11 ) AM_DEVWRITE("crtc", mc6845_register_w) |
| 197 | AM_RANGE( 0x10, 0x11 ) AM_WRITE(pasopia7_6845_w) |
| 170 | 198 | AM_RANGE( 0x18, 0x1b ) AM_READWRITE( pac2_r, pac2_w ) |
| 171 | 199 | AM_RANGE( 0x20, 0x23 ) AM_DEVREADWRITE("ppi8255_2", i8255a_r, i8255a_w) |
| 172 | 200 | AM_RANGE( 0x28, 0x2b ) AM_DEVREADWRITE("ctc", z80ctc_r, z80ctc_w) |
| r8512 | r8513 | |
| 270 | 298 | static WRITE8_DEVICE_HANDLER( video_misc_w ) |
| 271 | 299 | { |
| 272 | 300 | /* |
| 273 | | else if(id == SIG_MEMORY_I8255_1_C) |
| 274 | | attr_wrap = (data & 0x10) ? true : false; |
| 275 | | pal_sel = (data & 0xc) ? true : false; |
| 276 | 301 | --x- ---- blinking |
| 277 | 302 | ---x ---- attribute wrap |
| 278 | 303 | ---- x--- pal disable |
| 279 | 304 | ---- xx-- palette selector (both bits enables this, odd hook-up) |
| 280 | 305 | */ |
| 281 | 306 | // printf("VIDEO MISC REG %02x\n",data); |
| 307 | cursor_blink = data & 0x20; |
| 308 | |
| 282 | 309 | } |
| 283 | 310 | |
| 284 | 311 | static WRITE8_DEVICE_HANDLER( nmi_mask_w ) |