Skip to content

Instantly share code, notes, and snippets.

@taotao54321
taotao54321 / profile.lua
Created September 21, 2018 04:40
ドクターマリオ (FC) 処理量表示luaスクリプト (FCEUX用)
local cycle_start = nil
local cycle_end = nil
local function main()
memory.registerexec(0xB65B, function()
cycle_start = debugger.getcyclescount()
end)
memory.registerexec(0xB65E, function()
cycle_end = debugger.getcyclescount()
end)
@taotao54321
taotao54321 / sound_cycle-chill.log
Created September 20, 2018 14:12
ドクターマリオ (FC) サウンド処理量計測を試みたもの
0 1548
1 2788
2 973
3 974
4 974
5 974
6 973
7 974
8 973
9 973
@taotao54321
taotao54321 / nmi_display.lua
Created August 12, 2018 15:59
ドクターマリオ (FC) NMI戻りアドレス表示 & 色すり替えバグ支援
--[[
ドクターマリオ (FC) NMI戻りアドレス表示 (for FCEUX)
色すり替えが可能な場合、戻りアドレスが緑色で表示し、さらに該当マスを緑
色で囲って表示する。
※色すり替えが可能かどうかの判定は割とアバウトなので、できない場合もあ
りうる。厳密に知りたければ頑張ってアセンブリを読んでください><
--]]
@taotao54321
taotao54321 / bk2tofm2.py
Created August 9, 2018 22:15
ドクターマリオ (FC) 専用 bk2 -> fm2 変換
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""bk2 -> fm2 変換 (ドクターマリオ (FC) 専用)
"""
import io
import re
@taotao54321
taotao54321 / score_add_cycle.log
Created August 9, 2018 12:56
ドクターマリオ スコア加算ルーチンの処理量 (概算値)
#n LOW MED HI
1 121 121 121
2 211 211 211
3 391 404 404
4 764 764 777
5 1484 1510 1536
6 2950 2989 3028
7 2950 2989 3028
8 2950 2989 3028
9 2950 2989 3028
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from tabulate import tabulate
TABLE = (
1, 2, 4, 8, 16, 32, 32, 32, 32, 32,
32, 10, 3, 0, 1, 2, 4, 0, 252, 248,
@taotao54321
taotao54321 / hand.py
Last active August 4, 2018 16:00
NES Dr.Mario hand simulator
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""ドクターマリオ (FC) ツモ&初期配置シミュレータ
使い方:
$ hand.py <level> <rand_idx>
level には 0..20 の値を指定します。
@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