PoP1 SEGA Genesis format documentation
Re: PoP1 SEGA Genesis format documentation
David, do you have any thoughts on saving object customizations? In particular, the original ROMs do not seem to have any free space after the object groups. There are some areas with consecutive 00's, but not many and most are sprinkled with other values. For the EU version, the guards end at 0x3030, level doors at 0x4854, gates at 0x6720, and so on, and, for example, the space between level doors and gates appears to be occupied. The solution I have in mind is to disallow additional objects if their maximum has been reached. This would mean for, for example, gates, that their overall usage limit is 105. If 105 gates are used in the first level, all other levels can have 0 gates. I think this is a fairly good - especially safe - solution, but maybe you have a better alternative. I don't want to scour through the entire ROM to locate areas that could provide a handful of extra bytes. Also, I don't think there are any. There are places with dozens of 00's (similarly for FF's), but most are sprinkled with other bytes. Maybe (near) the very end of the ROM. I think limiting objects might be good, it might breed creativity and - perhaps more importantly - prevent modders from creating huge levels.
Re: PoP1 SEGA Genesis format documentation
Speaking of names of levels, the four extra levels of the EU version, how will we name them? (For the 12a and 12b combination of tower and jaffar, I'm simply using "twr+jaf" and similar things.) As David mentioned, screenshots of the levels can be found here.
My thoughts:
Level 6
-----
The player moves through the level using an S path, meeting the level exit door early on. It also forces the prince to close two gates. It has lots of gates-stuff in general. But "gates" wouldn't be suitable, it might be misleading, as another extra level (#12) has a section with lots of gates. Neither would "snake" as a reference to the level shape, because the player might think of the (PoP2) animal. So, maybe "back", as in, the player has to find a way back to the level door after completing the S path?
Level 7
-----
This has the potion that freezes (stops) time. I was thinking "freeze" for this one. The guards are frozen, the hazards are, and so on.
Level 12
-----
This has the potion that shakes the screen. I was thinking either "shake" or "rumble".
Level 15
-----
This level has lots of spikes. Also several chompers and deadly pits. Drop buttons that need to be avoided. Maybe "pits" for his one? Or "hazards" or "spikes". The level itself is shaped like a gun, kind of, but I asked in #guns and from what I could tell they didn't think it resembles any known gun.
My thoughts:
Level 6
-----
The player moves through the level using an S path, meeting the level exit door early on. It also forces the prince to close two gates. It has lots of gates-stuff in general. But "gates" wouldn't be suitable, it might be misleading, as another extra level (#12) has a section with lots of gates. Neither would "snake" as a reference to the level shape, because the player might think of the (PoP2) animal. So, maybe "back", as in, the player has to find a way back to the level door after completing the S path?
Level 7
-----
This has the potion that freezes (stops) time. I was thinking "freeze" for this one. The guards are frozen, the hazards are, and so on.
Level 12
-----
This has the potion that shakes the screen. I was thinking either "shake" or "rumble".
Level 15
-----
This level has lots of spikes. Also several chompers and deadly pits. Drop buttons that need to be avoided. Maybe "pits" for his one? Or "hazards" or "spikes". The level itself is shaped like a gun, kind of, but I asked in #guns and from what I could tell they didn't think it resembles any known gun.
Re: PoP1 SEGA Genesis format documentation
I made a map of level 4 that shows the numbers of gates and buttons' event links: It seems like the (leftmost) button that opens the gate to the LP (gate[0]) is just not linked to any other gate.Norbert wrote:There are several other interesting differences I noticed. One is that after obtaining the LP in level 4, the prince cannot go back via the top rooms. He has to first kill the guard in the lower room, then obtain the LP, and then take the path to where the guard used to be. I didn't look into why the original path isn't possible, but I think the reason is that the dropped loose tile, that should keep open more than one gate, only keeps open the gate next to the LP. This could mean - again, just speculating - that the game only keeps the first gate open if a loose tile drops on a raise button.
And so there is no way to keep gate[1] open.
I also found out that the button that opens the exit on level 4 is linked to *two* things.
The first link is 0xFFFF, which means the exit door.
The second link is 0xFFFE. It might be related to the mirror's appearance.
Re: PoP1 SEGA Genesis format documentation
I figured out where is the prince's starting position stored.
I added it to the docs: http://www.princed.org/wiki/SEGA_Genesis_format
Here is how I found it, to show a concrete example of how I find out things:
I added it to the docs: http://www.princed.org/wiki/SEGA_Genesis_format
Here is how I found it, to show a concrete example of how I find out things:
Spoiler: show
Re: PoP1 SEGA Genesis format documentation
Now that you write about those directions, those are a giveaway.
Even guards have 0x0000 and 0x0800 values.
Are you also creating an editor of sorts?
[Edit: By the way, I think what you wrote about the gates (coordinate left edge, displayed right edge) also goes for guards and the prince?]
Even guards have 0x0000 and 0x0800 values.
Are you also creating an editor of sorts?
[Edit: By the way, I think what you wrote about the gates (coordinate left edge, displayed right edge) also goes for guards and the prince?]
-
- Calif
- Posts: 553
- Joined: August 27th, 2011, 2:04 am
Re: PoP1 SEGA Genesis format documentation
The map is really tiny, havent played so much Sega version, but does levels are smaller than Dos/Snes versions??David wrote: I made a map of level 4 that shows the numbers of gates and buttons' event links:
It seems like the (leftmost) button that opens the gate to the LP (gate[0]) is just not linked to any other gate.
And so there is no way to keep gate[1] open.
I also found out that the button that opens the exit on level 4 is linked to *two* things.
The first link is 0xFFFF, which means the exit door.
The second link is 0xFFFE. It might be related to the mirror's appearance.
Check my Prince in C# https://github.com/salvadorc17/Prince-Monogame
Re: PoP1 SEGA Genesis format documentation
The image only shows part of the level.salvadorc17 wrote:The map is really tiny, havent played so much Sega version, but does levels are smaller than Dos/Snes versions??
Re: PoP1 SEGA Genesis format documentation
Here is a bit more information about the format:
The bytes for the starting time are 03 4B for US, and 02 BF for EU.
First I came up with:
- US: number of times (1093/60) minutes left + number of times (1/14) minutes left
- EU: number of times (1322.5/60) minutes left + number of times (1/12) minutes left
Then I realized the US (NTSC) framerate 59.9227510135505 is a higher value than the EU (PAL) framerate 49.7014601199484.
And 703 (02 BF) x 1.205653735 = 847.574575705, which is indeed close to 843 (03 4B)
Probably some rounding happening there.
Close, but now I'm tired of looking into it.
At least I've helped a little.
Code: Select all
US EU
Starting Level 0x1DFA7 (00..0C) 0x4E2A7 (00..10)
Starting HP 0x1DFAF 0x4E2C1
Starting Time 0x1DF9D/0x1DF9E 0x4E29D/0x4E29E
First I came up with:
- US: number of times (1093/60) minutes left + number of times (1/14) minutes left
- EU: number of times (1322.5/60) minutes left + number of times (1/12) minutes left
Then I realized the US (NTSC) framerate 59.9227510135505 is a higher value than the EU (PAL) framerate 49.7014601199484.
And 703 (02 BF) x 1.205653735 = 847.574575705, which is indeed close to 843 (03 4B)
Probably some rounding happening there.
Close, but now I'm tired of looking into it.
At least I've helped a little.
Re: PoP1 SEGA Genesis format documentation
Tested with the EU version, time values above 809 show letters for the minutes left instead of numbers.
...|66|67|68|69|Mi|nu|te| R|em|ai|ni|ng| M|in|ut|es| R|em|ai|ni|ng|...
This seems to indicate the time value is a pointer to a location with strings or images.
...|66|67|68|69|Mi|nu|te| R|em|ai|ni|ng| M|in|ut|es| R|em|ai|ni|ng|...
This seems to indicate the time value is a pointer to a location with strings or images.
Re: PoP1 SEGA Genesis format documentation
I made a small program that can export texts from the game. The part with the time messages is:Norbert wrote:Tested with the EU version, time values above 809 show letters for the minutes left instead of numbers.
...|66|67|68|69|Mi|nu|te| R|em|ai|ni|ng| M|in|ut|es| R|em|ai|ni|ng|...
This seems to indicate the time value is a pointer to a location with strings or images.
Code: Select all
US: 0x00026BDE: 1 2 3 4 5 6 7 8 9101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960Minute Remaining Minutes RemainingLevel1 2 3 4 5 6 7 8 9 1011121314151617181920Password
EU: 0x000573B4: 1 2 3 4 5 6 7 8 9101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869Minute Remaining Minutes RemainingLevel1 2 3 4 5 6 7 8 9 1011121314151617181920Password
Not just that, but there are separate tables for minutes (right-aligned) and levels (left-aligned).
And it seems they were planning for 20 levels?
It makes a lot more sense if you look at the whole 32-bit numbers:Norbert wrote: Starting Time 0x1DF9D/0x1DF9E 0x4E29D/0x4E29E
The bytes for the starting time are 03 4B for US, and 02 BF for EU.
US: 0x0001DF9C: 0x00034BBF = 215999 = 60*60*60 - 1
EU: 0x0004E29C: 0x0002BF1F = 179999 = 60*60*50 - 1
The first 60 is the number of minutes at start, the second 60 is the number of seconds in a minute, and the last 50 or 60 is the framerate.
So you were right that it's bound to the framerate.
How did you find these offsets, by the way?
Here is the disassembly of that area:
Code: Select all
(US version)
0001DF92 33fc 0000 00ff 1d92 MOVE.W #0x0000 , A_00ff1d92 ; ???
0001DF9A 23fc 0003 4bbf 00ff 0d5c MOVE #0x00034bbf, A_00ff0d5c ; Time
0001DFA4 33fc 0000 00ff 0f48 MOVE.W #0x0000 , A_00ff0f48 ; Level
0001DFAC 33fc 0003 00ff 1eb0 MOVE.W #0x0003 , A_00ff1eb0 ; HP
0001DFB4 4e75 RTS
(EU version)
0004E292 33fc 0000 00ff 1e2c MOVE.W #0x0000 , A_00ff1e2c ; ???
0004E29A 23fc 0002 bf1f 00ff 0d5c MOVE #0x0002bf1f, A_00ff0d5c ; Time
0004E2A4 33fc 0000 00ff 0fe0 MOVE.W #0x0000 , A_00ff0fe0 ; Level
0004E2AC 33f9 00ff 0fe0 00ff 0fe2 MOVE.W A_00ff0fe0 , A_00ff0fe2 ; Level is copied (why?)
0004E2B6 33fc 003e 00ff 3eae MOVE.W #0x003e , A_00ff3eae ; ???
0004E2BE 33fc 0003 00ff 1f66 MOVE.W #0x0003 , A_00ff1f66 ; HP
0004E2C6 4e75 RTS
That 0x003e seems to be related to how long is the level number shown.
And if I change the first 0x0000 then the game will hang when I start the first level. The pause menu will still work, though.
Re: PoP1 SEGA Genesis format documentation
It's unfortunate you used variable names such as $a, $p, $f, $x, $sa, $ea and $la.David wrote:I made a small program that can export texts from the game.
In pseudo-code, it's doing something with 0x7A1 and a static string?
Okay.David wrote:It makes a lot more sense if you look at the whole 32-bit numbers: [...]
Changed random bytes, and when I'd found the byte to modify hit points I changed some more random bytes in its vicinity.David wrote:How did you find these offsets, by the way?
This is indeed what I'm going to do, for both the rooms (object/graphics combinations) and the guard/object attributes.Norbert wrote:[...], the original ROMs do not seem to have any free space [...] The solution I have in mind is to disallow additional objects if their maximum has been reached. This would mean for, for example, gates, that their overall usage limit is 105.
I'm adding a screen that shows usage numbers and totals, that'll show up if save is requested but one or more totals exceed available space.
Re: PoP1 SEGA Genesis format documentation
Even more accurate:David wrote:US: 0x0001DF9C: 0x00034BBF = 215999 = 60*60*60 - 1
EU: 0x0004E29C: 0x0002BF1F = 179999 = 60*60*50 - 1
The first 60 is the number of minutes at start, the second 60 is the number of seconds in a minute, and the last 50 or 60 is the framerate.
Since it's not storing a multiplication of the number of minutes at the start times the - theoretically variable/modifiable - number of seconds in a minute. I know you understand (and meant) that, but just for people who're interested in the material and are reading along.US: 0x0001DF9C: 0x00034BBF = 215999 = 3600*60 - 1
EU: 0x0004E29C: 0x0002BF1F = 179999 = 3600*50 - 1
The 3600 is the number of seconds at start, and the last 50 or 60 is the framerate.
Re: PoP1 SEGA Genesis format documentation
It goes through the whole ROM image, reading it as a sequence of 2-byte integers.Norbert wrote:It's unfortunate you used variable names such as $a, $p, $f, $x, $sa, $ea and $la.David wrote:I made a small program that can export texts from the game.
In pseudo-code, it's doing something with 0x7A1 and a static string?
If the current 2-byte integer is between 0x7A1 and 0x7A1+strlen($abc) then it can be the tile index of a character, and the program outputs that character.
The "static string" ($abc) is the list of characters in the game's font, and 0x7A1 is the tile index of the first character.
That is, 0x7A1=" ", 0x7A2="0", 0x7A3="1", and so on.
Re: PoP1 SEGA Genesis format documentation
While working on the level editor, I'm frequently playtesting. The starting animation, in the EU version, of the prince rolling downhill, I pass that quickly by holding down the backquote key. It's funny, because of the sped up sound it appears as if the prince is rolling down some kind of amusement park attraction, expression enjoyment by exclaiming "Whee!".
Re: PoP1 SEGA Genesis format documentation
[I've edited this post a bunch of times.]Norbert wrote:[Edit: By the way, I think what you wrote about the gates (coordinate left edge, displayed right edge) also goes for guards and the prince?]
It does not, my bad.
There are two exceptions though, namely the X-coordinate of the prince in level 1(EU only) and the Y-coordinate of the prince in level 7(US)/9(EU). The game moves the prince (an additional) respectively +12 (in level 1) and +31 (level 7/9) pixels.
Last edited by Norbert on December 6th, 2016, 9:24 pm, edited 2 times in total.