Skip to content

Instantly share code, notes, and snippets.

@taotao54321
taotao54321 / Makefile
Created December 6, 2024 01:42
6502 の除算ルーチンに時々見られる誤りの検証 (NES 用)
.PHONY: all verify clean
CMP := cmp
CA65 := ca65
LD65 := ld65
MKDIR := mkdir
OUT_DIR := build
@taotao54321
taotao54321 / game.py
Created October 20, 2024 18:51
NES Wizardry (J): solver for save glitch TAS
# ゲームロジック関連。
import z3
# 8bit の BitVecVal を返す。
def BYTE(value):
return z3.BitVecVal(value, 8)
# BitVec 変数の範囲制約を返す。
def bitvec_minmax(bv: z3.BitVecRef, min_, max_):
@taotao54321
taotao54321 / DejaVu-text.txt
Created September 7, 2024 18:54
NES Deja Vu (U) text script dump
[PRG 2 $A500]
0 [Text("IT'S CAPSULES. THERE'S NOMEDICINE IN THEM."), Op1F]
1 [Text("YOU'RE IN AN OFFICE. A"), Op1D, Text("DEAD BODY IS SLUMPED OVER"), Op1D, Text("THE DESK. HIS LEFT HAND"), Op1D, Text("GRIPS THE PHONE RECEIVER."), Op1C, Text("THERE APPEARS TO BE"), Op1D, Text("SOMETHING IN HIS POCKET."), Op1F]
2 [Text("YOU'RE INSIDE A MERCEDES"), Op1D, Text("BENZ."), Op1F]
3 [Text("IT'S A PHONE RECEIVER. THECORD HAS BEEN PULLED OUT."), Op1F]
4 [Text("ON THE DESKTOP THERE IS A"), Op1D, Text("POOL OF DRIED BLOOD. THEREIS A DRAWER ON THE OTHER"), Op1D, Text("SIDE OF THE DESK."), Op1F]
5 [Text("IT'S A WALL SAFE WITH A"), Op1D, Text("COMBINATION LOCK."), Op1F]
6 [Text("IT'S AN OLD-FASHIONED"), Op1D, Text("TELEPHONE. THE CORD HANGS"), Op1D, Text("LIMPLY FROM IT."), Op1F]
7 [Text("THROUGH THE WINDOW YOU"), Op1D, Text("HAVE ACCESS TO THE FIRE"), Op1D, Text("ESCAPE."), Op1F]
8 [Text("IT'S A COMMON _2 PENCIL."), Op1F]
@taotao54321
taotao54321 / ExcitingRally-map.lua
Created February 21, 2024 10:30
NES Exciting Rally (a.k.a. Championship Rally): map parts generation script for FCEUX
--[[
エキサイティングラリー (FC) マップ生成スクリプト for FCEUX
T を押すとレースを開始する状態から起動する。
結果は本スクリプトからの相対パス output/map-{block_x}-{block_y}.png として出力される。
結合は別途行うこと。
--]]
local function mem_write_u8(addr, value)
@taotao54321
taotao54321 / cost.lua
Created June 5, 2023 04:46
NES Flipull (v1.0) - a script to examine frame costs for throwing block
--[[
フリップル (FC) 着手の時間コスト調査スクリプト for FCEUX
(投げる位置, 当たる位置) ごとの所要フレームを調べる。
自機が最上段にいる状態で起動すること。
--]]
-- メモリから u8 値を読み取る。
local function mem_read_u8(addr)
return memory.readbyte(addr)
@taotao54321
taotao54321 / hud.lua
Created May 9, 2023 15:14
紫禁城 (FC) HUD script for Mesen
--[[
紫禁城 (FC) HUD script for Mesen
--]]
local function warn(msg)
emu.log(msg)
end
local function mem_read(addr)
return emu.read(addr, emu.memType.cpu)
@taotao54321
taotao54321 / neshawk2subneshawk.lua
Created March 6, 2023 07:50
Plays a NesHawk movie on SubNesHawk
--[[
Plays a NesHawk movie on SubNesHawk.
Set INPUT_PATH, and launch this script (at frame 0).
Power/Reset is not supported.
--]]
-- extract "Input Log.txt" from your NesHawk movie, and put it to the script directory.
-- (or specify an absolute path)
@taotao54321
taotao54321 / phrase-command.txt
Last active February 28, 2023 19:56
DQ1 (FC) 頻出語を表すスクリプトコマンド一覧
0x6D "*「"
0x6E "ローラ「"
0x6F ""
0x70 "ラダトーム"
0x71 "うわさでは"
0x72 "ようこそ"
0x73 "あった"
0x74 "ガライのはか"
0x75 "つたえてくれ"
0x76 "\x42ム\x42ーラ"
@taotao54321
taotao54321 / rat926-20230203.txt
Last active February 27, 2023 14:10
DQ1 太陽の石バグ ログ要約テスト
fetch $03B0: dynamic_script (0xFD)
fetch $00A3: char 'し' (0x15)
write $0707: 0x15
fetch $00A4: char 'の' (0x22)
write $0708: 0x22
fetch $00A5: char 'く' (0x11)
write $0709: 0x11
fetch $00A6: char 'ひ' (0x24)
write $070A: 0x24
fetch $00A7: dakuten (0xF8)
@taotao54321
taotao54321 / ViceProjectDoom-hud.lua
Last active February 11, 2023 20:05
NES Vice Project: Doom HUD script for BizHawk
--[[
NES Vice Project Doom - HUD script for BizHawk
全スキャンライン表示かつウィンドウサイズ 2 倍設定を仮定している。
--]]
-- 現在のセグメントの開始フレームを返す。
--
-- TAStudio 使用時は、直前のマーカーがあればそのフレームを、なければ 0 を返す。
-- TAStudio を使っていない場合は単に 0 を返す。