hail-to-the-ryzen wrote:If umb=true, then should xms turn on automatically and a message printed to the log?
--- int10_modes-orig.cpp
+++ int10_modes.cpp
@@ -521,7 +521,11 @@ static void FinishSetMode(bool clearmem)
break;
case M_TEXT: {
Bit16u seg = (CurMode->mode==7)?0xb000:0xb800;
- for (Bit16u ct=0;ct<16*1024;ct++) real_writew(seg,ct*2,0x0720);
+ for (Bit16u ct=0;ct<16*1024;ct++) {
+ // LOG_MSG("Delay for clearing the memory");
+ VGAMEM_USEC_write_delay();
+ real_writew(seg,ct*2,0x0720);
+ }
break;
}
case M_EGA:
--- vga-orig.h
+++ vga.h
@@ -515,6 +515,8 @@ void SVGA_Setup_TsengET3K(void);
void SVGA_Setup_ParadisePVGA1A(void);
void SVGA_Setup_Driver(void);
+void VGAMEM_USEC_write_delay(void);
+
// Amount of video memory required for a mode, implemented in int10_modes.cpp
Bitu VideoModeMemSize(Bitu mode);
case M_TEXT: {
Bit16u seg = (CurMode->mode==7)?0xb000:0xb800;
for (Bit16u ct=0;ct<16*1024;ct++) real_writew(seg,ct*2,0x0720);
break;
}
case M_TEXT:
case M_EGA: case M_VGA: case M_LIN8: case M_LIN4: case M_LIN15: case M_LIN16:
case M_LIN32:
/* Hack we just access the memory directly */
memset(vga.mem.linear,0,vga.vmemsize);
memset(vga.fastmem, 0, vga.vmemsize<<1);
break;
--- int10_modes-orig.cpp
+++ int10_modes.cpp
@@ -1681,17 +1681,17 @@ dac_text16:
svga.set_video_mode(crtc_base, &modeData);
}
- FinishSetMode(clearmem);
-
/* Set vga attrib register into defined state */
IO_Read(mono_mode ? 0x3ba : 0x3da);
IO_Write(0x3c0,0x20);
- IO_Read(mono_mode ? 0x3ba : 0x3da);
/* Load text mode font */
if (CurMode->type==M_TEXT) {
INT10_ReloadFont();
}
+
+ FinishSetMode(clearmem);
+
// Enable screen memory access
IO_Write(0x3c4,1); IO_Write(0x3c5,seq_data[1] & ~0x20);
//LOG_MSG("setmode end");
danrevella wrote:Hi!!
Even on the very last version, the bios support for int 10h 1c02h is still broken.
Any help please?
diff -rupN dosbox-orig//src/cpu/core_dyn_x86/cache.h dosbox//src/cpu/core_dyn_x86/cache.h
--- dosbox-orig//src/cpu/core_dyn_x86/cache.h
+++ dosbox//src/cpu/core_dyn_x86/cache.h
@@ -483,17 +483,22 @@ static CacheBlock * cache_blocks=NULL;
static bool cache_initialized = false;
+extern int dynamic_core_cache_block_size;
+extern int cache_total_adjust;
+
static void cache_init(bool enable) {
Bits i;
+ int cache_total_adjust = 1 + ((dynamic_core_cache_block_size - 1) / 32);
+ // LOG_MSG("cache_total_adjust by %i",cache_total_adjust);
if (enable) {
if (cache_initialized) return;
cache_initialized = true;
if (cache_blocks == NULL) {
- cache_blocks=(CacheBlock*)malloc(CACHE_BLOCKS*sizeof(CacheBlock));
+ cache_blocks=(CacheBlock*)malloc((CACHE_BLOCKS*cache_total_adjust)*sizeof(CacheBlock));
if(!cache_blocks) E_Exit("Allocating cache_blocks has failed");
- memset(cache_blocks,0,sizeof(CacheBlock)*CACHE_BLOCKS);
+ memset(cache_blocks,0,sizeof(CacheBlock)*(CACHE_BLOCKS*cache_total_adjust));
cache.block.free=&cache_blocks[0];
- for (i=0;i<CACHE_BLOCKS-1;i++) {
+ for (i=0;i<(CACHE_BLOCKS*cache_total_adjust)-1;i++) {
cache_blocks[i].link[0].to=(CacheBlock *)1;
cache_blocks[i].link[1].to=(CacheBlock *)1;
cache_blocks[i].cache.next=&cache_blocks[i+1];
@@ -501,12 +506,12 @@ static void cache_init(bool enable) {
}
if (cache_code_start_ptr==NULL) {
#if defined (WIN32)
- cache_code_start_ptr=(Bit8u*)VirtualAlloc(0,CACHE_TOTAL+CACHE_MAXSIZE+PAGESIZE_TEMP-1+PAGESIZE_TEMP,
+ cache_code_start_ptr=(Bit8u*)VirtualAlloc(0,(CACHE_TOTAL*cache_total_adjust)+CACHE_MAXSIZE+PAGESIZE_TEMP-1+PAGESIZE_TEMP,
MEM_COMMIT,PAGE_EXECUTE_READWRITE);
if (!cache_code_start_ptr)
- cache_code_start_ptr=(Bit8u*)malloc(CACHE_TOTAL+CACHE_MAXSIZE+PAGESIZE_TEMP-1+PAGESIZE_TEMP);
+ cache_code_start_ptr=(Bit8u*)malloc((CACHE_TOTAL*cache_total_adjust)+CACHE_MAXSIZE+PAGESIZE_TEMP-1+PAGESIZE_TEMP);
#else
- cache_code_start_ptr=(Bit8u*)malloc(CACHE_TOTAL+CACHE_MAXSIZE+PAGESIZE_TEMP-1+PAGESIZE_TEMP);
+ cache_code_start_ptr=(Bit8u*)malloc((CACHE_TOTAL*cache_total_adjust)+CACHE_MAXSIZE+PAGESIZE_TEMP-1+PAGESIZE_TEMP);
#endif
if(!cache_code_start_ptr) E_Exit("Allocating dynamic core cache memory failed");
@@ -516,14 +521,14 @@ static void cache_init(bool enable) {
cache_code+=PAGESIZE_TEMP;
#if (C_HAVE_MPROTECT)
- if(mprotect(cache_code_link_blocks,CACHE_TOTAL+CACHE_MAXSIZE+PAGESIZE_TEMP,PROT_WRITE|PROT_READ|PROT_EXEC))
+ if(mprotect(cache_code_link_blocks,(CACHE_TOTAL*cache_total_adjust)+CACHE_MAXSIZE+PAGESIZE_TEMP,PROT_WRITE|PROT_READ|PROT_EXEC))
LOG_MSG("Setting excute permission on the code cache has failed!");
#endif
CacheBlock * block=cache_getblock();
cache.block.first=block;
cache.block.active=block;
block->cache.start=&cache_code[0];
- block->cache.size=CACHE_TOTAL;
+ block->cache.size=(CACHE_TOTAL*cache_total_adjust);
block->cache.next=0; //Last block in the list
}
/* Setup the default blocks for block linkage returns */
@@ -571,6 +576,8 @@ static void cache_close(void) {
}
static void cache_reset(void) {
+ int cache_total_adjust = 1 + ((dynamic_core_cache_block_size - 1) / 32);
+ // LOG_MSG("cache_total_adjust by %i",cache_total_adjust);
if (cache_initialized) {
for (;;) {
if (cache.used_pages) {
@@ -583,12 +590,12 @@ static void cache_reset(void) {
}
if (cache_blocks == NULL) {
- cache_blocks=(CacheBlock*)malloc(CACHE_BLOCKS*sizeof(CacheBlock));
+ cache_blocks=(CacheBlock*)malloc((CACHE_BLOCKS*cache_total_adjust)*sizeof(CacheBlock));
if(!cache_blocks) E_Exit("Allocating cache_blocks has failed");
}
- memset(cache_blocks,0,sizeof(CacheBlock)*CACHE_BLOCKS);
+ memset(cache_blocks,0,sizeof(CacheBlock)*(CACHE_BLOCKS*cache_total_adjust));
cache.block.free=&cache_blocks[0];
- for (Bits i=0;i<CACHE_BLOCKS-1;i++) {
+ for (Bits i=0;i<(CACHE_BLOCKS*cache_total_adjust)-1;i++) {
cache_blocks[i].link[0].to=(CacheBlock *)1;
cache_blocks[i].link[1].to=(CacheBlock *)1;
cache_blocks[i].cache.next=&cache_blocks[i+1];
@@ -596,12 +603,12 @@ static void cache_reset(void) {
if (cache_code_start_ptr==NULL) {
#if defined (WIN32)
- cache_code_start_ptr=(Bit8u*)VirtualAlloc(0,CACHE_TOTAL+CACHE_MAXSIZE+PAGESIZE_TEMP-1+PAGESIZE_TEMP,
+ cache_code_start_ptr=(Bit8u*)VirtualAlloc(0,(CACHE_TOTAL*cache_total_adjust)+CACHE_MAXSIZE+PAGESIZE_TEMP-1+PAGESIZE_TEMP,
MEM_COMMIT,PAGE_EXECUTE_READWRITE);
if (!cache_code_start_ptr)
- cache_code_start_ptr=(Bit8u*)malloc(CACHE_TOTAL+CACHE_MAXSIZE+PAGESIZE_TEMP-1+PAGESIZE_TEMP);
+ cache_code_start_ptr=(Bit8u*)malloc((CACHE_TOTAL*cache_total_adjust)+CACHE_MAXSIZE+PAGESIZE_TEMP-1+PAGESIZE_TEMP);
#else
- cache_code_start_ptr=(Bit8u*)malloc(CACHE_TOTAL+CACHE_MAXSIZE+PAGESIZE_TEMP-1+PAGESIZE_TEMP);
+ cache_code_start_ptr=(Bit8u*)malloc((CACHE_TOTAL*cache_total_adjust)+CACHE_MAXSIZE+PAGESIZE_TEMP-1+PAGESIZE_TEMP);
#endif
if (!cache_code_start_ptr) E_Exit("Allocating dynamic core cache memory failed");
@@ -611,7 +618,7 @@ static void cache_reset(void) {
cache_code+=PAGESIZE_TEMP;
#if (C_HAVE_MPROTECT)
- if(mprotect(cache_code_link_blocks,CACHE_TOTAL+CACHE_MAXSIZE+PAGESIZE_TEMP,PROT_WRITE|PROT_READ|PROT_EXEC))
+ if(mprotect(cache_code_link_blocks,(CACHE_TOTAL*cache_total_adjust)+CACHE_MAXSIZE+PAGESIZE_TEMP,PROT_WRITE|PROT_READ|PROT_EXEC))
LOG_MSG("Setting excute permission on the code cache has failed!");
#endif
}
@@ -620,7 +627,7 @@ static void cache_reset(void) {
cache.block.first=block;
cache.block.active=block;
block->cache.start=&cache_code[0];
- block->cache.size=CACHE_TOTAL;
+ block->cache.size=(CACHE_TOTAL*cache_total_adjust);
block->cache.next=0; //Last block in the list
/* Setup the default blocks for block linkage returns */
diff -rupN dosbox-orig//src/cpu/core_dyn_x86.cpp dosbox//src/cpu/core_dyn_x86.cpp
--- dosbox-orig//src/cpu/core_dyn_x86.cpp
+++ dosbox//src/cpu/core_dyn_x86.cpp
@@ -258,6 +258,11 @@ static void dyn_restoreregister(DynReg *
extern int dynamic_core_cache_block_size;
+/* Increase CACHE_TOTAL where block_size greater than 32 and by a factor which is rounded to next integer */
+/* dosbox.cpp defines block size as > 0 otherwise edit equation */
+extern int cache_total_adjust;
+int cache_total_adjust = 1;
+
static bool paging_warning = true;
Bits CPU_Core_Dyn_X86_Run(void) {
Users browsing this forum: No registered users and 1 guest