Post Reply 
newRPL - build 1255 released! [updated to 1299]
01-03-2018, 04:10 AM (This post was last modified: 01-03-2018 04:15 AM by Claudio L..)
Post: #73
RE: newRPL - build 1001 released!
(01-03-2018 12:31 AM)BarryMead Wrote:  Anyone: I was experimenting with SDSTO and SDRCL on the calculator with an sdcard installed. I was also experimenting with saving and loading of SaveAs and Open on the emulator. The emulator saves files in an .nrpb format, which is not compatible with the SDRCL of the calculator. If you put one of these .nrpb files onto an sdcard
and try to read it with SDRCL it does not work.

There's 2 file formats: .nrpl is for RPL objects, and .nrpb is for backup files. Backup files are more than objects, they have the entire directory structure, settings, flags, and are generated by xxARCHIVE/xxRESTORE (here xx=either SD or USB). The New/Open/Save options in the File menu work on entire calculators and use backup files, 100% compatible with xxARCHIVE. For individual objects the menu Stack can "Open file to level 1" and "Save level 1 as..." which uses files .nrpl fully compatible with SDSTO/SDRCL.

(01-03-2018 12:31 AM)BarryMead Wrote:  I was wondering if there is any way
to EMULATE an sdcard on the emulator so that SDSTO and SDRCL will save and restore files to the emulator that were SDSTOed by the calculator or visa versa. On the emulator if you try to use SDSTO or SDRCL it just says "No SDCARD installed". With a giant hard disk out there just waiting to be used by the emulator this error seems unnecessary.

The menu Hardware has the option to insert an SD card image. The image is exactly that: the image of a FAT formatted filesystem. You can easily get one from a real SD card, using the 'dd' command (on Linux that is, just clarifying for other people).

Code:
dd if=/dev/sdX of=~/myfile.img bs=1MB status=progress

where /dev/sdX has to be replaced with the device of your real SD card.

The image file has to be inserted/ejected from the simulator just like an SD card in the real calculator.

(01-03-2018 12:31 AM)BarryMead Wrote:  I know that whatever you have on one
either the emulator or calculator you can transfer to the other with USBARCHIVE and USBRESTORE, and I have already used these with great success. Also I was able to grab text images of programs, put them on an sdcard and open them in the calculator using this program:

«
SDOPENRD
DUP
DUP
SDFILESIZE
SWAP
SDREADTEXT
STR→
SWAP
SDCLOSE
» 'TREAD' STO
Then just put the name of the text file in double quotes on the stack and execute TREAD

I was also able to use the clipboard to cut/paste text into the stack then use STR→ to convert it to a proper program on the emulator. But I was thinking that if the emulator used the current working directory to simulate the sdcard that would make many of the other SD operations more useful. Right now all SD operations just error out with "No SD card installed" on the emulator. This seems a shame since there is plenty of hard drive space available to act like the sdcard. Alterntively, a menu option could allow the user to pick any directory on the computer to act as the SDCARD.
Any thoughts, comments or better ideas are welcome.

If you want to get files out of the image, just mount it in Linux and it magically becomes the directory you are requesting. On some desktops mounting an image is a couple of clicks, on others a matter of "mount -o loop ...".
[a side note for other people: on Windows I use a free program called OSFMount by Passmark to mount images]
Writing directly to a directory in the host would bypass the filesystem driver in newRPL, and defeats the purpose of debugging and testing it. This way it was more useful to me for development, and more realistic as far as the simulation. I agree from a final user perspective having to mount/unmount an image seems like an unnecessary chore.
EDIT: By the way, writing directly to a directory is exactly what those 2 options in the Stack menu do, they are actually SDSTO/SDRCL but directly to the host, in the same way that the "Remote USBARCHIVE..." and "Remote USBRESTORE..." are working directly on the host, bypassing the simulator entirely.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: newRPL - build 1001 released! - pier4r - 12-16-2017, 08:03 AM
newRPL - on Hp 39gs - Martin Hepperle - 06-05-2019, 06:51 AM
RE: newRPL - build 1001 released! - pier4r - 12-23-2017, 10:16 AM
RE: newRPL - build 1001 released! - pier4r - 01-01-2018, 09:42 AM
t - Claudio L. - 01-01-2018, 03:06 PM
RE: newRPL - build 1001 released! - pier4r - 01-01-2018, 03:41 PM
RE: newRPL - build 1001 released! - pier4r - 01-02-2018, 04:54 PM
RE: newRPL - build 1001 released! - pier4r - 01-02-2018, 06:58 PM
RE: newRPL - build 1001 released! - Claudio L. - 01-03-2018 04:10 AM
newRPL - brickviking - 10-05-2018, 06:01 AM
How to participate? - erazor - 12-13-2019, 07:12 AM



User(s) browsing this thread: 17 Guest(s)