Re: Euphoria on DOSbox
- Posted by CChris <christian.cuvier at agriculture.?o?v.fr> Oct 30, 2007
- 834 views
Robert Craig wrote: > > CChris wrote: > > Really? > > The code in be_machine.c has some interrupt #31 calls which are specific to > > Causeway according to RBIL v61: > > * long_to_short(): AX=#FF21 (GetMemDOS) and #FF01 (RM interrupt) > > * InitGraphics(): AX=#FF08 (GetSelDet32) > > * user_allocate_low(): AX=#FF21 > > * user_free_low: AX=#FF23 (RelMemDOS) > > * dos_interrupt: AX=#FF01 > > > > So... I expect these areas of the backend source will require some > > alternative > > variant selected by an #ifdef ... #else directive. > > Thanks for spotting those calls. They are specialized bits > of code you would probably have to change to > achieve 100% compatibility, but I think the bulk of > Euphoria for DOS should work OK without any source code changes. > For instance, Bernie recently said he got pmodew working: > > <a > href="http://www.openeuphoria.org/EUforum/m17215.html">http://www.openeuphoria.org/EUforum/m17215.html</a> > > I switched over to the Causeway DOS extender, > from DOS4GW, more than a decade ago. > I compared against a couple of other DOS extenders at that time. > I recall that things pretty much worked immediately, > without any source changes, whichever extender I used. > Though, as you observe, I did eventually code a few > Causeway-specific calls to support some tricky stuff, > such as the Euphoria dos_interrupt() library routine etc. > > Regards, > Rob Craig > Rapid Deployment Software > <a href="http://www.RapidEuphoria.com">http://www.RapidEuphoria.com</a> Looking at the docs, you may even be able to drop Causeway specific calls altogether: * replace #FF21 by #0100 (DPMI DOS allocate) * replace #FF23 by #0101 (DPMI DOS free) * replace #FF01 by #0300 (DPMI perform real mode interrupt) * replace #FF08 by #0006 (DPMI get descriptor linear addr) The (slightly) tricky bit is at line 574, which would have to be edited as: peekaboo = ((regs.x.ecx && 0xFFFF)<<16)+(regs.x.edx && 0xFFFF); // base of selector I didn't find the definition for the REGS union - don't have a C compiler here -, so this line can probably be simplified by using the 16 bit register version only, since the base addr is returned in CX:DX instead of EDX. I didn't check whether the real mode call structures standard DPMI and CauseWay use are the same; I'd be surprised if they are not. Otherwise, register usage is consistent, so nothing else needs any change, since nothing else in the source depends on the extender. CChris