AppleIISd/Software/src/AppleIISd.h

70 lines
1.3 KiB
C
Raw Permalink Normal View History

2019-02-25 23:42:47 +00:00
#ifndef APPLE_II_SD_H
#define APPLE_II_SD_H
2019-03-04 21:00:36 +00:00
typedef unsigned char uint8;
typedef unsigned short uint16;
2019-03-04 21:01:07 +00:00
typedef unsigned long uint32;
2019-03-05 19:41:36 +00:00
typedef unsigned char boolean;
2020-08-30 12:07:27 +00:00
#ifndef TRUE
2019-03-05 19:41:36 +00:00
#define TRUE 1
2020-08-30 12:07:27 +00:00
#endif
#ifndef FALSE
2019-03-05 19:41:36 +00:00
#define FALSE 0
2020-08-30 12:07:27 +00:00
#endif
2019-02-25 23:42:47 +00:00
2020-08-30 12:07:27 +00:00
#define SLOT_IO_START (volatile uint8*)0xC080
#define SLOT_ROM_START (volatile uint8*)0xC000
#define EXT_ROM_START (volatile uint8*)0xC800
2019-02-25 23:42:47 +00:00
2020-08-30 12:07:27 +00:00
#define CFFF (volatile uint8*)0xCFFF
2019-02-25 23:42:47 +00:00
2020-08-30 12:07:27 +00:00
typedef volatile struct
2019-02-25 23:42:47 +00:00
{
// data register
// +0
2019-03-04 21:00:36 +00:00
uint8 data;
2019-02-25 23:42:47 +00:00
// status register
// +1
union
{
struct
{
unsigned pgmen : 1;
unsigned : 1;
unsigned ece : 1;
unsigned : 1;
unsigned frx : 1;
const unsigned bsy : 1;
unsigned : 1;
const unsigned tc : 1;
};
2019-03-04 21:00:36 +00:00
uint8 status;
2019-02-25 23:42:47 +00:00
} status;
2020-08-30 12:07:27 +00:00
// clock divisor register, unused
2019-02-25 23:42:47 +00:00
// +2
2020-08-30 12:07:27 +00:00
uint8 clkDiv;
2019-02-25 23:42:47 +00:00
// slave select and card state register
// +3
union
{
struct
{
unsigned slaveSel : 1;
unsigned : 3;
unsigned sdhc : 1;
2020-08-30 12:07:27 +00:00
const unsigned wp : 1;
const unsigned card : 1;
2019-02-25 23:42:47 +00:00
unsigned inited : 1;
};
2019-03-04 21:00:36 +00:00
uint8 ss_card;
2019-02-25 23:42:47 +00:00
} ss_card;
} APPLE_II_SD_T;
#endif