News for hackers. Stuff that matters.
Re:Building a Tetris Clone in X86 Assembly, Pt. Ⅰ: Hello, World by userbinator on Friday September 11, 2015 @10:38PM (#10207039)
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=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

Vaguely related; chess game in 487 bytes:

https://news.ycombinator.com/item?id=8954630

Re:Building a Tetris Clone in X86 Assembly, Pt. Ⅰ: Hello, World by cjauvin on Friday September 11, 2015 @07:16PM (#10206642)
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

Re:Building a Tetris Clone in X86 Assembly, Pt. Ⅰ: Hello, World by akkartik on Friday September 11, 2015 @10:45PM (#10207052)
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.
Re:Building a Tetris Clone in X86 Assembly, Pt. Ⅰ: Hello, World by programble on Saturday September 12, 2015 @01:46PM (#10208707)
The build defaults to debug, so `make qemu` also starts QEMU waiting for a debugger to attach. `make qemu BUILD=release` won't.
Re:Building a Tetris Clone in X86 Assembly, Pt. Ⅰ: Hello, World by akkartik on Saturday September 12, 2015 @02:17PM (#10208802)
Thanks!
Re:Building a Tetris Clone in X86 Assembly, Pt. Ⅰ: Hello, World by pki on Friday September 11, 2015 @04:16PM (#10205928)
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?

Re:Building a Tetris Clone in X86 Assembly, Pt. Ⅰ: Hello, World by jquast on Friday September 11, 2015 @04:56PM (#10206130)
The default video bios mode is used as-is here, 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.

Re:Building a Tetris Clone in X86 Assembly, Pt. Ⅰ: Hello, World by jquast on Friday September 11, 2015 @04:58PM (#10206146)
Furthermore, see an example of setting the mode explicitly from PC-DOS: https://github.com/johannesl/EditANSi/blob/master/ea.asm#L23 and http://fleder44.net/312/notes/18Graphics/index.html
Re:Building a Tetris Clone in X86 Assembly, Pt. Ⅰ: Hello, World by userbinator on Friday September 11, 2015 @10:40PM (#10207041)
More detailed article on the text mode:

https://en.wikipedia.org/wiki/VGA-compatible_text_mode

(Many, including me, still consider the original IBM VGA text font to be one of the most well-designed and readable for displaying text.)

Re:Building a Tetris Clone in X86 Assembly, Pt. Ⅰ: Hello, World by programble on Friday September 11, 2015 @04:23PM (#10205973)
It is indeed the default BIOS font. You usually get it when switching to a TTY on Linux, as well.
Re:Building a Tetris Clone in X86 Assembly, Pt. Ⅰ: Hello, World by cnvogel on Sunday September 13, 2015 @04:54AM (#10210755)
But of course nowadays most distributions use KMS and put the consoles in a graphics mode on which the virtual console is emulated.
Re:Building a Tetris Clone in X86 Assembly, Pt. Ⅰ: Hello, World by cnvogel on Sunday September 13, 2015 @04:49AM (#10210748)
Its part of the hardware (emulated by qemu). A VGA card (or any other text mode capable video adapter) will use either a portion of ROM or some part of video memory to hold the font from where its accessed simultaneously to the beam drawing the CRT screen. (Hercules, CGA, EGA, VGA all did this).

In contrast to this, many Unix workstations never implemented such a thing and went directly to graphics framebuffers (SUN cgX framebuffers for the ... Sbus??). For that, of course you have to implement the font rendering in "bios" , or in the case of the sun machine in the OpenFirmware. Slowly.)

Re:Building a Tetris Clone in X86 Assembly, Pt. Ⅰ: Hello, World by thinkpad20 on Friday September 11, 2015 @04:19PM (#10205949)
I haven't read through the tutorial, but I would assume that the programmer does not specify the fonts being used, but rather outputs bytes to stdout. It's the terminal emulator that's running the program that is responsible for displaying those bytes, so that's where things like font would be set.