New release for Neoflash comp:
Project Name: BAGASM RC2
Platform: Currently compiled for PC, Supercard DS2, and Nintendo DS (as of RC3)
Original Enter: YES
Support Motion: NO
In last NEO Compo this project have won in the top 10: NO
I'm not entirely sure that this entry will be accepted or not based on its current platform ports, however, I will try entering anyway on the basis that it is open source, fairly portable, and retro in the sense it is based on an old programming language.
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 only 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 performance of this interpreter is not bad. Currently, a test program containing 843441 operations completes in 0.37 seconds on the 396mhz clock of the DS2. (As of RC2 build)
Changes from first release:
-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
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.
Here is an example on how to write hello world for this interpreter:
;Any line with ";" as the first character is a comment, yay!
;This debug text flag is only good for the PC interpreter,
;Debug text slows the DS2 interpreter down a lot
;Here we are setting the DS2 CPU speed to its highest value
;it does nothing on the PC interpreter though
;_start: marks the start of the program, this is where white space
;starts to matter in function formatting
;this will output Hello World! to the console (top screen on DS)
;all function names are capital and must have 1 space after the function name before the first argument
;all arguments after the first one would be separated by a comma (",") with no trailing or leading spaces,
;however there is only a max of 2 arguments per function
PRINT "Hello World!"
;finally this will end the program
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.
RC2 is the build that is entered in the competition, but there are binaries that have been compiled with the RC3 source available for download in the Binary folder. Other test programs to run in the interpreter can be found in the All Programs directory.
There are currently 1 users browsing this thread. (0 members and 1 guests)