Page 1 of 1

Looking for a BASIC trick for RESTORE N

Posted: Thu May 20, 2021 10:34 am
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 :)

Re: Looking for a BASIC trick for RESTORE N

Posted: Thu May 20, 2021 11:12 am
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.

Re: Looking for a BASIC trick for RESTORE N

Posted: Sat May 22, 2021 11:40 am
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 ???? :)

Re: Looking for a BASIC trick for RESTORE N

Posted: Sat May 22, 2021 1:34 pm
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

Re: Looking for a BASIC trick for RESTORE N

Posted: Sun May 23, 2021 6:06 am
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:

Re: Looking for a BASIC trick for RESTORE N

Posted: Thu Jun 10, 2021 8:11 am
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 . :)

Re: Looking for a BASIC trick for RESTORE N

Posted: Fri Nov 19, 2021 5:14 pm
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.