Pong-MBR

所属分类:磁盘编程
开发工具:Others
文件大小:7KB
下载次数:0
上传日期:2012-08-02 04:25:45
上 传 者sh-1993
说明:  我已经有一段时间没有玩x86 asm了,为什么不看看我是否可以制作一个玩Pong的MBR
(I haven t played with x86 asm for a while so why not see if I can make an MBR that plays Pong)

文件列表:
pongmbr-timer.nasm (7877, 2012-08-02)
pongmbr.nasm (7601, 2012-08-02)

Pong-MBR ======== I haven't played with x86 asm for a while so why not see if I can make an MBR that plays Pong? For two human players, first to 9 points wins. Controls: - Player 1 - W: move paddle up - S: move paddle down - Player 2 - O: move paddle up - L: move paddle down Compile with NASM (`nasm pongmbr.nasm`). Either install to the boot sector (`dd if=pongmbr of=/path/to/disk bs=512 count=1`) and boot or test with QEMU (`qemu-system-i386 pongmbr`). Note that installing the MBR will destroy what is currently there including the partition table so beware. Speed is controlled via the THROTTLE macro. The default is set to 0x2f22 because this arbitrarily seemed a good speed on my test setup (QEMU on a fairly minimal Arch install on an Eee PC 901). Different computers are different so I suggest adjusting the throttle and recompiling if the game runs too fast or too slow for your computer. Larger throttles slow down the game; smaller throttles speed it up. An experimental alternate version (pongmbr-timer.nasm) replaces the cpu-speed-dependent throttle with a timer-based approach based on real time rather than CPU cycles. It works in QEMU but it failed my VirtualBox test so I am providing it as an alternate alongside the usable version until I determine the error. See README-timer.md for more information about that version. While this code should work on most modern x86 machines it has so far only been tested with QEMU and VirtualBox no guarantees are made about portability.

近期下载者

相关文件


收藏者