A GAME IN BASIC V

bbc micro/electron/atom/risc os coding queries and routines
User avatar
jgharston
Posts: 4121
Joined: Thu Sep 24, 2009 12:22 pm
Location: Whitby/Sheffield
Contact:

Re: BASIC V SPRITES

Post by jgharston » Sat Aug 29, 2020 6:55 pm

jms2 wrote:
Mon Aug 24, 2020 8:33 am
Eg OSBYTE 0 displays the OS version number.
Nope. It generates an error containing the OS version, or returns the OS version. It is only displayed if the user program *CHOOSES* to display it.
To call them on a BBC from BASIC: You have to jump to the address of the routine directly, eg A%=0:CALL &FFF4 jumps to OSBYTE 0.
To call them on RISC OS: There is a special command called SYS, so: SYS"OS_Byte",0 is the equivalent.
Or, as you've stated you're calling them from BASIC, use the BASIC API, ie just...... CALL &FFxx.

The WHOLE POINT of Acorn's philosphy of API independance is to avoid programs that do:
IF platformX THEN blah ELSE IF platformY THEN blah ELSE IF platformZ THEN blah

when all the 'blah's can be done with the same identical bit of code
IF (universe) THEN blah
which reduces to:
blah

There is absolutely no need to do
IF riscos THEN SYS "OS_Byte",thing ELSE A%=thing:CALL &FFF4
when the whole point of Acorn's API philosphy is that you do
A%=thing:CALL &FFF4

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.32
(C) Copyright J.G.Harston 1989,2005-2020
>_

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

Re: A GAME IN BASIC V

Post by drfloyd » Sun Aug 30, 2020 11:02 am

Another question :

If a use a compiler for my basic V program, does it improve in a significative way the speed of my program ?

markdryan
Posts: 158
Joined: Sun Aug 20, 2017 11:37 pm
Contact:

Re: A GAME IN BASIC V

Post by markdryan » Sun Aug 30, 2020 12:38 pm

drfloyd wrote:
Sun Aug 30, 2020 11:02 am
Another question :

If a use a compiler for my basic V program, does it improve in a significative way the speed of my program ?
Using ABC? Compiling with ABC will provide better integer and string performance but worse floating point performance, assuming you don't have an FPA. You might expect to see between 2x and 5x speed up on integer computations when using ABC. I posted some benchmarks earlier this month viewtopic.php?f=55&t=20175#p282649 comparing BBC BASIC to ABC. These benchmarks are on a RiscPC with a StrongARM CPU.

I doubt ABC will improve sprite performance much though. You'll still be using the same code OS code to render the sprites. Also, ABC is not 100% compatible with BBC BASIC so you may need to modify your program. Your program will also be dependent on the ABC Shared Library.

I remember, when playing around with sprites in BASIC on my A3000 in 1991, that I got better performance when using the SWI integer code rather than the name, e.g., use SYS &2e, rather than SYS "OS_SpriteOp". I seem to remember that I used some type-in from the Acorn User that automatically replaced SWI names with integer codes in a BASIC program. I guess if you use the SWI name, BASIC needs to insert an additional SWI call to convert the name into an integer. You probably don't want this overhead in your redraw code.

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

Re: A GAME IN BASIC V

Post by drfloyd » Sun Aug 30, 2020 1:03 pm

so not so easy to compile....

markdryan
Posts: 158
Joined: Sun Aug 20, 2017 11:37 pm
Contact:

Re: A GAME IN BASIC V

Post by markdryan » Sun Aug 30, 2020 1:04 pm

Also, it might be worth reading through the Archimedes Gamemakers Manual if you haven't already done so.

http://www.riscos.com/support/developers/agrm/index.htm

I haven't actually got around to reading this yet myself, but it is on my to-read list.

markdryan
Posts: 158
Joined: Sun Aug 20, 2017 11:37 pm
Contact:

Re: A GAME IN BASIC V

Post by markdryan » Sun Aug 30, 2020 1:07 pm

drfloyd wrote:
Sun Aug 30, 2020 1:03 pm
so not so easy to compile....
It's easy to compile as long as your program uses the subset of BBC BASIC that ABC supports, e.g., doesn't use SWAP or matrix multiplication. If you have a copy of ABC, it's just a matter of launching it and dragging your BASIC program onto the Icon, entering a file name for your binary and dragging that to your disk.

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

Re: A GAME IN BASIC V

Post by drfloyd » Sun Aug 30, 2020 4:15 pm

I succesfull in compiling my program !

I win about 25% speed (for this test)

great

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

Re: A GAME IN BASIC V

Post by drfloyd » Sun Aug 30, 2020 4:32 pm

jms2 wrote:
Sat Aug 29, 2020 2:18 pm
Aha, I thought maybe you might run into that problem.

The ADF file is an image of a complete floppy disc. It would be useful with a Gotek drive, but I didn't realise that you don't have one.

What you will need is the zip file of the application, and then unzip it using !Sparkplug on the A3010. The zip file is on this website: http://www.riscos.com/ftp_space/310/index.htm - look down the page a bit to find a file called "Support". It's also here:
supp.zip

If you put this on your DOM, then load !Sparkplug and drag the file onto it, it will show the contents of the zipfile. Then you can drag and drop the application !ChangeFSI onto your hard disc.

If you don't have !Sparkplug, the same page also has a self-extracting version of SparkFS (which is essentially the same thing), with instructions for extracting it.


I launch SPARKPLUG (ok, It come the bottom)
I drag and drop the folder !CHANGEFSI to !SPARKPLUG

But nothing at all happen

I have problem with lot of folder APP !.... Don't know how to use them... when i click on them, i have this message : "no run action specified for this file type"

(still need to learn !)

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

Re: A GAME IN BASIC V

Post by jms2 » Sun Aug 30, 2020 5:50 pm

That doesn't sound quite right. You need to use !Sparkplug to unzip the file "Supp.zip", not the folder !ChangeFSI. It sounds like you have already done the unzipping of Supp.zip on a PC.

Step 1 - drag supp.zip onto !Sparkplug
Capture.PNG
Capture.PNG (41.12 KiB) Viewed 276 times
Step 2 - !Sparkplug shows what is inside. At this point the icons don't look right, this is normal.
Capture1.PNG
Step 3 - Drag !ChangeFSI onto your hard disc. In this picture I have used a Ram Disc, just because there is no hard disc in my emulator.
Capture2.PNG
Capture2.PNG (5.95 KiB) Viewed 276 times

Acorn file systems contain metadata - on the BBC this includes the load and execution addresses, and on Risc OS there is also the file type. So instead of having the file type as an extension (such as .txt) the file type is stored within some attributes associated with the file. Windows unzippers don't know about this data, so whilst they unzip the files correctly they don't set any of the attributes. If you use !Sparkplug to unzip, it will set these correctly.

It sounds like you have been doing the same thing to create your other applications, which explains why they don't work! The !Run file should be the type called "Obey", but if it is not then you will get the error message "No run action for this file type".

You can check (and set) filetypes manually by middle clicking on the file to bring up a menu. From memory, I think the second item on the list refers to the file, so if you click on the file !Run you will see "File '!Run'". Follow the arrow to the submenu and the last item will be "Filetype". You can set the filetypes by entering a 3-digit hex number, or a name. Again from memory, here are some common ones:

&FFB or BASIC = BASIC files.
&FF9 or Sprite = Sprite files. Files with the name !Sprites or !Sprites22 should be set to this type.
Obey = Scripts of OS commands, like a batch file. The files !Run and !Boot should be set to Obey
Text = Text files. Files called !ReadMe will usually be Text files.
Absolute = Machine code files. However setting this type probably won't help very much because I would think you would need to know the load and exec addresses as well.

Apart from the common files listed above, it is not really possible to guess what type a file will be, so it is much better to get !Sparkplug to extract the files and set their type automatically. You might find it interesting to look at a few files and check what type they are. The ones you have unpacked using Windows probably won't have any type information set.

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

Re: A GAME IN BASIC V

Post by drfloyd » Sun Aug 30, 2020 10:32 pm

ahhh!! Ok, i was unzipping first on my PC :mrgreen: THANK YOU !

so stupid i am :mrgreen:

The problem is that into SUPP.ZIP there is the same file disk image that before BLANK.ADF :mrgreen:

(but now i can unzip some games, just tried WOLFENTEIN 3D !!! My god ! Like on 386DX !!!)

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

Re: BASIC V SPRITES

Post by jms2 » Sun Aug 30, 2020 11:10 pm

Great! You are getting somewhere! I don't understand what you are saying about supp.zip though. Is there still a problem?

It would be useful to understand what is on your hard disc. Is there a !Boot, and is it a file or an application? You can check this by holding Shift and double clicking on it.

The reason I asked is because ChangeFSI needs to have "seen" the application !Scrap. This is a standard application which provides some kind of temporary file space. It is probably on your hard disc somewhere.

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

Re: A GAME IN BASIC V

Post by drfloyd » Mon Aug 31, 2020 12:01 pm

I will try again and tell you

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

Re: A GAME IN BASIC V

Post by drfloyd » Mon Aug 31, 2020 3:06 pm

My first newbies test coding on Archimedes :

Image

Very simple I know... but it works and move ;)

Thank you all for your help

Hope it will be a real Role SCI-FI game one day

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

Re: BASIC V SPRITES

Post by drfloyd » Mon Aug 31, 2020 5:41 pm

jms2 wrote:
Sun Aug 30, 2020 11:10 pm
Great! You are getting somewhere! I don't understand what you are saying about supp.zip though. Is there still a problem?

It would be useful to understand what is on your hard disc. Is there a !Boot, and is it a file or an application? You can check this by holding Shift and double clicking on it.

The reason I asked is because ChangeFSI needs to have "seen" the application !Scrap. This is a standard application which provides some kind of temporary file space. It is probably on your hard disc somewhere.
it's good ! Can convert .BMP !!!!! Fabulous !

Post Reply

Return to “programming”