x49gp/README.md
claudiol c61f11cff2 On behalf of: 3298 - Applied 23 patches by 3298:
Misc changes, mostly fixes:
- fix ./newconfig systems other than OSX (broke in c8b823f)
- fix palette usage in 2-bit color mode (was broken ever since grayscale was implemented in 18e1003 and its improperly attributed copy f7913eb)
- fix continuing from breakpoints in the debugger (never worked, was exposed when the debugger was enabled in 9c1f2ed)
- restore the printf statements commented out in 9c1f2ed and hide them with #ifdefs instead
- close the server socket after accepting a debugger connection to allow another simultaneous debug session to be started using the same TCP port
- use the symbolic constant DEFAULT_GDBSTUB_PORT (already defined in gdb_stub.h as 1234) when starting the gdb server in main.c in place of the raw number 1234
- change Makefile to read the name of the firmware file from the file update.scp instead of hardcoding it; this allows users to switch to another firmware
by simply pasting it along with its accompanying update.scp into the x49gp directory

- Enhance port G (keyboard) handling to remember the value of output bits across periods with these bits configured as input
This fixes interaction with HPGCC3 keyboard routines, and it also fixes keys with eint==7 (assuming the stock firmware is in use)
needing a double-tap to work unless pressed very shortly after another keypress (the latter broke in b5f93ed)
- Get rid of the deprecated function warning by switching from gdk_pixbuf_new_from_inline to gdk_pixbuf_new_from_data (based on code by chwdt)
- Delete remaining now-redundant CVS files
- Don't release all buttons anymore if there are still physical keys and/or the left mouse button are holding some down
On the other hand, forcibly release all buttons when losing focus to avoid getting stuck in a state with buttons down
when they are not held down by anything; this would happen due to missed events while not in focus
- Add a context menu to the screen, containing only "Reset" and "Quit" items for now
- Ensure that the files backing flash, sram, and s3c2410-sram exist and have the correct size when opening them
Note that if the flash file does not exist, this will not fill it with the code that's supposed to be in there, obviously causing the calculator to crash. That's an improvement for later.
- Allow the config system to fill not only numbers, but also strings (including filenames) with default values
basename is excluded, but it's planned to be dropped entirely.
- Add an "install" target to the Makefile
- Implement a more generic command-line parser for substantially improved flexibility
- Also adds a proper help option, though the manual referenced in the corresponding output (a manpage, hopefully) does not exist yet.
- Drop the "basename" config property in favor of interpreting relative paths in the config as relative to the config file's location
- Retire the "image" config property in favor of simply loading the image from next to the binary or from the install directory
- Split the UI name property into name (affecting only the window title) and type (affecting the UI image and in the future also the default bootcode) properties
- Change the default calculator type to the 50g everywhere, which probably matches today's user expectations better than the 49g+.
- Create a flash file from the calculator model's appropriate boot file if it does not exist, relying on the bootcode to detect the absence of a firmware
  The bootcode will complain about the missing firmware and enter update mode, so the user needs to supply their favorite firmware version and point the bootcode's updater to it.
  The easiest way is probably pointing the emulated SD card at a directory containing the firmware and its accompanying update.scp file, and then starting the SD-based update.
- Add SD mount / unmount options to the right-click / menu-key popup menu
- Remove most of the old script-based config-generating system since the binary now has these capabilities as well
- Add an applications menu item for installing
- Keep some debug output on stderr and a huge vvfat.log file from showing up when not debugging x49gp itself
- Allow (re-)connecting a debugger to a running session
  This is done through the right-click / menu-key popup menu.
  To avoid confusion due to the accidental clicks leading to an unresponsive interface (caused by waiting for the debugger to connect),
  this option is hidden unless option -d or its new companion -D (same as -d, but does not start the debug interface right away) is present.
- Improved support for hardware keyboards
- Update README.md, add manpage, rename other README files to TODO to reflect their contents
2018-05-07 17:32:14 -04:00

4.1 KiB

Quick Start Guide 03/27/2017 Egan Ford egan@sense.net

NOTE: READ ALL INSTRUCTIONS

Prereqs:

  • MacOS 10.12 64-bit:

    • Install XQuartz, Xcode (from your installation media) in that order.
    • Install Macports (macports.org), then:
  sudo port install gtk2 pkgconfig gcc6
  sudo port select --set gcc mp-gcc6
  export PATH=/opt/local/bin:$PATH
  • Ubuntu:
  sudo apt-get install git libgtk2.0-dev
  • RedHat/CentOS, Fedora:
  sudo yum install git gtk2-devel
  • Arch:
  sudo pacman -S git gtk2

Start up X11 and use xterm


Download x49gp source:

git clone https://github.com/chwdt/x49gp.git

Build:

cd x49gp
make

Install (optional):

make install

Run:

./x49gp

When installed, there should be an applications menu entry to run x49gp. Installing also enables running it from the terminal in any directory:

x49gp

First launch setup

On the first launch, the calculator will be missing a firmware, forcing the bootloader to complain and demand a fresh one. HP's official firmwares can be found at e.g.: https://www.hpcalc.org/hp49/pc/rom/ Some of the most popular of these are also included in x49gp's source directory. Alternatively, the most up-to-date version of NewRPL can be found at: https://hpgcc3.org/downloads/newrplfw.bin

Pick a firmware to use and store it in any directory along with its update.scp file. The update.scp file only contains the filename of the firmware (when renaming the firmware, make sure the new name fits into a DOS-style 8.3 naming scheme) followed by a DOS-style linebreak, so a missing update.scp can be rectified easily.

Right click on the screen, or press the menu key on a physical keyboard, to open the menu, and click on "Mount SD folder". Select the directory containing the firmware. Then, select the SD option from the bootloader's update source menu by clicking on the virtual key labeled "2" or by pressing the "2" key on a physical keyboard.

Now the bootloader is installing the firmware; wait until it finishes printing hex numbers to the virtual display, then follow its prompt to press Reset ( = F12 or the Reset entry in the menu) or Enter. The calculator should be fully usable after this procedure.


Do stuff, e.g.:

Restore backup:

BACKUP
3
->TAG
RESTORE

Install ARMToolbox (HPGCC2):

2
SETUP.BIN
3
->TAG
RCL
EVAL

(Right Click ON, Left Click C)


To Exit Emulator

Use any of:

  • Press Alt-F4 or your system's equivalent key combination

  • Open the menu using a right click on the screen or the menu key, then choose "Quit"

  • Press Ctrl-C in the launch terminal


Start Over:

  • clean slate?
rm -r ~/.x49gp
  • soft reset only?

With x49gp running, press F12, or right click on the screen and select "Reset" from the menu.


Debugging with x49gp

There is a GDB interface for debugging ARM programs, e.g. HPGCC2/3 applications or replacement firmwares. To use it, start x49gp from a terminal with the -d option, and start arm-none-eabi-gdb with an appropriate ELF file in another terminal. To connect to x49gp, type in the GDB console:

target remote :1234

Known Limitations:

  • HPGCC SD Card I/O
    • libfsystem unavailable.
    • f* calls unstable (HPGCC2)
    • f* calls stable (HPGCC3)