27#ifndef __WF_LIBWS_EEPROM_H__
28#define __WF_LIBWS_EEPROM_H__
113#define WS_IEEP_SIZE_MONO 0x80
114#define WS_IEEP_SIZE_COLOR 0x800
116#define IEEP_ADDR_OWNER_NAME 0x60
117#define IEEP_ADDR_OWNER_BIRTHDAY_YEAR 0x70
118#define IEEP_ADDR_OWNER_BIRTHDAY_MONTH 0x72
119#define IEEP_ADDR_OWNER_BIRTHDAY_DAY 0x73
120#define IEEP_ADDR_OWNER_GENDER 0x74
121#define IEEP_ADDR_OWNER_BLOOD_TYPE 0x75
122#define IEEP_ADDR_LAST_CART_PUBLISHER 0x76
123#define IEEP_ADDR_LAST_CART_PLATFORM 0x77
124#define IEEP_ADDR_LAST_CART_GAME_ID 0x78
125#define IEEP_ADDR_CART_CHANGE_COUNT 0x7C
126#define IEEP_ADDR_NAME_CHANGE_COUNT 0x7D
127#define IEEP_ADDR_STARTUP_COUNT 0x7E
129#define IEEP_ADDR_C_OPTIONS1 0x83
130#define IEEP_C_OPTIONS1_CUSTOM_SPLASH 0x80
131#define IEEP_C_OPTIONS1_WSC_HIGH_CONTRAST 0x40
132#define IEEP_C_OPTIONS1_VOLUME(x) ((x) & 3)
133#define IEEP_C_OPTIONS1_VOLUME_MASK 0x03
135#define IEEP_ADDR_C_NAME_COLOR 0x84
136#define IEEP_C_NAME_COLOR_BLACK 0x00
137#define IEEP_C_NAME_COLOR_RED 0x01
138#define IEEP_C_NAME_COLOR_ORANGE 0x02
139#define IEEP_C_NAME_COLOR_YELLOW 0x03
140#define IEEP_C_NAME_COLOR_LIME 0x04
141#define IEEP_C_NAME_COLOR_GREEN 0x05
142#define IEEP_C_NAME_COLOR_TEAL 0x06
143#define IEEP_C_NAME_COLOR_CYAN 0x07
144#define IEEP_C_NAME_COLOR_SEABLUE 0x08
145#define IEEP_C_NAME_COLOR_BLUE 0x09
146#define IEEP_C_NAME_COLOR_PURPLE 0x0A
147#define IEEP_C_NAME_COLOR_PINK 0x0B
148#define IEEP_C_NAME_COLOR_FUCHSIA 0x0C
149#define IEEP_C_NAME_COLOR_WHITE 0x0D
150#define IEEP_C_NAME_COLOR_GRAY 0x0E
bool ws_eeprom_write_lock(ws_eeprom_handle_t handle)
Lock the EEPROM, preventing writes and erases.
void ws_eeprom_read_data(ws_eeprom_handle_t handle, uint16_t address, uint8_t *data, uint16_t length)
Read bytes from the EEPROM.
bool ws_eeprom_erase_word(ws_eeprom_handle_t handle, uint16_t address)
Erase a word from the EEPROM, setting it to 0xFFFF.
bool ws_eeprom_write_unlock(ws_eeprom_handle_t handle)
Unlock the EEPROM, allowing writes and erases.
uint8_t ws_eeprom_read_byte(ws_eeprom_handle_t handle, uint16_t address)
Read a byte from the EEPROM.
bool ws_eeprom_write_word(ws_eeprom_handle_t handle, uint16_t address, uint16_t value)
Write a word to the EEPROM.
uint16_t ws_eeprom_read_word(ws_eeprom_handle_t handle, uint16_t address)
Read an aligned word from the EEPROM.
static ws_eeprom_handle_t ws_eeprom_handle_cartridge(uint8_t bits)
ws_eeprom_handle_t ws_eeprom_handle_internal(void)
void ws_ieep_read_owner_name(uint8_t *data)
Read the owner name, as raw data.
static bool ws_ieep_protect_check(void)
Check if the non-cartridge area of the internal EEPROM is currently protected.
void ws_ieep_read_owner_name_ascii(char *str)
Read the owner name, as an ASCII string.
static void ws_ieep_protect_enable(void)
Protect the non-cartridge area of the internal EEPROM.
uint16_t ws_ieep_name_color_to_rgb(uint8_t value)
Convert a given name color to its RGB value.