uint32_t pc1350_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { const int contrast = m_dsw0->read() & 7; int color[4] = { colortable[contrast][0], colortable[contrast][1], 8, 7 }; bitmap.fill(11, cliprect); for (int k = 0, y = DOWN; k < 4; y += 16, k++) for (int x = RIGHT, i = pc1350_addr[k]; i < 0xa00; i += 0x200) for (int j = 0; j <= 0x1d; j++, x+=2) for (int bit = 0; bit < 8; bit++) bitmap.plot_box(x, y + bit * 2, 2, 2, color[BIT(m_reg[j+i], bit)]); /* 783c: 0 SHIFT 1 DEF 4 RUN 5 PRO 6 JAPAN 7 SML */ /* I don't know how they really look like on the LCD */ pocketc_draw_special(bitmap, RIGHT-30, DOWN+45, s_shift, BIT(m_reg[0x83c], 0) ? color[2] : color[3]); pocketc_draw_special(bitmap, RIGHT-30, DOWN+55, s_def, BIT(m_reg[0x83c], 1) ? color[2] : color[3]); pocketc_draw_special(bitmap, RIGHT-30, DOWN+5, s_run, BIT(m_reg[0x83c], 4) ? color[2] : color[3]); pocketc_draw_special(bitmap, RIGHT-30, DOWN+15, s_pro, BIT(m_reg[0x83c], 5) ? color[2] : color[3]); pocketc_draw_special(bitmap, RIGHT-30, DOWN+25, s_japan, BIT(m_reg[0x83c], 6) ? color[2] : color[3]); pocketc_draw_special(bitmap, RIGHT-30, DOWN+35, s_sml, BIT(m_reg[0x83c], 7) ? color[2] : color[3]); return 0; }
UINT32 pc1251_state::screen_update_pc1251(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int x, y, i, j; int color[2]; running_machine &machine = screen.machine(); bitmap.fill(11, cliprect); /* HJB: we cannot initialize array with values from other arrays, thus... */ color[0] = 7; //pocketc_colortable[PC1251_CONTRAST][0]; color[1] = 8; //pocketc_colortable[PC1251_CONTRAST][1]; for (x=RIGHT,y=DOWN, i=0; i<60; x+=3) { for (j=0; j<5; j++, i++, x+=3) drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[0], m_reg[i], PC1251_CONTRAST,0,0, x,y); } for (i=0x7b; i>=0x40; x+=3) { for (j=0; j<5; j++, i--, x+=3) drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[0], m_reg[i], PC1251_CONTRAST,0,0, x,y); } pocketc_draw_special(bitmap, RIGHT+134, DOWN-10, de, m_reg[0x3c] & 0x08 ? color[1] : color[0]); pocketc_draw_special(bitmap, RIGHT+142, DOWN-10, g, m_reg[0x3c] & 0x04 ? color[1] : color[0]); pocketc_draw_special(bitmap, RIGHT+146, DOWN-10, rad, m_reg[0x3d] & 0x04 ? color[1] : color[0]); pocketc_draw_special(bitmap, RIGHT+18, DOWN-10, def, m_reg[0x3c] & 0x01 ? color[1] : color[0]); pocketc_draw_special(bitmap, RIGHT, DOWN-10, shift, m_reg[0x3d] & 0x02 ? color[1] : color[0]); pocketc_draw_special(bitmap, RIGHT+38, DOWN-10, pro, m_reg[0x3e] & 0x01 ? color[1] : color[0]); pocketc_draw_special(bitmap, RIGHT+53, DOWN-10, run, m_reg[0x3e] & 0x02 ? color[1] : color[0]); pocketc_draw_special(bitmap, RIGHT+68, DOWN-10, rsv, m_reg[0x3e] & 0x04 ? color[1] : color[0]); /* 0x3c 1 def?, 4 g, 8 de 0x3d 2 shift, 4 rad, 8 error 0x3e 1 pro?, 2 run?, 4rsv?*/ return 0; }
UINT32 pc1403_state::screen_update_pc1403(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int x, y, i, j; int color[3]; bitmap.fill(11, cliprect); /* HJB: we cannot initialize array with values from other arrays, thus... */ color[0] = 7; // pocketc_colortable[CONTRAST][0]; color[2] = 8; // pocketc_colortable[CONTRAST][1]; color[1] = (m_portc & 1) ? color[2] : color[0]; if (m_portc & 1) { for (x=m_RIGHT, y=m_DOWN, i=0; i<6*5; x+=2) { for (j=0; j<5; j++, i++, x+=2) m_gfxdecode->gfx(0)->opaque(bitmap,cliprect, m_reg[i],CONTRAST,0,0, x,y); } for (i=9*5; i<12*5; x+=2) { for (j=0; j<5; j++, i++, x+=2) m_gfxdecode->gfx(0)->opaque(bitmap,cliprect, m_reg[i],CONTRAST,0,0, x,y); } for (i=6*5; i<9*5; x+=2) { for (j=0; j<5; j++, i++, x+=2) m_gfxdecode->gfx(0)->opaque(bitmap,cliprect, m_reg[i],CONTRAST,0,0, x,y); } for (i=0x7b-3*5; i>0x7b-6*5; x+=2) { for (j=0; j<5; j++, i--, x+=2) m_gfxdecode->gfx(0)->opaque(bitmap,cliprect, m_reg[i],CONTRAST,0,0, x,y); } for (i=0x7b; i>0x7b-3*5; x+=2) { for (j=0; j<5; j++, i--, x+=2) m_gfxdecode->gfx(0)->opaque(bitmap,cliprect, m_reg[i],CONTRAST,0,0, x,y); } for (i=0x7b-6*5; i>0x7b-12*5; x+=2) { for (j=0; j<5; j++, i--, x+=2) m_gfxdecode->gfx(0)->opaque(bitmap,cliprect, m_reg[i],CONTRAST,0,0, x,y); } } /* if display is off, busy is always visible? it seems to behave like that. */ /* But if computer is off, busy is hidden. */ if(!(m_portc&8)) { if (m_portc&1) pocketc_draw_special(bitmap, m_RIGHT, m_DOWN-13, busy, m_reg[0x3d] & 1 ? color[2] : color[0]); else pocketc_draw_special(bitmap, m_RIGHT, m_DOWN-13, busy, color[2]); } else pocketc_draw_special(bitmap, m_RIGHT, m_DOWN-13, busy, color[0]); pocketc_draw_special(bitmap, m_RIGHT+18, m_DOWN-13, def, m_reg[0x3d] & 0x02 ? color[1] : color[0]); pocketc_draw_special(bitmap, m_RIGHT+43, m_DOWN-13, shift, m_reg[0x3d] & 0x04 ? color[1] : color[0]); pocketc_draw_special(bitmap, m_RIGHT+63, m_DOWN-13, hyp, m_reg[0x3d] & 0x08 ? color[1] : color[0]); pocketc_draw_special(bitmap, m_RIGHT+155, m_DOWN-13, kana, m_reg[0x3c] & 0x01 ? color[1] : color[0]); pocketc_draw_special(bitmap, m_RIGHT+167, m_DOWN-13, shoo, m_reg[0x3c] & 0x02 ? color[1] : color[0]); pocketc_draw_special(bitmap, m_RIGHT+178, m_DOWN-13, sml, m_reg[0x3c] & 0x04 ? color[1] : color[0]); pocketc_draw_special(bitmap, m_RIGHT+191, m_DOWN-13, de, m_reg[0x7c] & 0x20 ? color[1] : color[0]); pocketc_draw_special(bitmap, m_RIGHT+199, m_DOWN-13, g, m_reg[0x7c] & 0x10 ? color[1] : color[0]); pocketc_draw_special(bitmap, m_RIGHT+203, m_DOWN-13, rad, m_reg[0x7c] & 0x08 ? color[1] : color[0]); pocketc_draw_special(bitmap, m_RIGHT+266, m_DOWN-13, braces, m_reg[0x7c] & 0x04 ? color[1] : color[0]); pocketc_draw_special(bitmap, m_RIGHT+274, m_DOWN-13, m, m_reg[0x7c] & 0x02 ? color[1] : color[0]); pocketc_draw_special(bitmap, m_RIGHT+281, m_DOWN-13, e, m_reg[0x7c] & 0x01 ? color[1] : color[0]); pocketc_draw_special(bitmap, m_RIGHT+10, m_DOWN+27, line /* empty */, m_reg[0x3c] & 0x40 ? color[1] : color[0]); pocketc_draw_special(bitmap, m_RIGHT+31, m_DOWN+27, line /*calc*/, m_reg[0x3d] & 0x40 ? color[1] : color[0]); pocketc_draw_special(bitmap, m_RIGHT+52, m_DOWN+27, line/*run*/, m_reg[0x3d] & 0x20 ? color[1] : color[0]); pocketc_draw_special(bitmap, m_RIGHT+73, m_DOWN+27, line/*prog*/, m_reg[0x3d] & 0x10 ? color[1] : color[0]); pocketc_draw_special(bitmap, m_RIGHT+94, m_DOWN+27, line /* empty */, m_reg[0x3c] & 0x20 ? color[1] : color[0]); pocketc_draw_special(bitmap, m_RIGHT+232, m_DOWN+27, line/*matrix*/, m_reg[0x3c] & 0x10 ? color[1] : color[0]); pocketc_draw_special(bitmap, m_RIGHT+253, m_DOWN+27, line/*stat*/, m_reg[0x3c] & 0x08 ? color[1] : color[0]); pocketc_draw_special(bitmap, m_RIGHT+274, m_DOWN+27, line/*print*/, m_reg[0x7c] & 0x40 ? color[1] : color[0]); return 0; }
UINT32 pc1401_state::screen_update_pc1401(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { running_machine &machine = screen.machine(); int x, y, i, j; int color[2]; bitmap.fill(11, cliprect); #if 0 /* HJB: we cannot initialize array with values from other arrays, thus... */ color[0] = pocketc_colortable[CONTRAST][0]; color[1] = pocketc_colortable[CONTRAST][1]; #endif /* Above can be unreadable or misleading at certain contrast settings, this is better */ color[0] = 7; color[1] = 8; if (m_portc&1) { for (x=RIGHT,y=DOWN,i=0; i<0x28;x+=2) { for (j=0; j<5;j++,i++,x+=2) drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[0], m_reg[i],CONTRAST,0,0,x,y); } for (i=0x67; i>=0x40;x+=2) { for (j=0; j<5;j++,i--,x+=2) drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[0], m_reg[i],CONTRAST,0,0,x,y); } } pocketc_draw_special(bitmap, RIGHT+149, DOWN+24, line, m_reg[0x3c] & 0x08 ? color[1] : color[0]); pocketc_draw_special(bitmap, RIGHT, DOWN-10, busy, m_reg[0x3d] & 0x01 ? color[1] : color[0]); pocketc_draw_special(bitmap, RIGHT+18, DOWN-10, def, m_reg[0x3d] & 0x02 ? color[1] : color[0]); pocketc_draw_special(bitmap, RIGHT+43, DOWN-10,shift, m_reg[0x3d] & 0x04 ? color[1] : color[0]); pocketc_draw_special(bitmap, RIGHT+63, DOWN-10,hyp, m_reg[0x3d] & 0x08 ? color[1] : color[0]); pocketc_draw_special(bitmap, RIGHT+38, DOWN+24,line, m_reg[0x3d] & 0x10 ? color[1] : color[0]); pocketc_draw_special(bitmap, RIGHT+23, DOWN+24,line, m_reg[0x3d] & 0x20 ? color[1] : color[0]); pocketc_draw_special(bitmap, RIGHT+8, DOWN+24,line, m_reg[0x3d] & 0x40 ? color[1] : color[0]); pocketc_draw_special(bitmap, RIGHT+183, DOWN-10,e, m_reg[0x7c] & 0x01 ? color[1] : color[0]); pocketc_draw_special(bitmap, RIGHT+176, DOWN-10,m, m_reg[0x7c] & 0x02 ? color[1] : color[0]); pocketc_draw_special(bitmap, RIGHT+168, DOWN-10,braces, m_reg[0x7c] & 0x04 ? color[1] : color[0]); pocketc_draw_special(bitmap, RIGHT+138, DOWN-10,rad, m_reg[0x7c] & 0x08 ? color[1] : color[0]); pocketc_draw_special(bitmap, RIGHT+134, DOWN-10,g, m_reg[0x7c] & 0x10 ? color[1] : color[0]); pocketc_draw_special(bitmap, RIGHT+126, DOWN-10,de, m_reg[0x7c] & 0x20 ? color[1] : color[0]); pocketc_draw_special(bitmap, RIGHT+165, DOWN+24,line, m_reg[0x7c] & 0x40 ? color[1] : color[0]); /* 603c: 3 STAT 603d: 0 BUSY, 1 DEF, 2 SHIFT, 3 HYP, 4 PRO, 5 RUN, 6 CAL 607c: 0 E, 1 M, 2 (), 3 RAD, 4 G, 5 DE, 6 PRINT */ return 0; }