Prince Of Persia - 30th Anniversary Port

User avatar
Shauing
Calif
Calif
Posts: 431
Joined: April 5th, 2018, 10:38 pm
Contact:

Re: Prince Of Persia - 30th Anniversary Port

Post by Shauing »

badnest wrote: July 16th, 2021, 3:16 am To be quite honest this (shared hit star/life meter palette) is one change I'm not too fond of. In my opinion it doesn't make sense in the context of the console's richer color palette. I don't think it looks very good, and if you're gonna go as far as to emulate the color limitations of the DOS version then you might as well use 6 color sprite palettes (please don't do this). That's just me though.

What I can say so far from what I've seen, you've done an impressive job with the intro modifications and syncing it up with the music. It's amazing, really. The new music (or sometimes lack of) also sounds great. Looking forward to playing more.
Hmm, I'll check if I have one (or can make one) as there were a few other changes I did between those changes. I'm also waiting if there's a solution to this.
I'm adapting to SNES what is on the DOS as much as possible (of course is not a copy-paste or 1:1, but an adaptation). Hopefully it'll be sorted out.
I'm happy you liked the new music and intro changes.
NEW UPDATE! Prince Of Persia: 30th Anniversary Port v1.1.5. Download it today!: viewtopic.php?p=29053#p29053
NEW UPDATE! Prince Of Persia: The Queen Of Light v2.6. Download it today! viewtopic.php?p=33174#p33174
David
The Prince of Persia
The Prince of Persia
Posts: 2846
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Prince Of Persia - 30th Anniversary Port

Post by David »

Here is how to undo the hack which changes the color of the star sprites:
At 0xF5A1 write back what was there originally: 20 F8 C3
User avatar
Shauing
Calif
Calif
Posts: 431
Joined: April 5th, 2018, 10:38 pm
Contact:

Re: Prince Of Persia - 30th Anniversary Port

Post by Shauing »

David wrote: July 17th, 2021, 6:59 pm Here is how to undo the hack which changes the color of the star sprites:
At 0xF5A1 write back what was there originally: 20 F8 C3
Thank you. So I suppose there's no feasible solution to this issue other than undoing it.
EDIT: It seems to only make the Prince's star sprite to have the palette of the enemy it's facing.
EDIT 2: We missed the guard's star sprite undo at F5E2.
EDIT 3: Version 1.1.5 has been uploaded; it's using the same link and name file of V1.1 for now to use the same shortened link and thus avoid asking the admins to change the link on the first page.
NEW UPDATE! Prince Of Persia: 30th Anniversary Port v1.1.5. Download it today!: viewtopic.php?p=29053#p29053
NEW UPDATE! Prince Of Persia: The Queen Of Light v2.6. Download it today! viewtopic.php?p=33174#p33174
David
The Prince of Persia
The Prince of Persia
Posts: 2846
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Prince Of Persia - 30th Anniversary Port

Post by David »

Shauing wrote: July 17th, 2021, 7:38 pm EDIT 3: Version 1.1.5 has been uploaded; it's using the same link and name file of V1.1 for now to use the same shortened link and thus avoid asking the admins to change the link on the first page.
I downloaded the file linked from the first post, and it's the same file as for v1.1.
User avatar
Shauing
Calif
Calif
Posts: 431
Joined: April 5th, 2018, 10:38 pm
Contact:

Re: Prince Of Persia - 30th Anniversary Port

Post by Shauing »

David wrote: July 17th, 2021, 9:01 pm
Shauing wrote: July 17th, 2021, 7:38 pm EDIT 3: Version 1.1.5 has been uploaded; it's using the same link and name file of V1.1 for now to use the same shortened link and thus avoid asking the admins to change the link on the first page.
I downloaded the file linked from the first post, and it's the same file as for v1.1.
Here's the link to be updated on the first post:
https://bit.ly/PoP30th115
NEW UPDATE! Prince Of Persia: 30th Anniversary Port v1.1.5. Download it today!: viewtopic.php?p=29053#p29053
NEW UPDATE! Prince Of Persia: The Queen Of Light v2.6. Download it today! viewtopic.php?p=33174#p33174
David
The Prince of Persia
The Prince of Persia
Posts: 2846
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Prince Of Persia - 30th Anniversary Port

Post by David »

Shauing wrote: July 17th, 2021, 9:24 pm Here's the link to be updated on the first post:
https://bit.ly/PoP30th115
Done: viewtopic.php?p=29053#p29053

Should I also add a changelog entry to the post?

It could be something like this:
Change from v1.1:
- Removed the coloring of hit star sprites, because it messed up the background colors on real hardware.
User avatar
Shauing
Calif
Calif
Posts: 431
Joined: April 5th, 2018, 10:38 pm
Contact:

Re: Prince Of Persia - 30th Anniversary Port

Post by Shauing »

David wrote: July 18th, 2021, 10:00 am Should I also add a changelog entry to the post?

It could be something like this:
Change from v1.1:
- Removed the coloring of hit star sprites, because it messed up the background colors on real hardware.
Sure you can add that.
NEW UPDATE! Prince Of Persia: 30th Anniversary Port v1.1.5. Download it today!: viewtopic.php?p=29053#p29053
NEW UPDATE! Prince Of Persia: The Queen Of Light v2.6. Download it today! viewtopic.php?p=33174#p33174
David
The Prince of Persia
The Prince of Persia
Posts: 2846
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Prince Of Persia - 30th Anniversary Port

Post by David »

Shauing wrote: July 18th, 2021, 10:14 am Sure you can add that.
Done: viewtopic.php?p=29053#p29053
badnest
Efendi
Efendi
Posts: 5
Joined: July 15th, 2021, 6:08 am

Re: Prince Of Persia - 30th Anniversary Port

Post by badnest »

You could distribute the file as an archive with two ips files inside, one for emulators and one for real hardware. Romhack authors have done this in the past, there's nothing wrong with it. Thanks for taking the time to look into it, I'll be playing more of it soon and hopefully leave a full review or at least a good positives and negatives list.

Also, someone with good knowledge of how the SNES actually works could probably point out what the issue is and possibly how you could implement it in a way that works on real hardware. Even though David seems to be a real wiz on ASM, consoles are quirky like this sometimes and understanding these quirks requires deep knowledge about the hardware itself :(

Another way would be to just make all hit stars red instead of orange. This would make the game closer to the DOS version without triggering the bug.
David
The Prince of Persia
The Prince of Persia
Posts: 2846
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Prince Of Persia - 30th Anniversary Port

Post by David »

badnest wrote: July 18th, 2021, 4:04 pm Also, someone with good knowledge of how the SNES actually works could probably point out what the issue is and possibly how you could implement it in a way that works on real hardware.
Even though David seems to be a real wiz on ASM, consoles are quirky like this sometimes and understanding these quirks requires deep knowledge about the hardware itself :(
My guess is that my hack accessed the palette (CGRAM) while the PPU was drawing the screen.
But the PPU needs to read the palette during that time, to know what colors to show on the screen.
The two accesses probably clashed and the palette write in my hack went into the wrong palette slots.

The game contains some code to upload data to the CGRAM during Vblank (NMI).
(It's called "VRAM request" in my disassembly.)
That should be the correct way to change the palette.


There is another hack in this mod which accesses the CGRAM directly:
The hack which sets the color of the guard's hit points. (viewtopic.php?p=28796#p28796)

Yet this didn't cause any problem on real hardware.
That's because the game turns the screen off (Forced Blank) before writing the guard palette into CGRAM.
I put the hitpoint-color hack into this part, so this palette write didn't clash with the PPU.
User avatar
Shauing
Calif
Calif
Posts: 431
Joined: April 5th, 2018, 10:38 pm
Contact:

Re: Prince Of Persia - 30th Anniversary Port

Post by Shauing »

David wrote: July 24th, 2021, 11:04 am
badnest wrote: July 18th, 2021, 4:04 pm Also, someone with good knowledge of how the SNES actually works could probably point out what the issue is and possibly how you could implement it in a way that works on real hardware.
Even though David seems to be a real wiz on ASM, consoles are quirky like this sometimes and understanding these quirks requires deep knowledge about the hardware itself :(
My guess is that my hack accessed the palette (CGRAM) while the PPU was drawing the screen.
But the PPU needs to read the palette during that time, to know what colors to show on the screen.
The two accesses probably clashed and the palette write in my hack went into the wrong palette slots.

The game contains some code to upload data to the CGRAM during Vblank (NMI).
(It's called "VRAM request" in my disassembly.)
That should be the correct way to change the palette.


There is another hack in this mod which accesses the CGRAM directly:
The hack which sets the color of the guard's hit points. (viewtopic.php?p=28796#p28796)

Yet this didn't cause any problem on real hardware.
That's because the game turns the screen off (Forced Blank) before writing the guard palette into CGRAM.
I put the hitpoint-color hack into this part, so this palette write didn't clash with the PPU.
Hmmm, so the solution to this it's to turn the screen off before writing the star palette into CGRAM?
NEW UPDATE! Prince Of Persia: 30th Anniversary Port v1.1.5. Download it today!: viewtopic.php?p=29053#p29053
NEW UPDATE! Prince Of Persia: The Queen Of Light v2.6. Download it today! viewtopic.php?p=33174#p33174
David
The Prince of Persia
The Prince of Persia
Posts: 2846
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: Prince Of Persia - 30th Anniversary Port

Post by David »

Shauing wrote: July 24th, 2021, 11:23 pm Hmmm, so the solution to this it's to turn the screen off before writing the star palette into CGRAM?
I tried that, but then part or all of the screen visibly goes blank every time someone is hurt.
When the prince is hurt then part of the red flash becomes black.
When a guard is hurt then the screen becomes black for one frame.

Here is how to do that anyway:
Spoiler: show
I added the following code:

Code: Select all

before accessing the palette:
22 0B B6 00 JSR $00:B60B ; screen off (RTL)

after accessing the palette:
22 0F B6 00 JSR $00:B60F ; screen on (RTL)
At 0xF5A1 write: 20 F0 FA
At 0xF5E2 write: 20 A0 FC

At 0xFAF0 write: 20 F8 C3 22 0B B6 00 A9 75 8D 21 21 AE 3B 21 AC 3B 21 AD 69 02 0A 0A 0A 0A 48 18 69 88 8D 21 21 A9 04 8E 22 21 8C 22 21 3A D0 F7 A9 74 8D 21 21 AE 3B 21 AC 3B 21 68 18 69 8C 8D 21 21 A9 03 8E 22 21 8C 22 21 3A D0 F7 22 0F B6 00 60

At 0xFCA0 write: AD 64 04 C9 01 D0 03 4C F0 FA 20 F8 C3 22 0B B6 00 A9 77 8D 21 21 AE 3B 21 AC 3B 21 AD 69 02 0A 0A 0A 0A 48 18 69 88 8D 21 21 A9 04 8E 22 21 8C 22 21 3A D0 F7 A9 76 8D 21 21 AE 3B 21 AC 3B 21 68 18 69 8C 8D 21 21 A9 03 8E 22 21 8C 22 21 3A D0 F7 22 0F B6 00 60

A better solution is to wait for vblank before accessing the palette.
Spoiler: show
I added the following code before accessing the palette:

Code: Select all

; wait for start of vblank
:1
AD 10 42    LDA $4210 ; RDNMI
10 FB       BPL :1
At 0xF5A1 write: 20 F0 FA
At 0xF5E2 write: 20 A0 FC

At 0xFAF0 write: 20 F8 C3 AD 10 42 10 FB A9 75 8D 21 21 AE 3B 21 AC 3B 21 AD 69 02 0A 0A 0A 0A 48 18 69 88 8D 21 21 A9 04 8E 22 21 8C 22 21 3A D0 F7 A9 74 8D 21 21 AE 3B 21 AC 3B 21 68 18 69 8C 8D 21 21 A9 03 8E 22 21 8C 22 21 3A D0 F7 60

At 0xFCA0 write: AD 64 04 C9 01 D0 03 4C F0 FA 20 F8 C3 AD 10 42 10 FB A9 77 8D 21 21 AE 3B 21 AC 3B 21 AD 69 02 0A 0A 0A 0A 48 18 69 88 8D 21 21 A9 04 8E 22 21 8C 22 21 3A D0 F7 A9 76 8D 21 21 AE 3B 21 AC 3B 21 68 18 69 8C 8D 21 21 A9 03 8E 22 21 8C 22 21 3A D0 F7 60
User avatar
Shauing
Calif
Calif
Posts: 431
Joined: April 5th, 2018, 10:38 pm
Contact:

Re: Prince Of Persia - 30th Anniversary Port

Post by Shauing »

VelCheran played this mod live today, was nice to see a DOS speedrunner give a try to this mod port of mine:
https://www.twitch.tv/videos/1126258885?t=00h43m38s
NEW UPDATE! Prince Of Persia: 30th Anniversary Port v1.1.5. Download it today!: viewtopic.php?p=29053#p29053
NEW UPDATE! Prince Of Persia: The Queen Of Light v2.6. Download it today! viewtopic.php?p=33174#p33174
User avatar
VelCheran
Vizier
Vizier
Posts: 127
Joined: May 28th, 2020, 7:26 pm

Re: Prince Of Persia - 30th Anniversary Port

Post by VelCheran »

I think it's been ages since I beat this game with so few time remaining, but the sword fights are a bit puzzling to me. It looks like the game doesn't slow down so the guards hit quite fast. :)
User avatar
Shauing
Calif
Calif
Posts: 431
Joined: April 5th, 2018, 10:38 pm
Contact:

Re: Prince Of Persia - 30th Anniversary Port

Post by Shauing »

And ironically, there's a few portions on this mod where it lags a lot and DOS doesn't (Level 4's first guard for example), so it can disorient DOS speedrunners even more.
NEW UPDATE! Prince Of Persia: 30th Anniversary Port v1.1.5. Download it today!: viewtopic.php?p=29053#p29053
NEW UPDATE! Prince Of Persia: The Queen Of Light v2.6. Download it today! viewtopic.php?p=33174#p33174
Post Reply