Menu

#106 Add MEMPTR support to Z80 emulation

v1.3.3
closed
z80 (1)
5
2017-03-11
2016-12-14
No

The "hidden" register of the Z80, commonly known as MEMPTR, has been documented for many years, but we've never implemented it in Fuse, nominally because of the overhead of doing so and the (very) limited again. However, as even a $5 Raspberry Pi can run Fuse these days without so much as breaking sweat, it's probably time to implement it.

If anyone strongly thinks this is the wrong decision, please shout.

1 Attachments

Related

Feature Requests: #106
Wiki: Fuse 1.3.3 Plan

Discussion

  • Philip Kendall

    Philip Kendall - 2016-12-14

    Work proceeding in the feature-106-memptr branch.

     
  • Philip Kendall

    Philip Kendall - 2016-12-14
    • assigned_to: Philip Kendall
     
  • Philip Kendall

    Philip Kendall - 2017-01-07

    Right, implementation is pretty much done on this one. The most important thing is that we don't regress anything, but I'm not entirely sure of the best way to test that. I tried to be careful when I was updating the Z80 test suite that no observable behaviour was changed (other than BIT n,(HL)), but could have made a mistake somewhere. Any thoughts welcome...

     
  • Philip Kendall

    Philip Kendall - 2017-01-09

    The good news here is that we now match the expected results for running zexall, whereas master failed on the test containing BIT n,(HL).

     
  • Philip Kendall

    Philip Kendall - 2017-01-09

    And even better, we pass all the MEMPTR tests in Patrik Rak's test suite, so I'm now pretty confident on this one. Any objections if I merge?

     
    • Fredrick Meunier

      Hi Phil,
      I'm on holiday and haven't had a chance to look and am also struggling to log onto sourceforge to comment on the issue, but I'm happy for the merge to go ahead.

      The only other test that comes to mind would be something like reworking Sergio's RZX regression scripts to check before and after behaviour of Fuse doesn't have any significant regressions.

      I think there is also a game that depends on MEMPTR to work properly?

      Thanks,
      Fred

      On 8 Jan 2017, at 22:14, Philip Kendall pak21@users.sf.net wrote:

      And even better, we pass all the MEMPTR tests in Patrik Rak's test suite, so I'm now pretty confident on this one. Any objections if I merge?

      [feature-requests:#106] Add MEMPTR support to Z80 emulation

      Status: open
      Group: future
      Labels: z80
      Created: Wed Dec 14, 2016 09:39 PM UTC by Philip Kendall
      Last Updated: Mon Jan 09, 2017 05:57 AM UTC
      Owner: Philip Kendall
      Attachments:

      memptr_eng.txt (5.1 kB; text/plain)
      The "hidden" register of the Z80, commonly known as MEMPTR, has been documented for many years, but we've never implemented it in Fuse, nominally because of the overhead of doing so and the (very) limited again. However, as even a $5 Raspberry Pi can run Fuse these days without so much as breaking sweat, it's probably time to implement it.

      If anyone strongly thinks this is the wrong decision, please shout.

      Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/fuse-emulator/feature-requests/106/

      To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

       

      Related

      Feature Requests: #106

      • Philip Kendall

        Philip Kendall - 2017-01-09

        Nothing released in the commercial days of the Spectrum depends on MEMPTR. One of the reasons I didn't worry about it until now ;-)

        Somebody did write a snake game (I think) in the past few years which depends on MEMPTR, but that was more as a "ha ha I can break emulators" rather than an honest attempt at a game. Patrik's tests are probably much better at actually testing we've done things right - as we pass all of ZEXALL and Patrik's tests (apart from SCF/CCF which is a different issue), I'm happy I haven't regressed anything.

         
  • Sergio Baldoví

    Sergio Baldoví - 2017-01-09

    The implementation also pass Woody's tests:
    http://web.archive.org/web/20160411222144/http://homepage.ntlworld.com/mark.woodmass/z80tests.tap

    Do you mind adding MEMPTR support for SZX snapshots?

     
    • Philip Kendall

      Philip Kendall - 2017-01-10

      Will do - hopefully Wednesday evening.

       
      • Philip Kendall

        Philip Kendall - 2017-01-10

        Well, that was easier than I thought as I'd forgotten we already had MEMPTR support in libspectrum. Thanks Fred :-)

         
  • Philip Kendall

    Philip Kendall - 2017-01-13

    One last bit I realised that needs to be done: expose MEMPTR to the debugger.

     
    • Philip Kendall

      Philip Kendall - 2017-01-13

      And done - as either z80:memptr or z80:wz as the register is sometimes referred to as "WZ". Think this one is probably ready to merge now.

       
  • Philip Kendall

    Philip Kendall - 2017-01-16
    • Group: future --> NextRelease
     
  • Philip Kendall

    Philip Kendall - 2017-01-22

    And merged. Please report any problems!

     
  • Philip Kendall

    Philip Kendall - 2017-01-22
    • status: open --> accepted
     
  • Fredrick Meunier

    • status: accepted --> closed
     

Log in to post a comment.

Auth0 Logo