Skip to content

TheRainbowPhoenix/MQ

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

343 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

MQ: Calculator emulator

Project description is TODO.

git clone --recursive https://git.planet-casio.com/Lephenixnoir/mq

Building for Linux

Clone this repository recursively. Also install Azur for the GUI.

# Path where you installed Azur for Linux:
% export AZUR_PATH_linux="$HOME/.local"

% cmake -B build-linux -DAZUR_PLATFORM=linux \
    -DCMAKE_BUILD_TYPE=[Debug|Release] \
    [-DMQ_DISABLE_OPTIMIZATIONS=1] \
    [-DMQ_PROFILING_GPROF=1] \
    [-DMQ_PROFILING_TRACY=1] \
    [-DMQ_VIDEO_FFMPEG=0]
% make -C build-linux

Optimizations are enabled in all modes by default, as the emulator is almost unusable without. Debug mode just turns off LTO. To fully disable optimizations, add -DMQ_DISABLE_OPTIMIZATIONS.

Debug modes can enable profiling.

  • Select -DMQ_PROFILING_GPROF to profile with gprof; running the executable will produce gmon.out in the current folder.
  • Select -DMQ_PROFILING_TRACY to enable tracy, which must be cloned in 3rdparty/tracy.

Linux builds enable video capture with ffmpeg libraries by default. This requires libswscale, libavutil, libavformat and libavcodec. If you don't have these libraries you can disable the feature with -DMQ_VIDEO_FFMPEG=0.

Building for emscripten

Clone this repository recursively. Also install Azur for the GUI.

# Path where you installed Azur for emscripten:
% export AZUR_PATH_emscripten="$HOME/.prefix-emscripten"

% emcmake cmake -B build-emscripten -D AZUR_PLATFORM=emscripten
% make -C build-emscripten

In order to test you'll need to serve the files somewehre, as the main .html file won't be able to load the others with a file:// URL. You also need a server that provides appropriate COOP and COEP headers, see the emscripten docs for details. A local server satisfying these requirement is given in tools.

% python3 tools/local-http-server.py build-emscripten 8000
% firefox http://0.0.0.0:8000

Profiling on Linux

MQ supports profiling with Tracy.

After cloning, build the Tracy server. The GUI uses nativefiledialogs-extended for file dialogs, which tries to use the XDG portal by default on Linux. If this doesn't work for you (i.e. you get an error message when using open/save file features in the GUI), try to configure with -DGTK_FILESELECTOR=1.

git submodule update --init --recursive
cd 3rdparty/tracy
# Set a cache for both profiler and capture so the libraries don't get rebuilt
export CPM_SOURCE_CACHE=$(realpath .)/.cpm-cache
# Build the live profiler
cmake -B profiler/build -S profiler -DCMAKE_BUILD_TYPE=Release
cmake --build profiler/build --config Release
# Build the capture program (analysis after-the-fact)
cmake -B capture/build -S capture -DCMAKE_BUILD_TYPE=Release
cmake --build capture/build --config Release

You can run Tracy in one of two ways:

  1. Live: run profiler/build/tracy-profiler. Start MQ then click "Connect". You can then use the profiler live, pause, etc.
  2. Offline: run capture/build/tracy-capture -o [FILE]. Start MQ and run some code. Quit MQ then interrupt the capture; this leaves you with a trace in FILE. Run profiler/build/tracy-profiler and choose "Open saved trace" to open the file.

Profiling TODOs:

  • Assign fixed cores with high priority for the process.
  • Set these cores to a fixed frequency.
  • Once threads, name threads (see doc @2.4)

Compatibility table

This section is generated automatically based on this YAML summary.

Total programs: all(59): fxcg50(27) fx9860g_sh4(23) fxcg20(6) fx9860g_sh3(3) fxcp400_2.01.2(0) fxcg100_2.00(0) fx9860g3(0)

🟒 Complete (47.46%) - Programs where most features work and games that can be completed with reasonable performance
🟠 Usable (20.34%) - Programs that can be used and games that can be played but have missing features, glitches, or bad performance
🟀 Frame (10.17%) - Programs that display at least one frame before failing
⚫ Nothing (22.03%) - Programs that crash, loop, or get stuck before displaying their first frame

Addin Status Models Updated Notes
Gravity Duck by PierrotLL 🟒 Complete fxcg50 2026-02-21 - Graphical animation bug
- Lots of NULL accesses; some are bugs from original program.
- Syscall-based
Duet by Yatis and Lephe 🟒 Complete fxcg50 2026-02-21 - the emulator doesn't support screen rotation
- miss automatic arrows key bind with KEY_0 and KEY_7
Mario Kart by Circuit10 🟒 Complete fxcg50 2026-02-21 - Pefect?!
Cube Field by PierrotLL 🟒 Complete fxcg50 2026-02-21 - Perfect?!
OutRun by SlyvTT 🟒 Complete fxcg50 2026-02-21 - Perfect?!
After Burner by Lephe 🟒 Complete fxcg50 2026-02-21 - Perfect?!
- Throttle doesn't work?
Super Mario 3D by Farhi 🟒 Complete fxcg50 2026-02-21 - Perfect?!
Maverick Bird by Lephe 🟒 Complete fxcg50 2026-02-21 - Perfect?!
Mario 3D by Games 🟒 Complete fxcg50 2026-02-21 - Perfect?!
Dumb Clicker Goto Edition by Kikoodx 🟒 Complete fxcg50 2026-02-21 - we can click efficiently, nice
Momento by Kikoodx 🟒 Complete fxcg50 2026-02-21 - Perfect?!
Teh Moon Show by Massena 🟒 Complete fxcg50 2026-02-21 - cannot restart a game, same on real hardware
- need to properly handle game exit
Chaos Drop by Lephe 🟒 Complete fxcg50 2026-02-21 - too many NULL page write warning
Geometry Dash by Fife86 🟒 Complete fx9860g_sh4 2026-02-21 - Perfect?!
Gravity Duck by PierrotLL 🟒 Complete fx9860g_sh4 2026-02-21 - Perfect?!
2048 delux by Kirafi 🟒 Complete fx9860g_sh4 2025-09-03 - save file loading is broken
Mipjabok by Louloux 🟒 Complete fx9860g_sh4 2026-02-21 - Perfect?!
Bomberman by Dodormeur 🟒 Complete fx9860g_sh4 2025-09-03 - Perfect?!
FxLibcTest by Lephenixnoir 🟒 Complete fxcg50 2026-02-21 - Perfect?!
Arena by Lephenixnoir 🟒 Complete fx9860g_sh4 2026-02-21 - Perfect?!
Azuray by Lephenixnoir 🟒 Complete fxcg50 2026-02-21 - Perfect?!
- too many unhandled read/write e500deb8
BosonX by Lephenixnoir 🟒 Complete fxcg50 2026-02-21 - Perfect?!
CG Demo by Slyvtt 🟒 Complete fxcg50 2026-02-21 - Perfect?!
IpodSpike by Kirafi 🟒 Complete fx9860g_sh4 2026-02-21 - Perfect?!
IpodGraviton by Kirafi 🟒 Complete fx9860g_sh4 2026-02-21 - Perfect?!
SeaRush by Kirafi 🟒 Complete fx9860g_sh4 2026-02-21 - Perfect?!
IpodSpin by Kirafi 🟒 Complete fx9860g_sh4 2026-02-21 - Perfect?!
PythonExtra by Lephenixnoix 🟒 Complete fxcg50 2026-02-21 - Perfect?!
gintctl by Lephe 🟠 Usable fxcg50 2026-02-21 - Most things work
- This is used to test hardware features
HorlogeSH4 by Lephe 🟠 Usable fx9860g_sh4 2026-02-21 - displays and works in real-time
- blocked by %14d Bdisp_AreaReverseVRAM in date/time edition menu
Sonic by Smashmaster 🟠 Usable fxcg50 2026-02-21 - Lephenixnoir's fxcg50 port
- require the throtle to be playable, too fast othewise
Meta Ball by Lancelot 🟠 Usable fxcg50 2026-02-21 - Lephenixnoir's fxcg50 port
- Too slow.
- Invalid write sometime (0xaeffffc2)
AST3 C by Tituya 🟠 Usable fxcg50 2026-02-21 - Broken first menu which not display frame entierly
- Rest of the game is playable
- a lot of broken frame in the level selection
Frozen Frenzy by Massena 🟠 Usable fxcg50 2025-08-21 - require throttle to be playable, too fast otherwise
Angry Bird by LouLoux 🟠 Usable fx9860g_sh4 2025-08-27 - too fast
Evasion by Dodormeur 🟠 Usable fx9860g_sh4 2026-02-21 - missing syscall %462 GetAppName()
gintctl by Lephe 🟠 Usable fx9860g_sh4 2026-02-21 - libprof tests freeze (no crash)
- missing instruction macw in CPU parallelism
Destiny by Dodormeur 🟠 Usable fx9860g_sh4 2025-09-03 - missing %118 Timer_Install support
EditeurHexa by Lephenixnoir 🟠 Usable fxcg50 2026-02-21 - missing support to Bfile_GetPos()
- weird behaviour with empty folder
IpodDextris by Kirafi 🟠 Usable fx9860g_sh4 2026-02-21 - too fast, use the throttle with 120FPS
Demineur winXP by Smashmaster 🟀 Frame fxcg50 2026-02-21 - fxcg50 port
- First game work, but second game (first click) crash (double fault)
Mario land ce by Bebe-vador 🟀 Frame fx9860g_sh3 2026-02-21 - first frame of the game
- missing support for %3ed Interrupt_SetOrClrStatusFlags()
OrtonSH4 by PierrotLL 🟀 Frame fx9860g_sh4 2026-02-21 - stuck with the splash-screen
Hard game by PierrotLL 🟀 Frame fx9860g_sh4 2025-08-28 - stuck with the splash-screen
DarkLaby by LouLoux 🟀 Frame fx9860g_sh4 2026-02-21 - missing support for %118 Timer_Install()
FruitNinja by Dark Storm 🟀 Frame fx9860g_sh4 2026-02-21 - freeze after save loading
Sudoku solver by Lancelot ⚫ Nothing fxcg20 2025-08-21 - Prizm
- missing %d39 syscall support
Flappy bird color by Lancelot ⚫ Nothing fxcg20 2026-02-21 - version fxcg50 (Lephenixoir)
- missing %d39 KeyBoard_PRGM_GetKey() syscall support
Cgsnake by Eiyeron ⚫ Nothing fxcg20 2026-02-21 - Prizm
- Do not crash, just display nothing
Falldown colors by Dodormeur ⚫ Nothing fxcg20 2025-08-21 - Use PRIZM VRAM area
Obliterate by planetcasio ⚫ Nothing fxcg20 2026-02-21 - Prizm
- missing support of %12b FKey_map() syscall
Life game cg-20 by Smashmaster ⚫ Nothing fxcg20 2025-08-21 - Prizm
- black screen
- Use PRIZM VRAM area
Tetrizm by Planetcasio ⚫ Nothing fxcg50 2026-02-21 - CG50 port
- missing support for %12b to boot
OpenJazz by Programmern ⚫ Nothing fxcg50 2026-02-21 - fxcg50 official port(?)
- missing syscall %1b0b GetVRAMWorkBuffer() to boot
- missing syscall %921 EnableColor() to boot
- missing syscall %2a3 FrameColor() to boot
- missing syscall %18f9 PrintXY() to boot
FlappyBird by Dark storm ⚫ Nothing fx9860g_sh4 2026-02-21 - missing %d39 GetKey() syscall support
Doodle jump by Kevkevvtt ⚫ Nothing fx9860g_sh3 2026-02-21 - SH3 with RevolutionFX
- execution crash
Ball game by PierrotLL ⚫ Nothing fx9860g_sh3 2026-02-21 - missing syscall %24c Keyboard_IsSpecialKeyDown()
- need SH3 timer support
Atlantis by Lephenixnoir ⚫ Nothing fx9860g_sh4 2026-02-21 - missing %840 MCSGetDlen2() syscall support
IpodFall by Kirafi ⚫ Nothing fx9860g_sh4 2026-02-21 - Instant crash after many invalid read
- any version of the addin crash

About

SuperH emulator for CASIO devices

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors