BASIC

General Chit Chat about Sinclair Computers and their Clones
User avatar
XavSnap
Posts: 1940
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Re: BASIC

Post by XavSnap »

rune wrote:XavSnap,

Can I ask how you got the Basic in a format that could be copied and pasted above?

It would be very useful if its possible to use an external editor and import/export with an emulator.
Create a new "text" file, and paste this code in it.
Save it !

Open the XuR, and in "file" select Hard reset to clear the memory... and freezed ROM.
Just load it with VB81 Xur in the "Files" popup, select "specily tape&directory" window.
Select the text file, and "Return to the basic Editor"
Use "K" key to list it.

SAVE"program.txt" will save your codes in text mode (REMs included).
import/export with an emulator
Vb81 XUR is "AN" emulator... too...
When you know where your code is printed on the screen you can also change the inversebit of the score on the screen.
True!

Code: Select all

1 PRINT AT 0,0;"<- IT S A TEST 12345 aAbBcCdD ->"
10 LET ADD=PEEK(16397)*256+PEEK(16396)+1
20 FOR A=ADD TO ADD+31
30 POKE A,PEEK(A)+(128 AND (PEEK(A)<128))
40 NEXT A
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
rune
Posts: 174
Joined: Thu Sep 04, 2014 8:35 am

Re: BASIC

Post by rune »

dr beep wrote:When you know where your code is printed on the screen you can also change the inversebit of the score on the screen.
Yep, I use this formula to work out the position in DFILE using y,x co-ordinates from Basic :

= DFILE + (33*Y+1)+X

Don't know if that's the most efficient way of calculating an address or not.
User avatar
XavSnap
Posts: 1940
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Re: BASIC

Post by XavSnap »

rune wrote: Yep, I use this formula to work out the position in DFILE using y,x co-ordinates from Basic :
= DFILE + (33*Y+1)+X
Don't know if that's the most efficient way of calculating an address or not.
Use the Df-CC Basic variable in 16398...
If the "Print AT" is used , this variable store the screen address offset !
Dont forget the ";" after the "PRINT AT" to point to the next address offset, not the next "line" address offset.

Code: Select all

1 PRINT AT 10,10;
5 REM GET THE DF-CC AFTER A PRINT AT
8 REM CURRENT SCREEN OFFSET.
10 POKE PEEK(16399)*256+PEEK(16398),141
20 PRINT AT 3,15;"HELLO";
30 POKE PEEK(16399)*256+PEEK(16398)-5,PEEK(PEEK(16399)*256+PEEK(16398)-5)+128
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
User avatar
PokeMon
Posts: 2264
Joined: Sat Sep 17, 2011 6:48 pm

Re: BASIC

Post by PokeMon »

All this PEEK and POKE stuff is in fact to slow for this.
I would PRINT it just as it is (black char on white background) and do only the naming "SCORE" in inverted chars.
Just make a suitable screen design if you want to program it in BASIC.
What do you think how long this PEEK and POKE action will take for 10 chars ? :shock:
User avatar
XavSnap
Posts: 1940
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Re: BASIC

Post by XavSnap »

Hi,
To invers a string variable.

only Work with a string decalred as a DIM...

Code: Select all

5 DIM A$(5,6)
10 LET A$(1)="HELLO1"
11 LET A$(2)="HELLO2"
12 LET A$(3)="HELLO3"
13 LET A$(4)="HELLO4"
14 LET A$(5)="HELLO5"
18 REM GET POINTER ADD.
20 LET A$(3)=A$(3)
30 GOSUB 100
40 LET ADD=PEEK(16445)*256+PEEK(16444)
50 FOR X=ADD TO ADD+5
60 POKE X,PEEK(X)+128
70 NEXT X
75 PRINT A$(3)
80 STOP
90 REM PUT IN BUFFER
100 POKE 16444,PEEK(16402)
110 POKE 16445,PEEK(16403)
130 RETURN
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
User avatar
XavSnap
Posts: 1940
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Re: BASIC

Post by XavSnap »

PokeMon wrote:All this PEEK and POKE stuff is in fact to slow for this.
I would PRINT it just as it is (black char on white background) and do only the naming "SCORE" in inverted chars.
Just make a suitable screen design if you want to program it in BASIC.
What do you think how long this PEEK and POKE action will take for 10 chars ? :shock:
Juste use an inverted matrix in string values "000000000"...
And change only the modified character.

5 DIM MATRIX$(1,10)
8 DIM DIGIT$(1,10)
10 LET DIGIT$="0123456789"
20 LET MATRIX$(1)="0000000000"
30 LET MATRIX$(1,9 TO)=DIGIT$(1,SCORE TO SCORE)
if SCORE=10 inc MATRIX$(1,8 TO 8)=DIGIT$(1,SCORE\10 TO SCORE\10 )

:?:
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
rune
Posts: 174
Joined: Thu Sep 04, 2014 8:35 am

Re: BASIC

Post by rune »

XavSnap wrote:
rune wrote:
import/export with an emulator
Vb81 XUR is "AN" emulator... too...
and it looks brilliant too!!! I am at work so cant do a lot with it but I think this is going to be my favorite emulator for the ZX 81.

Loading and saving text plus assembler and disassembler are perfect. All the other tools just feels like Christmas.

Well done XavSnap and thanks for creating this.

</BIG :D >
rune
Posts: 174
Joined: Thu Sep 04, 2014 8:35 am

Re: BASIC

Post by rune »

XavSnap wrote:
rune wrote:
Use the Df-CC Basic variable in 16398...
If the "Print AT" is used , this variable store the screen address offset !
Dont forget the ";" after the "PRINT AT" to point to the next address offset, not the next "line" address offset.
I know about the Df-CC variable but havent done a lot with it because I kept losing my code when using EightyOne emulator. I did save but usually forgot to save the TAPE file. Anyway, I prefer using text files as it allows me to use an editor to edit text quicker and easier than can be done in an emulator.
User avatar
XavSnap
Posts: 1940
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Re: BASIC

Post by XavSnap »

I prefer using text files as it allows me to use an editor to edit text quicker and easier than can be done in an emulator.
I never typed ins a ZX81 program directly on the PC Keyboard on emulator (or ZX81 emulated keyboard)!
:shock:
I never remenber keys and symbols locations... :oops:
Press 3 keys to get a function is too fastidious. :o

All programs on http://www.hebdogiciel.fr/ZX81.htm are typed-ins in text mode (retrived with OCR) !
And launched in VB81 XuR AS IS ... :evil:

In text mode, it alow to copy and paste programs parts, ASM...
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
rune
Posts: 174
Joined: Thu Sep 04, 2014 8:35 am

Re: BASIC

Post by rune »

I'm finding nice tools like renumber and REM creator, but cant see how to get the input into text mode?

Can you tell me how.

The http://www.hebdogiciel.fr/ZX81.htm link looks very interesting
Post Reply