ZX Spectrum Emulator for Windows

Zero is the new Ziggy!

I have made available a new version of Zero (aka Ziggy) as a preview build 0.4.5. That is, the build is likely to have a few minor quibbles (like references to Ziggy still existing in the app 😉 ).

Basically, I’m looking for feedback on the various changes I’ve made to Zero including:
1) Better use of CPU cycles.
2) Emulator can be re-sized in 50% increments and is limited by the resolution of your monitor.
3) Three levels of borders can be set via the Options menu.
4) Zipped files are supported.
5) POK files are supported.
6) Various sundry visual changes.

For other changes see the What’s New text file.

1) Do not unzip this version to your installation folder! Instead unzip to a new folder location.

2) Since this isn’t a true stable release I haven’t bundled the SlimDX setup with this. If you’ve already installed SlimDX you don’t need to worry. If you haven’t, you’ll need to download the SlimDX runtime.

3) Your previous Ziggy version will remain untouched. Any extensions registered will still trigger the previous Ziggy version. To launch Zero you will have to navigate to the Zero folder you just unzipped these files to.

4) Zero has preliminary support for the 128ke model. By default this is the standard 128K model and should load most files including 48k games that didn’t work on the standard 128k machine. However, if you’re looking for 128k contention and accurate emulation you should switch to the 128K model from the machine selector. Zero will use the last selected 128k model from thereon.


6 responses to “Zero is the new Ziggy!

  1. George October 22, 2010 at 10:24 pm

    Firstly it’s great now there’s no installer. I did run into some problems though with the new version. I also tried running it as Administrator, same thing.

    1) Unzipped the Zero 0.4.5 to a folder of the same name on the desktop (Windows 7).
    2) Ran Zero.exe
    3) displayed…
    “Zer0 couldn’t find the default config file.
    It will now attempt to create one.”
    4) Crashed (got trace from VS2010)

    System.NullReferenceException was unhandled
    Message=Object reference not set to an instance of an object.
    at ZiggyWin.Form1.get_AppHasFocus()
    at ZiggyWin.Form1.OnApplicationIdle(Object sender, EventArgs e)
    at System.Windows.Forms.Application.ThreadContext.System.Windows.Forms.UnsafeNativeMethods.IMsoComponent.FDoIdle(Int32 grfidlef)
    at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
    at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
    at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
    at System.Windows.Forms.Application.RunDialog(Form form)
    at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
    at System.Windows.Forms.Form.ShowDialog()
    at System.Windows.Forms.Application.ThreadContext.OnThreadException(Exception t)
    at System.Windows.Forms.Control.WndProcException(Exception e)
    at System.Windows.Forms.Control.ControlNativeWindow.OnThreadException(Exception e)
    at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
    at System.Windows.Forms.SafeNativeMethods.ShowWindow(HandleRef hWnd, Int32 nCmdShow)
    at System.Windows.Forms.Control.SetVisibleCore(Boolean value)
    at System.Windows.Forms.Form.SetVisibleCore(Boolean value)
    at System.Windows.Forms.Control.set_Visible(Boolean value)
    at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
    at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
    at System.Windows.Forms.Application.Run(Form mainForm)
    at ZiggyWin.Program.Main()

    • George October 22, 2010 at 11:07 pm

      I’d had a look at the code and I’d try modifying your declaration of PeekMessage and struct Message to include the following (might help?)…

      [return: MarshalAs(UnmanagedType.Bool)]
      [SuppressUnmanagedCodeSecurity, DllImport(“User32.dll”, CharSet=CharSet.Auto, SetLastError=true)] <– ADD SetLastError=true
      public static extern bool PeekMessage(out Message msg, IntPtr hWnd,
      [MarshalAs(UnmanagedType.U4)] uint messageFilterMin, <– ADD [MarshalAs]
      [MarshalAs(UnmanagedType.U4)] uint messageFilterMax, <– ADD [MarshalAs]
      [MarshalAs(UnmanagedType.U4)] uint flags); <– ADD [MarshalAs]

      …and add to the following…

      public struct Message
      public IntPtr hWnd;
      [MarshalAs(UnmanagedType.U4)] <– ADD [MarshalAs]
      public int msg;
      public IntPtr wParam;
      public IntPtr lParam;
      [MarshalAs(UnmanagedType.U4)] <– ADD [MarshalAs]
      public uint time;
      public Point p;

  2. George October 24, 2010 at 8:43 pm

    Here you go…

    Microsoft .NET Compact Framework 2.0 SP2 – v2.0.7045
    Microsoft .NET Compact Framework 3.5 – v3.5.7283
    Microsoft .NET Framework 4 Client Profile – v4.0.30320
    Microsoft .NET Framework 4 Extended – v4.0.30320
    Microsoft .NET Framework 4 Multi-Targeting Pack – v4.0.30319


    • Arjun October 25, 2010 at 5:42 pm

      I have incorporated your suggestions (thanks!) to the code, but I doubt that was the root cause of the crash. I have identified a likely suspect in my code related to the tape deck initialisation that may have been causing the unexpected error. I can’t reproduce the error at my end at any rate, so we’ll just have to wait till I release the next update to see if either of the “fixes” worked. The next update is coming “soon”. 😉

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: