mirror of
https://github.com/DavidBuchanan314/6502-emu.git
synced 2025-01-13 09:30:00 +00:00
Make status structs unsigned
This commit is contained in:
parent
eb70f8a7c7
commit
851ac5fe1e
16
6502.h
16
6502.h
@ -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
16
6850.h
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user