Jump to content
IGNORED

[AQUARIUS] BootLoader BASIC


Recommended Posts

BootLoader Basic is the new version to create bootable BASIC programs on the Aquarius. Together with the Virtual Aquarius, BL Basic provides a complete environment to create, test and dump your BASIC programs. No more hussle with external scripts to create your ROM.

BL Basic adds the following commands and functions:

- CLS - Clear screen
Syntax: CLS

- LOCATE - Position on screen
Syntax: LOCATE col, row

- OUT - I/O Output data to port
Syntax: OUT port, data

- PSG - Program PSG directly register, value
Syntax: PSG register, value [, ...]

- IN() - I/O Input data from port
Syntax: n = IN( port )

- JOY() - Read joystick
Syntax: j = JOY( n )
n - 0 will read left or right
- 1 will read left joystick only
- 2 will read right joystick only


- LDUMP
This command will export the BASIC program to ROM file using the printer interface of the Virtual Aquarius


All these commands (except LDUMP) can be used in your own ROM file as well.

To create your own BASIC ROM:

Load the BLBASIC.ROM in the Virtual Aquarius.
Next load your BASIC program by typing, quick type or load cassette.
Type the command LDUMP

IMPORTANT: Before pressing RETURN check the Virtual Aquarius printer settings!
Go to Configure -> Printer and configure the "Filename for Printer Output"
Make sure you send the output to a new file (!)

After checking the printer settings press RETURN at the LDUMP command

That's it!

Rename the output file extension from .txt to .rom or .bin and load the file into the Virtual Aquarius.

The zip file includes the following:

README.TXT - this text
BLBASIC.ROM - ROM to load into the Virtual Aquarius
SOURCE.ZIP - Z80 assembly code to create BLBASIC

BLBasic.zip

 

Regs,

Martin

  • Like 3
Link to comment
Share on other sites

Super awesome.

 

What's a PSG register?

 

try this

cls: locate1,1: print("hello"): poke12288,255

doesn't it seem that the cursor is at 1,2 when it starts printing?

Well I guess that's the way Extended Basic did it as well.

 

You have some examples of those out and in commands in use?

Edited by Pset
Link to comment
Share on other sites

What's a PSG register?

PSG is the AY-3-8910 programmable sound generator, which is the 3-channel sound chip located in the mini-expander of the Aquarius. It also controls the handcontrollers.

You can read more about the PSG and its registers on my website here.

 

See the first example in Z80 on the page, "generate a tone on channel A"

This can be done with the PSG command as followed:

PSG 8,15,0,93,1,13,7,62

try this

cls: locate1,1: print("hello"): poke12288,255
doesn't it seem that the cursor is at 1,2 when it starts printing?

Well I guess that's the way Extended Basic did it as well.

 

That correct, the locate command works the same as Extended Basic. Try this:

locate14,11:?"Hello world!"

You have some examples of those out and in commands in use?

The JOY() function allows you to read the handcontrollers directly, but you can also read them by using the OUT and IN statements:

10 OUT 247,7:OUT 246,63
20 OUT 247,14:I=IN(246)
30 IF I=255 THEN 20
40 PRINT I;
50 GOTO20
Read here for more information about reading the handcontrollers.

 

Regs,

Martin

  • Like 1
Link to comment
Share on other sites

Ah PSG for sound hardware. I was just bopping around with SOUND the other day.

 

I don't have any Aquarius hardware, too much arthritis to be patient enough with it but wow dreams do come true.

I tried to figure this stuff out for days, what peek or poke would get me the controller returns.

Press enter, change location, thumb all the buttons and the wheel, repeat. Until I had blisters.

Extended BASIC was supposed to be the answer and wasn't, but the disk drive gave me hope that

more programs to access faster would let me stumble on the answer, and that never showed up.

 

Are you testing your joysticks and ROMs on the real hardware?

 

Can we get joystick input from somewhere in the virtual software?

I just mashed all my keys, Virtual Aquarius didn't flinch.

Link to comment
Share on other sites

Here's a program to draw with PSET through your game controller and

save the drawing to a BASIC file that will draw the drawing back to you using POKES.

 

This is just a test to see if I could PEEK where I was PSETting and of course doodle with the game controller.

First version does some printing using LOCATE that slows down the mouse draw.

 

 

 
NEW
5 REM REQUIRES BLBASIC by Martin Steenoven
20 REM SET UP YOUR PRINTER FILE FOR OUTPUT
30 REM DRAW WITH A JOYSTICK
40 REM PRESS "S" SAVE LPRINT FILE, wait for beep.
50 REM LPRINTED FILE SAVED IS BASIC PROGRAM TO RUN
60 REM PRESS "C" TO CLEAR SCREEN
70 REM BROUGHT TO BY iGame3D January 05 2014
100 CLS
120 y =36:x=40 :REM PSET CENTER
130 vx=0:vy=0 :REM VELOCITY
140 PC = 0 : N = 0
500 REM MAIN
510 a$= inkey$
520 if a$="s" THEN goto 6000
530 if a$="c" THEN goto 10
600 GOSUB 5100 : REM DRAW PSET TRAIL
1000 REM JOYSTICK INPUT BLBASIC
1100 OUT 247,7:OUT 246,63
1110 OUT 247,14:I=IN(246)
1120 GOSUB 2000 :REM GET DATA FROM POSITION
1130 GOSUB 8000 : REM PRINT JOYSTICK AND POSITION
1200 IF I=255 THEN 500
1300 GOSUB 5000
1400 GOTO 500
2000 REM GET DATA FROM POSITION
2110 XYT= int(x/2)+(int(y/3)*40) : REM distance from screen loc 0
2120 PXYT = PEEK(12328+XYT) : REM Whats character did PSET make?
5000 REM handle joystick
5010 IF I = 251 THEN vY =-1:vx=0
5020 IF I = 254 THEN vY = 1:vx=0
5030 IF I = 247 THEN vX =-1:vy=0
5040 IF I = 253 THEN vX = +1:vy=0
5100 REM INCREMENT PSET POSTION
5110 x=x+vx:y=y+vy
5120 IF X > 79 THEN X = 1
5130 IF X < 1 THEN X = 79
5140 IF Y < 1 THEN Y = 71
5150 IF Y > 71 THEN Y = 1
5200 PSET(X,Y)
5210 RETURN
6000 REM Save Pokes
6010 GOSUB 7000 : REM Output program prefix
6030 DLS=8010 : REM DATA LINE START
6040 GOSUB 6520 : REM PRINT DATA LINES
6100 REM Loop through screen locations
6110 For I = 0 to 999
6120 P = PEEK(12288+I)
6130 IF P <> 32 THEN GOSUB 6300
6140 NEXT I
6200 REM LPRINT NUMBER OF DATA CALLS
6210 LPRINT:LPRINT"8000DATA";PC: LPRINT "RUN":LPRINT
6230 PRINTCHR$(7)
6240 PC=0 : GOTO 500 : REM to MAIN
6300 REM PRINT PEEK <> 32
6310 N = N + 1: PC = PC + 1
6330 if N <>4 THEN LPRINT I;CHR$(44);P;CHR$(44);
6340 if N = 4 THEN GOSUB 6500
6350 RETURN :REM TO
6500 REM PRINT DATA NEW LINES
6510 LPRINT I;CHR$(44);P; :LPRINT
6520 N = 0: DLS=DLS+10
6530 LPRINT DLS;"Data";
6540 RETURN:
7000 REM OUTPUT PROGRAM PREFIX
7010 LPRINT "NEW"
7020 LPRINT "100 REM Draw from DATA"
7030 LPRINT "110 PRINT CHR$(11)"
7040 LPRINT "120 READ N:REM number of locations"
7050 LPRINT "130 FOR I = 1 to N"
7060 LPRINT "140 READ D,C : REM Distance , Character"
7070 LPRINT "150 A=12288+D: REM Screen RAM"
7080 LPRINT "160 POKE A,C"
7090 LPRINT "170 NEXT I"
7100 DQ$= CHR$(34)+CHR$(34): REM double qoute
7110 LPRINT "200 i$=inkey$:ifi$=";DQ$;"THEN 200":LPRINT
7200 RETURN
8000 REM PRINT JOYSTICK POSITION DATA
8010 LOCATE 1,1:PRINT"IN(246)=";I
8020 LOCATE 18,1:PRINT"X:";x;" Y:";y
8030 LOCATE 1,2:PRINT "INT(x/2)+(INT(y/3)*40)=";XYT;
8040 LOCATE 1,3:PRINT "PEEK(";XYT;"+12328)=";PXYT ;" "; CHR$(PXYT)
8050 RETURN
9000 END
RUN

 

 

 

JoyStickDraw_blbasic.txt

Edited by Pset
  • Like 1
Link to comment
Share on other sites

Thanks Martin, once again you did a great job of taking programming on the Aquarius one step further. As of 2014 this is the tool for every Basic developer!

Thanks for the compliment! But 2014 is still young and I'm looking forward to see Jay his mini expander project which looks very promissing as well.

  • Like 2
Link to comment
Share on other sites

Thanks for the compliment! But 2014 is still young and I'm looking forward to see Jay his mini expander project which looks very promissing as well.

Thanks! I finally managed to burn that ROM that we had discussed, by the way; all I need to do now is finish building the glue logic and test it. I should have time next week.

  • Like 2
Link to comment
Share on other sites

First version does some printing using LOCATE that slows down the mouse draw.

 

Screenupdates always require some time.

I also noticed that you used the OUT and IN commands to read the joystick. These commands require multiple translations between BASIC and the machinecode. The JOY() function does this all for you in lesser translations.

  • Like 1
Link to comment
Share on other sites

But 2014 is still young and I'm looking forward to see Jay his mini expander project which looks very promissing as well.

That's indeed a project which I am also looking forward to,especially the incorporated font feature would rise the Aquarius to a much higher level!!
Link to comment
Share on other sites

Updated ROAD program, ie, drive your car down the road, don't hit the sides.

Use WASD keys or the joystick (still using the IN/OUT statements) to move.

Program runs out of memory eventually. I'm not sure why.

 

 

new
10 REM ROAD RACING GAME
20 REM DONT HIT THE SIDES
30 REM REQUIRES BLBASIC
35 REM USE JOYSTICK TO MOVE
40 clear 2048
50 DIM ROAD(23)
60 X$=CHR$(255):B$=X$+X$+X$+X$:B$=B$+B$+B$+B$+B$+B$
70 S$="             "
 
100 CLS
110 N=23:X=16:Y=12:A=INT(LEN(B$)/2)
 
 
200 REM ROAD RUNNER
210 FOR I = 23 to 0 Step -1
220 GOSUB 7000
230 A=A+V
240 if A< 6 then A=6
245 if A>23 then A=23
250 ROAD(I)=A
260 C=C-1
270 IF C=0 THEN GOSUB 7000
280 NEXT I
 
300 REM MAIN
310 N=N-1
320 IF N = 0 then GOSUB 700
330 if N = Y-1 then goto 600
345 if PEEK(12287+(x+(y*40))) <> 32 then goto 6000
340 L$=LEFT$(B$,ROAD(N))
350 D=LEN(B$)-LEN(L$)
360 R$=LEFT$(B$,D)
385 LOCATE 1,N: PRINT L$;S$;R$
390 GOSUB 800
400 GOSUB 1000
 
490 goto 300 
 
600 REM Skip HERO LINE
605 if D-1 < 1 then D= 1
610 LSR$=L$+S$+R$
630 RS$=LEFT$(LSR$,X-1)+CHR$(159)+MID$(LSR$,X+1,(LEN(LSR$)))
670 LOCATE 1,N: PRINT RS$
680 GOTO 300
 
700 REM ADD TO ROAD
710 FOR J=0 to 21 
720 ROAD(J)=ROAD(J+1)
730 NEXT J 
 
745 C=C-1: IF C = 0 then GOSUB 7000
750 RN=ROAD(22)+V
760 if RN <6 then RN =6
775 if RN >20 then RN =20
780 ROAD(22)= RN
790 N =22
795 return 
 
800 I$=INKEY$ 
810 ifI$="w" then VY = -1:vx=0
830 ifI$="s" then vY = 1:vx=0
840 ifI$="a" then vX =-1:vy=0
850 ifI$="d" then vX = +1:vy=0
860 if I$<>"" then 5050
880 RETURN
 
 
1000 REM JOYSTICK INPUT BLBASIC
1100 OUT 247,7:OUT 246,63
1110 OUT 247,14:I=IN(246)
1200 IF I=255 THEN 300
1300 GOSUB 5000 
1400 GOTO 300
 
5000 REM handle joystick
5010 IF I = 251 THEN vY =-1:vx=0
5020 IF I = 254 THEN vY = 1:vx=0
5030 IF I = 247 THEN vX =-1:vy=0
5040 IF I = 253 THEN vX = +1:vy=0
 
5050 POKE 12288+(X+(Y*40)), 32
5100 REM INCREMENT PSET POSTION
5110 x=x+vx:y=y+vy
5120 IF X > 39 THEN X = 1
5130 IF X < 1 THEN X = 39
5140 IF Y < 1 THEN Y = 25
5150 IF Y > 25 THEN Y = 1
5160 L=(X+(Y*40))
5180 IF PEEK(12288+L) <>32 then 6000
5200 POKE 12288+L, 159
5210 RETURN
 
6000 REM YOU LOST
6030 LOCATE 14,7:PRINT"YOU LOST"
6050 LOCATE 7,8:PRINT"PRESS A KEY TO CONTINUE"
6100 x$=inkey$ 
6140 if X$="" then 6100
6200 goto 100
6900 end
 
 7000 REM RANDOM ROAD
 7100 R=INT(20*RND(1)+1)
 7200 if R <10 then V=-1
7300 if R > 10 then V=1
 7400 C=INT(10*RND(1)+5)
 7500  RETURN
run

NEWROADS.txt

Link to comment
Share on other sites

 

Updated ROAD program, ie, drive your car down the road, don't hit the sides.

Use WASD keys or the joystick (still using the IN/OUT statements) to move.

Program runs out of memory eventually. I'm not sure why.

 

You are calling your joystick input routine at line 1000 from line 400 using a GOSUB 1000.

But the routine at 1000 does not end with a RETURN statement, instead there are two GOTO 300 statements (at 1200 and 1400)

For every GOSUB statement the BASIC envorinment needs to "remember" where to return.

Replace the GOTO 300 statements at 1200 and 1400 with RETURN and you will have solved your memory leak.

 

Regs

Martin

  • Like 1
Link to comment
Share on other sites

Ok fixed up with a bit more curvey action to the road, preventing endless straightaways.

Wow it sure is super slow at 100% cpu speed. I was building it at 500%.

The program came from what I remember of the 50 BASIC Game Programs for Timex Sinclair book..

Now, I remember running that BASIC file on a Sinclair emulator years back and it was heart crushingly slow.

 

But yay! Locate command scrolling and Joysticks. :D

Wish I could have been a fly on the wall while you made this BASIC.

 

 

10 REM ROAD RACING GAME
20 REM DONT HIT THE SIDES
30 REM REQUIRES BLBASIC
35 REM USE JOYSTICK TO MOVE
40 clear 2048
50 DIM ROAD(23)
60 X$=CHR$(255):B$=X$+X$+X$+X$:B$=B$+B$+B$+B$+B$+B$
70 S$="             "
 
100 CLS
110 N=23:X=16:Y=12:A=INT(LEN(B$)/2)
 
 
200 REM ROAD RUNNER
210 FOR I = 23 to 0 Step -1
220 GOSUB 7000
230 A=A+V
240 if A< 6 then A=6
245 if A>23 then A=23
250 ROAD(I)=A
260 C=C-1
270 IF C=0 THEN GOSUB 7000
280 NEXT I
 
300 REM MAIN
310 N=N-1
320 IF N = 0 then GOSUB 700
330 if N = Y-1 then goto 600
345 if PEEK(12287+(x+(y*40))) <> 32 then goto 6000
340 L$=LEFT$(B$,ROAD(N))
350 D=LEN(B$)-LEN(L$)
360 R$=LEFT$(B$,D)
385 LOCATE 1,N: PRINT L$;S$;R$
390 GOSUB 800
400 GOSUB 1000
 
490 goto 300 
 
600 REM Skip HERO LINE
605 if D-1 < 1 then D= 1
610 LSR$=L$+S$+R$
630 RS$=LEFT$(LSR$,X-1)+CHR$(159)+MID$(LSR$,X+1,(LEN(LSR$)))
670 LOCATE 1,N: PRINT RS$
680 GOTO 300
 
700 REM ADD TO ROAD
710 FOR J=0 to 21 
720 ROAD(J)=ROAD(J+1)
730 NEXT J 
 
745 C=C-1: IF C = 0 then GOSUB 7000
750 RN=ROAD(22)+V
760 if RN <6 then V=1
775 if RN >20 then V=-1
780 ROAD(22)= RN
790 N =22
795 return 
 
800 I$=INKEY$ 
810 ifI$="w" then VY = -1:vx=0
830 ifI$="s" then vY = 1:vx=0
840 ifI$="a" then vX =-1:vy=0
850 ifI$="d" then vX = +1:vy=0
860 if I$<>"" then 5050
880 RETURN
 
 
1000 REM JOYSTICK INPUT BLBASIC
1100 OUT 247,7:OUT 246,63
1110 OUT 247,14:I=IN(246)
1200 IF I=255 THEN RETURN
1300 GOSUB 5000 
1400  RETURN
 
5000 REM handle joystick
5010 IF I = 251 THEN vY =-1:vx=0
5020 IF I = 254 THEN vY = 1:vx=0
5030 IF I = 247 THEN vX =-1:vy=0
5040 IF I = 253 THEN vX = +1:vy=0
 
5050 POKE 12288+(X+(Y*40)), 32
5100 REM INCREMENT PSET POSTION
5110 x=x+vx:y=y+vy
5120 IF X > 39 THEN X = 1
5130 IF X < 1 THEN X = 39
5140 IF Y < 1 THEN Y = 25
5150 IF Y > 25 THEN Y = 1
5160 L=(X+(Y*40))
5180 IF PEEK(12288+L) <>32 then 6000
5200 POKE 12288+L, 159
5210 RETURN
 
6000 REM YOU LOST
6030 LOCATE 14,7:PRINT"YOU LOST"
6050 LOCATE 7,8:PRINT"PRESS A KEY TO CONTINUE"
6100 x$=inkey$ 
6140 if X$="" then 6100
6200 goto 100
6900 end
 
 7000 REM RANDOM ROAD
 7100 R=INT(20*RND(1)+1)
 7200 if R <10 then V=-1
7300 if R > 10 then V=1
 7400 C=INT(10*RND(1)+5)
 7500  RETURN
run

 

 

NEWROADS.txt

Edited by Pset
  • Like 1
Link to comment
Share on other sites

BootLoader Basic is the new version to create bootable BASIC programs on the Aquarius. Together with the Virtual Aquarius, BL Basic provides a complete environment to create, test and dump your BASIC programs. No more hussle with external scripts to create your ROM.

 

BL Basic adds the following commands and functions:

 

- CLS - Clear screen

Syntax: CLS

 

- LOCATE - Position on screen

Syntax: LOCATE col, row

 

- OUT - I/O Output data to port

Syntax: OUT port, data

 

- PSG - Program PSG directly register, value

Syntax: PSG register, value [, ...]

 

- IN() - I/O Input data from port

Syntax: n = IN( port )

 

- JOY() - Read joystick

Syntax: j = JOY( n )

n - 0 will read left or right

- 1 will read left joystick only

- 2 will read right joystick only

 

 

- LDUMP

This command will export the BASIC program to ROM file using the printer interface of the Virtual Aquarius

 

 

All these commands (except LDUMP) can be used in your own ROM file as well.

 

To create your own BASIC ROM:

 

Load the BLBASIC.ROM in the Virtual Aquarius.

Next load your BASIC program by typing, quick type or load cassette.

Type the command LDUMP

 

IMPORTANT: Before pressing RETURN check the Virtual Aquarius printer settings!

Go to Configure -> Printer and configure the "Filename for Printer Output"

Make sure you send the output to a new file (!)

 

After checking the printer settings press RETURN at the LDUMP command

 

That's it!

 

Rename the output file extension from .txt to .rom or .bin and load the file into the Virtual Aquarius.

 

The zip file includes the following:

 

README.TXT - this text

BLBASIC.ROM - ROM to load into the Virtual Aquarius

SOURCE.ZIP - Z80 assembly code to create BLBASIC

 

attachicon.gifBLBasic.zip

 

Regs,

Martin

Hi Martin, I think you nailed all the most important commands of the 1541 rom in BL Basic, but why didn't you also incorporate the Scr command?
Link to comment
Share on other sites

Hi Martin, I think you nailed all the most important commands of the 1541 rom in BL Basic, but why didn't you also incorporate the Scr command?

 

You gotta draw the line somewhere :-D

I can do an update and include the SCR command in version 1.1

Are there any other futures or nice to haves to include?

Perhaps a command AQUARIUS that will show a big Aquarius logo on screen?

or scrolling the screen vertical or horizontal, like VSCROLL and HSCROLL?

or............. ?

 

Regs,

Martin

  • Like 1
Link to comment
Share on other sites

 

You gotta draw the line somewhere :-D

I can do an update and include the SCR command in version 1.1

Are there any other futures or nice to haves to include?

Perhaps a command AQUARIUS that will show a big Aquarius logo on screen?

or scrolling the screen vertical or horizontal, like VSCROLL and HSCROLL?

or............. ?

 

Regs,

Martin

I understand, and of course we have to keep in mind the limited memory! However when you offer we could see some more commands in version 1.1 ;-) Something like Vscroll / Hscroll, the GET and PUT commands from Extended Basis and maybe a command like blanking the screen, to give the Aquarius a temporary speed boost would be very much appreciated. The screen blanking would be usefull for drawing a playfield quicker and not showing it building up slowly! These commands of course take up some memory space, but I think they are worth it, because in the end they would mean a shorter program to get things done. But after saying all of this I am still a very happy person at the moment whith the current BL basic you gave us :thumbsup:

  • Like 1
Link to comment
Share on other sites

Trying to replace your BASIC loader with a binary using LDUMP returns and OD error at line 1010 when the binary is run from restart.

However typing run after the error runs the program as usual.

However typing new with the rom in the cartridge port returns OM memory at line 1000

Interesting.

Wooo typing 1000 and return scrambles the screen and reboots.

Such fun!

Typing 1010 and return flips the margin 30 characters and locks the emulator.

All kinds of discoveries with this new BASIC.

 

I think the Rom export needs to copy your BLbasic.rom and append the basic program as strings,

then feed the strings to BASIC as line feeds to put into memory on a specific init command

leaving RAM and the code to be manipulated by the user as usual.

What if you write batch files and scripts out of BitLoader Basic instead a straight cartridge dump.

Hmmm.

 

Anyway this is the code that I was breaking binary loader with

Your amazing Aquarius Man Holiday Assembler ;-D

 

 

10 DATA 6,32,33,0,48,205,89,30,6,112,205,89,30,33,56,122,17,197,51,1
20 DATA 8,0,237,176,33,64,122,17,218,51,1,9,0,237,176,42,216,56,17,7
30 DATA 0,25,34,76,122,205,177,121,205,205,121,205,80,121,24,245,1,96
40 DATA 47,205,75,29,1,255,239,237,120,203,103,32,9,62,255,205,123,121
50 DATA 254,255,32,18,1,255,247,237,120,203,111,32,223,62,1,205,123,121
60 DATA 254,128,40,214,201,33,74,122,119,254,1,33,75,122,126,40,8,203
70 DATA 127,32,10,62,0,24,6,203,127,40,2,62,0,33,74,122,134,254,3,32
80 DATA 2,62,1,254,253,32,2,62,255,33,75,122,119,33,74,122,58,73,122
90 DATA 134,201,50,73,122,205,45,122,235,33,40,48,205,24,122,205,45,122
100 DATA 17,90,14,25,235,33,40,52,205,24,122,201,58,75,122,254,254,40
110 DATA 36,254,255,40,26,254,0,40,16,254,1,40,6,62,21,205,254,121,201
120 DATA 62,23,205,254,121,201,62,19,205,254,121,201,62,130,205,254,121
130 DATA 201,62,140,205,254,121,201,50,52,51,245,58,52,55,230,15,50,52
140 DATA 55,241,60,50,92,51,58,92,55,230,15,50,92,55,201,14,22,6,40,26
150 DATA 119,35,19,16,250,13,229,33,127,0,25,235,225,32,238,201,42,76
160 DATA 122,58,73,122,22,0,95,25,201,99,32,45,32,76,101,102,116,114
170 DATA 105,103,104,116,32,45,32,98,0,255,0,0,0
999 DATA -1
 
 
1000 N=31000:POKE14341,N/256:POKE14340,N-256*PEEK(14341)
1005 ?CHR$(11);"Writing machinecode to memory."
1007 ?"Please wait...."
1010 READX:IFX=-1GOTO1025
1020 POKEN,X:N=N+1:GOTO1010
1025 ?CHR$(11);"Press RETURN key and"
1027 ?"Play Cassette File QUEST_A.CAQ":?
1030 DIMA(1836):CLOAD*A
1040 X=USR(0)

 

 

panscr.zip

Edited by Pset
Link to comment
Share on other sites

Trying to replace your BASIC loader with a binary using LDUMP returns and OD error at line 1010 when the binary is run from restart.

However typing run after the error runs the program as usual.

 

Thanks for reporting these errors! :thumbsup:

You have discovered two bugs;

 

Apparently I did not set the start address for the DATA/READ command in the Boot Loader modus (after LDUMP). That is why it generates an OD Error.

The address at $38DC (14556) will now be set correctly so the DATA and READ commands are now functional too.

 

A program that is run in Boot Loader modus (after LDUMP) should never go into intermediate mode. If a program fails, or ends, or even is breaked by pressing CTRL+C, it should always restart the program.

You should never see the "Ok" prompt after the program has been LDUMP'ed.

This is to "protect" the code, but also because you cannot modify the program after LDUMP. It gives unexpected results.

In the standard Aquarius ROM the BASIC program is in memory before the memory variables. Rewriting a line of the BASIC program also requires some management of the memory variables.

But in Boot Loader modus (after LDUMP) the memory variables are before the BASIC program. After all, the program is in ROM memory while the memory variables are in lower RAM.

The Aquarius ROM wanted to do its memory management after removing the Basic line 1000 but failed to do so, which resulted in the scrambled screen.

This is a "known" issue that has been bypassed by not allowing the OK prompt.

Unfortunattely, the process that should trigger the OK prompt pointed to the wrong subprocess that is why you were able to get the OK prompt.

But this now been solved too.

 

 

Please find version 1.1 of BLBASIC attached which resolve the known bugs.

 

BLBasic.zip

 

Regs,

Martin

  • Like 1
Link to comment
Share on other sites

I understand, and of course we have to keep in mind the limited memory! However when you offer we could see some more commands in version 1.1 ;-) Something like Vscroll / Hscroll, the GET and PUT commands from Extended Basis and maybe a command like blanking the screen, to give the Aquarius a temporary speed boost would be very much appreciated. The screen blanking would be usefull for drawing a playfield quicker and not showing it building up slowly!

 

Please note: The version 1.1 which has just been released is only a bugfix. It does not contains any enhancements - yet.

 

I was already thinking about some kind of MEMCOPY command; this would allow you to POKE and prepare a part in memory and when you are finished copy the memory to the screen so everything is shown in once.

But perhaps we can extend the GET and PUT commands; like, first GET a part of the screen ( or the whole screen if you like ) - the contents is moved into an array - you modify the array as if it was the screen - and PUT the array back on screen.

 

In Extended Basic the GET syntax is: GET (x1, y1)-(x2,y2), array

The PUT syntax: PUT (x1,y2), array [, action ]

 

We could do something like MOD array, (x,y), character, color

(MOD as in Modify but truncated to 3 three letters, just as GET and PUT)

 

Add a function which returns the address of the array in memory so you can POKE directly into the content?

e.g. N=ADDR( array )

 

Ideas, suggestions?

 

 

Regs,

Martin

Link to comment
Share on other sites

Please note: The version 1.1 which has just been released is only a bugfix. It does not contains any enhancements - yet.

 

I was already thinking about some kind of MEMCOPY command; this would allow you to POKE and prepare a part in memory and when you are finished copy the memory to the screen so everything is shown in once.

But perhaps we can extend the GET and PUT commands; like, first GET a part of the screen ( or the whole screen if you like ) - the contents is moved into an array - you modify the array as if it was the screen - and PUT the array back on screen.

 

In Extended Basic the GET syntax is: GET (x1, y1)-(x2,y2), array

The PUT syntax: PUT (x1,y2), array [, action ]

 

We could do something like MOD array, (x,y), character, color

(MOD as in Modify but truncated to 3 three letters, just as GET and PUT)

 

Add a function which returns the address of the array in memory so you can POKE directly into the content?

e.g. N=ADDR( array )

 

Ideas, suggestions?

 

 

Regs,

Martin

These all sound equally interesting and I leave it up to you, what would be the quickest and easiest way to get some kind of screen flipping done (preferably possible to create a full screen presentation)? Also the commands should make some kind of speedier "sprite" movements possible, keeping in mind the upcoming Font upgrade by Jay! Edited by Aquaman
Link to comment
Share on other sites

How do we make this a bootable a ROM for the emulator?

can we loose the load screen and go straight to BASIC?

 

I can't even get Virtual Aquarius to open the file browser for boot or character roms,

It dies if ROM/RADOFIN.BIN or the built in S2 is not the boot rom.

 

Even if it has files in the cartridge slot it doesn't boot with them, at application start, its

always a trip to the file menu, scroll down to blbasic.rom, open it , restart, press return...

 

Probably want to set up some kind of batch file with build options for Tniasm for future changes?

waystobreakBasic.bat?

 

In theory wouldn't it be possible to patch the Virtual Aquarius.exe's default
rom and re-release the VirtualAquarius2014 edition here in a few months with the patcher inside the download?
Isn't that how hackers hack software? Where are those meddling kids?

 

I've been breaking my brain every day since November trying to get different z80 emulators and projects to do something Aquarius.

 

Here's a thought.

We don't want to be forever stuck in a loop of developing for the the Aquarius

and the work lying dead there, what if your BASIC can take in the standard

Simple Aquarius basic, and output C or Lua or Browser Basic

 

They used to have programs for that sort of thing all over.

 

By the way on RetroBattleStations it's Z80 week, go show off your gear.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...