DOSBox-X branch

Here you can discuss the development of patches.

Re: DOSBox-X branch

Postby TheGreatCodeholio » 2019-3-30 @ 01:29

Morten79 wrote:Thanks alot Codeholio for making DOSBox-x. After using 0.82.4 for long time I decided too try the newest version. I then discovered that the Drive option was missing from the menu bar. Actually it's been missing since 0.82.7 2018-06-01 13:05.
Why did you removed that feature? I use it for one game that's on six CD images. I hope it's a minor bug that you're willing too fix soon. I've tested both the 32 and the 64-bit Windows versions. In the meantime I'll just use 0.82.6 :happy:
I'm using Windows 10 64-bit.


That happened when I replaced the Windows menu resource inherited from Daum's branch, with the menu framework. I didn't bother to recreate the drive list because I didn't see any demand for it.

I'll keep your request in mind. I think it would be helpful to be able to mount and change floppies and CDs at runtime too.

The biggest challenge obviously is to write common code that can show a "select file" interface across all platforms.

Windows obviously has the "GetOpenFileName" function, but I'm not yet familiar with Mac OS X for it's version of the same, and using one from a toolkit like GTK would require linking to a whole GUI toolkit in Linux, so it's probably going to have a custom drawn file select dialog for platforms other than Windows and Mac OS X.
DOSBox-X project: more emulation better accuracy.
DOSLIB and DOSLIB2: Learn how to tinker and hack hardware and software from DOS.
User avatar
TheGreatCodeholio
Oldbie
 
Posts: 674
Joined: 2011-8-18 @ 20:15
Location: Seattle, WA

Re: DOSBox-X branch

Postby bfcastello » 2019-3-30 @ 12:25

TheGreatCodeholio wrote:
Morten79 wrote:Thanks alot Codeholio for making DOSBox-x. After using 0.82.4 for long time I decided too try the newest version. I then discovered that the Drive option was missing from the menu bar. Actually it's been missing since 0.82.7 2018-06-01 13:05.
Why did you removed that feature? I use it for one game that's on six CD images. I hope it's a minor bug that you're willing too fix soon. I've tested both the 32 and the 64-bit Windows versions. In the meantime I'll just use 0.82.6 :happy:
I'm using Windows 10 64-bit.


That happened when I replaced the Windows menu resource inherited from Daum's branch, with the menu framework. I didn't bother to recreate the drive list because I didn't see any demand for it.

I'll keep your request in mind. I think it would be helpful to be able to mount and change floppies and CDs at runtime too.

The biggest challenge obviously is to write common code that can show a "select file" interface across all platforms.

Windows obviously has the "GetOpenFileName" function, but I'm not yet familiar with Mac OS X for it's version of the same, and using one from a toolkit like GTK would require linking to a whole GUI toolkit in Linux, so it's probably going to have a custom drawn file select dialog for platforms other than Windows and Mac OS X.



Boxer (boxerapp.com) a GUI frontend for dosbox, has a way to use CDs/floppies the way he described. You might want to check it
"Design isn't just what it looks like and feels like. Design is how it works."
JOBS, Steve.
User avatar
bfcastello
Member
 
Posts: 111
Joined: 2017-9-07 @ 02:39
Location: Catalonia, Spain

Re: DOSBox-X branch

Postby Morten79 » 2019-3-31 @ 08:22

bfcastello wrote:Boxer (boxerapp.com) a GUI frontend for dosbox, has a way to use CDs/floppies the way he described. You might want to check it

Boxer is only available for Mac OS X.
Morten79
Newbie
 
Posts: 4
Joined: 2017-8-12 @ 15:10

Re: DOSBox-X branch

Postby TheGreatCodeholio » 2019-3-31 @ 14:55

If Boxer is open source it may serve as something to study on how to do the File Open/Save dialog boxes in Mac OS X.
DOSBox-X project: more emulation better accuracy.
DOSLIB and DOSLIB2: Learn how to tinker and hack hardware and software from DOS.
User avatar
TheGreatCodeholio
Oldbie
 
Posts: 674
Joined: 2011-8-18 @ 20:15
Location: Seattle, WA

Re: DOSBox-X branch

Postby collector » 2019-4-01 @ 00:32

Wouldn't it have to be since it is based on DOSBox?
User avatar
collector
l33t
 
Posts: 4334
Joined: 2003-1-15 @ 10:39

Re: DOSBox-X branch

Postby bfcastello » 2019-4-03 @ 08:39

I think it is.

I was given a compiled 64bit version on their github page to test last year.

Boxer hasn’t been updated since then, I stopped using it when macOS Mojave came, and when I wanted to use NE2000 patch (boxer doesn’t have it).
"Design isn't just what it looks like and feels like. Design is how it works."
JOBS, Steve.
User avatar
bfcastello
Member
 
Posts: 111
Joined: 2017-9-07 @ 02:39
Location: Catalonia, Spain

Re: DOSBox-X branch

Postby hail-to-the-ryzen » 2019-4-04 @ 00:56

It is possible to keep use of the normal core in resolving the page faults for the normal core while using the full core to resolve the dynarec core faults. This is sample code:
Code: Select all
diff -rupN dosbox-X/src/cpu/cpu.cpp dosbox-X-Orig/src/cpu/cpu.cpp
--- dosbox-X/src/cpu/cpu.cpp   2019-04-03 20:32:50 -0400
+++ dosbox-X-Orig/src/cpu/cpu.cpp   2019-01-25 20:25:38 -0500
@@ -1817,17 +1817,6 @@ void CPU_Snap_Back_Forget() {
    snap_cpu_snapped = false;
 }
 
-bool CPU_IsDynamicCore(void) {
-#if (C_DYNAMIC_X86)
-    if (cpudecoder == &CPU_Core_Dyn_X86_Run)
-        return true;
-#elif (C_DYNREC)
-    if (cpudecoder == &CPU_Core_Dynrec_Run)
-        return true;
-#endif
-    return false;
-}
-
 static bool printed_cycles_auto_info = false;
 void CPU_SET_CRX(Bitu cr,Bitu value) {
    switch (cr) {
@@ -2688,13 +2677,17 @@ public:
       cpudecoder=&CPU_Core_Normal_Run;
       if (core == "normal") {
          cpudecoder=&CPU_Core_Normal_Run;
+         use_dynamic_core_with_paging=false;
       } else if (core =="simple") {
          cpudecoder=&CPU_Core_Simple_Run;
+         use_dynamic_core_with_paging=false;
       } else if (core == "full") {
          cpudecoder=&CPU_Core_Full_Run;
+         use_dynamic_core_with_paging=false;
       } else if (core == "auto") {
          cpudecoder=&CPU_Core_Normal_Run;
          CPU_AutoDetermineMode|=CPU_AUTODETERMINE_CORE;
+         use_dynamic_core_with_paging=false;
 #if (C_DYNAMIC_X86)
       } else if (core == "dynamic") {
          cpudecoder=&CPU_Core_Dyn_X86_Run;
@@ -2711,6 +2704,7 @@ public:
           std::string core("normal");
          LOG_MSG("CPU:Unknown core type %s, switching to normal.",core.c_str());
          cpudecoder=&CPU_Core_Normal_Run;
+         use_dynamic_core_with_paging=false;
        }
 
 #if (C_DYNAMIC_X86)
diff -rupN dosbox-X/src/cpu/paging.cpp dosbox-X-Orig/src/cpu/paging.cpp
--- dosbox-X/src/cpu/paging.cpp   2019-04-03 20:22:10 -0400
+++ dosbox-X-Orig/src/cpu/paging.cpp   2018-11-12 03:19:06 -0500
@@ -112,7 +112,10 @@ static Bits PageFaultCore(void) {
    CPU_CycleLeft+=CPU_Cycles;
    CPU_Cycles=1;
 
-   ret=CPU_Core_Full_Run();
+   if (!use_dynamic_core_with_paging)
+      ret=CPU_Core_Normal_Run();
+   else
+      ret=CPU_Core_Full_Run();
 
    CPU_CycleLeft+=CPU_Cycles;
    if (ret<0) E_Exit("Got a dosbox close machine in pagefault core?");
@@ -268,8 +271,6 @@ void PrintPageInfo(const char* string, P
 
 bool dosbox_allow_nonrecursive_page_fault = false;
 
-bool CPU_IsDynamicCore(void);
-
 // PAGING_NewPageFault
 // lin_addr, page_addr: the linear and page address the fault happened at
 // prepare_only: true in case the calling core handles the fault, else the PageFaultCore does
@@ -282,7 +283,7 @@ static void PAGING_NewPageFault(PhysPt l
    if (prepare_only) {
       cpu.exception.which = EXCEPTION_PF;
       cpu.exception.error = faultcode;
-   } else if (dosbox_allow_nonrecursive_page_fault && !CPU_IsDynamicCore()) {
+   } else if (dosbox_allow_nonrecursive_page_fault && !use_dynamic_core_with_paging) {
       throw GuestPageFaultException(lin_addr,page_addr,faultcode);   
 
    } else {

hail-to-the-ryzen
Member
 
Posts: 315
Joined: 2017-3-09 @ 01:34

Re: DOSBox-X branch

Postby Timbi » 2019-4-12 @ 12:37

Is possible to get rid of mouse lag in the Win95 protected mode MS-DOS? Basically when user runs the command line windowed, the mouse pointer lags and the refresh rate slightly changes to better while pressing or holding any key from keyboard input. Yet, the keyboard input works fine in both environments.
User avatar
Timbi
Newbie
 
Posts: 14
Joined: 2016-4-11 @ 09:07

Re: DOSBox-X branch

Postby hail-to-the-ryzen » 2019-4-20 @ 15:16

DOSBox-X has a modification to the dynamic core in decoder.h (as compared to vanilla dosbox):
Code: Select all
static bool MakeCodePage(Bitu lin_addr,CodePageHandler * &cph) {
   Bit8u rdval;
...
   if (handler->getFlags() & PFLAG_NOCODE) {
         LOG_MSG("DYNX86:Can't run code in this page!");
         cph=0;      return false;
   }


But the same code is unmodified except for the false condition in the dynrec core (decoder_basic.h):
Code: Select all
static bool MakeCodePage(Bitu lin_addr,CodePageHandlerDynRec * &cph) {
   Bit8u rdval;
...
   if (handler->flags & PFLAG_NOCODE) {
      if (false) { // PAGING_ForcePageInit(lin_addr)) {
         handler=get_tlb_readhandler(lin_addr);
         if (handler->flags & PFLAG_HASCODE) {
            cph=(CodePageHandlerDynRec *)handler;
            return false;
         }
      }
      if (handler->flags & PFLAG_NOCODE) {
         LOG_MSG("DYNREC:Can't run code in this page");
         cph=0;
         return false;
      }
   }

I think the modification to the dynamic core originated from Hal's modified dosbox build (megabuild) which was enhanced for paging operations. Since one of those code blocks in the dynrec is not active, it could be removed along with a redundant check on (handler->flags & PFLAG_NOCODE).
hail-to-the-ryzen
Member
 
Posts: 315
Joined: 2017-3-09 @ 01:34

Re: DOSBox-X branch

Postby hail-to-the-ryzen » 2019-4-28 @ 02:31

The recent compiler warning fix casts written only (/cpu/core_dynrec/cache.h):
Code: Select all
+         if (written>block->cache.size+CACHE_MAXSIZE) E_Exit("CacheBlock overrun 1 %lu",(unsigned long)written-block->cache.size);
but this could be written so both variables are cast like in a related line that is not shown here:
Code: Select all
+         if (written>block->cache.size+CACHE_MAXSIZE) E_Exit("CacheBlock overrun 1 %lu",(unsigned long)written-(unsigned long)block->cache.size);
hail-to-the-ryzen
Member
 
Posts: 315
Joined: 2017-3-09 @ 01:34

Re: DOSBox-X branch

Postby bfcastello » 2019-4-28 @ 14:00

hail-to-the-ryzen wrote:The recent compiler warning fix casts written only (/cpu/core_dynrec/cache.h):
Code: Select all
+         if (written>block->cache.size+CACHE_MAXSIZE) E_Exit("CacheBlock overrun 1 %lu",(unsigned long)written-block->cache.size);
but this could be written so both variables are cast like in a related line that is not shown here:
Code: Select all
+         if (written>block->cache.size+CACHE_MAXSIZE) E_Exit("CacheBlock overrun 1 %lu",(unsigned long)written-(unsigned long)block->cache.size);


Hmmmm.... why not post this on his github project page? Not a complaint, just a honest question
"Design isn't just what it looks like and feels like. Design is how it works."
JOBS, Steve.
User avatar
bfcastello
Member
 
Posts: 111
Joined: 2017-9-07 @ 02:39
Location: Catalonia, Spain

Re: DOSBox-X branch

Postby hail-to-the-ryzen » 2019-4-28 @ 20:32

So others may easily search and archive information.
hail-to-the-ryzen
Member
 
Posts: 315
Joined: 2017-3-09 @ 01:34

Re: DOSBox-X branch

Postby hail-to-the-ryzen » 2019-5-12 @ 21:57

Remapping video memory according to r3974 may restrict access to the mmio region by the s3 trio Windows driver. Testing in the dos box may verify.
hail-to-the-ryzen
Member
 
Posts: 315
Joined: 2017-3-09 @ 01:34

Previous

Return to DOSBox Patches

Who is online

Users browsing this forum: No registered users and 0 guests