*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 @@
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><E7A5AD>: <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><E7A5AD>:
* <20><EFBFBD><E3ADAA><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><E7A5AD> * <20><EFBFBD><E3ADAA><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><E7A5AD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:
* <20><EFBFBD><20><> <20><><EFBFBD>४⭮<E0A5AA><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20><><EFBFBD><E2A0AD><EFBFBD><EFBFBD> ᫨誮<E1ABA8> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> * <20><EFBFBD> <20>㭪樨 <20><>易⥫<EFBFBD><EFBFBD> <20><> <20><EFBFBD><EFBFBD><EFBFBD> <20>㭪権 15.2 <20> 15.5
<20><><EFBFBD><EFBFBD><E7A5AD> <20><EFBFBD><E0A8A2><EFBFBD><EFBFBD> <20><>, <20><><EFBFBD> <20><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><EFBFBD>
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><E4AEAD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><E0A0A6><EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> = 0x160000-0x10, <20><><EFBFBD>
ᮮ⢥<E1AEAE><E2A2A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><E1A8AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><E0A0A7>ࠬ 800*600. (800*600*3=0x15F900)
* <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> (<28><><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E8A5AD> <20><><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, ࠡ<><E0A0A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> * <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> (<28><><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E8A5AD> <20><><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, ࠡ<><E0A0A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>
<><E4AEAD>) <20><><EFBFBD><EFBFBD><EBA2A0><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><E3ADAA><EFBFBD> 3 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E1AEA2><>. <><E4AEAD>) <20><><EFBFBD><EFBFBD><EBA2A0><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><E3ADAA><EFBFBD> 3 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E1AEA2><>.
* <20><><EFBFBD><EFBFBD> <20><><EFBFBD> <20><EFBFBD><E3ADAA><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><E7A5AD><><E0A0A7>஢ 䮭<><E4AEAD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><E0A0A6><EFBFBD><EFBFBD> - * <20><><EFBFBD><EFBFBD> <20><><EFBFBD> <20><EFBFBD><E3ADAA><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><E7A5AD><><E0A0A7>஢ 䮭<><E4AEAD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><E0A0A6><EFBFBD><EFBFBD> -
@@ -524,8 +521,8 @@
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:
* <20><><EFBFBD><EFBFBD><E9A5AD> <20><><EFBFBD> <20><><20> <20><><EFBFBD><EFBFBD><E0A4A8><EFBFBD> (x,y) <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> * <20><><EFBFBD><EFBFBD><E9A5AD> <20><><EFBFBD> <20><><20> <20><><EFBFBD><EFBFBD><E0A4A8><EFBFBD> (x,y) <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>
(x+y*xsize)*3. (x+y*xsize)*3.
* <20>᫨ 㪠<><E3AAA0><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᬥ饭<E1ACA5><E9A5AD> <20><EFBFBD><EFBFBD> 0x160000-16 = * <20>᫨ 㪠<><E3AAA0><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᬥ饭<E1ACA5><E9A5AD> <20><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>㭪樥<E3ADAA> 15.1 ࠧ<><E0A0A7><EFBFBD>,
1.375 Mb - 16 bytes, <20><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
* <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> (<28><><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E8A5AD> <20><><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, ࠡ<><E0A0A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> * <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> (<28><><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E8A5AD> <20><><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, ࠡ<><E0A0A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>
<><E4AEAD>) <20><><EFBFBD><EFBFBD><EBA2A0><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><E3ADAA><EFBFBD> 3 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E1AEA2><>. <><E4AEAD>) <20><><EFBFBD><EFBFBD><EBA2A0><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><E3ADAA><EFBFBD> 3 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E1AEA2><>.
* <20><><EFBFBD><EFBFBD> <20><><EFBFBD> <20><EFBFBD><E3ADAA><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><E7A5AD> <20><><20><><E4AEAD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><E0A0A6><EFBFBD><EFBFBD> - * <20><><EFBFBD><EFBFBD> <20><><EFBFBD> <20><EFBFBD><E3ADAA><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><E7A5AD> <20><><20><><E4AEAD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><E0A0A6><EFBFBD><EFBFBD> -
@@ -569,8 +566,8 @@
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><E7A5AD>: <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><E7A5AD>:
* <20><EFBFBD><E3ADAA><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><E7A5AD> * <20><EFBFBD><E3ADAA><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><E7A5AD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:
* <20><20><><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><EFBFBD><E0A0AD><EFBFBD> 0x160000-16 = 1.375 Mb - 16 bytes, * <20><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᬥ饭<EFBFBD><EFBFBD> <20><EFBFBD><EFBFBD> <20><><EFBFBD><E2A0AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>㭪樥<E3ADAA> 15.1 ࠧ<><E0A0A7><EFBFBD>,
<20><EFBFBD> <20><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
* <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><EFBFBD><E0A0AD><EFBFBD><EFBFBD> <20><><EFBFBD> 3-<2D><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> BBGGRR. * <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><EFBFBD><E0A0AD><EFBFBD><EFBFBD> <20><><EFBFBD> 3-<2D><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> BBGGRR.
* <20><><EFBFBD><EFBFBD><><E4AEAD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><E0A0A6><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EBA2A0><EFBFBD><EFBFBD> <20><><EFBFBD><E1ABA5><EFBFBD><EFBFBD>⥫쭮 * <20><><EFBFBD><EFBFBD><><E4AEAD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><E0A0A6><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EBA2A0><EFBFBD><EFBFBD> <20><><EFBFBD><E1ABA5><EFBFBD><EFBFBD>⥫쭮
<><E1ABA5> <20><><EFBFBD><EFBFBD>, ᢥ<><E1A2A5><EFBFBD> <20><><EFBFBD><EFBFBD>. <><E1ABA5> <20><><EFBFBD><EFBFBD>, ᢥ<><E1A2A5><EFBFBD> <20><><EFBFBD><EFBFBD>.

View File

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

View File

@@ -2363,8 +2363,8 @@ sys_background:
cmp eax,2 ; SET PIXEL cmp eax,2 ; SET PIXEL
jnz nosb2 jnz nosb2
mov edx,0x160000-16 mov edx,[mem_BACKGROUND]
cmp edx,ebx cmp edx,ebx
jbe nosb2 jbe nosb2
mov edx,[ebx] mov edx,[ebx]
and edx,0xFF000000 ;255*256*256*256 and edx,0xFF000000 ;255*256*256*256
@@ -3221,12 +3221,7 @@ sys_window_move:
mov [MOUSE_BACKGROUND],byte 0 ; no mouse under mov [MOUSE_BACKGROUND],byte 0 ; no mouse under
mov [MOUSE_DOWN],byte 0 ; react to mouse up/down mov [MOUSE_DOWN],byte 0 ; react to mouse up/down
mov ecx,10 ; wait 1/10 second
.wmrl3:
call [draw_pointer] call [draw_pointer]
mov eax,1
call delay_hs
loop .wmrl3
mov [window_move_pr],0 mov [window_move_pr],0
@@ -3234,23 +3229,6 @@ sys_window_move:
ret 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 uglobal
window_move_pr dd 0x0 window_move_pr dd 0x0
window_move_eax dd 0x0 window_move_eax dd 0x0

View File

@@ -1,6 +1,7 @@
@echo off @echo off
set languages=en ru ge et set languages=en ru ge et
set __CPU_type=p5 p6 k6
set kpack=y n set kpack=y n
cls cls
echo Build KolibriOS apps echo Build KolibriOS apps
@@ -12,6 +13,14 @@ set /P res=">
@erase lang.inc @erase lang.inc
echo lang fix %res% > 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 mkdir bin
if not exist bin\demos mkdir bin\demos if not exist bin\demos mkdir bin\demos
if not exist bin\develop mkdir bin\develop if not exist bin\develop mkdir bin\develop
@@ -35,6 +44,7 @@ echo *
@fasm system\kbd\trunk\kbd.ASM bin\kbd @fasm system\kbd\trunk\kbd.ASM bin\kbd
@fasm system\launcher\trunk\launcher.asm bin\launcher @fasm system\launcher\trunk\launcher.asm bin\launcher
@fasm system\menu\trunk\menu.asm bin\@menu @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\PANEL\trunk\@PANEL.ASM bin\@PANEL
@fasm system\pcidev\trunk\pcidev.asm bin\pcidev @fasm system\pcidev\trunk\pcidev.asm bin\pcidev
@fasm system\RB\trunk\@RB.ASM bin\@RB @fasm system\RB\trunk\@RB.ASM bin\@RB
@@ -77,10 +87,12 @@ echo *
@fasm network\dhcp\trunk\dhcp.asm bin\network\dhcp @fasm network\dhcp\trunk\dhcp.asm bin\network\dhcp
@fasm network\dnsr\trunk\dnsr.asm bin\network\dnsr @fasm network\dnsr\trunk\dnsr.asm bin\network\dnsr
@fasm network\ethstat\trunk\ethstat.asm bin\network\ethstat @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\httpc\trunk\httpc.asm bin\network\httpc
@fasm network\https\trunk\https.asm bin\network\https @fasm network\https\trunk\https.asm bin\network\https
@fasm network\ipc\trunk\ipc.asm bin\network\ipc @fasm network\ipc\trunk\ipc.asm bin\network\ipc
@fasm network\local\trunk\local.asm bin\network\local @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\netsendc\trunk\netsendc.asm bin\network\netsendc
@fasm network\netsends\trunk\netsends.asm bin\network\netsends @fasm network\netsends\trunk\netsends.asm bin\network\netsends
@fasm network\nntpc\trunk\nntpc.asm bin\network\nntpc @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\midamp\trunk\midamp.asm bin\midamp
@fasm media\midiplay\trunk\midiplay.asm bin\midiplay @fasm media\midiplay\trunk\midiplay.asm bin\midiplay
@fasm media\mixer\trunk\mixer.asm bin\mixer @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\mv\trunk\mv.asm bin\mv
@fasm media\pic4\trunk\pic4.asm bin\pic4 @fasm media\pic4\trunk\pic4.asm bin\pic4
@fasm media\sb\trunk\sb.asm bin\sb @fasm media\sb\trunk\sb.asm bin\sb
@@ -143,6 +155,7 @@ cd ..\..\..
@fasm games\pong3\trunk\pong3.asm bin\games\pong3 @fasm games\pong3\trunk\pong3.asm bin\games\pong3
@fasm games\tanks\trunk\tanks.asm bin\games\tanks @fasm games\tanks\trunk\tanks.asm bin\games\tanks
@fasm games\tetris\trunk\tetris.asm bin\games\tetris @fasm games\tetris\trunk\tetris.asm bin\games\tetris
rem @fasm games\hunter\trunk\hunter.asm bin\games\hunter
echo * echo *
echo Building demos echo Building demos
@@ -200,6 +213,7 @@ echo *
@kpack bin\kbd @kpack bin\kbd
@kpack bin\launcher @kpack bin\launcher
@kpack bin\menu @kpack bin\menu
@kpack bin\mgb
@kpack bin\@PANEL @kpack bin\@PANEL
@kpack bin\pcidev @kpack bin\pcidev
@kpack bin\@RB @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 SCREEN_Y equ 200
include 'lang.inc' include 'lang.inc'
include '..\..\..\macros.inc'
include 'ascl.inc' include 'ascl.inc'
include 'ascgl.inc' include 'ascgl.inc'
include 'macros.inc'
START: START:
call draw_window call draw_window
call init_sin_cos call init_sin_cos
still: 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 mov eax,11
int 0x40 mcall
dec eax dec eax
; cmp eax,1 ; window redraw request ? ; cmp eax,1 ; window redraw request ?
@@ -84,36 +81,36 @@ red:
jmp still jmp still
key: key:
mov eax,2 mov eax,2
int 0x40 mcall
jmp still jmp still
button: button:
mov eax,17 mov eax,17
int 0x40 mcall
cmp ah,1 cmp ah,1
jne still jne still
exit: exit:
mov eax,-1 mov eax,-1
int 0x40 mcall
;Draw window ;Draw window
draw_window: draw_window:
mov eax,12 ;Start mov eax,12 ;Start
mov ebx,1 mov ebx,1
int 0x40 mcall
mov eax,0 ;Draw window mov eax,0 ;Draw window
mov ebx,100*65536+(SCREEN_X+9) ;x start*65536+x size 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 ecx,100*65536+(SCREEN_Y+26) ;y start*65536+y size
mov edx,0x13000000 ;0x03 use skinned window mov edx,0x13000000 ;0x03 use skinned window
mov edi,header mov edi,title
int 0x40 mcall
mov eax,12 ;End mov eax,12 ;End
mov ebx,2 mov ebx,2
int 0x40 mcall
ret ret
header db '3D TEST SAMPLE FOR MENUETOS',0 title db '3D TEST SAMPLE FOR MENUETOS',0
; Draw faces procedure ; Draw faces procedure
@@ -182,7 +179,7 @@ clear_screen_buffer:
mov ecx,SCREEN_X*65536+SCREEN_Y mov ecx,SCREEN_X*65536+SCREEN_Y
mov edx,5*65536+22 mov edx,5*65536+22
mov ax,7 mov ax,7
int 0x40 mcall
;White background ;White background
mov edi,scrbuf mov edi,scrbuf
@@ -578,7 +575,7 @@ translate_points:
pushad pushad
mov eax,37 mov eax,37
mov ebx,1 mov ebx,1
int 0x40 mcall
mov ebx,eax mov ebx,eax
shr eax,16 shr eax,16
and ebx,0xffff and ebx,0xffff

View File

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

View File

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

View File

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

View File

@@ -1,4 +1,5 @@
@erase lang.inc @erase lang.inc
@echo lang fix ru >lang.inc @echo lang fix ru >lang.inc
@fasm 3dcube2.asm 3dcube2 @fasm 3dcube2.asm 3dcube2
@erase lang.inc
@pause @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 dd 0x0 , 0x0 ; I_Param , I_Icon
include 'lang.inc' include 'lang.inc'
include '..\..\..\macros.inc'
include 'ascgl.inc' include 'ascgl.inc'
include 'ascl.inc' include 'ascl.inc'
@@ -271,13 +272,13 @@ skip_texgen:
mov eax,66 mov eax,66
mov ebx,1 mov ebx,1
mov ecx,1 mov ecx,1
int 0x40 mcall
mov eax,26 mov eax,26
mov ebx,2 mov ebx,2
mov ecx,1 mov ecx,1
mov edx,keymap+100 mov edx,keymap+100
int 0x40 mcall
;Build triangle matrix ;Build triangle matrix
mov esi,points mov esi,points
@@ -384,7 +385,7 @@ skip_moddata:
;Main loop ;Main loop
still: ; <20><EFBFBD><E1ADAE><EFBFBD><EFBFBD><> still: ; <20><EFBFBD><E1ADAE><EFBFBD><EFBFBD><>
mov eax,11 ; <20><EFBFBD><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> mov eax,11 ; <20><EFBFBD><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
int 0x40 mcall
cmp eax,1 ; <20><><EFBFBD><EFBFBD><><E1A4A2><20><><EFBFBD> <20><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E1AEA2><EFBFBD> cmp eax,1 ; <20><><EFBFBD><EFBFBD><><E1A4A2><20><><EFBFBD> <20><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E1AEA2><EFBFBD>
je red je red
@@ -490,16 +491,16 @@ ndt:
mov ecx,0x0000ff00 ; font 1 & color ( 0xF0RRGGBB ) mov ecx,0x0000ff00 ; font 1 & color ( 0xF0RRGGBB )
mov edx,keymap ; pointer to text beginning mov edx,keymap ; pointer to text beginning
mov esi,100 ; text length mov esi,100 ; text length
int 0x40 mcall
add edx,100 add edx,100
add ebx,10 add ebx,10
mov esi,60 ; text length mov esi,60 ; text length
mov ecx,0x00dddddd ; font 1 & color ( 0xF0RRGGBB ) mov ecx,0x00dddddd ; font 1 & color ( 0xF0RRGGBB )
int 0x40 mcall
mov edx,usemap mov edx,usemap
mov esi,60 ; text length mov esi,60 ; text length
mov ecx,0x0000ff00 mov ecx,0x0000ff00
int 0x40 mcall
jmp rx jmp rx
;01234567890123456789012345678901234567890123456789 ;01234567890123456789012345678901234567890123456789
usemap db ' E wer u [] asd zxc ' usemap db ' E wer u [] asd zxc '
@@ -721,7 +722,7 @@ ok4:
key: ; key key: ; key
mov eax,2 ; just read it and ignore mov eax,2 ; just read it and ignore
int 0x40 mcall
shr eax,8 shr eax,8
and eax,0xff and eax,0xff
@@ -747,14 +748,14 @@ noisa:
button: ; button button: ; button
mov eax,17 ; get id mov eax,17 ; get id
int 0x40 mcall
cmp ah,1 cmp ah,1
jz exit jz exit
jmp cycle jmp cycle
exit: exit:
mov eax,-1 or eax,-1
int 0x40 mcall
; ********************************************* ; *********************************************
; ******* WINDOW DEFINITIONS AND DRAW ******** ; ******* WINDOW DEFINITIONS AND DRAW ********
@@ -763,7 +764,7 @@ exit:
draw_window: draw_window:
mov eax,12 ; function 12:tell os about windowdraw mov eax,12 ; function 12:tell os about windowdraw
mov ebx,1 ; 1, start of draw mov ebx,1 ; 1, start of draw
int 0x40 mcall
; DRAW WINDOW ; DRAW WINDOW
mov eax,0 ; function 0 : define and draw window mov eax,0 ; function 0 : define and draw window
mov ebx,0*65536+SCREEN_X-1 ; [x start] *65536 + [x size] 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 edx,0x03ffffff ; color of work area RRGGBB,8->color gl
mov esi,0x005080d0 ; color of grab bar RRGGBB,8->color gl mov esi,0x005080d0 ; color of grab bar RRGGBB,8->color gl
mov edi,0x005080d0 ; color of frames RRGGBB mov edi,0x005080d0 ; color of frames RRGGBB
int 0x40 mcall
; WINDOW LABEL ; WINDOW LABEL
mov eax,4 ; function 4 : write text to window mov eax,4 ; function 4 : write text to window
mov ebx,8*65536+8 ; [x start] *65536 + [y start] mov ebx,8*65536+8 ; [x start] *65536 + [y start]
mov ecx,0x10ddeeff ; font 1 & color ( 0xF0RRGGBB ) mov ecx,0x10ddeeff ; font 1 & color ( 0xF0RRGGBB )
mov edx,labelt ; pointer to text beginning mov edx,labelt ; pointer to text beginning
mov esi,labellen-labelt ; text length mov esi,labellen-labelt ; text length
int 0x40 mcall
mov eax,12 mov eax,12
mov ebx,2 mov ebx,2
int 0x40 mcall
ret ret
dispimg: dispimg:
@@ -790,7 +791,7 @@ dispimg:
mov ebx,I_END ;zbuffer mov ebx,I_END ;zbuffer
mov ecx,SCREEN_X*65536+SCREEN_Y mov ecx,SCREEN_X*65536+SCREEN_Y
xor edx,edx ;0*65536+0 xor edx,edx ;0*65536+0
int 0x40 mcall
; ret ; ret
mov eax,8 mov eax,8
@@ -798,7 +799,7 @@ dispimg:
mov ecx,10*65536+20 mov ecx,10*65536+20
mov edx,1 mov edx,1
mov esi,0x0000aa00 mov esi,0x0000aa00
int 0x40 mcall
ret ret
clrscr: ; clear screen buffer clrscr: ; clear screen buffer

View File

@@ -20,8 +20,8 @@ lang equ ru
;0.07 convbmp ~13.05.2004 ;0.07 convbmp ~13.05.2004
;0.08 fps ~14.05.2004 ;0.08 fps ~14.05.2004
;0.09 drawfbox ~03.06.2004 ;0.09 drawfbox ~03.06.2004
;0.10 all macros optimized by Halyavin A., add at ~07.06.2004 ;0.10 all macros optimized by halyavin, add at ~07.06.2004
;0.11 many macros optimized by Halyavin A., add at ~30.08.2004 ;0.11 many macros optimized by halyavin, add at ~30.08.2004
;0.12 bmptoimg ~07.09.2004 ;0.12 bmptoimg ~07.09.2004
;0.13 imgtoimg ~08.09.2004 ;0.13 imgtoimg ~08.09.2004
;0.14 imgtoimg modify not brake bmp pict! ~09.09.2004 ;0.14 imgtoimg modify not brake bmp pict! ~09.09.2004
@@ -369,11 +369,11 @@ end if
;DrawBox ;DrawBox
macro drawfbox x,y,xs,ys,color macro drawfbox x,y,xs,ys,color
{ {
words2reg ebx,x,xs ;x*65536+xs wordstoreg ebx,x,xs ;x*65536+xs
words2reg ecx,y,ys ;y*65536+ys wordstoreg ecx,y,ys ;y*65536+ys
mov edx,color mov edx,color
mov eax,13 mov eax,13
int 0x40 mcall
} }
; FPS - Set Frame Per Second Display ; FPS - Set Frame Per Second Display
@@ -385,17 +385,17 @@ local no_out_fps
jmp spdat jmp spdat
savetime dd 0 savetime dd 0
fps_cntr dd 0 fps_cntr dd 0
fps dd 0 fps dd 0
ttt dd 0 ttt dd 0
spdat: spdat:
get_time: get_time:
mov eax,3 mov eax,3
int 0x40 mcall
cmp eax,[savetime] cmp eax,[savetime]
jne new_time jne new_time
inc [fps_cntr] inc [fps_cntr]
cmp dword [ttt],0 cmp dword [ttt],0
je out_fps je out_fps
dec dword [ttt] dec dword [ttt]
jmp no_out_fps jmp no_out_fps
new_time: new_time:
@@ -405,20 +405,20 @@ new_time:
mov [fps_cntr],0 mov [fps_cntr],0
out_fps: out_fps:
if ~(delcolor eq ) if ~(delcolor eq )
mov ebx,x*65536+36 mov ebx,x*65536+30
mov ecx,y*65536+7 mov ecx,y*65536+7
mov edx,delcolor mov edx,delcolor
mov eax,13 mov eax,13
int 0x40 mcall
end if end if
mov dword [ttt],fps_show_frequency mov dword [ttt],fps_show_frequency
mov eax,47 mov eax,47
mov ebx,6*65536 mov ebx,5*65536
; mov bl,0 ; mov bl,0
mov edx,x*65536+y mov edx,x*65536+y
mov esi,color mov esi,color
mov ecx,[fps] mov ecx,[fps]
int 0x40 mcall
no_out_fps: no_out_fps:
} }
@@ -462,9 +462,9 @@ nbc:
xor ecx,ecx xor ecx,ecx
ret ret
end if end if
bounce: bounce:
mov otv,1 mov otv,1
exit: exit:
} }
macro rgbtobgr image macro rgbtobgr image
@@ -495,8 +495,8 @@ macro setimg x , y ,arg3
shl ecx,16 shl ecx,16
add cx,[arg3+4] add cx,[arg3+4]
; wordstoreg ecx,[arg3],[arg3+4] ; wordstoreg ecx,[arg3],[arg3+4]
words2reg edx, x , y ;arg1*65536+arg2 wordstoreg edx, x , y ;arg1*65536+arg2
int 0x40 mcall
} }
macro setframe x , y ,arg3 macro setframe x , y ,arg3
@@ -504,10 +504,10 @@ macro setframe x , y ,arg3
mov eax,7 mov eax,7
mov ebx,arg3 mov ebx,arg3
add ebx,8 add ebx,8
words2reg edx, x , y ;arg1*65536+arg2 wordstoreg edx, x , y ;arg1*65536+arg2
add edx,dword [arg3] add edx,dword [arg3]
mov ecx,dword [arg3+4] mov ecx,dword [arg3+4]
int 0x40 mcall
} }
@@ -697,7 +697,7 @@ local nextelem,convertno32,nomorestring,convert1,nextstring,yespicsize
sub esi,dword [bmptoimg_data_area_bps] sub esi,dword [bmptoimg_data_area_bps]
sub esi,dword [bmptoimg_data_area_bps] sub esi,dword [bmptoimg_data_area_bps]
cmp esi,dword [bmptoimg_data_area_sop] cmp esi,dword [bmptoimg_data_area_sop]
jb end_bmp jb end_bmp
add edi,eax add edi,eax
add ebp,eax add ebp,eax
jmp nextstring jmp nextstring
@@ -705,7 +705,7 @@ local nextelem,convertno32,nomorestring,convert1,nextstring,yespicsize
convertno32: convertno32:
mov ebx,bmp_load_area mov ebx,bmp_load_area
add ebx, [bmp_load_area+14] add ebx, [bmp_load_area+14]
add ebx,14 ;start of color table add ebx,14 ;start of color table
push esi push esi
add esi,dword [bmptoimg_data_area_bps] add esi,dword [bmptoimg_data_area_bps]
mov dword [bmptoimg_data_area_eos],esi mov dword [bmptoimg_data_area_eos],esi
@@ -714,9 +714,9 @@ local nextelem,convertno32,nomorestring,convert1,nextstring,yespicsize
push eax push eax
movzx eax,byte [esi] movzx eax,byte [esi]
cmp word [bmp_load_area+28],4 cmp word [bmp_load_area+28],4
je convert4bpp je convert4bpp
cmp word [bmp_load_area+28],1 cmp word [bmp_load_area+28],1
je convert1bpp je convert1bpp
call converttable call converttable
convert2: convert2:
@@ -750,7 +750,7 @@ local nextelem,convertno32,nomorestring,convert1,nextstring,yespicsize
mov edx,7 mov edx,7
nextbit: nextbit:
xor eax,eax xor eax,eax
bt ecx,edx bt ecx,edx
jnc noaddelem jnc noaddelem
inc eax inc eax
noaddelem: noaddelem:
@@ -758,7 +758,7 @@ local nextelem,convertno32,nomorestring,convert1,nextstring,yespicsize
call converttable call converttable
pop edx pop edx
dec edx dec edx
js convert2 js convert2
add edi,3 add edi,3
add ebp,3 add ebp,3
@@ -776,12 +776,12 @@ local nextelem,convertno32,nomorestring,convert1,nextstring,yespicsize
bmptoimg_data_area_count=bmptoimg_data_area_count+1 bmptoimg_data_area_count=bmptoimg_data_area_count+1
if bmptoimg_data_area_count = 1 if bmptoimg_data_area_count = 1
; DATA AREA ; DATA AREA
bmptoimg_soi dd 0 bmptoimg_soi dd 0
bmptoimg_data_area_bps dd 0 bmptoimg_data_area_bps dd 0
bmptoimg_data_area_dwps dd 0 bmptoimg_data_area_dwps dd 0
bmptoimg_data_area_sop dd 0 bmptoimg_data_area_sop dd 0
bmptoimg_data_area_eop dd 0 bmptoimg_data_area_eop dd 0
bmptoimg_data_area_eos dd 0 bmptoimg_data_area_eos dd 0
end if end if
end_bmp: end_bmp:
@@ -816,13 +816,13 @@ _null equ 0x1000 ; 0x1000
; end if ; end if
;sss: ;sss:
mov esi,gifsrc ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> mov esi,gifsrc ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
mov edi,imgsrc ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> ᯨ᮪ <20><><EFBFBD><EFBFBD><E2A8AD> mov edi,imgsrc ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> ᯨ᮪ <20><><EFBFBD><EFBFBD><E2A8AD>
if defined gif_hash_offset if defined gif_hash_offset
mov eax,gif_hash_offset ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 4096*4 <20><><EFBFBD><EFBFBD> mov eax,gif_hash_offset ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 4096*4 <20><><EFBFBD><EFBFBD>
else else
mov eax,hasharea ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 4096*4 <20><><EFBFBD><EFBFBD> mov eax,hasharea ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 4096*4 <20><><EFBFBD><EFBFBD>
end if end if
call ReadGIF call ReadGIF
@@ -845,12 +845,12 @@ ReadGIF:
mov [img_count],eax mov [img_count],eax
inc eax inc eax
cmp dword[esi],'GIF8' cmp dword[esi],'GIF8'
jne er ; signature jne er ; signature
mov ecx,[esi+0xa] mov ecx,[esi+0xa]
inc eax inc eax
add esi,0xd add esi,0xd
mov edi,esi mov edi,esi
bt ecx,7 bt ecx,7
jnc nextblock jnc nextblock
mov [globalColor],esi mov [globalColor],esi
call Gif_skipmap call Gif_skipmap
@@ -891,8 +891,8 @@ noextblock:
push edi push edi
movzx ecx,word[esi] movzx ecx,word[esi]
inc esi inc esi
bt ecx,7 bt ecx,7
jc uselocal jc uselocal
push [globalColor] push [globalColor]
mov edi,esi mov edi,esi
jmp setPal jmp setPal
@@ -909,7 +909,7 @@ setPal:
mov edi,[table_ptr] mov edi,[table_ptr]
xor eax,eax xor eax,eax
cld cld
lodsb ; eax - block_count lodsb ; eax - block_count
add eax,esi add eax,esi
mov [block_ofs],eax mov [block_ofs],eax
mov [bit_count],8 mov [bit_count],8
@@ -933,7 +933,7 @@ reinit:
pop [compsize] pop [compsize]
call Gif_get_sym call Gif_get_sym
cmp eax,[CC] cmp eax,[CC]
je reinit je reinit
call Gif_output call Gif_output
cycle: cycle:
movzx ebx,ax movzx ebx,ax
@@ -941,9 +941,9 @@ cycle:
cmp eax,edx cmp eax,edx
jae notintable jae notintable
cmp eax,[CC] cmp eax,[CC]
je reinit je reinit
cmp eax,[EOI] cmp eax,[EOI]
je zend je zend
call Gif_output call Gif_output
zadd: zadd:
push eax push eax
@@ -997,7 +997,7 @@ Gif_skipmap:
; out: edi - pointer to area after colormap ; out: edi - pointer to area after colormap
and ecx,111b and ecx,111b
inc ecx ; color map size inc ecx ; color map size
mov ebx,1 mov ebx,1
shl ebx,cl shl ebx,cl
lea ebx,[ebx*2+ebx] lea ebx,[ebx*2+ebx]
@@ -1015,7 +1015,7 @@ shift:
jnz loop1 jnz loop1
inc esi inc esi
cmp esi,[block_ofs] cmp esi,[block_ofs]
jb noblock jb noblock
push eax push eax
xor eax,eax xor eax,eax
lodsb lodsb
@@ -1057,14 +1057,14 @@ loop2:
add esi,[Palette] add esi,[Palette]
if COLOR_ORDER eq MENUETOS if COLOR_ORDER eq MENUETOS
mov esi,[esi] mov esi,[esi]
bswap esi bswap esi
shr esi,8 shr esi,8
mov [edi],esi mov [edi],esi
add edi,3 add edi,3
else else
movsw movsw
movsb movsb
end if end if
loop loop2 loop loop2
@@ -1073,7 +1073,7 @@ loop2:
globalColor dd 1 globalColor dd 1
img_count dd 1 img_count dd 1
cur_info dd 1 ; image table pointer cur_info dd 1 ; image table pointer
img_start dd 1 img_start dd 1
codesize dd 1 codesize dd 1
compsize dd 1 compsize dd 1
@@ -1101,15 +1101,15 @@ local notintable, er, zend, nxt, continue, ex, Gif_skipmap
local Gif_get_sym, shift, nextbl, noblock, loop1, exx local Gif_get_sym, shift, nextbl, noblock, loop1, exx
local Gif_output, next, loop2 local Gif_output, next, loop2
_null equ 0x1000 ; 0x1000 _null fix 0x1000 ; 0x1000
mov esi,gifsrc ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> mov esi,gifsrc ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
mov edi,imgsrc ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> ᯨ᮪ <20><><EFBFBD><EFBFBD><E2A8AD> mov edi,imgsrc ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> ᯨ᮪ <20><><EFBFBD><EFBFBD><E2A8AD>
if defined gif_hash_offset if defined gif_hash_offset
mov eax,gif_hash_offset ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 4096*4 <20><><EFBFBD><EFBFBD> mov eax,gif_hash_offset ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 4096*4 <20><><EFBFBD><EFBFBD>
else else
mov eax,hasharea ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 4096*4 <20><><EFBFBD><EFBFBD> mov eax,hasharea ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 4096*4 <20><><EFBFBD><EFBFBD>
end if end if
call ReadGIF call ReadGIF
@@ -1130,12 +1130,12 @@ ReadGIF:
mov [img_count],eax mov [img_count],eax
inc eax inc eax
cmp dword[esi],'GIF8' cmp dword[esi],'GIF8'
jne er ; signature jne er ; signature
mov ecx,[esi+0xa] mov ecx,[esi+0xa]
inc eax inc eax
add esi,0xd add esi,0xd
mov edi,esi mov edi,esi
bt ecx,7 bt ecx,7
jnc nextblock jnc nextblock
mov [globalColor],esi mov [globalColor],esi
call Gif_skipmap call Gif_skipmap
@@ -1187,8 +1187,8 @@ noextblock:
push edi push edi
movzx ecx,word[esi] movzx ecx,word[esi]
inc esi inc esi
bt ecx,7 bt ecx,7
jc uselocal jc uselocal
push [globalColor] push [globalColor]
mov edi,esi mov edi,esi
jmp setPal jmp setPal
@@ -1205,7 +1205,7 @@ setPal:
mov edi,[table_ptr] mov edi,[table_ptr]
xor eax,eax xor eax,eax
cld cld
lodsb ; eax - block_count lodsb ; eax - block_count
add eax,esi add eax,esi
mov [block_ofs],eax mov [block_ofs],eax
mov [bit_count],8 mov [bit_count],8
@@ -1229,7 +1229,7 @@ reinit:
pop [compsize] pop [compsize]
call Gif_get_sym call Gif_get_sym
cmp eax,[CC] cmp eax,[CC]
je reinit je reinit
call Gif_output call Gif_output
cycle: cycle:
movzx ebx,ax movzx ebx,ax
@@ -1237,9 +1237,9 @@ cycle:
cmp eax,edx cmp eax,edx
jae notintable jae notintable
cmp eax,[CC] cmp eax,[CC]
je reinit je reinit
cmp eax,[EOI] cmp eax,[EOI]
je zend je zend
call Gif_output call Gif_output
zadd: zadd:
push eax push eax
@@ -1293,7 +1293,7 @@ Gif_skipmap:
; out: edi - pointer to area after colormap ; out: edi - pointer to area after colormap
and ecx,111b and ecx,111b
inc ecx ; color map size inc ecx ; color map size
mov ebx,1 mov ebx,1
shl ebx,cl shl ebx,cl
lea ebx,[ebx*2+ebx] lea ebx,[ebx*2+ebx]
@@ -1311,7 +1311,7 @@ shift:
jnz loop1 jnz loop1
inc esi inc esi
cmp esi,[block_ofs] cmp esi,[block_ofs]
jb noblock jb noblock
push eax push eax
xor eax,eax xor eax,eax
lodsb lodsb
@@ -1353,14 +1353,14 @@ loop2:
add esi,[Palette] add esi,[Palette]
if COLOR_ORDER eq MENUETOS if COLOR_ORDER eq MENUETOS
mov esi,[esi] mov esi,[esi]
bswap esi bswap esi
shr esi,8 shr esi,8
mov [edi],esi mov [edi],esi
add edi,3 add edi,3
else else
movsw movsw
movsb movsb
end if end if
loop loop2 loop loop2
@@ -1369,7 +1369,7 @@ loop2:
globalColor dd 1 globalColor dd 1
img_count dd 1 img_count dd 1
cur_info dd 1 ; image table pointer cur_info dd 1 ; image table pointer
img_start dd 1 img_start dd 1
codesize dd 1 codesize dd 1
compsize dd 1 compsize dd 1

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,4 +1,5 @@
@erase lang.inc @erase lang.inc
@echo lang fix ru >lang.inc @echo lang fix ru >lang.inc
@fasm bcdclk.asm bcdclk @fasm bcdclk.asm bcdclk
@erase lang.inc
@pause @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 if ~ BGI_LEVEL eq KERNEL
mov eax, 70 mov eax, 70
mov ebx, .fontattr mov ebx, .fontattr
int 0x40 mcall
test eax, eax test eax, eax
jnz .fail jnz .fail
dps2 '1' dps2 '1'
@@ -247,7 +247,7 @@ if ~ BGI_LEVEL eq KERNEL
mov [.fsize], eax mov [.fsize], eax
mov ebx,.fontinfo mov ebx,.fontinfo
mov eax,70 mov eax,70
int 0x40 ; ebx - file size mcall ; ebx - file size
else else
push edi esi edx push edi esi edx
mov eax,.font mov eax,.font
@@ -454,7 +454,7 @@ if ~ BGI_LEVEL eq KERNEL
mov eax,9 mov eax,9
mov ebx,BGI_PRC_INFO mov ebx,BGI_PRC_INFO
mov ecx,-1 mov ecx,-1
int 0x40 mcall
popa popa
end if end if
end if end if
@@ -587,14 +587,14 @@ if ~ BGI_LEVEL eq KERNEL
and edx, 0xFFFFFF and edx, 0xFFFFFF
; \end{diamond}[18.08.2006] ; \end{diamond}[18.08.2006]
mov eax,38 mov eax,38
int 0x40 mcall
test ebp,BGI_BOLD test ebp,BGI_BOLD
jz .nobold jz .nobold
test ebp,BGI_FREE test ebp,BGI_FREE
jnz .free5 jnz .free5
.free5: .free5:
add ebx,1 shl 16+1 add ebx,1 shl 16+1
int 0x40 mcall
.nobold: .nobold:
pop eax pop eax
else else

View File

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

View File

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

View File

@@ -1,4 +1,5 @@
@erase lang.inc @erase lang.inc
@echo lang fix ru >lang.inc @echo lang fix ru >lang.inc
@fasm bgitest.asm bgitest @fasm bgitest.asm bgitest
@erase lang.inc
@pause @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 @erase lang.inc
@echo lang fix en >lang.inc @echo lang fix en >lang.inc
@fasm colorref.asm colorref @fasm colorref.asm colorref
@erase lang.inc
@pause @pause

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -26,7 +26,7 @@ use32
dd 0x0 dd 0x0
dd 0x0 dd 0x0
include 'macros.inc' include '..\..\..\macros.inc'
ENTRANCE: ; start of code ENTRANCE: ; start of code
; ==== main ==== ; ==== main ====
@@ -41,7 +41,7 @@ call draw_eyes ; draw those funny "eyes"
mov eax,23 ; wait for event with timeout mov eax,23 ; wait for event with timeout
mov ebx,TIMEOUT mov ebx,TIMEOUT
int 0x40 mcall
cmp eax,1 ; redraw ? cmp eax,1 ; redraw ?
jnz no_draw jnz no_draw
@@ -60,12 +60,12 @@ jmp still ; loop
key: key:
mov eax,2 ; just read and ignore mov eax,2 ; just read and ignore
int 0x40 mcall
jmp still jmp still
button: ; analyze button button: ; analyze button
mov eax,-1 ; this is button 1 - we have only one button :-) mov eax,-1 ; this is button 1 - we have only one button :-)
int 0x40 mcall
jmp still jmp still
; -====- declarations -====- ; -====- declarations -====-
@@ -81,7 +81,7 @@ shape_window:
mov eax,50 ; set up shape reference area mov eax,50 ; set up shape reference area
mov ebx,0 mov ebx,0
mov ecx,winref mov ecx,winref
int 0x40 mcall
ret ret
@@ -91,7 +91,7 @@ draw_eyes: ; check mousepos to disable blinking
mov eax,37 mov eax,37
xor ebx,ebx xor ebx,ebx
int 0x40 mcall
cmp dword [mouse],eax cmp dword [mouse],eax
jne redraw_ok jne redraw_ok
ret ret
@@ -102,7 +102,7 @@ redraw_overlap: ; label for redraw event (without checkmouse)
mov eax,12 mov eax,12
mov ebx,1 mov ebx,1
int 0x40 mcall
xor eax,eax ; define window xor eax,eax ; define window
mov ebx,[win_ebx] mov ebx,[win_ebx]
@@ -110,19 +110,19 @@ mov ecx,[win_ecx]
xor edx,edx xor edx,edx
xor esi,esi xor esi,esi
xor edi,edi xor edi,edi
int 0x40 mcall
mov eax,8 ; define closebutton mov eax,8 ; define closebutton
mov ebx,60 mov ebx,60
mov ecx,45 mov ecx,45
mov edx,1 mov edx,1
int 0x40 mcall
mov eax,7 mov eax,7
mov ebx,skindata mov ebx,skindata
mov ecx,60*65536+30 mov ecx,60*65536+30
mov edx,15 mov edx,15
int 0x40 mcall
mov eax,15 mov eax,15
mov ebx,30 mov ebx,30
@@ -132,7 +132,7 @@ call draw_eye_point
mov eax,12 mov eax,12
mov ebx,2 mov ebx,2
int 0x40 mcall
ret ret
@@ -281,7 +281,7 @@ shl ebx,16
add ebx,4 add ebx,4
mov eax,13 mov eax,13
xor edx,edx xor edx,edx
int 0x40 mcall
popa popa
ret ret
@@ -295,12 +295,12 @@ prepare_eyes:
;mov ecx,0x00000000 ;mov ecx,0x00000000
;mov edx,0xFFFFFFFF ;mov edx,0xFFFFFFFF
;mov esi,imagedata ;mov esi,imagedata
;int 0x40 ;mcall
;cmp eax,0xFFFFFFFF ;cmp eax,0xFFFFFFFF
;jnz filefound ;jnz filefound
;mov eax,-1 ; file not exists... ;mov eax,-1 ; file not exists...
;int 0x40 ;mcall
;filefound: ;filefound:
mov esi,imagedata+25 ; transform grayscale to putimage format mov esi,imagedata+25 ; transform grayscale to putimage format
@@ -327,7 +327,7 @@ pop ecx
loop transform_loop loop transform_loop
mov eax,14 ; calculating screen position mov eax,14 ; calculating screen position
int 0x40 mcall
shr eax,1 shr eax,1
mov ax,59 mov ax,59
sub eax,30*65536 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 mem_end
dd 0,0 ; no parameters, no path dd 0,0 ; no parameters, no path
include 'macros.inc' include '..\..\..\macros.inc'
START: START:
@@ -27,7 +27,7 @@ draw_window:
mov eax,12 ; tell os about redraw mov eax,12 ; tell os about redraw
mov ebx,1 mov ebx,1
int 0x40 mcall
xor eax,eax ; define and draw window xor eax,eax ; define and draw window
mov ebx,100*65536+321 mov ebx,100*65536+321
@@ -35,37 +35,37 @@ draw_window:
mov edx,0x00000000 mov edx,0x00000000
mov esi,0x00000000 mov esi,0x00000000
mov edi,0x00000000 mov edi,0x00000000
int 0x40 mcall
mov al,4 ; 'FIRE FOR MENUET' mov al,4 ; 'FIRE FOR MENUET'
mov ebx,110*65536+8 mov ebx,110*65536+8
mov ecx,dword 0x00FFFFFF mov ecx,dword 0x00FFFFFF
mov edx,text mov edx,text
mov esi,textlen-text mov esi,textlen-text
int 0x40 mcall
mov al,8 mov al,8
mov ebx,(321-19)*65536+12 ; button start x & size mov ebx,(321-19)*65536+12 ; button start x & size
mov ecx,5*65536+12 ; button start y & size mov ecx,5*65536+12 ; button start y & size
mov edx,1 ; button number mov edx,1 ; button number
mov esi,0x009a0000 mov esi,0x009a0000
int 0x40 mcall
mov ebx,ecx ;5*65536+12 mov ebx,ecx ;5*65536+12
inc edx inc edx
int 0x40 mcall
mov ebx,18*65536+12 mov ebx,18*65536+12
inc edx inc edx
int 0x40 mcall
mov ebx,31*65536+12 mov ebx,31*65536+12
inc edx inc edx
int 0x40 mcall
mov al,12 ; tell os about redraw end mov al,12 ; tell os about redraw end
mov ebx,2 mov ebx,2
int 0x40 mcall
sta: ; calculate fire image sta: ; calculate fire image
@@ -134,7 +134,7 @@ typedone:
mov al, 5 ; in this moment always high 24 bits of eax are zero! mov al, 5 ; in this moment always high 24 bits of eax are zero!
mov ebx,[delay] mov ebx,[delay]
int 0x40 mcall
inc [calc] inc [calc]
cmp [calc], byte 2 cmp [calc], byte 2
@@ -184,12 +184,12 @@ typedone:
pop ebx pop ebx
mov ecx,4*80*65536+200 mov ecx,4*80*65536+200
mov edx,1*65536+22 mov edx,1*65536+22
int 0x40 mcall
nodrw: nodrw:
mov eax,11 ; check if os wants to talk to us mov eax,11 ; check if os wants to talk to us
int 0x40 mcall
dec eax dec eax
jz red jz red
cmp al, 3-1 cmp al, 3-1
@@ -197,13 +197,13 @@ typedone:
button: ; get button id button: ; get button id
mov al,17 mov al,17
int 0x40 mcall
shr eax, 8 shr eax, 8
dec eax dec eax
jnz noclose jnz noclose
or eax,-1 ; close this program or eax,-1 ; close this program
int 0x40 mcall
noclose: noclose:
dec eax ; change fire type 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 use32
org 0x0 org 0x0
@@ -17,7 +18,7 @@ START:
rep stosd rep stosd
mov al, 3 mov al, 3
int 0x40 mcall
mov [curtime], eax mov [curtime], eax
red: red:
@@ -25,7 +26,7 @@ red:
pop eax pop eax
push 1 push 1
pop ebx pop ebx
int 0x40 mcall
xor eax, eax xor eax, eax
mov ebx, 200*65536+325 mov ebx, 200*65536+325
@@ -33,14 +34,14 @@ red:
xor edx, edx xor edx, edx
xor esi, esi xor esi, esi
mov edi, 0x00100000 mov edi, 0x00100000
int 0x40 mcall
mov al, 8 mov al, 8
mov ebx, (325-19)*65536+12 mov ebx, (325-19)*65536+12
mov ecx, 5*65536+12 mov ecx, 5*65536+12
inc edx inc edx
mov esi, 0x00400000 mov esi, 0x00400000
int 0x40 mcall
mov al, 4 mov al, 4
mov ebx, 8*65536+8 mov ebx, 8*65536+8
@@ -48,18 +49,18 @@ red:
mov edx, fire_label mov edx, fire_label
push len00 push len00
pop esi pop esi
int 0x40 mcall
mov al, 12 mov al, 12
push 2 push 2
pop ebx pop ebx
int 0x40 mcall
still: still:
push 11 push 11
pop eax pop eax
int 0x40 mcall
dec eax dec eax
jz red jz red
@@ -71,7 +72,7 @@ still:
call image call image
push 3 push 3
pop eax pop eax
int 0x40 mcall
cmp eax, [curtime] cmp eax, [curtime]
jz still jz still
mov [curtime], eax mov [curtime], eax
@@ -81,25 +82,25 @@ print_fps:
mov ebx, (8+27*6)*65536+18 mov ebx, (8+27*6)*65536+18
mov ecx, 8*65536+8 mov ecx, 8*65536+8
xor edx, edx xor edx, edx
int 0x40 mcall
lea edx, [ebx-10] lea edx, [ebx-10]
mov al, 47 mov al, 47
mov ebx, 30000h mov ebx, 30000h
xor ecx, ecx xor ecx, ecx
xchg ecx, [fps] xchg ecx, [fps]
mov esi, 0x00FFFFFF ;0x00400000 mov esi, 0x00FFFFFF ;0x00400000
int 0x40 mcall
jmp still jmp still
key: key:
mov al, 2 mov al, 2
int 0x40 mcall
cmp ah, 1Bh ;<Esc> cmp ah, 1Bh ;<Esc>
jne still jne still
button: button:
; we have only one button, close ; we have only one button, close
or eax, -1 or eax, -1
int 0x40 mcall
image: image:

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,4 +1,5 @@
@erase lang.inc @erase lang.inc
@echo lang fix ru >lang.inc @echo lang fix ru >lang.inc
@fasm @ss.asm @ss @fasm @ss.asm @ss
@erase lang.inc
@pause @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 @erase lang.inc
@echo lang fix en >lang.inc @echo lang fix en >lang.inc
@fasm timer.asm timer @fasm timer.asm timer
@erase lang.inc
@pause @pause

View File

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

View File

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

View File

@@ -1,4 +1,5 @@
@erase lang.inc @erase lang.inc
@echo lang fix ru >lang.inc @echo lang fix ru >lang.inc
@fasm tinyfrac.asm tinyfrac @fasm tinyfrac.asm tinyfrac
@erase lang.inc
@pause @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

@@ -59,7 +59,7 @@ ZOOMLIMIT equ 13 ; can change to up to 13 for extended zoom in
; feel free to experiment with the following constants: ; feel free to experiment with the following constants:
DELTA equ 200 ; the unit of pan movement in pixels DELTA equ 200 ; the unit of pan movement in pixels
THRESHOLD equ 7 ; must be in the range of (0,255) THRESHOLD equ 7 ; must be in the range of (0,255)
STARTSCALE equ 5 ; a number from 0 to ZOOMLIMIT, inclusive STARTSCALE equ 5 ; a number from 0 to ZOOMLIMIT, inclusive
CHAR_COLOR equ 0fh ; white on black background (for PRINTZOOM feature) CHAR_COLOR equ 0fh ; white on black background (for PRINTZOOM feature)
@@ -83,7 +83,7 @@ use32
dd 0,0 dd 0,0
include 'lang.inc' include 'lang.inc'
include 'macros.inc' include '..\..\..\macros.inc'
STARTX dd 200 STARTX dd 200
STARTY dd 120 STARTY dd 120
@@ -93,32 +93,77 @@ scaleaddx dd 200
START: START:
red:
call draw_window call draw_window
call draw_fractal call draw_fractal
still: still:
mov eax,10 mov eax,10
int 0x40 mcall
cmp eax,1 dec eax
je red jz red
cmp eax,2 dec eax
je key jz key
cmp eax,3
je button 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 jmp still
red: no_bgr:
call draw_window
call put_image 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 jmp still
no_color:
jmp still
key: key:
mov eax,2 mov al,2
int 0x40 mcall
cmp ah,'e' cmp ah,'e'
je cycle je cycle
@@ -179,61 +224,6 @@ still:
call draw_fractal call draw_fractal
jmp still 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: color_cycle:
pusha pusha
@@ -257,7 +247,7 @@ color_cycle:
call put_image call put_image
mov eax,5 mov eax,5
mov ebx,1 mov ebx,1
int 0x40 mcall
dec esi dec esi
jnz newcycle jnz newcycle
@@ -287,11 +277,10 @@ draw_fractal:
pusha pusha
mov eax,4 mov eax,4
mov ebx,15*65536+35 mov ebx,10*65536+30
mov ecx,0xffffff mov ecx,0x80ffffff
mov edx,calc mov edx,calc
mov esi,calcl-calc mcall
int 0x40
popa popa
pusha pusha
@@ -309,12 +298,6 @@ draw_fractal:
push cx push cx
; and cl,0x7
; cmp cl,0
; jne noim
; call put_image
; noim:
mov cx, PIXWIDTH -1 ; width of screen in pixels mov cx, PIXWIDTH -1 ; width of screen in pixels
sub bp,cx ; sub bp,cx ;
@@ -369,9 +352,9 @@ put_image:
mov eax,7 mov eax,7
mov ebx,0x1000 mov ebx,0x1000
mov ecx,512*65536+255 mov ecx,512*65536+256
mov edx,10*65536+30 mov edx,4*65536+21
int 0x40 mcall
popa popa
@@ -446,38 +429,30 @@ draw_window:
mov eax,12 mov eax,12
mov ebx,1 mov ebx,1
int 0x40 mcall
mov eax,0 xor eax,eax
mov ebx,50*65536+531 mov ebx,50*65536+PIXWIDTH+8
mov ecx,100*65536+256+48 mov ecx,100*65536+PIXHEIGHT+25
mov edx,0x02334455 mov edx,0x13334455
mov esi,0x80778899 mov edi,title
mov edi,0x00778899 mcall
int 0x40
mov eax,8 mov eax,8
mov ebx,(531-19)*65536+12 mov ebx,290*65536+112
mov ecx,5*65536+12
mov edx,1
mov esi,0x808080
int 0x40
mov eax,8
mov ebx,300*65536+112
mov ecx,5*65536+12 mov ecx,5*65536+12
mov edx,2 mov edx,2
mov esi,0x808080 mov esi,0x808080
int 0x40 mcall
mov ebx,430*65536+12 mov ebx,420*65536+12
mov ecx,5*65536+12 mov ecx,5*65536+12
mov edx,3 mov edx,3
mov esi,0xa00000 mov esi,0xa00000
mov edi,3 mov edi,3
;mov eax,8
newcolor: newcolor:
mov eax,8 mcall
int 0x40
add ebx,13*65536 add ebx,13*65536
shr esi,8 shr esi,8
inc edx inc edx
@@ -485,15 +460,14 @@ draw_window:
jnz newcolor jnz newcolor
mov eax,4 mov eax,4
mov ebx,8*65536+8 mov ebx,300*65536+8
mov ecx,0xffffff mov ecx,0x80ffffff
mov edx,l mov edx,button_txt
mov esi,ll-l mcall
int 0x40
mov eax,12 mov eax,12
mov ebx,2 mov ebx,2
int 0x40 mcall
popa popa
ret ret
@@ -505,15 +479,9 @@ draw_window:
; ;
l: db 'TINYFRAC - MOVE: ARROWS, ZOOM Q/W, CYCLE: E/R ' title db 'Tinyfrac - MOVE: ARROWS, ZOOM Q/W, CYCLE: E/R',0
db 'SET AS WALLPAPER' button_txt db 'Set as wallpaper',0
ll:
calc db 'CALCULATING'
calcl:
I_END:
calc db 'CALCULATING',0
I_END:

View File

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

View File

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

View File

@@ -373,7 +373,7 @@ macro drawfbox x,y,xs,ys,color
wordstoreg ecx,y,ys ;y*65536+ys wordstoreg ecx,y,ys ;y*65536+ys
mov edx,color mov edx,color
mov eax,13 mov eax,13
int 0x40 mcall
} }
; FPS - Set Frame Per Second Display ; FPS - Set Frame Per Second Display
@@ -390,7 +390,7 @@ ttt dd 0
spdat: spdat:
get_time: get_time:
mov eax,3 mov eax,3
int 0x40 mcall
cmp eax,[savetime] cmp eax,[savetime]
jne new_time jne new_time
inc [fps_cntr] inc [fps_cntr]
@@ -409,7 +409,7 @@ if ~(delcolor eq )
mov ecx,y*65536+7 mov ecx,y*65536+7
mov edx,delcolor mov edx,delcolor
mov eax,13 mov eax,13
int 0x40 mcall
end if end if
mov dword [ttt],fps_show_frequency mov dword [ttt],fps_show_frequency
mov eax,47 mov eax,47
@@ -418,7 +418,7 @@ end if
mov edx,x*65536+y mov edx,x*65536+y
mov esi,color mov esi,color
mov ecx,[fps] mov ecx,[fps]
int 0x40 mcall
no_out_fps: no_out_fps:
} }
@@ -496,7 +496,7 @@ macro setimg x , y ,arg3
add cx,[arg3+4] add cx,[arg3+4]
; wordstoreg ecx,[arg3],[arg3+4] ; wordstoreg ecx,[arg3],[arg3+4]
wordstoreg edx, x , y ;arg1*65536+arg2 wordstoreg edx, x , y ;arg1*65536+arg2
int 0x40 mcall
} }
macro setframe x , y ,arg3 macro setframe x , y ,arg3
@@ -507,7 +507,7 @@ macro setframe x , y ,arg3
wordstoreg edx, x , y ;arg1*65536+arg2 wordstoreg edx, x , y ;arg1*65536+arg2
add edx,dword [arg3] add edx,dword [arg3]
mov ecx,dword [arg3+4] 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 dword [fileinfo+8],1 ; how many blocks to read (1)
mov eax,58 mov eax,58
mov ebx,fileinfo mov ebx,fileinfo
int 0x40 mcall
mov eax,[file_load_area+2] mov eax,[file_load_area+2]
shr eax,9 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> 512 <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 1 - <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> shr eax,9 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> 512 <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 1 - <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
inc eax inc eax
mov dword [fileinfo+8],eax mov dword [fileinfo+8],eax
mov eax,58 mov eax,58
mov ebx,fileinfo mov ebx,fileinfo
int 0x40 mcall
} }
@@ -91,7 +91,7 @@ asd:
mov edx,id mov edx,id
mov esi,bcolor mov esi,bcolor
mov eax,8 mov eax,8
int 0x40 mcall
mov eax,asd-lab ;calc size mov eax,asd-lab ;calc size
mov ebx,6 mov ebx,6
@@ -116,7 +116,7 @@ asd:
mov edx,lab mov edx,lab
mov esi,asd-lab ;calc size mov esi,asd-lab ;calc size
mov eax,4 mov eax,4
int 0x40 mcall
} }
@@ -145,7 +145,7 @@ mov [dlg_pid_get],0
mov eax,9 mov eax,9
mov ebx,procinfo mov ebx,procinfo
mov ecx,-1 mov ecx,-1
int 0x40 mcall
; convert eax bin to param dec ; convert eax bin to param dec
mov eax,dword [procinfo+30] ;offset of myPID mov eax,dword [procinfo+30] ;offset of myPID
@@ -179,12 +179,12 @@ new_d:
mov ebx,1 ; define IPC mov ebx,1 ; define IPC
mov ecx,path ; offset of area mov ecx,path ; offset of area
mov edx,150 ; size 150 bytes mov edx,150 ; size 150 bytes
int 0x40 mcall
; change wanted events list 7-bit IPC event ; change wanted events list 7-bit IPC event
mov eax,40 mov eax,40
mov ebx,01000111b mov ebx,01000111b
int 0x40 mcall
; ;
; STEP 3 run SYSTEM XTREE with parameters ; STEP 3 run SYSTEM XTREE with parameters
@@ -192,7 +192,7 @@ new_d:
mov eax,58 mov eax,58
mov ebx,run_fileinfo mov ebx,run_fileinfo
int 0x40 mcall
call redproc call redproc
@@ -200,7 +200,7 @@ new_d:
getmesloop: getmesloop:
mov eax,23 mov eax,23
mov ebx,50 ;0.5 sec mov ebx,50 ;0.5 sec
int 0x40 mcall
cmp eax,1 cmp eax,1
je mred je mred
@@ -215,14 +215,14 @@ getmesloop:
mov ebx,procinfo mov ebx,procinfo
mov ecx,-1 mov ecx,-1
mov eax,9 mov eax,9
int 0x40 mcall
mov ebp,eax mov ebp,eax
loox: loox:
mov eax,9 mov eax,9
mov ebx,procinfo mov ebx,procinfo
mov ecx,ebp mov ecx,ebp
int 0x40 mcall
mov eax,[DLGPID] mov eax,[DLGPID]
cmp [procinfo+30],eax ;IF Dialog find cmp [procinfo+30],eax ;IF Dialog find
je dlg_is_work ;jmp to dlg_is_work je dlg_is_work ;jmp to dlg_is_work
@@ -247,15 +247,15 @@ mred:
jmp getmesloop jmp getmesloop
mkey: mkey:
mov eax,2 mov eax,2
int 0x40 ; read (eax=2) mcall ; read (eax=2)
jmp getmesloop jmp getmesloop
mbutton: mbutton:
mov eax,17 ; get id mov eax,17 ; get id
int 0x40 mcall
cmp ah,1 ; button id=1 ? cmp ah,1 ; button id=1 ?
jne getmesloop jne getmesloop
mov eax,-1 ; close this program mov eax,-1 ; close this program
int 0x40 mcall
mgetmes: mgetmes:
; If dlg_pid_get then second message get jmp to still ; If dlg_pid_get then second message get jmp to still
@@ -357,7 +357,7 @@ mov [dlg_pid_get],0
mov eax,9 mov eax,9
mov ebx,procinfo mov ebx,procinfo
mov ecx,-1 mov ecx,-1
int 0x40 mcall
; convert eax bin to param dec ; convert eax bin to param dec
mov eax,dword [procinfo+30] ;offset of myPID mov eax,dword [procinfo+30] ;offset of myPID
@@ -391,12 +391,12 @@ new_d:
mov ebx,1 ; define IPC mov ebx,1 ; define IPC
mov ecx,path ; offset of area mov ecx,path ; offset of area
mov edx,120 ; size 150 bytes mov edx,120 ; size 150 bytes
int 0x40 mcall
; change wanted events list 7-bit IPC event ; change wanted events list 7-bit IPC event
mov eax,40 mov eax,40
mov ebx,01000111b mov ebx,01000111b
int 0x40 mcall
; ;
; STEP 3 run SYSTEM XTREE with parameters ; STEP 3 run SYSTEM XTREE with parameters
@@ -404,7 +404,7 @@ new_d:
mov eax,58 mov eax,58
mov ebx,run_fileinfo mov ebx,run_fileinfo
int 0x40 mcall
call redproc call redproc
@@ -412,7 +412,7 @@ new_d:
getmesloop: getmesloop:
mov eax,23 mov eax,23
mov ebx,50 ;0.5 sec mov ebx,50 ;0.5 sec
int 0x40 mcall
cmp eax,1 cmp eax,1
je mred je mred
@@ -427,14 +427,14 @@ getmesloop:
mov ebx,procinfo mov ebx,procinfo
mov ecx,-1 mov ecx,-1
mov eax,9 mov eax,9
int 0x40 mcall
mov ebp,eax mov ebp,eax
loox: loox:
mov eax,9 mov eax,9
mov ebx,procinfo mov ebx,procinfo
mov ecx,ebp mov ecx,ebp
int 0x40 mcall
mov eax,[DLGPID] mov eax,[DLGPID]
cmp [procinfo+30],eax ;IF Dialog find cmp [procinfo+30],eax ;IF Dialog find
je dlg_is_work ;jmp to dlg_is_work je dlg_is_work ;jmp to dlg_is_work
@@ -458,15 +458,15 @@ mred:
call redproc call redproc
jmp getmesloop jmp getmesloop
mkey: mkey:
int 0x40 ; read (eax=2) mcall ; read (eax=2)
jmp getmesloop jmp getmesloop
mbutton: mbutton:
mov eax,17 ; get id mov eax,17 ; get id
int 0x40 mcall
cmp ah,1 ; button id=1 ? cmp ah,1 ; button id=1 ?
jne getmesloop jne getmesloop
mov eax,-1 ; close this program mov eax,-1 ; close this program
int 0x40 mcall
mgetmes: mgetmes:
; If dlg_pid_get then second message get jmp to still ; If dlg_pid_get then second message get jmp to still
@@ -618,7 +618,7 @@ rxproc:
macro scank macro scank
{ {
mov eax,10 mov eax,10
int 0x40 mcall
} }
macro putpix x,y,color macro putpix x,y,color
@@ -627,7 +627,7 @@ macro putpix x,y,color
mov ecx,y mov ecx,y
mov edx,color mov edx,color
mov eax,1 mov eax,1
int 0x40 mcall
} }
macro puttxt x,y,offs,size,color macro puttxt x,y,offs,size,color
@@ -640,7 +640,7 @@ macro puttxt x,y,offs,size,color
mov edx,offs mov edx,offs
mov esi,size mov esi,size
mov eax,4 mov eax,4
int 0x40 mcall
} }
macro outcount data, x, y, color, numtype macro outcount data, x, y, color, numtype
@@ -652,7 +652,7 @@ macro outcount data, x, y, color, numtype
wordstoreg edx,x,y wordstoreg edx,x,y
mov esi,color mov esi,color
mov eax,47 mov eax,47
int 0x40 mcall
} }
; SCEVENT - Scan event ; SCEVENT - Scan event
@@ -660,7 +660,7 @@ macro outcount data, x, y, color, numtype
macro scevent red,key,but macro scevent red,key,but
{ {
mov eax,11 mov eax,11
int 0x40 mcall
dec eax dec eax
jz red jz red
dec eax dec eax
@@ -674,7 +674,7 @@ macro scevent red,key,but
macro wtevent red,key,but macro wtevent red,key,but
{ {
mov eax,10 mov eax,10
int 0x40 mcall
dec eax dec eax
jz red jz red
dec eax dec eax
@@ -689,7 +689,7 @@ macro timeevent xfps,noevent,red,key,but
{ {
mov eax,23 mov eax,23
mov ebx,xfps mov ebx,xfps
int 0x40 mcall
cmp eax,0 cmp eax,0
je noevent je noevent
dec eax dec eax
@@ -706,7 +706,7 @@ macro timeevent xfps,noevent,red,key,but
macro close macro close
{ {
mov eax,-1 mov eax,-1
int 0x40 mcall
} }
; DELAY - Create delay 1/100 sec ; DELAY - Create delay 1/100 sec
@@ -717,7 +717,7 @@ macro delay arg1
{ {
mov eax,5 mov eax,5
mov ebx,arg1 mov ebx,arg1
int 0x40 mcall
} }
; WINDOW - Draw window ; WINDOW - Draw window
@@ -732,7 +732,7 @@ macro window arg1,arg2,arg3,arg4,arg5
wordstoreg ecx,arg2,arg4 wordstoreg ecx,arg2,arg4
mov edx,arg5 mov edx,arg5
mov eax,0 mov eax,0
int 0x40 mcall
} }
macro colorwindow arg1,arg2,arg3,arg4,arg5,arg6,arg7 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 esi,arg6
mov edi,arg7 mov edi,arg7
mov eax,0 mov eax,0
int 0x40 mcall
} }
@@ -753,7 +753,7 @@ macro startwd
{ {
mov eax,12 mov eax,12
mov ebx,1 mov ebx,1
int 0x40 mcall
} }
; ENDWD - End window draw ; ENDWD - End window draw
@@ -762,7 +762,7 @@ macro endwd
{ {
mov eax,12 mov eax,12
mov ebx,2 mov ebx,2
int 0x40 mcall
} }
; LABEL - Put text to frame ; LABEL - Put text to frame
@@ -785,7 +785,7 @@ end if
mov edx,lab mov edx,lab
mov esi,asd-lab ;calc size mov esi,asd-lab ;calc size
mov eax,4 mov eax,4
int 0x40 mcall
} }
;Key's ;Key's

View File

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

View File

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

View File

@@ -1,4 +1,5 @@
@erase lang.inc @erase lang.inc
@echo lang fix ru >lang.inc @echo lang fix ru >lang.inc
@fasm tube.asm tube @fasm tube.asm tube
@erase lang.inc
@pause @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 0x40000
dd 0,0 dd 0,0
include 'macros.inc' include '..\..\..\macros.inc'
START: START:
@@ -38,7 +38,7 @@ still:
mov eax,23 mov eax,23
mov ebx,1 mov ebx,1
int 0x40 mcall
cmp eax,1 cmp eax,1
jne no_red jne no_red
@@ -50,8 +50,7 @@ still:
je still je still
or eax,-1 or eax,-1
int 0x40 mcall
SCREEN equ 160 SCREEN equ 160
PIXBUF equ 200h PIXBUF equ 200h
@@ -179,7 +178,7 @@ display_image:
mov ecx,320*65536+160 mov ecx,320*65536+160
xor edx,edx xor edx,edx
mov ebx,0x10000 mov ebx,0x10000
int 0x40 mcall
popa popa
ret ret
@@ -192,23 +191,20 @@ draw_window:
mov eax,12 mov eax,12
mov ebx,1 mov ebx,1
int 0x40 mcall
xor eax,eax xor eax,eax
mov ebx,100*65536+329 mov ebx,100*65536+329
mov ecx,100*65536+186 mov ecx,100*65536+186
mov edx,0x33000000 mov edx,0x33000000
mov edi,header mov edi,title
int 0x40 mcall
mov eax,12 mov eax,12
mov ebx,2 mov ebx,2
int 0x40 mcall
popa popa
ret ret
header db appname,0 title db appname,0
db 41,0,0xC3,0x3C db 41,0,0xC3,0x3C

View File

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

View File

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

View File

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

View File

@@ -1,10 +1,10 @@
include "macros.inc" include "..\..\..\macros.inc"
initipc: initipc:
mov eax,9 mov eax,9
mov ebx,prc mov ebx,prc
mov ecx,-1 mov ecx,-1
int 0x40 mcall
mov ecx,eax mov ecx,eax
loop1: loop1:
@@ -12,7 +12,7 @@ loop1:
mov eax,9 mov eax,9
mov ebx,prc mov ebx,prc
int 0x40 mcall
cmp word [prc+10],'CM' cmp word [prc+10],'CM'
jne no_cmd jne no_cmd
@@ -39,18 +39,18 @@ no_exit:
mov ecx,dword [cmdpid] mov ecx,dword [cmdpid]
mov edx,printf mov edx,printf
mov esi,4 mov esi,4
int 0x40 mcall
call initcmd call initcmd
waitcmdinit: waitcmdinit:
mov eax,40 mov eax,40
mov ebx,01000000b mov ebx,01000000b
int 0x40 mcall
mov eax,23 mov eax,23
mov ebx,100 mov ebx,100
int 0x40 mcall
cmp eax,7 cmp eax,7
je cmd_ok je cmd_ok
@@ -64,19 +64,19 @@ cmd_ok:
mov eax,18 mov eax,18
mov ebx,3 mov ebx,3
mov ecx,dword [cmdnumb] mov ecx,dword [cmdnumb]
int 0x40 mcall
ret ret
pause1: pause1:
mov eax,5 mov eax,5
mov ebx,1 mov ebx,1
int 0x40 mcall
ret ret
exit: exit:
mov eax,-1 or eax,-1
int 0x40 mcall
cls: cls:
mov eax,60 mov eax,60
@@ -84,7 +84,7 @@ cls:
mov ecx,dword [cmdpid] mov ecx,dword [cmdpid]
mov edx,ipccls mov edx,ipccls
mov esi,4 mov esi,4
int 0x40 mcall
call pause1 call pause1
@@ -120,7 +120,7 @@ loopprt:
mov ecx,dword [cmdpid] mov ecx,dword [cmdpid]
mov edx,stripc mov edx,stripc
mov esi,84 mov esi,84
int 0x40 mcall
call pause1 call pause1
@@ -132,7 +132,7 @@ eol:
mov ecx,dword [cmdpid] mov ecx,dword [cmdpid]
mov edx,ipceol mov edx,ipceol
mov esi,4 mov esi,4
int 0x40 mcall
call pause1 call pause1
@@ -144,13 +144,13 @@ initcmd:
mov ecx,dword [cmdpid] mov ecx,dword [cmdpid]
mov edx,ipckey mov edx,ipckey
mov esi,4 mov esi,4
int 0x40 mcall
mov eax,60 mov eax,60
mov ebx,1 mov ebx,1
mov ecx,ipcb mov ecx,ipcb
mov edx,28 mov edx,28
int 0x40 mcall
cld cld
mov ecx,28 mov ecx,28
@@ -166,10 +166,10 @@ getkey:
waitagain: waitagain:
mov eax,40 mov eax,40
mov ebx,01000000b mov ebx,01000000b
int 0x40 mcall
mov eax,10 mov eax,10
int 0x40 mcall
cmp eax,7 cmp eax,7
jne waitagain jne waitagain
@@ -186,7 +186,7 @@ endipc:
mov ecx,dword [cmdpid] mov ecx,dword [cmdpid]
mov edx,ipcend mov edx,ipcend
mov esi,4 mov esi,4
int 0x40 mcall
jmp exit 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 shl ecx,16
add ecx,ch_size add ecx,ch_size
mov edx,ch_border_color mov edx,ch_border_color
int 0x40 ;<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> mcall ;<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>
mov edx,ch_color mov edx,ch_color
add ebx,1 shl 16 - 2 add ebx,1 shl 16 - 2
add ecx,1 shl 16 - 2 add ecx,1 shl 16 - 2
int 0x40 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> mcall ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
test word ch_flags,2 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD> CF test word ch_flags,2 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD> CF
jz @f ;<EFBFBD> <EFBFBD> CF=1, <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> @@ jz @f ;<EFBFBD> <EFBFBD> CF=1, <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> @@
@@ -73,7 +73,7 @@ check_box:
movzx esi,word ch_text_length ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> esi movzx esi,word ch_text_length ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> esi
;<EFBFBD><EFBFBD><EFBFBD> <EFBFBD> eax <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ;<EFBFBD><EFBFBD><EFBFBD> <EFBFBD> eax <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
mov eax,4 mov eax,4
int 0x40 ;<EFBFBD><EFBFBD> mcall ;<EFBFBD><EFBFBD>
popa ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD> popa ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD>
ret ;<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ret ;<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
@@ -96,13 +96,13 @@ ret ;
shl ecx,16 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> 16 <EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> (<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> 65536) shl ecx,16 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> 16 <EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> (<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> 65536)
mov cx,bp ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> cx mov cx,bp ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> cx
;pop cx ;pop cx
int 0x40 ;<EFBFBD><EFBFBD> mcall ;<EFBFBD><EFBFBD>
ret ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ret ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
.mouse: ;<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> .mouse: ;<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
pusha pusha
mov eax,37 ;<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> - <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> mov eax,37 ;<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> - <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
mov ebx,2 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 2 mov ebx,2 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 2
int 0x40 ;<EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> mcall ;<EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>
test eax,eax ;<EFBFBD><EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD> eax=0, <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD> test eax,eax ;<EFBFBD><EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD> eax=0, <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD>
jnz @f ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> @@ jnz @f ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> @@
btr word ch_flags,2 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD> cf <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>. btr word ch_flags,2 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD> cf <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
@@ -120,7 +120,7 @@ pusha
mov eax,37 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> mov eax,37 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>
mov ebx,1 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 1 mov ebx,1 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 1
int 0x40 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>⥫쭮 <EFBFBD><EFBFBD><EFBFBD><EFBFBD> mcall ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>⥫쭮 <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
movzx ebx,word ch_top ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> bx <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> movzx ebx,word ch_top ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> bx <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>
cmp ax,bx ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> cmp ax,bx ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>

View File

@@ -23,7 +23,7 @@ use32 ;
; 㪠<><E3AAA0><EFBFBD> <20><> <20><><EFBFBD>, <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><20><><EFBFBD><EFBFBD>, ; 㪠<><E3AAA0><EFBFBD> <20><> <20><><EFBFBD>, <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><20><><EFBFBD><EFBFBD>,
; <20><><EFBFBD><20><><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><E0A8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ; <20><><EFBFBD><20><><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><E0A8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
;------------------ ;------------------
include 'macros.inc' include '..\..\..\..\macros.inc'
include 'check.inc' ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><> check.inc include 'check.inc' ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><> check.inc
; version_ch ;<3B><><EFBFBD><EFBFBD><EFBFBD><E5AEA4><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><E7A5AD> "<22><><EFBFBD>ன" <20><><EFBFBD>ᨨ check_box ; version_ch ;<3B><><EFBFBD><EFBFBD><EFBFBD><E5AEA4><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><E7A5AD> "<22><><EFBFBD>ன" <20><><EFBFBD>ᨨ check_box
version_ch1 ;<3B><><EFBFBD><EFBFBD><EFBFBD><E5AEA4><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><E7A5AD> new <20><><EFBFBD>ᨨ check_box1 version_ch1 ;<3B><><EFBFBD><EFBFBD><EFBFBD><E5AEA4><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><E7A5AD> new <20><><EFBFBD>ᨨ check_box1
@@ -36,16 +36,16 @@ start: ;
mov ebx,3 mov ebx,3
mov ecx,sc mov ecx,sc
mov edx,sizeof.system_colors mov edx,sizeof.system_colors
int 0x40 mcall
mov eax,40 ;<3B><><EFBFBD><E2A0AD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><> mov eax,40 ;<3B><><EFBFBD><E2A0AD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><>
mov ebx,0x25 ;<3B><><EFBFBD><EFBFBD> <20><EFBFBD><><E0A5A0><EFBFBD><E0AEA2><EFBFBD> ⮫쪮 <20><><><EFBFBD><E9A5AD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E1AEA2>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><E0A5A4>񭭠<EFBFBD><><E0A0AD>, ᮡ<><20><> <20><><EFBFBD><EFBFBD> (<28><><EFBFBD>-<2D><> <20><><EFBFBD><EFBFBD><E7A8AB><EFBFBD> - <20><><EFBFBD><EFBFBD><20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><E9A5AD>; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EBA2A0><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><E2A5AD>) mov ebx,0x25 ;<3B><><EFBFBD><EFBFBD> <20><EFBFBD><><E0A5A0><EFBFBD><E0AEA2><EFBFBD> ⮫쪮 <20><><><EFBFBD><E9A5AD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E1AEA2>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><E0A5A4>񭭠<EFBFBD><><E0A0AD>, ᮡ<><20><> <20><><EFBFBD><EFBFBD> (<28><><EFBFBD>-<2D><> <20><><EFBFBD><EFBFBD><E7A8AB><EFBFBD> - <20><><EFBFBD><EFBFBD><20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><E9A5AD>; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EBA2A0><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><E2A5AD>)
int 0x40 mcall
red_win: red_win:
call draw_window ;<3B><><EFBFBD><E0A2AE>砫쭮 <20><><EFBFBD><EFBFBD><EFBFBD><E5AEA4><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><E1AEA2><EFBFBD> <20><><EFBFBD><EFBFBD> call draw_window ;<3B><><EFBFBD><E0A2AE>砫쭮 <20><><EFBFBD><EFBFBD><EFBFBD><E5AEA4><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><E1AEA2><EFBFBD> <20><><EFBFBD><EFBFBD>
still: ;<3B><EFBFBD><E1ADAE><EFBFBD><EFBFBD> <20><><EFBFBD><E0A0A1> still: ;<3B><EFBFBD><E1ADAE><EFBFBD><EFBFBD> <20><><EFBFBD><E0A0A1>
mov eax,10 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><E1AEA1><EFBFBD><EFBFBD> mov eax,10 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><E1AEA1><EFBFBD><EFBFBD>
int 0x40 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><20> <20><><EFBFBD><E7A5AD> 2 <20><><EFBFBD><EFBFBD><EFBFBD>ᥪ㭤 mcall ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><20> <20><><EFBFBD><E7A5AD> 2 <20><><EFBFBD><EFBFBD><EFBFBD>ᥪ㭤
cmp al,0x1 ;<3B><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> cmp al,0x1 ;<3B><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
jz red_win jz red_win
@@ -55,14 +55,14 @@ still: ;
jmp still ;<3B><20><><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E1ABA5><EFBFBD><EFBFBD><EFBFBD> <20><><><E1ADAE> <20><> jmp still ;<3B><20><><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E1ABA5><EFBFBD><EFBFBD><EFBFBD> <20><><><E1ADAE> <20><>
button: button:
or eax,-1 ;<3B> eax,-1 - 5 ,<2C><><EFBFBD><20> <20><><EFBFBD> <20><> ⮫쪮 3 <20><><EFBFBD><EFBFBD><EFBFBD> or eax,-1 ;<3B> eax,-1 - 5 ,<2C><><EFBFBD><20> <20><><EFBFBD> <20><> ⮫쪮 3 <20><><EFBFBD><EFBFBD><EFBFBD>
int 0x40 ;<3B><><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><EBAFAE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><20><> <20>ணࠬ<E0AEA3><E0A0AC> mcall ;<3B><><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><EBAFAE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><20><> <20>ணࠬ<E0AEA3><E0A0AC>
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
draw_window: ;<3B><><EFBFBD><E1AEA2><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><EFBFBD><E0A8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD> draw_window: ;<3B><><EFBFBD><E1AEA2><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><EFBFBD><E0A8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
mov eax,12 ;<3B><><E0A5A3><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><E7A5AD> = 12 mov eax,12 ;<3B><><E0A5A3><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><E7A5AD> = 12
mov ebx,1 ;<3B><><EFBFBD><EFBFBD><E1A2AE><EFBFBD> 1 mov ebx,1 ;<3B><><EFBFBD><EFBFBD><E1A2AE><EFBFBD> 1
int 0x40 mcall
xor eax,eax ;<3B><><EFBFBD><EFBFBD><E3ABA8> eax xor eax,eax ;<3B><><EFBFBD><EFBFBD><E3ABA8> eax
mov ebx,50*65536+180 ;[<5B><><EFBFBD><EFBFBD><E0A4A8><EFBFBD><EFBFBD> <20><> <20><><EFBFBD> x]*65536 + [ࠧ<><E0A0A7><EFBFBD> <20><> <20><><EFBFBD> x] mov ebx,50*65536+180 ;[<5B><><EFBFBD><EFBFBD><E0A4A8><EFBFBD><EFBFBD> <20><> <20><><EFBFBD> x]*65536 + [ࠧ<><E0A0A7><EFBFBD> <20><> <20><><EFBFBD> x]
@@ -70,13 +70,13 @@ draw_window: ;
mov edx,[sc.work] ; color of work area RRGGBB,8->color gl mov edx,[sc.work] ; color of work area RRGGBB,8->color gl
or edx,0xb3000000 or edx,0xb3000000
mov edi,hed mov edi,hed
int 0x40 ;<3B><><EFBFBD><EFBFBD><EFBFBD><E1AEA2><EFBFBD> <20><><EFBFBD><EFBFBD> <20><EFBFBD><E0A8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD> mcall ;<3B><><EFBFBD><EFBFBD><EFBFBD><E1AEA2><EFBFBD> <20><><EFBFBD><EFBFBD> <20><EFBFBD><E0A8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
draw_check_boxes check_boxes,check_boxes_end ;<3B><><EFBFBD><E1AEA2><EFBFBD><EFBFBD><><E7A5AA><EFBFBD> draw_check_boxes check_boxes,check_boxes_end ;<3B><><EFBFBD><E1AEA2><EFBFBD><EFBFBD><><E7A5AA><EFBFBD>
mov eax,12 ;<3B><EFBFBD><E3ADAA><EFBFBD> 12 - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>/<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E1AEA2> <20><><EFBFBD><EFBFBD>. mov eax,12 ;<3B><EFBFBD><E3ADAA><EFBFBD> 12 - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>/<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E1AEA2> <20><><EFBFBD><EFBFBD>.
mov ebx,2 ;<3B><><EFBFBD><EFBFBD><EFBFBD><E3ADAA><EFBFBD> 2 - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E1AEA2> <20><><EFBFBD><EFBFBD>. mov ebx,2 ;<3B><><EFBFBD><EFBFBD><EFBFBD><E3ADAA><EFBFBD> 2 - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E1AEA2> <20><><EFBFBD><EFBFBD>.
int 0x40 mcall
ret 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 0x1000 ; esp
dd 0x00000000 ; reserved=no extended header dd 0x00000000 ; reserved=no extended header
include 'macros.inc' include '..\..\..\..\macros.inc'
@@ -29,7 +29,7 @@ START: ; start of execution
still: still:
mov eax,10 ; wait here for event mov eax,10 ; wait here for event
int 0x40 mcall
dec eax ; redraw request ? dec eax ; redraw request ?
jz red jz red
@@ -38,16 +38,16 @@ still:
button: button:
mov al,17 ; get id mov al,17 ; get id
int 0x40 mcall
cmp ah,1 ; button id=1 ? cmp ah,1 ; button id=1 ?
jne noclose jne noclose
or eax,-1 ; close this program or eax,-1 ; close this program
int 0x40 mcall
key: ; key key: ; key
mov al,2 ; just read it and ignore mov al,2 ; just read it and ignore
int 0x40 mcall
jmp still jmp still
noclose: noclose:
@@ -61,12 +61,12 @@ shape_window:
mov eax,50 ; give the shape reference area mov eax,50 ; give the shape reference area
mov ebx,0 mov ebx,0
mov ecx,shape_reference mov ecx,shape_reference
int 0x40 mcall
mov eax,50 ; give the shape scale 32 x 32 -> 128 x 128 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 ebx,1 ; you dont have to give this, scale is 1:1 by default
mov ecx,2 mov ecx,2
int 0x40 mcall
popa popa
@@ -118,7 +118,7 @@ draw_window:
mov eax,12 ; function 12:tell os about windowdraw mov eax,12 ; function 12:tell os about windowdraw
mov ebx,1 ; 1, start of draw mov ebx,1 ; 1, start of draw
int 0x40 mcall
; DRAW WINDOW ; DRAW WINDOW
xor eax,eax ; function 0 : define and 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 edx,0x00cccc00 ; color of work area RRGGBB,8->color glide
mov esi,0x00cccc00 ; color of grab bar RRGGBB,8->color glide mov esi,0x00cccc00 ; color of grab bar RRGGBB,8->color glide
mov edi,0x00cccc00 ; color of frames RRGGBB mov edi,0x00cccc00 ; color of frames RRGGBB
int 0x40 mcall
; CLOSE BUTTON ; CLOSE BUTTON
@@ -138,12 +138,12 @@ draw_window:
mov ecx,20*65536+12 ; [y start] *65536 + [y size] mov ecx,20*65536+12 ; [y start] *65536 + [y size]
mov edx,1 ; button id mov edx,1 ; button id
mov esi,0x5599cc ; button color RRGGBB mov esi,0x5599cc ; button color RRGGBB
int 0x40 mcall
mov eax,12 ; function 12:tell os about windowdraw mov eax,12 ; function 12:tell os about windowdraw
mov ebx,2 ; 2, end of draw mov ebx,2 ; 2, end of draw
int 0x40 mcall
ret 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 @erase lang.inc
@echo lang fix en >lang.inc @echo lang fix en >lang.inc
@fasm cpuspeed.asm cpuspeed @fasm cpuspeed.asm cpuspeed
@erase lang.inc
@pause @pause

View File

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

View File

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