comparison rf5c164.h @ 2243:0d1d5dccdd28

Initial implementation of oscilloscope debug view
author Michael Pavone <pavone@retrodev.com>
date Tue, 22 Nov 2022 17:57:02 -0800
parents 4fbe1e7c4a73
children 5a21bc0ec583
comparison
equal deleted inserted replaced
2240:8e8db9141209 2243:0d1d5dccdd28
1 #ifndef RF5C164_H_ 1 #ifndef RF5C164_H_
2 #define RF5C164_H_ 2 #define RF5C164_H_
3 #include <stdint.h> 3 #include <stdint.h>
4 #include "render_audio.h" 4 #include "render_audio.h"
5 #include "oscilloscope.h"
5 6
6 typedef struct { 7 typedef struct {
7 uint32_t cur_ptr; 8 uint32_t cur_ptr;
8 uint8_t regs[7]; 9 uint8_t regs[7];
9 uint8_t sample; 10 uint8_t sample;
10 uint8_t state; 11 uint8_t state;
12 uint8_t scope_channel;
13 uint8_t trigger;
11 } rf5c164_channel; 14 } rf5c164_channel;
12 15
13 typedef struct { 16 typedef struct {
14 audio_source *audio; 17 audio_source *audio;
18 oscilloscope *scope;
15 uint32_t cycle; 19 uint32_t cycle;
16 uint32_t clock_step; 20 uint32_t clock_step;
17 uint16_t ram[64*1024]; 21 uint16_t ram[64*1024];
18 uint16_t ram_bank; 22 uint16_t ram_bank;
19 uint16_t pending_address; 23 uint16_t pending_address;
31 void rf5c164_init(rf5c164* pcm, uint32_t mclks, uint32_t divider); 35 void rf5c164_init(rf5c164* pcm, uint32_t mclks, uint32_t divider);
32 void rf5c164_deinit(rf5c164* pcm); 36 void rf5c164_deinit(rf5c164* pcm);
33 void rf5c164_run(rf5c164* pcm, uint32_t cycle); 37 void rf5c164_run(rf5c164* pcm, uint32_t cycle);
34 void rf5c164_write(rf5c164* pcm, uint16_t address, uint8_t value); 38 void rf5c164_write(rf5c164* pcm, uint16_t address, uint8_t value);
35 uint8_t rf5c164_read(rf5c164* pcm, uint16_t address); 39 uint8_t rf5c164_read(rf5c164* pcm, uint16_t address);
40 void rf5c164_enable_scope(rf5c164* pcm, oscilloscope *scope);
36 41
37 #endif //RF5C164_H_ 42 #endif //RF5C164_H_