Just a little head-scratcher

Show us what you're working on, (preferably with screenshots).
Bizzley
Microbot
Posts: 124
Joined: Thu Nov 16, 2017 10:47 am

Just a little head-scratcher

Post by Bizzley » Wed Jan 09, 2019 10:40 pm

I've had the idea for this for years, and with time over Xmas and New Year thanks to some lousy TV decided to see if I could get it to work. I'm sure it's been done before, the logic isn't that difficult to work out, but it was fun to code something that has no real purpose.

So, Copy and Paste the block of code below into your assembler, run it from 32768, and enjoy a little 1/2K illusion. ;)

Code: Select all

	org 32768
	defb 205,72,129,205,18,128,205,160,128,118,205,189,128,205,45,128,24,241,58,252,129,238,1,50,252,129,200,1,133,129,62,88	
	defb 17,176,44,221,33,173,129,253,33,0,64,24,16,1,141,129,62,90,17,184,45,221,33,186,129,253,33,128,80,33,104,128
	defb 113,35,112,50,143,128,33,150,128,114,33,155,128,115,253,229,209,221,35,221,126,0,254,255,200,221,134,5,254,8,245,230
	defb 7,221,119,0,6,0,79,33,133,129,9,6,32,126,18,20,126,18,20,126,18,20,126,18,20,126,18,20,126,18,20,126
	defb 18,20,126,18,20,203,154,28,16,227,241,56,196,213,38,88,221,110,9,126,84,93,44,1,31,0,237,176,18,209,24,177
	defb 1,32,0,205,63,129,221,33,199,129,17,2,72,58,252,129,167,196,216,128,221,33,212,129,17,10,72,24,27,1,224,47
	defb 205,63,129,221,33,225,129,17,18,72,58,252,129,167,196,216,128,221,33,238,129,17,26,72,221,35,221,126,0,254,255,200
	defb 221,134,5,254,8,245,230,7,221,119,0,47,230,7,6,0,79,33,149,129,9,6,8,213,229,126,18,44,20,126,18,44
	defb 20,126,18,44,20,126,18,44,20,126,18,44,20,126,18,44,20,126,18,44,20,126,18,44,20,33,32,248,25,235,225,16
	defb 215,209,28,241,56,178,213,38,89,221,110,9,78,84,93,6,7,107,123,198,224,95,26,119,16,247,121,18,209,24,153,33
	defb 235,128,112,33,52,129,113,201,33,2,89,17,165,129,213,229,6,4,26,119,44,16,251,225,84,125,198,8,95,1,24,0
	defb 237,176,125,198,8,111,209,19,26,254,255,32,225,17,0,88,205,118,129,17,128,90,213,33,165,129,1,8,0,237,176,225
	defb 14,120,237,176,201,255,254,252,248,240,224,192,128,128,192,224,240,248,252,254,255,255,255,255,255,255,255,255,255,0,0,0
	defb 0,0,0,0,0,72,81,90,99,108,117,126,71,255,0,1,2,3,255,1,2,3,4,0,32,64,96,0,1,2,3,255
	defb 1,2,3,4,159,191,223,255,0,1,2,3,255,1,2,3,4,2,3,4,5,0,1,2,3,255,1,2,3,4,10,11
	defb 12,13,0,1,2,3,255,1,2,3,4,242,243,244,245,0,1,2,3,255,1,2,3,4,250,251,252,253,0,0,0,0
[Amended to reduce flicker]
Last edited by Bizzley on Wed Jan 09, 2019 11:47 pm, edited 1 time in total.
8 x
"He made eloquent speeches to an audience consisting of a few depressed daffodil roots, and sometimes the cat from next door."

User avatar
Ast A. Moore
Dynamite Dan
Posts: 1129
Joined: Mon Nov 13, 2017 3:16 pm

Re: Just a little head-scratcher

Post by Ast A. Moore » Wed Jan 09, 2019 11:17 pm

This is really neat! Want to fix up the top part? It’s pretty glitchy. The rest is beautifully smooth.

Oh, and I love the fact that it’s 512 bytes. :D
0 x
Every man should plant a tree, build a house, and write a ZX Spectrum game.

Author of A Yankee in Iraq, a 50 fps shoot-’em-up—the first game to utilize the floating bus on the +2A/+3,
and zasm Z80 Assembler syntax highlighter.

Bizzley
Microbot
Posts: 124
Joined: Thu Nov 16, 2017 10:47 am

Re: Just a little head-scratcher

Post by Bizzley » Wed Jan 09, 2019 11:50 pm

The emulator I was using didn't give me any problems but when I tried it on some others I had the flicker you mentioned. It should be fixed now and I've changed the code above (new data in the first line) if you want to give it a try.
0 x
"He made eloquent speeches to an audience consisting of a few depressed daffodil roots, and sometimes the cat from next door."

User avatar
Ast A. Moore
Dynamite Dan
Posts: 1129
Joined: Mon Nov 13, 2017 3:16 pm

Re: Just a little head-scratcher

Post by Ast A. Moore » Thu Jan 10, 2019 12:39 am

Yup. That did fix it. Ta!
0 x
Every man should plant a tree, build a house, and write a ZX Spectrum game.

Author of A Yankee in Iraq, a 50 fps shoot-’em-up—the first game to utilize the floating bus on the +2A/+3,
and zasm Z80 Assembler syntax highlighter.

User avatar
R-Tape
Site Admin
Posts: 2331
Joined: Thu Nov 09, 2017 11:46 am

Re: Just a little head-scratcher

Post by R-Tape » Thu Jan 10, 2019 11:19 am

Image

Pretty. Somehow it's psychadelic as well as soothing.

I haven't tried to code something like this, but I wonder if it's something that seems deceptively simple until you sit down to do it (especially in 500 bytes).
2 x

User avatar
PeterJ
Site Admin
Posts: 1248
Joined: Thu Nov 09, 2017 7:19 pm
Location: Surrey, UK

Re: Just a little head-scratcher

Post by PeterJ » Thu Jan 10, 2019 11:38 am

Ohhh. I'm in hypnotic trance @R-Tape
0 x

User avatar
Sokurah
Microbot
Posts: 109
Joined: Tue Nov 14, 2017 10:38 am

Re: Just a little head-scratcher

Post by Sokurah » Thu Jan 10, 2019 11:41 am

Looks great :)
0 x
Website: Tardis Remakes / Mostly remakes of Arcade and ZX Spectrum games.
My games for the Spectrum: Dingo, The Speccies, The Speccies 2, Vallation & Sqij.
Twitter: Sokurah

User avatar
Pegaz
Manic Miner
Posts: 241
Joined: Mon Nov 13, 2017 1:44 pm

Re: Just a little head-scratcher

Post by Pegaz » Thu Jan 10, 2019 1:07 pm

Beautiful.
This reminds me of an article I read long ago.
With certain Poke commands in system variables, you could get a nice effects, similar to this one.
I found it, here:
http://retrospec.sgn.net/users/tomcat/y ... =MMH_85_01

No translation required, just type Pokes. ;)
0 x

Joefish
Manic Miner
Posts: 533
Joined: Tue Nov 14, 2017 10:26 am

Re: Just a little head-scratcher

Post by Joefish » Thu Jan 10, 2019 2:06 pm

It's neat. Somewhere I've got scraps of a scrolling engine that worked like this, pixel-rolling a pattern so you could scroll a picture of blocky attributes left/right with pixel precision. I tried to synchronise it with a per-row 128K screen-swap to give you double the attribute resolution. I was thinking of the simple 'PlaySchool' backgrounds in something like Pac-Land.
0 x

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

Re: Just a little head-scratcher

Post by dfzx » Thu Jan 10, 2019 2:52 pm

Clearly the clever people can see how it works, but can someone post a dumbed down explanation of how it's doing it for the rest of us? :?
1 x

Post Reply