Advertisement
Guest User

Untitled

a guest
Apr 26th, 2019
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. org 100h
  2.  
  3. OBSTACLE_HEIGHT = 1
  4. CAR_HEIGHT = 1
  5.  
  6. SIDE_WIDTH = 20
  7. SCREEN_WIDTH = 80
  8.  
  9.  
  10.  
  11.  
  12. EntryPoint:
  13.         call    Data.SetMode
  14.  
  15.        ; call    Control.StartGame
  16.  
  17.  
  18.         call    View.DrawDesk
  19.         call    WaitForClick
  20.  
  21.  
  22.  
  23. Control.StartGame:
  24.         ret
  25.  
  26. View.DrawDesk:
  27.         xor     di, di
  28.         mov     bx, 25
  29. .DrawLoop:
  30.         mov     ax, $2000 or 176
  31.         mov     cx, SIDE_WIDTH
  32.         rep     stosw
  33.  
  34.         mov     ax, $8000 or 20h
  35.         mov     cx, SCREEN_WIDTH - 2 * SIDE_WIDTH
  36.         rep     stosw
  37.  
  38.         mov     ax, $2000 or 176
  39.         mov     cx, SIDE_WIDTH
  40.         rep     stosw
  41.  
  42.         dec     bx
  43.         jnz     .DrawLoop
  44. .DrawStrokes:
  45.         mov     di, (SCREEN_WIDTH/2)*2 + SCREEN_WIDTH * 2
  46.         mov     bx, 4
  47. @@:
  48.         mov     ax, $7000 or 20h
  49.         mov     cx, 4
  50. ..DrawStroke:
  51.         stosw
  52.         add     di, SCREEN_WIDTH * 2  - 2;
  53.         dec     cx
  54.         jnz     ..DrawStroke
  55.         add     di,  SCREEN_WIDTH*4
  56.         dec     bx
  57.         jnz     @B
  58.         ret
  59.  
  60. Data.SetMode:
  61.         mov     ax, $0003
  62.         int     10h
  63.         push    $B800
  64.         pop     es
  65.  
  66.         ret
  67.  
  68. WaitForClick:
  69.         xor     ah,ah
  70.         int     16h
  71.         ret
  72.  
  73. wCarPos                 dw                 ?
  74. wObstacleX              dw                 ?
  75. wObstacleY              dw                 ?
  76. wObstacleWidth          dw                 ?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement