C64/128 version released!

Threads about other remakes and ports.
Autor_Serwisu
Vizier
Vizier
Posts: 102
Joined: January 22nd, 2005, 9:23 pm
Location: Poland
Contact:

C64/128 version released!

Post by Autor_Serwisu »

Few days ago working version of PoP for Commodore 64/128 has been released. Enjoy: http://popc64.blogspot.com/2011/10/prin ... 64128.html
User avatar
mk1995
The Prince of Persia
The Prince of Persia
Posts: 1160
Joined: February 27th, 2009, 10:09 pm
Location: Germany

Re: C64/128 version released!

Post by mk1995 »

Wow... This port is a masterpiece! In fact, the best port out there. And I'm taking the SNES port out of consideration because it's more like an expansion than a port... at least in my opinion.
Image
Just to make something clear: I will not reply to daft PMs like "Where can I find X?" or "Can you give me a link to Y?". Most of your questions are likely answerable if only you took your bloody time to look through these forums and use Google if all else fails. Sheesh...
mrsid
Efendi
Efendi
Posts: 11
Joined: July 7th, 2009, 1:13 pm

Re: C64/128 version released!

Post by mrsid »

Thanks guys! :)

I haven't really posted much here, but I kinda announced this while ago in this thread: viewtopic.php?f=67&t=1610
Now it's done, and I'm writing the blog to document all of it, and at the end I'm gonna release the fully labelled disassembly.

Then someone could theoretically make a C/C++ version out of it and run it on the PC.
Andrew
Wise Scribe
Wise Scribe
Posts: 313
Joined: July 16th, 2009, 4:39 pm

Re: C64/128 version released!

Post by Andrew »

mrsid, hats off to you for what seems to be a mind-blowing conversion indeed! And all via reverse engineering as well, with no access to the original source code. :shock: Simply amazing and awe-inspiring! I am having a blast reading your excellent blog as well. It's like an edge-of-the-seat thriller, with all of us waiting with bated breath to know what happened next (although of course we have the end result before us already). ;) :P

Hope you'll be releasing updates as you manage to figure out the last of the vexing issues.

May I ask if you know what would be the best emulator to experience your masterpiece on a Windows PC?

P.S. A shame really that Jordan never made good on his word to release the Apple II source code. :( Makes me wonder whether someone asked him not to, or whether he himself changed his mind for some reason? ('Cos surely no one can be that busy for more than 2 years as to not even have the time to send a couple of disks over.)
User avatar
AuraDragon
Sultan
Sultan
Posts: 146
Joined: March 3rd, 2009, 11:03 pm

Re: C64/128 version released!

Post by AuraDragon »

Hey! Starwindz is on that blog, good to see he still has interest in PoP. :lol:
I post on the forum at weird times of the day
User avatar
mk1995
The Prince of Persia
The Prince of Persia
Posts: 1160
Joined: February 27th, 2009, 10:09 pm
Location: Germany

Re: C64/128 version released!

Post by mk1995 »

Get 'im over here!
Image
Just to make something clear: I will not reply to daft PMs like "Where can I find X?" or "Can you give me a link to Y?". Most of your questions are likely answerable if only you took your bloody time to look through these forums and use Google if all else fails. Sheesh...
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

Re: C64/128 version released!

Post by Norbert »

I know I'm a bit late to write this, but mrsid, what you've done is very impressive.
Congratulations on a job well done.
weirdzod
Scholar Scribe
Scholar Scribe
Posts: 2
Joined: December 26th, 2012, 10:16 pm

Re: C64/128 version released!

Post by weirdzod »

Hello!!
Can I play this port on vicepsp 2.2.1 ?? when I try to load it the emulator says "error loading file". This version of the emulator is compatible with easyflash... What can I do?
mrsid
Efendi
Efendi
Posts: 11
Joined: July 7th, 2009, 1:13 pm

Re: C64/128 version released!

Post by mrsid »

Possibly. If it's actually based on VICE 2.2 or newer and has an "Attach cartridge" option...
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

Re: C64/128 version released!

Post by Norbert »

Hi mrsid. As you may know, I've created a level editor of Prince of Persia for Apple II called leapop, available for Windows and Linux.
Since its second release (April 2018), it can also edit levels of kieranhj's BBC Master port.
While creating that last release of the editor, I've rewritten a lot of code to make it much easier to add support for other Apple II and Apple II-like disk images.
So far, the program supports 1 BBC Master (kieranhj) and 2 Apple II (adamgreen, peterferrie) images.
I'm currently creating another level editor, but when that one is done, I could continue development of leapop.
And I'm wondering if you'd then might be interested in lending me a hand with finding certain offsets in your port.
If you read this issue I created about the BBC Master port, you will understand what I mean.

By the way, are you perhaps Dutch or living in the Netherlands? While it says here that your nationality is Austrian, it's stated here that your country is the Netherlands.
mrsid
Efendi
Efendi
Posts: 11
Joined: July 7th, 2009, 1:13 pm

Re: C64/128 version released!

Post by mrsid »

Hi Norbert,

Check out the comments on this blog post: https://popc64.blogspot.nl/2011/10/part ... h.html?m=1

This is where I explained to starwindz how to find the level data in the C64 pop.crt cartridge image. This should help you too.

I grew up in Austria and I’m now living in the Netherlands. 😉
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

Re: C64/128 version released!

Post by Norbert »

User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

Re: C64/128 version released!

Post by Norbert »

mrsid wrote: May 26th, 2018, 1:59 pmCheck out the comments on this blog post: https://popc64.blogspot.nl/2011/10/part ... h.html?m=1

This is where I explained to starwindz how to find the level data in the C64 pop.crt cartridge image. This should help you too.
It somewhat helped, yes.

In the 1.1 CRT, the level offsets are:
1: 0x100D0
2: 0x109D0
3: 0x112D0
4: 0x140F0
5: 0x149F0
6: 0x152F0
7: 0x18110
8: 0x18A10
9: 0x19310
10: 0x1C130
11: 0x1CA30
12: 0x1D330
13: 0x20150
14: 0x20A50
The guard HPs start at 0xECA2.
The guard strike/block/etc. settings start at 0xEC42.
And for verification of the image, I'll use "C64 CARTRIDGE" (13 chars @0x00) and "05/11/2011" (10 chars @0x688C1).

But I still have four questions.
Perhaps you're able and willing to answer these.

1. Why is KidStartFace four bytes instead of one?
BF42:KidStartFace
BF46:GdStartBlock
2. What exactly are GdStartX, GdStartSeqLo, GdStartProg and GdStartSeqHi, and do they contain - or otherwise relate to - the guards' skills and colors? (GdStartX could be a location too, but isn't GdStartBlock enough...)

3. At what offset can I find the byte that contains the prince's starting hit points?

4. In a comment on your blog, starwindz asked: "How to skip the levels by using some kind of a key? I am going to test converted custom levels." I have a similar but slightly different question. Modders should be able to quickly playtest specific levels. Is there a way to quickly launch into a specific level, for example by changing bytes to skip the intro (which takes far too long for quick playtesting), and then modifying the level number that starts when the player picks "START THE GAME". Alternatively, but likely less user-friendly, perhaps the level that loads when Ctrl+l is used could be modified. (By the way, the vice x64 emulator does not seem to recognize any keys I press other than numpad numbers...)

Thanks.
mrsid
Efendi
Efendi
Posts: 11
Joined: July 7th, 2009, 1:13 pm

Re: C64/128 version released!

Post by mrsid »

1. I had to check Jordan's source code for that now, as I've never found code that accesses those bytes.
See https://github.com/jmechner/Prince-of-P ... ource/EQ.S at line 279

Code: Select all

KidStartScrn ds 1
KidStartBlock ds 1
KidStartFace ds 1
 ds 1
SwStartScrn ds 1
SwStartBlock ds 1
 ds 1
GdStartBlock ds 24
GdStartFace ds 24
GdStartX ds 24
GdStartSeqL ds 24
GdStartProg ds 24
GdStartSeqH ds 24
So there's an unused byte each between Kid, Shadow and Guard data.
But it you search through the code, you'll see that SwStartScrn and SwStartBlock are unused.
That's because the Shadow appears at specific hard-coded locations which are defined in individual tables:

These can be found in https://github.com/jmechner/Prince-of-P ... rce/AUTO.S starting at line 1080.
The same tables are in the C64 version, but that data is embedded in the code, which is stored compressed in the .crt, so it's not directly visible.

2. GdStartX is the CharX value for the guards for each of the 24 screens. GdStartSeqLo/GdStartSeqHi are the lo/hi bytes of the position in the sequence table that the guard starts at (basically its initial animation sequence after spawning). GdStartProg is the type of AI of the guard (which also determines its color). The strength of the guards are picked from a table by indexing with the level number and then the GuardProg is used to index into a table which adds an additional strength value. These tables can be found in Jordan's source as basicstrength and extrastrength.
As far as GdStartBlock is concerned, it's first used to determine if there's a guard on the screen at all (value must be < 30, no guard if it's >= 30), and then its unpacked into X and Y, then Y is used to initialize CharBlockY and CharY. But CharX and CharBlockX are initialized from GdStartX. See code at label AddNormalGd in AUTO.S

3. The initial kid strength is hard-coded to be 3. So it's in the compressed code, and not directly visible in the .crt

4. I don't think there's an easy way to override the starting level and/or skip the intro sequence in the final build of the .crt
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

Re: C64/128 version released!

Post by Norbert »

Thank you for the information.
mrsid wrote: October 18th, 2019, 11:13 pm4. I don't think there's an easy way to override the starting level and/or skip the intro sequence in the final build of the .crt
That's unfortunate, because if there is no way for modders to playtest later levels without playing all previous levels, then I don't think anyone would use the editor (except maybe to tweak level 1).
Post Reply