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.

Topics - yrinfish

Pages: [1]
TI Z80 / TinyCraft [Axe]
« on: January 05, 2012, 05:09:49 pm »
Vote for it ^ or post a suggestion here.

I' ve made a temporary project home page, but there's not really a lot to see there yet.
No mini competition please, teamwork is better :D

Language: Axe
Platform: TI 83+

Things we'll need to do/make
Draw the sprites. saintrunner
A save file format. yrinfish
A level generator.
A Tilemapper.
Some sort of AI.
Crafting system.

People on it (AFAIK)
Hayleia (your avatar is really cool btw)
Blue Raven

Useful info
For those who are going to work on this
General Program Structure
Spoiler For Spoiler:

:.Sprite Data
:.Other Data
:.Main menu
:.Option Start Game->init
:.Option How To Play->help
:.Option About->crdt
:.BEGIN init
:.Save file is present?
:.END init
:.BEGIN lgen
:.Make appvar appvMCSAVE
:.create 7 levels
:.edit for sky, mines, deep mines, nether
:.END lgen
:.BEGIN strt

~~~~ working on this ~~~~

Save file/Maps
Spoiler For Spoiler:
I was thinking about making them 32x32 (x2 for the depth) = 2KiB per map. If I'm right there are 5 seperate height maps, so that would be 10KiB in total.
We could also make it fit within the 16KiB boundary, and then we have space for another 2 maps (and some space (2 KiB should be enough) for inventory, entity etc data), so that we can have 1 Nether, 2 Deep Mines, 2 Mines, 1 Surface, 1 Sky.
Spoiler For Spoiler:

Spoiler For Spoiler:
Deep Mines

Spoiler For Spoiler:
Pow Glove
Iron Ore
Gold Ore

Spoiler For Spoiler:
Lantern: 5 wood, 10 slime, 4 glass
Oven: 15 stone
Furnace: 20 stone
Workbench: 20 wood
Chest: 20 wood
Anvil: 5 iron ingots
Iron ingot: 4 iron ore, 1 coal
Gold ingot: 4 gold ore, 1 coal
Glass: 4 sand, 1 coal
Bread: 4 wheat

Sword: 5 wood
Axe: 5 wood
Hoe: 5 wood
Pickaxe: 5 wood
Shovel: 5 wood

Sword: 5 wood, 5 stone
Axe: 5 wood, 5 stone
Hoe: 5 wood, 5 stone
Pickaxe: 5 wood, 5 stone
Shovel: 5 wood, 5 stone

Sword: 5 wood, 5 iron ingot
Axe: 5 wood, 5 iron ingot
Hoe: 5 wood, 5 iron ingot
Pickaxe: 5 wood, 5 iron ingot
Shovel: 5 wood, 5 iron ingot

Sword: 5 wood, 5 gold ingots
Axe: 5 wood, 5 gold ingots
Hoe: 5 wood, 5 gold ingots
Pickaxe: 5 wood, 5 gold ingots
Shovel: 5 wood, 5 gold ingots

Sword: 5 wood, 50 gem
Axe: 5 wood, 50 gem
Hoe: 5 wood, 50 gem
Pickaxe: 5 wood, 50 gem
Shovel: 5 wood, 50 gem

C and C++ / File reading with c/c++
« on: August 18, 2011, 03:09:10 am »
I want to be able to do this on a file:

Code: [Select]
myChar = getTheNthCharOrSomething(9);
that for example in pseudo-code, getTheNthCharOrSomething() is this:

Code: [Select]
char getTheNthCharOrSomething(where) {
    return file.charAt(where);

file is a global var.

Computer Projects and Ideas / Designing Happy - OOP
« on: July 16, 2011, 05:25:10 am »
Ok, I'm trying to add OOP to Happy.
I only have a small problem:

Where do I place te objects, and how big?

It is simple with objects like this:

Code: [Select]
type point[2] {
    ubyte x;
    ubyte y;

// And in the program or global declarations:

point lol;

I can place this with the other vars after the code, and I know I need 2 bytes of space

But even this approach gives problems:
For example, how do I give it initial values? 

Amd when using the stack, How do I know the amount of space left?

And this gives even more problems:

Code: [Select]
type string[] { // Yup, no native support
    ubyte[] value;
    empty create(ubyte[] in) { // empty is a subroutine type
        // Loop and copy the string

This one doesn't make sense, because we have the same data twice in RAM.

Code: [Select]
type enemy[10] {
    ubyte x;
    ubyte y;
    ubyte[8] sprite; // The monochtome sprite data

    empty move(sbyte dx, sbyte dy) {
        x = x + dx;
        y = y + dy; // update the pos

To make it short:
1. Happy doesn't always know how big it is
2. How can initial values be set?
3. How do I stop the program from corrupting things in RAM, with a ever-growing stack?

Minecraft Discussion / Omnimaga minecraft server
« on: June 18, 2011, 05:21:25 am »
What about an omnimaga minecraft server??

We have to think about a few things then:
Survival or freebuild?
Vanilla or Bukkit?
Who's going to host it?

Whoa, a lot of questions!!
I am good with bukkit mods etc, but I can't host it...

TI Z80 / The Happy Parser
« on: June 15, 2011, 10:31:31 am »
This is my happy thread ;)

Because it became a mess, and I got some new ideas to make it better. (Learn While Doing lol)

I am working on a programming language for the 83 etc, (But it is easily retargetable, so anyone who knows er, ti-nspire asm for example, could edit some strings and is ready!!)

I made it with JavaScript (I have a strange relation with that language)

working on a C++ version, so there is an exe for the winows guys coming!!

Current Features:
-Nice name (Happy)
-Operator Precedence
-Somewhat optimized expressions (Crenshaw hates me now)
-Really platform-independent because it's made with JS
-Nothing more yet...

To show what it is currently able to do:
Spoiler For Input and Output:

is translated to:

   ld hl, 4
   push hl
   ld hl, 5
   ld de, 3
   ld a,e
   ld e,a
   ld a,d
   ld d,a
   add hl, de
   pop de
   ex de,hl
   ld a,e
   ld e,a
   ld a,d
   ld d,a
   inc de
   add hl, de

That may seem much, but most of it is the super inefficient unary operator - and ~.
It is able to do * and / too, but that's not a z80 command, and I have no libs yet...

It also optimizes a VERY little bit: for example, it doesn't fall for this one:
(Which is also good to have no precedence)


is translated to:

   ld hl, 2
   ld de, 3
   add hl, de
   ld de, 4
   call multiply
   ld de, 5
   add hl, de
   ld de, 7
   call divide

Isn't that nice?

Spoiler For Log::
10-06-2011 Started development with a Crenshaw tutorial.
13-06-2011 Because of the horrible output quality, I started rewriting everything.
14-06-2011 Announced it here, posted a poll about precedence. Almost finished the expression parser the same day.
15-06-2011 Getting the pushes and pops right was harder than expected.
16-06-2011 Adding variables (sort-of) and function calls, Still fighting with pushes and pops.
17-06-2011 Still fighting with those #$%^pushes and pops, made a website for it. v0.0.2
18-06-2011 Assignments!! I think I finally fixed the pushes and pops. v0.0.3
19-06-2011 A few things that I want to make better, and going to make it MULTILINE YAY
Between:     v0.0.4
21-06-2011 It was slowly turning into a mess, so I decided to start over. REWRITING YAY
Until now: rewriting almost complete, rewriting it in C++ so it is more usable

Spoiler For Syntax:

nn is a number 0<nn<65535
var is a variable

Link to test it yourself (Please do that!!)

TI Z80 / Operator precedence...
« on: June 14, 2011, 02:16:14 am »
As some of you know I'm working on a programming language for the TI83/84 etc, but I've got a question:

Do you guys want operator precedence?

It would be less optimized (pushes and pops), but since the compiler is not on-calc, I can work on this. It would also mean more work for me (but that's not really bad)

I was bored, and I have a obsession with... Nevermind, here it is.

Made with my iPod Touch (no copy-paste used, everything is hand-codedthumb-coded)
Why js?
Because I hate Apple Waaah. Er, no, because I can't program in any other language with it thanks to Apple. (ok, it's jailbroken, but php is just ... not right for this and bash... There are still windows users here...

Why 4-bit?
To keep it simple, stupid.


Code: [Select]
var RAM = [4, 3, 5, 9, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0];
var ip = 0;
var a = 0;
var b = 0;
var c = 0; // for easy xchg
var z = false;

function setFlags(num) {
    if(num == 0) {
        z = true;
        z = false;

function execOpCode(opCode, arg) {
    var opCodeLength=1;

    case 0:
    case 1:
        opCodeLength = 0;
        ip = arg;
    case 2:
        opCodeLength = 2;
            ip = arg;
            opCodeLength = 0;
    case 3:
        opCodeLength = 2;
            ip = arg;
            opCodeLength = 0;
    case 4:
        opCodeLength = 2;
        a = arg;
    case 5:
        opCodeLength = 2;
        b = arg;
    case 6:
        opCodeLength = 2;
        RAM[arg] = a;
    case 7:
        opCodeLength = 2;
        a = RAM[arg];
    case 8:
        a = abs(a+b);
    case 9:
        a = abs(a|b);
    case 10:
        a = abs(a^b);
    case 11:
        a = abs(a&b);
    case 12:
        a = abs(~a);
    case 13:
        a = abs(-a);
    case 14:
        c = b;
        b = a;
        a = c;
    case 15:
        a = abs(a-b);
    return opCodeLength;

function log(txt) {
    document.querySelector('div#log').innerHTML += txt;

function hex(num) {
    var string = num;
    var abcdef = ['a', 'b', 'c', 'd', 'e', 'f'];

    if(num>15) {
        num = abs(num);

    if(num>9) {
        string = abcdef[num-10];
    return string;

function abs(num) {
    return num < 0 ? (16-Math.abs(num%16))%16 : num%16;

function sanitize() {
    var j = 0;

    for(j=0;j<16;j++) {
        RAM[j] = abs(RAM[j]);
    a = abs(a);
    b = abs(b);

function dumpRAM() {
    var k = 0;

    for(k=0;k<16;k++) {

function parseRAMInputs() {
    var i = 0;
    for(i=0;i<16;i++) {
        RAM[i] = document.getElementById('RAM' + i).value;
/*        document.getElementById('RAM' + i).setAttribute('onclick', 'this.value = ''"');*/

function start() {
    var i = 0;
    var counter=0;
    var maxCycles = document.getElementById('cycles').value;

    a = 0;
    b = 0;
    ip = 0;

    log('Starting…<br /> RAM: ');
    log('<br />Cycles to simulate: '+maxCycles+' <br /><br />');
    while(ip<16 && counter<maxCycles) {
        log(hex(ip) + ':' + hex(RAM[ip]));
        ip = execOpCode(RAM[ip], RAM[abs(ip+1)]) + ip;
        log('   a=' + hex(a) + '   b=' + hex(b) + '<br />');
    log('<br />');
    if(counter==maxCycles) {
        log('Stopped: max cycles reached.<br />');
    log('RAM:       ');
    log('<br />register a=                '+hex(a));
    log('<br />register b=                '+hex(b));
    log('<br />instruction pointer ip=    '+hex(ip));
    log('<br />zero flag z=            '+z+'<br />');

Code: [Select]
<!DOCTYPE html>
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width" />
        <script src="script.js"></script>
    <body onload="42">
        <form id="settings">
            <label for="cycles">Cycles</label>
            <input id="cycles" type="textbox" value="32" />
            <div id="RAM">
                <input id="RAM0" type="textbox" value="0" size="1" />
                <input id="RAM1" type="textbox" value="0" size="1" />
                <input id="RAM2" type="textbox" value="0" size="1" />
                <input id="RAM3" type="textbox" value="0" size="1" />

                <input id="RAM4" type="textbox" value="0" size="1" />
                <input id="RAM5" type="textbox" value="0" size="1" />
                <input id="RAM6" type="textbox" value="0" size="1" />
                <input id="RAM7" type="textbox" value="0" size="1" />

                <br />

                <input id="RAM8" type="textbox" value="0" size="1" />
                <input id="RAM9" type="textbox" value="0" size="1" />
                <input id="RAM10" type="textbox" value="0" size="1" />
                <input id="RAM11" type="textbox" value="0" size="1" />

                <input id="RAM12" type="textbox" value="0" size="1" />
                <input id="RAM13" type="textbox" value="0" size="1" />
                <input id="RAM14" type="textbox" value="0" size="1" />
                <input id="RAM15" type="textbox" value="0" size="1" />
            <input id="submit" type="button" value="Simulate" onclick="start()" />
        <tt><div id="log" style="white-space:pre;"></div></tt>

ASM / Assembler
« on: April 19, 2011, 10:47:17 am »
OK, I want to learn z80 assembly, but TASM isn't compatible with my shiny amd64 laptop.

And it is OLD.

Are there better assemblers out there?

PS: I've used some NASM for Linux, so that one would be great

Axe / getKey question
« on: March 17, 2011, 10:11:51 am »
I'm trying to make a key remapping function for DionJump, in Settings, users can edit the keys and the number is saved to an appvar.

But when I try to check the keys, it doesn't work...
Code: [Select]
:If getKey({K+2}) // K is the pointer to the appvar.
: ...

Here is my source, the getKey is changed back to getKey(41), to make the game work. Please don't ask questions about the rest of the code, it isn't really good code, I know that...
WHOA, that's BIG, BIIIIIIIIIIIIIIIIIIIG, did I make that in 4 days ???
Spoiler For Spoiler:
:Fix 5
:Lbl RE
:Fix 1
:Repeat getKey(9)
: If getKey(1) and (M<4)
:  M+1→M
:  1
: ElseIf getKey(4) and (M>0)
:  M-1→M
:  1
: Else
:  0
: End
: If
:  rref(40,8*M+21,50,9)
:  DispGraph
:  Pause 400
:  rref(40,8*M+21,50,9)
: End
:Fix 0
:Pause 500
:If M=0
: 125→R
:ElseIf M=1
: 080→R
:ElseIf M=2
: 040→R
:ElseIf M=3
: 020→R
: Goto HLP
:If Full
: R*3→R
: rand^27*2+GDB0→M
: 3→{M}
: rand^96→{M+1}
: rand^27*2+58+GDB0→M
: 3→{M}
: rand^96→{M+1}
:While 1
:Pause R
:If getKey(49)
: Return
:If getKey(54)
: -3→θ
: 0→F
:ElseIf getKey(41)
: 3→θ
: 8→F
: 2*I+GDB0→M
: If {M+1}>95 or ({M+1}=0)
:  0→{M}r
: End
: Y+I-6*2+GDB0→M: If X<<0
:  Text(2,14,"Luckily we've got doctors..."
:  Text(5,26,"Otherwise you'd be pretty")
:  Text(32,32,"dead now.")
:  Text(7,57,"Press [ENTER] to restart.")
:  DispGraphClrDraw
:  Repeat getKey:  End
:  If getKey(9)
:   Pause 1000
:   Goto RE
:  End
:  ClrHome
:  Fix 4
:  Return
: ElseIf {M+1}+8+1000>(X+Z+1000) and ({M+1}+1000<(X+992)
:  If {M}<6 and ({M}>2)
:   {M+1}+8→X
:   0→Z
:  End
: ElseIf {M+1}=(X-8)
:  If {M}=3
:   8→Z
:  ElseIf {M}=4
:   10→Z
:  ElseIf {M}=5
:   0→{M}r
:  End
: End
:If X>70 and (X<100)
: X-70→M
: X-M→X
: H+M→H
: For(I,0,63)
:  {I*2+GDB0+1}-M→{I*2+GDB0+1}
: End
: !If rand^20
:  sub(GEN,4,M)
:  H→D
: Else!If rand^15
:  sub(GEN,5,M)
: ElseIf H-D>25
:  sub(GEN,3,0,95)
:  H→D
: End
: If {2*I+GDB0}
:  Pt-On({2*I+GDB0+1},I,8*{2*I+GDB0}+L)
: End
:Lbl GEN
:While {rand^64*2+GDB0→A}
:If r2
: 95-(rand^r2)→{A+1}
: r3→{A+1}
:Lbl HLP
:Fix 1
:Text(42,46,"You lost")
:!If M
: 9→A
:ElseIf M=1
: ClrDraw
: Fix 0
: Text(9,9,"Press the key to go left.")
: DispGraph
: sub(PCK)→{K+2}: Text(66,9,"right.")
: DispGraph
: sub(PCK)→{K+3}: Text(60,9,"quit.           ")
: DispGraph
: sub(PCK)→{K+4}:ElseIf M=2
: 11→A
:ElseIf M=3
: 0→M
: Goto RE
:Text(45,57,"Press a key...")
:Pause 1000
:Repeat getKey
:Goto RE
:Lbl CHS
:Repeat getKey(9)
: If getKey(1) and (M<4)
:  M+1→M
:  1
: ElseIf getKey(4) and (M>0)
:  M-1→M
:  1
: Else
:  0
: End
: If
:  rref(40,8*M+21,50,9)
:  DispGraph
:  Pause 400
:  rref(40,8*M+21,50,9)
: End
:Fix 0
:Pause 500
:Lbl PCK
:Pause 1000
:Repeat getKey

TI Z80 / DionJump: a DoodleJump clone for the calcs
« on: March 12, 2011, 09:03:31 am »
I've made too, with Axe (where is my cheerleader smiley? ;D)

Uploaded it

Introduce Yourself! / Hello everybody
« on: March 11, 2011, 04:12:27 pm »
A little introduction.
I started programming in Axe about three months ago, and haven't written a single line of TI-BASIC since then. I am also able to program in some computer languages: Java, PHP, (a little bit) C, (X)HTML and JS, but those two aren't really computer languages. I live in the Netherlands, so if I make any language mistakes, correct me.
I have written a Doodle Jump clone called DionJump in Axe. Currently I'm adding functions to it. I'm also making a clone of Angry Birds, but that one isn't doing anything useful yet.

I hope I'm going to learn much here.


Edit1: added the word "language"
Edit2: whoa, got some sort of ninja'd on my FIRST post :o

Pages: [1]