-
Notifications
You must be signed in to change notification settings - Fork 7
/
CIA.h
63 lines (50 loc) · 1.5 KB
/
CIA.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
//
// CIA.h
// The Omega Project
// https://github.com/h5n1xp/Omega
//
// Created by Matt Parsons on 02/02/2019.
// Copyright © 2019 Matt Parsons. All rights reserved.
// <[email protected]>
//
//
// This Source Code Form is subject to the terms of the
// Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef CIA_h
#define CIA_h
#include <stdio.h>
#include "Chipset.h"
typedef struct{
unsigned char Name[2];
uint8_t pra;
uint8_t prb; //read port
uint8_t prbw; //write port
uint8_t ddra;
uint8_t ddrb;
int32_t ta;
int32_t tb;
uint32_t tod;
uint8_t sdr;
uint8_t icr;
uint8_t cra;
uint8_t crb;
uint16_t taLatch;
uint16_t tbLatch;
uint32_t todAlarm;
uint8_t icrMask;
uint16_t chipInt; // CIA A = 32776; CIA B = 40960
int irqLatch;
int prbChanged; // flag to indicate the CPU has altered a value in this register.
}CIA_t;
extern CIA_t CIAA;
extern CIA_t CIAB;
extern int disass;
void CIAInit(CIA_t*,uint16_t); //reset the CIA and set INTREQ value;
void CIAWrite(CIA_t*,int,uint8_t);//Data,byte address,data
uint8_t CIARead(CIA_t*,int); //Data,byteaddress
void CIAExecute(CIA_t*); //returns INTREQ value if interupt, or 0 for nothing.
void CIATODEvent(CIA_t*); //called every TOD event
void CIAIndex(CIA_t*); //called every floppy disk rotation
void keyboardInt();
#endif /* CIA_h */