mirror of
https://github.com/daniel-e/tetros.git
synced 2025-04-18 16:08:22 +02:00
update
This commit is contained in:
parent
1d5445d1ba
commit
49a3d7cf4d
6 changed files with 219 additions and 12 deletions
18
Makefile
18
Makefile
|
@ -1,15 +1,15 @@
|
|||
all: mbr.img
|
||||
all: tetros.img
|
||||
|
||||
mbr.img: tetros.asm Makefile
|
||||
nasm -d DEBUG -f bin tetros.asm -o mbr.img
|
||||
@echo "size is" `stat -c "%s" mbr.img`
|
||||
@if [ `stat -c "%s" mbr.img` -gt 446 ]; then \
|
||||
tetros.img: tetros.asm Makefile
|
||||
nasm -d DEBUG -f bin tetros.asm -o tetros.img
|
||||
@echo "size is" `stat -c "%s" tetros.img`
|
||||
@if [ `stat -c "%s" tetros.img` -gt 446 ]; then \
|
||||
bash -c 'echo -e "\e[91mOutput exceeded size of 446 bytes.\e[0m"'; \
|
||||
rm -f mbr.img; exit 1; fi
|
||||
nasm -f bin tetros.asm -o mbr.img
|
||||
rm -f tetros.img; exit 1; fi
|
||||
nasm -f bin tetros.asm -o tetros.img
|
||||
|
||||
run:
|
||||
@qemu-system-i386 -drive file=mbr.img,index=0,media=disk,format=raw
|
||||
@qemu-system-i386 -drive file=tetros.img,index=0,media=disk,format=raw
|
||||
|
||||
clean:
|
||||
rm -f mbr.img
|
||||
rm -f tetros.img
|
||||
|
|
16
README.md
16
README.md
|
@ -1,13 +1,18 @@
|
|||
# TetrOS
|
||||
TetrOS is a small *feature rich* Tetris clone which is written in Assembly.
|
||||
It fits completely into a 512 byte boot sector and is executed during the
|
||||
boot sequence. It does not need any existing operating system. TetrOS is its own
|
||||
operating system, hence the suffix OS in its name.
|
||||
boot sequence before any operating system is loaded. It does not need any
|
||||
existing operating system. TetrOS is its own operating system, hence the suffix
|
||||
OS in its name.
|
||||
|
||||
This is how it looks like:
|
||||
|
||||

|
||||
|
||||
And this is how the machine code looks:
|
||||
|
||||

|
||||
|
||||
## Features
|
||||
* Each brick shape has a unique color.
|
||||
* Blinking cursor is not visible.
|
||||
|
@ -21,6 +26,11 @@ This is how it looks like:
|
|||
## Features missing due to size limits
|
||||
* Scores and highscores.
|
||||
* Intro.
|
||||
* Game over message.
|
||||
* Game over message and restart without rebooting.
|
||||
* Show next brick.
|
||||
* Increase speed.
|
||||
|
||||
## Similar projects
|
||||
* https://github.com/dbittman/bootris
|
||||
* https://github.com/Shikhin/tetranglix
|
||||
* http://olivier.poudade.free.fr/src/BootChess.asm
|
||||
|
|
BIN
code.png
Normal file
BIN
code.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 73 KiB |
45
dev/additional_features.asm
Normal file
45
dev/additional_features.asm
Normal file
|
@ -0,0 +1,45 @@
|
|||
; game_over:
|
||||
; mov cx, 10
|
||||
; mov dx, 0x0323
|
||||
; mov bx, 0x8c
|
||||
; mov bp, game_over_msg + 0x7c00
|
||||
; mov ax, 0x1300
|
||||
; int 0x10
|
||||
; xor ax, ax ; wait for keyboard
|
||||
; int 16h
|
||||
; jmp start_tetris
|
||||
|
||||
;game_over_msg: db "GAME OVER!"
|
||||
|
||||
; ==============================================================================
|
||||
|
||||
initial_animation:
|
||||
; call clear_screen
|
||||
; mov ah, 2 ; set cursor position
|
||||
; xor bx, bx
|
||||
; mov dh, 5
|
||||
; mov dl, 10
|
||||
; int 0x10
|
||||
; mov si, message + 0x7c00 ; MBR is loaded at address 0000:7C00
|
||||
initial_animation_next:
|
||||
; cld
|
||||
; lodsb
|
||||
; cmp al, 0
|
||||
; jne initial_animation_do
|
||||
; xor ax, ax ; wait for keyboard
|
||||
; int 16h
|
||||
; ret
|
||||
initial_animation_do:
|
||||
; mov bx, 0x0a ; write character
|
||||
; mov cx, 1
|
||||
; mov ah, 9
|
||||
; int 0x10
|
||||
; call cursor_right
|
||||
; push dx
|
||||
; mov cx, 2 ; wait 2x65536 microseconds
|
||||
; xor dx, dx
|
||||
; call wait_abit
|
||||
; pop dx
|
||||
; jmp initial_animation_next
|
||||
|
||||
;message: db "Let's play tetris ...", 0
|
152
dev/bricks.txt
Normal file
152
dev/bricks.txt
Normal file
|
@ -0,0 +1,152 @@
|
|||
.X..
|
||||
.X..
|
||||
.X..
|
||||
.X..
|
||||
|
||||
XXXX
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.X..
|
||||
.X..
|
||||
.X..
|
||||
.X..
|
||||
|
||||
XXXX
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
====
|
||||
|
||||
..X.
|
||||
..X.
|
||||
.XX.
|
||||
....
|
||||
|
||||
XXX.
|
||||
..X.
|
||||
....
|
||||
....
|
||||
|
||||
.XX.
|
||||
.X..
|
||||
.X..
|
||||
....
|
||||
|
||||
X...
|
||||
XXX.
|
||||
....
|
||||
....
|
||||
|
||||
====
|
||||
|
||||
.X..
|
||||
.X..
|
||||
.XX.
|
||||
....
|
||||
|
||||
..X.
|
||||
XXX.
|
||||
....
|
||||
....
|
||||
|
||||
.XX.
|
||||
..X.
|
||||
..X.
|
||||
....
|
||||
|
||||
XXX.
|
||||
X...
|
||||
....
|
||||
....
|
||||
|
||||
====
|
||||
|
||||
.XX.
|
||||
.XX.
|
||||
....
|
||||
....
|
||||
|
||||
.XX.
|
||||
.XX.
|
||||
....
|
||||
....
|
||||
|
||||
.XX.
|
||||
.XX.
|
||||
....
|
||||
....
|
||||
|
||||
.XX.
|
||||
.XX.
|
||||
....
|
||||
....
|
||||
|
||||
====
|
||||
|
||||
XX..
|
||||
.XX.
|
||||
....
|
||||
....
|
||||
|
||||
..X.
|
||||
.XX.
|
||||
.X..
|
||||
....
|
||||
|
||||
XX..
|
||||
.XX.
|
||||
....
|
||||
....
|
||||
|
||||
..X.
|
||||
.XX.
|
||||
.X..
|
||||
....
|
||||
|
||||
====
|
||||
|
||||
.X..
|
||||
XXX.
|
||||
....
|
||||
....
|
||||
|
||||
.X..
|
||||
XX..
|
||||
.X..
|
||||
....
|
||||
|
||||
XXX.
|
||||
.X..
|
||||
....
|
||||
....
|
||||
|
||||
X...
|
||||
XX..
|
||||
X...
|
||||
....
|
||||
|
||||
====
|
||||
|
||||
.XX.
|
||||
XX..
|
||||
....
|
||||
....
|
||||
|
||||
X...
|
||||
XX..
|
||||
.X..
|
||||
....
|
||||
|
||||
.XX.
|
||||
XX..
|
||||
....
|
||||
....
|
||||
|
||||
X...
|
||||
XX..
|
||||
.X..
|
||||
....
|
||||
|
BIN
tetros.img
Normal file
BIN
tetros.img
Normal file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue