(Small) differences between Apple II and DOS levels

Discuss other PoP1 related things here.
Post Reply
David
The Prince of Persia
The Prince of Persia
Posts: 2846
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

(Small) differences between Apple II and DOS levels

Post by David »

(Small) differences between Apple II and DOS levels

I have compared the levels in the Apple II and DOS versions of PoP.
(I admit I was partially motivated by the possibility that the room from the cover might be hidden in the Apple II version. But, alas, it isn't.)

* The Apple II levels can be found in Mechner's PoP source: https://github.com/jmechner/Prince-of-P ... rce/Levels
* The DOS levels can be extracted from LEVELS.DAT with PR. You can use the --raw option to extract the levels without PLV headers. That way you can do a binary comparison between the corresponding levels.

Remember that the Apple II version was first, and the DOS version came later.


Here is what I found:

Differences on all levels:

1. The DOS version has guard colors Offset 0x8D7..0x8EE. That area is unused on the Apple II.

2. DOS levels (except the potions level) have an extra byte at the end (offset 0x900) with value 09.
Curiously, 9 is also the number of 256-byte sectors needed to store a level on the Apple II.

Level-specific differences:
(Scroll down for pictures.)

level 3:
Offset 0x52A: room 21, tile 2 modifier.
Apple: 01, DOS: 00.
It's just a wall pattern hidden behind the columns. It was removed in the DOS version, maybe because it's barely visible?

level 8, first difference:
Offset 0x275: room 21, tile 29.
Apple: 0x07 (doortop), DOS: 0x14 (wall).
The Apple II version has patterned doortops in the dungeon.
In the DOS version all doortops are black, so this doortop was changed into a wall.

level 8, second difference:
Offset 0x859: room 19 guard (unused room!).
Apple: 0F (tile 15), DOS: 1E (none)

level 9:
Offset 0x000 and 0x001: room 1, tiles 0 and 1.
Apple: 00 0C (empty, doortop), DOS: 14 14 (wall, wall).
Same as level 8 above.

level 10:
Offset 0x85B: room 21 guard (unused room!).
Apple: 0F (tile 15), DOS: 1E (none).

level 13:
Offset 0x5A0 and 0x6A0: door link 0 (event 1 in Apoplexy).
Apple: It points to room 5 tile 24 (unused room!), and it also triggers the next event, which points to room 3 tile 13.
DOS: It points to room 3 tile 13.


I made a collage of the differences:
differences_256color.png
User avatar
atrueprincefanfrom18
Site Shah
Site Shah
Posts: 1782
Joined: January 21st, 2020, 2:53 pm
Contact:

Re: (Small) differences between Apple II and DOS levels

Post by atrueprincefanfrom18 »

Nice.

But I think, there's a huge difference in Level 9, Room 1. The first block is a wall on DOS and a tapestry on Apple II.
I think it suggests that tapestry tiles didn't look good to eyes of Lance Groody and/or Jordan Mechner and they decided to put walls.
Love to create new MODS :)

My complete list of mods until now!

My channel. Do consider subscribing it! :)
Amethyst
Beylerbey
Beylerbey
Posts: 56
Joined: July 27th, 2021, 7:34 pm

Re: (Small) differences between Apple II and DOS levels

Post by Amethyst »

Another guard-related difference is that Fatty has 6 hitpoints on Apple II, but only 5 on DOS (and several other ports). IMHO 6 HPs are "better" considering the Prince also has 6 if all LPs have been collected.
David
The Prince of Persia
The Prince of Persia
Posts: 2846
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: (Small) differences between Apple II and DOS levels

Post by David »

Amethyst wrote: July 27th, 2021, 7:44 pm Another guard-related difference is that Fatty has 6 hitpoints on Apple II, but only 5 on DOS (and several other ports).
I tested this with the version of PoP which comes with leapop.
It seems the fat guard has 6 HP only if cheats are enabled, and I use the joystick, mapped to the numpad.
That way I enter the room with the "4" key which sets the guard's skill to 4 in cheat mode (accompanied by a beep).
Otherwise he has only 5 HP.

However, the fat guard has 6 HP here as well:
1. https://youtu.be/JZDAPp61aak?t=1400
2. https://youtu.be/JMc7cBVwF-k?t=176

I don't hear any beeps in the first video.
I'm not sure about the second video, because it's sped up.

What is going on with the hitpoints?
David
The Prince of Persia
The Prince of Persia
Posts: 2846
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: (Small) differences between Apple II and DOS levels

Post by David »

David wrote: July 31st, 2021, 1:35 pm What is going on with the hitpoints?
I tried it again, this time with a disk image from the woz-a-day collection.
(To use kinds of disk images, you need a newer version of AppleWin than what's included with leapop.)

This is the original version of PoP, it has no cheats, except for SKIP which takes you to the next level, until level 4.

The first time I enter the room, the fat guard has 6 HPs.
But if I leave the room and reenter, he will have only 5 HPs!
If I restart the level with Ctrl+A, and enter the room again, he will still have 5 HPs.

This is probably a bug.
Amethyst
Beylerbey
Beylerbey
Posts: 56
Joined: July 27th, 2021, 7:34 pm

Re: (Small) differences between Apple II and DOS levels

Post by Amethyst »

David wrote: July 31st, 2021, 8:08 pm
David wrote: July 31st, 2021, 1:35 pm What is going on with the hitpoints?
I tried it again, this time with a disk image from the woz-a-day collection.
Many thanks for getting to the bottom of this :)
David
The Prince of Persia
The Prince of Persia
Posts: 2846
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: (Small) differences between Apple II and DOS levels

Post by David »

I finally figured out how this bug works.

The fat guard will have 6 HPs the first time you enter his room, but only if you have completed level 5 before!
That explains why he has 6 HPs in the walkthrough videos.

He will have 5 HPs if you load level 6 from a saved game, or if you skip to level 6 using the GO06 cheat.

The reason I could reproduce the bug only with a WOZ disk image is my laziness:
With the other disk images, I took a short cut, and I either hex-edited the saved game to start on level 6, or used the GO06 cheat.
But the WOZ disk image has no cheats (except SKIP) and I can't hex-edit the saved game, so I had to type SKIP to skip levels until level 4, then complete level 4 and 5.

But once I figured this out, I could reproduce the bug with other disk images as well.


So why does the bug happen?

Each guard's HP is determined before his skill is loaded, even though the number of HPs depend on the skill.
This means that every time you meet a guard, he will have or not have an extra HP depending on the skill of the previous guard you have seen.

The last guard on level 5 has skill 4, which gives an extra HP.
This extra HP carries over to the level 6 guard when you first meet him.


You can try this with some other guards as well.

SKIP to level 4, then go right to see the guard behind the closed gate.
(This is the first guard in the game with skill 4.)
When you enter the room the first time, he will have 3 HPs.
If you leave and enter again, he will have 4 HPs.

Now restart the game with Ctrl+R, start a new game, and visit the first guard on level 1.
He will have 4 HPs instead of the usual 3!
If you leave the room and go back, he will have only 3 HPs.


Here are the relevant parts of the PoP Apple II source code:
Spoiler: show
All quoted code is from AUTO.S.

Code: Select all

 jsr getgdstrength ; <-- determine amount of HPs based on level and guard skill (guardprog)
 jmp :cont
[...]
:cont lda #0
 sta CharXVel
 sta CharYVel
 lda #1
 sta CharAction

 ldx VisScrn
 lda GdStartProg-1,x ; <-- load guard skill from level data
 cmp #numprogs
 bcc :ok
 lda #3 ;default
:ok sta guardprog ; <-- store guard skill to the variable used by getgdstrength
The amount of guard HPs are determined here:

Code: Select all

getgdstrength
 ldx level
 lda basicstrength,x
 ldx guardprog
 clc
 adc extrastrength,x
 sta MaxOppStr
 sta OppStrength
]rts rts
The C equivalent of this is:

Code: Select all

OppStrength = MaxOppStr = basicstrength[level] + extrastrength[guardprog];
The tables used are:

Code: Select all

basicstrength
 db 4,3,3,3,3,4,5 ;levels 0-6
 db 4,4,5,5,5,4,6 ;levels 7-13
The basic strength for guards on level 6 is 5 HP.

Code: Select all

extrastrength
 db 000,000,000,000,001,000,000,000,000,000,000,000
Guards with skill 5 (like the fat guard) have no extra HP, but guards with skill 4 have one extra HP.
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

Re: (Small) differences between Apple II and DOS levels

Post by Norbert »

David wrote: August 1st, 2021, 3:21 pm I finally figured out how this bug works.

[...]
This is very interesting. If you ever have the time, and have the audiovisual skills, maybe create a video, with desktop recording, demonstrating the bug, accompanied by your commentary that explains the bug. This could then be published, for example on YouTube (e.g. the PoPModding account), and linked to on the community's social media channels. If I'm understanding your explanation of the bug correctly, and given the time between the original game's release and this forum thread, perhaps even Mechner will be surprised to hear of this bug and particularly how it works.
Amethyst
Beylerbey
Beylerbey
Posts: 56
Joined: July 27th, 2021, 7:34 pm

Re: (Small) differences between Apple II and DOS levels

Post by Amethyst »

I might have discovered a similar bug in the PC-98 version.

When I enter this room on Level 5 for the first time, the guard has 4 hitpoints as expected. If I run away, enter the room to the left (encountering the penultimate guard with 4 hitpoints) and return, the guard suddenly has 5 hitpoints:
pc98lvl5a.png

The same can be observed with the penultimate guard if I run away to the last guard in Level 5 (who has 5 hitpoints) and return, the penultimate guard suddenly has 5 hitpoints too:
pc98lvl5b.png

I wasn't able to reproduce this behaviour in the PC Engine/TurboGrafx-CD, Mega-CD or X68000 version:
In the TurboGrafx-CD version, if I hit the guard in the first room once (reducing his health to 3 hitpoints), run away to the penultimate guard to the left and return to the guard in the first room, he still has 3 hitpoints.
The Mega-CD and X68000 version behave correctly, i.e. the guard in the first room has 4 hitpoints again after returning to him.

I haven't tried reproducing this in the FM Towns version yet.

Another observation: In the Mega-CD, TurboGrafx-CD and X68000 versions, the penultimate guard in Level 5 has 5 hitpoints (like in the DOS and most other versions), but 4 in the PC-98 and FM Towns versions (like on the Apple II).
x68klevel5.png
Amethyst
Beylerbey
Beylerbey
Posts: 56
Joined: July 27th, 2021, 7:34 pm

Re: (Small) differences between Apple II and DOS levels

Post by Amethyst »

Amethyst wrote: December 11th, 2021, 10:51 pm I haven't tried reproducing this in the FM Towns version yet.
I have now. The bug is also present in that one.

Additionally, the guard in the room to the right of the starting room in Level 4 has three hitpoints when first encountering him - returning to the starting room and encountering him again adds one hitpoint:
fmtownslvl4_1.png
fmtownslvl4_2.png

If I then go talk to this guard, he suddenly has four hitpoints instead of three:
fmtownslvl4_3.png
tacosalad
Sheikh
Sheikh
Posts: 48
Joined: October 3rd, 2005, 6:03 am
Location: Oregon, USA
Contact:

Re: (Small) differences between Apple II and DOS levels

Post by tacosalad »

Here's a not-so-small difference between Apple II and DOS: the timed-door shortcut in Level 8

Level 8 has a series of 3 closely-timed doors that you must dash through before they can close. At least, that's how it ordinarily plays.

Here's the timed-door shortcut...

On the Apple II, if you manage to kill the first guard so he falls in the door-open tile, the multiple-doors-opening sound fx will play. But the only visible door is already open...so what does that multiple-doors-opening sound mean? Hurry through that first door now...we'll find out what opened later...
Kill the first guard so he falls on the door-open tile.  And hurry through that door, it won't open again!
Kill the first guard so he falls on the door-open tile. And hurry through that door, it won't open again!
.
Later in the level, you'll start to notice doors that are already open!
Top-left corner, the door is already open...and staying that way!
Top-left corner, the door is already open...and staying that way!
.
Here's another room where you would ordinarily have to dash through those 'chompers' to get through a timed door...but it's not timed...it's open!
Top-left corner, the door is already open...and staying that way!
Top-left corner, the door is already open...and staying that way!
.
Even the first timed door is already open, even before you've fought that guard!
Top-left corner, the door is already open...and staying that way!
Top-left corner, the door is already open...and staying that way!
.
Thanks to this feature, you can take your time to explore the intermediate rooms, without worrying about getting through those timed doors before they close!
Doors just stand open as long as you like
Doors just stand open as long as you like
This was a wonderfully-discoverable feature hidden in the Apple II version. But the DOS version doesn't include it; if you kill the first guard on the door-open tile, then it just penalizes you by letting the door close...without any way to open it again!

Level 2 has a similar tile that triggers the multiple-doors-opening sound fx if you kill the second guard on the door-open tile, but I haven't found any doors that it affects. Maybe a feature was deleted from Level 2 during development?

[edit] Aaanndd...in the time it took to write that post, that RGB monitor died. No picture, no power light, just a high-pitched squeal from an ailing power supply. You served well, Magnavox RGB Display, you deserve a peaceful rest now.
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

Re: (Small) differences between Apple II and DOS levels

Post by Norbert »

tacosalad wrote: May 19th, 2022, 4:45 amHere's the timed-door shortcut...
Interesting find. :)
tacosalad wrote: May 19th, 2022, 4:45 amBut the DOS version doesn't include it; if you kill the first guard on the door-open tile, then it just penalizes you by letting the door close...without any way to open it again!
Hm, unless I misunderstand you, I don't think that's quite true. In DOS, the gate stays open. It's the original Apple II game where the (first) gate closes despite the guard being on the raise button.
tacosalad
Sheikh
Sheikh
Posts: 48
Joined: October 3rd, 2005, 6:03 am
Location: Oregon, USA
Contact:

Re: (Small) differences between Apple II and DOS levels

Post by tacosalad »

Oopsie, silly me. We've had this discussion before!

http://forum.princed.org/viewtopic.php?p=12135#p12135
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

Re: (Small) differences between Apple II and DOS levels

Post by Norbert »

tacosalad wrote: May 19th, 2022, 6:29 am Oopsie, silly me. We've had this discussion before!

http://forum.princed.org/viewtopic.php?p=12135#p12135
Oh wow, almost 10 years ago. No wonder we forgot. ;)
Post Reply