Author Topic: [CPCtelera] File Handling / Game Saving  (Read 919 times)

0 Members and 1 Guest are viewing this topic.

Offline EgoTrip

  • 6128 Plus
  • ******
  • Posts: 1.051
  • Country: gl
    • http://egochip.blogspot.co.uk/
  • Liked: 677
  • Likes Given: 294
[CPCtelera] File Handling / Game Saving
« on: 18:21, 01 May 16 »
I want a way to save a game progress in CPCtelera. As firmware is disabled, I cannot do any file handling. Will non-firmware file handling routines be included in a future version of CPCtelera?

Another option is to compress the save data, which is output as a string that can be typed back in. How would I go about doing that from within a CPCtelera game? Can exomizer even compress on the CPC, or only decompress? One issue I can see is that there are only 32-127 inputable characters on the CPC and exomizer will use 0-255 when compressing. How would I get around that, other than having some sort of console-style high score input? Or would that be my only option?

The third option would be a simple password system, but that would lose any other data like scores.
EgoTrip's Stuff
EgoTrip's Stuff

Offline Arnaud

  • Supporter
  • 6128 Plus
  • *
  • Posts: 622
  • Country: fr
  • Liked: 500
  • Likes Given: 1094
Re: [CPCtelera] File Handling / Game Saving
« Reply #1 on: 18:34, 01 May 16 »
I want a way to save a game progress in CPCtelera. As firmware is disabled, I cannot do any file handling. Will non-firmware file handling routines be included in a future version of CPCtelera?

It's planned in the next release and i'm really waiting for this  :D
File read and save without firmware · Issue #20 · lronaldo/cpctelera · GitHub

Can exomizer even compress on the CPC, or only decompress?

You can only decompress in CPC, but a compression is planned also in CPCtelera 1.5
Compression · Issue #23 · lronaldo/cpctelera · GitHub

The next release of CPCTelera will have really interesting feature.
« Last Edit: 18:46, 01 May 16 by Arnaud »

Offline EgoTrip

  • 6128 Plus
  • ******
  • Posts: 1.051
  • Country: gl
    • http://egochip.blogspot.co.uk/
  • Liked: 677
  • Likes Given: 294
Re: [CPCtelera] File Handling / Game Saving
« Reply #2 on: 18:41, 01 May 16 »
Guess its just the password option for now then. Thanks.
EgoTrip's Stuff
EgoTrip's Stuff

Offline Arnaud

  • Supporter
  • 6128 Plus
  • *
  • Posts: 622
  • Country: fr
  • Liked: 500
  • Likes Given: 1094
Re: [CPCtelera] File Handling / Game Saving
« Reply #3 on: 19:21, 01 May 16 »
How long is the structure you want to save ?

Offline EgoTrip

  • 6128 Plus
  • ******
  • Posts: 1.051
  • Country: gl
    • http://egochip.blogspot.co.uk/
  • Liked: 677
  • Likes Given: 294
Re: [CPCtelera] File Handling / Game Saving
« Reply #4 on: 19:26, 01 May 16 »
52 bytes
EgoTrip's Stuff
EgoTrip's Stuff

Offline ronaldo

  • Dev
  • 6128 Plus
  • *****
  • Posts: 627
  • Country: es
    • Fremos Blog
  • Liked: 895
  • Likes Given: 808
Re: [CPCtelera] File Handling / Game Saving
« Reply #5 on: 19:36, 01 May 16 »
@EgoTrip: as @Arnaud has already said, file handling routines are planned for next release. In fact, they are now being tested by @AugustoRuiz, who has already implemented some of them for discs, and we are also working on some others for cassette. It will take time to have this kind of routines standarized, tested, documented and ready to be used, but we also think that they are really important and useful for developers. At the present momment, there is no defined API for file handling, so I cannot tell you how should you proceed to save/restore things to cassette or disc.

Other provisional solution you may use is to reenable firmware for file handling then disabling it again. However, you should take care of in-RAM firmware variables for file handling, preserving them in some way.

As far as I'm aware, there is no Z80 exomizer compressor. I thought of it some time ago, and I would want to implement one, but that will take longer. It's not probable to have a Z80 exomizer compressor for next release. For the other part, I don't get what the issue is with exomizer and inputable characters. I don't see any problem with that, as compressed data does not have to be stored as plain text, but binary form. However, if that might be an hipothetical problem, that would be solved converting to Base64 format.

Offline SRS

  • Supporter
  • 6128 Plus
  • *
  • Posts: 591
  • Country: de
  • Schneider CPC464 - what else ?
  • Liked: 589
  • Likes Given: 320
Re: [CPCtelera] File Handling / Game Saving
« Reply #6 on: 00:27, 10 May 16 »
There are some z80 compressors/decompressors available, like : Realtime RLE for the Z80 :)