diff options
author | Andreas Baumann <mail@andreasbaumann.cc> | 2020-12-30 16:55:06 +0100 |
---|---|---|
committer | Andreas Baumann <mail@andreasbaumann.cc> | 2020-12-30 16:55:06 +0100 |
commit | aff63a211e9b1e397adb9dce726d8153beb96dcd (patch) | |
tree | 28f5b85fde65cff328fad0ea1d24fe93e5678b2e /emu/7seg.h | |
parent | 53569267c59204f56e4c0fddb669536d28706e5c (diff) | |
download | 6502-aff63a211e9b1e397adb9dce726d8153beb96dcd.tar.gz 6502-aff63a211e9b1e397adb9dce726d8153beb96dcd.tar.bz2 |
- 7seg is a subdevice of the VIA 6522 now, registering to
a small sub-bus
Diffstat (limited to 'emu/7seg.h')
-rw-r--r-- | emu/7seg.h | 14 |
1 files changed, 6 insertions, 8 deletions
@@ -6,6 +6,10 @@ #include <stdint.h> #include <stdbool.h> +#ifdef WITH_GUI +#include <SDL.h> +#endif + // VIA connected on PORTA to 3 wires leading to the 3 coupled 74HC595 // shift register which enable the ROM address lines to read the LED // segment data (cells 0-15 contain the encoded 7 segments of 16 hexdigits) @@ -16,9 +20,6 @@ // +---- RCLK // +----- SRCLK enum { - PORTA = 0x01, - DDRA = 0x03, - SER = 0x01, RCLK = 0x02, SRCLK = 0x04 @@ -27,17 +28,14 @@ enum { typedef struct seg7_t { device_t base; - - uint16_t addr; - - uint8_t ddr; + uint16_t shift; uint16_t latch; bool debug; } seg7_t; -void seg7_init( seg7_t *seg, uint16_t addr, bool initialize ); +void seg7_init( seg7_t *seg, bool initialize ); uint8_t seg7_read( void *obj, uint16_t addr ); void seg7_write( void *obj, uint16_t addr, uint8_t data ); |