Skip to content

Commit

Permalink
Remove unused macros
Browse files Browse the repository at this point in the history
  • Loading branch information
rhargreaves committed Feb 20, 2025
1 parent 103c813 commit d9ede8d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 31 deletions.
39 changes: 8 additions & 31 deletions src/ym2612_regs.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@
#define YM_DAC_ENABLE 0x2B
#define YM_TEST 0x2C

// Channel 1, Operator 1
// Per-Channel
#define YM_BASE_FREQ_LSB 0xA0
#define YM_BASE_FREQ_MSB_BLK 0xA4
#define YM_BASE_ALGORITHM_FEEDBACK 0xB0
#define YM_BASE_STEREO_AMS_PMS 0xB4

// Per-Operator
#define YM_BASE_MULTIPLE_DETUNE 0x30
#define YM_BASE_TOTAL_LEVEL 0x40
#define YM_BASE_ATTACK_RATE_SCALING_RATE 0x50
Expand All @@ -17,35 +23,6 @@
#define YM_BASE_RELEASE_RATE_SUSTAIN_LEVEL 0x80
#define YM_BASE_SSG_EG 0x90

// Channel 1
#define YM_BASE_FREQ_LSB 0xA0
#define YM_BASE_FREQ_MSB_BLK 0xA4
#define YM_BASE_ALGORITHM_FEEDBACK 0xB0
#define YM_BASE_STEREO_AMS_PMS 0xB4

// Channel 3 Special Mode
// Ch 3 Special Mode
#define YM_CH3SM_BASE_FREQ_LSB 0xA8
#define YM_CH3SM_BASE_FREQ_MSB_BLK 0xAC

// Operator Offsets
#define YM_OP2_OFFSET 0x08
#define YM_OP3_OFFSET 0x04
#define YM_OP4_OFFSET 0x0C

// Test Helpers
#define YM_CH3SM_OP_SELECT(baseReg, op) (baseReg + ((op + 1) % 3))
#define YM_CH_SELECT(baseReg, channel) (baseReg + (channel % 3))
#define YM_OP_REG_INDEX(op) ((op) == 1 ? 2 : ((op) == 2 ? 1 : (op)))
#define YM_OP_SELECT(baseReg, op) (baseReg + (YM_OP_REG_INDEX(op) * 4))

#define YM_CH1 0
#define YM_CH2 1
#define YM_CH3 2
#define YM_CH4 0
#define YM_CH5 1
#define YM_CH6 2

#define YM_OP1 0
#define YM_OP2 1
#define YM_OP3 2
#define YM_OP4 3
1 change: 1 addition & 0 deletions tests/mocks/mock_ym2612.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "cmocka_inc.h"
#include "mocks/mock_ym2612.h"
#include "ym2612_regs.h"
#include "test_helpers.h"

static bool disableChecks = false;

Expand Down

0 comments on commit d9ede8d

Please sign in to comment.