gfx cleanup, bad random fm instrument generator

This commit is contained in:
Jeremy Penner 2019-08-24 22:37:00 -04:00
parent b1a71e3e35
commit 7d4ba8e802
12 changed files with 22 additions and 6 deletions

View file

@ -94,3 +94,4 @@ array frames
6 defstatic {jeanne}
6 7 2 5 defanim {jeanne-walk}
18 defsingle {phone}
38 defsingle {fridge}

BIN
game.exe

Binary file not shown.

BIN
game.prj

Binary file not shown.

View file

@ -9,7 +9,7 @@ array preview 128 allot
: color! >r dup r@ @ = if drop else r@ ! refresh then rdrop ;
: +sprite! spriteindex spritecount +!cycle refresh ;
: +sprite! spriteindex spritecount +!cycle spriteindex @ . refresh ;
: draw-palette 0 0x11 for i 79 i 3 << drawfatbox next ;

8
jopl.c
View file

@ -1,4 +1,6 @@
#include <dir.h>
#include <stdlib.h>
#include <time.h>
#include "jorth.h"
#include "adlib.h"
#include "kbd.h"
@ -73,6 +75,10 @@ void f_seremit() {
DROP(1);
}
void f_random() {
TOP().i = random(TOP().i);
}
void do_repl(char *exe) {
adlib_init();
@ -89,6 +95,7 @@ void do_repl(char *exe) {
CDEF("key-debounce", kbd_debounce);
CDEF("key-pressed", f_keyWasPressed);
CDEF("key-down", f_keydown);
CDEF("rnd", f_random);
f_loadfile("jopl.jor");
ontick = f_lookupcp("ontick");
timer_setcallback(timer_callback);
@ -145,6 +152,7 @@ void keything() {
}
int main(int argc, char *argv[]) {
// keything();
randomize();
do_repl(argv[0]);
return 0;
}

BIN
jopl.exe

Binary file not shown.

View file

@ -93,6 +93,11 @@ array semitones
fgetc ar-alg adlib!
close ;
: rndbyte 256 rnd dup . ;
: rndop rndbyte rndbyte rndbyte rndbyte rndbyte s" loadop " type loadop ;
: rndinst s" op1 " type op1 rndop s" op2 " type op2 rndop
rndbyte s" ar-alg adlib! " type cr ar-alg adlib! ;
: panic 9 -1 for i voice ! noteoff next ;
var songticks
@ -293,7 +298,8 @@ var stopkeys
: jamkeys
stoponesc voicekeys
' noteon onkeynote
41 key-pressed if noteoff then ;
41 key-pressed if noteoff then
88 key-pressed if rndinst then ;
: jam ' jamkeys dokeys ;

BIN
jopl.prj

Binary file not shown.

View file

@ -1,6 +1,6 @@
#include <stdio.h>
#define MEM_SIZE 16384
#define MEM_SIZE 24576
#define STACK_SIZE 64
#define RSTACK_SIZE 64

View file

@ -4,11 +4,14 @@
15 5 N ' {chair} defentity chair
7 6 N ' {pete-bed} defentity bed
10 9 N ' {phone} defentity e_phone
18 3 N ' {fridge} defentity fridge
table :touch pete say" Yesterday's breakfast is still\on the table."
say" Maybe the day before's too." ;entity
chair :touch pete say" I've had my morning coffee\already." ;entity
bed :touch pete say" I'm not tired yet." ;entity
fridge :touch pete say" Should get some more beer soon." ;entity
e_phone :touch phone :|
s" [don't pick up]"
@ -75,7 +78,7 @@ done |; choose ;entity
:noname
reset-level
:| table yield chair yield bed yield e_phone yield done |; ' entities redefine
:| table yield chair yield bed yield e_phone yield fridge yield done |; ' entities redefine
:|
touch-begin 16 10 2= dup if
move-player 12 8 pete.jor queue-level
@ -85,8 +88,6 @@ then touch-next 11 4 2= dup if
pete say" I'm already dressed."
then touch-next 16 3 2= dup if
pete say" The sink's full of nasty dishes.\I'm not touching them."
then touch-next 18 3 2= dup if
pete say" Should get some more beer soon."
then touch-last |; ' player-touch redefine
s" petehous.map" load-map

Binary file not shown.

Binary file not shown.