Add full compiler toolchain, libc, examples and reference docs
First substantive commit: the entire Sprinter C compiler tree on top of
the bare README+gitignore initial commit.
What's in here:
bin/sprinter-cc — driver script invoking SDCC + linker + mkexe
libc/ — Sprinter-specific libc layer over ESTEX/BIOS
(conio, gfx, io, mem, stdio + headers)
runtime/ — crt0 variants (default/small/banked/minimal)
+ heap + bank trampolines
toolchain/ — mkexe (SprintEXE packer, C + tests)
examples/ — 30 demo programs (gfx, file I/O, env, time, …)
lib/Makefile — builds the libc archive (sprinter.lib)
docs/ — converted Sprinter manuals + asm reference samples
third_party/ — solid-c reference compiler dump + sdcc setup script
release_docs/ — packaging / release notes
gitignore overhaul:
• Drop dangerous blanket patterns: *.asm (would hide docs/samples/*.asm)
and *.exe (case-insensitive match was hiding third_party/solid-c/*.EXE
on macOS APFS). Replaced with examples/*/*.{asm,exe,…} and lib/*.lib.
• Restore tracking of toolchain/mkexe/tests/{one,big}.bin — those are
INPUT fixtures, not build outputs.
• Collapse the duplicated SDCC/C/Sdcc sections into one section per
concern (build outputs / vendored / OS-junk).
• Add .sprinter-cc-*/, build/ (catches lib/build/ too), .claude/.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,113 @@
|
||||
|
||||
|
||||
CTC:
|
||||
.Ch_0 equ #10
|
||||
.Ch_1 equ #11
|
||||
.Ch_2 equ #12
|
||||
.Ch_3 equ #13
|
||||
|
||||
|
||||
; процедура инициализации прерываний на CTC
|
||||
initialize_interrupts:
|
||||
ifdef ENABLE_MUSIC
|
||||
ld hl, memory_map.music_module_addr
|
||||
call sound_lib.init_psg
|
||||
endif
|
||||
|
||||
ld hl, im2_keyb_or_frame_handler
|
||||
ld (#beff), hl
|
||||
|
||||
ld hl, im2_ctc_handler
|
||||
ld (#be06), hl
|
||||
|
||||
ei
|
||||
halt
|
||||
di
|
||||
|
||||
; тут можно вставить код от Сергея,
|
||||
; который отличит клавиатурное прерывание от кадрового, и пропустит его
|
||||
|
||||
ld a, #57 : out (CTC.Ch_2),a
|
||||
ld a, 112 : out (CTC.Ch_2),a
|
||||
ld a, #d7 : out (CTC.Ch_3),a
|
||||
ld a, 160 : out (CTC.Ch_3),a
|
||||
ld a, 0 : out (CTC.Ch_0),a
|
||||
|
||||
ld a, #be
|
||||
ld i, a
|
||||
im 2
|
||||
ret
|
||||
|
||||
|
||||
; процедура отключения прерываний на CTC
|
||||
disable_interrupts:
|
||||
ld a, 1
|
||||
out (CTC.Ch_3), a
|
||||
|
||||
call im_lib.im2_off
|
||||
|
||||
ifdef ENABLE_MUSIC
|
||||
call sound_lib.init_psg
|
||||
call sound_lib.play_frame
|
||||
endif
|
||||
ret
|
||||
|
||||
|
||||
; пустой обработчик прерывания по вектору #FF
|
||||
im2_keyb_or_frame_handler:
|
||||
nop
|
||||
ei
|
||||
reti
|
||||
|
||||
|
||||
; обработчик CTC прерывания по вектору #06
|
||||
im2_ctc_handler:
|
||||
push af,bc,de,hl
|
||||
ex af, af
|
||||
push af
|
||||
|
||||
border 7
|
||||
|
||||
ifdef ENABLE_MUSIC
|
||||
in a, (SLOT3)
|
||||
push af
|
||||
|
||||
ld a, (music_page)
|
||||
out (SLOT3), a
|
||||
call sound_lib.play_frame
|
||||
endif
|
||||
|
||||
DELTA_INT_HANDLER
|
||||
|
||||
ld hl, (interrupts_count)
|
||||
inc hl
|
||||
ld (interrupts_count), hl
|
||||
|
||||
;
|
||||
; после 20 секунд (1000 прерываний) программа самозавершится
|
||||
;
|
||||
ld bc, -1000
|
||||
add hl, bc
|
||||
dec h
|
||||
jr nc, .exit
|
||||
|
||||
; установка флага "на выход"
|
||||
ld a, TRUE
|
||||
ld (delta_exit_flag), a
|
||||
|
||||
.exit:
|
||||
ifdef ENABLE_MUSIC
|
||||
pop af
|
||||
out (SLOT3), a
|
||||
endif
|
||||
|
||||
border 0
|
||||
|
||||
pop af
|
||||
ex af, af
|
||||
pop hl,de,bc,af
|
||||
|
||||
ei
|
||||
reti
|
||||
|
||||
|
||||
Reference in New Issue
Block a user