Page 1 of 1

Re: Black squares...

Posted: Sat Aug 03, 2019 9:08 am
by 1024MAK
A better colour version:

Code: Select all

1 FOR a=0 TO 14444: POKE PEEK a+PEEK (a+1) +PEEK (a+2) +22528,RND*56: NEXT a: GO TO 1
Mark

Re: Black squares...

Posted: Sat Aug 03, 2019 12:33 pm
by llewelyn
That's cool Mark. I typed it in and ran it, noticed that diagonal tendency to the way the squares are placed. Interesting.

BTW is there a command to make the keyboard window in Fuse get bigger somehow? I have to use a magnifying glass to read it.

Re: Black squares...

Posted: Sat Aug 03, 2019 1:20 pm
by PROSM
llewelyn wrote: Sat Aug 03, 2019 12:33 pm BTW is there a command to make the keyboard window in Fuse get bigger somehow? I have to use a magnifying glass to read it.
If you're talking about the "Keyboard Helper" window, then I'm afraid not - that's the biggest it gets. If you are having trouble with the keyword entry system, you might want to try typing in your BASIC programs from 128K mode; you can type your commands out letter by letter from there.

Re: Black squares...

Posted: Sat Aug 03, 2019 2:50 pm
by llewelyn
Thanks Prosm! Does that also include key command words and punctuation?

Re: Black squares...

Posted: Sat Aug 03, 2019 4:46 pm
by PROSM
llewelyn wrote: Sat Aug 03, 2019 2:50 pm Thanks Prosm! Does that also include key command words and punctuation?
In 128K mode, the only key positions you'll have to remember are for the punctuation marks. Everything else is typed out letter by letter, including key command words.

You may also want to consider trying out the "Keyboard Helper" function in ZX Spin. This allows you to write out whole BASIC statements using the PC keyboard mapping by first typing them into a separate input box, and then by clicking a button, allowing the emulator to convert these to Spectrum key presses.

In addition, the BASin development environment allows you to write BASIC programs in a standard Windows environment, and test them out in an integrated emulator at any time. It also comes with many useful features, such as a UDG editor, a debugger and a line renumbering facility.

To get slightly back on topic... :)
spider wrote: Fri Aug 02, 2019 4:01 pm ... I think if you added a splash of colour to the squares in your routine it would be even better 8-)
Image

Not yet random colour, but somewhat prettier:

Code: Select all

org 28000

c_mosaicfade:
		ld a,39					; Galois LFSR seed
		ld d,$38				; LFSR mask (and mask for attributes)
c_mosaicfade_l1:
		ld b,3					; 9 squares per frame
c_mosaicfade_l2:
		call c_mosaicfade_plot			; Plot square
		djnz c_mosaicfade_l2
		halt
		jr c_mosaicfade_l1

c_mosaicfade_plot:
		rrca					; Rotate
		jr nc,c_mosaicfade_plot_l1
		xor d					; XOR if last bit cycled was 1 (feedback part)

c_mosaicfade_plot_l1:
		ld l,a
		ld h,$58

		call c_matchcolours
		ld (hl),a				; 1st attr. page
		
		ld a,l
		inc h
		xor %00110110				; Randomise position
		ld l,a
		call c_matchcolours			; Set ink to be same colour as paper
		ld (hl),a

		ld a,l					; Get page position value
		inc h
		xor %11001001				; Randomise position
		ld l,a
		call c_matchcolours
		ld (hl),a
		
		ld a,l
		cpl					; Restore to original value (equiv. to XOR $FF)

c_mosaicfade_plot_l2:
		cp 39					; Are we back to the start of the period?
		ret nz					; Return if not
		or a
		ret z
		pop hl					; We want to return directly to the caller

		xor a
		jr c_mosaicfade_plot_l1

c_matchcolours:
		and d					; Keep only the paper colour
		ld c,a
		rrca
		rrca
		rrca					; Rotate paper colour into ink colour slot
		or c					; Combine paper and ink colours
		ret

end 28000

Re: Black squares...

Posted: Sun Aug 04, 2019 12:02 pm
by dfzx
llewelyn wrote: Sat Aug 03, 2019 12:33 pm BTW is there a command to make the keyboard window in Fuse get bigger somehow? I have to use a magnifying glass to read it.
The Fuse keyboard graphic was replaced by a much better one back in December. Unfortunately development of Fuse has rather stalled and they've not released a new version since before then. :(