NEXT FAQ’s

The Speccy's spritely young offspring. Discuss everything from FPGA to ZX
User avatar
Seven.FFF
Manic Miner
Posts: 744
Joined: Sat Nov 25, 2017 10:50 pm
Location: USA

Re: NEXT FAQ’s

Post by Seven.FFF »

stupidget wrote: Fri Jan 12, 2024 3:48 pm Is it possible to save a snapshot of a NEXT game? I know you can use the NMI button to save a snapshot of a running Speccy game but I wondered if it's possible for a NEXT game?
No, it's not even technically possible in the hardware, as some of the state like sprites is write-only. Well, it's read/write internally, but the rendering circuit is using the internal BRAM read port resources in such a way that the data is not currently exposed apart from inside the video signal. Even if it later becomes technically possible, the full state of a game is much more more distributed around the hardware than just copying the contents of main RAM, so it would be a challenge to write such a snapshotter. Even snapshotting the screen is non-trivial, as it's made up of stacked layers with transparency, stenciling, blend modes and dynamic copper effects, and the possible set of configurations those things can be used in (that a game can put them in) is enormous.

Generally, snapshotting only works well when you have a higher level of hardware than the game is running on itself. So Multiface can snapshot an original game because it has its own ROM and RAM (the Multiface in the Next works the same way for classic games). ResiDOS can snapshot and multitasks sets of complete 48K processes because it runs in the 128K extra RAM. PC emulators can snapshot everything the emulator can emulate, because they can access all the internals and have additional PC CPU/RAM resources. But all hardware on the Next is capable of being used in a Next-specific game, including the divMMC, the entire SD card, and (theoretically) the Multiface, so there is no external context that a snapshotter could run in.

The write-only thing is a slight problem on original machines too, for example border colour can't be snapshotted in a multiface snapshot, current 128K bank can't be snapshotted because the paging port is write-only, complete AY register state can't be snapshotted because the register select port is write only, etc. External hardware has to watch the Z80 bus with a state machine to guess some of that state. On the Next, the sprite port writes go out over the bus too, so external hardware or the Pi could theoretically track it, but it's orders of magnitude more complicated than tracking 128K paging. One thing we were planning on adding later is putting the current pixel RGB333 colour (the final output of the rendering circuit, over time) in a place that's readable by internal software or external hardware. That would avoid the need to have to decode the stacked layer configuration and contents to do a screenshot.
Robin Verhagen-Guest
SevenFFF / Threetwosevensixseven / colonel32
NXtel NXTP ESP Update ESP Reset CSpect Plugins
User avatar
Mpk
Dynamite Dan
Posts: 1008
Joined: Tue Feb 09, 2021 8:10 am

Re: NEXT FAQ’s

Post by Mpk »

stupidget wrote: Fri Jan 12, 2024 3:48 pm I know you can use the NMI button to save a snapshot of a running Speccy game
I did not know this! That's awesome.
Maybe I should read the manual.
User avatar
Seven.FFF
Manic Miner
Posts: 744
Joined: Sat Nov 25, 2017 10:50 pm
Location: USA

Re: NEXT FAQ’s

Post by Seven.FFF »

Mpk wrote: Fri Jan 12, 2024 5:40 pm I did not know this! That's awesome.
The yellow NMI button is a multiface "red button". The Next has a fully compatible multiface 1/128/3 built in, and can run with those original Romantic Robot ROMs in the non-Next machine personalities. In the Next, it has a custom Multiface ROM that can do some fancier Next-specific things. And 48K/128K/+3 game snapshotting and screenshotting. It even has an inbuilt memory, CPU register and nextreg inspector, although it doesn't yet have a full disassembler and step debugging like Romantic Robot provided. There are plans to add that later.
Robin Verhagen-Guest
SevenFFF / Threetwosevensixseven / colonel32
NXtel NXTP ESP Update ESP Reset CSpect Plugins
User avatar
MonkZy
Manic Miner
Posts: 279
Joined: Thu Feb 08, 2018 1:01 pm

Re: NEXT FAQ’s

Post by MonkZy »

I have a question that does not warrant a separate thread : When will the KS2 System/NextOS (23.06/2.08) be made available to all NEXT users? I have been exploring the possibilities of the KS2 machine by reading the manual and I will say it has been massive fun. I developed a couple of programs (i think the kids call them 'apps' now) that I would like to release, but as far as I can tell only KS2 owners can use them. I have used a couple of new NextBASIC commands that are not present on the released OS (The as$[>] to strip trailing spaces, utterly awesome feature when dealing with ZX arrays)..At this moment only KS2 owners have this OS. They must back up their SD's because there is no online resource for the OS. Has a release date or estimate been offered? Absolutely love this machine though...wonderful.
User avatar
MonkZy
Manic Miner
Posts: 279
Joined: Thu Feb 08, 2018 1:01 pm

Re: NEXT FAQ’s

Post by MonkZy »

I can answer my own question : The ZX Spectrum Next website links to an older version of the Next Distro...The very latest version can be obtained from the Gitlab @ https://gitlab.com/thesmog358/tbblue/ and is available with cores for both KS1 and KS2 boards. I guess the website will catch up once the team has finished getting the last machines out, it seems some hassles are still being had outside the UK. KS2 owners do still need to back up the original SD, the files held in KS2Extras folders are not hosted online.
User avatar
Seven.FFF
Manic Miner
Posts: 744
Joined: Sat Nov 25, 2017 10:50 pm
Location: USA

Re: NEXT FAQ’s

Post by Seven.FFF »

MonkZy wrote: Wed Jan 17, 2024 4:39 pm I can answer my own question : The ZX Spectrum Next website links to an older version of the Next Distro...The very latest version can be obtained from the Gitlab @ https://gitlab.com/thesmog358/tbblue/ and is available with cores for both KS1 and KS2 boards.
Yes. The June 10th commit at gitlab is what got burned onto the ks2 cards (June 10th was the SD manufacturing deadline!) - minus the ks2-exclusive stretch goals, which were on the cards but will never be in gitlab. The advice to back up your card is mostly because of this stretch goal content, rather than because the OS files aren't available elsewhere.

Anything since that in gitlab is bugfixes. There are still some bugfixes remaining before the next distro release will happen, although it is getting close. Once that is released it will be put at /latestdistro, and what is currently at /latestdistro will get its own archive page. We like the distro releases to be free of all known bugs, which is why there is sometimes long delays getting releases out. Free time for core designer, OS dev and third-party devs all need to align, and multiple rounds of internal testing have to happen. But the current contents of gitlab will also be pretty stable for adventurous end-users who want to explore it - a good amount of testing happens internally before changes even go in there.
Robin Verhagen-Guest
SevenFFF / Threetwosevensixseven / colonel32
NXtel NXTP ESP Update ESP Reset CSpect Plugins
User avatar
MonkZy
Manic Miner
Posts: 279
Joined: Thu Feb 08, 2018 1:01 pm

Re: NEXT FAQ’s

Post by MonkZy »

Thank you @Seven.FFF and thanks also to the rest of the team, I have had much joy with this machine :) I would recommend all Next users to upgrade....the new BASIC has bitwise operators and hexadecimal conversion as well as some useful string operators...yay! After learning z80 asm I always wondered why bitwise operators were not already in BASIC, they are so useful for interpreting IN and PEEK responses. Thanks again and well done fellas!
User avatar
Turtle_Quality
Manic Miner
Posts: 506
Joined: Fri Dec 07, 2018 10:19 pm

Re: NEXT FAQ’s

Post by Turtle_Quality »

Seven.FFF wrote: Fri Jan 12, 2024 5:43 pm The yellow NMI button is a multiface "red button". The Next has a fully compatible multiface 1/128/3 built in, and can run with those original Romantic Robot ROMs in the non-Next machine personalities. In the Next, it has a custom Multiface ROM that can do some fancier Next-specific things. And 48K/128K/+3 game snapshotting and screenshotting. It even has an inbuilt memory, CPU register and nextreg inspector, although it doesn't yet have a full disassembler and step debugging like Romantic Robot provided. There are plans to add that later.
So does it still use the Multiface compression/decompression for Spectrum snapshots or has that been replaced by something smarter ?
Definition of loop : see loop
User avatar
Seven.FFF
Manic Miner
Posts: 744
Joined: Sat Nov 25, 2017 10:50 pm
Location: USA

Re: NEXT FAQ’s

Post by Seven.FFF »

Turtle_Quality wrote: Thu Jan 18, 2024 10:06 am So does it still use the Multiface compression/decompression for Spectrum snapshots or has that been replaced by something smarter ?
Snapshots are in .Z80 format to SD card. This is a better choice for the Next than the other popular .SNA format esxDOS uses, as the Z80 format spec allows model and hardware info to be stored. This feeds into the Next’s ability to switch model and enable/disanle hardware at load time.

The NextZXOS Multiface ROMs don’t contain any Romantic Robot code at all. In fact Romantic Robot still exists as a company, and their ROMs are distribution-denied. But if you own a physical MF1/Mf128/MF3 you can dump the ROMs and use them on the Next in the other non-Next boot personalities.
Robin Verhagen-Guest
SevenFFF / Threetwosevensixseven / colonel32
NXtel NXTP ESP Update ESP Reset CSpect Plugins
User avatar
Turtle_Quality
Manic Miner
Posts: 506
Joined: Fri Dec 07, 2018 10:19 pm

Re: NEXT FAQ’s

Post by Turtle_Quality »

Thanks @Seven.FFF , that all sounds smart. I was only wondering because I wrote the compression and decompression code for Romantic Robot and so was hoping I had inadvertently contributed to the Next project also
Definition of loop : see loop
User avatar
Seven.FFF
Manic Miner
Posts: 744
Joined: Sat Nov 25, 2017 10:50 pm
Location: USA

Re: NEXT FAQ’s

Post by Seven.FFF »

Turtle_Quality wrote: Thu Jan 18, 2024 12:59 pm I wrote the compression and decompression code for Romantic Robot
Oh! I remember reading your thread a while back now! That’s very cool, and I can see why you’re disappointed. As far as I know (have to check) there’s isn’t any tape snapshotting in what Garry wrote, only SD.

Do you own the rights to your code, or did you sign it over?
Robin Verhagen-Guest
SevenFFF / Threetwosevensixseven / colonel32
NXtel NXTP ESP Update ESP Reset CSpect Plugins
User avatar
Turtle_Quality
Manic Miner
Posts: 506
Joined: Fri Dec 07, 2018 10:19 pm

Re: NEXT FAQ’s

Post by Turtle_Quality »

It was never anything formal, I just asked Romantic Robot if they compressed snapshots before saving, they said no. I said I would provide the code if they gave me a resulting updated Multiface. This is not about pursuing rights, just about potential bragging rights

But as you say no Multiface code is used, just similar functionality. And the z80 format uses a similar but slightly smarter method of compression, with EDh EDh as a marker instead of 37h, EDh and CBh for sequences of the same byte.
Definition of loop : see loop
User avatar
Seven.FFF
Manic Miner
Posts: 744
Joined: Sat Nov 25, 2017 10:50 pm
Location: USA

Re: NEXT FAQ’s

Post by Seven.FFF »

Heh yes, I understand. I was more thinking that you could license the code to the Next Team if you owned it, and it would be quite cool to put it to ongoing use. But it sounds like it that wouldn't really fly if your arrangement was informal. And realistically, Garry is capable of writing his own tape snapshot code too, and might not even be interested. It was just a passing thought of mine that probably can't go anywhere.

It is definitely a excellent thing to have your code out there being used in the original hardware, even now, even though nobody much is aware <3
Robin Verhagen-Guest
SevenFFF / Threetwosevensixseven / colonel32
NXtel NXTP ESP Update ESP Reset CSpect Plugins
User avatar
Mpk
Dynamite Dan
Posts: 1008
Joined: Tue Feb 09, 2021 8:10 am

Re: NEXT FAQ’s

Post by Mpk »

Mpk wrote: Tue Jan 09, 2024 9:17 pm Magic. Thanks everyone. Ordered.
And to verify, this arrived, took no effort to set up and works a treat with an old Xbox controller.

If I could figure out a way to map one of the buttons to reset, I'd be laughing.

Image
jamesh
Dizzy
Posts: 83
Joined: Thu Jul 06, 2023 6:36 pm

Re: NEXT FAQ’s

Post by jamesh »

Mpk wrote: Fri Jan 19, 2024 8:12 pm If I could figure out a way to map one of the buttons to reset, I'd be laughing.
Not yet :(
User avatar
Seven.FFF
Manic Miner
Posts: 744
Joined: Sat Nov 25, 2017 10:50 pm
Location: USA

Re: NEXT FAQ’s

Post by Seven.FFF »

Mpk wrote: Fri Jan 19, 2024 8:12 pm If I could figure out a way to map one of the buttons to reset, I'd be laughing.
Not possible in the hardware at present, but Allen was thinking of adding a special combination like START+A+B+C for reset.

My interim suggestion was to get a smart plug and plug the Next PSU, and hook it up to a smart command like "Alexa: reset Next". It'll be a longer cold reset rather than a short warm reset, but it's still useful.

edit: haha, James beat me to linking to my own post :D

I have a smart plug and was going to try this myself, but I can't find it :(
Robin Verhagen-Guest
SevenFFF / Threetwosevensixseven / colonel32
NXtel NXTP ESP Update ESP Reset CSpect Plugins
User avatar
Mpk
Dynamite Dan
Posts: 1008
Joined: Tue Feb 09, 2021 8:10 am

Re: NEXT FAQ’s

Post by Mpk »

Oh well. I can dream!

Looks like a wireless keyboard would do the job. Anyone have any luck attaching a USB wireless keyboard via a PS/2 adapter?


Image
AndyC
Dynamite Dan
Posts: 1409
Joined: Mon Nov 13, 2017 5:12 am

Re: NEXT FAQ’s

Post by AndyC »

Mpk wrote: Fri Jan 19, 2024 9:53 pm Oh well. I can dream!

Looks like a wireless keyboard would do the job. Anyone have any luck attaching a USB wireless keyboard via a PS/2 adapter?


Image
I'm pretty sure USB keyboards and mice have to support the PS/2 protocol in order to work with those adapters and I doubt a wireless dongle would bother implementing that (not even sure it'd supply sufficient power if one wanted to)
User avatar
Seven.FFF
Manic Miner
Posts: 744
Joined: Sat Nov 25, 2017 10:50 pm
Location: USA

Re: NEXT FAQ’s

Post by Seven.FFF »

AndyC wrote: Fri Jan 19, 2024 11:59 pm I'm pretty sure USB keyboards and mice have to support the PS/2 protocol in order to work with those adapters and I doubt a wireless dongle would bother implementing that (not even sure it'd supply sufficient power if one wanted to)
Yep, there was a while back in the early 2000s where manufacturers were making dual protocol mice and keyboards, before USB had fully taken over. But even then, the vast majority of those were wired rather than wireless. Nowadays there is next to no dual protocol stuff, but you can still find wired ps/2-only mice and keyboards. And as AndyC says, modern USB-only mice and keyboards do not work with those passive adaptors, as they simply cannot speak ps/2 protocol at all.

I have a Microsoft Elite 1011 wireless keyboard and a Microsoft C57 dual serial-ps/2 wireless mouse, and both of these work great with my Next, even at the same time. I haven't tested the power consumption of those, but the recommendation is to pull no more than 150mA for each device from the Next's ps/2 ports.

Another option somebody reported works with their Next is Logitech EX110. This seems to be a wireless keyboard/mouse bundle.

That dual serial-ps/2 mouse is from an even older dual standard era! Fortunately there seems to have been a large job lot of mint sealed new old stock unleashed on the used marketplace a few years ago.
Robin Verhagen-Guest
SevenFFF / Threetwosevensixseven / colonel32
NXtel NXTP ESP Update ESP Reset CSpect Plugins
User avatar
Mpk
Dynamite Dan
Posts: 1008
Joined: Tue Feb 09, 2021 8:10 am

Re: NEXT FAQ’s

Post by Mpk »

Seven.FFF wrote: Sat Jan 20, 2024 12:17 am Microsoft Elite 1011 wireless keyboard
I think I have one of these. The wireless puck thing looks familiar. Time to start rummaging through some dusty old boxes.
User avatar
Mpk
Dynamite Dan
Posts: 1008
Joined: Tue Feb 09, 2021 8:10 am

Re: NEXT FAQ’s

Post by Mpk »

Right - next daft question :

Is it possible to browse the network, see SMB shares etc from the Next? I dislike taking out the SD card to copy files over. Would be nice if I could grab things from a share.
jamesh
Dizzy
Posts: 83
Joined: Thu Jul 06, 2023 6:36 pm

Re: NEXT FAQ’s

Post by jamesh »

Hmm, not sure SMB client is even possible on Z80. Especially if we're talking about the modern features (is encryption still optional or mandatory?). And if we talking about setting up next-specific server, there are alternatives that even I am aware of.

Speaking of the general purpose solution "I'd like to fetch, well, I don't know what... oh, this one!" I'd say built-in .http plus "python3 -m http.server" on the host is the most simple to "deploy". gopher is a bit "user-friendlier" at the expense of setting up gopher server. Other fancy options may include setting up you own server for ZXDB-dl or GetIt apps.

And there are some solutions for specific use cases, like nextsync and a few others, but those are more oriented towards the regular "build-push-test" cycle and include quite specific host/server setup.
User avatar
Seven.FFF
Manic Miner
Posts: 744
Joined: Sat Nov 25, 2017 10:50 pm
Location: USA

Re: NEXT FAQ’s

Post by Seven.FFF »

There is no current SMB client, and scant possibility of somebody writing one in the future. The ESP wifi module doesn't expose any useful low level tcp/ip stuff, it's essentially a very flaky modem, running random versions of bad Chinese firmware, running over a slowish serial connection. And the Next is after all a Spectrum running Z80 code only, albeit a bit faster. There is no magic external stuff like an emulator would have.

Never say never, but I've been developing for the ESP and Next for nearly 6 years now, and knowing what I know, I wouldn't attempt it. It's not even up to the job of implementing a standard ftp client.
Robin Verhagen-Guest
SevenFFF / Threetwosevensixseven / colonel32
NXtel NXTP ESP Update ESP Reset CSpect Plugins
User avatar
Mpk
Dynamite Dan
Posts: 1008
Joined: Tue Feb 09, 2021 8:10 am

Re: NEXT FAQ’s

Post by Mpk »

Seven.FFF wrote: Mon Jan 22, 2024 7:00 pm
What's the zxdb downloader software running against? Http?
Should be possible to run a web server for that on my home PC and move files that way, right?

Of course, it'd be easier to just move my sd card around, I suppose. But I won't be happy about it.
User avatar
Seven.FFF
Manic Miner
Posts: 744
Joined: Sat Nov 25, 2017 10:50 pm
Location: USA

Re: NEXT FAQ’s

Post by Seven.FFF »

There's an .http dot command written by Remy Sharp that will let you do an HTTP GET or POST on any http address (not https, as the ESP can't do SSL/TLS), and dump the returned results into any consecutive set of 8K RAM banks. It's a bit crude, and only supports a tiny subset of the HTTP protocol, but it works well enough for zxdb-dl, etc to use it. And, with a bit of care and wrangling, it's even possible to invoke dot commands from your own asm, C or Boriel BASIC code. As well as, of course, NextBASIC.

Since both the ESP and Next UART have tiny RX buffers, and there isn't a good way of flow controlling the remote server to only send data that you are able to store without buffer overflow, it can get a bit hairy. I prefer writing a custom server with a chunked/resendable binary protocol ,where the Next client only gets small packets as it asks for them. But other devs are not really fond of that, as they would rather put minimal effort into writing the server side, or they have some idea they can support any third-party server on the general internet. Although this is exactly what NextSync does too.

Personally I would recommend put some effort into extending NextSync for two way transfer, since it is public domain (UnLicenced). The biggest problem you will have with doing rsync-type operations is tracking the changed file sizes and modified dates on a multi-GB-sized SD card. If you don't already have an RTC on the Next, or aren't setting your clock accurately with .nxtp, that would be the first step.

For me, everything on my many SD cards is expendable, so I literally never care about copying things back, unless it's individual files where I wrote an occasional BASIC program on the fly to test something. I am frequently buying new ones and reformatting the existing ones. Although it feels like having a hard drive, the actual reliability is not all that much greater than a floppy, so I treat all the data as disposable. I have had so many dozens of Next SD cards die on me in the last six years.
Robin Verhagen-Guest
SevenFFF / Threetwosevensixseven / colonel32
NXtel NXTP ESP Update ESP Reset CSpect Plugins
Post Reply