Mercurial > repos > blastem
annotate rf5c164.h @ 2166:3a6680e9204a
xcftools is no longer packaged by Debian/Ubuntu so switched to imagemagick
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Sat, 23 Jul 2022 10:54:07 -0700 |
parents | 4fbe1e7c4a73 |
children | 0d1d5dccdd28 |
rev | line source |
---|---|
2082
485834c0fea7
Forgot to add PCM source files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1 #ifndef RF5C164_H_ |
485834c0fea7
Forgot to add PCM source files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
2 #define RF5C164_H_ |
485834c0fea7
Forgot to add PCM source files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
3 #include <stdint.h> |
485834c0fea7
Forgot to add PCM source files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
4 #include "render_audio.h" |
485834c0fea7
Forgot to add PCM source files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
5 |
485834c0fea7
Forgot to add PCM source files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
6 typedef struct { |
485834c0fea7
Forgot to add PCM source files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
7 uint32_t cur_ptr; |
485834c0fea7
Forgot to add PCM source files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
8 uint8_t regs[7]; |
485834c0fea7
Forgot to add PCM source files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
9 uint8_t sample; |
485834c0fea7
Forgot to add PCM source files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
10 uint8_t state; |
485834c0fea7
Forgot to add PCM source files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
11 } rf5c164_channel; |
485834c0fea7
Forgot to add PCM source files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
12 |
485834c0fea7
Forgot to add PCM source files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
13 typedef struct { |
485834c0fea7
Forgot to add PCM source files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
14 audio_source *audio; |
485834c0fea7
Forgot to add PCM source files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
15 uint32_t cycle; |
485834c0fea7
Forgot to add PCM source files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
16 uint32_t clock_step; |
485834c0fea7
Forgot to add PCM source files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
17 uint16_t ram[64*1024]; |
485834c0fea7
Forgot to add PCM source files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
18 uint16_t ram_bank; |
485834c0fea7
Forgot to add PCM source files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
19 uint16_t pending_address; |
2145
62a53c052d9b
PCM channel add should saturate on overflow, not wrap around
Michael Pavone <pavone@retrodev.com>
parents:
2082
diff
changeset
|
20 int32_t left; |
62a53c052d9b
PCM channel add should saturate on overflow, not wrap around
Michael Pavone <pavone@retrodev.com>
parents:
2082
diff
changeset
|
21 int32_t right; |
2082
485834c0fea7
Forgot to add PCM source files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
22 rf5c164_channel channels[8]; |
485834c0fea7
Forgot to add PCM source files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
23 uint8_t pending_byte; |
485834c0fea7
Forgot to add PCM source files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
24 uint8_t channel_enable; |
485834c0fea7
Forgot to add PCM source files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
25 uint8_t selected_channel; |
485834c0fea7
Forgot to add PCM source files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
26 uint8_t cur_channel; |
485834c0fea7
Forgot to add PCM source files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
27 uint8_t step; |
485834c0fea7
Forgot to add PCM source files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
28 uint8_t flags; |
485834c0fea7
Forgot to add PCM source files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
29 } rf5c164; |
485834c0fea7
Forgot to add PCM source files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
30 |
485834c0fea7
Forgot to add PCM source files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
31 void rf5c164_init(rf5c164* pcm, uint32_t mclks, uint32_t divider); |
2164
4fbe1e7c4a73
Don't leak all Sega CD resources when freeing a Genesis instance
Michael Pavone <pavone@retrodev.com>
parents:
2145
diff
changeset
|
32 void rf5c164_deinit(rf5c164* pcm); |
2082
485834c0fea7
Forgot to add PCM source files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
33 void rf5c164_run(rf5c164* pcm, uint32_t cycle); |
485834c0fea7
Forgot to add PCM source files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
34 void rf5c164_write(rf5c164* pcm, uint16_t address, uint8_t value); |
485834c0fea7
Forgot to add PCM source files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
35 uint8_t rf5c164_read(rf5c164* pcm, uint16_t address); |
485834c0fea7
Forgot to add PCM source files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
36 |
485834c0fea7
Forgot to add PCM source files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
37 #endif //RF5C164_H_ |