The latest ZXDB database update will be applied today at 1530 BST. The site goes down for around 30 minutes whilst this happens.

Freezing Basic

The place for codemasters or beginners to talk about programming any language for the Spectrum.
Post Reply
MrPixel
Microbot
Posts: 170
Joined: Sat Mar 24, 2018 7:42 pm

Freezing Basic

Post by MrPixel »

i decided to screw around with basic and decided to make a inescapable loop

(i was bored)

10 REM gosub loop
11 plot 12,2
12 draw 14,2
13 if Inkey$="a" then goto 20
20 goto 10


any other ways to do so?
User avatar
R-Tape
Site Admin
Posts: 6436
Joined: Thu Nov 09, 2017 11:46 am

Re: Freezing Basic

Post by R-Tape »

any other ways to do so?
I give you Spectropolis, a city that slowly comes to life at night. Watch and wonder as the lights from buildings, cars and stars flicker while the inhabitants go about their business.

Code: Select all

5 BORDER 0: PAPER 0: CLS
10 INK 1+(RND*7)
20 PLOT RND*255, RND*175
40 GOTO 10
User avatar
RMartins
Manic Miner
Posts: 776
Joined: Thu Nov 16, 2017 3:26 pm

Re: Freezing Basic

Post by RMartins »

Code: Select all

10 FOR i= 1 TO 2 STEP 0
20 PRINT i
30 NEXT i
Dumb loop will keep BASIC ocuppied.
User avatar
1024MAK
Bugaboo
Posts: 3125
Joined: Wed Nov 15, 2017 2:52 pm
Location: Sunny Somerset in the U.K. in Europe

Re: Freezing Basic

Post by 1024MAK »

Code: Select all

10 LET HELL=20 : LET bottles=1E8
20 POKE 23692,255
30 PRINT bottles;" green bottles sitting"',"on the wall..."
40 LET bottles=bottles-1
50 GO TO HELL
Mark
:!: Standby alert :!:
“There are four lights!”
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb :dance
Looking forward to summer later in the year.
MrPixel
Microbot
Posts: 170
Joined: Sat Mar 24, 2018 7:42 pm

Re: Freezing Basic

Post by MrPixel »

1024MAK wrote: Wed May 16, 2018 5:52 pm

Code: Select all

10 LET HELL=20 : LET bottles=1E8
20 POKE 23692,255
30 PRINT bottles;" green bottles sitting"',"on the wall..."
40 LET bottles=bottles-1
50 GO TO HELL
Mark
LOL :lol:
MrPixel
Microbot
Posts: 170
Joined: Sat Mar 24, 2018 7:42 pm

Re: Freezing Basic

Post by MrPixel »

you magnificent Bas**rd!
User avatar
Ast A. Moore
Rick Dangerous
Posts: 2641
Joined: Mon Nov 13, 2017 3:16 pm

Re: Freezing Basic

Post by Ast A. Moore »

When I was modding my Toast Rack to improved the video output quality, I needed to create a gray screen in BASIC, which would also access contended memory with with a varying frequency. So just did this and pressed buttons while it ran:

Code: Select all

1 RUN
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: 6436
Joined: Thu Nov 09, 2017 11:46 am

Re: Freezing Basic

Post by R-Tape »

Is it possible to properly freeze BASIC (disable BREAK) without using POKE or any USR?
User avatar
Ast A. Moore
Rick Dangerous
Posts: 2641
Joined: Mon Nov 13, 2017 3:16 pm

Re: Freezing Basic

Post by Ast A. Moore »

R-Tape wrote: Wed May 16, 2018 8:03 pm Is it possible to properly freeze BASIC (disable BREAK) without using POKE or any USR?
I don’t think so. Since you can’t disable interrupts (from BASIC), and the ISR at $38 is what checks for keypresses, I don’t see an obvious way of doing that. Well, BEEP (and a few other BASIC commands) do disable interrupts, but making a long BEEP is more of a cheat.

EDIT: Oh, you can’t fool BASIC that easily, either. BEEP doesn’t allow to play super long notes. :D
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.
AndyC
Dynamite Dan
Posts: 1416
Joined: Mon Nov 13, 2017 5:12 am

Re: Freezing Basic

Post by AndyC »

Code: Select all

10 POKE 23620,0
;)
User avatar
PeteProdge
Bugaboo
Posts: 3610
Joined: Mon Nov 13, 2017 9:03 am

Re: Freezing Basic

Post by PeteProdge »

R-Tape wrote: Wed May 16, 2018 8:03 pm Is it possible to properly freeze BASIC (disable BREAK) without using POKE or any USR?
There was a small machine code routine printed in Your Sinclair's Program Pitstop - I'm sure it was under the confusing name of 'Break-Out'. It made BASIC unbreakable. The BREAK key was just treated as if you pressed the SPACE bar on its own.
Reheated Pixels - a combination of retrogaming, comedy and factual musing, is here!
New video: Nine ZX Spectrum magazine controversies - How Crash, Your Sinclair and Sinclair User managed to offend the world!
User avatar
Seven.FFF
Manic Miner
Posts: 747
Joined: Sat Nov 25, 2017 10:50 pm
Location: USA

Re: Freezing Basic

Post by Seven.FFF »

R-Tape wrote: Wed May 16, 2018 8:03 pm without using POKE or any USR?
Custom ROM'd do it! ;P
Robin Verhagen-Guest
SevenFFF / Threetwosevensixseven / colonel32
NXtel NXTP ESP Update ESP Reset CSpect Plugins
Post Reply