27#ifndef __WF_LIBWS_CARTRIDGE_H__
28#define __WF_LIBWS_CARTRIDGE_H__
38#define WF_BANK_INDEX(x) (x)
45#define MEM_RAM ((uint8_t __wf_iram*) 0x00000000)
46#define MEM_SRAM ((uint8_t __far*) 0x10000000)
47#define MEM_ROM0 ((uint8_t __far*) 0x20000000)
48#define MEM_ROM1 ((uint8_t __far*) 0x30000000)
49#define MEM_ROM_LINEAR ((uint8_t __far*) 0x40000000)
59 asm volatile(
"" :::
"memory");
60 uint8_t old_bank = inportb(port);
61 outportb(port, new_bank);
62 asm volatile(
"" :::
"memory");
67 asm volatile(
"" :::
"memory");
68 outportb(port, new_bank);
69 asm volatile(
"" :::
"memory");
78#define ws_bank_ram_save(new_bank) __ws_bank_save(IO_BANK_RAM, (new_bank))
85#define ws_bank_ram_set(new_bank) __ws_bank_set(IO_BANK_RAM, (new_bank))
86#define ws_bank_ram_restore ws_bank_ram_set
94#define ws_bank_rom0_save(new_bank) __ws_bank_save(IO_BANK_ROM0, (new_bank))
101#define ws_bank_rom0_set(new_bank) __ws_bank_set(IO_BANK_ROM0, (new_bank))
102#define ws_bank_rom0_restore ws_bank_rom0_set
110#define ws_bank_rom1_save(new_bank) __ws_bank_save(IO_BANK_ROM1, (new_bank))
117#define ws_bank_rom1_set(new_bank) __ws_bank_set(IO_BANK_ROM1, (new_bank))
118#define ws_bank_rom1_restore ws_bank_rom1_set
126#define ws_bank_rom_linear_save(new_bank) __ws_bank_save(IO_BANK_ROM_LINEAR, (new_bank))
133#define ws_bank_rom_linear_set(new_bank) __ws_bank_set(IO_BANK_ROM_LINEAR, (new_bank))
134#define ws_bank_rom_linear_restore ws_bank_rom_linear_set
void ws_cart_gpo_disable(uint8_t id)
Disable general-purpose output.
static void __ws_bank_set(uint8_t port, ws_bank_t new_bank)
void ws_cart_gpo_set(uint8_t id, bool val)
Set general-purpose output value.
void ws_cart_gpo_enable(uint8_t id)
Enable general-purpose output.
static ws_bank_t __ws_bank_save(uint8_t port, ws_bank_t new_bank)