mirror of
https://github.com/gwenhael-le-moine/x49gp.git
synced 2024-12-25 21:58:49 +01:00
Added missing file to repository
This commit is contained in:
parent
64e9371769
commit
9118d40ca4
4 changed files with 290 additions and 0 deletions
63
TODO
Normal file
63
TODO
Normal file
|
@ -0,0 +1,63 @@
|
|||
Next steps:
|
||||
|
||||
- Verify Locks needed
|
||||
- Audit Keyboard <-> IO Port Interaction
|
||||
- Add remote gdb interface
|
||||
|
||||
|
||||
Registers to check access to:
|
||||
|
||||
IO PORT MISCCR
|
||||
MMU FSR
|
||||
MMU FAR
|
||||
MMU Alignment Checks in general
|
||||
MMU r7: Wait for Interrupt
|
||||
|
||||
|
||||
File Manager:
|
||||
|
||||
Read from 0x08080000: Probe memory size???
|
||||
-> Add mirrored mapping of SRAM?
|
||||
|
||||
|
||||
Annunciators:
|
||||
|
||||
Bits set in Column 132 of the LCD screen memory:
|
||||
|
||||
Row 0: Transmit
|
||||
Row 1: Left Shift
|
||||
Row 2: Right Shift
|
||||
Row 3: Alpha
|
||||
Row 4: Battery
|
||||
Row 5: Busy
|
||||
|
||||
IRQ Branch Table:
|
||||
|
||||
08000020: IRQ reads 08000020 + (IRQOFFSET << 2), branches there
|
||||
|
||||
IRQ returns with "subs pc, lr, #4"
|
||||
|
||||
|
||||
|
||||
The speed of the emulator is an issue...
|
||||
|
||||
It is running about 20 times SLOWER than the original calculator at the moment
|
||||
on my 400 MHz UltraSparc. There will be quite some speedup running on a modern
|
||||
PC or workstation with faster processor. Also, at the moment I have a lot of debugging
|
||||
enabled, which slows down the emulator.
|
||||
|
||||
Getting the full 75 MHz out of the emulated ARM core will be hard work, I have not
|
||||
looked into the potential optimizations that can be done in the core emulator, but
|
||||
there are some things done during every instruction that we don't need for this
|
||||
machine.
|
||||
|
||||
There are generally two options to speed up or use the emulator:
|
||||
|
||||
1. Emulate the hardware as closely as possible to help debug programms digging
|
||||
into the s3c2410.
|
||||
2. Emulate the saturn part to make it a usable calculator. Here one could implement
|
||||
some of the most often used KOS syscalls directly in the emulator without doing
|
||||
these on the emulated ARM core. This would speed up the calculator significantly.
|
||||
|
||||
Optimally there will be a runtime option to switch between these two modes.
|
||||
|
1
TODO.QEMU
Normal file
1
TODO.QEMU
Normal file
|
@ -0,0 +1 @@
|
|||
Fix ldX_le/stX_le on sparc: use ASI_LE
|
9
x49gp.desktop.in
Normal file
9
x49gp.desktop.in
Normal file
|
@ -0,0 +1,9 @@
|
|||
[Desktop Entry]
|
||||
Type=Application
|
||||
Version=1.0
|
||||
Name=x49gp
|
||||
Icon=
|
||||
Exec=TARGET
|
||||
Terminal=false
|
||||
Categories=Office;Science;Math
|
||||
Comment=An emulator for HP 49g+ / 50g calculators
|
217
x49gp.man.in
Normal file
217
x49gp.man.in
Normal file
|
@ -0,0 +1,217 @@
|
|||
.\" Hey, EMACS: -*- nroff -*-
|
||||
.\" Please adjust this date whenever revising the manpage.
|
||||
.Dd August 29, 2018
|
||||
.Dt TARGET_ALLCAPS 1
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm TARGET
|
||||
.Nd Emulator for HP 49g+ / 50g calculators
|
||||
.Sh SYNOPSIS
|
||||
.Nm
|
||||
.Op Fl d Ns Oo Ns = Ns Ar port Oc | Fl Fl debug Ns Oo Ns = Ns Ar port Oc | Fl D Ns Oo Ns = Ns Ar port Oc | Fl Fl enable-debug Ns Oo Ns = Ns Ar port Oc
|
||||
.Op Fl h | Fl Fl help
|
||||
.Op Ar config
|
||||
.Sh DESCRIPTION
|
||||
.Nm
|
||||
is an emulator capable of running any software written for the HP 49g+ and HP 50g calculators, including ARM programs or even custom firmware. It achieves this by using a modified version of QEMU to emulate the ARM hardware based around the Samsung S3C2410 chip.
|
||||
.Pp
|
||||
Visually
|
||||
.Nm
|
||||
appears as an undecorated window mirroring the appearance of the emulated calculator. The display area obviously shows the virtual calculator's screen contents.
|
||||
.Ss Input
|
||||
For mouse input, the keys shown in the window can be interacted with; left-clicking on one holds it down for as long as the mouse button is down, right-clicking on one holds it down until any key is left-clicked.
|
||||
.Pp
|
||||
Another method of interacting with the calculator is through a physical keyboard.
|
||||
.Em A-Z ,
|
||||
.Em 0-9 ,
|
||||
.Em F1-F6 ,
|
||||
.Em cursor keys ,
|
||||
.Em \&' ,
|
||||
.Em Backspace ,
|
||||
.Em \&^ ,
|
||||
.Em \&+ ,
|
||||
.Em \&- ,
|
||||
.Em \&* ,
|
||||
.Em \&/ ,
|
||||
.Em \&. ,
|
||||
.Em Space ,
|
||||
.Em Enter
|
||||
correspond to their sensible calculator counterparts. In addition,
|
||||
.Em Delete
|
||||
acts as extra Backspace key,
|
||||
.Em \&,
|
||||
acts as extra decimal separator key,
|
||||
.Em Shift
|
||||
presses the Leftshift key (green on the 49g+, white on the 50g),
|
||||
.Em Control
|
||||
presses the Rightshift key (red on the 49g+, orange on the 50g),
|
||||
.Em Tab
|
||||
presses the Alpha key (yellow on the 49g+ and 50g), and
|
||||
.Em Escape
|
||||
presses the On key. Note that in order to allow multiple-key combinations involving e.g.
|
||||
.Em Shift
|
||||
without surprises, such as pressing
|
||||
.Em Shift
|
||||
.Ns - Ns
|
||||
.Em 8
|
||||
on a US QWERTY keyboard producing the key sequence
|
||||
.Dq Leftshift-hold multiply ,
|
||||
.Nm
|
||||
ignores all keyboard modifier states except NumLock. Because that may make certain virtual keys inaccessible to a laptop keyboard without a numpad, there are certain additional key definitions to support at least some common keyboard layouts:
|
||||
.Bl -tag -width indent
|
||||
.It US, UK, International QWERTY:
|
||||
.Em \e
|
||||
acts as \&* key,
|
||||
.Em \&=
|
||||
acts as \&+ key.
|
||||
.It German QWERTZ:
|
||||
.Em #
|
||||
acts as \&* key,
|
||||
.Em ß
|
||||
acts as \&/ key.
|
||||
.El
|
||||
.Pp
|
||||
(Further suggestions are welcome.) These additional key definitions do not need their respective layouts to work, so e.g.
|
||||
.Em \e
|
||||
will act as \&* on any keyboard that has it as an unshifted key.
|
||||
.Pp
|
||||
Pressing physical keys and clicking on virtual ones can be freely combined. Right-clicked keys are released when no keys are held down by the left mouse button or physical keys anymore. To avoid stuck keys,
|
||||
.Nm
|
||||
forcibly releases all keys when losing focus.
|
||||
.Pp
|
||||
There are two remaining miscellaneous key definitions:
|
||||
.Em F12
|
||||
resets the calculator, like inserting a paperclip into the tiny hole at the back of the real device or removing all of its power sources (batteries, USB) would;
|
||||
.Em Menu
|
||||
opens a popup menu granting access to several emulator control items. This popup menu can also be opened by right-clicking on the screen area.
|
||||
.Ss The popup menu
|
||||
The first group of items in the popup menu deals with the calculator's SD card. The SD card can either be backed by a directory on the host system (item
|
||||
.Sy Mount SD folder ... ;
|
||||
.Nm
|
||||
will simulate a FAT-formatted file system on the fly), or by an image file (item
|
||||
.Sy Mount SD image ... ) .
|
||||
The former is more convenient for general use, but when debugging a hypothetical replacement firmware's SD driver, the latter variant's accuracy (it allows corrupting the filesystem, for instance) might be more desirable. The virtual SD card can be absent entirely, too (item
|
||||
.Sy Unmount SD ) .
|
||||
.Pp
|
||||
The second group consists of only one item, and it is only visible when one of the debug options has been used while starting
|
||||
.Nm .
|
||||
Named
|
||||
.Sy Start debugger ,
|
||||
it (re-)starts the GDB remote debugging interface. This is hidden by default because accidental clicks will seemingly freeze the emulator while it waits for an incoming connection.
|
||||
.Pp
|
||||
The third and final group contains two items:
|
||||
.Sy Reset ,
|
||||
which resets the calculator just like the
|
||||
.Em F12
|
||||
key, and
|
||||
.Sy Quit ,
|
||||
which closes
|
||||
.Nm
|
||||
and saves the configuration, CPU registers, hardware registers, and memory contents to their respective files. This saving step is also performed when
|
||||
.Nm
|
||||
is closed in another way, e.g. pressing
|
||||
.Em Control-C
|
||||
in the controlling terminal.
|
||||
.Ss First launch
|
||||
During the first launch,
|
||||
.Nm
|
||||
generates a new configuration with default values and empty memory.
|
||||
.Nm
|
||||
does not ship with a default firmware, only with the bootloaders for the supported calculators. Hence, the user is required to select a firmware to load into the flash.
|
||||
.Nm
|
||||
will show a file selection window for that task. For the stock firmware HP has always used the file extension
|
||||
.Dq .bin ,
|
||||
any other files (including the update.scp files that typically come with them!) are generally not actual firmware files.
|
||||
.Pp
|
||||
When the file selection dialog is cancelled or the file could not be read,
|
||||
.Nm
|
||||
creates a flash without firmware; the bootloader will complain and offer ways to correct the situation just like it would on a real device, which include receiving a firmware via USB (currently not available in
|
||||
.Nm ,
|
||||
see
|
||||
.Em Caveats
|
||||
below) or loading one from the SD card. Apart from these options, it's also possible to recover from this by exiting
|
||||
.Nm
|
||||
and either deleting the flash file or using one of the options
|
||||
.Fl f
|
||||
and
|
||||
.Fl F ,
|
||||
causing
|
||||
.Nm
|
||||
to rebuild the flash and ask for a firmware again.
|
||||
.Pp
|
||||
Please consult HP's manual (for their official firmware) or the documentation of the custom firmware (if using one) for an explanation of using the calculator.
|
||||
.Sh OPTIONS
|
||||
.Bl -tag -width indent
|
||||
.It Fl d Ns Oo Ns = Ns Ar port Oc , Fl Fl debug Ns Oo Ns = Ns Ar port Oc
|
||||
Enable the GDB remote debugging interface on the specified port (default 1234) and start the interface immediately. When used multiple times, the last explicitly specified port wins. If the connection is closed before
|
||||
.Nm
|
||||
is shut down, then the interface can be restarted from the popup menu.
|
||||
.It Fl D Ns Oo Ns = Ns Ar port Oc , Fl Fl enable-debug Ns Oo Ns = Ns Ar port Oc
|
||||
Same as
|
||||
.Fl d ,
|
||||
but without starting the interface immediately. The popup menu has to be used to do so. When combined with
|
||||
.Fl d ,
|
||||
the last explicitly specified port will still win, and the GDB interface will be started immediately. This facilitates using an alias for
|
||||
.Do Nm
|
||||
.Fl D Dc
|
||||
when the possibility for spontaneous debug sessions exists.
|
||||
.It Fl f Ns Oo Ns = Ns Ar firmware Oc , Fl Fl reflash Ns Oo Ns = Ns Ar firmware Oc
|
||||
Rebuild the flash. If the firmware is not specified,
|
||||
.Nm
|
||||
will ask for one through a file selection dialog window like on the first launch. The flash area beyond the firmware is left untouched, though; in the stock firmware this area is available to the user as port 2. Implies
|
||||
.Fl r
|
||||
for safety reasons: the firmware may have changed, so the code at the location where
|
||||
.Nm
|
||||
was stopped previously could be entirely different from the code at that location afterwards; a reboot ensures an orderly reinitialization of the operating system.
|
||||
.It Fl F Ns Oo Ns = Ns Ar firmware Oc , Fl Fl reflash-full Ns Oo Ns = Ns Ar firmware Oc
|
||||
Same as
|
||||
.Fl f ,
|
||||
but erase the area beyond the firmware too. This has the same effect as deleting the flash, but with the added benefit of being able to specify the firmware on the command-line for automation in scripts.
|
||||
.It Fl r , Fl Fl reboot
|
||||
Reboot the calculator instead of starting from the state saved in the configuration file.
|
||||
.It Fl h , Fl Fl help
|
||||
Print a compact help message and exit.
|
||||
.It Ar config
|
||||
Use
|
||||
.Ar config
|
||||
as the configuration file instead of the default one. See below for details on the format; if the file does not exist, it will be created with default values.
|
||||
.El
|
||||
.Sh FILES
|
||||
.Bl -tag -width indent
|
||||
.It Sy ~/. Ns Nm Ns Sy /config
|
||||
The default location for the configuration file. The file format is the INI-like
|
||||
.Dq key-file
|
||||
format defined by GLib. The configuration file stores, for the most part, the state of the calculator's hardware, excluding the memory. The peripherals' official names according the the S3C2410 datasheet are used as section names with the prefix
|
||||
.Dq s3c2410- ,
|
||||
the respective register names are the keys used in a section, and the values are the numbers stored in these registers. For the ARM processor itself, the section name is s3c2410-arm, and the keys correspond to the names of attributes in the QEMU CPU state structures.
|
||||
.Pp
|
||||
In addition, there are keys called
|
||||
.Em filename
|
||||
in the sections
|
||||
.Em flash ,
|
||||
.Em sram ,
|
||||
.Em s3c2410-sram ,
|
||||
.Em s3c2410-sdi
|
||||
which allow changing the filename of the files where the state of the respective memory is held. These can be absolute paths, or paths relative to the location of the configuration file (in the simplest case, only a filename). Any files that do not exist will be created with appropriate size and placeholder content. For
|
||||
.Em s3c2410-sdi ,
|
||||
the empty string is accepted as a special value for no inserted SD card.
|
||||
.Pp
|
||||
Finally, the
|
||||
.Em gui
|
||||
section contains the keys
|
||||
.Em name ,
|
||||
which specifies the window title (possibly useful when multiple different instances are present), and
|
||||
.Em type ,
|
||||
which specifies the type of the calculator (accepted values are
|
||||
.Sy hp49g+
|
||||
and
|
||||
.Sy hp50g ) .
|
||||
.It Sy flash
|
||||
The default name of the file backing the flash memory; required size: 2 MiB. If this file does not exist or is too small, the calculator type's appropriate bootloader will be copied into the first 16 KiB. Do NOT simply put a firmware file here, it will not work. Just use the builtin firmware installation mechanism instead.
|
||||
.It Sy sram
|
||||
The default name of the file backing the SRAM memory; required size: 512 KiB.
|
||||
.It Sy s3c2410-sram
|
||||
The default name of the file backing the S3C2410's internal SRAM memory; required size: 4 KiB.
|
||||
.El
|
||||
.Sh CAVEATS
|
||||
The emulation of the calculators' hardware is not fully accurate. Most notably, emulation speed is not authentic (it depends on the host's capabilites), and communication ports (serial, infrared, USB) are not available. For most purposes this is good enough, though.
|
Loading…
Reference in a new issue