About BBC Basic 4

bbc micro/electron/atom/risc os coding queries and routines
Naomasa298
Posts: 355
Joined: Sat Feb 16, 2013 12:49 pm
Contact:

Re: About BBC Basic 4

Post by Naomasa298 » Tue Jun 30, 2020 8:17 pm

I use Notepad.

drfloyd
Posts: 287
Joined: Tue Jun 09, 2020 3:36 pm
Contact:

Re: About BBC Basic 4

Post by drfloyd » Tue Jun 30, 2020 9:43 pm

I enter :

EDIT

and go into ACORN SCREEN EDITOR 1989 !

Where I can update the lines, but cannot found the way to go out :mrgreen:

User avatar
jms2
Posts: 2565
Joined: Mon Jan 08, 2007 6:38 am
Location: Derby, UK
Contact:

Re: About BBC Basic 4

Post by jms2 » Tue Jun 30, 2020 10:37 pm

drfloyd wrote:
Tue Jun 30, 2020 7:10 pm
How to edit a line ?
This is quite easy when you know how. First list the part of the program you want to edit, eg:

LIST 200,300 - will list lines 200 to 300.

Then use the cursor keys. This splits the cursor into two parts, one cursor which copies whatever is under it, and the other which is just the normal one. If you press the COPY key, it copies whatever is under the copying cursor, and you can use this to edit.
I tried EDIT 10, not correct :mrgreen:
On the Master, there is a built in BASIC editor, which you can start by typing EDIT. I think it is quite good. But I have never used it and I don't know how it works. I just tried it out in an emulator and I couldn't figure out how to leave it..! You would need to read the Master welcome guide.

Writing on a PC and using the Gotek would probably be easier.

drfloyd
Posts: 287
Joined: Tue Jun 09, 2020 3:36 pm
Contact:

Re: About BBC Basic 4

Post by drfloyd » Tue Jun 30, 2020 11:29 pm

thank you

yes the Basic Editor seems very powerfull but... no way to leave it ! LOL

Naomasa298
Posts: 355
Joined: Sat Feb 16, 2013 12:49 pm
Contact:

Re: About BBC Basic 4

Post by Naomasa298 » Tue Jun 30, 2020 11:54 pm

I found out how.

SHIFT+F4
Type BASIC <RETURN>

User avatar
BigEd
Posts: 3107
Joined: Sun Jan 24, 2010 10:24 am
Location: West
Contact:

Re: About BBC Basic 4

Post by BigEd » Wed Jul 01, 2020 8:31 am

There will be a printed strip to slip under the perspex above the function keys to let you know what the various function keys do... in fact, here's a set to print off and keep:
http://www.8bs.com/othrdnld/manuals/functionkeys.shtml

Naomasa298
Posts: 355
Joined: Sat Feb 16, 2013 12:49 pm
Contact:

Re: About BBC Basic 4

Post by Naomasa298 » Wed Jul 01, 2020 9:32 am

BigEd wrote:
Wed Jul 01, 2020 8:31 am
There will be a printed strip to slip under the perspex above the function keys to let you know what the various function keys do... in fact, here's a set to print off and keep:
http://www.8bs.com/othrdnld/manuals/functionkeys.shtml
Edit lists the function key commands in the program itself - but SHIFT+F4 is labelled "Mode", which isn't terribly intuitive.

User avatar
BigEd
Posts: 3107
Joined: Sun Jan 24, 2010 10:24 am
Location: West
Contact:

Re: About BBC Basic 4

Post by BigEd » Wed Jul 01, 2020 9:38 am

Oh, so it does! (At least, at startup, in JSBeeb, in a Master Turbo. But not in a Master 128... (I see Shift-F4 is labelled 'Return Languag' which makes sense if you know the terminology.))

jregel
Posts: 203
Joined: Fri Dec 20, 2013 6:39 pm
Location: Gloucestershire
Contact:

Re: About BBC Basic 4

Post by jregel » Wed Jul 01, 2020 9:46 am

I'd recommend the BASIC Editor ROM that Tom Seddon has updated and extended: https://github.com/tom-seddon/basic_editor

The manual for the original release is here: https://github.com/tom-seddon/basic_edi ... Manual.pdf

Tom has changed/improved some of the keyboard commands, so check his notes on top of the manual.

Stardot thread here: viewtopic.php?f=2&t=9377
BBC Master Turbo, Retroclinic External Datacentre, VideoNuLA, PiTubeDirect with Pi Zero, Gotek USB Floppy Emulator

User avatar
daveejhitchins
Posts: 5661
Joined: Wed Jun 13, 2012 6:23 pm
Location: Newton Aycliffe, County Durham
Contact:

Re: About BBC Basic 4

Post by daveejhitchins » Wed Jul 01, 2020 11:33 am

Of course, I recommend the ABE (Advanced BASIC Editor :roll: ) As it has the very useful UTILITIES added to it.

Dave H :D
Parts: UM6502CE, GAL22V10D, GAL16V8D, AS6C62256A, TC514400AZ, WD1772, R6522, TMS27C512, AT28C256
Products: ARA II, ARA III, ABR, ATI, AP6, MGC, AP5 . . .
For a price list, contact me at: Retro Hardware AT dave ej hitchins DOT plus DOT com

drfloyd
Posts: 287
Joined: Tue Jun 09, 2020 3:36 pm
Contact:

Re: About BBC Basic 4

Post by drfloyd » Sun Jul 05, 2020 10:57 am

New question :

Is it possible to hide the code of Basic 4 basic program ?

My game is an adventure game and I don't want to give clue/solution into the code (as it will be a big challenge to finish it)

jregel
Posts: 203
Joined: Fri Dec 20, 2013 6:39 pm
Location: Gloucestershire
Contact:

Re: About BBC Basic 4

Post by jregel » Sun Jul 05, 2020 11:18 am

drfloyd wrote:
Sun Jul 05, 2020 10:57 am
New question :

Is it possible to hide the code of Basic 4 basic program ?

My game is an adventure game and I don't want to give clue/solution into the code (as it will be a big challenge to finish it)
I'd suggest that the abilities of some in this forum are such that any attempts to hide your code will be futile if they truly wanted to get a clue or solution... :-)
BBC Master Turbo, Retroclinic External Datacentre, VideoNuLA, PiTubeDirect with Pi Zero, Gotek USB Floppy Emulator

drfloyd
Posts: 287
Joined: Tue Jun 09, 2020 3:36 pm
Contact:

Re: About BBC Basic 4

Post by drfloyd » Sun Jul 05, 2020 9:17 pm

yes of course :mrgreen:

User avatar
BigEd
Posts: 3107
Joined: Sun Jan 24, 2010 10:24 am
Location: West
Contact:

Re: About BBC Basic 4

Post by BigEd » Sun Jul 05, 2020 9:32 pm

(But there is a clue if you search the forum for "unlistable")

drfloyd
Posts: 287
Joined: Tue Jun 09, 2020 3:36 pm
Contact:

Re: About BBC Basic 4

Post by drfloyd » Sun Jul 05, 2020 9:35 pm

i will look, not urgent, thanks

i really need to hide a part of the story :mrgreen:

Naomasa298
Posts: 355
Joined: Sat Feb 16, 2013 12:49 pm
Contact:

Re: About BBC Basic 4

Post by Naomasa298 » Sun Jul 05, 2020 9:37 pm

drfloyd wrote:
Sun Jul 05, 2020 9:35 pm
i will look, not urgent, thanks

i really need to hide a part of the story :mrgreen:
I don't think you do. If someone is playing your game for fun, they won't resort to looking at the listing. If they want to cheat, they're taking away from their own enjoyment. Let them. The only person they're ruining the game for is themselves.

drfloyd
Posts: 287
Joined: Tue Jun 09, 2020 3:36 pm
Contact:

Re: About BBC Basic 4

Post by drfloyd » Mon Jul 06, 2020 10:48 am

in fact there is a big final challenge and i whould like to see if someone can really finish it :mrgreen:

(on Amstrad CPC I can transform a .BAS into .BIN using a compiler)

Coeus
Posts: 1575
Joined: Mon Jul 25, 2016 12:05 pm
Contact:

Re: About BBC Basic 4

Post by Coeus » Mon Jul 06, 2020 5:11 pm

drfloyd wrote:
Mon Jul 06, 2020 10:48 am
in fact there is a big final challenge and i whould like to see if someone can really finish it :mrgreen:
I'd still say that making it impossible to cheat is itself impossible. Some of the people on here used to crack copy protection systems back in the day where the authors had gone to some trouble to obfuscate how they work. People have disassembled and analysed the OS and filing systems. We have a reverse engineered model of the Tube ULA obtained by scanning and applying pattern recognition to the meta layer masks etc.

User avatar
danielj
Posts: 8169
Joined: Thu Oct 02, 2008 5:51 pm
Location: Manchester
Contact:

Re: About BBC Basic 4

Post by danielj » Mon Jul 06, 2020 9:25 pm

I think you'll find people here would prefer to have the challenge of completing the game rather than worry about reading the code :)

User avatar
richardtoohey
Posts: 3900
Joined: Thu Dec 29, 2011 5:13 am
Location: Tauranga, New Zealand
Contact:

Re: About BBC Basic 4

Post by richardtoohey » Mon Jul 06, 2020 10:52 pm

There are BASIC compliers but I think :-k they are for different dialects.

And as Coeus says - whatever you do will be crackable.

The simplest solution from BITD for a BASIC listing was something like this:

10 REM ****

?&1906=21

That 1906 is a guess - it assumes PAGE is &1900 and a rough offset from the start of the program listing. It pokes VDU code 21 on top of one of the * characters in the REM statement.

VDU 21 turns off the VDU display. So LIST will "jam" at line 10.

Easily defeated by LIST 20,

But you could do something like that around a key section of your code to obscure it a little bit.

Don't forget backups and backups of backups before you try anything smart!

drfloyd
Posts: 287
Joined: Tue Jun 09, 2020 3:36 pm
Contact:

Re: About BBC Basic 4

Post by drfloyd » Wed Jul 08, 2020 8:43 am

thanks for your informations

other thing :

i have tried to draw circles with PLOT, without succes (lost in translation on the doc), is it possible ?

User avatar
dv8
Posts: 309
Joined: Mon Jun 22, 2009 10:07 pm
Contact:

Re: About BBC Basic 4

Post by dv8 » Wed Jul 08, 2020 8:55 am

drfloyd wrote:
Wed Jul 08, 2020 8:43 am
i have tried to draw circles with PLOT, without succes (lost in translation on the doc), is it possible ?
To draw a circle outline:

MOVE x,y : PLOT 145,r,0

To draw a filled circle:

MOVE x,y : PLOT 153,r,0

where x,y is the centre of the circle and r is the radius.

drfloyd
Posts: 287
Joined: Tue Jun 09, 2020 3:36 pm
Contact:

Re: About BBC Basic 4

Post by drfloyd » Wed Jul 08, 2020 10:14 am

wonderful, thanks

drfloyd
Posts: 287
Joined: Tue Jun 09, 2020 3:36 pm
Contact:

Re: About BBC Basic 4

Post by drfloyd » Thu Jul 09, 2020 3:09 pm

I have a little problem with GET$ and arrows :

REPEAT
A$=GET$
UNTIL A$=CHR$(136) OR A$=CHR$(137) OR A$=CHR$(138) OR A$=CHR$(139)

do not work (on emulator)

the programm do not detect when I press the cursor keys

Again lost in translation with the manual

Thanks

User avatar
dv8
Posts: 309
Joined: Mon Jun 22, 2009 10:07 pm
Contact:

Re: About BBC Basic 4

Post by dv8 » Thu Jul 09, 2020 3:27 pm

drfloyd wrote:
Thu Jul 09, 2020 3:09 pm
the programm do not detect when I press the cursor keys
At the start of your program put:

*FX4,1

to make the arrow keys return codes 136-139.

Also, it would be easier to use GET instead of GET$:

REPEAT : A=GET : UNTIL A>=136 AND A<=139

drfloyd
Posts: 287
Joined: Tue Jun 09, 2020 3:36 pm
Contact:

Re: About BBC Basic 4

Post by drfloyd » Thu Jul 09, 2020 4:18 pm

FX4,1 is magical
thank you very much !

drfloyd
Posts: 287
Joined: Tue Jun 09, 2020 3:36 pm
Contact:

Re: About BBC Basic 4

Post by drfloyd » Fri Jul 10, 2020 4:18 pm

Hello

In Mode 1

Can we simulate 8 colors in pure basic using flashing ?

User avatar
jms2
Posts: 2565
Joined: Mon Jan 08, 2007 6:38 am
Location: Derby, UK
Contact:

Re: About BBC Basic 4

Post by jms2 » Fri Jul 10, 2020 4:52 pm

No.

You only get flashing colours in Mode 2. In mode 1, you can set the four colours to anything you want, but not to a flashing colour.

To get 8 colours requires machine code. I'm not sure it's necessarily that easy to integrate this effect with BASIC, but I could be wrong.

The MOS for the Master does help with dithering though.

User avatar
davidb
Posts: 2768
Joined: Sun Nov 11, 2007 10:11 pm
Contact:

Re: About BBC Basic 4

Post by davidb » Fri Jul 10, 2020 5:24 pm

jms2 wrote:
Fri Jul 10, 2020 4:52 pm
You only get flashing colours in Mode 2. In mode 1, you can set the four colours to anything you want, but not to a flashing colour.

Code: Select all

VDU 19,3,15,0,0,0
:D

But dithering is a nicer solution unless you like headaches. ;)

User avatar
jms2
Posts: 2565
Joined: Mon Jan 08, 2007 6:38 am
Location: Derby, UK
Contact:

Re: About BBC Basic 4

Post by jms2 » Fri Jul 10, 2020 7:12 pm

I genuinely didn’t realise you could do that... Probably because nobody would ever want to use flashing colours, they’re awful!

Post Reply

Return to “programming”