pouët.net

Go to bottom

Kukkanen by wamma [web]

; Kukkanen
; y0bi / wAMMA
; 2024-7-11
cpu 186
org 100h

  mov al,13h
  int 10h

; 32768 "sin" with values between [-16,15]  
; bx=0
CurveLoop:
  mov ax,bx
  and al,127
  sub al,63
  imul al
  sub ah,16
  mov cx,bx
  shr cl,7  
  dec cl
  xor ah,cl
  mov [CURVE+bx],ah
  inc bx
  jns CurveLoop

  push 03000h
  pop es

MainLoop:

  push cs
  pop ds
  
  mov bh,4
  mov bp,255
DrawShapeLoop:
  mov cl,[cs:bx]
  mov al,cl
  add cl,16
  imul cl
  sar ax,2
  imul di,ax,320

  mov al,[bp+CURVE+64]
  imul cl
  sar ax,2
  add di,ax

  mov cl,4
  mov si,Sprite
DrawSpriteLoop:
  movsw
  movsw
  add di,320-4
  loop DrawSpriteLoop
  add bl,3

  dec bp
  jnz DrawShapeLoop

  push 0a000h
  pop ds
fliploop:
  xor ax,ax
  xchg al,[es:si]
  mov [si+160+50*320],al
  inc si
  jnz fliploop
  
  in al,60h
  cmp al,1
  jnz MainLoop
  ret
 
  CURVE           equ     1024
  ; HAHA I'm using a sprite
  Sprite          db      0, 4,4,0
                  db      4, 31,13,1
                  db      4, 13,13,1
                  db      0 ,1,1,0

Go to top