Skip to content

Instantly share code, notes, and snippets.

@graphitemaster
Created July 19, 2013 22:30
Show Gist options
  • Select an option

  • Save graphitemaster/6042801 to your computer and use it in GitHub Desktop.

Select an option

Save graphitemaster/6042801 to your computer and use it in GitHub Desktop.
Cubescript Magic
emu_rom = [
0x22 0xFC 0x6B 0x0C 0x6C 0x3F 0x6D 0x0C 0xA2 0xEA 0xDA 0xB6 0xDC 0xD6 0x6E 0x00 0x22 0xD4 0x66 0x03 0x68
0x02 0x60 0x60 0xF0 0x15 0xF0 0x07 0x30 0x00 0x12 0x1A 0xC7 0x17 0x77 0x08 0x69 0xFF 0xA2 0xF0 0xD6 0x71
0xA2 0xEA 0xDA 0xB6 0xDC 0xD6 0x60 0x01 0xE0 0xA1 0x7B 0xFE 0x60 0x04 0xE0 0xA1 0x7B 0x02 0x60 0x1F 0x8B
0x02 0xDA 0xB6 0x60 0x0C 0xE0 0xA1 0x7D 0xFE 0x60 0x0D 0xE0 0xA1 0x7D 0x02 0x60 0x1F 0x8D 0x02 0xDC 0xD6
0xA2 0xF0 0xD6 0x71 0x86 0x84 0x87 0x94 0x60 0x3F 0x86 0x02 0x61 0x1F 0x87 0x12 0x46 0x00 0x12 0x78 0x46
0x3F 0x12 0x82 0x47 0x1F 0x69 0xFF 0x47 0x00 0x69 0x01 0xD6 0x71 0x12 0x2A 0x68 0x02 0x63 0x01 0x80 0x70
0x80 0xB5 0x12 0x8A 0x68 0xFE 0x63 0x0A 0x80 0x70 0x80 0xD5 0x3F 0x01 0x12 0xA2 0x61 0x02 0x80 0x15 0x3F
0x01 0x12 0xBA 0x80 0x15 0x3F 0x01 0x12 0xC8 0x80 0x15 0x3F 0x01 0x12 0xC2 0x60 0x20 0xF0 0x18 0x22 0xD4
0x8E 0x34 0x22 0xD4 0x66 0x3E 0x33 0x01 0x66 0x03 0x68 0xFE 0x33 0x01 0x68 0x02 0x12 0x16 0x79 0xFF 0x49
0xFE 0x69 0xFF 0x12 0xC8 0x79 0x01 0x49 0x02 0x69 0x01 0x60 0x04 0xF0 0x18 0x76 0x01 0x46 0x40 0x76 0xFE
0x12 0x6C 0xA2 0xF2 0xFE 0x33 0xF2 0x65 0xF1 0x29 0x64 0x14 0x65 0x02 0xD4 0x55 0x74 0x15 0xF2 0x29 0xD4
0x55 0x00 0xEE 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x00 0x00 0x00 0x00 0x00 0xC0 0xC0 0xC0 0x00 0xFF 0x00
0x6B 0x20 0x6C 0x00 0xA2 0xF6 0xDB 0xC4 0x7C 0x04 0x3C 0x20 0x13 0x02 0x6A 0x00 0x6B 0x00 0x6C 0x1F 0xA2
0xFA 0xDA 0xB1 0xDA 0xC1 0x7A 0x08 0x3A 0x40 0x13 0x12 0xA2 0xF6 0x6A 0x00 0x6B 0x20 0xDB 0xA1 0x00 0xEE
]
emu_font = [
0xF0 0x90 0x90 0x90 0xF0 0x20 0x60 0x20 0x20 0x70 0xF0 0x10 0xF0 0x80 0xF0 0xF0 0x10 0xF0 0x10 0xF0
0x90 0x90 0xF0 0x10 0x10 0xF0 0x80 0xF0 0x10 0xF0 0xF0 0x80 0xF0 0x90 0xF0 0xF0 0x10 0x20 0x40 0x40
0xF0 0x90 0xF0 0x90 0xF0 0xF0 0x90 0xF0 0x10 0xF0 0xF0 0x90 0xF0 0x90 0x90 0xE0 0x90 0xE0 0x90 0xE0
0xF0 0x80 0x80 0x80 0xF0 0xE0 0x90 0x90 0x90 0xE0 0xF0 0x80 0xF0 0x80 0xF0 0xF0 0x80 0xF0 0x80 0x80
]
emu_mem = [
loop i $arg2 [
[emu_@[arg1]@i] = 0
]
]
emu_debug = 1 // 0 to turn off debug messages
emu_loaded = 0
emu_out = [
if ($emu_debug) [
echo (format "[chip8] %1" $arg1)
]
]
emu_init = [
emu_pc = 512
emu_opcode = 0
emu_index = 0
emu_sp = 0
emu_mem framebuffer 2048 // 2048 pixels
emu_mem memory 4096 // 4096K ram
emu_mem stack 16 // 16 stack levels
emu_mem registers 16 // 16 registers
emu_mem keys 16 // 2 key pads 8 buttons each
// draw flag
emu_draw = 1
// copy memory
loop i 80 [ [emu_memory@i] = (at $emu_font $i) ]
loop i (listlen $emu_rom) [ [emu_memory@(+ 512 $i)] = (at $emu_rom $i) ]
emu_timer_delay = 0
emu_timer_sound = 0
emu_out "initialized"
emu_loaded = 1
]
// beginning instruction 0
emu_exec_0 = [
case (& $emu_opcode 0x000F) 0 [
// clear screen
loop i 2048 [ [emu_framebuffer@i] = 0 ]
emu_pc = (+ $emu_pc 2)
emu_draw = 1
emu_out "clear screen"
] 14 [
// return from subroutine
emu_sp = (- $emu_sp 1)
emu_pc = $[emu_stack@emu_sp]
emu_pc = (+ $emu_pc 2)
emu_out "return from subroutine"
] () [
emu_out "invalid opcode"
]
]
// jump to address
emu_exec_4096 = [
emu_pc = (& $emu_opcode 0x0FFF)
emu_out "jump to address"
]
// call subroutine
emu_exec_8192 = [
[emu_stack@emu_sp] = $emu_pc
emu_sp = (+ $emu_sp 1)
emu_pc = (& $emu_opcode 0x0FFF)
emu_out (format "call subroutine %1" $emu_pc)
]
// skip next instruction if VX == NN
emu_exec_12288 = [
if (= $[emu_registers@(>> (& $emu_opcode 0x0F00) 8)] (& $emu_opcode 0x00FF)) [
emu_pc = (+ $emu_pc 4)
] [
emu_pc = (+ $emu_pc 2)
]
emu_out "skip next instruction if(VX == NN)"
]
// skip next instruction if VX != NN
emu_exec_16384 = [
if (!= $[emu_registers@(>> (& $emu_opcode 0x0F00) 8)] (& $emu_opcode 0x00FF)) [
emu_pc = (+ $emu_pc 4)
] [
emu_pc = (+ $emu_pc 2)
]
emu_out "skip next instruction if(VX != NN)"
]
// skip next instruction if VX == VY
emu_exec_20480 = [
if (= $[emu_registers@(>> (& $emu_opcode 0x0F00) 8)] $[emu_registers@(>> (& $emu_opcode 0x00F0) 4)]) [
emu_pc = (+ $emu_pc 4)
] [
emu_pc = (+ $emu_pc 2)
]
emu_out "skip next instruction if(VX == VY)"
]
// VX = NN
emu_exec_24576 = [
[emu_registers@(>> (& $emu_opcode 0x0F00) 8)] = (& $emu_opcode 0x00FF)
emu_pc = (+ $emu_pc 2)
emu_out "VX = NN"
]
// VX += NN
emu_exec_28672 = [
[emu_registers@(>> (& $emu_opcode 0x0F00) 8)] = (+ $[emu_registers@(>> (& $emu_opcode 0x0F00) 8)] (& $emu_opcode 0x00FF))
emu_pc = (+ $emu_pc 2)
emu_out "VX += NN"
]
emu_exec_32768 = [
case (& $emu_opcode 0x000F) 0 [ // VX = VY
[emu_registers@(>> (& $emu_opcode 0x0F00) 8)] = $[emu_registers@(>> (& $emu_opcode 0x00F0) 4)]
emu_pc = (+ $emu_pc 2)
emu_out "VX = VY"
] 1 [ // VX |= VY
[emu_registers@(>> (& $emu_opcode 0x0F00) 8)] = (| $[emu_registers@(>> (& $emu_opcode 0x0F00) 8)] $[emu_registers@(>> (& $emu_opcode 0x00F0) 4)])
emu_pc = (+ $emu_pc 2)
emu_out "VX |= VY"
] 2 [ // VX &= VY
[emu_registers@(>> (& $emu_opcode 0x0F00) 8)] = (& $[emu_registers@(>> (& $emu_opcode 0x0F00) 8)] $[emu_registers@(>> (& $emu_opcode 0x00F0) 4)])
emu_pc = (+ $emu_pc 2)
emu_out "VX &= VY"
] 3 [ // VX ^= VY
[emu_registers@(>> (& $emu_opcode 0x0F00) 8)] = (^ $[emu_registers@(>> (& $emu_opcode 0x0F00) 8)] $[emu_registers@(>> (& $emu_opcode 0x00F0) 4)])
emu_pc = (+ $emu_pc 2)
emu_out "VX ^= VY"
] 4 [ // Adds VY to VX. VF is set to 1 when there's a carry, and to 0 when there isn't
if (> $[emu_registers@(>> (& $emu_opcode 0x00F0) 4)] (- 255 $[emu_registers@(>> (& $emu_opcode 0x0F00) 8)])) [
emu_registers15 = 1 // carry
] [
emu_registers15 = 0
]
[emu_registers@(>> (& $emu_opcode 0x0F00) 8)] = (+ $[emu_registers@(>> (& $emu_opcode 0x0F00) 8)] $[emu_registers@(>> (& $emu_opcode 0x00F0) 4)])
emu_pc = (+ $emu_pc 2)
emu_out "VX += VY"
] 5 [ // VY is subtracted from VX. VF is set to 0 when there's a borrow, and 1 when there isn't
if (> $[emu_registers@(>> (& $emu_opcode 0x00F0) 4)] $[emu_registers@(>> (& $emu_opcode 0x0F00) 8)]) [
emu_registers15 = 0 // borrow
] [
emu_registers15 = 1
]
[emu_registers@(>> (& $emu_opcode 0x0F00) 8)] = (- $[emu_registers@(>> (& $emu_opcode 0x0F00) 8)] $[emu_registers@(>> (& $emu_opcode 0x00F0) 4)])
emu_pc = (+ $emu_pc 2)
emu_out "VX -= VY"
] 6 [ // 0x8XY6: Shifts VX right by one. VF is set to the value of the least significant bit of VX before the shift
emu_registers15 = (& $[emu_registers@(>> (& $emu_opcode 0x0F00) 8)] 1)
[emu_registers@(>> (& $emu_opcode 0x0F00) 8)] = (>> $[emu_registers@(>> (& $emu_opcode 0x0F00) 8)] 1)
emu_pc = (+ $emu_pc 2)
emu_out "VX >>= 1"
]
// last two since 8 arg limit
if (= (& $emu_opcode 0x000F) 7) [
// Sets VX to VY minus VX. VF is set to 0 when there's a borrow, and 1 when there isn't
if (> $[emu_registers@(>> (& $emu_opcode 0x0F00) 8)] $[emu_registers@(>> (& $emu_opcode 0x00F0) 4)]) [
emu_registers15 = 0
] [
emu_registers15 = 1
]
[emu_registers@(>> (& $emu_opcode 0x0F00) 8)] = (- $[emu_registers@(>> (& $emu_opcode 0x00F0) 4)] $[emu_registers@(>> (& $emu_opcode 0x0F00) 8)])
emu_pc = (+ $emu_pc 2)
emu_out "VX = VY-VX"
] [
emu_registers15 = (>> $[emu_registers@(>> (& $emu_opcode 0x0F00) 8)] 7)
[emu_registers@(>> (& $emu_opcode 0x0F00) 8)] = (<< $[emu_registers@(>> (& $emu_opcode 0x0F00) 8)] 1)
emu_pc = (+ $emu_pc 2)
emu_out "VX <<= 1"
]
emu_out "WHAT THE FUCK TITTIES"
]
// skips the next instruction if VX != VY
emu_exec_36864 = [
if (!= $[emu_registers@(>> (& $emu_opcode 0x0F00) 8)] $[emu_registers@(>> (& $emu_opcode 0x00F0) 4)]) [
emu_pc = (+ $emu_pc 4)
] [
emu_pc = (+ $emu_pc 2)
]
emu_out "skip next instruction if(VX != VY)"
]
// I = &NNN (address of)
emu_exec_40960 = [
emu_index = (& $emu_opcode 0x0FFF)
emu_pc = (+ $emu_pc 2)
emu_out "I = &NNN"
]
// jumps to address NNN + V0
emu_exec_45056 = [
emu_pc = (+ (& $emu_opcode 0x0FFF) $emu_registers0)
emu_out "JUMP *(NNN + V0)"
]
// VX = rand NN
emu_exec_49152 = [
[emu_registers@(>> (& $emu_opcode 0x0F00) 8)] = (& (rnd 0 255) 0x00FF)
emu_pc = (+ $emu_pc 2)
emu_out "VX = rand NN"
]
// draw pixel to framebuffer
emu_exec_53248 = [
local x y h p
x = (mod $[emu_registers@(>> (& $emu_opcode 0x0F00) 8)] 64)
y = (mod $[emu_registers@(>> (& $emu_opcode 0x00F0) 4)] 32)
h = (& $emu_opcode 0x000F)
emu_registers15 = 0
loop yline $h [
p = $[emu_memory@(+ $emu_index $yline)]
loop xline 8 [
if (!= (& $p (>> 0x80 $xline)) 0) [
if (= $[emu_framebuffer@(+ $x $xline (* (+ $y $yline) 64))] 1) [
emu_registers15 = 1
]
[emu_framebuffer@(+ $x $xline (* (+ $y $yline) 64))] = (^ $[emu_framebuffer@(+ $x $xline (* (+ $y $yline) 64))] 1)
]
]
]
emu_pc = (+ $emu_pc 2)
emu_draw = 1
]
emu_exec_57344 = [
case (& $emu_opcode 0x00FF) 0x009E [
// Skips the next instruction if the key stored in VX is pressed
if (!= $[emu_keys@[emu_registers@(>> (& $emu_opcode 0x0F00) 8)]] 0) [
emu_pc = (+ $emu_pc 4)
] [
emu_pc = (+ $emu_pc 2)
]
emu_out "skip instruction if key in VX is pressed"
] 0x00A1 [
// Skips the next instruction if the key stored in VX isn't pressed
if (= $[emu_keys@[emu_registers@(>> (& $emu_opcode 0x0F00) 8)]] 0) [
emu_pc = (+ $emu_pc 4)
] [
emu_pc = (+ $emu_pc 2)
]
emu_out "skip instruction if key in VX isn't pressed"
] () [
emu_out "invalid opcode"
]
]
// Sets VX to the value of the delay timer
emu_exec_61440_7 = [
[emu_registers@(>> 8 (& $emu_opcode 0x0F00))] = $emu_timer_delay
emu_pc = (+ $emu_pc 2)
emu_out "VX = timer_delay"
]
// A key press is awaited, and then stored in VX
emu_exec_61440_10 = [
local press = 0
loop i 16 [
if (!= $[emu_keys@i] 0) [
[emu_registers@(>> (& $emu_opcode 0x0F00) 8)] = $i
press = 1
]
]
if ($keypress) [
emu_pc = (+ $emu_pc 2)
]
emu_out "key press is awaited"
]
// Sets the delay timer to VX
emu_exec_61440_21 = [
emu_timer_delay = $[emu_registers@(>> (& $emu_opcode 0x0F00) 8)]
emu_pc = (+ $emu_pc 2)
emu_out "timer_delay = VX"
]
// Sets the sound timer to VX
emu_exec_61440_24 = [
emu_timer_sound = $[emu_registers@(>> (& $emu_opcode 0x0F00) 8)]
emu_pc = (+ $emu_pc 2)
emu_out "timer_sound = VX"
]
// Adds VX to I
emu_exec_61440_30 = [
// VF is set to 1 when range overflow (I+VX>0xFFF), and 0 when there isn't.
if (> (+ $emu_index $[emu_registers@(>> (& $emu_opcode 0x0F00) 8)]) 0xFFF) [
emu_registers15 = 1
] [
emu_registers15 = 0
]
emu_index = (+ $emu_index $[emu_registers@(>> (& $emu_opcode 0xF00) 8)])
emu_pc = (+ $emu_pc 2)
emu_out "I += VX"
]
// Sets I to the location of the sprite for the character in VX. Characters 0-F (in hexadecimal) are represented by a 4x5 font
emu_exec_61440_41 = [
emu_index = (* $[emu_registers@(>> (& $emu_opcode 0x0F00) 8)] 5)
emu_pc = (+ $emu_pc 2)
emu_out "set I to location of sprite for character in VX"
]
// Stores the Binary-coded decimal representation of VX at the addresses I, I plus 1, and I plus 2
emu_exec_61440_51 = [
[emu_memory@(+ $emu_index 0)] = (div $[emu_registers@(>> (& $emu_opcode 0x0F00) 8)] 100)
[emu_memory@(+ $emu_index 1)] = (mod (div $[emu_registers@(>> (& $emu_opcode 0x0F00) 8)] 10) 10)
[emu_memory@(+ $emu_index 2)] = (mod (mod $[emu_registers@(>> (& $emu_opcode 0x0F00) 8)] 100) 10)
emu_pc = (+ $emu_pc 2)
emu_out "BCD memcpy"
]
// Stores V0 to VX in memory starting at address I
emu_exec_61440_85 = [
loop i (+ (>> (& $emu_opcode 0x0F00) 8) 1) [
[emu_memory@(+ $emu_index $i)] = $[emu_registers@i]
]
// when the operation is done, I = I + X + 1.
emu_index = (+ $emu_index (>> (& $emu_opcode 0x0F00) 8) 1)
emu_pc = (+ $emu_pc 2)
emu_out "V0->VX memcpy (memory)"
]
// Fills V0 to VX with values from memory starting at address I
emu_exec_61440_101 = [
loop i (+ (>> (& $emu_opcode 0x0F00) 8) 1) [
[emu_registers@i] = $[emu_memory@(+ $emu_index $i)]
]
// When the operation is done, I = I + X + 1.
emu_index = (+ $emu_index (>> (& $emu_opcode 0x0F00) 8) 1)
emu_pc = (+ $emu_pc 2)
emu_out "VO->VX memcpy (registers)"
]
emu_exec_61440 = [
[emu_exec_61440_@(& $emu_opcode 0x00FF)]
]
emu_cycle = [
// fetch / decode
emu_opcode = (mod (| (<< $[emu_memory@emu_pc] 8) $[emu_memory@(+ $emu_pc 1)]) 0x10000)
// execute the opcode
[emu_exec_@(& $emu_opcode 0xF000)]
// timers
if (> $emu_timer_delay 0) [
if (= $emu_timer_delay 1) [
// play the sound
sound 1
]
emu_timer_delay = (- $emu_timer_delay 1)
]
]
emu_unload = [
emu_loaded = 0
]
emu_load = [
if (= $emu_loaded 0) [
emu_init
emu_loaded = 1
]
]
emu_render = [
if (= $emu_draw 1) [
loop y 32 [
guilist [
loop x 64 [
if (= $[emu_framebuffer@(+ (* $y 64) $x)] 0) [
guiimage "textures/black.png" 0 30
] [
guiimage "textures/white.png" 0 30
]
]
]
]
]
]
newgui "chip8" [
emu_load
emu_cycle
emu_render
]
// hello world SQ binary
subleq_loaded = 0
subleq_run = 0
subleq_text = " !^"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^^_`abcdefghijklmnopqrstuvwxyz{|}~"
// this C code:
// int putchar(int c);
// const char *p="q66, RaZgRiZ it works!";
// int main() {
// while(*p) putchar(*p++);
// }
// compiled into this:
subleq_program = [
0 0 599 635 663 666 7 19 19 10 666 19 13 20 20 16 666 20 19 0 0 22 29 29 25 666 29 28 665 0 31 665 665 34 666 665 37 663 666 40 52 52 43 666 52 46 53 53 49
666 53 52 0 0 55 62 62 58 666 62 61 658 0 64 663 666 67 79 79 70 666 79 73 80 80 76 666 80 79 0 0 82 89 89 85 666 89 88 659 0 91 663 666 94 106 106 97 666 106
100 107 107 103 666 107 106 0 0 109 116 116 112 666 116 115 660 0 118 658 658 121 659 659 124 136 136 127 3 662 130 662 136 133 662 662 136 0 658 139 658 659
142 658 658 145 659 662 148 662 658 154 662 662 163 662 662 157 659 658 160 659 658 163 662 658 272 658 658 169 3 662 172 662 658 175 662 662 178 661 3 181
659 659 184 660 660 187 199 199 190 658 662 193 662 199 196 662 662 199 0 659 202 659 660 205 663 666 208 220 220 211 666 220 214 221 221 217 666 221 220 0 0
223 233 233 226 666 233 229 660 662 232 662 0 235 662 662 238 663 666 241 253 253 244 666 253 247 254 254 250 666 254 253 0 0 256 263 263 259 666 263 262 265
0 353 266 633 666 269 662 662 118 281 281 275 666 281 278 660 660 281 0 660 284 661 666 287 296 296 290 666 296 293 659 659 296 0 659 299 661 666 302 311 311
305 666 311 308 658 658 311 0 658 314 661 666 317 666 666 320 665 666 323 332 332 326 666 332 329 665 665 332 0 665 335 661 666 338 347 347 341 666 347 344
352 352 347 0 352 350 662 662 0 663 666 356 368 368 359 666 368 362 369 369 365 666 369 368 0 0 371 378 378 374 666 378 377 665 0 380 665 665 383 666 665 386
663 666 389 401 401 392 666 401 395 402 402 398 666 402 401 0 0 404 411 411 407 666 411 410 658 0 413 663 666 416 428 428 419 666 428 422 429 429 425 666 429
428 0 0 431 438 438 434 666 438 437 659 0 440 663 666 443 455 455 446 666 455 449 456 456 452 666 456 455 0 0 458 465 465 461 666 465 464 660 0 467 658 658 470
659 659 473 665 658 476 633 658 479 658 659 482 658 658 485 660 660 488 500 500 491 659 662 494 662 500 497 662 662 500 0 658 503 658 660 506 660 -1 509 664 664
512 660 664 515 662 662 518 527 527 521 666 527 524 660 660 527 0 660 530 661 666 533 542 542 536 666 542 539 659 659 542 0 659 545 661 666 548 557 557 551 666
557 554 658 658 557 0 658 560 661 666 563 666 666 566 665 666 569 578 578 572 666 578 575 665 665 578 0 665 581 661 666 584 593 593 587 666 593 590 598 598 593
0 598 596 662 662 0 663 666 602 614 614 605 666 614 608 615 615 611 666 615 614 0 0 617 624 624 620 666 624 623 626 0 4 627 661 666 630 662 662 -1 -2 0 113 54
54 44 32 82 97 90 103 82 105 90 32 105 116 32 119 111 114 107 115 33 0 0 0 0 -1 0 1 0 0 -666
]
subleq_mem = [
loop i $arg2 [
[subleq_@[arg1]@i] = 0
]
]
subleq_init = [
subleq_ip = 0
subleq_mem memory 16000
loop i (listlen $subleq_program) [
[subleq_memory@i] = (at $subleq_program $i)
]
subleq_loaded = 1
subleq_run = 1
]
subleq_output = ""
subleq_cycle = [
local a b c
if (= $subleq_loaded 0) [
subleq_init
]
if (= $subleq_run 1) [
a = $[subleq_memory@subleq_ip]
b = $[subleq_memory@(+ $subleq_ip 1)]
c = $[subleq_memory@(+ $subleq_ip 2)]
subleq_ip = (+ $subleq_ip 3)
if (&& (= -1 $a) (= -1 $b)) [
// input
] [
if (= $a -1) [
[subleq_memory@b] = (- $[subleq_memory@b] 1)
if (<= $[subleq_memory@b] 0) [
subleq_ip = $c
]
] [
if (= $b -1) [
if (= $[subleq_memory@a] 10) [
echo $subleq_output
subleq_output = ""
] [
subleq_output = (concat $subleq_output (substr $subleq_text (- $[subleq_memory@a] 32) 1))
]
] [
[subleq_memory@b] = (- $[subleq_memory@b] $[subleq_memory@a])
if (<= $[subleq_memory@b] 0) [
subleq_ip = $c
]
]
]
]
if (< $subleq_ip 0) [
subleq_run = 0
// finish flush output
echo $subleq_output
]
]
]
subleq_execute = [
subleq_cycle
while $subleq_run [
subleq_cycle
]
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment