Commit 920a4406 authored by Dave Griffiths's avatar Dave Griffiths
Browse files

RPI fixes

parent 2019544d
Jellyfish
Aims to be a fluxus compatible programmable game engine and 3D renderer
for livecoding small devices.
Incorporating:
* Modified tinyscheme R5RS interpreter
* Fixed point maths throughout
* An experimental vector processor for fast procedural rendering
* OpenGL ES backend for ARM/android/rasperry pi/OUYA
* Linux target: reference version (also running fixed point)
* Playstation 2 target (legacy)
* Custom hardware renderer running on vu1 path
Jellyfish
=========
Aims to be a fluxus compatible programmable game engine and 3D renderer
for livecoding small devices.
Incorporating:
* Modified tinyscheme R5RS interpreter
* REPL for livecoding
* OSC REPL for remote livecoding
* Fixed point maths throughout
* An experimental vector processor and compiler for fast procedural rendering
* OpenGL ES backend for ARM/Android/Rasperry Pi/OUYA
* Linux target: reference version (also running fixed point)
* Playstation 2 target (legacy)
* Custom hardware renderer running on vu1 path
Building
========
Linux: scons
Android/OUYA: ndk-build (will need to be part of an APK)
Raspberry Pi (you'll need scons and liblo-dev installed):
scons TARGET=RPI
Jellyfish Lisp Language Reference
=================================
Example programs
----------------
Randomly move vertex positions
(with-primitive
(make-jelly-obj 1000
;; jellyfish lisp starts here
'(let ((vertex positions-start))
(forever
(set! vertex positions-start)
(loop (< vertex positions-end)
(write! vertex (+ (read vertex) (rndvec)))
(set! vertex (+ vertex 1)))
)))
;; jellyfish lisp ends here
(pdata-map! (lambda (p) (srndvec)) "p")
(pdata-map! (lambda (c) (rndvec)) "c"))
Core forms
----------
TDB
let
define
cond
loop
forever
do
lambda
+
-
*
/
*v
cross
dot
eq?
>
<
set!
write!
write-add!
swizzle
rndvec
trace
read
not
mag
magsq
noise
normalise
abs
floor
sincos
ignore
round
synth-create
synth-connect
synth-play
play-now
Low level instruction set
-------------------------
TDB
jmp jmz jlt jgt ldl lda ldi sta sti
add sub mul div abs scs atn dot crs
sqr len dup drp cmp shf bld ret dbg
nrm add.x add.y add.z swp rnd mull
jmr ldlv lensq noise lds sts mulv
synth-crt synth-con synth-ply flr
......@@ -44,10 +44,12 @@
char *starwisp_data = NULL;
#ifndef FLX_RPI
#include "core/db_container.h"
db_container the_db_container;
#include "core/idmap.h"
idmap the_idmap;
#endif
#ifdef _EE
#define USE_STRLWR 0
......@@ -4205,6 +4207,8 @@ static pointer opexe_5(scheme *sc, enum scheme_opcodes op) {
return sc->T;
}
#ifndef FLX_RPI
// fudge to behave like planet jaymccarthy/sqlite:5:1/sqlite
static pointer db_data_to_scm(scheme *sc, list *data)
{
......@@ -4274,6 +4278,8 @@ pointer db_exec(scheme* sc, db *d) {
return ret;
}
#endif
static pointer opexe_6(scheme *sc, enum scheme_opcodes op) {
pointer x, y;
long v;
......@@ -4339,14 +4345,17 @@ static pointer opexe_6(scheme *sc, enum scheme_opcodes op) {
}
s_return(sc,sc->F);
case OP_OPEN_DB: {
#ifndef FLX_RPI
if (is_string(car(sc->args))) {
the_db_container.add(string_value(car(sc->args)),
new db(string_value(car(sc->args))));
s_return(sc,sc->T);
}
#endif
s_return(sc,sc->F);
}
case OP_EXEC_DB: {
#ifndef FLX_RPI
if (is_string(car(sc->args)) &&
is_string(cadr(sc->args))) {
db *d=the_db_container.get(string_value(car(sc->args)));
......@@ -4355,9 +4364,11 @@ static pointer opexe_6(scheme *sc, enum scheme_opcodes op) {
s_return(sc,db_exec(sc,d));
}
}
#endif
s_return(sc,sc->F);
}
case OP_INSERT_DB: {
#ifndef FLX_RPI
if (is_string(car(sc->args)) &&
is_string(cadr(sc->args))) {
db *d=the_db_container.get(string_value(car(sc->args)));
......@@ -4367,12 +4378,15 @@ static pointer opexe_6(scheme *sc, enum scheme_opcodes op) {
s_return(sc,mk_integer(sc,d->last_rowid()));
}
}
#endif
s_return(sc,sc->F);
}
case OP_STATUS_DB: {
#ifndef FLX_RPI
if (is_string(car(sc->args))) {
s_return(sc,mk_string(sc,the_db_container.status()));
}
#endif
s_return(sc,sc->F);
}
case OP_TIME: {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment