MMC5, Metal Slader Glory and IRQs

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
MMC5, Metal Slader Glory and IRQs
by on (#186301)
The Nintendulator screenshot below depicts part of the intro to Metal Slader Glory.7z <Metal Slader Glory (J).nes>.

Image

The box containing the person has a horizontal, blue line at the bottom. The blue line also appears in Nestopia. But, it is absent in FCEUX, puNES and Mesen.

Does anyone have a recording of the intro from actual Famicom hardware? The MMC5 IRQ scanline counting is off in some emulators.
Re: MMC5, Metal Slader Glory and IRQs
by on (#186305)
Buy me the cart and I'll test + do recordings on actual hardware. :)
Re: MMC5, Metal Slader Glory and IRQs
by on (#186306)
koitsu wrote:
Buy me the cart and I'll test + do recordings on actual hardware. :)

I wonder how many peoples are playing this game... :mrgreen:
Re: MMC5, Metal Slader Glory and IRQs
by on (#186308)
Zepper wrote:
I wonder how many peoples are playing this game...


That game actually looks really incredible.

But, more importantly, it reveals a timing flaw in MMC5 emulation. Treat it as a test ROM.
Re: MMC5, Metal Slader Glory and IRQs
by on (#186310)
If you want to test something about the MMC5 IRQ, you can write a hotswap test and use any MMC5 cart, you don't need Metal Slader Glory. Maybe do some debugging on MSG to determine exactly what you think is questionable about the emulation, and then write a test specifically for that.

I have Uchuu Keibitai SDF, which I think has an identical board (ELROM), if you think there's any analog components relevant to the test that you wouldn't trust on a different MMC5 board.

Zepper wrote:
I wonder how many peoples are playing this game... :mrgreen:

Probably not many, because it's never been translated to English. It's never been translated to English because it's a port of a SNES game, which already has a translation, so it's basically the inferior version, only of interest if you're specifically NES focused.

Edit: SNES version doesn't actually seem to have a translation. I misremembered?
Re: MMC5, Metal Slader Glory and IRQs
by on (#186311)
Zepper wrote:
I wonder how many peoples are playing this game... :mrgreen:

"Game"? You're not talking about this, are you? :lol:
Re: MMC5, Metal Slader Glory and IRQs
by on (#186313)
rainwarrior wrote:
If you want to test something about the MMC5 IRQ, you can write a hotswap test and use any MMC5 cart

How would you test IRQ behavior if you don't have control over the IRQ vector?
Re: MMC5, Metal Slader Glory and IRQs
by on (#186314)
rainwarrior wrote:
It's never been translated to English because it's a port of a SNES game, which already has a translation

Other way around, actually - the SNES version is the port, and the NES version is the one with the (unfinished, unreleased) translation.
Re: MMC5, Metal Slader Glory and IRQs
by on (#186315)
Do any MMC5 games point their vectors at RAM?
Re: MMC5, Metal Slader Glory and IRQs
by on (#186316)
tokumaru wrote:
rainwarrior wrote:
If you want to test something about the MMC5 IRQ, you can write a hotswap test and use any MMC5 cart

How would you test IRQ behavior if you don't have control over the IRQ vector?

Oh, right. ;) Well never mind. Edit: Tepples has and idea, see below.

Revenant wrote:
the NES version is the one with the (unfinished, unreleased) translation.

I thought I remembered the SNES version having a complete translation, but apparently I was wrong about this as well.


0 for 2. Ha ha, sorry about that.
Re: MMC5, Metal Slader Glory and IRQs
by on (#186317)
tepples wrote:
Do any MMC5 games point their vectors at RAM?

Oh yeah, good idea! We're in luck! Scanning the 8k PRG banks:

Code:
Metal Slader Glory (Japan).nes
PRG size: 512k
Vectors bank 00: A730, 2F04, 1F46
Vectors bank 01: 2B40, 2120, 802B
Vectors bank 02: 5E00, 3E82, 0009
Vectors bank 03: 4E00, 02D0, 41A8
Vectors bank 04: BF9F, E08B, 9204
Vectors bank 05: 003A, 5100, 0041
Vectors bank 06: 0000, AFAB, 0000
Vectors bank 07: 0040, 2E46, 4100
Vectors bank 08: 9FBF, 0819, FE01
Vectors bank 09: F8EA, 204B, 4100
Vectors bank 0A: 0536, EA8F, 41A8
Vectors bank 0B: 4953, 02CE, 4151
Vectors bank 0C: 0068, 4B49, 4100
Vectors bank 0D: 3245, 4106, 0006
Vectors bank 0E: 0004, 0005, 0006
Vectors bank 0F: 4A49, 4100, 0001
Vectors bank 10: 010A, FA01, 0041
Vectors bank 11: 8220, 4C4E, 4108
Vectors bank 12: F8A8, 204D, 4100
Vectors bank 13: 8220, 814E, 4102
Vectors bank 14: 5152, 4041, 4100
Vectors bank 15: 0195, B401, 41A8
Vectors bank 16: 0200, 00D3, 4191
Vectors bank 17: 0040, AD4E, 4100
Vectors bank 18: 3030, 300F, 3030
Vectors bank 19: D000, 3A0A, 41A8
Vectors bank 1A: 18FE, 8BFF, 0000
Vectors bank 1B: B853, 2849, 4102
Vectors bank 1C: 010A, 000A, 1518
Vectors bank 1D: 0000, 3100, 0000
Vectors bank 1E: 4E02, 02F4, 41A8
Vectors bank 1F: 0042, 0043, 0044
Vectors bank 20: 0040, AE4E, 4100
Vectors bank 21: 031E, 7049, 4101
Vectors bank 22: 00AC, F8F7, 0041
Vectors bank 23: D003, 3A0A, 41A8
Vectors bank 24: 8210, 3149, 4100
Vectors bank 25: D003, 3A0A, 41A8
Vectors bank 26: B8EA, 9E49, 4100
Vectors bank 27: 01B4, 8210, 41A8
Vectors bank 28: 4D53, 031C, 41A8
Vectors bank 29: 0141, 0000, 0081
Vectors bank 2A: 3F85, 0009, 0000
Vectors bank 2B: 7B5F, 0E7D, 755F
Vectors bank 2C: 8A80, 091D, 0006
Vectors bank 2D: 8A10, 096F, 0006
Vectors bank 2E: 8269, 1D6F, 0009
Vectors bank 2F: 2001, 9587, 0009
Vectors bank 30: 726E, 0967, 0006
Vectors bank 31: 8187, 091E, 0006
Vectors bank 32: FC80, 0967, 0006
Vectors bank 33: 0433, 2005, 0001
Vectors bank 34: F785, 9880, 0002
Vectors bank 35: 9982, 1509, 0006
Vectors bank 36: 008B, 9880, 0002
Vectors bank 37: 8221, 093A, 0006
Vectors bank 38: 8162, 8082, 00F3
Vectors bank 39: 0000, 0000, 0000
Vectors bank 3A: FF00, 00FF, FF00
Vectors bank 3B: FF00, 00FF, FF00
Vectors bank 3C: FF00, 00FF, FF00
Vectors bank 3D: FF00, 00FF, FF00
Vectors bank 3E: FF00, 00FF, FF00
Vectors bank 3F: E9C3, E94E, F978

Uchuu Keibitai SDF (J).nes
PRG size: 128k
Vectors bank 00: FFFF, FFFF, FFFF
Vectors bank 01: FFFF, FFFF, FFFF
Vectors bank 02: FFFF, FFFF, FFFF
Vectors bank 03: FFFF, FFFF, FFFF
Vectors bank 04: FFFF, FFFF, FFFF
Vectors bank 05: FFFF, FFFF, FFFF
Vectors bank 06: FFFF, FFFF, FFFF
Vectors bank 07: FFFF, FFFF, FFFF
Vectors bank 08: FFFF, FFFF, FFFF
Vectors bank 09: FFFF, FFFF, FFFF
Vectors bank 0A: FFFF, FFFF, FFFF
Vectors bank 0B: 1B02, 0539, 0019
Vectors bank 0C: FFFF, FFFF, FFFF
Vectors bank 0D: E1E8, E4F2, FFFF
Vectors bank 0E: 074C, A9E0, 8D01
Vectors bank 0F: EC67, F916, ECFE


Extracted with a very simple python program:
Code:
def mmc5vectors(filename):
    rom = open(filename,"rb").read()
    print(filename)
    prg = rom[4]
    print("PRG size: %dk" % (prg * 16))
    for i in range(prg*2):
        bank = 16 + (0x2000 * i)
        nmi = rom[bank+0x1FFA] | (rom[bank+0x1FFB]<<8)
        rst = rom[bank+0x1FFC] | (rom[bank+0x1FFD]<<8)
        irq = rom[bank+0x1FFE] | (rom[bank+0x1FFF]<<8)
        print("Vectors bank %02X: %04X, %04X, %04X" % (i,nmi, rst, irq))
    print()

mmc5vectors("Metal Slader Glory (Japan).nes")
mmc5vectors("Uchuu Keibitai SDF (J).nes")
Re: MMC5, Metal Slader Glory and IRQs
by on (#186319)
Cool, so the test program can simply select the correct bank before enabling IRQs!