From dcdcd7749a0dc31eb9f07fdc4f641658a62b520c Mon Sep 17 00:00:00 2001 From: Zack Buhman Date: Thu, 4 May 2023 14:33:46 -0700 Subject: [PATCH] smpc: add oreg/intback macros --- smpc.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/smpc.h b/smpc.h index e80105f..b24cba7 100644 --- a/smpc.h +++ b/smpc.h @@ -133,6 +133,7 @@ typedef struct smpc_reg { static_assert((sizeof (struct smpc_reg)) == 0x80); static_assert((offsetof (struct smpc_reg, OREG0)) == 0x21); +static_assert((offsetof (struct smpc_reg, OREG1)) == 0x23); static_assert((offsetof (struct smpc_reg, SF)) == 0x63); struct smpc { @@ -198,6 +199,17 @@ enum sr_bit { #define SR__P1MD__0BYTE(sr) (((sr & 0b00000011)) == (0b11 << 0)) }; +//enum port_status { +#define PORT_STATUS__CONNECTORS(oreg) ((oreg >> 0) & 0b1111) +#define PORT_STATUS__MULTITAP_ID(oreg) ((oreg >> 4) & 0b1111) +//} + +//enum peripheral_id { +#define PERIPHERAL_ID__DATA_SIZE(oreg) ((oreg >> 0) & 0b1111) +#define PERIPHERAL_ID__IS_DIGITAL_PAD(oreg) (((oreg >> 4) & 0b1111) == 0b0000) +//} + + enum digital_bit { DIGITAL__1__RIGHT = (1 << 7), DIGITAL__1__LEFT = (1 << 6),