Black squares...

The place for codemasters or beginners to talk about programming any language for the Spectrum.
User avatar
1024MAK
Manic Miner
Posts: 533
Joined: Wed Nov 15, 2017 2:52 pm
Location: Sunny Somerset in the U.K. in Europe

Re: Black squares...

Post by 1024MAK » Sat Aug 03, 2019 8:08 am

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
1 x

llewelyn
Dizzy
Posts: 94
Joined: Thu Feb 22, 2018 3:27 pm
Location: virginias eastern shore
Contact:

Re: Black squares...

Post by llewelyn » Sat Aug 03, 2019 11:33 am

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.
0 x

User avatar
PROSM
Dizzy
Posts: 99
Joined: Fri Nov 17, 2017 7:18 pm
Location: Sunderland, England
Contact:

Re: Black squares...

Post by PROSM » Sat Aug 03, 2019 12:20 pm

llewelyn wrote:
Sat Aug 03, 2019 11:33 am
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.
0 x
All software to-date

Current Projects:
Currently working on ZX Adventure Designer, which lets one create point-and-click graphic adventures for a 48K Spectrum.

llewelyn
Dizzy
Posts: 94
Joined: Thu Feb 22, 2018 3:27 pm
Location: virginias eastern shore
Contact:

Re: Black squares...

Post by llewelyn » Sat Aug 03, 2019 1:50 pm

Thanks Prosm! Does that also include key command words and punctuation?
0 x

User avatar
PROSM
Dizzy
Posts: 99
Joined: Fri Nov 17, 2017 7:18 pm
Location: Sunderland, England
Contact:

Re: Black squares...

Post by PROSM » Sat Aug 03, 2019 3:46 pm

llewelyn wrote:
Sat Aug 03, 2019 1: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 3: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
1 x
All software to-date

Current Projects:
Currently working on ZX Adventure Designer, which lets one create point-and-click graphic adventures for a 48K Spectrum.

dfzx
Microbot
Posts: 170
Joined: Mon Nov 13, 2017 6:55 pm
Location: New Forest, UK
Contact:

Re: Black squares...

Post by dfzx » Sun Aug 04, 2019 11:02 am

llewelyn wrote:
Sat Aug 03, 2019 11:33 am
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. :(
0 x

Post Reply