Log In  

I am doing a little project here and decided to show how the results are going.
The project will be called pico 4 and will run on pico 8. It will have an audio editor (16 audios, eaach one with a length of 8 notes, 16 notes and 16 volumes), a sprite editor (4 colors palette, 16 sprites, 4x4 pixels and a 32x32 screen), a map editor (32x32 tiles) and a code editor (256 tokens, each one fitting on exactly 1 byte). In the end you get 961 bytes in a cartridge and with a little 63 bytes of save (mainly for highscores) it results in 1 kilo byte cartidges.
The objective is to do a mini-console where you can do a minigame in les than 2 hours.
Will be possible to use it in any pico 8 port using of virtual keyboards and some type of external saving (thinking in some type of special qr code or something).
And every editor will be written on the bto language (successive letters of asm) the language I am ending now.
Here the first interpreter. (You need to put the code inside the cart code (last lines inside quotes) 'cause I didn't end the code editor yet lol)

Cart #pico4-5 | 2022-10-12 | Code ▽ | Embed ▽ | No License
5

I will keep updating here.

BTO DOUCMENTATION

Sintax:

    Declaration:
        a = sentence
    Sentences:
        Are like values.
        A number is a sentence, a id is a sentence, a char is a sentence, a function literal  is a sentence and a "function call" is a sentence.
        Sentences can include other sentences inside of them using parenthesis
        Every sentence ends in a;
        Characters are initialized with $c where c is the char you want
        Function literals are code included inside of {}
        Example sentences:
             $a
             $(
             $\e (empty char)
             print 0 0 $a
             sub var 1 (execute the code)
             {sub a 2} (store the code on a string)
             if c {print 0 0 a}

Functions:
    if cond code
    equal a b -> true if both are equal false if not
    print x y str1 str2 str3
    sub a b
    add a b
    str c1 c2 c3 c4... -> gets a lot of characters and put them together in a single string
    strcat s1 s2 -> cats two strings (similar to str)
    strsub s start end -> same as pico 8 but zero idexed
    strlen s
    btn b
    key -> returns the first key pressed on the virtual keyboard on the key queue
    updt fn -> sets the update callback

Built in variables:
    true = 1
    false = 0
    (x emoji) and (o emoji) = same as pico lua


Examples:

    if 0 {print 0 0 2;};
        Doesn't print nothing
    a = 1; if a {print 0 0 (sub a 2;);};
        Prints -1
    print 0 0 (str $L $o $v $e;);
       Prints Love
    if (btn X;) { print 0 0 (key;);};
       If is pressing X, prints the last typed char on the virtual keyboard

P#118911 2022-10-11 18:19 ( Edited 2022-10-12 22:06)

Sorry if wrote something wrong, I am not native and don't have time to correct everything lol

P#118913 2022-10-11 18:21

@biteco8, I am ... questioning ... how you are going to get 8-audio channels out of Pico-8 albeit Pico-4 when its own limitations are set to 4 - and you mentioned it would be coded in Pico-8 ?

P#118916 2022-10-11 19:49

Sorry, I wanted to say that one audio will have a length of 8 notes. Editing...

P#118929 2022-10-11 23:18

Also, I'm ending this interpreter, will be interactive in some hours...

P#118930 2022-10-11 23:19 ( Edited 2022-10-11 23:24)

In that case, @biteco8, I welcome your submission here with eager anticipation ! There have only been a few interpreters written for Pico-8 and outside of Brain-F they have all been pretty complex to code in.

Here is a gold star to encourage you further.

P#118931 2022-10-11 23:33
1

Thanks!
The interpreter itself is finished, was very simple to be true. I waste all the time I was on school today thinking on how to do it the simpler as possible. It's just a lot of words and numbers in sequence, rarely an equal sign or parenthesis. The point now is doing all the functions it needs, but I will discover them while code somethings in that language. For now, I'm ending the virtual keyboard for typing without using the dev kit

P#118932 2022-10-11 23:37 ( Edited 2022-10-11 23:39)

Hi @biteco8:

Yes, I don't believe a cellphone keyboard appears with Pico-8. You will either have to do joystick or rely on stat(31) for input.

I recommend you make it simple if you can. I've always had idea of simple programming languages.

If you understand BASIC, you could have these commands that could be selectable by arrow keys and 🅾️ and ❎ and custom menu:

LET, PRINT/USING/;/, , INPUT, IF/THEN/ELSE/ELSEIF/ENDIF, FOR/STEP/NEXT, CLS, GOTO, GOSUB, RETURN, END.

You can load/save 256-bytes instantly or load/save up to 12288 bytes with a 1-second "busy" animation instilled by Pico-8 when you load/save more than 256-bytes.

If you need help, let me or others know. We're all in this together.

P#118936 2022-10-12 02:05

Lol, I ended the virtual keyboard now. I just think that it can work 'cause you will use just 256 tokens, meaning a 20 minutes coding session. I'm working on a backspace system for the code editor, written in bto. The reason I didn't want to use the dev kit was to run the console in every platform: mobile, handhelds, pc etc. I'm reconsidering it but I will mantain it for now because I show my games to my friends in the mobile most times.

P#118951 2022-10-12 11:45

You've got me really anticipating this thing, @biteco8. Hope to see a release soon - and ability to write code in it ...

P#118994 2022-10-12 22:27

Lol, it almost there. We have the (almost) code editor and the interpreter, just need to put the things together. If you really want to try, load the id and change the last string to have your code there

P#119018 2022-10-13 00:13

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-04-16 23:11:58 | 0.054s | Q:23