Make status structs unsigned

This commit is contained in:
DavidBuchanan314 2017-01-07 21:12:27 +00:00
parent eb70f8a7c7
commit 851ac5fe1e
2 changed files with 16 additions and 16 deletions

16
6502.h
View File

@ -20,14 +20,14 @@ void * read_addr;
void * write_addr;
struct StatusBits{
int carry:1; // bit 0
int zero:1;
int interrupt:1;
int decimal:1;
int brk:1; // "break" is a reserved word :(
int unused:1;
int overflow:1;
int sign:1; // bit 7
unsigned char carry:1; // bit 0
unsigned char zero:1;
unsigned char interrupt:1;
unsigned char decimal:1;
unsigned char brk:1; // "break" is a reserved word :(
unsigned char unused:1;
unsigned char overflow:1;
unsigned char sign:1; // bit 7
};
union StatusReg { // this means we can access the status register as a byte, or as individual bits.

16
6850.h
View File

@ -2,14 +2,14 @@
#define DATA_ADDR 0xA001
struct UartStatusBits{
int RDRF:1; // bit 0
int TDRE:1;
int DCD:1;
int CTS:1;
int FE:1;
int OVRN:1;
int PE:1;
int IRQ:1; // bit 7
unsigned char RDRF:1; // bit 0
unsigned char TDRE:1;
unsigned char DCD:1;
unsigned char CTS:1;
unsigned char FE:1;
unsigned char OVRN:1;
unsigned char PE:1;
unsigned char IRQ:1; // bit 7
};
union UartStatusReg {