Skip to content

Commit 333c9e1

Browse files
authored
Merge pull request #89 from mike632t/unstable
Merge changes from unstable
2 parents 25f88c9 + 9dc82eb commit 333c9e1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+6075
-1015
lines changed

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,5 @@
22
!src/*.c
33
!src/*.h
44
!src/*.in
5-
!src/*.desktop
65
!LICENSE
76
!README.md

README.md

+102-51
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,29 @@ avoided in order to try to make the code as portable as possible.
1212
The aim is to have the same source code compile without modification on
1313
Linux, VAX/VMS, and Tru64 Unix.
1414

15-
Unlike all the other emulators the ROM images for the HP10C, HP11C, HP12C,
16-
HP15C, HP16C are not defined in the the source code and must be loaded from
17-
a separate ROM file.
18-
1915
![HP10](./img/x11-calc-10c.png) ![HP11](./img/x11-calc-11c.png)
2016

2117
More [screenshots](./img/#top)
2218

2319

2420
### Latest News
2521

22+
14 Apr 24
23+
24+
- Allows the size of the window to be adjusted using the `--zoom n` option
25+
where n can be between 0 and 4.
26+
- Added an install option to the makefile (by default the installer will
27+
use `$HOME/.local` if it exists, but it is possible to specify another
28+
directory by setting the directory `prefix`).
29+
- Embedded missing firmware.
30+
2631
24 Feb 24
2732
- By default the application will attempt to use the X11 base fonts. But
2833
if these are not available it will try to select an suitable alternate
2934
font instead from a predefined list.
3035

3136
For all the fonts to be rendered as intended users should ensure that
32-
the X11 base fonts are installed (see prerequsites).
37+
the X11 base fonts are installed (see prerequisites).
3338

3439
16 Feb 24
3540
- For UNIX based systems the default location used to store the state of
@@ -53,59 +58,92 @@ More [screenshots](./img/#top)
5358

5459
### Compiling
5560

56-
To build the simulator on Linux check that you have all the prerequisites
57-
installed then download the source code from github and unzip it (a new
58-
folder will be created to automatically). Then change directory to the
59-
new folder run 'make all' build all the simulators.
61+
To build the simulator check that you have all the prerequisites installed
62+
then download the source code from github and unzip it (this will created a
63+
new directory automatically).
6064

6165
e.g:
6266
```
6367
$ wget https://github.com/mike632t/x11-calc/archive/refs/heads/stable.zip
6468
$ unzip x11-calc-stable.zip
69+
```
70+
Then change directory to the new folder.
71+
```
6572
$ cd x11-calc-stable
66-
$ make -f makefile.linux all
67-
73+
```
74+
The to compile all the emulators you just need to invoke make.
75+
```
76+
$ make clean; make all
77+
```
78+
It is also possible to compile a single emulator by specifying the model on
79+
the command line
80+
```
81+
$ make hp29c
82+
```
83+
By default the executable files will be created in the `bin` directory, and
84+
can run either a particular emulator directly, or invoke the launcher which
85+
will allow you to select which enulator to use by default the next time you
86+
launch it.
87+
```
6888
$ ./bin/x11-calc-29c
6989
x11-calc-29c: Version 0.10 [Commit ID: 399d546] 01 Nov 23 23:53:00 (Build: 0114)
7090
ROM Size : 4096 words
7191
```
92+
OR
93+
```
94+
$ bin/x11-calc
95+
```
7296
If more than one C compiler is installed or if gcc is not available you can
7397
specify which one to use from the command line.
7498
```
75-
$ make -f makefile.linux CC=clang VERBOSE=1 all
99+
$ make CC=clang hp11c
76100
77-
$ make -f makefile.linux CC=tcc VERBOSE=1 all
101+
$ make CC=tcc
78102
```
79-
80-
On Tru64 UNIX a specific make file is used, and the execuitable files are
81-
saved in the same folder as the source.
103+
#### VMS
104+
On VMS unzip the source code archive, change the default directory and then
105+
run `make.com`.
82106

83107
e.g:
84108
```
85109
$ unzip x11-calc-stable.zip
86-
$ cd x11-calc-stable
87-
$ make -f makefile.tru64 all
110+
$ set def [.x11-calc-stable.src]
111+
$ @make all
88112
89-
$ ./src/x11-calc-29c
90-
x11-calc-29c: Version 0.10 [Commit ID: 399d546] 01 Nov 23 23:53:00 (Build: 0114)
113+
$ mc [-.bin]x11-calc-29c
114+
x11-calc-29c: Version 0.10 [Commit ID: 399d546] 02 Nov 23 23:52:11 (Build: 0114)
91115
ROM Size : 4096 words
92116
```
93117

94-
On VMS unzip the source code archive, then run the DCL `make` script.
118+
### Installing
95119

96-
e.g:
120+
On Linux systems after the compilation is complete you can use the makefile
121+
to install the emulator locally.
122+
123+
By default the installer will use `$HOME/.local` if it exists, but it is
124+
possible to specify another directory by setting the directory `prefix`.
97125
```
98-
$ unzip x11-calc-stable.zip
99-
$ set def [.x11-calc-stable.src]
100-
$ @make all
126+
$ make install
101127
102-
$ mc [-.bin]x11-calc-29c
103-
x11-calc-29c: Version 0.10 [Commit ID: 399d546] 02 Nov 23 23:52:11 (Build: 0114)
104-
ROM Size : 4096 words
128+
OR
129+
130+
$ make install prefix=/usr
131+
```
132+
Installer also supports staged installs in a custom directory defined using
133+
DESTDIR.
134+
```
135+
make DESTDIR=/tmp/staging install
105136
```
106137

138+
### Using Flatpak
139+
140+
If you don't want to download an compile the sources your self the emulator
141+
is also available on [Flathub](https://flathub.org/apps/io.github.mike632t.x11-calc) and can be installed using Flatpak.
142+
107143
### Tested
108144

145+
The emulators have been tested on the following systems:
146+
109147
- Debian 12 (Bookworm), clang 14.0.6, x64 + arm64
110148

111149
- Debian 12 (Bookworm), tcc 0.9.27, x64 + arm64
@@ -130,6 +168,8 @@ ROM Size : 4096 words
130168

131169
- Fedora 35, gcc 11.3.1, x64
132170

171+
- Fedora 35, clang 13.0.1, x64
172+
133173
- Fedora 39, gcc 13.2.1, x64
134174

135175
- Gentoo, gcc 11.2.0, x64
@@ -138,6 +178,8 @@ ROM Size : 4096 words
138178

139179
- MacOS 13.4.1 (Venture), clang 14.0.3, arm64
140180

181+
- NetBSD 9.2, gcc 7.5.0, x64
182+
141183
- SUSE 15.4, clang 13. 0.1, x64
142184

143185
- SUSE 15.4, gcc 7.5.0, x64
@@ -154,16 +196,15 @@ ROM Size : 4096 words
154196

155197
- Windows 11 + WSL2, gcc 12.2.0, x64 + arm64
156198

157-
158199
### Prerequisites
159200

160201
The following packages are required to build and/or run the simulator.
161202

162203
- Debian : gcc | clang | tcc make libc6-dev libx11-dev xfonts-base
163204

164-
- Fedora : gcc make glibc-devel libX11-devel xorg-x11-fonts-base | xorg-x11-fonts-misc
205+
- Fedora : gcc | clang make glibc-devel libX11-devel xorg-x11-fonts-base | xorg-x11-fonts-misc
165206

166-
- Gentoo : gcc make libc6-dev libx11-dev font-misc-misc
207+
- Gentoo : gcc make libc6-dev libx11-dev font-misc-misc
167208

168209
- MacOS : clang make [xquartz](https://www.xquartz.org/)
169210

@@ -173,7 +214,6 @@ The following packages are required to build and/or run the simulator.
173214

174215
- Windows 11 + WSL2 : gcc make libc6-dev libx11-dev xfonts-base
175216

176-
177217
### Keyboard Shortcuts
178218

179219
The following keyboard shortcuts should work on Linux:
@@ -193,7 +233,6 @@ exist and 'Space' maps to 'SST' if not shifted.
193233
memory 'Ctrl-Z' saves the current register contents, and 'Ctrl-C' restores
194234
them to the original saved state.
195235

196-
197236
### Loading and saving
198237

199238
For models with continuous memory the contents of program memory and data
@@ -209,14 +248,12 @@ copies of programs to be loaded automatically when the simulator starts or
209248
the simulator is reset using 'Ctrl-C'. However, any changes will be
210249
saved in the hidden data file.
211250

212-
213251
### Exiting
214252

215253
For models with a 'sliding' On/Off switch clicking on the switch will turn
216254
the simulator on or off, but if when switching off you hold down the switch
217255
down for two seconds the program will exit.
218256

219-
220257
### Debugging
221258

222259
You can start the simulation in trace mode using '-t', or in single step
@@ -228,16 +265,16 @@ of the CPU registers.
228265

229266
When in trace mode a jump to the same instruction produces no output.
230267

231-
232268
### ROM Images
233269

234-
No ROM images are included for the HP10C, HP11C, HP12C, HP15C, and HP16C.
235-
236270
The '-r <filename>' command line option provides the ability to use the ROM
237-
contents held in an separate file.
271+
contents from a separate file. The contents of the ROM are stored as pairs
272+
values seperated by a colon containing the memory address and the opcode.
238273

239-
For the HP10C, HP11C, HP12C, HP15C, and HP16C the ROM comprised of pairs of
240-
hexadecimal values as address:opcode.
274+
Anything appearing after a semi colon on each line is ignored.
275+
276+
For the HP10C, HP11C, HP12C, HP15C and HP16C the ROM file contains pairs of
277+
_hexadecimal_ values.
241278
```
242279
0000:107
243280
0001:04e
@@ -246,8 +283,7 @@ hexadecimal values as address:opcode.
246283
0004:2ee
247284
0005:13f
248285
```
249-
Other models include the ROM as part of the program, but you can specify an
250-
alternate ROM comprising of pairs of octal values.
286+
For other models the ROM file contains pairs of _octal_ values.
251287
```
252288
00000:00255
253289
00001:01420
@@ -256,13 +292,23 @@ alternate ROM comprising of pairs of octal values.
256292
00004:01746
257293
00005:00472
258294
```
259-
This allows you to use your own ROM images with any of the simulators.
295+
When loading a ROM from file any gaps between the memory addresses will not
296+
be filled with zeros, and the existing ROM contents will be left unchanged.
260297

298+
ROM files can therefore be used to load alternative version of the firmware
299+
for a particular model or apply a patch to the existing firmware.
261300

262301
### Known Issues
263302

264-
* Keyboard shortcuts only work on Linux.
303+
* Keyboard shortcuts only work on Linux and NetBSD.
265304
* A 24 bit colour display is required.
305+
* For best results you need to have the X windows core fonts installed.
306+
307+
* Parallel make only works on Linux.
308+
309+
##### HP 29C
310+
311+
* All 30 registers have continuous memory.
266312

267313
##### HP 37E
268314

@@ -273,17 +319,22 @@ This allows you to use your own ROM images with any of the simulators.
273319
* Cannot read or write to magnetic cards.
274320
* Has continuous memory.
275321

276-
### Raspberry Pi Specific IssuesGentoo
322+
### Raspberry Pi Specific Issues
277323

278324
* The code uses a simplified display on Arm based systems (except Apple) to
279325
avoid the display refresh issues seen on the Raspberry Pi if either FKMS or
280326
KMS overlays are enabled. (Note- Do not disable KMS on the latest Raspberry
281327
Pi OS release).
282-
* The window manager on recent Raspberry Pi OS releases doesn't disable the
283-
ability to resize or maximize a window if the maximum and minimum window
284-
sizes are the same. The application will resize the window automatically it
285-
the user attempts to change the size but if it is maximized then the title
286-
bar will be hidden (by the window manager) until the window is unmaximized.
328+
329+
### Wayland specific Issues
330+
331+
* Performance under Xwayland is generally poor, the emulator will work well
332+
on a Raspberry Pi3 using Xwindows but a Raspberry Pi4 using Xwayland cannot
333+
redraw the display quickly enough to allow background shading to be used to
334+
draw the display digits. As a result the emulator's LED/LCD display doesn't
335+
use any background shading on ARM based systems.
336+
* The emulator window is supposed to be a fixed size. However wnen running
337+
on Xwayland the window manager does not handle this correctly.
287338

288339
### VMS Specific Issues
289340

img/README.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,15 @@ in C using only X11.
1010

1111
![HP35](./x11-calc-35.png) ![HP80](./x11-calc-80.png) ![HP45](./x11-calc-45.png) ![HP70](./x11-calc-70.png)
1212

13-
![HP10](./x11-calc-10.png)
14-
1513
![HP21](./x11-calc-21.png) ![HP22](./x11-calc-22.png) ![HP25](./x11-calc-25.png)
1614

1715
![HP27](./x11-calc-27.png) ![HP29](./x11-calc-29.png)
1816

1917
![HP67](./x11-calc-67.png)
2018

21-
![HP31](./x11-calc-31.png) ![HP32](./x11-calc-32.png) ![HP33](./x11-calc-33.png)
19+
![HP31](./x11-calc-31e.png) ![HP32](./x11-calc-32e.png) ![HP33](./x11-calc-33c.png)
2220

23-
![HP34](./x11-calc-34.png) ![HP37](./x11-calc-37.png) ![HP38](./x11-calc-38.png)
21+
![HP34](./x11-calc-34c.png) ![HP37](./x11-calc-37e.png) ![HP38](./x11-calc-38c.png)
2422

2523
![HP10](./x11-calc-10c.png) ![HP11](./x11-calc-11c.png)
2624

img/x11-calc-10c-gnome-screenshot.png

9.45 KB
Loading

img/x11-calc-11c-gnome-screenshot.png

10.3 KB
Loading

img/x11-calc-12c-gnome-screenshot.png

9.83 KB
Loading

img/x11-calc-15c-gnome-screenshot.png

10.6 KB
Loading

img/x11-calc-16c-gnome-screenshot.png

10.6 KB
Loading

img/x11-calc-21-gnome-screenshot.png

8.27 KB
Loading

img/x11-calc-25c-gnome-screenshot.png

9.99 KB
Loading
File renamed without changes.
File renamed without changes.

img/x11-calc-33-debian12-mate.png

-34.8 KB
Binary file not shown.

img/x11-calc-33-debian12-twm.png

-19 KB
Binary file not shown.

img/x11-calc-33-suse15-mate.png

-313 KB
Binary file not shown.

img/x11-calc-33-tru64-cde.jpg

-155 KB
Binary file not shown.

img/x11-calc-33-ubuntu20.png

-635 KB
Binary file not shown.

img/x11-calc-33-vms543-decw.png

-26.2 KB
Binary file not shown.

img/x11-calc-33c-gnome-screenshot.png

9.99 KB
Loading

img/x11-calc-33c-kde-screenshot.png

-22 KB
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

make.sh

-28
This file was deleted.

0 commit comments

Comments
 (0)