MPEGCommands

From Yabause
Revision as of 20:38, 31 May 2016 by Cyberwarriorx (Talk | contribs) (Added mpeg interrupt flag list)

Jump to: navigation, search

MPEG Get Status(0x90)

Format:

CR1 0x9000
CR2 0x0000
CR3 0x0000
CR4 0x0000

Returns: MPEG status data

HIRQ N/A


MPEG Get Interrupt(0x91)

Format:

CR1 0x9100
CR2 0x0000
CR3 0x0000
CR4 0x0000

Returns:

CR1 CD Status(high byte), upper byte of Interrupts(low byte)
CR2 lower word of Interrupts(word)
Possible bits for interrupts:
0x000001: Video Stream is ready
0x000002: Video Stream has been changed
0x000004: Video Output is ready
0x000008: Video Output start
0x000010: Video Decoding Error
0x000020: Video Stream Data Error
0x000040: Video Buffer division connection error
0x000080: Next Video Stream Data Error
0x000100: Picture start detected
0x000200: GOP start detected
0x000400: Sequence end detected
0x000800: Sequence start detected
0x001000: Video sector target bit
0x002000: Video sector EOR bit detected
0x004000: Audio sector target bit
0x008000: Audio sector EOR bit
0x010000: Audio stream is ready
0x020000: Audio stream has been changed
0x040000: Audio output is ready
0x080000: Audio output start
0x100000: Audio decoding error
0x200000: Audio stream data error
0x400000: Audio buffer division connection error
0x800000: Next Audio Stream Data Error
CR3 0x0000
CR4 0x0000
HIRQ N/A

MPEG Set Interrupt Mask(0x92)

Format:

CR1 0x92(high byte), upper byte of Interrupt Mask(low byte)
CR2 lower word of Interrupt Mask(word)
CR3 0x0000
CR4 0x0000

Returns: MPEG status data

HIRQ N/A


MPEG Init(0x93)

Format:

CR1 0x9300
CR2 Software Timer Enable(word)
CR3 0x0000
CR4 0x0000

Returns:

CR1 CD Status(high byte)
CR2 0x0000
CR3 0x0000
CR4 0x0000
HIRQ MPED, MPCM(see notes)

Notes: None of the other MPEG commands will work until MPEG card has been authenticated and this command has been called. If Software Timer Enable is set to 0x0001, MPCM is set, and continues to be set even if cleared(I'm not sure what interval it's set at though)


MPEG Set Mode(0x94)

Format:

CR1 0x94(high byte), video play mode(low byte)
Possible values for video play mode:
0x00: Full-motion video
0x01: Still picture
0x02: HD full-motion video
0x03: HD still picture
0xFF: No change
CR2 decode timing mode(high byte), output mode(low byte)
Possible values for decode timing mode:
0x00: V-Sync
0x01: Host
0xFF: No change
Possible values for output mode:
0x00: VDP2 output
0x01: Host output
0xFF: No change
CR3 scanline mode(high byte)
Possible values:
0x00: NTSC non-interlaced
0x01: NTSC interlaced
0x02: PAL non-interlaced
0x03: PAL interlaced
0xFF: No change
CR4 0x0000

Returns: MPEG status data

HIRQ N/A

MPEG Play(0x95)

Format:

CR1 0x95(high byte), sync/async play mode(low byte)
Possible values for video play mode:
0x00: Sync
0x01: Async
CR2 audio transfer mode (high byte), video transfer mode(low byte)
Possible values for audio/video transfer mode:
0x00: Auto
0x01: Forced
CR3 0x0000
CR4 decoder connection switch(low byte)
Possible values for decoder connection switch:
0x00: Abort
0x01: Change

Returns: MPEG status data

MPEG Set Decoding Method(0x96)

Format:

CR1 0x96(high byte), Mute Audio Channels(low byte)
Possible flags for mute audio channels:
0x01: Right channel mute
0x02: Left channel mute
0x04: Both channels unmuted
CR2 Pause timing(word)
CR3 0x0000
CR4 Freeze timing(word)

Returns: MPEG status data

MPEG Out Decoding Sync(0x97)

MPEG Get Timecode(0x98)

MPEG Get PTS(0x99)

MPEG Set Connection(0x9A)

Format:

CR1 0x9A(high byte), Audio Connection Mode(low byte)
CR2 Audio Layer and Search Settings(high byte), Audio Buffer Partition Number(low byte)
CR3 Stream Selection(high byte), Video Connection Mode(low byte)
Possible values for stream selection:
0x00: Current stream
0x01: Next stream
CR4 Video Layer and Search Settings(high byte), Video Buffer Partition Number(low byte)
Possible flag bits for audio/video connection modes:
0x01: EOR toggle
0x02: System End toggle
0x04: Sector delete
0x08: Ignore PTS
0x10: Clear VBV
0x20: Clear VBV & WBC
Possible flag bits for audio/video layer and search settings:
0x01: A/V layer(if this bit isn't set, system layer is assumed)
0x80: Video search
0xC0: A/V search

Returns: MPEG status data

MPEG Get Connection(0x9B)

Format:

CR1 0x9B(high byte)
CR2 0x0000
CR3 Stream Selection(high byte)
Possible values for stream selection:
0x00: Current stream
0x01: Next stream
CR4 0x0000

Returns:

CR1 CD Status(high byte), Audio Connection Mode(low byte)
CR2 Audio Layer and Search Settings(high byte), Audio Buffer Partition Number(low byte)
CR3 Video Connection Mode(low byte)
CR4 Video Layer and Search Settings(high byte), Video Buffer Partition Number(low byte)
Possible flag bits for audio/video connection modes:
0x01: EOR toggle
0x02: System End toggle
0x04: Sector delete
0x08: Ignore PTS
0x10: Clear VBV
0x20: Clear VBV & WBC
Possible flag bits for audio/video layer and search settings:
0x01: A/V layer(if this bit isn't set, system layer is assumed)
0x04: Sector delete
0x80: Video search
0xC0: A/V search

MPEG Change Connection(0x9C)

MPEG Set Stream(0x9D)

Format:

CR1 0x9D(high byte), Audio Stream Mode(low byte)
Possible flag bits for audio/video stream modes:
0x01: Stream ID set
0x02: Stream ID identify
0x04: Channel Number set
0x08: Channel Number identify
CR2 Audio Stream ID(high byte), Audio Channel Number(low byte)
CR3 Stream Selection(high byte), Video Stream Mode(low byte)
Possible values for stream selection:
0x00: Current stream
0x01: Next stream
CR4 Video Stream ID(high byte), Video Channel Number(low byte)

Returns: MPEG status data

MPEG Get Stream(0x9E)

MPEG Get Picture Size(0x9F)

MPEG Display(0xA0)

Format:

CR1 0xA0(high byte)
CR2 Display show flag(high byte), frame buffer number(low byte)
CR3 0x0000
CR4 0x0000

Returns: MPEG status data

MPEG Set Window(0xA1)

Format:

CR1 0xA1(high byte), Change type(low byte)
Possible values for type:
0x00: Frame Buffer Window position
0x01: Frame Buffer Window zoom rate
0x02: Display Window position
0x03: Display Window size
0x04: Display Window offset
CR2 Change Flag(word)
CR3 x position/rate/etc.(word)
CR4 y position/rate/etc.(word)

Returns: MPEG status data

HIRQ N/A

MPEG Set Border Color(0xA2)

Format:

CR1 0xA200
CR2 Color(word)
CR3 0x0000
CR4 0x0000

Returns: MPEG status data

HIRQ N/A


MPEG Set Fade(0xA3)

Format:

CR1 0xA300
CR2 Y gain (high byte), C gain(low byte)
CR3 0x0000
CR4 0x0000

Returns: MPEG status data

HIRQ N/A


MPEG Set Video Effects(0xA4)

Format:

CR1 0xA4(high byte)
CR2 Interpolation(high byte), Lumi-key(low byte)
CR3 Mosaic Width(high byte), Mosaic Height(low byte)
CR4 Blur Width(high byte), Blur Height(low byte)

Returns: MPEG status data

MPEG Get Image(0xA5)

MPEG Set Image(0xA6)

MPEG Read Image(0xA7)

MPEG Write Image(0xA8)

MPEG Read Sector(0xA9)

MPEG Write Sector(0xAA)

MPEG Get LSI(0xAE)

MPEG Set LSI(0xAF)