kieranhj / pop-beeb

Prince of Persia port to BBC Master
45 stars 2 forks source link

Disc loading optimisation #55

Closed kieranhj closed 6 years ago

kieranhj commented 6 years ago

Firstly the game currently reloads all background and guard character sprite data files even for same level (didn’t do this on Apple II.)

Next could make sure all initial boot files are in sequential order on disc 0 and all level files are in load order on disc 2 (blueprint, background sprites, character sprites.)

Possibly other optimisations as well!

kieranhj commented 6 years ago

Definitely needed as it takes about 10 seconds to load the Princess cutscenes. Once SWRAM banks are locked can bundle up all files into one for each bank. Possible EXO the MODE 2 screens.

kieranhj commented 6 years ago

Fixed game needlessly load bgset between level restart or changes to same set. Can probably preload Stage2 in master.asm to speed up switch to Princess cutscene in Attract mode.

kieranhj commented 6 years ago

Yes, definitely need this. Currently game loads from shift-break to attract title in ~10 seconds in b-em without disc noises. It loads in < 3 seconds on a real Master with DataCentre. :) From floppy on my real Master it takes just under 50 seconds. :(

Guess this is because disksys is loading one sector (256 bytes) at a time and copying to destination address, even when that is below &8000.

kieranhj commented 6 years ago

Have a new disksys implementation in a branch that just uses OSFILE to load entire files using the DFS API rather than loading sector-by-sector with our own catalog implementation. If destination adress is < &8000 just load in place otherwise load into screen buffer then copy pages of memory to destination. Needs testing on real floppy drive...

kieranhj commented 6 years ago

Happy with where this has ended up (after fixing some bugs!) Timing on real hardware:

Confirmed still works OK on DataCentre

mattgodbolt commented 6 years ago

Nice...may use these to tweak jsbeeb's disc timings and sounds :)