Mercurial > repos > blastem
annotate ym2612.h @ 363:c708dea45f8b
Fix push AF
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Wed, 29 May 2013 00:13:48 -0700 |
parents | b7c3facee762 |
children | 62177cc39049 |
rev | line source |
---|---|
288
a8ee7934a1f8
Add a YM2612 stub implementation with just timers and status registers so that games that depend on it can run.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1 #ifndef YM2612_H_ |
a8ee7934a1f8
Add a YM2612 stub implementation with just timers and status registers so that games that depend on it can run.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
2 #define YM2612_H_ |
a8ee7934a1f8
Add a YM2612 stub implementation with just timers and status registers so that games that depend on it can run.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
3 |
a8ee7934a1f8
Add a YM2612 stub implementation with just timers and status registers so that games that depend on it can run.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
4 #include <stdint.h> |
a8ee7934a1f8
Add a YM2612 stub implementation with just timers and status registers so that games that depend on it can run.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
5 |
a8ee7934a1f8
Add a YM2612 stub implementation with just timers and status registers so that games that depend on it can run.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
6 #define NUM_PART_REGS (0xB7-0x30) |
362 | 7 #define NUM_CHANNELS 6 |
8 #define NUM_OPERATORS (4*NUM_CHANNELS) | |
9 | |
10 typedef struct { | |
11 uint32_t phase_inc; | |
12 uint32_t phase_counter; | |
13 uint16_t envelope; | |
14 uint16_t output; | |
15 uint16_t total_level; | |
16 uint16_t sustain_level; | |
17 uint8_t rates[4]; | |
18 uint8_t key_scaling; | |
19 uint8_t multiple; | |
20 uint8_t detune; | |
21 uint8_t env_phase; | |
22 } ym_operator; | |
288
a8ee7934a1f8
Add a YM2612 stub implementation with just timers and status registers so that games that depend on it can run.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
23 |
a8ee7934a1f8
Add a YM2612 stub implementation with just timers and status registers so that games that depend on it can run.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
24 typedef struct { |
362 | 25 uint16_t fnum; |
26 int16_t output; | |
27 uint8_t block_fnum_latch; | |
28 uint8_t block; | |
29 uint8_t keycode; | |
30 uint8_t algorithm; | |
31 uint8_t feedback; | |
32 uint8_t ams; | |
33 uint8_t pms; | |
34 uint8_t lr; | |
35 } ym_channel; | |
36 | |
37 typedef struct { | |
38 uint32_t current_cycle; | |
39 uint32_t write_cycle; | |
40 ym_operator operators[NUM_OPERATORS]; | |
41 ym_channel channels[NUM_CHANNELS]; | |
42 uint16_t timer_a; | |
43 uint16_t timer_a_load; | |
44 uint8_t timer_b; | |
45 uint8_t timer_b_load; | |
46 uint8_t timer_control; | |
47 uint8_t dac_enable; | |
48 uint8_t status; | |
49 uint8_t selected_reg; | |
50 uint8_t selected_part; | |
288
a8ee7934a1f8
Add a YM2612 stub implementation with just timers and status registers so that games that depend on it can run.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
51 } ym2612_context; |
a8ee7934a1f8
Add a YM2612 stub implementation with just timers and status registers so that games that depend on it can run.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
52 |
a8ee7934a1f8
Add a YM2612 stub implementation with just timers and status registers so that games that depend on it can run.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
53 void ym_init(ym2612_context * context); |
a8ee7934a1f8
Add a YM2612 stub implementation with just timers and status registers so that games that depend on it can run.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
54 void ym_run(ym2612_context * context, uint32_t to_cycle); |
a8ee7934a1f8
Add a YM2612 stub implementation with just timers and status registers so that games that depend on it can run.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
55 void ym_address_write_part1(ym2612_context * context, uint8_t address); |
a8ee7934a1f8
Add a YM2612 stub implementation with just timers and status registers so that games that depend on it can run.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
56 void ym_address_write_part2(ym2612_context * context, uint8_t address); |
a8ee7934a1f8
Add a YM2612 stub implementation with just timers and status registers so that games that depend on it can run.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
57 void ym_data_write(ym2612_context * context, uint8_t value); |
a8ee7934a1f8
Add a YM2612 stub implementation with just timers and status registers so that games that depend on it can run.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
58 uint8_t ym_read_status(ym2612_context * context); |
a8ee7934a1f8
Add a YM2612 stub implementation with just timers and status registers so that games that depend on it can run.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
59 |
a8ee7934a1f8
Add a YM2612 stub implementation with just timers and status registers so that games that depend on it can run.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
60 #endif //YM2612_H_ |
a8ee7934a1f8
Add a YM2612 stub implementation with just timers and status registers so that games that depend on it can run.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
61 |