mirror of
https://github.com/satoshinm/pill_6502.git
synced 2024-12-27 17:29:19 +00:00
Fix ACIA status/control register, they share the same address (0xa000)
This commit is contained in:
parent
f1f1a1f8ac
commit
35ec39e13f
@ -13,17 +13,15 @@ extern usbd_device *usbd_dev;
|
||||
//
|
||||
|
||||
#define ACIAControl 0
|
||||
#define ACIAStatus 1
|
||||
#define ACIAData 2
|
||||
#define ACIAStatus 0
|
||||
#define ACIAData 1
|
||||
|
||||
// "MC6850 Data Register (R/W) Data can be read when Status.Bit0=1, and written when Status.Bit1=1."
|
||||
#define RDRF 1
|
||||
#define TDRE 2
|
||||
#define RDRF (1 << 0)
|
||||
#define TDRE (1 << 1)
|
||||
|
||||
uint8_t read6850(uint16_t address) {
|
||||
switch(address & 3) {
|
||||
case ACIAControl:
|
||||
break;
|
||||
switch(address & 1) {
|
||||
case ACIAStatus:
|
||||
return TDRE; // writable
|
||||
break;
|
||||
@ -38,13 +36,10 @@ uint8_t read6850(uint16_t address) {
|
||||
}
|
||||
|
||||
void write6850(uint16_t address, uint8_t value) {
|
||||
switch(address & 3) {
|
||||
switch(address & 1) {
|
||||
case ACIAControl:
|
||||
// TODO: decode baudrate, mode, break control, interrupt
|
||||
break;
|
||||
case ACIAStatus:
|
||||
(void) value;
|
||||
break;
|
||||
case ACIAData: {
|
||||
static char buf[1];
|
||||
buf[0] = value;
|
||||
|
Loading…
Reference in New Issue
Block a user