ocornut / meka Goto Github PK
View Code? Open in Web Editor NEWMEKA - Sega 8-bit emulator with debugging/hacking tools
Home Page: http://www.smspower.org/meka
MEKA - Sega 8-bit emulator with debugging/hacking tools
Home Page: http://www.smspower.org/meka
Where can I find the latest binary?
Or (easily) buildable Mac source?
Just a heads up that the current release (Meka 2019-12-13) of Meka is getting flagged by windows defender as malware. Maybe you can submit the executable to them for analysis? I assume/hope it's just a false positive.
It's nice that compiling for FreeBSD has been fixed, but there's something very wrong with the tiles viewer, tilemap viewer and even the background on some of the themes. The following screenshot is using the ninja gaiden theme. The themes with the grid background are rendered correctly, but there's no way to get the tiles viewer and tilemap viewer to work.
I can test patches or send any debugging info needed.
It seems the TV type setting does not work for the ColecoVision. In the ColecoVision BIOS, the byte at 0x69 contains the frequency of the vertical retrace interrupt. Reading this byte always gives 60 in Meka, even though it should be 50 when the emulation is set to PAL/SECAM.
Philipp
https://www.virustotal.com/gui/file/bef1057e26ca839e07e32e64c5c96e6022f43b948300badccc87c35bbcb413da
24 security vendors flagged this file as malicious.
Latest release : https://github.com/ocornut/meka/releases/tag/meka-20210726
I understand that this is a false positive, but the search engines will pessimize the smspover.org website and this repository too. Need to do something.
I tried following the instructions here for building Allegro and MEKA from source:
https://github.com/ocornut/meka/wiki/Building-on-ubuntu-linux
I build liballegro from git, sudo cmake, sudo make, sudo make install, and sudo ldconfig
Looks like that all runs fine.
When I try to compile Meka it has lots of undefined references to al_draw_bitmap, al_flip_display, etc (all the allegro functions, there are pages and pages of them). So it's not picking up the allegro library, which is all sitting in /usr/local/lib.
I can try sudo apt-get install liballegro5-dev, it works and will compile, but silently crashes with no error on loading the msg file, running from the same directory with it. So I removed it and just rebuilt allegro from source again, Meka won't compile though, looks like it can't find the allegro libs for some reason.
Am I missing anything?
UPDATE: I managed to get Meka to compile by copying the files in the pkg-config dir under /usr/local/lib from 5 to 5.0 (i.e. liballegro-5.pc to liballegro-5.0.pc). Still getting GL errors (0x501) but that may be related to RetroPie's driver implementation.
Only the PSG is written to the file. I think it'll be a bit painful to do...
Some of the timings seem to be wrong, for example ld a,ixh
. Possibly due to Marat's core being based on MSX timings. MAME timings are probably correct.
When loading a .sc file, Meka emulates 32 KB of RAM, mapped once (at 0x8000). However, AFAIK, the SC-3000 has just 2 KB of RAM mapped four times (at 0xc000, 0xc800, 0xd000, etc), similar to the ColecoVision.
Philipp
The unmodified Sonic's Edusoft rom will fail to run under pretty much all of the emulators safe for the ones that require a BIOS and do not manually set the VDP bits.
According to Bork here http://www.smspower.org/forums/9109-UnreleasedTiertexGameSonicEdusoft, setting VDP Register 1 to 0xA0 will allow the game to boot and i can confirm that it does fix it.
(It also fixes it on other unrelated emulators like SMS Plus)
He did comment and say that someone should check the value all the BIOSes out there set that bit to.
Since i was working on my fork of SMS Plus GX to fix that issue, naturally i did.
Also somewhat unrelated but MEKA sets the VDP registers back to default values, regardless of the BIOS you are using.
VDP Register 1 with the following BIOSes (Tested under SMS Plus GX, as i couldn't get most of the BIOSes below to boot a game on MEKA, bar the one that comes with it...):
Prototype BIOS v1.0 (1986)
626b3453613e43d5a47908a8944ba583 SMS Prototype (v1.0) [Proto] [BIOS].sms
0x80, 0xc0 then 0xe0
US/European BIOS v1.3 (1986)
840481177270d5642a14ca71ee72844c bios13fx.sms
0xa0 then 0xe0
US/European BIOS v2.4 with Hang On and Safari Hunt (1988)
02cbb2e348945c9ac41e37502a58ca76 HSHBIOS.sms
0xa0 then 0xe0
US/European BIOS with Alex Kidd in Miracle World (1990)
e8b26871629b938887757a64798df6dc akbios.sms
0xa0 then 0xe0
European BIOS with Sonic The Hedgehog (1991)
4187d96beaf36385e681a3cf3bd1663d SONBIOS.sms
0x80 then 0xc0
(It fails to boot Sonic's Edusoft but it can boot other games. It's stuck on the Sega logo. Checksum failure ?)
Korean Samsung Gam*Boy/Aladdin Boy II BIOS with Alex Kidd in Miracle World
e49e63328c78fe3d24ae32bf903583e0 Alex Kidd in Miracle World [BIOS] (KR).sms
0x0 for a while, 0xa0, then 0xe0
Seems to be consistently 0xE0 and i can confirm setting VDP Register 1 to 0xE0 does allow the game to boot.
Why was it set to 0x80 ? SG-1000 stuff ? Megadrive perhaps ?
The only time i see it is during early bootup on most BIOS revisions
but even then, not all of them do that.
Looking at the documentation related to the VDP left me empty handed.
start_in_gui = 0 "no work"
In the old version like meka-2015-05-06-win32-proto, if it works
In mode 2, Meka uses the mask derived from the lower bits of the pattern table register both for the pattern table and the color table. But AFAIK for the TMS99* the color table uses a separate mask derived from the lower bits of the color table register.
I guess this could be fixed by having a separate mask for the color table in Display_Background_2 in https://github.com/ocornut/meka/blob/master/meka/srcs/video_m2.c
I do not know how the SMS1 VDP behaves in that respect.
Philipp
i dont know if this is and emu problem or settings as i find 0 settings to change anything about video at all
I’ve been experimenting with Allegro’s resizable window support and got something working with some bugs. PR to come when they are fixed.
https://www.smspower.org/forums/13019?start=350#111352
I updated from version 0.73 to 0.8 and now I have a problem with the # key in debugger on a french keyboard under the debugger.
To do this key on french kb you must press [ALT GR] + [3] but no effect only undercase key value "
no possibility to do the # key with the [ALT] + 0023 (charmap)
then no breakpoint on display line with the function B line #13 ...
Setting the theme to either "Classic" or "Monochrome" will cause Meka to show a black screen unresponsive to input when it is restarted.
In this build: meka-2015-05-06-win32-proto.zip (1002.45 KB) the .cfg file is included.
If the cfg is meant to be bundled then i would suggest to use a lower resolution for the included .cfg file as 1280x960 is not a real common resolution, maybe default to 1024x768 instead.
It would be nice to be able to toggle the visibility of the overscan area in the window.
(this is a feature request)
When loading a .sg file, Meka emulates 4 KB of RAM, mapped twice (at 0xc000 and 0xd000). However, AFAIK, the SG-1000 has just 1 KB of RAM mapped eight times (at 0xc000, 0xc400, 0xc800, etc), similar to the ColecoVision.
Philipp
I cannot find any documentation on how to make Meka emulate a certain machine. From trying, it seems, .rom files are considered ColecoVision binaries and .sms files are considered Sega Master System files, but I'm not sure if that is true, or maybe Meka detected the ColecoVision header in my .rom file instead. On smspower.org someone suggested .sc when I asked for SG-1000 and SC-3000 emulation. But I have no idea if that is true (and from the lack of memory address aliasing, it probably is not).
Meka documentation should clearly state how to make Meka emulate a particular machine.
Philipp
Long overdue.
Where to put/config bios files?
Currently enabling keyboard emulation disable joystick emulations.
Those could work together on the same time if the other has gamepad plugged in.
Would facilitate the use of SC-3000 software which often alternate between the two.
I use meka 0.80-alpha 0e59470 on Debian GNU/Linux.
In the "Load ROM dialog", non-ASCII characters in filenames appear as squares.
Philipp
Have there been any discussions to a potential SDL port? I am not quite familiar with all the inner workings of MEKA yet (although I was an avid user back in the early 00s when I was in "the scene"), so I don't know what MEKA relies on in terms of the Allegro libs.
Whilst I like Allegro - it was my lib of choice for years, SDL is much more widely supported on many platforms, the most exciting of which being html/javascript, so we could see MEKA running in a browser, and I think that would be pretty awesome. I've got quite a bit of experience in that, so that's something I could assist with.
I'll take a look at the code whilst waiting for a reply
Would it be possible to implement something like paste & copy?
My aim is to preserve listings from magazines by typing them in.
Another oddity:
As an example, I typed a little "Hello world" within Level III Basic and saved it.
All seemed to work good, because it prompted something like "Starting to save -- and then save ended" or so but the program was nowhere to find. Did I do something wrong?
For a long time now I've dreaded playing Ninja Princess on this emulator, that is because every single time I load it into the emulator, the program will either crash or even worse, give me computer a blue screen.
I've heard that it might have something to do with the rom file size, which is 32kb. It seems to be the correct file size according to Sega Retro.
I should also say that every other emulator I've ran it with runs it perfectly fine, so I definitely know it's the emulator's issue.
Thanks for Meka... I hadn't used it in over a decade, found the website with a recent-ish update, then came here and only just realised you are the ImGUI guy :)
I didn't use meka for quite some time. This was likely the first time I tried it under Fedora 33/x86_64.
Most of the times I start meka-20210726 I get a segmentation fault.
Backtrace:
Thread 1 "meka" received signal SIGSEGV, Segmentation fault.
0x00007ffff7a13ab5 in __memcpy_ssse3 () from /lib64/libc.so.6
(gdb) bt
#0 0x00007ffff7a13ab5 in __memcpy_ssse3 () from /lib64/libc.so.6
#1 0x00007fffe460d16e in st_TexSubImage () from /usr/lib64/dri/nouveau_dri.so
#2 0x00007fffe479fbd7 in texture_sub_image ()
from /usr/lib64/dri/nouveau_dri.so
#3 0x00007fffe47a2e9c in texsubimage_err () from /usr/lib64/dri/nouveau_dri.so
#4 0x00007fffe47a8ac9 in _mesa_TexSubImage2D ()
from /usr/lib64/dri/nouveau_dri.so
#5 0x00007ffff7f07742 in _al_ogl_unlock_region_new ()
from /lib64/liballegro.so.5.2
#6 0x00007ffff7e87f73 in al_unlock_bitmap () from /lib64/liballegro.so.5.2
#7 0x0000000000440054 in TileViewer_Update (app=<optimized out>)
at app_tileview.cpp:226
#8 gui_update_applets () at g_update.cpp:49
#9 0x0000000000415a4d in Video_RefreshScreen () at video.cpp:436
#10 0x000000000041c6fd in Main_Loop_No_Emulation () at mainloop.cpp:108
#11 Main_Loop () at mainloop.cpp:68
#12 0x0000000000408465 in main (argc=<optimized out>, argv=<optimized out>)
at meka.cpp:434
I also downgraded to meka-20191213 and I have the same behaviour.
Meka.apk 20191218
My Phone Android 12
It was updated by infinitesimalau on 20200402
and paulc-fugro on 20200424
#53
It should support 64-bit hardware
But I can only get a 32-bit old version build
if someone can help porting to gnu/linux, and perhaps packing as .deb for Debian/Ubuntu/PPA repositories, please do! :)
If I keep the Palette tool open, its vertical size will increase (probably one pixel?) each time I close and open the emulator.
I'm running on Linux, not sure if this is Linux related anyway.
If I have some text in ROM like %1
then this messes up the debugger MEM
dump:
0520-0527 | 21 54 68 65 20 73 74 72 | !The str
0528-052F | 69 6E 67 20 69 6E 20 56 | ing in V
0530-0537 | 52 41 4D 20 73 61 79 73 | RAM says
0538-053F | 3A 20 25 73 6D 62 00 10 | : p..
0540-0547 | 0A 00 21 21 05 CD F7 06 | ..!!....
0548-054F | 18 1F 54 68 65 20 66 69 | ..The fi
0550-0557 | 66 74 68 20 63 68 61 72 | fth char
0558-055F | 61 63 74 65 72 20 69 73 | acter is
0560-0567 | 20 25 61 6D 62 D7 06 0A | 0x1.9f7940019f788p-1022mb...
0568-056F | 00 21 4A 05 CD F7 06 18 | .!J.....
0570-0577 | 02 0A 00 21 71 05 CD F7 | ...!q...
0578-057F | 06 18 0E 44 61 74 61 20 | ...Data
0580-0587 | 73 6F 75 72 63 65 73 0A | sources.
0588-058F | 00 21 7B 05 CD F7 06 21 | .!{....!
0590-0597 | AA 55 22 01 C0 3E 00 D3 | .U"..>..
0598-059F | BF 3E 40 D3 BF 3E 76 D3 | .>@..>v.
The % is at $53a. Presumably this is being passed to printf
in an unsafe way..?
As you can see in the pic below the words "Português", "Français" and "Español" arent correctly displayed at startup. From what i saw in the emu window itself the translation is applied correctly.
This also can be seen in the console, pic below:
The text doesnt fit in the buttons in the left bottom of the Load Rom screen.
I also found that the options window is too small and the translation doesnt fit, see the line before the last one:
It would be good if all windows in the GUI auto-resized themselves to fit the translations since words/phrases in other languages than english sometimes have bigger lenghts.
A problem with the binary in this release: https://github.com/ocornut/meka/releases/tag/meka-20191213
mekaw.exe is identified as a trojan virus by Windows Defender or Windows Security Essentials
Windows Defender identifies it as: Trojan:Win32/Fuery.B!cl
Windows Security Essentials identifies it as: Trojan:Win32/Wacatac.C!ml
If this is a false positive result, is there some problem with the way the executable is packed?
Meka mixes Game Gear stereo down to mono. I think it needs to treat all audio as stereo, extending up to stereo for YM2413.
I had a go at doing it myself but fell down at the Allegro/audio buffering parts, where we need to multiply or divide some numbers by 2 to get the right result.
Sega Genesis controllers can be used on a master system. I'd like to see both the 3-button and 6-button version in the "Input Configuration" dialog.
Many, but not all SMS games just work with the Genesis controllers. Correctly emulating them would also allow game authors to check that their games work ok with Genesis controllers, or even allow authors to test games that use the extra buttons for gameplay.
Philipp
Everytime i launch the latest build, this error pops up.
Failed!
Error loading image: "cursor_main.tga"
Following discussion on
http://www.smspower.org/forums/15120-MEKANeedsAMacOSXDeveloperMaintainer
cc: @blind
blind's fork is
https://github.com/blind/meka/tree/feature-macosx
Sorry I didn't have time to look at it. I'd really like to move that forward.
The reason I included binaries for Windows is that it is such a nightmare to compile anything under Windows. However my intuition was that OSX had good-enough packaging system that you could grab Allegro from somewhere? Just curious.
If you have installed a version of allegro5 > 5.0 (for example, in Fedora 24 there is allegro5-5.2.0), the linking will fail.
You can fix this with the following command:
sed -i 's/pkg-config --cflags --libs allegro-5.0 allegro_image-5.0 allegro_audio-5.0 allegro_font-5.0 allegro_primitives-5.0 allegro_ttf-5.0/pkg-config --cflags --libs allegro-5 allegro_image-5 allegro_audio-5 allegro_font-5 allegro_primitives-5 allegro_ttf-5/' srcs/Makefile
The games with mapper 11 ( described as : no mapper, ROM up to 48KB (typically 32KB) ), for instance Magical Kid Wiz, appear to be requiring 8Kb of ram. The games are however listed with type SG1. SG1000 has 1Kb ram, SC3000 has 2Kb ram, so they do not work unless the system is emulated with an incorrect amount of ram.
Either the description for mapper 11 may be changed or the system of the games may be changed to SMS .
I was trying out the Mekaw .80 and when I clicked on the .exe file it would tell me that it could not find the meka.msg file.
I had also tried earlier version of Mekaw such as .73 and that one said it could not find the audiow32.dll. Ironically the files seem to be there. I do not know if I am not installing it properly. I had used earlier version a few years ago and it worked quite well.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.