Running code from the display file

The place for codemasters or beginners to talk about programming any language for the Spectrum.
Post Reply
User avatar
R-Tape
Site Admin
Posts: 6406
Joined: Thu Nov 09, 2017 11:46 am

Running code from the display file

Post by R-Tape »

The only program I know that runs code from the screen is Woody's splendid Scumball 2. The entire program is in the bottom segment of the display file:

Image

I want to do something similar. Scumball2 works in SPIN, Spectaculator, QAOP and on the Next. Can anyone think of any reason why this will not run correctly on any model of Spectrum, emulator or online emulator?
User avatar
ketmar
Manic Miner
Posts: 699
Joined: Tue Jun 16, 2020 5:25 pm
Location: Ukraine

Re: Running code from the display file

Post by ketmar »

it's perfectly ok. just don't create interrupt table there, and remember that your code will be contended. otherwise, screen memory is just a normal memory. ;-)
+3code

Re: Running code from the display file

Post by +3code »

R-Tape wrote: Sat Oct 24, 2020 11:22 am Scumball2 works in SPIN, Spectaculator, QAOP and on the Next. Can anyone think of any reason why this will not run correctly on any model of Spectrum, emulator or online emulator?
In FUSE it runs OK.
User avatar
Lethargeek
Manic Miner
Posts: 743
Joined: Wed Dec 11, 2019 6:47 am

Re: Running code from the display file

Post by Lethargeek »

R-Tape wrote: Sat Oct 24, 2020 11:22 am The only program I know that runs code from the screen is Woody's splendid Scumball 2. The entire program is in the bottom segment of the display file:
Maybe this is "the only (complete and complex) program that runs entirely in the screen memory" but definitely not the only one that sometimes runs some code in the screen memory. One of the recent examples is Redshift running decompression routine in the temporarily inactive screen page. Also some games keep code and data in the hidden screen memory permanently (sometimes in the page 5).
User avatar
ketmar
Manic Miner
Posts: 699
Joined: Tue Jun 16, 2020 5:25 pm
Location: Ukraine

Re: Running code from the display file

Post by ketmar »

the great TF-COPY has "maximum memory" mode, where it keeps most of its code in screen$ too.
User avatar
R-Tape
Site Admin
Posts: 6406
Joined: Thu Nov 09, 2017 11:46 am

Re: Running code from the display file

Post by R-Tape »

Cheers all. It looks like this is safe to do without confusing any emulators.
Lethargeek wrote: Sat Oct 24, 2020 11:49 am Maybe this is "the only (complete and complex) program that runs entirely in the screen memory" but definitely not the only one that sometimes runs some code in the screen memory. One of the recent examples is Redshift running decompression routine in the temporarily inactive screen page. Also some games keep code and data in the hidden screen memory permanently (sometimes in the page 5).
I bet there are loads of programs that use the screen a little bit. I've often seen cracked versions where some setup code is place on the screen.
ketmar wrote: Sat Oct 24, 2020 11:52 am the great TF-COPY has "maximum memory" mode, where it keeps most of its code in screen$ too.
Cool. There's about 1K of code around 24000, but the whole top screen segment is being used.
AndyC
Dynamite Dan
Posts: 1406
Joined: Mon Nov 13, 2017 5:12 am

Re: Running code from the display file

Post by AndyC »

Didn't 007 Disassembler also run entirely from within screen RAM?
Post Reply