Loading/Editing/Saving .p files..?

Anything Sinclair ZX Basic related; history, development, tips - differences between BASIC on the ZX80 and ZX81
Coggie
Posts: 14
Joined: Thu Oct 12, 2017 1:11 am
Location: Orkney Islands
Contact:

Loading/Editing/Saving .p files..?

Post by Coggie »

Hi everyone...

Is there a utility I can use to write ZX BASIC .p files then load them from the eightyone emulator instead of typing my code directly in the emulator?

Cheerz...

Coggie.
sirmorris
Posts: 2811
Joined: Thu May 08, 2008 5:45 pm

Re: Loading/Editing/Saving .p files..?

Post by sirmorris »

There is ZX-Ide which is aimed at machine code programming but it has the ability to assist with BASIC too. Spend a little time learning it and you can do some cool stuff like fire up your program into EightyOne or a real ZX81.

Another way is to edit your BASIC program in notepad or whatever and then use a program called ZXTEXT2P which makes a P file for you.

I bet there will be other ways too. I remember something by Xav that looked like it would be pretty useful.

HTH
Coggie
Posts: 14
Joined: Thu Oct 12, 2017 1:11 am
Location: Orkney Islands
Contact:

Re: Loading/Editing/Saving .p files..?

Post by Coggie »

Cheerz sirmorris....

will have a spy at those and see...

Even if the LIST Command on the ZX81 was same as Speccy I would feel more at home...you could keep scrolling threw your prog unitl Break-Space ye know....oh ye also on Speccy keypresses repeated eh...but I'll try those Utils & see it I figure out something... :)

Coggie
Coggie
Posts: 14
Joined: Thu Oct 12, 2017 1:11 am
Location: Orkney Islands
Contact:

Re: Loading/Editing/Saving .p files..?

Post by Coggie »

Using Notepad++ then a batch file to convert in.txt to out.p using zxtext2p.exe

I got the the multiple statements on 1 line like on the Spectrum....
SCREENSHOT.png
SCREENSHOT.png (18.05 KiB) Viewed 6289 times
it runs but...it doesn't execute PRINT "WORLD"
and if you edit line it still gives a Syntax Error...

But Hey....got to try these things eh...

Anyhoo...I'm off 2 get a Bottle ov Whisky :)

Catch ye later....

Coggie
Coggie
Posts: 14
Joined: Thu Oct 12, 2017 1:11 am
Location: Orkney Islands
Contact:

Re: Loading/Editing/Saving .p files..?

Post by Coggie »

I tried looking for a Python Plug-in for Notepad++ that could open&convert .p files to txt but alas...didn't find one... :(
sirmorris
Posts: 2811
Joined: Thu May 08, 2008 5:45 pm

Re: Loading/Editing/Saving .p files..?

Post by sirmorris »

One statement per line I'm afraid bud. None of that fancy modern stuff here :lol:
sirmorris
Posts: 2811
Joined: Thu May 08, 2008 5:45 pm

Re: Loading/Editing/Saving .p files..?

Post by sirmorris »

Coggie wrote: Sat Oct 14, 2017 8:44 pm I tried looking for a Python Plug-in for Notepad++ that could open&convert .p files to txt but alas...didn't find one... :(
There is a program called zxtool that can convert p to txt. I think ZX-IDE can do it too but I've never tried. ZXtool is here
Coggie
Posts: 14
Joined: Thu Oct 12, 2017 1:11 am
Location: Orkney Islands
Contact:

Re: Loading/Editing/Saving .p files..?

Post by Coggie »

Cool sirmorris...

obviously cant convert INV/G chars but I can live with that.

so atm I'm using a combo of Notepad++,ZXTOOL,ZXTEXT2P & EightyOne...

I'm also on the Whisky 2day so i'll try them all out inc. ZX-IDE when I have a less Fuzzy Head lol

Cheerz

Coggie :)
sirmorris
Posts: 2811
Joined: Thu May 08, 2008 5:45 pm

Re: Loading/Editing/Saving .p files..?

Post by sirmorris »

There is a kind-of standard that can be used to put the gfx chars into the text editor. It uses sequences of 2 characters that (somewhat vaguely) represent the quarter square graphics. See at the bottom of this page. Something like this:

PRINT "%H%I% %T%H%E%R%E"

will print HI THERE in inverse text. This:

Code: Select all

PRINT "\:'\''\':"
PRINT "\: \  \ :"
PRINT "\:.\..\.:"
Will draw a chunky pixel box on screen. You can see how the characters following the back slash sort-of indicate the shape. No? Well OK it's more of a hint ;)
Coggie
Posts: 14
Joined: Thu Oct 12, 2017 1:11 am
Location: Orkney Islands
Contact:

Re: Loading/Editing/Saving .p files..?

Post by Coggie »

oh yes sir morris av only noticed now how it converted my snake game(with help fron Xav)

Code: Select all

700 PRINT AT 9,10;"%Y%A\::%S%I%L%L%Y\::%C%A%N%T" AND V=10;AT 11,4;"%Y%O%U\::%F%E%L%L\::%I%N\::%T%H%E\::%D%A%M\::%D%I%T%C%H" AND V=10;AT 9,9;"%Y%A\::%D%A%F%T\::%B%A%S%K%E%T" AND V=11;AT 11,4;"%Y%O%U\::%A%T%E\::%Y%O%U%R\::%F%E%C%K%I%N\::%T%A%I%L" AND V=11;AT 13,8;"%P%L%A%Y\::%A%G%A%I%N\::%(%Y%/%N%)%?"
  710 IF S>Z THEN LET Z=S
  750 POKE 16444,Z-(INT (Z/256)*256)
  752 POKE 16445,INT (Z/255)
  755 LET K$=INKEY$
  757 IF K$="Y" THEN GOTO 30
  758 IF K$="N" THEN GOTO 990
  759 GOTO 755
  777 GOTO 30
  800 PRINT AT 2,8;"%H%E%L%L%O\::%A%N%D\::%W%E%L%C%O%M%E";AT 4,15;"%T%O";AT 6,1;"%T%R%A%K%K%I%E\::%T%H%E\::%A%M%A%Z%I%N%G\::%W%O%B%B%L%Y\::%W%O%R%M";AT 10,6;"USE ARROW KEYS TO MOVE";AT 20,7;"PRESS A KEY TO PLAY"
  810 IF INKEY$="" THEN GOTO 810
  820 RETURN 
  990 PRINT AT 15,2;"%P%L%E%A%S%E\::%Y%O%U%R\::%F%E%C%K%I%N%G\::%S%E%L%F\::%T%H%E%N"
  991 STOP
Cool...think I was 2 drunk 2 notice before...working on a Windows Tablet doesn't really help either ha...
Post Reply