Shauing wrote: ↑February 29th, 2020, 10:16 pm
For some reason, the demo level can only be played once; if you die, you're booted out to the menu.
It seems the game has special code to return to the menu if the prince dies on the demo level.
(Even though that can't happen in the original game. Unlike in the DOS version, the Prince always beats the guard in the SNES demo level.)
In the Pr1SnesLevEd hacks window, on the "training" tab, there is an option labeled "?", whose default value is "demo".
Set it to "(disable)".
Yes, I know that label is meaningless and the option is even on the wrong tab.
When I found this hack some years ago, I only knew that this part of the code checks if the current level is the demo level, but I didn't know the purpose. And it was near some code which checks if the current level is a training level, that's why I put it onto the training tab.
I figured out its purpose only now, when I was specifically looking for code which does what you wrote, and I realized that the offset I found is already in the hacks list of the editor.
Shauing wrote: ↑February 29th, 2020, 10:16 pm
This leads me to a question where if it is possible to have all 27 levels available to play continuously?
Yes, you just need to disable all special events on Jaffar's level.
Then set "show ending when next level would be" to the (nonexistent) level after training 5. (It appears as an empty item in the dropdown list.)
Shauing wrote: ↑February 29th, 2020, 10:16 pm
And also, if more levels could technically be added? (the remaining free space might be an issue on that though).
Probably yes, but then the resources following the levels in the
first resource table have to be rearranged.
Or alternatively, the level loading code could be changed to load the extra levels from some other place instead of looking at resource 41+levelnumber.
And additionally, all the arrays related to levels (level types, level music, etc.) have to be enlarged, and moved to elsewhere where a longer array can fit.
And of course, the SNES level editor(s) have to be modified to know about all these changes.
Shauing wrote: ↑February 29th, 2020, 10:16 pm
David wrote: ↑February 29th, 2020, 9:58 pm
Do you also want to disable automatic moves on the demo level?
Yes.
You can do so in the hacks window: on the "demo level" tab, set the first two options to disabled.
(But you probably already knew that?)
Shauing wrote: ↑February 29th, 2020, 10:16 pm
Also, after finishing the demo can either send you back to the menu or that the next Level should be Level 1? Or the game is forced to follow an order in the level table?
By default the levels appear in sequential order.
But it's possible to override this using a hack similar to the one in my previous post, just with different level numbers.