void msm6222b_device::data_w(UINT8 data) { if(adc & 0x80) { int adr = adc & 0x7f; if(two_line) { if((adr >= 40 && adr < 64) || adr >= 64+40) adr = -1; if(adr >= 64) adr += 40-64; } else { if(adr >= 80) adr = -1; } if(adr != -1) { ddram[adr] = data; if(shift_on_write) shift_step(cursor_direction); else cursor_step(cursor_direction); } } else { if(adc < 8*8) { cgram[adc] = data; cursor_step(cursor_direction); } } }
void msm6222b_device::control_w(UINT8 data) { int cmd; for(cmd = 7; cmd >= 0 && !(data & (1<<cmd)); cmd--); switch(cmd) { case 0: memset(ddram, 0x20, sizeof(ddram)); adc = 0x00; break; case 1: adc = 0x00; shift = 0x00; break; case 2: shift_on_write = data & 1; cursor_direction = data & 2; break; case 3: display_on = data & 4; cursor_on = data & 2; cursor_blinking = data & 1; break; case 4: if(data & 8) shift_step(data & 4); else cursor_step(data & 4); break; case 5: two_line = data & 8; double_height = (data & 0xc) == 4; // Bit 4 is 4bits/8bits data access break; case 6: adc = data & 0x3f; break; case 7: adc = data; // Bit 7 is set break; } }
void sed1200_device::control_w(UINT8 data) { switch(data) { case 0x04: case 0x05: cursor_direction = data & 0x01; break; case 0x06: case 0x07: cursor_step(); break; case 0x08: case 0x09: cursor_full = data & 0x01; break; case 0x0a: case 0x0b: cursor_blinking = data & 0x01; break; case 0x0c: case 0x0d: display_on = data & 0x01; break; case 0x0e: case 0x0f: cursor_on = data & 0x01; break; case 0x10: soft_reset(); break; case 0x12: case 0x13: break; // Number of lines selection default: if((data & 0xf0) == 0x20) cgram_address = (data & 3)*8; else if((data & 0xe0) == 0x40) { cgram[cgram_address++] = data; if(cgram_address == 4*8) cgram_address = 0; } else if(data & 0x80) { cursor_address = data & 0x40 ? 10 : 0; cursor_address += (data & 0x3f) >= 10 ? 9 : data & 0x3f; } break; } }
void sed1200_device::data_w(UINT8 data) { ddram[cursor_address] = data; cursor_step(); }