New barebones project using various tools

This commit is contained in:
2025-06-23 14:34:21 +00:00
parent 55b456ec06
commit 7154c9bfc8
6 changed files with 136 additions and 3 deletions

6
.gitignore vendored
View File

@ -1,4 +1,8 @@
.tmp/
*.tap
*.sna
*.sld
*.sld
*.tzx
*.block
*.zx0
*.bin

View File

@ -1,10 +1,32 @@
myprog.sna myprog.tap myprog.sld: main.asm loader.asm print.asm
sjasmplus --sld=myprog.sld --fullpath main.asm
speccydev.tzx: speccydev.tap
tapeconv speccydev.tap speccydev.tzx
speccydev.tap: sjasm.tap loader.tap boriel.zx0.block
cat loader.tap sjasm.tap boriel.zx0.block > speccydev.tap
myprog.sna sjasm.tap myprog.sld: speccydev.asm dzx0_standard.asm boriel.zx0
sjasmplus --sld=myprog.sld --fullpath speccydev.asm
loader.tap: loader.bas
zmakebas -a 30 -n SpeccyDev -o loader.tap loader.bas
boriel.bin: boriel.zxb
zxbc -S 40000 -o boriel.bin boriel.zxb
boriel.zx0: boriel.bin
zx0 -f boriel.bin boriel.zx0
boriel.zx0.block: boriel.zx0
ttttt boriel.zx0 data
clean:
rm -f *.tap
rm -f *.sna
rm -f *.sld
rm -f *.block
rm -f *.tzx
rm -f *.bin
rm -f *.zx0
rm -rf .tmp/
start_new_project:

5
boriel.zxb Normal file
View File

@ -0,0 +1,5 @@
10 CLS
20 FOR i = 0 TO 23
30 PRINT "ZX Spectrum Rules OK!"
40 NEXT i
50 PAUSE 0

61
dzx0_standard.asm Normal file
View File

@ -0,0 +1,61 @@
; -----------------------------------------------------------------------------
; ZX0 decoder by Einar Saukas & Urusergi
; "Standard" version (68 bytes only)
; -----------------------------------------------------------------------------
; Parameters:
; HL: source address (compressed data)
; DE: destination address (decompressing)
; -----------------------------------------------------------------------------
dzx0_standard:
ld bc, $ffff ; preserve default offset 1
push bc
inc bc
ld a, $80
dzx0s_literals:
call dzx0s_elias ; obtain length
ldir ; copy literals
add a, a ; copy from last offset or new offset?
jr c, dzx0s_new_offset
call dzx0s_elias ; obtain length
dzx0s_copy:
ex (sp), hl ; preserve source, restore offset
push hl ; preserve offset
add hl, de ; calculate destination - offset
ldir ; copy from offset
pop hl ; restore offset
ex (sp), hl ; preserve offset, restore source
add a, a ; copy from literals or new offset?
jr nc, dzx0s_literals
dzx0s_new_offset:
pop bc ; discard last offset
ld c, $fe ; prepare negative offset
call dzx0s_elias_loop ; obtain offset MSB
inc c
ret z ; check end marker
ld b, c
ld c, (hl) ; obtain offset LSB
inc hl
rr b ; last offset bit becomes first length bit
rr c
push bc ; preserve new offset
ld bc, 1 ; obtain length
call nc, dzx0s_elias_backtrack
inc bc
jr dzx0s_copy
dzx0s_elias:
inc c ; interlaced Elias gamma coding
dzx0s_elias_loop:
add a, a
jr nz, dzx0s_elias_skip
ld a, (hl) ; load another group of 8 bits
inc hl
rla
dzx0s_elias_skip:
ret c
dzx0s_elias_backtrack:
add a, a
rl c
rl b
jr dzx0s_elias_loop
; -----------------------------------------------------------------------------

5
loader.bas Normal file
View File

@ -0,0 +1,5 @@
10 REM This file was created
20 REM using zmakebas
30 CLEAR 32767
40 LOAD ""CODE
50 RANDOMIZE USR 32768

36
speccydev.asm Normal file
View File

@ -0,0 +1,36 @@
code_start_addr EQU #8000
org code_start_addr
; headerless load
scf
ld a, #ff
ld de, boriel_size
ld ix, compressed_boriel
call #0556
decompress:
ld hl, compressed_boriel
ld de, uncompressed_boriel
call dzx0.dzx0_standard
call uncompressed_boriel
ret
MODULE dzx0
INCLUDE "dzx0_standard.asm"
ENDMODULE
code_length EQU $ - code_start_addr
compressed_boriel:
INCBIN "boriel.zx0"
boriel_size EQU $ - compressed_boriel
uncompressed_boriel EQU 40000
DEVICE ZXSPECTRUM48
SLDOPT COMMENT WPMEM, LOGPOINT, ASSERTION
SAVESNA "myprog.sna", decompress
EMPTYTAP "sjasm.tap"
SAVETAP "sjasm.tap", CODE, "sjasm", code_start_addr, code_length