From 398dcbb13d4891fbf7c7e2fb2c559313dcba4b53 Mon Sep 17 00:00:00 2001 From: Andrew Date: Fri, 10 Apr 2026 07:12:30 +0000 Subject: [PATCH] programs/demos: Post-SVN tidy (part 2) (#412) - Move source code from `trunk` into root directory for each program. - Update build files and ASM include paths. Add SPDX license header where appropriate. - Note: Line endings standardised from `CRLF` > `LF`, so best to view diffs with whitespace changes hidden. (Work towards #75, point 3) Reviewed-on: https://git.kolibrios.org/KolibriOS/kolibrios/pulls/412 Reviewed-by: Ivan B Reviewed-by: Mikhail Frolov Co-authored-by: Andrew Co-committed-by: Andrew --- data/Tupfile.lua | 18 +- programs/build_all.bat | 16 +- programs/demos/bcdclk/{trunk => }/Tupfile.lua | 2 +- programs/demos/bcdclk/{trunk => }/bcdclk.asm | 303 +- .../demos/bcdclk/{trunk => }/build_en.bat | 0 .../demos/bcdclk/{trunk => }/build_ru.bat | 0 .../demos/buddhabrot/{trunk => }/Tupfile.lua | 0 .../buddhabrot/{trunk => }/buddhabrot.asm | 717 ++-- .../demos/buddhabrot/{trunk => }/build.bat | 0 .../demos/colorref/{trunk => }/Tupfile.lua | 2 +- .../demos/colorref/{trunk => }/build_en.bat | 0 .../demos/colorref/{trunk => }/build_ru.bat | 0 .../demos/colorref/{trunk => }/colorref.asm | 11 +- .../demos/crownscr/{trunk => }/Tupfile.lua | 2 +- .../demos/crownscr/{trunk => }/build_en.bat | 0 .../demos/crownscr/{trunk => }/build_ru.bat | 0 .../demos/crownscr/{trunk => }/crownscr.asm | 11 +- .../demos/crownscr/{trunk => }/figuresi.inc | 0 programs/demos/cslide/{trunk => }/Tupfile.lua | 2 +- .../demos/cslide/{trunk => }/build_en.bat | 0 .../demos/cslide/{trunk => }/build_ru.bat | 0 programs/demos/cslide/{trunk => }/cslide.asm | 17 +- programs/demos/cubeline/{trunk => }/Makefile | 0 .../demos/cubeline/{trunk => }/ProcessTab.h | 0 programs/demos/cubeline/{trunk => }/SysCall.h | 0 programs/demos/cubeline/{trunk => }/fps.cpp | 0 programs/demos/cubeline/{trunk => }/main.cpp | 0 programs/demos/cubetext/{trunk => }/Makefile | 0 .../demos/cubetext/{trunk => }/ProcessTab.h | 0 programs/demos/cubetext/{trunk => }/SysCall.h | 0 programs/demos/cubetext/{trunk => }/bmp.cpp | 0 programs/demos/cubetext/{trunk => }/bmp.h | 0 programs/demos/cubetext/{trunk => }/fps.cpp | 0 programs/demos/cubetext/{trunk => }/logio.bmp | Bin programs/demos/cubetext/{trunk => }/main.cpp | 0 .../demos/cubetext/{trunk => }/readme.txt | 0 programs/demos/eyes/{trunk => }/Tupfile.lua | 2 +- programs/demos/eyes/{trunk => }/build_en.bat | 0 programs/demos/eyes/{trunk => }/build_ru.bat | 0 programs/demos/eyes/{trunk => }/eyes.asm | 5 +- programs/demos/eyes/{trunk => }/eyes.raw | Bin programs/demos/fire2/{trunk => }/Tupfile.lua | 0 programs/demos/fire2/{trunk => }/build.bat | 0 programs/demos/fire2/{trunk => }/fire2.asm | 10 +- .../demos/flatwav/{trunk => }/FLATWAV.ASM | 0 .../demos/flatwav/{trunk => }/Tupfile.lua | 0 programs/demos/flatwav/{trunk => }/build.bat | 0 programs/demos/free3d/{trunk => }/Tupfile.lua | 0 programs/demos/free3d/{trunk => }/build.bat | 0 programs/demos/free3d/{trunk => }/build.sh | 0 programs/demos/free3d/{trunk => }/free3d.asm | 2895 +++++++++-------- .../demos/free3d/{trunk => }/texture_24b.png | Bin .../demos/free3d04/{trunk => }/Tupfile.lua | 2 +- .../demos/free3d04/{trunk => }/build_en.bat | 0 .../demos/free3d04/{trunk => }/build_ru.bat | 0 .../demos/free3d04/{trunk => }/free3d04.asm | 7 +- .../demos/free3d04/{trunk => }/gif_lite.inc | 0 .../demos/free3d04/{trunk => }/readme.txt | 0 .../demos/free3d04/{trunk => }/texture.gif | Bin 59 files changed, 2026 insertions(+), 1996 deletions(-) rename programs/demos/bcdclk/{trunk => }/Tupfile.lua (79%) rename programs/demos/bcdclk/{trunk => }/bcdclk.asm (91%) rename programs/demos/bcdclk/{trunk => }/build_en.bat (100%) rename programs/demos/bcdclk/{trunk => }/build_ru.bat (100%) rename programs/demos/buddhabrot/{trunk => }/Tupfile.lua (100%) rename programs/demos/buddhabrot/{trunk => }/buddhabrot.asm (96%) rename programs/demos/buddhabrot/{trunk => }/build.bat (100%) rename programs/demos/colorref/{trunk => }/Tupfile.lua (79%) rename programs/demos/colorref/{trunk => }/build_en.bat (100%) rename programs/demos/colorref/{trunk => }/build_ru.bat (100%) rename programs/demos/colorref/{trunk => }/colorref.asm (99%) rename programs/demos/crownscr/{trunk => }/Tupfile.lua (79%) rename programs/demos/crownscr/{trunk => }/build_en.bat (100%) rename programs/demos/crownscr/{trunk => }/build_ru.bat (100%) rename programs/demos/crownscr/{trunk => }/crownscr.asm (98%) rename programs/demos/crownscr/{trunk => }/figuresi.inc (100%) rename programs/demos/cslide/{trunk => }/Tupfile.lua (79%) rename programs/demos/cslide/{trunk => }/build_en.bat (100%) rename programs/demos/cslide/{trunk => }/build_ru.bat (100%) rename programs/demos/cslide/{trunk => }/cslide.asm (98%) rename programs/demos/cubeline/{trunk => }/Makefile (100%) rename programs/demos/cubeline/{trunk => }/ProcessTab.h (100%) rename programs/demos/cubeline/{trunk => }/SysCall.h (100%) rename programs/demos/cubeline/{trunk => }/fps.cpp (100%) rename programs/demos/cubeline/{trunk => }/main.cpp (100%) rename programs/demos/cubetext/{trunk => }/Makefile (100%) rename programs/demos/cubetext/{trunk => }/ProcessTab.h (100%) rename programs/demos/cubetext/{trunk => }/SysCall.h (100%) rename programs/demos/cubetext/{trunk => }/bmp.cpp (100%) rename programs/demos/cubetext/{trunk => }/bmp.h (100%) rename programs/demos/cubetext/{trunk => }/fps.cpp (100%) rename programs/demos/cubetext/{trunk => }/logio.bmp (100%) rename programs/demos/cubetext/{trunk => }/main.cpp (100%) rename programs/demos/cubetext/{trunk => }/readme.txt (100%) rename programs/demos/eyes/{trunk => }/Tupfile.lua (79%) rename programs/demos/eyes/{trunk => }/build_en.bat (100%) rename programs/demos/eyes/{trunk => }/build_ru.bat (100%) rename programs/demos/eyes/{trunk => }/eyes.asm (98%) rename programs/demos/eyes/{trunk => }/eyes.raw (100%) rename programs/demos/fire2/{trunk => }/Tupfile.lua (100%) rename programs/demos/fire2/{trunk => }/build.bat (100%) rename programs/demos/fire2/{trunk => }/fire2.asm (97%) rename programs/demos/flatwav/{trunk => }/FLATWAV.ASM (100%) rename programs/demos/flatwav/{trunk => }/Tupfile.lua (100%) rename programs/demos/flatwav/{trunk => }/build.bat (100%) rename programs/demos/free3d/{trunk => }/Tupfile.lua (100%) rename programs/demos/free3d/{trunk => }/build.bat (100%) rename programs/demos/free3d/{trunk => }/build.sh (100%) rename programs/demos/free3d/{trunk => }/free3d.asm (94%) rename programs/demos/free3d/{trunk => }/texture_24b.png (100%) rename programs/demos/free3d04/{trunk => }/Tupfile.lua (79%) rename programs/demos/free3d04/{trunk => }/build_en.bat (100%) rename programs/demos/free3d04/{trunk => }/build_ru.bat (100%) rename programs/demos/free3d04/{trunk => }/free3d04.asm (99%) rename programs/demos/free3d04/{trunk => }/gif_lite.inc (100%) rename programs/demos/free3d04/{trunk => }/readme.txt (100%) rename programs/demos/free3d04/{trunk => }/texture.gif (100%) diff --git a/data/Tupfile.lua b/data/Tupfile.lua index 11e097300..4d2fc5b61 100644 --- a/data/Tupfile.lua +++ b/data/Tupfile.lua @@ -451,15 +451,15 @@ tup.append_table(img_files, { {"UNZ", VAR_PROGS .. "/fs/unz/unz"}, {"ZKEY", VAR_PROGS .. "/system/zkey/trunk/ZKEY"}, {"3D/3DWAV", VAR_PROGS .. "/demos/3dwav/3dwav"}, - {"3D/CROWNSCR", VAR_PROGS .. "/demos/crownscr/trunk/crownscr"}, + {"3D/CROWNSCR", VAR_PROGS .. "/demos/crownscr/crownscr"}, {"3D/3DCUBE2", VAR_PROGS .. "/demos/3dcube2/3DCUBE2"}, - {"3D/FREE3D04", VAR_PROGS .. "/demos/free3d04/trunk/free3d04"}, + {"3D/FREE3D04", VAR_PROGS .. "/demos/free3d04/free3d04"}, {"3D/GEARS", VAR_PROGS .. "/develop/libraries/TinyGL/asm_fork/examples/gears"}, {"3D/RAY", VAR_PROGS .. "/demos/ray/ray"}, {"3D/VIEW3DS", VAR_PROGS .. "/demos/view3ds/view3ds"}, - {"DEMOS/BCDCLK", VAR_PROGS .. "/demos/bcdclk/trunk/bcdclk"}, - {"DEMOS/BUDHBROT", VAR_PROGS .. "/demos/buddhabrot/trunk/buddhabrot"}, - {"DEMOS/EYES", VAR_PROGS .. "/demos/eyes/trunk/eyes"}, + {"DEMOS/BCDCLK", VAR_PROGS .. "/demos/bcdclk/bcdclk"}, + {"DEMOS/BUDHBROT", VAR_PROGS .. "/demos/buddhabrot/buddhabrot"}, + {"DEMOS/EYES", VAR_PROGS .. "/demos/eyes/eyes"}, {"DEMOS/FIREWORK", VAR_PROGS .. "/demos/firework/firework"}, {"DEMOS/MOVBACK", VAR_PROGS .. "/demos/movback/movback"}, {"DEMOS/PLASMA", VAR_PROGS .. "/demos/plasma/plasma"}, @@ -484,9 +484,9 @@ tup.append_table(img_files, { {"DEVELOP/MSTATE", VAR_PROGS .. "/develop/mstate/mstate"}, {"DEVELOP/SCANCODE", VAR_PROGS .. "/develop/scancode/trunk/scancode"}, {"DEVELOP/EXAMPLES/CIRCLE", VAR_PROGS .. "/develop/examples/circle/trunk/circle"}, - {"DEVELOP/EXAMPLES/COLORREF", VAR_PROGS .. "/demos/colorref/trunk/colorref"}, + {"DEVELOP/EXAMPLES/COLORREF", VAR_PROGS .. "/demos/colorref/colorref"}, {"DEVELOP/EXAMPLES/CONGET", VAR_PROGS .. "/develop/libraries/console_coff/examples/test_gets"}, - {"DEVELOP/EXAMPLES/CSLIDE", VAR_PROGS .. "/demos/cslide/trunk/cslide"}, + {"DEVELOP/EXAMPLES/CSLIDE", VAR_PROGS .. "/demos/cslide/cslide"}, {"DEVELOP/EXAMPLES/THREAD", VAR_PROGS .. "/develop/examples/thread/trunk/thread"}, {"File Managers/KFAR", VAR_PROGS .. "/fs/kfar/trunk/kfar"}, {"File Managers/OPENDIAL", VAR_PROGS .. "/fs/opendial/opendial"}, @@ -599,7 +599,7 @@ tup.append_table(extra_files, { {"HD_Load/USB_boot_old/", VAR_PROGS .. "/hd_load/usb_boot_old/MeOSload.com"}, {"HD_Load/USB_boot_old/", VAR_PROGS .. "/hd_load/usb_boot_old/enable.exe"}, {"kolibrios/3D/3dsheart", VAR_PROGS .. "/demos/3dsheart/3dsheart"}, - {"kolibrios/3D/flatwav", VAR_PROGS .. "/demos/flatwav/trunk/flatwav"}, + {"kolibrios/3D/flatwav", VAR_PROGS .. "/demos/flatwav/flatwav"}, {"kolibrios/3D/mos3de", VAR_PROGS .. "/demos/mos3de/mos3de"}, {"kolibrios/3D/info3ds/INFO3DS", VAR_PROGS .. "/develop/info3ds/info3ds"}, {"kolibrios/3D/textures1", VAR_PROGS .. "/develop/libraries/TinyGL/asm_fork/examples/textures1"}, @@ -760,7 +760,7 @@ tup.append_table(img_files, { {"LIB/ICONV.OBJ", VAR_PROGS .. "/develop/libraries/iconv/iconv.obj"}, }) tup.append_table(extra_files, { --- {"kolibrios/3D/cubeline", VAR_PROGS .. "/demos/cubeline/trunk/cubeline"}, +-- {"kolibrios/3D/cubeline", VAR_PROGS .. "/demos/cubeline/cubeline"}, {"kolibrios/3D/gears", VAR_PROGS .. "/demos/gears/gears"}, {"kolibrios/emul/e80/e80", VAR_PROGS .. "/emulator/e80/e80"}, {"kolibrios/emul/uarm/", VAR_CONTRIB .. "/other/uarm/uARM"}, diff --git a/programs/build_all.bat b/programs/build_all.bat index b020e8b4f..d12c519fd 100644 --- a/programs/build_all.bat +++ b/programs/build_all.bat @@ -207,16 +207,16 @@ fasm demos\3dtcub10\3dtcub10.asm %BIN%\3d\3dtcub10 cd demos\aclock\trunk\ nasmw -t -f bin -o ..\..\..\%BIN%\demos\aclock aclock.asm cd ..\..\.. -fasm demos\bcdclk\trunk\bcdclk.asm %BIN%\demos\bcdclk +fasm demos\bcdclk\bcdclk.asm %BIN%\demos\bcdclk fasm demos\bgitest\trunk\bgitest.asm %BIN%\fonts\bgitest -fasm demos\colorref\trunk\colorref.asm %BIN%\demos\colorref -fasm demos\crownscr\trunk\crownscr.asm %BIN%\3d\crownscr -fasm demos\cslide\trunk\cslide.asm %BIN%\demos\cslide -fasm demos\eyes\trunk\eyes.asm %BIN%\demos\eyes -fasm demos\fire\trunk\fire.asm %BIN%\demos\fire -fasm demos\fire2\trunk\fire2.asm %BIN%\demos\fire2 +fasm demos\colorref\colorref.asm %BIN%\demos\colorref +fasm demos\crownscr\crownscr.asm %BIN%\3d\crownscr +fasm demos\cslide\cslide.asm %BIN%\demos\cslide +fasm demos\eyes\eyes.asm %BIN%\demos\eyes +fasm demos\fire\fire.asm %BIN%\demos\fire +fasm demos\fire2\fire2.asm %BIN%\demos\fire2 fasm demos\firework\trunk\firework.asm %BIN%\demos\firework -fasm demos\free3d04\trunk\free3d04.asm %BIN%\3d\free3d04 +fasm demos\free3d04\free3d04.asm %BIN%\3d\free3d04 fasm demos\magnify\trunk\magnify.asm %BIN%\magnify fasm demos\movback\trunk\movback.asm %BIN%\demos\movback fasm demos\plasma\trunk\plasma.asm %BIN%\demos\plasma diff --git a/programs/demos/bcdclk/trunk/Tupfile.lua b/programs/demos/bcdclk/Tupfile.lua similarity index 79% rename from programs/demos/bcdclk/trunk/Tupfile.lua rename to programs/demos/bcdclk/Tupfile.lua index 308fb20c8..927e49cbe 100644 --- a/programs/demos/bcdclk/trunk/Tupfile.lua +++ b/programs/demos/bcdclk/Tupfile.lua @@ -1,5 +1,5 @@ if tup.getconfig("NO_FASM") ~= "" then return end -HELPERDIR = (tup.getconfig("HELPERDIR") == "") and "../../.." or tup.getconfig("HELPERDIR") +HELPERDIR = (tup.getconfig("HELPERDIR") == "") and "../.." or tup.getconfig("HELPERDIR") tup.include(HELPERDIR .. "/use_fasm.lua") add_include(tup.getvariantdir()) diff --git a/programs/demos/bcdclk/trunk/bcdclk.asm b/programs/demos/bcdclk/bcdclk.asm similarity index 91% rename from programs/demos/bcdclk/trunk/bcdclk.asm rename to programs/demos/bcdclk/bcdclk.asm index 79406c688..15e3c4509 100644 --- a/programs/demos/bcdclk/trunk/bcdclk.asm +++ b/programs/demos/bcdclk/bcdclk.asm @@ -1,150 +1,153 @@ -; -; BCD CLOCK -; -; Compile with FASM for Menuet -; -; - -use32 - - org 0x0 - - db 'MENUET01' - dd 0x01 - dd START - dd I_END - dd 0x1000 - dd 0x1000 - dd 0x0 , 0x0 - -include 'lang.inc' -include '../../../macros.inc' - - -START: -red: - call drawwindow - -still: - - - mov eax,23 ; wait for timeout - mov ebx,50 - mcall - - cmp eax,1 ; redraw ? - je red - - cmp eax, 2 ; key - je key - - cmp eax,3 ; button in buffer ? - je button - - call drawclock - - jmp still - -key: - mov eax, 2 - int 0x40 - jmp still - -button: - mov al,17 ; get id - mcall - - cmp ah,1 ; button id=1 ? - jne noclose - or eax,-1 ; close this program - mcall - noclose: - - jmp still - -drawclock: - - mov eax,3 ; get time - mcall - bswap eax - shr eax,8 - mov edi,dg1 - mov ecx,6 -dgtomem: - push eax - and al,0x0f - mov [edi],al - inc edi - pop eax - shr eax,4 - loop dgtomem - mov ebx,79*65536+11 - mov edi,dg1 -digitlp: - mov ecx,10*65536+11 - xor esi,esi -plotlp: - xor edx,edx - test byte[edi],8 - je nobit - mov edx,0x00ff0000 -nobit: - mov eax,13 ; plot 8,4,2,1 - mcall - add ecx,13*65536 - shl byte[edi],1 - inc esi - cmp esi,4 - jne plotlp - shr byte[edi],4 - mov edx,0x00880040 - mov eax,13 ; draw digit box - mcall - pusha - mov edx,ebx - and edx,0xffff0000 - shr ecx,16 - or edx,ecx - add edx,3*65536+2 - mov ebx,0x00010100 - mov ecx,[edi] - mov esi,0x00ffffff - mov eax,47 ; display decimal - mcall - popa - sub ebx,13*65536 - inc edi - cmp edi,dg1+6 - jne digitlp - ret - - -drawwindow: - - - mov eax,12 - mov ebx,1 ; start redraw - mcall - - mov eax, 48 - mov ebx, 4 - mcall - mov ecx, eax - xor eax,eax ; window - mov ebx,100*65536+113 - add ecx,100*65536+87 - mov edx,0x34400088 - mov edi,title - mcall - -call drawclock - - mov eax,12 - mov ebx,2 ; end redraw - mcall - - ret - -title db 'BCD Clock',0 -I_END: -dg1: db ? +; SPDX-License-Identifier: NOASSERTION +; + +; +; BCD CLOCK +; +; Compile with FASM for Menuet +; +; + +use32 + + org 0x0 + + db 'MENUET01' + dd 0x01 + dd START + dd I_END + dd 0x1000 + dd 0x1000 + dd 0x0 , 0x0 + +include 'lang.inc' +include '../../macros.inc' + + +START: +red: + call drawwindow + +still: + + + mov eax,23 ; wait for timeout + mov ebx,50 + mcall + + cmp eax,1 ; redraw ? + je red + + cmp eax, 2 ; key + je key + + cmp eax,3 ; button in buffer ? + je button + + call drawclock + + jmp still + +key: + mov eax, 2 + int 0x40 + jmp still + +button: + mov al,17 ; get id + mcall + + cmp ah,1 ; button id=1 ? + jne noclose + or eax,-1 ; close this program + mcall + noclose: + + jmp still + +drawclock: + + mov eax,3 ; get time + mcall + bswap eax + shr eax,8 + mov edi,dg1 + mov ecx,6 +dgtomem: + push eax + and al,0x0f + mov [edi],al + inc edi + pop eax + shr eax,4 + loop dgtomem + mov ebx,79*65536+11 + mov edi,dg1 +digitlp: + mov ecx,10*65536+11 + xor esi,esi +plotlp: + xor edx,edx + test byte[edi],8 + je nobit + mov edx,0x00ff0000 +nobit: + mov eax,13 ; plot 8,4,2,1 + mcall + add ecx,13*65536 + shl byte[edi],1 + inc esi + cmp esi,4 + jne plotlp + shr byte[edi],4 + mov edx,0x00880040 + mov eax,13 ; draw digit box + mcall + pusha + mov edx,ebx + and edx,0xffff0000 + shr ecx,16 + or edx,ecx + add edx,3*65536+2 + mov ebx,0x00010100 + mov ecx,[edi] + mov esi,0x00ffffff + mov eax,47 ; display decimal + mcall + popa + sub ebx,13*65536 + inc edi + cmp edi,dg1+6 + jne digitlp + ret + + +drawwindow: + + + mov eax,12 + mov ebx,1 ; start redraw + mcall + + mov eax, 48 + mov ebx, 4 + mcall + mov ecx, eax + xor eax,eax ; window + mov ebx,100*65536+113 + add ecx,100*65536+87 + mov edx,0x34400088 + mov edi,title + mcall + +call drawclock + + mov eax,12 + mov ebx,2 ; end redraw + mcall + + ret + +title db 'BCD Clock',0 +I_END: +dg1: db ? diff --git a/programs/demos/bcdclk/trunk/build_en.bat b/programs/demos/bcdclk/build_en.bat similarity index 100% rename from programs/demos/bcdclk/trunk/build_en.bat rename to programs/demos/bcdclk/build_en.bat diff --git a/programs/demos/bcdclk/trunk/build_ru.bat b/programs/demos/bcdclk/build_ru.bat similarity index 100% rename from programs/demos/bcdclk/trunk/build_ru.bat rename to programs/demos/bcdclk/build_ru.bat diff --git a/programs/demos/buddhabrot/trunk/Tupfile.lua b/programs/demos/buddhabrot/Tupfile.lua similarity index 100% rename from programs/demos/buddhabrot/trunk/Tupfile.lua rename to programs/demos/buddhabrot/Tupfile.lua diff --git a/programs/demos/buddhabrot/trunk/buddhabrot.asm b/programs/demos/buddhabrot/buddhabrot.asm similarity index 96% rename from programs/demos/buddhabrot/trunk/buddhabrot.asm rename to programs/demos/buddhabrot/buddhabrot.asm index 744c39d44..ba4c86883 100644 --- a/programs/demos/buddhabrot/trunk/buddhabrot.asm +++ b/programs/demos/buddhabrot/buddhabrot.asm @@ -1,357 +1,360 @@ -; App written by randall ported to Kolibri and MenuetOS64 by macgub (www.macgub.hekko.pl). -; Now it use static memory, it is mixed 32bit code and SSE instructions. - -include '../../../macros.inc' -include '../../../KOSfuncs.inc' - -use32 - org 0x0 - - db 'MENUET01' ; 8 byte id - dd 0x01 ; header version - dd START ; start of code - dd IMG_END ; size of image - dd I_END ;0x100000 ; memory for app - dd I_END ;0xbffff ; esp - dd 0x0 , 0x0 ; I_Param , I_Icon - -; start of execution -START: - - call draw_window - call draw_from_buffer - call Main - call draw_from_buffer - - mcall SF_SET_CAPTION,1,wintitle2 - -still: - - mcall SF_WAIT_EVENT - - cmp eax,EV_REDRAW - je .redraw - cmp eax,EV_KEY - je .key - cmp eax,EV_BUTTON - je .button - jmp still - - .redraw: - call draw_window - call draw_from_buffer - jmp still - - .key: - mcall SF_GET_KEY - shr eax,16 ; get scancode in 'al' - cmp al,1 - je .exit - cmp al,66 - je set_as_wallpaper - jmp still - - .button: - mcall SF_GET_BUTTON - cmp ah,1 ; button id=1 ? - jne still - - .exit: - mcall SF_TERMINATE_PROCESS - - -set_as_wallpaper: - mcall SF_BACKGROUND_SET,SSF_MODE_BG,2 - mcall SF_BACKGROUND_SET,SSF_SIZE_BG,IMG_SIZE,IMG_SIZE - mcall SF_BACKGROUND_SET,SSF_IMAGE_BG,screen,0,3*IMG_SIZE*IMG_SIZE - mcall SF_BACKGROUND_SET,SSF_REDRAW_BG - jmp still - -draw_from_buffer: - pusha - mcall SF_PUT_IMAGE,screen,IMG_SIZE*65536+IMG_SIZE,0 - popa -ret - -;------------------------------------------------------------------------------- -; NAME: XORWOW -; DESC: Pseudo random number generator. -; OUT: eax [0;2^32-1] -;------------------------------------------------------------------------------- -macro XORWOW { - mov edx,[g_xorwow_x] ; edx = x - shr edx,2 ; edx = x >> 2 - xor edx,[g_xorwow_x] ; t = x ^ (x >> 2) - mov eax,[g_xorwow_y] ; eax = y - mov [g_xorwow_x],eax ; x = y - mov eax,[g_xorwow_z] ; eax = z - mov [g_xorwow_y],eax ; y = z - mov eax,[g_xorwow_w] ; eax = w - mov [g_xorwow_z],eax ; z = w - mov eax,[g_xorwow_v] ; eax = v - mov [g_xorwow_w],eax ; w = v - mov edi,eax ; edi = v - shl edi,4 ; edi = v << 4 - xor edi,eax ; edi = (v ^ (v << 4)) - mov eax,edx ; eax = t - shl eax,1 ; eax = t << 1 - xor eax,edx ; eax = (t ^ (t << 1)) - xor eax,edi ; eax = (v ^ (v << 4)) ^ (t ^ (t << 1)) - mov [g_xorwow_v],eax ; v = eax - add [g_xorwow_d],362437 ; d += 362437 - mov eax,[g_xorwow_d] ; eax = d - add eax,[g_xorwow_v] ; eax = d + v -} -;------------------------------------------------------------------------------- -; NAME: RANDOM -; DESC: Returns pseudo random number in the range [-0.5;0.5). -; OUT: xmm0.x [-0.5;0.5) -;------------------------------------------------------------------------------- -macro RANDOM { - XORWOW - cvtsi2ss xmm0,eax - mulss xmm0,[g_rand_scale] -} -;------------------------------------------------------------------------------- - -;------------------------------------------------------------------------------- -; NAME: GenerateSequence -; IN: xmm0.x re (c0.x) -; IN: xmm1.x im (c0.y) -; IN: edi array size -; IN/OUT: esi pointer to the allocated array -; OUT: eax generated sequence size -;------------------------------------------------------------------------------- -align 16 -GenerateSequence: - xor eax,eax ; eax is index loop - xorps xmm4,xmm4 ; xmm4 is c.x - xorps xmm5,xmm5 ; xmm5 is c.y -.Loop: - ; cn.x = c.x * c.x - c.y * c.y + c0.x - movaps xmm2,xmm4 - movaps xmm3,xmm5 - mulss xmm2,xmm4 - mulss xmm3,xmm5 - subss xmm2,xmm3 - addss xmm2,xmm0 - movaps xmm6,xmm2 ; xmm6 is cn.x - ; cn.y = 2.0 * c.x * c.y + c0.y - movaps xmm7,xmm4 - mulss xmm7,xmm5 - addss xmm7,xmm7 - addss xmm7,xmm1 ; xmm7 is cn.y - ; store cn - movd dword [esi+eax*8],xmm6 - movd dword [esi+eax*8+4],xmm7 - ; if (cn.x * cn.x + cn.y * cn.y > 10.0) return eax; - movaps xmm2,xmm6 - movaps xmm3,xmm7 - mulss xmm2,xmm6 - mulss xmm3,xmm7 - addss xmm2,xmm3 - ucomiss xmm2,[g_max_dist] - ja .EndLoop - movaps xmm4,xmm6 ; c.x = cn.x - movaps xmm5,xmm7 ; c.y = cn.y - ; continue loop - inc eax - cmp eax,edi - jb .Loop - ; return 0 - xor eax,eax -.EndLoop: - ret -;------------------------------------------------------------------------------- -; NAME: main -; DESC: Program main function. -;------------------------------------------------------------------------------- -align 16 -Main: -img_ptr equ ebp-8 -seq_ptr equ ebp-16 -pixel equ ebp-24 -r13dd equ ebp-64 -r12dd equ ebp-68 -r15dd equ ebp-72 - - push ebp - mov ebp,esp - sub esp,128 - ; mem for the sequence - lea eax,[sequence] - mov [seq_ptr],eax - ; mem for the image - lea eax,[screen] - mov [img_ptr],eax - ; begin loops - mov dword[r13dd],0 ; .LoopIterations counter -.LoopIterations: - mov dword[r12dd],0 ; .LoopOneMillion counter -.LoopOneMillion: - RANDOM - mulss xmm0,[g_range] - movaps xmm1,xmm0 - RANDOM - mulss xmm0,[g_range] - mov edi,SEQ_SIZE - mov esi,[seq_ptr] - call GenerateSequence ; eax = n sequence size - test eax,eax - jz .LoopSequenceEnd - xor ecx,ecx ; ecx = i = 0 loop counter - ; mov r9dd,[seq_ptr] ; r9 = sequence base address - ; mov r8dd,[img_ptr] ; r8 = image base address - movss xmm2,[g_img_size] - movaps xmm3,xmm2 - mulss xmm3,[g_0_5] ; xmm3 = (g_img_size)/2 - movss xmm4,[g_zoom] - mulss xmm4,xmm2 ; xmm4 = g_zoom * g_img_size - movss xmm5,[g_offsetx] ; xmm5 = g_offsetx - movss xmm6,[g_offsety] ; xmm6 = g_offsety -.LoopSequence: - cmp ecx,eax ; i < n - je .LoopSequenceEnd - movd xmm0,[sequence+ecx*8] ; load re - movd xmm1,[sequence+ecx*8+4] ; load im - addss xmm0,xmm5 ; xmm0 = re+g_offsetx - addss xmm1,xmm6 ; xmm1 = im+g_offsety - mulss xmm0,xmm4 ; xmm0 = (re+g_offsetx)*g_img_size*g_zoom - mulss xmm1,xmm4 ; xmm1 = (im+g_offsety)*g_img_size*g_zoom - addss xmm0,xmm3 ; xmm0 = (re+g_offsetx)*g_img_size*g_zoom+g_img_size/2 - addss xmm1,xmm3 ; xmm1 = (im+g_offsety)*g_img_size*g_zoom+g_img_size/2 - cvtss2si edi,xmm0 ; edi = x = int(xmm0.x) - cvtss2si esi,xmm1 ; esi = y = int(xmm1.x) - cmp edi,0 - jl @f - cmp edi,IMG_SIZE - jge @f - cmp esi,0 - jl @f - cmp esi,IMG_SIZE - jge @f - imul esi,esi,IMG_SIZE - add esi,edi - add dword [screen+esi*4],1 -@@: - inc ecx - jmp .LoopSequence -.LoopSequenceEnd: - ; continue .LoopOneMillion - add dword[r12dd],1 - cmp dword[r12dd],1000000 - jb .LoopOneMillion - ; continue .LoopIterations - add dword[r13dd],1 - cmp dword[r13dd],ITERATIONS - jb .LoopIterations - ; find max value - mov dword[r12dd],0 - xor eax,eax ; eax = i = loop counter -.LoopMax: - push ecx - mov ecx,[r12dd] - cmp dword [screen+eax*4],ecx - cmova ecx,dword [screen+eax*4] - mov [r12dd],ecx - pop ecx - inc eax - cmp eax,IMG_SIZE*IMG_SIZE - jb .LoopMax - ; find min value - ; mov r13d,r12d ; r13d = min_val = max_val - push dword[r12dd] - pop dword[r13dd] - xor eax,eax ; eax = i = loop counter -.LoopMin: - push ecx - mov ecx,[r13dd] - cmp dword [screen+eax*4],ecx - - cmovb ecx,dword [screen+eax*4] - mov [r13dd],ecx - pop ecx - inc eax - cmp eax,IMG_SIZE*IMG_SIZE - jb .LoopMin - ; write image pixels - mov byte [pixel+3],255 - ; mov r14,[img_ptr] ; r14 = image base address - ; xor r15d,r15d ; r15d = i = loop counter - mov dword[r15dd],0 - cvtsi2ss xmm0,[r12dd] ; load max_value - cvtsi2ss xmm1,[r13dd] ; load min_value - movaps xmm2,xmm0 - subss xmm2,xmm1 ; xmm2 = r = max_value - min_value - xor ecx,ecx -.LoopWrite: - mov eax,[screen+ecx*4] ; eax = image_value - sub eax,[r13dd] ; eax = image_value - min_value - cvtsi2ss xmm0,eax ; xmm0 = float(image_value - min_value) - addss xmm0,xmm0 ; xmm0 = 2.0f * float(image_value - min_value) - divss xmm0,xmm2 ; xmm0 = 2.0f * float(image_value - min_value) / r - minss xmm0,[g_1_0] ; clamp to 1.0 - maxss xmm0,[g_0_0] ; clamp to 0.0 - mulss xmm0,[g_255_0] ; convert to 0 - 255 - cvtss2si eax,xmm0 - ; write pixel data - mov [screen+ecx*3],eax - inc ecx - cmp ecx,IMG_SIZE*IMG_SIZE - jb .LoopWrite - mov esp,ebp - pop ebp - ret - ; restore img_ptr,seq_ptr,pixel -;------------------------------------------------------------------------------- -; ********************************************* -; ******* WINDOW DEFINITIONS AND DRAW ******** -; ********************************************* -draw_window: - - mcall SF_REDRAW, SSF_BEGIN_DRAW - - mcall SF_STYLE_SETTINGS, SSF_GET_SKIN_HEIGHT - lea ecx, [50*65536+IMG_SIZE+4+eax] ; [y start] *65536 + [y size] + [skin_height] - mcall SF_CREATE_WINDOW,<50,IMG_SIZE+9>,,0x74000000,,wintitle1 - - mcall SF_REDRAW, SSF_END_DRAW - ret - - -;------------------------------------------------------------------------------- -align 1 -wintitle1 db 'Buddhabrot - Calculating, please wait...',0 -wintitle2 db 'Buddhabrot - Press F8 to set image as wallpaper',0 - -align 4 -g_xorwow_x dd 123456789 -g_xorwow_y dd 362436069 -g_xorwow_z dd 521288629 -g_xorwow_w dd 88675123 -g_xorwow_v dd 5783321 -g_xorwow_d dd 6615241 -g_rand_scale dd 2.3283064e-10 ; 1.0 / 2^32 - -IMG_SIZE = 600 -SEQ_SIZE = 50 -ITERATIONS = 100 - -g_img_size dd 600.0 -g_offsetx dd 0.5 -g_offsety dd 0.0 -g_zoom dd 0.4 - -g_max_dist dd 10.0 -g_range dd 4.2 -g_0_5 dd 0.5 -g_0_0 dd 0.0 -g_1_0 dd 1.0 -g_255_0 dd 255.0 - -IMG_END: -;-------------------- -sequence: rb SEQ_SIZE*8 -screen: rb IMG_SIZE*IMG_SIZE*4 -memStack: rd 1024 -I_END: \ No newline at end of file +; SPDX-License-Identifier: NOASSERTION +; + +; App written by randall ported to Kolibri and MenuetOS64 by macgub (www.macgub.hekko.pl). +; Now it use static memory, it is mixed 32bit code and SSE instructions. + +include '../../macros.inc' +include '../../KOSfuncs.inc' + +use32 + org 0x0 + + db 'MENUET01' ; 8 byte id + dd 0x01 ; header version + dd START ; start of code + dd IMG_END ; size of image + dd I_END ;0x100000 ; memory for app + dd I_END ;0xbffff ; esp + dd 0x0 , 0x0 ; I_Param , I_Icon + +; start of execution +START: + + call draw_window + call draw_from_buffer + call Main + call draw_from_buffer + + mcall SF_SET_CAPTION,1,wintitle2 + +still: + + mcall SF_WAIT_EVENT + + cmp eax,EV_REDRAW + je .redraw + cmp eax,EV_KEY + je .key + cmp eax,EV_BUTTON + je .button + jmp still + + .redraw: + call draw_window + call draw_from_buffer + jmp still + + .key: + mcall SF_GET_KEY + shr eax,16 ; get scancode in 'al' + cmp al,1 + je .exit + cmp al,66 + je set_as_wallpaper + jmp still + + .button: + mcall SF_GET_BUTTON + cmp ah,1 ; button id=1 ? + jne still + + .exit: + mcall SF_TERMINATE_PROCESS + + +set_as_wallpaper: + mcall SF_BACKGROUND_SET,SSF_MODE_BG,2 + mcall SF_BACKGROUND_SET,SSF_SIZE_BG,IMG_SIZE,IMG_SIZE + mcall SF_BACKGROUND_SET,SSF_IMAGE_BG,screen,0,3*IMG_SIZE*IMG_SIZE + mcall SF_BACKGROUND_SET,SSF_REDRAW_BG + jmp still + +draw_from_buffer: + pusha + mcall SF_PUT_IMAGE,screen,IMG_SIZE*65536+IMG_SIZE,0 + popa +ret + +;------------------------------------------------------------------------------- +; NAME: XORWOW +; DESC: Pseudo random number generator. +; OUT: eax [0;2^32-1] +;------------------------------------------------------------------------------- +macro XORWOW { + mov edx,[g_xorwow_x] ; edx = x + shr edx,2 ; edx = x >> 2 + xor edx,[g_xorwow_x] ; t = x ^ (x >> 2) + mov eax,[g_xorwow_y] ; eax = y + mov [g_xorwow_x],eax ; x = y + mov eax,[g_xorwow_z] ; eax = z + mov [g_xorwow_y],eax ; y = z + mov eax,[g_xorwow_w] ; eax = w + mov [g_xorwow_z],eax ; z = w + mov eax,[g_xorwow_v] ; eax = v + mov [g_xorwow_w],eax ; w = v + mov edi,eax ; edi = v + shl edi,4 ; edi = v << 4 + xor edi,eax ; edi = (v ^ (v << 4)) + mov eax,edx ; eax = t + shl eax,1 ; eax = t << 1 + xor eax,edx ; eax = (t ^ (t << 1)) + xor eax,edi ; eax = (v ^ (v << 4)) ^ (t ^ (t << 1)) + mov [g_xorwow_v],eax ; v = eax + add [g_xorwow_d],362437 ; d += 362437 + mov eax,[g_xorwow_d] ; eax = d + add eax,[g_xorwow_v] ; eax = d + v +} +;------------------------------------------------------------------------------- +; NAME: RANDOM +; DESC: Returns pseudo random number in the range [-0.5;0.5). +; OUT: xmm0.x [-0.5;0.5) +;------------------------------------------------------------------------------- +macro RANDOM { + XORWOW + cvtsi2ss xmm0,eax + mulss xmm0,[g_rand_scale] +} +;------------------------------------------------------------------------------- + +;------------------------------------------------------------------------------- +; NAME: GenerateSequence +; IN: xmm0.x re (c0.x) +; IN: xmm1.x im (c0.y) +; IN: edi array size +; IN/OUT: esi pointer to the allocated array +; OUT: eax generated sequence size +;------------------------------------------------------------------------------- +align 16 +GenerateSequence: + xor eax,eax ; eax is index loop + xorps xmm4,xmm4 ; xmm4 is c.x + xorps xmm5,xmm5 ; xmm5 is c.y +.Loop: + ; cn.x = c.x * c.x - c.y * c.y + c0.x + movaps xmm2,xmm4 + movaps xmm3,xmm5 + mulss xmm2,xmm4 + mulss xmm3,xmm5 + subss xmm2,xmm3 + addss xmm2,xmm0 + movaps xmm6,xmm2 ; xmm6 is cn.x + ; cn.y = 2.0 * c.x * c.y + c0.y + movaps xmm7,xmm4 + mulss xmm7,xmm5 + addss xmm7,xmm7 + addss xmm7,xmm1 ; xmm7 is cn.y + ; store cn + movd dword [esi+eax*8],xmm6 + movd dword [esi+eax*8+4],xmm7 + ; if (cn.x * cn.x + cn.y * cn.y > 10.0) return eax; + movaps xmm2,xmm6 + movaps xmm3,xmm7 + mulss xmm2,xmm6 + mulss xmm3,xmm7 + addss xmm2,xmm3 + ucomiss xmm2,[g_max_dist] + ja .EndLoop + movaps xmm4,xmm6 ; c.x = cn.x + movaps xmm5,xmm7 ; c.y = cn.y + ; continue loop + inc eax + cmp eax,edi + jb .Loop + ; return 0 + xor eax,eax +.EndLoop: + ret +;------------------------------------------------------------------------------- +; NAME: main +; DESC: Program main function. +;------------------------------------------------------------------------------- +align 16 +Main: +img_ptr equ ebp-8 +seq_ptr equ ebp-16 +pixel equ ebp-24 +r13dd equ ebp-64 +r12dd equ ebp-68 +r15dd equ ebp-72 + + push ebp + mov ebp,esp + sub esp,128 + ; mem for the sequence + lea eax,[sequence] + mov [seq_ptr],eax + ; mem for the image + lea eax,[screen] + mov [img_ptr],eax + ; begin loops + mov dword[r13dd],0 ; .LoopIterations counter +.LoopIterations: + mov dword[r12dd],0 ; .LoopOneMillion counter +.LoopOneMillion: + RANDOM + mulss xmm0,[g_range] + movaps xmm1,xmm0 + RANDOM + mulss xmm0,[g_range] + mov edi,SEQ_SIZE + mov esi,[seq_ptr] + call GenerateSequence ; eax = n sequence size + test eax,eax + jz .LoopSequenceEnd + xor ecx,ecx ; ecx = i = 0 loop counter + ; mov r9dd,[seq_ptr] ; r9 = sequence base address + ; mov r8dd,[img_ptr] ; r8 = image base address + movss xmm2,[g_img_size] + movaps xmm3,xmm2 + mulss xmm3,[g_0_5] ; xmm3 = (g_img_size)/2 + movss xmm4,[g_zoom] + mulss xmm4,xmm2 ; xmm4 = g_zoom * g_img_size + movss xmm5,[g_offsetx] ; xmm5 = g_offsetx + movss xmm6,[g_offsety] ; xmm6 = g_offsety +.LoopSequence: + cmp ecx,eax ; i < n + je .LoopSequenceEnd + movd xmm0,[sequence+ecx*8] ; load re + movd xmm1,[sequence+ecx*8+4] ; load im + addss xmm0,xmm5 ; xmm0 = re+g_offsetx + addss xmm1,xmm6 ; xmm1 = im+g_offsety + mulss xmm0,xmm4 ; xmm0 = (re+g_offsetx)*g_img_size*g_zoom + mulss xmm1,xmm4 ; xmm1 = (im+g_offsety)*g_img_size*g_zoom + addss xmm0,xmm3 ; xmm0 = (re+g_offsetx)*g_img_size*g_zoom+g_img_size/2 + addss xmm1,xmm3 ; xmm1 = (im+g_offsety)*g_img_size*g_zoom+g_img_size/2 + cvtss2si edi,xmm0 ; edi = x = int(xmm0.x) + cvtss2si esi,xmm1 ; esi = y = int(xmm1.x) + cmp edi,0 + jl @f + cmp edi,IMG_SIZE + jge @f + cmp esi,0 + jl @f + cmp esi,IMG_SIZE + jge @f + imul esi,esi,IMG_SIZE + add esi,edi + add dword [screen+esi*4],1 +@@: + inc ecx + jmp .LoopSequence +.LoopSequenceEnd: + ; continue .LoopOneMillion + add dword[r12dd],1 + cmp dword[r12dd],1000000 + jb .LoopOneMillion + ; continue .LoopIterations + add dword[r13dd],1 + cmp dword[r13dd],ITERATIONS + jb .LoopIterations + ; find max value + mov dword[r12dd],0 + xor eax,eax ; eax = i = loop counter +.LoopMax: + push ecx + mov ecx,[r12dd] + cmp dword [screen+eax*4],ecx + cmova ecx,dword [screen+eax*4] + mov [r12dd],ecx + pop ecx + inc eax + cmp eax,IMG_SIZE*IMG_SIZE + jb .LoopMax + ; find min value + ; mov r13d,r12d ; r13d = min_val = max_val + push dword[r12dd] + pop dword[r13dd] + xor eax,eax ; eax = i = loop counter +.LoopMin: + push ecx + mov ecx,[r13dd] + cmp dword [screen+eax*4],ecx + + cmovb ecx,dword [screen+eax*4] + mov [r13dd],ecx + pop ecx + inc eax + cmp eax,IMG_SIZE*IMG_SIZE + jb .LoopMin + ; write image pixels + mov byte [pixel+3],255 + ; mov r14,[img_ptr] ; r14 = image base address + ; xor r15d,r15d ; r15d = i = loop counter + mov dword[r15dd],0 + cvtsi2ss xmm0,[r12dd] ; load max_value + cvtsi2ss xmm1,[r13dd] ; load min_value + movaps xmm2,xmm0 + subss xmm2,xmm1 ; xmm2 = r = max_value - min_value + xor ecx,ecx +.LoopWrite: + mov eax,[screen+ecx*4] ; eax = image_value + sub eax,[r13dd] ; eax = image_value - min_value + cvtsi2ss xmm0,eax ; xmm0 = float(image_value - min_value) + addss xmm0,xmm0 ; xmm0 = 2.0f * float(image_value - min_value) + divss xmm0,xmm2 ; xmm0 = 2.0f * float(image_value - min_value) / r + minss xmm0,[g_1_0] ; clamp to 1.0 + maxss xmm0,[g_0_0] ; clamp to 0.0 + mulss xmm0,[g_255_0] ; convert to 0 - 255 + cvtss2si eax,xmm0 + ; write pixel data + mov [screen+ecx*3],eax + inc ecx + cmp ecx,IMG_SIZE*IMG_SIZE + jb .LoopWrite + mov esp,ebp + pop ebp + ret + ; restore img_ptr,seq_ptr,pixel +;------------------------------------------------------------------------------- +; ********************************************* +; ******* WINDOW DEFINITIONS AND DRAW ******** +; ********************************************* +draw_window: + + mcall SF_REDRAW, SSF_BEGIN_DRAW + + mcall SF_STYLE_SETTINGS, SSF_GET_SKIN_HEIGHT + lea ecx, [50*65536+IMG_SIZE+4+eax] ; [y start] *65536 + [y size] + [skin_height] + mcall SF_CREATE_WINDOW,<50,IMG_SIZE+9>,,0x74000000,,wintitle1 + + mcall SF_REDRAW, SSF_END_DRAW + ret + + +;------------------------------------------------------------------------------- +align 1 +wintitle1 db 'Buddhabrot - Calculating, please wait...',0 +wintitle2 db 'Buddhabrot - Press F8 to set image as wallpaper',0 + +align 4 +g_xorwow_x dd 123456789 +g_xorwow_y dd 362436069 +g_xorwow_z dd 521288629 +g_xorwow_w dd 88675123 +g_xorwow_v dd 5783321 +g_xorwow_d dd 6615241 +g_rand_scale dd 2.3283064e-10 ; 1.0 / 2^32 + +IMG_SIZE = 600 +SEQ_SIZE = 50 +ITERATIONS = 100 + +g_img_size dd 600.0 +g_offsetx dd 0.5 +g_offsety dd 0.0 +g_zoom dd 0.4 + +g_max_dist dd 10.0 +g_range dd 4.2 +g_0_5 dd 0.5 +g_0_0 dd 0.0 +g_1_0 dd 1.0 +g_255_0 dd 255.0 + +IMG_END: +;-------------------- +sequence: rb SEQ_SIZE*8 +screen: rb IMG_SIZE*IMG_SIZE*4 +memStack: rd 1024 +I_END: diff --git a/programs/demos/buddhabrot/trunk/build.bat b/programs/demos/buddhabrot/build.bat similarity index 100% rename from programs/demos/buddhabrot/trunk/build.bat rename to programs/demos/buddhabrot/build.bat diff --git a/programs/demos/colorref/trunk/Tupfile.lua b/programs/demos/colorref/Tupfile.lua similarity index 79% rename from programs/demos/colorref/trunk/Tupfile.lua rename to programs/demos/colorref/Tupfile.lua index d48992dd5..2e131aa8d 100644 --- a/programs/demos/colorref/trunk/Tupfile.lua +++ b/programs/demos/colorref/Tupfile.lua @@ -1,5 +1,5 @@ if tup.getconfig("NO_FASM") ~= "" then return end -HELPERDIR = (tup.getconfig("HELPERDIR") == "") and "../../.." or tup.getconfig("HELPERDIR") +HELPERDIR = (tup.getconfig("HELPERDIR") == "") and "../.." or tup.getconfig("HELPERDIR") tup.include(HELPERDIR .. "/use_fasm.lua") add_include(tup.getvariantdir()) diff --git a/programs/demos/colorref/trunk/build_en.bat b/programs/demos/colorref/build_en.bat similarity index 100% rename from programs/demos/colorref/trunk/build_en.bat rename to programs/demos/colorref/build_en.bat diff --git a/programs/demos/colorref/trunk/build_ru.bat b/programs/demos/colorref/build_ru.bat similarity index 100% rename from programs/demos/colorref/trunk/build_ru.bat rename to programs/demos/colorref/build_ru.bat diff --git a/programs/demos/colorref/trunk/colorref.asm b/programs/demos/colorref/colorref.asm similarity index 99% rename from programs/demos/colorref/trunk/colorref.asm rename to programs/demos/colorref/colorref.asm index 2fcb7bb49..8efa498c1 100644 --- a/programs/demos/colorref/trunk/colorref.asm +++ b/programs/demos/colorref/colorref.asm @@ -1,3 +1,6 @@ +; SPDX-License-Identifier: NOASSERTION +; + ; COLORREF.ASM - COLOR REFERENCE ; ; Compile with FASM for Menuet @@ -15,7 +18,7 @@ use32 dd 0x0,0x0 ; I_Param , I_Icon include 'lang.inc' -include '..\..\..\macros.inc' +include '..\..\macros.inc' wide: dd 0 ; screen pixels width mouse: dd 0 ; 1=right,2=left [mouse click] @@ -148,7 +151,7 @@ draw_window: mov edx,0x14000000 ; work area color (type II) mov edi,title ; frame color mcall - + call palette ; display color palette mcall 12, 2 @@ -267,7 +270,7 @@ help: add ecx, 236 sub ecx, eax - + mov ebx,5*65536+190 ; x and width mov edx,0x465e8f ; dark denim color mov eax,13 ; write text funx @@ -294,7 +297,7 @@ h1: push ecx jne h2 ; nope mov eax,2 ; yep, burn it mcall -h2: +h2: call draw_window ret diff --git a/programs/demos/crownscr/trunk/Tupfile.lua b/programs/demos/crownscr/Tupfile.lua similarity index 79% rename from programs/demos/crownscr/trunk/Tupfile.lua rename to programs/demos/crownscr/Tupfile.lua index dd3c4e554..cdcd46641 100644 --- a/programs/demos/crownscr/trunk/Tupfile.lua +++ b/programs/demos/crownscr/Tupfile.lua @@ -1,5 +1,5 @@ if tup.getconfig("NO_FASM") ~= "" then return end -HELPERDIR = (tup.getconfig("HELPERDIR") == "") and "../../.." or tup.getconfig("HELPERDIR") +HELPERDIR = (tup.getconfig("HELPERDIR") == "") and "../.." or tup.getconfig("HELPERDIR") tup.include(HELPERDIR .. "/use_fasm.lua") add_include(tup.getvariantdir()) diff --git a/programs/demos/crownscr/trunk/build_en.bat b/programs/demos/crownscr/build_en.bat similarity index 100% rename from programs/demos/crownscr/trunk/build_en.bat rename to programs/demos/crownscr/build_en.bat diff --git a/programs/demos/crownscr/trunk/build_ru.bat b/programs/demos/crownscr/build_ru.bat similarity index 100% rename from programs/demos/crownscr/trunk/build_ru.bat rename to programs/demos/crownscr/build_ru.bat diff --git a/programs/demos/crownscr/trunk/crownscr.asm b/programs/demos/crownscr/crownscr.asm similarity index 98% rename from programs/demos/crownscr/trunk/crownscr.asm rename to programs/demos/crownscr/crownscr.asm index 870da1ecc..f69e427d6 100644 --- a/programs/demos/crownscr/trunk/crownscr.asm +++ b/programs/demos/crownscr/crownscr.asm @@ -1,3 +1,6 @@ +; SPDX-License-Identifier: NOASSERTION +; + ; ; Crown_s Soft Screensaver v1.13m ; WWW: http://www.crown-s-soft.com @@ -34,8 +37,8 @@ copyrightlen: include "lang.inc" include "figuresi.inc" -include "..\..\..\macros.inc" -include "..\..\..\KOSfuncs.inc" +include "..\..\macros.inc" +include "..\..\KOSfuncs.inc" start: cmp dword[params], '@ss' setz [screensaver] @@ -96,7 +99,7 @@ red: still: mcall SF_WAIT_EVENT_TIMEOUT, delay ; wait here for event - + cmp eax,1 ; redraw request ? je red cmp eax,2 ; key in buffer ? @@ -117,7 +120,7 @@ jmp still key: cmp [screensaver], 0 jnz close - + mcall SF_GET_KEY cmp al,1 ; is key in buffer ? diff --git a/programs/demos/crownscr/trunk/figuresi.inc b/programs/demos/crownscr/figuresi.inc similarity index 100% rename from programs/demos/crownscr/trunk/figuresi.inc rename to programs/demos/crownscr/figuresi.inc diff --git a/programs/demos/cslide/trunk/Tupfile.lua b/programs/demos/cslide/Tupfile.lua similarity index 79% rename from programs/demos/cslide/trunk/Tupfile.lua rename to programs/demos/cslide/Tupfile.lua index edca97950..ac018d636 100644 --- a/programs/demos/cslide/trunk/Tupfile.lua +++ b/programs/demos/cslide/Tupfile.lua @@ -1,5 +1,5 @@ if tup.getconfig("NO_FASM") ~= "" then return end -HELPERDIR = (tup.getconfig("HELPERDIR") == "") and "../../.." or tup.getconfig("HELPERDIR") +HELPERDIR = (tup.getconfig("HELPERDIR") == "") and "../.." or tup.getconfig("HELPERDIR") tup.include(HELPERDIR .. "/use_fasm.lua") add_include(tup.getvariantdir()) diff --git a/programs/demos/cslide/trunk/build_en.bat b/programs/demos/cslide/build_en.bat similarity index 100% rename from programs/demos/cslide/trunk/build_en.bat rename to programs/demos/cslide/build_en.bat diff --git a/programs/demos/cslide/trunk/build_ru.bat b/programs/demos/cslide/build_ru.bat similarity index 100% rename from programs/demos/cslide/trunk/build_ru.bat rename to programs/demos/cslide/build_ru.bat diff --git a/programs/demos/cslide/trunk/cslide.asm b/programs/demos/cslide/cslide.asm similarity index 98% rename from programs/demos/cslide/trunk/cslide.asm rename to programs/demos/cslide/cslide.asm index 3f5cae91d..57487ba5e 100644 --- a/programs/demos/cslide/trunk/cslide.asm +++ b/programs/demos/cslide/cslide.asm @@ -1,3 +1,6 @@ +; SPDX-License-Identifier: NOASSERTION +; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; ; Color Slider Control Demonstration ; @@ -20,8 +23,8 @@ use32 dd 0x0 , 0x0 ; I_Param , I_Icon include 'lang.inc' -include '..\..\..\macros.inc' -include '..\..\..\KOSfuncs.inc' +include '..\..\macros.inc' +include '..\..\KOSfuncs.inc' START: ; start of execution call draw_window ; at first, draw the window @@ -50,7 +53,7 @@ still: button: ; button mcall SF_GET_BUTTON ; get id - + shr eax,8 cmp eax,1 ; button id=1 ? @@ -72,7 +75,7 @@ draw_window: mcall SF_REDRAW, SSF_BEGIN_DRAW mcall SF_CREATE_WINDOW, <100,200>, <100,200>, 0x14ffffff, , title mcall SF_REDRAW, SSF_END_DRAW - + call draw_slider_info xor ecx,ecx @@ -151,7 +154,7 @@ ret draw_slider_info: ;Repaint value background - mcall SF_DRAW_RECT, 144*65536+36, 72*65536+9, 0x00ffffff + mcall SF_DRAW_RECT, 144*65536+36, 72*65536+9, 0x00ffffff ;Draw Color Box xor edx, edx movzx ecx,word [slider_1+12] @@ -164,7 +167,7 @@ draw_slider_info: mov ebx, 0x00860035 mov ecx, 0x00590040 mov eax, SF_DRAW_RECT - mcall + mcall ;draw current value of slider mov ecx, edx mov eax, SF_DRAW_NUMBER @@ -340,4 +343,4 @@ ret ; DATA AREA title db 'Color Slider',0 -I_END: \ No newline at end of file +I_END: diff --git a/programs/demos/cubeline/trunk/Makefile b/programs/demos/cubeline/Makefile similarity index 100% rename from programs/demos/cubeline/trunk/Makefile rename to programs/demos/cubeline/Makefile diff --git a/programs/demos/cubeline/trunk/ProcessTab.h b/programs/demos/cubeline/ProcessTab.h similarity index 100% rename from programs/demos/cubeline/trunk/ProcessTab.h rename to programs/demos/cubeline/ProcessTab.h diff --git a/programs/demos/cubeline/trunk/SysCall.h b/programs/demos/cubeline/SysCall.h similarity index 100% rename from programs/demos/cubeline/trunk/SysCall.h rename to programs/demos/cubeline/SysCall.h diff --git a/programs/demos/cubeline/trunk/fps.cpp b/programs/demos/cubeline/fps.cpp similarity index 100% rename from programs/demos/cubeline/trunk/fps.cpp rename to programs/demos/cubeline/fps.cpp diff --git a/programs/demos/cubeline/trunk/main.cpp b/programs/demos/cubeline/main.cpp similarity index 100% rename from programs/demos/cubeline/trunk/main.cpp rename to programs/demos/cubeline/main.cpp diff --git a/programs/demos/cubetext/trunk/Makefile b/programs/demos/cubetext/Makefile similarity index 100% rename from programs/demos/cubetext/trunk/Makefile rename to programs/demos/cubetext/Makefile diff --git a/programs/demos/cubetext/trunk/ProcessTab.h b/programs/demos/cubetext/ProcessTab.h similarity index 100% rename from programs/demos/cubetext/trunk/ProcessTab.h rename to programs/demos/cubetext/ProcessTab.h diff --git a/programs/demos/cubetext/trunk/SysCall.h b/programs/demos/cubetext/SysCall.h similarity index 100% rename from programs/demos/cubetext/trunk/SysCall.h rename to programs/demos/cubetext/SysCall.h diff --git a/programs/demos/cubetext/trunk/bmp.cpp b/programs/demos/cubetext/bmp.cpp similarity index 100% rename from programs/demos/cubetext/trunk/bmp.cpp rename to programs/demos/cubetext/bmp.cpp diff --git a/programs/demos/cubetext/trunk/bmp.h b/programs/demos/cubetext/bmp.h similarity index 100% rename from programs/demos/cubetext/trunk/bmp.h rename to programs/demos/cubetext/bmp.h diff --git a/programs/demos/cubetext/trunk/fps.cpp b/programs/demos/cubetext/fps.cpp similarity index 100% rename from programs/demos/cubetext/trunk/fps.cpp rename to programs/demos/cubetext/fps.cpp diff --git a/programs/demos/cubetext/trunk/logio.bmp b/programs/demos/cubetext/logio.bmp similarity index 100% rename from programs/demos/cubetext/trunk/logio.bmp rename to programs/demos/cubetext/logio.bmp diff --git a/programs/demos/cubetext/trunk/main.cpp b/programs/demos/cubetext/main.cpp similarity index 100% rename from programs/demos/cubetext/trunk/main.cpp rename to programs/demos/cubetext/main.cpp diff --git a/programs/demos/cubetext/trunk/readme.txt b/programs/demos/cubetext/readme.txt similarity index 100% rename from programs/demos/cubetext/trunk/readme.txt rename to programs/demos/cubetext/readme.txt diff --git a/programs/demos/eyes/trunk/Tupfile.lua b/programs/demos/eyes/Tupfile.lua similarity index 79% rename from programs/demos/eyes/trunk/Tupfile.lua rename to programs/demos/eyes/Tupfile.lua index 344378152..dc8f0f4c1 100644 --- a/programs/demos/eyes/trunk/Tupfile.lua +++ b/programs/demos/eyes/Tupfile.lua @@ -1,5 +1,5 @@ if tup.getconfig("NO_FASM") ~= "" then return end -HELPERDIR = (tup.getconfig("HELPERDIR") == "") and "../../.." or tup.getconfig("HELPERDIR") +HELPERDIR = (tup.getconfig("HELPERDIR") == "") and "../.." or tup.getconfig("HELPERDIR") tup.include(HELPERDIR .. "/use_fasm.lua") add_include(tup.getvariantdir()) diff --git a/programs/demos/eyes/trunk/build_en.bat b/programs/demos/eyes/build_en.bat similarity index 100% rename from programs/demos/eyes/trunk/build_en.bat rename to programs/demos/eyes/build_en.bat diff --git a/programs/demos/eyes/trunk/build_ru.bat b/programs/demos/eyes/build_ru.bat similarity index 100% rename from programs/demos/eyes/trunk/build_ru.bat rename to programs/demos/eyes/build_ru.bat diff --git a/programs/demos/eyes/trunk/eyes.asm b/programs/demos/eyes/eyes.asm similarity index 98% rename from programs/demos/eyes/trunk/eyes.asm rename to programs/demos/eyes/eyes.asm index 08d797f5f..914910969 100644 --- a/programs/demos/eyes/trunk/eyes.asm +++ b/programs/demos/eyes/eyes.asm @@ -1,3 +1,6 @@ +; SPDX-License-Identifier: NOASSERTION +; + ; ; EYES FOR MENUET ; @@ -22,7 +25,7 @@ use32 dd 0x0 dd 0x0 -include '..\..\..\macros.inc' +include '..\..\macros.inc' ENTRANCE: ; start of code ; ==== main ==== diff --git a/programs/demos/eyes/trunk/eyes.raw b/programs/demos/eyes/eyes.raw similarity index 100% rename from programs/demos/eyes/trunk/eyes.raw rename to programs/demos/eyes/eyes.raw diff --git a/programs/demos/fire2/trunk/Tupfile.lua b/programs/demos/fire2/Tupfile.lua similarity index 100% rename from programs/demos/fire2/trunk/Tupfile.lua rename to programs/demos/fire2/Tupfile.lua diff --git a/programs/demos/fire2/trunk/build.bat b/programs/demos/fire2/build.bat similarity index 100% rename from programs/demos/fire2/trunk/build.bat rename to programs/demos/fire2/build.bat diff --git a/programs/demos/fire2/trunk/fire2.asm b/programs/demos/fire2/fire2.asm similarity index 97% rename from programs/demos/fire2/trunk/fire2.asm rename to programs/demos/fire2/fire2.asm index 18d70b247..c11766560 100644 --- a/programs/demos/fire2/trunk/fire2.asm +++ b/programs/demos/fire2/fire2.asm @@ -1,4 +1,10 @@ -include '..\..\..\macros.inc' +; SPDX-License-Identifier: NOASSERTION +; + +; Text encoded with Code Page 866 - Cyrillic + + +include '..\..\macros.inc' use32 org 0x0 @@ -199,7 +205,7 @@ put_big_point: ;DATA align 4 - + count1 dd my_img count2 dd 0 curtime dd 0 diff --git a/programs/demos/flatwav/trunk/FLATWAV.ASM b/programs/demos/flatwav/FLATWAV.ASM similarity index 100% rename from programs/demos/flatwav/trunk/FLATWAV.ASM rename to programs/demos/flatwav/FLATWAV.ASM diff --git a/programs/demos/flatwav/trunk/Tupfile.lua b/programs/demos/flatwav/Tupfile.lua similarity index 100% rename from programs/demos/flatwav/trunk/Tupfile.lua rename to programs/demos/flatwav/Tupfile.lua diff --git a/programs/demos/flatwav/trunk/build.bat b/programs/demos/flatwav/build.bat similarity index 100% rename from programs/demos/flatwav/trunk/build.bat rename to programs/demos/flatwav/build.bat diff --git a/programs/demos/free3d/trunk/Tupfile.lua b/programs/demos/free3d/Tupfile.lua similarity index 100% rename from programs/demos/free3d/trunk/Tupfile.lua rename to programs/demos/free3d/Tupfile.lua diff --git a/programs/demos/free3d/trunk/build.bat b/programs/demos/free3d/build.bat similarity index 100% rename from programs/demos/free3d/trunk/build.bat rename to programs/demos/free3d/build.bat diff --git a/programs/demos/free3d/trunk/build.sh b/programs/demos/free3d/build.sh similarity index 100% rename from programs/demos/free3d/trunk/build.sh rename to programs/demos/free3d/build.sh diff --git a/programs/demos/free3d/trunk/free3d.asm b/programs/demos/free3d/free3d.asm similarity index 94% rename from programs/demos/free3d/trunk/free3d.asm rename to programs/demos/free3d/free3d.asm index 02a51840b..c92596865 100644 --- a/programs/demos/free3d/trunk/free3d.asm +++ b/programs/demos/free3d/free3d.asm @@ -1,1446 +1,1449 @@ -;--------------------------------------------------------------------- -; Free3D version 0.6 -; -; last update: 21/02/2011 -; written by: Marat Zakiyanov aka Mario79, aka Mario -; changes: advanced control for mouse -; advanced control for keyboard: -; W,A,S,D adn Arrow UP,Down,Left,Right -;--------------------------------------------------------------------- -; Free3D version 0.5 -; -; last update: 20/02/2011 -; written by: Marat Zakiyanov aka Mario79, aka Mario -; changes: PNG textures 128x128 -; using libraries cnv_png.obj and archiver.obj -; using dinamically allocation of memory -; -;--------------------------------------------------------------------- -; -; Fisheye Raycasting Engine Etc. FREE3D for MENUETOS by Dieter Marfurt -; Version 0.4 (requires some texture-files to compile (see Data Section)) -; dietermarfurt@angelfire.com - www.melog.ch/mos_pub/ -; Don't hit me - I'm an ASM-Newbie... since years :) -; -; Compile with FASM for Menuet (requires .INC files - see DATA Section) -; -; Willow - greatly srinked code size by using GIF texture and FPU to calculate sine table -; -; !!!! Don't use GIF_LITE.INC in your apps - it's modified for FREE3D !!!! -; -; Heavyiron - new 0-function of drawing window from kolibri (do not work correctly with menuet) - -TEX_SIZE equ 128*128*4 ;64*64*4 ; - -ICON_SIZE_X equ 128 ;64 -ICON_SIZE_Y equ 128 ;64 - -Floors_Height equ 32000 -;--------------------------------------------------------------------- -use32 -org 0x0 - db 'MENUET01' ; 8 byte id - dd 0x01 ; header version - dd START ; start of code - dd IM_END ; size of image - dd I_END ; 0x100000 ; memory for app - dd stacktop ; 0x100000 ; esp - dd 0x0 - dd path -;--------------------------------------------------------------------- -include '../../../macros.inc' -;include 'macros.inc' -include '../../../KOSfuncs.inc' -include '../../../load_lib.mac' -;include 'load_lib.mac' -@use_library -;--------------------------------------------------------------------- -START: ; start of execution - mcall 68,11 - mcall 66,1,1 - mcall 40,0x27 - - mcall 9,procinfo,-1 - mov ecx,[ebx+30] ; PID - mcall 18,21 - mov [active_process],eax ; WINDOW SLOT - -load_libraries l_libs_start,end_l_libs - test eax,eax - jnz finish - -; unpack deflate - mov eax,[unpack_DeflateUnpack2] - mov [deflate_unpack],eax - - call load_icons - call convert_icons - - mov esi,sinus - mov ecx,360*10 - fninit - fld [sindegree] -;-------------------------------------- -.sinlp: - fst st1 - fsin - fmul [sindiv] - fistp dword[esi] - add esi,4 - fadd [sininc] - loop .sinlp -;--------------------------------------------------------------------- - call cursor_to_screen_center - call set_new_cursor_skin -;--------------------------------------------------------------------- -align 4 -red: ; redraw - call draw_window - call draw_stuff -;--------------------------------------------------------------------- -align 4 -still: - mcall 10 ; ask no wait for full speed - - cmp eax,1 ; window redraw request ? - je red - - cmp eax,2 ; key in buffer ? - je key - - cmp eax,3 ; button in buffer ? - je button - - cmp eax,6 - jne still -;--------------------------------------------------------------------- -mouse: - mcall 18,7 - cmp [active_process],eax - jne still - - mcall 37,1 - - xor ebx,ebx - mov bx,ax ; EBX mouse y - shr eax,16 ; EAX mouse x - - mov ecx,[mouse_position_old] - xor edx,edx - mov dx,cx ; EDX mouse y old - shr ecx,16 ; ECX mouse x old - - cmp eax,ecx - je .y ;still - ja .turn_left -;--------------------------------------------------------------------- -.turn_right: - xchg eax,ecx - sub eax,ecx - mov edi,[vheading] - add edi,eax - jmp @f -;--------------------------------------------------------------------- -.turn_left: - sub eax,ecx - mov edi,[vheading] - sub edi,eax -;-------------------------------------- -@@: - call check_range -;--------------------------------------------------------------------- -.y: - cmp ebx,edx - je .red - ja .walk_down -;-------------------------------------- -.walk_up: - sub edx,ebx - mov ecx,edx - call prepare_2 - jz .1 -;-------------------------------------- - add eax,edi ; newPx - add ebx,esi ; newPy - jmp .1 -;--------------------------------------------------------------------- -.walk_down: - sub ebx,edx - mov ecx,ebx - call prepare_2 - jz .1 - - sub eax,edi ; newPx - sub ebx,esi ; newPy -;-------------------------------------- -.1: - mov edi,eax ; newPx / ffff - mov esi,ebx ; newPy / ffff - sar edi,16 - sar esi,16 - mov ecx,esi - sal ecx,5 - lea ecx,[grid+ecx+edi] - cmp [ecx],byte 0 - je @f - - call cursor_to_screen_center - jmp still ;cannotwalk -;--------------------------------------------------------------------- -@@: - mov [vpx],eax - mov [vpy],ebx -;-------------------------------------- -.red: - call cursor_to_screen_center - jmp red -;--------------------------------------------------------------------- -align 4 -prepare_2: - shr ecx,4 - push ecx - call prepare_1 - pop ecx - cmp ecx,3 - jb @f - mov ecx,3 -@@: - shl edi,cl - shl esi,cl - test ecx,ecx - ret -;--------------------------------------------------------------------- -align 4 -check_range: - cmp edi,0 - jge @f - - mov edi,3600 - jmp .store -;-------------------------------------- -@@: - cmp edi,3600 - jle @f - - xor edi,edi -;-------------------------------------- -@@: -.store: - mov [vheading],edi - ret -;--------------------------------------------------------------------- -align 4 -cursor_to_screen_center: - mcall 18,15 - mcall 37,1 - mov [mouse_position_old],eax - ret -;--------------------------------------------------------------------- -set_new_cursor_skin: - mcall 68,12,32*32*4 - mov ecx,eax - mcall 37,4,,2 - mov ecx,eax - mcall 37,5 - ret -;--------------------------------------------------------------------- -align 4 -key: ; key - mcall 2 - cmp [extended_key],1 - je .extended_key - test al, al - jnz still - - cmp ah, 0xE0 - jne @f - - mov [extended_key],1 - jmp still -;--------------------------------------------------------------------- -@@: - cmp ah,1 ; Esc - je finish - - cmp ah,17 ; W up - je s_up - - cmp ah,31 ; S down - je s_down - - cmp ah,30 ; A left - je w_left ;s_left - - cmp ah,32 ; D right - je w_right ;s_right - - jmp still -;--------------------------------------------------------------------- -.extended_key: - mov [extended_key],0 - mov [current_key_code],ah - - cmp ah,27 ; esc=End App - je finish - - cmp ah,72 ; up arrow - je s_up - - cmp ah,80 ; down arrow - je s_down - - cmp ah,75 ; left arrow - je s_left - - cmp ah,77 ; right arrow - je s_right - - jmp still -;--------------------------------------------------------------------- -align 4 -smart_clr_key_buf: - mov al,[old_key_code] - mov ah,[current_key_code] - mov [old_key_code],ah - cmp al,ah - jne .end -;-------------------------------------- -.still: - mcall 2 - cmp [extended_key],1 - je .extended_key - - test al, al - jnz .end - - cmp ah, 0xE0 - jne .end - - mov [extended_key],1 - jmp .still -.end: - call draw_stuff - jmp still -;--------------------------------------------------------------------- -.extended_key: - mov [extended_key],0 - mov [current_key_code],ah - jmp smart_clr_key_buf -;--------------------------------------------------------------------- -align 4 -w_left: ; walk left - call prepare_1 - add eax,esi ; newPx - sub ebx,edi ; newPy - jmp s_down.1 -;--------------------------------------------------------------------- -align 4 -w_right: ; walk right - call prepare_1 - sub eax,esi ; newPx - add ebx,edi ; newPy - jmp s_down.1 -;--------------------------------------------------------------------- -align 4 -s_up: ; walk forward (key or mouse) - call prepare_1 -; sal esi,1 ; edit walking speed here -; sal edi,1 - add eax,edi ; newPx - add ebx,esi ; newPy - jmp s_down.1 -;--------------------------------------------------------------------- -align 4 -s_down: ; walk backward - call prepare_1 -; sal esi,1 ; edit walking speed here -; sal edi,1 - sub eax,edi ; newPx - sub ebx,esi ; newPy -.1: - mov edi,eax ; newPx / ffff - mov esi,ebx ; newPy / ffff - sar edi,16 - sar esi,16 - mov ecx,esi - sal ecx,5 - lea ecx,[grid+ecx+edi] - cmp [ecx],byte 0 - jne smart_clr_key_buf ;cannotwalk - - mov [vpx],eax - mov [vpy],ebx - jmp smart_clr_key_buf -;--------------------------------------------------------------------- -align 4 -prepare_1: - mov eax,[vpx] - mov ebx,[vpy] - mov ecx,[vheading] - mov edx,ecx - mov edi,[sinus+ecx*4] - lea edx,[sinus+3600+edx*4] - cmp edx,eosinus ; cosinus taken from (sinus plus 900) mod 3600 - jb @f - - sub edx,14400 -;-------------------------------------- -@@: - mov esi,[edx] - ret -;--------------------------------------------------------------------- -align 4 -s_left: ; turn left (key) - mov edi,[vheading] - add edi,50 - jmp s_right.1 -;--------------------------------------------------------------------- -align 4 -s_right: ; turn right - mov edi,[vheading] - sub edi,50 -.1: - call check_range - jmp smart_clr_key_buf -;--------------------------------------------------------------------- -align 4 -button: ; button - mcall 17 - cmp ah,1 ; button id=1 ? - jne still ;gamestart -;-------------------------------------- -finish: - mcall -1 ; close this program -;--------------------------------------------------------------------- -; ********************************************* -; ******* WINDOW DEFINITIONS AND DRAW ******** -; ********************************************* -align 4 -draw_window: - mcall 12,1 - - mcall 0,<50,649>,<50,484>,0x01000000,0x01000000,0x01000000 - - mcall 12,2 - ret -;--------------------------------------------------------------------- -; ********************************************* -; ******* COMPUTE 3D-VIEW ******** -; ********************************************* -align 4 -draw_stuff: - mov [step1],dword 1 -; mov [step64],dword 64 - mov esi,[vheading] - add esi,320 - mov [va],esi - mov eax,[vheading] - sub eax,320 - mov [vacompare],eax -;------------------------------------ CAST 640 PIXEL COLUMNS --------------- -; FOR A=320+heading to -319+heading step -1 (a is stored in [va]) -;--------------------------------------------------------------------------- -; mov edx,5 - mov [vx1],dword 0 ;5 ;edx ; init x1 ... pixelcolumn -;-------------------------------------- -align 4 -for_a: - mov edx,[vx1] - mov [vx1b],edx - sub [vx1b],dword 320 - mov edx,[va] ; a2 - cmp edx,-1 ; a2 is a mod 3600 - jg ok1 - - add edx,3600 -;-------------------------------------- -ok1: - cmp edx,3600 - jb ok2 - - sub edx,3600 -;-------------------------------------- -ok2: -; get stepx and stepy - ; pointer to stepx - lea ecx,[sinus+edx*4] - mov esi,[ecx] - sar esi,4 ; accuracy - mov [vstepx],esi ; store stepx - lea esi,[sinus+3600+edx*4] - cmp esi,eosinus ;cosinus taken from ((sinus plus 900) mod 3600) - jb ok202 - - sub esi,14400 -;-------------------------------------- -ok202: - mov ecx,[esi] - sar ecx,4 - mov [vstepy],ecx ; store stepy - - mov eax,[vpx] ; get Camera Position - mov ebx,[vpy] - mov [vxx],eax ; init caster position - mov [vyy],ebx - - mov edi,0 ; init L (number of raycsting-steps) - mov [step1],dword 1 ; init Caster stepwidth for L. -;-------------------------------------- -; raycast a pixel column -align 4 -raycast: - add edi,[step1] ; count caster steps - jmp nodouble ; use this to prevent blinking/wobbling textures: much slower! - -; cmp edi,32 -; je double - -; cmp edi,512 -; je double - -; cmp edi,1024 -; je double - -; jmp nodouble -;--------------------------------------------------------------------- -;double: -; mov edx,[step1] -; sal edx,1 -; mov [step1],edx - -; mov edx,[vstepx] -; sal edx,1 -; mov [vstepx],edx - -; mov edx,[vstepy] -; sal edx,1 -; mov [vstepy],edx -;-------------------------------------- -nodouble: - mov eax,Floors_Height ;32000 ; 3600 ; determine Floors Height based on distance - xor edx,edx - mov ebx,edi - - div ebx - - shl edx,1 - cmp ebx,edx - jae @f - inc eax -@@: - - mov esi,eax - mov [vdd],esi - mov edx,260 - sub edx,esi - mov [vh],edx - - cmp edx,22 - jb no_nu_pixel - - cmp edx,259 - jg no_nu_pixel ; draw only new pixels - - cmp edx,[h_old] - je no_nu_pixel - - mov eax,[vxx] ; calc floor pixel - mov ebx,[vyy] - - and eax,0x0000FFFF - and ebx,0x0000FFFF - - shr eax,10 - shr ebx,10 ; pixel coords inside Texture x,y 64*64 - mov [xfrac],eax - mov [yfrac],ebx -; plot floor pixel !!!! - mov [vl],edi ; save L - mov [ytemp],esi ; remember L bzw. H - - mov edi,[yfrac] ; get pixel color of this floor pixel - sal edi,9 ;8 - for 64x64 - mov esi,[xfrac] - sal esi,3 ;2 - for 64x64 -; in fact its floor, just using the wall texture :) -; lea edi,[wall+edi+esi] - add edi,[wall1] - add edi,esi - mov edx,[edi] - mov [remesi],esi -;**** calculate pixel adress:**** - mov esi,[ytemp] - add esi,240 - imul esi,1920 - mov eax,[vx1] - lea eax,[eax+eax*2] - lea esi,[screen_buffer+eax+esi] - - cmp esi,screen_buffer+1920*480 - jg foff0 - - cmp esi,screen_buffer - jb foff0 -; now we have the adress of the floor-pixel color in edi -; and the adress of the pixel in the image in esi - mov edx,[edi] -;******************** custom distance DARKEN Floor - mov eax,[vdd] -; jmp nodark0 ; use this to deactivate darkening floor (a bit faster) - - cmp eax,80 - jg nodark0 -; split rgb - mov [blue_color],edx - and [blue_color],dword 255 - - shr edx,8 - mov [green_color],edx - and [green_color],dword 255 - - shr edx,8 - mov [red_color],edx - and [red_color],dword 255 - - mov eax,81 ; darkness parameter - sub eax,[vdd] - sal eax,1 -; reduce rgb - sub [red_color],eax - cmp [red_color],dword 0 - jg notblack10 - - mov [red_color],dword 0 -;-------------------------------------- -notblack10: - sub [green_color],eax - cmp [green_color],dword 0 - jg notblack20 - - mov [green_color],dword 0 -;-------------------------------------- -notblack20: - mov edx,[blue_color] - sub [blue_color],eax - cmp [blue_color],dword 0 - jg notblack30 - - mov [blue_color],dword 0 -;-------------------------------------- -notblack30: - shl dword [red_color],16 ; reassemble rgb - shl dword [green_color],8 - mov edx,[red_color] - or edx,[green_color] - or edx,[blue_color] -;-------------------------------------- -nodark0: -; eo custom darken floor - mov eax,edx - -; cmp esi,screen_buffer+1920*480 -; ja foff0 - -; cmp esi,screen_buffer -; jb foff0 - - mov [esi],eax ; actually draw the floor pixel -; paint "forgotten" pixels - mov edx,[lasty] - sub edx,1920 - cmp esi,edx - je foff0 - - mov [esi+1920],eax - sub edx,1920 - cmp esi,edx - je foff0 - - mov [edx+1920],eax - sub edx,1920 - cmp esi,edx - je foff0 - - mov [edx+1920],eax -;-------------------------------------- -align 4 -foff0: - mov [lasty],esi -;**** end of draw floor pixel **** - mov esi,[remesi] - mov edi,[vl] ; restore L -;-------------------------------------- -no_nu_pixel: - mov esi,[vh] - mov [h_old],esi - - mov eax,[vxx] - mov ebx,[vyy] - - add eax,[vstepx] ; casting... - add ebx,[vstepy] - - mov [vxx],eax - mov [vyy],ebx - - sar eax,16 - sar ebx,16 - - mov [vpxi],eax ; casters position in Map Grid - mov [vpyi],ebx - - mov edx,ebx - shl edx,5 - lea edx,[grid+edx+eax] - - cmp [edx],byte 0 ; raycaster reached a wall? (0=no) - jne getout - - cmp edi,10000 ; limit view range - jb raycast -;-------------------------------------- -getout: - mov eax,[edx] ; store Grid Wall Value for Texture Selection - mov [vk],eax - call blur ; deactivate this (blurs the near floor) : a bit faster - -; simply copy floor to ceil pixel column here -; jmp nocopy ; use this for test purposes - pusha - mov eax,screen_buffer+1920*240 - mov ebx,eax ;screen_buffer+1920*240 -;-------------------------------------- -align 4 -copyfloor: - sub eax,1920 - add ebx,1920 - mov ecx,[vx1] - lea ecx,[ecx+ecx*2] - lea edx,[ecx+ebx] - add ecx,eax - mov esi,[edx] - mov [ecx],esi - cmp eax,screen_buffer - jg copyfloor -;@@: - popa -; *** end of copy floor to ceil -;nocopy: -;-------------------------------------- -; draw this pixelrows wall - mov [vl],edi - mov edi,260 - sub edi,[vdd] - cmp edi,0 - jg ok3 - - xor edi,edi -;-------------------------------------- -ok3: - mov [vbottom],edi ; end wall ceil (or window top) - mov esi,262 - add esi,[vdd] ; start wall floor - xor edi,edi -; somethin is wrong with xfrac,so recalc... - mov eax,[vxx] - and eax,0x0000FFFF - shr eax,10 - mov [xfrac],eax - - mov eax,[vyy] - and eax,0x0000FFFF - shr eax,10 - mov [yfrac],eax -;-------------------------------------- -pixelrow: -; find each pixels color: - add edi,ICON_SIZE_Y - sub esi,1 - cmp esi,502 ; dont calc offscreen-pixels - jg speedup - - xor edx,edx - mov eax,edi - mov ebx,[vdd] -; add ebx,ebx - shl ebx,1 - div ebx - - shl edx,1 - cmp ebx,edx - jae @f - inc eax -@@: - and eax,ICON_SIZE_Y-1 - mov [ytemp],eax ; get y of texture for wall - - mov eax,[xfrac] - add eax,[yfrac] - and eax,ICON_SIZE_X-1 - mov [xtemp],eax ; get x of texture for wall -; now prepare to plot that wall-pixel... - mov [remedi],edi - mov edi,[ytemp] - sal edi,9 ;8 - for 64x64 - mov edx,[xtemp] - sal edx,3 ;2 - for 64x64 - add edi,edx - mov eax,[vk] ; determine which texture should be used - and eax,255 - - cmp eax,1 - jne checkmore1 - - add edi,[wall0] ;ceil - jmp foundtex -;--------------------------------------------------------------------- -align 4 -checkmore1: - cmp eax,2 - jne checkmore2 - - add edi,[wall1] - jmp foundtex -;--------------------------------------------------------------------- -align 4 -checkmore2: - cmp eax,3 - jne checkmore3 - - add edi,[wall2] - jmp foundtex -;--------------------------------------------------------------------- -align 4 -checkmore3: - cmp eax,4 - jne checkmore4 - - add edi,[wall3] - jmp foundtex -;--------------------------------------------------------------------- -align 4 -checkmore4: - cmp eax,5 - jne checkmore5 - - add edi,[wall4] - jmp foundtex -;--------------------------------------------------------------------- -align 4 -checkmore5: - cmp eax,6 - jne checkmore6 - - add edi,[wall5] - jmp foundtex -;--------------------------------------------------------------------- -align 4 -checkmore6: - cmp eax,7 - jne checkmore7 - - add edi,[wall6] - jmp foundtex -;--------------------------------------------------------------------- -align 4 -checkmore7: - cmp eax,8 - jne checkmore8 - - add edi,[wall7] - jmp foundtex -;--------------------------------------------------------------------- -align 4 -checkmore8: -foundtex: - mov edx,[edi] ; get pixel color inside texture -; ***pseudoshade south-west -; jmp east ; activate this for southwest pseudoshade : a bit slower + blink-bug -;--------------------------------------------------------------------- -; mov edi,[yfrac] -; mov [pseudo],dword 0 ; store flag for custom distance darkening -; cmp edi,[xfrac] -; jge east - -; and edx,0x00FEFEFE -; shr edx,1 -; mov [pseudo],dword 1 -;-------------------------------------- -east: - call dark_distance ; deactivate wall distance darkening: a bit faster -; ******* DRAW WALL PIXEL ******* - mov eax,esi - lea eax,[esi-22] - imul eax,1920 - mov ebx,[vx1] - lea ebx,[ebx+ebx*2] - lea eax,[eax+screen_buffer+ebx] - - cmp eax,screen_buffer+1920*480 - ja dont_draw - - cmp eax,screen_buffer - jb dont_draw - - mov [eax],edx ; actually set the pixel in the image -;-------------------------------------- -; *** eo draw wall pixel -dont_draw: - mov edi,[remedi] -;-------------------------------------- -speedup: - cmp esi,[vbottom] ; end of this column? - jg pixelrow - - mov edi,[vl] ; restoring - mov eax,[vx1] ; inc X1 - add eax,1 - mov [vx1],eax -;*** NEXT A *** - mov esi,[va] - sub esi,1 - mov [va],esi - cmp esi,[vacompare] - jg for_a -;*** EO NEXT A *** -;-------------------------------------- -; **** put image !!!!!**** - xor edx,edx - mcall 7,screen_buffer,<640,480> - ret -;--------------------------------------------------------------------- -align 4 -blur: - pusha - mov eax,screen_buffer+360*1920 -;-------------------------------------- -align 4 -copyfloor2: - add eax,1920 - mov ebx,[vx1] - lea ebx,[ebx+ebx*2] - add ebx,eax - - mov ecx,[ebx-15] - and ecx,0x00FEFEFE - shr ecx,1 - - mov edx,[ebx-12] - and edx,0x00FEFEFE - shr edx,1 - add edx,ecx - and edx,0x00FEFEFE - shr edx,1 - - mov ecx,[ebx-9] - and ecx,0x00FEFEFE - shr ecx,1 - add edx,ecx - - and edx,0x00FEFEFE - shr edx,1 - - mov ecx,[ebx-6] - and ecx,0x00FEFEFE - shr ecx,1 - add edx,ecx - - and edx,0x00FEFEFE - shr edx,1 - - mov ecx,[ebx-3] - and ecx,0x00FEFEFE - shr ecx,1 - add edx,ecx - - and edx,0x00FEFEFE - shr edx,1 - - mov ecx,[ebx] - and ecx,0x00FEFEFE - shr ecx,1 - add edx,ecx - - mov [ebx],edx - - cmp eax,screen_buffer+478*1920 - jb copyfloor2 - - popa - ret -;--------------------------------------------------------------------- -; ******* Darken by Distance ******* -align 4 -dark_distance: -; color must be in edx, wall height in [vdd] - mov eax,[vdd] - cmp eax,50 - jg nodark -; split rgb - mov [blue_color],edx - and [blue_color],dword 255 - - shr edx,8 - mov [green_color],edx - and [green_color],dword 255 - - shr edx,8 - mov [red_color],edx - and [red_color],dword 255 - - mov eax,51 ; darkness parameter - sub eax,[vdd] - cmp [pseudo],dword 1 - je isdarkside - - sal eax,2 -;-------------------------------------- -align 4 -isdarkside: -; reduce rgb - sub [red_color],eax - cmp [red_color],dword 0 - jg notblack10b - - mov [red_color],dword 0 -;-------------------------------------- -align 4 -notblack10b: - sub [green_color],eax - cmp [green_color],dword 0 - jg notblack20b - - mov [green_color],dword 0 -;-------------------------------------- -align 4 -notblack20b: - mov edx,[blue_color] - sub [blue_color],eax - cmp [blue_color],dword 0 - jg notblack30b - - mov [blue_color],dword 0 -;-------------------------------------- -align 4 -notblack30b: - shl dword [red_color],16 ; reassemble rgb - shl dword [green_color],8 - mov edx,[red_color] - or edx,[green_color] - or edx,[blue_color] - mov eax,edx -;-------------------------------------- -align 4 -nodark: - ret -;--------------------------------------------------------------------- -load_icons: - mov ebx,icons_file_name - mov esi,path - mov edi,file_name - call copy_file_path - - mov [fileinfo.subfunction],dword 5 - mov [fileinfo.size],dword 0 - mov [fileinfo.return],dword file_info - mcall 70,fileinfo - test eax,eax - jnz .error - - mov [fileinfo.subfunction],dword 0 - - mov ecx,[file_info+32] - mov [fileinfo.size],ecx - mov [img_size],ecx - - mcall 68,12 - test eax,eax - jz finish ;memory_get_error - - mov [fileinfo.return],eax - mov [image_file],eax - - mcall 70,fileinfo - test eax,eax - jnz .error - ret -.error: -; mov [N_error],2 -; mov [error_type],eax - jmp finish -;--------------------------------------------------------------------- -copy_file_path: - xor eax,eax - cld -@@: - lodsb - stosb - test eax,eax - jnz @b - mov esi,edi - dec esi - std -@@: - lodsb - cmp al,'/' - jnz @b - mov edi,esi - add edi,2 - mov esi,ebx - cld -@@: - lodsb - stosb - test eax,eax - jnz @b - ret -;--------------------------------------------------------------------- -convert_icons: - xor eax,eax - mov [return_code],eax - push image_file - call [cnv_png_import.Start] - - mov ecx,[image_file] - mcall 68,13, - test eax,eax - jz finish ;memory_free_error - - cmp [return_code],dword 0 -; je @f -; mov [N_error],6 -; jmp button.exit -;@@: - jne finish - - mcall 68,20,ICON_SIZE_X*ICON_SIZE_Y*4*8+44,[raw_pointer] - mov [raw_pointer],eax - - mov ebx,[raw_pointer] -; set RAW area for icon - mov eax,[ebx+28] - add eax,ebx - mov edi,eax - mov esi,eax - add esi,ICON_SIZE_X*ICON_SIZE_Y*8*3-1 - add edi,ICON_SIZE_X*ICON_SIZE_Y*8*4-4 - -; add eax,TEX_SIZE - mov [wall0],eax - add eax,TEX_SIZE - mov [wall1],eax - add eax,TEX_SIZE - mov [wall2],eax - add eax,TEX_SIZE - mov [wall3],eax - add eax,TEX_SIZE - mov [wall4],eax - add eax,TEX_SIZE - mov [wall5],eax - add eax,TEX_SIZE - mov [wall6],eax - add eax,TEX_SIZE - mov [wall7],eax - add eax,TEX_SIZE -; conversion 24b to 32 b - mov ecx,ICON_SIZE_X*ICON_SIZE_Y*8 - std -@@: - xor eax,eax - lodsb - rol eax,8 - lodsb - rol eax,8 - lodsb -; ror eax,16 - stosd - dec ecx - jnz @b - cld - ret -;--------------------------------------------------------------------- -; DATA AREA -;ceil=ceil -;wall=wall floor -;2 corner stone -;3 leaf mosaic -;4 closed window -;5 greek mosaic -;6 old street stones -;7 maya wall -;--------------------------------------------------------------------- -align 4 -grid: ; 32*32 Blocks, Map: 0 = Air, 1 to 8 = Wall -db 2,1,2,1,2,1,2,1,2,1,2,1,1,1,1,1,1,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8 -db 1,0,0,0,1,0,0,0,0,0,0,3,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,8,8 -db 5,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8 -db 1,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,1,0,0,0,0,3,3,3,3,0,0,0,0,0,0,8 -db 5,0,1,2,3,4,5,6,7,8,2,1,3,3,3,0,5,0,2,1,2,3,0,0,0,0,0,0,0,0,0,8 -db 1,0,0,0,0,0,0,0,0,0,2,3,0,0,0,0,5,0,0,0,0,3,0,0,0,0,0,0,0,0,0,8 -db 5,0,0,0,1,0,0,4,0,0,0,1,0,0,0,0,5,0,0,0,0,3,3,0,3,3,0,0,0,0,0,8 -db 1,1,0,1,1,1,1,4,1,0,1,3,0,0,0,0,5,2,1,2,0,3,0,0,0,3,0,0,0,0,0,8 -db 5,0,0,0,1,0,0,0,0,0,0,1,0,3,3,3,5,0,0,0,0,3,0,0,0,3,0,0,0,0,0,8 -db 1,0,0,0,1,0,0,5,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,3,0,0,0,0,0,8 -db 5,0,0,0,0,0,0,5,0,0,0,1,0,0,0,0,5,0,0,0,0,3,0,0,0,0,0,0,0,0,0,8 -db 1,4,4,4,4,4,4,4,4,4,4,3,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,8,8 -db 2,2,2,2,2,2,8,8,8,8,8,8,8,8,8,0,0,0,6,6,0,7,7,7,7,7,7,7,7,7,8,8 -db 1,0,0,0,1,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,1 -db 5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,0,2,2,2,2,0,0,0,0,3,3,3,3,3,1 -db 1,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,6,0,0,0,0,2,0,0,0,0,3,0,0,0,0,1 -db 5,0,2,3,2,3,2,3,2,3,2,1,0,0,0,0,6,0,2,2,0,2,0,0,0,0,3,0,5,5,0,1 -db 1,0,0,0,0,0,0,4,0,0,0,3,0,0,0,0,6,0,0,2,0,2,0,2,0,0,3,0,0,0,0,1 -db 5,0,0,0,1,0,0,4,0,0,0,1,0,0,0,0,6,0,0,2,2,2,0,2,0,0,3,3,3,3,0,1 -db 1,1,0,1,1,1,1,4,1,0,1,3,7,7,7,0,6,0,0,0,0,0,0,2,0,0,0,0,0,3,0,1 -db 5,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,6,0,0,0,0,2,2,2,0,0,0,0,0,3,0,1 -db 1,0,0,0,1,0,0,5,0,0,0,3,0,0,0,0,6,0,0,0,0,2,0,0,0,0,0,0,0,0,0,1 -db 5,0,0,0,0,0,0,5,0,0,0,1,0,0,0,0,6,0,5,1,0,2,0,0,4,4,0,4,4,0,0,1 -db 1,4,1,4,1,4,1,4,1,4,1,3,0,0,0,0,6,0,0,5,0,2,0,0,0,4,0,4,0,0,0,1 -db 1,0,0,0,0,0,0,4,0,0,0,3,0,3,3,3,6,0,0,1,0,1,0,0,4,4,0,4,4,0,0,1 -db 5,0,0,0,1,0,0,4,0,0,0,1,0,0,0,0,6,0,0,5,0,1,0,4,4,0,0,0,4,4,0,1 -db 1,1,0,1,1,1,1,4,1,0,1,3,0,0,0,0,6,0,0,1,0,1,0,4,0,0,0,0,0,4,0,1 -db 5,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,6,0,0,5,0,1,0,4,0,0,0,0,0,4,0,1 -db 1,0,0,0,1,0,0,5,0,0,0,3,0,0,0,0,6,1,5,1,0,1,0,4,4,0,0,0,4,4,0,1 -db 5,0,0,0,0,0,0,5,0,0,0,0,0,0,1,1,0,0,0,0,0,1,0,0,4,4,4,4,4,0,0,1 -db 1,4,1,4,1,4,1,4,1,4,1,3,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1 -db 2,1,2,1,2,1,2,1,2,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 -;--------------------------------------------------------------------- -vpx: - dd 0x0001FFFF ; initial player position * 0xFFFF -vpy: - dd 0x0001FFFF - -title db 'Free3D v0.6 - fisheye raycasting engine etc.',0 - -sindegree dd 0.0 -sininc dd 0.0017453292519943295769236907684886 -sindiv dd 6553.5 -;textures: -;file 'texture.gif' -current_key_code db 0 -old_key_code db 0 -extended_key db 0 -;--------------------------------------------------------------------- -align 4 -fileinfo: -.subfunction dd 5 -.Offset dd 0 -.Offset_1 dd 0 -.size dd 0 -.return dd file_info - db 0 -.name: dd file_name -;--------------------------------------------------------------------- -icons_file_name db 'texture_24b.png',0 -;--------------------------------------------------------------------- -plugins_directory db 0 - -;system_dir_Boxlib db '/sys/lib/box_lib.obj',0 -system_dir_CnvPNG db '/sys/lib/cnv_png.obj',0 -;system_dir_Sort db '/sys/lib/sort.obj',0 -system_dir_UNPACK db '/sys/lib/archiver.obj',0 - -align 4 -l_libs_start: -library01 l_libs system_dir_CnvPNG+9,file_name,system_dir_CnvPNG,\ -cnv_png_import,plugins_directory - -library02 l_libs system_dir_UNPACK+9,file_name,system_dir_UNPACK,\ -UNPACK_import,plugins_directory - -end_l_libs: -;--------------------------------------------------------------------- -align 4 -cnv_png_import: -.Start dd aCP_Start -.Version dd aCP_Version -.Check dd aCP_Check -.Assoc dd aCP_Assoc - dd 0 - dd 0 -aCP_Start db 'START',0 -aCP_Version db 'version',0 -aCP_Check db 'Check_Header',0 -aCP_Assoc db 'Associations',0 -;--------------------------------------------------------------------- -align 4 -UNPACK_import: -;unpack_Version dd aUnpack_Version -;unpack_PluginLoad dd aUnpack_PluginLoad -;unpack_OpenFilePlugin dd aUnpack_OpenFilePlugin -;unpack_ClosePlugin dd aUnpack_ClosePlugin -;unpack_ReadFolder dd aUnpack_ReadFolder -;unpack_SetFolder dd aUnpack_SetFolder -;unpack_GetFiles dd aUnpack_GetFiles -;unpack_GetOpenPluginInfo dd aUnpack_GetOpenPluginInfo -;unpack_Getattr dd aUnpack_Getattr -;unpack_Open dd aUnpack_Open -;unpack_Read dd aUnpack_Read -;unpack_Setpos dd aUnpack_Setpos -;unpack_Close dd aUnpack_Close -;unpack_DeflateUnpack dd aUnpack_DeflateUnpack -unpack_DeflateUnpack2 dd aUnpack_DeflateUnpack2 - dd 0 - dd 0 - -;aUnpack_Version db 'version',0 -;aUnpack_PluginLoad db 'plugin_load',0 -;aUnpack_OpenFilePlugin db 'OpenFilePlugin',0 -;aUnpack_ClosePlugin db 'ClosePlugin',0 -;aUnpack_ReadFolder db 'ReadFolder',0 -;aUnpack_SetFolder db 'SetFolder',0 -;aUnpack_GetFiles db 'GetFiles',0 -;aUnpack_GetOpenPluginInfo db 'GetOpenPluginInfo',0 -;aUnpack_Getattr db 'getattr',0 -;aUnpack_Open db 'open',0 -;aUnpack_Read db 'read',0 -;aUnpack_Setpos db 'setpos',0 -;aUnpack_Close db 'close',0 -;aUnpack_DeflateUnpack db 'deflate_unpack',0 -aUnpack_DeflateUnpack2 db 'deflate_unpack2',0 - -;--------------------------------------------------------------------- -IM_END: -;--------------------------------------------------------------------- -; not change this section!!! -; start section -;--------------------------------------------------------------------- -align 4 -image_file rd 1 -raw_pointer rd 1 -return_code rd 1 -img_size rd 1 -deflate_unpack rd 1 -raw_pointer_2 rd 1 ;+20 -;--------------------------------------------------------------------- -; end section -;--------------------------------------------------------------------- -align 4 -;--------------------------------------------------------------------- -wall0 rd 1 -wall1 rd 1 -wall2 rd 1 -wall3 rd 1 -wall4 rd 1 -wall5 rd 1 -wall6 rd 1 -wall7 rd 1 -;screen_buffer rd 1 -active_process rd 1 - -;mouse_position rd 1 -mouse_position_old rd 1 -;--------------------------------------------------------------------- -align 4 -col1: - dd ? ;- -; misc raycaster vars: -vxx: - dd ? ;- -vyy: - dd ? ;- -vl: - dd ? ;- -vstepx: - dd ? ;- -vstepy: - dd ? ;- -vxxint: - dd ? ;- -vyyint: - dd ? ;- -vk: - dd ? ;- -va: - dd ? ;- -va2: - dd ? ;- -vdd: - dd ? ;- -vx1: - dd ? ;- -vx1b: - dd ? ;- -vh: - dd ? ;- -vdt: - dd ? ;- -vheading: ; initial heading: 0 to 3599 - dd ? ;- -vacompare: - dd ? ;- -vpxi: - dd ? ;- -vpyi: - dd ? ;- -wtolong: - dw ?,? ;-,?;- - -xtemp: - dd ? ;- -ytemp: - dd ? ;- -xfrac: - dd ? ;- -yfrac: - dd ? ;- -h_old: - dd ? ;- -vbottom: - dd ? ;- -;mouseya: -; dd ? ;- -remeax: - dd ? ;- -remebx: - dd ? ;- -remecx: - dd ? ;- -remedx: - dd ? ;- -remedi: - dd ? ;- -remesi: - dd ? ;- -red_color: - dd ? ;- -green_color: - dd ? ;- -blue_color: - dd ? ;- -pseudo: - dd ? ;- -step1: - dd ? ;- -;step64: -; dd ? ;- -lasty: - dd ? ;- -;--------------------------------------------------------------------- -;I_END: -IncludeUGlobals -align 4 -sinus rd 360*10 -eosinus: -; rd 16*1024*4 -;--------------------------------------------------------------------- -align 4 - rb 4096 -stacktop: -;--------------------------------------------------------------------- -procinfo: - rb 1024 -;--------------------------------------------------------------------- -path: - rb 4096 -;--------------------------------------------------------------------- -file_name: - rb 4096 -;--------------------------------------------------------------------- -file_info: - rb 40 -;--------------------------------------------------------------------- -screen_buffer: - rb 640*480*3 *3/2 -;--------------------------------------------------------------------- -I_END: -;--------------------------------------------------------------------- \ No newline at end of file +; SPDX-License-Identifier: NOASSERTION +; + +;--------------------------------------------------------------------- +; Free3D version 0.6 +; +; last update: 21/02/2011 +; written by: Marat Zakiyanov aka Mario79, aka Mario +; changes: advanced control for mouse +; advanced control for keyboard: +; W,A,S,D adn Arrow UP,Down,Left,Right +;--------------------------------------------------------------------- +; Free3D version 0.5 +; +; last update: 20/02/2011 +; written by: Marat Zakiyanov aka Mario79, aka Mario +; changes: PNG textures 128x128 +; using libraries cnv_png.obj and archiver.obj +; using dinamically allocation of memory +; +;--------------------------------------------------------------------- +; +; Fisheye Raycasting Engine Etc. FREE3D for MENUETOS by Dieter Marfurt +; Version 0.4 (requires some texture-files to compile (see Data Section)) +; dietermarfurt@angelfire.com - www.melog.ch/mos_pub/ +; Don't hit me - I'm an ASM-Newbie... since years :) +; +; Compile with FASM for Menuet (requires .INC files - see DATA Section) +; +; Willow - greatly srinked code size by using GIF texture and FPU to calculate sine table +; +; !!!! Don't use GIF_LITE.INC in your apps - it's modified for FREE3D !!!! +; +; Heavyiron - new 0-function of drawing window from kolibri (do not work correctly with menuet) + +TEX_SIZE equ 128*128*4 ;64*64*4 ; + +ICON_SIZE_X equ 128 ;64 +ICON_SIZE_Y equ 128 ;64 + +Floors_Height equ 32000 +;--------------------------------------------------------------------- +use32 +org 0x0 + db 'MENUET01' ; 8 byte id + dd 0x01 ; header version + dd START ; start of code + dd IM_END ; size of image + dd I_END ; 0x100000 ; memory for app + dd stacktop ; 0x100000 ; esp + dd 0x0 + dd path +;--------------------------------------------------------------------- +include '../../macros.inc' +;include 'macros.inc' +include '../../KOSfuncs.inc' +include '../../load_lib.mac' +;include 'load_lib.mac' +@use_library +;--------------------------------------------------------------------- +START: ; start of execution + mcall 68,11 + mcall 66,1,1 + mcall 40,0x27 + + mcall 9,procinfo,-1 + mov ecx,[ebx+30] ; PID + mcall 18,21 + mov [active_process],eax ; WINDOW SLOT + +load_libraries l_libs_start,end_l_libs + test eax,eax + jnz finish + +; unpack deflate + mov eax,[unpack_DeflateUnpack2] + mov [deflate_unpack],eax + + call load_icons + call convert_icons + + mov esi,sinus + mov ecx,360*10 + fninit + fld [sindegree] +;-------------------------------------- +.sinlp: + fst st1 + fsin + fmul [sindiv] + fistp dword[esi] + add esi,4 + fadd [sininc] + loop .sinlp +;--------------------------------------------------------------------- + call cursor_to_screen_center + call set_new_cursor_skin +;--------------------------------------------------------------------- +align 4 +red: ; redraw + call draw_window + call draw_stuff +;--------------------------------------------------------------------- +align 4 +still: + mcall 10 ; ask no wait for full speed + + cmp eax,1 ; window redraw request ? + je red + + cmp eax,2 ; key in buffer ? + je key + + cmp eax,3 ; button in buffer ? + je button + + cmp eax,6 + jne still +;--------------------------------------------------------------------- +mouse: + mcall 18,7 + cmp [active_process],eax + jne still + + mcall 37,1 + + xor ebx,ebx + mov bx,ax ; EBX mouse y + shr eax,16 ; EAX mouse x + + mov ecx,[mouse_position_old] + xor edx,edx + mov dx,cx ; EDX mouse y old + shr ecx,16 ; ECX mouse x old + + cmp eax,ecx + je .y ;still + ja .turn_left +;--------------------------------------------------------------------- +.turn_right: + xchg eax,ecx + sub eax,ecx + mov edi,[vheading] + add edi,eax + jmp @f +;--------------------------------------------------------------------- +.turn_left: + sub eax,ecx + mov edi,[vheading] + sub edi,eax +;-------------------------------------- +@@: + call check_range +;--------------------------------------------------------------------- +.y: + cmp ebx,edx + je .red + ja .walk_down +;-------------------------------------- +.walk_up: + sub edx,ebx + mov ecx,edx + call prepare_2 + jz .1 +;-------------------------------------- + add eax,edi ; newPx + add ebx,esi ; newPy + jmp .1 +;--------------------------------------------------------------------- +.walk_down: + sub ebx,edx + mov ecx,ebx + call prepare_2 + jz .1 + + sub eax,edi ; newPx + sub ebx,esi ; newPy +;-------------------------------------- +.1: + mov edi,eax ; newPx / ffff + mov esi,ebx ; newPy / ffff + sar edi,16 + sar esi,16 + mov ecx,esi + sal ecx,5 + lea ecx,[grid+ecx+edi] + cmp [ecx],byte 0 + je @f + + call cursor_to_screen_center + jmp still ;cannotwalk +;--------------------------------------------------------------------- +@@: + mov [vpx],eax + mov [vpy],ebx +;-------------------------------------- +.red: + call cursor_to_screen_center + jmp red +;--------------------------------------------------------------------- +align 4 +prepare_2: + shr ecx,4 + push ecx + call prepare_1 + pop ecx + cmp ecx,3 + jb @f + mov ecx,3 +@@: + shl edi,cl + shl esi,cl + test ecx,ecx + ret +;--------------------------------------------------------------------- +align 4 +check_range: + cmp edi,0 + jge @f + + mov edi,3600 + jmp .store +;-------------------------------------- +@@: + cmp edi,3600 + jle @f + + xor edi,edi +;-------------------------------------- +@@: +.store: + mov [vheading],edi + ret +;--------------------------------------------------------------------- +align 4 +cursor_to_screen_center: + mcall 18,15 + mcall 37,1 + mov [mouse_position_old],eax + ret +;--------------------------------------------------------------------- +set_new_cursor_skin: + mcall 68,12,32*32*4 + mov ecx,eax + mcall 37,4,,2 + mov ecx,eax + mcall 37,5 + ret +;--------------------------------------------------------------------- +align 4 +key: ; key + mcall 2 + cmp [extended_key],1 + je .extended_key + test al, al + jnz still + + cmp ah, 0xE0 + jne @f + + mov [extended_key],1 + jmp still +;--------------------------------------------------------------------- +@@: + cmp ah,1 ; Esc + je finish + + cmp ah,17 ; W up + je s_up + + cmp ah,31 ; S down + je s_down + + cmp ah,30 ; A left + je w_left ;s_left + + cmp ah,32 ; D right + je w_right ;s_right + + jmp still +;--------------------------------------------------------------------- +.extended_key: + mov [extended_key],0 + mov [current_key_code],ah + + cmp ah,27 ; esc=End App + je finish + + cmp ah,72 ; up arrow + je s_up + + cmp ah,80 ; down arrow + je s_down + + cmp ah,75 ; left arrow + je s_left + + cmp ah,77 ; right arrow + je s_right + + jmp still +;--------------------------------------------------------------------- +align 4 +smart_clr_key_buf: + mov al,[old_key_code] + mov ah,[current_key_code] + mov [old_key_code],ah + cmp al,ah + jne .end +;-------------------------------------- +.still: + mcall 2 + cmp [extended_key],1 + je .extended_key + + test al, al + jnz .end + + cmp ah, 0xE0 + jne .end + + mov [extended_key],1 + jmp .still +.end: + call draw_stuff + jmp still +;--------------------------------------------------------------------- +.extended_key: + mov [extended_key],0 + mov [current_key_code],ah + jmp smart_clr_key_buf +;--------------------------------------------------------------------- +align 4 +w_left: ; walk left + call prepare_1 + add eax,esi ; newPx + sub ebx,edi ; newPy + jmp s_down.1 +;--------------------------------------------------------------------- +align 4 +w_right: ; walk right + call prepare_1 + sub eax,esi ; newPx + add ebx,edi ; newPy + jmp s_down.1 +;--------------------------------------------------------------------- +align 4 +s_up: ; walk forward (key or mouse) + call prepare_1 +; sal esi,1 ; edit walking speed here +; sal edi,1 + add eax,edi ; newPx + add ebx,esi ; newPy + jmp s_down.1 +;--------------------------------------------------------------------- +align 4 +s_down: ; walk backward + call prepare_1 +; sal esi,1 ; edit walking speed here +; sal edi,1 + sub eax,edi ; newPx + sub ebx,esi ; newPy +.1: + mov edi,eax ; newPx / ffff + mov esi,ebx ; newPy / ffff + sar edi,16 + sar esi,16 + mov ecx,esi + sal ecx,5 + lea ecx,[grid+ecx+edi] + cmp [ecx],byte 0 + jne smart_clr_key_buf ;cannotwalk + + mov [vpx],eax + mov [vpy],ebx + jmp smart_clr_key_buf +;--------------------------------------------------------------------- +align 4 +prepare_1: + mov eax,[vpx] + mov ebx,[vpy] + mov ecx,[vheading] + mov edx,ecx + mov edi,[sinus+ecx*4] + lea edx,[sinus+3600+edx*4] + cmp edx,eosinus ; cosinus taken from (sinus plus 900) mod 3600 + jb @f + + sub edx,14400 +;-------------------------------------- +@@: + mov esi,[edx] + ret +;--------------------------------------------------------------------- +align 4 +s_left: ; turn left (key) + mov edi,[vheading] + add edi,50 + jmp s_right.1 +;--------------------------------------------------------------------- +align 4 +s_right: ; turn right + mov edi,[vheading] + sub edi,50 +.1: + call check_range + jmp smart_clr_key_buf +;--------------------------------------------------------------------- +align 4 +button: ; button + mcall 17 + cmp ah,1 ; button id=1 ? + jne still ;gamestart +;-------------------------------------- +finish: + mcall -1 ; close this program +;--------------------------------------------------------------------- +; ********************************************* +; ******* WINDOW DEFINITIONS AND DRAW ******** +; ********************************************* +align 4 +draw_window: + mcall 12,1 + + mcall 0,<50,649>,<50,484>,0x01000000,0x01000000,0x01000000 + + mcall 12,2 + ret +;--------------------------------------------------------------------- +; ********************************************* +; ******* COMPUTE 3D-VIEW ******** +; ********************************************* +align 4 +draw_stuff: + mov [step1],dword 1 +; mov [step64],dword 64 + mov esi,[vheading] + add esi,320 + mov [va],esi + mov eax,[vheading] + sub eax,320 + mov [vacompare],eax +;------------------------------------ CAST 640 PIXEL COLUMNS --------------- +; FOR A=320+heading to -319+heading step -1 (a is stored in [va]) +;--------------------------------------------------------------------------- +; mov edx,5 + mov [vx1],dword 0 ;5 ;edx ; init x1 ... pixelcolumn +;-------------------------------------- +align 4 +for_a: + mov edx,[vx1] + mov [vx1b],edx + sub [vx1b],dword 320 + mov edx,[va] ; a2 + cmp edx,-1 ; a2 is a mod 3600 + jg ok1 + + add edx,3600 +;-------------------------------------- +ok1: + cmp edx,3600 + jb ok2 + + sub edx,3600 +;-------------------------------------- +ok2: +; get stepx and stepy + ; pointer to stepx + lea ecx,[sinus+edx*4] + mov esi,[ecx] + sar esi,4 ; accuracy + mov [vstepx],esi ; store stepx + lea esi,[sinus+3600+edx*4] + cmp esi,eosinus ;cosinus taken from ((sinus plus 900) mod 3600) + jb ok202 + + sub esi,14400 +;-------------------------------------- +ok202: + mov ecx,[esi] + sar ecx,4 + mov [vstepy],ecx ; store stepy + + mov eax,[vpx] ; get Camera Position + mov ebx,[vpy] + mov [vxx],eax ; init caster position + mov [vyy],ebx + + mov edi,0 ; init L (number of raycsting-steps) + mov [step1],dword 1 ; init Caster stepwidth for L. +;-------------------------------------- +; raycast a pixel column +align 4 +raycast: + add edi,[step1] ; count caster steps + jmp nodouble ; use this to prevent blinking/wobbling textures: much slower! + +; cmp edi,32 +; je double + +; cmp edi,512 +; je double + +; cmp edi,1024 +; je double + +; jmp nodouble +;--------------------------------------------------------------------- +;double: +; mov edx,[step1] +; sal edx,1 +; mov [step1],edx + +; mov edx,[vstepx] +; sal edx,1 +; mov [vstepx],edx + +; mov edx,[vstepy] +; sal edx,1 +; mov [vstepy],edx +;-------------------------------------- +nodouble: + mov eax,Floors_Height ;32000 ; 3600 ; determine Floors Height based on distance + xor edx,edx + mov ebx,edi + + div ebx + + shl edx,1 + cmp ebx,edx + jae @f + inc eax +@@: + + mov esi,eax + mov [vdd],esi + mov edx,260 + sub edx,esi + mov [vh],edx + + cmp edx,22 + jb no_nu_pixel + + cmp edx,259 + jg no_nu_pixel ; draw only new pixels + + cmp edx,[h_old] + je no_nu_pixel + + mov eax,[vxx] ; calc floor pixel + mov ebx,[vyy] + + and eax,0x0000FFFF + and ebx,0x0000FFFF + + shr eax,10 + shr ebx,10 ; pixel coords inside Texture x,y 64*64 + mov [xfrac],eax + mov [yfrac],ebx +; plot floor pixel !!!! + mov [vl],edi ; save L + mov [ytemp],esi ; remember L bzw. H + + mov edi,[yfrac] ; get pixel color of this floor pixel + sal edi,9 ;8 - for 64x64 + mov esi,[xfrac] + sal esi,3 ;2 - for 64x64 +; in fact its floor, just using the wall texture :) +; lea edi,[wall+edi+esi] + add edi,[wall1] + add edi,esi + mov edx,[edi] + mov [remesi],esi +;**** calculate pixel adress:**** + mov esi,[ytemp] + add esi,240 + imul esi,1920 + mov eax,[vx1] + lea eax,[eax+eax*2] + lea esi,[screen_buffer+eax+esi] + + cmp esi,screen_buffer+1920*480 + jg foff0 + + cmp esi,screen_buffer + jb foff0 +; now we have the adress of the floor-pixel color in edi +; and the adress of the pixel in the image in esi + mov edx,[edi] +;******************** custom distance DARKEN Floor + mov eax,[vdd] +; jmp nodark0 ; use this to deactivate darkening floor (a bit faster) + + cmp eax,80 + jg nodark0 +; split rgb + mov [blue_color],edx + and [blue_color],dword 255 + + shr edx,8 + mov [green_color],edx + and [green_color],dword 255 + + shr edx,8 + mov [red_color],edx + and [red_color],dword 255 + + mov eax,81 ; darkness parameter + sub eax,[vdd] + sal eax,1 +; reduce rgb + sub [red_color],eax + cmp [red_color],dword 0 + jg notblack10 + + mov [red_color],dword 0 +;-------------------------------------- +notblack10: + sub [green_color],eax + cmp [green_color],dword 0 + jg notblack20 + + mov [green_color],dword 0 +;-------------------------------------- +notblack20: + mov edx,[blue_color] + sub [blue_color],eax + cmp [blue_color],dword 0 + jg notblack30 + + mov [blue_color],dword 0 +;-------------------------------------- +notblack30: + shl dword [red_color],16 ; reassemble rgb + shl dword [green_color],8 + mov edx,[red_color] + or edx,[green_color] + or edx,[blue_color] +;-------------------------------------- +nodark0: +; eo custom darken floor + mov eax,edx + +; cmp esi,screen_buffer+1920*480 +; ja foff0 + +; cmp esi,screen_buffer +; jb foff0 + + mov [esi],eax ; actually draw the floor pixel +; paint "forgotten" pixels + mov edx,[lasty] + sub edx,1920 + cmp esi,edx + je foff0 + + mov [esi+1920],eax + sub edx,1920 + cmp esi,edx + je foff0 + + mov [edx+1920],eax + sub edx,1920 + cmp esi,edx + je foff0 + + mov [edx+1920],eax +;-------------------------------------- +align 4 +foff0: + mov [lasty],esi +;**** end of draw floor pixel **** + mov esi,[remesi] + mov edi,[vl] ; restore L +;-------------------------------------- +no_nu_pixel: + mov esi,[vh] + mov [h_old],esi + + mov eax,[vxx] + mov ebx,[vyy] + + add eax,[vstepx] ; casting... + add ebx,[vstepy] + + mov [vxx],eax + mov [vyy],ebx + + sar eax,16 + sar ebx,16 + + mov [vpxi],eax ; casters position in Map Grid + mov [vpyi],ebx + + mov edx,ebx + shl edx,5 + lea edx,[grid+edx+eax] + + cmp [edx],byte 0 ; raycaster reached a wall? (0=no) + jne getout + + cmp edi,10000 ; limit view range + jb raycast +;-------------------------------------- +getout: + mov eax,[edx] ; store Grid Wall Value for Texture Selection + mov [vk],eax + call blur ; deactivate this (blurs the near floor) : a bit faster + +; simply copy floor to ceil pixel column here +; jmp nocopy ; use this for test purposes + pusha + mov eax,screen_buffer+1920*240 + mov ebx,eax ;screen_buffer+1920*240 +;-------------------------------------- +align 4 +copyfloor: + sub eax,1920 + add ebx,1920 + mov ecx,[vx1] + lea ecx,[ecx+ecx*2] + lea edx,[ecx+ebx] + add ecx,eax + mov esi,[edx] + mov [ecx],esi + cmp eax,screen_buffer + jg copyfloor +;@@: + popa +; *** end of copy floor to ceil +;nocopy: +;-------------------------------------- +; draw this pixelrows wall + mov [vl],edi + mov edi,260 + sub edi,[vdd] + cmp edi,0 + jg ok3 + + xor edi,edi +;-------------------------------------- +ok3: + mov [vbottom],edi ; end wall ceil (or window top) + mov esi,262 + add esi,[vdd] ; start wall floor + xor edi,edi +; somethin is wrong with xfrac,so recalc... + mov eax,[vxx] + and eax,0x0000FFFF + shr eax,10 + mov [xfrac],eax + + mov eax,[vyy] + and eax,0x0000FFFF + shr eax,10 + mov [yfrac],eax +;-------------------------------------- +pixelrow: +; find each pixels color: + add edi,ICON_SIZE_Y + sub esi,1 + cmp esi,502 ; dont calc offscreen-pixels + jg speedup + + xor edx,edx + mov eax,edi + mov ebx,[vdd] +; add ebx,ebx + shl ebx,1 + div ebx + + shl edx,1 + cmp ebx,edx + jae @f + inc eax +@@: + and eax,ICON_SIZE_Y-1 + mov [ytemp],eax ; get y of texture for wall + + mov eax,[xfrac] + add eax,[yfrac] + and eax,ICON_SIZE_X-1 + mov [xtemp],eax ; get x of texture for wall +; now prepare to plot that wall-pixel... + mov [remedi],edi + mov edi,[ytemp] + sal edi,9 ;8 - for 64x64 + mov edx,[xtemp] + sal edx,3 ;2 - for 64x64 + add edi,edx + mov eax,[vk] ; determine which texture should be used + and eax,255 + + cmp eax,1 + jne checkmore1 + + add edi,[wall0] ;ceil + jmp foundtex +;--------------------------------------------------------------------- +align 4 +checkmore1: + cmp eax,2 + jne checkmore2 + + add edi,[wall1] + jmp foundtex +;--------------------------------------------------------------------- +align 4 +checkmore2: + cmp eax,3 + jne checkmore3 + + add edi,[wall2] + jmp foundtex +;--------------------------------------------------------------------- +align 4 +checkmore3: + cmp eax,4 + jne checkmore4 + + add edi,[wall3] + jmp foundtex +;--------------------------------------------------------------------- +align 4 +checkmore4: + cmp eax,5 + jne checkmore5 + + add edi,[wall4] + jmp foundtex +;--------------------------------------------------------------------- +align 4 +checkmore5: + cmp eax,6 + jne checkmore6 + + add edi,[wall5] + jmp foundtex +;--------------------------------------------------------------------- +align 4 +checkmore6: + cmp eax,7 + jne checkmore7 + + add edi,[wall6] + jmp foundtex +;--------------------------------------------------------------------- +align 4 +checkmore7: + cmp eax,8 + jne checkmore8 + + add edi,[wall7] + jmp foundtex +;--------------------------------------------------------------------- +align 4 +checkmore8: +foundtex: + mov edx,[edi] ; get pixel color inside texture +; ***pseudoshade south-west +; jmp east ; activate this for southwest pseudoshade : a bit slower + blink-bug +;--------------------------------------------------------------------- +; mov edi,[yfrac] +; mov [pseudo],dword 0 ; store flag for custom distance darkening +; cmp edi,[xfrac] +; jge east + +; and edx,0x00FEFEFE +; shr edx,1 +; mov [pseudo],dword 1 +;-------------------------------------- +east: + call dark_distance ; deactivate wall distance darkening: a bit faster +; ******* DRAW WALL PIXEL ******* + mov eax,esi + lea eax,[esi-22] + imul eax,1920 + mov ebx,[vx1] + lea ebx,[ebx+ebx*2] + lea eax,[eax+screen_buffer+ebx] + + cmp eax,screen_buffer+1920*480 + ja dont_draw + + cmp eax,screen_buffer + jb dont_draw + + mov [eax],edx ; actually set the pixel in the image +;-------------------------------------- +; *** eo draw wall pixel +dont_draw: + mov edi,[remedi] +;-------------------------------------- +speedup: + cmp esi,[vbottom] ; end of this column? + jg pixelrow + + mov edi,[vl] ; restoring + mov eax,[vx1] ; inc X1 + add eax,1 + mov [vx1],eax +;*** NEXT A *** + mov esi,[va] + sub esi,1 + mov [va],esi + cmp esi,[vacompare] + jg for_a +;*** EO NEXT A *** +;-------------------------------------- +; **** put image !!!!!**** + xor edx,edx + mcall 7,screen_buffer,<640,480> + ret +;--------------------------------------------------------------------- +align 4 +blur: + pusha + mov eax,screen_buffer+360*1920 +;-------------------------------------- +align 4 +copyfloor2: + add eax,1920 + mov ebx,[vx1] + lea ebx,[ebx+ebx*2] + add ebx,eax + + mov ecx,[ebx-15] + and ecx,0x00FEFEFE + shr ecx,1 + + mov edx,[ebx-12] + and edx,0x00FEFEFE + shr edx,1 + add edx,ecx + and edx,0x00FEFEFE + shr edx,1 + + mov ecx,[ebx-9] + and ecx,0x00FEFEFE + shr ecx,1 + add edx,ecx + + and edx,0x00FEFEFE + shr edx,1 + + mov ecx,[ebx-6] + and ecx,0x00FEFEFE + shr ecx,1 + add edx,ecx + + and edx,0x00FEFEFE + shr edx,1 + + mov ecx,[ebx-3] + and ecx,0x00FEFEFE + shr ecx,1 + add edx,ecx + + and edx,0x00FEFEFE + shr edx,1 + + mov ecx,[ebx] + and ecx,0x00FEFEFE + shr ecx,1 + add edx,ecx + + mov [ebx],edx + + cmp eax,screen_buffer+478*1920 + jb copyfloor2 + + popa + ret +;--------------------------------------------------------------------- +; ******* Darken by Distance ******* +align 4 +dark_distance: +; color must be in edx, wall height in [vdd] + mov eax,[vdd] + cmp eax,50 + jg nodark +; split rgb + mov [blue_color],edx + and [blue_color],dword 255 + + shr edx,8 + mov [green_color],edx + and [green_color],dword 255 + + shr edx,8 + mov [red_color],edx + and [red_color],dword 255 + + mov eax,51 ; darkness parameter + sub eax,[vdd] + cmp [pseudo],dword 1 + je isdarkside + + sal eax,2 +;-------------------------------------- +align 4 +isdarkside: +; reduce rgb + sub [red_color],eax + cmp [red_color],dword 0 + jg notblack10b + + mov [red_color],dword 0 +;-------------------------------------- +align 4 +notblack10b: + sub [green_color],eax + cmp [green_color],dword 0 + jg notblack20b + + mov [green_color],dword 0 +;-------------------------------------- +align 4 +notblack20b: + mov edx,[blue_color] + sub [blue_color],eax + cmp [blue_color],dword 0 + jg notblack30b + + mov [blue_color],dword 0 +;-------------------------------------- +align 4 +notblack30b: + shl dword [red_color],16 ; reassemble rgb + shl dword [green_color],8 + mov edx,[red_color] + or edx,[green_color] + or edx,[blue_color] + mov eax,edx +;-------------------------------------- +align 4 +nodark: + ret +;--------------------------------------------------------------------- +load_icons: + mov ebx,icons_file_name + mov esi,path + mov edi,file_name + call copy_file_path + + mov [fileinfo.subfunction],dword 5 + mov [fileinfo.size],dword 0 + mov [fileinfo.return],dword file_info + mcall 70,fileinfo + test eax,eax + jnz .error + + mov [fileinfo.subfunction],dword 0 + + mov ecx,[file_info+32] + mov [fileinfo.size],ecx + mov [img_size],ecx + + mcall 68,12 + test eax,eax + jz finish ;memory_get_error + + mov [fileinfo.return],eax + mov [image_file],eax + + mcall 70,fileinfo + test eax,eax + jnz .error + ret +.error: +; mov [N_error],2 +; mov [error_type],eax + jmp finish +;--------------------------------------------------------------------- +copy_file_path: + xor eax,eax + cld +@@: + lodsb + stosb + test eax,eax + jnz @b + mov esi,edi + dec esi + std +@@: + lodsb + cmp al,'/' + jnz @b + mov edi,esi + add edi,2 + mov esi,ebx + cld +@@: + lodsb + stosb + test eax,eax + jnz @b + ret +;--------------------------------------------------------------------- +convert_icons: + xor eax,eax + mov [return_code],eax + push image_file + call [cnv_png_import.Start] + + mov ecx,[image_file] + mcall 68,13, + test eax,eax + jz finish ;memory_free_error + + cmp [return_code],dword 0 +; je @f +; mov [N_error],6 +; jmp button.exit +;@@: + jne finish + + mcall 68,20,ICON_SIZE_X*ICON_SIZE_Y*4*8+44,[raw_pointer] + mov [raw_pointer],eax + + mov ebx,[raw_pointer] +; set RAW area for icon + mov eax,[ebx+28] + add eax,ebx + mov edi,eax + mov esi,eax + add esi,ICON_SIZE_X*ICON_SIZE_Y*8*3-1 + add edi,ICON_SIZE_X*ICON_SIZE_Y*8*4-4 + +; add eax,TEX_SIZE + mov [wall0],eax + add eax,TEX_SIZE + mov [wall1],eax + add eax,TEX_SIZE + mov [wall2],eax + add eax,TEX_SIZE + mov [wall3],eax + add eax,TEX_SIZE + mov [wall4],eax + add eax,TEX_SIZE + mov [wall5],eax + add eax,TEX_SIZE + mov [wall6],eax + add eax,TEX_SIZE + mov [wall7],eax + add eax,TEX_SIZE +; conversion 24b to 32 b + mov ecx,ICON_SIZE_X*ICON_SIZE_Y*8 + std +@@: + xor eax,eax + lodsb + rol eax,8 + lodsb + rol eax,8 + lodsb +; ror eax,16 + stosd + dec ecx + jnz @b + cld + ret +;--------------------------------------------------------------------- +; DATA AREA +;ceil=ceil +;wall=wall floor +;2 corner stone +;3 leaf mosaic +;4 closed window +;5 greek mosaic +;6 old street stones +;7 maya wall +;--------------------------------------------------------------------- +align 4 +grid: ; 32*32 Blocks, Map: 0 = Air, 1 to 8 = Wall +db 2,1,2,1,2,1,2,1,2,1,2,1,1,1,1,1,1,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8 +db 1,0,0,0,1,0,0,0,0,0,0,3,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,8,8 +db 5,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8 +db 1,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,1,0,0,0,0,3,3,3,3,0,0,0,0,0,0,8 +db 5,0,1,2,3,4,5,6,7,8,2,1,3,3,3,0,5,0,2,1,2,3,0,0,0,0,0,0,0,0,0,8 +db 1,0,0,0,0,0,0,0,0,0,2,3,0,0,0,0,5,0,0,0,0,3,0,0,0,0,0,0,0,0,0,8 +db 5,0,0,0,1,0,0,4,0,0,0,1,0,0,0,0,5,0,0,0,0,3,3,0,3,3,0,0,0,0,0,8 +db 1,1,0,1,1,1,1,4,1,0,1,3,0,0,0,0,5,2,1,2,0,3,0,0,0,3,0,0,0,0,0,8 +db 5,0,0,0,1,0,0,0,0,0,0,1,0,3,3,3,5,0,0,0,0,3,0,0,0,3,0,0,0,0,0,8 +db 1,0,0,0,1,0,0,5,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,3,0,0,0,0,0,8 +db 5,0,0,0,0,0,0,5,0,0,0,1,0,0,0,0,5,0,0,0,0,3,0,0,0,0,0,0,0,0,0,8 +db 1,4,4,4,4,4,4,4,4,4,4,3,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,8,8 +db 2,2,2,2,2,2,8,8,8,8,8,8,8,8,8,0,0,0,6,6,0,7,7,7,7,7,7,7,7,7,8,8 +db 1,0,0,0,1,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,1 +db 5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,0,2,2,2,2,0,0,0,0,3,3,3,3,3,1 +db 1,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,6,0,0,0,0,2,0,0,0,0,3,0,0,0,0,1 +db 5,0,2,3,2,3,2,3,2,3,2,1,0,0,0,0,6,0,2,2,0,2,0,0,0,0,3,0,5,5,0,1 +db 1,0,0,0,0,0,0,4,0,0,0,3,0,0,0,0,6,0,0,2,0,2,0,2,0,0,3,0,0,0,0,1 +db 5,0,0,0,1,0,0,4,0,0,0,1,0,0,0,0,6,0,0,2,2,2,0,2,0,0,3,3,3,3,0,1 +db 1,1,0,1,1,1,1,4,1,0,1,3,7,7,7,0,6,0,0,0,0,0,0,2,0,0,0,0,0,3,0,1 +db 5,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,6,0,0,0,0,2,2,2,0,0,0,0,0,3,0,1 +db 1,0,0,0,1,0,0,5,0,0,0,3,0,0,0,0,6,0,0,0,0,2,0,0,0,0,0,0,0,0,0,1 +db 5,0,0,0,0,0,0,5,0,0,0,1,0,0,0,0,6,0,5,1,0,2,0,0,4,4,0,4,4,0,0,1 +db 1,4,1,4,1,4,1,4,1,4,1,3,0,0,0,0,6,0,0,5,0,2,0,0,0,4,0,4,0,0,0,1 +db 1,0,0,0,0,0,0,4,0,0,0,3,0,3,3,3,6,0,0,1,0,1,0,0,4,4,0,4,4,0,0,1 +db 5,0,0,0,1,0,0,4,0,0,0,1,0,0,0,0,6,0,0,5,0,1,0,4,4,0,0,0,4,4,0,1 +db 1,1,0,1,1,1,1,4,1,0,1,3,0,0,0,0,6,0,0,1,0,1,0,4,0,0,0,0,0,4,0,1 +db 5,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,6,0,0,5,0,1,0,4,0,0,0,0,0,4,0,1 +db 1,0,0,0,1,0,0,5,0,0,0,3,0,0,0,0,6,1,5,1,0,1,0,4,4,0,0,0,4,4,0,1 +db 5,0,0,0,0,0,0,5,0,0,0,0,0,0,1,1,0,0,0,0,0,1,0,0,4,4,4,4,4,0,0,1 +db 1,4,1,4,1,4,1,4,1,4,1,3,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1 +db 2,1,2,1,2,1,2,1,2,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 +;--------------------------------------------------------------------- +vpx: + dd 0x0001FFFF ; initial player position * 0xFFFF +vpy: + dd 0x0001FFFF + +title db 'Free3D v0.6 - fisheye raycasting engine etc.',0 + +sindegree dd 0.0 +sininc dd 0.0017453292519943295769236907684886 +sindiv dd 6553.5 +;textures: +;file 'texture.gif' +current_key_code db 0 +old_key_code db 0 +extended_key db 0 +;--------------------------------------------------------------------- +align 4 +fileinfo: +.subfunction dd 5 +.Offset dd 0 +.Offset_1 dd 0 +.size dd 0 +.return dd file_info + db 0 +.name: dd file_name +;--------------------------------------------------------------------- +icons_file_name db 'texture_24b.png',0 +;--------------------------------------------------------------------- +plugins_directory db 0 + +;system_dir_Boxlib db '/sys/lib/box_lib.obj',0 +system_dir_CnvPNG db '/sys/lib/cnv_png.obj',0 +;system_dir_Sort db '/sys/lib/sort.obj',0 +system_dir_UNPACK db '/sys/lib/archiver.obj',0 + +align 4 +l_libs_start: +library01 l_libs system_dir_CnvPNG+9,file_name,system_dir_CnvPNG,\ +cnv_png_import,plugins_directory + +library02 l_libs system_dir_UNPACK+9,file_name,system_dir_UNPACK,\ +UNPACK_import,plugins_directory + +end_l_libs: +;--------------------------------------------------------------------- +align 4 +cnv_png_import: +.Start dd aCP_Start +.Version dd aCP_Version +.Check dd aCP_Check +.Assoc dd aCP_Assoc + dd 0 + dd 0 +aCP_Start db 'START',0 +aCP_Version db 'version',0 +aCP_Check db 'Check_Header',0 +aCP_Assoc db 'Associations',0 +;--------------------------------------------------------------------- +align 4 +UNPACK_import: +;unpack_Version dd aUnpack_Version +;unpack_PluginLoad dd aUnpack_PluginLoad +;unpack_OpenFilePlugin dd aUnpack_OpenFilePlugin +;unpack_ClosePlugin dd aUnpack_ClosePlugin +;unpack_ReadFolder dd aUnpack_ReadFolder +;unpack_SetFolder dd aUnpack_SetFolder +;unpack_GetFiles dd aUnpack_GetFiles +;unpack_GetOpenPluginInfo dd aUnpack_GetOpenPluginInfo +;unpack_Getattr dd aUnpack_Getattr +;unpack_Open dd aUnpack_Open +;unpack_Read dd aUnpack_Read +;unpack_Setpos dd aUnpack_Setpos +;unpack_Close dd aUnpack_Close +;unpack_DeflateUnpack dd aUnpack_DeflateUnpack +unpack_DeflateUnpack2 dd aUnpack_DeflateUnpack2 + dd 0 + dd 0 + +;aUnpack_Version db 'version',0 +;aUnpack_PluginLoad db 'plugin_load',0 +;aUnpack_OpenFilePlugin db 'OpenFilePlugin',0 +;aUnpack_ClosePlugin db 'ClosePlugin',0 +;aUnpack_ReadFolder db 'ReadFolder',0 +;aUnpack_SetFolder db 'SetFolder',0 +;aUnpack_GetFiles db 'GetFiles',0 +;aUnpack_GetOpenPluginInfo db 'GetOpenPluginInfo',0 +;aUnpack_Getattr db 'getattr',0 +;aUnpack_Open db 'open',0 +;aUnpack_Read db 'read',0 +;aUnpack_Setpos db 'setpos',0 +;aUnpack_Close db 'close',0 +;aUnpack_DeflateUnpack db 'deflate_unpack',0 +aUnpack_DeflateUnpack2 db 'deflate_unpack2',0 + +;--------------------------------------------------------------------- +IM_END: +;--------------------------------------------------------------------- +; not change this section!!! +; start section +;--------------------------------------------------------------------- +align 4 +image_file rd 1 +raw_pointer rd 1 +return_code rd 1 +img_size rd 1 +deflate_unpack rd 1 +raw_pointer_2 rd 1 ;+20 +;--------------------------------------------------------------------- +; end section +;--------------------------------------------------------------------- +align 4 +;--------------------------------------------------------------------- +wall0 rd 1 +wall1 rd 1 +wall2 rd 1 +wall3 rd 1 +wall4 rd 1 +wall5 rd 1 +wall6 rd 1 +wall7 rd 1 +;screen_buffer rd 1 +active_process rd 1 + +;mouse_position rd 1 +mouse_position_old rd 1 +;--------------------------------------------------------------------- +align 4 +col1: + dd ? ;- +; misc raycaster vars: +vxx: + dd ? ;- +vyy: + dd ? ;- +vl: + dd ? ;- +vstepx: + dd ? ;- +vstepy: + dd ? ;- +vxxint: + dd ? ;- +vyyint: + dd ? ;- +vk: + dd ? ;- +va: + dd ? ;- +va2: + dd ? ;- +vdd: + dd ? ;- +vx1: + dd ? ;- +vx1b: + dd ? ;- +vh: + dd ? ;- +vdt: + dd ? ;- +vheading: ; initial heading: 0 to 3599 + dd ? ;- +vacompare: + dd ? ;- +vpxi: + dd ? ;- +vpyi: + dd ? ;- +wtolong: + dw ?,? ;-,?;- + +xtemp: + dd ? ;- +ytemp: + dd ? ;- +xfrac: + dd ? ;- +yfrac: + dd ? ;- +h_old: + dd ? ;- +vbottom: + dd ? ;- +;mouseya: +; dd ? ;- +remeax: + dd ? ;- +remebx: + dd ? ;- +remecx: + dd ? ;- +remedx: + dd ? ;- +remedi: + dd ? ;- +remesi: + dd ? ;- +red_color: + dd ? ;- +green_color: + dd ? ;- +blue_color: + dd ? ;- +pseudo: + dd ? ;- +step1: + dd ? ;- +;step64: +; dd ? ;- +lasty: + dd ? ;- +;--------------------------------------------------------------------- +;I_END: +IncludeUGlobals +align 4 +sinus rd 360*10 +eosinus: +; rd 16*1024*4 +;--------------------------------------------------------------------- +align 4 + rb 4096 +stacktop: +;--------------------------------------------------------------------- +procinfo: + rb 1024 +;--------------------------------------------------------------------- +path: + rb 4096 +;--------------------------------------------------------------------- +file_name: + rb 4096 +;--------------------------------------------------------------------- +file_info: + rb 40 +;--------------------------------------------------------------------- +screen_buffer: + rb 640*480*3 *3/2 +;--------------------------------------------------------------------- +I_END: +;--------------------------------------------------------------------- diff --git a/programs/demos/free3d/trunk/texture_24b.png b/programs/demos/free3d/texture_24b.png similarity index 100% rename from programs/demos/free3d/trunk/texture_24b.png rename to programs/demos/free3d/texture_24b.png diff --git a/programs/demos/free3d04/trunk/Tupfile.lua b/programs/demos/free3d04/Tupfile.lua similarity index 79% rename from programs/demos/free3d04/trunk/Tupfile.lua rename to programs/demos/free3d04/Tupfile.lua index 231311ca9..a2612bb16 100644 --- a/programs/demos/free3d04/trunk/Tupfile.lua +++ b/programs/demos/free3d04/Tupfile.lua @@ -1,5 +1,5 @@ if tup.getconfig("NO_FASM") ~= "" then return end -HELPERDIR = (tup.getconfig("HELPERDIR") == "") and "../../.." or tup.getconfig("HELPERDIR") +HELPERDIR = (tup.getconfig("HELPERDIR") == "") and "../.." or tup.getconfig("HELPERDIR") tup.include(HELPERDIR .. "/use_fasm.lua") add_include(tup.getvariantdir()) diff --git a/programs/demos/free3d04/trunk/build_en.bat b/programs/demos/free3d04/build_en.bat similarity index 100% rename from programs/demos/free3d04/trunk/build_en.bat rename to programs/demos/free3d04/build_en.bat diff --git a/programs/demos/free3d04/trunk/build_ru.bat b/programs/demos/free3d04/build_ru.bat similarity index 100% rename from programs/demos/free3d04/trunk/build_ru.bat rename to programs/demos/free3d04/build_ru.bat diff --git a/programs/demos/free3d04/trunk/free3d04.asm b/programs/demos/free3d04/free3d04.asm similarity index 99% rename from programs/demos/free3d04/trunk/free3d04.asm rename to programs/demos/free3d04/free3d04.asm index 879522655..4d30e38b5 100644 --- a/programs/demos/free3d04/trunk/free3d04.asm +++ b/programs/demos/free3d04/free3d04.asm @@ -1,3 +1,6 @@ +; SPDX-License-Identifier: NOASSERTION +; + ; ; Fisheye Raycasting Engine Etc. FREE3D for MENUETOS by Dieter Marfurt ; Version 0.4 (requires some texture-files to compile (see Data Section)) @@ -36,7 +39,7 @@ use32 dd APP_MEM;0x100000 ; esp dd 0x0 , 0x0 ; I_Param , I_Icon include 'lang.inc' -include '..\..\..\macros.inc' +include '..\..\macros.inc' COLOR_ORDER equ OTHER include 'gif_lite.inc' @@ -296,7 +299,7 @@ m_right: ; turn right draw_window: mcall 12,1 - + mcall 48, 4 ;get skin width lea ecx, [50*65536+484+eax] ;[y start] *65536 + [y size] + [skin_height] mcall 0,<50,649>,,0x74ffffff,,title ;draw window diff --git a/programs/demos/free3d04/trunk/gif_lite.inc b/programs/demos/free3d04/gif_lite.inc similarity index 100% rename from programs/demos/free3d04/trunk/gif_lite.inc rename to programs/demos/free3d04/gif_lite.inc diff --git a/programs/demos/free3d04/trunk/readme.txt b/programs/demos/free3d04/readme.txt similarity index 100% rename from programs/demos/free3d04/trunk/readme.txt rename to programs/demos/free3d04/readme.txt diff --git a/programs/demos/free3d04/trunk/texture.gif b/programs/demos/free3d04/texture.gif similarity index 100% rename from programs/demos/free3d04/trunk/texture.gif rename to programs/demos/free3d04/texture.gif