Skip to content

Commit

Permalink
Update rdemo
Browse files Browse the repository at this point in the history
  • Loading branch information
bryce-carson committed Nov 7, 2024
1 parent b7bb13a commit 29c259a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 19 deletions.
2 changes: 1 addition & 1 deletion build/assets/rdemo.tic.dat
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0x78, 0xda, 0xbd, 0x54, 0x5d, 0x4f, 0xdb, 0x30, 0x14, 0xdd, 0xcb, 0x34, 0x29, 0xbf, 0xe2, 0x0e, 0x84, 0x94, 0x8c, 0x52, 0x9c, 0x38, 0x5f, 0xcd, 0xd8, 0x24, 0xc4, 0x8a, 0x86, 0xd6, 0x8d, 0x09, 0xba, 0xb1, 0x87, 0x3d, 0xd4, 0x71, 0x6c, 0x1a, 0x11, 0x92, 0x28, 0x71, 0xa1, 0xd5, 0xc4, 0x7f, 0x9f, 0xed, 0x24, 0x2d, 0x2d, 0x6c, 0xda, 0x24, 0xc4, 0xad, 0xd2, 0xeb, 0x73, 0xbf, 0xce, 0x89, 0x7b, 0xd5, 0x97, 0x77, 0xaf, 0x5e, 0x6c, 0x6f, 0x83, 0x48, 0x45, 0xc6, 0x22, 0x00, 0xb8, 0x24, 0xd7, 0xac, 0x41, 0x86, 0x0c, 0x93, 0x99, 0x98, 0x16, 0x55, 0xd4, 0x86, 0x13, 0x76, 0xc3, 0xb2, 0xa2, 0x64, 0x55, 0x0f, 0xd8, 0x35, 0x49, 0x33, 0xe9, 0x04, 0xed, 0xab, 0xba, 0x84, 0xd5, 0x54, 0x75, 0x43, 0x2d, 0xcb, 0x85, 0x86, 0x55, 0x5a, 0x8a, 0xb4, 0xc8, 0x55, 0xb6, 0x4e, 0x85, 0x9e, 0x0d, 0xb7, 0x2c, 0x56, 0x67, 0xc8, 0xd2, 0xfc, 0x4a, 0x25, 0xb2, 0x94, 0xb2, 0xbc, 0x96, 0xb9, 0xcf, 0x27, 0x63, 0x18, 0x35, 0x00, 0x4c, 0x3a, 0x25, 0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0xd5, 0xd4, 0xf6, 0xbf, 0xe0, 0xf4, 0xf0, 0xe8, 0xe3, 0xfa, 0xa3, 0x59, 0x8f, 0xf2, 0x52, 0xba, 0xd5, 0xe9, 0x46, 0xff, 0x06, 0xe8, 0xf2, 0x0a, 0xeb,
17 changes: 8 additions & 9 deletions demos/rdemo.r
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,22 @@ t <- 0
x <- 96
y <- 24

makeopfn <- \(f) \(x) eval.parent(substitute(x <- f(x, 1)))
inc <- makeopfn(`+`)
dec <- makeopfn(`-`)
inc <- \(x) eval.parent(substitute(x <- x + 1))
dec <- \(x) eval.parent(substitute(x <- x - 1))

`TIC-80` <- function() {
mapply(FUN = \(b, o) if (.External("t80.btn", b)) o,
mapply(\(b, o) if (.External("btn", b)) eval(o, .GlobalEnv),
0:3,
list(dec(y), inc(y),
dec(x), inc(x)));
.External("t80.cls", 13);
.External("t80.spr",
list(quote(dec(y)), quote(inc(y)),
quote(dec(x)), quote(inc(x))));
.External("cls", 13);
.External("spr",
id = 1 + (t %% 60) / 30 * 2,
scale = 3,
x, y,
colorkey = 14,
w = 2, h = 2);
.External("t80.print", "HELLO WORLD!", 84, 84);
.External("print", "HELLO WORLD!", 84, 84);
inc(t);
}

Expand Down
17 changes: 8 additions & 9 deletions src/api/r.org
Original file line number Diff line number Diff line change
Expand Up @@ -1935,23 +1935,22 @@ convention).
x <- 96
y <- 24

makeopfn <- \(f) \(x) eval.parent(substitute(x <- f(x, 1)))
inc <- makeopfn(`+`)
dec <- makeopfn(`-`)
inc <- \(x) eval.parent(substitute(x <- x + 1))
dec <- \(x) eval.parent(substitute(x <- x - 1))

`TIC-80` <- function() {
mapply(FUN = \(b, o) if (.External("t80.btn", b)) o,
mapply(\(b, o) if (.External("btn", b)) eval(o, .GlobalEnv),
0:3,
list(dec(y), inc(y),
dec(x), inc(x)));
.External("t80.cls", 13);
.External("t80.spr",
list(quote(dec(y)), quote(inc(y)),
quote(dec(x)), quote(inc(x))));
.External("cls", 13);
.External("spr",
id = 1 + (t %% 60) / 30 * 2,
scale = 3,
x, y,
colorkey = 14,
w = 2, h = 2);
.External("t80.print", "HELLO WORLD!", 84, 84);
.External("print", "HELLO WORLD!", 84, 84);
inc(t);
}

Expand Down

0 comments on commit 29c259a

Please sign in to comment.