• R/O
  • HTTP
  • SSH
  • HTTPS

common_source_project-fm7: 提交

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


Commit MetaInfo

修订版3949356448e02b98ecec22d68c621ea52e611288 (tree)
时间2020-02-21 00:25:27
作者K.Ohta <whatisthis.sowhat@gmai...>
CommiterK.Ohta

Log Message

[VM][PC9801][DISPLAY] .

更改概述

差异

--- a/source/src/vm/pc9801/display.cpp
+++ b/source/src/vm/pc9801/display.cpp
@@ -255,7 +255,15 @@ void DISPLAY::initialize()
255255 // set vram pointer to gdc
256256 d_gdc_chr->set_vram_ptr(tvram, 0x2000);
257257 d_gdc_chr->set_screen_width(80);
258+#if !defined(SUPPORT_HIRESO)
259+ #if !defined(SUPPORT_2ND_VRAM)
258260 d_gdc_gfx->set_vram_bus_ptr(this, 0x20000);
261+ #else
262+ d_gdc_gfx->set_vram_bus_ptr(this, 0x40000);
263+ #endif
264+#else
265+ d_gdc_gfx->set_vram_bus_ptr(this, 0x80000);
266+#endif
259267 d_gdc_gfx->set_screen_width(SCREEN_WIDTH >> 3);
260268
261269 // register event
@@ -1194,12 +1202,16 @@ uint32_t DISPLAY::read_memory_mapped_io16(uint32_t addr)
11941202 void DISPLAY::write_dma_io8(uint32_t addr, uint32_t data)
11951203 {
11961204 #if defined(SUPPORT_GRCG)
1197- if(grcg_mode & GRCG_CG_MODE) {
1205+ if(grcg_cg_mode) {
1206+// if(grcg_mode & GRCG_CG_MODE) {
11981207 #if defined(SUPPORT_EGC)
1199- if(modereg2[MODE2_EGC]) {
1208+ if(enable_egc) {
1209+// if(modereg2[MODE2_EGC]) {
1210+// out_debug_log(_T("ADDR = %08X"), addr);
12001211 egc_writeb(addr, data);
12011212 } else
12021213 #endif
1214+// out_debug_log(_T("ADDR = %08X"), addr);
12031215 grcg_writeb(addr, data);
12041216 return;
12051217 }
@@ -1225,9 +1237,11 @@ void DISPLAY::write_dma_io8(uint32_t addr, uint32_t data)
12251237 void DISPLAY::write_dma_io16(uint32_t addr, uint32_t data)
12261238 {
12271239 #if defined(SUPPORT_GRCG)
1228- if(grcg_mode & GRCG_CG_MODE) {
1240+ if(grcg_cg_mode) {
1241+// if(grcg_mode & GRCG_CG_MODE) {
12291242 #if defined(SUPPORT_EGC)
1230- if(modereg2[MODE2_EGC]) {
1243+ if(enable_egc) {
1244+// if(modereg2[MODE2_EGC]) {
12311245 egc_writew(addr, data);
12321246 } else
12331247 #endif
@@ -1302,9 +1316,11 @@ void DISPLAY::write_dma_io16(uint32_t addr, uint32_t data)
13021316 uint32_t DISPLAY::read_dma_io8(uint32_t addr)
13031317 {
13041318 #if defined(SUPPORT_GRCG)
1305- if(grcg_mode & GRCG_CG_MODE) {
1319+ if(grcg_cg_mode) {
1320+// if(grcg_mode & GRCG_CG_MODE) {
13061321 #if defined(SUPPORT_EGC)
1307- if(modereg2[MODE2_EGC]) {
1322+ if(enable_egc) {
1323+// if(modereg2[MODE2_EGC]) {
13081324 return egc_readb(addr);
13091325 }
13101326 #endif
@@ -1322,9 +1338,11 @@ uint32_t DISPLAY::read_dma_io8(uint32_t addr)
13221338 uint32_t DISPLAY::read_dma_io16(uint32_t addr)
13231339 {
13241340 #if defined(SUPPORT_GRCG)
1325- if(grcg_mode & GRCG_CG_MODE) {
1341+ if(grcg_cg_mode) {
1342+// if(grcg_mode & GRCG_CG_MODE) {
13261343 #if defined(SUPPORT_EGC)
1327- if(modereg2[MODE2_EGC]) {
1344+ if(enable_egc) {
1345+// if(modereg2[MODE2_EGC]) {
13281346 return egc_readw(addr);
13291347 }
13301348 #endif
@@ -2108,6 +2126,11 @@ bool DISPLAY::process_state(FILEIO* state_fio, bool loading)
21082126
21092127 // post process
21102128 if(loading) {
2129+
2130+#if defined(SUPPORT_16_COLORS) && defined(SUPPORT_EGC)
2131+ is_use_egc = ((config.dipswitch & (1 << DIPSWITCH_POSITION_EGC)) != 0);
2132+ enable_egc = ((is_use_egc) && (modereg2[MODE2_EGC] != 0)) ? true : false;
2133+#endif
21112134 #if defined(SUPPORT_2ND_VRAM) && !defined(SUPPORT_HIRESO)
21122135 if(vram_disp_sel & 1) {
21132136 vram_disp_b = vram + 0x28000;
@@ -2131,6 +2154,8 @@ bool DISPLAY::process_state(FILEIO* state_fio, bool loading)
21312154 }
21322155 #endif
21332156 #if defined(SUPPORT_GRCG)
2157+ grcg_cg_mode = ((grcg_mode & GRCG_CG_MODE) != 0) ? true : false;
2158+ grcg_rw_mode = ((grcg_mode & GRCG_RW_MODE) != 0) ? true : false;
21342159 for(int i = 0; i < 4; i++) {
21352160 grcg_tile_word[i] = ((uint16_t)grcg_tile[i]) | ((uint16_t)grcg_tile[i] << 8);
21362161 }
--- a/source/src/vm/upd7220.cpp
+++ b/source/src/vm/upd7220.cpp
@@ -802,20 +802,20 @@ void UPD7220::cmd_vecte()
802802 wrote_bytes = 1;
803803
804804 // execute command
805- if(!(vect[0] & 0x78)) {
805+ if(!(vect[0] & 0x78)) { // R, C, T, L
806806 pattern = ra[8] | (ra[9] << 8);
807807 draw_pset(dx, dy);
808808 }
809- if(vect[0] & 0x08) {
809+ if(vect[0] & 0x08) { // L (Line)
810810 draw_vectl();
811811 }
812- if(vect[0] & 0x10) {
812+ if(vect[0] & 0x10) { // T (Text)
813813 draw_vectt();
814814 }
815- if(vect[0] & 0x20) {
815+ if(vect[0] & 0x20) { // C (Circle)
816816 draw_vectc();
817817 }
818- if(vect[0] & 0x40) {
818+ if(vect[0] & 0x40) { // R (Rect)
819819 draw_vectr();
820820 }
821821 reset_vect();
@@ -1269,7 +1269,9 @@ void UPD7220::draw_vectr()
12691269 int vx2 = vectdir[dir][2];
12701270 int vy2 = vectdir[dir][3];
12711271 pattern = ra[8] | (ra[9] << 8);
1272-
1272+
1273+// out_debug_log(_T("VECTR D=%d D2=%d START=%d,%d VX1,VY1,VX2,VY2 = %d,%d,%d,%d"),
1274+// d, d1, dx, dy, vx1, vy1, vx2,vy2);
12731275 for(int i = 0; i < d; i++) {
12741276 draw_pset(dx, dy);
12751277 dx += vx1;
@@ -1343,15 +1345,6 @@ void UPD7220::draw_pset(int x, int y)
13431345 pattern = (pattern >> 1) | (dot << 15);
13441346 uint32_t addr = y * width + (x >> 3);
13451347
1346- if((_UPD7220_UGLY_PC98_HACK)) {
1347-// if(addr >= 0x8000) return;
1348-// if((y == 409) && (x >= 384)) return;
1349-// if(y > 409) return;
1350-// if((x < 0) || (y < 0) || (x >= (width << 3))) return;
1351-// addr = addr & 0x7fff;
1352- } else {
1353- //if((x < 0) || (y < 0) || (x >= (width << 3)) || (y >= height)) return;
1354- }
13551348 uint8_t bit;
13561349 if(_UPD7220_MSB_FIRST) {
13571350 bit = 0x80 >> (x & 7);
Show on old repository browser