Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Creating +3 Menus - Loading external BAS files
#1
Hello,

I'm creating Menus for my +3 game compilations but I can't find a way to load external BAS files.

With the LOAD command I can load only CODE & SCREEN$ files. There is a way to LOAD another BAS file included in the disks?

Like on standard +3 BASIC.

ie: LOAD "MYBASPRG" or LOAD "MYBASPRG.BAS"

Thanks in advance.

Example:

[Image: SERVER_000249.jpg]
Reply
#2
I have not tried it, but you have a library called Basic.bas with which you can try to load the program:

Code:
#include <basic.bas>
EvalBASIC(chr($ef")+" "+chr($22)+"program.bas"+chr($22))

$ef is the LOAD ASCII code, $22 is the " ASCII code. Change program.bas by your program name.
Duefectu
https://zx.duefectucorp.com
duefectucorp@gmail.com
Reply
#3
I have tried this:

EvalBASIC(chr($ef)+" "+chr($22)+"mybasprg"+chr($22))

and

EvalBASIC(chr($ef)+" mybasprg")

but all time I get two errors when compiling:

basic.bas:48: warning: [W150] Parameter 'basic' is never used
basic.bas:49: warning: [W190] Function 'EvalBASIC' should return a value
Reply
#4
These are not errors, these are warnings.
These warnings are to be expected because the function is in pure assembler.
Give them a try and see if they work as expected.
---
Boriel
Reply
#5
Hi @boriel,

Thanks but with these warnings I can't compile my xxxxx.bas file.

I have tried many times and variants, but no way.

ie:

2000 EvalBASIC(chr($EF)+" "+chr($22)+"ROGERPAN"+chr($22))

2010 EvalBASIC(chr($EF)+" ROGUETRO")
Reply
#6
merlinkv Wrote:Hi @boriel,

Thanks but with these warnings I can't compile my xxxxx.bas file.

I have tried many times and variants, but no way.

ie:

2000 EvalBASIC(chr($EF)+" "+chr($22)+"ROGERPAN"+chr($22))

2010 EvalBASIC(chr($EF)+" ROGUETRO")

Can you put the entire listing of what you're trying to do?
I understand you want to compile a loader that will load and execute your .BAS programs (NOT compile them).
Also, the commands above execute this command: LOAD "ROGERPAN" and LOAD "ROGUETRO". But I'm not sure this is what you type in a +3.
---
Boriel
Reply
#7
Hello,

This is my first attempt at ZX Basic, and I'm very aware that I need to adapt and debug it better.

It's a quick adaptation of the menu, created in 3DOS, that I include in my ZX Basic disk compilations.

I know it's simple, but it's fully functional.

By pressing the numbers 1 through 9, we select the game we want to load (a program written in BASIC) or press N, L, P, or F to change pages.

But commands like LOAD "RSWYPE" are not recognized, ZX Basic wants CODE or SCREEN$ not other BASIC (+3DOS) programs.

Code:
  10 REM 720K Games_089
  30 DIM a, p, tp, b, c, i AS Ubyte
  30 LET a=19: LET p=1: LET tp=2
  40 GO SUB 2200: GO SUB 2300: GO SUB 2000: GO SUB 2100: INK7: BRIGHT 1
  50 PRINT AT 2,3; "R-Swipe"
  60 PRINT AT 4,3; "S.O.L.O."
  70 PRINT AT 6,3; "Sabotage"
  80 PRINT AT 8,3; "Sabotaje"
  90 PRINT AT 10,3; "Saboteur"
100 PRINT AT 12,3; "Saboteur 2"
110 PRINT AT 14,3; "Sabre Wulf"
120 PRINT AT 16,3; "Sabrina"
130 PRINT AT 18,3; "Sai Combat"
140 LET k$=INKEY
150 IF k$="1" THEN GO TO 3000: END IF
160 IF k$="2" THEN GO TO 3010: END IF
170 IF k$="3" THEN GO TO 3020: END IF
180 IF k$="4" THEN GO TO 3030: END IF
190 IF k$="5" THEN GO TO 3040: END IF
200 IF k$="6" THEN GO TO 3050: END IF
210 IF k$="7" THEN GO TO 3060: END IF
220 IF k$="8" THEN GO TO 3070: END IF
230 IF k$="9" THEN GO TO 3080: END IF
240 IF k$="n" OR k$="N" THEN LET p=2: GO TO 300: END IF
250 IF k$="l" OR k$="L" THEN LET p=2: GO TO 300: END IF
260 GO TO 140
300 GO SUB 2200: GO SUB 2300: GO SUB 2000: GO SUB 2100: INK 7: BRIGHT 1
310 PRINT AT 2,3; "Saigon Combat Unit P1"
320 PRINT AT 4,3; "Saigon Combat Unit P2"
330 PRINT AT 6,3; "Saimazoom"
340 PRINT AT 8,3; "Salamander"
350 PRINT AT 10,3; "Sam Slade Robo-Hunter"
360 PRINT AT 12,3; "Sami Troid"
370 PRINT AT 14,3; ""
380 PRINT AT 16,3; ""
390 PRINT AT 18,3; ""
400 LET k$=INKEY
410 IF k$="1" THEN GO TO 3090: END IF
420 IF k$="2" THEN GO TO 3100: END IF
430 IF k$="3" THEN GO TO 3110: END IF
440 IF k$="4" THEN GO TO 3120: END IF
450 IF k$="5" THEN GO TO 3130: END IF
460 IF k$="6" THEN GO TO 3140: END IF
500 IF k$="p" OR k$="P" THEN LET p=1: GO TO 20: END IF
510 IF k$="f" OR k$="F" THEN LET p=1: GO TO 20: END IF
520 GO TO 400
2000 BRIGHT 1
2010 IF p=1 THEN PRINT AT 20,0; INK 2 ; "N"; INK 4;" - Next": PRINT AT 20,12; INK 2;"L"; INK 4; " - Last": END IF
2020 IF p=2 THEN PRINT AT 20,0; INK 2 ; "P"; INK 4 ; " - Prev": PRINT AT 20,12; INK 2;"F"; INK 4; " - First": END IF
2030 PRINT AT 20,29; INK 6; p;"/";tp
2040 RETURN
2100 BRIGHT 1
2110 POKE 23659,0: PRINT AT 22,0 ; INK 5 ; "720K 128DE / 80 Tracks / 2 Sides": POKE 23659,2
2120 RETURN
2200 BORDER 0: PAPER 0: CLS: BRIGHT 1
2210 PRINT AT 0,0; INK 5; "+3DOS Games 089"
2220 PRINT AT 0,19; INK 6; "MerlinKV 2025"
2230 RETURN
2300 INK 3: BRIGHT 1
2310 LET b=2:LET c=0:LET i=6
2320 FOR d=b TO a STEP 2
2330 PRINT AT b,0 ; INK i;c+1;")"
2340 LET b=b+2:LET c=c+1
2350 NEXT d
2360 RETURN
3000 LOAD "RSWYPE"
3010 LOAD "SOLO.INI"
3020 LOAD "SABOTAGE"
3030 LOAD "SABOTAJE.INI"
3040 LOAD "SABOTEUR"
3050 LOAD "SABOTEU2"
3060 LOAD "SABREWUL.INI"
3070 LOAD "SABRINA"
3080 LOAD "SCOMBAT"
3090 LOAD "SAICOMU1.INI"
3100 LOAD "SAICOMU2.INI"
3110 LOAD "SAIMAZOO"
3120 LOAD "SALAMAND"
3130 LOAD "SAMSLADE"
3140 LOAD "SAMITROI.INI"
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)