/* * pal_reset_at — восстановить встроенную палитру по умолчанию * (BIOS $A6 SET_PAL_INIT): A = pal_page, E = графическая палитра * (0..3), B = тип — PAL_GRAPH (1) / PAL_SINCLAIR (2) / PAL_CGA (3). */ #include "_palette.h" static uint8_t reset_page_; static uint8_t reset_graph_; static uint8_t reset_type_; void pal_reset_at(uint8_t type, uint8_t pal_page, uint8_t graph_pal) { reset_type_ = type; reset_page_ = pal_page; reset_graph_ = graph_pal; __asm push ix ld a, (_reset_graph_) ld e, a ; E = индекс графической палитры (0..3) ld a, (_reset_type_) ld b, a ; B = тип (1=GRAPH, 2=SINCLAIR, 3=CGA) ld a, (_reset_page_) ; A = палитровая страница (последним — A занят) ld c, #0xA6 ; BIOS SET_PAL_INIT rst #0x08 pop ix __endasm; }