It is currently Mon Oct 20, 2014 4:03 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 11 posts ] 
Author Message
PostPosted: Mon Oct 18, 2010 2:28 pm 
Offline
 Profile

Joined: Sun May 02, 2010 2:07 pm
Posts: 42
It can't be that hard to save a block of memory to disc, but I've not found any games yet that actually save the high score to disc. I'm sure in the age of write protect tabs on 5 1/4 floppies disc wear was an issue, but I can't see a problem with CF cards etc that everyone has now.

Anyone know of a game, or better still have some suitable machine code I could adapt for the purpose ?

I want to have a go at hacking a high score saving feature into some existing games. Just your usual arcade games, with name and score lists, Would the EXMON rom help with find the block of memory involved ?


Top
 
PostPosted: Mon Oct 18, 2010 4:42 pm 
Offline
User avatar
 Profile

Joined: Wed Mar 26, 2008 12:58 pm
Posts: 48
Location: Shadow in a Valley of Scotland
the only game i can mind that saves high score is
Super Pool by Invasion. You pressed break, and it asked if you wanted to save.

Can't mind off top of head any others :?

_________________
Retro Rules! ImageImageImage


Top
 
PostPosted: Tue Oct 19, 2010 12:43 pm 
Offline
User avatar
 Profile

Joined: Fri Apr 25, 2008 7:55 pm
Posts: 147
Yes, Exmon is as good a tool as any - look at the high score table, find a notable name and then use Exmon to search for that sequence of bytes. Once there, have a scroll up and down to find the block of memory that constitutes the full table.

You can use OSFILE to create a file of the table but it's probably just as easy for this simple task to use OSCLI and re-create in memory a *SAVE command to save the block you have identified. So, if for example you have your *SAVE command string at $2000 (e.g. '*S.HST 1234+100<cr>') then in MC set X=0 (lo addr), Y=$20 (hi addr) and JSR $FFF7. You can then re-load the table in exactly the same way but using a *LOAD command string.


Top
 
PostPosted: Wed Oct 20, 2010 4:23 pm 
Offline
Site Admin
User avatar
 Profile

Joined: Wed Dec 19, 2007 10:46 pm
Posts: 779
Bear in mind tho that many games relocate themselves when they've loaded, if they don't need disc access during play. I looked at this sort of functionality for Chuckie Egg which does this and, whilst the High Score table is easy enough to find, saving it to disc wouldn't be an entirely trivial exercise (not trivial enough for me, at any rate!).

Good luck with the exercise, tho.

Sam.


Top
 
PostPosted: Wed Oct 20, 2010 7:25 pm 
Offline
User avatar
 Profile

Joined: Fri Apr 25, 2008 7:55 pm
Posts: 147
Sorry, you're quite right Sam - I didn't mean to suggest that the task of adding a Load/Save high score facility to a game is in itself trivial, just that saving and loading a block of memory can be done relatively easily 8-)

I would expect to be looking at the stable state of a game once all the shuffling has finished and probably only enable Load/Save from the high score screen so you'd need to get there at least once in a game before you can do said loading or saving. I'd trap the {press a key to continue} code and add simple scans for say S and L editing any message ('Press Space...) to just 'L S <Space>' or similar. If there's no message, don't display anything, just put something in the instructions.

The reason I joined in is because I did just this exercise for lots of games but it was so long ago I don't have any specific details to offer. I do though remember that the methods I have mentioned are those that I used.

Maybe I should have a hack at Chuckie Egg to remind myself that it's much trickier than my (likely befuddled) memory is telling me ;)

(Ah, and I see what you're getting at about relocation - you mean that it may be shifted down into disc workspace. Yes, that would demand a little more creativity :roll:)


Top
 
PostPosted: Thu Oct 21, 2010 1:37 am 
Offline
Site Admin
User avatar
 Profile

Joined: Wed Dec 19, 2007 10:46 pm
Posts: 779
CMcDougall wrote:
Can't mind off top of head any others :?

@Colin, I'm pretty sure A&F's Cylon Attack allowed you to load/save the top 50 high scores table. It was used in a launch competition, I think.

@Martin, it's a bit annoying that this is one of the few "exclusive" features I managed to code myself without bugging everyone else, and which was going to be unveiled in the next version of Chuckie Egg Professional Edition when I finally get it finished. However, as I've let the cat out of the bag already that I've looked into this ;), find attached a sneak preview disc image with the code to load in a high scores table from disc into Chuckie Egg. There are three !BOOT files you can *EXEC - one for each of the three Chuckie Egg BBC Micro/Electron versions. Note: I've only done minimal testing, but it should work.

The sample high score data is taken from the Crystalsoft's Egg - The Upgrade package, but can be easily replaced by editing the scores file with a hex editor. You can load in this high score table from disc by entering the filename "scores" when prompted and press RETURN. You'll see the new table when the game is loaded.

However, the reason I didn't pursue implementing a save high score table option is because CE does indeed overwrite the DFS workspace. I imagine it would be perfectly possible to implement a save option, but it would involve a fairly substantial rewrite of the binary (both binaries in fact, if you want to support the BBC Micro and Electron versions).

My goal with CE Pro Edition has been to support both the BBC Micro or Electron releases and also to avoid being an invasive re-write/modification of the original binary - I've managed to keep all of the features so far stored in patch form in a BASIC loader program so the disc could potentially be distributed without the original CE programs, if required, and also to allow anyone interested in the inner workings a simple way of reading the modifications made to the game for each supported feature.

At this point, I think trying to write a save high score table option in a BASIC assembler patch (rather than rebuilding the binary) that would also work with all three versions of the binary in the same manner that the rest of the Pro Edition works would probably be tough. Even if it wasn't, attempting to integrate such a patch in with everything else I've got working together would also be a huge challenge - there's precious little memory left and the other patches already hack into the key routine on the title page to add joystick support which would mean those two features wouldn't be able to be toggled on/off separately as is.

Of course, if you did manage to create such a patch, I'm sure I'd suck it up and try integrating it (eventually) ... ;) Bearing in mind that there's not much room left in memory after CE has relocated itself and the DFS workspace has been overwritten tho, I still sincerely doubt there'd be much chance of integrating it in with everything else I've already crammed into the latest version of CE Pro Edition.

I guess as an alternative you could recompile and modify a standalone separate version of the binary which had the functionality to save out high scores to a file which could then be loaded into my Pro Edition. That would be a sort-of compromise. Though, TBH, as the high scores are trivial to tamper with and/or cheats applied to the game, it would probably be far simpler to just write a BASIC program that lets you edit and save a set of high scores with whatever names / values you want. I've considered doing that. Most people would probably make a manual note of their high scores anyway, if they cared about them to that level.

Anyway, in summation, that's the first half of the code done for you* ... :)

Sam.

* Well, if you want to see the bit of the routine that listens out for new key presses on the high scores screen, if you still have that Electron Joystick preview version I sent you here, you should find that includes an example of adding a joystick option to the high scores screen.


Attachments:
ChuckieEggLoadHighScores.zip [48.62 KiB]
Downloaded 6 times
Top
 
PostPosted: Thu Oct 21, 2010 8:22 am 
Offline
User avatar
 Profile

Joined: Fri Apr 25, 2008 7:55 pm
Posts: 147
Samwise wrote:
...which was going to be unveiled in the next version of Chuckie Egg Professional Edition when I finally get it finished.
Oops, sorry Sam, I feel bad now for forcing your hand and spoiling the surprise :oops:

Well done for adding the load facility, I had no idea that was in you plans! Regarding a save, could you perhaps squeeze in a save if you did it on the basis that the game/disc would have to re-boot on completion? I presume once someone is at the HST and has just entered their name that there's nothing else to preserve for that session so with just a few bytes of code along the lines I suggested maybe the table could be saved, albeit trampling over the loaded game, followed by a re-boot? Just a thought...

(I won't be sucked in just yet btw, too much else on the go ;) )


Top
 
PostPosted: Thu Oct 21, 2010 11:21 am 
Offline
Site Admin
User avatar
 Profile

Joined: Wed Dec 19, 2007 10:46 pm
Posts: 779
Naah, it's not a big deal. The complete thing will get released again eventually when I finally finish work on the non-loadery parts - and because of my sticking with a loader patch approach, all the source code will be easy to find. There's still a few surprises to be uncovered when it's finally ready. :) Plus releasing this snippet of code might be of interest/use to PaulA, as if nothing else, it illustrates my point that loading in a new high score table may not be as simple as just loading the data into the right place, if there's a lot of shuffling going on and the DFS workspace is overwritten as is the case with Chuckie Egg.

Yes, it may well be possible to do the sort of save function you're talking about but not, I suspect, without breaking the integration with all the other patches I have. Plus, that would sort of violate my minimalist non-invasive approach - not wanting to break existing features. PJ's been telling me for ages that I should drop the keyboard redefine screen as that would free up more memory for code.

No, tbh, my current thinking is that if I do anything at all, it would be to write a simple BASIC high score table editor that would read/write the data file. Though it's actually not on my list atm, as it's really not hard to hex edit the file.

That would mean the player would have to note their score by hand and add it to the saved table manually, but that's not much more clunky than having to restart the game again to replay, and it also adds the flexibility that you can put whatever messages you want on the scoreboard - there's no real way of stopping anyone from claiming a really high score they haven't earned on CE given this load functionality, so I might just as well let ppl put up whatever they want.

Like I said, if you drop the integrated patch approach I'm using and just go in and hack about and basically modify the binary, I'm sure there's a whole lot more you can do. But that's out of scope for my loader patch ...

Sam.


Top
 
PostPosted: Fri Oct 22, 2010 3:58 pm 
Offline
 Profile

Joined: Sun May 02, 2010 2:07 pm
Posts: 42
I'm battling with another game at the moment which loads all sorts of different files into different blocks of memory. I have a list of what it loads where, but it hasn't helped much so far. :roll:

I'm sure a Master with an game altered to use shadow screen memory is one way to solve the limited space problem. Thing is the highscore screen doesn't need most of the game loaded, as long as what is in the Disc Workspace isn't high score/loading screen related it can be replaced. Neither of these things are easy to do of course in reality.

Actually I wan't to setup a challenge day, of sorts, see who can get the highest score. Hardware will be locked down in various ways to prevent cheating.


Top
 
PostPosted: Sat Oct 23, 2010 2:59 pm 
Offline
Site Admin
User avatar
 Profile

Joined: Wed Dec 19, 2007 10:46 pm
Posts: 779
I think you'll have to take each title on its own and just see how far you can get.

Sounds like a fun project, though, it'll be interesting to see the results. I know some people are big fans of high score tables in beeb games. :)

Sam.


Top
 
PostPosted: Thu Jan 16, 2014 1:37 am 
Offline
User avatar
 Profile

Joined: Sat Mar 26, 2011 3:01 pm
Posts: 263
Location: Kings Langley
I have just finished adding a hi-score save/load to my version of Carnival/Carousel http://www.retrosoftware.co.uk/forum/viewtopic.php?f=19&t=877.

I have trampled over everything, so doing it "in-game" wasn't really an option, but at least on emulator (I still haven't unpacked my beeb from a house move) what I have done works.

When I boot the disc, the basic loader looks for a signature ("carnival") in memory and if it finds it, does a *SAVE 100 +A4 (yes, the usually unused part of the stack was my first choice!) and then runs the game again. If it doesn't find the signature, it writes one and sets up a default hi-score, then runs the game.

I guess pressing SHIFT-BREAK in game to save a HI-SCORE is rather clunky, but it takes no game memory for code and allows me to "borrow" all the RAM for the game.

This approach (suggested above I believe) should work for most games that you can hack to disable the resetting of the hi-score table on load.


Top
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron