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

Got a programming project in mind? Tell everyone about it!
User avatar
tricky
Posts: 2634
Joined: Tue Jun 21, 2011 8:25 am
Contact:

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

Post by tricky » Thu Feb 01, 2018 6:56 pm

Kieran, I'm not trying to distract you, but as an owner of a B+ 128 (my favourite beeb after my original) I can't help but point out that depending on what you are doing with the shadow copy of the screen, you can display one while updating the other (but not vice-versa).
If I am reading the B+ service manual correctly, code in the last 4K of the 12K of RAM that overlaps sideways ROM accesses main RAM while in shadow mode, so a memcpy loop crossing &A000 should work!
Figure 5 RAM access in normal and shadow modes
In normal mode the RAM can be thought of as 44K from address &0000-&AFFF. The top 12K of this RAM from address &8000-&AFFF is paged into the memory map when required in place of the bottom 12K of the sideways ROM space, see 5.4.2. The remaining 20K of RAM is set aside for the shadow screen memory, while it always exists, it is not available to the system in normal mode. The bank of 44K RAM we shall call "normal RAM". In normal mode, VDUSEL (IC36 pin 17) is always zero.
Any code executing anywhere within normal RAM in normal mode will always access normal RAM, it cannot access shadow RAM.

In shadow mode the RAM can be thought of as 44K from address &0000-&AFFF, plus a parallel bank of 20K RAM from address &3000-&7FFF which we shall call "shadow RAM". As in normal mode, the top 12K of normal RAM is paged into the memory when required. In the address range &3000-&7FFF the PAL (IC36) is able to switch between shadow RAM and normal RAM. It selects access to the shadow memory if a) shadow mode is on b) it detects a VDU driver and c) the operand address is between &3000 and &7FFF, the part of the memory map used by the screen. Otherwise it selects access to normal RAM. The machines logic is set to shadow mode when logic 1 is written to D7 at address &FE34, this causes pin 17 (VDUSEL) to go high. &FE34 is the address of a register in the PAL and when D7 is set any screen access through the VDU drivers will cause the PAL to switch in the shadow memory by making pin 12 (CPUSEL) high. In shadow mode, VDUSEL is always set, and CPUSEL is low to access normal RAM and high to access shadow RAM.
When the paged RAM is selected in shadow mode, the top 4K, &A000 to &AFFF, is programmed by the PAL (IC36) to have the attributes of VDU drivers.
Any code executing between &0000-&9FFF in shadow mode will always access normal RAM.
Any code executing from sideways RAM between &A000-&AFFF will access the shadow RAN (if selected) when the operand address is between &3000-&7FFF. This special attribute is not available to any other sideways memory, ROM or RAM.
I must admit that I didn't even try this for AstroBlaster samples as it made my head hurt and hay it already had SWRAM.
Anyway, I just wanted it out there, I'm not suggesting you do it, not even as a stretch goal!

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 » Thu Feb 01, 2018 7:09 pm

lurkio wrote:
Matt Godbolt wrote:Cripes mate that looks fantastic!
kieranhj wrote:The Master version needs ...
-- although if Matt were to find the time to implement it, it would benefit another recent game, White Light, too. (Hint, hint!)

:?:
Hahah hint taken. I'm actually working on jsbeeb at the moment, to add support for serial stuff and touchscreens. I'll be sure to make writable discs too. I have some ideas about this feature too...

User avatar
kieranhj
Posts: 700
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 » Thu Feb 01, 2018 8:17 pm

tricky wrote:I must admit that I didn't even try this for AstroBlaster samples as it made my head hurt and hay it already had SWRAM.
Anyway, I just wanted it out there, I'm not suggesting you do it, not even as a stretch goal!
Yes, trying to read that also made my head hurt! If it’s a case of slightly rejigging the memory map and tweaking the addresses used for paging then I’ll add it to the list but going to come after the vanilla Master and NULA versions!

I may be using a couple of 65C102 opcodes but I don’t think they are critical.
Bitshifters Collective | Retro Code & Demos for BBC Micro & Acorn computers | https://bitshifters.github.io/

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

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

Post by trixster » Thu Feb 01, 2018 8:55 pm

Whilst we're making requests, how about BBC Bs with lots of swram AND shadow ram? Mine has got a WE ram card so there's 20k shadow to play with!
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
tricky
Posts: 2634
Joined: Tue Jun 21, 2011 8:25 am
Contact:

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

Post by tricky » Thu Feb 01, 2018 10:02 pm

I wouldn't say the B+ shadow ram is just a matter of rejigging the memory map as I think although you could siplay one screen while building the other, then I think you would have to copied the changed bits back, but maybe its not that bad!

WE Shadow RAM won't sole the double buffering the screen problem, just give you more RAM.

User avatar
daveejhitchins
Posts: 4267
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 » Fri Feb 02, 2018 7:29 am

Just like to 'chip-in' here and really ask a question that I already know the answer to - but what the Hell!

How about an Electron with Turbo, shadow RAM and AP6 with lots RAM (extra 112K!) - could also add 2 x ABR giving a total of 176K of sideways RAM :D :roll:

Always worth a punt . . . :oops:

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

User avatar
sbadger
Posts: 327
Joined: Mon Mar 25, 2013 1:12 pm
Location: Farnham, Surrey
Contact:

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

Post by sbadger » Fri Feb 02, 2018 1:36 pm

Lovely Stuff Kieran, or should I say, Prince of Paddington!



:-D
So many projects, so little time...

SteveF
Posts: 510
Joined: Fri Aug 28, 2015 8:34 pm
Contact:

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

Post by SteveF » Fri Feb 02, 2018 9:54 pm

tricky wrote:If I am reading the B+ service manual correctly, code in the last 4K of the 12K of RAM that overlaps sideways ROM accesses main RAM while in shadow mode, so a memcpy loop crossing &A000 should work!
I might be misunderstanding what you're saying, but I wrote a test program to investigate the behaviour of this on real hardware and some people kindly ran it - have a look at the thread starting at http://www.stardot.org.uk/forums/viewto ... 87#p158387 Following on from that, my understanding is that code in the last 4K of the private 12K of RAM always accesses the displayed screen RAM, be that shadow or main RAM.

User avatar
kieranhj
Posts: 700
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 Feb 02, 2018 10:17 pm

I think I can safely discount the possibility of a B+ version at this point. And as for your ultra-pimped Electron... :lol:
Bitshifters Collective | Retro Code & Demos for BBC Micro & Acorn computers | https://bitshifters.github.io/

User avatar
daveejhitchins
Posts: 4267
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 » Sat Feb 03, 2018 5:19 am

kieranhj wrote:And as for your ultra-pimped Electron... :lol:
:(

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

User avatar
kieranhj
Posts: 700
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 » Sat Feb 03, 2018 1:26 pm

daveejhitchins wrote::(
I’m not at all familiar with Electron hardware add-ons (despite it being my first computer - just a bit too young!)

On the positive side all the source to POP Beeb is in GitHub and built from a single BeebAsm master asm file. The code is structured across about 20 reasonably well defined modules and I will publish the final memory map when complete. So if anyone would like to port to their own more exotic Acorn configuration (Atom, Electron, B+) then I would be happy to provide guidance on where to find the various hooks for ram banking, shadow, disc access etc.
Bitshifters Collective | Retro Code & Demos for BBC Micro & Acorn computers | https://bitshifters.github.io/

User avatar
danielj
Posts: 6366
Joined: Thu Oct 02, 2008 4:51 pm
Location: Manchester
Contact:

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

Post by danielj » Sat Feb 03, 2018 1:30 pm

kieranhj wrote:
daveejhitchins wrote::(
I’m not at all familiar with Electron hardware add-ons (despite it being my first computer - just a bit too young!)
I think you'll come a cropper, as shadow ram can't be paged in/out - it's either or or off, and AFAIK you can't write directly to it, you have to go via the OS routines... *this could be incorrect!

d.

User avatar
daveejhitchins
Posts: 4267
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 » Sat Feb 03, 2018 4:09 pm

danielj wrote:I think you'll come a cropper, as shadow ram can't be paged in/out - it's either or or off, and AFAIK you can't write directly to it, you have to go via the OS routines... *this could be incorrect!
- - - AND!

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

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

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

Post by RobC » Mon Feb 05, 2018 1:34 pm

Depending on the amount of actual RAM needed, I wonder whether the Mega Games Cartridge could be used as a large data store with 16KBs of data paged in as required?

crj
Posts: 834
Joined: Thu May 02, 2013 4:58 pm
Contact:

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

Post by crj » Mon Feb 05, 2018 2:33 pm

Terrifyingly, I realise that with modern hardware the limitation that the video subsystem always reads from main RAM needn't be an issue.

Suppose you'd attached enough RAM directly to a BBC B's CPU that it could happily emulate a BBC Master and more. That would leave the CPU's time on the main bus largely idle, apart from screen writes and memory-mapped I/O. The back of an envelope suggests some hardware trickery could react to a bank switch by blitting a different bank of screen memory into physical RAM quickly enough that it would keep ahead of the CRTC!

So nowadays, it's possible to make a shadow RAM system that supports bank switching without interfering at all with the video circuitry. Ulp!

paulb
Posts: 811
Joined: Mon Jan 20, 2014 9:02 pm
Contact:

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

Post by paulb » Mon Feb 05, 2018 3:39 pm

RobC wrote:Depending on the amount of actual RAM needed, I wonder whether the Mega Games Cartridge could be used as a large data store with 16KBs of data paged in as required?
Some kind of adjustable/scrolling window in the 16K sideways RAM/ROM region was done by various filing systems, and I did wonder whether Dave H might try and provide that with the MGC at some point. I did consider doing this with discrete logic, but you need quite a few ICs to make it work nicely, and the MGC has programmable logic, of course.

Another benefit of such a mechanism is the ability to access faster memory than the system RAM, although the 6502 instruction set really does favour zero page usage, thus limiting such benefits. And the screen accesses are still a bottleneck, too.

User avatar
daveejhitchins
Posts: 4267
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 05, 2018 7:39 pm

RobC wrote:Depending on the amount of actual RAM needed, I wonder whether the Mega Games Cartridge could be used as a large data store with 16KBs of data paged in as required?
The MK II will have just such a block available :D

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

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

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

Post by RobC » Wed Feb 07, 2018 5:10 pm

daveejhitchins wrote:The MK II will have just such a block available :D
Sounds good. I was just wondering whether having lots of ROM available was good enough (as that's what the existing MGC provides)?

User avatar
Arcadian
Site Admin
Posts: 2940
Joined: Fri Nov 24, 2000 12:16 pm
Contact:

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

Post by Arcadian » Thu Feb 22, 2018 7:21 am

kieranhj wrote:I will post a new level 1 WIP when I get chance, hopefully later today.
Hi, still planning a demo ver with dethmunk's marvy new gfx? Or have I somehow managed to miss it? :oops:
For a "Complete BBC Games Archive" visit www.bbcmicro.co.uk

Image
ABug SOUTH (Hampshire) (1-3 June 2018)

User avatar
kieranhj
Posts: 700
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 » Thu Feb 22, 2018 2:05 pm

Arcadian wrote:
kieranhj wrote:I will post a new level 1 WIP when I get chance, hopefully later today.
Hi, still planning a demo ver with dethmunk's marvy new gfx? Or have I somehow managed to miss it? :oops:
Haha, I did promise that but then Dethmunk & I decided to keep you all in suspense for a bit longer whilst we got a further along with the graphics and Simon tinkered with the audio. I will endeavour to get a level 1 WIP demo released for the weekend in order to get feedback and compatibility testing with folks' real hardware setups etc. There are a couple of things I want to get sorted before then because these things tend to go wider than you expect!
Bitshifters Collective | Retro Code & Demos for BBC Micro & Acorn computers | https://bitshifters.github.io/

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

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

Post by Dethmunk » Sat Feb 24, 2018 1:55 pm

Can't wait for people to play the demo.... I'm enjoying working on this Kieran. Sure seems to be coming together well too. I'm neglecting my Nintendo Switch, TV and Movies for this... tsk dam you retro gaming love.... :-)
Here's me working on some pixel stuff. LOL.
Pixels blurred to protect the innocent. ha ha. #sneakpeak

Image
Image

User avatar
FourthStone
Posts: 537
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 » Sat Feb 24, 2018 7:41 pm

What a fantastic snapshot of modern retro computing!

Who could've imagined what computers would be like back then, that in 30 years we'd be using souped up terabyte computers to continue development and enjoyment of those first computers we all used.

I wonder if in another 30 years we'll have VR simulations of people reliving the 'old' 64bit age of computers with the users writing 8bit software to play on original hardware... the mind boggles.

User avatar
kieranhj
Posts: 700
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 » Sun Feb 25, 2018 12:41 am

FourthStone wrote:I wonder if in another 30 years we'll have VR simulations of people reliving the 'old' 64bit age of computers with the users writing 8bit software to play on original hardware... the mind boggles.
You mean something a bit like this? https://youtu.be/AiZvGwojvS8 :D
Bitshifters Collective | Retro Code & Demos for BBC Micro & Acorn computers | https://bitshifters.github.io/

User avatar
FourthStone
Posts: 537
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 » Sun Feb 25, 2018 6:58 pm

Where's the like button, that VR vid is quite funny :lol:

User avatar
kieranhj
Posts: 700
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 » Sun Feb 25, 2018 10:15 pm

Hey folks,

I did promise you a demo this weekend but I'm going to renege on that and give you this wonderful screenshot of the newly redrawn Kid risking his life in the Palace instead, because I don't think you've seen these amazingly colourful backgrounds from Dethmunk yet:
new player in palace.png
Kid in the Palace!
The truth is that we're so close to getting the full game finished but it's not necessarily clear what is and isn't done yet. I can caveat this with you guys who understand it's work in progress but, with the best will in the world, stuff gets picked up quickly and travels further than you expect online and I can't provide a commentary for that. I already saw this when an early flickery version got sent to Jordan Mechner on Twitter by somebody else!!

As Dethmunk said, this has become a real labour of love for us and now has the focus & momentum from four professional game developers to make the best looking & sounding BBC game ever (and first BBC Master only game in the process.) I'd rather keep you waiting just a few more weeks to play the full thing and enjoy the whole experience from start to finish, not just level 1.

I hope you understand but please be patient... BBC forever! :D \:D/

PS. The amazingly talented musician who composed the tune for our Bad Apple demo has been inspired to recreate all of the original music from the PC version but in full channel SN chip audio just for the BBC Micro. That alone I think is worth waiting for!!
Bitshifters Collective | Retro Code & Demos for BBC Micro & Acorn computers | https://bitshifters.github.io/

User avatar
lurkio
Posts: 1660
Joined: Tue Apr 09, 2013 11:30 pm
Location: Doomawangara
Contact:

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

Post by lurkio » Sun Feb 25, 2018 10:27 pm

Sounds like you've got a great team together. And the graphics just keep getting better.

Can't wait!

Good luck!

[-o<

User avatar
danielj
Posts: 6366
Joined: Thu Oct 02, 2008 4:51 pm
Location: Manchester
Contact:

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

Post by danielj » Sun Feb 25, 2018 10:28 pm

OOooh, you tease Kieran :D

It looks absolutely amazing. Very very exciting! Any NULA goodies?

d.

User avatar
tricky
Posts: 2634
Joined: Tue Jun 21, 2011 8:25 am
Contact:

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

Post by tricky » Sun Feb 25, 2018 10:44 pm

Great work guys, this could be very big for our little community, I'm sure we can wait a little longer after all these years.

User avatar
kieranhj
Posts: 700
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 » Sun Feb 25, 2018 10:55 pm

Thanks for the support everyone!
danielj wrote:It looks absolutely amazing. Very very exciting! Any NULA goodies?
There will be a NULA version but that will definitely come a while after the standard Master release. (If nothing else I'll need a break after working on this almost continually for a year by the end.) I think Dethmunk has done an amazing job making the graphics look this good using just the regular Beeb palette - we're really trying to push it to see what can be done on original hardware first.

It would never have been commercially viable to make Master only games BITD but an interesting bar for us to set now..!
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 12:18 am

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!

Post Reply