Common Source Code Project for Qt (a.k.a for FM-7).
Revision | 1a9e156197f199d3bbd1c9c17d94754773729abd (tree) |
---|---|
Time | 2018-11-05 21:57:03 |
Author | K.Ohta <whatisthis.sowhat@gmai...> |
Commiter | K.Ohta |
[VM][X1][VRAM] Apply renderer to TEXT/(P)CG rendering.
@@ -146,6 +146,10 @@ void DISPLAY::initialize() | ||
146 | 146 | zpalette_pc[8 + 6] = zpalette_pc[16 + 0xff0]; |
147 | 147 | zpalette_pc[8 + 7] = zpalette_pc[16 + 0xfff]; |
148 | 148 | #endif |
149 | + | |
150 | + PrepareBitTransTableUint16(&bit_trans_table_b0, 0x01, 0x00); | |
151 | + PrepareBitTransTableUint16(&bit_trans_table_r0, 0x02, 0x00); | |
152 | + PrepareBitTransTableUint16(&bit_trans_table_g0, 0x04, 0x00); | |
149 | 153 | } |
150 | 154 | |
151 | 155 | void DISPLAY::reset() |
@@ -1135,11 +1139,16 @@ void DISPLAY::draw_text(int y) | ||
1135 | 1139 | |
1136 | 1140 | if(attr & 0x80) { |
1137 | 1141 | // horizontal doubled char |
1142 | +#if 0 | |
1138 | 1143 | d[ 0] = d[ 1] = ((b & 0x80) >> 7) | ((r & 0x80) >> 6) | ((g & 0x80) >> 5); |
1139 | 1144 | d[ 2] = d[ 3] = ((b & 0x40) >> 6) | ((r & 0x40) >> 5) | ((g & 0x40) >> 4); |
1140 | 1145 | d[ 4] = d[ 5] = ((b & 0x20) >> 5) | ((r & 0x20) >> 4) | ((g & 0x20) >> 3); |
1141 | 1146 | d[ 6] = d[ 7] = ((b & 0x10) >> 4) | ((r & 0x10) >> 3) | ((g & 0x10) >> 2); |
1147 | +#else | |
1148 | + ConvertRGBTo8ColorsUint8_Zoom2Left(r, g, b, d, &bit_trans_table_r0, &bit_trans_table_g0, &bit_trans_table_b0, 0); | |
1149 | +#endif | |
1142 | 1150 | } else { |
1151 | +#if 0 | |
1143 | 1152 | d[0] = ((b & 0x80) >> 7) | ((r & 0x80) >> 6) | ((g & 0x80) >> 5); |
1144 | 1153 | d[1] = ((b & 0x40) >> 6) | ((r & 0x40) >> 5) | ((g & 0x40) >> 4); |
1145 | 1154 | d[2] = ((b & 0x20) >> 5) | ((r & 0x20) >> 4) | ((g & 0x20) >> 3); |
@@ -1148,6 +1157,9 @@ void DISPLAY::draw_text(int y) | ||
1148 | 1157 | d[5] = ((b & 0x04) >> 2) | ((r & 0x04) >> 1) | ((g & 0x04) >> 0); |
1149 | 1158 | d[6] = ((b & 0x02) >> 1) | ((r & 0x02) >> 0) | ((g & 0x02) << 1); |
1150 | 1159 | d[7] = ((b & 0x01) >> 0) | ((r & 0x01) << 1) | ((g & 0x01) << 2); |
1160 | +#else | |
1161 | + ConvertRGBTo8ColorsUint8(r, g, b, d, &bit_trans_table_r0, &bit_trans_table_g0, &bit_trans_table_b0, 0); | |
1162 | +#endif | |
1151 | 1163 | } |
1152 | 1164 | prev_attr = attr; |
1153 | 1165 | } |
@@ -1254,7 +1266,8 @@ void DISPLAY::draw_cg(int line, int plane) | ||
1254 | 1266 | int ofs_b = ofs + 0x0000; |
1255 | 1267 | int ofs_r = ofs + 0x4000; |
1256 | 1268 | int ofs_g = ofs + 0x8000; |
1257 | - | |
1269 | + | |
1270 | +#if 0 | |
1258 | 1271 | for(int x = 0; x < hz_disp && x < width; x++) { |
1259 | 1272 | src &= 0x7ff; |
1260 | 1273 | uint8_t b = vram_ptr[ofs_b | src]; |
@@ -1271,6 +1284,28 @@ void DISPLAY::draw_cg(int line, int plane) | ||
1271 | 1284 | d[6] = ((b & 0x02) >> 1) | ((r & 0x02) >> 0) | ((g & 0x02) << 1); |
1272 | 1285 | d[7] = ((b & 0x01) >> 0) | ((r & 0x01) << 1) | ((g & 0x01) << 2); |
1273 | 1286 | } |
1287 | +#else | |
1288 | + _render_command_data_t cmd; | |
1289 | + for(int i = 0; i < 3; i++) { | |
1290 | + cmd.data[i] = vram_ptr; | |
1291 | + cmd.baseaddress[i] = 0; | |
1292 | + } | |
1293 | + cmd.voffset[0] = ofs_b; | |
1294 | + cmd.voffset[1] = ofs_r; | |
1295 | + cmd.voffset[2] = ofs_g; | |
1296 | + cmd.bit_trans_table[0] = &bit_trans_table_b0; | |
1297 | + cmd.bit_trans_table[1] = &bit_trans_table_r0; | |
1298 | + cmd.bit_trans_table[2] = &bit_trans_table_g0; | |
1299 | + cmd.addrmask = 0xffffffff; | |
1300 | + cmd.addrmask2 = 0x07ff; | |
1301 | + cmd.begin_pos = src; | |
1302 | + cmd.shift = 0; | |
1303 | + int iwidth = (hz_disp > width) ? width : hz_disp; | |
1304 | + uint8_t* d = &(cg[line][0]); | |
1305 | + cmd.render_width = (iwidth <= 0) ? 0 : (uint32_t)iwidth; | |
1306 | + | |
1307 | + Convert8ColorsToByte_Line(&cmd, d); | |
1308 | +#endif | |
1274 | 1309 | } |
1275 | 1310 | } |
1276 | 1311 |
@@ -149,6 +149,10 @@ private: | ||
149 | 149 | uint16_t jis2sjis(uint16_t jis); |
150 | 150 | |
151 | 151 | int tmp_kanji_ptr; |
152 | + | |
153 | + _bit_trans_table_t bit_trans_table_b0 __attribute__((aligned(sizeof(uint16_vec8_t)))); | |
154 | + _bit_trans_table_t bit_trans_table_r0 __attribute__((aligned(sizeof(uint16_vec8_t)))); | |
155 | + _bit_trans_table_t bit_trans_table_g0 __attribute__((aligned(sizeof(uint16_vec8_t)))); | |
152 | 156 | public: |
153 | 157 | DISPLAY(VM_TEMPLATE* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu) |
154 | 158 | { |