Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- org 100h
- OBSTACLE_HEIGHT = 1
- CAR_HEIGHT = 1
- SIDE_WIDTH = 20
- SCREEN_WIDTH = 80
- EntryPoint:
- call Data.SetMode
- ; call Control.StartGame
- call View.DrawDesk
- call WaitForClick
- Control.StartGame:
- ret
- View.DrawDesk:
- xor di, di
- mov bx, 25
- .DrawLoop:
- mov ax, $2000 or 176
- mov cx, SIDE_WIDTH
- rep stosw
- mov ax, $8000 or 20h
- mov cx, SCREEN_WIDTH - 2 * SIDE_WIDTH
- rep stosw
- mov ax, $2000 or 176
- mov cx, SIDE_WIDTH
- rep stosw
- dec bx
- jnz .DrawLoop
- .DrawStrokes:
- mov di, (SCREEN_WIDTH/2)*2 + SCREEN_WIDTH * 2
- mov bx, 4
- @@:
- mov ax, $7000 or 20h
- mov cx, 4
- ..DrawStroke:
- stosw
- add di, SCREEN_WIDTH * 2 - 2;
- dec cx
- jnz ..DrawStroke
- add di, SCREEN_WIDTH*4
- dec bx
- jnz @B
- ret
- Data.SetMode:
- mov ax, $0003
- int 10h
- push $B800
- pop es
- ret
- WaitForClick:
- xor ah,ah
- int 16h
- ret
- wCarPos dw ?
- wObstacleX dw ?
- wObstacleY dw ?
- wObstacleWidth dw ?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement