New barebones project using various tools
This commit is contained in:
6
.gitignore
vendored
6
.gitignore
vendored
@ -1,4 +1,8 @@
|
|||||||
.tmp/
|
.tmp/
|
||||||
*.tap
|
*.tap
|
||||||
*.sna
|
*.sna
|
||||||
*.sld
|
*.sld
|
||||||
|
*.tzx
|
||||||
|
*.block
|
||||||
|
*.zx0
|
||||||
|
*.bin
|
26
Makefile
26
Makefile
@ -1,10 +1,32 @@
|
|||||||
myprog.sna myprog.tap myprog.sld: main.asm loader.asm print.asm
|
speccydev.tzx: speccydev.tap
|
||||||
sjasmplus --sld=myprog.sld --fullpath main.asm
|
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:
|
clean:
|
||||||
rm -f *.tap
|
rm -f *.tap
|
||||||
rm -f *.sna
|
rm -f *.sna
|
||||||
rm -f *.sld
|
rm -f *.sld
|
||||||
|
rm -f *.block
|
||||||
|
rm -f *.tzx
|
||||||
|
rm -f *.bin
|
||||||
|
rm -f *.zx0
|
||||||
rm -rf .tmp/
|
rm -rf .tmp/
|
||||||
|
|
||||||
start_new_project:
|
start_new_project:
|
||||||
|
5
boriel.zxb
Normal file
5
boriel.zxb
Normal 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
61
dzx0_standard.asm
Normal 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
5
loader.bas
Normal 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
36
speccydev.asm
Normal 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
|
Reference in New Issue
Block a user