Looking for a BASIC trick for RESTORE N

Everything related to BASIC version 1.x (Oric 1 and Atmos) or HYPERBASIC (Telestrat).
Don't hesitate to give your small program samples, technical insights, or questions...
User avatar
Dom
Flying Officer
Posts: 141
Joined: Sun Nov 25, 2012 7:00 pm

Looking for a BASIC trick for RESTORE N

Post by Dom »

Hi,
I'd like to make a tap version of ENCHANTED, a disc game , restored and saved from oblivion by Steve.
It appears that the SEDORIC order RESTORE N is used in the original code.
I am pretty sure I read somwhere, in the times, a BASIC trick to simulate such a RESTORE N.
The problem is that I don't remember this trick nor where I read it.

Help appréciated :)
User avatar
Dbug
Site Admin
Posts: 4444
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: Looking for a BASIC trick for RESTORE N

Post by Dbug »

There's a BASIC and assembler way of doing that, page 52 of "Au coeur de l'Oric Atmos".
https://library.defence-force.org/index ... formatique

Using DEEK(176) you can read the current DATA pointer, and a DOKE can change it.
User avatar
Dom
Flying Officer
Posts: 141
Joined: Sun Nov 25, 2012 7:00 pm

Re: Looking for a BASIC trick for RESTORE N

Post by Dom »

Dbug wrote: Thu May 20, 2021 11:12 am Using DEEK(176) you can read the current DATA pointer, and a DOKE can change it.
Yes, I knew that :)
But I had in mind a trick do do that "automaticaly" Because if you change #B0-#B1 (176-177) value "in hard" in the listing, you can't modify your listing anymore...

What I remerber is something like that:

Instead of
100 RESTORE 1000 : READ A
..
..
900 DATA 900,901
1000DATA 1000,1001

Something like
100 GOSUB 1000: READ A
....
900 DATA 900,901
1000 DOKE#B0,(DEEK #????) :RETURN
1001DATA 1000,1001

What I can"t remember is Which BASIC pointer or expression to write intead of ???? :)
christian
Pilot Officer
Posts: 96
Joined: Sun Nov 24, 2013 9:58 pm

Re: Looking for a BASIC trick for RESTORE N

Post by christian »

You can try:

Code: Select all

100 GOSUB 1000: READ A
....
900 DATA 900,901
1000 DOKE #B0,DEEK(#AC) :RETURN
1001DATA 1000,1001
User avatar
Dom
Flying Officer
Posts: 141
Joined: Sun Nov 25, 2012 7:00 pm

Re: Looking for a BASIC trick for RESTORE N

Post by Dom »

I tried
DOKE #B0,DEEK(#AC) :RETURN,
as you proposed and.... It perfectly works !
Thanks a lot Christian ! :D

I find this trick very clever.
Now, I have to find where I read it for the first time :wink:
User avatar
Dom
Flying Officer
Posts: 141
Joined: Sun Nov 25, 2012 7:00 pm

Re: Looking for a BASIC trick for RESTORE N

Post by Dom »

I finally found where I had read this trick in the days.
It was in the André Chénière's book "ATMOS ORIC-1 manuel de référence".
On the top of the page 41 one can find the BASIC line :
7010 DOKE#B0,DEEK(DEEK(#AC)+1)-1
and on top of page 43 the Author admits he might have been more simple and clear writting:
7010 DOKE#B0,DEEK(#AC)
Exactly what Christian proposed :)
Meanwhile, I finished a .tap version of ENCHANTED.
This adventure game was missing in all archives.
But, thanks to Steve, a disc version has recently been rescued.
Doing that, in order to replace disc instructions
OPEN /CLOSE / PUT /TAKE,
I had to re learn how to use BASIC keywords : STORE and RECALL . :)
JamesD
Flight Lieutenant
Posts: 358
Joined: Tue Nov 07, 2006 7:38 am

Re: Looking for a BASIC trick for RESTORE N

Post by JamesD »

So what's this doing? POKEing the address of the line into BASIC's variable that remembers where to continue reading?
*edit*
Never mind, figured it out. Didn't notice it was a subroutine right before the data.
Post Reply