flat assembler
Message board for the users of flat assembler.

Index > Heap > I am a bad human.

Author
Thread Post new topic Reply to topic
HaHaAnonymous



Joined: 02 Dec 2012
Posts: 1180
Location: Unknown
HaHaAnonymous
[ Post removed by author. ]


Last edited by HaHaAnonymous on 28 Feb 2015, 18:11; edited 1 time in total
Post 14 Feb 2014, 23:51
View user's profile Send private message Reply with quote
sleepsleep



Joined: 05 Oct 2006
Posts: 8885
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 334455
sleepsleep
well,
idk why you care so much/so sensitive about how others view on your ideas/opinions/thoughts

there is one sentence i want to share several days ago, maybe i just write it here,

rant or switch on da brain and start solving issues.

rant, excuse, and etc no value activities don't solve issues and problems that we all face, the realistic and pragmatic approach, is only one, switch on the brain and deal with it.
Post 15 Feb 2014, 02:24
View user's profile Send private message Reply with quote
tthsqe



Joined: 20 May 2009
Posts: 724
tthsqe
If you are feeling down, why not try this pong game? I need some ideas for the AI for the red bumper.

Code:
format PE GUI 5.0
entry Start


; play is confined to the interior of the curve
; f[x_, y_] := 10 - 180 x^2 - 320 y^2 + 81 x^4 + 256 y^4




include 'win32axp.inc'

DIB_RGB_COLORS = 0


section '.code' code readable executable


Start:




                     invoke  QueryPerformanceFrequency,Frequency
                       fild  qword[Frequency]
                        fld  dword[TargetFPS]
                      fdivp  st1,st0
                      fistp  qword[TickIncrement]

                     invoke  GetModuleHandle,0
                        mov  [wc.hInstance],eax
                        mov  [hInstance],eax
                     invoke  LoadIcon,0,IDI_APPLICATION
                        mov  [wc.hIcon],eax
                     invoke  LoadCursor,0,IDC_ARROW
                        mov  [wc.hCursor],eax
                     invoke  RegisterClass,wc
                       test  eax,eax
                         jz  Error
                     invoke  CreateWindowEx,0,MainWindowClass,MainWindowTitle,WS_VISIBLE+WS_OVERLAPPEDWINDOW,100,100,800,600,NULL,NULL,[wc.hInstance],NULL
                        mov  [hMainWindow],eax
                       test  eax,eax
                         jz  Error

  .MsgLoop:          invoke  PeekMessage,msg,NULL,0,0,PM_REMOVE
                       test  eax,eax
                         jz  .DoRender
  .DoMsg:               cmp  [msg.message],WM_QUIT
                         je  .EndLoop
                     invoke  TranslateMessage,msg
                     invoke  DispatchMessage,msg
  .DoRender:         invoke  QueryPerformanceCounter,Tick
                        mov  ebx,dword[Tick+4*0]
                        mov  edx,dword[Tick+4*1]
                        mov  eax,ebx
                        mov  ecx,edx
                        sub  ebx,dword[ExpectedTick+4*0]
                        sbb  edx,dword[ExpectedTick+4*1]
                         jb  .MsgLoop
                        add  eax,dword[TickIncrement+4*0]
                        adc  ecx,dword[TickIncrement+4*1]
                        mov  dword[ExpectedTick+4*0],eax
                        mov  dword[ExpectedTick+4*1],ecx

                       call  Paint
                       call  Update
                        jmp  .MsgLoop
  .EndLoop:
                     invoke  ExitProcess,[msg.wParam]

Error:               invoke  MessageBox,NULL,_error,NULL,MB_ICONERROR+MB_OK
                     invoke  ExitProcess,0



proc WindowProc hwnd,wmsg,wparam,lparam

                       push  esi edi ebx

                        mov  eax,[wmsg]
                        cmp  eax,WM_CREATE
                         je  .wmcreate
                        cmp  eax,WM_PAINT
                         je  .wmpaint
                        cmp  eax,WM_SIZE
                         je  .wmsize
                        cmp  eax,WM_MOUSEMOVE
                         je  .wmmousemove
                        cmp  eax,WM_DESTROY
                         je  .wm_destroy

  .defwndproc:       invoke  DefWindowProc,[hwnd],[wmsg],[wparam],[lparam]
                        jmp  .return

  .wmmousemove:       movzx  eax,word[lparam+0]
                      movzx  ecx,word[lparam+2]
                        mov  dword[Mouse.x],eax
                        mov  dword[Mouse.y],ecx
                        jmp  .returnz

  .wmcreate:

  .wmsize:           invoke  GetClientRect,[hwnd],rect
                        mov  eax,[rect.right]
                       test  eax,eax
                         jz  .returnz
                        mov  eax,[rect.right]
                        mov  ecx,[rect.bottom]
                        mov  [Bitmap.x],eax
                        mov  [Bitmap.y],ecx
                        mov  ecx,[hBitmap]
                       test  ecx,ecx
                         jz  .wmpaint_newbm
                        jmp  .wmpaint_redobm

  .wmpaint:          invoke  GetClientRect,[hMainWindow],rect
                        mov  eax,[rect.right]
                        mov  ecx,[hBitmap]
                       test  eax,eax
                         jz  .returnz
                       test  ecx,ecx
                         jz  .wmpaint_newbm
    .wmpaint_ok:       call  Paint
                        jmp  .returnz
    .wmpaint_redobm: invoke  DeleteObject,[hBitmap]
    .wmpaint_newbm:     mov  [bmiheader.biSize],sizeof.BITMAPINFOHEADER
                        mov  eax,[Bitmap.x]
                        mov  [bmiheader.biWidth],eax
                        mov  eax,[Bitmap.y]
                        neg  eax
                        mov  [bmiheader.biHeight],eax
                        mov  [bmiheader.biPlanes],1
                        mov  [bmiheader.biBitCount],32
                        mov  [bmiheader.biCompression],BI_RGB
                        mov  eax,[Bitmap.x]
                       imul  eax,[Bitmap.y]
                        lea  eax,[4*eax+16]
                        mov  [bmiheader.biSizeImage],eax
                        mov  [bmiheader.biXPelsPerMeter],0
                        mov  [bmiheader.biYPelsPerMeter],0
                        mov  [bmiheader.biClrUsed],0
                        mov  [bmiheader.biClrImportant],0
                     invoke  CreateDIBSection,0,bmiheader,DIB_RGB_COLORS,ppvBits,0,0
                        mov  [hBitmap],eax
                       call  DrawBackground
                        jmp  .wmpaint_ok

.wm_destroy:         invoke  PostQuitMessage,0

.returnz:               xor  eax,eax
.return:                pop  ebx edi esi
                        ret
endp




Paint:                 push  ebp ebx esi edi

                        cmp  [hBitmap],0
                         je  .Done
                        cmp  [Background],0
                         je  .Done

                     invoke  InvalidateRect,[hMainWindow],rect,FALSE
                     invoke  BeginPaint,[hMainWindow],ps
                        mov  [hdc],eax
                     invoke  CreateCompatibleDC,eax
                       test  eax,eax
                         jz  Error
                        mov  [hMemDC],eax

                       call  DrawGame

                     invoke  SelectObject,[hMemDC],[hBitmap]
                     invoke  BitBlt,[hdc],0,0,[rect.right],[rect.bottom],[hMemDC],0,0,SRCCOPY
                     invoke  DeleteDC,[hMemDC]
                     invoke  EndPaint,[hMainWindow],ps

        .Done:          pop  edi esi ebx ebp
                        ret






DrawGame:

                        sub  esp,32

virtual at esp
.x  dq ?
.y  dq ?
.t1 dd ?
end virtual

                        mov  ebx,[Background]
                        mov  ebp,[ppvBits]

                        xor  esi,esi
            .1:
                      movsd  xmm0,qword[yCoords+8*esi]
                      movsd  qword[.y],xmm0
                        xor  edi,edi
              .2:
                      movsd  xmm0,qword[xCoords+8*edi]
                      movsd  qword[.x],xmm0

                      movss  xmm7,dword[ebx]
                     shufps  xmm7,xmm7,0
                      mulps  xmm7,dqword[BoardColor]

                        xor  edx,edx
                 .3:  movsd  xmm1,qword[Puck.r+edx]
                     movups  xmm0,dqword[.x]
                      subpd  xmm0,dqword[Puck.x+edx]
                      mulpd  xmm0,xmm0
                     haddpd  xmm0,xmm0
                     sqrtsd  xmm0,xmm0
                      subsd  xmm1,xmm0
                      mulsd  xmm1,qword[const_f8_64]
                      addsd  xmm1,qword[const_f8_1d2]
                      xorps  xmm0,xmm0
                      maxsd  xmm1,xmm0
                      minsd  xmm1,qword[const_f8_1]
                   cvtsd2ss  xmm1,xmm1
                     shufps  xmm1,xmm1,0
                      mulps  xmm1,dqword[Puck.col+edx]
                      addps  xmm7,xmm1
                        add  edx,64
                        cmp  edx,64*3
                         jb  .3

                   cvtps2dq  xmm7,xmm7
                   packssdw  xmm7,xmm7
                   packuswb  xmm7,xmm7

                       movd  dword[ebp],xmm7
                        add  ebx,4
                        add  ebp,4

                        add  edi,1
                        cmp  edi,dword[Bitmap.x]
                         jb  .2
                        add  esi,1
                        cmp  esi,dword[Bitmap.y]
                         jb  .1

                        add  esp,32
                        ret












Update:               push  ebp
                       mov  ebp,esp
                       and  esp,-16

                       sub  esp,128

virtual at esp
.p0xy  dq ?,?
.p1xy  dq ?,?
.p2xy  dq ?,?
.p0val dq ?,?
.p1val dq ?,?
.tx   dq ?
.ty   dq ?
end virtual


  ; bumper - board
                        mov  eax,dword[Mouse.x]
                        mov  ecx,dword[Mouse.y]
                      movsd  xmm0,qword[xCoords+8*eax]
                      movsd  qword[.tx],xmm0
                     movhpd  xmm0,qword[yCoords+8*ecx]
                      subpd  xmm0,dqword[aBumper.x]
                      mulpd  xmm0,dqword[const_f8_1d8_1d8]
                     movaps  dqword[aBumper.vx],xmm0


                        mov  esi,8
.MainLoop:

  ; puck - bumper
                     movaps  xmm0,dqword[Puck.x]
                      subpd  xmm0,dqword[aBumper.x]
                     movaps  xmm2,xmm0
                      mulpd  xmm0,xmm0
                     haddpd  xmm0,xmm0
                      movsd  xmm1,qword[Puck.r]
                      addsd  xmm1,qword[aBumper.r]
                      mulsd  xmm1,xmm1
                     comisd  xmm0,xmm1
                         ja  .NoColision
                     movaps  xmm0,dqword[aBumper.vx]
                     movaps  xmm1,dqword[Puck.vx]
                     movaps  xmm3,dqword[BumperMass]
                     movaps  xmm4,dqword[PuckMass]
                       call  Collision
                     movaps  dqword[aBumper.vx],xmm0
                     movaps  dqword[Puck.vx],xmm1
     .NoColision:    movaps  xmm0,dqword[aBumper.x]
                      addpd  xmm0,dqword[aBumper.vx]
                     movaps  xmm7,xmm0
                       call  QuarticValue
                      xorps  xmm1,xmm1
                     comisd  xmm0,xmm1
                        jae  @f
                     movaps  dqword[aBumper.x],xmm7
               @@:






  ; puck - board
                     movaps  xmm0,dqword[Puck.x]
                     movaps  dqword[.p0xy],xmm0
                      addpd  xmm0,dqword[Puck.vx]
                     movaps  dqword[.p1xy],xmm0
                       call  QuarticValue
                      xorps  xmm1,xmm1
                     movaps  dqword[.p1val],xmm0
                     comisd  xmm0,xmm1
                       jae  .PuckBounce
     .PuckSlide:     movaps  xmm0,dqword[Puck.vx]
                     movaps  xmm1,dqword[.p1xy]
                      mulpd  xmm0,dqword[PuckSlideF]
                     movaps  dqword[Puck.vx],xmm0
                     movaps  dqword[Puck.x],xmm1
                        jmp  .PuckDone
     .PuckBounce:    movaps  xmm0,dqword[.p0xy]
                       call  QuarticValue
                     movaps  dqword[.p0val],xmm0
                     movaps  xmm0,dqword[.p0xy]
                     movaps  xmm1,dqword[.p1xy]
                     movaps  xmm2,dqword[.p1val]
                     movaps  xmm3,dqword[.p0val]
                      mulpd  xmm0,xmm2
                      mulpd  xmm1,xmm3
                      subpd  xmm0,xmm1
                      subpd  xmm2,xmm3
                      divpd  xmm0,xmm2
                     movaps  dqword[.p2xy],xmm0
                       call  QuarticGrad
                       call  Normalize
                     movaps  xmm2,dqword[Puck.vx]
                     movaps  xmm1,xmm2
                      mulpd  xmm2,xmm0
                     haddpd  xmm2,xmm2
                      addpd  xmm2,xmm2
                      mulpd  xmm2,xmm0
                      subpd  xmm1,xmm2
                     movaps  xmm0,xmm1
                     movaps  xmm2,xmm1
                      mulpd  xmm0,xmm1
                     haddpd  xmm0,xmm0
                     movaps  xmm3,dqword[.p2xy]
                      subpd  xmm3,dqword[.p1xy]
                      mulpd  xmm3,xmm3
                     haddpd  xmm3,xmm3
                      divpd  xmm3,xmm0
                     sqrtpd  xmm3,xmm3
                      mulpd  xmm2,xmm3
                      addpd  xmm2,dqword[.p2xy]
                     movaps  dqword[Puck.x],xmm2
                      mulpd  xmm1,dqword[PuckBounceF]
                     movaps  dqword[Puck.vx],xmm1
        .PuckDone:

                        sub  esi,1
                        jne  .MainLoop


                        mov  esp,ebp
                        pop  ebp
                        ret






Collision:      ; in:   xmm0  V1   velocity of first body
                ;       xmm1  V2   velocity of second body
                ;       xmm2  P    vector between two bodies
                ;       xmm3  m1   mass of first body
                ;       xmm4  m2   mass of second body
                ;
                ;                    (m2+m2)(P.V2)+(m1-m2)(P.V1)     (V1.Pr)
                ; out:  xmm0  V1' =  --------------------------- P + ------- Pr
                ;                            (m1+m2)(P.P)             (P.P)
                ;
                ;                    (m1+m1)(P.V1)+(m2-m1)(P.V2)     (V2.Pr)
                ;       xmm1  V2' =  --------------------------- P + ------- Pr
                ;                            (m1+m2)(P.P)             (P.P)
                       push  ebp
                        mov  ebp,esp
                        and  esp,-16
                        sub  esp,128
virtual at esp
.M2pM2 dq ?,?
.M1pM1 dq ?,?
.M1mM2 dq ?,?
.M1pM2 dq ?,?
.PdP   dq ?,?
.v1    dq ?,?
.v2    dq ?,?
end virtual
                     movaps  xmm5,xmm3
                      subpd  xmm5,xmm4
                     movaps  dqword[.M1mM2],xmm5
                     movaps  xmm5,xmm3
                      addpd  xmm5,xmm4
                     movaps  dqword[.M1pM2],xmm5
                      addpd  xmm4,xmm4
                     movaps  dqword[.M2pM2],xmm4
                      addpd  xmm3,xmm3
                     movaps  dqword[.M1pM1],xmm3

                     movaps  xmm5,xmm2
                     shufpd  xmm5,xmm5,00001b
                      xorps  xmm5,dqword[const_f8_sign_0]

                     movaps  xmm3,xmm0
                     movaps  xmm4,xmm1

                      mulpd  xmm0,xmm2
                     haddpd  xmm0,xmm0
                      mulpd  xmm1,xmm2
                     haddpd  xmm1,xmm1

                     movaps  xmm6,xmm2
                      mulpd  xmm6,xmm2
                     haddpd  xmm6,xmm6
                      mulpd  xmm3,xmm5
                     haddpd  xmm3,xmm3
                      mulpd  xmm4,xmm5
                     haddpd  xmm4,xmm4
                      divpd  xmm5,xmm6
                      mulpd  xmm3,xmm5
                      mulpd  xmm4,xmm5

                      mulpd  xmm6,dqword[.M1pM2]
                      divpd  xmm2,xmm6

                     movaps  xmm5,dqword[.M2pM2]
                      mulpd  xmm5,xmm1
                     movaps  xmm6,dqword[.M1mM2]
                      mulpd  xmm6,xmm0
                      addpd  xmm5,xmm6
                      mulpd  xmm5,xmm2
                      addpd  xmm5,xmm3
                     movaps  dqword[.v1],xmm5

                     movaps  xmm5,dqword[.M1pM1]
                      mulpd  xmm5,xmm0
                     movaps  xmm6,dqword[.M1mM2]
                      mulpd  xmm6,xmm1
                      subpd  xmm5,xmm6
                      mulpd  xmm5,xmm2
                      addpd  xmm5,xmm4
                     movaps  dqword[.v2],xmm5

                     movaps  xmm0,dqword[.v1]
                     movaps  xmm1,dqword[.v2]

                        mov  esp,ebp
                        pop  ebp
                        ret





Normalize:       ; in:   xmm0:  { x , y }
                 ; out:  xmm0:  { x , y } / Sqrt[x^2+y^2]
                     movaps  xmm1,xmm0
                      mulpd  xmm1,xmm0
                     haddpd  xmm1,xmm1
                     sqrtpd  xmm1,xmm1
                      divpd  xmm0,xmm1
                        ret

QuarticValue:    ; in:   xmm0:  { x , y }
                 ; out:  xmm0:   10 - 180 x^2 - 320 y^2 + 81 x^4 + 256 y^4
                     movaps  xmm1,dqword[const_f8_20_20]
                      mulpd  xmm0,dqword[const_f8_3_4]
                      mulpd  xmm0,xmm0
                      mulpd  xmm1,xmm0
                      mulpd  xmm0,xmm0
                     haddpd  xmm1,xmm1
                     haddpd  xmm0,xmm0
                      addpd  xmm0,dqword[const_f8_10_10]
                      subpd  xmm0,xmm1
                        ret

QuarticGrad:     ; in:   xmm0:  { x , y }
                 ; out:  xmm0:  { x (-360 + 324 x^2) , y (-640 + 1024 y^2) }
                     movaps  xmm1,xmm0
                      mulpd  xmm1,xmm0
                      mulpd  xmm1,dqword[const_f8_324_1024]
                      subpd  xmm1,dqword[const_f8_360_640]
                      mulpd  xmm0,xmm1
                        ret



QuarticDist:     ; in:   xmm0:  x
                 ;
                 ; out:  st0 distance to quartic curve

; this is quite an expensive operation
; to find the approximant distance t from a point (x,y) to the curve defined by f[x,y]=0
;  set, for k=0,1,...
;  F[k_] := Norm[Table[D[f[x, y], {x, i}, {y, k - i}]/(i! (k - i)! Sqrt[Binomial[k, i]]), {i, 0, k}]];
;  the distance t is approximated by the smallest positive root of
;  F[0] = F[1] t + F[2] t^2 + ... + F[n] t^n

                        sub  esp,16*8

virtual at esp
.x  dq ?
.y  dq ?
.F0 dq ?
.F1 dq ?
.F2 dq ?
end virtual
                     movups  dqword[.x],xmm0

                       call  QuarticValue
                      andps  xmm0,dqword[const_f8_abs_abs]
                      movsd  qword[.F0],xmm0

                     movups  xmm0,dqword[.x]
                       call  QuarticGrad
                      mulpd  xmm0,xmm0
                     haddpd  xmm0,xmm0
                     movaps  xmm3,xmm0
                     sqrtsd  xmm0,xmm0
                      movsd  qword[.F1],xmm0

                     movups  xmm0,dqword[.x]
                      mulpd  xmm0,xmm0
                      mulpd  xmm0,dqword[const_f8_486_1536]
                      subpd  xmm0,dqword[const_f8_180_320]
                      mulpd  xmm0,xmm0
                     haddpd  xmm0,xmm0
                     sqrtsd  xmm0,xmm0
                      movsd  qword[.F2],xmm0

                      movsd  xmm1,qword[const_f8_3d8]
                      mulsd  xmm1,qword[.F1]
                      movsd  xmm2,qword[const_f8_4]
                      mulsd  xmm2,qword[.F0]
                      mulsd  xmm2,qword[.F2]
                      addsd  xmm2,xmm3
                     sqrtsd  xmm2,xmm2
                      mulsd  xmm2,qword[const_f8_5d8]
                      addsd  xmm1,xmm2
                      movsd  xmm0,qword[.F0]
                      divsd  xmm0,xmm1

                        add  esp,16*8
                        ret





DrawBackground:

                        sub  esp,32

virtual at esp
.x dq ?
.y dq ?
end virtual



                     invoke  VirtualFree,[Background],0,MEM_RELEASE

                        mov  eax,[Bitmap.x]
                       imul  eax,[Bitmap.y]
                        shl  eax,2
                     invoke  VirtualAlloc,0,eax,MEM_COMMIT,PAGE_READWRITE
                        mov  dword[Background],eax


                        mov  ebx,xCoords
                        xor  esi,esi
                       fild  dword[Bitmap.x]
                        fld  st0
                       fldz
                        fld  qword[x_min]
                        fld  qword[x_max]
             .3:        fld  st1
                       fmul  st0,st4
                        fld  st1
                       fmul  st0,st4
                      faddp  st1,st0
                       fdiv  st0,st5
                       fstp  qword[ebx]
                        add  ebx,8
                       fld1
                       fadd  st3,st0
                      fsubp  st4,st0
                        add  esi,1
                        cmp  esi,[Bitmap.x]
                         jb  .3
                       fstp  st0
                       fstp  st0
                       fstp  st0
                       fstp  st0
                       fstp  st0


                        mov  ebx,yCoords
                        xor  esi,esi
                       fild  dword[Bitmap.y]
                        fld  st0
                       fldz
                        fld  qword[y_min]
                        fld  qword[y_max]
             .4:        fld  st1
                       fmul  st0,st4
                        fld  st1
                       fmul  st0,st4
                      faddp  st1,st0
                       fdiv  st0,st5
                       fstp  qword[ebx]
                        add  ebx,8
                       fld1
                       fadd  st3,st0
                      fsubp  st4,st0
                        add  esi,1
                        cmp  esi,[Bitmap.y]
                         jb  .4
                       fstp  st0
                       fstp  st0
                       fstp  st0
                       fstp  st0
                       fstp  st0



                        mov  ebx,[Background]
                        xor  esi,esi
            .1:
                      movsd  xmm0,qword[yCoords+8*esi]
                      movsd  qword[.y],xmm0
                        xor  edi,edi
              .2:
                      movsd  xmm0,qword[xCoords+8*edi]
                      movsd  qword[.x],xmm0

                     movups  xmm0,dqword[.x]
                       call  QuarticValue
                      xorps  xmm1,xmm1
                     comisd  xmm0,xmm1
                        jbe  @f
                     movups  xmm0,dqword[.x]
                       call  QuarticDist
                      xorps  xmm1,xmm1
                      subsd  xmm0,qword[Puck.r]
                      mulsd  xmm0,qword[const_f8_64]
                      addsd  xmm0,qword[const_f8_1d2]
                      maxsd  xmm1,xmm0
                      minsd  xmm1,qword[const_f8_1]
                   cvtsd2ss  xmm1,xmm1
            @@:       movss  dword[ebx],xmm1
                        add  ebx,4

                        add  edi,1
                        cmp  edi,dword[Bitmap.x]
                         jb  .2
                        add  esi,1
                        cmp  esi,dword[Bitmap.y]
                         jb  .1

                        add  esp,32
                        ret





section '.idata' import data readable writeable

 library kernel32,'KERNEL32.DLL',\
         user32,'USER32.DLL',\
         gdi32,'GDI32.DLL'

include 'api\kernel32.inc'
include 'api\user32.inc'
include 'api\gdi32.inc'


section '.data' data readable writeable

align 16
 BoardColor  dd 255.0,255.0,255.0,1.0
 PuckColor   dd 000.0,255.0,000.0,1.0
 PuckBounceF dq 0.900,0.900
 PuckSlideF  dq 0.999,0.999
 PuckMass    dq 1.0,1.0
 BumperMass  dq 2.5,2.5

align 16
 const_f8_3_4      dq 3.0,4.0
 const_f8_20_20    dq 20.0,20.0
 const_f8_10_10    dq 10.0,10.0
 const_f8_324_1024 dq 324.0,1024.0
 const_f8_360_640  dq 360.0,640.0
 const_f8_486_1536 dq 486.0,1536.0
 const_f8_180_320  dq 180.0,320.0
 const_f8_1d8_1d8  dq 0.125,0.125
 const_f8_sign_sign dq 0x8000000000000000,0x8000000000000000
 const_f8_abs_abs   dq 0x7FFFFFFFFFFFFFFF,0x7FFFFFFFFFFFFFFF
 const_f8_sign_0    dq 0x8000000000000000,0x0000000000000000


align 8
 const_f8_3d8    dq 0.375
 const_f8_5d8    dq 0.625
 const_f8_4      dq 4.0

align 8
 x_min dq -1.75
 x_max dq +1.75
 y_min dq -1.33
 y_max dq +1.33


align 8
 const_f8_64   dq 64.0
 const_f8_1d2  dq 0.5
 const_f8_1    dq 1.0

align 4
 TargetFPS    dd 30.0


align 4
 const_f4_1   dd 1.0




align 2
 f10Control dw 0x037F


align 16
 Puck.x     dq +1.0
 Puck.y     dq +1.0
 Puck.vx    dq -0.05
 Puck.vy    dq -0.05
 Puck.r     dq 0.04
            dq ?
 Puck.col   dd 000.0,255.0,000.0,1.0

 aBumper.x    dq +1.0
 aBumper.y    dq -1.0
 aBumper.vx   dq 1.0
 aBumper.vy   dq 1.0
 aBumper.r    dq 0.1
              dq ?
 aBumper.col  dd 255.0,000.0,000.0,1.0

 bBumper.x    dq -1.0
 bBumper.y    dq +1.0
 bBumper.vx   dq 1.0
 bBumper.vy   dq 1.0
 bBumper.r    dq 0.08
              dq ?
 bBumper.col  dd 000.0,000.0,255.0,1.0


align 4

 const_f4_16384 dd 16384.0
 const_f4_128   dd 128.0
 const_f4_10    dd 10.0
 const_f4_20    dd 20.0
 const_f4_3     dd 3.0
 const_f4_4     dd 4.0
 const_f4_324   dd 324.0
 const_f4_640   dd 640.0
 const_f4_1024  dd 1024.0
 const_f4_360   dd 360.0

 const_f4_5d8   dd 0.625
 const_f4_3d8   dd 0.375

 const_f4_486   dd 486.0
 const_f4_180   dd 180.0
 const_f4_1536  dd 1536.0
 const_f4_320   dd 320.0




align 4
 Mouse.x    dd ?
 Mouse.y    dd ?



 wc WNDCLASS 0,WindowProc,0,0,NULL,NULL,NULL,COLOR_BTNFACE+1,NULL,MainWindowClass

align 1
  MainWindowTitle db 'plot', 0
  MainWindowClass db 'plot32', 0
  _error TCHAR 'Startup failed.',0

align 8
  a dq 2.0


align 8
  Frequency      dq ?
  ExpectedTick   dq ?
  TickIncrement  dq ?
  Tick           dq ?

align 4
  hMainWindow     dd ?
  hStatusWindow   dd ?
  hMainMenu       dd ?
  hInstance       dd ?
  ppvBits         dd ?
  hMemDC          dd ?
  hdc             dd ?
  hBitmap         dd ?
  Bitmap.x        dd ?
  Bitmap.y        dd ?
  TickCount       dd ?
  Background      dd ?
  bmiheader     BITMAPINFOHEADER

  ps            PAINTSTRUCT
  rc RECT
  rect          RECT
  msg           MSG

align 1
  PaintTimer db ?


align 16
  xCoords rb 16*2048
  yCoords rb 16*2048
    
Post 15 Feb 2014, 02:59
View user's profile Send private message Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1409
Location: Toronto, Canada
AsmGuru62
@HaHa:
Share your opinions, but do not argue about them.
Just ignore the argument.
Post 15 Feb 2014, 13:33
View user's profile Send private message Send e-mail Reply with quote
sid123



Joined: 30 Jul 2013
Posts: 340
Location: Asia, Singapore
sid123
HaHa,
Hope you havent left and you are reading this. Smile
I agree with sleepsleep.
After all YOLO, so enjoy life!
Post 15 Feb 2014, 16:05
View user's profile Send private message Reply with quote
matefkr



Joined: 02 Sep 2007
Posts: 1291
Location: Ukraine, Beregovo
matefkr
yes. u should not leave. u should share your opinions and help making the game of pong go into realization.
Post 15 Feb 2014, 22:40
View user's profile Send private message Reply with quote
matefkr



Joined: 02 Sep 2007
Posts: 1291
Location: Ukraine, Beregovo
matefkr
u can still post on the forums, even if u dont share opinions, u can share facts or others opiniosn whatever u have read, if u have the opinion it is worth sharing, u can share the thing but still u have not expressed your opinion yet u can communicate on the forum.
Post 15 Feb 2014, 22:41
View user's profile Send private message Reply with quote
KevinN



Joined: 09 Oct 2012
Posts: 161
KevinN
BAD HUMAN!!! BAD!!!
Post 15 Feb 2014, 22:43
View user's profile Send private message Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
rugxulo
HaHaAnonymous wrote:
I came to the conclusion that I am causing harm and being an useless example for other people in this forum.

My opinions and thoughts are better if I keep them only to myself. And sharing them in this forum is just letting me more and more depressed each day, with the will to die and get out of this world for ever.

And for my own benefit, I have to leave this forum forever.

Never share your opinions with others... Lesson learned.


I never read you say anything harmful. If anything, this only reminds me of the jerk who unfairly insulted you here two months ago. It's people like that who need to stop the hate, not you.

You're obviously entitled to your opinions, seemingly random posts here aren't "useless" as there is no metric nor quota for being a member. (Admittedly, some opinions should be weighed before being expressed, but nobody's perfect. Unfortunately, some people are ruder than others. May God forgive them.)

If you're suffering from depression, try to see a therapist and/or a doctor.

You just have to ignore the bad and focus on the good.
Post 17 Feb 2014, 07:57
View user's profile Send private message Visit poster's website Reply with quote
taeyun



Joined: 12 Jan 2014
Posts: 42
Location: south korea
taeyun
life is not about to avoid storm and wait for sunny day.
life is about to dancing in the stormy rain.
hope you cheer up.
Post 17 Mar 2014, 19:05
View user's profile Send private message Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2913
Location: 0x77760000
typedef
taeyun wrote:
life is not about to avoid storm and wait for sunny day.
life is about to dancing in the stormy rain.
hope you cheer up.


I didn't see anyone dancing during Hurricane Katrina. Confused
Post 18 Mar 2014, 00:07
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.