This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
import dataclasses | |
import pathlib | |
import re | |
OUTPUT_EXTENSION = "txt" | |
@dataclasses.dataclass | |
class Segment: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
write = (z) => process.stdout.write(z); | |
arguments = process.argv.slice(2); | |
arguments.map((o) => { | |
for ( | |
d = Array((e = 99)).fill((i = p = 0)), | |
h = (p) => | |
f ? (d[--e] = i) : ']' != o[i++] && ('[' == o[i] && h(), h()); | |
(f = d[p]), o[i]; | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; see results of nes tetris line scoring math | |
; meant for use on https://skilldrick.github.io/easy6502/ | |
; slightly modified version of the following: | |
; https://github.com/CelestialAmber/TetrisNESDisasm/blob/master/main.asm#L3469-L3515 | |
; pointsTable is normally referenced using x as a pointer. This points to two bytes of zeropage instead | |
define pointsTable0 $11 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; draws a reverse secret grade pattern on the board that's hard to get out of | |
gameModeState_initGameState: | |
jsr actualInit | |
lda #$0 | |
sta player1_vramRow | |
ldy #11 | |
sty generalCounter | |
dey | |
@loop: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Learning some nesfab by playing with this project: | |
https://github.com/fractal161/nestris-recreation/commit/ada04653a89b8670e45679455caae35cb669b215 | |
Changes made to nesfab to compile: | |
diff --git a/src/eval.cpp b/src/eval.cpp | |
index f7c65ac..e8d6f24 100644 | |
--- a/src/eval.cpp | |
+++ b/src/eval.cpp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
const long INVALID = -1; | |
const long MAXOUT = 999999; | |
const long RANGE = 10000; | |
const long POWERS[] = {1, 10, 100, 1000, 10000, 100000, 1000000}; | |
long convertByte(unsigned char *b) { | |
unsigned char bigNybble = *b >> 4; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PentrisSPS: | |
pieces = [ | |
# F/N/Y may be swapped | |
"F", | |
"f", | |
"J", | |
"L", | |
"X", | |
"S", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; assembles with https://github.com/snarfblam/snarfblasm | |
BUTTON_UP = $08 | |
iHoriz = $12 | |
spawnID = $19 | |
cheatActive = $35 | |
newlyPressedButtons_player1 = $F5 | |
chooseNextTetrimino = $98EB | |
gameModeState_startButtonHandling = $A37F |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
logger = logging.getLogger(__name__) | |
pieces = "TJZOSLI" | |
id_to_piece = {i: p for i, p in enumerate(pieces)} | |
orientation_ids = [0x02, 0x07, 0x08, 0x0A, 0x0B, 0x0E, 0x12] | |
def shuffle_rng(rng_hi, rng_lo): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
clears = list(reversed("""4 | |
5 | |
6 | |
10 | |
11 | |
12 | |
16 | |
20 | |
21 | |
22 |
NewerOlder