WIP: PAS16.
See above, currently very WIP.
This commit is contained in:
@@ -42,6 +42,7 @@ typedef struct ctr_t {
|
||||
int state;
|
||||
int null_count;
|
||||
int do_read_status;
|
||||
int enable;
|
||||
|
||||
union {
|
||||
int32_t count;
|
||||
@@ -57,7 +58,7 @@ typedef struct ctr_t {
|
||||
uint32_t l;
|
||||
|
||||
void (*load_func)(uint8_t new_m, int new_count);
|
||||
void (*out_func)(int new_out, int old_out);
|
||||
void (*out_func)(int new_out, int old_out, void *priv);
|
||||
} ctr_t;
|
||||
|
||||
typedef struct PIT {
|
||||
@@ -68,8 +69,12 @@ typedef struct PIT {
|
||||
ctr_t counters[3];
|
||||
|
||||
uint8_t ctrl;
|
||||
void *dev_priv;
|
||||
void (*dev_timer)(void *priv);
|
||||
} pit_t;
|
||||
|
||||
extern pit_t *ext_pit;
|
||||
|
||||
enum {
|
||||
PIT_8253 = 0,
|
||||
PIT_8254 = 1,
|
||||
@@ -87,7 +92,7 @@ typedef struct pit_intf_t {
|
||||
/* Sets if a counter's CLOCK input is from the timer or not - used by PCjr. */
|
||||
void (*set_using_timer)(void *data, int counter_id, int using_timer);
|
||||
/* Sets a counter's OUT output handler. */
|
||||
void (*set_out_func)(void *data, int counter_id, void (*func)(int new_out, int old_out));
|
||||
void (*set_out_func)(void *data, int counter_id, void (*func)(int new_out, int old_out, void *priv));
|
||||
/* Sets a counter's load count handler. */
|
||||
void (*set_load_func)(void *data, int counter_id, void (*func)(uint8_t new_m, int new_count));
|
||||
void (*ctr_clock)(void *data, int counter_id);
|
||||
@@ -113,20 +118,24 @@ extern uint64_t RTCCONST;
|
||||
extern int refresh_at_enable;
|
||||
|
||||
/* Sets a counter's CLOCK input. */
|
||||
extern void pit_ctr_set_clock(ctr_t *ctr, int clock);
|
||||
extern void pit_ctr_set_clock(ctr_t *ctr, int clock, void *priv);
|
||||
|
||||
extern pit_t *pit_common_init(int type, void (*out0)(int new_out, int old_out), void (*out1)(int new_out, int old_out));
|
||||
extern void pit_ctr_set_out_func(void *data, int counter_id, void (*func)(int new_out, int old_out, void *priv));
|
||||
|
||||
extern void pit_ctr_set_using_timer(void *data, int counter_id, int using_timer);
|
||||
|
||||
extern pit_t *pit_common_init(int type, void (*out0)(int new_out, int old_out, void *priv), void (*out1)(int new_out, int old_out, void *priv));
|
||||
extern pit_t *pit_ps2_init(int type);
|
||||
extern void pit_reset(pit_t *dev);
|
||||
|
||||
extern void pit_irq0_timer_ps2(int new_out, int old_out);
|
||||
extern void pit_irq0_timer_ps2(int new_out, int old_out, void *priv);
|
||||
|
||||
extern void pit_refresh_timer_xt(int new_out, int old_out);
|
||||
extern void pit_refresh_timer_at(int new_out, int old_out);
|
||||
extern void pit_refresh_timer_xt(int new_out, int old_out, void *priv);
|
||||
extern void pit_refresh_timer_at(int new_out, int old_out, void *priv);
|
||||
|
||||
extern void pit_speaker_timer(int new_out, int old_out);
|
||||
extern void pit_speaker_timer(int new_out, int old_out, void *priv);
|
||||
|
||||
extern void pit_nmi_timer_ps2(int new_out, int old_out);
|
||||
extern void pit_nmi_timer_ps2(int new_out, int old_out, void *priv);
|
||||
|
||||
extern void pit_set_clock(uint32_t clock);
|
||||
extern void pit_handler(int set, uint16_t base, int size, void *priv);
|
||||
@@ -135,6 +144,7 @@ extern uint8_t pit_read_reg(void *priv, uint8_t reg);
|
||||
|
||||
#ifdef EMU_DEVICE_H
|
||||
extern const device_t i8253_device;
|
||||
extern const device_t i8253_ext_io_device;
|
||||
extern const device_t i8254_device;
|
||||
extern const device_t i8254_sec_device;
|
||||
extern const device_t i8254_ext_io_device;
|
||||
|
||||
@@ -59,7 +59,8 @@ typedef struct ctrf_t {
|
||||
pc_timer_t timer;
|
||||
|
||||
void (*load_func)(uint8_t new_m, int new_count);
|
||||
void (*out_func)(int new_out, int old_out);
|
||||
void (*out_func)(int new_out, int old_out, void *priv);
|
||||
void *priv;
|
||||
} ctrf_t;
|
||||
|
||||
typedef struct pitf_t {
|
||||
|
||||
@@ -123,10 +123,8 @@ extern const device_t cms_device;
|
||||
/* Gravis UltraSound and UltraSound Max */
|
||||
extern const device_t gus_device;
|
||||
|
||||
# if defined(DEV_BRANCH) && defined(USE_PAS16)
|
||||
/* Pro Audio Spectrum 16 */
|
||||
extern const device_t pas16_device;
|
||||
# endif
|
||||
|
||||
/* IBM PS/1 Audio Card */
|
||||
extern const device_t ps1snd_device;
|
||||
|
||||
Reference in New Issue
Block a user