2022-02-18 19:42:21 -05:00
|
|
|
#ifndef VIDEO_ATI_EEPROM_H
|
2022-07-27 17:00:34 -04:00
|
|
|
#define VIDEO_ATI_EEPROM_H
|
2022-02-18 19:42:21 -05:00
|
|
|
|
2016-08-14 22:07:17 -04:00
|
|
|
/* Copyright holders: Sarah Walker
|
|
|
|
|
see COPYING for more details
|
|
|
|
|
*/
|
2020-09-02 17:50:24 +02:00
|
|
|
|
2022-07-27 17:00:34 -04:00
|
|
|
enum {
|
|
|
|
|
EEPROM_IDLE,
|
|
|
|
|
EEPROM_WAIT,
|
|
|
|
|
EEPROM_OPCODE,
|
|
|
|
|
EEPROM_INPUT,
|
|
|
|
|
EEPROM_OUTPUT
|
2020-09-02 17:50:24 +02:00
|
|
|
};
|
|
|
|
|
|
2022-07-27 17:00:34 -04:00
|
|
|
enum {
|
|
|
|
|
EEPROM_OP_EW = 4,
|
|
|
|
|
EEPROM_OP_WRITE = 5,
|
|
|
|
|
EEPROM_OP_READ = 6,
|
|
|
|
|
EEPROM_OP_ERASE = 7,
|
2022-02-20 02:26:27 -05:00
|
|
|
|
2022-07-27 17:00:34 -04:00
|
|
|
EEPROM_OP_WRALMAIN = -1
|
2020-09-02 17:50:24 +02:00
|
|
|
};
|
|
|
|
|
|
2022-07-27 17:00:34 -04:00
|
|
|
enum {
|
|
|
|
|
EEPROM_OP_EWDS = 0,
|
|
|
|
|
EEPROM_OP_WRAL = 1,
|
|
|
|
|
EEPROM_OP_ERAL = 2,
|
|
|
|
|
EEPROM_OP_EWEN = 3
|
2020-09-02 17:50:24 +02:00
|
|
|
};
|
|
|
|
|
|
2022-07-27 17:00:34 -04:00
|
|
|
typedef struct ati_eeprom_t {
|
|
|
|
|
uint16_t data[256];
|
2020-09-02 17:50:24 +02:00
|
|
|
|
2023-06-09 23:46:54 -04:00
|
|
|
int oldclk;
|
|
|
|
|
int oldena;
|
|
|
|
|
int opcode;
|
|
|
|
|
int state;
|
|
|
|
|
int count;
|
|
|
|
|
int out;
|
2022-07-27 17:00:34 -04:00
|
|
|
int wp;
|
|
|
|
|
uint32_t dat;
|
|
|
|
|
int type;
|
|
|
|
|
int address;
|
2016-06-26 00:34:39 +02:00
|
|
|
|
2022-07-27 17:00:34 -04:00
|
|
|
char fn[256];
|
2016-06-26 00:34:39 +02:00
|
|
|
} ati_eeprom_t;
|
|
|
|
|
|
2021-03-14 20:35:01 +01:00
|
|
|
void ati_eeprom_load(ati_eeprom_t *eeprom, char *fn, int type);
|
2024-11-13 22:55:16 +01:00
|
|
|
void ati_eeprom_load_mach8(ati_eeprom_t *eeprom, char *fn, int mca);
|
|
|
|
|
void ati_eeprom_load_mach8_vga(ati_eeprom_t *eeprom, char *fn);
|
2016-06-26 00:34:39 +02:00
|
|
|
void ati_eeprom_write(ati_eeprom_t *eeprom, int ena, int clk, int dat);
|
2022-07-27 17:00:34 -04:00
|
|
|
int ati_eeprom_read(ati_eeprom_t *eeprom);
|
2022-02-18 19:42:21 -05:00
|
|
|
|
|
|
|
|
#endif /*VIDEO_ATI_EEPROM_H*/
|