Poke to hide "Program:, Bytes:" tape loading prompts

The place for codemasters or beginners to talk about programming any language for the Spectrum.
equinox
Dynamite Dan
Posts: 1052
Joined: Mon Oct 08, 2018 1:57 am
Location: SE England

Poke to hide "Program:, Bytes:" tape loading prompts

Post by equinox »

Hi. I remember that there's a poke that can be used immediately before LOAD, to hide the "Program:, Bytes:" etc. prompt from the screen (so it doesn't wreck your pretty loading screen or whatever).

To my surprise I can't find this poke despite some diligent search attempts. Please remind me!
User avatar
MustardTiger
Microbot
Posts: 122
Joined: Tue May 02, 2023 8:05 pm

Re: Poke to hide "Program:, Bytes:" tape loading prompts

Post by MustardTiger »

10 CLEAR 24575: LOAD ""SCREEN$: POKE 23739,111: LOAD ""CODE: RANDOMIZE USR 24576

I searched for this recently and it took ages to find. I haven't tried it though, just pasted the code at the bottom of my source for when I need it.
equinox
Dynamite Dan
Posts: 1052
Joined: Mon Oct 08, 2018 1:57 am
Location: SE England

Re: Poke to hide "Program:, Bytes:" tape loading prompts

Post by equinox »

MustardTiger wrote: Mon Feb 12, 2024 6:25 pm 10 CLEAR 24575: LOAD ""SCREEN$: POKE 23739,111: LOAD ""CODE: RANDOMIZE USR 24576

I searched for this recently and it took ages to find. I haven't tried it though, just pasted the code at the bottom of my source for when I need it.
POKE 23739,111, that's the bunny. Thanks.
Also explains why I couldn't find it in the manual (chapter 25: system variables), since their list ends a few bytes earlier, at 23732.

Maybe the Tipshop needs a section for all those handy non-game pokes... hmmm :)
User avatar
ParadigmShifter
Manic Miner
Posts: 670
Joined: Sat Sep 09, 2023 4:55 am

Re: Poke to hide "Program:, Bytes:" tape loading prompts

Post by ParadigmShifter »

It's part of the channel info which is at the end of the SYSVAR area and is 21 bytes long

https://skoolkid.github.io/rom/dec/asm/23734.html

Presumably it sends it to some null device or something which doesn't appear on the screen when you poke it with 111.

Hmm its replacing the low byte of a function pointer with 111... maybe that just points to a RET instruction in the ROM afterwards or something
User avatar
MustardTiger
Microbot
Posts: 122
Joined: Tue May 02, 2023 8:05 pm

Re: Poke to hide "Program:, Bytes:" tape loading prompts

Post by MustardTiger »

ParadigmShifter wrote: Mon Feb 12, 2024 6:40 pm
Hmm its replacing the low byte of a function pointer with 111... maybe that just points to a RET instruction in the ROM afterwards or something
Just looking at the Rom disassembly, it's doing just that. Points to a Ret rather than the PRINT_OUT function.
User avatar
ParadigmShifter
Manic Miner
Posts: 670
Joined: Sat Sep 09, 2023 4:55 am

Re: Poke to hide "Program:, Bytes:" tape loading prompts

Post by ParadigmShifter »

Does that bugger up normal printing then until you set it back? Only an issue if you use the super slow ROM to do printing (or BASIC) I guess.

My first hacky thought of how it would work was correct :)

EDIT: Yep it disables printing to top 22 lines of screen until you POKE the value 244 back. So you have to do that either in your asm code or before the RANDOMIZE USR x if you want to use ROM or BASIC output to work correctly after loading.
User avatar
MustardTiger
Microbot
Posts: 122
Joined: Tue May 02, 2023 8:05 pm

Re: Poke to hide "Program:, Bytes:" tape loading prompts

Post by MustardTiger »

I wonder if you could poke the two bytes to jump off to a function that ignores the print but repairs the sysvars for when the program runs. Probably overkill :lol:
equinox
Dynamite Dan
Posts: 1052
Joined: Mon Oct 08, 2018 1:57 am
Location: SE England

Re: Poke to hide "Program:, Bytes:" tape loading prompts

Post by equinox »

Some things undo the effect of the poke, like CLS.
User avatar
ParadigmShifter
Manic Miner
Posts: 670
Joined: Sat Sep 09, 2023 4:55 am

Re: Poke to hide "Program:, Bytes:" tape loading prompts

Post by ParadigmShifter »

Yeah you could point it to ASM code such as this, only if you load 1 block (otherwise you have to point it at the code again before you load another block)

Code: Select all

   ld a, 244
   ld (23739), a
   ret
You could easily poke those 6 bytes in the basic loader anywhere you wanted and point the function pointer at that.
User avatar
WhatHoSnorkers
Manic Miner
Posts: 254
Joined: Tue Dec 10, 2019 3:22 pm

Re: Poke to hide "Program:, Bytes:" tape loading prompts

Post by WhatHoSnorkers »

I used to find it by Googling "Jonathan Cauldwell POKE". He talks about it in his book, but I don't know if he originally invented it or not.

I used to use it a lot, but you'd need a CLS or two to reset, so these days I position the PRINT in unobtrusive parts of the screen or something.
I have a little YouTube channel of nonsense
https://www.youtube.com/c/JamesOGradyWhatHoSnorkers
equinox
Dynamite Dan
Posts: 1052
Joined: Mon Oct 08, 2018 1:57 am
Location: SE England

Re: Poke to hide "Program:, Bytes:" tape loading prompts

Post by equinox »

WhatHoSnorkers wrote: Mon Feb 12, 2024 7:11 pm I used to find it by Googling "Jonathan Cauldwell POKE". He talks about it in his book, but I don't know if he originally invented it or not.

I used to use it a lot, but you'd need a CLS or two to reset, so these days I position the PRINT in unobtrusive parts of the screen or something.
I've seen at least one old game where the artist ingeniously included "Bytes: blah" in the loading screen itself, and then set OVER 1 so that the loading prompt would erase it! Not ideal, since you still see it for a few seconds.
User avatar
ParadigmShifter
Manic Miner
Posts: 670
Joined: Sat Sep 09, 2023 4:55 am

Re: Poke to hide "Program:, Bytes:" tape loading prompts

Post by ParadigmShifter »

Nah as I said you can just POKE 23739, 244 to enable printing after loading (or as the first line of a BASIC program you load I guess if it's in BASIC).

So if you want the loading screen to stay after the code starts running you can do that ;)

EDIT: That was a reply to Mr. Snorkers.
User avatar
WhatHoSnorkers
Manic Miner
Posts: 254
Joined: Tue Dec 10, 2019 3:22 pm

Re: Poke to hide "Program:, Bytes:" tape loading prompts

Post by WhatHoSnorkers »

ParadigmShifter wrote: Mon Feb 12, 2024 7:14 pm Nah as I said you can just POKE 23739, 244 to enable printing after loading (or as the first line of a BASIC program you load I guess if it's in BASIC).

So if you want the loading screen to stay after the code starts running you can do that ;)

EDIT: That was a reply to Mr. Snorkers.
Yeah, it took me a few goes to get it right. Awkward to test! What I found was I had the game all sorted, then I bolt on a loading screen with the POKE, then had to turn it off (which Mr Cauldwell didn't tell me) otherwise you'd get weird results. And you couldn't fast load as I wasn't clever enough to just put PAUSE 0 at the top of the program!

Live and learn :)
I have a little YouTube channel of nonsense
https://www.youtube.com/c/JamesOGradyWhatHoSnorkers
User avatar
ParadigmShifter
Manic Miner
Posts: 670
Joined: Sat Sep 09, 2023 4:55 am

Re: Poke to hide "Program:, Bytes:" tape loading prompts

Post by ParadigmShifter »

WhatHoSnorkers wrote: Mon Feb 12, 2024 7:11 pm I used to find it by Googling "Jonathan Cauldwell POKE". He talks about it in his book, but I don't know if he originally invented it or not.

I used to use it a lot, but you'd need a CLS or two to reset, so these days I position the PRINT in unobtrusive parts of the screen or something.
I wonder if Mr. Cauldwell had some kind of scandal in the past involving him poking things and that is just a ploy to make those search results not appear on the first page when you Google (like how Boris Johnson made up that story about him making model buses out of wine box cartons to try and bury google searches for Boris Johnson + Bus about that £350m NHS lie) :)
User avatar
Lee P
Microbot
Posts: 157
Joined: Fri Jan 05, 2018 9:47 am
Location: The Warehouse
Contact:

Re: Poke to hide "Program:, Bytes:" tape loading prompts

Post by Lee P »

equinox wrote: Mon Feb 12, 2024 7:14 pm I've seen at least one old game where the artist ingeniously included "Bytes: blah" in the loading screen itself, and then set OVER 1 so that the loading prompt would erase it! Not ideal, since you still see it for a few seconds.
In theory you could have a filename called "Bytes" with the control codes at the start to get the cursor to overwrite it first (CHR$ 22, 1, 0, 21, 1) but you'd still be left with a floating colon. Missus.
User avatar
Lee P
Microbot
Posts: 157
Joined: Fri Jan 05, 2018 9:47 am
Location: The Warehouse
Contact:

Re: Poke to hide "Program:, Bytes:" tape loading prompts

Post by Lee P »

I mean, the other way is to have a headerless loader and call it from rom, can't remember exactly how it's done but even I managed it years ago in some csscgc entry so can't be that hard.
equinox
Dynamite Dan
Posts: 1052
Joined: Mon Oct 08, 2018 1:57 am
Location: SE England

Re: Poke to hide "Program:, Bytes:" tape loading prompts

Post by equinox »

Lee P wrote: Mon Feb 12, 2024 9:30 pm In theory you could have a filename called "Bytes" with the control codes at the start to get the cursor to overwrite it first (CHR$ 22, 1, 0, 21, 1) but you'd still be left with a floating colon. Missus.
This doesn't seem to work. (I don't think OVER codes work in a string.) Also it relies on the Bytes: etc. being printed on line 1, which will not be true if you have moved the print position.

The tab character CHR$ 23 might be handy in blanking out the line (though again it would depend on the print position and whether OVER was already enabled). "Character array:" is the really long one!
User avatar
Lee P
Microbot
Posts: 157
Joined: Fri Jan 05, 2018 9:47 am
Location: The Warehouse
Contact:

Re: Poke to hide "Program:, Bytes:" tape loading prompts

Post by Lee P »

You could always change the numbers after 22 to match the print position.

I once used something like LET a$=
CHR$ 22+CHR$ 0 +CHR$ 12 (PRINT AT 0,12)
+CHR$ 239 ("LOAD " keyword)
+CHR$ 8 (backspace because LOAD contains a space)
+"ING"
+CHR$ 13 (carriage return)
+CHR$ 6 (tab)

which produced this:

Image
User avatar
ParadigmShifter
Manic Miner
Posts: 670
Joined: Sat Sep 09, 2023 4:55 am

Re: Poke to hide "Program:, Bytes:" tape loading prompts

Post by ParadigmShifter »

I only really like using character codes to embed keywords in the filename. I will defo be using Bytes: SJOE CODE AND DATA when I finally finish the full version ;)

Anything else to hide the message is easily sorted by the POKE which has been discussed already.

I know most loaders would crash if you tried to break into them, that must be a code that replaces the error handler (or output stream for the lower screen area) I guess, you can probably override that one too do do some funky stuff? (e.g. printing "don't press break you muppet rewind the tape and try again" or something)
User avatar
TakuikaNinja
Drutt
Posts: 30
Joined: Mon Dec 25, 2023 11:02 am
Location: New Zealand
Contact:

Re: Poke to hide "Program:, Bytes:" tape loading prompts

Post by TakuikaNinja »

Does any assembler/compiler allow embedding character codes into the filename? Pasmo and bas2tap end up escaping the backslash ("\") you'd normally use to insert escape sequences into strings.
User avatar
ParadigmShifter
Manic Miner
Posts: 670
Joined: Sat Sep 09, 2023 4:55 am

Re: Poke to hide "Program:, Bytes:" tape loading prompts

Post by ParadigmShifter »

I've not tried to do it yet except in BASIC where it is easy.

It's pretty easy to hack the filename bytes of the loader header though and resave?

If you are using an emulator it's probably easiest to load the assembly to the right place in memory and then do a SAVE "funkyfilename" CODE start, len.
Last edited by ParadigmShifter on Tue Feb 13, 2024 2:42 am, edited 1 time in total.
User avatar
TakuikaNinja
Drutt
Posts: 30
Joined: Mon Dec 25, 2023 11:02 am
Location: New Zealand
Contact:

Re: Poke to hide "Program:, Bytes:" tape loading prompts

Post by TakuikaNinja »

ParadigmShifter wrote: Tue Feb 13, 2024 2:38 am I've not tried to do it yet except in BASIC where it is easy.

It's pretty easy to hack the filename bytes of the loader header though and resave?
I know I could do that but it feels rather inelegant that it can't be done on the terminal (I use Linux).
User avatar
ParadigmShifter
Manic Miner
Posts: 670
Joined: Sat Sep 09, 2023 4:55 am

Re: Poke to hide "Program:, Bytes:" tape loading prompts

Post by ParadigmShifter »

Yeah so see my edit, load the binary into an emulator at the right address then just do a SAVE "filename" CODE start, len
User avatar
TakuikaNinja
Drutt
Posts: 30
Joined: Mon Dec 25, 2023 11:02 am
Location: New Zealand
Contact:

Re: Poke to hide "Program:, Bytes:" tape loading prompts

Post by TakuikaNinja »

Well now this just makes me want to make the filename print out the longest string within the 10 character limit. :lol:

Image
Last edited by TakuikaNinja on Tue Feb 13, 2024 3:08 am, edited 1 time in total.
User avatar
ParadigmShifter
Manic Miner
Posts: 670
Joined: Sat Sep 09, 2023 4:55 am

Re: Poke to hide "Program:, Bytes:" tape loading prompts

Post by ParadigmShifter »

RANDOMIZE is your friend.

Once it wraps to another line it kind of looks crappy though.

I think the filename is not terminated by last byte being OR'd with 128 and is fixed 10 bytes so you should be able to use 10 of those?

EDIT: Great minds think alike. Fools seldom differ ;)

EDIT2: Great name for a game though, RANDOMIZE RANDOMIZE RANDOMIZE RANDOMIZE RANDOMIZE RANDOMIZE RANDOMIZE RANDOMIZE RANDOMIZE RANDOMIZE

I still think it should be RANDOMISE of course :(

There was a CSSCGC entry with an all keywords name at least once, something about a CAT if I recall correctly
Post Reply