RED-Project icon indicating copy to clipboard operation
RED-Project copied to clipboard

arcade version of Heiankyo Alien from Steam

Open f-fix opened this issue 2 months ago • 3 comments

if you search for the five-byte string ONKYO in the file HeiankyoAlien3671.exe from the Steam game Heiankyo Alien and then back up 6693 bytes before the beginning of ONKYO and extract 16384 bytes. you will have a concatenated CPU ROM image for the arcade game.

to get the separated ROMs needed by MAME, extract sixteen 1024 bytes chunks and name them:

  • ha16.u33
  • ha15.u32
  • ha14.u31
  • ha13.u30
  • ha12.u29
  • ha11.u28
  • ha10.u27
  • ha9.u26
  • ha8.u8
  • ha7.u7
  • ha6.u6
  • ha3.u3
  • ignored-3000.bin
  • ignored-3400.bin
  • ha2.u2
  • ha1.u1

you can skip over the "ignored" ones as they are not used by MAME and are entirely FF bytes.

then create a 32 byte file of color mapping values and name it 316-138.u49 as the "color PROM" which MAME uses (though MAME only needs the 8 entries for this game and ignores the other parts of the PROM), and another two 32-byte files with arbitrary contents and name those as "316-0043.u87" and "316-0042.u88" for the control and sequence PROM's which MAME also does not use the contents of (yet!).

note that the faked PROMs will cause MAME to warn you at start-up, but this can be safely ignored for now.

How I did it:

python3 -c '
import sys
_, x = sys.argv
b = open(x,"rb").read()
b = b[b.find(b"ONKYO") - 6693:][:0x4000]
import os
os.path.exists("heiankyo") or os.mkdir("heiankyo")
[
   open("heiankyo/" + n, "wb").write(b[i*0x400:(1+i)*0x400])
   for i, n in enumerate(
      """
      ha16.u33
      ha15.u32
      ha14.u31
      ha13.u30
      ha12.u29
      ha11.u28
      ha10.u27
      ha9.u26
      ha8.u8
      ha7.u7
      ha6.u6
      ha3.u3
      ignored-3000.bin
      ignored-3400.bin
      ha2.u2
      ha1.u1
      """.split())
   if not n.startswith("ignored")
]
import PIL.ImageColor as IC
c2n = lambda c: (int(c[1], 16) & 8) | ((int(c[5], 16) & 8) >> 1) | ((int(c[3], 16) & 8) >> 2) | 1
color_pair = lambda fg, bg: (c2n(fg) << 4) | c2n(bg)
fake_color_prom = bytes([
   color_pair(IC.colormap[c], IC.colormap["blue"])
   for c in "red white white white aqua yellow red yellow".split()
]) * 4
open("heiankyo/316-138.u49", "wb").write(fake_color_prom)
open("heiankyo/316-0043.u87", "wb").write(32 * b"\0")
open("heiankyo/316-0042.u88", "wb").write(32 * b"\0")
' HeiankyoAlien3671.exe

Apart from the (obviously fake) color PROM and other fake PROM's which were generated by my Python script from scratch, onlyha3.u3 differs from the ROM set known to MAME as heiankyo. I do not know what effect the different region has, if any

ImageImageImageImageImage ROM fingerprint information for the extracted ROM set: (excludes the generated-from-scratch fake PROMs):

1.0K ha1.u1 crc32:b8da2b5e md5:23f78bc98f9b69d85d3f3347cabac042 sha1:70d97b89cb3162bd479203c53148319179a9873f sha256:568c1633bb0c61f55abb7ed7f809fdf86389dee664e8c2974f4e71165e573be3 size:1024

1.0K ha10.u27 crc32:4e203074 md5:3655e57e67e0f359e2f8b5a7862ce644 sha1:1a80c396ceb9a2b1c737e1af791dbab2bee10ce5 sha256:5976e7e96c3cc9cdb8350ee7a9ac000d9f47e4c8eff84f828240b83f56899bcd size:1024

1.0K ha11.u28 crc32:d469226a md5:06d9842a0fe0ef15f149d32e6a28b612 sha1:dfca01d956e12162fab261a017c727a756b67206 sha256:86db89a7d9742db21a4812cf4bbee35e1ca1329586119fa1504b396a65a4a19f size:1024

1.0K ha12.u29 crc32:75889ca6 md5:8221b8a1cd67c8605d176ab95d82af6d sha1:552bcf976f31d7b634b79175c0470978b6b82433 sha256:d3f96c2e7afdeb5a8e5e76cfcdd910ec06d304e0ef3bcc3ba3a06e8dba562f5b size:1024

1.0K ha13.u30 crc32:4aa67e01 md5:f00a82b6bd93f3a95ad4e7a93aaec093 sha1:5539a028cb1935bb4d6ab747c92792f5462add1f sha256:efb732cd9c2940ff5d1d56d215d946531ba5e40ec7337d4ad8a3d41fadf58168 size:1024

1.0K ha14.u31 crc32:5b7b582e md5:49693e7f7002700948276f743d7bb1de sha1:078b8b7d1836cc31cee244a58fb6a6a50135f833 sha256:bb4ef6e4ab11c3df47641ed7dce821b8452041dd07830e756e04bad9d352d22e size:1024

1.0K ha15.u32 crc32:c1b9a1a5 md5:a840cac5bc51cc7b73acba717716c384 sha1:068ad2da4852a50c948c4f9b3e1b1aa5c5bf5ca5 sha256:db09533b53513c636ca469ca5a6898cb6cf0bc66091def8e5df328cdfe18a087 size:1024

1.0K ha16.u33 crc32:1eec8b36 md5:a7150e1d44216bd110512b311b1c7b11 sha1:55644cfeb7a9d64e52f11611c91c6186038772a3 sha256:8a60a942013d975d27bdc338260fcf3bb25ef810d87b2ba6ac63df6e5b21b76d size:1024

1.0K ha2.u2 crc32:056b3b8b md5:045e084b74feba602575684f84dd7c47 sha1:3cce6c928599604ffdcdb767caa7b32d8ec1e03d sha256:271db0c82ff2a55d36d6e5c38f9f93380d2aeb90ea6ca9faa55eeb8f51d4f3de size:1024

1.0K ha3.u3 crc32:943521a0 md5:f0a8f6fe33ef2f26d130ae0da8ffd0f4 sha1:a453ac82aecafaa841771a198393b1aa28bdef49 sha256:42ec59e2fd5072c88e5d22848f126468952b3197f7e3bc9cfeb6ad59f56ede44 size:1024

1.0K ha6.u6 crc32:e467c353 md5:c2b92053161058298421f40a03331ae0 sha1:a76b4f6d9702f760f287b5285f76ea4206c6934a sha256:ba81a568215731b7a817668949f377d3c3b3df13217017b5fc1c711d4d01216e size:1024

1.0K ha7.u7 crc32:6d2f9527 md5:7cbf6441929c7c773d99f5aeaf524e36 sha1:4e51c5404d0302547c1ae85b27ffe4de11d68224 sha256:852d0bd674c32b7a5b25b59a9f7dee4880389d394e85e67070c200d0604a328a size:1024

1.0K ha8.u8 crc32:6cc64878 md5:27fbb1644a065cde2c872b0ff51d50e6 sha1:4d03ff925d80835c27512b3bd04ea57f91b4491f sha256:b967137f6fd83e13affa8d0e3543ec659a07cf91ff3572b4c9b59178b96b0e76 size:1024

1.0K ha9.u26 crc32:9c3a3dd2 md5:9c889ccbc2cf897e3f279ee1bc676db6 sha1:afcd85ec0174bdcab31135b4e271cec1eb75fd02 sha256:e3b7502325fc6589b17152b61d26220f3e1f3e19ba8a699c0cfa793ad4584bbf size:1024

f-fix avatar Oct 20 '25 22:10 f-fix

the game also includes most of the sound samples needed to play the game using sampled sound effects in ThunderMAME32UI+ VER.0.160X [regular MAME doesn't implement sound for this game at the moment]

correspondence is as follows:

  • Steam Heiankyo Alien Media/SE/SE_DIG.wav ≈ ThunderMAME32UI+ VER.0.160X sample heiankyo/00.wav
  • Steam Heiankyo Alien Media/SE/SE_PI.wav repeated 3x ≈ThunderMAME32UI+ VER.0.160X sample heiankyo/01.wav
  • Steam Heiankyo Alien Media/SE/SE_TRAPPED.wav repeated 17x with intervening silence removed ≈ThunderMAME32UI+ VER.0.160X sample heiankyo/02.wav
  • Steam Heiankyo Alien Media/SE/SE_EATING.wav ≈ ThunderMAME32UI+ VER.0.160X sample heiankyo/03.wav
  • Steam Heiankyo Alien Media/SE/SE_DEAD.wav ≈ ThunderMAME32UI+ VER.0.160X sample heiankyo/04.wav
  • Steam Heiankyo Alien Media/SE/SE_WALK.wav repeated 3x with additional intervening silences ≈ ThunderMAME32UI+ VER.0.160X sample heiankyo/05.wav
  • Steam Heiankyo Alien Media/SE/SE_KILL_ALIEN.wav ≈ ThunderMAME32UI+ VER.0.160X sample heiankyo/06.wav

f-fix avatar Oct 21 '25 03:10 f-fix

BTW this Steam version of Heiankyo Alien also includes instruction cards for the arcade cabinet (both normal as Media/InstCard.png and rotated 180 degrees as as Media/InstCard_180.png, since this is a cocktail table arcade cabinet) - i don't know whether there is a way to make MAME use those, though.

f-fix avatar Oct 23 '25 03:10 f-fix

Here's the pre-generated fake prom for those who are too lazy or are unable to run the python script.

316-138.zip

Here's the forcecrc32.py commands to make the romset run under FBNeo:

ha3.u3 508 6a55eda8
316-138.u49 0 67104ea9

I have also provided my copy of the prom with the hacked crc.

316-138 hacked crc.zip

Note: Hacking the color prom could make some colors render incorrectly, but I haven't noticed any issues from my limited testing.

DrAzathoth avatar Nov 09 '25 11:11 DrAzathoth