4 static unsigned short apu_addr;
5 static unsigned char apu_data;
7 #define APU_IO_SIZE 0x20
10 * apucore r/w func ptr.
12 void set_dma_data(unsigned char data);
13 void release_bus(void);
16 typedef void (apu_write_t)(unsigned char);
17 typedef unsigned char (apu_read_t)(void);
19 static apu_write_t *apu_write_func[APU_IO_SIZE];
20 static apu_read_t *apu_read_func[APU_IO_SIZE];
22 void set_apu_addr(unsigned short addr) {
23 //dprint("set_apu_addr: %02x\n", addr);
27 unsigned char get_apu_data(void) {
31 void set_apu_data(unsigned char data) {
32 //dprint("set_apu_data: %02x\n", data);
36 void set_apu_start(int ce) {
37 //let ram i/o on the bus.
41 apu_write_func[apu_addr](apu_data);
45 apu_data = apu_read_func[apu_addr]();
53 static void null_write(unsigned char d){}
54 static unsigned char null_read(void){return 0;}
62 for (i = 0; i < APU_IO_SIZE; i++) {
63 apu_write_func[i] = null_write;
65 for (i = 0; i < APU_IO_SIZE; i++) {
66 apu_read_func[i] = null_read;
69 apu_write_func[0x14] = set_dma_data;
74 void clean_apu(void) {