Author Topic: [Multi-Platform+Open Source] BAGASM(RC3)-Assembly Like Scripting Interpreter  (Read 8769 times)

0 Members and 1 Guest are viewing this topic.

Offline BassAceGold

  • Jr. Member
  • **
  • Posts: 67
Nickname: BassAceGold
Project Name: BAGASM (RC3 -currently)
From: Canada
Division: APP
Platform: PC, Supercard DS2, and Nintendo DS
Original Entry: YES
Support Motion: NO
In last NEO Compo this project have won in the top 10: NO


BAGASM is a portable interpreter for an assembly like scripting language in which
one can bind their own functions. The interpreter is written completely in C originally
for the Supercard DSTwo flashcard for the Nintendo DS, but can also be easily ported and compiled for other platforms.

Currently there is a PC and Supercard DS2 port, the PC side uses SDL for graphics, timer and input functions which would make it really easy to port to the Wii or Dingoo if one wanted to.  An NDS port is in the works and there is a working build available, however it does not have all the features available to run the pong demo. (No sprite support yet). The NDS build is running a simple program to draw circles on the background.


Changes from first release:
Code: [Select]
BAGASM RC3

[General Changes]
-started NDS port
-misc changes for performance improvements
-can now configure the max number of arguments per function
-minor arg parsing optimizations on code conversion
-added a system for deprecating functions and registers
    SETPIX, $VX(0 or 1), and $VY(0 or 1) are now deprecated!
-added support for arrays(check documenation)
-updated and optimized code in the benchmark program
-added SETPIXEL screen,x,y,color
-fixed the JMPBK command skipping a line
-optimized the pong demo (removed NOP instances)
-added SETPIXELF - a faster, but unsafe version of SETPIXEL
-cpu operations can now be added in any order in the ops enum
-added FATOPEN SLOT,FILENAME -filename can be an array of characters or a constant
-added FATREAD SLOT,DEST,SIZE,COUNT
-added FATCLOSE SLOT
-added FATSEEK SLOT,POS,OFFSET
    (slots are 0 or 1)
-Constant strings ("this kind of test") are now stored in virtual ram

[DS2 fixes]
-fixed CLRSCRN
-fixed stylus x and y detection

[PC fixes]
-added stylus support using mouse

BAGASM RC2
-added JMPBK function. This will jump back to the line after a previous jump, requires no arguments
-removed $VMX define for video memory access and added SETPIX screen,color. This results in better video access performance
-constant values and jumps are now stored in the virtual ram (4kb) to improve read performance
-new memory access routines for better performance
-pc interpreter will now count the number of operations executed within a programs run time
-added white space handling to code parsing, can now use tabs or spaces to indent lines, and new lines to organize code. Functions still must follow "FUNC ARG1,ARG2" format (white space sensitive)
-vastly improved general performance (test program took ~1.5 seconds to complete in RC1, now it takes ~0.36 seconds to complete)
-moved some data off stack declarations to dynamic allocations for better memory handling and reduced errors for portable environments.
-white space doesn't matter before and after lines

Screen shots
Here is a screenshot of the interpreter running a game of pong on the PC version of the interpreter


And here is the exact same script running on the DS2



And here is the script if anyone is curious to see how its working.
https://raw.github.com/BassAceGold/BAGASM/master/Programs/pong/pong-neo.asm

DS port:

Script for this is here:
https://raw.github.com/BassAceGold/BAGASM/5f0fe6418db17e7ec191342f869f1ff1be5ae5ba/Programs/circles.asm

Downloads, Source, Documentation, and Example Programs:
can all be found at: https://github.com/BassAceGold/BAGASM
with instructions on running the compiled binaries or compiling your own.

[Competition Binaries]
These binaries are the ones submitted for this competition so far:

DS Binary(only runs one built in test program): https://github.com/BassAceGold/BAGASM/blob/5f0fe6418db17e7ec191342f869f1ff1be5ae5ba/DS-Binary-NEO.zip?raw=true

DS2 Binary (requires a menu with argv support to launch files): https://github.com/BassAceGold/BAGASM/blob/5f0fe6418db17e7ec191342f869f1ff1be5ae5ba/DS2-Binary-NEO.zip?raw=true

PC Binary (windows only so far): https://github.com/BassAceGold/BAGASM/blob/5f0fe6418db17e7ec191342f869f1ff1be5ae5ba/PC-Binary-NEO.zip?raw=true

Other test programs to run in the interpreter can be found in the Programs directory of the github link.


Special thanks to Nightfox for his prompt assistance with nflib for the DS port. 8)
« Last Edit: August 17, 2012, 11:18:24 AM by BassAceGold »

Offline corenting

  • Newbie
  • *
  • Posts: 14
    • My website
Nice project, could be nice to easily create multi platform games !

Offline BassAceGold

  • Jr. Member
  • **
  • Posts: 67
Nice project, could be nice to easily create multi platform games !

Assuming you'd want to create a whole game with this, then yeah.

Anyway, I have started working on an NDS port for the interpreter. It currently only supports 16 bit screen drawing and does not have sprite support yet. It is a start, and enough to test its performance. You can download the test binary in the "Binary" folder of the github link in the first post.

Offline theloon

  • Newbie
  • *
  • Posts: 29
  • NEO newbie
You seemed to be asking for feedback in another topic so I thought I'd elaborate.

Tools already exist for the platforms BAGASM targets.  DS Game Maker offers a much easier development environment for making DS games.

What I'd consider is making BAGASM for platforms that yet to have easy development platforms.  The NES, Genesis and now SNES all have C compilers you could port BAGASM to.  If you could make an easy to use scripting language for these platforms then BAGASM will have found its niche.

Offline BassAceGold

  • Jr. Member
  • **
  • Posts: 67
You seemed to be asking for feedback in another topic so I thought I'd elaborate.

Tools already exist for the platforms BAGASM targets.  DS Game Maker offers a much easier development environment for making DS games.

What I'd consider is making BAGASM for platforms that yet to have easy development platforms.  The NES, Genesis and now SNES all have C compilers you could port BAGASM to.  If you could make an easy to use scripting language for these platforms then BAGASM will have found its niche.

Thank you for your input. The goal for BAGASM isn't really to make developing games easy like one would use DS Game Maker for, but rather to provide an extremely fast low level scripting language that one could add to an existing project. Perhaps it may become more when more features are added. But currently it is really just a developers toy, to fool around with, and to create / optimize various programs on multiple platforms, while feeling like a badass.

I have also received other suggestions for porting it to the SNES, I may look into it.
From what I've read about the snes hardware, porting this to it may or may not be possible in its current state.

Edit:
It's interesting that people connect this scripting language as an EASY alternative to development like DS Game Maker, especially since I am using an ASM like syntax. Although it's not difficult to pick up, and testing the code itself is easy enough, logic takes more effort through BAGASM than most other standard scripting languages.

Perhaps I need to work on my project presentation a bit more to clarify its use and purpose. I must apologize if I may have mislead anyone with the intents and purpose of this project.
« Last Edit: September 15, 2012, 07:15:35 AM by BassAceGold »

Offline theloon

  • Newbie
  • *
  • Posts: 29
  • NEO newbie
Easy is relative, here.  Putting together C compilers and libraries for older consoles can be tedious and frustrating.  Even if your language is low level it's still tied together better than many other tools out there.  With enough people making their own functions maybe it could be "easy" as in BASIC someday.
« Last Edit: September 19, 2012, 05:41:36 AM by theloon »

Offline PypeBros

  • Newbie
  • *
  • Posts: 30
  • homebrewer
    • Bilou Homebrew's Blog.
maybe I didn't found how to make the most of BAGASM_DS-NEO.nds, but it looks to me that such a tool on the DS would be more interesting if you had editors features on the console itself, without having to swap media card at every iteration.

You may find Eric Chahi's pseudo-assembly language interesting and inspiring, too.
« Last Edit: September 19, 2012, 05:54:21 PM by PypeBros »
Enjoy Apple Assault v1.4 with polished gameplay and graphics

Offline BassAceGold

  • Jr. Member
  • **
  • Posts: 67
The NDS version is useless in its current form and is really just there to demonstrate that BAGASM was compiled and runs on the NDS. The PC version and Supercard version are more flexible and allow you to use each platforms native shell/os to load other programs, where the NDS doesn't quite have such a set up yet. I opted for a more easy to install/run setup on the NDS, which I guess did more harm than good for this demonstration. Improvements to the NDS version are being worked on, but all the core features of BAGASM are shared among all the (increasing list of)supported platforms.

Also, BAGASM is now renamed to BAGASMI (BassAceGold's psuedo-ASM Interpreter) to more accurately reflect the purpose of the program, and I have started writing up a wiki on its use. https://bitbucket.org/BassAceGold/bagasmi/wiki/Home

I wasn't intending BAGASMI to become a serious form of scripting, but merely a toy. However, it seems that there is actually some demand for portable scripting on various platforms.

That psuedo assembly link looks neat, and indeed does inspire me to do more more BAGASMI.

Also, I'd like to thank everyone for their input, it is appreciated greatly. I apologize for my unintended demand of feedback in the other topic. I did not wish specifically for myself to only receive such special attention, but was merely voicing an opinion that I'm sure quite a few other developers may have had and was expecting nothing to come of it.
« Last Edit: September 20, 2012, 01:59:13 AM by BassAceGold »

Offline Art

  • Newbie
  • *
  • Posts: 24
Nice :)
Probably didn't receive the attention it deserved.