• R/O
  • HTTP
  • SSH
  • HTTPS

common_source_project-fm7: Commit

Common Source Code Project for Qt (a.k.a for FM-7).


Commit MetaInfo

Revisiona5e8e01855c26f59882b8ed7a6b592dea645b5dc (tree)
Time2018-03-16 15:42:03
AuthorK.Ohta <whatisthis.sowhat@gmai...>
CommiterK.Ohta

Log Message

[VM][FM7][VRAM] More expect to use SIMD.

Change Summary

Incremental Difference

--- a/source/src/vm/fm7/fm7_display.h
+++ b/source/src/vm/fm7/fm7_display.h
@@ -8,6 +8,7 @@
88 #ifndef _CSP_FM7_DISPLAY_H
99 #define _CSP_FM7_DISPLAY_H
1010
11+#include "../../common.h"
1112 #include "../device.h"
1213 #include "../mc6809.h"
1314 #include "fm7_common.h"
@@ -284,11 +285,14 @@ protected:
284285 MC6809 *subcpu;
285286 KEYBOARD *keyboard;
286287 bool vram_wrote;
287- void GETVRAM_8_200L(int yoff, scrntype_t *p, scrntype_t *px, bool window_inv, bool scan_line);
288- void GETVRAM_4096(int yoff, scrntype_t *p, scrntype_t *px, uint32_t rgbmask, bool window_inv, bool scan_line);
288+
289+ void GETVRAM_8_200L(int yoff, scrntype_t *p, scrntype_t *px, bool window_inv = false, bool scan_line = false);
290+#if defined(_FM77AV_VARIANTS)
291+ void GETVRAM_4096(int yoff, scrntype_t *p, scrntype_t *px, uint32_t rgbmask, bool window_inv = false, bool scan_line = false);
292+#endif
289293 #if defined(_FM77AV40) || defined(_FM77AV40EX) || defined(_FM77AV40SX)
290- void GETVRAM_8_400L(int yoff, scrntype_t *p, bool window_inv);
291- void GETVRAM_256k(int yoff, scrntype_t *p, scrntype_t *px, bool scan_line);
294+ void GETVRAM_8_400L(int yoff, scrntype_t *p, bool window_inv = false);
295+ void GETVRAM_256k(int yoff, scrntype_t *p, scrntype_t *px, bool scan_line = false);
292296 #endif
293297 uint8_t read_vram_l4_400l(uint32_t addr, uint32_t offset);
294298 uint32_t read_mmio(uint32_t addr);
@@ -431,4 +435,5 @@ public:
431435 }
432436 #endif
433437 };
438+
434439 #endif // _CSP_FM7_DISPLAY_H
--- a/source/src/vm/fm7/vram.cpp
+++ b/source/src/vm/fm7/vram.cpp
@@ -56,301 +56,391 @@ void DISPLAY::write_vram_l4_400l(uint32_t addr, uint32_t offset, uint32_t data)
5656 #endif
5757 }
5858
59-void DISPLAY::GETVRAM_8_200L(int yoff, scrntype_t *p,
60- scrntype_t *px,
61- bool window_inv = false,
62- bool scan_line = false)
59+
60+
61+void DISPLAY::draw_screen()
6362 {
64- uint8_t b, r, g;
65- uint32_t yoff_d;
66-#if defined(_FM77AV40EX) || defined(_FM77AV40SX)
67- int dpage = vram_display_block;
68-#endif
69- if(p == NULL) return;
70- yoff_d = 0;
71- yoff_d = (yoff + yoff_d) & 0x3fff;
63+//#if !defined(_FM77AV_VARIANTS)
64+ this->draw_screen2();
65+//#endif
66+}
67+
68+extern config_t config;
69+void DISPLAY::draw_screen2()
70+{
71+ int y;
72+ int x;
73+ scrntype_t *p, *pp, *p2;
74+ int yoff;
75+ int yy;
76+ int k;
77+ //uint32_t rgbmask;
78+ uint32_t yoff_d1, yoff_d2;
79+ uint16_t wx_begin, wx_end, wy_low, wy_high;
80+ bool scan_line = config.scan_line;
7281
7382 #if defined(_FM77AV40EX) || defined(_FM77AV40SX)
74- if(window_inv) {
75- if(dpage == 0) {
76- dpage = 1;
83+ {
84+ wx_begin = window_xbegin;
85+ wx_end = window_xend;
86+ wy_low = window_low;
87+ wy_high = window_high;
88+ bool _flag = window_opened;
89+ if((wx_begin < wx_end) && (wy_low < wy_high)) {
90+ window_opened = true;
7791 } else {
78- dpage = 0;
92+ window_opened = false;
93+ }
94+ if(_flag != window_opened) {
95+ vram_wrote_shadow = true;
7996 }
8097 }
81- if(dpage != 0) yoff_d += 0x18000;
8298 #endif
83- b = r = g = 0;
99+// frame_skip_count_draw++;
84100 #if defined(_FM77AV_VARIANTS)
85- if(display_page_bak == 1) yoff_d += 0xc000;
101+ yoff_d2 = 0;
102+ yoff_d1 = 0;
103+#else
104+ //if(!(vram_wrote_shadow)) return;
105+ yoff_d1 = yoff_d2 = offset_point;
86106 #endif
87- if(!multimode_dispflags[0]) b = gvram_shadow[yoff_d + 0x00000];
88- if(!multimode_dispflags[1]) r = gvram_shadow[yoff_d + 0x04000];
89- if(!multimode_dispflags[2]) g = gvram_shadow[yoff_d + 0x08000];
90-
91- uint16_t *pg = &(bit_trans_table_0[g][0]);
92- uint16_t *pr = &(bit_trans_table_1[r][0]);
93- uint16_t *pb = &(bit_trans_table_2[b][0]);
94- uint16_t tmp_d[8];
95-
96- scrntype_t tmp_dd[8];
97-
98-__DECL_VECTORIZED_LOOP
99- for(int i = 0; i < 8; i++) {
100- tmp_d[i] = pg[i];
101- tmp_d[i] |= pr[i];
102- tmp_d[i] |= pb[i];
103- tmp_d[i] >>= 5;
104- }
105-__DECL_VECTORIZED_LOOP
106- for(int i = 0; i < 8; i++) {
107- tmp_dd[i] = dpalette_pixel[tmp_d[i]];
108- p[i] = tmp_dd[i];
107+ // Set blank
108+ int ylines;
109+ int xpixels;
110+ switch(display_mode) {
111+ case DISPLAY_MODE_8_200L:
112+ xpixels = 640;
113+ ylines = 200;
114+ break;
115+ case DISPLAY_MODE_8_400L:
116+ xpixels = 640;
117+ ylines = 400;
118+ break;
119+ default:
120+ xpixels = 320;
121+ ylines = 200;
122+ break;
109123 }
110-#if defined(FIXED_FRAMEBUFFER_SIZE)
111- if(scan_line) {
112-/* Fancy scanline */
113- #if defined(_RGB555) || defined(_RGBA565)
114- static const int shift_factor = 2;
115- #else // 24bit
116- static const int shift_factor = 3;
117- #endif
118-__DECL_VECTORIZED_LOOP
119- for(int i = 0; i < 8; i++) {
120- tmp_dd[i] = (tmp_dd[i] >> shift_factor) & (const scrntype_t)RGBA_COLOR(31, 31, 31, 255);;
121- //tmp_dd[i] = tmp_dd[i] & (const scrntype_t)RGBA_COLOR(31, 31, 31, 255);
122- px[i] = tmp_dd[i];
123- }
124- } else {
125-__DECL_VECTORIZED_LOOP
126- for(int i = 0; i < 8; i++) {
127- px[i] = tmp_dd[i];
124+# if !defined(FIXED_FRAMEBUFFER_SIZE)
125+ emu->set_vm_screen_size(xpixels, ylines, WINDOW_WIDTH, WINDOW_HEIGHT, WINDOW_WIDTH_ASPECT, WINDOW_HEIGHT_ASPECT);
126+# endif
127+ emu->set_vm_screen_lines(ylines);
128+ if(!crt_flag) {
129+ if(crt_flag_bak) {
130+ scrntype_t *ppp;
131+#if !defined(FIXED_FRAMEBUFFER_SIZE)
132+ for(y = 0; y < ylines; y += 8) {
133+ for(yy = 0; yy < 8; yy++) {
134+ vram_draw_table[y + yy] = false;
135+ ppp = emu->get_screen_buffer(y + yy);
136+ if(ppp != NULL) memset(ppp, 0x00, xpixels * sizeof(scrntype_t));
137+ }
138+ }
139+#else
140+ for(y = 0; y < 400; y += 8) {
141+ for(yy = 0; yy < 8; yy++) {
142+ vram_draw_table[y + yy] = false;
143+ ppp = emu->get_screen_buffer(y + yy);
144+ if(ppp != NULL) memset(ppp, 0x00, 640 * sizeof(scrntype_t));
145+ }
146+ }
147+#endif
148+
128149 }
150+ crt_flag_bak = crt_flag;
151+ return;
129152 }
130-#endif
131-}
132-
133-#if defined(_FM77AV40) || defined(_FM77AV40EX) || defined(_FM77AV40SX)
134-void DISPLAY::GETVRAM_8_400L(int yoff, scrntype_t *p,
135- bool window_inv = false)
136-{
137- uint8_t b, r, g;
138- uint32_t dot;
139- uint32_t yoff_d;
153+ crt_flag_bak = crt_flag;
154+ if(!vram_wrote_shadow) return;
155+ vram_wrote_shadow = false;
156+ if(display_mode == DISPLAY_MODE_8_200L) {
157+ int ii;
158+ yoff = 0;
159+ for(y = 0; y < 200; y += 8) {
160+ for(yy = 0; yy < 8; yy++) {
161+
162+ if(!vram_draw_table[y + yy]) continue;
163+ vram_draw_table[y + yy] = false;
164+#if !defined(FIXED_FRAMEBUFFER_SIZE)
165+ p = emu->get_screen_buffer(y + yy);
166+ p2 = NULL;
167+#else
168+ p = emu->get_screen_buffer((y + yy) * 2);
169+ p2 = emu->get_screen_buffer((y + yy) * 2 + 1);
170+#endif
171+ if(p == NULL) continue;
172+ yoff = (y + yy) * 80;
140173 # if defined(_FM77AV40EX) || defined(_FM77AV40SX)
141- int dpage = vram_display_block;
174+ if(window_opened && (wy_low <= (y + yy)) && (wy_high > (y + yy))) {
175+ for(x = 0; x < 80; x++) {
176+ if((x >= wx_begin) && (x < wx_end)) {
177+ GETVRAM_8_200L(yoff, p, p2, true, scan_line);
178+ } else {
179+ GETVRAM_8_200L(yoff, p, p2, false, scan_line);
180+ }
181+#if defined(FIXED_FRAMEBUFFER_SIZE)
182+ p2 += 8;
183+#endif
184+ p += 8;
185+ yoff++;
186+ }
187+ } else
142188 # endif
143- if(p == NULL) return;
144- yoff_d = yoff;
145-# if defined(_FM77AV40EX) || defined(_FM77AV40SX)
146- if(window_inv) {
147- if(dpage == 0) {
148- dpage = 1;
149- } else {
150- dpage = 0;
189+ {
190+ for(x = 0; x < 10; x++) {
191+ for(ii = 0; ii < 8; ii++) {
192+ GETVRAM_8_200L(yoff + ii, p, p2, false, scan_line);
193+#if defined(FIXED_FRAMEBUFFER_SIZE)
194+ p2 += 8;
195+#endif
196+ p += 8;
197+ }
198+ yoff += 8;
199+ }
200+ }
201+ }
202+
151203 }
204+ return;
152205 }
153- if(dpage != 0) yoff_d += 0x18000;
154-# endif
155- b = r = g = 0;
156- if(!multimode_dispflags[0]) b = gvram_shadow[yoff_d + 0x00000];
157- if(!multimode_dispflags[1]) r = gvram_shadow[yoff_d + 0x08000];
158- if(!multimode_dispflags[2]) g = gvram_shadow[yoff_d + 0x10000];
159-
160- uint16_t *pg = &(bit_trans_table_0[g][0]);
161- uint16_t *pr = &(bit_trans_table_1[r][0]);
162- uint16_t *pb = &(bit_trans_table_2[b][0]);
163- uint16_t tmp_d[8];
164- scrntype_t tmp_dd[8];
165-
166-__DECL_VECTORIZED_LOOP
167- for(int i = 0; i < 8; i++) {
168- tmp_d[i] = pg[i] | pr[i] | pb[i];
169- tmp_d[i] = tmp_d[i] >> 5;
170-
171-__DECL_VECTORIZED_LOOP
172- for(int i = 0; i < 8; i++) {
173- tmp_dd[i] = dpalette_pixel[tmp_d[i]];
174- p[i] = tmp_dd[i];
175- }
176-}
177-
178-void DISPLAY::GETVRAM_256k(int yoff, scrntype_t *p, scrntype_t *px, bool scan_line = false)
179-{
180- uint32_t b3, r3, g3;
181- uint32_t b4, r4, g4;
182- uint32_t btmp, rtmp, gtmp;
183-
184- scrntype_t b, r, g;
185- scrntype_t pixel;
186- uint32_t _bit;
187- int _shift;
188- int cp;
189- uint32_t yoff_d1;
190- uint32_t yoff_d2;
191- if(p == NULL) return;
192-
193- r3 = g3 = b3 = 0;
194- r4 = g4 = b4 = 0;
195- r = g = b = 0;
196-
197- yoff_d1 = yoff;
198- yoff_d2 = yoff;
206+# if defined(_FM77AV_VARIANTS)
207+ if(display_mode == DISPLAY_MODE_4096) {
208+ uint32_t mask = 0;
209+ int ii;
210+ yoff = 0;
211+ if(!multimode_dispflags[0]) mask = 0x00f;
212+ if(!multimode_dispflags[1]) mask = mask | 0x0f0;
213+ if(!multimode_dispflags[2]) mask = mask | 0xf00;
214+ for(y = 0; y < 200; y += 4) {
215+ for(yy = 0; yy < 4; yy++) {
216+ if(!vram_draw_table[y + yy]) continue;
217+ vram_draw_table[y + yy] = false;
199218
200- uint8_t bb[8], rr[8], gg[8];
201- uint16_t *p0, *p1, *p2, *p3, *p4, *p5;
202- uint32_t _btmp[8], _rtmp[8], _gtmp[8];
203219 #if !defined(FIXED_FRAMEBUFFER_SIZE)
204- scrntype_t tmp_dd[8];
220+ p = emu->get_screen_buffer(y + yy);
221+ p2 = NULL;
205222 #else
206- scrntype_t tmp_dd[16];
223+ p = emu->get_screen_buffer((y + yy) * 2 );
224+ p2 = emu->get_screen_buffer((y + yy) * 2 + 1);
207225 #endif
208-// if(mask & 0x01) {
209- if(!multimode_dispflags[0]) {
210- // B
211- bb[0] = gvram_shadow[yoff_d1];
212- bb[1] = gvram_shadow[yoff_d1 + 0x02000];
213-
214- bb[2] = gvram_shadow[yoff_d2 + 0x0c000];
215- bb[3] = gvram_shadow[yoff_d2 + 0x0e000];
216-
217- bb[4] = gvram_shadow[yoff_d1 + 0x18000];
218- bb[5] = gvram_shadow[yoff_d1 + 0x1a000];
219-
220- p0 = &(bit_trans_table_0[bb[0]][0]);
221- p1 = &(bit_trans_table_1[bb[1]][0]);
222- p2 = &(bit_trans_table_2[bb[2]][0]);
223- p3 = &(bit_trans_table_3[bb[3]][0]);
224- p4 = &(bit_trans_table_4[bb[4]][0]);
225- p5 = &(bit_trans_table_5[bb[5]][0]);
226-__DECL_VECTORIZED_LOOP
227- for(int i = 0; i < 8; i++) {
228- _btmp[i] = p0[i];
229- _btmp[i] = _btmp[i] | p1[i];
230- _btmp[i] = _btmp[i] | p2[i];
231- _btmp[i] = _btmp[i] | p3[i];
232- _btmp[i] = _btmp[i] | p4[i];
233- _btmp[i] = _btmp[i] | p5[i];
226+ if(p == NULL) continue;
227+ yoff = (y + yy) * 40;
228+# if defined(_FM77AV40EX) || defined(_FM77AV40SX)
229+ if(window_opened && (wy_low <= (y + yy)) && (wy_high > (y + yy))) {
230+ for(x = 0; x < 40; x++) {
231+ if((x >= wx_begin) && (x < wx_end)) {
232+ GETVRAM_4096(yoff, p, p2, mask, true, scan_line);
233+ } else {
234+ GETVRAM_4096(yoff, p, p2, mask, false, scan_line);
235+ }
236+#if defined(FIXED_FRAMEBUFFER_SIZE)
237+ p2 += 16;
238+ p += 16;
239+#else
240+ p += 8;
241+#endif
242+ yoff++;
243+ }
244+ } else
245+# endif
246+ {
247+ for(x = 0; x < 5; x++) {
248+ for(ii = 0; ii < 8; ii++) {
249+ GETVRAM_4096(yoff + ii, p, p2, mask, false, scan_line);
250+#if defined(FIXED_FRAMEBUFFER_SIZE)
251+ p2 += 16;
252+ p += 16;
253+#else
254+ p += 8;
255+#endif
256+ }
257+ yoff += 8;
258+ }
259+ }
260+ }
261+
262+ }
263+ return;
264+ }
265+# if defined(_FM77AV40) || defined(_FM77AV40EX) || defined(_FM77AV40SX)
266+ else if(display_mode == DISPLAY_MODE_8_400L) {
267+ int ii;
268+ yoff = 0;
269+ //rgbmask = ~multimode_dispmask;
270+ for(y = 0; y < 400; y += 8) {
271+ for(yy = 0; yy < 8; yy++) {
272+ if(!vram_draw_table[y + yy]) continue;
273+ vram_draw_table[y + yy] = false;
274+
275+ p = emu->get_screen_buffer(y + yy);
276+ if(p == NULL) continue;
277+ pp = p;
278+ yoff = (y + yy) * 80;
279+# if defined(_FM77AV40EX) || defined(_FM77AV40SX)
280+ if(window_opened && (wy_low <= (y + yy)) && (wy_high > (y + yy))) {
281+ for(x = 0; x < 80; x++) {
282+ if((x >= wx_begin) && (x < wx_end)) {
283+ GETVRAM_8_400L(yoff, p, true);
284+ } else {
285+ GETVRAM_8_400L(yoff, p, false);
286+ }
287+ p += 8;
288+ yoff++;
289+ }
290+ } else
291+# endif
292+ for(x = 0; x < 10; x++) {
293+
294+ for(ii = 0; ii < 8; ii++) {
295+ GETVRAM_8_400L(yoff + ii, p);
296+ p += 8;
297+ }
298+ yoff += 8;
299+ }
300+ }
301+ }
302+ return;
303+ } else if(display_mode == DISPLAY_MODE_256k) {
304+ int ii;
305+ //rgbmask = ~multimode_dispmask;
306+ //
307+ for(y = 0; y < 200; y += 4) {
308+ for(yy = 0; yy < 4; yy++) {
309+ if(!vram_draw_table[y + yy]) continue;
310+ vram_draw_table[y + yy] = false;
311+#if !defined(FIXED_FRAMEBUFFER_SIZE)
312+ p = emu->get_screen_buffer(y + yy);
313+ p2 = NULL;
314+#else
315+ p = emu->get_screen_buffer((y + yy) * 2 );
316+ p2 = emu->get_screen_buffer((y + yy) * 2 + 1);
317+#endif
318+ if(p == NULL) continue;
319+ pp = p;
320+ yoff = (y + yy) * 40;
321+ {
322+ for(x = 0; x < 5; x++) {
323+ for(ii = 0; ii < 8; ii++) {
324+ GETVRAM_256k(yoff + ii, p, p2, scan_line);
325+#if !defined(FIXED_FRAMEBUFFER_SIZE)
326+ p += 8;
327+#else
328+ p += 16;
329+ p2 += 16;
330+#endif
331+ }
332+ yoff += 8;
333+ }
334+ }
335+ }
234336 }
337+ return;
338+ }
339+# endif // _FM77AV40
340+# endif //_FM77AV_VARIANTS
341+}
342+
343+bool DISPLAY::screen_update(void)
344+{
345+ if(crt_flag) {
346+ bool f = screen_update_flag;
347+ screen_update_flag = false;
348+ return f;
235349 } else {
236-__DECL_VECTORIZED_LOOP
237- for(int i = 0; i < 8; i++) {
238- _btmp[i] = 0;
350+ if(crt_flag_bak) return true;
351+ }
352+ return false;
353+}
354+
355+void DISPLAY::reset_screen_update(void)
356+{
357+ screen_update_flag = false;
358+}
359+
360+void DISPLAY::GETVRAM_8_200L(int yoff, scrntype_t *p,
361+ scrntype_t *px,
362+ bool window_inv,
363+ bool scan_line)
364+{
365+ uint8_t b, r, g;
366+ uint32_t yoff_d;
367+#if defined(_FM77AV40EX) || defined(_FM77AV40SX)
368+ int dpage = vram_display_block;
369+#endif
370+ if(p == NULL) return;
371+ yoff_d = 0;
372+ yoff_d = (yoff + yoff_d) & 0x3fff;
373+
374+#if defined(_FM77AV40EX) || defined(_FM77AV40SX)
375+ if(window_inv) {
376+ if(dpage == 0) {
377+ dpage = 1;
378+ } else {
379+ dpage = 0;
239380 }
240381 }
241- if(!multimode_dispflags[1]) {
242- //if(mask & 0x02) {
243- // R
244- rr[0] = gvram_shadow[yoff_d1 + 0x04000];
245- rr[1] = gvram_shadow[yoff_d1 + 0x06000];
246-
247- rr[2] = gvram_shadow[yoff_d2 + 0x10000];
248- rr[3] = gvram_shadow[yoff_d2 + 0x12000];
249-
250- rr[4] = gvram_shadow[yoff_d1 + 0x1c000];
251- rr[5] = gvram_shadow[yoff_d1 + 0x1e000];
252-
253- p0 = &(bit_trans_table_0[rr[0]][0]);
254- p1 = &(bit_trans_table_1[rr[1]][0]);
255- p2 = &(bit_trans_table_2[rr[2]][0]);
256- p3 = &(bit_trans_table_3[rr[3]][0]);
257- p4 = &(bit_trans_table_4[rr[4]][0]);
258- p5 = &(bit_trans_table_5[rr[5]][0]);
382+ if(dpage != 0) yoff_d += 0x18000;
383+#endif
384+ b = r = g = 0;
385+#if defined(_FM77AV_VARIANTS)
386+ if(display_page_bak == 1) yoff_d += 0xc000;
387+#endif
388+ if(!multimode_dispflags[0]) b = gvram_shadow[yoff_d + 0x00000];
389+ if(!multimode_dispflags[1]) r = gvram_shadow[yoff_d + 0x04000];
390+ if(!multimode_dispflags[2]) g = gvram_shadow[yoff_d + 0x08000];
391+
392+ uint16_t *pg = &(bit_trans_table_0[g][0]);
393+ uint16_t *pr = &(bit_trans_table_1[r][0]);
394+ uint16_t *pb = &(bit_trans_table_2[b][0]);
395+ uint16_t tmp_d[8];
396+ scrntype_t tmp_dd[8];
397+
259398 __DECL_VECTORIZED_LOOP
260- for(int i = 0; i < 8; i++) {
261- _rtmp[i] = p0[i];
262- _rtmp[i] = _rtmp[i] | p1[i];
263- _rtmp[i] = _rtmp[i] | p2[i];
264- _rtmp[i] = _rtmp[i] | p3[i];
265- _rtmp[i] = _rtmp[i] | p4[i];
266- _rtmp[i] = _rtmp[i] | p5[i];
267- }
268- } else {
399+ for(int i = 0; i < 8; i++) {
400+ tmp_d[i] = pr[i];
401+ tmp_d[i] = tmp_d[i] | pg[i];
402+ tmp_d[i] = tmp_d[i] | pb[i];
403+ tmp_d[i] = tmp_d[i] >> 5;
404+ }
405+
269406 __DECL_VECTORIZED_LOOP
270- for(int i = 0; i < 8; i++) {
271- _rtmp[i] = 0;
272- }
407+ for(int i = 0; i < 8; i++) {
408+ tmp_dd[i] = dpalette_pixel[tmp_d[i]];
273409 }
274- if(!multimode_dispflags[2]) {
275- //if(mask & 0x04) {
276- // G
277- gg[0] = gvram_shadow[yoff_d1 + 0x08000];
278- gg[1] = gvram_shadow[yoff_d1 + 0x0a000];
279-
280- gg[2] = gvram_shadow[yoff_d2 + 0x14000];
281- gg[3] = gvram_shadow[yoff_d2 + 0x16000];
282-
283- gg[4] = gvram_shadow[yoff_d1 + 0x20000];
284- gg[5] = gvram_shadow[yoff_d1 + 0x22000];
285-
286- p0 = &(bit_trans_table_0[gg[0]][0]);
287- p1 = &(bit_trans_table_1[gg[1]][0]);
288- p2 = &(bit_trans_table_2[gg[2]][0]);
289- p3 = &(bit_trans_table_3[gg[3]][0]);
290- p4 = &(bit_trans_table_4[gg[4]][0]);
291- p5 = &(bit_trans_table_5[gg[5]][0]);
410+#if defined(FIXED_FRAMEBUFFER_SIZE)
411+ if(scan_line) {
412+/* Fancy scanline */
413+ #if defined(_RGB555) || defined(_RGBA565)
414+ static const int shift_factor = 2;
415+ #else // 24bit
416+ static const int shift_factor = 3;
417+ #endif
292418 __DECL_VECTORIZED_LOOP
293419 for(int i = 0; i < 8; i++) {
294- _gtmp[i] = p0[i];
295- _gtmp[i] = _gtmp[i] | p1[i];
296- _gtmp[i] = _gtmp[i] | p2[i];
297- _gtmp[i] = _gtmp[i] | p3[i];
298- _gtmp[i] = _gtmp[i] | p4[i];
299- _gtmp[i] = _gtmp[i] | p5[i];
420+ p[i] = tmp_dd[i];
421+ tmp_dd[i] = (tmp_dd[i] >> shift_factor) & (const scrntype_t)RGBA_COLOR(31, 31, 31, 255);;
422+ px[i] = tmp_dd[i];
300423 }
301424 } else {
302425 __DECL_VECTORIZED_LOOP
303426 for(int i = 0; i < 8; i++) {
304- _gtmp[i] = 0;
427+ p[i] = tmp_dd[i];
428+ px[i] = tmp_dd[i];
305429 }
306430 }
307-#if !defined(FIXED_FRAMEBUFFER_SIZE)
431+#else
308432 __DECL_VECTORIZED_LOOP
309433 for(int i = 0; i < 8; i++) {
310- tmp_dd[i] = RGB_COLOR(_rtmp[i], _gtmp[i], _btmp[i]);
311434 p[i] = tmp_dd[i];
312435 }
313-#else
314-__DECL_VECTORIZED_LOOP
315- for(int i = 0; i < 8; i++) {
316- tmp_dd[i * 2] = tmp_dd[i * 2 + 1] = RGB_COLOR(_rtmp[i], _gtmp[i], _btmp[i]);
317- }
318-__DECL_VECTORIZED_LOOP
319- for(int i = 0; i < 16; i++) {
320- p[i] = tmp_dd[i];
321- }
322- if(scan_line) {
323-/* Fancy scanline */
324-__DECL_VECTORIZED_LOOP
325- for(int i = 0; i < 16; i++) {
326-#if defined(_RGB888) || defined(_RGBA888)
327- tmp_dd[i] = tmp_dd[i] >> 3;
328-#elif defined(_RGB555)
329- tmp_dd[i] = tmp_dd[i] >> 2;
330-#elif defined(_RGB565)
331- tmp_dd[i] = tmp_dd[i] >> 2;
332-#endif
333- }
334-__DECL_VECTORIZED_LOOP
335- for(int i = 0; i < 16; i++) {
336- tmp_dd[i] = tmp_dd[i] & RGBA_COLOR(31, 31, 31, 256);
337- px[i] = tmp_dd[i];
338- }
339- } else {
340-__DECL_VECTORIZED_LOOP
341- for(int i = 0; i < 16; i++) {
342- px[i] = tmp_dd[i];
343- }
344- }
345436 #endif
346437 }
347-#endif
348438
349439 #if defined(_FM77AV_VARIANTS)
350440 void DISPLAY::GETVRAM_4096(int yoff, scrntype_t *p, scrntype_t *px,
351441 uint32_t mask,
352- bool window_inv = false,
353- bool scan_line = false)
442+ bool window_inv,
443+ bool scan_line)
354444 {
355445 uint32_t b3, r3, g3;
356446 uint8_t bb[4], rr[4], gg[4];
@@ -494,333 +584,216 @@ __DECL_VECTORIZED_LOOP
494584 }
495585 #endif
496586
497-
498-void DISPLAY::draw_screen()
499-{
500-//#if !defined(_FM77AV_VARIANTS)
501- this->draw_screen2();
502-//#endif
503-}
504-
505-extern config_t config;
506-void DISPLAY::draw_screen2()
587+#if defined(_FM77AV40) || defined(_FM77AV40EX) || defined(_FM77AV40SX)
588+void DISPLAY::GETVRAM_8_400L(int yoff, scrntype_t *p,
589+ bool window_inv)
507590 {
508- int y;
509- int x;
510- scrntype_t *p, *pp, *p2;
511- int yoff;
512- int yy;
513- int k;
514- //uint32_t rgbmask;
515- uint32_t yoff_d1, yoff_d2;
516- uint16_t wx_begin, wx_end, wy_low, wy_high;
517- bool scan_line = config.scan_line;
518-
519-#if defined(_FM77AV40EX) || defined(_FM77AV40SX)
520- {
521- wx_begin = window_xbegin;
522- wx_end = window_xend;
523- wy_low = window_low;
524- wy_high = window_high;
525- bool _flag = window_opened;
526- if((wx_begin < wx_end) && (wy_low < wy_high)) {
527- window_opened = true;
591+ uint8_t b, r, g;
592+ uint32_t dot;
593+ uint32_t yoff_d;
594+# if defined(_FM77AV40EX) || defined(_FM77AV40SX)
595+ int dpage = vram_display_block;
596+# endif
597+ if(p == NULL) return;
598+ yoff_d = yoff;
599+# if defined(_FM77AV40EX) || defined(_FM77AV40SX)
600+ if(window_inv) {
601+ if(dpage == 0) {
602+ dpage = 1;
528603 } else {
529- window_opened = false;
530- }
531- if(_flag != window_opened) {
532- vram_wrote_shadow = true;
604+ dpage = 0;
533605 }
534606 }
535-#endif
536-// frame_skip_count_draw++;
537-#if defined(_FM77AV_VARIANTS)
538- yoff_d2 = 0;
539- yoff_d1 = 0;
540-#else
541- //if(!(vram_wrote_shadow)) return;
542- yoff_d1 = yoff_d2 = offset_point;
543-#endif
544- // Set blank
545- if(!crt_flag) {
546- if(crt_flag_bak) {
547- scrntype_t *ppp;
548- if(display_mode == DISPLAY_MODE_8_200L) {
549-# if !defined(FIXED_FRAMEBUFFER_SIZE)
550- emu->set_vm_screen_size(640, 200, WINDOW_WIDTH, WINDOW_HEIGHT, WINDOW_WIDTH_ASPECT, WINDOW_HEIGHT_ASPECT);
551-# endif
552- emu->set_vm_screen_lines(200);
553-#if !defined(FIXED_FRAMEBUFFER_SIZE)
554- for(y = 0; y < 200; y += 8) {
555- for(yy = 0; yy < 8; yy++) {
556- vram_draw_table[y + yy] = false;
557- ppp = emu->get_screen_buffer(y + yy);
558- if(ppp != NULL) memset(ppp, 0x00, 640 * sizeof(scrntype_t));
559- }
560- }
561-#else
562- for(y = 0; y < 400; y += 8) {
563- for(yy = 0; yy < 8; yy++) {
564- vram_draw_table[y + yy] = false;
565- ppp = emu->get_screen_buffer(y + yy);
566- if(ppp != NULL) memset(ppp, 0x00, 640 * sizeof(scrntype_t));
567- }
568- }
569-#endif
570- } else if(display_mode == DISPLAY_MODE_8_400L) {
571- emu->set_vm_screen_lines(400);
572- emu->set_vm_screen_size(640, 400, WINDOW_WIDTH, WINDOW_HEIGHT, WINDOW_WIDTH_ASPECT, WINDOW_HEIGHT_ASPECT);
573- for(y = 0; y < 400; y += 8) {
574- for(yy = 0; yy < 8; yy++) {
575- vram_draw_table[y + yy] = false;
576- ppp = emu->get_screen_buffer(y + yy);
577- if(ppp != NULL) memset(ppp, 0x00, 640 * sizeof(scrntype_t));
578- }
579- }
580- } else { // 320x200
581-# if !defined(FIXED_FRAMEBUFFER_SIZE)
582- emu->set_vm_screen_size(320, 200, WINDOW_WIDTH, WINDOW_HEIGHT, WINDOW_WIDTH_ASPECT, WINDOW_HEIGHT_ASPECT);
607+ if(dpage != 0) yoff_d += 0x18000;
583608 # endif
584- emu->set_vm_screen_lines(200);
585-#if !defined(FIXED_FRAMEBUFFER_SIZE)
586- for(y = 0; y < 200; y += 8) {
587- for(yy = 0; yy < 8; yy++) {
588- vram_draw_table[y + yy] = false;
589- ppp = emu->get_screen_buffer(y + yy);
590- if(ppp != NULL) memset(ppp, 0x00, 320 * sizeof(scrntype_t));
591- }
592- }
593-#else
594- for(y = 0; y < 400; y++) {
595- for(yy = 0; yy < 8; yy++) {
596- vram_draw_table[y + yy] = false;
597- ppp = emu->get_screen_buffer(y + yy);
598- if(ppp != NULL) memset(ppp, 0x00, 640 * sizeof(scrntype_t));
599- }
600- }
601-#endif
602- }
603- }
604- crt_flag_bak = crt_flag;
605- return;
609+ b = r = g = 0;
610+ if(!multimode_dispflags[0]) b = gvram_shadow[yoff_d + 0x00000];
611+ if(!multimode_dispflags[1]) r = gvram_shadow[yoff_d + 0x08000];
612+ if(!multimode_dispflags[2]) g = gvram_shadow[yoff_d + 0x10000];
613+
614+ uint16_t *pg = &(bit_trans_table_0[g][0]);
615+ uint16_t *pr = &(bit_trans_table_1[r][0]);
616+ uint16_t *pb = &(bit_trans_table_2[b][0]);
617+ uint16_t tmp_d[8];
618+
619+__DECL_VECTORIZED_LOOP
620+ for(int i = 0; i < 8; i++) {
621+ tmp_d[i] = pg[i] | pr[i] | pb[i];
622+ tmp_d[i] = tmp_d[i] >> 5;
623+ }
624+__DECL_VECTORIZED_LOOP
625+ for(int i = 0; i < 8; i++) {
626+ p[i] = dpalette_pixel[tmp_d[i]];
606627 }
607- crt_flag_bak = crt_flag;
608- if(!vram_wrote_shadow) return;
609- vram_wrote_shadow = false;
610- if(display_mode == DISPLAY_MODE_8_200L) {
611- int ii;
612-# if !defined(FIXED_FRAMEBUFFER_SIZE)
613- emu->set_vm_screen_size(640, 200, WINDOW_WIDTH, WINDOW_HEIGHT, WINDOW_WIDTH_ASPECT, WINDOW_HEIGHT_ASPECT);
614-# endif
615- emu->set_vm_screen_lines(200);
616- yoff = 0;
617- for(y = 0; y < 200; y += 8) {
618- for(yy = 0; yy < 8; yy++) {
619-
620- if(!vram_draw_table[y + yy]) continue;
621- vram_draw_table[y + yy] = false;
628+}
629+
630+void DISPLAY::GETVRAM_256k(int yoff, scrntype_t *p, scrntype_t *px, bool scan_line)
631+{
632+ uint32_t b3, r3, g3;
633+ uint32_t b4, r4, g4;
634+ uint32_t btmp, rtmp, gtmp;
635+
636+ scrntype_t b, r, g;
637+ scrntype_t pixel;
638+ uint32_t _bit;
639+ int _shift;
640+ int cp;
641+ uint32_t yoff_d1;
642+ uint32_t yoff_d2;
643+ if(p == NULL) return;
644+
645+ r3 = g3 = b3 = 0;
646+ r4 = g4 = b4 = 0;
647+ r = g = b = 0;
648+
649+ yoff_d1 = yoff;
650+ yoff_d2 = yoff;
651+
652+ uint8_t bb[8], rr[8], gg[8];
653+ uint16_t *p0, *p1, *p2, *p3, *p4, *p5;
654+ uint32_t _btmp[8], _rtmp[8], _gtmp[8];
622655 #if !defined(FIXED_FRAMEBUFFER_SIZE)
623- p = emu->get_screen_buffer(y + yy);
624- p2 = NULL;
656+ scrntype_t tmp_dd[8];
625657 #else
626- p = emu->get_screen_buffer((y + yy) * 2);
627- p2 = emu->get_screen_buffer((y + yy) * 2 + 1);
628-#endif
629- if(p == NULL) continue;
630- yoff = (y + yy) * 80;
631-# if defined(_FM77AV40EX) || defined(_FM77AV40SX)
632- if(window_opened && (wy_low <= (y + yy)) && (wy_high > (y + yy))) {
633- for(x = 0; x < 80; x++) {
634- if((x >= wx_begin) && (x < wx_end)) {
635- GETVRAM_8_200L(yoff, p, p2, true, scan_line);
636- } else {
637- GETVRAM_8_200L(yoff, p, p2, false, scan_line);
638- }
639-#if defined(FIXED_FRAMEBUFFER_SIZE)
640- p2 += 8;
641-#endif
642- p += 8;
643- yoff++;
644- }
645- } else
646-# endif
647- {
648- for(x = 0; x < 10; x++) {
649- for(ii = 0; ii < 8; ii++) {
650- GETVRAM_8_200L(yoff + ii, p, p2, false, scan_line);
651-#if defined(FIXED_FRAMEBUFFER_SIZE)
652- p2 += 8;
658+ scrntype_t tmp_dd[16];
653659 #endif
654- p += 8;
655- }
656- yoff += 8;
657- }
658- }
659- }
660-
660+// if(mask & 0x01) {
661+ if(!multimode_dispflags[0]) {
662+ // B
663+ bb[0] = gvram_shadow[yoff_d1];
664+ bb[1] = gvram_shadow[yoff_d1 + 0x02000];
665+
666+ bb[2] = gvram_shadow[yoff_d2 + 0x0c000];
667+ bb[3] = gvram_shadow[yoff_d2 + 0x0e000];
668+
669+ bb[4] = gvram_shadow[yoff_d1 + 0x18000];
670+ bb[5] = gvram_shadow[yoff_d1 + 0x1a000];
671+
672+ p0 = &(bit_trans_table_0[bb[0]][0]);
673+ p1 = &(bit_trans_table_1[bb[1]][0]);
674+ p2 = &(bit_trans_table_2[bb[2]][0]);
675+ p3 = &(bit_trans_table_3[bb[3]][0]);
676+ p4 = &(bit_trans_table_4[bb[4]][0]);
677+ p5 = &(bit_trans_table_5[bb[5]][0]);
678+__DECL_VECTORIZED_LOOP
679+ for(int i = 0; i < 8; i++) {
680+ _btmp[i] = p0[i];
681+ _btmp[i] = _btmp[i] | p1[i];
682+ _btmp[i] = _btmp[i] | p2[i];
683+ _btmp[i] = _btmp[i] | p3[i];
684+ _btmp[i] = _btmp[i] | p4[i];
685+ _btmp[i] = _btmp[i] | p5[i];
686+ }
687+ } else {
688+__DECL_VECTORIZED_LOOP
689+ for(int i = 0; i < 8; i++) {
690+ _btmp[i] = 0;
661691 }
662- return;
663692 }
664-# if defined(_FM77AV_VARIANTS)
665- if(display_mode == DISPLAY_MODE_4096) {
666-# if !defined(FIXED_FRAMEBUFFER_SIZE)
667- emu->set_vm_screen_size(320, 200, WINDOW_WIDTH, WINDOW_HEIGHT, WINDOW_WIDTH_ASPECT, WINDOW_HEIGHT_ASPECT);
668-# endif
669- emu->set_vm_screen_lines(200);
670- uint32_t mask = 0;
671- int ii;
672- yoff = 0;
673- if(!multimode_dispflags[0]) mask = 0x00f;
674- if(!multimode_dispflags[1]) mask = mask | 0x0f0;
675- if(!multimode_dispflags[2]) mask = mask | 0xf00;
676- for(y = 0; y < 200; y += 4) {
677- for(yy = 0; yy < 4; yy++) {
678- if(!vram_draw_table[y + yy]) continue;
679- vram_draw_table[y + yy] = false;
680-
681-#if !defined(FIXED_FRAMEBUFFER_SIZE)
682- p = emu->get_screen_buffer(y + yy);
683- p2 = NULL;
684-#else
685- p = emu->get_screen_buffer((y + yy) * 2 );
686- p2 = emu->get_screen_buffer((y + yy) * 2 + 1);
687-#endif
688- if(p == NULL) continue;
689- yoff = (y + yy) * 40;
690-# if defined(_FM77AV40EX) || defined(_FM77AV40SX)
691- if(window_opened && (wy_low <= (y + yy)) && (wy_high > (y + yy))) {
692- for(x = 0; x < 40; x++) {
693- if((x >= wx_begin) && (x < wx_end)) {
694- GETVRAM_4096(yoff, p, p2, mask, true, scan_line);
695- } else {
696- GETVRAM_4096(yoff, p, p2, mask, false, scan_line);
697- }
698-#if defined(FIXED_FRAMEBUFFER_SIZE)
699- p2 += 16;
700- p += 16;
701-#else
702- p += 8;
703-#endif
704- yoff++;
705- }
706- } else
707-# endif
708- {
709- for(x = 0; x < 5; x++) {
710- for(ii = 0; ii < 8; ii++) {
711- GETVRAM_4096(yoff + ii, p, p2, mask, false, scan_line);
712-#if defined(FIXED_FRAMEBUFFER_SIZE)
713- p2 += 16;
714- p += 16;
715-#else
716- p += 8;
717-#endif
718- }
719- yoff += 8;
720- }
721- }
722- }
723-
693+ if(!multimode_dispflags[1]) {
694+ //if(mask & 0x02) {
695+ // R
696+ rr[0] = gvram_shadow[yoff_d1 + 0x04000];
697+ rr[1] = gvram_shadow[yoff_d1 + 0x06000];
698+
699+ rr[2] = gvram_shadow[yoff_d2 + 0x10000];
700+ rr[3] = gvram_shadow[yoff_d2 + 0x12000];
701+
702+ rr[4] = gvram_shadow[yoff_d1 + 0x1c000];
703+ rr[5] = gvram_shadow[yoff_d1 + 0x1e000];
704+
705+ p0 = &(bit_trans_table_0[rr[0]][0]);
706+ p1 = &(bit_trans_table_1[rr[1]][0]);
707+ p2 = &(bit_trans_table_2[rr[2]][0]);
708+ p3 = &(bit_trans_table_3[rr[3]][0]);
709+ p4 = &(bit_trans_table_4[rr[4]][0]);
710+ p5 = &(bit_trans_table_5[rr[5]][0]);
711+__DECL_VECTORIZED_LOOP
712+ for(int i = 0; i < 8; i++) {
713+ _rtmp[i] = p0[i];
714+ _rtmp[i] = _rtmp[i] | p1[i];
715+ _rtmp[i] = _rtmp[i] | p2[i];
716+ _rtmp[i] = _rtmp[i] | p3[i];
717+ _rtmp[i] = _rtmp[i] | p4[i];
718+ _rtmp[i] = _rtmp[i] | p5[i];
719+ }
720+ } else {
721+__DECL_VECTORIZED_LOOP
722+ for(int i = 0; i < 8; i++) {
723+ _rtmp[i] = 0;
724724 }
725- return;
726725 }
727-# if defined(_FM77AV40) || defined(_FM77AV40EX) || defined(_FM77AV40SX)
728- else if(display_mode == DISPLAY_MODE_8_400L) {
729- int ii;
730- emu->set_vm_screen_size(640, 400, WINDOW_WIDTH, WINDOW_HEIGHT, WINDOW_WIDTH_ASPECT, WINDOW_HEIGHT_ASPECT);
731- emu->set_vm_screen_lines(400);
732- yoff = 0;
733- //rgbmask = ~multimode_dispmask;
734- for(y = 0; y < 400; y += 8) {
735- for(yy = 0; yy < 8; yy++) {
736- if(!vram_draw_table[y + yy]) continue;
737- vram_draw_table[y + yy] = false;
738-
739- p = emu->get_screen_buffer(y + yy);
740- if(p == NULL) continue;
741- pp = p;
742- yoff = (y + yy) * 80;
743-# if defined(_FM77AV40EX) || defined(_FM77AV40SX)
744- if(window_opened && (wy_low <= (y + yy)) && (wy_high > (y + yy))) {
745- for(x = 0; x < 80; x++) {
746- if((x >= wx_begin) && (x < wx_end)) {
747- GETVRAM_8_400L(yoff, p, true);
748- } else {
749- GETVRAM_8_400L(yoff, p, false);
750- }
751- p += 8;
752- yoff++;
753- }
754- } else
755-# endif
756- for(x = 0; x < 10; x++) {
757-
758- for(ii = 0; ii < 8; ii++) {
759- GETVRAM_8_400L(yoff + ii, p);
760- p += 8;
761- }
762- yoff += 8;
763- }
764- }
726+ if(!multimode_dispflags[2]) {
727+ //if(mask & 0x04) {
728+ // G
729+ gg[0] = gvram_shadow[yoff_d1 + 0x08000];
730+ gg[1] = gvram_shadow[yoff_d1 + 0x0a000];
731+
732+ gg[2] = gvram_shadow[yoff_d2 + 0x14000];
733+ gg[3] = gvram_shadow[yoff_d2 + 0x16000];
734+
735+ gg[4] = gvram_shadow[yoff_d1 + 0x20000];
736+ gg[5] = gvram_shadow[yoff_d1 + 0x22000];
737+
738+ p0 = &(bit_trans_table_0[gg[0]][0]);
739+ p1 = &(bit_trans_table_1[gg[1]][0]);
740+ p2 = &(bit_trans_table_2[gg[2]][0]);
741+ p3 = &(bit_trans_table_3[gg[3]][0]);
742+ p4 = &(bit_trans_table_4[gg[4]][0]);
743+ p5 = &(bit_trans_table_5[gg[5]][0]);
744+__DECL_VECTORIZED_LOOP
745+ for(int i = 0; i < 8; i++) {
746+ _gtmp[i] = p0[i];
747+ _gtmp[i] = _gtmp[i] | p1[i];
748+ _gtmp[i] = _gtmp[i] | p2[i];
749+ _gtmp[i] = _gtmp[i] | p3[i];
750+ _gtmp[i] = _gtmp[i] | p4[i];
751+ _gtmp[i] = _gtmp[i] | p5[i];
765752 }
766- return;
767- } else if(display_mode == DISPLAY_MODE_256k) {
768- int ii;
769-# if !defined(FIXED_FRAMEBUFFER_SIZE)
770- emu->set_vm_screen_size(320, 200, WINDOW_WIDTH, WINDOW_HEIGHT, WINDOW_WIDTH_ASPECT, WINDOW_HEIGHT_ASPECT);
771-# endif
772- emu->set_vm_screen_lines(200);
773- //rgbmask = ~multimode_dispmask;
774- //
775- for(y = 0; y < 200; y += 4) {
776- for(yy = 0; yy < 4; yy++) {
777- if(!vram_draw_table[y + yy]) continue;
778- vram_draw_table[y + yy] = false;
779-#if !defined(FIXED_FRAMEBUFFER_SIZE)
780- p = emu->get_screen_buffer(y + yy);
781- p2 = NULL;
782-#else
783- p = emu->get_screen_buffer((y + yy) * 2 );
784- p2 = emu->get_screen_buffer((y + yy) * 2 + 1);
785-#endif
786- if(p == NULL) continue;
787- pp = p;
788- yoff = (y + yy) * 40;
789- {
790- for(x = 0; x < 5; x++) {
791- for(ii = 0; ii < 8; ii++) {
792- GETVRAM_256k(yoff + ii, p, p2, scan_line);
753+ } else {
754+__DECL_VECTORIZED_LOOP
755+ for(int i = 0; i < 8; i++) {
756+ _gtmp[i] = 0;
757+ }
758+ }
793759 #if !defined(FIXED_FRAMEBUFFER_SIZE)
794- p += 8;
760+__DECL_VECTORIZED_LOOP
761+ for(int i = 0; i < 8; i++) {
762+ tmp_dd[i] = RGB_COLOR(_rtmp[i], _gtmp[i], _btmp[i]);
763+ p[i] = tmp_dd[i];
764+ }
795765 #else
796- p += 16;
797- p2 += 16;
766+__DECL_VECTORIZED_LOOP
767+ for(int i = 0; i < 8; i++) {
768+ tmp_dd[i * 2] = tmp_dd[i * 2 + 1] = RGB_COLOR(_rtmp[i], _gtmp[i], _btmp[i]);
769+ }
770+__DECL_VECTORIZED_LOOP
771+ for(int i = 0; i < 16; i++) {
772+ p[i] = tmp_dd[i];
773+ }
774+ if(scan_line) {
775+/* Fancy scanline */
776+__DECL_VECTORIZED_LOOP
777+ for(int i = 0; i < 16; i++) {
778+#if defined(_RGB888) || defined(_RGBA888)
779+ tmp_dd[i] = tmp_dd[i] >> 3;
780+#elif defined(_RGB555)
781+ tmp_dd[i] = tmp_dd[i] >> 2;
782+#elif defined(_RGB565)
783+ tmp_dd[i] = tmp_dd[i] >> 2;
798784 #endif
799- }
800- yoff += 8;
801- }
802- }
803- }
804785 }
805- return;
806- }
807-# endif // _FM77AV40
808-# endif //_FM77AV_VARIANTS
809-}
810-
811-bool DISPLAY::screen_update(void)
812-{
813- if(crt_flag) {
814- bool f = screen_update_flag;
815- screen_update_flag = false;
816- return f;
786+__DECL_VECTORIZED_LOOP
787+ for(int i = 0; i < 16; i++) {
788+ tmp_dd[i] = tmp_dd[i] & RGBA_COLOR(31, 31, 31, 256);
789+ px[i] = tmp_dd[i];
790+ }
817791 } else {
818- if(crt_flag_bak) return true;
792+__DECL_VECTORIZED_LOOP
793+ for(int i = 0; i < 16; i++) {
794+ px[i] = tmp_dd[i];
795+ }
819796 }
820- return false;
821-}
822-
823-void DISPLAY::reset_screen_update(void)
824-{
825- screen_update_flag = false;
797+#endif
826798 }
799+#endif
Show on old repository browser