*kernel - fixes in 15.2 by Mario79 and 67 by mike.dld

updated sysfunc.txt
*programs 
         new icons and logo for CPUID and ICON
         added new version of @ICON and ICONMNGR
         fixes in iconedit and calendar from DedOK
         new algoritm of fill background in pic4
         all apps (fasm-writen only) rewriten to use common macros.inc for easy recompile in fastcall mode (there is a bug in https; run need rewrite to use common macros.inc)
         small fixes in build_all.bat script
         

git-svn-id: svn://kolibrios.org@485 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
heavyiron 2007-05-10 13:48:35 +00:00
parent 0f7aa4d574
commit 4daae89053
545 changed files with 31819 additions and 34012 deletions

View File

@ -502,10 +502,7 @@
‚®§Άΰ ι ¥¬®¥ §­ η¥­¨¥:
* δγ­<CEB3>ζ¨ο ­¥ Ά®§Άΰ ι ¥β §­ η¥­¨ο
‡ ¬¥η ­¨ο:
* <20>஢¥à®ª ­  ª®à४⭮áâì ­¥ ¤¥« ¥âáï. “áâ ­®¢ª  ᫨誮¬ ¡®«ìè¨å
§­ ç¥­¨© ¯à¨¢¥¤ñâ ª ⮬ã, çâ® ¢ ä®­ ¢®©¤ãâ ¤ ­­ë¥ §  £à ­¨æ¥©
¡ãä¥à  ä®­®¢®£® ¨§®¡à ¦¥­¨ï. <20> §¬¥à ¡ãä¥à  = 0x160000-0x10, çâ®
ᮮ⢥âáâ¢ã¥â ¬ ªá¨¬ «ì­ë¬ à §¬¥à ¬ 800*600. (800*600*3=0x15F900)
* ‚맮¢ ä㭪樨 ®¡ï§ â¥«¥­ ¯¥à¥¤ ¢ë§®¢®¬ ä㭪権 15.2 ¨ 15.5
* „«ο ®΅­®Ά«¥­¨ο ν<>ΰ ­  (―®α«¥ § Ά¥ΰθ¥­¨ο α¥ΰ¨¨ <20>®¬ ­¤, ΰ ΅®β ξι¨ε α
δ®­®¬) Άλ§λΆ ©β¥ ―®¤δγ­<CEB3>ζ¨ξ 3 ―¥ΰ¥ΰ¨α®Ά<C2AE>¨ δ®­ .
* …αβμ ― ΰ­ ο δγ­<CEB3>ζ¨ο ―®«γη¥­¨ο ΰ §¬¥ΰ®Ά δ®­®Ά®£® ¨§®΅ΰ ¦¥­¨ο -
@ -524,8 +521,8 @@
‡ ¬¥η ­¨ο:
* ‘¬¥ι¥­¨¥ ¤«ο β®η<C2AE>¨ α <20>®®ΰ¤¨­ β ¬¨ (x,y) Άλη¨α«ο¥βαο <20> <EFBFBD>
(x+y*xsize)*3.
* …᫨ 㪠§ ­­®¥ ᬥ饭¨¥ ¯à¥¢ëè ¥â 0x160000-16 =
1.375 Mb - 16 bytes, ¢ë§®¢ ¨£­®à¨àã¥âáï.
* …᫨ 㪠§ ­­®¥ ᬥ饭¨¥ ¯à¥¢ëè ¥â ãáâ ­®¢«¥­­ë© ä㭪樥© 15.1 à §¬¥à,
¢ë§®¢ ¨£­®à¨àã¥âáï.
* „«ο ®΅­®Ά«¥­¨ο ν<>ΰ ­  (―®α«¥ § Ά¥ΰθ¥­¨ο α¥ΰ¨¨ <20>®¬ ­¤, ΰ ΅®β ξι¨ε α
δ®­®¬) Άλ§λΆ ©β¥ ―®¤δγ­<CEB3>ζ¨ξ 3 ―¥ΰ¥ΰ¨α®Ά<C2AE>¨ δ®­ .
* …αβμ ― ΰ­ ο δγ­<CEB3>ζ¨ο ―®«γη¥­¨ο β®η<C2AE>¨ α δ®­®Ά®£® ¨§®΅ΰ ¦¥­¨ο -
@ -569,8 +566,8 @@
‚®§Άΰ ι ¥¬®¥ §­ η¥­¨¥:
* δγ­<CEB3>ζ¨ο ­¥ Ά®§Άΰ ι ¥β §­ η¥­¨ο
‡ ¬¥η ­¨ο:
* …᫨ ¡«®ª ¢ë«¥§ ¥â §  £à ­¨æã 0x160000-16 = 1.375 Mb - 16 bytes,
â® ¢ë§®¢ ¨£­®à¨àã¥âáï.
* …᫨ 㪠§ ­­®¥ ᬥ饭¨¥ ¯à¥¢ëè ¥â ãáâ ­®¢«¥­­ë© ä㭪樥© 15.1 à §¬¥à,
¢ë§®¢ ¨£­®à¨àã¥âáï.
* –Ά¥β <20> ¦¤®£® ―¨<E28095>ᥫο εΰ ­¨βαο <20> <EFBFBD> 3-΅ ©β­ ο Ά¥«¨η¨­  BBGGRR.
* <20>¨<EFBFBD>ᥫ¨ δ®­®Ά®£® ¨§®΅ΰ ¦¥­¨ο § ―¨αλΆ ξβαο ―®α«¥¤®Ά β¥«μ­®
α«¥Ά  ­ ―ΰ Ά®, αΆ¥ΰεγ Ά­¨§.

View File

@ -493,10 +493,8 @@ Parameters:
Returned value:
* function does not return value
Remarks:
* There is no checks for correctness. The setting of too large
values will result that the background will contain data abroad
of buffer for the background image. Buffer size = 0x160000-0x10,
that corresponds to maximum size 800*600. (800*600*3=0x15F900)
* Before calling functions 15.2 and 15.5 you should call this function
to set image size!
* For update of the screen (after completion of a series of commands
working with a background) call subfunction 3.
* There is a pair function for get size of the background image -
@ -515,7 +513,7 @@ Returned value:
Remarks:
* Offset for a pixel with coordinates (x,y) is calculated as
(x+y*xsize)*3.
* If the given offset exceeds 0x160000-16 = 1.375 Mb - 16 bytes,
* If the given offset exceeds size sets by function 15.1,
the call is ignored.
* For update of the screen (after completion of a series of commands
working with a background) call subfunction 3.
@ -561,7 +559,7 @@ Parameters:
Returned value:
* function does not return value
Remarks:
* If the block gets out abroad 0x160000-16 = 1.375 Mb - 16 bytes,
* If the block gets out abroad size sets by function 15.1,
the call is ignored.
* Color of each pixel is stored as 3-bytes value BBGGRR.
* Pixels of the background image are written sequentially

View File

@ -2363,7 +2363,7 @@ sys_background:
cmp eax,2 ; SET PIXEL
jnz nosb2
mov edx,0x160000-16
mov edx,[mem_BACKGROUND]
cmp edx,ebx
jbe nosb2
mov edx,[ebx]
@ -3221,12 +3221,7 @@ sys_window_move:
mov [MOUSE_BACKGROUND],byte 0 ; no mouse under
mov [MOUSE_DOWN],byte 0 ; react to mouse up/down
mov ecx,10 ; wait 1/10 second
.wmrl3:
call [draw_pointer]
mov eax,1
call delay_hs
loop .wmrl3
mov [window_move_pr],0
@ -3234,23 +3229,6 @@ sys_window_move:
ret
;type_background_1:
; cmp [0xfff0],byte 0 ; background update ?
; jz temp_nobackgr
; mov [0xfff0],byte 2
; call change_task
; mov [draw_data+32+0],dword 0
; mov [draw_data+32+4],dword 0
; mov eax,[ScreenWidth
; mov ebx,[0xfe04]
; mov [draw_data+32+8],eax
; mov [draw_data+32+12],ebx
; call drawbackground
; mov [0xfff0],byte 0
; mov [MOUSE_BACKGROUND],byte 0
;temp_nobackgr:
; ret
uglobal
window_move_pr dd 0x0
window_move_eax dd 0x0

View File

@ -1,6 +1,7 @@
@echo off
set languages=en ru ge et
set __CPU_type=p5 p6 k6
set kpack=y n
cls
echo Build KolibriOS apps
@ -12,6 +13,14 @@ set /P res=">
@erase lang.inc
echo lang fix %res% > lang.inc
echo Enter CPU_type ("p5" for interrupt, "p6" for SYSENTER, "k6" for SYSCALL)
set /p res=">
@erase config.inc
echo __CPU_type fix %res% > config.inc
if not exist bin mkdir bin
if not exist bin\demos mkdir bin\demos
if not exist bin\develop mkdir bin\develop
@ -35,6 +44,7 @@ echo *
@fasm system\kbd\trunk\kbd.ASM bin\kbd
@fasm system\launcher\trunk\launcher.asm bin\launcher
@fasm system\menu\trunk\menu.asm bin\@menu
@fasm system\mgb\trunk\mgb.asm bin\mgb
@fasm system\PANEL\trunk\@PANEL.ASM bin\@PANEL
@fasm system\pcidev\trunk\pcidev.asm bin\pcidev
@fasm system\RB\trunk\@RB.ASM bin\@RB
@ -77,10 +87,12 @@ echo *
@fasm network\dhcp\trunk\dhcp.asm bin\network\dhcp
@fasm network\dnsr\trunk\dnsr.asm bin\network\dnsr
@fasm network\ethstat\trunk\ethstat.asm bin\network\ethstat
@fasm network\ftps\trunk\https.asm bin\network\ftps
@fasm network\httpc\trunk\httpc.asm bin\network\httpc
@fasm network\https\trunk\https.asm bin\network\https
@fasm network\ipc\trunk\ipc.asm bin\network\ipc
@fasm network\local\trunk\local.asm bin\network\local
@fasm network\mp3s\trunk\mp3s.asm bin\network\mp3s
@fasm network\netsendc\trunk\netsendc.asm bin\network\netsendc
@fasm network\netsends\trunk\netsends.asm bin\network\netsends
@fasm network\nntpc\trunk\nntpc.asm bin\network\nntpc
@ -119,7 +131,7 @@ rem media\ac97snd\trunk\ac97snd.asm ac97snd
@fasm media\midamp\trunk\midamp.asm bin\midamp
@fasm media\midiplay\trunk\midiplay.asm bin\midiplay
@fasm media\mixer\trunk\mixer.asm bin\mixer
@fasm media\mp3s\trunk\mp3s.asm bin\mp3s
@fasm media\mv\trunk\mv.asm bin\mv
@fasm media\pic4\trunk\pic4.asm bin\pic4
@fasm media\sb\trunk\sb.asm bin\sb
@ -143,6 +155,7 @@ cd ..\..\..
@fasm games\pong3\trunk\pong3.asm bin\games\pong3
@fasm games\tanks\trunk\tanks.asm bin\games\tanks
@fasm games\tetris\trunk\tetris.asm bin\games\tetris
rem @fasm games\hunter\trunk\hunter.asm bin\games\hunter
echo *
echo Building demos
@ -200,6 +213,7 @@ echo *
@kpack bin\kbd
@kpack bin\launcher
@kpack bin\menu
@kpack bin\mgb
@kpack bin\@PANEL
@kpack bin\pcidev
@kpack bin\@RB

1
programs/config.inc Normal file
View File

@ -0,0 +1 @@
__CPU_type fix p5

View File

@ -24,20 +24,17 @@ SCREEN_X equ 320
SCREEN_Y equ 200
include 'lang.inc'
include '..\..\..\macros.inc'
include 'ascl.inc'
include 'ascgl.inc'
include 'macros.inc'
START:
call draw_window
call init_sin_cos
still:
; mov eax,23 ; wait for system event with 10 ms timeout
; mov ebx,1 ; wait 10 ms, then continue
; int 0x40
mov eax,11
int 0x40
mcall
dec eax
; cmp eax,1 ; window redraw request ?
@ -84,36 +81,36 @@ red:
jmp still
key:
mov eax,2
int 0x40
mcall
jmp still
button:
mov eax,17
int 0x40
mcall
cmp ah,1
jne still
exit:
mov eax,-1
int 0x40
mcall
;Draw window
draw_window:
mov eax,12 ;Start
mov ebx,1
int 0x40
mcall
mov eax,0 ;Draw window
mov ebx,100*65536+(SCREEN_X+9) ;x start*65536+x size
mov ecx,100*65536+(SCREEN_Y+26) ;y start*65536+y size
mov edx,0x13000000 ;0x03 use skinned window
mov edi,header
int 0x40
mov edi,title
mcall
mov eax,12 ;End
mov ebx,2
int 0x40
mcall
ret
header db '3D TEST SAMPLE FOR MENUETOS',0
title db '3D TEST SAMPLE FOR MENUETOS',0
; Draw faces procedure
@ -182,7 +179,7 @@ clear_screen_buffer:
mov ecx,SCREEN_X*65536+SCREEN_Y
mov edx,5*65536+22
mov ax,7
int 0x40
mcall
;White background
mov edi,scrbuf
@ -578,7 +575,7 @@ translate_points:
pushad
mov eax,37
mov ebx,1
int 0x40
mcall
mov ebx,eax
shr eax,16
and ebx,0xffff

View File

@ -33,7 +33,7 @@ macro drawfbox x,y,xs,ys,color
add ecx,ys
mov edx,color
mov eax,13
int 0x40
mcall
}
; FPS - Set Frame Per Second Display
@ -50,7 +50,7 @@ ttt dd 0
spdat:
get_time:
mov eax,3
int 0x40
mcall
cmp eax,[savetime]
jne new_time
inc [fps_cntr]
@ -69,7 +69,7 @@ if ~(delcolor eq )
mov ecx,y*65536+7
mov edx,delcolor
mov eax,13
int 0x40
mcall
end if
mov dword [ttt],fps_show_frequency
mov eax,47
@ -78,7 +78,7 @@ end if
mov edx,x*65536+y
mov esi,color
mov ecx,[fps]
int 0x40
mcall
no_out_fps:
}
@ -153,7 +153,7 @@ else
shl edx,16
add edx,arg2
end if
int 0x40
mcall
nodi:
}
@ -173,7 +173,7 @@ else
shl edx,16
add edx,arg2
end if
int 0x40
mcall
}
;Not optimiz
@ -451,14 +451,14 @@ local noaddword
mov dword [fileinfo+8],1 ; how many blocks to read (1)
mov eax,58
mov ebx,fileinfo
int 0x40
mcall
mov eax,[bmp_load_area+2]
shr eax,9 ; ŻŽ¤ĽŤ¨Ź ­  512 ¨ Żŕ¨Ą ˘¨Ź 1 - ŻŽŤă稏 ç¨áŤŽ ĄŤŽŞŽ˘
inc eax
mov dword [fileinfo+8],eax
mov eax,58
mov ebx,fileinfo
int 0x40
mcall
; jmp qwe
;bmpfn db bmp_file_name
@ -469,7 +469,7 @@ local noaddword
; mov edx,0xFFFFFF
; mov esi,bmp_load_area
; mov edi,0
; int 0x40
; mcall
; convert:
movzx eax,word [bmp_load_area+28]

View File

@ -36,9 +36,9 @@ incf:
mov eax,6
mov ebx,clip_file
mov ecx,0
mov edx,-1
or edx,-1
mov esi,path
int 0x40
mcall
cmp byte [clip_file+7],'Z'
je erroff
cmp eax,0xffffffff
@ -54,12 +54,12 @@ zzz2:
mov edx,100
mov esi,0
mov eax,33
int 0x40
mcall
mov ebx,dlg_file
mov ecx,clip_file
mov eax,19
int 0x40
mcall
still:
scevent red,key,button
@ -72,7 +72,7 @@ still:
mov ecx,0
mov edx,-1
mov esi,path
int 0x40
mcall
cmp eax,0xffffffff
je erroff ;errexit
mov dword [redwait],0
@ -84,19 +84,19 @@ zzz:
file_is_open:
mov eax,32
mov ebx,clip_file
int 0x40
mcall
jmp openoff
key: ; key
int 0x40 ; read (eax=2)
mcall ; read (eax=2)
jmp still
button: ; button
mov eax,17 ; get id
int 0x40
mcall
cmp ah,1 ; button id=1 ?
jne still
mov eax,-1 ; close this program
int 0x40
mcall
red:
call redproc
@ -127,7 +127,7 @@ incf:
mov ecx,0
mov edx,-1
mov esi,path
int 0x40
mcall
cmp byte [clip_file+7],'Z'
je erroff
cmp eax,0xffffffff
@ -143,12 +143,12 @@ zzz2:
mov edx,100
mov esi,0
mov eax,33
int 0x40
mcall
mov ebx,dlg_file
mov ecx,clip_file
mov eax,19
int 0x40
mcall
still:
scevent red,key,button
@ -161,7 +161,7 @@ still:
mov ecx,0
mov edx,-1
mov esi,path
int 0x40
mcall
cmp eax,0xffffffff
je erroff ;errexit
mov dword [redwait],0
@ -173,19 +173,19 @@ zzz:
file_is_open:
mov eax,32
mov ebx,clip_file
int 0x40
mcall
jmp openoff
key: ; key
int 0x40 ; read (eax=2)
mcall ; read (eax=2)
jmp still
button: ; button
mov eax,17 ; get id
int 0x40
mcall
cmp ah,1 ; button id=1 ?
jne still
mov eax,-1 ; close this program
int 0x40
mcall
red:
call redproc
@ -272,7 +272,7 @@ rxproc:
macro scank
{
mov eax,10
int 0x40
mcall
}
macro putpix x,y,color
@ -281,7 +281,7 @@ macro putpix x,y,color
mov ecx,y
mov edx,color
mov eax,1
int 0x40
mcall
}
macro puttxt x,y,offs,size,color
@ -293,7 +293,7 @@ macro puttxt x,y,offs,size,color
mov edx,offs
mov esi,size
mov eax,4
int 0x40
mcall
}
;_ equ '____'
@ -306,7 +306,7 @@ macro puttxt x,y,offs,size,color
; mov ecx,y
; mov edx,color
; mov eax,1
; int 0x40
; mcall
;}
@ -318,7 +318,7 @@ macro outcount data, x, y, color, numtype
mov edx,x*65536+y
mov esi,color
mov eax,47
int 0x40
mcall
}
; SCEVENT - Scan event
@ -326,7 +326,7 @@ macro outcount data, x, y, color, numtype
macro scevent red,key,but
{
mov eax,11
int 0x40
mcall
dec eax
jz red
dec eax
@ -340,7 +340,7 @@ macro scevent red,key,but
macro wtevent red,key,but
{
mov eax,10
int 0x40
mcall
dec eax
jz red
dec eax
@ -355,7 +355,7 @@ macro timeevent xfps,noevent,red,key,but
{
mov eax,23
mov ebx,xfps
int 0x40
mcall
cmp eax,0
je noevent
dec eax
@ -372,7 +372,7 @@ macro timeevent xfps,noevent,red,key,but
macro close
{
mov eax,-1
int 0x40
mcall
}
; DELAY - Create delay 1/100 sec
@ -383,7 +383,7 @@ macro delay arg1
{
mov eax,5
mov ebx,arg1
int 0x40
mcall
}
; WINDOW - Draw window
@ -396,7 +396,7 @@ macro window arg1,arg2,arg3,arg4,arg5
mov ecx,arg2*65536+arg4
mov edx,arg5
mov eax,0
int 0x40
mcall
}
macro colorwindow arg1,arg2,arg3,arg4,arg5,arg6,arg7
@ -407,7 +407,7 @@ macro colorwindow arg1,arg2,arg3,arg4,arg5,arg6,arg7
mov esi,arg6
mov edi,arg7
mov eax,0
int 0x40
mcall
}
@ -417,7 +417,7 @@ macro startwd
{
mov eax,12
mov ebx,1
int 0x40
mcall
}
; ENDWD - End window draw
@ -426,7 +426,7 @@ macro endwd
{
mov eax,12
mov ebx,2
int 0x40
mcall
}
; LABEL - Put text to frame
@ -446,7 +446,7 @@ asd:
mov edx,lab
mov esi,asd-lab ;calc size
mov eax,4
int 0x40
mcall
}
;Key's

View File

@ -1,4 +1,5 @@
@erase lang.inc
@echo lang fix en >lang.inc
@fasm 3dcube2.asm 3dcube2
@erase lang.inc
@pause

View File

@ -1,4 +1,5 @@
@erase lang.inc
@echo lang fix ru >lang.inc
@fasm 3dcube2.asm 3dcube2
@erase lang.inc
@pause

View File

@ -1,269 +0,0 @@
; new application structure
macro meos_app_start
{
use32
org 0x0
db 'MENUET01'
dd 0x01
dd __start
dd __end
dd __memory
dd __stack
if used __params & ~defined __params
dd __params
else
dd 0x0
end if
dd 0x0
}
MEOS_APP_START fix meos_app_start
macro code
{
__start:
}
CODE fix code
macro data
{
__data:
}
DATA fix data
macro udata
{
if used __params & ~defined __params
__params:
db 0
__end:
rb 255
else
__end:
end if
__udata:
}
UDATA fix udata
macro meos_app_end
{
align 32
rb 2048
__stack:
__memory:
}
MEOS_APP_END fix meos_app_end
; macro for defining multiline text data
struc mstr [sstring]
{
forward
local ssize
virtual at 0
db sstring
ssize = $
end virtual
dd ssize
db sstring
common
dd -1
}
; strings
macro sz name,[data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if used name
db data
end if
common
if used name
.size = $-name
end if
}
macro lsz name,[lng,data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if (used name)&(lang eq lng)
db data
end if
common
if used name
.size = $-name
end if
}
; easy system call macro
macro mpack dest, hsrc, lsrc
{
if (hsrc eqtype 0) & (lsrc eqtype 0)
mov dest, (hsrc) shl 16 + lsrc
else
if (hsrc eqtype 0) & (~lsrc eqtype 0)
mov dest, (hsrc) shl 16
add dest, lsrc
else
mov dest, hsrc
shl dest, 16
add dest, lsrc
end if
end if
}
macro __mov reg,a,b { ; mike.dld
if (~a eq)&(~b eq)
mpack reg,a,b
else if (~a eq)&(b eq)
mov reg,a
end if
}
macro mcall a,b,c,d,e,f { ; mike.dld
__mov eax,a
__mov ebx,b
__mov ecx,c
__mov edx,d
__mov esi,e
__mov edi,f
int 0x40
}
; optimize the code for size
__regs fix <eax,ebx,ecx,edx,esi,edi,ebp,esp>
macro add arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
inc arg1
else
add arg1,arg2
end if
else
add arg1,arg2
end if
}
macro sub arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
dec arg1
else
sub arg1,arg2
end if
else
sub arg1,arg2
end if
}
macro mov arg1,arg2
{
if (arg1 in __regs) & ((arg2 eqtype 0) | (arg2 eqtype '0'))
if (arg2) = 0
xor arg1,arg1
else if (arg2) = 1
xor arg1,arg1
inc arg1
else if (arg2) = -1
or arg1,-1
else if (arg2) > -128 & (arg2) < 128
push arg2
pop arg1
else
mov arg1,arg2
end if
else
mov arg1,arg2
end if
}
macro struct name
{
virtual at 0
name name
sizeof.#name = $ - name
end virtual
}
; structures used in MeOS
struc process_information
{
.cpu_usage dd ? ; +0
.window_stack_position dw ? ; +4
.window_stack_value dw ? ; +6
.not_used1 dw ? ; +8
.process_name rb 12 ; +10
.memory_start dd ? ; +22
.used_memory dd ? ; +26
.PID dd ? ; +30
.x_start dd ? ; +34
.y_start dd ? ; +38
.x_size dd ? ; +42
.y_size dd ? ; +46
.slot_state dw ? ; +50
dw ? ; +52 - reserved
.client_left dd ? ; +54
.client_top dd ? ; +58
.client_width dd ? ; +62
.client_height dd ? ; +66
.wnd_state db ? ; +70
rb (1024-71)
}
struct process_information
struc system_colors
{
.frame dd ?
.grab dd ?
.grab_button dd ?
.grab_button_text dd ?
.grab_text dd ?
.work dd ?
.work_button dd ?
.work_button_text dd ?
.work_text dd ?
.work_graph dd ?
}
struct system_colors
; constants
; events
EV_IDLE = 0
EV_TIMER = 0
EV_REDRAW = 1
EV_KEY = 2
EV_BUTTON = 3
EV_EXIT = 4
EV_BACKGROUND = 5
EV_MOUSE = 6
EV_IPC = 7
EV_STACK = 8
; event mask bits for function 40
EVM_REDRAW = 1b
EVM_KEY = 10b
EVM_BUTTON = 100b
EVM_EXIT = 1000b
EVM_BACKGROUND = 10000b
EVM_MOUSE = 100000b
EVM_IPC = 1000000b
EVM_STACK = 10000000b

View File

@ -61,6 +61,7 @@ MAP_YSIZE equ 128
dd 0x0 , 0x0 ; I_Param , I_Icon
include 'lang.inc'
include '..\..\..\macros.inc'
include 'ascgl.inc'
include 'ascl.inc'
@ -271,13 +272,13 @@ skip_texgen:
mov eax,66
mov ebx,1
mov ecx,1
int 0x40
mcall
mov eax,26
mov ebx,2
mov ecx,1
mov edx,keymap+100
int 0x40
mcall
;Build triangle matrix
mov esi,points
@ -384,7 +385,7 @@ skip_moddata:
;Main loop
still: ; ®á­®¢­®© 横«
mov eax,11 ; ¯à®¢¥àª  á®áâ®ï­¨ï ®ª­ 
int 0x40
mcall
cmp eax,1 ; ®ª­® ᤢ¨­ã«¨ ¥£® ­ã¦­® ¯¥à¥à¨á®¢ âì
je red
@ -490,16 +491,16 @@ ndt:
mov ecx,0x0000ff00 ; font 1 & color ( 0xF0RRGGBB )
mov edx,keymap ; pointer to text beginning
mov esi,100 ; text length
int 0x40
mcall
add edx,100
add ebx,10
mov esi,60 ; text length
mov ecx,0x00dddddd ; font 1 & color ( 0xF0RRGGBB )
int 0x40
mcall
mov edx,usemap
mov esi,60 ; text length
mov ecx,0x0000ff00
int 0x40
mcall
jmp rx
;01234567890123456789012345678901234567890123456789
usemap db ' E wer u [] asd zxc '
@ -721,7 +722,7 @@ ok4:
key: ; key
mov eax,2 ; just read it and ignore
int 0x40
mcall
shr eax,8
and eax,0xff
@ -747,14 +748,14 @@ noisa:
button: ; button
mov eax,17 ; get id
int 0x40
mcall
cmp ah,1
jz exit
jmp cycle
exit:
mov eax,-1
int 0x40
or eax,-1
mcall
; *********************************************
; ******* WINDOW DEFINITIONS AND DRAW ********
@ -763,7 +764,7 @@ exit:
draw_window:
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,1 ; 1, start of draw
int 0x40
mcall
; DRAW WINDOW
mov eax,0 ; function 0 : define and draw window
mov ebx,0*65536+SCREEN_X-1 ; [x start] *65536 + [x size]
@ -771,18 +772,18 @@ draw_window:
mov edx,0x03ffffff ; color of work area RRGGBB,8->color gl
mov esi,0x005080d0 ; color of grab bar RRGGBB,8->color gl
mov edi,0x005080d0 ; color of frames RRGGBB
int 0x40
mcall
; WINDOW LABEL
mov eax,4 ; function 4 : write text to window
mov ebx,8*65536+8 ; [x start] *65536 + [y start]
mov ecx,0x10ddeeff ; font 1 & color ( 0xF0RRGGBB )
mov edx,labelt ; pointer to text beginning
mov esi,labellen-labelt ; text length
int 0x40
mcall
mov eax,12
mov ebx,2
int 0x40
mcall
ret
dispimg:
@ -790,7 +791,7 @@ dispimg:
mov ebx,I_END ;zbuffer
mov ecx,SCREEN_X*65536+SCREEN_Y
xor edx,edx ;0*65536+0
int 0x40
mcall
; ret
mov eax,8
@ -798,7 +799,7 @@ dispimg:
mov ecx,10*65536+20
mov edx,1
mov esi,0x0000aa00
int 0x40
mcall
ret
clrscr: ; clear screen buffer

View File

@ -20,8 +20,8 @@ lang equ ru
;0.07 convbmp ~13.05.2004
;0.08 fps ~14.05.2004
;0.09 drawfbox ~03.06.2004
;0.10 all macros optimized by Halyavin A., add at ~07.06.2004
;0.11 many macros optimized by Halyavin A., add at ~30.08.2004
;0.10 all macros optimized by halyavin, add at ~07.06.2004
;0.11 many macros optimized by halyavin, add at ~30.08.2004
;0.12 bmptoimg ~07.09.2004
;0.13 imgtoimg ~08.09.2004
;0.14 imgtoimg modify not brake bmp pict! ~09.09.2004
@ -369,11 +369,11 @@ end if
;DrawBox
macro drawfbox x,y,xs,ys,color
{
words2reg ebx,x,xs ;x*65536+xs
words2reg ecx,y,ys ;y*65536+ys
wordstoreg ebx,x,xs ;x*65536+xs
wordstoreg ecx,y,ys ;y*65536+ys
mov edx,color
mov eax,13
int 0x40
mcall
}
; FPS - Set Frame Per Second Display
@ -390,7 +390,7 @@ ttt dd 0
spdat:
get_time:
mov eax,3
int 0x40
mcall
cmp eax,[savetime]
jne new_time
inc [fps_cntr]
@ -405,20 +405,20 @@ new_time:
mov [fps_cntr],0
out_fps:
if ~(delcolor eq )
mov ebx,x*65536+36
mov ebx,x*65536+30
mov ecx,y*65536+7
mov edx,delcolor
mov eax,13
int 0x40
mcall
end if
mov dword [ttt],fps_show_frequency
mov eax,47
mov ebx,6*65536
mov ebx,5*65536
; mov bl,0
mov edx,x*65536+y
mov esi,color
mov ecx,[fps]
int 0x40
mcall
no_out_fps:
}
@ -495,8 +495,8 @@ macro setimg x , y ,arg3
shl ecx,16
add cx,[arg3+4]
; wordstoreg ecx,[arg3],[arg3+4]
words2reg edx, x , y ;arg1*65536+arg2
int 0x40
wordstoreg edx, x , y ;arg1*65536+arg2
mcall
}
macro setframe x , y ,arg3
@ -504,10 +504,10 @@ macro setframe x , y ,arg3
mov eax,7
mov ebx,arg3
add ebx,8
words2reg edx, x , y ;arg1*65536+arg2
wordstoreg edx, x , y ;arg1*65536+arg2
add edx,dword [arg3]
mov ecx,dword [arg3+4]
int 0x40
mcall
}
@ -1101,7 +1101,7 @@ local notintable, er, zend, nxt, continue, ex, Gif_skipmap
local Gif_get_sym, shift, nextbl, noblock, loop1, exx
local Gif_output, next, loop2
_null equ 0x1000 ; 0x1000
_null fix 0x1000 ; 0x1000
mov esi,gifsrc ;“ª § â¥«ì ­  ƒˆ” ä ¨« ¢ ¯ ¬ïâ¨
mov edi,imgsrc ;“ª § â¥«ì ­  ᯨ᮪ ª à⨭®ª

View File

@ -27,13 +27,11 @@ lang equ ru ; ru en fr ge fi
;0.12 open/save dialog ~13.09.2004
;0.13 dialogs bugs deleted
;0.14 drawlbut ~03.10.2004
;0.15 extendet label!
; LOADFILE
; (SYNTAX) LOADFILE 'full_path_to_file',file_load_area,file_temp_area
; (SAMPLE) LOADFILE '/rd/1/clock.bmp',load_area,temp_area
macro loadfile file_name,file_load_area,file_temp_area
{
local open,fileinfo,string
@ -50,85 +48,35 @@ open:
mov dword [fileinfo+8],1 ; how many blocks to read (1)
mov eax,58
mov ebx,fileinfo
int 0x40
mcall
mov eax,[file_load_area+2]
shr eax,9 ; ¯®¤¥«¨¬ ­  512 ¨ ¯à¨¡ ¢¨¬ 1 - ¯®«ã稬 ç¨á«® ¡«®ª®¢
inc eax
mov dword [fileinfo+8],eax
mov eax,58
mov ebx,fileinfo
int 0x40
mcall
}
;macro wordstoreg reg,hiword,loword
;{
;if hiword eqtype 0 & loword eqtype 0
; mov reg,dword hiword*65536+loword
;else if hiword eqtype 12 & loword eqtype eax
; mov reg,dword hiword*65536
; add reg,dword loword
;else if hiword eqtype 12 & loword eqtype [123]
; mov reg,dword hiword*65536
; add reg,dword loword
;else
; mov reg,dword hiword
; shl reg,16
; add reg,dword loword
;end if
;}
macro dword2reg reg,doubleword
macro wordstoreg reg,hiword,loword
{
if doubleword eq
; not changes
if hiword eqtype 0 & loword eqtype 0
mov reg,(hiword)*65536+(loword)
else if hiword eqtype 12 & loword eqtype eax
mov reg,(hiword)*65536
add reg,loword
else if hiword eqtype 0 & loword eqtype [123]
mov reg,(hiword)*65536
add reg,loword
else if (hiword eq ) & (loword eq )
else
mov reg,dword doubleword
mov reg,hiword
shl reg,16
add reg,loword
end if
}
macro words2reg reg,hiword,lowword
{
if hiword eq
if lowword eq
; not changes
else
if lowword eqtype 12
and reg,dword 0xffff0000
add reg,dword lowword
else
and reg,dword 0xffff0000
add reg,dword lowword
end if
end if
else
if lowword eq
if hiword eqtype 12
and reg,dword 0x0000ffff
add reg,dword hiword*65536
else
shl reg,16
add reg,dword hiword
ror reg,16
end if
else
if lowword eqtype 12 & hiword eqtype 12
if lowword eq 0 & hiword eq 0
xor reg,reg
else
mov reg,dword hiword*65536+lowword
end if
else
mov reg,dword hiword
shl reg,16
add reg,dword lowword
end if
end if
end if
}
; DRAW BUTTON with label
@ -138,12 +86,12 @@ local asd,lab
jmp asd
lab db text ;arg label
asd:
words2reg ebx,x,xs
words2reg ecx,y,ys
wordstoreg ebx,x,xs
wordstoreg ecx,y,ys
mov edx,id
mov esi,bcolor
mov eax,8
int 0x40
mcall
mov eax,asd-lab ;calc size
mov ebx,6
@ -168,7 +116,7 @@ asd:
mov edx,lab
mov esi,asd-lab ;calc size
mov eax,4
int 0x40
mcall
}
@ -197,7 +145,7 @@ mov [dlg_pid_get],0
mov eax,9
mov ebx,procinfo
mov ecx,-1
int 0x40
mcall
; convert eax bin to param dec
mov eax,dword [procinfo+30] ;offset of myPID
@ -231,12 +179,12 @@ new_d:
mov ebx,1 ; define IPC
mov ecx,path ; offset of area
mov edx,150 ; size 150 bytes
int 0x40
mcall
; change wanted events list 7-bit IPC event
mov eax,40
mov ebx,01000111b
int 0x40
mcall
;
; STEP 3 run SYSTEM XTREE with parameters
@ -244,7 +192,7 @@ new_d:
mov eax,58
mov ebx,run_fileinfo
int 0x40
mcall
call redproc
@ -252,7 +200,7 @@ new_d:
getmesloop:
mov eax,23
mov ebx,50 ;0.5 sec
int 0x40
mcall
cmp eax,1
je mred
@ -267,14 +215,14 @@ getmesloop:
mov ebx,procinfo
mov ecx,-1
mov eax,9
int 0x40
mcall
mov ebp,eax
loox:
mov eax,9
mov ebx,procinfo
mov ecx,ebp
int 0x40
mcall
mov eax,[DLGPID]
cmp [procinfo+30],eax ;IF Dialog find
je dlg_is_work ;jmp to dlg_is_work
@ -299,15 +247,15 @@ mred:
jmp getmesloop
mkey:
mov eax,2
int 0x40 ; read (eax=2)
mcall ; read (eax=2)
jmp getmesloop
mbutton:
mov eax,17 ; get id
int 0x40
mcall
cmp ah,1 ; button id=1 ?
jne getmesloop
mov eax,-1 ; close this program
int 0x40
mcall
mgetmes:
; If dlg_pid_get then second message get jmp to still
@ -380,7 +328,7 @@ run_fileinfo:
db '/RD/1/SYSXTREE',0
procinfo:
times 1024 db 0
times 256 db 0
}
@ -409,7 +357,7 @@ mov [dlg_pid_get],0
mov eax,9
mov ebx,procinfo
mov ecx,-1
int 0x40
mcall
; convert eax bin to param dec
mov eax,dword [procinfo+30] ;offset of myPID
@ -442,13 +390,13 @@ new_d:
mov eax,60
mov ebx,1 ; define IPC
mov ecx,path ; offset of area
mov edx,150 ; size 150 bytes
int 0x40
mov edx,120 ; size 150 bytes
mcall
; change wanted events list 7-bit IPC event
mov eax,40
mov ebx,01000111b
int 0x40
mcall
;
; STEP 3 run SYSTEM XTREE with parameters
@ -456,7 +404,7 @@ new_d:
mov eax,58
mov ebx,run_fileinfo
int 0x40
mcall
call redproc
@ -464,7 +412,7 @@ new_d:
getmesloop:
mov eax,23
mov ebx,50 ;0.5 sec
int 0x40
mcall
cmp eax,1
je mred
@ -479,14 +427,14 @@ getmesloop:
mov ebx,procinfo
mov ecx,-1
mov eax,9
int 0x40
mcall
mov ebp,eax
loox:
mov eax,9
mov ebx,procinfo
mov ecx,ebp
int 0x40
mcall
mov eax,[DLGPID]
cmp [procinfo+30],eax ;IF Dialog find
je dlg_is_work ;jmp to dlg_is_work
@ -510,16 +458,15 @@ mred:
call redproc
jmp getmesloop
mkey:
mov eax,2
int 0x40 ; read (eax=2)
mcall ; read (eax=2)
jmp getmesloop
mbutton:
mov eax,17 ; get id
int 0x40
mcall
cmp ah,1 ; button id=1 ?
jne getmesloop
mov eax,-1 ; close this program
int 0x40
mcall
mgetmes:
; If dlg_pid_get then second message get jmp to still
@ -579,8 +526,8 @@ dlg_pid_get dd 0
DLGPID dd 0
param:
dd 0 ; My dec PID
dd 0,0 ; Type of dialog
rb 4 ; My dec PID
rb 6 ; Type of dialog
run_fileinfo:
dd 16
@ -588,11 +535,11 @@ run_fileinfo:
dd param
dd 0
dd procinfo
;run_filepath:
run_filepath:
db '/RD/1/SYSXTREE',0
procinfo:
times 1024 db 0
times 256 db 0
}
@ -671,7 +618,7 @@ rxproc:
macro scank
{
mov eax,10
int 0x40
mcall
}
macro putpix x,y,color
@ -680,7 +627,7 @@ macro putpix x,y,color
mov ecx,y
mov edx,color
mov eax,1
int 0x40
mcall
}
macro puttxt x,y,offs,size,color
@ -688,17 +635,12 @@ macro puttxt x,y,offs,size,color
; mov ebx,x
; shl ebx,16
; add ebx,y
words2reg ebx,x,y
dword2reg ecx,color
dword2reg edx,offs
dword2reg esi,size
; mov ecx,color
; mov edx,offs
; mov esi,size
wordstoreg ebx,x,y
mov ecx,color
mov edx,offs
mov esi,size
mov eax,4
int 0x40
mcall
}
macro outcount data, x, y, color, numtype
@ -707,10 +649,10 @@ macro outcount data, x, y, color, numtype
mov ebx,numtype
mov bl,0
; mov edx,x*65536+y
words2reg edx,x,y
wordstoreg edx,x,y
mov esi,color
mov eax,47
int 0x40
mcall
}
; SCEVENT - Scan event
@ -718,7 +660,7 @@ macro outcount data, x, y, color, numtype
macro scevent red,key,but
{
mov eax,11
int 0x40
mcall
dec eax
jz red
dec eax
@ -732,7 +674,7 @@ macro scevent red,key,but
macro wtevent red,key,but
{
mov eax,10
int 0x40
mcall
dec eax
jz red
dec eax
@ -747,7 +689,7 @@ macro timeevent xfps,noevent,red,key,but
{
mov eax,23
mov ebx,xfps
int 0x40
mcall
cmp eax,0
je noevent
dec eax
@ -764,7 +706,7 @@ macro timeevent xfps,noevent,red,key,but
macro close
{
mov eax,-1
int 0x40
mcall
}
; DELAY - Create delay 1/100 sec
@ -775,7 +717,7 @@ macro delay arg1
{
mov eax,5
mov ebx,arg1
int 0x40
mcall
}
; WINDOW - Draw window
@ -786,11 +728,11 @@ macro window arg1,arg2,arg3,arg4,arg5
{
; mov ebx,arg1*65536+arg3
; mov ecx,arg2*65536+arg4
words2reg ebx,arg1,arg3
words2reg ecx,arg2,arg4
wordstoreg ebx,arg1,arg3
wordstoreg ecx,arg2,arg4
mov edx,arg5
mov eax,0
int 0x40
mcall
}
macro colorwindow arg1,arg2,arg3,arg4,arg5,arg6,arg7
@ -801,7 +743,7 @@ macro colorwindow arg1,arg2,arg3,arg4,arg5,arg6,arg7
mov esi,arg6
mov edi,arg7
mov eax,0
int 0x40
mcall
}
@ -811,7 +753,7 @@ macro startwd
{
mov eax,12
mov ebx,1
int 0x40
mcall
}
; ENDWD - End window draw
@ -820,7 +762,7 @@ macro endwd
{
mov eax,12
mov ebx,2
int 0x40
mcall
}
; LABEL - Put text to frame
@ -836,15 +778,14 @@ asd:
; mov ebx,arg1 ;arg1=y arg2=x
; shl ebx,16
; add ebx,arg2
words2reg ebx,arg1,arg2
dword2reg ecx,arg4
wordstoreg ebx,arg1,arg2
if ~(arg4 eq )
mov ecx,arg4 ;arg4 color
end if
mov edx,lab
mov esi,asd-lab ;calc size
mov eax,4
int 0x40
mcall
}
;Key's

View File

@ -1,4 +1,5 @@
@erase lang.inc
@echo lang fix en >lang.inc
@fasm 3detx60b.asm 3detx60b
@erase lang.inc
@pause

View File

@ -1,4 +1,5 @@
@erase lang.inc
@echo lang fix ru >lang.inc
@fasm 3detx60b.asm 3detx60b
@erase lang.inc
@pause

View File

@ -20,6 +20,7 @@ use32
dd 0x0 , 0x0 ; I_Param , I_Icon
include 'lang.inc'
include '..\..\..\macros.inc'
MAX_DEGS equ 512 ;quantity of angels 2^n.Minimize for speedup
MAX_POINTS equ 8 ;quantity of points
MAX_FACES equ 6 ;quantity of points
@ -33,10 +34,10 @@ START:
still:
mov eax,23 ; wait for system event with 2 ms timeout
mov ebx,2 ; wait 2 ms, then continue
int 0x40
mcall
; mov eax,11 ;If you want maximum speed! :)
; int 0x40
; mcall
dec eax ; window redraw request ?
je red
@ -86,30 +87,30 @@ key:
jmp exit
button:
mov eax,17
int 0x40
mcall
cmp ah,1
jne still
exit:
mov eax,-1
int 0x40
mcall
;Draw window
draw_window:
mov eax,12 ;Start
mov ebx,1
int 0x40
mcall
mov eax,0 ;Draw window
mov ebx,0*65536+(799) ;x start*65536+x size
mov ecx,0*65536+(599) ;y start*65536+y size
mov edx,0x00000000 ;0x03 use skinned window
int 0x40
mcall
call clear_screen
mov eax,12 ;End
mov ebx,2
int 0x40
mcall
ret
head_label: db "3D TEXTURED CUBE THE LITTLE SCREEN SAVER FOR MENUETOS. USE "
@ -163,14 +164,14 @@ clear_screen:
mov ebx,0*65536+800
mov ecx,0*65536+600
mov edx,0
int 40h
mcall
mov eax,4 ;Out Text
mov ebx,8*65536+8 ;x start*65536+y start
mov ecx,0x00ffffff ;color White
mov edx,head_label
mov esi,hl_end-head_label
int 0x40
mcall
ret
clear_screen_buffer:
@ -178,7 +179,7 @@ clear_screen_buffer:
mov ecx,800*65536+(600-40) ;sub 40 for antiflickering title
mov edx,0*65536+40
mov eax,7
int 0x40
mcall
mov eax,4 ;Out Text
mov ebx,8*65536+580 ;x start*65536+y start
@ -189,7 +190,7 @@ clear_screen_buffer:
mov edx,move_text
add edx,[step]
mov esi,130 ;mt_end-move_text
int 0x40
mcall
inc [n_step]
cmp [n_step],6

View File

@ -1,4 +1,5 @@
@erase lang.inc
@echo lang fix en >lang.inc
@fasm 3dtcub10.asm 3dtcub10
@erase lang.inc
@pause

View File

@ -1,4 +1,5 @@
@erase lang.inc
@echo lang fix ru >lang.inc
@fasm 3dtcub10.asm 3dtcub10
@erase lang.inc
@pause

View File

@ -18,7 +18,7 @@ use32
dd 0x0 , 0x0
include "lang.inc"
include "macros.inc"
include "..\..\..\macros.inc"
START:
@ -30,7 +30,7 @@ still:
mov eax,23 ; wait for timeout
mov ebx,50
int 0x40
mcall
cmp eax,1 ; redraw ?
je red
@ -44,12 +44,12 @@ still:
button:
mov al,17 ; get id
int 0x40
mcall
cmp ah,1 ; button id=1 ?
jne noclose
or eax,-1 ; close this program
int 0x40
mcall
noclose:
jmp still
@ -57,7 +57,7 @@ button:
drawclock:
mov eax,3 ; get time
int 0x40
mcall
bswap eax
shr eax,8
mov edi,dg1
@ -82,7 +82,7 @@ plotlp:
mov edx,0x00ff0000
nobit:
mov eax,13 ; plot 8,4,2,1
int 0x40
mcall
add ecx,12*65536
shl byte[edi],1
inc esi
@ -91,7 +91,7 @@ nobit:
shr byte[edi],4
mov edx,0x00880040
mov eax,13 ; draw digit box
int 0x40
mcall
pusha
mov edx,ebx
and edx,0xffff0000
@ -102,7 +102,7 @@ nobit:
mov ecx,[edi]
mov esi,0x00ffffff
mov eax,47 ; display decimal
int 0x40
mcall
popa
sub ebx,12*65536
inc edi
@ -116,23 +116,23 @@ drawwindow:
mov eax,12
mov ebx,1 ; start redraw
int 0x40
mcall
xor eax,eax ; window
mov ebx,100*65536+107
mov ecx,100*65536+105
mov edx,0x33400088
mov edi,header
int 0x40
mov edi,title
mcall
call drawclock
mov eax,12
mov ebx,2 ; end redraw
int 0x40
mcall
ret
header db 'BCD Clock',0
title db 'BCD Clock',0
I_END:
dg1: db ?

View File

@ -1,4 +1,5 @@
@erase lang.inc
@echo lang fix en >lang.inc
@fasm bcdclk.asm bcdclk
@erase lang.inc
@pause

View File

@ -1,4 +1,5 @@
@erase lang.inc
@echo lang fix ru >lang.inc
@fasm bcdclk.asm bcdclk
@erase lang.inc
@pause

View File

@ -1,266 +0,0 @@
; new application structure
macro meos_app_start
{
use32
org 0x0
db 'MENUET01'
dd 0x01
dd __start
dd __end
dd __memory
dd __stack
if used __params & ~defined __params
dd __params
else
dd 0x0
end if
dd 0x0
}
MEOS_APP_START fix meos_app_start
macro code
{
__start:
}
CODE fix code
macro data
{
__data:
}
DATA fix data
macro udata
{
if used __params & ~defined __params
__params:
db 0
__end:
rb 255
else
__end:
end if
__udata:
}
UDATA fix udata
macro meos_app_end
{
align 32
rb 2048
__stack:
__memory:
}
MEOS_APP_END fix meos_app_end
; macro for defining multiline text data
struc mstr [sstring]
{
forward
local ssize
virtual at 0
db sstring
ssize = $
end virtual
dd ssize
db sstring
common
dd -1
}
; strings
macro sz name,[data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if used name
db data
end if
common
if used name
.size = $-name
end if
}
macro lsz name,[lng,data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if (used name)&(lang eq lng)
db data
end if
common
if used name
.size = $-name
end if
}
; easy system call macro
macro mpack dest, hsrc, lsrc
{
if (hsrc eqtype 0) & (lsrc eqtype 0)
mov dest, (hsrc) shl 16 + lsrc
else
if (hsrc eqtype 0) & (~lsrc eqtype 0)
mov dest, (hsrc) shl 16
add dest, lsrc
else
mov dest, hsrc
shl dest, 16
add dest, lsrc
end if
end if
}
macro __mov reg,a,b { ; mike.dld
if (~a eq)&(~b eq)
mpack reg,a,b
else if (~a eq)&(b eq)
mov reg,a
end if
}
macro mcall a,b,c,d,e,f { ; mike.dld
__mov eax,a
__mov ebx,b
__mov ecx,c
__mov edx,d
__mov esi,e
__mov edi,f
int 0x40
}
; optimize the code for size
__regs fix <eax,ebx,ecx,edx,esi,edi,ebp,esp>
macro add arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
inc arg1
else
add arg1,arg2
end if
else
add arg1,arg2
end if
}
macro sub arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
dec arg1
else
sub arg1,arg2
end if
else
sub arg1,arg2
end if
}
macro mov arg1,arg2
{
if (arg1 in __regs) & (arg2 eqtype 0)
if (arg2) = 0
xor arg1,arg1
else if (arg2) = 1
xor arg1,arg1
inc arg1
else if (arg2) = -1
or arg1,-1
else if (arg2) > -128 & (arg2) < 128
push arg2
pop arg1
else
mov arg1,arg2
end if
else
mov arg1,arg2
end if
}
macro struct name
{
virtual at 0
name name
sizeof.#name = $ - name
end virtual
}
; structures used in MeOS
struc process_information
{
.cpu_usage dd ? ; +0
.window_stack_position dw ? ; +4
.window_stack_value dw ? ; +6
.not_used1 dw ? ; +8
.process_name rb 12 ; +10
.memory_start dd ? ; +22
.used_memory dd ? ; +26
.PID dd ? ; +30
.x_start dd ? ; +34
.y_start dd ? ; +38
.x_size dd ? ; +42
.y_size dd ? ; +46
.slot_state dw ? ; +50
rb (1024-52)
}
struct process_information
struc system_colors
{
.frame dd ?
.grab dd ?
.grab_button dd ?
.grab_button_text dd ?
.grab_text dd ?
.work dd ?
.work_button dd ?
.work_button_text dd ?
.work_text dd ?
.work_graph dd ?
}
struct system_colors
; constants
; events
EV_IDLE = 0
EV_TIMER = 0
EV_REDRAW = 1
EV_KEY = 2
EV_BUTTON = 3
EV_EXIT = 4
EV_BACKGROUND = 5
EV_MOUSE = 6
EV_IPC = 7
EV_STACK = 8
; event mask bits for function 40
EVM_REDRAW = 1b
EVM_KEY = 10b
EVM_BUTTON = 100b
EVM_EXIT = 1000b
EVM_BACKGROUND = 10000b
EVM_MOUSE = 100000b
EVM_IPC = 1000000b
EVM_STACK = 10000000b

View File

@ -239,7 +239,7 @@ _BGIfont_Prepare:
if ~ BGI_LEVEL eq KERNEL
mov eax, 70
mov ebx, .fontattr
int 0x40
mcall
test eax, eax
jnz .fail
dps2 '1'
@ -247,7 +247,7 @@ if ~ BGI_LEVEL eq KERNEL
mov [.fsize], eax
mov ebx,.fontinfo
mov eax,70
int 0x40 ; ebx - file size
mcall ; ebx - file size
else
push edi esi edx
mov eax,.font
@ -454,7 +454,7 @@ if ~ BGI_LEVEL eq KERNEL
mov eax,9
mov ebx,BGI_PRC_INFO
mov ecx,-1
int 0x40
mcall
popa
end if
end if
@ -587,14 +587,14 @@ if ~ BGI_LEVEL eq KERNEL
and edx, 0xFFFFFF
; \end{diamond}[18.08.2006]
mov eax,38
int 0x40
mcall
test ebp,BGI_BOLD
jz .nobold
test ebp,BGI_FREE
jnz .free5
.free5:
add ebx,1 shl 16+1
int 0x40
mcall
.nobold:
pop eax
else

View File

@ -69,7 +69,7 @@ use32
not1strun dd 0x0
include 'lang.inc'
include 'macros.inc'
include '..\..\..\macros.inc'
;include 'debug.inc'
include 'bgifont.inc'
@ -101,7 +101,7 @@ red:
still:
mov eax,10
int 0x40
mcall
cmp eax,1
je red
@ -114,19 +114,19 @@ still:
button:
mov eax,17
int 0x40
mcall
cmp ah,1
jnz noclose
close:
xor eax,eax
dec eax
int 0x40
mcall
noclose:
jmp still
key:
mov eax,2
int 0x40
mcall
shr eax,8
cmp al,27 ; esc - close
je close
@ -228,11 +228,11 @@ draw_window:
mov ebx,3
mov ecx,sc
mov edx,sizeof.system_colors
int 0x40
mcall
mov eax,12
mov ebx,1
int 0x40
mcall
xor eax,eax
mov ebx,10*65536+_X*2+30
@ -240,7 +240,7 @@ draw_window:
mov edx,0x03261212
mov esi,0x805080d0
mov edi,0x005080d0
int 0x40
mcall
mov eax,4
mov ebx,8*65536+8
@ -252,7 +252,7 @@ draw_window:
je .int
sub esi,12
.int:
int 0x40
mcall
cmp [help],0
jnz .help
@ -282,16 +282,16 @@ draw_window:
mov edx,0x4b331a
mov ebx,[edi]
mov ecx,[edi+4]
int 0x40
mcall
mov ebx,[edi+8]
mov ecx,[edi+12]
int 0x40
mcall
mov ebx,freetest
BGIfont_Freetext
.eod:
mov eax,12
mov ebx,2
int 0x40
mcall
ret
Print: ; eax-pointer to _txt struc
@ -326,7 +326,7 @@ PixelPrint: ; eax-pointer to _txt struc, but used differently
and esi,0xfff
push ecx
mov ecx,[ebp+8]
int 0x40
mcall
pop ecx
lea edx,[esi+edx+4]
add ebx,[ebp+4]

View File

@ -1,4 +1,5 @@
@erase lang.inc
@echo lang fix en >lang.inc
@fasm bgitest.asm bgitest
@erase lang.inc
@pause

View File

@ -1,4 +1,5 @@
@erase lang.inc
@echo lang fix ru >lang.inc
@fasm bgitest.asm bgitest
@erase lang.inc
@pause

View File

@ -1,269 +0,0 @@
; new application structure
macro meos_app_start
{
use32
org 0x0
db 'MENUET01'
dd 0x01
dd __start
dd __end
dd __memory
dd __stack
if used __params & ~defined __params
dd __params
else
dd 0x0
end if
dd 0x0
}
MEOS_APP_START fix meos_app_start
macro code
{
__start:
}
CODE fix code
macro data
{
__data:
}
DATA fix data
macro udata
{
if used __params & ~defined __params
__params:
db 0
__end:
rb 255
else
__end:
end if
__udata:
}
UDATA fix udata
macro meos_app_end
{
align 32
rb 2048
__stack:
__memory:
}
MEOS_APP_END fix meos_app_end
; macro for defining multiline text data
struc mstr [sstring]
{
forward
local ssize
virtual at 0
db sstring
ssize = $
end virtual
dd ssize
db sstring
common
dd -1
}
; strings
macro sz name,[data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if used name
db data
end if
common
if used name
.size = $-name
end if
}
macro lsz name,[lng,data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if (used name)&(lang eq lng)
db data
end if
common
if used name
.size = $-name
end if
}
; easy system call macro
macro mpack dest, hsrc, lsrc
{
if (hsrc eqtype 0) & (lsrc eqtype 0)
mov dest, (hsrc) shl 16 + lsrc
else
if (hsrc eqtype 0) & (~lsrc eqtype 0)
mov dest, (hsrc) shl 16
add dest, lsrc
else
mov dest, hsrc
shl dest, 16
add dest, lsrc
end if
end if
}
macro __mov reg,a,b { ; mike.dld
if (~a eq)&(~b eq)
mpack reg,a,b
else if (~a eq)&(b eq)
mov reg,a
end if
}
macro mcall a,b,c,d,e,f { ; mike.dld
__mov eax,a
__mov ebx,b
__mov ecx,c
__mov edx,d
__mov esi,e
__mov edi,f
int 0x40
}
; optimize the code for size
__regs fix <eax,ebx,ecx,edx,esi,edi,ebp,esp>
macro add arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
inc arg1
else
add arg1,arg2
end if
else
add arg1,arg2
end if
}
macro sub arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
dec arg1
else
sub arg1,arg2
end if
else
sub arg1,arg2
end if
}
macro mov arg1,arg2
{
if (arg1 in __regs) & ((arg2 eqtype 0) | (arg2 eqtype '0'))
if (arg2) = 0
xor arg1,arg1
else if (arg2) = 1
xor arg1,arg1
inc arg1
else if (arg2) = -1
or arg1,-1
else if (arg2) > -128 & (arg2) < 128
push arg2
pop arg1
else
mov arg1,arg2
end if
else
mov arg1,arg2
end if
}
macro struct name
{
virtual at 0
name name
sizeof.#name = $ - name
end virtual
}
; structures used in MeOS
struc process_information
{
.cpu_usage dd ? ; +0
.window_stack_position dw ? ; +4
.window_stack_value dw ? ; +6
.not_used1 dw ? ; +8
.process_name rb 12 ; +10
.memory_start dd ? ; +22
.used_memory dd ? ; +26
.PID dd ? ; +30
.x_start dd ? ; +34
.y_start dd ? ; +38
.x_size dd ? ; +42
.y_size dd ? ; +46
.slot_state dw ? ; +50
dw ? ; +52 - reserved
.client_left dd ? ; +54
.client_top dd ? ; +58
.client_width dd ? ; +62
.client_height dd ? ; +66
.wnd_state db ? ; +70
rb (1024-71)
}
struct process_information
struc system_colors
{
.frame dd ?
.grab dd ?
.grab_button dd ?
.grab_button_text dd ?
.grab_text dd ?
.work dd ?
.work_button dd ?
.work_button_text dd ?
.work_text dd ?
.work_graph dd ?
}
struct system_colors
; constants
; events
EV_IDLE = 0
EV_TIMER = 0
EV_REDRAW = 1
EV_KEY = 2
EV_BUTTON = 3
EV_EXIT = 4
EV_BACKGROUND = 5
EV_MOUSE = 6
EV_IPC = 7
EV_STACK = 8
; event mask bits for function 40
EVM_REDRAW = 1b
EVM_KEY = 10b
EVM_BUTTON = 100b
EVM_EXIT = 1000b
EVM_BACKGROUND = 10000b
EVM_MOUSE = 100000b
EVM_IPC = 1000000b
EVM_STACK = 10000000b

View File

@ -1,4 +1,5 @@
@erase lang.inc
@echo lang fix en >lang.inc
@fasm colorref.asm colorref
@erase lang.inc
@pause

View File

@ -1,4 +1,5 @@
@erase lang.inc
@echo lang fix ru >lang.inc
@fasm colorref.asm colorref
@erase lang.inc
@pause

View File

@ -15,6 +15,7 @@ use32
dd 0x0,0x0 ; I_Param , I_Icon
include 'lang.inc'
include '..\..\..\macros.inc'
wide: dd 0 ; screen pixels width
mouse: dd 0 ; 1=right,2=left [mouse click]
@ -22,7 +23,7 @@ mouse: dd 0 ; 1=right,2=left [mouse click]
start:
mov eax,14 ; get screen size
int 0x40
mcall
shr eax,16 ; get width into AX
inc eax ; not 0 based
mov [wide],eax
@ -32,7 +33,7 @@ start:
still:
mov eax,23 ; wait for event w/timeout
mov ebx,5 ; delay in hundredths
int 0x40
mcall
cmp eax,1 ; redraw request ?
jne s1
@ -46,7 +47,7 @@ s2: cmp eax,3 ; button in buffer ?
s3: mov eax,9 ; process info function
mov ebx,stat_table ; return data table
mov ecx,-1 ; who am i
int 0x40
mcall
cmp ax,[stat_table+4] ; are we active?
je active ; yep
jmp still
@ -54,7 +55,7 @@ s3: mov eax,9 ; process info function
active:
mov eax,37 ; mouse info function
mov ebx,2 ; get buttons
int 0x40
mcall
cmp eax,0 ; mouse click?
jne click
jmp still
@ -62,7 +63,7 @@ s3: mov eax,9 ; process info function
mov [mouse],eax ; save mouse click
mov eax,37 ; mouse info
xor ebx,ebx ; get screen pos for mouse
int 0x40 ; into EAX
mcall ; into EAX
xor ebx,ebx
mov bx,ax ; BX=y screen position
shr eax,16 ; AX=x screen position
@ -72,7 +73,7 @@ s3: mov eax,9 ; process info function
mul ecx
add ebx,eax ; add x
mov eax,35 ; get mouse pos pixel
int 0x40 ; EAX=mouse pixel color
mcall ; EAX=mouse pixel color
mov ebx,eax ; EBX has color
mov esi,colors ; color table
mov ecx,72 ; total colors
@ -110,7 +111,7 @@ r1: mov [picks+4],edx ; update right pick color
key: ; key
mov eax,2 ; just read it and ignore
int 0x40
mcall
cmp al,0 ; key in buffer?
je k1 ; yep
jmp still
@ -124,14 +125,14 @@ k2: call help ; show help screen
button: ; button
mov eax,17 ; get id
int 0x40
mcall
cmp ah,1 ; button id=1 ?
je close
jmp still
close:
mov eax,-1 ; close this program
int 0x40
mcall
; *********************************************
@ -143,20 +144,20 @@ draw_window:
mov eax,12 ; tell os about windowdraw
mov ebx,1 ; 1, start of draw
int 0x40
mcall
mov eax,0 ; DRAW WINDOW
mov ebx,1*65536+200 ; [x start] *65536 + [x size]
mov ecx,200*65536+240 ; [y start] *65536 + [y size]
mov edx,0x13000000 ; work area color (type II)
mov edi,header ; frame color
int 0x40
mov edi,title ; frame color
mcall
call palette ; display color palette
mov eax,12 ; tell os about windowdraw
mov ebx,2 ; 2, end of draw
int 0x40
mcall
ret
@ -178,7 +179,7 @@ p2: push ecx
mov ecx,edx ; y coord
mov edx,[ebp] ; color
mov eax,13 ; draw bar function
int 0x40
mcall
pop edx
pop ecx
add ebx,19*65536 ; next column
@ -197,7 +198,7 @@ draw_picks:
mov ecx,188*65536+42 ; draw y and depth
mov edx,0xc0c0c0 ; color grey
mov eax,13 ; draw bar function
int 0x40
mcall
mov eax,[picks] ; first picked color
mov esi,22*65536+196 ; print at x and y
call do_hex ; print color number
@ -232,7 +233,7 @@ do_hex:
mov edx,esi ; copy color
mov esi,0xe1e1e1 ; use white
mov eax,47 ; print number function
int 0x40
mcall
ret
@ -245,7 +246,7 @@ do_color:
mov edx,[edi] ; color
mov ecx,esi ; recover y an depth
mov eax,13 ; draw bar function
int 0x40
mcall
ret
@ -258,7 +259,7 @@ do_name:
mov ecx,0xe1e1e1 ; color
mov esi,15
mov eax,4 ; print text function
int 0x40
mcall
ret
@ -267,12 +268,12 @@ clear:
mov ecx,196*65536+26 ; y and depth
mov edx,0x000000 ; color
mov eax,13 ; draw bar funx
int 0x40
mcall
mov ebx,96*65536+90 ; x and width
mov ecx,196*65536+26 ; y and depth
mov edx,0x000000 ; color
mov eax,13 ; draw bar funx
int 0x40
mcall
ret
@ -281,7 +282,7 @@ help:
mov ecx,20*65536+216 ; y and depth
mov edx,0x465e8f ; dark denim color
mov eax,13 ; write text funx
int 0x40
mcall
mov ebx,20*65536+40 ; starting x and y
mov edx,text ; start of text
mov esi,27 ; width of text
@ -290,25 +291,25 @@ help:
h1: push ecx
sub ebx,65537 ; drop shadow x and y
mov ecx,0x000000 ; black shadow
int 0x40
mcall
add ebx,65537 ; original x and y
mov ecx,0xefefef ; white text
int 0x40
mcall
add edx,27 ; next line of text
add bx,12 ; next row
pop ecx
loop h1
mov eax,10 ; wait on event
int 0x40
mcall
cmp eax,2 ; got a key?
jne h2 ; nope
mov eax,2 ; yep, burn it
int 0x40
mcall
h2: mov ebx,4*65536+192 ; y and width
mov ecx,20*65536+216 ; x and depth
mov edx,0x00000 ; restore black bkg
mov eax,13 ; draw bar funx
int 0x40
mcall
call palette ; redraw color palette
ret
@ -318,7 +319,7 @@ h2: mov ebx,4*65536+192 ; y and width
; ********** DATA DEFINITIONS AREA ***********
; *********************************************
header db 'COLOR REFERENCE H>HELP',0
title db 'COLOR REFERENCE H>HELP',0
picks:
dd 31,2 ; selected top/bot colors

View File

@ -1,4 +1,5 @@
@erase lang.inc
@echo lang fix en >lang.inc
@fasm crownscr.asm crownscr
@erase lang.inc
@pause

View File

@ -1,4 +1,5 @@
@erase lang.inc
@echo lang fix ru >lang.inc
@fasm crownscr.asm crownscr
@erase lang.inc
@pause

View File

@ -33,7 +33,7 @@ copyrightlen:
include "lang.inc"
include "figuresi.inc"
include "macros.inc"
include "..\..\..\macros.inc"
start:
cld
finit
@ -46,7 +46,7 @@ start:
cmp [flscr],0
jz nofullscreen
mov eax,14
int 0x40
mcall
mov [maxy],ax
sub ax,480
@ -80,7 +80,7 @@ red:
still:
mov eax,23
mov ebx,delay
int 0x40 ; wait here for event
mcall ; wait here for event
cmp eax,1 ; redraw request ?
je red
@ -95,12 +95,12 @@ still:
mov ecx,[outsize] ; ecx=image position in window [x]*65536+[y]
mov ebx,scr ; ebx pointer to image in memory
mov eax,07 ; putimage
int 0x40
mcall
jmp still
key:
mov eax,2
int 0x40
mcall
cmp al,1 ; is key in buffer ?
jz still
@ -110,14 +110,14 @@ jmp still
button: ; button
mov eax,17 ; get id
int 0x40
mcall
; cmp ah,1 ; button id=1 ?
; jne still
close:
mov eax,-1 ; close this program
int 0x40
mcall
; *********************************************
@ -128,7 +128,7 @@ close:
draw_window:
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,1 ; 1, start of draw
int 0x40
mcall
cmp [flscr],0
jnz m2
@ -138,7 +138,7 @@ draw_window:
mov esi,0x805080d0 ; color of grab bar RRGGBB,8->color gl
mov edi,0x005080d0 ; color of frames RRGGBB
xor eax,eax ; function 0 : define and draw window
int 0x40
mcall
; WINDOW LABEL
mov ebx,8*65536+8 ; [x start] *65536 + [y start]
@ -146,7 +146,7 @@ draw_window:
mov edx,copyright ; pointer to text beginning
mov esi,copyrightlen-copyright; text length
mov eax,4 ; function 4 : write text to window
int 0x40
mcall
; CLOSE BUTTON
mov ebx,(640-19)*65536+12 ; [x start] *65536 + [x size]
@ -154,7 +154,7 @@ draw_window:
mov edx,1 ; button id
mov esi,0x6688dd ; button color RRGGBB
mov eax,8 ; function 8 : define and draw button
int 0x40
mcall
jmp m3
m2:
movzx ebx,[maxx] ; [x start] *65536 + [x size]
@ -164,17 +164,17 @@ draw_window:
mov esi,0x805080d0 ; color of grab bar RRGGBB,8->color gl
mov edi,0x005080d0 ; color of frames RRGGBB
xor eax,eax ; function 0 : define and draw window
int 0x40
mcall
inc bx
inc cx
mov eax,13 ; functiom 13 : draw bar
int 0x40
mcall
m3:
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,2 ; 2, end of draw
int 0x40
mcall
ret
@ -332,7 +332,7 @@ ret
filling_alfbet:
; Initialize RND
mov eax,3
int 40h
mcall
; eax - fist random number
mov ecx,n_points

View File

@ -1,261 +0,0 @@
; new application structure
macro meos_app_start
{
use32
org 0x0
db 'MENUET01'
dd 0x01
dd __start
dd __end
dd __memory
dd __stack
if used __params & ~defined __params
dd __params
else
dd 0x0
end if
dd 0x0
}
MEOS_APP_START fix meos_app_start
macro code
{
__start:
}
CODE fix code
macro data
{
__data:
}
DATA fix data
macro udata
{
if used __params & ~defined __params
__params:
db 0
__end:
rb 255
else
__end:
end if
__udata:
}
UDATA fix udata
macro meos_app_end
{
align 32
rb 2048
__stack:
__memory:
}
MEOS_APP_END fix meos_app_end
; macro for defining multiline text data
struc mstr [sstring]
{
forward
local ssize
virtual at 0
db sstring
ssize = $
end virtual
dd ssize
db sstring
common
dd -1
}
; strings
macro sz name,[data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if used name
db data
end if
common
if used name
.size = $-name
end if
}
macro lsz name,[lng,data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if (used name)&(lang eq lng)
db data
end if
common
if used name
.size = $-name
end if
}
; easy system call macro
macro mpack dest, hsrc, lsrc
{
if (hsrc eqtype 0) & (lsrc eqtype 0)
mov dest, (hsrc) shl 16 + lsrc
else
if (hsrc eqtype 0) & (~lsrc eqtype 0)
mov dest, (hsrc) shl 16
add dest, lsrc
else
mov dest, hsrc
shl dest, 16
add dest, lsrc
end if
end if
}
macro __mov reg,a,b { ; mike.dld
if (~a eq)&(~b eq)
mpack reg,a,b
else if (~a eq)&(b eq)
mov reg,a
end if
}
macro mcall a,b,c,d,e,f { ; mike.dld
__mov eax,a
__mov ebx,b
__mov ecx,c
__mov edx,d
__mov esi,e
__mov edi,f
int 0x40
}
; optimize the code for size
__regs fix <eax,ebx,ecx,edx,esi,edi,ebp,esp>
macro add arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
inc arg1
else
add arg1,arg2
end if
else
add arg1,arg2
end if
}
macro sub arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
dec arg1
else
sub arg1,arg2
end if
else
sub arg1,arg2
end if
}
macro mov arg1,arg2
{
if (arg1 in __regs) & (arg2 eqtype 0)
if (arg2) = 0
xor arg1,arg1
else if (arg2) = 1
xor arg1,arg1
inc arg1
else if (arg2) = -1
or arg1,-1
else if (arg2) > -128 & (arg2) < 128
push arg2
pop arg1
else
mov arg1,arg2
end if
else
mov arg1,arg2
end if
}
macro struct name
{
virtual at 0
name name
sizeof.#name = $ - name
end virtual
}
; structures used in MeOS
struc process_information
{
.cpu_usage dd ? ; +0
.window_stack_position dw ? ; +4
.window_stack_value dw ? ; +6
.not_used1 dw ? ; +8
.process_name rb 12 ; +10
.memory_start dd ? ; +22
.used_memory dd ? ; +26
.PID dd ? ; +30
.x_start dd ? ; +34
.y_start dd ? ; +38
.x_size dd ? ; +42
.y_size dd ? ; +46
.slot_state dw ? ; +50
rb (1024-52)
}
struct process_information
struc system_colors
{
.frame dd ?
.grab dd ?
.grab_button dd ?
.grab_button_text dd ?
.grab_text dd ?
.work dd ?
.work_button dd ?
.work_button_text dd ?
.work_text dd ?
.work_graph dd ?
}
struct system_colors
; constants
; events
EV_IDLE = 0
EV_TIMER = 0
EV_REDRAW = 1
EV_KEY = 2
EV_BUTTON = 3
EV_EXIT = 4
EV_BACKGROUND = 5
EV_MOUSE = 6
EV_IPC = 7
EV_STACK = 8
; event mask bits for function 40
EVM_REDRAW = 1b
EVM_KEY = 10b
EVM_BUTTON = 100b
EVM_EXIT = 1000b
EVM_BACKGROUND = 10000b
EVM_MOUSE = 100000b
EVM_IPC = 1000000b
EVM_STACK = 10000000b

View File

@ -1,4 +1,5 @@
@erase lang.inc
@echo lang fix en >lang.inc
@fasm cslide.asm cslide
@erase lang.inc
@pause

View File

@ -1,4 +1,5 @@
@erase lang.inc
@echo lang fix ru >lang.inc
@fasm cslide.asm cslide
@erase lang.inc
@pause

View File

@ -20,6 +20,7 @@ use32
dd 0x0 , 0x0 ; I_Param , I_Icon
include 'lang.inc'
include '..\..\..\macros.inc'
START: ; start of execution
call draw_window ; at first, draw the window
@ -29,7 +30,7 @@ still:
mov eax,23
mov ebx,2
int 0x40
mcall
cmp eax,1 ; redraw request ?
je red
@ -46,19 +47,19 @@ still:
key: ; key
mov eax,2 ; just read it and ignore
int 0x40
mcall
jmp still
button: ; button
mov eax,17 ; get id
int 0x40
mcall
shr eax,8
cmp eax,1 ; button id=1 ?
jne noclose
mov eax,-1 ; close this program
int 0x40
mcall
noclose:
@ -74,14 +75,14 @@ still:
draw_window:
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,1 ; 1, start of draw
int 0x40
mcall
; DRAW WINDOW
mov eax,0 ; function 0 : define and draw window
mov ebx,100*65536+200 ; [x start] *65536 + [x size]
mov ecx,100*65536+200 ; [y start] *65536 + [y size]
mov edx,0x13ffffff ; color of work area RRGGBB,8->color gl
mov edi,header ; WINDOW LABEL
int 0x40
mov edi,title ; WINDOW LABEL
mcall
call draw_slider_info
@ -98,7 +99,7 @@ Draw_Controls_Done:
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,2 ; 2, end of draw
int 0x40
mcall
ret
@ -113,12 +114,12 @@ mouseb dd 0
mouse_info:
mov eax, 37 ;get mouse cordinates
mov ebx, 1 ;
int 0x40 ;
mcall ;
mov ecx, eax ;
push ecx ;
mov eax, 37 ;get mouse buttons
mov ebx, 2 ;
int 0x40 ;
mcall ;
cmp [mouseb], eax ;compare old mouse states to new states
jne redraw_mouse_info ;
cmp [mousey], cx ;
@ -174,7 +175,7 @@ draw_slider_info:
mov ebx, 0x00960028
mov ecx, 0x00240010
mov edx, 0x00ffffff
int 0x40
mcall
;Draw Color Box
xor edx, edx
movzx ecx,word [slider_1+12]
@ -187,14 +188,14 @@ draw_slider_info:
mov ebx, 0x00860035
mov ecx, 0x00590040
mov eax, 13
int 0x40
mcall
;draw current value of slider
mov ecx, edx
mov eax, 47
mov ebx, 0x00060100
mov esi, 0
mov edx, 0x009A0029
int 0x40
mcall
ret
@ -267,7 +268,7 @@ draw_slider:
mov ebx, [ebp] ;x start/width
mov ecx, [ebp+4] ;y start/height
mov edx, 0x002288DD ;color
int 0x40 ;draw bar
mcall ;draw bar
;Draw line for slide rail
mov eax, 38 ;draw vertical slide line
movzx ebx,word [ebp] ;x
@ -281,7 +282,7 @@ draw_slider:
add ecx, [ebp+6] ;y start
sub ecx, 10 ;
mov edx, 0x00 ;color
int 0x40 ;
mcall ;
;Draw slider box
movzx eax,word [ebp+4] ;height
sub eax, 20 ;
@ -301,7 +302,7 @@ draw_slider:
mov cx, [box_h] ;height
mov eax, 13 ;draw bar sys function
mov edx, 0x00 ;color
int 0x40 ;draw slider box
mcall ;draw slider box
pop edx
pop ecx
pop ebx
@ -374,5 +375,5 @@ ret
;**************************************************
; DATA AREA
header db 'Color Slider',0
title db 'Color Slider',0
I_END:

View File

@ -1,4 +1,5 @@
@erase lang.inc
@echo lang fix en >lang.inc
@fasm eyes.asm eyes
@erase lang.inc
@pause

View File

@ -1,4 +1,5 @@
@erase lang.inc
@echo lang fix ru >lang.inc
@fasm eyes.asm eyes
@erase lang.inc
@pause

View File

@ -26,7 +26,7 @@ use32
dd 0x0
dd 0x0
include 'macros.inc'
include '..\..\..\macros.inc'
ENTRANCE: ; start of code
; ==== main ====
@ -41,7 +41,7 @@ call draw_eyes ; draw those funny "eyes"
mov eax,23 ; wait for event with timeout
mov ebx,TIMEOUT
int 0x40
mcall
cmp eax,1 ; redraw ?
jnz no_draw
@ -60,12 +60,12 @@ jmp still ; loop
key:
mov eax,2 ; just read and ignore
int 0x40
mcall
jmp still
button: ; analyze button
mov eax,-1 ; this is button 1 - we have only one button :-)
int 0x40
mcall
jmp still
; -====- declarations -====-
@ -81,7 +81,7 @@ shape_window:
mov eax,50 ; set up shape reference area
mov ebx,0
mov ecx,winref
int 0x40
mcall
ret
@ -91,7 +91,7 @@ draw_eyes: ; check mousepos to disable blinking
mov eax,37
xor ebx,ebx
int 0x40
mcall
cmp dword [mouse],eax
jne redraw_ok
ret
@ -102,7 +102,7 @@ redraw_overlap: ; label for redraw event (without checkmouse)
mov eax,12
mov ebx,1
int 0x40
mcall
xor eax,eax ; define window
mov ebx,[win_ebx]
@ -110,19 +110,19 @@ mov ecx,[win_ecx]
xor edx,edx
xor esi,esi
xor edi,edi
int 0x40
mcall
mov eax,8 ; define closebutton
mov ebx,60
mov ecx,45
mov edx,1
int 0x40
mcall
mov eax,7
mov ebx,skindata
mov ecx,60*65536+30
mov edx,15
int 0x40
mcall
mov eax,15
mov ebx,30
@ -132,7 +132,7 @@ call draw_eye_point
mov eax,12
mov ebx,2
int 0x40
mcall
ret
@ -281,7 +281,7 @@ shl ebx,16
add ebx,4
mov eax,13
xor edx,edx
int 0x40
mcall
popa
ret
@ -295,12 +295,12 @@ prepare_eyes:
;mov ecx,0x00000000
;mov edx,0xFFFFFFFF
;mov esi,imagedata
;int 0x40
;mcall
;cmp eax,0xFFFFFFFF
;jnz filefound
;mov eax,-1 ; file not exists...
;int 0x40
;mcall
;filefound:
mov esi,imagedata+25 ; transform grayscale to putimage format
@ -327,7 +327,7 @@ pop ecx
loop transform_loop
mov eax,14 ; calculating screen position
int 0x40
mcall
shr eax,1
mov ax,59
sub eax,30*65536

View File

@ -1,269 +0,0 @@
; new application structure
macro meos_app_start
{
use32
org 0x0
db 'MENUET01'
dd 0x01
dd __start
dd __end
dd __memory
dd __stack
if used __params & ~defined __params
dd __params
else
dd 0x0
end if
dd 0x0
}
MEOS_APP_START fix meos_app_start
macro code
{
__start:
}
CODE fix code
macro data
{
__data:
}
DATA fix data
macro udata
{
if used __params & ~defined __params
__params:
db 0
__end:
rb 255
else
__end:
end if
__udata:
}
UDATA fix udata
macro meos_app_end
{
align 32
rb 2048
__stack:
__memory:
}
MEOS_APP_END fix meos_app_end
; macro for defining multiline text data
struc mstr [sstring]
{
forward
local ssize
virtual at 0
db sstring
ssize = $
end virtual
dd ssize
db sstring
common
dd -1
}
; strings
macro sz name,[data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if used name
db data
end if
common
if used name
.size = $-name
end if
}
macro lsz name,[lng,data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if (used name)&(lang eq lng)
db data
end if
common
if used name
.size = $-name
end if
}
; easy system call macro
macro mpack dest, hsrc, lsrc
{
if (hsrc eqtype 0) & (lsrc eqtype 0)
mov dest, (hsrc) shl 16 + lsrc
else
if (hsrc eqtype 0) & (~lsrc eqtype 0)
mov dest, (hsrc) shl 16
add dest, lsrc
else
mov dest, hsrc
shl dest, 16
add dest, lsrc
end if
end if
}
macro __mov reg,a,b { ; mike.dld
if (~a eq)&(~b eq)
mpack reg,a,b
else if (~a eq)&(b eq)
mov reg,a
end if
}
macro mcall a,b,c,d,e,f { ; mike.dld
__mov eax,a
__mov ebx,b
__mov ecx,c
__mov edx,d
__mov esi,e
__mov edi,f
int 0x40
}
; optimize the code for size
__regs fix <eax,ebx,ecx,edx,esi,edi,ebp,esp>
macro add arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
inc arg1
else
add arg1,arg2
end if
else
add arg1,arg2
end if
}
macro sub arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
dec arg1
else
sub arg1,arg2
end if
else
sub arg1,arg2
end if
}
macro mov arg1,arg2
{
if (arg1 in __regs) & ((arg2 eqtype 0) | (arg2 eqtype '0'))
if (arg2) = 0
xor arg1,arg1
else if (arg2) = 1
xor arg1,arg1
inc arg1
else if (arg2) = -1
or arg1,-1
else if (arg2) > -128 & (arg2) < 128
push arg2
pop arg1
else
mov arg1,arg2
end if
else
mov arg1,arg2
end if
}
macro struct name
{
virtual at 0
name name
sizeof.#name = $ - name
end virtual
}
; structures used in MeOS
struc process_information
{
.cpu_usage dd ? ; +0
.window_stack_position dw ? ; +4
.window_stack_value dw ? ; +6
.not_used1 dw ? ; +8
.process_name rb 12 ; +10
.memory_start dd ? ; +22
.used_memory dd ? ; +26
.PID dd ? ; +30
.x_start dd ? ; +34
.y_start dd ? ; +38
.x_size dd ? ; +42
.y_size dd ? ; +46
.slot_state dw ? ; +50
dw ? ; +52 - reserved
.client_left dd ? ; +54
.client_top dd ? ; +58
.client_width dd ? ; +62
.client_height dd ? ; +66
.wnd_state db ? ; +70
rb (1024-71)
}
struct process_information
struc system_colors
{
.frame dd ?
.grab dd ?
.grab_button dd ?
.grab_button_text dd ?
.grab_text dd ?
.work dd ?
.work_button dd ?
.work_button_text dd ?
.work_text dd ?
.work_graph dd ?
}
struct system_colors
; constants
; events
EV_IDLE = 0
EV_TIMER = 0
EV_REDRAW = 1
EV_KEY = 2
EV_BUTTON = 3
EV_EXIT = 4
EV_BACKGROUND = 5
EV_MOUSE = 6
EV_IPC = 7
EV_STACK = 8
; event mask bits for function 40
EVM_REDRAW = 1b
EVM_KEY = 10b
EVM_BUTTON = 100b
EVM_EXIT = 1000b
EVM_BACKGROUND = 10000b
EVM_MOUSE = 100000b
EVM_IPC = 1000000b
EVM_STACK = 10000000b

View File

@ -13,7 +13,7 @@ use32
dd mem_end
dd 0,0 ; no parameters, no path
include 'macros.inc'
include '..\..\..\macros.inc'
START:
@ -27,7 +27,7 @@ draw_window:
mov eax,12 ; tell os about redraw
mov ebx,1
int 0x40
mcall
xor eax,eax ; define and draw window
mov ebx,100*65536+321
@ -35,37 +35,37 @@ draw_window:
mov edx,0x00000000
mov esi,0x00000000
mov edi,0x00000000
int 0x40
mcall
mov al,4 ; 'FIRE FOR MENUET'
mov ebx,110*65536+8
mov ecx,dword 0x00FFFFFF
mov edx,text
mov esi,textlen-text
int 0x40
mcall
mov al,8
mov ebx,(321-19)*65536+12 ; button start x & size
mov ecx,5*65536+12 ; button start y & size
mov edx,1 ; button number
mov esi,0x009a0000
int 0x40
mcall
mov ebx,ecx ;5*65536+12
inc edx
int 0x40
mcall
mov ebx,18*65536+12
inc edx
int 0x40
mcall
mov ebx,31*65536+12
inc edx
int 0x40
mcall
mov al,12 ; tell os about redraw end
mov ebx,2
int 0x40
mcall
sta: ; calculate fire image
@ -134,7 +134,7 @@ typedone:
mov al, 5 ; in this moment always high 24 bits of eax are zero!
mov ebx,[delay]
int 0x40
mcall
inc [calc]
cmp [calc], byte 2
@ -184,12 +184,12 @@ typedone:
pop ebx
mov ecx,4*80*65536+200
mov edx,1*65536+22
int 0x40
mcall
nodrw:
mov eax,11 ; check if os wants to talk to us
int 0x40
mcall
dec eax
jz red
cmp al, 3-1
@ -197,13 +197,13 @@ typedone:
button: ; get button id
mov al,17
int 0x40
mcall
shr eax, 8
dec eax
jnz noclose
or eax,-1 ; close this program
int 0x40
mcall
noclose:
dec eax ; change fire type

View File

@ -1,269 +0,0 @@
; new application structure
macro meos_app_start
{
use32
org 0x0
db 'MENUET01'
dd 0x01
dd __start
dd __end
dd __memory
dd __stack
if used __params & ~defined __params
dd __params
else
dd 0x0
end if
dd 0x0
}
MEOS_APP_START fix meos_app_start
macro code
{
__start:
}
CODE fix code
macro data
{
__data:
}
DATA fix data
macro udata
{
if used __params & ~defined __params
__params:
db 0
__end:
rb 255
else
__end:
end if
__udata:
}
UDATA fix udata
macro meos_app_end
{
align 32
rb 2048
__stack:
__memory:
}
MEOS_APP_END fix meos_app_end
; macro for defining multiline text data
struc mstr [sstring]
{
forward
local ssize
virtual at 0
db sstring
ssize = $
end virtual
dd ssize
db sstring
common
dd -1
}
; strings
macro sz name,[data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if used name
db data
end if
common
if used name
.size = $-name
end if
}
macro lsz name,[lng,data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if (used name)&(lang eq lng)
db data
end if
common
if used name
.size = $-name
end if
}
; easy system call macro
macro mpack dest, hsrc, lsrc
{
if (hsrc eqtype 0) & (lsrc eqtype 0)
mov dest, (hsrc) shl 16 + lsrc
else
if (hsrc eqtype 0) & (~lsrc eqtype 0)
mov dest, (hsrc) shl 16
add dest, lsrc
else
mov dest, hsrc
shl dest, 16
add dest, lsrc
end if
end if
}
macro __mov reg,a,b { ; mike.dld
if (~a eq)&(~b eq)
mpack reg,a,b
else if (~a eq)&(b eq)
mov reg,a
end if
}
macro mcall a,b,c,d,e,f { ; mike.dld
__mov eax,a
__mov ebx,b
__mov ecx,c
__mov edx,d
__mov esi,e
__mov edi,f
int 0x40
}
; optimize the code for size
__regs fix <eax,ebx,ecx,edx,esi,edi,ebp,esp>
macro add arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
inc arg1
else
add arg1,arg2
end if
else
add arg1,arg2
end if
}
macro sub arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
dec arg1
else
sub arg1,arg2
end if
else
sub arg1,arg2
end if
}
macro mov arg1,arg2
{
if (arg1 in __regs) & ((arg2 eqtype 0) | (arg2 eqtype '0'))
if (arg2) = 0
xor arg1,arg1
else if (arg2) = 1
xor arg1,arg1
inc arg1
else if (arg2) = -1
or arg1,-1
else if (arg2) > -128 & (arg2) < 128
push arg2
pop arg1
else
mov arg1,arg2
end if
else
mov arg1,arg2
end if
}
macro struct name
{
virtual at 0
name name
sizeof.#name = $ - name
end virtual
}
; structures used in MeOS
struc process_information
{
.cpu_usage dd ? ; +0
.window_stack_position dw ? ; +4
.window_stack_value dw ? ; +6
.not_used1 dw ? ; +8
.process_name rb 12 ; +10
.memory_start dd ? ; +22
.used_memory dd ? ; +26
.PID dd ? ; +30
.x_start dd ? ; +34
.y_start dd ? ; +38
.x_size dd ? ; +42
.y_size dd ? ; +46
.slot_state dw ? ; +50
dw ? ; +52 - reserved
.client_left dd ? ; +54
.client_top dd ? ; +58
.client_width dd ? ; +62
.client_height dd ? ; +66
.wnd_state db ? ; +70
rb (1024-71)
}
struct process_information
struc system_colors
{
.frame dd ?
.grab dd ?
.grab_button dd ?
.grab_button_text dd ?
.grab_text dd ?
.work dd ?
.work_button dd ?
.work_button_text dd ?
.work_text dd ?
.work_graph dd ?
}
struct system_colors
; constants
; events
EV_IDLE = 0
EV_TIMER = 0
EV_REDRAW = 1
EV_KEY = 2
EV_BUTTON = 3
EV_EXIT = 4
EV_BACKGROUND = 5
EV_MOUSE = 6
EV_IPC = 7
EV_STACK = 8
; event mask bits for function 40
EVM_REDRAW = 1b
EVM_KEY = 10b
EVM_BUTTON = 100b
EVM_EXIT = 1000b
EVM_BACKGROUND = 10000b
EVM_MOUSE = 100000b
EVM_IPC = 1000000b
EVM_STACK = 10000000b

View File

@ -1,3 +1,4 @@
include '..\..\..\macros.inc'
use32
org 0x0
@ -17,7 +18,7 @@ START:
rep stosd
mov al, 3
int 0x40
mcall
mov [curtime], eax
red:
@ -25,7 +26,7 @@ red:
pop eax
push 1
pop ebx
int 0x40
mcall
xor eax, eax
mov ebx, 200*65536+325
@ -33,14 +34,14 @@ red:
xor edx, edx
xor esi, esi
mov edi, 0x00100000
int 0x40
mcall
mov al, 8
mov ebx, (325-19)*65536+12
mov ecx, 5*65536+12
inc edx
mov esi, 0x00400000
int 0x40
mcall
mov al, 4
mov ebx, 8*65536+8
@ -48,18 +49,18 @@ red:
mov edx, fire_label
push len00
pop esi
int 0x40
mcall
mov al, 12
push 2
pop ebx
int 0x40
mcall
still:
push 11
pop eax
int 0x40
mcall
dec eax
jz red
@ -71,7 +72,7 @@ still:
call image
push 3
pop eax
int 0x40
mcall
cmp eax, [curtime]
jz still
mov [curtime], eax
@ -81,25 +82,25 @@ print_fps:
mov ebx, (8+27*6)*65536+18
mov ecx, 8*65536+8
xor edx, edx
int 0x40
mcall
lea edx, [ebx-10]
mov al, 47
mov ebx, 30000h
xor ecx, ecx
xchg ecx, [fps]
mov esi, 0x00FFFFFF ;0x00400000
int 0x40
mcall
jmp still
key:
mov al, 2
int 0x40
mcall
cmp ah, 1Bh ;<Esc>
jne still
button:
; we have only one button, close
or eax, -1
int 0x40
mcall
image:

View File

@ -1,4 +1,5 @@
@erase lang.inc
@echo lang fix en >lang.inc
@fasm free3d04.asm free3d04
@erase lang.inc
@pause

View File

@ -1,4 +1,5 @@
@erase lang.inc
@echo lang fix ru >lang.inc
@fasm free3d04.asm free3d04
@erase lang.inc
@pause

View File

@ -35,7 +35,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.inc'
@ -63,12 +63,12 @@ gamestart:
; ******* MOUSE CHECK *******
; mov eax,37 ; check mouse (use mouse over window to navigate)
; mov ebx,2 ; check mousebuttons
; int 0x40
; mcall
; cmp eax,0 ; only use mouse when button down
; je noneed ; deactivated cause of disappear-bug etc.
mov eax,37
mov ebx,1 ; check mouseposition
int 0x40
mcall
mov ebx,eax
shr eax,16
@ -99,7 +99,7 @@ check_refresh:
; mov eax,23 ; wait for system event with 10 ms timeout
; mov ebx,1 ; thats max 100 FPS
mov eax,11 ; ask no wait for full speed
int 0x40
mcall
cmp eax,1 ; window redraw request ?
je red2
@ -126,7 +126,7 @@ red2: ; redraw
key2: ; key
mov eax,2
int 0x40
mcall
cmp al,1
je gamestart ; keybuffer empty
@ -284,14 +284,14 @@ m_right: ; turn right
button2: ; button
mov eax,17 ; get id
int 0x40
mcall
cmp ah,1 ; button id=1 ?
jne gamestart
; eo GAME mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
finish:
mov eax,-1 ; close this program
int 0x40
mcall
; *********************************************
@ -303,19 +303,19 @@ draw_window:
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,1 ; 1, start of draw
int 0x40
mcall
; DRAW WINDOW
mov eax,0 ; function 0 : define and draw window
mov ebx,50*65536+649 ; [x start] *65536 + [x size]
mov ecx,50*65536+504 ; [y start] *65536 + [y size]
mov edx,0x33ffffff ; color of work area RRGGBB,8->color gl
mov edi,header
int 0x40
mov edi,title
mcall
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,2 ; 2, end of draw
int 0x40
mcall
ret
@ -811,7 +811,7 @@ speedup:
mov ebx,0x80000
mov ecx,640*65536+480
xor edx,edx
int 0x40
mcall
ret
@ -991,7 +991,7 @@ dd 0x0001FFFF ; initial player position * 0xFFFF
vpy:
dd 0x0001FFFF
header db 'FISHEYE RAYCASTING ENGINE ETC. FREE3D',0
title db 'FISHEYE RAYCASTING ENGINE ETC. FREE3D',0
sindegree dd 0.0
sininc dd 0.0017453292519943295769236907684886

View File

@ -1,267 +0,0 @@
; new application structure
macro meos_app_start
{
use32
org 0x0
db 'MENUET01'
dd 0x01
dd __start
dd __end
dd __memory
dd __stack
if used __params & ~defined __params
dd __params
else
dd 0x0
end if
dd 0x0
}
MEOS_APP_START fix meos_app_start
macro code
{
__start:
}
CODE fix code
macro data
{
__data:
}
DATA fix data
macro udata
{
if used __params & ~defined __params
__params:
db 0
__end:
rb 255
else
__end:
end if
__udata:
}
UDATA fix udata
macro meos_app_end
{
align 32
rb 2048
__stack:
__memory:
}
MEOS_APP_END fix meos_app_end
; macro for defining multiline text data
struc mstr [sstring]
{
forward
local ssize
virtual at 0
db sstring
ssize = $
end virtual
dd ssize
db sstring
common
dd -1
}
; strings
macro sz name,[data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if used name
db data
end if
common
if used name
.size = $-name
end if
}
macro lsz name,[lng,data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if (used name)&(lang eq lng)
db data
end if
common
if used name
.size = $-name
end if
}
; easy system call macro
macro mpack dest, hsrc, lsrc
{
if (hsrc eqtype 0) & (lsrc eqtype 0)
mov dest, (hsrc) shl 16 + lsrc
else
if (hsrc eqtype 0) & (~lsrc eqtype 0)
mov dest, (hsrc) shl 16
add dest, lsrc
else
mov dest, hsrc
shl dest, 16
add dest, lsrc
end if
end if
}
macro __mov reg,a,b { ; mike.dld
if (~a eq)&(~b eq)
mpack reg,a,b
else if (~a eq)&(b eq)
mov reg,a
end if
}
macro mcall a,b,c,d,e,f { ; mike.dld
__mov eax,a
__mov ebx,b
__mov ecx,c
__mov edx,d
__mov esi,e
__mov edi,f
int 0x40
}
; optimize the code for size
__regs fix <eax,ebx,ecx,edx,esi,edi,ebp,esp>
macro add arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
inc arg1
else
add arg1,arg2
end if
else
add arg1,arg2
end if
}
macro sub arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
dec arg1
else
sub arg1,arg2
end if
else
sub arg1,arg2
end if
}
macro mov arg1,arg2
{
if (arg1 in __regs) & (arg2 eqtype 0)
if (arg2) = 0
xor arg1,arg1
else if (arg2) = 1
xor arg1,arg1
inc arg1
else if (arg2) = -1
or arg1,-1
else if (arg2) > -128 & (arg2) < 128
push arg2
pop arg1
else
mov arg1,arg2
end if
else
mov arg1,arg2
end if
}
macro struct name
{
virtual at 0
name name
sizeof.#name = $ - name
end virtual
}
; structures used in MeOS
struc process_information
{
.cpu_usage dd ? ; +0
.window_stack_position dw ? ; +4
.window_stack_value dw ? ; +6
.not_used1 dw ? ; +8
.process_name rb 12 ; +10
.memory_start dd ? ; +22
.used_memory dd ? ; +26
.PID dd ? ; +30
.x_start dd ? ; +34
.y_start dd ? ; +38
.x_size dd ? ; +42
.y_size dd ? ; +46
.slot_state dw ? ; +50
rb (1024-52)
}
struct process_information
struc system_colors
{
.frame dd ?
.grab dd ?
.grab_button dd ?
.grab_button_text dd ?
.grab_text dd ?
.work dd ?
.work_button dd ?
.work_button_text dd ?
.work_text dd ?
.work_graph dd ?
}
struct system_colors
; constants
; events
EV_IDLE = 0
EV_TIMER = 0
EV_REDRAW = 1
EV_KEY = 2
EV_BUTTON = 3
EV_EXIT = 4
EV_BACKGROUND = 5
EV_MOUSE = 6
EV_IPC = 7
EV_STACK = 8
; event mask bits for function 40
EVM_REDRAW = 1b
EVM_KEY = 10b
EVM_BUTTON = 100b
EVM_EXIT = 1000b
EVM_BACKGROUND = 10000b
EVM_MOUSE = 100000b
EVM_IPC = 1000000b
EVM_STACK = 10000000b

View File

@ -1,4 +1,5 @@
@erase lang.inc
@echo lang fix en >lang.inc
@fasm magnify.asm magnify
@erase lang.inc
@pause

View File

@ -1,4 +1,5 @@
@erase lang.inc
@echo lang fix ru >lang.inc
@fasm magnify.asm magnify
@erase lang.inc
@pause

View File

@ -1,267 +0,0 @@
; new application structure
macro meos_app_start
{
use32
org 0x0
db 'MENUET01'
dd 0x01
dd __start
dd __end
dd __memory
dd __stack
if used __params & ~defined __params
dd __params
else
dd 0x0
end if
dd 0x0
}
MEOS_APP_START fix meos_app_start
macro code
{
__start:
}
CODE fix code
macro data
{
__data:
}
DATA fix data
macro udata
{
if used __params & ~defined __params
__params:
db 0
__end:
rb 255
else
__end:
end if
__udata:
}
UDATA fix udata
macro meos_app_end
{
align 32
rb 2048
__stack:
__memory:
}
MEOS_APP_END fix meos_app_end
; macro for defining multiline text data
struc mstr [sstring]
{
forward
local ssize
virtual at 0
db sstring
ssize = $
end virtual
dd ssize
db sstring
common
dd -1
}
; strings
macro sz name,[data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if used name
db data
end if
common
if used name
.size = $-name
end if
}
macro lsz name,[lng,data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if (used name)&(lang eq lng)
db data
end if
common
if used name
.size = $-name
end if
}
; easy system call macro
macro mpack dest, hsrc, lsrc
{
if (hsrc eqtype 0) & (lsrc eqtype 0)
mov dest, (hsrc) shl 16 + lsrc
else
if (hsrc eqtype 0) & (~lsrc eqtype 0)
mov dest, (hsrc) shl 16
add dest, lsrc
else
mov dest, hsrc
shl dest, 16
add dest, lsrc
end if
end if
}
macro __mov reg,a,b { ; mike.dld
if (~a eq)&(~b eq)
mpack reg,a,b
else if (~a eq)&(b eq)
mov reg,a
end if
}
macro mcall a,b,c,d,e,f { ; mike.dld
__mov eax,a
__mov ebx,b
__mov ecx,c
__mov edx,d
__mov esi,e
__mov edi,f
int 0x40
}
; optimize the code for size
__regs fix <eax,ebx,ecx,edx,esi,edi,ebp,esp>
macro add arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
inc arg1
else
add arg1,arg2
end if
else
add arg1,arg2
end if
}
macro sub arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
dec arg1
else
sub arg1,arg2
end if
else
sub arg1,arg2
end if
}
macro mov arg1,arg2
{
if (arg1 in __regs) & (arg2 eqtype 0)
if (arg2) = 0
xor arg1,arg1
else if (arg2) = 1
xor arg1,arg1
inc arg1
else if (arg2) = -1
or arg1,-1
else if (arg2) > -128 & (arg2) < 128
push arg2
pop arg1
else
mov arg1,arg2
end if
else
mov arg1,arg2
end if
}
macro struct name
{
virtual at 0
name name
sizeof.#name = $ - name
end virtual
}
; structures used in MeOS
struc process_information
{
.cpu_usage dd ? ; +0
.window_stack_position dw ? ; +4
.window_stack_value dw ? ; +6
.not_used1 dw ? ; +8
.process_name rb 12 ; +10
.memory_start dd ? ; +22
.used_memory dd ? ; +26
.PID dd ? ; +30
.x_start dd ? ; +34
.y_start dd ? ; +38
.x_size dd ? ; +42
.y_size dd ? ; +46
.slot_state dw ? ; +50
rb (1024-52)
}
struct process_information
struc system_colors
{
.frame dd ?
.grab dd ?
.grab_button dd ?
.grab_button_text dd ?
.grab_text dd ?
.work dd ?
.work_button dd ?
.work_button_text dd ?
.work_text dd ?
.work_graph dd ?
}
struct system_colors
; constants
; events
EV_IDLE = 0
EV_TIMER = 0
EV_REDRAW = 1
EV_KEY = 2
EV_BUTTON = 3
EV_EXIT = 4
EV_BACKGROUND = 5
EV_MOUSE = 6
EV_IPC = 7
EV_STACK = 8
; event mask bits for function 40
EVM_REDRAW = 1b
EVM_KEY = 10b
EVM_BUTTON = 100b
EVM_EXIT = 1000b
EVM_BACKGROUND = 10000b
EVM_MOUSE = 100000b
EVM_IPC = 1000000b
EVM_STACK = 10000000b

View File

@ -16,7 +16,7 @@ use32
dd 0x1000 ; esp
dd 0, 0 ; no parameters, no path
include 'macros.inc'
include '..\..\..\macros.inc'
delay equ 20
magnify_width = 40
@ -30,7 +30,7 @@ still:
wtevent:
mov eax, 23 ; wait here for event with timeout
mov ebx, delay
int 0x40
mcall
dec eax
js still
jz redraw
@ -38,12 +38,12 @@ wtevent:
jnz button
; key in buffer
mov al, 2
int 0x40
mcall
jmp wtevent
button:
; we have only one button, close
or eax, -1
int 0x40
mcall
; *********************************************
; ******* WINDOW DEFINITIONS AND DRAW ********
@ -52,11 +52,11 @@ button:
draw_window:
mov eax, 12 ; function 12:tell os about windowdraw
mov ebx, 1 ; 1, start of draw
int 0x40
mcall
mov al, 48 ; function 48 : graphics parameters
mov bl, 4 ; subfunction 4 : get skin height
int 0x40
mcall
; DRAW WINDOW
mov ebx, 100*65536 + 8*magnify_width + 8
@ -64,19 +64,19 @@ draw_window:
mov edx, 0x33000000 ; color of work area RRGGBB
mov edi, labelt ; header
xor eax, eax ; function 0 : define and draw window
int 0x40
mcall
mov al, 12 ; function 12:tell os about windowdraw
mov ebx, 2 ; 2, end of draw
int 0x40
mcall
ret
draw_screen:
draw_magnify:
mov eax, 14
int 0x40 ; get screen size
mcall ; get screen size
movzx ecx, ax
inc ecx
mov [size_y], ecx
@ -86,7 +86,7 @@ draw_magnify:
mov eax, 37
xor ebx, ebx
int 0x40 ; get mouse coordinates
mcall ; get mouse coordinates
mov ecx, eax
shr ecx, 16 ; ecx = x
movzx edx, ax ; edx = y
@ -113,7 +113,7 @@ draw_magnify:
imul ebx, [size_x]
add ebx, ecx
mov eax, 35
int 0x40 ; read pixel
mcall ; read pixel
.nopix:
push ecx edx
sub ecx, [m_x]
@ -126,7 +126,7 @@ draw_magnify:
mov cl, 7
mov edx, eax
mov eax, 13
int 0x40
mcall
pop edx ecx
inc ecx
cmp ecx, [m_xe]

View File

@ -1,4 +1,5 @@
@erase lang.inc
@echo lang fix en >lang.inc
@fasm movback.asm movback
@erase lang.inc
@pause

View File

@ -1,4 +1,5 @@
@erase lang.inc
@echo lang fix ru >lang.inc
@fasm movback.asm movback
@erase lang.inc
@pause

View File

@ -1,267 +0,0 @@
; new application structure
macro meos_app_start
{
use32
org 0x0
db 'MENUET01'
dd 0x01
dd __start
dd __end
dd __memory
dd __stack
if used __params & ~defined __params
dd __params
else
dd 0x0
end if
dd 0x0
}
MEOS_APP_START fix meos_app_start
macro code
{
__start:
}
CODE fix code
macro data
{
__data:
}
DATA fix data
macro udata
{
if used __params & ~defined __params
__params:
db 0
__end:
rb 255
else
__end:
end if
__udata:
}
UDATA fix udata
macro meos_app_end
{
align 32
rb 2048
__stack:
__memory:
}
MEOS_APP_END fix meos_app_end
; macro for defining multiline text data
struc mstr [sstring]
{
forward
local ssize
virtual at 0
db sstring
ssize = $
end virtual
dd ssize
db sstring
common
dd -1
}
; strings
macro sz name,[data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if used name
db data
end if
common
if used name
.size = $-name
end if
}
macro lsz name,[lng,data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if (used name)&(lang eq lng)
db data
end if
common
if used name
.size = $-name
end if
}
; easy system call macro
macro mpack dest, hsrc, lsrc
{
if (hsrc eqtype 0) & (lsrc eqtype 0)
mov dest, (hsrc) shl 16 + lsrc
else
if (hsrc eqtype 0) & (~lsrc eqtype 0)
mov dest, (hsrc) shl 16
add dest, lsrc
else
mov dest, hsrc
shl dest, 16
add dest, lsrc
end if
end if
}
macro __mov reg,a,b { ; mike.dld
if (~a eq)&(~b eq)
mpack reg,a,b
else if (~a eq)&(b eq)
mov reg,a
end if
}
macro mcall a,b,c,d,e,f { ; mike.dld
__mov eax,a
__mov ebx,b
__mov ecx,c
__mov edx,d
__mov esi,e
__mov edi,f
int 0x40
}
; optimize the code for size
__regs fix <eax,ebx,ecx,edx,esi,edi,ebp,esp>
macro add arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
inc arg1
else
add arg1,arg2
end if
else
add arg1,arg2
end if
}
macro sub arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
dec arg1
else
sub arg1,arg2
end if
else
sub arg1,arg2
end if
}
macro mov arg1,arg2
{
if (arg1 in __regs) & (arg2 eqtype 0)
if (arg2) = 0
xor arg1,arg1
else if (arg2) = 1
xor arg1,arg1
inc arg1
else if (arg2) = -1
or arg1,-1
else if (arg2) > -128 & (arg2) < 128
push arg2
pop arg1
else
mov arg1,arg2
end if
else
mov arg1,arg2
end if
}
macro struct name
{
virtual at 0
name name
sizeof.#name = $ - name
end virtual
}
; structures used in MeOS
struc process_information
{
.cpu_usage dd ? ; +0
.window_stack_position dw ? ; +4
.window_stack_value dw ? ; +6
.not_used1 dw ? ; +8
.process_name rb 12 ; +10
.memory_start dd ? ; +22
.used_memory dd ? ; +26
.PID dd ? ; +30
.x_start dd ? ; +34
.y_start dd ? ; +38
.x_size dd ? ; +42
.y_size dd ? ; +46
.slot_state dw ? ; +50
rb (1024-52)
}
struct process_information
struc system_colors
{
.frame dd ?
.grab dd ?
.grab_button dd ?
.grab_button_text dd ?
.grab_text dd ?
.work dd ?
.work_button dd ?
.work_button_text dd ?
.work_text dd ?
.work_graph dd ?
}
struct system_colors
; constants
; events
EV_IDLE = 0
EV_TIMER = 0
EV_REDRAW = 1
EV_KEY = 2
EV_BUTTON = 3
EV_EXIT = 4
EV_BACKGROUND = 5
EV_MOUSE = 6
EV_IPC = 7
EV_STACK = 8
; event mask bits for function 40
EVM_REDRAW = 1b
EVM_KEY = 10b
EVM_BUTTON = 100b
EVM_EXIT = 1000b
EVM_BACKGROUND = 10000b
EVM_MOUSE = 100000b
EVM_IPC = 1000000b
EVM_STACK = 10000000b

View File

@ -1,5 +1,5 @@
include "lang.inc"
include "macros.inc"
include "..\..\..\macros.inc"
WND_SIZE_X = 320
WND_SIZE_Y = 200
@ -15,13 +15,13 @@ CODE
call init_palette
mov eax,40
mov ebx,101b
int 0x40
mcall
jmp .paint_window
.event_loop:
mov eax,23
mov ebx,1
int 0x40
mcall
test eax,eax
je .draw_screen
@ -29,7 +29,7 @@ CODE
je .paint_window
or eax,-1
int 0x40
mcall
.draw_screen:
add word [ver_counter],VC_DELTA
@ -39,30 +39,30 @@ CODE
mov ebx,virtual_screen_32
mov ecx,(WND_SIZE_X shl 16)+WND_SIZE_Y
xor edx,edx
int 0x40
mcall
jmp .event_loop
.paint_window:
mov eax,12
mov ebx,1
int 0x40
mcall
xor eax,eax
mov ebx,(100 shl 16)+(WND_SIZE_X+9)
mov ecx,(100 shl 16)+(WND_SIZE_Y+28)
mov edx,0x33000000
mov edi,header
int 0x40
mov edi,title
mcall
mov eax,7
mov ebx,virtual_screen_32
mov ecx,(WND_SIZE_X shl 16)+WND_SIZE_Y
xor edx,edx
int 0x40
mcall
mov eax,12
mov ebx,2
int 0x40
mcall
jmp .event_loop
@ -160,7 +160,7 @@ DATA
delta_angle dd 0.0245436926066 ; pi/128
scale_sin dd 128.0
header db 'MoveBack',0
title db 'MoveBack',0
UDATA
ver_counter dd ?

View File

@ -1,4 +1,5 @@
@erase lang.inc
@echo lang fix en >lang.inc
@fasm plasma.asm plasma
@erase lang.inc
@pause

View File

@ -1,4 +1,5 @@
@erase lang.inc
@echo lang fix ru >lang.inc
@fasm plasma.asm plasma
@erase lang.inc
@pause

View File

@ -1,266 +0,0 @@
; new application structure
macro meos_app_start
{
use32
org 0x0
db 'MENUET01'
dd 0x01
dd __start
dd __end
dd __memory
dd __stack
if used __params & ~defined __params
dd __params
else
dd 0x0
end if
dd 0x0
}
MEOS_APP_START fix meos_app_start
macro code
{
__start:
}
CODE fix code
macro data
{
__data:
}
DATA fix data
macro udata
{
if used __params & ~defined __params
__params:
db 0
__end:
rb 255
else
__end:
end if
__udata:
}
UDATA fix udata
macro meos_app_end
{
align 32
rb 2048
__stack:
__memory:
}
MEOS_APP_END fix meos_app_end
; macro for defining multiline text data
struc mstr [sstring]
{
forward
local ssize
virtual at 0
db sstring
ssize = $
end virtual
dd ssize
db sstring
common
dd -1
}
; strings
macro sz name,[data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if used name
db data
end if
common
if used name
.size = $-name
end if
}
macro lsz name,[lng,data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if (used name)&(lang eq lng)
db data
end if
common
if used name
.size = $-name
end if
}
; easy system call macro
macro mpack dest, hsrc, lsrc
{
if (hsrc eqtype 0) & (lsrc eqtype 0)
mov dest, (hsrc) shl 16 + lsrc
else
if (hsrc eqtype 0) & (~lsrc eqtype 0)
mov dest, (hsrc) shl 16
add dest, lsrc
else
mov dest, hsrc
shl dest, 16
add dest, lsrc
end if
end if
}
macro __mov reg,a,b { ; mike.dld
if (~a eq)&(~b eq)
mpack reg,a,b
else if (~a eq)&(b eq)
mov reg,a
end if
}
macro mcall a,b,c,d,e,f { ; mike.dld
__mov eax,a
__mov ebx,b
__mov ecx,c
__mov edx,d
__mov esi,e
__mov edi,f
int 0x40
}
; optimize the code for size
__regs fix <eax,ebx,ecx,edx,esi,edi,ebp,esp>
macro add arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
inc arg1
else
add arg1,arg2
end if
else
add arg1,arg2
end if
}
macro sub arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
dec arg1
else
sub arg1,arg2
end if
else
sub arg1,arg2
end if
}
macro mov arg1,arg2
{
if (arg1 in __regs) & (arg2 eqtype 0)
if (arg2) = 0
xor arg1,arg1
else if (arg2) = 1
xor arg1,arg1
inc arg1
else if (arg2) = -1
or arg1,-1
else if (arg2) > -128 & (arg2) < 128
push arg2
pop arg1
else
mov arg1,arg2
end if
else
mov arg1,arg2
end if
}
macro struct name
{
virtual at 0
name name
sizeof.#name = $ - name
end virtual
}
; structures used in MeOS
struc process_information
{
.cpu_usage dd ? ; +0
.window_stack_position dw ? ; +4
.window_stack_value dw ? ; +6
.not_used1 dw ? ; +8
.process_name rb 12 ; +10
.memory_start dd ? ; +22
.used_memory dd ? ; +26
.PID dd ? ; +30
.x_start dd ? ; +34
.y_start dd ? ; +38
.x_size dd ? ; +42
.y_size dd ? ; +46
.slot_state dw ? ; +50
rb (1024-52)
}
struct process_information
struc system_colors
{
.frame dd ?
.grab dd ?
.grab_button dd ?
.grab_button_text dd ?
.grab_text dd ?
.work dd ?
.work_button dd ?
.work_button_text dd ?
.work_text dd ?
.work_graph dd ?
}
struct system_colors
; constants
; events
EV_IDLE = 0
EV_TIMER = 0
EV_REDRAW = 1
EV_KEY = 2
EV_BUTTON = 3
EV_EXIT = 4
EV_BACKGROUND = 5
EV_MOUSE = 6
EV_IPC = 7
EV_STACK = 8
; event mask bits for function 40
EVM_REDRAW = 1b
EVM_KEY = 10b
EVM_BUTTON = 100b
EVM_EXIT = 1000b
EVM_BACKGROUND = 10000b
EVM_MOUSE = 100000b
EVM_IPC = 1000000b
EVM_STACK = 10000000b

View File

@ -1,6 +1,6 @@
; Originally written by Jarek Pelczar
include "lang.inc"
include "macros.inc"
include "..\..\..\macros.inc"
WND_SIZE_X = 320
WND_SIZE_Y = 200
@ -10,21 +10,21 @@ CODE
fninit
mov al,40
mov bl,101b
int 0x40
mcall
call init_palette
call init_texture
jmp .paint_window
.event_loop:
mov al,23
mov ebx,1
int 0x40
mcall
test eax,eax
je .draw_screen
dec eax
je .paint_window
or eax,-1
int 0x40
mcall
.draw_screen:
call blit_8_to_32
@ -32,7 +32,7 @@ CODE
mov ebx,virtual_screen_32
mov ecx,(WND_SIZE_X shl 16)+WND_SIZE_Y
xor edx,edx
int 0x40
mcall
call rotate_pal
jmp .event_loop
@ -41,24 +41,24 @@ CODE
push eax
xor ebx,ebx
inc ebx
int 0x40
mcall
xor eax,eax
mov ebx,(100 shl 16)+(WND_SIZE_X+8)
mov ecx,(100 shl 16)+(WND_SIZE_Y+25)
mov edx,0x33000000
mov edi,header
int 0x40
mov edi,title
mcall
mov al,7
mov ebx,virtual_screen_32
mov ecx,(WND_SIZE_X shl 16)+WND_SIZE_Y
xor edx,edx
int 0x40
mcall
pop eax
and ebx,2 ; bit 1 is set
int 0x40
mcall
jmp .event_loop
@ -161,7 +161,7 @@ include "graph8.inc"
DATA
_multiplier dd 63.5
header db 'Plasma',0
title db 'Plasma',0
UDATA
_fpom32 rd 1

View File

@ -14,22 +14,22 @@
dd 0x0 , 0x0 ; I_Param , I_Icon
include 'lang.inc'
include 'macros.inc'
include '..\..\..\macros.inc'
;include 'debug.inc'
START:
mov eax,14
int 0x40
mcall
and eax,0xFFFF0000
mov [top_right_corner],eax
mov eax,40 ; ãáâ ­®¢¨âì ¬ áªã ᮡë⨩
mov ebx,110010b ; ॠ£¨à㥬 ­  ª« ¢¨ âãàã, ¬ëèì, ®âà¨á®¢ªã ä®­ 
int 0x40
mcall
mov eax,14 ; ¯®«ã稬 à §¬¥àë íªà ­ 
int 0x40
mcall
mov [y_max],ax
shr eax,16
mov [x_max],ax
@ -37,18 +37,18 @@ START:
event: ; ®¡à ¡®â稪 ᮡë⨩ (¢á¥å)
mov eax,26
mov ebx,9
int 0x40 ; ¯®«ãç¨âì ¢à¥¬ï á¨á⥬ë
mcall ; ¯®«ãç¨âì ¢à¥¬ï á¨á⥬ë
; mov eax,3
; int 0x40
; mcall
mov [evtime],eax ; § ¯®¬­¨âì ¥£®
mov eax,37
mov ebx,2
int 0x40
mcall
cmp eax,3 ; ¯à®¤®«¦¨¬, ¥á«¨ ­ ¦ â  á।­ïï ª­®¯ª  ¬ëè¨
jne still
mov eax,37 ; ¯à®¢¥à¨¬ ª®®à¤¨­ âë
mov ebx,0
int 0x40
mcall
cmp [top_right_corner],eax
je create_setup ; ᮧ¤ ñ¬ ®ª­® ­ áâனª¨, ¥á«¨ ¬ëèì ¢ ¢¥àå­¥¬ ¯à ¢®¬
; 㣫ã íªà ­ 
@ -59,7 +59,7 @@ still: ;
mov eax,23 ; ¦¤ñ¬ ᮡëâ¨ï ¢ â¥ç¥­¨¥ 1 ᥪ㭤ë
mov ebx,100
int 0x40
mcall
bt dword [params],0 ; ssaver works?
jc event
@ -75,7 +75,7 @@ still: ;
mov eax,26
mov ebx,9
int 0x40
mcall
sub eax,[evtime]
xor edx,edx
mov ebx,60*100 ; ¯®¤¥«¨¬ ­  60*100, ¯®«ã稬 ¢à¥¬ï ¢ ¬¨­ãâ å
@ -97,7 +97,7 @@ still: ;
mov ebx,1
mov ecx,sthread
mov edx,0x3F000
int 0x40
mcall
bts dword [params],1
jmp still
@ -106,17 +106,17 @@ still: ;
mov ebx,1
mov ecx,thread
mov edx,0x3E000
int 0x40
mcall
bts dword [params],0
ret
thread:
mov eax,5
mov ebx,eax
int 0x40
mcall
mov eax,40
mov ebx,100010b
int 0x40
mcall
cmp dword [type],0
je drawsswin
cmp dword [type],24
@ -135,7 +135,7 @@ still: ;
mov dword [delay],25
mov eax,58
mov ebx,fileinfo
int 0x40
mcall
asminit1:
mov eax,data_from_file
mov [stringstart],eax
@ -152,14 +152,14 @@ still: ;
inc ebx
inc ecx
mov edx,0x01000000
int 0x40
mcall
mov eax,13
xor edx,edx
int 0x40
mcall
tstill:
mov eax,23
mov ebx,[delay]
int 0x40
mcall
cmp eax,2
je thr_end
cmp eax,6
@ -174,10 +174,10 @@ still: ;
btr dword [params],0
mov eax,26
mov ebx,9
int 0x40
mcall
mov [evtime],eax
or eax,-1
int 0x40
mcall
drawssasm:
mov edi,[stringstart]
@ -204,7 +204,7 @@ still: ;
mov ecx,0x104ba010
mov edx,[stringstart]
mov esi,[stringlen]
int 0x40
mcall
inc dword [stringlen]
cmp byte [edi],byte ' '
je drawssasm
@ -276,7 +276,7 @@ draw_line:
mov eax,38
mov edx,[lcolor]
and edx,0xffffff
int 0x40
mcall
dnol:
@ -292,7 +292,7 @@ sthread: ; start of execution
sstill:
mov eax,10 ; wait here for event
int 0x40
mcall
cmp eax,1 ; redraw request ?
je sthread
@ -305,14 +305,14 @@ sstill:
sbutton: ; button
mov eax,17 ; get id
int 0x40
mcall
cmp ah,1 ; button id=1 ?
jne snoclose
btr dword [params],1
mov eax,-1 ; close this program
int 0x40
mcall
snoclose:
cmp ah,7
jne nosetfl
@ -362,7 +362,7 @@ sstill:
jne noshow
mov eax,5
mov ebx,150
int 0x40
mcall
call create_ss
jmp sstill
noshow:
@ -387,57 +387,53 @@ sdraw_window:
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,1 ; 1, start of draw
int 0x40
mcall
; DRAW WINDOW
xor eax,eax ; function 0 : define and draw window
mov ebx,100*65536+215 ; [x start] *65536 + [x size]
mov ecx,100*65536+70 ; [y start] *65536 + [y size]
mov edx,0x03400088 ; color of work area RRGGBB,8->color gl
int 0x40
mov edi,title
mcall
mov eax,8
mov ebx,47*65536+10
mov ecx,31*65536+10
mov edx,2
mov esi,0x702050
int 0x40
mcall
push ebx
add ebx,13*65536
mov edi,ebx
inc edx
int 0x40
mcall
pop ebx
add ecx,15*65536
inc edx
int 0x40
mcall
mov ebx,edi
inc edx
int 0x40
mcall
mov ebx,160*65536+40
mov ecx,28*65536+14
inc edx
int 0x40
; WINDOW LABEL
mcall
mov eax,4 ; function 4 : write text to window
mov ebx,8*65536+8 ; [x start] *65536 + [y start]
mov ecx,0x10ddeeff ; font 1 & color ( 0xF0RRGGBB )
mov edx,labelt ; pointer to text beginning
mov esi,17 ; text length
int 0x40
add ebx,7*65536+25
mov ebx,15*65536+33 ; [x start] *65536 + [y start]
mov ecx,0xffffff
mov edx,setuptext
mov esi,9
int 0x40
mcall
add ebx,15
add edx,esi
mov esi,30
int 0x40
mcall
mov ebx,169*65536+32
mov edx,buttext
mov esi,4
int 0x40
mcall
call drawtype
call drawtime
@ -445,7 +441,7 @@ sdraw_window:
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,2 ; 2, end of draw
int 0x40
mcall
ret
@ -458,14 +454,14 @@ drawtype:
jnc noblue
mov edx,0x4e00e7
noblue:
int 0x40
mcall
mov eax,4
mov ebx,82*65536+32
xor ecx,ecx
mov edx,typetext
add edx,[type]
mov esi,12
int 0x40
mcall
ret
drawtime:
@ -477,13 +473,13 @@ drawtime:
jnc noblue1
mov edx,0x4e00e7
noblue1:
int 0x40
mcall
mov eax,47
mov edx,82*65536+47
xor esi,esi
movzx ecx,byte [time]
mov ebx,0x00020000
int 0x40
mcall
ret
drawflag:
@ -492,7 +488,7 @@ drawflag:
mov ecx,45*65536+10
mov edx,7
mov esi,0xe0e0e0
int 0x40
mcall
mov eax,4
mov ebx,153*65536+47
xor ecx,ecx
@ -502,13 +498,13 @@ drawflag:
jc setf
inc edx
setf:
int 0x40
mcall
ret
; DATA AREA
buttext db 'SHOW'
flag db 'V '
labelt db 'SCREENSAVER SETUP'
title db 'SCREENSAVER SETUP',0
setuptext db 'TYPE: < >TIME: < > MINUTES NEVER'
typetext db 'BLACK SCREENCOLOR LINES ASSEMBLER '
type dd 12

View File

@ -1,4 +1,5 @@
@erase lang.inc
@echo lang fix en >lang.inc
@fasm @ss.asm @ss
@erase lang.inc
@pause

View File

@ -1,4 +1,5 @@
@erase lang.inc
@echo lang fix ru >lang.inc
@fasm @ss.asm @ss
@erase lang.inc
@pause

View File

@ -1,267 +0,0 @@
; new application structure
macro meos_app_start
{
use32
org 0x0
db 'MENUET01'
dd 0x01
dd __start
dd __end
dd __memory
dd __stack
if used __params & ~defined __params
dd __params
else
dd 0x0
end if
dd 0x0
}
MEOS_APP_START fix meos_app_start
macro code
{
__start:
}
CODE fix code
macro data
{
__data:
}
DATA fix data
macro udata
{
if used __params & ~defined __params
__params:
db 0
__end:
rb 255
else
__end:
end if
__udata:
}
UDATA fix udata
macro meos_app_end
{
align 32
rb 2048
__stack:
__memory:
}
MEOS_APP_END fix meos_app_end
; macro for defining multiline text data
struc mstr [sstring]
{
forward
local ssize
virtual at 0
db sstring
ssize = $
end virtual
dd ssize
db sstring
common
dd -1
}
; strings
macro sz name,[data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if used name
db data
end if
common
if used name
.size = $-name
end if
}
macro lsz name,[lng,data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if (used name)&(lang eq lng)
db data
end if
common
if used name
.size = $-name
end if
}
; easy system call macro
macro mpack dest, hsrc, lsrc
{
if (hsrc eqtype 0) & (lsrc eqtype 0)
mov dest, (hsrc) shl 16 + lsrc
else
if (hsrc eqtype 0) & (~lsrc eqtype 0)
mov dest, (hsrc) shl 16
add dest, lsrc
else
mov dest, hsrc
shl dest, 16
add dest, lsrc
end if
end if
}
macro __mov reg,a,b { ; mike.dld
if (~a eq)&(~b eq)
mpack reg,a,b
else if (~a eq)&(b eq)
mov reg,a
end if
}
macro mcall a,b,c,d,e,f { ; mike.dld
__mov eax,a
__mov ebx,b
__mov ecx,c
__mov edx,d
__mov esi,e
__mov edi,f
int 0x40
}
; optimize the code for size
__regs fix <eax,ebx,ecx,edx,esi,edi,ebp,esp>
macro add arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
inc arg1
else
add arg1,arg2
end if
else
add arg1,arg2
end if
}
macro sub arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
dec arg1
else
sub arg1,arg2
end if
else
sub arg1,arg2
end if
}
macro mov arg1,arg2
{
if (arg1 in __regs) & (arg2 eqtype 0)
if (arg2) = 0
xor arg1,arg1
else if (arg2) = 1
xor arg1,arg1
inc arg1
else if (arg2) = -1
or arg1,-1
else if (arg2) > -128 & (arg2) < 128
push arg2
pop arg1
else
mov arg1,arg2
end if
else
mov arg1,arg2
end if
}
macro struct name
{
virtual at 0
name name
sizeof.#name = $ - name
end virtual
}
; structures used in MeOS
struc process_information
{
.cpu_usage dd ? ; +0
.window_stack_position dw ? ; +4
.window_stack_value dw ? ; +6
.not_used1 dw ? ; +8
.process_name rb 12 ; +10
.memory_start dd ? ; +22
.used_memory dd ? ; +26
.PID dd ? ; +30
.x_start dd ? ; +34
.y_start dd ? ; +38
.x_size dd ? ; +42
.y_size dd ? ; +46
.slot_state dw ? ; +50
rb (1024-52)
}
struct process_information
struc system_colors
{
.frame dd ?
.grab dd ?
.grab_button dd ?
.grab_button_text dd ?
.grab_text dd ?
.work dd ?
.work_button dd ?
.work_button_text dd ?
.work_text dd ?
.work_graph dd ?
}
struct system_colors
; constants
; events
EV_IDLE = 0
EV_TIMER = 0
EV_REDRAW = 1
EV_KEY = 2
EV_BUTTON = 3
EV_EXIT = 4
EV_BACKGROUND = 5
EV_MOUSE = 6
EV_IPC = 7
EV_STACK = 8
; event mask bits for function 40
EVM_REDRAW = 1b
EVM_KEY = 10b
EVM_BUTTON = 100b
EVM_EXIT = 1000b
EVM_BACKGROUND = 10000b
EVM_MOUSE = 100000b
EVM_IPC = 1000000b
EVM_STACK = 10000000b

View File

@ -1,4 +1,5 @@
@erase lang.inc
@echo lang fix en >lang.inc
@fasm timer.asm timer
@erase lang.inc
@pause

View File

@ -1,4 +1,5 @@
@erase lang.inc
@echo lang fix ru >lang.inc
@fasm timer.asm timer
@erase lang.inc
@pause

View File

@ -1,266 +0,0 @@
; new application structure
macro meos_app_start
{
use32
org 0x0
db 'MENUET01'
dd 0x01
dd __start
dd __end
dd __memory
dd __stack
if used __params & ~defined __params
dd __params
else
dd 0x0
end if
dd 0x0
}
MEOS_APP_START fix meos_app_start
macro code
{
__start:
}
CODE fix code
macro data
{
__data:
}
DATA fix data
macro udata
{
if used __params & ~defined __params
__params:
db 0
__end:
rb 255
else
__end:
end if
__udata:
}
UDATA fix udata
macro meos_app_end
{
align 32
rb 2048
__stack:
__memory:
}
MEOS_APP_END fix meos_app_end
; macro for defining multiline text data
struc mstr [sstring]
{
forward
local ssize
virtual at 0
db sstring
ssize = $
end virtual
dd ssize
db sstring
common
dd -1
}
; strings
macro sz name,[data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if used name
db data
end if
common
if used name
.size = $-name
end if
}
macro lsz name,[lng,data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if (used name)&(lang eq lng)
db data
end if
common
if used name
.size = $-name
end if
}
; easy system call macro
macro mpack dest, hsrc, lsrc
{
if (hsrc eqtype 0) & (lsrc eqtype 0)
mov dest, (hsrc) shl 16 + lsrc
else
if (hsrc eqtype 0) & (~lsrc eqtype 0)
mov dest, (hsrc) shl 16
add dest, lsrc
else
mov dest, hsrc
shl dest, 16
add dest, lsrc
end if
end if
}
macro __mov reg,a { ; mike.dld
if ~a eq
mov reg,a
end if
}
macro mcall a,b,c,d,e,f { ; mike.dld
__mov eax,a
__mov ebx,b
__mov ecx,c
__mov edx,d
__mov esi,e
__mov edi,f
int 0x40
}
; language for programs
lang fix ru ; ru en fr ge fi
; optimize the code for size
__regs fix <eax,ebx,ecx,edx,esi,edi,ebp,esp>
macro add arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
inc arg1
else
add arg1,arg2
end if
else
add arg1,arg2
end if
}
macro sub arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
dec arg1
else
sub arg1,arg2
end if
else
sub arg1,arg2
end if
}
macro mov arg1,arg2
{
if (arg1 in __regs) & (arg2 eqtype 0)
if (arg2) = 0
xor arg1,arg1
else if (arg2) = 1
xor arg1,arg1
inc arg1
else if (arg2) = -1
or arg1,-1
else if (arg2) > -128 & (arg2) < 128
push arg2
pop arg1
else
mov arg1,arg2
end if
else
mov arg1,arg2
end if
}
macro struct name
{
virtual at 0
name name
sizeof.#name = $ - name
end virtual
}
; structures used in MeOS
struc process_information
{
.cpu_usage dd ? ; +0
.window_stack_position dw ? ; +4
.window_stack_value dw ? ; +6
.not_used1 dw ? ; +8
.process_name rb 12 ; +10
.memory_start dd ? ; +22
.used_memory dd ? ; +26
.PID dd ? ; +30
.x_start dd ? ; +34
.y_start dd ? ; +38
.x_size dd ? ; +42
.y_size dd ? ; +46
.slot_state dw ? ; +50
rb (1024-52)
}
struct process_information
struc system_colors
{
.frame dd ?
.grab dd ?
.grab_button dd ?
.grab_button_text dd ?
.grab_text dd ?
.work dd ?
.work_button dd ?
.work_button_text dd ?
.work_text dd ?
.work_graph dd ?
}
struct system_colors
; constants
; events
EV_IDLE = 0
EV_TIMER = 0
EV_REDRAW = 1
EV_KEY = 2
EV_BUTTON = 3
EV_EXIT = 4
EV_BACKGROUND = 5
EV_MOUSE = 6
EV_IPC = 7
EV_STACK = 8
; event mask bits for function 40
EVM_REDRAW = 1b
EVM_KEY = 10b
EVM_BUTTON = 100b
EVM_EXIT = 1000b
EVM_BACKGROUND = 10000b
EVM_MOUSE = 100000b
EVM_IPC = 1000000b
EVM_STACK = 10000000b

View File

@ -17,12 +17,12 @@ use32
dd 0x0 , 0x0 ; I_Param , I_Icon
include 'lang.inc'
include 'macros.inc'
include '..\..\..\macros.inc'
START: ; start of execution
mov eax, 40
mov ebx, 101b
int 0x40
mcall
red:
call draw_window
@ -31,7 +31,7 @@ still:
mov eax,23 ; wait here for event
mov ebx,50
int 0x40
mcall
cmp eax,1 ; redraw request ?
je red
@ -45,7 +45,7 @@ still:
button: ; button
or eax,-1 ; close this program
int 0x40
mcall
; *********************************************
@ -56,7 +56,7 @@ draw_clock:
mov eax, 26 ; get system counter
mov ebx, 9
int 0x40
mcall
cdq ;xor edx,edx
mov ebx,100
@ -83,7 +83,7 @@ draw_clock:
mov edi,[sc.work]
mov ebx,0x00020000
mov edx,15*65536+5
int 0x40
mcall
pop eax ; MM
imul ecx,ecx,60
@ -91,7 +91,7 @@ draw_clock:
mov ecx,eax
mov eax,47
add edx,20*65536
int 0x40
mcall
pop ecx
pop eax
@ -102,7 +102,7 @@ draw_clock:
mov ecx,eax ; SS
mov eax,47
add edx,20*65536
int 0x40
mcall
ret
@ -111,11 +111,11 @@ draw_window:
mov ebx,3
mov ecx,sc
mov edx,sizeof.system_colors
int 0x40
mcall
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,1 ; 1, start of draw
int 0x40
mcall
; DRAW WINDOW
xor eax,eax ; function 0 : define and draw window
@ -123,14 +123,14 @@ draw_window:
mov ecx,100*65536+40 ; [y start] *65536 + [y size]
mov edx,[sc.work] ; color of work area RRGGBB,8->color gl
or edx,0x33000000
mov edi,header
int 0x40
mov edi,title
mcall
call draw_clock
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,2 ; 2, end of draw
int 0x40
mcall
ret
@ -138,9 +138,9 @@ draw_window:
; DATA AREA
if lang eq ru
header db '€‰Œ…<C592>',0
title db '€‰Œ…<C592>',0
else
header db 'TIMER',0
title db 'TIMER',0
end if

View File

@ -1,4 +1,5 @@
@erase lang.inc
@echo lang fix en >lang.inc
@fasm tinyfrac.asm tinyfrac
@erase lang.inc
@pause

View File

@ -1,4 +1,5 @@
@erase lang.inc
@echo lang fix ru >lang.inc
@fasm tinyfrac.asm tinyfrac
@erase lang.inc
@pause

View File

@ -1,266 +0,0 @@
; new application structure
macro meos_app_start
{
use32
org 0x0
db 'MENUET01'
dd 0x01
dd __start
dd __end
dd __memory
dd __stack
if used __params & ~defined __params
dd __params
else
dd 0x0
end if
dd 0x0
}
MEOS_APP_START fix meos_app_start
macro code
{
__start:
}
CODE fix code
macro data
{
__data:
}
DATA fix data
macro udata
{
if used __params & ~defined __params
__params:
db 0
__end:
rb 255
else
__end:
end if
__udata:
}
UDATA fix udata
macro meos_app_end
{
align 32
rb 2048
__stack:
__memory:
}
MEOS_APP_END fix meos_app_end
; macro for defining multiline text data
struc mstr [sstring]
{
forward
local ssize
virtual at 0
db sstring
ssize = $
end virtual
dd ssize
db sstring
common
dd -1
}
; strings
macro sz name,[data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if used name
db data
end if
common
if used name
.size = $-name
end if
}
macro lsz name,[lng,data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if (used name)&(lang eq lng)
db data
end if
common
if used name
.size = $-name
end if
}
; easy system call macro
macro mpack dest, hsrc, lsrc
{
if (hsrc eqtype 0) & (lsrc eqtype 0)
mov dest, (hsrc) shl 16 + lsrc
else
if (hsrc eqtype 0) & (~lsrc eqtype 0)
mov dest, (hsrc) shl 16
add dest, lsrc
else
mov dest, hsrc
shl dest, 16
add dest, lsrc
end if
end if
}
macro __mov reg,a { ; mike.dld
if ~a eq
mov reg,a
end if
}
macro mcall a,b,c,d,e,f { ; mike.dld
__mov eax,a
__mov ebx,b
__mov ecx,c
__mov edx,d
__mov esi,e
__mov edi,f
int 0x40
}
; language for programs
lang fix ru ; ru en fr ge fi
; optimize the code for size
__regs fix <eax,ebx,ecx,edx,esi,edi,ebp,esp>
macro add arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
inc arg1
else
add arg1,arg2
end if
else
add arg1,arg2
end if
}
macro sub arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
dec arg1
else
sub arg1,arg2
end if
else
sub arg1,arg2
end if
}
macro mov arg1,arg2
{
if (arg1 in __regs) & (arg2 eqtype 0)
if (arg2) = 0
xor arg1,arg1
else if (arg2) = 1
xor arg1,arg1
inc arg1
else if (arg2) = -1
or arg1,-1
else if (arg2) > -128 & (arg2) < 128
push arg2
pop arg1
else
mov arg1,arg2
end if
else
mov arg1,arg2
end if
}
macro struct name
{
virtual at 0
name name
sizeof.#name = $ - name
end virtual
}
; structures used in MeOS
struc process_information
{
.cpu_usage dd ? ; +0
.window_stack_position dw ? ; +4
.window_stack_value dw ? ; +6
.not_used1 dw ? ; +8
.process_name rb 12 ; +10
.memory_start dd ? ; +22
.used_memory dd ? ; +26
.PID dd ? ; +30
.x_start dd ? ; +34
.y_start dd ? ; +38
.x_size dd ? ; +42
.y_size dd ? ; +46
.slot_state dw ? ; +50
rb (1024-52)
}
struct process_information
struc system_colors
{
.frame dd ?
.grab dd ?
.grab_button dd ?
.grab_button_text dd ?
.grab_text dd ?
.work dd ?
.work_button dd ?
.work_button_text dd ?
.work_text dd ?
.work_graph dd ?
}
struct system_colors
; constants
; events
EV_IDLE = 0
EV_TIMER = 0
EV_REDRAW = 1
EV_KEY = 2
EV_BUTTON = 3
EV_EXIT = 4
EV_BACKGROUND = 5
EV_MOUSE = 6
EV_IPC = 7
EV_STACK = 8
; event mask bits for function 40
EVM_REDRAW = 1b
EVM_KEY = 10b
EVM_BUTTON = 100b
EVM_EXIT = 1000b
EVM_BACKGROUND = 10000b
EVM_MOUSE = 100000b
EVM_IPC = 1000000b
EVM_STACK = 10000000b

View File

@ -83,7 +83,7 @@ use32
dd 0,0
include 'lang.inc'
include 'macros.inc'
include '..\..\..\macros.inc'
STARTX dd 200
STARTY dd 120
@ -93,32 +93,77 @@ scaleaddx dd 200
START:
red:
call draw_window
call draw_fractal
still:
mov eax,10
int 0x40
mcall
cmp eax,1
je red
cmp eax,2
je key
cmp eax,3
je button
dec eax
jz red
dec eax
jz key
button:
mov al,17
mcall
cmp ah,1
jne no_close
or eax,-1
mcall
no_close:
cmp ah,2
jne no_bgr
mov eax,15 ; bgr 512 x 256
mov ebx,1
mov ecx,512
mov edx,256
mcall
mov eax,15
mov ebx,5
mov ecx,0x1000
mov edx,0
mov esi,512*3*256
mcall
mov eax,15
mov ebx,3
mcall
jmp still
red:
call draw_window
call put_image
no_bgr:
cmp ah,3
jb no_color
cmp ah,5
jg no_color
shr eax,8
sub eax,3
imul eax,8
add eax,8
not eax
and eax,11000b
mov [shlc],al
call draw_fractal
jmp still
no_color:
jmp still
key:
mov eax,2
int 0x40
mov al,2
mcall
cmp ah,'e'
je cycle
@ -179,61 +224,6 @@ still:
call draw_fractal
jmp still
button:
mov eax,17
int 0x40
cmp ah,1
jne no_close
mov eax,-1
int 0x40
no_close:
cmp ah,2
jne no_bgr
mov eax,15 ; bgr 512 x 256
mov ebx,1
mov ecx,512
mov edx,256
int 0x40
mov eax,15
mov ebx,5
mov ecx,0x1000
mov edx,0
mov esi,512*3*256
int 0x40
mov eax,15
mov ebx,3
int 0x40
jmp still
no_bgr:
cmp ah,3
jb no_color
cmp ah,5
jg no_color
shr eax,8
sub eax,3
imul eax,8
add eax,8
not eax
and eax,11000b
; sub eax,8
mov [shlc],al
call draw_fractal
jmp still
no_color:
jmp still
color_cycle:
pusha
@ -257,7 +247,7 @@ color_cycle:
call put_image
mov eax,5
mov ebx,1
int 0x40
mcall
dec esi
jnz newcycle
@ -287,11 +277,10 @@ draw_fractal:
pusha
mov eax,4
mov ebx,15*65536+35
mov ecx,0xffffff
mov ebx,10*65536+30
mov ecx,0x80ffffff
mov edx,calc
mov esi,calcl-calc
int 0x40
mcall
popa
pusha
@ -309,12 +298,6 @@ draw_fractal:
push cx
; and cl,0x7
; cmp cl,0
; jne noim
; call put_image
; noim:
mov cx, PIXWIDTH -1 ; width of screen in pixels
sub bp,cx ;
@ -369,9 +352,9 @@ put_image:
mov eax,7
mov ebx,0x1000
mov ecx,512*65536+255
mov edx,10*65536+30
int 0x40
mov ecx,512*65536+256
mov edx,4*65536+21
mcall
popa
@ -446,38 +429,30 @@ draw_window:
mov eax,12
mov ebx,1
int 0x40
mcall
mov eax,0
mov ebx,50*65536+531
mov ecx,100*65536+256+48
mov edx,0x02334455
mov esi,0x80778899
mov edi,0x00778899
int 0x40
xor eax,eax
mov ebx,50*65536+PIXWIDTH+8
mov ecx,100*65536+PIXHEIGHT+25
mov edx,0x13334455
mov edi,title
mcall
mov eax,8
mov ebx,(531-19)*65536+12
mov ecx,5*65536+12
mov edx,1
mov esi,0x808080
int 0x40
mov eax,8
mov ebx,300*65536+112
mov ebx,290*65536+112
mov ecx,5*65536+12
mov edx,2
mov esi,0x808080
int 0x40
mcall
mov ebx,430*65536+12
mov ebx,420*65536+12
mov ecx,5*65536+12
mov edx,3
mov esi,0xa00000
mov edi,3
;mov eax,8
newcolor:
mov eax,8
int 0x40
mcall
add ebx,13*65536
shr esi,8
inc edx
@ -485,15 +460,14 @@ draw_window:
jnz newcolor
mov eax,4
mov ebx,8*65536+8
mov ecx,0xffffff
mov edx,l
mov esi,ll-l
int 0x40
mov ebx,300*65536+8
mov ecx,0x80ffffff
mov edx,button_txt
mcall
mov eax,12
mov ebx,2
int 0x40
mcall
popa
ret
@ -505,15 +479,9 @@ draw_window:
;
l: db 'TINYFRAC - MOVE: ARROWS, ZOOM Q/W, CYCLE: E/R '
db 'SET AS WALLPAPER'
ll:
title db 'Tinyfrac - MOVE: ARROWS, ZOOM Q/W, CYCLE: E/R',0
button_txt db 'Set as wallpaper',0
calc db 'CALCULATING'
calcl:
calc db 'CALCULATING',0
I_END:

View File

@ -1,4 +1,5 @@
@erase lang.inc
@echo lang fix en >lang.inc
@fasm transp.asm transp
@erase lang.inc
@pause

View File

@ -1,4 +1,5 @@
@erase lang.inc
@echo lang fix ru >lang.inc
@fasm transp.asm transp
@erase lang.inc
@pause

View File

@ -1,266 +0,0 @@
; new application structure
macro meos_app_start
{
use32
org 0x0
db 'MENUET01'
dd 0x01
dd __start
dd __end
dd __memory
dd __stack
if used __params & ~defined __params
dd __params
else
dd 0x0
end if
dd 0x0
}
MEOS_APP_START fix meos_app_start
macro code
{
__start:
}
CODE fix code
macro data
{
__data:
}
DATA fix data
macro udata
{
if used __params & ~defined __params
__params:
db 0
__end:
rb 255
else
__end:
end if
__udata:
}
UDATA fix udata
macro meos_app_end
{
align 32
rb 2048
__stack:
__memory:
}
MEOS_APP_END fix meos_app_end
; macro for defining multiline text data
struc mstr [sstring]
{
forward
local ssize
virtual at 0
db sstring
ssize = $
end virtual
dd ssize
db sstring
common
dd -1
}
; strings
macro sz name,[data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if used name
db data
end if
common
if used name
.size = $-name
end if
}
macro lsz name,[lng,data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if (used name)&(lang eq lng)
db data
end if
common
if used name
.size = $-name
end if
}
; easy system call macro
macro mpack dest, hsrc, lsrc
{
if (hsrc eqtype 0) & (lsrc eqtype 0)
mov dest, (hsrc) shl 16 + lsrc
else
if (hsrc eqtype 0) & (~lsrc eqtype 0)
mov dest, (hsrc) shl 16
add dest, lsrc
else
mov dest, hsrc
shl dest, 16
add dest, lsrc
end if
end if
}
macro __mov reg,a { ; mike.dld
if ~a eq
mov reg,a
end if
}
macro mcall a,b,c,d,e,f { ; mike.dld
__mov eax,a
__mov ebx,b
__mov ecx,c
__mov edx,d
__mov esi,e
__mov edi,f
int 0x40
}
; language for programs
lang fix ru ; ru en fr ge fi
; optimize the code for size
__regs fix <eax,ebx,ecx,edx,esi,edi,ebp,esp>
macro add arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
inc arg1
else
add arg1,arg2
end if
else
add arg1,arg2
end if
}
macro sub arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
dec arg1
else
sub arg1,arg2
end if
else
sub arg1,arg2
end if
}
macro mov arg1,arg2
{
if (arg1 in __regs) & (arg2 eqtype 0)
if (arg2) = 0
xor arg1,arg1
else if (arg2) = 1
xor arg1,arg1
inc arg1
else if (arg2) = -1
or arg1,-1
else if (arg2) > -128 & (arg2) < 128
push arg2
pop arg1
else
mov arg1,arg2
end if
else
mov arg1,arg2
end if
}
macro struct name
{
virtual at 0
name name
sizeof.#name = $ - name
end virtual
}
; structures used in MeOS
struc process_information
{
.cpu_usage dd ? ; +0
.window_stack_position dw ? ; +4
.window_stack_value dw ? ; +6
.not_used1 dw ? ; +8
.process_name rb 12 ; +10
.memory_start dd ? ; +22
.used_memory dd ? ; +26
.PID dd ? ; +30
.x_start dd ? ; +34
.y_start dd ? ; +38
.x_size dd ? ; +42
.y_size dd ? ; +46
.slot_state dw ? ; +50
rb (1024-52)
}
struct process_information
struc system_colors
{
.frame dd ?
.grab dd ?
.grab_button dd ?
.grab_button_text dd ?
.grab_text dd ?
.work dd ?
.work_button dd ?
.work_button_text dd ?
.work_text dd ?
.work_graph dd ?
}
struct system_colors
; constants
; events
EV_IDLE = 0
EV_TIMER = 0
EV_REDRAW = 1
EV_KEY = 2
EV_BUTTON = 3
EV_EXIT = 4
EV_BACKGROUND = 5
EV_MOUSE = 6
EV_IPC = 7
EV_STACK = 8
; event mask bits for function 40
EVM_REDRAW = 1b
EVM_KEY = 10b
EVM_BUTTON = 100b
EVM_EXIT = 1000b
EVM_BACKGROUND = 10000b
EVM_MOUSE = 100000b
EVM_IPC = 1000000b
EVM_STACK = 10000000b

View File

@ -17,13 +17,13 @@ use32
dd 0x0 , 0x0 ; I_Param , I_Icon
include 'lang.inc'
include 'macros.inc'
include '..\..\..\macros.inc'
START: ; start of execution
mov [procinfo.x_start], 100
mov [procinfo.x_size], 200
mov [procinfo.y_start], 80
mov [procinfo.y_size], 300
mov [procinfo.box.left], 100
mov [procinfo.box.width], 200
mov [procinfo.box.top], 80
mov [procinfo.box.height], 300
call draw_window
red:
call get_transparent
@ -32,7 +32,7 @@ red:
still:
mov eax,10 ; wait here for event
int 0x40
mcall
cmp eax,1 ; redraw request ?
je red
@ -44,17 +44,17 @@ still:
key: ; key
mov al,2 ; just read it and ignore
int 0x40
mcall
jmp still
button: ; button
mov al,17 ; get id
int 0x40
mcall
cmp ah,1 ; button id=1 ?
jne noclose
or eax,-1 ; close this program
int 0x40
mcall
noclose:
jmp still
@ -69,24 +69,24 @@ draw_window:
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,1 ; 1, start of draw
int 0x40
mcall
; DRAW WINDOW
xor eax,eax ; function 0 : define and draw window
mov ebx,[procinfo.x_start]
mov ebx,[procinfo.box.left]
shl ebx,16
add ebx,[procinfo.x_size]
mov ecx,[procinfo.y_start]
add ebx,[procinfo.box.width]
mov ecx,[procinfo.box.top]
shl ecx,16
add ecx,[procinfo.y_size]
add ecx,[procinfo.box.height]
mov edx,0x33000000 ; color of work area RRGGBB,8->color gl
mov edi,header ; WINDOW LABEL
int 0x40
mov edi,title ; WINDOW LABEL
mcall
call draw_transparent
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,2 ; 2, end of draw
int 0x40
mcall
ret
@ -99,11 +99,11 @@ draw_transparent:
mov eax,7
mov ebx,0x1000
mov ecx,[procinfo.x_size]
mov ecx,[procinfo.box.width]
shl ecx,16
add ecx,[procinfo.y_size]
add ecx,[procinfo.box.height]
xor edx,edx
int 0x40
mcall
popa
ret
@ -116,29 +116,29 @@ get_transparent:
mov eax,9
mov ebx,I_END
mov ecx,-1
int 0x40
mcall
mov eax,14
int 0x40
mcall
shr eax,16
inc eax
mov [scx],eax
add [procinfo.x_start], 4
sub [procinfo.x_size], 4+4
add [procinfo.y_start], 22
sub [procinfo.y_size], 22+4
add [procinfo.box.left], 4
sub [procinfo.box.width], 4+4
add [procinfo.box.top], 22
sub [procinfo.box.height], 22+4
mov eax,[procinfo.x_start]
add eax,[procinfo.x_size]
mov eax,[procinfo.box.left]
add eax,[procinfo.box.width]
mov [x_end],eax
mov eax,[procinfo.y_start]
add eax,[procinfo.y_size]
mov eax,[procinfo.box.top]
add eax,[procinfo.box.height]
mov [y_end],eax
mov eax,[procinfo.x_start]
mov ebx,[procinfo.y_start]
mov eax,[procinfo.box.left]
mov ebx,[procinfo.box.top]
dtpl1:
@ -148,15 +148,15 @@ get_transparent:
imul ebx,[scx]
add ebx,eax
mov eax,35
int 0x40
mcall
or eax, 0x4e4e4e
mov ebx,[esp+4]
mov ecx,[esp]
sub ebx,[procinfo.x_start]
sub ecx,[procinfo.y_start]
imul ecx,[procinfo.x_size]
sub ebx,[procinfo.box.left]
sub ecx,[procinfo.box.top]
imul ecx,[procinfo.box.width]
imul ebx,3
imul ecx,3
add ebx,ecx
@ -168,7 +168,7 @@ get_transparent:
inc eax
cmp eax,[x_end]
jb dtpl1
mov eax,[procinfo.x_start]
mov eax,[procinfo.box.left]
inc ebx
cmp ebx,[y_end]
jb dtpl1
@ -182,18 +182,13 @@ get_transparent:
; DATA AREA
;x_start dd 100
;y_start dd 80
;x_size dd 160
;y_size dd 200
x_end dd 0
y_end dd 0
scx dd 640
header db 'Transparent',0
title db 'Transparent',0
I_END:
procinfo process_information

View File

@ -373,7 +373,7 @@ macro drawfbox x,y,xs,ys,color
wordstoreg ecx,y,ys ;y*65536+ys
mov edx,color
mov eax,13
int 0x40
mcall
}
; FPS - Set Frame Per Second Display
@ -390,7 +390,7 @@ ttt dd 0
spdat:
get_time:
mov eax,3
int 0x40
mcall
cmp eax,[savetime]
jne new_time
inc [fps_cntr]
@ -409,7 +409,7 @@ if ~(delcolor eq )
mov ecx,y*65536+7
mov edx,delcolor
mov eax,13
int 0x40
mcall
end if
mov dword [ttt],fps_show_frequency
mov eax,47
@ -418,7 +418,7 @@ end if
mov edx,x*65536+y
mov esi,color
mov ecx,[fps]
int 0x40
mcall
no_out_fps:
}
@ -496,7 +496,7 @@ macro setimg x , y ,arg3
add cx,[arg3+4]
; wordstoreg ecx,[arg3],[arg3+4]
wordstoreg edx, x , y ;arg1*65536+arg2
int 0x40
mcall
}
macro setframe x , y ,arg3
@ -507,7 +507,7 @@ macro setframe x , y ,arg3
wordstoreg edx, x , y ;arg1*65536+arg2
add edx,dword [arg3]
mov ecx,dword [arg3+4]
int 0x40
mcall
}

View File

@ -48,14 +48,14 @@ open:
mov dword [fileinfo+8],1 ; how many blocks to read (1)
mov eax,58
mov ebx,fileinfo
int 0x40
mcall
mov eax,[file_load_area+2]
shr eax,9 ; ¯®¤¥«¨¬ ­  512 ¨ ¯à¨¡ ¢¨¬ 1 - ¯®«ã稬 ç¨á«® ¡«®ª®¢
inc eax
mov dword [fileinfo+8],eax
mov eax,58
mov ebx,fileinfo
int 0x40
mcall
}
@ -91,7 +91,7 @@ asd:
mov edx,id
mov esi,bcolor
mov eax,8
int 0x40
mcall
mov eax,asd-lab ;calc size
mov ebx,6
@ -116,7 +116,7 @@ asd:
mov edx,lab
mov esi,asd-lab ;calc size
mov eax,4
int 0x40
mcall
}
@ -145,7 +145,7 @@ mov [dlg_pid_get],0
mov eax,9
mov ebx,procinfo
mov ecx,-1
int 0x40
mcall
; convert eax bin to param dec
mov eax,dword [procinfo+30] ;offset of myPID
@ -179,12 +179,12 @@ new_d:
mov ebx,1 ; define IPC
mov ecx,path ; offset of area
mov edx,150 ; size 150 bytes
int 0x40
mcall
; change wanted events list 7-bit IPC event
mov eax,40
mov ebx,01000111b
int 0x40
mcall
;
; STEP 3 run SYSTEM XTREE with parameters
@ -192,7 +192,7 @@ new_d:
mov eax,58
mov ebx,run_fileinfo
int 0x40
mcall
call redproc
@ -200,7 +200,7 @@ new_d:
getmesloop:
mov eax,23
mov ebx,50 ;0.5 sec
int 0x40
mcall
cmp eax,1
je mred
@ -215,14 +215,14 @@ getmesloop:
mov ebx,procinfo
mov ecx,-1
mov eax,9
int 0x40
mcall
mov ebp,eax
loox:
mov eax,9
mov ebx,procinfo
mov ecx,ebp
int 0x40
mcall
mov eax,[DLGPID]
cmp [procinfo+30],eax ;IF Dialog find
je dlg_is_work ;jmp to dlg_is_work
@ -247,15 +247,15 @@ mred:
jmp getmesloop
mkey:
mov eax,2
int 0x40 ; read (eax=2)
mcall ; read (eax=2)
jmp getmesloop
mbutton:
mov eax,17 ; get id
int 0x40
mcall
cmp ah,1 ; button id=1 ?
jne getmesloop
mov eax,-1 ; close this program
int 0x40
mcall
mgetmes:
; If dlg_pid_get then second message get jmp to still
@ -357,7 +357,7 @@ mov [dlg_pid_get],0
mov eax,9
mov ebx,procinfo
mov ecx,-1
int 0x40
mcall
; convert eax bin to param dec
mov eax,dword [procinfo+30] ;offset of myPID
@ -391,12 +391,12 @@ new_d:
mov ebx,1 ; define IPC
mov ecx,path ; offset of area
mov edx,120 ; size 150 bytes
int 0x40
mcall
; change wanted events list 7-bit IPC event
mov eax,40
mov ebx,01000111b
int 0x40
mcall
;
; STEP 3 run SYSTEM XTREE with parameters
@ -404,7 +404,7 @@ new_d:
mov eax,58
mov ebx,run_fileinfo
int 0x40
mcall
call redproc
@ -412,7 +412,7 @@ new_d:
getmesloop:
mov eax,23
mov ebx,50 ;0.5 sec
int 0x40
mcall
cmp eax,1
je mred
@ -427,14 +427,14 @@ getmesloop:
mov ebx,procinfo
mov ecx,-1
mov eax,9
int 0x40
mcall
mov ebp,eax
loox:
mov eax,9
mov ebx,procinfo
mov ecx,ebp
int 0x40
mcall
mov eax,[DLGPID]
cmp [procinfo+30],eax ;IF Dialog find
je dlg_is_work ;jmp to dlg_is_work
@ -458,15 +458,15 @@ mred:
call redproc
jmp getmesloop
mkey:
int 0x40 ; read (eax=2)
mcall ; read (eax=2)
jmp getmesloop
mbutton:
mov eax,17 ; get id
int 0x40
mcall
cmp ah,1 ; button id=1 ?
jne getmesloop
mov eax,-1 ; close this program
int 0x40
mcall
mgetmes:
; If dlg_pid_get then second message get jmp to still
@ -618,7 +618,7 @@ rxproc:
macro scank
{
mov eax,10
int 0x40
mcall
}
macro putpix x,y,color
@ -627,7 +627,7 @@ macro putpix x,y,color
mov ecx,y
mov edx,color
mov eax,1
int 0x40
mcall
}
macro puttxt x,y,offs,size,color
@ -640,7 +640,7 @@ macro puttxt x,y,offs,size,color
mov edx,offs
mov esi,size
mov eax,4
int 0x40
mcall
}
macro outcount data, x, y, color, numtype
@ -652,7 +652,7 @@ macro outcount data, x, y, color, numtype
wordstoreg edx,x,y
mov esi,color
mov eax,47
int 0x40
mcall
}
; SCEVENT - Scan event
@ -660,7 +660,7 @@ macro outcount data, x, y, color, numtype
macro scevent red,key,but
{
mov eax,11
int 0x40
mcall
dec eax
jz red
dec eax
@ -674,7 +674,7 @@ macro scevent red,key,but
macro wtevent red,key,but
{
mov eax,10
int 0x40
mcall
dec eax
jz red
dec eax
@ -689,7 +689,7 @@ macro timeevent xfps,noevent,red,key,but
{
mov eax,23
mov ebx,xfps
int 0x40
mcall
cmp eax,0
je noevent
dec eax
@ -706,7 +706,7 @@ macro timeevent xfps,noevent,red,key,but
macro close
{
mov eax,-1
int 0x40
mcall
}
; DELAY - Create delay 1/100 sec
@ -717,7 +717,7 @@ macro delay arg1
{
mov eax,5
mov ebx,arg1
int 0x40
mcall
}
; WINDOW - Draw window
@ -732,7 +732,7 @@ macro window arg1,arg2,arg3,arg4,arg5
wordstoreg ecx,arg2,arg4
mov edx,arg5
mov eax,0
int 0x40
mcall
}
macro colorwindow arg1,arg2,arg3,arg4,arg5,arg6,arg7
@ -743,7 +743,7 @@ macro colorwindow arg1,arg2,arg3,arg4,arg5,arg6,arg7
mov esi,arg6
mov edi,arg7
mov eax,0
int 0x40
mcall
}
@ -753,7 +753,7 @@ macro startwd
{
mov eax,12
mov ebx,1
int 0x40
mcall
}
; ENDWD - End window draw
@ -762,7 +762,7 @@ macro endwd
{
mov eax,12
mov ebx,2
int 0x40
mcall
}
; LABEL - Put text to frame
@ -785,7 +785,7 @@ end if
mov edx,lab
mov esi,asd-lab ;calc size
mov eax,4
int 0x40
mcall
}
;Key's

View File

@ -19,6 +19,7 @@ use32
SCREEN_X equ 320 ;800
SCREEN_Y equ 200 ;600
include '..\..\..\macros.inc'
include 'lang.inc'
include 'ascl.inc'
include 'ascgl.inc'
@ -66,37 +67,37 @@ count dd 100
key:
mov eax,2
int 0x40
mcall
jmp still
button:
mov eax,17
int 0x40
mcall
cmp ah,1
jne still
exit:
mov eax,-1
int 0x40
mcall
;Draw window
draw_window:
mov eax,12 ;Start
mov ebx,1
int 0x40
mcall
xor eax,eax ;Draw window
mov ebx,100*65536+(SCREEN_X+9) ;x start*65536+x size
mov ecx,100*65536+(SCREEN_Y+26) ;y start*65536+y size
mov edx,0x13000000 ;0x13 use skinned window
mov edi,header
int 0x40
mov edi,title
mcall
mov eax,12 ;End
mov ebx,2
int 0x40
mcall
ret
header db '3D TEST SAMPLE',0
title db '3D TEST SAMPLE',0
outscr:
@ -105,7 +106,7 @@ outscr:
mov ecx,SCREEN_X*65536+SCREEN_Y
mov edx,5*65536+22
mov ax,7
int 0x40
mcall
ret

View File

@ -1,4 +1,5 @@
@erase lang.inc
@echo lang fix en >lang.inc
@fasm tube.asm tube
@erase lang.inc
@pause

View File

@ -1,4 +1,5 @@
@erase lang.inc
@echo lang fix ru >lang.inc
@fasm tube.asm tube
@erase lang.inc
@pause

View File

@ -1,266 +0,0 @@
; new application structure
macro meos_app_start
{
use32
org 0x0
db 'MENUET01'
dd 0x01
dd __start
dd __end
dd __memory
dd __stack
if used __params & ~defined __params
dd __params
else
dd 0x0
end if
dd 0x0
}
MEOS_APP_START fix meos_app_start
macro code
{
__start:
}
CODE fix code
macro data
{
__data:
}
DATA fix data
macro udata
{
if used __params & ~defined __params
__params:
db 0
__end:
rb 255
else
__end:
end if
__udata:
}
UDATA fix udata
macro meos_app_end
{
align 32
rb 2048
__stack:
__memory:
}
MEOS_APP_END fix meos_app_end
; macro for defining multiline text data
struc mstr [sstring]
{
forward
local ssize
virtual at 0
db sstring
ssize = $
end virtual
dd ssize
db sstring
common
dd -1
}
; strings
macro sz name,[data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if used name
db data
end if
common
if used name
.size = $-name
end if
}
macro lsz name,[lng,data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if (used name)&(lang eq lng)
db data
end if
common
if used name
.size = $-name
end if
}
; easy system call macro
macro mpack dest, hsrc, lsrc
{
if (hsrc eqtype 0) & (lsrc eqtype 0)
mov dest, (hsrc) shl 16 + lsrc
else
if (hsrc eqtype 0) & (~lsrc eqtype 0)
mov dest, (hsrc) shl 16
add dest, lsrc
else
mov dest, hsrc
shl dest, 16
add dest, lsrc
end if
end if
}
macro __mov reg,a { ; mike.dld
if ~a eq
mov reg,a
end if
}
macro mcall a,b,c,d,e,f { ; mike.dld
__mov eax,a
__mov ebx,b
__mov ecx,c
__mov edx,d
__mov esi,e
__mov edi,f
int 0x40
}
; language for programs
lang fix ru ; ru en fr ge fi
; optimize the code for size
__regs fix <eax,ebx,ecx,edx,esi,edi,ebp,esp>
macro add arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
inc arg1
else
add arg1,arg2
end if
else
add arg1,arg2
end if
}
macro sub arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
dec arg1
else
sub arg1,arg2
end if
else
sub arg1,arg2
end if
}
macro mov arg1,arg2
{
if (arg1 in __regs) & (arg2 eqtype 0)
if (arg2) = 0
xor arg1,arg1
else if (arg2) = 1
xor arg1,arg1
inc arg1
else if (arg2) = -1
or arg1,-1
else if (arg2) > -128 & (arg2) < 128
push arg2
pop arg1
else
mov arg1,arg2
end if
else
mov arg1,arg2
end if
}
macro struct name
{
virtual at 0
name name
sizeof.#name = $ - name
end virtual
}
; structures used in MeOS
struc process_information
{
.cpu_usage dd ? ; +0
.window_stack_position dw ? ; +4
.window_stack_value dw ? ; +6
.not_used1 dw ? ; +8
.process_name rb 12 ; +10
.memory_start dd ? ; +22
.used_memory dd ? ; +26
.PID dd ? ; +30
.x_start dd ? ; +34
.y_start dd ? ; +38
.x_size dd ? ; +42
.y_size dd ? ; +46
.slot_state dw ? ; +50
rb (1024-52)
}
struct process_information
struc system_colors
{
.frame dd ?
.grab dd ?
.grab_button dd ?
.grab_button_text dd ?
.grab_text dd ?
.work dd ?
.work_button dd ?
.work_button_text dd ?
.work_text dd ?
.work_graph dd ?
}
struct system_colors
; constants
; events
EV_IDLE = 0
EV_TIMER = 0
EV_REDRAW = 1
EV_KEY = 2
EV_BUTTON = 3
EV_EXIT = 4
EV_BACKGROUND = 5
EV_MOUSE = 6
EV_IPC = 7
EV_STACK = 8
; event mask bits for function 40
EVM_REDRAW = 1b
EVM_KEY = 10b
EVM_BUTTON = 100b
EVM_EXIT = 1000b
EVM_BACKGROUND = 10000b
EVM_MOUSE = 100000b
EVM_IPC = 1000000b
EVM_STACK = 10000000b

View File

@ -18,7 +18,7 @@ use32
dd 0x40000
dd 0,0
include 'macros.inc'
include '..\..\..\macros.inc'
START:
@ -38,7 +38,7 @@ still:
mov eax,23
mov ebx,1
int 0x40
mcall
cmp eax,1
jne no_red
@ -50,8 +50,7 @@ still:
je still
or eax,-1
int 0x40
mcall
SCREEN equ 160
PIXBUF equ 200h
@ -179,7 +178,7 @@ display_image:
mov ecx,320*65536+160
xor edx,edx
mov ebx,0x10000
int 0x40
mcall
popa
ret
@ -192,23 +191,20 @@ draw_window:
mov eax,12
mov ebx,1
int 0x40
mcall
xor eax,eax
mov ebx,100*65536+329
mov ecx,100*65536+186
mov edx,0x33000000
mov edi,header
int 0x40
mov edi,title
mcall
mov eax,12
mov ebx,2
int 0x40
mcall
popa
ret
header db appname,0
title db appname,0
db 41,0,0xC3,0x3C

View File

@ -1,4 +1,5 @@
@erase lang.inc
@echo lang fix en >lang.inc
@fasm cmd.asm cmd
@erase lang.inc
@pause

View File

@ -1,4 +1,5 @@
@erase lang.inc
@echo lang fix de >lang.inc
@fasm cmd.asm cmd
@erase lang.inc
@pause

View File

@ -18,7 +18,7 @@ use32
dd 0x0
dd 0x0
include "macros.inc"
include "..\..\..\macros.inc"
include "lang.inc"
START:
@ -33,7 +33,7 @@ START:
still:
mov eax,10
int 0x40
mcall
cmp eax,1
je re
@ -46,7 +46,7 @@ still:
button:
mov eax,17
int 0x40
mcall
cmp ah,1
jne noclose
@ -84,7 +84,7 @@ loop1:
mov edx,tic_table
add edx,dword [linev]
mov esi,81
int 0x40
mcall
add dword [xpos],10
add dword [linev],81
pop ecx
@ -101,7 +101,7 @@ no_red:
key:
mov eax,2
int 0x40
mcall
cmp ah,27
jne no_escape
@ -287,7 +287,7 @@ clear:
shl ecx,16
add ecx,9
mov edx,0
int 0x40
mcall
add dword [ypos],6
ret
@ -295,18 +295,18 @@ draw:
mov eax,12
mov ebx,1
int 0x40
mcall
mov eax,0
mov ebx,100*65536+492
mov ecx,100*65536+280
mov edx,0x13000000
mov edi,title
int 0x40
mcall
mov eax,12
mov ebx,2
int 0x40
mcall
ret
@ -318,7 +318,7 @@ print:
mov ecx,0x00ddeeff
mov edx,smb
mov esi,1
int 0x40
mcall
mov edi,tic_table
add edi,dword [linen]
@ -337,7 +337,7 @@ cursor:
mov ecx,0x00ddeeff
mov edx,smb_cursor
mov esi,1
int 0x40
mcall
mov edi,tic_table
mov esi,smb_cursor
@ -356,7 +356,7 @@ ppr:
mov ecx,0x00ddeeff
mov edx,prompt
mov esi,5
int 0x40
mcall
mov dword [ypos],42
cld
@ -471,7 +471,7 @@ loopls:
mov eax, 70
mov ebx, dirinfo
int 0x40
mcall
inc dword [dirinfo+4]
cmp ebx, 1
jnz ls_end
@ -542,7 +542,7 @@ ls_print:
mov edx,filename
mov ecx,0x00ddeeff
mov esi,12
int 0x40
mcall
cld
mov ecx,12
@ -618,7 +618,7 @@ chdot:
mov ecx,0
mov edx,-1
mov esi,tic_table+25000
int 0x40
mcall
cmp eax,4294967295
je nosuchfile
@ -647,7 +647,7 @@ chnodot:
mov ecx,0
mov edx,-1
mov esi,tic_table+25000
int 0x40
mcall
cmp eax,4294967295
je nosuchfile
@ -667,7 +667,7 @@ lschok:
mov edx,tic_table+400
mov esi,12
mov ecx,0x00ddeeff
int 0x40
mcall
cld
mov ecx,12
@ -701,7 +701,7 @@ ps:
mov eax,9
mov ebx,tic_table
mov ecx,1
int 0x40
mcall
mov dword [count2],eax
@ -710,7 +710,7 @@ ll1:
mov eax,9
mov ebx,tic_table
mov ecx,[pn]
int 0x40
mcall
mov ebx,[tic_table+30]
mov dword [fnumb],4
@ -741,7 +741,7 @@ ll1:
add ebx,[xpos]
mov ecx,0x00ddeeff
mov esi,12
int 0x40
mcall
cld
mov ecx,11
@ -838,7 +838,7 @@ printn:
shl edx,16
add edx,[xpos]
mov esi,0x00ddeeff
int 0x40
mcall
ret
pause2:
@ -847,7 +847,7 @@ pause2:
call printf
mov eax,10
int 0x40
mcall
red3:
cmp eax,2
@ -859,19 +859,19 @@ red3:
call red
mov eax,10
int 0x40
mcall
jmp red3
back:
mov eax,2
int 0x40
mcall
cmp ah,27
je checmd
ret
exit:
mov eax,-1
int 0x40
mcall
checmd:
cmp byte [callp],1
@ -894,7 +894,7 @@ err:
add ebx,[xpos]
mov ecx,0x00ddeeff
mov esi,33
int 0x40
mcall
cld
mov ecx,27
@ -1046,7 +1046,7 @@ gocp1:
mov ecx,0
mov edx,-1
mov esi,tic_table+25000
int 0x40
mcall
cmp eax,4294967295
je nosuchfile
@ -1125,7 +1125,7 @@ gocp2:
mov ecx,0
mov edx,-1
mov esi,tic_table+25000
int 0x40
mcall
cmp eax,4294967295
jne alreadyexist
@ -1135,7 +1135,7 @@ gocp2:
mov ecx,tic_table+25000
mov edx,dword [filesize]
mov esi,0
int 0x40
mcall
cmp eax,0
jne no_ok
@ -1145,7 +1145,7 @@ gocp2:
mov ecx,0
mov edx,-1
mov esi,tic_table+25000
int 0x40
mcall
cmp eax,4294967295
je no_ok
@ -1289,7 +1289,7 @@ gorn1:
mov ecx,0
mov edx,-1
mov esi,tic_table+25000
int 0x40
mcall
cmp eax,4294967295
je nosuchfile
@ -1366,7 +1366,7 @@ gorn2:
mov ecx,0
mov edx,-1
mov esi,tic_table+25000
int 0x40
mcall
cmp eax,4294967295
jne alreadyexist
@ -1376,7 +1376,7 @@ gorn2:
mov ecx,0
mov edx,-1
mov esi,tic_table+25000
int 0x40
mcall
mov dword [filesize],eax
@ -1385,7 +1385,7 @@ gorn2:
mov ecx,tic_table+25000
mov edx,dword [filesize]
mov esi,0
int 0x40
mcall
cmp eax,0
jne no_ok1
@ -1395,14 +1395,14 @@ gorn2:
mov ecx,0
mov edx,-1
mov esi,tic_table+25000
int 0x40
mcall
cmp eax,4294967295
je no_ok1
mov eax,32
mov ebx,tic_table+9000
int 0x40
mcall
call newline
mov edx,mess14
@ -1504,14 +1504,14 @@ godel:
mov ecx,0
mov edx,-1
mov esi,tic_table+25000
int 0x40
mcall
cmp eax,4294967295
je nosuchfile2
mov eax,32
mov ebx,tic_table+400
int 0x40
mcall
call newline
mov edx,mess6
@ -1562,7 +1562,7 @@ autoexec:
mov ecx,0
mov edx,-1
mov esi,tic_table+15000
int 0x40
mcall
cmp eax,4294967295
je noaxfile
@ -1620,7 +1620,7 @@ strup7:
mov ecx,0
mov edx,-1
mov esi,tic_table+15000
int 0x40
mcall
cmp eax,4294967295
je nosuchfile3
@ -1755,7 +1755,7 @@ go4:
mov ecx,0x00ddeeff
mov edx,tic_table+200
mov esi,dword [fnumb]
int 0x40
mcall
ret
@ -1795,7 +1795,7 @@ kill:
mov eax,9
mov ebx,tic_table
int 0x40
mcall
cmp eax,ecx
jb nosuchprocess
@ -1803,7 +1803,7 @@ kill:
mov eax,18
mov ebx,2
mov edx,0
int 0x40
mcall
call clearsum
call newline
@ -1868,7 +1868,7 @@ gonext13:
mov edx,tic_table+300
mov ecx,0x00ddeeff
mov esi,dword [count]
int 0x40
mcall
cld
mov ecx,dword [count]
@ -1895,7 +1895,7 @@ printf:
add ebx,[xpos]
mov ecx,0x00ddeeff
mov esi,45
int 0x40
mcall
cld
mov ecx,45
@ -1918,7 +1918,7 @@ printipc:
add ebx,[xpos]
mov ecx,0x00ddeeff
mov esi,79
int 0x40
mcall
cld
mov ecx,79
@ -2078,7 +2078,7 @@ cls1:
mov ebx,6*65536+483
mov ecx,24*65536+250
mov edx,0
int 0x40
mcall
ret
cls2:
@ -2290,11 +2290,11 @@ no_cls:
mov eax,18
mov ebx,1
int 0x40
mcall
mov eax,5
mov ebx,200
int 0x40
mcall
no_shutdown:
cmp word [tic_table+600],'ps'
@ -2454,17 +2454,17 @@ cmd_ok:
mov ebx,1
mov ecx,ipcb
mov edx,118
int 0x40
mcall
call clearipc
mov eax,40
mov ebx,01000111b
int 0x40
mcall
mov eax,23
mov ebx,10
int 0x40
mcall
cmp eax,7
jne noipc
@ -2478,7 +2478,7 @@ ipccontinue:
mov eax,9
mov ebx,tic_table+100000
mov ecx,-1
int 0x40
mcall
mov ecx,eax
loopfindipc:
@ -2486,7 +2486,7 @@ loopfindipc:
mov eax,9
mov ebx,tic_table+100000
int 0x40
mcall
mov bl,[tic_table+600]
cmp byte [tic_table+100000+10],bl
@ -2548,7 +2548,7 @@ ipcfinished:
mov ecx,dword [ipcpid]
mov edx,ddot
mov esi,1
int 0x40
mcall
call newline
call clearipc
@ -2576,7 +2576,7 @@ printcmd:
mov edx,tic_table+600
mov ecx,0x00ddeeff
mov esi,dword [count]
int 0x40
mcall
cld
mov ecx,dword [count]
@ -2605,10 +2605,10 @@ cmd_ok2:
waitipc:
mov eax,40
mov ebx,01000111b
int 0x40
mcall
mov eax,10
int 0x40
mcall
cmp eax,7
je ipcok
@ -2623,7 +2623,7 @@ waitipc:
keyipc:
mov eax,2
int 0x40
mcall
jmp waitipc
@ -2662,7 +2662,7 @@ reipc2:
ipckey:
mov eax,10
int 0x40
mcall
cmp eax,1
je reipc2
@ -2675,7 +2675,7 @@ ipckey:
ipckeypressed:
mov eax,2
int 0x40
mcall
mov byte [ipckeyvalue],ah
@ -2684,7 +2684,7 @@ ipckeypressed:
mov ecx,dword [ipcpid]
mov edx,ipckeyvalue
mov esi,1
int 0x40
mcall
call clearipc
jmp waitipc
@ -2717,7 +2717,7 @@ cmdexist:
mov eax,9
mov ebx,tic_table
mov ecx,-1
int 0x40
mcall
mov ecx,eax
loopex:
@ -2725,7 +2725,7 @@ loopex:
mov eax,9
mov ebx,I_END
int 0x40
mcall
cmp word [I_END+10],'CM'
jne no_cmd
@ -2764,7 +2764,7 @@ start_rd_app:
mov eax, 70
mov ebx, fileinfo_start
mov [ebx+8], ecx
int 0x40
mcall
ret
fileinfo_start:
dd 7
@ -2775,8 +2775,7 @@ fileinfo_start:
db 0
dd fileinfo_buffer
title:
db 'CMD - Command line interpreter',0
title db 'CMD - Command line interpreter',0
smb_cursor db '|'

View File

@ -1,10 +1,10 @@
include "macros.inc"
include "..\..\..\macros.inc"
initipc:
mov eax,9
mov ebx,prc
mov ecx,-1
int 0x40
mcall
mov ecx,eax
loop1:
@ -12,7 +12,7 @@ loop1:
mov eax,9
mov ebx,prc
int 0x40
mcall
cmp word [prc+10],'CM'
jne no_cmd
@ -39,18 +39,18 @@ no_exit:
mov ecx,dword [cmdpid]
mov edx,printf
mov esi,4
int 0x40
mcall
call initcmd
waitcmdinit:
mov eax,40
mov ebx,01000000b
int 0x40
mcall
mov eax,23
mov ebx,100
int 0x40
mcall
cmp eax,7
je cmd_ok
@ -64,19 +64,19 @@ cmd_ok:
mov eax,18
mov ebx,3
mov ecx,dword [cmdnumb]
int 0x40
mcall
ret
pause1:
mov eax,5
mov ebx,1
int 0x40
mcall
ret
exit:
mov eax,-1
int 0x40
or eax,-1
mcall
cls:
mov eax,60
@ -84,7 +84,7 @@ cls:
mov ecx,dword [cmdpid]
mov edx,ipccls
mov esi,4
int 0x40
mcall
call pause1
@ -120,7 +120,7 @@ loopprt:
mov ecx,dword [cmdpid]
mov edx,stripc
mov esi,84
int 0x40
mcall
call pause1
@ -132,7 +132,7 @@ eol:
mov ecx,dword [cmdpid]
mov edx,ipceol
mov esi,4
int 0x40
mcall
call pause1
@ -144,13 +144,13 @@ initcmd:
mov ecx,dword [cmdpid]
mov edx,ipckey
mov esi,4
int 0x40
mcall
mov eax,60
mov ebx,1
mov ecx,ipcb
mov edx,28
int 0x40
mcall
cld
mov ecx,28
@ -166,10 +166,10 @@ getkey:
waitagain:
mov eax,40
mov ebx,01000000b
int 0x40
mcall
mov eax,10
int 0x40
mcall
cmp eax,7
jne waitagain
@ -186,7 +186,7 @@ endipc:
mov ecx,dword [cmdpid]
mov edx,ipcend
mov esi,4
int 0x40
mcall
jmp exit

View File

@ -1,269 +0,0 @@
; new application structure
macro meos_app_start
{
use32
org 0x0
db 'MENUET01'
dd 0x01
dd __start
dd __end
dd __memory
dd __stack
if used __params & ~defined __params
dd __params
else
dd 0x0
end if
dd 0x0
}
MEOS_APP_START fix meos_app_start
macro code
{
__start:
}
CODE fix code
macro data
{
__data:
}
DATA fix data
macro udata
{
if used __params & ~defined __params
__params:
db 0
__end:
rb 255
else
__end:
end if
__udata:
}
UDATA fix udata
macro meos_app_end
{
align 32
rb 2048
__stack:
__memory:
}
MEOS_APP_END fix meos_app_end
; macro for defining multiline text data
struc mstr [sstring]
{
forward
local ssize
virtual at 0
db sstring
ssize = $
end virtual
dd ssize
db sstring
common
dd -1
}
; strings
macro sz name,[data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if used name
db data
end if
common
if used name
.size = $-name
end if
}
macro lsz name,[lng,data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if (used name)&(lang eq lng)
db data
end if
common
if used name
.size = $-name
end if
}
; easy system call macro
macro mpack dest, hsrc, lsrc
{
if (hsrc eqtype 0) & (lsrc eqtype 0)
mov dest, (hsrc) shl 16 + lsrc
else
if (hsrc eqtype 0) & (~lsrc eqtype 0)
mov dest, (hsrc) shl 16
add dest, lsrc
else
mov dest, hsrc
shl dest, 16
add dest, lsrc
end if
end if
}
macro __mov reg,a,b { ; mike.dld
if (~a eq)&(~b eq)
mpack reg,a,b
else if (~a eq)&(b eq)
mov reg,a
end if
}
macro mcall a,b,c,d,e,f { ; mike.dld
__mov eax,a
__mov ebx,b
__mov ecx,c
__mov edx,d
__mov esi,e
__mov edi,f
int 0x40
}
; optimize the code for size
__regs fix <eax,ebx,ecx,edx,esi,edi,ebp,esp>
macro add arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
inc arg1
else
add arg1,arg2
end if
else
add arg1,arg2
end if
}
macro sub arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
dec arg1
else
sub arg1,arg2
end if
else
sub arg1,arg2
end if
}
macro mov arg1,arg2
{
if (arg1 in __regs) & ((arg2 eqtype 0) | (arg2 eqtype '0'))
if (arg2) = 0
xor arg1,arg1
else if (arg2) = 1
xor arg1,arg1
inc arg1
else if (arg2) = -1
or arg1,-1
else if (arg2) > -128 & (arg2) < 128
push arg2
pop arg1
else
mov arg1,arg2
end if
else
mov arg1,arg2
end if
}
macro struct name
{
virtual at 0
name name
sizeof.#name = $ - name
end virtual
}
; structures used in MeOS
struc process_information
{
.cpu_usage dd ? ; +0
.window_stack_position dw ? ; +4
.window_stack_value dw ? ; +6
.not_used1 dw ? ; +8
.process_name rb 12 ; +10
.memory_start dd ? ; +22
.used_memory dd ? ; +26
.PID dd ? ; +30
.x_start dd ? ; +34
.y_start dd ? ; +38
.x_size dd ? ; +42
.y_size dd ? ; +46
.slot_state dw ? ; +50
dw ? ; +52 - reserved
.client_left dd ? ; +54
.client_top dd ? ; +58
.client_width dd ? ; +62
.client_height dd ? ; +66
.wnd_state db ? ; +70
rb (1024-71)
}
struct process_information
struc system_colors
{
.frame dd ?
.grab dd ?
.grab_button dd ?
.grab_button_text dd ?
.grab_text dd ?
.work dd ?
.work_button dd ?
.work_button_text dd ?
.work_text dd ?
.work_graph dd ?
}
struct system_colors
; constants
; events
EV_IDLE = 0
EV_TIMER = 0
EV_REDRAW = 1
EV_KEY = 2
EV_BUTTON = 3
EV_EXIT = 4
EV_BACKGROUND = 5
EV_MOUSE = 6
EV_IPC = 7
EV_STACK = 8
; event mask bits for function 40
EVM_REDRAW = 1b
EVM_KEY = 10b
EVM_BUTTON = 100b
EVM_EXIT = 1000b
EVM_BACKGROUND = 10000b
EVM_MOUSE = 100000b
EVM_IPC = 1000000b
EVM_STACK = 10000000b

View File

@ -48,12 +48,12 @@ check_box:
shl ecx,16
add ecx,ch_size
mov edx,ch_border_color
int 0x40 ;à¨á㥬 à ¬ªã
mcall ;à¨á㥬 à ¬ªã
mov edx,ch_color
add ebx,1 shl 16 - 2
add ecx,1 shl 16 - 2
int 0x40 ;§ ªà è¨¢ ¥¬ ¢­ãâ७­®á⨠祪¡®ªá 
mcall ;§ ªà è¨¢ ¥¬ ¢­ãâ७­®á⨠祪¡®ªá 
test word ch_flags,2 ;¤®áâ âì §­ ç¥­¨¥ ¡¨â  ¨§ ¯¥à¥¬¥­­®© ¨ ¯®¬¥áâ¨âì ¢ ä« £ CF
jz @f ;¢ ¥á«¨ CF=1, â® ¢ë¯®«­¨¬ á«¥¤ãîéãî ¯à®æ¥¤ãàã ¨­ ç¥ ¯¥à¥©â¨ ­  ­¨¦­îî @@
@ -73,7 +73,7 @@ check_box:
movzx esi,word ch_text_length ;‡ £à㧨¬ ¤«¨­ã ­ ¤¯¨á¨ ¢ esi
;¢­¥á¥¬ ¢ eax §­ ç¥­¨¥ ¢ë¢®¤  ­ ¤¯¨á¨ ­  ª ­¢ã
mov eax,4
int 0x40 ;‚뢮¤
mcall ;‚뢮¤
popa ;¢®ááâ ­®¢¨âì §­ ç¥­¨ï ॣ¨áâ஢ ¨§ á⥪ 
ret ;¢ë©¤¥¬ ¨§ ¯à®æ¥¤ãàë
@ -96,13 +96,13 @@ ret ;
shl ecx,16 ;ᤢ¨­¥¬ ­  16 à §à冷¢ ¢ «¥¢® (㬭®¦¨¬ ­  65536)
mov cx,bp ;§ £à㧨¬ §­ ç¥­¨ï ॣ¨áâà  ãª § â¥«ï ¡ §ë ¢ cx
;pop cx
int 0x40 ;¢ë¢®¤
mcall ;¢ë¢®¤
ret ;¢ë©â¨ ¨§ ¯à®æ¥¤ãàë
.mouse: ;®¡à ¡®âª  ¬ëè¨
pusha
mov eax,37 ;¡ã¤¥¬ çâ® â® ¤¥« âì ¥á«¨ ã ­ á çâ® - ­¨âì ­ ¦ â®
mov ebx,2 ;¢­¥á⨠¢ ॣ¨áâà §­ ç¥­¨¥ 2
int 0x40 ;¯à®¢¥àª  ­¥ ­ ¦ « «¨ ¯®«ì§®¢ â¥«ì ª­®¯ªã ¬ë誨
mcall ;¯à®¢¥àª  ­¥ ­ ¦ « «¨ ¯®«ì§®¢ â¥«ì ª­®¯ªã ¬ë誨
test eax,eax ;¯à®¢¥àª  ¥á«¨ ã ­ á ¢ eax=0, â® ãáâ ­®¢¨¬ ä« £ ¨ ¢ë©¤¥¬
jnz @f ;¯¥à¥©â¨ ­  ­¨¦­îî ¬¥âªã @@
btr word ch_flags,2 ;¨§¢«¥ç¥­¨¥ §­ ç¥­¨ï § ¤ ­­®£® ¡¨â  ¢ ä« £ cf ¨ ¨§¬¥­¥­¨¥ ¥£® §­ ç¥­¨ï ­  ­ã«¥¢®¥.
@ -120,7 +120,7 @@ pusha
mov eax,37 ;¯®«ã稬 ª®®à¤¨­ âë ¬ë誨
mov ebx,1 ;¤®¡ ¢¨âì 1
int 0x40 ;¯®«ãç¨âì ª®®à¤¨­ âë ªãàá®à  ®â­®á¨â¥«ì­® ®ª­ 
mcall ;¯®«ãç¨âì ª®®à¤¨­ âë ªãàá®à  ®â­®á¨â¥«ì­® ®ª­ 
movzx ebx,word ch_top ;§ £à㧨âì ¢ bx §­ ç¥­¨¥ ª®®à¤¨­ âë ã
cmp ax,bx ;áà ¢­¨âì á á ª®®à¤¨­ â®© ªãàá®à 

View File

@ -23,7 +23,7 @@ use32 ;
; 㪠§ â¥«ì ­  áâபã, ¢ ª®â®àãî § ¯¨á ­ ¯ãâì,
; ®âªã¤  § ¯ã饭® ¯à¨«®¦¥­¨¥
;------------------
include 'macros.inc'
include '..\..\..\..\macros.inc'
include 'check.inc' ;¢ª«îç¨âì ä ©« check.inc
; version_ch ;­¥®¡å®¤¨¬ë© ¬ ªà®á ¤«ï ¢ª«î祭¨ï "áâ à®©" ¢¥àᨨ check_box
version_ch1 ;­¥®¡å®¤¨¬ë© ¬ ªà®á ¤«ï ¢ª«î祭¨ï new ¢¥àᨨ check_box1
@ -36,16 +36,16 @@ start: ;
mov ebx,3
mov ecx,sc
mov edx,sizeof.system_colors
int 0x40
mcall
mov eax,40 ;ãáâ ­®¢¨âì ¬ áªã ¤«ï ®¦¨¤ ¥¬ëå ᮡë⨩
mov ebx,0x25 ;á¨á⥬  ¡ã¤¥â ॠ£¨à®¢ âì ⮫쪮 ­  á®®¡é¥­¨¥ ® ¯¥à¥à¨á®¢ª¥,­ ¦ â  ª­®¯ª , ®¯à¥¤¥«ñ­­ ï à ­¥¥, ᮡë⨥ ®â ¬ëè¨ (çâ®-â® á«ã稫®áì - ­ ¦ â¨¥ ­  ª­®¯ªã ¬ëè¨ ¨«¨ ¯¥à¥¬¥é¥­¨¥; á¡à á뢠¥âáï ¯à¨ ¯à®ç⥭¨¨)
int 0x40
mcall
red_win:
call draw_window ;¯¥à¢®­ ç «ì­® ­¥®¡å®¤¨¬® ­ à¨á®¢ âì ®ª­®
still: ;®á­®¢­®© ®¡à ¡®â稪
mov eax,10 ;Ž¦¨¤ âì ᮡëâ¨ï
int 0x40 ;®¦¨¤ âì ᮡë⨥ ¢ â¥ç¥­¨¥ 2 ¬¨««¨á¥ªã­¤
mcall ;®¦¨¤ âì ᮡë⨥ ¢ â¥ç¥­¨¥ 2 ¬¨««¨á¥ªã­¤
cmp al,0x1 ;¥á«¨ ¨§¬¥­¨«®áì ¯®«®¦¥­¨¥ ®ª­ 
jz red_win
@ -55,14 +55,14 @@ still: ;
jmp still ;¥á«¨ ­¨ç¥£® ¨§ ¯¥à¥ç¨á«¥­­®£® â® á­®¢  ¢ 横«
button:
or eax,-1 ;¢ eax,-1 - 5 ,¡ ©â®¢ ã ­ á ¦¥ ⮫쪮 3 ¢ë©â¨
int 0x40 ;¤ «¥¥ ¢ë¯®«­ï¥âáï ¢ë室 ¨§ ¯à®£à ¬¬ë
mcall ;¤ «¥¥ ¢ë¯®«­ï¥âáï ¢ë室 ¨§ ¯à®£à ¬¬ë
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
draw_window: ;à¨á®¢ ­¨¥ ®ª­  ¯à¨«®¦¥­¨ï
mov eax,12 ;¢ ॣ¨áâà ¢­¥á⨠§­ ç¥­¨¥ = 12
mov ebx,1 ;¯à¨á¢®¨âì 1
int 0x40
mcall
xor eax,eax ;®¡­ã«¨âì eax
mov ebx,50*65536+180 ;[ª®®à¤¨­ â  ¯® ®á¨ x]*65536 + [à §¬¥à ¯® ®á¨ x]
@ -70,13 +70,13 @@ draw_window: ;
mov edx,[sc.work] ; color of work area RRGGBB,8->color gl
or edx,0xb3000000
mov edi,hed
int 0x40 ;­ à¨á®¢ âì ®ª­® ¯à¨«®¦¥­¨ï
mcall ;­ à¨á®¢ âì ®ª­® ¯à¨«®¦¥­¨ï
draw_check_boxes check_boxes,check_boxes_end ;à¨á®¢ ­¨¥ 祪¡®ªá®¢
mov eax,12 ;”ã­ªæ¨ï 12 - ­ ç âì/§ ª®­ç¨âì ¯¥à¥à¨á®¢ªã ®ª­ .
mov ebx,2 ;<3B>®¤äã­ªæ¨ï 2 - § ª®­ç¨âì ¯¥à¥à¨á®¢ªã ®ª­ .
int 0x40
mcall
ret
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

View File

@ -1,269 +0,0 @@
; new application structure
macro meos_app_start
{
use32
org 0x0
db 'MENUET01'
dd 0x01
dd __start
dd __end
dd __memory
dd __stack
if used __params & ~defined __params
dd __params
else
dd 0x0
end if
dd 0x0
}
MEOS_APP_START fix meos_app_start
macro code
{
__start:
}
CODE fix code
macro data
{
__data:
}
DATA fix data
macro udata
{
if used __params & ~defined __params
__params:
db 0
__end:
rb 255
else
__end:
end if
__udata:
}
UDATA fix udata
macro meos_app_end
{
align 32
rb 2048
__stack:
__memory:
}
MEOS_APP_END fix meos_app_end
; macro for defining multiline text data
struc mstr [sstring]
{
forward
local ssize
virtual at 0
db sstring
ssize = $
end virtual
dd ssize
db sstring
common
dd -1
}
; strings
macro sz name,[data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if used name
db data
end if
common
if used name
.size = $-name
end if
}
macro lsz name,[lng,data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if (used name)&(lang eq lng)
db data
end if
common
if used name
.size = $-name
end if
}
; easy system call macro
macro mpack dest, hsrc, lsrc
{
if (hsrc eqtype 0) & (lsrc eqtype 0)
mov dest, (hsrc) shl 16 + lsrc
else
if (hsrc eqtype 0) & (~lsrc eqtype 0)
mov dest, (hsrc) shl 16
add dest, lsrc
else
mov dest, hsrc
shl dest, 16
add dest, lsrc
end if
end if
}
macro __mov reg,a,b { ; mike.dld
if (~a eq)&(~b eq)
mpack reg,a,b
else if (~a eq)&(b eq)
mov reg,a
end if
}
macro mcall a,b,c,d,e,f { ; mike.dld
__mov eax,a
__mov ebx,b
__mov ecx,c
__mov edx,d
__mov esi,e
__mov edi,f
int 0x40
}
; optimize the code for size
__regs fix <eax,ebx,ecx,edx,esi,edi,ebp,esp>
macro add arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
inc arg1
else
add arg1,arg2
end if
else
add arg1,arg2
end if
}
macro sub arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
dec arg1
else
sub arg1,arg2
end if
else
sub arg1,arg2
end if
}
macro mov arg1,arg2
{
if (arg1 in __regs) & ((arg2 eqtype 0) | (arg2 eqtype '0'))
if (arg2) = 0
xor arg1,arg1
else if (arg2) = 1
xor arg1,arg1
inc arg1
else if (arg2) = -1
or arg1,-1
else if (arg2) > -128 & (arg2) < 128
push arg2
pop arg1
else
mov arg1,arg2
end if
else
mov arg1,arg2
end if
}
macro struct name
{
virtual at 0
name name
sizeof.#name = $ - name
end virtual
}
; structures used in MeOS
struc process_information
{
.cpu_usage dd ? ; +0
.window_stack_position dw ? ; +4
.window_stack_value dw ? ; +6
.not_used1 dw ? ; +8
.process_name rb 12 ; +10
.memory_start dd ? ; +22
.used_memory dd ? ; +26
.PID dd ? ; +30
.x_start dd ? ; +34
.y_start dd ? ; +38
.x_size dd ? ; +42
.y_size dd ? ; +46
.slot_state dw ? ; +50
dw ? ; +52 - reserved
.client_left dd ? ; +54
.client_top dd ? ; +58
.client_width dd ? ; +62
.client_height dd ? ; +66
.wnd_state db ? ; +70
rb (1024-71)
}
struct process_information
struc system_colors
{
.frame dd ?
.grab dd ?
.grab_button dd ?
.grab_button_text dd ?
.grab_text dd ?
.work dd ?
.work_button dd ?
.work_button_text dd ?
.work_text dd ?
.work_graph dd ?
}
struct system_colors
; constants
; events
EV_IDLE = 0
EV_TIMER = 0
EV_REDRAW = 1
EV_KEY = 2
EV_BUTTON = 3
EV_EXIT = 4
EV_BACKGROUND = 5
EV_MOUSE = 6
EV_IPC = 7
EV_STACK = 8
; event mask bits for function 40
EVM_REDRAW = 1b
EVM_KEY = 10b
EVM_BUTTON = 100b
EVM_EXIT = 1000b
EVM_BACKGROUND = 10000b
EVM_MOUSE = 100000b
EVM_IPC = 1000000b
EVM_STACK = 10000000b

View File

@ -16,7 +16,7 @@ use32
dd 0x1000 ; esp
dd 0x00000000 ; reserved=no extended header
include 'macros.inc'
include '..\..\..\..\macros.inc'
@ -29,7 +29,7 @@ START: ; start of execution
still:
mov eax,10 ; wait here for event
int 0x40
mcall
dec eax ; redraw request ?
jz red
@ -38,16 +38,16 @@ still:
button:
mov al,17 ; get id
int 0x40
mcall
cmp ah,1 ; button id=1 ?
jne noclose
or eax,-1 ; close this program
int 0x40
mcall
key: ; key
mov al,2 ; just read it and ignore
int 0x40
mcall
jmp still
noclose:
@ -61,12 +61,12 @@ shape_window:
mov eax,50 ; give the shape reference area
mov ebx,0
mov ecx,shape_reference
int 0x40
mcall
mov eax,50 ; give the shape scale 32 x 32 -> 128 x 128
mov ebx,1 ; you dont have to give this, scale is 1:1 by default
mov ecx,2
int 0x40
mcall
popa
@ -118,7 +118,7 @@ draw_window:
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,1 ; 1, start of draw
int 0x40
mcall
; DRAW WINDOW
xor eax,eax ; function 0 : define and draw window
@ -129,7 +129,7 @@ draw_window:
mov edx,0x00cccc00 ; color of work area RRGGBB,8->color glide
mov esi,0x00cccc00 ; color of grab bar RRGGBB,8->color glide
mov edi,0x00cccc00 ; color of frames RRGGBB
int 0x40
mcall
; CLOSE BUTTON
@ -138,12 +138,12 @@ draw_window:
mov ecx,20*65536+12 ; [y start] *65536 + [y size]
mov edx,1 ; button id
mov esi,0x5599cc ; button color RRGGBB
int 0x40
mcall
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,2 ; 2, end of draw
int 0x40
mcall
ret

View File

@ -1,266 +0,0 @@
; new application structure
macro meos_app_start
{
use32
org 0x0
db 'MENUET01'
dd 0x01
dd __start
dd __end
dd __memory
dd __stack
if used __params & ~defined __params
dd __params
else
dd 0x0
end if
dd 0x0
}
MEOS_APP_START fix meos_app_start
macro code
{
__start:
}
CODE fix code
macro data
{
__data:
}
DATA fix data
macro udata
{
if used __params & ~defined __params
__params:
db 0
__end:
rb 255
else
__end:
end if
__udata:
}
UDATA fix udata
macro meos_app_end
{
align 32
rb 2048
__stack:
__memory:
}
MEOS_APP_END fix meos_app_end
; macro for defining multiline text data
struc mstr [sstring]
{
forward
local ssize
virtual at 0
db sstring
ssize = $
end virtual
dd ssize
db sstring
common
dd -1
}
; strings
macro sz name,[data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if used name
db data
end if
common
if used name
.size = $-name
end if
}
macro lsz name,[lng,data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if (used name)&(lang eq lng)
db data
end if
common
if used name
.size = $-name
end if
}
; easy system call macro
macro mpack dest, hsrc, lsrc
{
if (hsrc eqtype 0) & (lsrc eqtype 0)
mov dest, (hsrc) shl 16 + lsrc
else
if (hsrc eqtype 0) & (~lsrc eqtype 0)
mov dest, (hsrc) shl 16
add dest, lsrc
else
mov dest, hsrc
shl dest, 16
add dest, lsrc
end if
end if
}
macro __mov reg,a,b { ; mike.dld
if (~a eq)&(~b eq)
mpack reg,a,b
else if (~a eq)&(b eq)
mov reg,a
end if
}
macro mcall a,b,c,d,e,f { ; mike.dld
__mov eax,a
__mov ebx,b
__mov ecx,c
__mov edx,d
__mov esi,e
__mov edi,f
int 0x40
}
; optimize the code for size
__regs fix <eax,ebx,ecx,edx,esi,edi,ebp,esp>
macro add arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
inc arg1
else
add arg1,arg2
end if
else
add arg1,arg2
end if
}
macro sub arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
dec arg1
else
sub arg1,arg2
end if
else
sub arg1,arg2
end if
}
macro mov arg1,arg2
{
if (arg1 in __regs) & (arg2 eqtype 0)
if (arg2) = 0
xor arg1,arg1
else if (arg2) = 1
xor arg1,arg1
inc arg1
else if (arg2) = -1
or arg1,-1
else if (arg2) > -128 & (arg2) < 128
push arg2
pop arg1
else
mov arg1,arg2
end if
else
mov arg1,arg2
end if
}
macro struct name
{
virtual at 0
name name
sizeof.#name = $ - name
end virtual
}
; structures used in MeOS
struc process_information
{
.cpu_usage dd ? ; +0
.window_stack_position dw ? ; +4
.window_stack_value dw ? ; +6
.not_used1 dw ? ; +8
.process_name rb 12 ; +10
.memory_start dd ? ; +22
.used_memory dd ? ; +26
.PID dd ? ; +30
.x_start dd ? ; +34
.y_start dd ? ; +38
.x_size dd ? ; +42
.y_size dd ? ; +46
.slot_state dw ? ; +50
rb (1024-52)
}
struct process_information
struc system_colors
{
.frame dd ?
.grab dd ?
.grab_button dd ?
.grab_button_text dd ?
.grab_text dd ?
.work dd ?
.work_button dd ?
.work_button_text dd ?
.work_text dd ?
.work_graph dd ?
}
struct system_colors
; constants
; events
EV_IDLE = 0
EV_TIMER = 0
EV_REDRAW = 1
EV_KEY = 2
EV_BUTTON = 3
EV_EXIT = 4
EV_BACKGROUND = 5
EV_MOUSE = 6
EV_IPC = 7
EV_STACK = 8
; event mask bits for function 40
EVM_REDRAW = 1b
EVM_KEY = 10b
EVM_BUTTON = 100b
EVM_EXIT = 1000b
EVM_BACKGROUND = 10000b
EVM_MOUSE = 100000b
EVM_IPC = 1000000b
EVM_STACK = 10000000b

View File

@ -1,4 +1,5 @@
@erase lang.inc
@echo lang fix en >lang.inc
@fasm cpuspeed.asm cpuspeed
@erase lang.inc
@pause

View File

@ -1,4 +1,5 @@
@erase lang.inc
@echo lang fix ru >lang.inc
@fasm cpuspeed.asm cpuspeed
@erase lang.inc
@pause

View File

@ -16,13 +16,13 @@
dd 0x00000000 ; reserved=no extended header
include 'lang.inc'
include 'macros.inc'
include '..\..\..\..\macros.inc'
START: ; start of execution
mov eax,18
mov ebx,5
int 0x40
mcall
xor edx,edx
mov ebx,1000000
@ -38,13 +38,20 @@ START: ; start of execution
mov [edi],dl
sub edi,1
loop newnum
mov eax,48
mov ebx,3
mov ecx,sc
mov edx,sizeof.system_colors
mcall
red:
call draw_window ; at first, draw the window
still:
mov eax,10 ; wait here for event
int 0x40
mcall
cmp eax,1 ; redraw request ?
jz red
@ -57,17 +64,17 @@ still:
key: ; key
mov eax,2 ; just read it and ignore
int 0x40
mcall
jmp still
button: ; button
mov eax,17 ; get id
int 0x40
mcall
cmp ah,1 ; button id=1 ?
jnz still
or eax,-1 ; close this program
int 0x40
mcall
; *********************************************
@ -79,13 +86,7 @@ draw_window:
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,1 ; 1, start of draw
int 0x40
mov eax,48
mov ebx,3
mov ecx,sc
mov edx,sizeof.system_colors
int 0x40
mcall
; DRAW WINDOW
mov eax,0 ; function 0 : define and draw window
@ -93,8 +94,8 @@ draw_window:
mov ecx,100*65536+65 ; [y start] *65536 + [y size]
mov edx,[sc.work] ; color of work area RRGGBB,8->color glide
or edx,0x33000000 ; color of grab bar RRGGBB,8->color
mov edi,header ; WINDOW LABEL
int 0x40
mov edi,title ; WINDOW LABEL
mcall
mov ebx,20*65536+14 ; draw info text with function 4
@ -102,11 +103,11 @@ draw_window:
mov edx,text
mov esi,24
mov eax,4
int 0x40
mcall
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,2 ; 2, end of draw
int 0x40
mcall
ret
@ -117,7 +118,7 @@ draw_window:
text:
db 'CPU RUNNING AT MHZ'
header db 'CPU SPEED',0
title db 'CPU SPEED',0
I_END:

View File

@ -1,266 +0,0 @@
; new application structure
macro meos_app_start
{
use32
org 0x0
db 'MENUET01'
dd 0x01
dd __start
dd __end
dd __memory
dd __stack
if used __params & ~defined __params
dd __params
else
dd 0x0
end if
dd 0x0
}
MEOS_APP_START fix meos_app_start
macro code
{
__start:
}
CODE fix code
macro data
{
__data:
}
DATA fix data
macro udata
{
if used __params & ~defined __params
__params:
db 0
__end:
rb 255
else
__end:
end if
__udata:
}
UDATA fix udata
macro meos_app_end
{
align 32
rb 2048
__stack:
__memory:
}
MEOS_APP_END fix meos_app_end
; macro for defining multiline text data
struc mstr [sstring]
{
forward
local ssize
virtual at 0
db sstring
ssize = $
end virtual
dd ssize
db sstring
common
dd -1
}
; strings
macro sz name,[data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if used name
db data
end if
common
if used name
.size = $-name
end if
}
macro lsz name,[lng,data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if (used name)&(lang eq lng)
db data
end if
common
if used name
.size = $-name
end if
}
; easy system call macro
macro mpack dest, hsrc, lsrc
{
if (hsrc eqtype 0) & (lsrc eqtype 0)
mov dest, (hsrc) shl 16 + lsrc
else
if (hsrc eqtype 0) & (~lsrc eqtype 0)
mov dest, (hsrc) shl 16
add dest, lsrc
else
mov dest, hsrc
shl dest, 16
add dest, lsrc
end if
end if
}
macro __mov reg,a,b { ; mike.dld
if (~a eq)&(~b eq)
mpack reg,a,b
else if (~a eq)&(b eq)
mov reg,a
end if
}
macro mcall a,b,c,d,e,f { ; mike.dld
__mov eax,a
__mov ebx,b
__mov ecx,c
__mov edx,d
__mov esi,e
__mov edi,f
int 0x40
}
; optimize the code for size
__regs equ <eax,ebx,ecx,edx,esi,edi,ebp,esp>
macro add arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
inc arg1
else
add arg1,arg2
end if
else
add arg1,arg2
end if
}
macro sub arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
dec arg1
else
sub arg1,arg2
end if
else
sub arg1,arg2
end if
}
macro mov arg1,arg2
{
if (arg1 in __regs) & (arg2 eqtype 0)
if (arg2) = 0
xor arg1,arg1
else if (arg2) = 1
xor arg1,arg1
inc arg1
else if (arg2) = -1
or arg1,-1
else if (arg2) > -128 & (arg2) < 128
push arg2
pop arg1
else
mov arg1,arg2
end if
else
mov arg1,arg2
end if
}
macro struct name
{
virtual at 0
name name
sizeof.#name = $ - name
end virtual
}
; structures used in MeOS
struc process_information
{
.cpu_usage dd ? ; +0
.window_stack_position dw ? ; +4
.window_stack_value dw ? ; +6
.not_used1 dw ? ; +8
.process_name rb 12 ; +10
.memory_start dd ? ; +22
.used_memory dd ? ; +26
.PID dd ? ; +30
.x_start dd ? ; +34
.y_start dd ? ; +38
.x_size dd ? ; +42
.y_size dd ? ; +46
.slot_state dw ? ; +50
rb (1024-52)
}
struct process_information
struc system_colors
{
.frame dd ?
.grab dd ?
.grab_button dd ?
.grab_button_text dd ?
.grab_text dd ?
.work dd ?
.work_button dd ?
.work_button_text dd ?
.work_text dd ?
.work_graph dd ?
}
struct system_colors
; constants
; events
EV_IDLE = 0
EV_TIMER = 0
EV_REDRAW = 1
EV_KEY = 2
EV_BUTTON = 3
EV_EXIT = 4
EV_BACKGROUND = 5
EV_MOUSE = 6
EV_IPC = 7
EV_STACK = 8
; event mask bits for function 40
EVM_REDRAW = 1b
EVM_KEY = 10b
EVM_BUTTON = 100b
EVM_EXIT = 1000b
EVM_BACKGROUND = 10000b
EVM_MOUSE = 100000b
EVM_IPC = 1000000b
EVM_STACK = 10000000b

View File

@ -13,7 +13,7 @@ use32 ;
dd i_end ; Ž¡ê¥¬ ¨á¯®«ì§ã¥¬®© ¯ ¬ïâ¨, ¤«ï á⥪  ®â¢¥¤¥¬ 0å100 ¡ ©â ¨ ¢ë஢­¨¬ ­  £à­¨æã 4 ¡ ©â 
dd i_end ; à á¯®«®¦¨¬ ¯®§¨æ¨î á⥪  ¢ ®¡« á⨠¯ ¬ïâ¨, áࠧ㠧  ⥫®¬ ¯à®£à ¬¬ë. ‚¥à設  á⥪  ¢ ¤¨ ¯ §®­¥ ¯ ¬ïâ¨, 㪠§ ­­®¬ ¢ëè¥
dd 0x0,0x0 ; 㪠§ â¥«ì ­  áâபã á ¯ à ¬¥âà ¬¨.
include 'macros.inc'
include '..\..\..\..\macros.inc'
include 'editbox.inc'
align 4
use_edit_box procinfo,22,5

View File

@ -1,269 +0,0 @@
; new application structure
macro meos_app_start
{
use32
org 0x0
db 'MENUET01'
dd 0x01
dd __start
dd __end
dd __memory
dd __stack
if used __params & ~defined __params
dd __params
else
dd 0x0
end if
dd 0x0
}
MEOS_APP_START fix meos_app_start
macro code
{
__start:
}
CODE fix code
macro data
{
__data:
}
DATA fix data
macro udata
{
if used __params & ~defined __params
__params:
db 0
__end:
rb 255
else
__end:
end if
__udata:
}
UDATA fix udata
macro meos_app_end
{
align 32
rb 2048
__stack:
__memory:
}
MEOS_APP_END fix meos_app_end
; macro for defining multiline text data
struc mstr [sstring]
{
forward
local ssize
virtual at 0
db sstring
ssize = $
end virtual
dd ssize
db sstring
common
dd -1
}
; strings
macro sz name,[data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if used name
db data
end if
common
if used name
.size = $-name
end if
}
macro lsz name,[lng,data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if (used name)&(lang eq lng)
db data
end if
common
if used name
.size = $-name
end if
}
; easy system call macro
macro mpack dest, hsrc, lsrc
{
if (hsrc eqtype 0) & (lsrc eqtype 0)
mov dest, (hsrc) shl 16 + lsrc
else
if (hsrc eqtype 0) & (~lsrc eqtype 0)
mov dest, (hsrc) shl 16
add dest, lsrc
else
mov dest, hsrc
shl dest, 16
add dest, lsrc
end if
end if
}
macro __mov reg,a,b { ; mike.dld
if (~a eq)&(~b eq)
mpack reg,a,b
else if (~a eq)&(b eq)
mov reg,a
end if
}
macro mcall a,b,c,d,e,f { ; mike.dld
__mov eax,a
__mov ebx,b
__mov ecx,c
__mov edx,d
__mov esi,e
__mov edi,f
int 0x40
}
; optimize the code for size
__regs fix <eax,ebx,ecx,edx,esi,edi,ebp,esp>
macro add arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
inc arg1
else
add arg1,arg2
end if
else
add arg1,arg2
end if
}
macro sub arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
dec arg1
else
sub arg1,arg2
end if
else
sub arg1,arg2
end if
}
macro mov arg1,arg2
{
if (arg1 in __regs) & ((arg2 eqtype 0) | (arg2 eqtype '0'))
if (arg2) = 0
xor arg1,arg1
else if (arg2) = 1
xor arg1,arg1
inc arg1
else if (arg2) = -1
or arg1,-1
else if (arg2) > -128 & (arg2) < 128
push arg2
pop arg1
else
mov arg1,arg2
end if
else
mov arg1,arg2
end if
}
macro struct name
{
virtual at 0
name name
sizeof.#name = $ - name
end virtual
}
; structures used in MeOS
struc process_information
{
.cpu_usage dd ? ; +0
.window_stack_position dw ? ; +4
.window_stack_value dw ? ; +6
.not_used1 dw ? ; +8
.process_name rb 12 ; +10
.memory_start dd ? ; +22
.used_memory dd ? ; +26
.PID dd ? ; +30
.x_start dd ? ; +34
.y_start dd ? ; +38
.x_size dd ? ; +42
.y_size dd ? ; +46
.slot_state dw ? ; +50
dw ? ; +52 - reserved
.client_left dd ? ; +54
.client_top dd ? ; +58
.client_width dd ? ; +62
.client_height dd ? ; +66
.wnd_state db ? ; +70
rb (1024-71)
}
;struct process_information
struc system_colors
{
.frame dd ?
.grab dd ?
.grab_button dd ?
.grab_button_text dd ?
.grab_text dd ?
.work dd ?
.work_button dd ?
.work_button_text dd ?
.work_text dd ?
.work_graph dd ?
}
;struct system_colors
; constants
; events
EV_IDLE = 0
EV_TIMER = 0
EV_REDRAW = 1
EV_KEY = 2
EV_BUTTON = 3
EV_EXIT = 4
EV_BACKGROUND = 5
EV_MOUSE = 6
EV_IPC = 7
EV_STACK = 8
; event mask bits for function 40
EVM_REDRAW = 1b
EVM_KEY = 10b
EVM_BUTTON = 100b
EVM_EXIT = 1000b
EVM_BACKGROUND = 10000b
EVM_MOUSE = 100000b
EVM_IPC = 1000000b
EVM_STACK = 10000000b

Some files were not shown because too many files have changed in this diff Show More