Page 3 of 3
Re: To compile and run Prince Of Persia source code.
Posted: Sun Mar 17, 2013 9:44 pm
by potatohead
Yes. Precisely. What I found interesting was I found no assembler that would allow for a large memory arrangement. They all wanted to manage banks, segments, etc...
So far, this has been a great exercise! I've learned a lot. It bothers me considerably that I cannot find an assembler that does it that way.
Re: To compile and run Prince Of Persia source code.
Posted: Tue Mar 19, 2013 6:25 pm
by potatohead
Update:
A long discussion on assemblers and some education on my part has advanced the project some. It's time to build up a sample bootable Apple disk image and check it on both a real machine and emulation. I'll start with the very basic example Miles provided, then move to one that incorporates the necessary RWTS for doing more than just a bootup. The product of that will be the base I/O code needed to begin building PoP.
Re: To compile and run Prince Of Persia source code.
Posted: Wed Apr 17, 2013 7:45 am
by AdamGr
Hard to believe that it has already been a year since Jordan Mechner et al made these sources available on github. Like others here, I too have been investigating the possibility of building the Apple II Prince of Persia sources. There are definitely multiple ways to tackle this problem and this thread mentions a few great alternatives. In the end, I decided that the most interesting way (i.e. most fun) for me to solve the problem would be to write a Merlin 8 compatible cross assembler that would run on modern PCs to build the original sources.
At this point I have a fork of Jordan Mechner's github repository which contains a makefile and tool binaries for 32-bit x86 host platforms running OS X, Windows, or Ubuntu. The makefile is able to assemble all of the required Prince of Persia sources and generate a 3.5" disk image. My current build documentation can be found here:
https://github.com/adamgreen/Prince-of- ... ild.creole The source code for the assembler and disk imaging tool used can be found here:
https://github.com/adamgreen/snapNcrackle
There are some important things to note about the current state of this build system:
The output disk image won't work on the Apple IIGS. The Prince of Persia sources use 65802 instructions in some Apple IIGS specific code paths. I don't support this instruction set yet. I will correct this in the near future and this should increase the numbers of emulators and machines on which the disk image will work.
I have been using
JACE for my current testing and it sort of works but has issues with keyboard input on my MacBook Air. Maybe others more familiar with Apple emulators have other suggestions for emulators that can emulate a 128K Apple II using an emulated SmartPort 3.5" or mass storage mounting of this image.
Only a 3.5" disk image is created at this point. The github repository doesn't contain the RW18 code required for 5.25" disks but it does contain the 3.5" version. If someone has an original copy of the 5.25" Prince of Persia disk and is able to make a nibble copy of both sides, then I would love to have it. It would really help me pull together 5.25" disk support in this build system.
Thanks,
Adam
Re: To compile and run Prince Of Persia source code.
Posted: Wed Apr 17, 2013 5:32 pm
by BigEd
Impressive!
Re: To compile and run Prince Of Persia source code.
Posted: Wed May 15, 2013 7:10 am
by AdamGr
I recently updated my github repository so that it can now create 5.25" .nib disk images for Prince of Persia as well. This appears to enable the game to play on more emulators. I have used Virtual ][ on my MacBook and others have used it with AppleWin on Windows machines.
Re: To compile and run Prince Of Persia source code.
Posted: Sat Jun 15, 2013 1:41 pm
by andym00
Maybe of interest to those involved in this thread..
A code review of PoP

Probably not that much in there the seasoned 6502 hackers didn't already know.. But an interesting read over a coffee..
http://fabiensanglard.net/prince_of_persia/index.php
Re: To compile and run Prince Of Persia source code.
Posted: Thu Sep 01, 2022 1:22 am
by wyattwong