Making lines invisible in +3 mode

The place for codemasters or beginners to talk about programming any language for the Spectrum.
Post Reply
Nomad
Manic Miner
Posts: 600
Joined: Thu Dec 28, 2017 12:38 pm

Making lines invisible in +3 mode

Post by Nomad »

So in 48k basic the following works, but in +3 it fails.

Code: Select all

10    LET A = 0
POKE 23759,16 : POKE 23760,7 : POKE 23761,17 : POKE 23762,7
You should get the whole of line 10 to be concealed... but in +3 mode you are still left with the A = 0
User avatar
RMartins
Manic Miner
Posts: 776
Joined: Thu Nov 16, 2017 3:26 pm

Re: Making lines invisible in +3 mode

Post by RMartins »

The usual trick was to setup the first line with REM something.
Then just poke an unsuportted char at the end of the REM description(replace last char)
Then all that was left to do was poke the line number to be zero.

What this all does is play with implementation quirks of the Basic LIST command.
Nomad
Manic Miner
Posts: 600
Joined: Thu Dec 28, 2017 12:38 pm

Re: Making lines invisible in +3 mode

Post by Nomad »

Yea the invalid character trick - the pamphlet talks about that. I think the way that got nixed is advance to the end of the line, if the cursor goes invisible it confirms this technique is being used then you delete until the invalid characters are erased.

I been going through trade secret trying the codes - it all works in 48k but the weird thing is this fails with +3 and I can't figure out why. Its like this is just the cheese way of poking INK 7 PAPER 7 in the first four blank spaces of line 10.
User avatar
Ast A. Moore
Rick Dangerous
Posts: 2640
Joined: Mon Nov 13, 2017 3:16 pm

Re: Making lines invisible in +3 mode

Post by Ast A. Moore »

Three things:

1. The addresses are sort of meaningless, because you assume the BASIC starts at address 23755. It doesn’t consistently. The PROG system variable at 23635–6 will hold the correct address. PEEK it first, then add the displacement, then POKE these values.
2. It’s much simpler, I think, to use INV. VIDEO/TRUE VIDEO commands to set both INK and PAPER attributes to 7 (white).
3. The 128K BASIC (not just the +3 BASIC) does not support coloring the listing, so this “trick” won’t work.
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
RMartins
Manic Miner
Posts: 776
Joined: Thu Nov 16, 2017 3:26 pm

Re: Making lines invisible in +3 mode

Post by RMartins »

Nomad wrote: Sun Apr 15, 2018 12:54 pm Yea the invalid character trick - the pamphlet talks about that. I think the way that got nixed is advance to the end of the line, if the cursor goes invisible it confirms this technique is being used then you delete until the invalid characters are erased.

...
Whatever you do it can always be reversed if you know how it was done.

Note: Basic lists line 0, but does not allow you to edit it, so that "protects" the special unsupported char in the line.

Having an unsupported char in one line stops basic from listing any other line after that one.
User avatar
RMartins
Manic Miner
Posts: 776
Joined: Thu Nov 16, 2017 3:26 pm

Re: Making lines invisible in +3 mode

Post by RMartins »

But there are simple ways to defeat this for the common user, once you have the correct file to help you.

As far as I recall if we have a special file that contains a single normal REM without any special chars, already forced as line 0, you can just MERGE it in after loading the "protected" listing.
This will unprotect the file.

But I could be wrong. :lol:
Nomad
Manic Miner
Posts: 600
Joined: Thu Dec 28, 2017 12:38 pm

Re: Making lines invisible in +3 mode

Post by Nomad »

True, but still the percentage of users that would go to that extent are going to be small. I always saw it as a way to stop the majority of peasants getting the IP :lol:

Always figured by the time someone gets the disassembler out its all over.
Nomad
Manic Miner
Posts: 600
Joined: Thu Dec 28, 2017 12:38 pm

Re: Making lines invisible in +3 mode

Post by Nomad »

Thank you guys for the help on this, clearing up the 128k basic issue with the listing and making the 48k program more robust.
Post Reply