Overview Features Instructions Performance Forum Downloads Products OrderV4 Reseller Contact

Welcome to the Apollo Forum

This forum is for people interested in the APOLLO CPU.
Please read the forum usage manual.



All TopicsNewsPerformanceGamesDemosApolloVampireAROSWorkbenchATARIReleases
Running Games and Apps.

Is There An Interest In Coding In Vampire BASIC ?page  1 2 

Vladimir Repcak

Posts 327
30 Apr 2020 23:46


On Jaguar, long time ago (circa 2013), I created a VRBasic language.

It's basically using a Microsoft-compliant syntax. So, most features/syntax can be looked up straight on MSDN.

The VRBasic code gets translated into C (via my .NET-based backend), which then gets fed into your local C compiler (producing the executable).

Jaguar-specific functionality was written in Assembler, so this portion would have to be rewritten, but this obviously means the direct SAGA support, potential of using AMMX, etc.

I had it set up in Notepad++, where I just hit F5, it runs the build script and deploys it to Jaguar (via Skunkboard).

I could reuse my current WinUAE deployment script for straight testing on the emulator. Later, deployment to HW can of course happen.

Looks like this forum doesn't allow attachments, so I will go copy paste here some of the samples, so you can see the syntax.



Vladimir Repcak

Posts 327
30 Apr 2020 23:47



' VRBasic Sample 06 - Screen Drawing
' Sep-2013, Vladimir Repcak

Module Globals
  Dim lvlData() As Byte
  Dim ImgWall As Sprite
End Module

  ' Draws a specific screen from the loaded map
Sub DrawScreen (ScrCol As Byte, ScrRow As Byte)
  Dim xpos As Integer = 0
  Dim ypos As Integer = 0
  Dim idx As Integer
  ' idxOffset is an offset to get to next row in the map. It should be 8* (ScreensPerMapRow-1), e.g. 8 * (2-1) = 8 in our case
  Dim idxOffset As Integer = 8

  ' This is our global index into the map array
  idx = (ScrRow*(3*8)*2) + (ScrCol*8)
  ' Render 3 Rows
  For row = 0 To 3
    ' Render Row of 8 Sprites per column
  For col = 0 To 8
    ' Check for 'X' (ASCII:88) and draw the sprite
    If (lvlData(idx)=88) Then ShowImage (ImgWall,xpos,ypos)
    Else ShowBlankImage (ImgWall,xpos,ypos)
    End If
    ' Irrespective of the 'X' we move right in the increments of Sprite Width
    xpos = xpos + ImgWall.xl
    idx = idx + 1
  Next
    ' Update the xpos,ypos for the next row of sprites
  xpos = 0
  ypos = ypos + ImgWall.yl
    ' Move the index into map data at next row
  idx = idx + idxOffset
  Next
End Sub

Sub Main ()
  SetGraphicsMode ()

  ' This is our level data in a text format. Each screen is 3 rows by 8 columns, whole level has 2 rows of screens, each row having also 2 screens
  ' Base advantage of this format is that one can edit whole map in a Notepad
  LoadTextData (lvlData, "c:\jaguar\_Projects\_VRBasic\src\Samples\ArtAssets\level00.txt")
  ' This is our Wall Sprite
  LoadImage (ImgWall,"c:\jaguar\_Projects\_VRBasic\src\Samples\ArtAssets\TileA2_16_Colors_Palette.gif",8)
  ' Push the palette colors at index 1 (for example)
  CopyPalette (1,ImgWall)
  ' Update the Image data
  OffsetImage (1,ImgWall)

  ' Render all screens, one after another
  For ScrRow = 0 To 2
  For ScrCol = 0 To 2
    DrawScreen (ScrCol,ScrRow)
  Next
  Next

  Wait (5000)
End Sub





Vladimir Repcak

Posts 327
30 Apr 2020 23:49



' VRBasic Sample 04 - Basic Drawing
' Sep-2013, Vladimir Repcak

  ' Draw all colors in the palette
Sub DrawPaletteAt (xp As Integer, yp As Integer)
  For idxColor As Integer = 0 To 255
  DrawPixel (xp + idxColor, yp, idxColor)
  Next idxColor
  ' Draw some helper points every 32 pixels to assist with picking the color index
  For idxHelper As Integer = 0 To 8
  DrawPixel (xp + idxHelper*32, yp+1, 127)
  Next idxHelper
End Sub

Sub Main ()
  SetGraphicsMode ()
  DrawPaletteAt (32,0)

  ' Draw a grid of colored points.
  Dim color As Integer = 0
  For y As Integer = 10 To 190 Step 10
  For x As Integer = 0 To 320 Step 10
    DrawPixel (x,y, color)
    color = (color + 1) Mod 256
  Next x
  Next y

  ' Draw a butterfly set of colored lines
  color = 0
  For x As Integer = 0 To 320 Step 1
  DrawLine (x,x/3, 319-x,199, color)
  color = (color + 1) Mod 256
  Next x
 
  Wait (5000)
End Sub
 





Vladimir Repcak

Posts 327
30 Apr 2020 23:54


There's few things that would have to be figured out first - most importantly configuring the dev environment for compiling C.

Later, we would need to integrate it with the library written in assembler (for Vampire-specific functionality).

I'm obviously busy with finishing the game, but this looks like an opportunity to create a dev community around the Vampire.

It's definitely much easier to write code in VRBasic than in C, that's for sure!


Mr Niding

Posts 445
01 May 2020 06:56


I would be intrested in it for sure. Altho I would find more use for Hollywood Designer since Im more into productivity related uses of my computers (Libreoffice, Video editing, picture manipulation and pdf).

But I see people like Steve Ferrel pushing for higher level languages, altho he is more a C developer related to 3D modelling.
Im sure he can add more on his own.

A few questions tho Vlad;

What kind of performance are you looking at vs asm/c code?
I know this is extremely guesstimate kinda question, but given your knowledge, Im sure you have thoughts regarding this.

VBasic; gamedesign oriented, or also useful for productivity software?

Again, I assume you are very gameoriented developer, and would like to optimise libraries and compliers to accelerate game (and demo) development?

So I would say we are better off making productivity in Hollywood :)


Vladimir Repcak

Posts 327
01 May 2020 08:06


I'm all for productivity too!

But as a coder :)

Also, productivity SW needs GUI via OS, that's a whole other beast to tackle. I'm sure there must be dozens of GUI libraries out there. Hell, as a kid it was fun for me to write couple for various platforms. Just not now. Been exposed to way too many over 3 decades...




Vladimir Repcak

Posts 327
01 May 2020 08:22


Mr Niding wrote:

  What kind of performance are you looking at vs asm/c code?
  I know this is extremely guesstimate kinda question, but given your knowledge, Im sure you have thoughts regarding this.
Yeah, the performance differential between hand-written ASM and C is brutal. Easily order of magnitude (and worse). Can't say how many times I've seen C compiler create 3-4 pages of code, when it was barely 10 lines by hand. But, the C standard is what it is, so the compiler must play it safe. I get that.

But, we have 85 MHz. And the core drawing stuff happens in ASM anyway.

So, it doesn't matter too much that the high-level game logic takes much longer to process. There's not much of it anyway.

We can still make fun games with it. Just don't try to draw the screen, pixel by pixel, from C via DrawPixel () :)

 
Mr Niding wrote:

  Again, I assume you are very gameoriented developer, and would like to optimise libraries and compliers to accelerate game (and demo) development?
Correct.
Library [written in ASM - well - my Higgs] would have functionality that is most performance critical - like:
- sprite drawing,
- clearscreen
- line/pixel drawing (think OpenGL style - you submit an array of primitives, the backend will crunch through it in full speed)
- scanline traversal and fill (example: Road drawing)
- double-buffering
- etc.




Vladimir Repcak

Posts 327
01 May 2020 08:30


Mr Niding wrote:

... optimise libraries and compliers to accelerate game (and demo) development?

Yes, I would probably prefer more for this to be used for demo development. I mean the demo/intro compos.

There's a lot that an 85 MHz CPU can do, even in C, when you get down to 8-10 fps, and have 6-7 frames to prepare the screen.

Unlike game, there's no AI, no difficulty, no bug hunting. You just work for a day or two on a scene, then progress to next scene, etc.

In a week, you can have a pretty good demo.

Hell, if you show me you are serious, and show some real progress, I could write some special FX in ASM and put them into the library.



Philippe Flype
(Apollo Team Member)
Posts 281
01 May 2020 11:03


I think it would be VERY welcome. I personally use a lot PureBasic on modern platform for easy/quick prototyping, or scripting tools, or even just as easy calculator. A system friendly BASIC, maintained, is for sure more than good to have, and i'm sure i'd use it, and help test it. Ideally if it be quite same syntax style as purebasic it be perfect. Also with easy to add asm libraries + direct asm.


Olaf Schoenweiss

Posts 646
01 May 2020 11:28


looks interesting. I would be interested too
   
    If I understand correctly you develop on windows and then test it in UAE?
   
    we have something similar with the scorpion engine
   
    EXTERNAL LINK   
    the only difference the developer uses blitzbasic for the amiga parts. And it uses Ink for scripting (not Basic)
 
  but in general the more the better ;)

Question: are there external tools useable, f.e. for level design?


Vladimir Repcak

Posts 327
05 May 2020 01:29


Philippe Flype wrote:

I think it would be VERY welcome. I personally use a lot PureBasic on modern platform for easy/quick prototyping, or scripting tools, or even just as easy calculator. A system friendly BASIC, maintained, is for sure more than good to have, and i'm sure i'd use it, and help test it. Ideally if it be quite same syntax style as purebasic it be perfect. Also with easy to add asm libraries + direct asm.

Not familiar with purebasic, so not sure how different that syntax is - but you can see by checking the samples I included in first few posts.

Inlining ASM tends to be problematic with C compilers.

I worked with some that required prefixing each ASM line with something like ASM ("move.l d1,d2").

What are those rules in Amiga land using oldest working gcc ?

Alternatively, it's always possible to create a complex makefile that will first go and compile the separate ASM module and only then invoke C compiler, linking against the pre-compiled module.

But that quickly becomes a dependency mess...



Vladimir Repcak

Posts 327
05 May 2020 01:34


Olaf Schoenweiss wrote:

looks interesting. I would be interested too
   
    If I understand correctly you develop on windows and then test it in UAE?
   
    we have something similar with the scorpion engine
   
    EXTERNAL LINK     
    the only difference the developer uses blitzbasic for the amiga parts. And it uses Ink for scripting (not Basic)
   
    but in general the more the better ;)

Yes, I currently test directly on Windows against UAE. This would be the same.
Never used Ink. What's its biggest advantage ?

Olaf Schoenweiss wrote:

  Question: are there external tools useable, f.e. for level design?

Level design is strongly tied to the game you develop - I don't think there's a point in hardcoding any specific level design tool. But this being PC means there's certainly dozens of editors for every imaginable game type.

You just then import a text or binary file in BASIC (created by the level design SW of your choice).




Steve Ferrell

Posts 393
05 May 2020 02:58


Philippe Flype wrote:

    I think it would be VERY welcome. I personally use a lot PureBasic on modern platform for easy/quick prototyping, or scripting tools, or even just as easy calculator. A system friendly BASIC, maintained, is for sure more than good to have, and i'm sure i'd use it, and help test it. Ideally if it be quite same syntax style as purebasic it be perfect. Also with easy to add asm libraries + direct asm.
   

   
I use PureBasic for the very same reasons on the PC.  The Amiga version is available at no cost and the source code for the Amiga version has been open-sourced.  I suggested some time ago that it would be a good candidate for Vampire coders since the source was available and could be updated to support AMMX but none of the assembly language gurus were interested in taking on the project.  It has a pretty significant following in the PC and MacOS world and with a few minor exceptions the syntax is cross-platform, including the Amiga. 
 
You can get the Amiga version here:
EXTERNAL LINK   
 
And the English forum is here:
EXTERNAL LINK   
 
You can find the French and German forums here:
EXTERNAL LINK 
 
There's also an AmigaOS specific forum here:
EXTERNAL LINK


Amano Jyaku

Posts 6
05 May 2020 22:57


Afaik the archive only contains the sources for the libraries (written in asm) and the very minimalistic IDE (written in Blitz).
The source of the compiler itself was not included.


Steve Ferrell

Posts 393
05 May 2020 23:34


Amano Jyaku wrote:

  Afaik the archive only contains the sources for the libraries (written in asm) and the very minimalistic IDE (written in Blitz).
  The source of the compiler itself was not included.
 

 
The archive that I linked in my earlier post contains the Amiga IDE and the compiler, support files and some coding examples.  No where did I state it contained the sources.  You can also find the Amiga compiler on Aminet at:  EXTERNAL LINK 
If you want the sources, contact Frederic by email: alphasnd at purebasic.com
 
Here's a short excerpt from the Read.me
 
...PureBasic's advanced features such as pointers, structures, procedures, dynamically linked lists and much more. Experienced coders will have no problem gaining access to any of the legal OS structures or API objects and PureBasic even allows inline ASM.......

For all assembler optimizer freaks (like us ? :-): You can compile programs into a 'commented asm output file', containing all code in a comprehensive asm format; all directly recompilable with phxass.


 
I use PureBasic on the PC and Mac for rapid prototyping and in most cases the prototypes end up being the final products because the prototypes are true EXE files, not byte code, and perform just as well if not better than the same app coded completely in C/C++.


Knight Stone

Posts 114
06 May 2020 16:31


Vladimir Repcak wrote:

On Jaguar, long time ago (circa 2013), I created a VRBasic language.
 
  It's basically using a Microsoft-compliant syntax. So, most features/syntax can be looked up straight on MSDN.
 
  The VRBasic code gets translated into C (via my .NET-based backend), which then gets fed into your local C compiler (producing the executable).
 
  Jaguar-specific functionality was written in Assembler, so this portion would have to be rewritten, but this obviously means the direct SAGA support, potential of using AMMX, etc.
 
  I had it set up in Notepad++, where I just hit F5, it runs the build script and deploys it to Jaguar (via Skunkboard).
 
  I could reuse my current WinUAE deployment script for straight testing on the emulator. Later, deployment to HW can of course happen.
 
  Looks like this forum doesn't allow attachments, so I will go copy paste here some of the samples, so you can see the syntax.
 

I think as far as the Vampire goes, this is one of the best ideas ever.

Alot of technical info is posted on here, that i would guess goes right over the head of alot of people, me included. But an easy to access language, that we are all familiar with would really let the amateur show of the power of the beast.


Steve Ferrell

Posts 393
06 May 2020 19:47


Knight Stone wrote:

 
  I think as far as the Vampire goes, this is one of the best ideas ever.
 
  Alot of technical info is posted on here, that i would guess goes right over the head of alot of people, me included. But an easy to access language, that we are all familiar with would really let the amateur show of the power of the beast.

I've never been a fan of re-creating the wheel so to speak.  PureBasic already exists for PC, MacOS, Linux AND the Amiga. It uses the same syntax across those platforms. It outputs real EXE's or commented assembly language that can be assembled by PHXASS without the need for an additional C/C++ compiler. There's already a large code base and a large user base and the Amiga version of PureBasic is available now for free. I'll ask Frederic if he thinks adding AMMX support would be trivial or not. 



Steve Ferrell

Posts 393
07 May 2020 09:48


Here's the response I got back from Frederic.  He does't have any intentions of updating PureBasic to support the 68080/AMMX but is open to anyone else doing it if they so desire.  Just email him for the sources.

"Hello Stephen,

Unfortunately, PB for Amiga is long time discontinued and we don't plan to enhance it any further. All the sources of the libs are opensources (full assembly) so it could be a starting point, but the compiler itself will remains limited to standard instruction set (and to be honest, even the x86 version of PB doesn't use MMX instruction set, it's not really needed for general code).

Best regards,"




Ray Couzens

Posts 67
08 May 2020 09:04


I think it's a great idea.  The more support there is for the Vampire the better.  I would certainly give it a go.

Not everyone is keen on lower-level programming in ASM, and this is where simpler languages like BASIC step in.  Who knows, they may later decide to venture into 'C' or ASM. If not, it does not matter if they are having fun.


Ronnie Beck
(Apollo Team Member)
Posts 178
08 May 2020 09:47


I want to echo the sentiment in this thread.  It is a great idea.  Anything that allows people enjoy their vampire and develop new software gets my vote.  And I can imainge thta everyone who has enjoyed programming has at one time or another ejoyed some time programming BASIC.

posts 29page  1 2