IREM M92

System Information:
    V33 (I86 based) CPU
    YM2151 Sound chip (encrypted V33)

V33 Addresses:
    $00000 $9ffff MRA_ROM
    $A0000 $bffff MRA_BANK1
    $C0000 $cffff Mirror of rom:  Used by In The Hunt as protection
    $D0000 $dffff Vram
    $E0000 $effff System ram
    $F0000 $f3fff Eeprom, Major Title 2 only
    $F8000 $f87ff Sprite Ram
    $F8800 $f8fff Palette Ram (xBBBBBGGGGGRRRRR)
    $F9000 $f900f Sprite Control
    $F9008        Clears Sprite Ram
    $F9800 $f9801 Sprite Buffer
    $FFFF0 $FFFFF MRA_ROM

Read Ports:
    $00     Player 1 Input
    $01     Player 2 Input
    $02     Coins & VBL
    $03     Dip 3
    $04     Dip 2
    $05     Dip 1
    $06     Player 3
    $07     Player 4
    $08-$09 Status Port

Write Ports:
    $00-$01 Sound Latch
    $02-$03 Coin Counter
    $20-$21 Bank Switch
    $40-$43 Interrupt controller, only written to at bootup
    $80-$87 Play Field 1 Control
    $88-$8F Play Field 2 Control
    $90-$97 Play Field 3 Control
    $98-$9F Master Control
    $C0-$C1 ?

Sound memory:
    $00000-$1FFFF   Rom
    $FFFF0-$FFFFF   Rom

Graphics:
		3 scrolling playfields, 512 by 512.
		Each playfield can enable rowscroll, change shape (to 1024 by 512),
		be enabled/disabled and change position in VRAM.

		Tiles can have several priority values:
			0 = standard
			1 = Top 8 pens appear over sprites (split tilemap)
			2 = Whole tile appears over sprites
			3 = ?  Seems to be the whole tile is over sprites (as 2).

		Sprites have 2 priority values:
			0 = standard
			1 = Sprite appears over all tiles, including high priority pf1

		Raster interrupts can be triggered at any line of the screen redraw,
		typically used in games like R-Type Leo to multiplex the top
        playfield.

Master Control registers:
		Word 0:	Playfield 1 control
			Bit  0x40:  1 = Rowscroll enable, 0 = disable
			Bit  0x10:	0 = Playfield enable, 1 = disable
			Bit  0x04:  0 = 512 x 512 playfield, 1 = 1024 x 512 playfield
			Bits 0x03:  Playfield location in VRAM (0, 0x4000, 0x8000, 0xc000)
		Word 1: Playfield 2 control (as above)
		Word 2: Playfield 3 control (as above)
		Word 3: Raster IRQ position.
                               Byte 6                   Byte 7
        Raster Irq Position = (Position & $ff) + 128 | (Position & $ff00)


	The raster IRQ position is offset by 128+8 from the first visible line,
	suggesting there are 8 lines before the first visible one.

	Gunforce waits on bit 1 (word) going high on bootup, just after
	setting up interrupt controller.

	Gunforce reads bit 2 (word) on every coin insert, doesn't seem to
	do much though..

	Ninja Batman polls this.

	R-Type Leo reads it now & again..
    m92_ram[$53]=1; /* FIXES RTYPE LEO! */

IRQs:
    IRQ 0   VBL interrupt
    IRQ 1   End of VBL interrupt??
    IRQ 2   Raster interrupt
    IRQ 3   Sprite buffer complete interrupt?

Tiles:
    tile  = Index + 1 << 8 | Index
    color = [Index + 2] & $3f
    [Index + 3] & 1     Highest priority;
    [Index + 2] & $80   Medium priority
    [Index + 3] & &6    Flip X and Y

    Playfield 3 rowscroll data is $dfc00 - $dffff
    Playfield 2 rowscroll data is $df800 - $dfbff
    Playfield 1 rowscroll data is $df400 - $df7ff

    It appears to be hardwired to those locations.

    In addition, each playfield is staggered 2 pixels horizontally from the
    previous one.  This is most obvious in Hook & Blademaster.

Playfield Controls:
    Scroll X    Play Field Control[5] << 8) + Play Field Control[4]
    Scroll Y    Play Field Control[1] << 8) + Play Field Control[0]

Sprites:
    y       = (Spriteram[0] | Spriteram[1] << 8) & $1ff
    x       = (Spriteram[6] | Spriteram[7] << 8) & $1ff

    sprite  = Spriteram[2] | (Spriteram[3] << 8)
    color   = Spriteram[4] & $3f

    Y Size  = (Spriteram[1] >> 1) & $03     1, 2, 4 or 8
    X Size  = (Spriteram[1] >> 3) & $03     1, 2, 4 or 8
?   Fixed X = Spriteram[5] & $01
?   Fixed Y = Spriteram[5] & $02

    I believe the spritechip interrupts the main CPU once sprite buffering is
    complete, there isn't a whole lot of evidence for this but it's an idea.

Input:
    Player 1 (Port 0)
        $01 Right
        $02 Left
        $04 Down
        $08 Up
        $10 Unused
        $20 Button 3
        $40 Button 2
        $80 Button 1

    Extra Buttons
        $01 Unused
        $02 Button 4 (Player 1)
        $04 Button 5 (Player 1)
        $08 Button 6 (Player 1)
        $10 Unused
        $20 Button 4 (Player 2)
        $40 Button 5 (Player 2)
        $80 Button 6 (Player 2)

Graphics:
    8 * 8 characters
    65536 characters
    4 bits per pixel
    // The bitplanes are separated
    Plane Offsets   $180000 * 8 $100000 * 8 $80000 * 8 $000000 * 8
    XOffsets        0 1 2 3 4 5 6 7
    YOffsets        0 * 8 1 * 8 2 * 8 3 * 8 4 * 8 5 * 8 6 * 8 7 * 8
    Every char takes 8 consecutive bytes

    16 * 16 characters
    32768   characters
    4 bits per pixel
    Plane Offsets   $300000 * 8 $200000 * 8 $100000 * 8 $000000 * 8
    XOffsets 0, 1, 2, 3, 4, 5, 6, 7,
             16*8+0, 16*8+1, 16*8+2, 16*8+3, 16*8+4, 16*8+5, 16*8+6, 16*8+7
    YOffsets 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
             8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8
    Every character takes 32 consecutive bytes

    16 * 16 characters
    65536   characters
    4 bits per pixel
    Plane Offsets   $600000 * 8 $400000 * 8 $200000 * 8 $000000 * 8
    XOffsets 8 9 10 11 12 13 14 15 0 1 2 3 4 5 6 7
    YOffsets 0 * 16 1 * 16  2 * 16  3 * 16  4 * 16  5 * 16  6 * 16  7 * 16
             8 * 16 9 * 16 10 * 16 11 * 16 12 * 16 13 * 16 14 * 16 15 * 16
    Every character takes 32 consecutive bytes



Hosted by the Vintage Gaming Network