Post Reply 
Most up-to-date 48 emulator code (for command line)
04-27-2020, 12:04 AM (This post was last modified: 04-27-2020 12:04 AM by 3298.)
Post: #2
RE: Most up-to-date 48 emulator code (for command line)
(04-26-2020 09:16 PM)Orome Wrote:  sorting out how to pull out the RPL engine
Are you looking just for any RPL, or some specific calculator's version wrapped in an emulation layer? Because the former sounds like you actually want a simulator instead of an emulator.
The RPL kernel (closest match for your "RPL engine") is of course part of the ROM (otherwise the real calculator couldn't run RPL), not part of the emulator. Emu48's debugger and other features admittedly hide this distinction from the user quite well, but the emulator runs RPL code only indirectly via the ROM's RPL implementation written in Saturn ASM and SysRPL.

I see two possible ways for your RPL-in-a-terminal quest:
1a. Use an emulator regardless, while just not showing the GUI. Emu48's debugging features can be used to send the input into the calculator's memory, then the emulation core is put to work running it, and afterwards you pull the results back out and print them. That's going to require quite a bit of hacking to get that working. I've seen a Mac port of Emu48 over at hpcalc.org, but I have no clue whether that one even works still. As for modifying the code to suit your needs, I can't help you as you've definitely more experience with it that I do, because unlike me you've actually looked at the code already.

1b. Same, but with x49gp as emulation core instead, which is at least proven to run fine on a Mac. I've worked with x49gp enough to know that ripping out the GUI ought to be quite simple, but getting data in and out in an automated fashion isn't. Maybe the calculator's remote control mode could be used; however, that requires a connection on the calculator's serial port, which is completely unimplemented in x49gp - someone would need to figure out how the serial or USB port's hardware works, and write emulation code for it (likely won't be easy). Also, you'd need your command-line application to talk to the calculator using the remote-control protocol. The code for that would need to be taken from yet another program or written from scratch.

2. Find a simulator, i.e. a reimplementation of RPL. I'm aware of just one, newRPL. As far as I can tell, that's much easier to adapt. In fact, a cursory look into its sources shows something in newrpl/main.cpp that looks an awful lot like a command-line application already, so I think you should just build that and give it a try. Of course, newRPL has some differences from traditional RPL (e.g. the meanings of + and ADD on lists are swapped, instead of 12-digit reals and infinite-precision integers you get configurable-precision reals up to ... was it 2000 digits?, etc), and it obviously isn't done yet, but this one appears to be the lowest-effort solution to your problem.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Most up-to-date 48 emulator code (for command line) - 3298 - 04-27-2020 12:04 AM



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