SGDK
A free and open development kit for the Sega Mega Drive
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
ym2612.h File Reference

YM2612 support. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define YM2612_BASEPORT   0xA04000
 YM2612 base port address.
 
#define YM2612_writeSafe(port, data)
 
#define YM2612_writeRegSafe(part, reg, data)
 

Functions

void YM2612_reset (void)
 Reset YM2612 chip.
 
u8 YM2612_read (const u16 port)
 Read YM2612 port.
 
u8 YM2612_readStatus ()
 Return YM2612 status (busy and timer flag).
 
void YM2612_write (const u16 port, const u8 data)
 Write YM2612 port.
 
void YM2612_writeReg (const u16 part, const u8 reg, const u8 data)
 Set YM2612 register value.
 
void YM2612_enableDAC (void)
 Enable YM2612 DAC.
 
void YM2612_disableDAC (void)
 Disable YM2612 DAC.
 

Detailed Description

YM2612 support.

Author
Stephane Dallongeville
Date
08/2011

This unit provides access to the YM2612 through the 68000 CPU.

Macro Definition Documentation

◆ YM2612_writeRegSafe

#define YM2612_writeRegSafe ( part,
reg,
data )
Value:
_Pragma("GCC error \"This definition is deprecated, use YM2612_writeReg(..) instead.\"")

◆ YM2612_writeSafe

#define YM2612_writeSafe ( port,
data )
Value:
_Pragma("GCC error \"This definition is deprecated, use YM2612_write(..) instead.\"")

Function Documentation

◆ YM2612_read()

u8 YM2612_read ( const u16 port)

Read YM2612 port.

Parameters
portPort number (0-3)
Returns
YM2612 port value.

Reading YM2612 always return YM2612 status (busy and timer flag) whatever is the port read.

◆ YM2612_readStatus()

u8 YM2612_readStatus ( )

Return YM2612 status (busy and timer flag).

Returns
YM2612 status.

◆ YM2612_write()

void YM2612_write ( const u16 port,
const u8 data )

Write YM2612 port.

Parameters
portPort number (0-3)
dataData to write

◆ YM2612_writeReg()

void YM2612_writeReg ( const u16 part,
const u8 reg,
const u8 data )

Set YM2612 register value.

Parameters
partpart number (0-1)
regregister number
dataregister value