;вывод стрелки на экран (тут же запоминание и стирание)
;и буфер стрелки
SHAPESPROC shapes_memorizearr
;hl=x
;a=y
call prarr_calccur
ld hl,arrbuf
memorizearrcolumn0
ld hy,ly
push de
push hl
dup 12
ld a,(de) ;scr
ld (hl),a ;buf
dec hy
jp z,memorizearrcolumnq
inc hl
ex de,hl
add hl,bc
ex de,hl
edup
ld a,(de) ;scr
ld (hl),a ;buf
memorizearrcolumnq
pop hl
ld de,13
add hl,de
pop de
bit 6,d
jr z,memorizearrcolumn_set6d
bit 5,d
jr z,memorizearrcolumn_to2
ld a,d
sub 0x60
ld d,a
inc de
dec lx
jp nz,memorizearrcolumn0
ret
memorizearrcolumn_set6d
set 6,d
dec lx
jp nz,memorizearrcolumn0
ret
memorizearrcolumn_to2
ld a,d
sub 0x20
ld d,a
dec lx
jp nz,memorizearrcolumn0
ret
SHAPESPROC shapes_rearr
;hl=x
;a=y
call prarr_calccur
ld hl,arrbuf
rearrcolumn0
ld hy,ly
push de
push hl
dup 12
ld a,(hl) ;buf
ld (de),a ;scr
dec hy
jp z,rearrcolumnq
inc hl
ex de,hl
add hl,bc
ex de,hl
edup
ld a,(hl) ;buf
ld (de),a ;scr
rearrcolumnq
pop hl
ld de,13
add hl,de
pop de
bit 6,d
jr z,rearrcolumn_set6d
bit 5,d
jr z,rearrcolumn_to2
ld a,d
sub 0x60
ld d,a
inc de
dec lx
jp nz,rearrcolumn0
ret
rearrcolumn_set6d
set 6,d
dec lx
jp nz,rearrcolumn0
ret
rearrcolumn_to2
ld a,d
sub 0x20
ld d,a
dec lx
jp nz,rearrcolumn0
ret
SHAPESPROC shapes_prarr_ring8c
;hl=x
;a=y
bit 0,l
ld de,sprring8c_l+1
jr nz,$+5+2
ld de,sprring8c_r+1
dec hl
dec hl
if 1==0
jr prarr_cross8c_go
SHAPESPROC shapes_prarr_cross8c
;hl=x
;a=y
bit 0,l
ld de,sprcross8c_l+1
jr nz,$+5+2
ld de,sprcross8c_r+1
dec hl
dec hl
endif
prarr_cross8c_go
ld b,h
ld c,l
ld l,a ;y
sub 3
ld (prarr_crosscolumny),a
ld lx,4 ;wid
push hl ;y
ex de,hl
ld de,13*2
bit 7,b
jr z,$+2+2+1+2
inc bc
inc bc
add hl,de
dec lx
dec bc ;x
dec bc ;x
bit 7,b
jr z,$+2+2+1+2
inc bc
inc bc
add hl,de
dec lx
ex de,hl
pop hl ;y
;l=y
;bc=x
;de=spr
;lx=wid
call prarr_calcscr
;bc=40
;de=scr
;lx=ширина
;ly=200-y
ld a,(prarr_crosscolumny)
add a,3
ex de,hl
dup 3
or a
jr z,prarr_cross_preskip
sbc hl,bc
dec a
edup
prarr_cross_preskip
ex de,hl
prarr_crosscolumn0
ld hy,ly
push de
push hl
prarr_crosscolumny=$+2
ld hx,0
dup 12
ld a,hx
inc hx
cp scrhgt
jr nc,1f;prarr_crosscolumnskipbyte
ld a,(de) ;scr
and (hl) ;mask
inc hl
xor (hl) ;pixels
dec hl
ld (de),a ;scr
ex de,hl
add hl,bc
ex de,hl
1;prarr_crosscolumnskipbyte
inc hl
;dec hy
;jp z,prarr_crosscolumnq
inc hl
edup
ld a,(de) ;scr
and (hl) ;mask
inc hl
xor (hl) ;pixels
ld (de),a ;scr
;prarr_crosscolumnq
pop hl
ld de,13*2
add hl,de
pop de
bit 6,d
jr z,prarr_crosscolumn_set6d
bit 5,d
jr z,prarr_crosscolumn_to2
ld a,d
sub 0x60
ld d,a
inc de
dec lx
jp nz,prarr_crosscolumn0
ret
prarr_crosscolumn_set6d
set 6,d
dec lx
jp nz,prarr_crosscolumn0
ret
prarr_crosscolumn_to2
ld a,d
sub 0x20
ld d,a
dec lx
jp nz,prarr_crosscolumn0
ret
SHAPESPROC shapes_prarr8c
;hl=x
;a=y
call prarr_calccur
prarrcolumn0
ld hy,ly
push de
push hl
dup 12
ld a,(de) ;scr
and (hl) ;mask
inc hl
xor (hl) ;pixels
ld (de),a ;scr
dec hy
jp z,prarrcolumnq
inc hl
ex de,hl
add hl,bc
ex de,hl
edup
ld a,(de) ;scr
and (hl) ;mask
inc hl
xor (hl) ;pixels
ld (de),a ;scr
prarrcolumnq
pop hl
ld de,13*2
add hl,de
pop de
bit 6,d
jr z,prarrcolumn_set6d
bit 5,d
jr z,prarrcolumn_to2
ld a,d
sub 0x60
ld d,a
inc de
dec lx
jp nz,prarrcolumn0
ret
prarrcolumn_set6d
set 6,d
dec lx
jp nz,prarrcolumn0
ret
prarrcolumn_to2
ld a,d
sub 0x20
ld d,a
dec lx
jp nz,prarrcolumn0
ret
prarr_calccur
;hl=x
;a=y
;out: hl=scr+, de=gfx, lx=wid, bc=40
push hl ;x
rr l
ld l,a ;l=y
ld de,sprarr8c_l
jr nc,prarr_nor ;de=спрайт для чётного x
ld de,sprarr8c_r ;de=спрайт для нечётного x
prarr_nor
pop bc ;x
ld a,(de)
ld lx,a
inc de
;l=y
;bc=x
;de=spr
;lx=wid
;ret
prarr_calcscr
;l=y
;bc=x
;de=spr
;lx=wid
push de ;spr
ld h,0 ;y HSB
ld a,scrhgt
sub l ;y
ld ly,a ;200-y
ld d,scrbase/256/8
ld e,l
add hl,hl
add hl,hl
add hl,de ;y*5
add hl,hl
add hl,hl
add hl,hl ;y*40 + scrbase
pop de ;spr
srl b ;теперь b=0
rr c ;c=x/2
ld a,scrwid/2
sub c ;scrwid/2-(x/2)
cp lx
jr nc,$+2+2 ;scrwid/2-(x/2) >= ширина
ld lx,a ;scrwid/2-(x/2) < ширина
srl c
jr nc,$+4
set 6,h
srl c
jr nc,$+4
set 5,h
add hl,bc
ex de,hl
ld bc,40
;bc=40
;de=scr
;lx=ширина
;ly=200-y
ret
if 1==0
sprarr_l
;mask,pixels = 0xppmm
;%rlrrrlll
db 4
dw 0x0000,0xb800,0xb800,0xb800,0xb800,0xb800,0xb800,0xb800,0xb800,0x0047,0x00ff,0x00ff,0x00ff
dw 0x00ff,0x00b8,0x4700,0xff00,0xff00,0xff00,0xff00,0xff00,0x0000,0x0047,0x00ff,0x00ff,0x00ff
dw 0x00ff,0x00ff,0x00ff,0x00b8,0x4700,0xff00,0xff00,0x4700,0x4700,0x4700,0xb800,0xb800,0x0047
dw 0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00b8,0x4700,0x00b8,0x00ff,0x00ff,0x00b8,0x00b8,0x00ff
sprarr_r
;mask,pixels = 0xppmm
;%rlrrrlll
db 5
dw 0x0047,0x0047,0x0047,0x0047,0x0047,0x0047,0x0047,0x0047,0x0047,0x00ff,0x00ff,0x00ff,0x00ff
dw 0x00b8,0x4700,0xff00,0xff00,0xff00,0xff00,0xff00,0xff00,0x4700,0x00b8,0x00ff,0x00ff,0x00ff
dw 0x00ff,0x00ff,0x00b8,0x4700,0xff00,0xff00,0xff00,0xff00,0xb800,0xb800,0x0047,0x0047,0x00ff
dw 0x00ff,0x00ff,0x00ff,0x00ff,0x00b8,0x4700,0xff00,0x0000,0x00b8,0x00b8,0x4700,0x4700,0x00b8
dw 0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00b8,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff
endif
sprarr8c_l
;mask,pixels = 0xppmm
;%rlrrrlll
db 4
dw 0x0000,0x3800,0x3800,0x3800,0x3800,0x3800,0x3800,0x3800,0x3800,0x0047,0x00ff,0x00ff,0x00ff
dw 0x00ff,0x00b8,0x0700,0x3f00,0x3f00,0x3f00,0x3f00,0x3f00,0x0000,0x0047,0x00ff,0x00ff,0x00ff
dw 0x00ff,0x00ff,0x00ff,0x00b8,0x0700,0x3f00,0x3f00,0x0700,0x0700,0x0700,0x3800,0x3800,0x0047
dw 0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00b8,0x0700,0x00b8,0x00ff,0x00ff,0x00b8,0x00b8,0x00ff
sprarr8c_r
;mask,pixels = 0xppmm
;%rlrrrlll
db 5
dw 0x0047,0x0047,0x0047,0x0047,0x0047,0x0047,0x0047,0x0047,0x0047,0x00ff,0x00ff,0x00ff,0x00ff
dw 0x00b8,0x0700,0x3f00,0x3f00,0x3f00,0x3f00,0x3f00,0x3f00,0x0700,0x00b8,0x00ff,0x00ff,0x00ff
dw 0x00ff,0x00ff,0x00b8,0x0700,0x3f00,0x3f00,0x3f00,0x3f00,0x3800,0x3800,0x0047,0x0047,0x00ff
dw 0x00ff,0x00ff,0x00ff,0x00ff,0x00b8,0x0700,0x3f00,0x0000,0x00b8,0x00b8,0x0700,0x0700,0x00b8
dw 0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00b8,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff
if 1==0
sprcross_l
;mask,pixels = 0xppmm
;%rlrrrlll
db 4
dw 0x00ff,0x00ff,0x00ff,0xffff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff
dw 0xb8ff,0xb8ff,0xb8ff,0xffff,0xb8ff,0xb8ff,0xb8ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff
dw 0x00ff,0x00ff,0x00ff,0xffff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff
dw 0x00ff,0x00ff,0x00ff,0x47ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff
sprcross_r
;mask,pixels = 0xppmm
;%rlrrrlll
db 4
dw 0x00ff,0x00ff,0x00ff,0xb8ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff
dw 0x00ff,0x00ff,0x00ff,0xffff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff
dw 0x47ff,0x47ff,0x47ff,0xffff,0x47ff,0x47ff,0x47ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff
dw 0x00ff,0x00ff,0x00ff,0xffff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff
sprwindow_l
;mask,pixels = 0xppmm
;%rlrrrlll
db 4
dw 0x00ff,0x00ff,0x00ff,0xffff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff
dw 0xb8ff,0xb8ff,0xb8ff,0xffff,0xb8ff,0xb8ff,0xb8ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff
dw 0x00ff,0x00ff,0x00ff,0xffff,0x00ff,0x00ff,0xb8ff,0xb8ff,0xb8ff,0x00ff,0x00ff,0x00ff,0x00ff
dw 0x00ff,0x00ff,0x00ff,0x47ff,0x00ff,0x00ff,0xffff,0xb8ff,0xffff,0x00ff,0x00ff,0x00ff,0x00ff
sprwindow_r
;mask,pixels = 0xppmm
;%rlrrrlll
db 5
dw 0x00ff,0x00ff,0x00ff,0xb8ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff
dw 0x00ff,0x00ff,0x00ff,0xffff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff
dw 0x47ff,0x47ff,0x47ff,0xffff,0x47ff,0x47ff,0x47ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff
dw 0x00ff,0x00ff,0x00ff,0xffff,0x00ff,0x00ff,0xffff,0x47ff,0xffff,0x00ff,0x00ff,0x00ff,0x00ff
dw 0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x47ff,0x47ff,0x47ff,0x00ff,0x00ff,0x00ff,0x00ff
sprfill_l
;mask,pixels = 0xppmm
;%rlrrrlll
db 4
dw 0x00ff,0x00ff,0x00ff,0xffff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff
dw 0xb8ff,0xb8ff,0xb8ff,0xffff,0xb8ff,0xb8ff,0xb8ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff
dw 0x00ff,0x00ff,0x00ff,0xffff,0x00ff,0x00ff,0x00ff,0xb8ff,0xb8ff,0x00ff,0x00ff,0x00ff,0x00ff
dw 0x00ff,0x00ff,0x00ff,0x47ff,0x00ff,0x47ff,0x47ff,0xb8ff,0xffff,0x47ff,0x00ff,0x00ff,0x00ff
sprfill_r
;mask,pixels = 0xppmm
;%rlrrrlll
db 5
dw 0x00ff,0x00ff,0x00ff,0xb8ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff
dw 0x00ff,0x00ff,0x00ff,0xffff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff
dw 0x47ff,0x47ff,0x47ff,0xffff,0x47ff,0x47ff,0x47ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff
dw 0x00ff,0x00ff,0x00ff,0xffff,0x00ff,0xb8ff,0xb8ff,0x47ff,0xffff,0xb8ff,0x00ff,0x00ff,0x00ff
dw 0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x47ff,0x47ff,0x00ff,0x00ff,0x00ff,0x00ff
sprtext_l
;mask,pixels = 0xppmm
;%rlrrrlll
db 4
dw 0x00ff,0x00ff,0x00ff,0xffff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff
dw 0xb8ff,0xb8ff,0xb8ff,0xffff,0xb8ff,0xb8ff,0xb8ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff
dw 0x00ff,0x00ff,0x00ff,0xffff,0x00ff,0x00ff,0xb8ff,0x00ff,0x00ff,0xb8ff,0x00ff,0x00ff,0x00ff
dw 0x00ff,0x00ff,0x00ff,0x47ff,0x00ff,0x00ff,0xffff,0x47ff,0x47ff,0xffff,0x00ff,0x00ff,0x00ff
sprtext_r
;mask,pixels = 0xppmm
;%rlrrrlll
db 5
dw 0x00ff,0x00ff,0x00ff,0xb8ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff
dw 0x00ff,0x00ff,0x00ff,0xffff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff
dw 0x47ff,0x47ff,0x47ff,0xffff,0x47ff,0x47ff,0x47ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff
dw 0x00ff,0x00ff,0x00ff,0xffff,0x00ff,0x00ff,0xffff,0xb8ff,0xb8ff,0xffff,0x00ff,0x00ff,0x00ff
dw 0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x47ff,0x00ff,0x00ff,0x47ff,0x00ff,0x00ff,0x00ff
endif
;;;;;;; для палитры (инвертируют внутри первых 8 цветов)
if 1==0
sprcross8c_l
;mask,pixels = 0xppmm
;%rlrrrlll
db 4
dw 0x00ff,0x00ff,0x00ff,0x3fff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff
dw 0x38ff,0x38ff,0x38ff,0x3fff,0x38ff,0x38ff,0x38ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff
dw 0x00ff,0x00ff,0x00ff,0x3fff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff
dw 0x00ff,0x00ff,0x00ff,0x07ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff
sprcross8c_r
;mask,pixels = 0xppmm
;%rlrrrlll
db 4
dw 0x00ff,0x00ff,0x00ff,0x38ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff
dw 0x00ff,0x00ff,0x00ff,0x3fff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff
dw 0x07ff,0x07ff,0x07ff,0x3fff,0x07ff,0x07ff,0x07ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff
dw 0x00ff,0x00ff,0x00ff,0x3fff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff
endif
sprring8c_l
;mask,pixels = 0xppmm
;%rlrrrlll
db 4
dw 0x00ff,0x38ff,0x07ff,0x07ff,0x07ff,0x38ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff
dw 0x3fff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x3fff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff
dw 0x07ff,0x38ff,0x00ff,0x00ff,0x00ff,0x38ff,0x07ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff
dw 0x00ff,0x00ff,0x07ff,0x07ff,0x07ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff
sprring8c_r
;mask,pixels = 0xppmm
;%rlrrrlll
db 4
dw 0x00ff,0x00ff,0x38ff,0x38ff,0x38ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff
dw 0x38ff,0x07ff,0x00ff,0x00ff,0x00ff,0x07ff,0x38ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff
dw 0x3fff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x3fff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff
dw 0x00ff,0x07ff,0x38ff,0x38ff,0x38ff,0x07ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff,0x00ff
sprringon_l
;mask,pixels = #ppmm
;%rlrrrlll
db 4
dw #00ff,#3847,#07b8,#07b8,#07b8,#3847,#00ff,#00ff,#00ff,#00ff,#00ff,#00ff,#00ff
dw #3f00,#00ff,#00ff,#00ff,#00ff,#00ff,#3f00,#00ff,#00ff,#00ff,#00ff,#00ff,#00ff
dw #07b8,#3847,#00ff,#00ff,#00ff,#3847,#07b8,#00ff,#00ff,#00ff,#00ff,#00ff,#00ff
dw #00ff,#00ff,#07b8,#07b8,#07b8,#00ff,#00ff,#00ff,#00ff,#00ff,#00ff,#00ff,#00ff
sprringon_r
;mask,pixels = #ppmm
;%rlrrrlll
db 4
dw #00ff,#00ff,#3847,#3847,#3847,#00ff,#00ff,#00ff,#00ff,#00ff,#00ff,#00ff,#00ff
dw #3847,#07b8,#00ff,#00ff,#00ff,#07b8,#3847,#00ff,#00ff,#00ff,#00ff,#00ff,#00ff
dw #3f00,#00ff,#00ff,#00ff,#00ff,#00ff,#3f00,#00ff,#00ff,#00ff,#00ff,#00ff,#00ff
dw #00ff,#07b8,#3847,#3847,#3847,#07b8,#00ff,#00ff,#00ff,#00ff,#00ff,#00ff,#00ff
sprringoff_l
;mask,pixels = #ppmm
;%rlrrrlll
db 4
dw #00ff,#0047,#00b8,#00b8,#00b8,#0047,#00ff,#00ff,#00ff,#00ff,#00ff,#00ff,#00ff
dw #0000,#00ff,#00ff,#00ff,#00ff,#00ff,#0000,#00ff,#00ff,#00ff,#00ff,#00ff,#00ff
dw #00b8,#0047,#00ff,#00ff,#00ff,#0047,#00b8,#00ff,#00ff,#00ff,#00ff,#00ff,#00ff
dw #00ff,#00ff,#00b8,#00b8,#00b8,#00ff,#00ff,#00ff,#00ff,#00ff,#00ff,#00ff,#00ff
sprringoff_r
;mask,pixels = #ppmm
;%rlrrrlll
db 4
dw #00ff,#00ff,#0047,#0047,#0047,#00ff,#00ff,#00ff,#00ff,#00ff,#00ff,#00ff,#00ff
dw #0047,#00b8,#00ff,#00ff,#00ff,#00b8,#0047,#00ff,#00ff,#00ff,#00ff,#00ff,#00ff
dw #0000,#00ff,#00ff,#00ff,#00ff,#00ff,#0000,#00ff,#00ff,#00ff,#00ff,#00ff,#00ff
dw #00ff,#00b8,#0047,#0047,#0047,#00b8,#00ff,#00ff,#00ff,#00ff,#00ff,#00ff,#00ff
arrbuf
ds 13*5