#include <stdio.h>
#include <stdint.h>
#include <sprinter.h>

/* crt0_banked.s reads this constant to know how many banks to load. */
const uint8_t n_banks = 2;

void bank1_func(void) __banked;
void bank2_func(void) __banked;
void bank1_func2(uint16_t) __banked;

extern uint16_t bank1var;
extern uint16_t bank2var;

extern uint8_t bank_pages[];   /* filled by crt0_banked.s */

int main(void)
{
    bank1var = 1;
    bank2var = 2;
    puts("HOME: program start.");
    printf("HOME: window 3 phys page = 0x%02X\n", _io_page_w3);
    printf("HOME: bank_pages[1] = 0x%02X\n", bank_pages[1]);
    printf("HOME: bank_pages[2] = 0x%02X\n", bank_pages[2]);

    bank1_func();
    bank2_func();
    bank1_func2(25);
    bank2_func();

    puts("Press any key to exit...");
    (void)getchar();
    return 0;
}
