New release of EightyOne available

Emulator and emulator development specific topics
Elurdio
Posts: 19
Joined: Thu Apr 28, 2022 3:44 pm

Re: New release of EightyOne available

Post by Elurdio »

Hi,

I began to use EighyOne emulator some months ago to emulate a Jupiter Ace. I have installed versión 1.28 now.

I leave the checkbox "Protect Rom from Writes" unchecked but ther ROM remains unwritable. How can I overwrite ROM memory?
Fruitcake
Posts: 346
Joined: Wed Sep 01, 2010 10:53 pm

Re: New release of EightyOne available

Post by Fruitcake »

Elurdio wrote: Mon May 02, 2022 9:36 pm I leave the checkbox "Protect Rom from Writes" unchecked but ther ROM remains unwritable. How can I overwrite ROM memory?
Looking at the code for EightyOne, there is a bug that means the "Protect Rom from Writes" checkbox is effectively ignored. A fix for this will appear in version 1.29.
Elurdio
Posts: 19
Joined: Thu Apr 28, 2022 3:44 pm

Re: New release of EightyOne available

Post by Elurdio »

Fruitcake wrote: Thu May 19, 2022 3:35 pm
Elurdio wrote: Mon May 02, 2022 9:36 pm I leave the checkbox "Protect Rom from Writes" unchecked but ther ROM remains unwritable. How can I overwrite ROM memory?
Looking at the code for EightyOne, there is a bug that means the "Protect Rom from Writes" checkbox is effectively ignored. A fix for this will appear in version 1.29.
Thanks!
jjp
Posts: 9
Joined: Tue Jul 20, 2021 1:13 am

Re: New release of EightyOne available

Post by jjp »

Hi!

I want request a path for EO, zxpand joys.
In wine it don't works fine, because the read_joy() function, check for exact values.
Let me explain

in my enviromnt

Code: Select all

joyGetDevCaps(0, &caps, sizeof(JOYCAPS));
return 65535 for wXmax and wYmax members in struct caps

but when it read the joy pos with

Code: Select all

joyGetPosEx(0, &joyInfo)
it return 65534 for dwYpos (down pos) and dwXpos (right pos).

I suggest this change in read_joy() function in Source/zxpand/js.cpp

Code: Select all

   if (JOYERR_NOERROR == joyGetPosEx(0, &joyInfo))
   {
      if (joyInfo.dwYpos <= caps.wYmin + 1) joypos &= 0x7f;
      if (joyInfo.dwYpos >= caps.wYmax - 1) joypos &= 0xbf;
      if (joyInfo.dwXpos <= caps.wXmin + 1) joypos &= 0xdf;
      if (joyInfo.dwXpos >= caps.wXmax - 1) joypos &= 0xef;
      if (joyInfo.dwButtons != 0) joypos &= 0xf7;
   }
or

Code: Select all

#include <windows.h>

static JOYCAPS caps;
static int dy, dx;

void initJoy(void)
{
   // don't bother with error checking;
   // if this fails the joyGetPos call will fail too.
   //
   joyGetDevCaps(0, &caps, sizeof(JOYCAPS));

    dy = ( caps.wYmax - caps.wYmin ) / 4, dx = ( caps.wXmax - caps.wXmin ) / 4;
}
 
unsigned char readJoy(void)
{
   JOYINFOEX joyInfo;
   joyInfo.dwFlags = JOY_RETURNBUTTONS | JOY_RETURNX | JOY_RETURNY;

   unsigned char joypos = 0xfe;

   if (JOYERR_NOERROR == joyGetPosEx(0, &joyInfo))
   {   
      if (joyInfo.dwYpos <= caps.wYmin + dy ) joypos &= 0x7f;
      if (joyInfo.dwYpos >= caps.wYmax - dy ) joypos &= 0xbf;
      if (joyInfo.dwXpos <= caps.wXmin + dx ) joypos &= 0xdf;
      if (joyInfo.dwXpos >= caps.wXmax - dx ) joypos &= 0xef;
      if (joyInfo.dwButtons != 0) joypos &= 0xf7;
   }
   
   if (GetKeyState(VK_NUMPAD8) & 0x8000)
   {
      joypos &= 0x7f;
   }
   else if (GetKeyState(VK_NUMPAD2) & 0x8000)
   {
      joypos &= 0xbf;
   }

   if (GetKeyState(VK_NUMPAD4) & 0x8000)
   {
      joypos &= 0xdf;
   }
   else if (GetKeyState(VK_NUMPAD6) & 0x8000)
   {
      joypos &= 0xef;
   }

   if (GetKeyState(VK_NUMPAD0) & 0x8000)
   {
      joypos &= 0xf7;
   }

   return joypos;
}
thanks!
jjp
Posts: 9
Joined: Tue Jul 20, 2021 1:13 am

Re: New release of EightyOne available

Post by jjp »

I already test it... it works...

(change with +/- 1 )
Fruitcake
Posts: 346
Joined: Wed Sep 01, 2010 10:53 pm

Re: New release of EightyOne available

Post by Fruitcake »

A significant new version of EightyOne (v1.29) is now available. It can be found here:
https://sourceforge.net/projects/eightyone-sinclair-emulator/

EightyOne has never accurately emulated the timing of the ZX81 display mechanism, always running slightly faster than it should (by 'faster' I mean the ratio of time spent running a user program to the time spent by the ROM generating the TV picture). Originally EightyOne ran at about 114%. In v1.18 I introduced some code that crudely attempted to compensate for this, reducing the speed to around 102%. This was good enough for the vast majority of purposes and the faster speed was essentially unnoticeable, but it did cause issues for a few very specially timed programs. In this new release of EightyOne, I've finally addressed the timing issue and now the emulation runs at 100%.

A consequence of the changes is then when EightyOne is run in Full Frame mode the sync pulses are now shown at their correct positions, which might come in useful to programmers creating their own display driver routines.

The new version also includes support for the Improved Wait circuit functionality devised by Wilf Rigter to avoid the ZX81 needlessly running ~10% slower than it could have done.

I've also upgraded the ZX80 emulation so that it correctly supports the ZX80's mechanism for generating HSync pulses (which is different to that of the ZX81). Previously the ZX80 emulation was handled using the ZX81 emulation and although this produced good results for the majority of cases, it could result in deviation for programs running their own custom display driver routine.

The final headline feature I've added is a new 'Annotation' facility that will be of particular interest to programmers writing their own custom display drivers but also to those with a just general interest in how the ZX80 and ZX81 display mechanisms operate. You might find it quite illuminating...

The changes made in this release has have involved significant reworking of the ZX81 / ZX80 display emulation mechanism and so there is a risk that some very specialised edge cases have not been covered. Should you encounter any programs that used to run fine on the previous release but now don't then please report the issues on this thread.

Oh, and the requested change above for the joystick support just crept in before the doors shut on v1.29! However, I don't have a joystick to test with so please verify that the change made does indeed work ok.
Moggy
Posts: 3222
Joined: Wed Jun 18, 2008 2:00 pm

Re: New release of EightyOne available

Post by Moggy »

Whilst being more of a real kit user than an emulator user I have to say your continued work and time taken on this project is very much appreciated and I'm sure others feel the same way too.
stevenmcdonald
Posts: 17
Joined: Tue May 30, 2017 1:26 am

Re: New release of EightyOne available

Post by stevenmcdonald »

I second that !

This is a major update and a milestone release!

Great work and much appreciated !!

Steven McDonald
jjp
Posts: 9
Joined: Tue Jul 20, 2021 1:13 am

Re: New release of EightyOne available

Post by jjp »

Fruitcake wrote: Sat Jun 11, 2022 1:06 pm A significant new version of EightyOne (v1.29) is now available. It can be found here:
https://sourceforge.net/projects/eightyone-sinclair-emulator/

EightyOne has never accurately emulated the timing of the ZX81 display mechanism, always running slightly faster than it should (by 'faster' I mean the ratio of time spent running a user program to the time spent by the ROM generating the TV picture). Originally EightyOne ran at about 114%. In v1.18 I introduced some code that crudely attempted to compensate for this, reducing the speed to around 102%. This was good enough for the vast majority of purposes and the faster speed was essentially unnoticeable, but it did cause issues for a few very specially timed programs. In this new release of EightyOne, I've finally addressed the timing issue and now the emulation runs at 100%.

A consequence of the changes is then when EightyOne is run in Full Frame mode the sync pulses are now shown at their correct positions, which might come in useful to programmers creating their own display driver routines.

The new version also includes support for the Improved Wait circuit functionality devised by Wilf Rigter to avoid the ZX81 needlessly running ~10% slower than it could have done.

I've also upgraded the ZX80 emulation so that it correctly supports the ZX80's mechanism for generating HSync pulses (which is different to that of the ZX81). Previously the ZX80 emulation was handled using the ZX81 emulation and although this produced good results for the majority of cases, it could result in deviation for programs running their own custom display driver routine.

The final headline feature I've added is a new 'Annotation' facility that will be of particular interest to programmers writing their own custom display drivers but also to those with a just general interest in how the ZX80 and ZX81 display mechanisms operate. You might find it quite illuminating...

The changes made in this release has have involved significant reworking of the ZX81 / ZX80 display emulation mechanism and so there is a risk that some very specialised edge cases have not been covered. Should you encounter any programs that used to run fine on the previous release but now don't then please report the issues on this thread.

Oh, and the requested change above for the joystick support just crept in before the doors shut on v1.29! However, I don't have a joystick to test with so please verify that the change made does indeed work ok.
Great! thanks for accept my suggest! it works excelent!

Other issue, the sources requiere a component named AnimTimer, but it is missing... anyway this component isn't used, but fail the compilation.

thanks, again!
Fruitcake
Posts: 346
Joined: Wed Sep 01, 2010 10:53 pm

Re: New release of EightyOne available

Post by Fruitcake »

jjp wrote: Sat Jun 11, 2022 7:57 pm Great! thanks for accept my suggest! it works excelent!
Good to hear it works! :)

jjp wrote: Sat Jun 11, 2022 7:57 pm Other issue, the sources requiere a component named AnimTimer, but it is missing... anyway this component isn't used, but fail the compilation.
Thanks for bringing it to my attention. I'll sort that in the next release.
Post Reply