1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-14 15:28:05 +11:00
collapseos/emul/z80/sms_ports.h
Virgil Dupras 2b8524d11e sms: CPORT_CTL is write-only!
why did I think that I could read from it?
2020-11-08 08:43:24 -05:00

21 lines
448 B
C

#pragma once
#include "emul.h"
// Each port is a bitmask of each pin's status. 1 means high.
// From Bit 0 to 6: up, down, left, right, TL, TR, TH
typedef struct {
uint8_t ctl;
Tristate TRA;
Tristate THA;
Tristate TRB;
Tristate THB;
IORD portA_rd;
IORD portB_rd;
} Ports;
void ports_init(Ports *ports);
void ports_ctl_wr(Ports *ports, uint8_t val);
uint8_t ports_A_rd(Ports *ports);
uint8_t ports_B_rd(Ports *ports);