Room For Improvements

Recently, I was watching Rod Hull lament about the lack of joystick control in Mike Singleton’s Snake Pit. Having seen keyboard patches for other Spectrum games which fix terrible controls in classics like Jet Pac (Q, W, E, R and T for goodness sake!) I wondered how difficult it would be to adapt the game to use the Kempton joystick interface provided by the divMMC Future.

Armed with a pen, my trusty notebook and a ZX Spectrum emulator – Fuse in my case as I’m on Linux – I started my investigations. After some initial dead ends, I tracked down the keyboard reading routine. I then wrote some new code which took input from the Kempston joystick (on loan from my esxDOS browser) and converted that to the keypresses the game was expecting, so the original game code would be none the wiser as to what was going on. I then patched the original routine to call my new code and crossed my fingers.

After managing to get Fuse to emulate a Kempston interface and mapping the keyboard to be the attached joystick, it did indeed work. I then made a patched version available and after getting Rod Hull’s seal of approval in his rather lovely follow up video I then went about tidying up the patch and doing a final release. This involved me modifying the game to start using the joystick and – more importantly – adding a little cracker-esque message screen at the start.

Not all blue screens are bad.

Snake Pit with Kempston joystick support is available here.

After getting this all set up, I decided to package up a couple of other patches and fixes I had kicking around. When I got my +2 up and running a few months back, I’d tried running a +2 timed version of deMarche’s Paralactika demo to see how the cool multicolour effects looked on real hardware. The .tap file I had promptly reset after loading. On power up, esxDOS forces a 128k machine into USR 0 mode (basically the 48k BASIC prompt but with access to all the memory pages) whereas the loader was expecting standard 128k mode and was doing the memory paging in a way that didn’t work in USR 0 mode. So, I rewrote the loader to take this into consideration and the demo loaded and started up correctly. Paralactika fixed for esxDOS / USR 0 mode is available here.

Finally, I’d come across a 128k mod of Manic Miner which played AY music in game and also included an in-game cheat menu. The original file was a .z80 snapshot and it was causing the full-screen preview code in my esxDOS browser to crash. After fixing that, I had a play around with it and noticed that the music code was hanging – playing the last note over and over again – when you turned the music off or ended up on the Game Over screen. The mod code was using an interrupt based music player for the 128k music and was just enabling and disabling interrupts to start and stop the music. They weren’t calling the ‘stop’ routine to silence the AY chip in the music player which is why the music was getting stuck. After patching the code to do this, I then extracted the code and made it into a .tap file with the original Manic Miner animated loading screen as I’m not a fan of snapshot files. Manic Miner 128k with fixed music playback is available here.

15 thoughts on “Room For Improvements”

  1. I was delighted to find this improved version of Manic Miner 128 here, and overall it’s great; I love that you’ve turned it into a proper .tap file. However, having just downloaded it and given it a try (in Fuse on a Mac), I found that when I lost a life in Skylab Landing Bay, the whole game just froze up. (Music continued playing, but everything else just stopped.) I’d collided with one of the descending skylabs. Worth a bug-hunt? NB I’d opened the cheat menu to see what was on it, but I hadn’t enabled any cheats.

    1. Thanks for the kind words and play testing. I wouldn’t have encountered this issue as I can’t make it that far into the game. 🙂 I replicated it by POKING myself onto that room – the normal Manic Miner room teleport cheat wouldn’t work as pressing number 1 brings that cheat menu up. Thanks to the wonderful Skoolkit disassembly of Manic Miner, I managed to work out what was going on. The code that draws the skylab sprites uses a different code path for the explosion effect. For whatever reason when this code detected a collision with Willy it was jumping back to the wrong part of the game loop and getting into an infinite loop. This looks like a bug in the original snapshot file. So, long story short, the following pokes, entered on the title screen, should fix the hang:

      POKE 33799, 13 – sets the start room to Skylab Landing Bay
      POKE 36702, 38
      POKE 36140, 210

      Let me know if this fixes the issue and I’ll repackage the .tap file to include them.

      1. Please forgive the delayed response; I didn’t get an email notification that you’d replied to my original post, and I only thought to check to see if there was anything new just now, a couple of weeks later.

        Anyway, I’ve just tried it again with the pokes you’ve specified, and yes, it now seems to behave as expected. So yes, if you could repackage the .tap file with the pokes included, that’d be much appreciated by me, at least!

        Indeed, Spectrum Computing and the JSW/MM forums appear to be unaware of your improved version of this 128 enhancement, so I think it’d be worth submitting it to them… but not with the bug still present, obviously! Thanks again for your efforts with this; it really is a massive improvement on the original snapshot.

        1. No problem. In the interim, as I wasn’t sure what had been done by the original author and if any other bugs like the Skylab one you found had also been introduced, I decided to re do the patch from scratch. I took the 128k music out from the snapshot and patched the original Bug Byte release of Manic Miner to use it.

          The teleport cheat now works again as you couldn’t type the magic number in as it activated the in-game cheat menu. To compensate for the removal of this I’ve added a 3 option trainer. The music playback now uses the in-game music flag so pressing the normal music on/off keys will turn the AY tune of as well. You can download my re-patched 128k version from:

          http://www.thefossilrecord.co.uk/wp-content/uploads/zx/manic128.zip

          1. Thanks so much for your efforts! You’ve done a fine job here – and it’s nice to have a 128 version of the Bug-Byte edition of Manic Miner, as that’s the one I had in the 80s and so I prefer it to the Software Projects version, really. And thanks for the mention on page 2 of your new intro screen, too! 🙂

            I do have a bit of further feedback, though, and a couple of requests.

            1. Could you still apply those pokes to the Mihai Novitchi Software Projects version and reissue the .tap file, please? It’s nice to have both Bug-Byte and Software Projects versions of the game in 128 editions, but this version still has the Skylab bug as it stands.

            2. Concerning the cheat code… from the way you refer to it, I suspect you may have forgotten that the 6031769 code in the Bug-Byte version was changed in the Software Projects re-release to TYPEWRITER. (Which led in due course to the equivalent cheat becoming WRITETYPER in JSW.) And the TYPEWRITER code DOES work in the Mihai Novitchi hack. Of course, you’re right that this would indeed have been a problem in the Bug-Byte version of the game, but I thought I should clarify that the cheat code does work in the existing hack.

            3. I very much like the fact that the music on/off keys now work again in your new version. I also like the fact that you offer an invulnerability option in the trainer. However, it does strike me as a shame that the in-game menu has been lost, because obviously you now have to reload the whole thing in order to change an option, whereas the cheats can be toggled temporarily (maybe to help the player past a tricky section) via the in-game menu in the other version. So I was wondering how much effort it would be to restore the in-game menu to your version… Obviously you’d need a new way to trigger it, but this could presumably be moved to a different key, such as Enter (for example). Or maybe you could invoke the menu by using the music on/off keys, but ONLY when the game was paused? (And of course you’d have your new invulnerability poke as option 3, since the music on/off option is no longer needed.)

            4. Some corruption has crept into your new Bug-Byte version, I’m afraid. If you look at Eugene’s Lair, there’s a couple of corrupt character cells in the left wall, next to the top platform (just below-left of where Willy starts on that screen). It doesn’t appear to have any adverse effect on the game, but it’d obviously be better for it not to be there.

          2. Thanks for testing this and your feedback. I’ve re-packaged the Software Projects version to include the fix for the Skylab Landing Bay. I’ve also fixed the issue I introduced into the Bug Byte version which corrupted the room data for Eugene’s Lair. I’ve updated the zip file I linked to in my previous reply.

            I still maintain the built in cheat mode is broken as although TYPEWRITER displays the boot, you don’t seem to be able to teleport to any room that requires the number 1 – as any press of that key opens the cheat menu. When I was debugging the Skylab issue, I couldn’t teleport there and had to POKE the starting room as the teleport code was 1,3,4,9 which I didn’t seem to be able to enter.

  2. Very many thanks for the updates; all seems fine now.

    Sorry about the confusion with the cheat mode. You are of course quite right that the key-1 menu interferes with using the cheat code – though it does NOT, in fact, render it totally unusable. It still works (or can be made to work) if you press the keys just right – and I’ve confirmed that just now by jumping to Skylab Landing Bay in the Software Projects version with the menu. The jump happens when the 9 key is pressed, and the other numbers you need for Skylab Landing Bay are 1, 3 and 4. So if you hold down 3 and 4, and then jab 1 and 9 simultaneously, the cheat does work. In fact, it’s even possible to do it without invoking the menu (though it usually does open and have to be closed again, which is a pain).

    As far as using the cheat is concerned, it would be FAR better if the cheat menu were on key-0 (zero) rather than 1, since 0 isn’t used in the room access keypress configurations.

    Before, I really thought you were referring to the way of invoking the cheat rather than using it, though with hindsight I’m not sure why I thought that. Clearly, the key-1 menu would interfere with the invocation in the 6031769 Bug-Byte version (and so would key-0) but not with the TYPEWRITER Software Projects version.

    Anyway, that’s really why I wondered whether the menu could come back on another key entirely (such as Enter) or – the best potential option available, I think – as an option that worked only in pause mode. After all, the player is only going to be using the cheat menu when the game is paused, so why not make it accessible only when the game is paused already? (And then you could presumably keep it on key-1 if you wanted to.)

    I suppose there’s an argument that, for simplicity, pause mode itself could become the way of accessing the menu (i.e. press pause and up comes the cheat menu with no further need to press a specific button). Though I don’t personally really like that idea simply because it’d make the cheat menu too intrusive, and you wouldn’t necessarily want it always to appear when you just want to pause the game. (E.g. you might want to take a screenshot, which the cheat menu would then ruin.)

    Anyway, there are clearly various potential approaches. I just like the cheat menu, inherently, because it provides the ability to toggle the cheats temporarily rather than forcing them to be chosen as one-offs for the whole session.

  3. I just played this and lost my last life on Mutant Telephones (I’m usually much better, but had a panicky idiot moment in Kong Beast and lost three in a row to that barrel right at the start) — and it froze up when I touched the enemy that would have taken my last life. Music continued playing. So it’s still buggy.

    1. Which version was this – my Bug Byte patch with the +3 trainer or the Software Projects one with the in game cheat menu? I’m more inclined to fix my own patch than trying to figure out why someone else’s patch isn’t working. 🙂

        1. If you find a bug and give me clear steps to replicate it (like Mr Scratcher did), I’ll have a look. I can always counter move with the other programmer’s classic ‘It works on my machine’. 🙂

      1. MM/JSW god “Jet Set Danny” just got onto me by e-mail asking the details of this, and I honestly can’t remember now… sorry. Your game was evidently linked to me through some external source (maybe SpectrumComputing forum, or some e-mail zine) — but I’ve got no idea.
        If JSDanny can’t reproduce the bug then it never happened 🙂

        1. Obviously without knowing, I strongly suspect that this bug happened in the repackaged version of the original hack (the one with the ‘1’-based cheat menu), since this version is, unfortunately, the one that’s still linked from the main body text of the post, and thus the easiest to find here. In order to find the new, improved versions of the hack (both Bug-Byte and Software Projects versions), one has to open the blog post in its own separate page in order to see the comments, and then find the newer versions therein.

          My guess is that you downloaded the ‘improved original’ hack in which Bob Fossil has repackaged the original Manic Miner 128 in a .tap file but not otherwise improved it. And then you probably fell foul of a bug similar to that which caught me in Skylab Landing Bay. Obviously I’m just guessing, but it seems like a plausible scenario.

          Happily, the new, improved versions with Skylab fix have now made their way onto a much more prominent dedicated page on JSW Central, which is the ideal home for them, so people who are interested in Manic Miner should now be much more likely to find them.

  4. Thank you so much for creating these versions, Bob! It’s great to be able to play “Manic Miner” with 128K music, and to be able to complete it.

    I have played both versions (Bob’s Bug Byte patch with the +3 trainer and the Software Projects one with the in-game cheat menu) to completion and did not notice any bugs or other issues.

    I have also purposefully lost all my lives in Mutant Telephones, and nothing untoward happened there – the game went to the Game Over screen as it should. So I haven’t been able to reproduce the problem Eq observed.

    Once again, thank you for these versions, Bob! I have updated this variant’s page on JSW Central (https://jswcentral.org/mminmods_mm128ay.html) accordingly.

Leave a Reply

Your email address will not be published. Required fields are marked *