+atari2600land Posted December 27, 2017 Share Posted December 27, 2017 All I want to do is save the value of two variables to flash in my program. And the manual's stuff about flash is like gibberish when I read it. What are rows? How do I convert them to variables? Why do I need to save at least 15 of them? This is all I have so far in the way of saving two variables' values: write_row: PROCEDURE #row(0) = lemonnumber #row(1) = levelnumber FOR c = 2 to 15 #row(c)=0 NEXT c FLASH WRITE FLASH.FIRST,VARPTR #row(0) END read_row: PROCEDURE FLASH READ FLASH.FIRST,VARPTR #row(0) lemonnumber=#row(0) levelnumber=#row(1) FOR c = 2 to 15 #row(c)=0 NEXT c END And I don't even know if this will work. Quote Link to comment Share on other sites More sharing options...
+atari2600land Posted December 27, 2017 Author Share Posted December 27, 2017 It won't work. The Flash sample won't even work. I press 1 and it gives me a message that says CPU is off in the weeds. Quote Link to comment Share on other sites More sharing options...
intvnut Posted December 28, 2017 Share Posted December 28, 2017 Be sure to run the IntyBASIC compiler and jzIntv with the --jlp flag. To specify a file on disk to act as flash storage, add the flag --jlp-savegame=FILENAME, replacing FILENAME with the file you'd like to use for storage. I would also recommend to compile to BIN+CFG format, not ROM format when using JLP. The ROM format emulates an actual Intellicart, and it can interact strangely with JLP support. The most recent updates to jzIntv, AS1600, and IntyBASIC 1.2.9 (updated Nov 22nd, as per this post) do their best to avoid weird interactions between the ROM format and JLP. AS1600 and jzIntv warn when those interactions might happen. But even if you have the latest jzIntv, that won't help someone playing your game who hasn't updated recently. Quote Link to comment Share on other sites More sharing options...
+atari2600land Posted December 28, 2017 Author Share Posted December 28, 2017 I tried a bin file and it works unless you exit jzINTV and start it back up again. Closing jzINTV makes everything reset? I thought the save file would save the data when jzINTV closes down and is started back up again. Is this not so? Quote Link to comment Share on other sites More sharing options...
+DZ-Jay Posted December 29, 2017 Share Posted December 29, 2017 I tried a bin file and it works unless you exit jzINTV and start it back up again. Closing jzINTV makes everything reset? I thought the save file would save the data when jzINTV closes down and is started back up again. Is this not so? It should, as long as you specify a filename in the command-line, like intvnut mentioned. You not only have to specify it when running the jzIntv in the session you want to save, but in all subsequent sessions where you want it to load the game. Otherwise, how does it know that there is saved data? By the way, intvnut, perhaps there is a chance for improvement: perhaps jzIntv should take a hint from MAME and use its own default folder/file structure. In MAME, I don't have to specify save files or NVRAM files, just their location. It will look for one with the game name and a special extension (or something like that). Maybe jzIntv can do the same? It could make it easier for non-technical people to use. -dZ. Quote Link to comment Share on other sites More sharing options...
+atari2600land Posted December 29, 2017 Author Share Posted December 29, 2017 I am using a batch file to play jzintv, so all the times I've been playing it I have been entering the same thing. Quote Link to comment Share on other sites More sharing options...
intvnut Posted December 30, 2017 Share Posted December 30, 2017 jzIntv's entire handling of files and filenames is a mess. I have mixed emotions on having a default save location for flash save files. I didn't feel like making policy tradeoffs, so I outsourced it back to the user. That seemed reasonable when it was a feature used by 2 or 3 people. I am using a batch file to play jzintv, so all the times I've been playing it I have been entering the same thing. Update your batch file to add this flag . --jlp-savegame=lemons.jlp . That'll tell jzIntv where to save the flash image. You can delete that file whenever you like to "reset" the flash image. You can look inside it with "tohex" if you're curious what's in the emulated flash. (It's pretty boring, actually.) jzIntv will try to make a backup copy of the file with a ~ on the name (lemons.jlp~ in this case) whenever jzIntv starts up. That way, if you mess up the file, you can copy the backup back over the image. The backup only gets written at startup. If you want a more sophisticated backup strategy, you'll have to build it in your batch file. Quote Link to comment Share on other sites More sharing options...
+atari2600land Posted December 30, 2017 Author Share Posted December 30, 2017 So what is the flash example supposed to do? Is it supposed to save the green numbers that come up on the screen when 2 is pressed? I added that line in my batch file, and it makes the file, but it's not reading it. Whenever 2 is pressed, it says "Invalid JLP command." Quote Link to comment Share on other sites More sharing options...
intvnut Posted December 30, 2017 Share Posted December 30, 2017 As best as I can tell, here's what it does: Pressing 1 reads the current contents of a flash row, and shows the values in white. Pressing 2 generates a set of random values and attempts to write them to flash. (This write may or may not succeed.) It also prints these numbers in green. Pressing 3 erases the flash sector that contains this row. (There are 8 rows to a sector; erase will erase them all.) So, if you start with blank flash, and press 1, you should get a bunch of 65535s. Flash erases to all 1s. If you press 2 once, and then press 1, you should see the same set of numbers in green and white. If you press 2 a second time, you'll see a new set of numbers. If you now press 1, you should see the first set that was saved, not the new set you attempted to save. JLP doesn't let you overwrite a non-empty row. If you press 3 and then 1, you'll erase the sector, and then see that it's erased (65535). Now if you press 2, and then press 1, you'll see you can save a new set of numbers to flash. (But again, only once until you erase them again.) Quote Link to comment Share on other sites More sharing options...
+nanochess Posted December 30, 2017 Share Posted December 30, 2017 Don't forget to download the latest jzintv version, the previous one had some bugs. Specify the Flash size in command-line, forgot the argument name. Otherwise jzintv will choke with invalid read/write. Also your #row array should be Dim'ed as DIM #row (96) Quote Link to comment Share on other sites More sharing options...
+atari2600land Posted December 30, 2017 Author Share Posted December 30, 2017 Specify the Flash size in command-line, forgot the argument name. Otherwise jzintv will choke with invalid read/write. How do I do this? Quote Link to comment Share on other sites More sharing options...
+nanochess Posted December 30, 2017 Share Posted December 30, 2017 How do I do this? Just checked, the latest version of IntyBASIC inserts the jlpflash command in the generated .cfg file. Make sure you run your game from the bin file, as the ROM format doesn't include this info. Quote Link to comment Share on other sites More sharing options...
+atari2600land Posted December 31, 2017 Author Share Posted December 31, 2017 I have been using the bin file and not the ROM. Quote Link to comment Share on other sites More sharing options...
freewheel Posted December 31, 2017 Share Posted December 31, 2017 Specify the Flash size in command-line, forgot the argument name. Otherwise jzintv will choke with invalid read/write. I've never specified anything on the command line, other than the save file itself. jzintv works fine for me. I'm not sure what you're referring to, here. Quote Link to comment Share on other sites More sharing options...
intvnut Posted December 31, 2017 Share Posted December 31, 2017 I've never specified anything on the command line, other than the save file itself. jzintv works fine for me. I'm not sure what you're referring to, here. If you just say "jlp = 1" without adding "jlp_flash = #" (or "jlpflash"; both spellings are supported), older jzIntv set the flash capacity to 0. Thus, any attempt to read or write flash was considered "out of range." Make sure you run your game from the bin file, as the ROM format doesn't include this info. The latest version of AS1600 and jzIntv do have support for that now. It's working better than before, but it isn't perfect. I still recommend BIN+CFG as the most fully-supported option for JLP development. 1 Quote Link to comment Share on other sites More sharing options...
intvnut Posted December 31, 2017 Share Posted December 31, 2017 BTW, I'm working on pushing out a new jzIntv update tonight, with several minor improvements, bug-fixes, etc. 2 Quote Link to comment Share on other sites More sharing options...
+atari2600land Posted December 31, 2017 Author Share Posted December 31, 2017 I found the problem: It's not reading the flash file. I don't know why. Here is my batch file I use to run jzINTV. What am I doing wrong? jzintv flash.bin --jlp-savegame=lfff.jlp Quote Link to comment Share on other sites More sharing options...
+atari2600land Posted January 1, 2018 Author Share Posted January 1, 2018 THERE. I successfully programmed it to save three variables, then turn of jzintv, turn it back on again and have the three variables still be there. Can I test this on an LTO Flash! and have it work like it does in jzINTV? Quote Link to comment Share on other sites More sharing options...
+nanochess Posted January 1, 2018 Share Posted January 1, 2018 THERE. I successfully programmed it to save three variables, then turn of jzintv, turn it back on again and have the three variables still be there. Can I test this on an LTO Flash! and have it work like it does in jzINTV? Congrats! It should work exactly the same Quote Link to comment Share on other sites More sharing options...
+atari2600land Posted January 1, 2018 Author Share Posted January 1, 2018 It won't work on LTO Flash. All I get is a black screen. Quote Link to comment Share on other sites More sharing options...
+atari2600land Posted January 1, 2018 Author Share Posted January 1, 2018 The Flash sample program also doesn't work on LTO Flash. I press 2 and it goes back to the LTO Flash! select game menu. Quote Link to comment Share on other sites More sharing options...
+DZ-Jay Posted January 1, 2018 Share Posted January 1, 2018 jzIntv's entire handling of files and filenames is a mess. Hmm... Do I sense a 2018 resolution there? Quote Link to comment Share on other sites More sharing options...
SIO2 Posted January 1, 2018 Share Posted January 1, 2018 2 Quote Link to comment Share on other sites More sharing options...
+DZ-Jay Posted January 1, 2018 Share Posted January 1, 2018 flashv.jpg Haha! Goes well with the title of the thread! 1 Quote Link to comment Share on other sites More sharing options...
+nanochess Posted January 1, 2018 Share Posted January 1, 2018 It won't work on LTO Flash. All I get is a black screen. Load the BIN not the ROM Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.