Created
May 11, 2018 16:21
-
-
Save lithium/fe2795af43d237a9ddd6d81fe735a738 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // internal register cache, copy on write | |
| #define YM_REG_LAST_ADDR 0xB4 | |
| #define YM_REG_FIRST_ADDR 0x22 | |
| #define YM_REG_PART_SIZE (YM_REG_LAST_ADDR - YM_REG_FIRST_ADDR + 1) | |
| #define YM_REG_NUM_PARTS 2 | |
| uint8_t registers[YM_REG_NUM_PARTS][YM_REG_PART_SIZE]; | |
| void Ym2612::set_register(uint8_t part, uint8_t ym_addr, uint8_t value) | |
| { | |
| this->registers[part][ym_addr - YM_REG_FIRST_ADDR] = value; | |
| write_register(part, ym_addr, value); | |
| } | |
| uint8_t Ym2612::get_register(uint8_t part, uint8_t ym_addr) | |
| { | |
| return this->registers[part][ym_addr - YM_REG_FIRST_ADDR]; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment