/*************************************************************************** z88.c Functions to emulate the video hardware of the Cambridge Z88 ***************************************************************************/ #include "includes/z88.h" inline void z88_state::plot_pixel(bitmap_ind16 &bitmap, int x, int y, UINT16 color) { if (x>3); y++) { int x = 0, c = 0; while (x < Z88_SCREEN_WIDTH) { UINT16 pen0, pen1; UINT8 *char_gfx; UINT8 byte0 = vram[(y * 0x100) + c]; UINT8 byte1 = vram[(y * 0x100) + c + 1]; // inverted graphics? if (byte1 & Z88_SCR_HW_REV) { pen0 = (byte1 & Z88_SCR_HW_GRY) ? 2 : 1; pen1 = 0; } else { pen0 = 0; pen1 = (byte1 & Z88_SCR_HW_GRY) ? 2 : 1; } if ((byte1 & Z88_SCR_HW_NULL) == Z88_SCR_HW_NULL) { // hidden } else if (!(byte1 & Z88_SCR_HW_HRS) || (((byte1 & Z88_SCR_HW_CURS) == Z88_SCR_HW_CURS))) { // low-res 6x8 UINT16 ch = (byte0 | (byte1<<8)) & 0x1ff; if ((ch & 0x01c0) == 0x01c0) { ch &= 0x3f; char_gfx = convert_address(lores0<<9); } else { char_gfx = convert_address(lores1<<12); } char_gfx += (ch<<3); // cursor flash if (flash && (byte1 & Z88_SCR_HW_CURS) == Z88_SCR_HW_CURS) vh_render_6x8(bitmap, x,(y<<3), pen1, pen0, char_gfx); else vh_render_6x8(bitmap, x,(y<<3), pen0, pen1, char_gfx); // underline? if (byte1 & Z88_SCR_HW_UND) vh_render_line(bitmap, x, (y<<3), pen1); x += 6; } else if ((byte1 & Z88_SCR_HW_HRS) && !(byte1 & Z88_SCR_HW_REV)) { // high-res 8x8 UINT16 ch = (byte0 | (byte1<<8)) & 0x3ff; if (ch & 0x0100) { ch &= 0xff; char_gfx = convert_address(hires1<<11); } else { ch &= 0xff; char_gfx = convert_address(hires0<<13); } char_gfx += (ch<<3); // flash if ((byte1 & Z88_SCR_HW_FLS) && flash) pen0 = pen1 = 0; vh_render_8x8(bitmap, x,(y<<3), pen0, pen1, char_gfx); x += 8; } // every char takes 2 bytes c += 2; } } } }