Prepared the API to set the PIT constant.

This commit is contained in:
OBattler
2024-03-23 06:15:34 +01:00
parent 01b026c76e
commit 2466da2161
5 changed files with 112 additions and 31 deletions

View File

@@ -71,6 +71,9 @@ typedef struct PIT {
ctr_t counters[3];
uint8_t ctrl;
uint64_t pit_const;
void *dev_priv;
} pit_t;
@@ -97,6 +100,7 @@ typedef struct pit_intf_t {
/* 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);
void (*set_pit_const)(void *data, uint64_t pit_const);
void *data;
} pit_intf_t;
@@ -108,6 +112,7 @@ extern double PCICLK;
extern double AGPCLK;
extern uint64_t PITCONST;
extern uint64_t PAS16CONST;
extern uint64_t ISACONST;
extern uint64_t CGACONST;
extern uint64_t MDACONST;
@@ -118,6 +123,10 @@ extern uint64_t RTCCONST;
extern int refresh_at_enable;
extern void pit_change_pas16_const(double prescale);
extern void pit_set_pit_const(void *data, uint64_t pit_const);
/* Sets a counter's CLOCK input. */
extern void pit_ctr_set_clock(ctr_t *ctr, int clock, void *priv);

View File

@@ -56,6 +56,9 @@ typedef struct ctrf_t {
};
uint32_t l;
uint64_t pit_const;
pc_timer_t timer;
void (*load_func)(uint8_t new_m, int new_count);
@@ -70,6 +73,8 @@ typedef struct pitf_t {
uint8_t ctrl;
} pitf_t;
extern void pitf_set_pit_const(void *data, uint64_t pit_const);
extern uint8_t pitf_read_reg(void *priv, uint8_t reg);
extern const pit_intf_t pit_fast_intf;