PROGRAM PITSTOP
Your Sinclair, April 1989

[This is one of McCandless' more comprehensive cock-ups. The ASCII Search    ]
[listing was useless as the hex dump was an unusable mess. The supposedly    ]
["brilliant" Renumber routine had several programming errors in it and should]
[never have been printed. The BASIC listing for the Sampler program didn't   ]
[match the comments, there were no instructions on how to use it, and the hex]
[dump (for a 128K program) was located in the 48K printer buffer.        JimG]

David McCandless, YS's page 80 passport photo fellow proudly
presents the next instalment of Program Pitstop.

Phew! What a wheeze those art department chappies are! Come and have
your picture taken David, they said to me. The whole country is fed up
of that gormless passport effort taken a year ago, they said. So
gullible Dave, seduced by the Art Editor's haircut, tramped down and
had his mug shot. Don't worry Dave, they said after I had seen the
pictures, we won't put that one in, the one where you look as if
you're giving birth to an ostrich, we won't Dave honest! And lo and
behold in the next issue which picture had they put in? Exactly.

Well that's life. Give an Art Editor an inch and she takes a mile.
Anyway, highly demeaning and embarrassing snap shots aside, have I got
a rampantly selective bunch of programs for you to devour this month?
It all starts with Francisco Pinho who makes an appearance with an
excellent Text Searcher program. Kevin Maricz comes after that with
his life- saving down scroll routine [Except that it was a renumber
routine. JimG]. And to cap it all off this month, there's Jay Salmon
with a superlative Sampler program. Let's drive straight on in.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

ASCII SEARCH
by Francisco Pinho

[I've included the printed instructions for this, although there's no program]
[as the correct listing was never printed. There was a note on page 8 of the ]
[June issue saying that anyone who wanted the listing had to write in to YS  ]
[to get it.                                                              JimG]

Francisco Pinho, patriot of Portugal, has sent in a mightily useful
program. With it you can smugly customise your favourite game, search
out hidden passwords and information, and read the secret (and
explicit) messages often left by programmers in your programs. It's
easy to use, simple to understand, and a cinch to type in. Do I make
life easy for you or do I make life easy for you? [Well, if you didn't
screw up so often, you might. JimG]

Method
To use it, first type in the Basic listing. Check it thoroughly and
then save it with SAVE "name" LINE 10. Using the Hex Loader, enter the
256 bytes of machine code (use the Hex Loader program on the page
opposite), and record the code onto the same tape after the Basic
program with: SAVE "name" CODE 23296,254. Now, reset your computer and
load the tape you saved everything onto. It should run automatically.

Controls
The idea behind the program is that you load in a program, look
through it for interesting text, change it if you want and then
re-save it with your amendments. Use the following controls:
L LOAD PROGRAM into memory address 26000
S SAVE PROGRAM will save the original program with the original
  name, start address, and length.
N ADVANCE 703 bytes. The screen will change and the next
  page of Ascii codes will appear. Don't worry if all you see is
  garbage - keep advancing through the code and you'll find
  something.
D EXECUTE to an inputted address. Warning: this may
  cause a crash.
T TEXT EDIT MODE:
  Q/A/O/P Move cursor around screen
  CAPS+0 Backspace one character
  ENTER Quit this mode
Just move the cursor to the message you wish to change and type in
your replacement.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

RENUMBER
by Kevin Maricz [Although the listing says James Mancz. JimG]

[There are several faults with this program as listed:                  ]
[* It doesn't alter GOSUB/GOTO numbers, so isn't really much use.       ]
[* If merged, the line numbers used would stick part of the routine     ]
[  at the start of the program and part at the end.                     ]
[* It stops when it finds line 9000, which may not exist.               ]
[* It assumes that a CHR$ 13 indicates end-of-line, not taking into     ]
[  account that an embedded binary number form might contain that value.]
[                                                                   JimG]

Basic renumbering routines are pretty useful things, especially when
you've got a mammoth program with totally inconsistent line-numbers
and you want to send it to er, Pitstop, to pluck a name out of the
blue. With Kevin Maricz's submission you just glue these few lines on
the end of the program. Wait a while! And what do you get? A totally
renumerated program. Brilliant.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

SAMPLER
by Jay Salmon

[I've included this although I've no idea what it's supposed to be ]
[doing as the printed instructions don't match the printed listing.]
[It's written for the 128K only.                               JimG]

An aeon ago in the cob-webbed history of this revered column I printed
a Sound Sampling program by Heikki Julken. That ancient routine seemed
to push the Speccy's sound digitising abilities as far as they would
go, and rested its case at being able to manage a six second long
sample. But now! comes Jay Salmon with his routine which (hold your
breath) can cope with a 22 second sample and play it back at twenty
different speeds!

Absolutely incredible. When I first loaded it, and after listening to
his stunning demo sample, I spent two hours mesmerised next to the
screen, digitising chunks from my entire record collection. It's
incredible. Type it in and believe it. [Well, if you'd bothered to
print the correct listing, maybe we could. JimG]

Sampling
The code occupies memory address 65221 to 65391 and so is a mere 170
bytes long. [That's actually 171 bytes, although the hex dump to the
last RET is only 161 bytes. There's some more data after that, which
would make it up to 200 bytes, but that just appears to be garbage, as
the code doesn't address that area. The hex dump was 256 bytes in
total, as it was a dump from the 48K printer buffer at 23296 where the
code had been (erroneously) located. JimG] Type it in (using the Hex
Loader above) and save it to tape with SAVE "name" CODE 65221,170.
After that, reset the computer to clear memory.

Then type in the Basic program and then CLEAR 65535 [?! JimG] and
reload the code you just saved. Next, type GOTO 9997 [Which doesn't
exist, as the printed BASIC listing stops at line 100. JimG] and the
program will save both the Basic and machine code together.

To sample, type RUN and follow on screen instructions [Of which there
are none. JimG], making sure you disconnect the MIC lead of your
Speccy and the EAR lead of your tape recorder. Keys 1 to P alter the speed.

It's incredible. [= "yet another cock-up" in McCandless-speak. JimG]

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

So you think you can program eh? Reckon you're good at it eh? Think
you can do better than what you see on these pages eh? Good, send it
to me. The name's David McCandless (but you can just call me Macca)
and the address is Program Pitstop, Your Sinclair, 14 Rathbone Place,
London, W1P 1DE. And if I think it's good enough then you'll receive
fifty big fat juicy ones (pounds) to you. Say no more.
