programs/demos: Post-SVN tidy (part 3) (#416)

- 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: #416
Reviewed-by: Ivan B <dunkaist@noreply.localhost>
Reviewed-by: Burer <burer@noreply.localhost>
Co-authored-by: Andrew <dent.ace@gmail.com>
Co-committed-by: Andrew <dent.ace@gmail.com>
This commit was merged in pull request #416.
This commit is contained in:
2026-04-10 17:20:15 +00:00
committed by Burer
parent 7bcb400040
commit d6a1b56b7f
39 changed files with 1479 additions and 1453 deletions
+6 -6
View File
@@ -464,12 +464,12 @@ tup.append_table(img_files, {
{"DEMOS/MOVBACK", VAR_PROGS .. "/demos/movback/movback"},
{"DEMOS/PLASMA", VAR_PROGS .. "/demos/plasma/plasma"},
{"DEMOS/SPIRAL", VAR_PROGS .. "/demos/spiral/spiral"},
{"DEMOS/TINYFRAC", VAR_PROGS .. "/demos/tinyfrac/trunk/tinyfrac"},
{"DEMOS/TRANTEST", VAR_PROGS .. "/demos/trantest/trunk/trantest"},
{"DEMOS/TINYFRAC", VAR_PROGS .. "/demos/tinyfrac/tinyfrac"},
{"DEMOS/TRANTEST", VAR_PROGS .. "/demos/trantest/trantest"},
{"DEMOS/TUBE", VAR_PROGS .. "/demos/tube/tube"},
{"DEMOS/UNVWATER", VAR_PROGS .. "/demos/unvwater/unvwater"},
{"DEMOS/WEB", VAR_PROGS .. "/demos/web/trunk/web"},
{"DEMOS/ZEROLINE", VAR_PROGS .. "/demos/zeroline/trunk/zeroline"},
{"DEMOS/WEB", VAR_PROGS .. "/demos/web/web"},
{"DEMOS/ZEROLINE", VAR_PROGS .. "/demos/zeroline/zeroline"},
{"DEVELOP/BOARD", VAR_PROGS .. "/system/board/board"},
{"DEVELOP/DBGBOARD", VAR_PROGS .. "/system/dbgboard/dbgboard"},
{"DEVELOP/CHARSETS", VAR_PROGS .. "/develop/charsets/charsets"},
@@ -610,7 +610,7 @@ tup.append_table(extra_files, {
{"kolibrios/3D/voxel_utilites/VOX_TGL" , VAR_PROGS .. "/media/voxel_editor/utilites/vox_tgl"},
{"kolibrios/demos/flag", VAR_PROGS .. "/demos/flag/flag"},
{"kolibrios/demos/life3", VAR_PROGS .. "/games/life3/life3"},
{"kolibrios/demos/qjulia", VAR_PROGS .. "/demos/qjulia/trunk/qjulia"},
{"kolibrios/demos/qjulia", VAR_PROGS .. "/demos/qjulia/qjulia"},
{"kolibrios/develop/koldbg", VAR_PROGS .. "/develop/koldbg/koldbg"},
{"kolibrios/games/Almaz", VAR_PROGS .. "/games/almaz/almaz"},
{"kolibrios/games/arcanii", VAR_PROGS .. "/games/arcanii/arcanii"},
@@ -730,7 +730,7 @@ tup.append_table(img_files, {
})
tup.append_table(extra_files, {
{"kolibrios/utils/thashview", VAR_PROGS .. "/other/TinyHashView/thashview"},
{"kolibrios/demos/kmatrix", VAR_PROGS .. "/demos/kmatrix/trunk/kmatrix"},
{"kolibrios/demos/kmatrix", VAR_PROGS .. "/demos/kmatrix/kmatrix"},
{"kolibrios/utils/graph", VAR_PROGS .. "/other/graph/branches/tcc_current/graph"},
{"kolibrios/develop/TinyBasic/TinyBasic", VAR_PROGS .. "/develop/tinybasic-1.0.4/tinybasic"},
{"kolibrios/develop/TinyBasic/bas/", SRC_PROGS .. "/develop/tinybasic-1.0.4/bas/*"},
+15 -15
View File
@@ -183,9 +183,9 @@ echo *
fasm games\15\trunk\15.asm %BIN%\games\15
fasm games\arcanii\trunk\arcanii.asm %BIN%\games\arcanii
fasm games\arcanoid\trunk\arcanoid.asm %BIN%\games\arcanoid
cd games\c4\trunk\
pushd games\c4\trunk\
nasmw -f bin -o ..\..\..\%BIN%\games\c4 c4.asm
cd ..\..\..
popd
fasm games\freecell\freecell.asm %BIN%\games\freecell
fasm games\mblocks\trunk\mblocks.asm %BIN%\games\mblocks
fasm games\phenix\trunk\phenix.asm %BIN%\games\phenix
@@ -204,28 +204,28 @@ echo *
fasm demos\3dcube2\3dcube2.asm %BIN%\3d\3dcube2
rem fasm demos\3detx60b\3detx60b.asm %BIN%\3d\3detx60b
fasm demos\3dtcub10\3dtcub10.asm %BIN%\3d\3dtcub10
cd demos\aclock\trunk\
pushd demos\aclock\
nasmw -t -f bin -o ..\..\..\%BIN%\demos\aclock aclock.asm
cd ..\..\..
popd
fasm demos\bcdclk\bcdclk.asm %BIN%\demos\bcdclk
fasm demos\bgitest\trunk\bgitest.asm %BIN%\fonts\bgitest
rem fasm demos\bgitest\trunk\bgitest.asm %BIN%\fonts\bgitest
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\firework\firework.asm %BIN%\demos\firework
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
fasm demos\timer\trunk\timer.asm %BIN%\demos\timer
fasm demos\tinyfrac\trunk\tinyfrac.asm %BIN%\demos\tinyfrac
fasm demos\transp\trunk\transp.asm %BIN%\demos\transp
fasm demos\trantest\trunk\trantest.asm %BIN%\demos\trantest
fasm demos\tube\trunk\tube.asm %BIN%\demos\tube
fasm demos\unvwater\trunk\unvwater.asm %BIN%\demos\unvwater
rem fasm demos\magnify\trunk\magnify.asm %BIN%\magnify
fasm demos\movback\movback.asm %BIN%\demos\movback
fasm demos\plasma\plasma.asm %BIN%\demos\plasma
fasm demos\timer\timer.asm %BIN%\demos\timer
fasm demos\tinyfrac\tinyfrac.asm %BIN%\demos\tinyfrac
fasm demos\transp\transp.asm %BIN%\demos\transp
fasm demos\trantest\trantest.asm %BIN%\demos\trantest
fasm demos\tube\tube.asm %BIN%\demos\tube
fasm demos\unvwater\unvwater.asm %BIN%\demos\unvwater
echo *
echo Building depend application for fdd's nightbuild
@@ -1,6 +1,6 @@
if tup.getconfig("NO_TCC") ~= "" 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_tcc.lua")
link_tcc("main.c", "kmatrix");
@@ -1,4 +1,4 @@
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")
tup.rule("life.asm", FASM .. " %f %o " .. tup.getconfig("KPACK_CMD"), "life")
File diff suppressed because it is too large Load Diff
@@ -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())
@@ -1,3 +1,9 @@
; SPDX-License-Identifier: NOASSERTION
;
; Text encoded with Code Page 866 - Cyrillic
;
; TIMER (show how much system works)
;
@@ -17,7 +23,7 @@ use32
dd 0x0 , 0x0 ; I_Param , I_Icon
include 'lang.inc' ; Language support for locales: ru_RU (CP866), en_US.
include '..\..\..\macros.inc'
include '..\..\macros.inc'
START: ; start of execution
mov eax, 40
@@ -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())
@@ -1,3 +1,6 @@
; SPDX-License-Identifier: NOASSERTION
;
; tinyfrac.asm
;
; teeny program displays the Mandelbrot set.
@@ -82,7 +85,7 @@ use32
dd 0,0
include 'lang.inc'
include '..\..\..\macros.inc'
include '..\..\macros.inc'
START:
call draw_fractal
@@ -173,39 +176,39 @@ still:
call draw_fractal
jmp still
no_right:
cmp al,19 ;'r'
jne no_red
mov ah,3
call colorize
jmp still
no_red:
cmp al,34 ;'g'
jne no_green
mov ah,4
call colorize
jmp still
no_green:
cmp al,48 ;'b'
jne no_blue
mov ah,5
call colorize
jmp still
no_blue:
cmp al,17 ;'w'
jne no_set_as_wallpaper
mcall 15, 1, PIXWIDTH, PIXHEIGHT
mcall 15, 4, 1 ;mode 1-tiled, 0-stretch
mcall 15, 5, IMGBUF, 0, PIXWIDTH*3*PIXHEIGHT
mcall 15, 3
mcall 15, 3
no_set_as_wallpaper:
jmp still
colorize:
colorize:
shr eax,8
sub eax,3
imul eax,8
@@ -392,13 +395,13 @@ scale db STARTSCALE
draw_window:
pusha
mcall 12, 1
mcall 48, 4 ;get skin height
lea ecx, [50*65536+PIXHEIGHT+4+eax]
mcall 0,<50,PIXWIDTH+9>,,0x74000000,,header_txt ;draw window
call put_image
mcall 12, 2
popa
ret
@@ -425,4 +428,4 @@ STARTY dd 120
scaleaddy dd 120
scaleaddx dd 200
I_END:
I_END:
@@ -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())
@@ -1,3 +1,6 @@
; SPDX-License-Identifier: NOASSERTION
;
;
; TRANSPARENT EXAMPLE
;
@@ -17,7 +20,7 @@ use32
dd 0x0 , 0x0 ; I_Param , I_Icon
include 'lang.inc'
include '..\..\..\macros.inc'
include '..\..\macros.inc'
START: ; start of execution
mov [procinfo.box.left], 100
@@ -25,7 +28,7 @@ START: ; start of execution
mov [procinfo.box.top], 80
mov [procinfo.box.height], 300
call draw_window
red:
red:
call get_transparent
call draw_window ; at first, draw the window
@@ -83,7 +86,7 @@ draw_window:
mcall
call draw_transparent
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,2 ; 2, end of draw
mcall
@@ -192,4 +195,3 @@ title db 'Transparent',0
I_END:
procinfo process_information
@@ -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())
@@ -1,3 +1,6 @@
; SPDX-License-Identifier: NOASSERTION
;
;
; TRIANGLE SPEED TEST 3
; 32 triangle draw use! 12300 triangle in sec on 800Mhz processor
@@ -19,7 +22,7 @@ use32
SCREEN_X equ 320 ;800
SCREEN_Y equ 200 ;600
include '..\..\..\macros.inc'
include '..\..\macros.inc'
include 'lang.inc'
include 'ascl.inc'
include 'ascgl.inc'
@@ -80,7 +83,7 @@ exit:
;Draw window
draw_window:
mov eax,12 ;Start
mov ebx,1
mcall
@@ -227,7 +230,7 @@ filled_triangle:
mov ecx,[@@ty2]
cmp ecx,[@@ty3]
jge @@end_loop23
mov ebx,[@@tx2]
shl ebx,12 ;7
@@loop23:
@@ -1,3 +1,6 @@
; SPDX-License-Identifier: NOASSERTION
;
;"Web" demo for KolibriOS, version 0.3
;Copyright Alexander Meshcheryakov (Self-Perfection), 2009
;Contact me: alexander.s.m@gmail.com
@@ -13,7 +16,7 @@ use32
db 'MENUET01'
dd 0x01,__start,__end,__memory,__stack,param,0
include '../../../macros.inc'
include '../../macros.inc'
background_cl = 0x000000
foreground_cl = 0xFFFFFF
@@ -31,7 +34,7 @@ CODE
mov ebx, EVM_REDRAW + EVM_KEY + EVM_BUTTON
cmovz ebx, EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE
mcall 40
;Make cursor transparent
mov edi, transparent_cursor
xor eax, eax
@@ -40,7 +43,7 @@ CODE
mcall 37, 4, transparent_cursor, 2
mov ecx, eax
mcall 37, 5
;Preinit. Randomize start counter
mcall 3
mov [initial_counter], eax ;init with system time
@@ -51,7 +54,7 @@ CODE
mov dword [y_max], eax ;store x_max and y_max
shr eax, 1
mov dword [radius], eax ;store radius and x_center
;Calc line_number
mov ax, [y_max]
mov dx, 0
@@ -90,7 +93,7 @@ CODE
fninit
fldpi
fidiv word [half_line_number] ;Now st0 contains angle step of line start points
mov eax, [line_coords_array_pointer] ;cleanup: comment
movzx ecx, word [half_line_number]
shl ecx, 1
@@ -189,7 +192,7 @@ calculate_next_line_end_point:
add eax, dword [image_pointer]
inc eax
mov [eax], byte red_cl_index
movzx ebx, word [esi+end_y_offset]
movzx eax, word [x_max]
imul eax, ebx
@@ -210,9 +213,9 @@ calculate_next_line_end_point:
mov bx, word [esi+start_y_offset]
cmp bx, word [esi+end_y_offset]
jnz general_draw_line ;Jump to next test if dy!=0
pusha
movzx ecx, word [esi+end_x_offset]
sub cx, word [esi+start_x_offset]
@@ -279,7 +282,7 @@ general_draw_line:
neg cx
neg edi
@@:
;compare abs(y1 - y0) and abs(x1 - x0)
cmp bx, cx
jnc @f
@@ -348,7 +351,7 @@ line_drawing_end:
movzx ebx, [x_max]
movzx ecx, [y_max]
mov edx, 0x01000000 ;Window style ;Draw nothing
; mov edx, 0x00000000 ;Window style
; mov edx, 0x00000000 ;Window style
; mov esi, 0x00000000 ;Header color (prevent odd color line on top of window in random cases)
mcall ;Define window
@@ -453,4 +456,4 @@ f70: ; run
screensaver db ?
transparent_cursor rd 32*32
MEOS_APP_END
MEOS_APP_END
@@ -1,373 +1,379 @@
;------------------------------------------------------------------------------
; @SS - screensaver
;------------------------------------------------------------------------------
; last update: 30/03/2012
; changed by: Marat Zakiyanov aka Mario79, aka Mario
; changes: The program uses only 4 Kb memory is now.
; Code refactoring. Using transparent cursor.
; Fix bug - using lots of buttons from f.8.
;---------------------------------------------------------------------
; SCREENSAVER APPLICATION by lisovin@26.ru
;
; Compile with FASM for Menuet
;
;------------------------------------------------------------------------------
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 ; memory for app
dd stack_top ; esp
dd I_Param ; boot parameters
dd 0x0 ; path
;------------------------------------------------------------------------------
include '..\..\..\macros.inc'
;include 'debug.inc'
;------------------------------------------------------------------------------
align 4
START:
mcall 68,11
mcall 40, EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE
; boot parameters
cmp [I_Param], dword '@ss'
setz [screensaver]
cmp [I_Param],dword 'ZERO'
jne @f
mov [type],dword 0
;--------------------------------------
align 4
@@:
cmp [I_Param],dword 'ASSM'
jne bgr_changed
mov [type],dword 24
;------------------------------------------------------------------------------
align 4
bgr_changed:
mcall 14
mov [y_max],ax
shr eax,16
mov [x_max],ax
shl eax,16
mov [top_right_corner],eax
call create_ss
;------------------------------------------------------------------------------
align 4
still:
cmp al,2 ; key in buffer?
jz key
cmp al,5 ; background redraw?
jz bgr_changed
; mouse event
mcall 37,2 ; проверим кнопки
and al,3
cmp al,3 ; нажаты обе кнопки мыши?
jnz still
mcall 37,0 ; проверим координаты
cmp [top_right_corner],eax
jnz still
;------------------------------------------------------------------------------
align 4
key:
mcall ; eax = 2
jmp still
;------------------------------------------------------------------------------
align 4
create_ss:
mcall 40,100010b
;set_new_cursor_skin - transparent cursor
mcall 68,12,32*32*4 ; get memory for own cursor area
push eax
mov ecx,eax
mcall 37,4,,2 ; load own cursor
mov ecx,eax
mcall 37,5 ; set own cursor
pop ecx
mcall 68,13 ; free own cursor area
cmp [type],dword 0
je drawsswin
cmp [type],dword 24
je asminit
mov dword [delay],1
mov [lx1],10 ; for "draw line"
mov [lx2],40
mov [ly1],50
mov [ly2],100
mov [addx1],1
mov [addx2],1
mov [addy1],1
mov [addy2],1
jmp drawsswin
;--------------------------------------
align 4
asminit: ; for "assembler" - assembler sources demo
; get size of file
mov [fileinfo],dword 5
mov [fileinfo.point],dword fileinfo_buffer
mcall 70,fileinfo
test eax,eax
jnz .no_file
; get memory for file
mov ecx,[fileinfo_buffer+32]
mov [fileinfo.size],ecx
mcall 68,12
mov [fileinfo.point],eax
; load file
mov [fileinfo],dword 0
mcall 70,fileinfo
test eax,eax
jz @f
mcall 68,13,[fileinfo.point]
;--------------------------------------
align 4
.no_file:
mov [type],dword 0
jmp drawsswin
;--------------------------------------
align 4
@@:
mov dword [delay],1 ;25 - old value
;--------------------------------------
align 4
asminit1:
mov eax,[fileinfo.point]
mov [stringstart],eax
mov dword [stringlen],1
;--------------------------------------
align 4
newpage:
mov [stringpos],16
;--------------------------------------
align 4
drawsswin:
xor eax,eax
movzx ebx,[x_max]
movzx ecx,[y_max]
inc ebx
inc ecx
mcall ,,,0x01000000
xor edx,edx
;mcall 13 ;Leency - use transparent background
;--------------------------------------
align 4
tstill:
mcall 23,[delay]
test eax,eax
jnz thr_end
cmp [type],dword 0
je tstill
cmp [type],dword 24
je drawssasm
call draw_line
jmp tstill
;--------------------------------------
align 4
thr_end:
cmp [screensaver], 0
jz @f
mcall 70, f70
@@:
cmp [type],dword 24
jne @f
mcall 68,13,[fileinfo.point]
@@:
and [params], not 1
or eax,-1
mcall
;------------------------------------------------------------------------------
align 4
drawssasm:
mov edi,[stringstart]
add edi,[stringlen]
dec edi
mov eax,edi
sub eax,[fileinfo.point]
cmp eax,[fileinfo.size]
ja asminit1
cmp word [edi],0x0a0d
je addstring
cmp byte [edi],0x0a
jne noaddstring
dec edi
;--------------------------------------
align 4
addstring:
add [stringpos],16
add edi,2
mov [stringstart],edi
mov dword [stringlen],1
mov ax,[stringpos]
cmp ax,[y_max]
jb tstill
jmp newpage
;--------------------------------------
align 4
noaddstring:
mov ebx,[stringlen]
shl ebx,19
mov bx,[stringpos]
mov edx,[stringstart]
add edx,[stringlen]
dec edx
mcall 4,,0x104ba010,,1
inc dword [stringlen]
cmp [edi],byte ' '
je drawssasm
jmp tstill
;------------------------------------------------------------------------------
align 4
draw_line:
movzx esi,[x_max]
movzx edi,[y_max]
mov eax,[addx1]
add [lx1],eax
mov eax,[addy1]
add [ly1],eax
mov eax,[addx2]
add [lx2],eax
mov eax,[addy2]
add [ly2],eax
cmp [lx1],1
jge dl1
mov [addx1],1
;--------------------------------------
align 4
dl1:
cmp [lx2],1
jge dl2
mov [addx2],1
;--------------------------------------
align 4
dl2:
cmp [lx1],esi
jbe dl3
mov [addx1],0xffffffff
;--------------------------------------
align 4
dl3:
cmp [lx2],esi
jbe dl4
mov [addx2],0xffffffff
;--------------------------------------
align 4
dl4:
cmp [ly1],1
jge dl5
mov [addy1],1
;--------------------------------------
align 4
dl5:
cmp [ly2],2
jge dl6
mov [addy2],1
;--------------------------------------
align 4
dl6:
cmp [ly1],edi
jbe dl7
mov [addy1],-1
;--------------------------------------
align 4
dl7:
cmp [ly2],edi
jbe dl8
mov [addy2],-1
;--------------------------------------
align 4
dl8:
mov eax,[lx2]
cmp [lx1],eax
jz dnol
mov bx,word [lx1]
shl ebx,16
mov bx,word [lx2]
mov cx,word [ly1]
shl ecx,16
mov cx,word [ly2]
mov edx,[lcolor]
and edx,0xffffff
mcall 38
;--------------------------------------
align 4
dnol:
add [lcolor],0x010201
ret
;------------------------------------------------------------------------------
align 4 ; DATA AREA
type dd 12
delay dd 100
lx1 dd 10
lx2 dd 40
ly1 dd 50
ly2 dd 100
addx1 dd 1
addx2 dd 1
addy1 dd 1
addy2 dd 1
stringlen dd 1
stringstart dd 0
stringpos dw 16
params db 0 ;if bit 0 set-ssaver works if bit 1 set-setup works
fileinfo:
dd 0
dd 0
dd 0
.size: dd 0
.point: dd 0
db '/sys/macros.inc',0
f70: ; run
dd 7, 0, 0, 0, 0
db '/sys/@SS',0
screensaver db ?
;-------------------------------
IM_END: ; UNINITIALIZED DATA
top_right_corner rd 1
align 4
lcolor dd ?
x_max dw ? ; размеры экрана
y_max dw ?
I_Param:
fileinfo_buffer:
rb 40
;-------------------------------
rb 512
stack_top:
I_END:
; SPDX-License-Identifier: NOASSERTION
;
; Text encoded with Code Page 866 - Cyrillic
;------------------------------------------------------------------------------
; @SS - screensaver
;------------------------------------------------------------------------------
; last update: 30/03/2012
; changed by: Marat Zakiyanov aka Mario79, aka Mario
; changes: The program uses only 4 Kb memory is now.
; Code refactoring. Using transparent cursor.
; Fix bug - using lots of buttons from f.8.
;---------------------------------------------------------------------
; SCREENSAVER APPLICATION by lisovin@26.ru
;
; Compile with FASM for Menuet
;
;------------------------------------------------------------------------------
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 ; memory for app
dd stack_top ; esp
dd I_Param ; boot parameters
dd 0x0 ; path
;------------------------------------------------------------------------------
include '..\..\macros.inc'
;include 'debug.inc'
;------------------------------------------------------------------------------
align 4
START:
mcall 68,11
mcall 40, EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE
; boot parameters
cmp [I_Param], dword '@ss'
setz [screensaver]
cmp [I_Param],dword 'ZERO'
jne @f
mov [type],dword 0
;--------------------------------------
align 4
@@:
cmp [I_Param],dword 'ASSM'
jne bgr_changed
mov [type],dword 24
;------------------------------------------------------------------------------
align 4
bgr_changed:
mcall 14
mov [y_max],ax
shr eax,16
mov [x_max],ax
shl eax,16
mov [top_right_corner],eax
call create_ss
;------------------------------------------------------------------------------
align 4
still:
cmp al,2 ; key in buffer?
jz key
cmp al,5 ; background redraw?
jz bgr_changed
; mouse event
mcall 37,2 ; проверим кнопки
and al,3
cmp al,3 ; нажаты обе кнопки мыши?
jnz still
mcall 37,0 ; проверим координаты
cmp [top_right_corner],eax
jnz still
;------------------------------------------------------------------------------
align 4
key:
mcall ; eax = 2
jmp still
;------------------------------------------------------------------------------
align 4
create_ss:
mcall 40,100010b
;set_new_cursor_skin - transparent cursor
mcall 68,12,32*32*4 ; get memory for own cursor area
push eax
mov ecx,eax
mcall 37,4,,2 ; load own cursor
mov ecx,eax
mcall 37,5 ; set own cursor
pop ecx
mcall 68,13 ; free own cursor area
cmp [type],dword 0
je drawsswin
cmp [type],dword 24
je asminit
mov dword [delay],1
mov [lx1],10 ; for "draw line"
mov [lx2],40
mov [ly1],50
mov [ly2],100
mov [addx1],1
mov [addx2],1
mov [addy1],1
mov [addy2],1
jmp drawsswin
;--------------------------------------
align 4
asminit: ; for "assembler" - assembler sources demo
; get size of file
mov [fileinfo],dword 5
mov [fileinfo.point],dword fileinfo_buffer
mcall 70,fileinfo
test eax,eax
jnz .no_file
; get memory for file
mov ecx,[fileinfo_buffer+32]
mov [fileinfo.size],ecx
mcall 68,12
mov [fileinfo.point],eax
; load file
mov [fileinfo],dword 0
mcall 70,fileinfo
test eax,eax
jz @f
mcall 68,13,[fileinfo.point]
;--------------------------------------
align 4
.no_file:
mov [type],dword 0
jmp drawsswin
;--------------------------------------
align 4
@@:
mov dword [delay],1 ;25 - old value
;--------------------------------------
align 4
asminit1:
mov eax,[fileinfo.point]
mov [stringstart],eax
mov dword [stringlen],1
;--------------------------------------
align 4
newpage:
mov [stringpos],16
;--------------------------------------
align 4
drawsswin:
xor eax,eax
movzx ebx,[x_max]
movzx ecx,[y_max]
inc ebx
inc ecx
mcall ,,,0x01000000
xor edx,edx
;mcall 13 ;Leency - use transparent background
;--------------------------------------
align 4
tstill:
mcall 23,[delay]
test eax,eax
jnz thr_end
cmp [type],dword 0
je tstill
cmp [type],dword 24
je drawssasm
call draw_line
jmp tstill
;--------------------------------------
align 4
thr_end:
cmp [screensaver], 0
jz @f
mcall 70, f70
@@:
cmp [type],dword 24
jne @f
mcall 68,13,[fileinfo.point]
@@:
and [params], not 1
or eax,-1
mcall
;------------------------------------------------------------------------------
align 4
drawssasm:
mov edi,[stringstart]
add edi,[stringlen]
dec edi
mov eax,edi
sub eax,[fileinfo.point]
cmp eax,[fileinfo.size]
ja asminit1
cmp word [edi],0x0a0d
je addstring
cmp byte [edi],0x0a
jne noaddstring
dec edi
;--------------------------------------
align 4
addstring:
add [stringpos],16
add edi,2
mov [stringstart],edi
mov dword [stringlen],1
mov ax,[stringpos]
cmp ax,[y_max]
jb tstill
jmp newpage
;--------------------------------------
align 4
noaddstring:
mov ebx,[stringlen]
shl ebx,19
mov bx,[stringpos]
mov edx,[stringstart]
add edx,[stringlen]
dec edx
mcall 4,,0x104ba010,,1
inc dword [stringlen]
cmp [edi],byte ' '
je drawssasm
jmp tstill
;------------------------------------------------------------------------------
align 4
draw_line:
movzx esi,[x_max]
movzx edi,[y_max]
mov eax,[addx1]
add [lx1],eax
mov eax,[addy1]
add [ly1],eax
mov eax,[addx2]
add [lx2],eax
mov eax,[addy2]
add [ly2],eax
cmp [lx1],1
jge dl1
mov [addx1],1
;--------------------------------------
align 4
dl1:
cmp [lx2],1
jge dl2
mov [addx2],1
;--------------------------------------
align 4
dl2:
cmp [lx1],esi
jbe dl3
mov [addx1],0xffffffff
;--------------------------------------
align 4
dl3:
cmp [lx2],esi
jbe dl4
mov [addx2],0xffffffff
;--------------------------------------
align 4
dl4:
cmp [ly1],1
jge dl5
mov [addy1],1
;--------------------------------------
align 4
dl5:
cmp [ly2],2
jge dl6
mov [addy2],1
;--------------------------------------
align 4
dl6:
cmp [ly1],edi
jbe dl7
mov [addy1],-1
;--------------------------------------
align 4
dl7:
cmp [ly2],edi
jbe dl8
mov [addy2],-1
;--------------------------------------
align 4
dl8:
mov eax,[lx2]
cmp [lx1],eax
jz dnol
mov bx,word [lx1]
shl ebx,16
mov bx,word [lx2]
mov cx,word [ly1]
shl ecx,16
mov cx,word [ly2]
mov edx,[lcolor]
and edx,0xffffff
mcall 38
;--------------------------------------
align 4
dnol:
add [lcolor],0x010201
ret
;------------------------------------------------------------------------------
align 4 ; DATA AREA
type dd 12
delay dd 100
lx1 dd 10
lx2 dd 40
ly1 dd 50
ly2 dd 100
addx1 dd 1
addx2 dd 1
addy1 dd 1
addy2 dd 1
stringlen dd 1
stringstart dd 0
stringpos dw 16
params db 0 ;if bit 0 set-ssaver works if bit 1 set-setup works
fileinfo:
dd 0
dd 0
dd 0
.size: dd 0
.point: dd 0
db '/sys/macros.inc',0
f70: ; run
dd 7, 0, 0, 0, 0
db '/sys/@SS',0
screensaver db ?
;-------------------------------
IM_END: ; UNINITIALIZED DATA
top_right_corner rd 1
align 4
lcolor dd ?
x_max dw ? ; размеры экрана
y_max dw ?
I_Param:
fileinfo_buffer:
rb 40
;-------------------------------
rb 512
stack_top:
I_END: