
Building a Tetris Clone in X86 Assembly, Pt. Ⅰ: Hello, World - raphaelss
https://cmcenroe.me/2015/09/11/tetrasm-1.html
======
userbinator
Tetris seems to be one of those games that people love to size-optimise in
Asm; here's a few in the <512b category:

[http://www.pouet.net/prod.php?which=33942](http://www.pouet.net/prod.php?which=33942)

[http://www.pouet.net/prod.php?which=6951](http://www.pouet.net/prod.php?which=6951)

There was a competition too, based on a standard appearance and behaviour, and
the winner is 363 bytes:

[https://files.scene.org/view/mags/hugi/compos/hc22fin.zip](https://files.scene.org/view/mags/hugi/compos/hc22fin.zip)

Vaguely related; chess game in 487 bytes:

[https://news.ycombinator.com/item?id=8954630](https://news.ycombinator.com/item?id=8954630)

------
cjauvin
It's not 100% related but I had great fun building a very minimal Tetris clone
in 6502 assembly, for the C=64, a couple of years ago (the code is "kinda"
commented):

[https://github.com/cjauvin/tetris-464](https://github.com/cjauvin/tetris-464)

------
akkartik
Is anybody able to get the repo running? 'make qemu' simply shows a blank
screen and exits. But the repo seems much farther along than the blog post.

~~~
programble
The build defaults to debug, so `make qemu` also starts QEMU waiting for a
debugger to attach. `make qemu BUILD=release` won't.

~~~
akkartik
Thanks!

------
pki
there's no comment section there so i'd figure i'd ask here: what is that font
that it outputs? is that part of BIOS or something? or part of boot loader or
PXE server?

i assumed asm was the lowest level, is there some builtin font by default that
can't be changed or something?

~~~
jquast
The default video bios mode is used as-is here,
[https://en.wikipedia.org/wiki/Video_BIOS](https://en.wikipedia.org/wiki/Video_BIOS)

There is no terminal emulator here. This hello world text is written directly
to video memory -- and yes, there is a character rom, so placing a string of
words in memory OR'd with bits set for video attributes (the #defines there)
make it color.

~~~
jquast
Furthermore, see an example of setting the mode explicitly from PC-DOS:
[https://github.com/johannesl/EditANSi/blob/master/ea.asm#L23](https://github.com/johannesl/EditANSi/blob/master/ea.asm#L23)
and
[http://fleder44.net/312/notes/18Graphics/index.html](http://fleder44.net/312/notes/18Graphics/index.html)

