demos/zeroline: Post-SVN tidy

- Move source code from `trunk` into root directory.
- Update build files and ASM include paths.
- Note: Line endings standardised from `CRLF` > `LF`, so best to view diffs with whitespace changes hidden.
This commit is contained in:
2025-05-31 21:49:52 +01:00
parent 7fe66081fa
commit 9d0aee6c6d
5 changed files with 380 additions and 374 deletions

View File

@@ -466,7 +466,7 @@ tup.append_table(img_files, {
{"DEMOS/TUBE", VAR_PROGS .. "/demos/tube/tube"}, {"DEMOS/TUBE", VAR_PROGS .. "/demos/tube/tube"},
{"DEMOS/UNVWATER", VAR_PROGS .. "/demos/unvwater/unvwater"}, {"DEMOS/UNVWATER", VAR_PROGS .. "/demos/unvwater/unvwater"},
{"DEMOS/WEB", VAR_PROGS .. "/demos/web/web"}, {"DEMOS/WEB", VAR_PROGS .. "/demos/web/web"},
{"DEMOS/ZEROLINE", VAR_PROGS .. "/demos/zeroline/trunk/zeroline"}, {"DEMOS/ZEROLINE", VAR_PROGS .. "/demos/zeroline/zeroline"},
{"DEVELOP/BOARD", VAR_PROGS .. "/system/board/trunk/board"}, {"DEVELOP/BOARD", VAR_PROGS .. "/system/board/trunk/board"},
{"DEVELOP/DBGBOARD", VAR_PROGS .. "/system/dbgboard/dbgboard"}, {"DEVELOP/DBGBOARD", VAR_PROGS .. "/system/dbgboard/dbgboard"},
{"DEVELOP/CEDIT", SRC_PROGS .. "/develop/cedit/CEDIT"}, {"DEVELOP/CEDIT", SRC_PROGS .. "/develop/cedit/CEDIT"},

View File

@@ -1,373 +1,379 @@
;------------------------------------------------------------------------------ ; SPDX-License-Identifier: NOASSERTION
; @SS - screensaver ;
;------------------------------------------------------------------------------
; last update: 30/03/2012 ; Text encoded with Code Page 866 - Cyrillic
; 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. ; @SS - screensaver
;--------------------------------------------------------------------- ;------------------------------------------------------------------------------
; SCREENSAVER APPLICATION by lisovin@26.ru ; last update: 30/03/2012
; ; changed by: Marat Zakiyanov aka Mario79, aka Mario
; Compile with FASM for Menuet ; changes: The program uses only 4 Kb memory is now.
; ; Code refactoring. Using transparent cursor.
;------------------------------------------------------------------------------ ; Fix bug - using lots of buttons from f.8.
use32 ;---------------------------------------------------------------------
org 0x0 ; SCREENSAVER APPLICATION by lisovin@26.ru
;
db 'MENUET01' ; 8 byte id ; Compile with FASM for Menuet
dd 0x01 ; header version ;
dd START ; start of code ;------------------------------------------------------------------------------
dd IM_END ; size of image use32
dd I_END ; memory for app org 0x0
dd stack_top ; esp
dd I_Param ; boot parameters db 'MENUET01' ; 8 byte id
dd 0x0 ; path dd 0x01 ; header version
;------------------------------------------------------------------------------ dd START ; start of code
include '..\..\..\macros.inc' dd IM_END ; size of image
;include 'debug.inc' dd I_END ; memory for app
;------------------------------------------------------------------------------ dd stack_top ; esp
align 4 dd I_Param ; boot parameters
START: dd 0x0 ; path
mcall 68,11 ;------------------------------------------------------------------------------
mcall 40, EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE include '..\..\macros.inc'
; boot parameters ;include 'debug.inc'
cmp [I_Param], dword '@ss' ;------------------------------------------------------------------------------
setz [screensaver] align 4
cmp [I_Param],dword 'ZERO' START:
jne @f mcall 68,11
mov [type],dword 0 mcall 40, EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE
;-------------------------------------- ; boot parameters
align 4 cmp [I_Param], dword '@ss'
@@: setz [screensaver]
cmp [I_Param],dword 'ASSM' cmp [I_Param],dword 'ZERO'
jne bgr_changed jne @f
mov [type],dword 24 mov [type],dword 0
;------------------------------------------------------------------------------ ;--------------------------------------
align 4 align 4
bgr_changed: @@:
cmp [I_Param],dword 'ASSM'
mcall 14 jne bgr_changed
mov [y_max],ax mov [type],dword 24
shr eax,16 ;------------------------------------------------------------------------------
mov [x_max],ax align 4
shl eax,16 bgr_changed:
mov [top_right_corner],eax
mcall 14
call create_ss mov [y_max],ax
;------------------------------------------------------------------------------ shr eax,16
align 4 mov [x_max],ax
still: shl eax,16
cmp al,2 ; key in buffer? mov [top_right_corner],eax
jz key
call create_ss
cmp al,5 ; background redraw? ;------------------------------------------------------------------------------
jz bgr_changed align 4
; mouse event still:
mcall 37,2 ; ¯à®¢¥à¨¬ ª­®¯ª¨ cmp al,2 ; key in buffer?
and al,3 jz key
cmp al,3 ; ­ ¦ âë ®¡¥ ª­®¯ª¨ ¬ëè¨?
jnz still cmp al,5 ; background redraw?
jz bgr_changed
mcall 37,0 ; ¯à®¢¥à¨¬ ª®®à¤¨­ âë ; mouse event
cmp [top_right_corner],eax mcall 37,2 ; ¯à®¢¥à¨¬ ª­®¯ª¨
jnz still and al,3
;------------------------------------------------------------------------------ cmp al,3 ; ­ ¦ âë ®¡¥ ª­®¯ª¨ ¬ëè¨?
align 4 jnz still
key:
mcall ; eax = 2 mcall 37,0 ; ¯à®¢¥à¨¬ ª®®à¤¨­ âë
jmp still cmp [top_right_corner],eax
;------------------------------------------------------------------------------ jnz still
align 4 ;------------------------------------------------------------------------------
create_ss: align 4
mcall 40,100010b key:
;set_new_cursor_skin - transparent cursor mcall ; eax = 2
mcall 68,12,32*32*4 ; get memory for own cursor area jmp still
;------------------------------------------------------------------------------
push eax align 4
mov ecx,eax create_ss:
mcall 37,4,,2 ; load own cursor mcall 40,100010b
;set_new_cursor_skin - transparent cursor
mov ecx,eax mcall 68,12,32*32*4 ; get memory for own cursor area
mcall 37,5 ; set own cursor
push eax
pop ecx mov ecx,eax
mcall 68,13 ; free own cursor area mcall 37,4,,2 ; load own cursor
cmp [type],dword 0 mov ecx,eax
je drawsswin mcall 37,5 ; set own cursor
cmp [type],dword 24 pop ecx
je asminit mcall 68,13 ; free own cursor area
mov dword [delay],1 cmp [type],dword 0
mov [lx1],10 ; for "draw line" je drawsswin
mov [lx2],40
mov [ly1],50 cmp [type],dword 24
mov [ly2],100 je asminit
mov [addx1],1
mov [addx2],1 mov dword [delay],1
mov [addy1],1 mov [lx1],10 ; for "draw line"
mov [addy2],1 mov [lx2],40
jmp drawsswin mov [ly1],50
;-------------------------------------- mov [ly2],100
align 4 mov [addx1],1
asminit: ; for "assembler" - assembler sources demo mov [addx2],1
; get size of file mov [addy1],1
mov [fileinfo],dword 5 mov [addy2],1
mov [fileinfo.point],dword fileinfo_buffer jmp drawsswin
mcall 70,fileinfo ;--------------------------------------
test eax,eax align 4
jnz .no_file asminit: ; for "assembler" - assembler sources demo
; get memory for file ; get size of file
mov ecx,[fileinfo_buffer+32] mov [fileinfo],dword 5
mov [fileinfo.size],ecx mov [fileinfo.point],dword fileinfo_buffer
mcall 68,12 mcall 70,fileinfo
mov [fileinfo.point],eax test eax,eax
; load file jnz .no_file
mov [fileinfo],dword 0 ; get memory for file
mcall 70,fileinfo mov ecx,[fileinfo_buffer+32]
test eax,eax mov [fileinfo.size],ecx
jz @f mcall 68,12
mcall 68,13,[fileinfo.point] mov [fileinfo.point],eax
;-------------------------------------- ; load file
align 4 mov [fileinfo],dword 0
.no_file: mcall 70,fileinfo
mov [type],dword 0 test eax,eax
jmp drawsswin jz @f
;-------------------------------------- mcall 68,13,[fileinfo.point]
align 4 ;--------------------------------------
@@: align 4
mov dword [delay],1 ;25 - old value .no_file:
;-------------------------------------- mov [type],dword 0
align 4 jmp drawsswin
asminit1: ;--------------------------------------
mov eax,[fileinfo.point] align 4
mov [stringstart],eax @@:
mov dword [stringlen],1 mov dword [delay],1 ;25 - old value
;-------------------------------------- ;--------------------------------------
align 4 align 4
newpage: asminit1:
mov [stringpos],16 mov eax,[fileinfo.point]
;-------------------------------------- mov [stringstart],eax
align 4 mov dword [stringlen],1
drawsswin: ;--------------------------------------
xor eax,eax align 4
movzx ebx,[x_max] newpage:
movzx ecx,[y_max] mov [stringpos],16
inc ebx ;--------------------------------------
inc ecx align 4
mcall ,,,0x01000000 drawsswin:
xor eax,eax
xor edx,edx movzx ebx,[x_max]
;mcall 13 ;Leency - use transparent background movzx ecx,[y_max]
;-------------------------------------- inc ebx
align 4 inc ecx
tstill: mcall ,,,0x01000000
mcall 23,[delay]
test eax,eax xor edx,edx
jnz thr_end ;mcall 13 ;Leency - use transparent background
;--------------------------------------
cmp [type],dword 0 align 4
je tstill tstill:
mcall 23,[delay]
cmp [type],dword 24 test eax,eax
je drawssasm jnz thr_end
call draw_line cmp [type],dword 0
jmp tstill je tstill
;--------------------------------------
align 4 cmp [type],dword 24
thr_end: je drawssasm
cmp [screensaver], 0
jz @f call draw_line
mcall 70, f70 jmp tstill
@@: ;--------------------------------------
cmp [type],dword 24 align 4
jne @f thr_end:
mcall 68,13,[fileinfo.point] cmp [screensaver], 0
@@: jz @f
and [params], not 1 mcall 70, f70
or eax,-1 @@:
mcall cmp [type],dword 24
;------------------------------------------------------------------------------ jne @f
align 4 mcall 68,13,[fileinfo.point]
drawssasm: @@:
mov edi,[stringstart] and [params], not 1
add edi,[stringlen] or eax,-1
dec edi mcall
;------------------------------------------------------------------------------
mov eax,edi align 4
sub eax,[fileinfo.point] drawssasm:
mov edi,[stringstart]
cmp eax,[fileinfo.size] add edi,[stringlen]
ja asminit1 dec edi
cmp word [edi],0x0a0d mov eax,edi
je addstring sub eax,[fileinfo.point]
cmp byte [edi],0x0a cmp eax,[fileinfo.size]
jne noaddstring ja asminit1
dec edi cmp word [edi],0x0a0d
;-------------------------------------- je addstring
align 4
addstring: cmp byte [edi],0x0a
add [stringpos],16 jne noaddstring
add edi,2
mov [stringstart],edi dec edi
mov dword [stringlen],1 ;--------------------------------------
mov ax,[stringpos] align 4
cmp ax,[y_max] addstring:
jb tstill add [stringpos],16
jmp newpage add edi,2
;-------------------------------------- mov [stringstart],edi
align 4 mov dword [stringlen],1
noaddstring: mov ax,[stringpos]
mov ebx,[stringlen] cmp ax,[y_max]
shl ebx,19 jb tstill
mov bx,[stringpos] jmp newpage
mov edx,[stringstart] ;--------------------------------------
add edx,[stringlen] align 4
dec edx noaddstring:
mcall 4,,0x104ba010,,1 mov ebx,[stringlen]
inc dword [stringlen] shl ebx,19
cmp [edi],byte ' ' mov bx,[stringpos]
je drawssasm mov edx,[stringstart]
jmp tstill add edx,[stringlen]
;------------------------------------------------------------------------------ dec edx
align 4 mcall 4,,0x104ba010,,1
draw_line: inc dword [stringlen]
movzx esi,[x_max] cmp [edi],byte ' '
movzx edi,[y_max] je drawssasm
jmp tstill
mov eax,[addx1] ;------------------------------------------------------------------------------
add [lx1],eax align 4
mov eax,[addy1] draw_line:
add [ly1],eax movzx esi,[x_max]
movzx edi,[y_max]
mov eax,[addx2]
add [lx2],eax mov eax,[addx1]
mov eax,[addy2] add [lx1],eax
add [ly2],eax mov eax,[addy1]
add [ly1],eax
cmp [lx1],1
jge dl1 mov eax,[addx2]
mov [addx1],1 add [lx2],eax
;-------------------------------------- mov eax,[addy2]
align 4 add [ly2],eax
dl1:
cmp [lx2],1 cmp [lx1],1
jge dl2 jge dl1
mov [addx1],1
mov [addx2],1 ;--------------------------------------
;-------------------------------------- align 4
align 4 dl1:
dl2: cmp [lx2],1
cmp [lx1],esi jge dl2
jbe dl3
mov [addx2],1
mov [addx1],0xffffffff ;--------------------------------------
;-------------------------------------- align 4
align 4 dl2:
dl3: cmp [lx1],esi
cmp [lx2],esi jbe dl3
jbe dl4
mov [addx1],0xffffffff
mov [addx2],0xffffffff ;--------------------------------------
;-------------------------------------- align 4
align 4 dl3:
dl4: cmp [lx2],esi
cmp [ly1],1 jbe dl4
jge dl5
mov [addy1],1 mov [addx2],0xffffffff
;-------------------------------------- ;--------------------------------------
align 4 align 4
dl5: dl4:
cmp [ly2],2 cmp [ly1],1
jge dl6 jge dl5
mov [addy1],1
mov [addy2],1 ;--------------------------------------
;-------------------------------------- align 4
align 4 dl5:
dl6: cmp [ly2],2
cmp [ly1],edi jge dl6
jbe dl7
mov [addy2],1
mov [addy1],-1 ;--------------------------------------
;-------------------------------------- align 4
align 4 dl6:
dl7: cmp [ly1],edi
cmp [ly2],edi jbe dl7
jbe dl8
mov [addy1],-1
mov [addy2],-1 ;--------------------------------------
;-------------------------------------- align 4
align 4 dl7:
dl8: cmp [ly2],edi
mov eax,[lx2] jbe dl8
cmp [lx1],eax
jz dnol mov [addy2],-1
;--------------------------------------
mov bx,word [lx1] align 4
shl ebx,16 dl8:
mov bx,word [lx2] mov eax,[lx2]
cmp [lx1],eax
mov cx,word [ly1] jz dnol
shl ecx,16
mov cx,word [ly2] mov bx,word [lx1]
shl ebx,16
mov edx,[lcolor] mov bx,word [lx2]
and edx,0xffffff
mcall 38 mov cx,word [ly1]
;-------------------------------------- shl ecx,16
align 4 mov cx,word [ly2]
dnol:
add [lcolor],0x010201 mov edx,[lcolor]
ret and edx,0xffffff
;------------------------------------------------------------------------------ mcall 38
align 4 ; DATA AREA ;--------------------------------------
type dd 12 align 4
delay dd 100 dnol:
lx1 dd 10 add [lcolor],0x010201
lx2 dd 40 ret
ly1 dd 50 ;------------------------------------------------------------------------------
ly2 dd 100 align 4 ; DATA AREA
addx1 dd 1 type dd 12
addx2 dd 1 delay dd 100
addy1 dd 1 lx1 dd 10
addy2 dd 1 lx2 dd 40
stringlen dd 1 ly1 dd 50
stringstart dd 0 ly2 dd 100
addx1 dd 1
stringpos dw 16 addx2 dd 1
params db 0 ;if bit 0 set-ssaver works if bit 1 set-setup works addy1 dd 1
addy2 dd 1
fileinfo: stringlen dd 1
dd 0 stringstart dd 0
dd 0
dd 0 stringpos dw 16
.size: dd 0 params db 0 ;if bit 0 set-ssaver works if bit 1 set-setup works
.point: dd 0
db '/sys/macros.inc',0 fileinfo:
dd 0
f70: ; run dd 0
dd 7, 0, 0, 0, 0 dd 0
db '/sys/@SS',0 .size: dd 0
.point: dd 0
screensaver db ? db '/sys/macros.inc',0
;------------------------------- f70: ; run
IM_END: ; UNINITIALIZED DATA dd 7, 0, 0, 0, 0
top_right_corner rd 1 db '/sys/@SS',0
align 4
lcolor dd ? screensaver db ?
x_max dw ? ; à §¬¥àë íªà ­ 
y_max dw ? ;-------------------------------
I_Param: IM_END: ; UNINITIALIZED DATA
fileinfo_buffer: top_right_corner rd 1
rb 40 align 4
;------------------------------- lcolor dd ?
rb 512 x_max dw ? ; à §¬¥àë íªà ­ 
stack_top: y_max dw ?
I_END: I_Param:
fileinfo_buffer:
rb 40
;-------------------------------
rb 512
stack_top:
I_END: