Skip to content

Commit 2742a79

Browse files
committed
N20: Reverse-Engineering NES Tetris to add Hard Drop
1 parent 9fd7e4a commit 2742a79

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

content/posts/newsletter-020/index.md

+35
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,41 @@ If needed, a section can be split into subsections with a "------" delimiter.
6868

6969
## Learning Material Updates
7070

71+
### [Reverse-Engineering NES Tetris to add Hard Drop][tetris-hard-drop]
72+
73+
![NES Tetris with Hard Drop and Ghost Piece](tetris-hard-drop.gif) _NES Tetris
74+
with Hard Drop and Ghost Piece_
75+
76+
A [blog post][tetris-hard-drop] describing the process of reverse-engineering
77+
the rendering and input-handling logic in the NES version of Tetris, and using
78+
a [rust embedded domain-specific language][tetris-hard-drop-dsl-example] to
79+
make a [patching tool][tetris-hard-drop-patch-tool] that generates code (6502
80+
machine code) to add hard drop (instantly dropping the current piece) and to
81+
render a ghost piece (the dotted outline showing where the current piece will
82+
land).
83+
84+
The patching tool uses the crate
85+
[mos6502_assembler][tetris-hard-drop-assembler] to specify 6502 assembly in
86+
rust and generate machine code. Many of the reverse-engineering experiments
87+
were done using [this rust NES emulator][tetris-hard-drop-nes-emulator]. The
88+
result is available as an [IPS Patch][tetris-hard-drop-ips-patch].
89+
90+
_Discussions: [Hacker News](https://news.ycombinator.com/item?id=26530604),
91+
[/r/rust](https://reddit.com/r/rust/comments/ma6jqz/using_a_rust_dsl_to_add_hard_drop_to_nes_tetris/)_
92+
93+
[tetris-hard-drop]:
94+
https://www.gridbugs.org/reverse-engineering-nes-tetris-to-add-hard-drop/
95+
[tetris-hard-drop-nes-emulator]:
96+
https://github.com/stevebob/mos6502/tree/master/nes-emulator
97+
[tetris-hard-drop-assembler]:
98+
https://github.com/stevebob/mos6502/tree/master/assembler
99+
[tetris-hard-drop-ips-patch]:
100+
https://github.com/stevebob/mos6502/raw/master/tetris-hard-drop-patcher/tetris-hard-drop.ips
101+
[tetris-hard-drop-patch-tool]:
102+
https://github.com/stevebob/mos6502/tree/master/tetris-hard-drop-patcher
103+
[tetris-hard-drop-dsl-example]:
104+
https://github.com/stevebob/mos6502/blob/master/tetris-hard-drop-patcher/src/main.rs#L23
105+
71106
## Library & Tooling Updates
72107

73108
## Popular Workgroup Issues in Github
Loading

0 commit comments

Comments
 (0)