TIC-80 icon indicating copy to clipboard operation
TIC-80 copied to clipboard

Is it possible to read/write the virtual ram in Tic80?

Open another-m00 opened this issue 2 years ago • 4 comments

Hi, I was wondering if it is possible for an external program to read or write the cartridge ram (not the rom) in Tic80.

I'm asking this because I had an idea to use some of the reserved future use ram space to communicate with an external program that is specifically made for this, like a plugin.

If this was possible, libretro wouldn't need to use pram for communication, and other plugins could be created for example for a file accessing tool.

This actually fits into the fantasy computer perspective too, since all atari, commodore, sinclair, etc computers had an expansion slot which wrote to a custom memory adress.

another-m00 avatar Mar 28 '22 17:03 another-m00

Hi, At the moment it is possible only with a pmem(), I do not see any other variants, also, we have about 12K reserved RAM for the future, and we could give part of it for such purposes.

nesbox avatar Mar 29 '22 07:03 nesbox

You can write to the cartridge with sync, no?

joshgoebel avatar Mar 29 '22 12:03 joshgoebel

Yes, in theory you could even write your data to the sprites area for example and then use sync() to copy that data to the cart :)

nesbox avatar Mar 30 '22 06:03 nesbox

I would also be interested in having a few bytes of reserved memory dedicated for IO with external programs. Or at least some method of receiving input from an external program other then on startup. (by passing the log output to a .txt file on startup you can get pretty good output using trace()) It would be fun to be able to use the TIC-80 as a programmable plugin for other programs! Or to be able to connect multiple instances of the TIC-80 for multiplayer games.

I will have too look into using sync() and pmem(), they might be enough for some of the things I'd like to try out for now, awesome work by the way!

NPO-197 avatar Mar 17 '23 23:03 NPO-197