4a081501d8
- bios/conio/env/errno/gfx/io/mem/mouse/stdio/stdlib/string/sys/time/ video разложены по модулям: общие статики и helpers — в internal _-модулях (_conio.h/_mouse.h/_gfx.h/_palette.h/_atexit.h/_time.h) - lib/Makefile: LIBC_C = wildcard libc/*/*.c — гранулярность файлов = гранулярность DCE линкера - эффект _CODE: gfx_text 6986→2568 Б, gfx_mous −1745, gfx_demo/d16 −542; ранее timedir −3270, ls −3098, stattest −2995 - комментарии оставшихся модулей переведены на русский; puts: убран мёртвый pchars; videomode_raw разложен на get/set - docs/libc-split-asm-cases.md — правила asm-связок между модулями; docs/libc-roadmap.md — план этапа - восстановлен examples/mdview/SAMPLE.MD (нужен make floppy) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
31 lines
1.0 KiB
C
31 lines
1.0 KiB
C
/*
|
||
* 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;
|
||
}
|