src/mess/drivers/pasopia.c
| r9015 | r9016 | |
| 23 | 23 | static UINT8 bank_reg; |
| 24 | 24 | static UINT16 cursor_addr; |
| 25 | 25 | static UINT8 cursor_blink,cursor_raster; |
| 26 | | static UINT8 plane_reg,attr_data,attr_wrap,attr_latch,pal_sel,x_width; |
| 26 | static UINT8 plane_reg,attr_data,attr_wrap,attr_latch,pal_sel,x_width,gfx_mode; |
| 27 | 27 | |
| 28 | 28 | #define VDP_CLOCK XTAL_3_579545MHz/4 |
| 29 | 29 | |
| r9015 | r9016 | |
| 220 | 220 | if((plane_reg & 0x44) == 0x44) |
| 221 | 221 | { |
| 222 | 222 | res &= vram[offset | 0x8000]; |
| 223 | | attr_latch = vram[offset | 0xc000]; |
| 224 | | i8255a_w(space->machine->device("ppi8255_0"), 1, (attr_latch << 4) | (attr_latch & 0x7)); |
| 223 | attr_latch = vram[offset | 0xc000] & 0x87; |
| 225 | 224 | } |
| 226 | 225 | |
| 227 | 226 | return res; |
| r9015 | r9016 | |
| 240 | 239 | } |
| 241 | 240 | |
| 242 | 241 | if(plane_reg & 0x10) |
| 243 | | vram[offset | 0x0000] = (plane_reg & 1) ? data : 0xff; |
| 242 | vram[(offset & 0x3fff) | 0x0000] = (plane_reg & 1) ? data : 0xff; |
| 244 | 243 | if(plane_reg & 0x20) |
| 245 | | vram[offset | 0x4000] = (plane_reg & 2) ? data : 0xff; |
| 244 | vram[(offset & 0x3fff) | 0x4000] = (plane_reg & 2) ? data : 0xff; |
| 246 | 245 | if(plane_reg & 0x40) |
| 247 | 246 | { |
| 248 | | vram[offset | 0x8000] = (plane_reg & 4) ? data : 0xff; |
| 247 | vram[(offset & 0x3fff) | 0x8000] = (plane_reg & 4) ? data : 0xff; |
| 249 | 248 | attr_latch = attr_wrap ? attr_latch : attr_data; |
| 250 | | vram[offset | 0xc000] = attr_latch; |
| 251 | | i8255a_w(space->machine->device("ppi8255_0"), 1, (attr_latch << 4) | (attr_latch & 0x7)); |
| 249 | vram[(offset & 0x3fff) | 0xc000] = attr_latch; |
| 252 | 250 | } |
| 253 | 251 | } |
| 254 | 252 | else |
| r9015 | r9016 | |
| 550 | 548 | static READ8_DEVICE_HANDLER( crtc_portb_r ) |
| 551 | 549 | { |
| 552 | 550 | // --x- ---- vsync bit |
| 551 | // ---x ---- lcd dip-sw |
| 553 | 552 | // ---- x--- disp bit |
| 554 | | int lcd_bit = input_port_read(device->machine, "DSW") & 1; |
| 555 | | int vdisp = (device->machine->primary_screen->vpos() < (lcd_bit ? 200 : 28)) ? 0x08 : 0x00; //TODO: check LCD vpos trigger |
| 553 | UINT8 lcd_bit = input_port_read(device->machine, "DSW") & 1; |
| 554 | UINT8 vdisp = (device->machine->primary_screen->vpos() < (lcd_bit ? 200 : 28)) ? 0x08 : 0x00; //TODO: check LCD vpos trigger |
| 555 | UINT8 vsync = vdisp ? 0x00 : 0x20; |
| 556 | 556 | |
| 557 | | return 0xe7 | vdisp | (lcd_bit << 4); |
| 557 | return 0x40 | (attr_latch & 0x87) | vsync | vdisp | (lcd_bit << 4); |
| 558 | 558 | } |
| 559 | 559 | |
| 560 | 560 | static WRITE8_DEVICE_HANDLER( screen_mode_w ) |
| 561 | 561 | { |
| 562 | | if(data & 0xdf) |
| 562 | if(data & 0x7f) |
| 563 | 563 | printf("GFX MODE %02x\n",data); |
| 564 | |
| 564 | 565 | x_width = data & 0x20; |
| 566 | gfx_mode = data & 0x80; |
| 567 | |
| 568 | // printf("%02x\n",gfx_mode); |
| 565 | 569 | } |
| 566 | 570 | |
| 567 | 571 | static WRITE8_DEVICE_HANDLER( plane_reg_w ) |