Use more modern types for fixed size variables.

This commit is contained in:
Godzil
2018-02-01 19:04:46 +00:00
parent a3d67a4de3
commit ad195d6c20
37 changed files with 418 additions and 454 deletions

View File

@@ -18,45 +18,45 @@
#define ATTR_PAGE_GHOST 0x02
#define ATTR_PAGE_MAPPED 0x01
typedef byte (*func_rdhook)(byte /* addr */);
typedef void (*func_wrhook)(byte addr, byte data);
typedef uint8_t (*func_rdhook)(uint8_t /* addr */);
typedef void (*func_wrhook)(uint8_t addr, uint8_t data);
/* Functions to manage pages data */
void set_page_ptr(byte page, byte *ptr);
void set_page_ptr_1k(byte page, byte *ptr);
void set_page_ptr_2k(byte page, byte *ptr);
void set_page_ptr_4k(byte page, byte *ptr);
void set_page_ptr_8k(byte page, byte *ptr);
void set_page_ptr_16k(byte page, byte *ptr);
void set_page_ptr_32k(byte page, byte *ptr);
void set_page_ptr(uint8_t page, uint8_t *ptr);
void set_page_ptr_1k(uint8_t page, uint8_t *ptr);
void set_page_ptr_2k(uint8_t page, uint8_t *ptr);
void set_page_ptr_4k(uint8_t page, uint8_t *ptr);
void set_page_ptr_8k(uint8_t page, uint8_t *ptr);
void set_page_ptr_16k(uint8_t page, uint8_t *ptr);
void set_page_ptr_32k(uint8_t page, uint8_t *ptr);
byte *get_page_ptr(byte page);
uint8_t *get_page_ptr(uint8_t page);
/* Functions to set pages attributes */
void set_page_rd_hook(byte page, func_rdhook func);
void set_page_rd_hook(uint8_t page, func_rdhook func);
void set_page_wr_hook(byte page, func_wrhook func);
void set_page_wr_hook(uint8_t page, func_wrhook func);
void set_page_readable(byte page, bool value);
void set_page_readable(uint8_t page, uint8_t value);
void set_page_writeable(byte page, bool value);
void set_page_writeable(uint8_t page, uint8_t value);
void set_page_ghost(byte page, bool value, byte ghost);
void set_page_ghost(uint8_t page, uint8_t value, uint8_t ghost);
byte get_page_attributes(byte page);
uint8_t get_page_attributes(uint8_t page);
func_rdhook get_page_rdhook(byte page);
func_rdhook get_page_rdhook(uint8_t page);
func_wrhook get_page_wrhook(byte page);
func_wrhook get_page_wrhook(uint8_t page);
/* Generalist functions */
void InitMemory();
byte ReadMemory(byte page, byte addr);
void WriteMemory(byte page, byte addr, byte value);
uint8_t ReadMemory(uint8_t page, uint8_t addr);
void WriteMemory(uint8_t page, uint8_t addr, uint8_t value);
void DumpMemoryState(FILE *fp);