Problem creating 'Nirvana' snapshots ?

Discuss ZX Spectrum Next Games, Tools and more.
User avatar
spikejohnc
Posts: 18
Joined: Thu Sep 07, 2017 1:18 pm

Problem creating 'Nirvana' snapshots ?

Postby spikejohnc » Wed Aug 26, 2020 11:36 am

Is there a known problem creating snapshots of games built using the Nirvana engine ? Tried to create a snapshot of Multidude and when trying to run the .sna file it wouldn't work. Seem to be able to create snapshots of regular Speccy games no problem.

Alcoholics Anonymous
Posts: 777
Joined: Mon May 29, 2017 7:00 pm

Re: Problem creating 'Nirvana' snapshots ?

Postby Alcoholics Anonymous » Wed Aug 26, 2020 5:24 pm

spikejohnc wrote:
Wed Aug 26, 2020 11:36 am
Is there a known problem creating snapshots of games built using the Nirvana engine ? Tried to create a snapshot of Multidude and when trying to run the .sna file it wouldn't work. Seem to be able to create snapshots of regular Speccy games no problem.
After returning from the snapshot does the game crash or behave badly?

The answer is yes though. Any program which uses the stack pointer to point at data or hold data can lead to bad snapshots if taken at the wrong time. Nirvana is one such program where it uses the stack pointer to point at a table of screen addresses while it draws the screen.

The reason it is a problem is in how the z80 works -- if you press the nmi button, the return address is pushed to the stack so that's 2 bytes of data written to memory where the stack pointer is pointing. If the stack pointer holds data or points into a table of constants, memory is going to be changed where it shouldn't.

We are considering having an option to modify the z80's nmi response so that nothing is written to memory. This would make all such snapshot issues go away. But it would be incompatible with the mutiface and divmmc -- the software in these devices would have to be updated to use this nmi option -- so that's why it would have to be a switch that activates the different behaviour. NextZXOS could accommodate this easily though so everything running from the Next (as opposed to personalities which use the original divmmc and multiface roms) would be able to take these new sorts of snapshots.

User avatar
spikejohnc
Posts: 18
Joined: Thu Sep 07, 2017 1:18 pm

Re: Problem creating 'Nirvana' snapshots ?

Postby spikejohnc » Wed Sep 09, 2020 1:05 pm

"After returning from the snapshot does the game crash or behave badly?"

It's intermittent, sometimes I can create a snapshot that is fine. Other times, when I return it crashes and when trying to load the snapshot file the same thing happens.

Alcoholics Anonymous
Posts: 777
Joined: Mon May 29, 2017 7:00 pm

Re: Problem creating 'Nirvana' snapshots ?

Postby Alcoholics Anonymous » Sat Sep 12, 2020 3:35 am

Yeah. I think we've decided to put the special nmi in so snapshots should be error free in the future.

Alcoholics Anonymous
Posts: 777
Joined: Mon May 29, 2017 7:00 pm

Re: Problem creating 'Nirvana' snapshots ?

Postby Alcoholics Anonymous » Thu Nov 12, 2020 9:31 pm

Core version 3.01.09 now contains a stackless nmi option that will allow all original spectrum programs to be snapshotted successfully. This, along with a move to saving .Z80 snapshots rathern than .SNA, should make snapshots work much better.


Who is online

Users browsing this forum: No registered users and 4 guests