Join us on Discord!
You can help CodeWalrus stay online by donating here.

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - Snektron

PC, Mac & Vintage Computers / Z80-based pico8 clone?
September 07, 2016, 08:25:15 PM
Recently i came to the idea of making a Z80 based pico8-like platform. I wonder how many people would be interested in such a thing.
I myself find the z80 a pretty cool language, but i kinda lost interest in calculators :/.
It would boot the KOS kernel, but wouldn't use the (standard) programs on it since the project would not aim for calculator like emulation.
That's right, i'm at it again. This time the engine works in full 3D instead of only in the horizontal plane like my
last non-euclidean project

I've recorded a video here: (about 2.5 MB)

It works by making every voxel an object, with pointers/references to it's neighbors on each face.
(You can imagine it as a 3D linked list).  The rendering algoritm uses the DDA algorithm used in early ray casters (and my last project),
optimized to branchless code for GPU's. The algorithm uses the pointers to walk the structure until a non-empty voxel is hit.
This way, creating a portal is as easy as changing a voxel's neighbor pointer to somewhere else. (So in fact, everything is a portal.) This creates a lot of potential for really bizarre levels.

A small problem is, this engine can never support absolute coordinates, so level designing will be extremely complex. I will try to make a level editor
in the future, which will most likely have arrows drawn between voxels to show where each face leads.

This engine is made in LibGDX and uses OpenCL for the rendering algoritm (which gives a small speed boost over OpenGL shaders). Its still heavily in developement, so no downloads :(. In the future i want to try to make a game with it, which could be one of the first ray traced games :o
So IBM made it's quantum computer available and programmable in their cloud:
waitch out though: they have a bitch license. Everything that gets ran on their computer is also their property <_<
This weekend i decided to try to make a ray tracer. It can render triangle meshes, loaded from wavefront obj files.
It works by having all triangles stored in a bounded volume hierarchy, so only a part of the mesh needs to be tested against
rays, instead of every triangle.

You can download it here:

I highly recommend only running this if you have a modern GPU. It requires OpenGL 4.3 to run, and will eat a load of GPU processing power.
To run it, just double-click and everything should work fine (on most platforms). If you want to load your own wavefront object model, run
java -jar RayTracer.jar model.obj
replace model.obj with the file name to load.
Make sure the object model has normals and is triangulated! (if you are unsure, open it in blender and export it with everything but triangulate and write normals disabled). Colors / textures etc are not supported.
It depends on the model and location, but most of the time i was able to achieve the 60 fps cap, though it gets a bit slower when the viewer is inside the object.
The default dragon has about 2000 faces and 1000 vertices, but i tried with a model with up to 24000 vertices too.

Im not really planning to release the source, but if you want you can decompile it :P
You can find the shader source in shaders/trace.csh when you open the jar as a zip file though.
PC, Mac & Vintage Computers / [C] CE Raymarching
March 15, 2016, 09:39:11 PM
So i while ago i wanted to try out CE C programming. Since the CE has float support and a color screen i made a little ray marcher :)

You can view the source too:
I recommend trying this out on an emulator, since it takes quite a while to generate an image.
The attached file is one made for an emulator. Since CE will freeze if it exits a program at maximum speed i've put a while(1); loop
so it doesnt quit in the program, but if you want to run it on an actual calculator you wil have to remove it and build it yourself :P
Gaming / [Android/iOS] The Room
December 26, 2015, 12:56:25 AM
The Room is a puzzle game for mobile devices, it's a bit sp00ky and it has a cool back story. As of now there are 2 the room games, but a nrw one (3) is soon going to be released. Its available for ios and android (3 is already released on ios i think). Its costs a bit (like 2 euros) but its certainly worth it :)
(It does need a reasonably good phone since its 3d)
For the past few days i have been working on a little proof of concept: non euclidean space in a raycaster!
Basically, the space can be stretched or compressed, on tiles, making the rays do all sorts of crazy things, for
example a tunnel can seem 10 tiles long (and, since player movement is slowed down too it takes the same
time as to walk though it as an actual tunnel of 10 tiles), but in reality you only traveled 1 tile.

gif (about 500kb):

I probably add some more cool things, like portals and such and
turn this into a little engine. (Wolfenstein4D?)

You can find the window executable at
It depends on SDL, so SDL.dll (included in the download) needs to be either besides the executable or
on your system's path.
It should be possible to run on linux and mac too, but you'll need to build yourself.
You can find the source at
Programs and Utilities / [TI-83+/84+] AxeRay (Axe)
October 10, 2015, 09:15:27 AM
So a while ago i got bored in class, and i made a little program that can make mathematical figures and animate them.

The above image is the result of cos(R*32+(θ*2)+(N*32))-sin(θ*8+sin(R*8 )//2-(N*32))

The way it works is for each pixel i each frame a function F gets called. The return value of this function must be a signed byte.
values -128 to -64 are being colored white, -64 to 0 light gray, 0 to 64 dark gray and 64 to 128 black. While there isn't anyway to input an equation without recompiling, it is easy to change the equation within the code.

Lbl F

O n the first few lines of the source you can find the code above. The equation can be changed by changing the formula between "Lbl F" and "Return". X and Y are the pixel positions, R is the distance from (32, 48), theta is the angle on [0, 256] and N is the frame number. The maximum amount of frames can be changed by changing the line:
(where 8 is the number of frames)
Beware you need M*1536 bytes of free ram! (the image data gets stored in a tmpvar and is deleted when the program exits).
Since the program needs some time to generate the frames, a small progress bar is displayed until the image is done.
Games / [TI-83+/84+] Line++ [Axe]
July 24, 2015, 12:35:17 PM
I had some spare time while on vacation where i could lend my little brothers laptop. After i had downloaded the necessary tools over our 100 slow free wifi hotspot, i decided to clone a little game we had been playing (one more line).

It remembers your highscore and the number of times you died too :D
Also, i added a few performance settings.

Tell me what you think  ;D
Also, "Line++" "one more line". See what i did there?  ;D

how did i clone again? :P

After a while in developement, we finally decided to release the mobile notifier! :D

- Last 10 posts can be viewed from the app.
- Images are also displayed in the app
- most bb tags are also parsed
- Double tap a post to open it in the browser.
- Service sending a push-notification when a new posts is made.
- Changable time between update checks.
- Enable / Disable service.
- Enable / Disable mobile data used to check for updates.

Known bugs:
- There is a bug in android 4.4.2 where it doesn't restart services, which kills the service instandly :( (at least thats what i think it is)
- You tell me :)

Not yet implemented
- Smileys (that means walrii too :()
- Links in posts. [ url] [ /url] tags work though
- WIRC??? (Maybe)



The source can be found at

Download & Install
You can download the apk from
Initially i wanted to put the app on the play store too, but i don't know if thats a good idea.
You have to enable 'install from unknown locations' in your settings, but that get's prompted by android automatically

If you encounter any bugs or have any suggestions please let me know :)
Hello! So, at the last moment i decided to make something to make something for the 4x3 challenge.

In The Game: Contest Edition, the aim is to find the correct key.
At the start, the game randomly picks a key, and it's up to you to find it!
if you find the right key, you win. Else, you lose the game.

it also features a special escape key, enter. But who would use that right? i mean it's such a thrilling
game, you wouldn't want to end it before you win, right?


also: you lost
PC, Mac & Vintage Computers / [pico-8] Raymarcher
May 05, 2015, 10:46:20 AM
So i downloaded pico-8 a few days ago, and i made a shader-like thingy (basically it loops through every pixel and runs a function to get the color).
Ofcourse, i had to make a raymarcher with it:

It contains some vector functions, a few raymarch primitives (only 2 atm), atan, acos, sqrt (which i didnt make), and rgb-to-16-color converter, and some functions for the raymarcher lie getting normals and calculating a diffuse value.
The function "f" in the code makes the scene, the image just shows "return sdSphere(p, 2)" which makes a sphere with a radius of 2.
The variable "ro" is the camera position, and dir is the look direction. "sun" is the light direction. "STEPS" is the max # of steps, MAX_DST the maximum distance and EPS/EPS2 a small edge value. It takes a few sec to render an image, but it turned out pretty nice i think :D
(also press action to end the program when its done, or esc to stop it anytime)

EDIT: so i added the "opRep" function which repeates space and increased the max distance:
Programs and Utilities / [TI84+CSE] DovahCalc CSE
April 18, 2015, 11:18:58 PM
I wanted to try out CSE Developement for a while, and i also wanted to see my DovahCalc for the CSE, since it has a higher res. Most of the code is the same, only the menu and the way it loads fonts (because the bitmap layout is ridiculous - i even made a small editor for it).

Turned out quite nice i think. Now, it should chain, but i don't know any font hook for CSE and i didn't really have time either (its 1:17 am and i kinda want to sleep).

EDIT: it looks like DCSE8.1 turns the hook on after a program has ran. thats strange, since DCSE8.1 probably doesnt do chaining correctly, then
For our computer science class we (@brentmaas, @TheCoder1998 and me) need to do a project. We had
to come up with a project ourselves. The first thing i did was send a mail to DJ, since i saw people would like a post notifier a while before.
Since we were quite busy at the time, we decided to delay developement untill we had some free time, which is about now.
We have to keep a log and everything too, so we'll be using this topic to notify of developement updates.

Since the default Android programming language is Java, and we can all code in Java (well, TheCoder is still learning :P), we'll
be using that to make the application. We will be using the Android SDK ofcourse.

Planned features:
- Service that sends a push notification when a new post is made.
- Clientside only. it will be checking the SMF RSS update feed and parsing data from there.
   (The SMF RSS feed gives post content too, but that might use too much data. If someone knows how to remove that data in the http request, or if
   a site maintainer can make a special feed for us, that would be nice :))
a custom smf mod that returns some data upon requesting an url
- Toggle service active.
- Toggle 3g update checking.
- Algorithm to do more checks when there is intense posting.
- Setting for time between checks
- Activity that displays latest X posts
- Setting to ignore some tags/topics/subforums

The app will be released on the play store, since i have an account anyways.
Ofcourse, the app will be free. Also we'll probably post it on a new topic when it's finished.

Further info
This app will sadly not be available for iOS, since none of us have a mac to develop on or an app store license.
Windows version is not ruled out but that's not part of the project, so that will maybe come later. (also if we do it, it's maybe better to do a chrome plugin).

If you have any suggestions or ideas, please leave them on this topic :)
This morning i got the idea to make a font hook that replaces letters with their Dovahzul equivalent:

It has a few changes, though:
- Since the dragon language has no c, the sprite is the same as 'k' with a minor change
- Things like 'Ah', which normally is 1 letter in the dragon language, is now just 'a' and 'h'

Also this was more of a quick experiment, so i made only a quick menu, without fancy moving parts.
(if you press one of the keys for the menu, it will enable/disable, just no action is shown)

EDIT: i wanted to have an alphabet here, but it doesnt seem to show pictures from ClrHome
PC, Mac & Vintage Computers / Game engine structure
March 27, 2015, 05:23:17 PM
I was starting on some simple program today, and when i wanted to draw something, i noticed OpenGL wouldn't really
draw my lines. Since i used Java with still LWJGL 2.9 i decided to update to LWJGL 3, but this newer version completely changes
things like displays and such, so i decided to make a new engine. Normally i just use the simple engine i made some time ago,
which only handles display creation, openGL initialization, and a game loop. And since i want to write a better engine, i'm wondering
how i would create a good engine. I don't want to create an enourmous thing like Unity or Unreal, but just something i can easily make
OpenGL programs with. Though the engine will mostly be used by me, i still want to write it like a proper library.
What things shall i initialize with the game code?
And what is a good general structure?
Things like object loading i can do myself, i'm more interested in a general game (engine) structure. :)
Also if you make games, how do you make your structure?
(as i said i use java, but this is more a general question)

thanks :)
TheCoder1998 first showed me about a year ago. Since i wasnt really interested in calc programming i didn't join (or maybe i did, just never posted anything). After a while i started making basic programs to make math easier (i was too lazy to solve quadratic equations myself lol). Then TheCoder showed me Axe and i started doing that. When i heard a new Calculator forum was opening i thought that was a great opportunity to get into forums, so i signed up like a month before the official release. I also started learing Z80 ASM about half a year ago.

What about you?
For the past few weeks i've been working on an app, which allows you to run TI-Basic programs with arguments.
It installs a parser hook, which parses 'prgm<name>(' to 'sin(<id>,'. Upon parsing sin( with 2 or more arguments it
launches prgm<name from id> with the arguments in list lARGS. Ans is returned as variable, allowing more
than only the program to be entered in the expression.

At this moment it won't parse programs and assumes the expression entered and parsed is less than
767 bytes. Also, since it's still not quite finished, it probably has some errors. Watch out for ram clears!

The source is available at:
If you find any bugs or have any questions please post them below :)
Programs and Utilities / [TI-83+/84+] Draw (Axe)
February 14, 2015, 04:25:53 PM
One of my friends asked if i could make a draw program, so i did :D.

- Mode menu
    - Select actions/drawing modes
    - Open with [mode]
    - Navigate with [up]/[down]
    - select with [2nd], [mode] or [enter]

  - Size menu
    - Set pen size
    - Open with [alpha]
    - change size with [up]/[down]
    - Select with [alpha]

  - Pattern menu
    - Set drawing pattern
    - Open with [X,T,θ, n]
    -  Navigate with [up]/[down]
    - Select with [2nd], [X,T,θ, n] or [enter]

    - Pen:
      - Draws with the selected pattern and size
      - draw by holding [2nd]
      - Set size with [alpha]
    - Eraser:
      - Clears with the selected size
      - erase by holding [2nd]
      - Set size with [alpha]
    - Quit:
      - Exits the program
    - Clear:
      - Clears the image
      - Activates immediately and selects pen after activating
    - Line:
      - Draw a line
      - Press [2nd] for point 1 and a second time for point 2
      - Press [Del] to cancel
    - Invert:
      - Inverts the image
      - Activates immediately and selects pen after activating
    - Circle:
      - Draws a circle
      - Press [2nd] to set the origin and a second time for a point to specify the radius
      - Press [del] to cancel
    - Flood:
      - Floods an area with the selected pattern
      - Activates when [2nd] is pressed
    - Save:
      - Save current image to a pic var
      - Displays an error message when there is too little free ram
    - Open:
      - Open pic var and copy to image, overwriting everything
      - Diplays an error message when the pic var is undefined

    - Hold [Y=] to speed up the cursor
    - When quitting, the current image is saved to an appvar and loaded when the program is reopened

Credits to DarkestEx for the pic pixel test algoritm and to MGOS for the flood fill
Download zip contains:
  - Draw.8xk -- the main app
  - Draw.8xp -- the axe source
  - readme.txt -- the readme

This was intended as App but will probably work when compiled as Program, though you will have to change the name
as it contains lower case characters.
If you find any bugs or have any ideas i should add let me know.
Have fun with it :P
Other / Weird Links [possibly nsfw]
February 13, 2015, 10:29:14 PM
Know any funny/interesting sites? List them here!
(also: 333th post, i am now half-satan)
PC, Mac & Vintage Computers / Raymarch Shaders
February 10, 2015, 07:56:06 PM
Apart from making particle systems i do more with shaders, and that is mainly raymarching.
For those of you who don't know, raymarching is a rendering technique (like rasterizing).
for every pixel a ray is casted from the camera and folowed until it hits an object, mostly
done by having a distance formula (which surprisingly returns the distance to a surface) and
moving forward until the distance is smaller than a certain number (like 0.0001).

I've whipped up a program to load and draw the shader on a quad covering the whole screen, does
some uniform (variables send to the GPU) management, and even some position/direction to make
first person controls possible. And i've ofcourse made a few shaders, and wanted to share a few screens :)


This one i made just today, and is probably one of my best.


An experiment with reflections, and the noise distortion makes it look like water :)


A simple one, made with my standard raymarch set.


This is not really raymarching, and without animation it's hard to see, but it's a galaxy.
One of the drawbacks of raymarching: these kind of objects. it needs to calculate for every
object if a pixel is in range, which causes ridiculous frame drops.


It's also very easy to plot a 3d function :)


And i really like how easy it is to make almost impossible shapes for rasterization.

So i got bored to day, and decided to make a Brainf*** Virtual Machine in z80
(ti 83+, 84+ etc). I haven't yet made a way to input code on the calculator, but it
has all the instructions.
The input code supports all alpha characters (including theta) and 1-9 (i should impelent 0, oops), + - * / ^ ( )
. and ,. character 10 is new line in the print code.
Media Talk / What series do you watch?
January 25, 2015, 05:01:29 PM
So what series do you watch / have you watched / are you going to watch?

- Game of Thrones
- Supernatural
- The Walking Dead
- Falling Skies
- Legend of Aang & Legend of Korra
- Rick & Morty
- occasionally some Breaking Bad, but i'm not a great fan

- Not really anything

Going to watch:
- Also not really anything, Vikings maybe.
Web / MazeDweller
January 23, 2015, 03:09:16 PM
Last year we were assigned to make a maze game in HTML.
The original project (the one described in out book) was made entirely in HTML, with the exception of some basic Javascript
to handle button input. It was a broken beta version and it was to us to fix the game and present it's final form.
Ofcourse, i didn't want some half broken maze game, so i (we actually had to work in groups of 4, but i did all
the programming (also TheCoder was in my team too :P)) made it in 3D using THREE.js.

I was working on it for a few weeks, and it's actually my biggest project ever >.<. Even though it's not as optimized as could
be (the deadline was in june 2014, and since then i've learnt a lot more about programming), i'm still quite proud of it.
Since i had i VPS i thought "Why not put it on there?", so you guys can play it right in your brower,
it's on (Yeah the main page). In the end i got a 9 or 9.5 out of 10, while
the rest of my team got an 8 (i guess the teacher also saw they were lifting on my skills ^^).

Even though i'm not working on it anymore, if you've noticed a bug, please tell me so i can remove it :)
PC, Mac & Vintage Computers / FBO Particle System
January 22, 2015, 10:31:58 PM
Ever since i started programming, i've been interested in particle systems.
The mouseattractor ones. I've made several of them, the
first one on my laptop could'nt even handle a thousand without killing the
computer (that are the drawbacks of Java i guess :/).

Also, this summer became interested in GLSL (Shading) and started learning that.
Then after a while i read somewhere that GPU's could be used
for more than only drawing images on screen (well, i knew that before, but i never
really knew how such a thing would be accomplished). And yeah, that includes particle systems.
So i started reading up on them, and i actually managed to make one myself :D.



(some screenshots ^)
I can run easily 2 million particles.
It's not quite done yet though, as i've learnt several optimization tricks (yeah, it's was a forgotten project for a few months).
So i'll be working on this project for a few days (i didn't want to attach the project just yet, as
you'd need to recompile it to change the texture size etc). Let me know
what you think and if you have any ideas i should include :)
Web / Batman
January 15, 2015, 02:51:35 PM
I made this little script:

javascript:var url='';for (var x=0; x<document.images.length; x++){i=document.images[x];i.src = url;}void(0);

paste this into your browser and don't forget to type 'javascript:' before it if
you are using Chrome!
PC, Mac & Vintage Computers / C windows api
January 13, 2015, 11:19:15 PM
So im trying to send some bytes trough an usb port in C. i'm using some
library ( which does most of
the work. At least it should be. When i put the c file for windows in
my project, it gives some errors under "SetupDiGetClassDevsA"
and more from "setupapi". Apparently i need to link this DLL with my project.

I'm using MinGW and code in Eclipse (pls no h8). Note that ive never
done PC C before (only some GLSL and SDCC).

This image is quite appropriate of how im feeling right now.
So im trying to do a fast square in an Axiom.
im using a LUT i generated but it keeps outputting the wrong values.

.dw ShdDraw_
.dw $00F3
.db AXM_1ARG
.org 0
ld l, 0
call squareL

; square l, return in hl
ld hl, (SqLUT)

.dw $0000, $0001, $0004, $0009, $0010, $0019...

This is the code for the Command, and obviously the LUT is way bigger so i stripped it a bit down.
For debugging purposes i print the first byte at hl, which should be 0 but isn't...
Anyone got an idea of what im doing wrong? q.q

EDIT: Looks like it's something with a 16-bit load command
EDIT2: I have the 0! now for the rest of the values...
EDIT3: Okay so i did some data analysing...
Seems like verything up until 22 goes OK... then
23^2 is 39598... then the values are offset 1 for a few numbers (eg 25^2 displays as 26^2)
after a while its just random values...
also my code now looks like this:

ld h, 0
sla l
rl h ;l*2 in hl
ld de, SqLUT
add hl, de ; address in hl
dec hl
ld d, (hl)
inc hl
ld e, (hl)
ex de, hl

.dw $0000, $0001, $0004, $0009, $0010, $0019, $0024, $0031... etc

EDIT4: Ok so ive narrowed the problem down to the loading the address into hl part...

ld hl, SqLUT + 96  ; for debugging purposes, this is one of the faulty numbers (48)
dec hl
ld d, (hl)
inc hl
ld e, (hl)
ex de, hl

EDIT5: My god... it finally works... don't have any dea of how i fixed it though...
EDIT6: Oh nvm, it worked in my test program... not in the axiom (im getting tired of this)
EDIT7: I finally got it working! :D
If someone wants to know what the correct way is:
Axe uses a few bytes for special things (like loading into 16bit registers). If those bytes are in your data,
axe will replace them and everything will fail :(.'
The solution is to make another Axiom command, but with AXM_DATA as type.
The special bytes will not be applied to commands with this byte set.

.dw some_command_
.dw token
.db AXM_1ARG
.org $0000
REP_NEXT ; don't forget
ld hl, sub_Axiom2 ; replace the 2 with whatever # command your data block is at
; start of the data address is now in hl

.dw data_block_
.dw $0000   ; it can only be called from other commands
.db AXM_1ARG
.org $0000
; data here
So today i came up with this nice little shadow program in axe.
Unfortunately, it was horribly slow. So i decided to have a
crack at Axiom developement.

It works by first copying the main buffer to the back buffer,
then looping through each byte of the back buffer and moving it 12 bytes to the right
(one pixel down). Then, depending on the command, one bit right or one bit left.
Although it's not amazingly optimized ASM it works quite well.
I haven't really tested it for bugs, so please use at your own risk :P

EDIT: The tokens are found in the stat-calc menu (at 5, 6 and 7)
PC, Mac & Vintage Computers / java binpac8x
January 01, 2015, 02:54:39 PM

a while ago i started doing some C for the ti 84 and since it was like
7 commands to compile it, i decided to make some kind of sdk.
I wanted to use a minimal amount of windows commands, so
i made this java implementation of binpac8x.
it doesn't have support for any other type than 8xp, maybe i'll add it later.
Source is available here:
also contains a windows executable made with launch4j
Powered by EzPortal