Going great guns on a Prince of Persia port...

Got a programming project in mind? Tell everyone about it!
User avatar
daveejhitchins
Posts: 4531
Joined: Wed Jun 13, 2012 5:23 pm
Location: Newton Aycliffe, County Durham
Contact:

Re: Going great guns on a Prince of Persia port...

Post by daveejhitchins » Mon Feb 26, 2018 8:48 am

Matt Godbolt wrote:I am SO excited for this. Can we support this in some way? A Patreon, or some such thing? The amount of effort you all are putting in is amazing!
Seconded, this Game is going to set-some-standards! . . . With Kieran working on this and Sarah working on her "tube type thingy" and White Light under her belt already . . . Wow =D>

Dave H :D
Parts: UM6502CE, GAL22V10D, GAL16V8D, AS6C62256A, TC514400AZ, WD1772, R6522, TMS27C512, AT28C256
Products: ARA II, ARA III, ABR, ATI, AP6, MGC, AP5 . . .
For a price list, contact me at: Retro Hardware AT dave ej hitchins DOT plus DOT com

User avatar
oss003
Posts: 2797
Joined: Tue Jul 14, 2009 11:57 am
Location: Netherlands
Contact:

Re: Going great guns on a Prince of Persia port...

Post by oss003 » Mon Feb 26, 2018 9:10 am

Congratulations guys, the gameshots are looking fantastic.
I know it's a big and long proces to check all game assembler and game data but checking 128KB is a huge, huge job........ respect ...... =D> =D>
Keep up the good work by posting some screen shots now and then, makes waiting easier ....

Greetings
Kees

User avatar
Lardo Boffin
Posts: 1321
Joined: Thu Aug 06, 2015 6:47 am
Contact:

Re: Going great guns on a Prince of Persia port...

Post by Lardo Boffin » Mon Feb 26, 2018 9:21 am

daveejhitchins wrote:
Matt Godbolt wrote:I am SO excited for this. Can we support this in some way? A Patreon, or some such thing? The amount of effort you all are putting in is amazing!
Seconded, this Game is going to set-some-standards! . . . With Kieran working on this and Sarah working on her "tube type thingy" and White Light under her belt already . . . Wow =D>

Dave H :D
Thirded. :D

This was my main motivation in getting a Master...
BBC model B 32k issue 4, 16k sideways RAM, Watford 12 ROM board, Acorn 6502 coproc
BBC model B 32k issue 7, turboMMC, Opus Challenger 3 512k, Pi 3 coproc
USA Model B
BBC Master, Datacentre + HDD, pi co-proc, econet

User avatar
kieranhj
Posts: 732
Joined: Sat Sep 19, 2015 10:11 pm
Location: Farnham, Surrey, UK
Contact:

Re: Going great guns on a Prince of Persia port...

Post by kieranhj » Mon Feb 26, 2018 11:01 am

Matt Godbolt wrote:I am SO excited for this. Can we support this in some way? A Patreon, or some such thing? The amount of effort you all are putting in is amazing!
Thanks for the feedback & encouragement, that is all the support I need for the project (plus using jsbeeb to distribute test builds of course. ;))

The usage rights for the POP source code were made quite clear by Jordan when he posted them to GitHub: https://github.com/jmechner/Prince-of-Persia-Apple-II
Jordan Mechner wrote:As the author and copyright holder of this source code, I personally have no problem with anyone studying it, modifying it, attempting to run it, etc. Please understand that this does NOT constitute a grant of rights of any kind in Prince of Persia, which is an ongoing Ubisoft game franchise. Ubisoft alone has the right to make and distribute Prince of Persia games.
As we've said, this is a labour of love for those involved and we do it because it's a challenge, it's fun and for the love of the BBC! No Patreon required.

That said, whilst three of the team are gainfully employed elsewhere, our musician Inverse Phase does make a living creating chiptune music (a niche gig by any measure) so any time he spends working on POP is time not spent on paid work. I would therefore encourage everyone to visit his Patreon page and consider supporting him so we may continue to have new, awesome BBC tunes in the future https://www.patreon.com/inversephase/overview. (I know you're already a supporter Matt!)
Bitshifters Collective | Retro Code & Demos for BBC Micro & Acorn computers | https://bitshifters.github.io/

User avatar
Matt Godbolt
Posts: 181
Joined: Mon Jul 31, 2006 10:02 am
Location: Chicago
Contact:

Re: Going great guns on a Prince of Persia port...

Post by Matt Godbolt » Mon Feb 26, 2018 1:49 pm

Cool! Thanks Kieran. We'll keep up our side of the agreement by continuing to give our enthusiastic support!

RobC
Posts: 2366
Joined: Sat Sep 01, 2007 9:41 pm
Contact:

Re: Going great guns on a Prince of Persia port...

Post by RobC » Mon Feb 26, 2018 5:33 pm

Wow - that looks amazing. Congrats to all involved =D>

I'm sure it'll be well worth the wait :D

User avatar
trixster
Posts: 692
Joined: Wed May 06, 2015 11:45 am
Location: York
Contact:

Re: Going great guns on a Prince of Persia port...

Post by trixster » Mon Feb 26, 2018 6:32 pm

It looks absolutely amazing! More screenshots please!
A3020 | A3000 | A420/1 | BBC B + 128K RAM/ROM + 20K Shadow + Pi0 + VideoNuLA
Master Turbo + DC + BeebSID | Atom | A4000 060 | A3000 060 | A1200 060 | A500
Atari Falcon 060 | Saturn | PS1 | SNES | CPC6128 | C64 | 3DO | MD | Jaguar

User avatar
richardtoohey
Posts: 3590
Joined: Thu Dec 29, 2011 5:13 am
Location: Tauranga, New Zealand
Contact:

Re: Going great guns on a Prince of Persia port...

Post by richardtoohey » Tue Feb 27, 2018 6:10 am

Matt Godbolt wrote:We'll keep up our side of the agreement by continuing to give our enthusiastic support!
Hear, hear! =D> It's looking great, but don't kill yourselves with delivery deadlines/stress; it will be ready when it's ready! :D

User avatar
Dave Footitt
Posts: 791
Joined: Thu Jun 22, 2006 9:31 am
Location: Abandoned Uranium Workings
Contact:

Re: Going great guns on a Prince of Persia port...

Post by Dave Footitt » Fri Mar 02, 2018 3:57 pm

Aye, top work, looking really lovely!

I've just had my Master Compact refurbed and this will be the perfect excuse to get it going =D>

User avatar
Dethmunk
Posts: 193
Joined: Fri Jul 01, 2016 12:29 pm
Location: Guildford
Contact:

Re: Going great guns on a Prince of Persia port...

Post by Dethmunk » Wed Mar 21, 2018 12:54 am

FYI It's close my Acorn loving friends.... :wink:
Note: This is just a bit of extra artwork I put together for Kieran. (Subject to changes). Up to him what he does with it mind you. He seemed to like it. :D I was just doing a test print of it.

Image
Image

User avatar
richardtoohey
Posts: 3590
Joined: Thu Dec 29, 2011 5:13 am
Location: Tauranga, New Zealand
Contact:

Re: Going great guns on a Prince of Persia port...

Post by richardtoohey » Wed Mar 21, 2018 4:18 am

No, no, you've got no time for that, get on with the game!

:twisted: :shock:

Just kidding, it looks great. :D

Just read Jordan's journal from that time (when he created Prince of Persia); interesting read (but very very light on any technical detail.)

User avatar
FourthStone
Posts: 631
Joined: Thu Nov 17, 2016 2:29 am
Location: Melbourne, Australia
Contact:

Re: Going great guns on a Prince of Persia port...

Post by FourthStone » Wed Mar 21, 2018 4:31 am

This PDF is a good read of some of the technical bits.

http://www.jordanmechner.com/downloads/popsource.pdf

User avatar
kieranhj
Posts: 732
Joined: Sat Sep 19, 2015 10:11 pm
Location: Farnham, Surrey, UK
Contact:

Re: Going great guns on a Prince of Persia port...

Post by kieranhj » Fri Mar 30, 2018 12:23 am

Almost a year after first looking at the code here we go: http://www.stardot.org.uk/forums/viewto ... 57&t=14858.
Bitshifters Collective | Retro Code & Demos for BBC Micro & Acorn computers | https://bitshifters.github.io/

User avatar
kieranhj
Posts: 732
Joined: Sat Sep 19, 2015 10:11 pm
Location: Farnham, Surrey, UK
Contact:

Re: Going great guns on a Prince of Persia port...

Post by kieranhj » Wed May 02, 2018 9:39 pm

I did promise everyone a memory map of the game. RobC has prompted me to do this so here's a first attempt:

Code: Select all

-------- 
POP-BEEB MEMORY MAP
-------- 

-------- 
ZERO PAGE
-------- 
&0000 - &00FF: ZERO PAGE
-------- 
Zero page high watermark =  &A0 
Zero page free =  &0 
--------
Global variables &00 - &9F
Local variables &D0 - &DF
-------- 

-------- 
LOWER Workspace 
-------- 
&0300 - &0DFF: "Lower" RAM aka "Lang" (legacy name)
-------- 
Lower workspace high watermark =  &CF8 
Lower workspace RAM free =  &8 
-------- 
General run-time buffers
E.g. image lists, collision buffers, moveable object tables, global variables (not ZP)
--------
&0C00 - &0CFF: Lower data loaded from file "$.Lower" at boot
Contains filenames, sfx lookup table, crash message text, version number at &CF0
-------- 

-------- 
CORE Modules 
-------- 
&0E00 - &2FFF: "Core" RAM
-------- 
BEEB BOOT size =  &1EC              ; System and game bootstrap
AUX JUMP TABLES size =  &81E        ; Jump tables for AUX (gameplay) functions
DISKSYS size =  &187                ; Disk system (file + sector load)
SWR size =  &6                      ; Sideways RAM routines
BEEB TEST size =  &0 
BEEB PLATFORM size =  &129          ; ULA palette, sprite palette routines
MASTER size =  &446                 ; attract mode, load data for levels or cutscenes
TOPCTRL size =  &77E                ; main game loop
AUDIO (LEGACY) size =  &1 
PUCRUNCH size =  &15B               ; decompress static screens etc. 
BEEB AUDIO size =  &106             ; Beeb audio module handling
HIRES size =  &1DC                  ; original Apple II screen plotting routines
BEEB PLOT FONT size =  &F6          ; font plot routines
BEEB PLOT FASTLAY size =  &13C      ; fast sprite plot routines
BEEB PLOT LAYRSAVE size =  &167     ; unrolled sprite "layrsave" routines
-------- 
Core code size =  &20E1 
Core data size =  &40 
Core high watermark =  &2F21 
Core RAM free =  &DF 
-------- 
Code entry is at &E00
BEEB BOOT section is trashed after boot completes and used as the Exomizer decompression buffer (for music player.)
Aux jump table transparently redirects function calls to appropriate Aux (gameplay) module in sideways RAM bank, preserving registers and ROM slot on entry and exit.
Fastlay sprite routines are byte aligned and have no clipping - used for background objects
Layrsave routines save the screen buffer beneath the character sprites into the "peel" buffer memory area
-------- 

-------- 
MAIN Modules 
-------- 
&3000 - &7FFF: "Main" RAM (also shadowed x2)
-------- 
BEEB PLOT size =  &360              ; character sprite plot routines
BEEB PLOT WIPE size =  &64          ; unrolled sprite wipe routines
BEEB PLOT LAY size =  &0 
BEEB PLOT PEEL size =  &125         ; unrolled sprite "peel" routines
-------- 
Main code size =  &4E9 
Main high watermark =  &34E9 
Peel buffer address = &3500
Peel buffer size = &C00
Screen buffer address =  &4100 
Screen buffer size =  &3F00 
Main RAM free =  &17 
--------
Character sprite plotting routines support per-pixel plotting with mirroring and per-byte clipping on all four sides
Sprite peel routines "peel" sprites pff the screen by writing previously saved ("layrsaved") data back
Screen is MODE 2 but at 160x200 resolution (24 character rows for game and 1 character row for the status line)
Entire Main RAM area is double-buffered using SHADOW RAM
--------

--------
ANDY RAM
-------- 
&8000 - &8FFF: "Andy" RAM
-------- 
AUDIO BANK 0 size =  &D6B           ; title screen music
AUDIO BANK 0 free =  &295 
AUDIO BANK 3 size =  &F14           ; in-game musical ditties
AUDIO BANK 3 free =  &EC 
AUDIO BANK 4 size =  &B09           ; in-game cutscene music
AUDIO BANK 4 free =  &4F7 
-------- 
Audio banks are overlaid as required by master.asm module
-------- 

-------- 
SIDEWAYS RAM BANK 0 
-------- 
&8000 - &BFFF: "Bank 0" (ROM slot 4)
-------- 
BGTABLE 1A size =  &171D            ; background sprites set 1A (Palace or Dungeon)
BGTABLE 2 size =  &1223             ; background sprites set 2
CHTABLE 4 size =  &14C1             ; enemy character sprites (Guards)
-------- 
BANK 0 size =  &3FC1 
BANK 0 free =  &3F 
-------- 

-------- 
SIDEWAYS RAM BANK 1
-------- 
&8000 - &BFFF: "Bank 1" (ROM slot 5)
-------- 
BGTABLE 1B size =  &7D8             ; background sprites set 1B
CHTABLE 1 size =  &129E             ; player sprites set 1
CHTABLE 2 size =  &1283             ; player sprites set 2
CHTABLE 3 size =  &E1A              ; player sprites set 3
AUDIO SFX size =  &3A2              ; sound effects
-------- 
BANK 1 size =  &3FA2 
BANK 1 free =  &5E 
-------- 

-------- 
SIDEWAYS RAM BANK 2
-------- 
&8000 - &BFFF: "Bank 2" (ROM slot 6) aka "AUX B" gameplay modules
-------- 
SEQTABLE size =  &9F1               ; animation sequence data
FRAMEDEFS size =  &7B7              ; animation frame data
CTRLSUBS size =  &86F               ; sub-routines for controling characters
COLL size =  &736                   ; collision detection routines
AUTO size =  &A4E                   ; AI / enemy character auto control
INVERTY size =  &DF                 ; code to invert all plot routines in Y axis
BEEB MASTER size =  &4B             ; Beeb specific functions for attract sequence
-------- 
Aux B code+data size =  &2CC5 
Aux B high watermark =  &BFC5 
-------- 
BANK 2 size =  &3FC5 
BANK 2 free =  &3B 
-------- 

-------- 
SIDEWAYS RAM BANK 3
-------- 
&8000 - &BFFF: "Bank 3" (ROM slot 7) aka "AUX High" gameplay modules
-------- 
CTRL size =  &B4C                   ; character control routines
FRAMEADV size =  &B41               ; render a single gameplay frame into image lists
GAMEBG size =  &507                 ; functions to plot specific game objects
GRAFIX size =  &40E                 ; plot sprites from image lists onto screen
SUBS size =  &868                   ; general sub-routines including cutscene
MOVER size =  &A60                  ; moveable object routines
MISC size =  &3EE                   ; misc routines including energy meters
SPECIALK size =  &5E2               ; keyboard handling
BEEB SCREEN size =  &89             ; Beeb specific screen functions
ATTRACT size =  &20F                ; entire attract sequence
-------- 
Aux High code size =  &3ED2 
Aux High high watermark =  &BED2 
-------- 
BANK 3 size =  &3ED2 
BANK 3 free =  &12E 
-------- 

-------- 
HAZEL Modules 
-------- 
&C300 - &DEFF: "Hazel" RAM
-------- 
BLUEPRINT size = &900               ; level data loaded from disc
TABLES size =  &57C                 ; multiplication tables
BGDATA size =  &1EB                 ; data tables related to background sprite pieces
HRTABLES size =  &190               ; lookup tables for sprite plot
BEEB PALETTE DATA size =  &4C1      ; unrolled palette tables for fast sprite plot
EXO size =  &134                    ; Exomizer decompressor
VGMPLAYER size =  &132              ; VGM music player module
FONT size =  &1CA                   ; font data
-------- 
HAZEL data size =  &F00 
HAZEL code size =  &2FC 
HAZEL BSS (blueprint) size =  &900 
HAZEL high watermark =  &DEFC 
HAZEL RAM free =  &4 
-------- 

-------- 
CUTSCENE OVERLAYS
--------
CHTABLE 6 size =  &3E0A             ; cutscene sprites (4bpp) level 2+
CHTABLE 7 size =  &8EB              ; cutscene sprites (4bpp) attract only
CHTABLE 8 size =  &1B9E             ; cutscene sprites (4bpp) attract + level 1-2
CHTABLE 9 size =  &2B0F             ; cutscene sprites (4bpp) attract only
AUDIO BANK 1 size =  &128C          ; story cutscene music
AUDIO BANK 2 size =  &2B48          ; epilog cutscene music
--------
CHTABLE 6 or 8 are loaded into BANK 0 (ROM slot 4) between gameplay levels, displacing background sprite sets
CHTABLE 9 is loaded into BANK 1 (ROM slot 5) during attract cutscene only, diplacing background and player sprite sets
CHTABLE 7 and AUDIO BANK 1 are loaded into BANK 0 (ROM slot 4) during attract sequence only
AUDIO BANK 2 is loaded into BANK 0 (ROM slot 4) before the final epilog cutscene
--------
Also attached as a text file for convenience. I will check this in to the GitHub repo when I get chance.
Attachments
pop-beeb-memory-map.txt
POP BEEB memory map
(7.87 KiB) Downloaded 29 times
Bitshifters Collective | Retro Code & Demos for BBC Micro & Acorn computers | https://bitshifters.github.io/

RobC
Posts: 2366
Joined: Sat Sep 01, 2007 9:41 pm
Contact:

Re: Going great guns on a Prince of Persia port...

Post by RobC » Thu May 03, 2018 6:57 am

Thanks Kieran - that's awesome.

Post Reply