PoP1 SEGA Genesis format documentation

Discuss other PoP1 related things here.
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

Re: PoP1 SEGA Genesis format documentation

Post by Norbert »

David wrote:Apoplexy does not display level names for PoP2 DOS and PoP1 SNES, only the names of level types.
Why was it important for the Genesis version?
For example the "mouse" level, is 8 for DOS, 10 for Mega Drive, 8 for Sega Genesis.
This means that when I remove tiles, "mouse" tells me more about, for example, available special events.
I probably didn't add it to SNES because of how different these levels are.
Might still be useful though, same for PoP2 for DOS.
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

Re: PoP1 SEGA Genesis format documentation

Post by Norbert »

Someone mailed me with the question if there's any way to get rid of the game's input delay(*) for this port.
I personally have no idea. I also don't know if the delay was deliberately added or not.
(*) And screen-switch fading, that supposedly isn't there with the "Genesis PoP beta 1" rom.

Also, that person's working on a color hack for the cancelled PoP2 for Mega Drive:
http://www.sega-16.com/forum/showthread ... post798976
http://www.sega-16.com/forum/showthread ... post812880
David
The Prince of Persia
The Prince of Persia
Posts: 2846
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: PoP1 SEGA Genesis format documentation

Post by David »

Norbert wrote: May 11th, 2018, 8:55 pm Someone mailed me with the question if there's any way to get rid of the game's input delay(*) for this port.
I personally have no idea. I also don't know if the delay was deliberately added or not.
(*) And screen-switch fading, that supposedly isn't there with the "Genesis PoP beta 1" rom.
In case you say "supposedly" because you haven't played beta 1 yet:
You can find the "Prince of Persia (Beta 1).gen" ROM for example here: http://emu-russia.net/en/roms/gen/0-Z/f ... of-Persia/
The download is a 7-Zip archive with multiple versions of PoP1 for the Genesis.

I might look into these problems later, but I can't promise anything.
Norbert wrote: May 11th, 2018, 8:55 pm Also, that person's working on a color hack for the cancelled PoP2 for Mega Drive:
http://www.sega-16.com/forum/showthread ... post798976
http://www.sega-16.com/forum/showthread ... post812880
Yeah, I'm wondering that if this port uses the graphics from the DOS version, as he writes, then why is the palette so off.
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

Re: PoP1 SEGA Genesis format documentation

Post by Norbert »

David wrote: May 12th, 2018, 1:03 pmIn case you say "supposedly" because you haven't played beta 1 yet: [...]
Yes.
David wrote: May 12th, 2018, 1:03 pmYou can find the "Prince of Persia (Beta 1).gen" ROM for example here: http://emu-russia.net/en/roms/gen/0-Z/f ... of-Persia/
The download is a 7-Zip archive with multiple versions of PoP1 for the Genesis.
Hm, it took me about half a minute to figure out what image/text linked to the file (Prince_of_Persia.7z). It's the text "Prince of Persia" next to "US title". I eventually found it by using Ctrl+f on the page source. First I was thinking maybe Adblock Plus or Tracking Protection were causing the link to be hidden.

Anyway... Beta 1 is interesting. It must have leaked? It doesn't have the sword or guards, and a chomper (with the prince death in front of it) in the starting room, among other things. Enter restarts its only level.
David
The Prince of Persia
The Prince of Persia
Posts: 2846
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: PoP1 SEGA Genesis format documentation

Post by David »

Norbert wrote: May 12th, 2018, 6:28 pm Hm, it took me about half a minute to figure out what image/text linked to the file (Prince_of_Persia.7z). It's the text "Prince of Persia" next to "US title". I eventually found it by using Ctrl+f on the page source. First I was thinking maybe Adblock Plus or Tracking Protection were causing the link to be hidden.
Sorry about that. I am so used to the site that I forgot to explain this...
Norbert wrote: May 12th, 2018, 6:28 pm Anyway... Beta 1 is interesting. It must have leaked? It doesn't have the sword or guards, and a chomper (with the prince death in front of it) in the starting room, among other things. Enter restarts its only level.
It doesn't have the menus or the intro either. It directly starts with the first level.
There are no sounds either.
David wrote: May 12th, 2018, 1:03 pm (*) And screen-switch fading, that supposedly isn't there with the "Genesis PoP beta 1" rom.
It took me about half an hour to find the code that handles palettes and fading. (But I have been writing this post for like one hour...)
Here is how to disable fading between different rooms:
In the USA version: At offset 0x00000C32 write: 4E 71 4E 71 4E 71.
In the Europe version the offset is 0x00000BFC.
This hack doesn't affect the fade-in/out when starting or restarting the level.

Also, this hack has a small bug: when you meet the first guard, he will fade in from black. :)

Some details:
This hack actually disables the fade to black.
Due to the way fades are implemented, the following fade in will take no time, since the displayed palette already matches the level palette.

Fading to black is done using an all-black (all-zeroes) palette at offset 0x000045C0 (USA) / 0x00004B0C (Europe).
After that there are various single-color palettes for flashes. (all-red, all-blue, etc.)
Looks like they didn't bother to write code that makes such a palette from the color value.
This is not really surprising considering the way they solved integer-to-string conversion: viewtopic.php?p=19994#p19994
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

Re: PoP1 SEGA Genesis format documentation

Post by Norbert »

Yes, works.
The guard's fading in from black is actually kind of cool.
User avatar
Linkuei
Scholar Scribe
Scholar Scribe
Posts: 4
Joined: May 18th, 2018, 5:02 am

Re: PoP1 SEGA Genesis format documentation

Post by Linkuei »

David wrote: May 12th, 2018, 10:43 pm It took me about half an hour to find the code that handles palettes and fading. (But I have been writing this post for like one hour...)
Here is how to disable fading between different rooms:
In the USA version: At offset 0x00000C32 write: 4E 71 4E 71 4E 71.
In the Europe version the offset is 0x00000BFC.
This hack doesn't affect the fade-in/out when starting or restarting the level.

Also, this hack has a small bug: when you meet the first guard, he will fade in from black. :)

Some details:
This hack actually disables the fade to black.
Due to the way fades are implemented, the following fade in will take no time, since the displayed palette already matches the level palette.

Fading to black is done using an all-black (all-zeroes) palette at offset 0x000045C0 (USA) / 0x00004B0C (Europe).
After that there are various single-color palettes for flashes. (all-red, all-blue, etc.)
Looks like they didn't bother to write code that makes such a palette from the color value.
This is not really surprising considering the way they solved integer-to-string conversion: viewtopic.php?p=19994#p19994
I'm the guy behind those requests and the autor behind the Hack for the cancelled Mega Drive version of PoP2.

Registered here just to thank Norbert for the Genesis/Mega Drive Level Editor and David for founding and fixing this slow Fade in/Fade out effect that make the overall controls from this port even more worse. Now with the transition removed, feels like the DOS/SEGA CD version. Very well done!!

The other complains about this port (US/EU):

-Ridiculous delay for any movement-
If you can't see the delay: You simple can't make the Shadow and the Flame dance (<,>,<,>...) like any other good PoP version. Looks fixable for me, but i don't know where i can find these values to change/fix the timing to feel more like the DOS version...

-The Sword Fight system is broken-
The delay one more time kills the gameplay here!
If you block, you make a big step backward.
There's no "Block, Attack, Block, Attack, Block..." system.

If, at least, we can fix the delay and the big backward step. The Sword Fights will play more like the not so bad Sword Fight system from the PC Engine version.

Thank you guys for the amazing work!
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

Re: PoP1 SEGA Genesis format documentation

Post by Norbert »

Hi Linkuei. Thanks again; glad you like the software.
I was able to create it because David had documented the game's level format.
My own (dis)assembly and hex edit skills are limited.
User avatar
Linkuei
Scholar Scribe
Scholar Scribe
Posts: 4
Joined: May 18th, 2018, 5:02 am

Re: PoP1 SEGA Genesis format documentation

Post by Linkuei »

Norbert wrote: May 18th, 2018, 7:59 am Hi Linkuei. Thanks again; glad you like the software.
I was able to create it because David had documented the game's level format.
My own (dis)assembly and hex edit skills are limited.
Thank you again guys!

I forgot to quote another interesting/weird problem that would be great if fixed. This occurs only on the European version:

When you come from Left Screen to Right, there's a blind moment untill you pass the first floor from the next screen causing a lot of cheap deaths. When you come from Right to left this doesn't happen.

Here's a Video showing the problem:
(Playing with the great David fade fix)
BlueBarracudas
Efendi
Efendi
Posts: 12
Joined: May 21st, 2018, 10:07 pm

Re: PoP1 SEGA Genesis format documentation

Post by BlueBarracudas »

Linkuei wrote: May 18th, 2018, 5:51 am-Ridiculous delay for any movement-
If you can't see the delay: You simple can't make the Shadow and the Flame dance (<,>,<,>...) like any other good PoP version. Looks fixable for me, but i don't know where i can find these values to change/fix the timing to feel more like the DOS version...
If you're fine with an external fix via emulation, you can partially get rid of the lag with Retroarch's new runahead feature. Even with the max 6-frame runahead it still feels a little stiff, though.

Bonus: if you map the B button (B button in Retroarch menu) and the Up D-pad to the same key, you can pretty much re-create the DOS control scheme. Map the A button (Y button in Retroarch menu) to Shift to finish the job. NOTE: You may need to edit the .cfg directly to do this - for some reason, trying to remap the keys through retroarch's GUI menu kept incorrectly mapping them to Keypad.8 when I wanted to map them to the Up Arrow key. A quick Google check suggests this is a recurring issue with Retroarch for Windows.

Remaining issues with this port:
The "blind" spot in screen transitions shown in the post above.
Long skid/knockback when you block an attack.
Can't strike out of a block (if you could crank the runahead up even higher it might "fix" this).
Limited edge detection with running jumps (your running jump timing needs to be precise, but sneaking to the edge still works).
Running through already-triggered spikes will kill you.
You can't move/"bunny-hop" when crouched.
Gate open and close tiles are identical.
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

Re: PoP1 SEGA Genesis format documentation

Post by Norbert »

BlueBarracudas wrote: July 9th, 2018, 2:08 amYou can't move/"bunny-hop" when crouched.
I think this is possible with 'Shift' (gamepad A).
BlueBarracudas
Efendi
Efendi
Posts: 12
Joined: May 21st, 2018, 10:07 pm

Re: PoP1 SEGA Genesis format documentation

Post by BlueBarracudas »

Norbert wrote: July 9th, 2018, 7:42 am
BlueBarracudas wrote: July 9th, 2018, 2:08 amYou can't move/"bunny-hop" when crouched.
I think this is possible with 'Shift' (gamepad A).
Ah, you're right of course. A bit of an odd control choice but at least it works. If we could fix the blindspot and knockback issues (and increase the max number of runahead frames), I think this version would become playable enough to be enjoyable for those used to the more popular versions, at least for those curious about the extra levels.
David
The Prince of Persia
The Prince of Persia
Posts: 2846
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: PoP1 SEGA Genesis format documentation

Post by David »

BlueBarracudas wrote: July 9th, 2018, 2:08 am If you're fine with an external fix via emulation, you can partially get rid of the lag with Retroarch's new runahead feature. Even with the max 6-frame runahead it still feels a little stiff, though.
I just tried to run PoP in RetroArch, but it seems that it won't run any game for Sega consoles.
(I.e. those games that would use the "Genesis Plus GX" core, which is the only Genesis emulator in the "Download Core" list.)
For Genesis games it just shows a black screen (no sound either), for Master System and Game Gear games it crashes.
For the USA version of PoP1 Genesis, it beeps a few times, then it crashes.
Emulators of other systems (NES, SNES, Game Boy (Color), Atari 2600 and even the WonderSwan) work fine.

And I downloaded the "Genesis Plus GX" core today, so it has to be the newest version.
Weird.
BlueBarracudas
Efendi
Efendi
Posts: 12
Joined: May 21st, 2018, 10:07 pm

Re: PoP1 SEGA Genesis format documentation

Post by BlueBarracudas »

David wrote: July 14th, 2018, 5:57 pmI just tried to run PoP in RetroArch, but it seems that it won't run any game for Sega consoles.
(I.e. those games that would use the "Genesis Plus GX" core, which is the only Genesis emulator in the "Download Core" list.)
For Genesis games it just shows a black screen (no sound either), for Master System and Game Gear games it crashes.
For the USA version of PoP1 Genesis, it beeps a few times, then it crashes.
Emulators of other systems (NES, SNES, Game Boy (Color), Atari 2600 and even the WonderSwan) work fine.

And I downloaded the "Genesis Plus GX" core today, so it has to be the newest version.
Weird.
Honestly, I find Retroarch in general and it's GUI in particular very difficult to use, but the runahead feature makes it worth it to me and I have managed to get Genesis games to run. The Mega Drive version of POP1 works for me with the GenesisPlusGX core, but the PicoDrive core should support it as well (along with MS and GG games, btw). Are you sure you have the bios correctly named and located? BIOS info: https://docs.libretro.com/library/genesis_plus_gx/
David
The Prince of Persia
The Prince of Persia
Posts: 2846
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: PoP1 SEGA Genesis format documentation

Post by David »

BlueBarracudas wrote: July 14th, 2018, 11:40 pm The Mega Drive version of POP1 works for me with the GenesisPlusGX core, but the PicoDrive core should support it as well (along with MS and GG games, btw).
PicoDrive doesn't even appear for me in the Download Core menu.
But there is a picodrive_libretro.info file in the RetroArch\info folder, so RetroArch somehow knows about it.

There are a couple more cores missing from the menu, like the PlayStation ones.
BlueBarracudas wrote: July 14th, 2018, 11:40 pm Are you sure you have the bios correctly named and located? BIOS info: https://docs.libretro.com/library/genesis_plus_gx/
I didn't even know that I need a BIOS, since my usual Genesis emulator (Fusion) worked without it...
The linked page lists only one MegaDrive BIOS, and that is listed as Optional.
Anyway, I will try to find a BIOS.

Update:
I found the BIOS here: http://emu-russia.net/en/roms/gen/0-Z/f ... TMSS-BIOS/
(Click the name after "US title" to download.)
I copied the file to RetroArch\system\bios_MD.bin .
Core Information says this ROM is Present.
However, PoP for the Genesis still doesn't work for me.

The version of the installed Genesis Plus GX is v1.7.4, which is the newest: https://github.com/libretro/libretro-su ... retro.info

Update:
I found a bug report: https://github.com/libretro/Genesis-Plus-GX/issues/146
When you load ANY SEGA game from ANY source with ANY file extension: it'll just be a blank screen (or sometimes crash).
This is what happens on my system.

There is a manually downloadable version of genesis_plus_gx_libretro.dll here: https://bitbucket.org/eke/genesis-plus- ... er/builds/
If I overwrite RetroArch\cores\genesis_plus_gx_libretro.dll with this then I can finally play Genesis games.
And I don't even need the BIOS.
BlueBarracudas wrote: July 9th, 2018, 2:08 am you can partially get rid of the lag with Retroarch's new runahead feature.
You can find this at: Options (or press F1 after you started the game) -> Latency -> Run-Ahead to Reduce Latency -and- Number of Frames to Run Ahead
Post Reply