Files
snark13 4a081501d8 libc: сплит «1 функция = 1 модуль» — вся библиотека, wildcard-сборка
- 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>
2026-07-06 16:08:58 +03:00

40 lines
1.5 KiB
C
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/*
* mouse_text_cursor — форма курсора в текстовых режимах (RST 30h,
* fn $0A CURSOR_TEXT_MODES):
* B = 0
* H = AND-маска символа L = XOR-маска символа
* D = AND-маска атрибута E = XOR-маска атрибута
*
* SDCC __sdcccall(1) для 4×uint8_t даёт:
* sym_and в A, sym_xor в L, attr_and/attr_xor парой на стеке.
*/
#include <mouse.h>
void mouse_text_cursor(uint8_t sym_and, uint8_t sym_xor,
uint8_t attr_and, uint8_t attr_xor) __naked
{
(void)sym_and; (void)sym_xor; (void)attr_and; (void)attr_xor;
__asm
;; SDCC __sdcccall(1) для 4×uint8_t:
;; arg1 sym_and A
;; arg2 sym_xor L
;; arg3 attr_and младший байт пары на стеке
;; arg4 attr_xor старший байт пары
pop iy ; адрес возврата
pop bc ; C = attr_and (low), B = attr_xor (high)
push ix
;; Цель: H=sym_and, L=sym_xor, D=attr_and, E=attr_xor, B=0
ld h, a ; H = sym_and (из A)
; L уже держит sym_xor
ld d, c ; D = attr_and
ld e, b ; E = attr_xor
ld b, #0
ld c, #0x0A ; CURSOR TEXT MODE
rst #0x30 ; MOUSE
pop ix
jp (iy)
__endasm;
}