- if(display_mode == DISPLAY_MODE_1_400L) {
- int ii;
- uint8_t *regs = l4crtc->get_regs();
- cursor_start = (int)(regs[10] & 0x1f);
- cursor_end = (int)(regs[11] & 0x1f);
- cursor_type = (int)((regs[10] & 0x60) >> 5);
- text_xmax = (int)((uint16_t)regs[1] << 1);
- text_lines = (int)((regs[9] & 0x1f) + 1);
- text_ymax = (int)(regs[6] & 0x7f);
- yoff = 0;
- // Green display had only connected to FM-8, FM-7/NEW7 and FM-77.
- for(y = 0; y < 400; y += 8) {
- bool renderf = false;
- uint32_t naddr;
- uint8_t bitcode;
- uint8_t charcode;
- uint8_t attr_code;
- scrntype_t on_color;
- int xlim, ylim;
- bool do_green;
- if((y & 0x0f) == 0) {
- for(yy = 0; yy < 16; yy++) renderf |= vram_draw_table[y + yy];
- renderf = renderf | ff;
- if(renderf) {
- for(yy = 0; yy < 16; yy++) vram_draw_table[y + yy] = true;
- }
- }
- if(use_green_monitor) {
- for(yy = 0; yy < 8; yy++) {
- if(!(vram_draw_table[y + yy] | ff)) continue;
- vram_draw_table[y + yy] = false;
- p = emu->get_screen_buffer(y + yy);
- if(p == NULL) continue;
- yoff = (y + yy) * 80;
- for(x = 0; x < 10; x++) {
- for(ii = 0; ii < 8; ii++) {
- GETVRAM_1_400L_GREEN(yoff + ii, p);
- p += 8;
- }
- yoff += 8;
- }
- }
- do_green = true;
- } else {
- for(yy = 0; yy < 8; yy++) {
- if(!(vram_draw_table[y + yy] | ff)) continue;
- vram_draw_table[y + yy] = false;
- p = emu->get_screen_buffer(y + yy);
- if(p == NULL) continue;
- yoff = (y + yy) * 80;
- for(x = 0; x < 10; x++) {
- for(ii = 0; ii < 8; ii++) {
- GETVRAM_1_400L(yoff + ii, p);
- p += 8;
- }
- yoff += 8;
- }
- }
- do_green = false;
- }
- // Draw Text
- if(renderf) {
- bool reverse;
- bool display_char;
- int raster;
- bool cursor_rev;
- uint8_t bitdata;
- if(text_width40) {
- xlim = 40;
- } else {
- xlim = 80;
- }
-
- for(x = 0; x < xlim; x++) {
- naddr = (text_start_addr.w.l + ((y / text_lines) * text_xmax + x) * 2) & 0x0ffe;
- charcode = text_vram[naddr];
- attr_code = text_vram[naddr + 1];
-
- on_color = GETVRAM_TEXTCOLOR(attr_code, do_green);
-
- display_char = ((attr_code & 0x10) == 0);
- reverse = ((attr_code & 0x08) != 0);
-
- for(yy = 0; yy < 16; yy++) {
- raster = y % text_lines;
- bitdata = 0x00;
- p = emu->get_screen_buffer(y + yy);
- if(p == NULL) continue;
- if((raster < 16) && (display_char || text_blink)) {
- bitdata = subsys_cg_l4[(uint32_t)charcode * 16 + (uint32_t)raster];
- }
- cursor_rev = false;
- if((naddr == (uint32_t)(cursor_addr.w.l)) && (cursor_type != 1) &&
- (text_blink || (cursor_type == 0))) {
- if((raster >= cursor_start) && (raster <= cursor_end)) {
- cursor_rev = true;
- }
- }
- bitdata = GETVRAM_TEXTPIX(bitdata, reverse, cursor_rev);
- if(bitdata != 0) {
- if(text_width40) {
- scrntype_t *pp = &(p[x * 2]);
- for(ii = 0; ii < 8; ii++) {
- if((bitdata & 0x80) != 0) {
- p[0] = on_color;
- p[1] = on_color;
- }
- bitdata <<= 1;
- p += 2;
- }
- } else {
- scrntype_t *pp = &(p[x * 2]);
- for(ii = 0; ii < 8; ii++) {
- if((bitdata & 0x80) != 0) {
- p[0] = on_color;
- }
- bitdata <<= 1;
- p += 1;
- }
- }
- }
- }
- }
- }
- }
- if(ff) force_update = false;
- return;
- }
-#endif
-# if defined(_FM77AV_VARIANTS)
- if(display_mode == DISPLAY_MODE_4096) {
- uint32_t mask = 0;
- int ii;
- yoff = 0;
- if(!multimode_dispflags[0]) mask = 0x00f;
- if(!multimode_dispflags[1]) mask = mask | 0x0f0;
- if(!multimode_dispflags[2]) mask = mask | 0xf00;
- for(y = 0; y < 200; y += 4) {
- for(yy = 0; yy < 4; yy++) {
- if(!(vram_draw_table[y + yy] | ff)) continue;
- vram_draw_table[y + yy] = false;
-
-#if !defined(FIXED_FRAMEBUFFER_SIZE)
- p = emu->get_screen_buffer(y + yy);
- p2 = NULL;
-#else
- p = emu->get_screen_buffer((y + yy) * 2 );
- p2 = emu->get_screen_buffer((y + yy) * 2 + 1);
-#endif
- if(p == NULL) continue;
- yoff = (y + yy) * 40;
-# if defined(_FM77AV40EX) || defined(_FM77AV40SX)
- if(window_opened && (wy_low <= (y + yy)) && (wy_high > (y + yy))) {
- for(x = 0; x < 40; x++) {
- if((x >= wx_begin) && (x < wx_end)) {
- GETVRAM_4096(yoff, p, p2, mask, true, scan_line);
- } else {
- GETVRAM_4096(yoff, p, p2, mask, false, scan_line);
- }
-#if defined(FIXED_FRAMEBUFFER_SIZE)
- p2 += 16;
- p += 16;
-#else
- p += 8;
-#endif
- yoff++;
- }
- } else
-# endif
- {
- for(x = 0; x < 5; x++) {
- for(ii = 0; ii < 8; ii++) {
- GETVRAM_4096(yoff + ii, p, p2, mask, false, scan_line);
-#if defined(FIXED_FRAMEBUFFER_SIZE)
- p2 += 16;
- p += 16;
-#else
- p += 8;
-#endif
- }
- yoff += 8;
- }
- }
- }
-
- }