lgblgblgb / xemu

Emulations (running on Linux/Unix/Windows/macOS, utilizing SDL2) of some - mainly - 8 bit machines, including the Commodore LCD, Commodore 65, and the MEGA65 as well.
https://github.com/lgblgblgb/xemu/wiki
GNU General Public License v2.0
201 stars 31 forks source link

MEGA65: UI menu cannot be activated (by right clicking into the emulator window) #240

Closed euneuber closed 3 years ago

euneuber commented 3 years ago

There as some places to guide a "n00bi" through installation and setup, some are outdated, none is sufficient (at least for me).

When the virtual SDCard is created, a notice to copy required files via a menu option (right mouse click on window) to the virtual SDCard. I can not get to this menu. xmega65.native only enters an endless loop on reboot:

**** The Incomplete MEGA65 emulator from LGB ****
This software is part of the Xemu project: https://github.com/lgblgblgb/xemu
CREATED: eugen@linux-xg80.suse on Linux 5.3.18-lp152.66-preempt at Do 15. Apr 17:10:27 CEST 2021
CREATED: gcc-compatible 7.5.0 64LE for linux
VERSION: https://github.com/lgblgblgb/xemu.git next e316c537d2070ac7be90e38da499cfdf712c72bd 20210407211721 custom-build
EMULATE: MEGA65 (mega65): xmega65 (../../build/bin/xmega65.native) for mega65 on linux (native) using cc
LICENSE: Copyright (C)2016-2021 Gábor Lénárt (aka LGB) lgb@lgb.hu http://lgb.hu/
LICENSE: This software is a GNU/GPL version 2 (or later) software.
LICENSE: <http://gnu.org/licenses/gpl.html>
LICENSE: This is free software; you are free to change and redistribute it.
LICENSE: There is NO WARRANTY, to the extent permitted by law.

FILE: @mega65-default.cfg cannot be open, tried path(s):  /home/eugen/.local/share/xemu-lgb/mega65/mega65-default.cfg
CFG: Default config file @mega65-default.cfg cannot be used
CFG: CLI parsing is done without error.
FILE: file @mega65-template.cfg.TMP opened as /home/eugen/.local/share/xemu-lgb/mega65/mega65-template.cfg.TMP with base mode-set as fd=3
FILE: 5342 bytes saved into file: @mega65-template.cfg.TMP
FILE: renaming file: /home/eugen/.local/share/xemu-lgb/mega65/mega65-template.cfg.TMP -> /home/eugen/.local/share/xemu-lgb/mega65/mega65-template.cfg
XEMU: emulated MEGA65 model ID: 255
INSTALLER: not activated.
WARNING: *** NEW M65 HACK MODE ACTIVATED ***
Logging into file: not enabled.
SDL: no SDL subsystem initialization has been done yet, do it!
SDL version: (hg-11914:f1084c419f33) compiled with 2.0.8, used with 2.0.8 on platform Linux
SDL system info: 64 bits LE, 8 cores, l1_line=64, RAM=32009Mbytes, max_alignment=16, CPU features: 3DNow=0 AVX=1 AVX2=1 AltiVec=0 MMX=1 RDTSC=1 SSE=1 SSE2=1 SSE3=1 SSE41=1 SSE42=1
SDL drivers: video = x11, audio = pulseaudio
TIMING: sleep = nanosleep, query = SDL_GetPerformanceCounter
SDL preferences directory: /home/eugen/.local/share/xemu-lgb/mega65/
SDL window native pixel format: SDL_PIXELFORMAT_RGB888
SDL renderer driver #3: "software"
SDL renderer driver #2: "opengles"
SDL renderer driver #1: "opengles2"
SDL renderer driver #0: "opengl"
SDL renderer used: "opengl" max_tex=16384x16384 tex_formats=5 (SDL_PIXELFORMAT_ARGB8888 SDL_PIXELFORMAT_YV12 SDL_PIXELFORMAT_IYUV SDL_PIXELFORMAT_NV12 SDL_PIXELFORMAT_NV21)

GUI: no GUI was specified, using the first available one from this list: none
GUI: using "none" (Not using GUI - the null GUI :))
FILE: file @keymap-default.cfg opened as /home/eugen/.local/share/xemu-lgb/mega65/keymap-default.cfg with base mode-set as fd=15
HID: 89 key bindings has been added as the default built-in configuration
FILE: @keymap.cfg cannot be open, tried path(s):  /home/eugen/.local/share/xemu-lgb/mega65/keymap.cfg
HID: cannot open keymap user config file (maybe does not exist), ignoring: @keymap.cfg
BIN: config "loadrom" as "C65 ROM image": pre-zero policy, clearing memory content.
BIN: config "loadrom" as "C65 ROM image": has no option override, using the previously stated policy.
BIN: config "loadcram" as "CRAM utilities": no pre-zero policy, using some (possible) built-in default content.
BIN: config "loadcram" as "CRAM utilities": has no option override, using the previously stated policy.
BIN: config "loadbanner" as "M65 logo": no pre-zero policy, using some (possible) built-in default content.
BIN: config "loadbanner" as "M65 logo": has no option override, using the previously stated policy.
BIN: config "loadc000" as "C000 utilities": pre-zero policy, clearing memory content.
BIN: config "loadc000" as "C000 utilities": has no option override, using the previously stated policy.
BIN: config "kickup" as "M65 kickstart": no pre-zero policy, using some (possible) built-in default content.
BIN: config "kickup" as "M65 kickstart": has no option override, using the previously stated policy.
FILE: file @nvram.bin opened as /home/eugen/.local/share/xemu-lgb/mega65/nvram.bin with base mode-set as fd=15
FILE: 64 bytes loaded from file: /home/eugen/.local/share/xemu-lgb/mega65/nvram.bin
FILE: file @uuid.bin opened as /home/eugen/.local/share/xemu-lgb/mega65/uuid.bin with base mode-set as fd=15
FILE: 8 bytes loaded from file: /home/eugen/.local/share/xemu-lgb/mega65/uuid.bin
D81: initial subsystem reset
SDCARD: configuring F011 FDC with have_disk=0, can_write=1
FILE: file @mega65.img opened as /home/eugen/.local/share/xemu-lgb/mega65/mega65.img with base mode-set as fd=15
SDCARD: image is not compressed
SDCARD: card init done, size=4096 Mbytes, virtsd_flag=0
SDCARD: check Xemu signature (@block 2): disk=0 this_xemu=1
INFO: Cannot find Xemu's signature on the SD-card image.
Please use UI menu: SD-card -> Update files ...
UI can be accessed with right mouse click into the emulator window.
VIC4: precise video address mode
VIC4: precise character address mode
VIC4: precise sprite pointer address mode
VIC4: compatibility screen address mode
VIC4: compatibility character address mode
VIC4: compatibility sprite pointer address mode
DMA: 'hack' (preliminary!! support for new-style M65 DMA) status: **ENABLED**
DMA: initializing DMA engine for chip revision 1 (initially, may be modified later!), dyn_mode=YES(M65-aware), modulo_support=DISABLED.
UARTMON: disabled, no name is specified to bind to.
SPEED: fast clock is set to 40.50MHz, 2592 CPU cycles per scanline.
CPU[65CE02]: RESET, PC=0000, BCD_behaviour=NMOS-6502
SPEED: in_hypervisor=1 force_fast=0 c128_fast=0, c65_fast=0 m65_fast=0
AUDIO: initialized (#2), 44100 Hz, 2 channels, 1024 buffer sample size.
AUDIO: volume is set to 100%, stereo separation is 100% [component-A is 100, component-B is 0]
MEM: UNHANDLED memory policy: 0
ETH: not enabled by config/command line
AUDIO: start
VIC4: precise character address mode
SDCARD: D81: mount register request @ $D68B val=$00 at PC=$A1A7
SDCARD: configuring F011 FDC with have_disk=0, can_write=1
VIC4: precise character address mode
SDCARD: D81: mount register request @ $D68B val=$00 at PC=$A1A7
SDCARD: configuring F011 FDC with have_disk=0, can_write=1
VIC4: precise character address mode
SDCARD: D81: mount register request @ $D68B val=$00 at PC=$A1A7
SDCARD: configuring F011 FDC with have_disk=0, can_write=1
VIC4: precise character address mode
SDCARD: D81: mount register request @ $D68B val=$00 at PC=$A1A7
SDCARD: configuring F011 FDC with have_disk=0, can_write=1
VIC4: precise character address mode
SDCARD: D81: mount register request @ $D68B val=$00 at PC=$A1A7
SDCARD: configuring F011 FDC with have_disk=0, can_write=1
VIC4: precise character address mode
SDCARD: D81: mount register request @ $D68B val=$00 at PC=$A1A7
SDCARD: configuring F011 FDC with have_disk=0, can_write=1
VIC4: precise character address mode
SDCARD: D81: mount register request @ $D68B val=$00 at PC=$A1A7
SDCARD: configuring F011 FDC with have_disk=0, can_write=1
^CVIC4: precise character address mode
SDCARD: configuring F011 FDC with have_disk=0, can_write=1
ETH: shutting down: handler thread seems hasn't been even running (not enabled?)

TIMING: Xemu CPU usage: avg=28.68%, min=14%, max=38% (142 counts), uptime=00:13
XEMU: good by(T)e.

Please add more explanations/links or a HOWTO for creating the virtual SDCard manually!

lgblgblgb commented 3 years ago

Hmm you should have that menu. So I have no idea :( The constant rebooting is normal, a real MEGA65 would react the same way exactly in this situation. You should see "SD-card" sub menu, and there "Update files on SD image". Please take a screenshot then what you can see in the menu, if you can't find it, really interesting. The documentation for this is: https://github.com/lgblgblgb/xemu/wiki/MEGA65-quickstart What you can access from the menu as well "Help (online) -> Xemu MEGA65 help page" and choosing "quickstart" on the web page already which should lead you the link above (I admit, this opening a web page from Xemu is a kinda hacky and not sure if it works on every OSes well enough, but it was the most sane way to add some help which can be kept up-to-date then without the need to update Xemu, ie not embedded things into Xemu itself, especially nowadays when there are lots of changes and branches everywhere ...).

Surely, I'm far from being a good documenter guy, so just go head and tell, if you find something problematic (as being the author of Xemu, I can easily miss many things which are of course clear for me, but can't be for others, new to Xemu), and thanks for the report.

lgblgblgb commented 3 years ago

Oh, sorry, just realized:

VERSION: https://github.com/lgblgblgb/xemu.git next e316c537d2070ac7be90e38da499cfdf712c72bd 20210407211721 custom-build

So is it a custom build done by yourself?

GUI: no GUI was specified, using the first available one from this list: none
GUI: using "none" (Not using GUI - the null GUI :))

Aha, so you build it without GTK support, thus you don't have menu (I misinterpreted your description somewhat, that you can't see only the corresponding menu option mentioned ...), clearly now, you can't see any menu to be used, since Xemu needs GTK3 devel libraries at compile time (actually it needs pkg-config for the GTK3 devel libs to be able to detect its presence), so it can compile support for the GUI menus at all! (on Linux of course. On Windows and Mac, Xemu uses native Windows and Mac APIs for the very same purposes). It's not strictly a compilation error though, since it's very legit to compile Xemu without any UI support, just then you won't be able to use things like the menu (right click into the emulator window), or various file dialog boxes, and such.

I'm sorry that I haven't spotted this at the first time, I was in the impression automatically, that you use a pre-built ("official build", downloaded from the Xemu download page) Xemu, since it is compiled correctly having GTK support in the Linux version.

lgblgblgb commented 3 years ago

I close this now, since it seems to be just the lack of GTK3 support compiled in, thus not having menu. Though if you still feel something is wrong, you can tell by commenting this issue. Though at this point it's not clear for me, that I should enhance the documentation, since for me it seems to be correct, you just lack the GUI support to be able to use the UI functionality the documentation talks about. Please note, that for Linux compilation the example (for DEB based systems, probably debian/ubuntu and others) includes this line as an example how to get the dependencies before compilation:

sudo apt install git build-essential libsdl2-dev libgtk-3-dev libreadline-dev

Which indicates that you need the GTK3 devel libs as well.

lgblgblgb commented 3 years ago

Also note (mainly for myself ...) that I may need to add some feedback if user right-click into the emulator window (in the hope to activate the UI menu what documentation talks about) but no support compiled in for the UI. Then it can be much more clear what happened rather than silently fail to do what the user expects.

lgblgblgb commented 3 years ago

Warning about the missing GUI support compiled in on popup-menu-time in this commit b4d96ceff9f4e5f02493932ceed0318d348bc70d

euneuber commented 3 years ago

Thank you very much! I recompiled with GTK3 support and now I have this "right-click-menu" and successfully created an SD-image!

Please make a note for Linux users, who compile your project themself:

"It needs GTK3 support/development libraries installed!"

Again, a huge "Thank you very much!"

lgblgblgb commented 3 years ago

Well, I think, most user download an official build. For those, want to their own, I have the modification now (see above on that commit) which presents an error dialog now to tell about the problem (so it won't left unnoticed why right-click does not work silently). For the compilation, and user documentation side, I don't know what can be written better, as it clearly stated with an example with apt that gtk3 devel lib must be installed. For sure, not everybody uses apt/DEB based distro, that's true, but it would be a "bit" overkill to have documentation for every distribution possible ;), who can compile a problem by its own - I guess - can figure out from that. But if you meant something different to add more comment on this, you're welcomed to suggest a place or anything.