David Haywood's Homepage
MAME work and other stuff

Not 33

December 23, 2017 Haze Categories: General News. 14 Comments on Not 33

Morten and Peter managed to dump the internal rom of Dodonpachi Daioujou Tamashii, a Chinese release of Dodonpachi Daioujou on PGM2 hardware that offers an ‘easy’ mode.

extracting this one was more difficult (I’ll update this post / do a new post explaining why later)

unfortunately for now it also appears to expose some more bugs in the MAME ARM core, these are being looked into, but basically a lot of the sprites end up with a value of ‘0’ for palette selection instead of the correct value causing them to be rendered with incorrect colours. There are no additional video attributes being set so it seems logical to conclude it’s a CPU emulation problem at this stage.


Dodonpachi Daioujou Tamashii Dodonpachi Daioujou Tamashii
Dodonpachi Daioujou Tamashii Dodonpachi Daioujou Tamashii
Dodonpachi Daioujou Tamashii Dodonpachi Daioujou Tamashii
Dodonpachi Daioujou Tamashii Dodonpachi Daioujou Tamashii

Yes, the service mode really renders at the wrong orientation, bit lazy considering they didn’t have a bios to worry about and all the code is on the game boards.

*edit* MetalliC traced down the ARM CPU core bug and fixed it, resulting in correct colours. This also potentially improves things in the GBA driver. This fix might not make 0.193 as it missed the deadline, so unless those in charge of the release decided that it’s important the 0.193 version will have broken colours shown above instead. *edit* Looks like the progress to fix the colours will be in 0.193, unless it gets backed out again at the last minute.


Dodonpachi Daioujou Tamashii Dodonpachi Daioujou Tamashii

.. and a video of it running in MAME



Go to article.. »

The King of Fighters ’98: Ultimate Match HERO (PGM2)

December 13, 2017 Haze Categories: General News. 30 Comments on The King of Fighters ’98: Ultimate Match HERO (PGM2)

Here are the first Work in Progress shots from The King of Fighters ’98: Ultimate Match HERO after Morten Shearman Kirkegaard and Peter Wilhelmsen dumped the internal rom.

They show that the PGM2 emulation still needs work, especially with a missing sprite enable register and screen resolution control. There is also no music at the moment, and a hardlock in attract mode.


King of Fighter 98 Ultimate Match Hero
King of Fighter 98 Ultimate Match Hero
King of Fighter 98 Ultimate Match Hero
King of Fighter 98 Ultimate Match Hero
King of Fighter 98 Ultimate Match Hero
King of Fighter 98 Ultimate Match Hero
King of Fighter 98 Ultimate Match Hero
King of Fighter 98 Ultimate Match Hero
King of Fighter 98 Ultimate Match Hero

*edit* fixed various bugs, made a video. sound is still incorrect but being worked on.




*edit2* MetalliC improved the sound emulation, it should be good now



Some pictures for the non-videoy people

King of Fighters 98 Ultimate Match Hero King of Fighters 98 Ultimate Match Hero
King of Fighters 98 Ultimate Match Hero King of Fighters 98 Ultimate Match Hero
King of Fighters 98 Ultimate Match Hero King of Fighters 98 Ultimate Match Hero
King of Fighters 98 Ultimate Match Hero King of Fighters 98 Ultimate Match Hero
King of Fighters 98 Ultimate Match Hero King of Fighters 98 Ultimate Match Hero
King of Fighters 98 Ultimate Match Hero King of Fighters 98 Ultimate Match Hero
King of Fighters 98 Ultimate Match Hero King of Fighters 98 Ultimate Match Hero
King of Fighters 98 Ultimate Match Hero King of Fighters 98 Ultimate Match Hero
King of Fighters 98 Ultimate Match Hero King of Fighters 98 Ultimate Match Hero
King of Fighters 98 Ultimate Match Hero King of Fighters 98 Ultimate Match Hero
King of Fighters 98 Ultimate Match Hero King of Fighters 98 Ultimate Match Hero

This progress will be in MAME 0.193

*edit* Further bug fixes to the audio, stage music doesn’t play over intro if left in attract now.



Go to article.. »

PGM2 (Oriental Legend 2) card use

December 11, 2017 Haze Categories: General News. 35 Comments on PGM2 (Oriental Legend 2) card use

The PGM2 system allowed for use of Memory Cards (supplied by the arcade, specific to each game / region) in order to save Character progress. Each card allows for a limited number of saves (500?) but allows you to store items, XP and money your character has acquired and reuse them between playthroughs. For the 0.193 release (or current GIT code) this is supported.

The English language version of Oriental Legend 2 does NOT have this feature (and the game is rebalanced to not require it) however the Chinese version does use it, so knowing how to use it in MAME makes sense.

Anyway, using it…

Once you get to the character select screen you’ll be presented with a 10 second timer to insert a memory card. It’s recommended you pause MAME at this point (with p)

It’s worth noting that without a memory card the bottom 2 characters are locked,you can’t move the cursor over them without inserting a memory card.

Oriental Legend 2

Bring up the tab menu, go to File Manager

Oriental Legend 2

from filemanager select ‘memcard1’

Oriental Legend 2

and from the next menu select ‘create’ as this will allow us to create a blank (default) memory card

Oriental Legend 2

Type in the name of your new memory card, with a “.pg2” extension (I used oriental2.pg2) (note, MAME is silly, so pressing p when typing pg2 will actually unpause it, so don’t take too long here)

Oriental Legend 2

Select ‘Create’

Oriental Legend 2

and you’ll see that the memory card is inserted in memcard slot 1. You can now close the menu with tab

Oriental Legend 2

and choose your character (I chose the bottom left one that is now unlocked)

Oriental Legend 2

you can now enter a name, I’m not actually sure how this screen works as it’s all very Chinese.

Oriental Legend 2

you’ll see that you start the game as level 0, with 1500 gold.

Oriental Legend 2

so play it a little bit, level up, collect some gold etc.

Oriental Legend 2

At this point (for the purpose of our testing) allow your character to die, so that you get the Game Over message (if your character doesn’t die no progress is saved) Take note, we’re a LV01 character (progressed from LV00) and have 1521 gold pieces.

Quit MAME, reload MAME and get back to the character select screen.

You’ll be prompted with the ‘insert card’ screen you saw before, again it makes sense to pause the game here.

Bring up the tab menu, select file manager, select the first Memcard slot as before

Oriental Legend 2

This time, instead of selecting ‘create’ you should scroll down the file browser (or type the name of the filename previously used) and select that file

Oriental Legend 2

The game will take a brief moment to read the card, and tell you a value (I believe the number of writes left on the card)

Oriental Legend 2

It will then show you equipment you have etc.

Oriental Legend 2

And then you’ll be back at the game. Note, the character is ‘LV01’ (not LV00) and has 1521 gold pieces, exactly as it was left when we killed the character off earlier.

Oriental Legend 2

Knights of Valour 2 New Legend has a similar feature.

Note, the default (blank) cards have been added to the romsets, so you’ll need updated roms.
https://mamedev.emulab.it/haze/pics2017/orleg2card/blank_orleg2.zip
https://mamedev.emulab.it/haze/pics2017/orleg2card/blank_kov2nl.zip

*edit* after some new information about the actual Card Reader came to light here are the new default card images, that include some additional ‘security data’ used as unlock passwords, current GIT requires these, old 256 byte memcard images are invalid.

https://mamedev.emulab.it/haze/pics2017/orleg2card/blank_orleg2_new.zip
https://mamedev.emulab.it/haze/pics2017/orleg2card/blank_kov2nl_new.zip

Thanks to MetalliC for reverse engineering and implementing the Card Reader MCU logic.

Go to article.. »

New Legend

November 15, 2017 Haze Categories: General News. 58 Comments on New Legend

Internal Rom was dumped for Knights of Valour 2 New Legend

KOV2NL KOV2NL
KOV2NL KOV2NL
KOV2NL KOV2NL
KOV2NL KOV2NL
KOV2NL KOV2NL
KOV2NL

looks like it might need sprite zoom adding for characters in grass.

*edit* Added zooming etc. also optimized the driver, which is now faster than that stupid dangerous hack-emu too.

haven’t played much of the game to see if it crashes at all yet.

Go to article.. »

Progress Post

November 7, 2017 Haze Categories: General News. 39 Comments on Progress Post

fixed up some bugs in the ARM core, identified IRQ controller, located palette…

Warning

other layers aren’t yet emulated, but you can already see the palette uploads for what is running eg. the IGS logo
IGS Logo Palette

If you wait a while you get the ingame HUD for attract mode
HUD

located the background tilemap data, not added to video mixing yet, but can see tilemap RAM content in tilemap viewer
background

found sprite list. sprites use 1 rom for ‘mask’ (1bpp shape) and another for colour (5? bpp palette) Similar to PGM1, but not the same as the offsets to both are in the sprite list this time. hooked up the 1bpp mask data for now.
sprites
sprites
sprites
sprites
sprites
sprites

started hooking up colour data to the sprites, giving them detail, not quite right yet

sprites
sprites
sprites
sprites
sprites

worked out the slight scramble on the colour data

sprites
sprites
sprites
sprites
sprites
sprites
sprites

improved various things about the sprites, still some issues with y-flipped sprites tho
sprites
sprites
sprites
sprites
sprites
sprites

Metallic added preliminary sound, as I can’t demonstrate this in screenshots here’s a quick video

started adding in the background layer (priority still wrong) and fixed the y-flipped sprites. still the odd sprite issue (actually looks like the badly coloured sprite in the 2nd to last screenshot should just be hidden by the bg and never seen) sprite zoom not yet implemented either. Metallic also made further sound improvements.

sprites
sprites
sprites
sprites
sprites
sprites

emulated sprite priorities, fixed a few other sprite bugs. most (all?) the features of the video needed by Oriental Legend 2 are now emulated, so it’s looking pretty good. made a new video

added linescroll effects

linescroll sprites
linescroll sprites
linescroll sprites
linescroll sprites
linescroll sprites

although annoyingly the game still seems to crash at this point.. even with no hacks etc. I’ve seen videos of the hacked build doing this too, so bit of a mystery at this point, maybe another ARM bug?

linescroll

While I came up with a crude hack to work around the above crash (which probably isn’t safe) I’ve been unable to find a real solution yet, although the game is playable past this point with the hack.

PGM2 dumping is likely to resume on Wednesday, maybe having proper dumps of some of the other titles will throw more light on the issue.

Go to article.. »

Doing things properly…

November 6, 2017 Haze Categories: General News. 6 Comments on Doing things properly…

Morten Shearman Kirkegaard and Peter Wilhelmsen built an FPGA based board that plugs into the program ROM socket on a PGM2 board.

Doing this allows direct control over what the IGS036 CPU reads, and allows us to monitor all bus signals to and from the external ROM.

The hardware setup they created looks like this


PGM2 hardware setup

With this, and existing knowledge of the encryption scheme they were able to modify the code running on the board while it was running, thus allowing their own code to be injected. Code was added to read the internal ROM space at 0x0000 to 0x3fff, as we didn’t know how the video hardware worked at this point the value read was then used as an offset to read into external rom, the bus signals were monitored meaning we could translate our external rom read offset back into the byte value for each address in the internal rom. This proved successful. Surprisingly, unlike the later PGM1 games there wasn’t even an Execute Only area on the PGM2 CPU being read (Oriental Legend 2) so they managed to get a complete dump.

All the actual dumping was done without the PGM2 board hooked up to monitor / display, but instead simply by looking at what the FPGA was sending back. (Earlier testing to get the setup built obviously did make use of an actual monitor)

Anyway, it was easy enough to see some of the startup strings in the internal ROM.



Hooking this up to MAME revealed a few things, first of all the internal ROM code really doesn’t like the ARM7/ARM9 MMU implementation; it could be different here, so for the time being I’ve disabled it if the CPU type is IGS036. That allowed a few basic devices to be hooked up, which gave the following




After that the code rather jumped into the weeds, clearly there are other ARM9 bugs in MAME, as the code flow below shows



Obviously it shouldn’t be jumping straight back into the middle of a BL (HI) / BLX (LO) combo. This one seems relatively easy to fix, it was simply adding 4 to an address where it should add 2.

Even with that fixed, the code ends up going off the rails tho. More investigation is needed, but this is a good start.

btw, if anybody has “Jigsaw World Arena” or “Puzzle of Ocha / Ochainu No Pazuru” we could do with borrowing them. They used to sell for dirt cheap relative to the other PGM2 titles at the time (around $250 – $300) but lately they haven’t been showing up for anything like that. They’re single board PGM2 games that were only distributed in Japan to the best of our knowledge. The internal ROM is different for every game, so they will need dumping using the methods outlined here. Apart from those 2 boards we have access to at least one of each other game (although AFAIK only the China regions – internal ROM controls the region)

Further note, please don’t post links to that ghastly hack of MAME with badly hacked in PGM2 support, it’s loaded with anti-debugger nasties, has no source and it doesn’t seem safe to run (it blew up my VM image) and is entirely the wrong way of going about things. The point of the work being done here is to actually get it done as it should have been done.

Go to article.. »

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close