Files
Sprinter-SDCC/tests/banktest/banked.c
T
snark13 1b39a60ff0 tests: add hello2, simple, banktest smoke tests
hello2 — stdio vs conio output API comparison (fast/no-attr vs
slower/attributed), also exercises textcolor/textbackground.
simple — packed 2-bit style array bit-twiddling smoke test.
banktest — __banked function calls across two explicit banks in huge
memory mode.

hello2.c updated to call the renamed gettextmode/settextmode (see the
conio rename in 5e5e70d).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-23 17:12:19 +03:00

35 lines
804 B
C

#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;
}