Skip to content

Instantly share code, notes, and snippets.

@taotao54321
taotao54321 / virus_place.py
Last active August 6, 2018 23:43
NES Dr.Mario virus placement simulator
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""ドクターマリオ (FC) 初期配置シミュレータ
使い方:
$ virus_place.py <level> <rand_idx>
level には 0..20 の値を指定します。
@taotao54321
taotao54321 / rand.py
Created August 3, 2018 00:12
NES Dr.Mario RNG simulator
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
RAND_INI = 0x8988
def BIT(x, i):
return (x>>i) & 1
def rand_update(r):
bit = BIT(r,1) ^ BIT(r,9)
@taotao54321
taotao54321 / calc.py
Last active December 20, 2017 13:18
tatsu calc example bug?
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
import json
from codecs import open
from pprint import pprint
import tatsu
from tatsu.ast import AST
from tatsu.walkers import NodeWalker
@taotao54321
taotao54321 / tblhelper.py
Created December 14, 2017 12:40
Helps to create .tbl files
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Helps to create .tbl files
Write "game.in":
0x30
あいうえお
かきくけこ
@taotao54321
taotao54321 / tblstrings.py
Last active December 14, 2017 10:39
strings(1) with .tbl file
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""strings(1) with .tbl file
Example:
$ tblstrings --tbl game.tbl game.nes
$ tblstrings --tbl game.tbl -tx game.nes # show offsets
@taotao54321
taotao54321 / QuestOfKi-hud.lua
Created February 23, 2017 05:22
NES The Quest of Ki (J) HUD script for FCEUX
----------------------------------------------------------------------
-- NES The Quest of Ki (J) HUD script for FCEUX
--
-- displays position and velocity
----------------------------------------------------------------------
----------------------------------------------------------------------
-- util
----------------------------------------------------------------------
@taotao54321
taotao54321 / cdldump.png
Last active August 24, 2021 11:32
Colorize NES ROM using FCEUX CDL
cdldump.png
# AD&D プールオブレイディアンス (FC) memory map
# =============================================
# 特に断らない限りリトルエンディアン
$00- 雑用
$13 U8 $2000 退避用
$14 U8 $2001 退避用
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""AD&D プールオブレイディアンス (FC) マップデータ画像化
マップデータ(0x400 Byte)から画像を生成する。
TODO:
データの意味が完全にわかってない。扉でないところが扉になったりする。
"""
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""AD&D プールオブレイディアンス (FC) マップデータ切り出し
iNESヘッダなしのROMファイルを食わせると全マップデータを出力する。
"""