Skip to content
Cycle-accurate Yamaha YM3438(YM2612) emulator
Branch: master
Clone or download
nukeykt Merge pull request #7 from Wohlstand/master
Fixed C90 compatibility
Latest commit 356f288 Nov 25, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE Initial commit Mar 17, 2017 Update Sep 21, 2017
ym3438.c Fixed C90 compatibility Nov 26, 2018
ym3438.h Fixed C90 compatibility Nov 26, 2018
ym3438.svg Nuked OPN2 v1.0 Sep 21, 2017


High accuracy Yamaha YM3438(OPN2) emulator.

The YM3438 is a CMOS variant of the YM2612 used in Sega MegaDrive(Genesis) and FM Towns.

Genesis Plus GX fork with this core integrated is available here:


  • Based on YM3438 die shot reverse engineering and thus provides very high emulation accuracy.

  • Cycle-accurate.

  • Undocumented registers/features emulation.

  • SSG-EG, CSM mode emulation.

  • Compatible with the YM2612.

API documention

void OPN2_Reset(ym3438_t *chip) - Reset emulated chip
void OPN2_Clock(ym3438_t *chip, Bit32s *buffer) - Advances emulated chip state by 1 internal clock(6 master clocks). Writes signed 9-bit MOL, MOR pin states to buffer. 
void OPN2_Write(ym3438_t *chip, Bit32u port, Bit8u data) - Write 8-bit data to port.
void OPN2_SetTestPin(ym3438_t *chip, Bit32u value) - Set TEST pin value.
Bit32u OPN2_ReadTestPin(ym3438_t *chip) - Read TEST pin value.
Bit32u OPN2_ReadIRQPin(ym3438_t *chip) - Read IRQ pin value.
Bit8u OPN2_Read(ym3438_t *chip, Bit32u port) - Read chip status.


Sonic the Hedgehog:

Sega CD BIOS v1.10:

You can’t perform that action at this time.