BlastEm 0.4.0 - Now with GUI, improved debugger and more

Talk about development tools here

Moderator: BigEvilCorporation

Mask of Destiny
Very interested
Posts: 615
Joined: Thu Nov 30, 2006 6:30 am

BlastEm 0.4.0 - Now with GUI, improved debugger and more

Post by Mask of Destiny » Tue May 03, 2016 7:49 am

Hello folks,

I've finally put together a new release of BlastEm. This one finally features a basic GUI though it is a rather eccentric one. The UI is actually a Genesis ROM running inside the emulator with some "custom hardware" to provide access to things like directory listings and certain emulator functionality. There will probably be a real UI at some point, but this was a fun little experiment.

The integrated 68K debugger has two new commands 'co' and 'di'. 'co' allows you to run a list of debugger commands whenever a particular breakpoint is hit. 'di' allows you to print a certain register/location before each debugger prompt (the Z80 debugger already had this previously).

There are a ton of accuracy improvements and bugfixes. Big thanks to Eke and Nemesis for their documentation/tests/notes.

I've had a report that GDB remote debugging is not working with GDB 7.11, but I haven't had a chance to investigate. Expect a fix soon.

You can see the full changelog and download links here.

Sik
Very interested
Posts: 939
Joined: Thu Apr 10, 2008 3:03 pm
Contact:

Re: BlastEm 0.4.0 - Now with GUI, improved debugger and more

Post by Sik » Tue May 03, 2016 9:06 pm

The biggest problem with such an approach is that it can't provide any functionality once a game has been loaded. Still, keeping this thing around maybe could be useful for building other tools on top that could make some use of the emulation.
Sik is pronounced as "seek", not as "sick".

Mask of Destiny
Very interested
Posts: 615
Joined: Thu Nov 30, 2006 6:30 am

Re: BlastEm 0.4.0 - Now with GUI, improved debugger and more

Post by Mask of Destiny » Tue May 03, 2016 9:48 pm

Sik wrote:The biggest problem with such an approach is that it can't provide any functionality once a game has been loaded.
It can. Hit the escape key and the display switches back to the menu without unloading the game. Currently, the "pause" menu lets you save and load savestates or switch to another game. At the moment it's not possible to actually run both the UI ROM and the game ROM simultaneously (though making that work isn't totally impossible), but apart from debugger windows I'm not sure how desirable that is anyway.
Sik wrote:Still, keeping this thing around maybe could be useful for building other tools on top that could make some use of the emulation.
That's an interesting idea. I had thought about expanding the "hardware" exposed to the menu a little so it could support things like playing VGM files, but authoring tools for the Genesis/Megadrive are something I hadn't really considered.

panzeroceania
Interested
Posts: 27
Joined: Sat Sep 12, 2009 4:02 am
Location: Salem, OR

Re: BlastEm 0.4.0 - Now with GUI, improved debugger and more

Post by panzeroceania » Sun Jul 17, 2016 9:26 pm

Great job on this release! I just found out about BlastEm and am really impressed with the performance and game compatibility and look forward to future updates. I had no issues with my favorite games, but I decided to boot up a bunch of different titles to give the emulator a test drive like I do when I first use a lot of emulators. I found a few issues with booting some games that I'll post below.

Madden NFL 98 (USA).md

Code: Select all

Fatal Error

Illegal read from PSG port 14
Phelios (Japan).md

Code: Select all

Fatal Error

unimplemented Z80 instruction: daa at 10C4
Z80 RAM has been saved to zram.bin for debugging
Power Monger (Japan, Korea).md

Code: Select all

Fatal Error

unimplemented Z80 instruction: otir at 67
Z80 RAM has been saved to zram.bin for debugging
Prince of Persia 2 - The Shadow and the Flame (Europe) (Proto).md

Code: Select all

Fatal Error

unimplemented Z80 instruction: otir at 848
Z80 RAM has been saved to zram.bin for debugging
Sonic Crackers (Japan) (Proto).md

Code: Select all

BlastEm Info

Read from VDP data port while writes are configured, CPU is now frozen. VDP Address: 4, CD: 5
I also have a list of games that when you try to open them, will cause BlastEm to freeze for various reasons, some probably being due to save format, others possibly to the region of the game, etc.

Wonder Boy V - Monster World III (Japan, Korea).md -- hangs at title screen, likely because of eeprom save
Wonder Boy in Monster World (USA, Europe).md -- hangs at title screen, likely because of eeprom save

Alisia Dragoon (Japan).md
Alisia Dragoon (USA).md
Alisia Dragoon (Europe).md

Greatest Heavyweights (Japan).md
Greatest Heavyweights (USA).md
Greatest Heavyweights (Europe).md


Paperboy 2 (USA, Europe).md
Zombies Ate My Neighbors (USA).md
Daikoukai Jidai II (Japan).md
Dragon Slayer - Eiyuu Densetsu (Japan).md
Dragon Slayer - Eiyuu Densetsu II (Japan).md
Gambler Jiko Chuushinha - Katayama Masayuki no Mahjong Doujou (Japan).md
J. League Pro Striker Perfect (Japan).md
Janou Touryuumon (Japan).md
Langrisser II (Japan).md
Hybrid Front, The (Japan).md
Madou Monogatari I (Japan).md
Nobunaga no Yabou - Haouden (Japan).md
Super Daisenryaku (Japan).md
Advanced Daisenryaku - Deutsch Dengeki Sakusen (Japan) (Rev A).md
Twinkle Tale (Japan).md
Yu Yu Hakusho Gaiden (Japan).md
Zan Yasha Enbukyoku (Japan).md

Mask of Destiny
Very interested
Posts: 615
Joined: Thu Nov 30, 2006 6:30 am

Re: BlastEm 0.4.0 - Now with GUI, improved debugger and more

Post by Mask of Destiny » Mon Jul 18, 2016 6:37 am

Thanks for the kind words. Someone just told me about Madden 98 and Power Monger the other day, but some of the others are new to me so the report is very much appreciated. There are legitimately some Z80 instructions that aren't yet implemented, though at this point it's only ones that aren't useful on the Genesis/MD. On my TODO list, but lower priority than genuine compatibility problems. If these games are actually using DAA and OTIR that obviously bumps those up on the priority list, but I'm guessing there's a problem elsewhere that's causing them to jump to garbage. I'll have to dig in to see what's actually going on.
panzeroceania wrote:Wonder Boy in Monster World (USA, Europe).md -- hangs at title screen, likely because of eeprom save
This is embarrassing. I actually added this game to my ROM DB and had it working, but somehow I managed to remove it when I was making some other change. Thanks for catching this.
panzeroceania wrote:Zombies Ate My Neighbors (USA).md
This is a regression caused by a failed attempt at using the "domestic" name if the "international" name is empty. I thought I had tested it before the 0.4.0 release, but I obviously didn't since it causes a crash whenever that code path gets hit. I suspect this is also what's causing at least some of those Japanese games to fail as they often don't have the domestic name field populated. I fixed this a little while back, but I've been procrastinating on a point release as there's a couple of other things I wanted to fix first.

Mask of Destiny
Very interested
Posts: 615
Joined: Thu Nov 30, 2006 6:30 am

Re: BlastEm 0.4.0 - Now with GUI, improved debugger and more

Post by Mask of Destiny » Mon Jul 18, 2016 6:50 am

panzeroceania wrote: Sonic Crackers (Japan) (Proto).md

Code: Select all

BlastEm Info

Read from VDP data port while writes are configured, CPU is now frozen. VDP Address: 4, CD: 5
I took a quick peek in the Genesis Plus GX source tree (Eke Eke is good about leaving comments mentioning problematic games that depend on quirky behavior) and I found this in the HISTORY file:
* added 'Force DTACK' option for prototype games usually hanging on real hardware (example: Sonic Crackers)
Apparently this proto does actually lock up the CPU when run on real hardware so this is not a bug per se.

Sik
Very interested
Posts: 939
Joined: Thu Apr 10, 2008 3:03 pm
Contact:

Re: BlastEm 0.4.0 - Now with GUI, improved debugger and more

Post by Sik » Mon Jul 18, 2016 7:35 am

Note that if I recall correctly the PSG can be accessed through a port (don't remember which one) so that may be a legitimate use of OTIR (setting all values for all four channels would take up 11 writes - suddenly OTIR starts looking attractive, doesn't it?).
Sik is pronounced as "seek", not as "sick".

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Re: BlastEm 0.4.0 - Now with GUI, improved debugger and more

Post by Stef » Mon Jul 18, 2016 8:30 am

PSG accessible through a port ? not in Genesis mode at least. On Gens port instructions are not connected and as far i can tell no game relies on them.

Mask of Destiny
Very interested
Posts: 615
Joined: Thu Nov 30, 2006 6:30 am

Re: BlastEm 0.4.0 - Now with GUI, improved debugger and more

Post by Mask of Destiny » Mon Jul 18, 2016 6:59 pm

Here's what Charles MacDonald's doc has to say about IO ports in Genesis mode:
All I/O ports return FFh, and writing to them has no effect. The Thunder
Force games read port BFh in the IRQ subroutine, this would appear to be
a misunderstanding on the programmer's behalf.
I have not personally done any testing to this effect, but I haven't seen any reason to doubt it either.

panzeroceania
Interested
Posts: 27
Joined: Sat Sep 12, 2009 4:02 am
Location: Salem, OR

Re: BlastEm 0.4.0 - Now with GUI, improved debugger and more

Post by panzeroceania » Mon Jul 18, 2016 8:37 pm

Yeah, I figured with the prototype that there was likely a problem with the game itself, not the emulator. I thought I would just post them anyways since they gave a specific crash report, so at the very least you would be aware of the bug in the game.

Also the previous reports on Twitter were me, I'm @TimNetwork

Mask of Destiny
Very interested
Posts: 615
Joined: Thu Nov 30, 2006 6:30 am

Re: BlastEm 0.4.0 - Now with GUI, improved debugger and more

Post by Mask of Destiny » Mon Jul 18, 2016 11:11 pm

panzeroceania wrote:Yeah, I figured with the prototype that there was likely a problem with the game itself, not the emulator. I thought I would just post them anyways since they gave a specific crash report, so at the very least you would be aware of the bug in the game.
The report is indeed appreciated.
panzeroceania wrote:Also the previous reports on Twitter were me, I'm @TimNetwork
Ah, I was wondering if that was the case given the overlap, but didn't want to assume.

King Of Chaos
Very interested
Posts: 273
Joined: Fri Feb 29, 2008 8:12 pm
Location: United States

Re: BlastEm 0.4.0 - Now with GUI, improved debugger and more

Post by King Of Chaos » Tue Jul 19, 2016 10:51 am

Hey MoD, nice work on this emulator! Anyways, I'm getting this error when attempting to run on the latest Windows 10 Insider Preview (which is either pre-RTM or is the RTM of the Anniversary Update);

Image

And...

Image

Looks like it's looking for/expecting a Linux directory, not a Windows directory.

Also, it looks like the file browser is limited to the OS drive (in Windows' case) and can't selected other drives (where the ROM files are).

panzeroceania
Interested
Posts: 27
Joined: Sat Sep 12, 2009 4:02 am
Location: Salem, OR

Re: BlastEm 0.4.0 - Now with GUI, improved debugger and more

Post by panzeroceania » Tue Jul 19, 2016 5:53 pm

I can reproduce this same issue on Windows Vista. As stated, likely a forward slash, backward slack issue.

Mask of Destiny
Very interested
Posts: 615
Joined: Thu Nov 30, 2006 6:30 am

Re: BlastEm 0.4.0 - Now with GUI, improved debugger and more

Post by Mask of Destiny » Tue Jul 19, 2016 7:43 pm

King Of Chaos wrote:Looks like it's looking for/expecting a Linux directory, not a Windows directory.
A dirty little secret is that Windows actually supports Unix-style directory separators and I've been abusing this since the first Windows release (though 0.4.0 does more path manipulation than previous versions) . 0.4.0 actually cleaned this up a bit, but there are still some remnants I need to fix. I should probably also create these in something like "Application Data" on Windows, rather than the Unixy .local/share. Not sure why the directory creation failed though. Were any of the intermediate directories created?
panzeroceania wrote:I can reproduce this same issue on Windows Vista. As stated, likely a forward slash, backward slack issue.
I did test this on my Windows 10 box at some point. I'll have to test again with the existing save directories deleted to see if I broke it at some point or whether this issue is environment specific.
King Of Chaos wrote:Also, it looks like the file browser is limited to the OS drive (in Windows' case) and can't selected other drives (where the ROM files are).
To be somewhat pedantic, it's limited to whatever drive the starting path is on. By default, this path is your home directory, but you can change it by setting the "initial_path" value in the "ui" section of the config file. I'd like to fix this for 0.4.1, but getting a list of drives is somewhat annoying on non-Windows platforms and I don't like to add Windows-only features if I can avoid it.

Mask of Destiny
Very interested
Posts: 615
Joined: Thu Nov 30, 2006 6:30 am

Re: BlastEm 0.4.0 - Now with GUI, improved debugger and more

Post by Mask of Destiny » Wed Jul 20, 2016 5:01 am

Deleted the save directory tree on my Windows test box and I can indeed reproduce the error. The Windows version of a function I wrote for recursively creating a directory had a bug that would cause it to fail in some cases when the path contained a mix of Windows-style and Unix-style path separators. This is now fixed in the repository. I'll definitely put out a point release this weekend since this breaks save state and SRAM/EEPROM functionality on Windows unless you manually create the .local\share\blastem folder in your home directory.

Post Reply