Games that become playable after compiling?

General software. From trouble with the Banyan Tree to OCP Art Studio, post any general software chat here. Could include game challenges...
zup
Manic Miner
Posts: 215
Joined: Wed Jul 08, 2020 8:42 am

Games that become playable after compiling?

Post by zup »

We all know that Sinclair BASIC interpreter is slooooow, and there were many Spectrum games released in BASIC.BASIC games are (almost) universally regarded as shitty, unplayable games, but...

Is there any BASIC game that becomes playable when using a faster BASIC intepreter (or when using a BASIC compiler)?
User avatar
Jbizzel
Dynamite Dan
Posts: 1537
Joined: Mon May 04, 2020 4:34 pm
Location: Hull
Contact:

Re: Games that become playable after compiling?

Post by Jbizzel »

It's an interesting idea. One that I've dabbled with. It's not always a case of compiling the basic listing, the Sinclair basic and zx complied basic are different, so you would need to alter the code somewhat.

Frogger on cassette 50 might be a good one to start with :)
User avatar
jpnz
Manic Miner
Posts: 332
Joined: Tue Nov 14, 2017 4:07 pm
Location: Hamilt[r]on - City Of The Future - NZ

Re: Games that become playable after compiling?

Post by jpnz »

LAFIX 2 - painfully slow but a really good game. Looking through my December 2019 download history, seems I'd ran it through a bunch of compilers until I'd got to [the universally panned] Blast! and then played it for 3 or 4 days up until level 78
Spoiler
xzmycvx
I've not had a good look, but I can't find any snapshots of the compiled game
User avatar
Pegaz
Dynamite Dan
Posts: 1210
Joined: Mon Nov 13, 2017 1:44 pm

Re: Games that become playable after compiling?

Post by Pegaz »

A long time ago, I typed flight simulation program from Input magazine, compiled with Boriel Compiler and it works much better.
I am glad to see that its still among the examples on the Boriel web page. :)
http://www.boriel.com/files/zxb/flights.tzx

There are also hi quality games made by Boriel ZX Basic and compiled with Boriel ZX Compiler, ZX Striker, Ad Lunam, Vade Retro etc.
https://spectrumcomputing.co.uk/list?gr ... rce=3&pg=1
User avatar
WhatHoSnorkers
Manic Miner
Posts: 255
Joined: Tue Dec 10, 2019 3:22 pm

Re: Games that become playable after compiling?

Post by WhatHoSnorkers »

Jbizzel wrote: Mon Dec 27, 2021 8:17 am It's an interesting idea. One that I've dabbled with. It's not always a case of compiling the basic listing, the Sinclair basic and zx complied basic are different, so you would need to alter the code somewhat.

Frogger on cassette 50 might be a good one to start with :)
Frogger on cassette 50 was OK. Monster Muncher on the other hand....

I decided to make Monster Muncher better, by adding various sensible features... and I made it worse as the performance was like treacle.

It's an interesting idea though....
I have a little YouTube channel of nonsense
https://www.youtube.com/c/JamesOGradyWhatHoSnorkers
User avatar
bluespikey
Manic Miner
Posts: 969
Joined: Tue Jun 30, 2020 3:54 pm

Re: Games that become playable after compiling?

Post by bluespikey »

Ooohhh, this is too good an idea. Someone please compile football manager and see how fast the league calculations are then.

And Snowjump from Cassette 50 would be peachy too.
User avatar
Turtle_Quality
Manic Miner
Posts: 508
Joined: Fri Dec 07, 2018 10:19 pm

Re: Games that become playable after compiling?

Post by Turtle_Quality »

bluespikey wrote: Mon Dec 27, 2021 10:44 am Ooohhh, this is too good an idea. Someone please compile football manager and see how fast the league calculations are then.

And Snowjump from Cassette 50 would be peachy too.
Hi, I did compile Football Manager with MCoder II back in the day, but it was a long process ; the compiler didn't accept string arrays and numbers had to be integers, so many lines had to be changed. Plus some space saving tricks were needed to fit the game and compile in 48K. If you're playing a game like that through an emulator, the WAY simpler option is to hit the full speed button while the computer is thinking.
Definition of loop : see loop
User avatar
Pegaz
Dynamite Dan
Posts: 1210
Joined: Mon Nov 13, 2017 1:44 pm

Re: Games that become playable after compiling?

Post by Pegaz »

Just tried to compile Frogger from cassette 50 compilation with Boriel zx compiler, but get "Undeclared function CLEAR" at line 2 and Undeclared function SCREEN$ at lines 71, 99, 100.
Compiled with zxbc -taB frogger.bas
Any clue ?
User avatar
Jbizzel
Dynamite Dan
Posts: 1537
Joined: Mon May 04, 2020 4:34 pm
Location: Hull
Contact:

Re: Games that become playable after compiling?

Post by Jbizzel »

Pegaz wrote: Mon Dec 27, 2021 2:14 pm Just tried to compile Frogger from cassette 50 compilation with Boriel zx compiler, but get "Undeclared function CLEAR" at line 2 and Undeclared function SCREEN$ at lines 71, 99, 100.
Compiled with zxbc -taB frogger.bas
Any clue ?
Thats awesome. We have to figure this out. Maybe we need to ask for help in the programming section.

Can you post the listing here and we can try and work out what's going on?
User avatar
spider
Dynamite Dan
Posts: 1106
Joined: Wed May 01, 2019 10:59 am
Location: Derby, UK
Contact:

Re: Games that become playable after compiling?

Post by spider »

From memory you have to define them in a statement at the start of the listing, something like:

Code: Select all

10 DIM a1 , a2 , a3 , b , c , d as Integer
User avatar
Pegaz
Dynamite Dan
Posts: 1210
Joined: Mon Nov 13, 2017 1:44 pm

Re: Games that become playable after compiling?

Post by Pegaz »

Jbizzel wrote: Mon Dec 27, 2021 4:01 pmThats awesome. We have to figure this out. Maybe we need to ask for help in the programming section.

Can you post the listing here and we can try and work out what's going on?
spider wrote: Mon Dec 27, 2021 9:41 pm From memory you have to define them in a statement at the start of the listing, something like:

Code: Select all

10 DIM a1 , a2 , a3 , b , c , d as Integer
Well, I've already done this with all the undeclared variables in the first line, my only problem is the CLEAR and SCREEN$ Basic commands, with mentioned errors during compilation.
If I put them in the DIM, I get messages - "CLEAR is a VAR not a function" and "SCREEN$ is neither an array nor a function".
Here is a listing with the changes I have made so far, its very close to being completely correct, except for those two errors:
https://www80.zippyshare.com/v/iIvS3gNj/file.html
User avatar
Jbizzel
Dynamite Dan
Posts: 1537
Joined: Mon May 04, 2020 4:34 pm
Location: Hull
Contact:

Re: Games that become playable after compiling?

Post by Jbizzel »

[mention]Pegaz[/mention] I can't access the link, it says forbidden.

One thing I wonder with clear, it's clearing a memory address isn't it? Might that address be needed by the complier code, so you may have to move the area cleared?

I'm trying to remember zx basic, it has been a while.
User avatar
Pegaz
Dynamite Dan
Posts: 1210
Joined: Mon Nov 13, 2017 1:44 pm

Re: Games that become playable after compiling?

Post by Pegaz »

Jbizzel wrote: Tue Dec 28, 2021 9:09 am @Pegaz I can't access the link, it says forbidden.

One thing I wonder with clear, it's clearing a memory address isn't it? Might that address be needed by the complier code, so you may have to move the area cleared?

I'm trying to remember zx basic, it has been a while.
Try this link, it should work:
https://easyupload.io/ydc6pn
User avatar
spider
Dynamite Dan
Posts: 1106
Joined: Wed May 01, 2019 10:59 am
Location: Derby, UK
Contact:

Re: Games that become playable after compiling?

Post by spider »

If its just a CLEAR you might get away without it as the compiled code will have to have such a statement in its loader anyway. The screens$ thing I'm assuming its not a load""screen$ ? can change that for 16384,6912 , if its more 'screen location' then its more tricky.
User avatar
Jbizzel
Dynamite Dan
Posts: 1537
Joined: Mon May 04, 2020 4:34 pm
Location: Hull
Contact:

Re: Games that become playable after compiling?

Post by Jbizzel »

This is the line it doesn't like.

Code: Select all

690 IF  SCREEN$(x2,y2)=" " THEN GO TO 880:END IF
User avatar
Jbizzel
Dynamite Dan
Posts: 1537
Joined: Mon May 04, 2020 4:34 pm
Location: Hull
Contact:

Re: Games that become playable after compiling?

Post by Jbizzel »

This line needs sorting out too. not sure what's happened to the code, seems to be missing print statements?

Code: Select all

300 CLS : PRINT AT 0,11;"OBJECT" '"To guide a \g across a road and ariver,avoiding \a\b \c\d\e \f \q\r\r\s \t\u." "A \o\p patrols the central island."
 
I commented out the CLEAR and the 3 SCREEN$ statements and the game compiles, and draws the screen etc. But you can't move and die after a few seconds, no matter what.

EDIT*

I changed it to this, works well....

Code: Select all

300 CLS : PRINT AT 0,11;"OBJECT" : Print at 2,0; "To guide a \g across a road and ariver,avoiding \a\b \c\d\e \f \q\r\r\s \t\u." ; "A \o\p patrols the central island."
 

Edit2*

[mention]Pegaz[/mention] I compiled it correctly. You needed:

Code: Select all

#include <screen.bas>
(It is not working correctly though lol)
User avatar
Pegaz
Dynamite Dan
Posts: 1210
Joined: Mon Nov 13, 2017 1:44 pm

Re: Games that become playable after compiling?

Post by Pegaz »

[mention]Jbizzel[/mention]

I managed to compile with the changes you suggested, but when I start the game, I get the message "Integer out of range 30: 1"
Can you share your working bas and tap file, I would like to check what happened ?
Did you maybe use some extra switch after the zxbc command ?
User avatar
Jbizzel
Dynamite Dan
Posts: 1537
Joined: Mon May 04, 2020 4:34 pm
Location: Hull
Contact:

Re: Games that become playable after compiling?

Post by Jbizzel »

This is the code. I compiled it the same way as you [mention]Pegaz[/mention]

Code: Select all

 #include <screen.bas>
  0 DIM b, a, y2, c, hi, lives, score, home, x1, y1, x2 as Integer
  '20 CLEAR 32243: GO TO 40
  20 cls
  '25 BEEP .01,b-a
  '30 PRINT OVER 1; PAPER 8; INK 8;AT a,y2;"\g": RETURN
  40 PRINT AT 11,5;"Please wait a moment"
  50 FOR a=32244 TO 32494
  60 READ b: POKE a,b: NEXT a
  70 DATA 14,8,229,17,31,0,25,126,237,82,31,6,32,126,31,119,35,16,250,225,36,13,32,234,201
  80 DATA 14,8,175,229,17,31,0,237,82,126,25,23,6,32,126,23,119,43,16,250,225,36,13,32,233,201
  90 DATA 33,95,64,205,13,126,33,95,64,205,13,126,33,128,64,205,244,125,33,128,64,205,244,125,33,223,64,205,13,126,33,0,72,205,244,125,0,0,0,0,0,0
 100 DATA 58,121,92,0,0,0,0,0,0,0,230,2,40,20,33,64,72,205,244,125,33,64,72,205,244,125,33,64,72,205,244,125,24,18,33,95,72,205,13,126,33,95,72,205,13,126,33,95,72,205,13,126
 110 DATA 33,128,72,205,244,125,33,192,72,205,244,125,33,192,72,205,244,125
 115 DATA 33,31,80,205,13,126,33,31,80,205,13,126,33,95,80,205,13,126,201
 120 DATA 33,128,72,205,244,125,33,192,72,205,244,125,33,31,80,205,13,126,33,95,80,205,13,126,201
 130 DATA 33,95,64,205,13,126,33,128,64,205,244,125,33,0,72,205,244,125,201
 140 DATA 33,95,64,205,13,126,33,223,64,205,13,126,33,128,72,205,244,125,33,192,72,205,244,125,201
 150 LET a=PEEK 23675+256*PEEK 23676
 160 FOR b=a TO a+167
 170 READ c: POKE b,c: NEXT b
 180 DATA 15,18,34,127,255,255,40,16,128,64,32,254,254,255,40,16
 190 DATA 127,127,127,127,127,255,21,8,254,254,254,254,255,255,64,128
 200 DATA 0,248,196,196,254,254,40,16,24,24,36,126,60,90,165,66
 210 DATA 90,153,126,60,189,189,102,36,1,2,4,127,127,255,20,8
 220 DATA 240,72,68,254,255,255,20,8,0,31,35,35,127,127,20,8
 230 DATA 127,127,127,127,255,255,2,1,254,254,254,254,254,255,168,16
 240 DATA 16,41,199,0,38,0,0,0,0,68,255,68,68,255,68,0
 250 DATA 0,34,85,143,151,163,160,0,0,68,170,241,233,197,5,0
 260 DATA 16,16,16,254,63,31,15,7,0,0,0,0,30,255,255,255
 270 DATA 96,124,84,120,127,255,254,252,0,0,3,2,15,63,255,0,6,12,152,240,224,85,255,0
 280 PRINT AT 11,3;"Do you want instructions?";AT 13,11;"(y)es";AT 15,11;"(n)o"
 290 PAUSE 0: IF INKEY$="y" THEN GO TO 300:END IF
 295 GO TO 400
 300 CLS : PRINT AT 0,11;"OBJECT" : Print at 2,0; "To guide a \g across a road and ariver,avoiding \a\b \c\d\e \f \q\r\r\s \t\u." ; "A \o\p patrols the central island."
 310 PRINT "There are 4 HOMES to be filled. i.e. gaps in top fence \n\n\n \n\n\n"
 320 PRINT "Once all 4 HOMES are filled the speed will increase,an extra \o\p will be added and the HOMES willempty."
 330 PRINT AT 18,9;"Press any key.": PAUSE 0
 370 CLS : PRINT AT 7,11;"CONTROLS"
 375 PRINT "      ^               < >"
 380 PRINT FLASH 1;AT 11,6;"1"; FLASH 0;" 2 3 4 5 6 7 8 "; FLASH 1;"9"; FLASH 0;" "; FLASH 1;"0"
 390 PRINT AT 18,5;"Press any key to PLAY": PAUSE 0
 400 BRIGHT 1: PAPER 5: BORDER 5: CLS
 410 LET hi=0
 420 PRINT PAPER 4;AT 10,0;"               \o\p               "
 430 LET lives=9: LET score=0: LET home=0
 440 POKE 32425,201: POKE 32450,201: POKE 32469,201
 450 PRINT AT 0,0; PAPER 4;"\n\n\n\n"; PAPER 7;" "; PAPER 4;"\n\n\n\n\n\n"; PAPER 7;" "; PAPER 4;"\n\n\n\n\n\n\n"; PAPER 7;" "; PAPER 4;"\n\n\n\n\n\n\n"; PAPER 7;" "; PAPER 4;"\n\n\n\n"
 455 IF home<>0 THEN GO TO 660:END IF
 460 PRINT PAPER 4; INK 5;"\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\.."
 470 PRINT " \q\r\r\r\s   \q\r\r\r\s    \q\r\r\s   \q\r\r\s   "
 480 PRINT INK 7;"    \m\m\m     \m\m\m\m\m     \m\m\m      \m"
 490 PRINT INK 2;"  \t\u     \t\u     \t\u   \t\u      \t\u "
 500 PRINT INK 7;"\m\m   \m      \m\m\m\m\m        \m\m\m    "
 510 PRINT INK 1;"\r\s     \q\r\r\s      \q\r\r\r\r\s     \q\r\r\r"
 520 PRINT INK 7;"   \m\m  \m\m\m\m\m  \m\m       \m\m\m      "
 530 PRINT "\u         \t\u     \t\u      \t\u    \t"
 540 PRINT PAPER 4;"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
 550 PRINT PAPER 0; INK 7;AT 11,0;"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
 560 PRINT PAPER 0; INK 3;" \a\b \f  \a\b  \c\d\c\d\e \f \f   \c\d\e      "
 570 PRINT PAPER 0; INK 7;"--------------------------------"
 580 PRINT PAPER 0; INK 5;" \a\b    \a\b    \a\b  \a\b        \a\b   "
 590 PRINT PAPER 0; INK 7;"================================"
 600 PRINT PAPER 0; INK 4;"\i     \h\i   \h\i       \h\i         \h"
 610 PRINT PAPER 0; INK 7;"--------------------------------"
 620 PRINT PAPER 0; INK 6;"\k\l   \h\i  \h\i \f  \f  \j\k\l\k\l   \f    \j"
 630 PRINT PAPER 4;"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
 640 PRINT PAPER 4;"                                "
 650 PRINT PAPER 1; INK 7;" SCORE ";AT 21,11;" MEN "; PAPER 5; INK 0;lives; PAPER 1; INK 7;" HI-SCORE "
 660 LET x1=20: LET y1=16: LET x2=x1: LET y2=y1
 670 PRINT PAPER 8; INK 8;AT x1,y1;" "
 680 RANDOMIZE USR 32295
 690 IF  SCREEN$(x2, y2)=" " THEN GO TO 880:END IF
 700 LET a=x2: FOR b=25 TO 35: GO SUB 25: GO SUB 25: NEXT b
 730 FOR a=x2 TO 20 STEP 2: GO SUB 25: GO SUB 25: NEXT a
 740 LET lives=lives-1: PRINT AT 21,16;lives
 750 LET x2=20
 760 IF lives<>0 THEN GO TO 680:END IF
 770 IF hi>score THEN GO TO 790:END IF
 780 LET hi=score: PRINT AT 21,27;hi
 790 PRINT FLASH 1; PAPER 7;AT 12,0;"           GAME  OVER           "
 800 PRINT AT 14,0;"  Another game ? (y)es  (n)o    "
 840 IF INKEY$="n" THEN RANDOMIZE USR 0:END IF
 850 IF INKEY$<>"y" THEN GO TO 840:END IF
 860 PRINT PAPER 5;AT 21,7;"    ": GO TO 420
 880 IF x2<>0 THEN GO TO 1050:END IF
 890 PRINT PAPER 8; INK 8;AT x1,y1;" ": PRINT AT x2,y2;"\g"
 900 RESTORE 920
 910 FOR a=1 TO 8: READ b,c: BEEP b,c: NEXT a
 920 DATA .1,11,.1,11,.8,16,.05,11,.05,16,.05,11,.05,16,1,20
 930 LET home=home+1: LET score=score+50: PRINT AT 21,7;score
 950 IF home/4<>INT (home/4) THEN GO TO 660:END IF
 960 IF home=4 THEN POKE 32425,0:END IF
 970 IF home=8 THEN POKE 32450,0:END IF
 980 IF home=12 THEN POKE 32469,0:END IF
 985 IF home>36 THEN GO TO 450:END IF
 990 LET a=RND*31
1000 LET a=a+1
1005 IF a>31 THEN LET a=0:END IF
1010 IF  SCREEN$ (10,a)="" THEN GO TO 1000:END IF
1020 IF  SCREEN$ (10,a+1)="" THEN GO TO 1000:END IF
1030 PRINT PAPER 4;AT 10,a;"\o\p"
1035 RESTORE 920: FOR a=1 TO 8: READ b,c: BEEP b,c: NEXT a
1040 GO TO 450
1050 PRINT PAPER 8; INK 8;AT x2,y2;"\g"
1060 LET x1=x2: LET y1=y2
1070 IF INKEY$<>"1" THEN GO TO 1100:END IF
1080 BEEP .001,33
1090 LET x2=x2-2: LET score=score+5: PRINT AT 21,7;score
1100 LET y2=y2+(INKEY$="0" AND y2<>31)-(INKEY$="9" AND y2<>0)
1110 GO TO 670
I didn't really understand what was happening around line 20 - 40 as the code is never used. So I put a CLS in commented out the other stuff as a short term fix.
User avatar
Pegaz
Dynamite Dan
Posts: 1210
Joined: Mon Nov 13, 2017 1:44 pm

Re: Games that become playable after compiling?

Post by Pegaz »

[mention]Jbizzel[/mention]

Theres still a lot to do here, the game crashes every time the frog moves to the right (key 0).
I managed to fix it a little more, but the objects in the lower part of the screen do not move at all and the frog dies every time it touches the upper fence.
What bothers me is this unwanted scroll, which occurs before each start of the game, obviously theres something else that needs to be adjusted to the compiler...

Code: Select all

  #include <screen.bas>
  0 DIM b, a, y2, c, hi, lives, score, home, x1, y1, x2
  '20 CLEAR 32243
  22 GO TO 40
  25 BEEP .01,b-a
  30 PRINT OVER 1; PAPER 8; INK 8;AT a,y2;"\g": RETURN
  40 PRINT AT 11,5;"Please wait a moment"
  50 FOR a=32244 TO 32494
  60 READ b: POKE a,b: NEXT a
  70 DATA 14,8,229,17,31,0,25,126,237,82,31,6,32,126,31,119,35,16,250,225,36,13,32,234,201
  80 DATA 14,8,175,229,17,31,0,237,82,126,25,23,6,32,126,23,119,43,16,250,225,36,13,32,233,201
  90 DATA 33,95,64,205,13,126,33,95,64,205,13,126,33,128,64,205,244,125,33,128,64,205,244,125,33,223,64,205,13,126,33,0,72,205,244,125,0,0,0,0,0,0
 100 DATA 58,121,92,0,0,0,0,0,0,0,230,2,40,20,33,64,72,205,244,125,33,64,72,205,244,125,33,64,72,205,244,125,24,18,33,95,72,205,13,126,33,95,72,205,13,126,33,95,72,205,13,126
 110 DATA 33,128,72,205,244,125,33,192,72,205,244,125,33,192,72,205,244,125
 115 DATA 33,31,80,205,13,126,33,31,80,205,13,126,33,95,80,205,13,126,201
 120 DATA 33,128,72,205,244,125,33,192,72,205,244,125,33,31,80,205,13,126,33,95,80,205,13,126,201
 130 DATA 33,95,64,205,13,126,33,128,64,205,244,125,33,0,72,205,244,125,201
 140 DATA 33,95,64,205,13,126,33,223,64,205,13,126,33,128,72,205,244,125,33,192,72,205,244,125,201
 150 LET a=PEEK 23675+256*PEEK 23676
 160 FOR b=a TO a+167
 170 READ c: POKE b,c: NEXT b
 180 DATA 15,18,34,127,255,255,40,16,128,64,32,254,254,255,40,16
 190 DATA 127,127,127,127,127,255,21,8,254,254,254,254,255,255,64,128
 200 DATA 0,248,196,196,254,254,40,16,24,24,36,126,60,90,165,66
 210 DATA 90,153,126,60,189,189,102,36,1,2,4,127,127,255,20,8
 220 DATA 240,72,68,254,255,255,20,8,0,31,35,35,127,127,20,8
 230 DATA 127,127,127,127,255,255,2,1,254,254,254,254,254,255,168,16
 240 DATA 16,41,199,0,38,0,0,0,0,68,255,68,68,255,68,0
 250 DATA 0,34,85,143,151,163,160,0,0,68,170,241,233,197,5,0
 260 DATA 16,16,16,254,63,31,15,7,0,0,0,0,30,255,255,255
 270 DATA 96,124,84,120,127,255,254,252,0,0,3,2,15,63,255,0,6,12,152,240,224,85,255,0
 280 PRINT AT 11,3;"Do you want instructions?";AT 13,11;"(y)es";AT 15,11;"(n)o"
 290 PAUSE 0: IF INKEY$="y" THEN GO TO 300:END IF
 295 GO TO 400
 300 CLS : PRINT AT 0,11;"OBJECT"''"To guide a \g across a road and ariver,avoiding \a\b \c\d\e \f \q\r\r\s \t\u."''"A \o\p patrols the central island."
 310 PRINT ''"There are 4 HOMES to be filled. i.e. gaps in top fence \n\n\n \n\n\n"
 320 PRINT '"Once all 4 HOMES are filled the speed will increase,an extra \o\p will be added and the HOMES will empty."
 330 PRINT '''AT 18,9;"Press any key.": PAUSE 0
 370 CLS : PRINT AT 7,11;"CONTROLS"
 375 PRINT '"      ^               < >"
 380 PRINT FLASH 1;AT 11,6;"1"; FLASH 0;" 2 3 4 5 6 7 8 "; FLASH 1;"9"; FLASH 0;" "; FLASH 1;"0"
 390 PRINT AT 18,5;"Press any key to PLAY": PAUSE 0
 400 BRIGHT 1: PAPER 5: BORDER 5: CLS
 410 LET hi=0
 420 PRINT PAPER 4;AT 10,0;"               \o\p               "
 430 LET lives=9: LET score=0: LET home=0
 440 POKE 32425,201: POKE 32450,201: POKE 32469,201
 450 PRINT AT 0,0; PAPER 4;"\n\n\n\n"; PAPER 7;" "; PAPER 4;"\n\n\n\n\n\n"; PAPER 7;" "; PAPER 4;"\n\n\n\n\n\n\n"; PAPER 7;" "; PAPER 4;"\n\n\n\n\n\n\n"; PAPER 7;" "; PAPER 4;"\n\n\n\n"
 455 IF home<>0 THEN GO TO 660:END IF
 460 PRINT PAPER 4; INK 5;"\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\.."
 470 PRINT " \q\r\r\r\s   \q\r\r\r\s    \q\r\r\s   \q\r\r\s   "
 480 PRINT INK 7;"    \m\m\m     \m\m\m\m\m     \m\m\m      \m"
 490 PRINT INK 2;"  \t\u     \t\u     \t\u   \t\u      \t\u "
 500 PRINT INK 7;"\m\m   \m      \m\m\m\m\m        \m\m\m    "
 510 PRINT INK 1;"\r\s     \q\r\r\s      \q\r\r\r\r\s     \q\r\r\r"
 520 PRINT INK 7;"   \m\m  \m\m\m\m\m  \m\m       \m\m\m      "
 530 PRINT "\u         \t\u     \t\u      \t\u    \t"
 540 PRINT PAPER 4;"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
 550 PRINT PAPER 0; INK 7;AT 11,0;"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
 560 PRINT PAPER 0; INK 3;" \a\b \f  \a\b  \c\d\c\d\e \f \f   \c\d\e      "
 570 PRINT PAPER 0; INK 7;"--------------------------------"
 580 PRINT PAPER 0; INK 5;" \a\b    \a\b    \a\b  \a\b        \a\b   "
 590 PRINT PAPER 0; INK 7;"================================"
 600 PRINT PAPER 0; INK 4;"\i     \h\i   \h\i       \h\i         \h"
 610 PRINT PAPER 0; INK 7;"--------------------------------"
 620 PRINT PAPER 0; INK 6;"\k\l   \h\i  \h\i \f  \f  \j\k\l\k\l   \f    \j"
 630 PRINT PAPER 4;"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
 640 PRINT PAPER 4;"                                "
 650 PRINT PAPER 1; INK 7;" SCORE ";AT 21,11;" MEN "; PAPER 5; INK 0;lives; PAPER 1; INK 7;" HI-SCORE "
 660 LET x1=20: LET y1=16: LET x2=x1: LET y2=y1
 670 PRINT PAPER 8; INK 8;AT x1,y1;" "
 680 RANDOMIZE USR 32295
 690 IF  SCREEN$(x2,y2)=" " THEN GO TO 880:END IF
 700 LET a=x2: FOR b=25 TO 35: GO SUB 25: GO SUB 25: NEXT b
 730 FOR a=x2 TO 20 STEP 2: GO SUB 25: GO SUB 25: NEXT a
 740 LET lives=lives-1: PRINT AT 21,16;lives
 750 LET x2=20
 760 IF lives<>0 THEN GO TO 680:END IF
 770 IF hi>score THEN GO TO 790:END IF
 780 LET hi=score: PRINT AT 21,27;hi
 790 PRINT FLASH 1; PAPER 7;AT 12,0;"           GAME  OVER           "
 800 PRINT AT 14,0;"  Another game ? (y)es  (n)o    "
 840 IF INKEY$="n" THEN RANDOMIZE USR 0:END IF
 850 IF INKEY$<>"y" THEN GO TO 840:END IF
 860 PRINT PAPER 5;AT 21,7;"    ": GO TO 420
 880 IF x2<>0 THEN GO TO 1050:END IF
 890 PRINT PAPER 8; INK 8;AT x1,y1;" ": PRINT AT x2,y2;"\g"
 900 RESTORE 920
 910 FOR a=1 TO 8: READ b,c: BEEP b,c: NEXT a
 920 DATA .1,11,.1,11,.8,16,.05,11,.05,16,.05,11,.05,16,1,20
 930 LET home=home+1: LET score=score+50: PRINT AT 21,7;score
 950 IF home/4<>INT (home/4) THEN GO TO 660:END IF
 960 IF home=4 THEN POKE 32425,0:END IF
 970 IF home=8 THEN POKE 32450,0:END IF
 980 IF home=12 THEN POKE 32469,0:END IF
 985 IF home>36 THEN GO TO 450:END IF
 990 LET a=RND*31
1000 LET a=a+1
1005 IF a>31 THEN LET a=0:END IF
1010 IF  SCREEN$ (10,a)="" THEN GO TO 1000:END IF
1020 IF  SCREEN$ (10,a+1)="" THEN GO TO 1000:END IF
1030 PRINT PAPER 4;AT 10,a;"\o\p"
1035 RESTORE 920: FOR a=1 TO 8: READ b,c: BEEP b,c: NEXT a
1040 GO TO 450
1050 PRINT PAPER 8; INK 8;AT x2,y2;"\g"
1060 LET x1=x2: LET y1=y2
1070 IF INKEY$<>"1" THEN GO TO 1100:END IF
1080 BEEP .001,33
1090 LET x2=x2-2: LET score=score+5: PRINT AT 21,7;score
1100 LET y2=y2+(INKEY$="0" AND y2<>31)-(INKEY$="9" AND y2<>0)
1110 GO TO 670
User avatar
Pegaz
Dynamite Dan
Posts: 1210
Joined: Mon Nov 13, 2017 1:44 pm

Re: Games that become playable after compiling?

Post by Pegaz »

I just asked for help on the Boriel forum.
Fingers crossed... ;)
User avatar
boriel
Drutt
Posts: 7
Joined: Sun May 10, 2020 1:47 pm
Location: Barcelona
Contact:

Re: Games that become playable after compiling?

Post by boriel »

Compile with the --sinclair flag.
This improves compatibility with Sinclair BASIC. Otherwise there are things that won't compile.
This flag also includes some functions (SCREEN$, POINT, ATTR) not included by default.
User avatar
Jbizzel
Dynamite Dan
Posts: 1537
Joined: Mon May 04, 2020 4:34 pm
Location: Hull
Contact:

Re: Games that become playable after compiling?

Post by Jbizzel »

[mention]boriel[/mention] , [mention]Pegaz[/mention]

thanks, I quickly compiled it just now, with your new code and using --sinclair flag.

The best version yet. The scrolling issue at the start is throwing out all the graphics. The routine that causes obstacle movement must work on certain rows of the screen. The scroll is causing the wrong objects to move.

There are other issues but lets look at the main one first - the scrolling issue, the other seems trivial :)
User avatar
Jbizzel
Dynamite Dan
Posts: 1537
Joined: Mon May 04, 2020 4:34 pm
Location: Hull
Contact:

Re: Games that become playable after compiling?

Post by Jbizzel »

So the problem is when it draws the screen... here onwards it adds blank lines in between the printing. I cannot see why. However, see example below, I added in "at 2,0;" etc to force it to print in the right places. This gives a better result.

Code: Select all

 460 PRINT PAPER 4; INK 5; at 0,0;"\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\.."
 470 PRINT at 1,0; "\q\r\r\r\s   \q\r\r\r\s    \q\r\r\s   \q\r\r\s   "
 480 PRINT INK 7;  at 2,0;"   \m\m\m     \m\m\m\m\m     \m\m\m      \m"
 490 PRINT INK 2; at 3,0;" \t\u     \t\u     \t\u   \t\u      \t\u "
 500 PRINT INK 7; at 4,0;"\m\m   \m      \m\m\m\m\m        \m\m\m    "
 510 PRINT INK 1; at 5,0;"\r\s     \q\r\r\s      \q\r\r\r\r\s     \q\r\r\r"
 520 PRINT INK 7; at 6,0;"  \m\m  \m\m\m\m\m  \m\m       \m\m\m      "
 530 PRINT at 7,0;"\u        \t\u     \t\u      \t\u    \t"
 540 PRINT PAPER 4; at 8,0;"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
 550 PRINT PAPER 0; INK 7;AT 11,0;"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"

Image
User avatar
Jbizzel
Dynamite Dan
Posts: 1537
Joined: Mon May 04, 2020 4:34 pm
Location: Hull
Contact:

Re: Games that become playable after compiling?

Post by Jbizzel »

Try this!! :)

So this drawing the screen nicely. the next issue is the flashing frog that can hardly be seen, and now the controls are sensitive which makes the game much harder. But some real progress...

Code: Select all

  #include <screen.bas>
  0 DIM b, a, y2, c, hi, lives, score, home, x1, y1, x2
  '20 CLEAR 32243
  22 GO TO 40
  25 BEEP .01,b-a
  30 PRINT OVER 1; PAPER 8; INK 8;AT a,y2;"\g": RETURN
  40 PRINT AT 11,5;"Please wait a moment"
  50 FOR a=32244 TO 32494
  60 READ b: POKE a,b: NEXT a
  70 DATA 14,8,229,17,31,0,25,126,237,82,31,6,32,126,31,119,35,16,250,225,36,13,32,234,201
  80 DATA 14,8,175,229,17,31,0,237,82,126,25,23,6,32,126,23,119,43,16,250,225,36,13,32,233,201
  90 DATA 33,95,64,205,13,126,33,95,64,205,13,126,33,128,64,205,244,125,33,128,64,205,244,125,33,223,64,205,13,126,33,0,72,205,244,125,0,0,0,0,0,0
 100 DATA 58,121,92,0,0,0,0,0,0,0,230,2,40,20,33,64,72,205,244,125,33,64,72,205,244,125,33,64,72,205,244,125,24,18,33,95,72,205,13,126,33,95,72,205,13,126,33,95,72,205,13,126
 110 DATA 33,128,72,205,244,125,33,192,72,205,244,125,33,192,72,205,244,125
 115 DATA 33,31,80,205,13,126,33,31,80,205,13,126,33,95,80,205,13,126,201
 120 DATA 33,128,72,205,244,125,33,192,72,205,244,125,33,31,80,205,13,126,33,95,80,205,13,126,201
 130 DATA 33,95,64,205,13,126,33,128,64,205,244,125,33,0,72,205,244,125,201
 140 DATA 33,95,64,205,13,126,33,223,64,205,13,126,33,128,72,205,244,125,33,192,72,205,244,125,201
 150 LET a=PEEK 23675+256*PEEK 23676
 160 FOR b=a TO a+167
 170 READ c: POKE b,c: NEXT b
 180 DATA 15,18,34,127,255,255,40,16,128,64,32,254,254,255,40,16
 190 DATA 127,127,127,127,127,255,21,8,254,254,254,254,255,255,64,128
 200 DATA 0,248,196,196,254,254,40,16,24,24,36,126,60,90,165,66
 210 DATA 90,153,126,60,189,189,102,36,1,2,4,127,127,255,20,8
 220 DATA 240,72,68,254,255,255,20,8,0,31,35,35,127,127,20,8
 230 DATA 127,127,127,127,255,255,2,1,254,254,254,254,254,255,168,16
 240 DATA 16,41,199,0,38,0,0,0,0,68,255,68,68,255,68,0
 250 DATA 0,34,85,143,151,163,160,0,0,68,170,241,233,197,5,0
 260 DATA 16,16,16,254,63,31,15,7,0,0,0,0,30,255,255,255
 270 DATA 96,124,84,120,127,255,254,252,0,0,3,2,15,63,255,0,6,12,152,240,224,85,255,0
 280 PRINT AT 11,3;"Do you want instructions?";AT 13,11;"(y)es";AT 15,11;"(n)o"
 290 PAUSE 0: IF INKEY$="y" THEN GO TO 300:END IF
 295 GO TO 400
 300 CLS : PRINT AT 0,11;"OBJECT"''"To guide a \g across a road and ariver,avoiding \a\b \c\d\e \f \q\r\r\s \t\u."''"A \o\p patrols the central island."
 310 PRINT ''"There are 4 HOMES to be filled. i.e. gaps in top fence \n\n\n \n\n\n"
 320 PRINT '"Once all 4 HOMES are filled the speed will increase,an extra \o\p will be added and the HOMES will empty."
 330 PRINT '''AT 18,9;"Press any key.": PAUSE 0
 370 CLS : PRINT AT 7,11;"CONTROLS"
 375 PRINT '"      ^               < >"
 380 PRINT FLASH 1;AT 11,6;"1"; FLASH 0;" 2 3 4 5 6 7 8 "; FLASH 1;"9"; FLASH 0;" "; FLASH 1;"0"
 390 PRINT AT 18,5;"Press any key to PLAY": PAUSE 0
 400 BRIGHT 1: PAPER 5: BORDER 5: CLS
 410 LET hi=0
 420 PRINT PAPER 4;AT 10,0;"               \o\p               "
 430 LET lives=9: LET score=0: LET home=0
 440 POKE 32425,201: POKE 32450,201: POKE 32469,201
 450 PRINT AT 0,0; PAPER 4;"\n\n\n\n"; PAPER 7;" "; PAPER 4;"\n\n\n\n\n\n"; PAPER 7;" "; PAPER 4;"\n\n\n\n\n\n\n"; PAPER 7;" "; PAPER 4;"\n\n\n\n\n\n\n"; PAPER 7;" "; PAPER 4;"\n\n\n\n"
 455 IF home<>0 THEN GO TO 660:END IF
 460 PRINT PAPER 4; INK 5; at 1,0 ;"\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\.."
 470 PRINT  at 2,0; " \q\r\r\r\s   \q\r\r\r\s    \q\r\r\s   \q\r\r\s   "
 480 PRINT INK 7; at 3,0 ;"    \m\m\m     \m\m\m\m\m     \m\m\m      \m"
 490 PRINT INK 2; at 4,0 ;"  \t\u     \t\u     \t\u   \t\u      \t\u "
 500 PRINT INK 7; at 5,0 ;"\m\m   \m      \m\m\m\m\m        \m\m\m    "
 510 PRINT INK 1; at 6,0 ;"\r\s     \q\r\r\s      \q\r\r\r\r\s     \q\r\r\r"
 520 PRINT INK 7; at 7,0 ;"   \m\m  \m\m\m\m\m  \m\m       \m\m\m      "
 530 PRINT  at 8,0 ;"\u         \t\u     \t\u      \t\u    \t"
 540 PRINT PAPER 4; at 9,0 ;"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
 550 PRINT PAPER 0; INK 7;AT 11,0;"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
 560 PRINT PAPER 0; INK 3; at 12,0 ;" \a\b \f  \a\b  \c\d\c\d\e \f \f   \c\d\e      "
 570 PRINT PAPER 0; INK 7; at 13,0 ;"--------------------------------"
 580 PRINT PAPER 0; INK 5; at 14,0 ;" \a\b    \a\b    \a\b  \a\b        \a\b   "
 590 PRINT PAPER 0; INK 7; at 15,0 ;"================================"
 600 PRINT PAPER 0; INK 4; at 16,0 ;"\i     \h\i   \h\i       \h\i         \h"
 610 PRINT PAPER 0; INK 7; at 17,0 ;"--------------------------------"
 620 PRINT PAPER 0; INK 6; at 18,0 ;"\k\l   \h\i  \h\i \f  \f  \j\k\l\k\l   \f    \j"
 630 PRINT PAPER 4; at 19,0 ;"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
 640 PRINT PAPER 4; at 20,0 ;"                                "
 650 PRINT PAPER 1; INK 7; at 21,0 ;" SCORE ";AT 21,11;" MEN "; PAPER 5; INK 0;lives; PAPER 1; INK 7;" HI-SCORE "
 660 LET x1=20: LET y1=16: LET x2=x1: LET y2=y1
 670 PRINT PAPER 8; INK 8;AT x1,y1;" "
 680 RANDOMIZE USR 32295
 690 IF  SCREEN$(x2,y2)=" " THEN GO TO 880:END IF
 700 LET a=x2: FOR b=25 TO 35: GO SUB 25: GO SUB 25: NEXT b
 730 FOR a=x2 TO 20 STEP 2: GO SUB 25: GO SUB 25: NEXT a
 740 LET lives=lives-1: PRINT AT 21,16;lives
 750 LET x2=20
 760 IF lives<>0 THEN GO TO 680:END IF
 770 IF hi>score THEN GO TO 790:END IF
 780 LET hi=score: PRINT AT 21,27;hi
 790 PRINT FLASH 1; PAPER 7;AT 12,0;"           GAME  OVER           "
 800 PRINT AT 14,0;"  Another game ? (y)es  (n)o    "
 840 IF INKEY$="n" THEN RANDOMIZE USR 0:END IF
 850 IF INKEY$<>"y" THEN GO TO 840:END IF
 860 PRINT PAPER 5;AT 21,7;"    ": GO TO 420
 880 IF x2<>0 THEN GO TO 1050:END IF
 890 PRINT PAPER 8; INK 8;AT x1,y1;" ": PRINT AT x2,y2;"\g"
 900 RESTORE 920
 910 FOR a=1 TO 8: READ b,c: BEEP b,c: NEXT a
 920 DATA .1,11,.1,11,.8,16,.05,11,.05,16,.05,11,.05,16,1,20
 930 LET home=home+1: LET score=score+50: PRINT AT 21,7;score
 950 IF home/4<>INT (home/4) THEN GO TO 660:END IF
 960 IF home=4 THEN POKE 32425,0:END IF
 970 IF home=8 THEN POKE 32450,0:END IF
 980 IF home=12 THEN POKE 32469,0:END IF
 985 IF home>36 THEN GO TO 450:END IF
 990 LET a=RND*31
1000 LET a=a+1
1005 IF a>31 THEN LET a=0:END IF
1010 IF  SCREEN$ (10,a)="" THEN GO TO 1000:END IF
1020 IF  SCREEN$ (10,a+1)="" THEN GO TO 1000:END IF
1030 PRINT PAPER 4;AT 10,a;"\o\p"
1035 RESTORE 920: FOR a=1 TO 8: READ b,c: BEEP b,c: NEXT a
1040 GO TO 450
1050 PRINT PAPER 8; INK 8;AT x2,y2;"\g"
1060 LET x1=x2: LET y1=y2
1070 IF INKEY$<>"1" THEN GO TO 1100:END IF
1080 BEEP .001,33
1090 LET x2=x2-2: LET score=score+5: PRINT AT 21,7;score
1100 LET y2=y2+(INKEY$="0" AND y2<>31)-(INKEY$="9" AND y2<>0)
1110 GO TO 670
User avatar
Pegaz
Dynamite Dan
Posts: 1210
Joined: Mon Nov 13, 2017 1:44 pm

Re: Games that become playable after compiling?

Post by Pegaz »

[mention]Jbizzel[/mention]

Well, --sinclair switch didnt improve much my previous version.
As you said, it seems that the way the game draws the screen doesnt suit the compiler and additional program customization is needed.
Your version is a big step forward, runs nicely, we'll see, maybe [mention]boriel[/mention] has ideas of what to do next and make it perfect.
Last edited by Pegaz on Thu Dec 30, 2021 8:42 am, edited 1 time in total.
Post Reply