' Unfortunately,Size textbuffer source forum is small and
' I divade file onto a few part (*.INC)...
'
' This is STATIC (NOT Dynamic) MMX model FOR DDRAW;
' This is easy and simple example for DDRAW with mixed MMX and FPU;
' The code is not optimized;
' The code is raw, You can =dry= this code;
' You can easy make Dynamic (moving) model from this code;
' This example is small part of large prog, I make it in 1997 in
' PB3.5 DOS-version for Vesa-r;
' Now this is WIN32 version;
' I try make code as simple - for understand;
'
'
' --------------------------- V.Shulakov ---------------------------
#COMPILE EXE
#OPTION VERSION4
#DIM ALL
#INCLUDE "WIN32API.INC"
#INCLUDE "DDRAW.INC"
%NULL_PAINT = &h00000000
%BLUE_PAINT = &h000099ff
%YELL_PAINT = &h00ffff00
%SEA_WAIT = 100
DECLARE SUB NEXTFLAG()
GLOBAL ddsd AS DDSURFACEDESC
GLOBAL fk AS SINGLE
GLOBAL lpDDSPrimary AS LONG
GLOBAL ddscaps AS DDSCAPS
GLOBAL LPDD AS DWORD
GLOBAL DDWIDTH AS LONG
GLOBAL DDHEIGHT AS LONG
GLOBAL FLAG AS LONG
'__________________________________ START ___________________________________
'
FUNCTION WINMAIN (BYVAL hInst AS LONG, _
BYVAL hPrevInst AS LONG, _
CmdLine AS ASCIIZ PTR, _
BYVAL CmdShow AS LONG) EXPORT AS LONG
LOCAL Msg AS tagMsg
LOCAL wndclass AS WndClassEx
GLOBAL hWnd AS LONG
LOCAL szClassName AS ASCIIZ * 80
LOCAL szDisplayName AS ASCIIZ * 80
LOCAL TMP AS LONG
GLOBAL GPTR AS LONG
GLOBAL YPTR AS LONG
DIM G(0:21,1:120) AS GLOBAL LONG
GPTR = VARPTR(G(1,1))
ddwidth = 640
ddheight = 480
fk = 0.05
szClassName = "DDraw MMX-FPU demo"
szDisplayName = szClassName
wndclass.cbSize = SIZEOF(WndClass)
wndclass.style = %CS_HREDRAW OR %CS_VREDRAW
wndclass.lpfnWndProc = CODEPTR( WndProc )
wndclass.cbClsExtra = 0
wndclass.cbWndExtra = 0
wndclass.hInstance = hinst
wndclass.hIcon = 0
wndclass.hCursor = 0
wndclass.hbrBackground = GetStockObject( %white_BRUSH )
wndclass.lpszMenuName = %NULL
wndclass.lpszClassName = VARPTR( szClassName )
wndclass.hIconSm = 0
RANDOMIZE 21
RegisterClassEx wndclass
HWND=CreateWindowEx(0,szClassName,_
szDisplayName,_
%WS_POPUP,_
0, 0, ddwidth, ddheight,_
BYVAL %NULL, BYVAL %NULL,_
hInst, BYVAL %NULL)
ShowWindow hWnd, %SW_SHOWNORMAL
SetFocus hWnd
ShowCursor 0
IF %DD_OK<>DDDirectDrawCreate(BYVAL %NULL,lpDD,BYVAL %NULL) THEN
! JMP FATAL
END IF
IF %DD_OK<>DDSetCooperativeLevel(lpDD, hWnd, _
%DDSCL_EXCLUSIVE OR %DDSCL_FULLSCREEN) THEN
! JMP FATAL
END IF
IF %DD_OK<>DDSetDisplayMode( lpDD, ddwidth, ddheight, 32) THEN
! JMP FATAL
END IF
ddsd.dwSize=SIZEOF(DDSD)
ddsd.dwFlags=%DDSD_CAPS
ddsd.ddsCaps.dwCaps=%DDSCAPS_PRIMARYSURFACE
IF %DD_OK<>DDCreateSurface(lpDD, ddsd, lpDDSPrimary) THEN
! JMP FATAL
END IF
'__________________________________________________________________________________
'
WHILE -1
IF 0<>PeekMessage(msg, BYVAL %NULL, 0, 0, %PM_REMOVE) THEN
IF msg.message = %WM_QUIT THEN
PostQuitMessage msg.wParam
EXIT LOOP
ELSE
TranslateMessage msg
DispatchMessage msg
END IF
ELSE
IF GetFocus = hWnd THEN
ddsd.dwSize= SIZEOF(DDSD) '(DDSURFACEDESC)
ddsd.dwFlags=%DDSD_PITCH
WHILE -1
TMP=DDSLock(lpDDSPrimary, BYVAL %NULL, ddsd, %DDLOCK_WAIT, BYVAL %NULL)
IF TMP = %DD_OK THEN
EXIT LOOP
ELSEIF TMP = %DDERR_SURFACELOST THEN
DDSRestore lpDDSPrimary
END IF
WEND
DDWaitForVerticalBlank lpDD, %DDWAITVB_BLOCKBEGIN, BYVAL %NULL
STATIC L AS LONG
IF L=0 THEN
! call NEXTframe
! mov L,1
ELSE
! call NEXTFLAG
END IF
DDSUNLOCK lpDDSPrimary, ddsd.lpSurface
ELSE
! mov L,0
END IF
END IF
WEND
FATAL: '************************************************************************************
IF lpDD <> %NULL THEN
IF lpDDSPrimary <> %NULL THEN
DDIRelease lpDDSPrimary
lpDDSPrimary = %NULL
END IF
DDIRelease lpDD
lpDD = %NULL
END IF
FUNCTION= msg.wParam
END FUNCTION
'_____________________________________________________________________________________
' Window Proc
'_____________________________________________________________________________________
'
FUNCTION WndProc (BYVAL hWin AS LONG, BYVAL uMsg AS LONG, _
BYVAL wParam AS LONG, BYVAL lParam AS LONG) EXPORT AS LONG
IF uMsg = %WM_KEYDOWN THEN
IF wParam = %VK_ESCAPE THEN
PostQuitMessage 0
FUNCTION=0
EXIT FUNCTION
END IF
ELSEIF uMsg = %WM_DESTROY THEN
PostQuitMessage 0
FUNCTION=0
EXIT FUNCTION
END IF
FUNCTION = DefWindowProc(hWin, uMsg, wParam, lParam)
END FUNCTION
'_________________________________________________________________________________________
'
SUB nextFrame
#REGISTER NONE
LOCAL j AS LONG
LOCAL i AS LONG
LOCAL c AS LONG
LOCAL k AS LONG
LOCAL t AS LONG
! PUSHAD
! mov eax,offset datacol
! movq mm1,[eax]
! movq mm2,[eax+8]
! movq mm3,[eax+16]
! movd mm5,[eax+24]
! mov esi,ddsd[36] ; htmp=ddsd.lpSurface íà÷àëî
! mov edi,esi ; new line
! mov edx,ddsd[16]
! mov t,0
! push edx
! mov j,0
mline:
! mov i,0
! inc ecx
! cmp ecx,1
! jne mblue
! paddsb mm1,mm2
! jmp mstart
mblue:
! xor ecx,ecx
! paddsb mm1,mm3
mstart:
! movq [esi],mm1
! add esi,8
! inc i
! cmp i,320
! jl mstart ;----------->
! add edi,edx
! mov esi,edi
! inc j
! cmp j,480
! jl mline ;----------->
FTOWN:'------------------------------------------------------------------------------
! mov eax,ddsd[36]
! push eax
! pop esi ;esi ' htmp=ddsd.lpSurface íà÷àëî
! push edx
! pop eax
! mov ebx,253
! mul ebx
! add esi,eax
! pop edx
! mov edi,esi ; new line
! mov eax,offset town ;town
! mov ebx,offset pal ;pal
! xor ecx,ecx
! mov j,0
mlt0:
! mov i,0
mlt1:
! mov cl,[eax]
! inc eax
! push eax
! push ebx
! pop eax
! push ecx
! shl ecx,2
! add eax,ecx
! pop ecx
! movd mm4,[eax]
! pop eax
! cmp j,5
! jl mn1
! cmp j,26
! jg mn1
! cmp i,200
! jl mn1
'---------------------
! pushad
! mov eax,GPTR
! add eax,t
! movd [eax],mm4
! add t,4
! popad
'---------------------
! jmp mn2
mn1:
! movd [esi],mm4
mn2:
! add esi,4
! inc i
! cmp i,320
! jl mlt1 ;------------->
! add edi,edx
! push edi
! pop esi
! inc j
! cmp j,66
! jl mlt0 ;------------->
! CALL NICE
! CALL TREES
! CALL STARS
! CALL REDDS
! CALL REDDSU
! CALL COW
! CALL RADIO_SH
! CALL LINES1
! CALL LINES2
! EMMS
! POPAD
EXIT SUB 'good work
TREES: '---------------------------------------------------------------------------
! pushad
! mov esi,ddsd[36]
! mov edi,esi ; new line
! mov edx,ddsd[16]
! push edx
! mov eax,edx ;ddsd[16]
! mov edx,77
! mul edx
! mov k,eax
! pop edx
! mov eax,edx
! push edx
! mov ebx,385
! mul ebx
! add esi,eax
! pop edx
! mov edi,esi ; new line
! mov eax,offset tree ;tree
! mov ebx,offset pal ;pal
! xor ecx,ecx
! mov j,0
mltr0:
! mov i,0
mltr1:
! mov cl,[eax]
! inc eax
! push eax
! push ebx
! pop eax
! add eax,ecx
! add eax,ecx
! add eax,ecx
! add eax,ecx
! movd mm4,[eax]
! mov eax,[eax]
! mov c,eax
! pop eax
! movd [esi],mm4
! add esi,4
! inc i
! cmp i,320
! jl mltr1 ;------------->
! add edi,edx
! push edi
! pop esi
! inc j
! cmp j,94
! jne mfor ;------------->
! add edi,1280
! sub edi,k
mfor:
! cmp j,171
! jl mltr0 ;------------->
! popad
! ret
STARS:'------------------------------------------------------------------------------
! pushad
! mov esi,ddsd[36]
! mov edi,ddsd[16]
! mov c,0
mzt1:
! EMMS
! pushad
j = RND(20,250)
i = RND(10,638)
! popad
! mov eax,edi
! mul j
! add eax,esi
! mov ecx,eax
! mov eax,4
! mul i
! add ecx,eax
! shr j,3
! movd mm2,j
! PUNPCKLBW mm2,mm2 ;LAY
! PSUBsB mm5,mm2
! movd [ecx],mm5
! inc c
! cmp c,70
! jl mzt1 ;----------->
! popad
! ret
REDDS:'-----------------------------------------------------------------------------
! pushad
! mov esi,ddsd[36]
! mov edi,ddsd[16]
! mov eax,offset datacol
! movq mm1,[eax+28]
! mov eax,edi
! mov ebx,319 ;x
! mul ebx
! add eax,esi
! mov c,0
mred:
! movd [eax],mm1
! add eax,4
! inc c
! cmp c,360
! jl mred ;------------>
! popad
! ret
REDDSU:'--------------------------------------------------------------------------------
! pushad
! mov esi,ddsd[36]
! mov edi,ddsd[16]
! mov eax,offset datacol
! movd mm1,[eax+24]
! movd mm2,[eax+24]
! mov c,&h00030100
! mov eax,edi
! mov ebx,250 ;x
! mul ebx
! add eax,esi
! mov i,0
mred1:
! mov j,0
mred2:
! movd ecx,mm2
! cmp [eax],ecx
! jne mnos ;------------>
! movd [eax],mm1
mnos:
! add eax,4
! inc j
! cmp j,640
! jl mred2 ;------------>
! PADDB mm1,c
! sub eax,2560
! add eax,edi
! inc i
! cmp i,70
! jl mred1 ;------------>
! popad
! ret
COW:'---------------------------------------------------------------------------------
! pushad
! mov esi,ddsd[36]
! mov edi,ddsd[16]
! mov eax,edi
! mov ebx,20
! mul ebx
! add eax,esi
! add eax,2000
! mov edx,gptr
! mov i,0
mcw1:
! mov j,0
mcw2:
! mov ebx,[edx]
! cmp ebx,&h7f7f
! jne mnow ;----------->
! mov ebx,[eax]
! mov [edx],ebx
mnow:
! mov [eax],ebx
! add edx,4
! add eax,4
! inc j
! cmp j,120
! jl mcw2 ;----------->
! sub eax,480
! add eax,edi
! inc i
! cmp i,22
! jl mcw1 ;----------->
! popad
! ret
RADIO_SH:'-------------------------------------------------------------------------------
LOCAL m AS LONG
LOCAL w AS LONG
! pushad
! mov esi,ddsd[36]
! mov edi,ddsd[16]
! mov k,edi
! mov eax,400
! mul k
! add eax,esi
! mov i,eax
! mov m,0
mfc:
! mov j,0
mfg:
! mov w,210
! fld j
! fdiv w
! mov w,550
! fisub w
! fcos
! mov w,350
! fimul w
! fist c
! finit
! mov ebx,j
! shl ebx,2
! add ebx,i
! mov w,ebx
! mov eax,c
! mov eax,c
! add eax,m
! mul k
! add eax,w
! mov w,eax
! mov eax,[eax]
! mov t,eax
! mov eax,&h050202
! mul m
! movd mm1,eax
! paddusb mm1,t
m01:
! mov eax,w
! movd [eax],mm1
! emms
! inc j
! cmp j,330
! jl mfg ;------------->
! inc m
! cmp m,30
! jl mfc ;------------->
! popad
! ret
NICE:'--------------------------------------------------------------------------------
! PUSHAD
! mov eax,&h00220022
! movd mm5,eax
! mov edx,ddsd[16]
! push edx
! mov eax,ddsd[36]
! add eax,860 ;1260
! push eax
! pop esi ;esi ' htmp=ddsd.lpSurface íà÷àëî
! push edx
! pop eax
! mov ebx,250
! mul ebx
! add esi,eax
! pop edx
! mov edi,esi ; new line
! mov eax,offset obl ;obl
! mov ebx,offset pal ;pal
! xor ecx,ecx
! mov j,0
mnt0:
! mov i,0
mnt1:
! mov cl,[eax]
! inc eax
! push eax
! push ebx
! pop eax
! push ecx
! shl ecx,2
! add eax,ecx
! pop ecx
! movd mm4,[eax]
! mov eax,[eax]
! cmp eax,&h00007F7F
! pop eax
! je non ;------------->
! psubb mm4,mm5
! movd [esi],mm4
non:
! add esi,4
! inc i
! cmp i,320
! jl mnt1 ;------------->
! add edi,edx
! push edi
! pop esi
! inc j
! cmp j,44
! jl mnt0 ;------------->
! popad
! ret
LINES1:'-----------------------------------------------------------------
! pushad
! mov eax,&h00010000
! movd mm1,eax
! mov esi,ddsd[36]
! mov edi,ddsd[16]
! add esi,1680
! mov ecx,0
! mov j,10
mln11:
! mov i,0
! mov eax,j
! mul edi
! add eax,esi
! sub ecx,6
mln12:
! mov w,0
mln13:
! mov edx,eax
! add edx,ecx
! add edx,w
! push ecx
! mov ecx,[edx]
! movd mm2,ecx
! pop ecx
! paddusb mm2,mm1
! movd [edx],mm2
! inc w
! mov edx,2400
! add edx,ecx
! shr edx,4
! cmp w,edx
! jl mln13 ;-------------->
! inc i
! cmp i,5 ; contrast
! jl mln12 ;-------------->
! inc j
! cmp j,300
! jl mln11 ;-------------->
! popad
! ret
LINES2:'-----------------------------------------------------------------
! pushad
! mov eax,&h00010000
! movd mm1,eax
! mov esi,ddsd[36]
! mov edi,ddsd[16]
! add esi,2550
! mov ecx,0
! mov j,80
mln21:
! mov i,0
! mov eax,j
! mul edi
! add eax,esi
! sub ecx,9
mln22:
! mov w,0
mln23:
! mov edx,eax
! add edx,ecx
! add edx,w
! push ecx
! mov ecx,[edx]
! movd mm2,ecx
! pop ecx
! paddusb mm2,mm1
! pushad
! mov eax,edi
! mul j
! add eax,esi
! mov m,eax
! popad
! cmp m,edx
! jl mvd2
! movd [edx],mm2
MVD2:
! inc w
! mov edx,2400
! add edx,ecx
! shr edx,4
! cmp w,edx
! jl mln23 ;-------------->
! inc i
! cmp i,3 ; contrast
! jl mln22 ;-------------->
! inc j
! cmp j,320
! jl mln21 ;-------------->
! popad
! ret
datacol:
! db 1, 1, 0, 0, 1, 1, 0, 0
! db 1, 1, 0, 0, 1, 1, 0, 0
! db 1, 0, 0, 0, 1, 0, 0, 0
! db &h7F,&h7F, 0, 0,&h7F,&hB0,&hB0,&h00
! db 0, 0,&hFF, 0, 0, 0,&hFF, 0
pal:'OFFSET PALETTE FOR SHOW
!DB &hFC,&hFC,&hFC,&h0 , &h9C,&h9C,&h9C,&h0 , &hA4,&hA4,&hAC,&h0 , &h70,&h70,&h78,&h0
!DB &h28,&h28,&h30,&h0 , &hA4,&hA4,&hDC,&h0 , &h40,&h40,&h58,&h0 , &h4 ,&h14,&h8 ,&h0
!DB &h4 ,&h1C,&h8 ,&h0 , &h8 ,&h14,&h8 ,&h0 , &h0 ,&h0 ,&hFC,&h0 , &h8 ,&h1C,&hC ,&h0
!DB &hC ,&h14,&h14,&h0 , &h18,&h1C,&h18,&h0 , &h94,&h9C,&hCC,&h0 , &h4 ,&h20,&hC ,&h0
!DB &h8 ,&h20,&hC ,&h0 , &h4 ,&h24,&h10,&h0 , &h68,&h70,&h94,&h0 , &h4 ,&h28,&h10,&h0
!DB &h8 ,&h20,&h14,&h0 , &h8 ,&h2C,&h10,&h0 , &hC ,&h28,&h1C,&h0 , &hAC,&hB4,&hCC,&h0
!DB &h84,&h8C,&hA4,&h0 , &h4 ,&h30,&h14,&h0 , &h10,&h40,&hD4,&h0 , &h4 ,&h34,&h18,&h0
!DB &h70,&h84,&hAC,&h0 , &h78,&h94,&hCC,&h0 , &h60,&h78,&hB4,&h0 , &h30,&h48,&h84,&h0
!DB &hCC,&hD4,&hE4,&h0 , &h94,&h9C,&hAC,&h0 , &h50,&h58,&h68,&h0 , &h40,&h58,&h8C,&h0
!DB &h8 ,&h30,&h14,&h0 , &h8 ,&h34,&h18,&h0 , &h68,&h8C,&hCC,&h0 , &h48,&h68,&hAC,&h0
!DB &h8 ,&h38,&h18,&h0 , &h14,&h2C,&h1C,&h0 , &h10,&h34,&h1C,&h0 , &h14,&h38,&h1C,&h0
!DB &hC ,&h3C,&h20,&h0 , &h14,&h38,&h24,&h0 , &h28,&h2C,&h1C,&h0 , &h50,&h78,&hBC,&h0
!DB &h24,&h24,&h24,&h0 , &h24,&h34,&h24,&h0 , &h28,&h34,&h30,&h0 , &h30,&h2C,&h30,&h0
!DB &h38,&h38,&h38,&h0 , &hC ,&h44,&h1C,&h0 , &hB4,&hC4,&hDC,&h0 , &h84,&hAC,&hE4,&h0
!DB &hC ,&h40,&h24,&h0 , &hC ,&h4C,&h24,&h0 , &h70,&h8C,&hAC,&h0 , &h70,&h78,&h84,&h0
!DB &hC4,&hD4,&hE4,&h0 , &hAC,&hCC,&hEC,&h0 , &hC ,&h50,&h28,&h0 , &h14,&h40,&h24,&h0
!DB &h14,&h40,&h28,&h0 , &h18,&hA4,&hFC,&h0 , &h68,&h78,&h84,&h0 , &h10,&h48,&h24,&h0
!DB &hB4,&hD4,&hDC,&h0 , &h1C,&h40,&h24,&h0 , &h58,&hA4,&hB4,&h0 , &h84,&hEC,&hFC,&h0
!DB &hF4,&hF4,&hF4,&h0 , &hE4,&hE4,&hE4,&h0 , &hC4,&hCC,&hCC,&h0 , &h84,&h8C,&h8C,&h0
!DB &h70,&h8C,&h8C,&h0 , &h70,&hA4,&hA4,&h0 , &h20,&hFC,&hFC,&h0 , &h18,&h44,&h28,&h0
!DB &h1C,&h4C,&h2C,&h0 , &h10,&h40,&h34,&h0 , &h1C,&h40,&h34,&h0 , &h0 ,&hFC,&hF4,&h0
!DB &h50,&h94,&h8C,&h0 , &h58,&h94,&h8C,&h0 , &h18,&h48,&h34,&h0 , &h18,&h4C,&h38,&h0
!DB &h10,&h5C,&h2C,&h0 , &h14,&h60,&h34,&h0 , &h1C,&h7C,&h3C,&h0 , &h60,&h94,&h84,&h0
!DB &h28,&h44,&h24,&h0 , &h24,&h48,&h34,&h0 , &h24,&h58,&h38,&h0 , &h60,&h78,&h68,&h0
!DB &h0 ,&hFC,&h38,&h0 , &h60,&h94,&h68,&h0 , &h68,&hA4,&h70,&h0 , &h0 ,&hFC,&h10,&h0
!DB &h94,&hA4,&h94,&h0 , &h0 ,&hFC,&h0 ,&h0 , &h0 ,&hEC,&h0 ,&h0 , &h0 ,&h9C,&h0 ,&h0
!DB &h40,&hFC,&h38,&h0 , &h60,&hFC,&h50,&h0 , &h8C,&hFC,&h78,&h0 , &h28,&hFC,&h0 ,&h0
!DB &h68,&h8C,&h60,&h0 , &h58,&h78,&h50,&h0 , &h78,&h94,&h70,&h0 , &h78,&hFC,&h50,&h0
!DB &h60,&hFC,&h30,&h0 , &h30,&hAC,&h0 ,&h0 , &h78,&hFC,&h40,&h0 , &h50,&hFC,&h0 ,&h0
!DB &h9C,&hC4,&h84,&h0 , &h9C,&hFC,&h60,&h0 , &h70,&hFC,&h0 ,&h0 , &h9C,&hB4,&h84,&h0
!DB &h78,&h94,&h60,&h0 , &h78,&h9C,&h58,&h0 , &h94,&hFC,&h0 ,&h0 , &h30,&h4C,&h2C,&h0 ;123
!DB &h34,&h48,&h34,&h0 , &h34,&h50,&h34,&h0 , &hA4,&hAC,&h84,&h0 , &h28,&h60,&h3C,&h0 ;127
!DB &h1C,&h5C,&h44,&h0 , &h2C,&h4C,&h40,&h0 , &h24,&h58,&h44,&h0 , &h38,&h4C,&h40,&h0 ;131
!DB &h38,&h38,&h38,&h0 , &h94,&h94,&h84,&h0 , &h78,&h78,&h68,&h0 , &h94,&h94,&h70,&h0 ;135
!DB &hC4,&hC4,&h78,&h0 , &h40,&h40,&h28,&h0 , &h38,&h58,&h44,&h0 , &h2C,&h60,&h44,&h0 ;139
!DB &hB4,&hAC,&h78,&h0 , &h2C,&h6C,&h50,&h0 , &h50,&h48,&h38,&h0 , &h7F,&h7F,&h00,&h0 ;---->< &hBC,&hA4,&h78,&h0
!DB &h24,&h78,&h44,&h0 , &h70,&h60,&h48,&h0 , &h34,&h60,&h48,&h0 , &hF4,&hEC,&hE4,&h0
!DB &h38,&h30,&h28,&h0 , &hE4,&hDC,&hD4,&h0 , &hDC,&hC4,&hB4,&h0 , &hB4,&h94,&h78,&h0
!DB &hCC,&h8C,&h58,&h0 , &hE4,&hCC,&hBC,&h0 , &hCC,&h9C,&h78,&h0 , &h34,&h6C,&h58,&h0
!DB &h30,&h74,&h48,&h0 , &h30,&h78,&h54,&h0 , &hB8,&h94,&h78,&h0 , &hCC,&h94,&h64,&h0
!DB &hCC,&hB4,&hA4,&h0 , &hB4,&h8C,&h70,&h0 , &h44,&h4C,&h34,&h0 , &h40,&h58,&h3C,&h0
!DB &h48,&h48,&h48,&h0 , &hCC,&hAC,&h9C,&h0 , &hBC,&h9C,&h8C,&h0 , &hB4,&h94,&h84,&h0
!DB &h4C,&h5C,&h4C,&h0 , &h4C,&h50,&h54,&h0 , &hDC,&hB4,&hA4,&h0 , &hC4,&h9C,&h8C,&h0
!DB &hBC,&h94,&h84,&h0 , &hB4,&h8C,&h78,&h0 , &h50,&h58,&h40,&h0 , &h58,&h58,&h58,&h0
!DB &hD4,&hCC,&hCC,&h0 , &hCC,&hC4,&hC4,&h0 , &hC4,&hBC,&hBC,&h0 , &hEC,&hDC,&hDC,&h0
!DB &hB4,&hA4,&hA4,&h0 , &h94,&h84,&h84,&h0 , &hCC,&hB4,&hB4,&h0 , &h70,&h60,&h60,&h0
!DB &h9C,&h70,&h70,&h0 , &h50,&h58,&h68,&h0 , &h40,&h60,&h4C,&h0 , &h40,&h6C,&h50,&h0
!DB &h40,&h74,&h58,&h0 , &h58,&h64,&h58,&h0 , &h58,&h74,&h58,&h0 , &h4C,&h7C,&h64,&h0
!DB &h5C,&h64,&h60,&h0 , &h50,&h70,&h64,&h0 , &h70,&h48,&h50,&h0 , &h60,&h64,&h5C,&h0
!DB &h64,&h68,&h64,&h0 , &h64,&h74,&h68,&h0 , &h68,&h74,&h74,&h0 , &hC4,&hAC,&hB4,&h0
!DB &h78,&h78,&h74,&h0 , &h34,&h84,&h4C,&h0 , &hB4,&hA4,&hAC,&h0 , &h3C,&h84,&h58,&h0
!DB &hD4,&hAC,&hC4,&h0 , &h3C,&h80,&h64,&h0 , &h4C,&h84,&h58,&h0 , &h44,&h8C,&h68,&h0
!DB &hCC,&hA4,&hC4,&h0 , &h48,&h90,&h6C,&h0 , &hC4,&hBC,&hC4,&h0 , &hB4,&hAC,&hB4,&h0
!DB &h94,&h8C,&h94,&h0 , &h84,&h78,&h84,&h0 , &h48,&h40,&h48,&h0 , &hD4,&hB4,&hD4,&h0
!DB &h58,&h84,&h68,&h0 , &h50,&h94,&h70,&h0 , &h64,&h84,&h6C,&h0 , &h64,&h84,&h74,&h0
!DB &hC4,&hA4,&hCC,&h0 , &h9C,&h70,&hA4,&h0 , &hBC,&h9C,&hC4,&h0 , &h64,&h90,&h78,&h0
!DB &h84,&h70,&h8C,&h0 , &h68,&h58,&h70,&h0 , &h60,&h40,&h70,&h0 , &h74,&h84,&h78,&h0
!DB &h68,&h94,&h84,&h0 , &h74,&h8C,&h88,&h0 , &h78,&h98,&h84,&h0 , &h60,&hA4,&h84,&h0
!DB &h68,&h60,&h70,&h0 , &h7C,&hA4,&h8C,&h0 , &hBC,&hB4,&hC4,&h0 , &h78,&hA4,&h90,&h0
!DB &h80,&h7C,&h7C,&h0 , &h84,&h80,&h7C,&h0 , &hA4,&h8C,&hCC,&h0 , &h88,&h84,&h84,&h0
!DB &h84,&h94,&h88,&h0 , &h88,&h98,&h90,&h0 , &h90,&h88,&h88,&h0 , &h90,&h94,&h88,&h0
!DB &h98,&h98,&h98,&h0 , &h88,&hA4,&h94,&h0 , &h84,&hAC,&hA0,&h0 , &h68,&h60,&h84,&h0
!DB &hAC,&hA4,&hCC,&h0 , &h9C,&h8C,&hDC,&h0 , &hA4,&h9C,&hCC,&h0 , &h38,&h28,&hAC,&h0
!DB &h20,&h0 ,&hF4,&h0 , &h58,&h50,&hCC,&h0 , &h40,&h38,&hC4,&h0 , &h0 ,&h0 ,&h0 ,&h0
!DB &h68,&h94,&h84,&h0 , &h74,&h8C,&h88,&h0 , &h78,&h98,&h84,&h0 , &h60,&hA4,&h84,&h0
!DB &h68,&h60,&h70,&h0 , &h7C,&hA4,&h8C,&h0 , &hBC,&hB4,&hC4,&h0 , &h78,&hA4,&h90,&h0
!DB &h80,&h7C,&h7C,&h0 , &h84,&h80,&h7C,&h0 , &hA4,&h8C,&hCC,&h0 , &h88,&h84,&h84,&h0
!DB &h84,&h94,&h88,&h0 , &h88,&h98,&h90,&h0 , &h90,&h88,&h88,&h0 , &h90,&h94,&h88,&h0
!DB &h98,&h98,&h98,&h0 , &h88,&hA4,&h94,&h0 , &h84,&hAC,&hA0,&h0 , &h68,&h60,&h84,&h0
!DB &hAC,&hA4,&hCC,&h0 , &h9C,&h8C,&hDC,&h0 , &hA4,&h9C,&hCC,&h0 , &h38,&h28,&hAC,&h0
!DB &h20,&h0 ,&hF4,&h0 , &h58,&h50,&hCC,&h0 , &h40,&h38,&hC4,&h0 , &h0 ,&h0 ,&h0 ,&h0
!DB &h68,&h94,&h84,&h0 , &h74,&h8C,&h88,&h0 , &h78,&h98,&h84,&h0 , &h60,&hA4,&h84,&h0
!DB &h68,&h60,&h70,&h0 , &h7C,&hA4,&h8C,&h0 , &hBC,&hB4,&hC4,&h0 , &h78,&hA4,&h90,&h0
!DB &h80,&h7C,&h7C,&h0 , &h84,&h80,&h7C,&h0 , &hA4,&h8C,&hCC,&h0 , &h88,&h84,&h84,&h0
!DB &h84,&h94,&h88,&h0 , &h88,&h98,&h90,&h0 , &h90,&h88,&h88,&h0 , &h90,&h94,&h88,&h0
!DB &h98,&h98,&h98,&h0 , &h88,&hA4,&h94,&h0 , &h84,&hAC,&hA0,&h0 , &h68,&h60,&h84,&h0
!DB &hAC,&hA4,&hCC,&h0 , &h9C,&h8C,&hDC,&h0 , &hA4,&h9C,&hCC,&h0 , &h38,&h28,&hAC,&h0
!DB &h20,&h0 ,&hF4,&h0 , &h58,&h50,&hCC,&h0 , &h40,&h38,&hC4,&h0 , &h0 ,&h0 ,&h0 ,&h0
!DB &h80,&h7C,&h7C,&h0 , &h84,&h80,&h7C,&h0 , &hA4,&h8C,&hCC,&h0 , &h88,&h84,&h84,&h0
!DB &h84,&h94,&h88,&h0 , &h88,&h98,&h90,&h0 , &h90,&h88,&h88,&h0 , &h90,&h94,&h88,&h0
!DB &h98,&h98,&h98,&h0 , &h88,&hA4,&h94,&h0 , &h84,&hAC,&hA0,&h0 , &h68,&h60,&h84,&h0
!DB &hAC,&hA4,&hCC,&h0 , &h9C,&h8C,&hDC,&h0 , &hA4,&h9C,&hCC,&h0 , &h38,&h28,&hAC,&h0
!DB &h20,&h0 ,&hF4,&h0 , &h58,&h50,&hCC,&h0 , &h40,&h38,&hC4,&h0 , &h0 ,&h0 ,&h0 ,&h0
'DATA INCLUDE
#INCLUDE "town1.inc"
#INCLUDE "town2.inc"
#INCLUDE "tree1.inc"
#INCLUDE "tree2.inc"
#INCLUDE "tree3.inc"
#INCLUDE "tree4.inc"
#INCLUDE "tree5.inc"
#INCLUDE "nice1.inc"
#INCLUDE "nice2.inc"
END SUB
'_____________________________________________________________________________________________
'
' for Dynamic (for moving) >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>>>>><
'_____________________________________________________________________________________________
'
SUB NEXTFLAG
#REGISTER NONE
LOCAL i AS LONG 'for i~
LOCAL J AS LONG 'for j~
STATIC K AS SINGLE 'FPU tmp
STATIC J1 AS SINGLE 'FPU tmp
STATIC H AS LONG
LOCAL col AS SINGLE 'FRAC--
STATIC w AS LONG
LOCAL s AS LONG
LOCAL c AS LONG
LOCAL x AS LONG
LOCAL y AS LONG
! PUSHAD
! mov esi,ddsd[36]
! mov edi,ddsd[16]
! mov c,0
mstart1:
! mov ebx,offset sea
! mov s,0
mstart2:
! pushad
x = RND(0,638)
y = RND(320,362)
! popad
! mov eax,edi
! mul y
! add eax,esi
! mov ecx,eax
! mov eax,4
! mul x
! add ecx,eax
! mov eax,[ebx]
! mov [ecx],eax
'--------------------------------
! mov eax,edi
! add y,25
! mul y
! add eax,esi
! mov ecx,eax
! mov eax,4
! mul x
! add ecx,eax
! mov eax,[ebx]
! mov [ecx],eax
! mov [ecx+4],eax
! CALL SEAGREEN
! inc s
! add ebx,4
! cmp s,11
! jl mstart2
! inc c
! cmp c,%SEA_WAIT ;60
! jl mstart1
! CALL CO
! CALL RE
! POPAD
EXIT SUB
CHECKZ:'----------------------------------------------------------
! push ebx
! push edx
! push esi
! push edi
! mov ebx,offset sea
! xor edi,edi
! xor esi,esi
mch:
! mov eax,[ebx]
! cmp [ecx],eax
! jne mcc0 ;-------->< je
! inc edi
mcc0:
! cmp [ecx+4],eax
! jne mcc1 ;--------><
! inc edi
mcc1:
! cmp [ecx+8],eax
! jne mcc2 ;--------><
! inc edi
mcc2:
! add ebx,4
! inc esi
! cmp esi,12
! jl mch ;-------->
! xor eax,eax
! cmp edi,3
! je mkf ;-------->
mco:
! mov eax,&hFFFFFFFF
mkf:
! pop edi
! pop esi
! pop edx
! pop ebx
! ret
SEAGREEN:'-----------------------------------------------------------
! PUSHAD
! cmp x,637
! jl mlow ;--------NON-------->
! mov x,637
mlow:
! mov eax,edi
! add y,43
! mul y
! add eax,esi
! mov ecx,eax
! mov eax,4
! mul x
! add ecx,eax
! CALL CHECKZ
! cmp eax,&hFFFFFFFF
! je ex ;----------->
! mov eax,[ebx]
! mov [ecx],eax
! mov [ecx+4],eax
! mov [ecx+8],eax
ex:
! POPAD
! ret
CO:'--------------------------------------------------------
j1 = 6
! pushad
! inc w
! cmp w,9
! jg mgr ;------------------>
! popad
! ret
mgr:
! mov w,0
! mov esi,ddsd[36]
! mov edi,ddsd[16]
! xor ecx,ecx
! mov eax,edi
! mov ebx,20
! mul ebx
! add eax,esi
! add eax,2000
! mov edx,gptr
! mov i,0
mco1:
! emms
! fild i
! fdiv j1
! fst col
! fld K
! fadd FK
! fst K
! fadd col
! fcos
! fst col
! fld1
! fld col
! Fscale
! fist H
! FINIT
! mov j,0
! pushad
! mov eax,h
! shl eax,2
! mov c,eax
! popad
! add eax,c
mco2:
! mov ebx,[edx]
! mov [eax],ebx
! add edx,4
! add eax,4
! inc j
! cmp j,120
! jl mco2 ;------------>
! sub eax,480
! sub eax,c
! add eax,edi
! inc i
! cmp i,22
! jl mco1 ;------------>
! popad
! ret
RE:'-------------------- DYNAMIC -------------------------------------
! pushad
'..................................
' Dynamic part
' more code (Your code) for move...
' Dynamic part
'..................................
! popad
! ret
sea:'------------------------------------------------------------------
'palette own for sea
! dd &h0058849C, &h0094A4CC, &h00B4BCD4, &h00C4CCD4
! dd &h009CACC4, &h008494AC, &h007C8CAC, &h00C4C4C4
! dd &h00587494, &h006C7CA4, &h00DCDCDC, &h00007F7F
'palette two for sea
! dd &h0078A4BC, &h00B4C4DC, &h00D4DCE4, &h00E4ECF4
! dd &h00BCCCE4, &h00A4B4CC, &h009CACCC, &h00E4E4E4
! dd &h007894B4, &h008C9CC4, &h00FCFCFC
END SUB
'_______________________________________________________________________________
'
' end end end end end end end end end end end end end end end end
'_______________________________________________________________________________
'
------------------
' I divade file onto a few part (*.INC)...
'
' This is STATIC (NOT Dynamic) MMX model FOR DDRAW;
' This is easy and simple example for DDRAW with mixed MMX and FPU;
' The code is not optimized;
' The code is raw, You can =dry= this code;
' You can easy make Dynamic (moving) model from this code;
' This example is small part of large prog, I make it in 1997 in
' PB3.5 DOS-version for Vesa-r;
' Now this is WIN32 version;
' I try make code as simple - for understand;
'
'
' --------------------------- V.Shulakov ---------------------------
#COMPILE EXE
#OPTION VERSION4
#DIM ALL
#INCLUDE "WIN32API.INC"
#INCLUDE "DDRAW.INC"
%NULL_PAINT = &h00000000
%BLUE_PAINT = &h000099ff
%YELL_PAINT = &h00ffff00
%SEA_WAIT = 100
DECLARE SUB NEXTFLAG()
GLOBAL ddsd AS DDSURFACEDESC
GLOBAL fk AS SINGLE
GLOBAL lpDDSPrimary AS LONG
GLOBAL ddscaps AS DDSCAPS
GLOBAL LPDD AS DWORD
GLOBAL DDWIDTH AS LONG
GLOBAL DDHEIGHT AS LONG
GLOBAL FLAG AS LONG
'__________________________________ START ___________________________________
'
FUNCTION WINMAIN (BYVAL hInst AS LONG, _
BYVAL hPrevInst AS LONG, _
CmdLine AS ASCIIZ PTR, _
BYVAL CmdShow AS LONG) EXPORT AS LONG
LOCAL Msg AS tagMsg
LOCAL wndclass AS WndClassEx
GLOBAL hWnd AS LONG
LOCAL szClassName AS ASCIIZ * 80
LOCAL szDisplayName AS ASCIIZ * 80
LOCAL TMP AS LONG
GLOBAL GPTR AS LONG
GLOBAL YPTR AS LONG
DIM G(0:21,1:120) AS GLOBAL LONG
GPTR = VARPTR(G(1,1))
ddwidth = 640
ddheight = 480
fk = 0.05
szClassName = "DDraw MMX-FPU demo"
szDisplayName = szClassName
wndclass.cbSize = SIZEOF(WndClass)
wndclass.style = %CS_HREDRAW OR %CS_VREDRAW
wndclass.lpfnWndProc = CODEPTR( WndProc )
wndclass.cbClsExtra = 0
wndclass.cbWndExtra = 0
wndclass.hInstance = hinst
wndclass.hIcon = 0
wndclass.hCursor = 0
wndclass.hbrBackground = GetStockObject( %white_BRUSH )
wndclass.lpszMenuName = %NULL
wndclass.lpszClassName = VARPTR( szClassName )
wndclass.hIconSm = 0
RANDOMIZE 21
RegisterClassEx wndclass
HWND=CreateWindowEx(0,szClassName,_
szDisplayName,_
%WS_POPUP,_
0, 0, ddwidth, ddheight,_
BYVAL %NULL, BYVAL %NULL,_
hInst, BYVAL %NULL)
ShowWindow hWnd, %SW_SHOWNORMAL
SetFocus hWnd
ShowCursor 0
IF %DD_OK<>DDDirectDrawCreate(BYVAL %NULL,lpDD,BYVAL %NULL) THEN
! JMP FATAL
END IF
IF %DD_OK<>DDSetCooperativeLevel(lpDD, hWnd, _
%DDSCL_EXCLUSIVE OR %DDSCL_FULLSCREEN) THEN
! JMP FATAL
END IF
IF %DD_OK<>DDSetDisplayMode( lpDD, ddwidth, ddheight, 32) THEN
! JMP FATAL
END IF
ddsd.dwSize=SIZEOF(DDSD)
ddsd.dwFlags=%DDSD_CAPS
ddsd.ddsCaps.dwCaps=%DDSCAPS_PRIMARYSURFACE
IF %DD_OK<>DDCreateSurface(lpDD, ddsd, lpDDSPrimary) THEN
! JMP FATAL
END IF
'__________________________________________________________________________________
'
WHILE -1
IF 0<>PeekMessage(msg, BYVAL %NULL, 0, 0, %PM_REMOVE) THEN
IF msg.message = %WM_QUIT THEN
PostQuitMessage msg.wParam
EXIT LOOP
ELSE
TranslateMessage msg
DispatchMessage msg
END IF
ELSE
IF GetFocus = hWnd THEN
ddsd.dwSize= SIZEOF(DDSD) '(DDSURFACEDESC)
ddsd.dwFlags=%DDSD_PITCH
WHILE -1
TMP=DDSLock(lpDDSPrimary, BYVAL %NULL, ddsd, %DDLOCK_WAIT, BYVAL %NULL)
IF TMP = %DD_OK THEN
EXIT LOOP
ELSEIF TMP = %DDERR_SURFACELOST THEN
DDSRestore lpDDSPrimary
END IF
WEND
DDWaitForVerticalBlank lpDD, %DDWAITVB_BLOCKBEGIN, BYVAL %NULL
STATIC L AS LONG
IF L=0 THEN
! call NEXTframe
! mov L,1
ELSE
! call NEXTFLAG
END IF
DDSUNLOCK lpDDSPrimary, ddsd.lpSurface
ELSE
! mov L,0
END IF
END IF
WEND
FATAL: '************************************************************************************
IF lpDD <> %NULL THEN
IF lpDDSPrimary <> %NULL THEN
DDIRelease lpDDSPrimary
lpDDSPrimary = %NULL
END IF
DDIRelease lpDD
lpDD = %NULL
END IF
FUNCTION= msg.wParam
END FUNCTION
'_____________________________________________________________________________________
' Window Proc
'_____________________________________________________________________________________
'
FUNCTION WndProc (BYVAL hWin AS LONG, BYVAL uMsg AS LONG, _
BYVAL wParam AS LONG, BYVAL lParam AS LONG) EXPORT AS LONG
IF uMsg = %WM_KEYDOWN THEN
IF wParam = %VK_ESCAPE THEN
PostQuitMessage 0
FUNCTION=0
EXIT FUNCTION
END IF
ELSEIF uMsg = %WM_DESTROY THEN
PostQuitMessage 0
FUNCTION=0
EXIT FUNCTION
END IF
FUNCTION = DefWindowProc(hWin, uMsg, wParam, lParam)
END FUNCTION
'_________________________________________________________________________________________
'
SUB nextFrame
#REGISTER NONE
LOCAL j AS LONG
LOCAL i AS LONG
LOCAL c AS LONG
LOCAL k AS LONG
LOCAL t AS LONG
! PUSHAD
! mov eax,offset datacol
! movq mm1,[eax]
! movq mm2,[eax+8]
! movq mm3,[eax+16]
! movd mm5,[eax+24]
! mov esi,ddsd[36] ; htmp=ddsd.lpSurface íà÷àëî
! mov edi,esi ; new line
! mov edx,ddsd[16]
! mov t,0
! push edx
! mov j,0
mline:
! mov i,0
! inc ecx
! cmp ecx,1
! jne mblue
! paddsb mm1,mm2
! jmp mstart
mblue:
! xor ecx,ecx
! paddsb mm1,mm3
mstart:
! movq [esi],mm1
! add esi,8
! inc i
! cmp i,320
! jl mstart ;----------->
! add edi,edx
! mov esi,edi
! inc j
! cmp j,480
! jl mline ;----------->
FTOWN:'------------------------------------------------------------------------------
! mov eax,ddsd[36]
! push eax
! pop esi ;esi ' htmp=ddsd.lpSurface íà÷àëî
! push edx
! pop eax
! mov ebx,253
! mul ebx
! add esi,eax
! pop edx
! mov edi,esi ; new line
! mov eax,offset town ;town
! mov ebx,offset pal ;pal
! xor ecx,ecx
! mov j,0
mlt0:
! mov i,0
mlt1:
! mov cl,[eax]
! inc eax
! push eax
! push ebx
! pop eax
! push ecx
! shl ecx,2
! add eax,ecx
! pop ecx
! movd mm4,[eax]
! pop eax
! cmp j,5
! jl mn1
! cmp j,26
! jg mn1
! cmp i,200
! jl mn1
'---------------------
! pushad
! mov eax,GPTR
! add eax,t
! movd [eax],mm4
! add t,4
! popad
'---------------------
! jmp mn2
mn1:
! movd [esi],mm4
mn2:
! add esi,4
! inc i
! cmp i,320
! jl mlt1 ;------------->
! add edi,edx
! push edi
! pop esi
! inc j
! cmp j,66
! jl mlt0 ;------------->
! CALL NICE
! CALL TREES
! CALL STARS
! CALL REDDS
! CALL REDDSU
! CALL COW
! CALL RADIO_SH
! CALL LINES1
! CALL LINES2
! EMMS
! POPAD
EXIT SUB 'good work
TREES: '---------------------------------------------------------------------------
! pushad
! mov esi,ddsd[36]
! mov edi,esi ; new line
! mov edx,ddsd[16]
! push edx
! mov eax,edx ;ddsd[16]
! mov edx,77
! mul edx
! mov k,eax
! pop edx
! mov eax,edx
! push edx
! mov ebx,385
! mul ebx
! add esi,eax
! pop edx
! mov edi,esi ; new line
! mov eax,offset tree ;tree
! mov ebx,offset pal ;pal
! xor ecx,ecx
! mov j,0
mltr0:
! mov i,0
mltr1:
! mov cl,[eax]
! inc eax
! push eax
! push ebx
! pop eax
! add eax,ecx
! add eax,ecx
! add eax,ecx
! add eax,ecx
! movd mm4,[eax]
! mov eax,[eax]
! mov c,eax
! pop eax
! movd [esi],mm4
! add esi,4
! inc i
! cmp i,320
! jl mltr1 ;------------->
! add edi,edx
! push edi
! pop esi
! inc j
! cmp j,94
! jne mfor ;------------->
! add edi,1280
! sub edi,k
mfor:
! cmp j,171
! jl mltr0 ;------------->
! popad
! ret
STARS:'------------------------------------------------------------------------------
! pushad
! mov esi,ddsd[36]
! mov edi,ddsd[16]
! mov c,0
mzt1:
! EMMS
! pushad
j = RND(20,250)
i = RND(10,638)
! popad
! mov eax,edi
! mul j
! add eax,esi
! mov ecx,eax
! mov eax,4
! mul i
! add ecx,eax
! shr j,3
! movd mm2,j
! PUNPCKLBW mm2,mm2 ;LAY
! PSUBsB mm5,mm2
! movd [ecx],mm5
! inc c
! cmp c,70
! jl mzt1 ;----------->
! popad
! ret
REDDS:'-----------------------------------------------------------------------------
! pushad
! mov esi,ddsd[36]
! mov edi,ddsd[16]
! mov eax,offset datacol
! movq mm1,[eax+28]
! mov eax,edi
! mov ebx,319 ;x
! mul ebx
! add eax,esi
! mov c,0
mred:
! movd [eax],mm1
! add eax,4
! inc c
! cmp c,360
! jl mred ;------------>
! popad
! ret
REDDSU:'--------------------------------------------------------------------------------
! pushad
! mov esi,ddsd[36]
! mov edi,ddsd[16]
! mov eax,offset datacol
! movd mm1,[eax+24]
! movd mm2,[eax+24]
! mov c,&h00030100
! mov eax,edi
! mov ebx,250 ;x
! mul ebx
! add eax,esi
! mov i,0
mred1:
! mov j,0
mred2:
! movd ecx,mm2
! cmp [eax],ecx
! jne mnos ;------------>
! movd [eax],mm1
mnos:
! add eax,4
! inc j
! cmp j,640
! jl mred2 ;------------>
! PADDB mm1,c
! sub eax,2560
! add eax,edi
! inc i
! cmp i,70
! jl mred1 ;------------>
! popad
! ret
COW:'---------------------------------------------------------------------------------
! pushad
! mov esi,ddsd[36]
! mov edi,ddsd[16]
! mov eax,edi
! mov ebx,20
! mul ebx
! add eax,esi
! add eax,2000
! mov edx,gptr
! mov i,0
mcw1:
! mov j,0
mcw2:
! mov ebx,[edx]
! cmp ebx,&h7f7f
! jne mnow ;----------->
! mov ebx,[eax]
! mov [edx],ebx
mnow:
! mov [eax],ebx
! add edx,4
! add eax,4
! inc j
! cmp j,120
! jl mcw2 ;----------->
! sub eax,480
! add eax,edi
! inc i
! cmp i,22
! jl mcw1 ;----------->
! popad
! ret
RADIO_SH:'-------------------------------------------------------------------------------
LOCAL m AS LONG
LOCAL w AS LONG
! pushad
! mov esi,ddsd[36]
! mov edi,ddsd[16]
! mov k,edi
! mov eax,400
! mul k
! add eax,esi
! mov i,eax
! mov m,0
mfc:
! mov j,0
mfg:
! mov w,210
! fld j
! fdiv w
! mov w,550
! fisub w
! fcos
! mov w,350
! fimul w
! fist c
! finit
! mov ebx,j
! shl ebx,2
! add ebx,i
! mov w,ebx
! mov eax,c
! mov eax,c
! add eax,m
! mul k
! add eax,w
! mov w,eax
! mov eax,[eax]
! mov t,eax
! mov eax,&h050202
! mul m
! movd mm1,eax
! paddusb mm1,t
m01:
! mov eax,w
! movd [eax],mm1
! emms
! inc j
! cmp j,330
! jl mfg ;------------->
! inc m
! cmp m,30
! jl mfc ;------------->
! popad
! ret
NICE:'--------------------------------------------------------------------------------
! PUSHAD
! mov eax,&h00220022
! movd mm5,eax
! mov edx,ddsd[16]
! push edx
! mov eax,ddsd[36]
! add eax,860 ;1260
! push eax
! pop esi ;esi ' htmp=ddsd.lpSurface íà÷àëî
! push edx
! pop eax
! mov ebx,250
! mul ebx
! add esi,eax
! pop edx
! mov edi,esi ; new line
! mov eax,offset obl ;obl
! mov ebx,offset pal ;pal
! xor ecx,ecx
! mov j,0
mnt0:
! mov i,0
mnt1:
! mov cl,[eax]
! inc eax
! push eax
! push ebx
! pop eax
! push ecx
! shl ecx,2
! add eax,ecx
! pop ecx
! movd mm4,[eax]
! mov eax,[eax]
! cmp eax,&h00007F7F
! pop eax
! je non ;------------->
! psubb mm4,mm5
! movd [esi],mm4
non:
! add esi,4
! inc i
! cmp i,320
! jl mnt1 ;------------->
! add edi,edx
! push edi
! pop esi
! inc j
! cmp j,44
! jl mnt0 ;------------->
! popad
! ret
LINES1:'-----------------------------------------------------------------
! pushad
! mov eax,&h00010000
! movd mm1,eax
! mov esi,ddsd[36]
! mov edi,ddsd[16]
! add esi,1680
! mov ecx,0
! mov j,10
mln11:
! mov i,0
! mov eax,j
! mul edi
! add eax,esi
! sub ecx,6
mln12:
! mov w,0
mln13:
! mov edx,eax
! add edx,ecx
! add edx,w
! push ecx
! mov ecx,[edx]
! movd mm2,ecx
! pop ecx
! paddusb mm2,mm1
! movd [edx],mm2
! inc w
! mov edx,2400
! add edx,ecx
! shr edx,4
! cmp w,edx
! jl mln13 ;-------------->
! inc i
! cmp i,5 ; contrast
! jl mln12 ;-------------->
! inc j
! cmp j,300
! jl mln11 ;-------------->
! popad
! ret
LINES2:'-----------------------------------------------------------------
! pushad
! mov eax,&h00010000
! movd mm1,eax
! mov esi,ddsd[36]
! mov edi,ddsd[16]
! add esi,2550
! mov ecx,0
! mov j,80
mln21:
! mov i,0
! mov eax,j
! mul edi
! add eax,esi
! sub ecx,9
mln22:
! mov w,0
mln23:
! mov edx,eax
! add edx,ecx
! add edx,w
! push ecx
! mov ecx,[edx]
! movd mm2,ecx
! pop ecx
! paddusb mm2,mm1
! pushad
! mov eax,edi
! mul j
! add eax,esi
! mov m,eax
! popad
! cmp m,edx
! jl mvd2
! movd [edx],mm2
MVD2:
! inc w
! mov edx,2400
! add edx,ecx
! shr edx,4
! cmp w,edx
! jl mln23 ;-------------->
! inc i
! cmp i,3 ; contrast
! jl mln22 ;-------------->
! inc j
! cmp j,320
! jl mln21 ;-------------->
! popad
! ret
datacol:
! db 1, 1, 0, 0, 1, 1, 0, 0
! db 1, 1, 0, 0, 1, 1, 0, 0
! db 1, 0, 0, 0, 1, 0, 0, 0
! db &h7F,&h7F, 0, 0,&h7F,&hB0,&hB0,&h00
! db 0, 0,&hFF, 0, 0, 0,&hFF, 0
pal:'OFFSET PALETTE FOR SHOW
!DB &hFC,&hFC,&hFC,&h0 , &h9C,&h9C,&h9C,&h0 , &hA4,&hA4,&hAC,&h0 , &h70,&h70,&h78,&h0
!DB &h28,&h28,&h30,&h0 , &hA4,&hA4,&hDC,&h0 , &h40,&h40,&h58,&h0 , &h4 ,&h14,&h8 ,&h0
!DB &h4 ,&h1C,&h8 ,&h0 , &h8 ,&h14,&h8 ,&h0 , &h0 ,&h0 ,&hFC,&h0 , &h8 ,&h1C,&hC ,&h0
!DB &hC ,&h14,&h14,&h0 , &h18,&h1C,&h18,&h0 , &h94,&h9C,&hCC,&h0 , &h4 ,&h20,&hC ,&h0
!DB &h8 ,&h20,&hC ,&h0 , &h4 ,&h24,&h10,&h0 , &h68,&h70,&h94,&h0 , &h4 ,&h28,&h10,&h0
!DB &h8 ,&h20,&h14,&h0 , &h8 ,&h2C,&h10,&h0 , &hC ,&h28,&h1C,&h0 , &hAC,&hB4,&hCC,&h0
!DB &h84,&h8C,&hA4,&h0 , &h4 ,&h30,&h14,&h0 , &h10,&h40,&hD4,&h0 , &h4 ,&h34,&h18,&h0
!DB &h70,&h84,&hAC,&h0 , &h78,&h94,&hCC,&h0 , &h60,&h78,&hB4,&h0 , &h30,&h48,&h84,&h0
!DB &hCC,&hD4,&hE4,&h0 , &h94,&h9C,&hAC,&h0 , &h50,&h58,&h68,&h0 , &h40,&h58,&h8C,&h0
!DB &h8 ,&h30,&h14,&h0 , &h8 ,&h34,&h18,&h0 , &h68,&h8C,&hCC,&h0 , &h48,&h68,&hAC,&h0
!DB &h8 ,&h38,&h18,&h0 , &h14,&h2C,&h1C,&h0 , &h10,&h34,&h1C,&h0 , &h14,&h38,&h1C,&h0
!DB &hC ,&h3C,&h20,&h0 , &h14,&h38,&h24,&h0 , &h28,&h2C,&h1C,&h0 , &h50,&h78,&hBC,&h0
!DB &h24,&h24,&h24,&h0 , &h24,&h34,&h24,&h0 , &h28,&h34,&h30,&h0 , &h30,&h2C,&h30,&h0
!DB &h38,&h38,&h38,&h0 , &hC ,&h44,&h1C,&h0 , &hB4,&hC4,&hDC,&h0 , &h84,&hAC,&hE4,&h0
!DB &hC ,&h40,&h24,&h0 , &hC ,&h4C,&h24,&h0 , &h70,&h8C,&hAC,&h0 , &h70,&h78,&h84,&h0
!DB &hC4,&hD4,&hE4,&h0 , &hAC,&hCC,&hEC,&h0 , &hC ,&h50,&h28,&h0 , &h14,&h40,&h24,&h0
!DB &h14,&h40,&h28,&h0 , &h18,&hA4,&hFC,&h0 , &h68,&h78,&h84,&h0 , &h10,&h48,&h24,&h0
!DB &hB4,&hD4,&hDC,&h0 , &h1C,&h40,&h24,&h0 , &h58,&hA4,&hB4,&h0 , &h84,&hEC,&hFC,&h0
!DB &hF4,&hF4,&hF4,&h0 , &hE4,&hE4,&hE4,&h0 , &hC4,&hCC,&hCC,&h0 , &h84,&h8C,&h8C,&h0
!DB &h70,&h8C,&h8C,&h0 , &h70,&hA4,&hA4,&h0 , &h20,&hFC,&hFC,&h0 , &h18,&h44,&h28,&h0
!DB &h1C,&h4C,&h2C,&h0 , &h10,&h40,&h34,&h0 , &h1C,&h40,&h34,&h0 , &h0 ,&hFC,&hF4,&h0
!DB &h50,&h94,&h8C,&h0 , &h58,&h94,&h8C,&h0 , &h18,&h48,&h34,&h0 , &h18,&h4C,&h38,&h0
!DB &h10,&h5C,&h2C,&h0 , &h14,&h60,&h34,&h0 , &h1C,&h7C,&h3C,&h0 , &h60,&h94,&h84,&h0
!DB &h28,&h44,&h24,&h0 , &h24,&h48,&h34,&h0 , &h24,&h58,&h38,&h0 , &h60,&h78,&h68,&h0
!DB &h0 ,&hFC,&h38,&h0 , &h60,&h94,&h68,&h0 , &h68,&hA4,&h70,&h0 , &h0 ,&hFC,&h10,&h0
!DB &h94,&hA4,&h94,&h0 , &h0 ,&hFC,&h0 ,&h0 , &h0 ,&hEC,&h0 ,&h0 , &h0 ,&h9C,&h0 ,&h0
!DB &h40,&hFC,&h38,&h0 , &h60,&hFC,&h50,&h0 , &h8C,&hFC,&h78,&h0 , &h28,&hFC,&h0 ,&h0
!DB &h68,&h8C,&h60,&h0 , &h58,&h78,&h50,&h0 , &h78,&h94,&h70,&h0 , &h78,&hFC,&h50,&h0
!DB &h60,&hFC,&h30,&h0 , &h30,&hAC,&h0 ,&h0 , &h78,&hFC,&h40,&h0 , &h50,&hFC,&h0 ,&h0
!DB &h9C,&hC4,&h84,&h0 , &h9C,&hFC,&h60,&h0 , &h70,&hFC,&h0 ,&h0 , &h9C,&hB4,&h84,&h0
!DB &h78,&h94,&h60,&h0 , &h78,&h9C,&h58,&h0 , &h94,&hFC,&h0 ,&h0 , &h30,&h4C,&h2C,&h0 ;123
!DB &h34,&h48,&h34,&h0 , &h34,&h50,&h34,&h0 , &hA4,&hAC,&h84,&h0 , &h28,&h60,&h3C,&h0 ;127
!DB &h1C,&h5C,&h44,&h0 , &h2C,&h4C,&h40,&h0 , &h24,&h58,&h44,&h0 , &h38,&h4C,&h40,&h0 ;131
!DB &h38,&h38,&h38,&h0 , &h94,&h94,&h84,&h0 , &h78,&h78,&h68,&h0 , &h94,&h94,&h70,&h0 ;135
!DB &hC4,&hC4,&h78,&h0 , &h40,&h40,&h28,&h0 , &h38,&h58,&h44,&h0 , &h2C,&h60,&h44,&h0 ;139
!DB &hB4,&hAC,&h78,&h0 , &h2C,&h6C,&h50,&h0 , &h50,&h48,&h38,&h0 , &h7F,&h7F,&h00,&h0 ;---->< &hBC,&hA4,&h78,&h0
!DB &h24,&h78,&h44,&h0 , &h70,&h60,&h48,&h0 , &h34,&h60,&h48,&h0 , &hF4,&hEC,&hE4,&h0
!DB &h38,&h30,&h28,&h0 , &hE4,&hDC,&hD4,&h0 , &hDC,&hC4,&hB4,&h0 , &hB4,&h94,&h78,&h0
!DB &hCC,&h8C,&h58,&h0 , &hE4,&hCC,&hBC,&h0 , &hCC,&h9C,&h78,&h0 , &h34,&h6C,&h58,&h0
!DB &h30,&h74,&h48,&h0 , &h30,&h78,&h54,&h0 , &hB8,&h94,&h78,&h0 , &hCC,&h94,&h64,&h0
!DB &hCC,&hB4,&hA4,&h0 , &hB4,&h8C,&h70,&h0 , &h44,&h4C,&h34,&h0 , &h40,&h58,&h3C,&h0
!DB &h48,&h48,&h48,&h0 , &hCC,&hAC,&h9C,&h0 , &hBC,&h9C,&h8C,&h0 , &hB4,&h94,&h84,&h0
!DB &h4C,&h5C,&h4C,&h0 , &h4C,&h50,&h54,&h0 , &hDC,&hB4,&hA4,&h0 , &hC4,&h9C,&h8C,&h0
!DB &hBC,&h94,&h84,&h0 , &hB4,&h8C,&h78,&h0 , &h50,&h58,&h40,&h0 , &h58,&h58,&h58,&h0
!DB &hD4,&hCC,&hCC,&h0 , &hCC,&hC4,&hC4,&h0 , &hC4,&hBC,&hBC,&h0 , &hEC,&hDC,&hDC,&h0
!DB &hB4,&hA4,&hA4,&h0 , &h94,&h84,&h84,&h0 , &hCC,&hB4,&hB4,&h0 , &h70,&h60,&h60,&h0
!DB &h9C,&h70,&h70,&h0 , &h50,&h58,&h68,&h0 , &h40,&h60,&h4C,&h0 , &h40,&h6C,&h50,&h0
!DB &h40,&h74,&h58,&h0 , &h58,&h64,&h58,&h0 , &h58,&h74,&h58,&h0 , &h4C,&h7C,&h64,&h0
!DB &h5C,&h64,&h60,&h0 , &h50,&h70,&h64,&h0 , &h70,&h48,&h50,&h0 , &h60,&h64,&h5C,&h0
!DB &h64,&h68,&h64,&h0 , &h64,&h74,&h68,&h0 , &h68,&h74,&h74,&h0 , &hC4,&hAC,&hB4,&h0
!DB &h78,&h78,&h74,&h0 , &h34,&h84,&h4C,&h0 , &hB4,&hA4,&hAC,&h0 , &h3C,&h84,&h58,&h0
!DB &hD4,&hAC,&hC4,&h0 , &h3C,&h80,&h64,&h0 , &h4C,&h84,&h58,&h0 , &h44,&h8C,&h68,&h0
!DB &hCC,&hA4,&hC4,&h0 , &h48,&h90,&h6C,&h0 , &hC4,&hBC,&hC4,&h0 , &hB4,&hAC,&hB4,&h0
!DB &h94,&h8C,&h94,&h0 , &h84,&h78,&h84,&h0 , &h48,&h40,&h48,&h0 , &hD4,&hB4,&hD4,&h0
!DB &h58,&h84,&h68,&h0 , &h50,&h94,&h70,&h0 , &h64,&h84,&h6C,&h0 , &h64,&h84,&h74,&h0
!DB &hC4,&hA4,&hCC,&h0 , &h9C,&h70,&hA4,&h0 , &hBC,&h9C,&hC4,&h0 , &h64,&h90,&h78,&h0
!DB &h84,&h70,&h8C,&h0 , &h68,&h58,&h70,&h0 , &h60,&h40,&h70,&h0 , &h74,&h84,&h78,&h0
!DB &h68,&h94,&h84,&h0 , &h74,&h8C,&h88,&h0 , &h78,&h98,&h84,&h0 , &h60,&hA4,&h84,&h0
!DB &h68,&h60,&h70,&h0 , &h7C,&hA4,&h8C,&h0 , &hBC,&hB4,&hC4,&h0 , &h78,&hA4,&h90,&h0
!DB &h80,&h7C,&h7C,&h0 , &h84,&h80,&h7C,&h0 , &hA4,&h8C,&hCC,&h0 , &h88,&h84,&h84,&h0
!DB &h84,&h94,&h88,&h0 , &h88,&h98,&h90,&h0 , &h90,&h88,&h88,&h0 , &h90,&h94,&h88,&h0
!DB &h98,&h98,&h98,&h0 , &h88,&hA4,&h94,&h0 , &h84,&hAC,&hA0,&h0 , &h68,&h60,&h84,&h0
!DB &hAC,&hA4,&hCC,&h0 , &h9C,&h8C,&hDC,&h0 , &hA4,&h9C,&hCC,&h0 , &h38,&h28,&hAC,&h0
!DB &h20,&h0 ,&hF4,&h0 , &h58,&h50,&hCC,&h0 , &h40,&h38,&hC4,&h0 , &h0 ,&h0 ,&h0 ,&h0
!DB &h68,&h94,&h84,&h0 , &h74,&h8C,&h88,&h0 , &h78,&h98,&h84,&h0 , &h60,&hA4,&h84,&h0
!DB &h68,&h60,&h70,&h0 , &h7C,&hA4,&h8C,&h0 , &hBC,&hB4,&hC4,&h0 , &h78,&hA4,&h90,&h0
!DB &h80,&h7C,&h7C,&h0 , &h84,&h80,&h7C,&h0 , &hA4,&h8C,&hCC,&h0 , &h88,&h84,&h84,&h0
!DB &h84,&h94,&h88,&h0 , &h88,&h98,&h90,&h0 , &h90,&h88,&h88,&h0 , &h90,&h94,&h88,&h0
!DB &h98,&h98,&h98,&h0 , &h88,&hA4,&h94,&h0 , &h84,&hAC,&hA0,&h0 , &h68,&h60,&h84,&h0
!DB &hAC,&hA4,&hCC,&h0 , &h9C,&h8C,&hDC,&h0 , &hA4,&h9C,&hCC,&h0 , &h38,&h28,&hAC,&h0
!DB &h20,&h0 ,&hF4,&h0 , &h58,&h50,&hCC,&h0 , &h40,&h38,&hC4,&h0 , &h0 ,&h0 ,&h0 ,&h0
!DB &h68,&h94,&h84,&h0 , &h74,&h8C,&h88,&h0 , &h78,&h98,&h84,&h0 , &h60,&hA4,&h84,&h0
!DB &h68,&h60,&h70,&h0 , &h7C,&hA4,&h8C,&h0 , &hBC,&hB4,&hC4,&h0 , &h78,&hA4,&h90,&h0
!DB &h80,&h7C,&h7C,&h0 , &h84,&h80,&h7C,&h0 , &hA4,&h8C,&hCC,&h0 , &h88,&h84,&h84,&h0
!DB &h84,&h94,&h88,&h0 , &h88,&h98,&h90,&h0 , &h90,&h88,&h88,&h0 , &h90,&h94,&h88,&h0
!DB &h98,&h98,&h98,&h0 , &h88,&hA4,&h94,&h0 , &h84,&hAC,&hA0,&h0 , &h68,&h60,&h84,&h0
!DB &hAC,&hA4,&hCC,&h0 , &h9C,&h8C,&hDC,&h0 , &hA4,&h9C,&hCC,&h0 , &h38,&h28,&hAC,&h0
!DB &h20,&h0 ,&hF4,&h0 , &h58,&h50,&hCC,&h0 , &h40,&h38,&hC4,&h0 , &h0 ,&h0 ,&h0 ,&h0
!DB &h80,&h7C,&h7C,&h0 , &h84,&h80,&h7C,&h0 , &hA4,&h8C,&hCC,&h0 , &h88,&h84,&h84,&h0
!DB &h84,&h94,&h88,&h0 , &h88,&h98,&h90,&h0 , &h90,&h88,&h88,&h0 , &h90,&h94,&h88,&h0
!DB &h98,&h98,&h98,&h0 , &h88,&hA4,&h94,&h0 , &h84,&hAC,&hA0,&h0 , &h68,&h60,&h84,&h0
!DB &hAC,&hA4,&hCC,&h0 , &h9C,&h8C,&hDC,&h0 , &hA4,&h9C,&hCC,&h0 , &h38,&h28,&hAC,&h0
!DB &h20,&h0 ,&hF4,&h0 , &h58,&h50,&hCC,&h0 , &h40,&h38,&hC4,&h0 , &h0 ,&h0 ,&h0 ,&h0
'DATA INCLUDE
#INCLUDE "town1.inc"
#INCLUDE "town2.inc"
#INCLUDE "tree1.inc"
#INCLUDE "tree2.inc"
#INCLUDE "tree3.inc"
#INCLUDE "tree4.inc"
#INCLUDE "tree5.inc"
#INCLUDE "nice1.inc"
#INCLUDE "nice2.inc"
END SUB
'_____________________________________________________________________________________________
'
' for Dynamic (for moving) >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>>>>><
'_____________________________________________________________________________________________
'
SUB NEXTFLAG
#REGISTER NONE
LOCAL i AS LONG 'for i~
LOCAL J AS LONG 'for j~
STATIC K AS SINGLE 'FPU tmp
STATIC J1 AS SINGLE 'FPU tmp
STATIC H AS LONG
LOCAL col AS SINGLE 'FRAC--
STATIC w AS LONG
LOCAL s AS LONG
LOCAL c AS LONG
LOCAL x AS LONG
LOCAL y AS LONG
! PUSHAD
! mov esi,ddsd[36]
! mov edi,ddsd[16]
! mov c,0
mstart1:
! mov ebx,offset sea
! mov s,0
mstart2:
! pushad
x = RND(0,638)
y = RND(320,362)
! popad
! mov eax,edi
! mul y
! add eax,esi
! mov ecx,eax
! mov eax,4
! mul x
! add ecx,eax
! mov eax,[ebx]
! mov [ecx],eax
'--------------------------------
! mov eax,edi
! add y,25
! mul y
! add eax,esi
! mov ecx,eax
! mov eax,4
! mul x
! add ecx,eax
! mov eax,[ebx]
! mov [ecx],eax
! mov [ecx+4],eax
! CALL SEAGREEN
! inc s
! add ebx,4
! cmp s,11
! jl mstart2
! inc c
! cmp c,%SEA_WAIT ;60
! jl mstart1
! CALL CO
! CALL RE
! POPAD
EXIT SUB
CHECKZ:'----------------------------------------------------------
! push ebx
! push edx
! push esi
! push edi
! mov ebx,offset sea
! xor edi,edi
! xor esi,esi
mch:
! mov eax,[ebx]
! cmp [ecx],eax
! jne mcc0 ;-------->< je
! inc edi
mcc0:
! cmp [ecx+4],eax
! jne mcc1 ;--------><
! inc edi
mcc1:
! cmp [ecx+8],eax
! jne mcc2 ;--------><
! inc edi
mcc2:
! add ebx,4
! inc esi
! cmp esi,12
! jl mch ;-------->
! xor eax,eax
! cmp edi,3
! je mkf ;-------->
mco:
! mov eax,&hFFFFFFFF
mkf:
! pop edi
! pop esi
! pop edx
! pop ebx
! ret
SEAGREEN:'-----------------------------------------------------------
! PUSHAD
! cmp x,637
! jl mlow ;--------NON-------->
! mov x,637
mlow:
! mov eax,edi
! add y,43
! mul y
! add eax,esi
! mov ecx,eax
! mov eax,4
! mul x
! add ecx,eax
! CALL CHECKZ
! cmp eax,&hFFFFFFFF
! je ex ;----------->
! mov eax,[ebx]
! mov [ecx],eax
! mov [ecx+4],eax
! mov [ecx+8],eax
ex:
! POPAD
! ret
CO:'--------------------------------------------------------
j1 = 6
! pushad
! inc w
! cmp w,9
! jg mgr ;------------------>
! popad
! ret
mgr:
! mov w,0
! mov esi,ddsd[36]
! mov edi,ddsd[16]
! xor ecx,ecx
! mov eax,edi
! mov ebx,20
! mul ebx
! add eax,esi
! add eax,2000
! mov edx,gptr
! mov i,0
mco1:
! emms
! fild i
! fdiv j1
! fst col
! fld K
! fadd FK
! fst K
! fadd col
! fcos
! fst col
! fld1
! fld col
! Fscale
! fist H
! FINIT
! mov j,0
! pushad
! mov eax,h
! shl eax,2
! mov c,eax
! popad
! add eax,c
mco2:
! mov ebx,[edx]
! mov [eax],ebx
! add edx,4
! add eax,4
! inc j
! cmp j,120
! jl mco2 ;------------>
! sub eax,480
! sub eax,c
! add eax,edi
! inc i
! cmp i,22
! jl mco1 ;------------>
! popad
! ret
RE:'-------------------- DYNAMIC -------------------------------------
! pushad
'..................................
' Dynamic part
' more code (Your code) for move...
' Dynamic part
'..................................
! popad
! ret
sea:'------------------------------------------------------------------
'palette own for sea
! dd &h0058849C, &h0094A4CC, &h00B4BCD4, &h00C4CCD4
! dd &h009CACC4, &h008494AC, &h007C8CAC, &h00C4C4C4
! dd &h00587494, &h006C7CA4, &h00DCDCDC, &h00007F7F
'palette two for sea
! dd &h0078A4BC, &h00B4C4DC, &h00D4DCE4, &h00E4ECF4
! dd &h00BCCCE4, &h00A4B4CC, &h009CACCC, &h00E4E4E4
! dd &h007894B4, &h008C9CC4, &h00FCFCFC
END SUB
'_______________________________________________________________________________
'
' end end end end end end end end end end end end end end end end
'_______________________________________________________________________________
'
------------------
Comment