Memotech-Bill / MEMU

MEMU - Memotech EMUlator
Other
10 stars 2 forks source link

Installation and running issues on pi4B running piOS64bit #1

Closed Ardeer closed 1 year ago

Ardeer commented 1 year ago

A couple of issues during installation and running:- home/pi/MEMU/src/memu/win_fb.c: In function ‘win_fb_init’: /home/pi/MEMU/src/memu/win_fb.c:140:7: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] 140 | if ( (int) fbp == -1 ) | ^ [ 97%] Building C object CMakeFiles/memu-fb.dir/src/Z80/Z80.c.o [100%] Linking C executable ../run_time/memu-fb [100%] Built target memu-fb

error message when running ./memu-pi

memu: Unable to get existing keyboard mode. Terminate: Fatal: Unable to get existing keyboard mode.

Memotech-Bill commented 1 year ago

A couple of issues during installation and running:- home/pi/MEMU/src/memu/win_fb.c: In function ‘win_fb_init’: /home/pi/MEMU/src/memu/win_fb.c:140:7: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] 140 | if ( (int) fbp == -1 ) | ^ [ 97%] Building C object CMakeFiles/memu-fb.dir/src/Z80/Z80.c.o [100%] Linking C executable ../run_time/memu-fb [100%] Built target memu-fb

Fixed.

error message when running ./memu-pi

memu: Unable to get existing keyboard mode. Terminate: Fatal: Unable to get existing keyboard mode.

Were you running over SSH? memu-pi will not work like that. It is intended to be used with a display and keyboard attached directly to the RaspberryPi. Note also that memu-pi also currently requires the FKMS video driver, not KMS.

For use over SSH use a copy of memu-x compiled on the Raspberry Pi.

Ardeer commented 1 year ago

Hi Bill,

the change you made to win_fb.c worked. Thanks.

There was no memu-pi in runtime this time, only memu-fb. When I ran memu-fb, resulted in the same keyboard fatal error. I did copy back the original memu-pi file but this gave the same error.

My pi4B is connected to a screen and a wired keyboard and mouse. I have never used SSH.

As for which video driver I am using FKMS or KMS, I have no idea, what ever is installed with piOS 64-bit bullseye (Linux raspberrypi 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr 3 17:24:16 BST 2023 aarch64 GNU/Linux, debian version 11.7)?

regards

Ardeer commented 1 year ago

I found the video driver in /boot/config.txt. It was set to KMS. I have changed it to FKMS.

It didn't alter the fatal keyboard error.

Memotech-Bill commented 1 year ago

No idea. In order to test I did a fresh install of 64-bit bullseye. My kernel version is identical to yours. I cloned the repository and did a build. I don't see that error.

The only thing I can suggest is that you delete the build folder and then redo the whole build.

Ardeer commented 1 year ago

Hi Bill,

Still unsuccessful, I included the install info below, just in case something jumps out. thanks.

I deleted the MEMU folder sudo apt update && sudo apt upgrade rebooted pi:$ git clone https://github.com/Memotech-Bill/MEMU.git Cloning into 'MEMU'... remote: Enumerating objects: 587, done. remote: Counting objects: 100% (587/587), done. remote: Compressing objects: 100% (394/394), done. remote: Total 587 (delta 329), reused 445 (delta 187), pack-reused 0 Receiving objects: 100% (587/587), 2.75 MiB | 5.50 MiB/s, done. Resolving deltas: 100% (329/329), done. pi:~ $ cd MEMU pi:~/MEMU $ mkdir build-fb pi:~/MEMU $ cd build-fb pi:~/MEMU/build-fb $ cmake -DTARGET=FBuf .. -- The C compiler identification is GNU 10.2.1 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Configuring done -- Generating done -- Build files have been written to: /home/pi/MEMU/build-fb pi~/MEMU/build-fb $ make Scanning dependencies of target memu-fb [ 2%] Building C object CMakeFiles/memu-fb.dir/src/memu/cfgwin.c.o [ 5%] Building C object CMakeFiles/memu-fb.dir/src/memu/cfx2.c.o [ 8%] Building C object CMakeFiles/memu-fb.dir/src/memu/common.c.o [ 10%] Building C object CMakeFiles/memu-fb.dir/src/memu/config.c.o [ 13%] Building C object CMakeFiles/memu-fb.dir/src/memu/cpm.c.o [ 16%] Building C object CMakeFiles/memu-fb.dir/src/memu/ctc.c.o [ 18%] Building C object CMakeFiles/memu-fb.dir/src/memu/dart.c.o [ 21%] Building C object CMakeFiles/memu-fb.dir/src/memu/diag.c.o [ 24%] Building C object CMakeFiles/memu-fb.dir/src/memu/dirmap.c.o [ 27%] Building C object CMakeFiles/memu-fb.dir/src/memu/dirt_unix.c.o [ 29%] Building C object CMakeFiles/memu-fb.dir/src/memu/dis.c.o [ 32%] Building C object CMakeFiles/memu-fb.dir/src/memu/joy_lin.c.o [ 35%] Building C object CMakeFiles/memu-fb.dir/src/memu/kbd2.c.o [ 37%] Building C object CMakeFiles/memu-fb.dir/src/memu/main.c.o [ 40%] Building C object CMakeFiles/memu-fb.dir/src/memu/mem.c.o [ 43%] Building C object CMakeFiles/memu-fb.dir/src/memu/memu.c.o [ 45%] Building C object CMakeFiles/memu-fb.dir/src/memu/mon.c.o [ 48%] Building C object CMakeFiles/memu-fb.dir/src/memu/monprom.c.o [ 51%] Building C object CMakeFiles/memu-fb.dir/src/memu/nfx.c.o [ 54%] Building C object CMakeFiles/memu-fb.dir/src/memu/printer.c.o [ 56%] Building C object CMakeFiles/memu-fb.dir/src/memu/rom_os.c.o [ 59%] Building C object CMakeFiles/memu-fb.dir/src/memu/rom_assem.c.o [ 62%] Building C object CMakeFiles/memu-fb.dir/src/memu/rom_basic.c.o [ 64%] Building C object CMakeFiles/memu-fb.dir/src/memu/rom_boot_type07.c.o [ 67%] Building C object CMakeFiles/memu-fb.dir/src/memu/rom_sdx_type07.c.o [ 70%] Building C object CMakeFiles/memu-fb.dir/src/memu/sdxfdc.c.o [ 72%] Building C object CMakeFiles/memu-fb.dir/src/memu/sid.c.o [ 75%] Building C object CMakeFiles/memu-fb.dir/src/memu/snd.c.o [ 78%] Building C object CMakeFiles/memu-fb.dir/src/memu/spec.c.o [ 81%] Building C object CMakeFiles/memu-fb.dir/src/memu/tape.c.o [ 83%] Building C object CMakeFiles/memu-fb.dir/src/memu/ui.c.o [ 86%] Building C object CMakeFiles/memu-fb.dir/src/memu/vdeb.c.o [ 89%] Building C object CMakeFiles/memu-fb.dir/src/memu/vga.c.o [ 91%] Building C object CMakeFiles/memu-fb.dir/src/memu/vid.c.o [ 94%] Building C object CMakeFiles/memu-fb.dir/src/memu/win_fb.c.o [ 97%] Building C object CMakeFiles/memu-fb.dir/src/Z80/Z80.c.o [100%] Linking C executable ../run_time/memu-fb [100%] Built target memu-fb pi:~/MEMU/run_time $ ls andy_sys.mfloppy disks memu0.cfg memu.cfg memu-fb roms tapes pi:~/MEMU/run_time $ ./memu-fb memu: Unable to get existing keyboard mode. Terminate: Fatal: Unable to get existing keyboard mode.

regards,

Ardeer commented 1 year ago

I have one of the original PI4Bs and piOS runs from the USB not the SD card. Not sure if either of these are a factor. Thanks for your time in trying to resolve the issue. Thanks.

Ardeer commented 1 year ago

I have downloaded a fresh copy of piOS 64 onto an SD card. installed MEMU however, when I run it I still get the same keyboard fatal error message.

Memotech-Bill commented 1 year ago

Just had a thought. Are you running the GUI? The memu-fb is not meant to be run from a GUI. Use memu-x for that.

I am using the 'lite' version of the OS. If you are using one of the full installations and are booting into the GUI, the simplest way of trying memu-fb is to use the key combination <Ctrl+Alt+F2>. That should give you a full screen text display. You will have to logon again. Try memu-fb from there.

To get back to the GUI use <Ctrl+Alt+F7>.

Ardeer commented 1 year ago

Hi Bill,

you were correct in your observation, when I booted into non-GUI mode, memu-fb loaded the emulator as expected. Thanks.

one follow up though, when I type PRINT "HELLO" RETURN, the EDIT window doesn't enter but a scrolling number 2's fill the edit screen overwriting what I wrote. Is this a keyboard mapping issue? I am using a standard PC keyboard. Thanks.

Memotech-Bill commented 1 year ago

No that does not sound like a keyboard mapping issue. That just results in a few keys not producing the expected character.

Again, I have no idea what the cause could be and I am not able to reproduce.

Ardeer commented 1 year ago

Sometimes, I press a key and it races across the screen. Pressing the offending key again seems to stop it. I have tried different keyboards with the same effect. the " key appears troublesome. Now I know how to stop it, it works.

Sometimes on loading memu-fb it displays ALSO lib pcm.c:8545 (snd_pcm_recover) underrun occurred.

I have managed to get TOADO running, when I remembered I needed to change the emulation to mtx500.

I will continue to play around with it.

regards.

Memotech-Bill commented 1 year ago

OK, I have been able to reproduce. It happens if you release the shift key before you release the 2 key.

I will have to give it some thought.

Memotech-Bill commented 1 year ago

Code revised.

Ardeer commented 1 year ago

Bill,

I deleted MEMU, downloaded the new version and it the few tests carried out so far, appears to work as it should. Thanks. regards,

Ardeer commented 1 year ago

When you load a program, run it and want to stop it without leaving the session, how do you do it as the break key returns you back to the pi terminal?

Note: I found an old cassette with some MTX assembly code I was working on way back in 1989. I have converted to wav files. Some appear to load. Sometimes, the sound keeps going even though the program has loaded. Any thoughts? Thanks.

Memotech-Bill commented 1 year ago

The 'star' (multiply) key on the numeric keypad emulates the MTX break key, but most commercial games will ignore that.

Pressing the two keys performs a reset, as per the two reset keys on the MTX.

The 'loading' sound on an MTX does not come from the tape. It is faked by the sound chip so can sometimes continue after the tape has finished. The simplest way to silence this is to type <Ctrl+G>.