libbgi: bgi256 fill-примитивы на register-ABI + typedef color_t

- удалён глобальный скретч акселератора (_gfx_acc256.c); fill-сегменты
  (_gfx_hfill256/_gfx_vfill256) принимают аргументы в регистрах HL/C/B/E,
  вызываются только из asm raw-примитивов
- новый _gfx_rectfill256: заливка прямоугольника через Horizontal_Size
- raw-примитивы (plot/read/hspan/vspan/clear) переписаны под новый ABI
- graphics.h: typedef color_t (uint8_t) для всех public color-функций
- sprinter-cc: флаг --safe (линковка *_safe.lib при наличии)
- CLAUDE.md/mame_interactive: авто-прогон тестов в MAME
- gfx_demo: демонстрация rectfill

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-10 14:32:21 +03:00
parent 52636a5d6e
commit 029607971f
31 changed files with 618 additions and 283 deletions
+11 -4
View File
@@ -20,6 +20,9 @@
#include <gfx.h> /* GFX_WIDTH/HEIGHT, gfx_pal_load (mode-agnostic) */
#include <stdint.h>
extern void gfx_rectfill(int x, int y, int w, int h, uint8_t color);
static uint8_t palette_data[256 * 4];
static void wait_key(void)
@@ -48,8 +51,11 @@ int main(void)
setcolor(0xFF);
line(1, 1, GFX_WIDTH - 2, 1); /* top */
line(1, GFX_HEIGHT - 2, GFX_WIDTH - 2, GFX_HEIGHT - 2); /* bottom */
line(1, 2, 1, GFX_HEIGHT - 4); /* left */
line(GFX_WIDTH - 2, 2, GFX_WIDTH - 2, GFX_HEIGHT - 4); /* right */
line(1, 1, 1, GFX_HEIGHT - 2); /* left */
line(GFX_WIDTH - 2, 1, GFX_WIDTH - 2, GFX_HEIGHT - 2); /* right */
// gfx_rectfill(20, 20, 40, 3, 120);
// gfx_rectfill(120, 20, 3, 40, 120);
wait_key();
/* --- Stage 2: nested rectangles --------------------------------- */
@@ -57,11 +63,12 @@ int main(void)
for (int i = 0; i < 16; i++) {
setcolor((uint8_t)(0x40 + i * 8));
rectangle(i * 10, i * 8,
GFX_WIDTH - i * 20,
GFX_HEIGHT - i * 16);
GFX_WIDTH - i * 10,
GFX_HEIGHT - i * 8);
}
wait_key();
/* --- Stage 3: filled-rect colour bars (bar = залитый прямоугольник) */
setbkcolor(0); cleardevice();
for (int i = 0; i < 16; i++) {