| 9120e874 Andy McCall |
1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
#ifndef VIA_H |
| 6 |
#define VIA_H |
| 7 |
|
| 8 |
#include <stdint.h> |
| 9 |
#include <stdbool.h> |
| 10 |
|
| 11 |
#ifdef __cplusplus |
| 12 |
extern "C" { |
| 13 |
#endif |
| 14 |
|
| 15 |
void via1_init(); |
| 16 |
uint8_t via1_read(uint8_t reg, bool debug); |
| 17 |
void via1_write(uint8_t reg, uint8_t value); |
| 18 |
void via1_step(unsigned clocks); |
| 19 |
bool via1_irq(); |
| 20 |
|
| 21 |
void via2_init(); |
| 22 |
uint8_t via2_read(uint8_t reg, bool debug); |
| 23 |
void via2_write(uint8_t reg, uint8_t value); |
| 24 |
void via2_step(unsigned clocks); |
| 25 |
bool via2_irq(); |
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
typedef struct { |
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
uint8_t regs[15]; |
| 45 |
uint16_t timer_count[2]; |
| 46 |
uint16_t timer_latch[2]; |
| 47 |
bool timer_running[2]; |
| 48 |
bool timer1_m1; |
| 49 |
bool pb7_output; |
| 50 |
} via_debug_state_t; |
| 51 |
|
| 52 |
void via_debug_get_state(int which, via_debug_state_t *out); |
| 53 |
|
| 54 |
#ifdef __cplusplus |
| 55 |
} |
| 56 |
#endif |
| 57 |
|
| 58 |
#endif |