Mercurial > repos > blastem
annotate rf5c164.h @ 2155:6f58af5bd6fa
Add ROM DB entry for NHL 96 as it is missing SRAM info in the header
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Thu, 07 Apr 2022 00:49:58 -0700 |
parents | 62a53c052d9b |
children | 4fbe1e7c4a73 |
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); |
485834c0fea7
Forgot to add PCM source files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
32 void rf5c164_run(rf5c164* pcm, uint32_t cycle); |
485834c0fea7
Forgot to add PCM source files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
33 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
|
34 uint8_t rf5c164_read(rf5c164* pcm, uint16_t address); |
485834c0fea7
Forgot to add PCM source files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
35 |
485834c0fea7
Forgot to add PCM source files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
36 #endif //RF5C164_H_ |