Update headers programs : delete MENUET00 header on 2 programs.

Fixed mario2 game : delete using sysfn 6 and added constants 
Update macro.inc : Added new fields in process_information 

git-svn-id: svn://kolibrios.org@9971 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Doczom 2024-01-21 11:23:12 +00:00
parent ef78b78d1c
commit 7f7718f532
10 changed files with 1754 additions and 1733 deletions

View File

@ -8,19 +8,12 @@
use32 use32
org 0x0 org 0x0
;db 'MENUET00' ; 8 byte id db 'MENUET01' ; header
;dd 38 ; required os dd 1 ; version
;dd STARTAPP ; program start dd STARTAPP ; program start
;dd I_END ; program image size dd I_END ; program image size
;dd 0x100000 ; required amount of memory dd MEM ; size memory for program
;dd 0x00000000 ; reserved=no extended header dd STACKTOP ; pointer of stack
db 'MENUET01'
dd 1
dd STARTAPP
dd I_END
dd MEM
dd STACKTOP
dd 0 dd 0
dd 0 dd 0

View File

@ -8,27 +8,42 @@ use32
org 0x0 org 0x0
db 'MENUET00' ; 8 byte id db 'MENUET01' ; header
dd 38 ; required os dd 1 ; version
dd START ; program start dd START ; program start
dd I_END ; image size dd I_END ; image size
dd 0x100000 ; reguired amount of memory dd MEM ; size memory program
dd 0x00000000 ; reserved=no extended header dd STACKTOP ; pointer to begin stack pos
dd 0
dd 0
res_base = loadp + 0x36 ; offset on array pixel in BMP file
res_width_px = 150
res_height_px = 35
res_line_size = (res_width_px*3 + 11b) and not 11b ; 150*3 + 2
empty equ 0x80000 + 0*3*40*40 block_width = 40
build_1 equ 0x80000 + 1*3*40*40 block_height = 40
build_2 equ 0x80000 + 2*3*40*40 block_line_size = block_width * 3
build_3 equ 0x80000 + 3*3*40*40 block_img_size = block_width * block_height * 3
block_draw_size = (block_width shl 16) + block_height ; for sysfn 7
block_count_pixel = block_width * block_height
mario_1 equ 0x90000 + 0*3*70*51 mario_width = 50
mario_2 equ 0x90000 + 1*3*70*51 mario_height = 70
mario_3 equ 0x90000 + 2*3*70*51 mario_line_size = mario_width * 3
mario_4 equ 0x90000 + 3*3*70*51 mario_img_size = mario_width * mario_height * 3
mario_5 equ 0x90000 + 4*3*70*51 mario_draw_size = (mario_width shl 16) + mario_height
mario_6 equ 0x90000 + 5*3*70*51 mario_count_pixel = mario_width * mario_height
mario_green equ 0x90000 + 6*3*70*51
loadp equ 0x90000 + 7*3*70*51
wnd_pos_x = 80
wnd_pos_y = 20
wnd_header_size = 0x16
wnd_height = 9*block_height + wnd_header_size
wnd_width = 12*block_width + 1
START: START:
@ -46,55 +61,51 @@ START:
sta: sta:
mov eax,field mov eax,field
mov edx,1*65526+30 mov dword[xxyy], 1*65536 + wnd_header_size
mov [xxyy],dword 1*65536+22
stl: stl:
cmp [eax],byte ' ' cmp byte[eax], ' '
jnz noempty jnz @f
mov ebx,empty mov ebx,empty
noempty: @@:
cmp [eax],byte '1' cmp byte[eax], '1'
jnz no1 jnz @f
mov ebx,build_1 mov ebx,build_1
no1: @@:
cmp [eax],byte '2' cmp byte[eax], '2'
jnz no2 jnz @f
mov ebx,build_2 mov ebx,build_2
no2: @@:
cmp [eax],byte '3' cmp byte[eax], '3'
jnz no3 jnz @f
mov ebx,build_3 mov ebx,build_3
no3: @@:
pusha pusha
mov edx,[xxyy] mov edx,[xxyy]
mov eax,7 ; display image mov eax,7 ; display image
mov ecx,40*65536+40 mov ecx, block_draw_size
int 0x40 int 0x40
popa popa
add word [xxyy+2],word 40 add word [xxyy+2], block_width
cmp word [xxyy+2],word 40*12+1 cmp word [xxyy+2], block_width*12+1
jnz nonewline jnz .nonewline
mov word [xxyy+2],word 1
add word [xxyy+0],word 40 mov word [xxyy+2], 1
nonewline: add word [xxyy+0], block_height
.nonewline:
add eax,1 add eax,1
cmp eax,field+12*9 cmp eax, field.end
jz nodraw jnz stl
jmp stl
nodraw:
; ********* MAIN LOOP *********** ; ********* MAIN LOOP ***********
@ -105,14 +116,16 @@ wait_for_event:
mov eax,11 ; check for event mov eax,11 ; check for event
int 0x40 int 0x40
cmp eax,1 cmp eax,1
jz red jz red
cmp eax,2 cmp eax,2
jz key jz key
cmp eax,3 cmp eax,3 ; check pressed button
jnz wait_for_event jnz wait_for_event
jmp button mov eax, -1 ; close this program
int 0x40
red: red:
@ -128,17 +141,17 @@ wait_for_event:
mov eax,2 ; ah <- key mov eax,2 ; ah <- key
int 0x40 int 0x40
cmp ah,176 cmp ah,176 ; 'left'
jnz key1 jnz key1
mov byte [leftright],byte 1 mov byte [leftright],byte 1
key1: key1:
cmp ah,179 cmp ah,179 ; 'right'
jnz key2 jnz key2
mov byte [leftright],byte 4 mov byte [leftright],byte 4
key2: key2:
cmp ah,177 cmp ah,177 ; 'down'
jnz key3 jnz key3
mov al,byte [leftright] mov al,byte [leftright]
mov bl,al mov bl,al
@ -153,13 +166,14 @@ wait_for_event:
mov byte [leftright],bl mov byte [leftright],bl
key3: key3:
cmp ah,178 cmp ah,178 ; 'up'
jnz key4 jnz key4
cmp [velocity],dword 0xff cmp [velocity],dword 0xff
jnz key4 jnz key4
mov [velocity],dword 0x110 mov [velocity],dword 0x110
key4: key4:
; this code using for fix defects drawing(draw in caption area)
mov eax,71 ;draw caption mov eax,71 ;draw caption
mov ebx,1 mov ebx,1
mov ecx,title mov ecx,title
@ -169,41 +183,25 @@ wait_for_event:
;jmp wait_for_event ;jmp wait_for_event
button:
mov eax,0xffffffff ; close this program
int 0x40
load_graph: load_graph:
pusha pusha
mov eax,6 ; 6 = open file ; empty block init - set in 0x00500f color
mov ebx,filename
mov ecx,0
mov edx,0xFFFFFF
mov esi,loadp
mov edi,0 ; floppy
int 0x40
; empty
mov edi,empty mov edi,empty
mov ecx,40*40 mov ecx, block_count_pixel
mov eax,0x00500f mov eax,0x00500f
cld cld
emptyl: @@:
mov [edi],eax mov [edi],eax
add edi, 3 add edi, 3
loop emptyl loop @b
mov [width],40*3 mov [width], block_line_size
mov [width_move],20 mov [width_move], block_width/2
mov [sub_esi],150*3+2 mov [height_move], block_height/2
mov [add_edi],40*3*2
mov [imul_esi],20*3 mov [imul_esi],20*3
mov [base],loadp+18*3+3*150*34+3*98-1 mov [base], res_base + 3*res_width_px * 34 +3*98-1
mov esi,0 mov esi,0
mov edi,build_1 mov edi,build_1
@ -216,26 +214,24 @@ load_graph:
; build_3 ; build_3
mov edi,build_3 mov edi,build_3
mov esi,loadp+18*3+230*3+3*300*69 mov esi, res_base + 230*3+3*300*69
mov ecx,40 mov ecx, block_height
build_3l: build_3l:
pusha pusha
mov ecx,3*40 mov ecx, block_line_size
cld cld
rep movsb rep movsb
popa popa
sub esi,300*3 sub esi,300*3
add edi,40*3 add edi, block_line_size
loop build_3l loop build_3l
mov [width],50*3 mov [width], mario_line_size
mov [width_move],25 mov [width_move], mario_width/2
mov [sub_esi],150*3+2 mov [height_move], mario_height/2
mov [add_edi],50*3*2
mov [imul_esi],25*3 mov [imul_esi],25*3
mov [base],loadp+18*3+3*150*34+68 mov [base], res_base + 3*res_width_px*34 + 68
mov esi,0 mov esi,0
mov edi,mario_1 mov edi,mario_1
@ -252,16 +248,21 @@ load_graph:
jmp mario_mirror jmp mario_mirror
; copy in [edi], image x2
convert: convert:
imul esi,[imul_esi] imul esi,[imul_esi]
add esi,[base] ; loadp+18*3+3*150*34+68 add esi,[base] ; loadp+18*3+3*150*34+68
mov ecx,70 mov eax, [width]
mario_1l: shl eax, 1 ; *2
mov ecx, [height_move] ;?
.new_line:
pusha pusha
mov ecx,[width_move] mov ecx,[width_move]
putpix:
.putpix: ; set 4 pixel: edi, edi+3, edi+width, edi+width+3
mov eax,[esi] mov eax,[esi]
mov [edi+00],ax mov [edi+00],ax
mov [edi+03],ax mov [edi+03],ax
@ -278,45 +279,41 @@ convert:
mov [edi+ebx],al mov [edi+ebx],al
add esi,3 add esi,3
add edi,6 add edi,6
loop putpix loop .putpix
popa popa
sub esi,[sub_esi]
add edi,[add_edi] sub esi,res_line_size
loop mario_1l add edi, eax
loop .new_line
ret ret
sub_esi dd 0x0 imul_esi dd 0
add_edi dd 0x0 base dd 0
imul_esi dd 0x0 width dd 0
base dd 0x0 width_move dd 0
width dd 0x0 height_move dd 0
width_move dd 0x0
mario_mirror: mario_mirror:
; mario_green ; mario_green
mov edi,mario_green mov edi,mario_green
mov ecx,70*50 mov ecx, mario_count_pixel
mario_greenl: @@:
mov [edi],dword 0x00500f mov [edi],dword 0x00500f
add edi, 3 add edi, 3
loop mario_greenl loop @b
; mario_4 - reverse mario_1
; mario_4
mov edi, mario_4 mov edi, mario_4
mov esi,mario_1+49*3 mov esi, mario_1 + (mario_width - 1)*3
mov ecx,70 mov ecx, mario_height
m4l1: m4l1:
pusha pusha
mov ecx,50 mov ecx, mario_width
m4l2: m4l2:
mov eax,[esi] mov eax,[esi]
mov [edi],ax mov [edi],ax
@ -326,19 +323,20 @@ mario_mirror:
sub esi,3 sub esi,3
loop m4l2 loop m4l2
popa popa
add esi,50*3
add edi,50*3 add esi, mario_width*3
add edi, mario_width*3
loop m4l1 loop m4l1
; mario_5 ; mario_5 - reverse mario_2
mov edi, mario_5 mov edi, mario_5
mov esi,mario_2+49*3 mov esi, mario_2 + (mario_width - 1)*3
mov ecx,70 mov ecx, mario_height
m5l1: m5l1:
pusha pusha
mov ecx,50 mov ecx, mario_width
m5l2: m5l2:
mov eax,[esi] mov eax,[esi]
mov [edi],ax mov [edi],ax
@ -348,19 +346,20 @@ mario_mirror:
sub esi,3 sub esi,3
loop m5l2 loop m5l2
popa popa
add esi,50*3
add edi,50*3 add esi, mario_width*3
add edi, mario_width*3
loop m5l1 loop m5l1
; mario_6 ; mario_6 - reverse mario_3
mov edi, mario_6 mov edi, mario_6
mov esi,mario_3+49*3 mov esi, mario_3 + (mario_width - 1)*3
mov ecx,70 mov ecx, mario_height
m6l1: m6l1:
pusha pusha
mov ecx,50 mov ecx, mario_width
m6l2: m6l2:
mov eax,[esi] mov eax,[esi]
mov [edi],ax mov [edi],ax
@ -370,13 +369,13 @@ mario_mirror:
sub esi,3 sub esi,3
loop m6l2 loop m6l2
popa popa
add esi,50*3
add edi,50*3 add esi, mario_width*3
add edi, mario_width*3
loop m6l1 loop m6l1
popa popa
ret ret
@ -547,129 +546,132 @@ draw_mario:
mov eax,[mariomem] mov eax,[mariomem]
cmp eax,[marioxy] cmp eax,[marioxy]
jnz dm1 jnz @f
call mario_delay call mario_delay
popa popa
ret ret
dm1: @@:
mov eax,[marioxy] mov eax,[marioxy]
mov [mariomem],eax mov [mariomem],eax
cmp byte [leftright],byte 1 ; go left cmp byte [leftright], 1 ; go left
jnz no_m_left jz m_left
jmp m_left
no_m_left:
cmp byte [leftright],byte 4 ; go right cmp byte [leftright], 4 ; go right
jnz no_m_right jz m_right
jmp m_right
no_m_right:
cmp byte [leftright],byte 2 ; stand left cmp byte [leftright], 2 ; stand left
jnz no_r_still jnz no_r_still
mov eax,7 mov eax,7
mov ebx,mario_green mov ebx,mario_green
mov ecx,50*65536+70 mov ecx, mario_draw_size
mov edx,[marioxy] mov edx,[marioxy]
int 0x40 int 0x40
call advance_mario call advance_mario
mov eax,7 mov eax,7
mov ebx,mario_1 mov ebx,mario_1
mov ecx,50*65536+70 mov ecx, mario_draw_size
mov edx,[marioxy] mov edx,[marioxy]
int 0x40 int 0x40
call mario_delay call mario_delay
popa popa
ret ret
no_r_still:
no_r_still:
cmp byte [leftright],byte 3 ; stand right cmp byte [leftright],byte 3 ; stand right
jnz no_l_still jnz no_l_still
mov eax,7 mov eax,7
mov ebx,mario_green mov ebx,mario_green
mov ecx,50*65536+70 mov ecx, mario_draw_size
mov edx,[marioxy] mov edx,[marioxy]
int 0x40 int 0x40
call advance_mario call advance_mario
mov eax,7 mov eax,7
mov ebx,mario_4 mov ebx,mario_4
mov ecx,50*65536+70 mov ecx, mario_draw_size
mov edx,[marioxy] mov edx,[marioxy]
int 0x40 int 0x40
call mario_delay call mario_delay
popa
ret
no_l_still: no_l_still:
popa popa
ret ret
m_left: m_left:
mov eax,7 mov eax,7
mov ebx,mario_green mov ebx,mario_green
mov ecx,50*65536+70 mov ecx, mario_draw_size
mov edx,[marioxy] mov edx,[marioxy]
int 0x40 int 0x40
call advance_mario call advance_mario
mov eax,7 mov eax,7
mov ebx,mario_1 mov ebx,mario_1
mov ecx,50*65536+70 mov ecx, mario_draw_size
mov edx,[marioxy] mov edx,[marioxy]
int 0x40 int 0x40
call mario_delay call mario_delay
mov eax,7 mov eax,7
mov ebx,mario_green mov ebx,mario_green
mov ecx,50*65536+70 mov ecx, mario_draw_size
mov edx,[marioxy] mov edx,[marioxy]
int 0x40 int 0x40
call advance_mario call advance_mario
mov eax,7 mov eax,7
mov ebx,mario_2 mov ebx,mario_2
mov ecx,50*65536+70 mov ecx, mario_draw_size
mov edx,[marioxy] mov edx,[marioxy]
int 0x40 int 0x40
call mario_delay call mario_delay
mov eax,7 mov eax,7
mov ebx,mario_green mov ebx,mario_green
mov ecx,50*65536+70 mov ecx, mario_draw_size
mov edx,[marioxy] mov edx,[marioxy]
int 0x40 int 0x40
call advance_mario call advance_mario
mov eax,7 mov eax,7
mov ebx,mario_3 mov ebx,mario_3
mov ecx,50*65536+70 mov ecx, mario_draw_size
mov edx,[marioxy] mov edx,[marioxy]
int 0x40 int 0x40
call mario_delay call mario_delay
mov eax,7 mov eax,7
mov ebx,mario_green mov ebx,mario_green
mov ecx,50*65536+70 mov ecx, mario_draw_size
mov edx,[marioxy] mov edx,[marioxy]
int 0x40 int 0x40
call advance_mario call advance_mario
mov eax,7 mov eax,7
mov ebx,mario_2 mov ebx,mario_2
mov ecx,50*65536+70 mov ecx, mario_draw_size
mov edx,[marioxy] mov edx,[marioxy]
int 0x40 int 0x40
call mario_delay call mario_delay
popa popa
ret ret
m_right: m_right:
@ -677,64 +679,67 @@ draw_mario:
mov eax,7 mov eax,7
mov ebx,mario_green mov ebx,mario_green
mov ecx,50*65536+70 mov ecx, mario_draw_size
mov edx,[marioxy] mov edx,[marioxy]
int 0x40 int 0x40
call advance_mario call advance_mario
mov eax,7 mov eax,7
mov ebx,mario_4 mov ebx,mario_4
mov ecx,50*65536+70 mov ecx, mario_draw_size
mov edx,[marioxy] mov edx,[marioxy]
int 0x40 int 0x40
call mario_delay call mario_delay
mov eax,7 mov eax,7
mov ebx,mario_green mov ebx,mario_green
mov ecx,50*65536+70 mov ecx, mario_draw_size
mov edx,[marioxy] mov edx,[marioxy]
int 0x40 int 0x40
call advance_mario call advance_mario
mov eax,7 mov eax,7
mov ebx,mario_5 mov ebx,mario_5
mov ecx,50*65536+70 mov ecx, mario_draw_size
mov edx,[marioxy] mov edx,[marioxy]
int 0x40 int 0x40
call mario_delay call mario_delay
mov eax,7 mov eax,7
mov ebx,mario_green mov ebx,mario_green
mov ecx,50*65536+70 mov ecx, mario_draw_size
mov edx,[marioxy] mov edx,[marioxy]
int 0x40 int 0x40
call advance_mario call advance_mario
mov eax,7 mov eax,7
mov ebx,mario_6 mov ebx,mario_6
mov ecx,50*65536+70 mov ecx, mario_draw_size
mov edx,[marioxy] mov edx,[marioxy]
int 0x40 int 0x40
call mario_delay call mario_delay
mov eax,7 mov eax,7
mov ebx,mario_green mov ebx,mario_green
mov ecx,50*65536+70 mov ecx, mario_draw_size
mov edx,[marioxy] mov edx,[marioxy]
int 0x40 int 0x40
call advance_mario call advance_mario
mov eax,7 mov eax,7
mov ebx,mario_5 mov ebx,mario_5
mov ecx,50*65536+70 mov ecx, mario_draw_size
mov edx,[marioxy] mov edx,[marioxy]
int 0x40 int 0x40
call mario_delay call mario_delay
popa popa
ret ret
draw_window: draw_window:
pusha pusha
@ -744,9 +749,9 @@ draw_window:
int 0x40 int 0x40
mov eax,0 ; define and draw window mov eax,0 ; define and draw window
mov ebx,80*65536+480+1 mov ebx, (wnd_pos_x shl 16) + wnd_width ;80*65536+480+1
mov ecx,20*65536+382 mov ecx, (wnd_pos_y shl 16) + wnd_height ;20*65536+382
mov edx,0x5466AA88 mov edx,0x5466AA88 ; 4 type window + title + no draw work space
mov edi,title mov edi,title
int 0x40 int 0x40
@ -761,9 +766,6 @@ draw_window:
; DATA SECTION ; DATA SECTION
filename:
db 'MARIOALLBMP'
title: title:
db 'SUPER MARIO - USE ARROW KEYS', 0 db 'SUPER MARIO - USE ARROW KEYS', 0
@ -778,6 +780,7 @@ field:
db '1 1' db '1 1'
db '1 1' db '1 1'
db '222222222222' db '222222222222'
.end:
xxyy dd 0x0 xxyy dd 0x0
@ -789,9 +792,33 @@ leftright dd 0x0
velocity dd 0x0 velocity dd 0x0
align 16
loadp:
file 'MARIOALL.BMP'
I_END: I_END:
align 0x1000
empty: rb block_img_size
build_1: rb block_img_size
build_2: rb block_img_size
build_3: rb block_img_size
align 0x1000
mario_1: rb mario_img_size
mario_2: rb mario_img_size
mario_3: rb mario_img_size
mario_4: rb mario_img_size
mario_5: rb mario_img_size
mario_6: rb mario_img_size
mario_green: rb mario_img_size
rb 4096
STACKTOP:
MEM:

View File

@ -20,21 +20,14 @@ CK_UP2 equ 72
CK_DOWN2 equ 80 CK_DOWN2 equ 80
use32 use32
org 0x0
;org 0x0
;
;db 'MENUET00' ; 8 byte id
;dd 38 ; required os
;dd START ; program start
;dd I_END ; program image size
;dd 0x2000 ; required amount of memory
;dd 0x00000000 ; reserved=no extended header
db 'MENUET01' db 'MENUET01'
dd 1 dd 1 ; version
dd START dd START ; program start
dd I_END dd I_END ; program image size
dd MEM dd MEM ; size memory for program
dd STACKTOP dd STACKTOP ; pointer on stack
dd 0 dd 0
dd 0 dd 0

View File

@ -465,7 +465,9 @@ struct process_information
dw ? ; +52 dw ? ; +52
client_box BOX ; +54 client_box BOX ; +54
wnd_state db ? ; +70 wnd_state db ? ; +70
rb (1024-71) event_mask dd ? ; +71
keyboard_mode db ? ; +75
rb (1024-76)
ends ends
struct system_colors struct system_colors

View File

@ -579,7 +579,7 @@ START:
mcall 66,1,1 mcall 66,1,1
mcall 9,process_info_buffer,-1 mcall 9,process_info_buffer,-1
mov ecx,[ebx+30] ; PID mov ecx, [ebx + process_information.PID] ; PID
mcall 18,21 mcall 18,21
mov [my_active_slot],eax ; WINDOW SLOT mov [my_active_slot],eax ; WINDOW SLOT
@ -627,7 +627,7 @@ end if
call set_work_ares_pf_screen call set_work_ares_pf_screen
mcall 9,process_info_buffer,-1 mcall 9,process_info_buffer,-1
mov ecx,[process_info_buffer+30] mov ecx,[process_info_buffer.PID]
mcall 18,21 mcall 18,21
mov [this_slot],eax mov [this_slot],eax
mov [max_slot],255 mov [max_slot],255
@ -798,7 +798,7 @@ button:
mcall 9,process_info_buffer mcall 9,process_info_buffer
test [ebx+70],dword 10b ; window is minimized to panel test [ebx + process_information.wnd_state], byte 10b ; window is minimized to panel
jnz @f jnz @f
cmp ecx,[current_active_slot] cmp ecx,[current_active_slot]

View File

@ -1,7 +1,7 @@
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
align 4 align 4
context_menu_start: context_menu_start:
mcall 40,00100111b mcall 40, EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE ;00100111b
mov ecx, [ctx_menu_PID] mov ecx, [ctx_menu_PID]
mcall 18,21 mcall 18,21
mov ecx, eax mov ecx, eax
@ -11,13 +11,13 @@ context_menu_start:
align 4 align 4
ctx_menu_still: ctx_menu_still:
mcall 10 mcall 10
cmp eax, 2 cmp eax, EV_KEY
jz ctx_menu_key jz ctx_menu_key
cmp eax, 3 cmp eax, EV_BUTTON
jz ctx_menu_button jz ctx_menu_button
cmp eax, 6 cmp eax, EV_MOUSE
jz ctx_menu_mouse jz ctx_menu_mouse
call draw_ctx_menu call draw_ctx_menu
@ -75,7 +75,7 @@ align 4
mov edx, [n_slot] mov edx, [n_slot]
xor ecx, ecx xor ecx, ecx
test [procinfo_for_detect+70],byte 2 test [procinfo_for_detect.wnd_state],byte 2
setnz cl setnz cl
add cl, cl add cl, cl
;-------------------------------------- ;--------------------------------------
@ -102,29 +102,29 @@ draw_ctx_menu:
sub ecx, 60 ; 41 sub ecx, 60 ; 41
shl ecx, 16 shl ecx, 16
add ecx, 60 ; 41 add ecx, 60 ; 41
mov esi, [system_colours + 4] ; sc.grab mov esi, [system_colours.grab] ; sc.grab
or esi, 0x81000000 or esi, 0x81000000
mcall ,,,[system_colours + 20],,[system_colours+8] mcall ,,,[system_colours.work],,[system_colours.work_dark]
mcall 8,<0,133>,<22,17>,0x40000001 mcall 8,<0,133>,<22,17>,0x40000001
inc edx inc edx
mcall ,,<40,17> mcall ,,<40,17>
mov ecx, [system_colours + 16] ; sc.grab_text mov ecx, [system_colours.grab_text] ; sc.grab_text
or ecx, 0x10000000 or ecx, 0x10000000
mcall 4,<32,4>,,ctx_menu_title,ctx_menu_title_end - ctx_menu_title mcall 4,<32,4>,,ctx_menu_title,ctx_menu_title_end - ctx_menu_title
add ebx, 1 * 65536 add ebx, 1 * 65536
mcall mcall
mov ecx, [system_colours + 32] ; sc.work_text mov ecx, [system_colours.work_text] ; sc.work_text
or ecx, 0x80000000 or ecx, 0x80000000
mcall ,<4,28>,,ctx_menu_text mcall ,<4,28>,,ctx_menu_text
mov edx, ctx_menu_text2 mov edx, ctx_menu_text2
test byte [procinfo_for_detect+70], 2 test byte [procinfo_for_detect.wnd_state], 2
jz @f jz @f
mov edx, ctx_menu_text3 mov edx, ctx_menu_text3
;-------------------------------------- ;--------------------------------------

View File

@ -28,26 +28,26 @@ align 4
need_window_tab: need_window_tab:
; in: ebx->process info ; in: ebx->process info
; out: ZF set <=> do not draw ; out: ZF set <=> do not draw
cmp byte [ebx+10], '@' cmp byte [ebx + process_information.process_name], '@'
jz .nodraw jz .nodraw
; do not draw undefined (zero-sized) windows ; do not draw undefined (zero-sized) windows
cmp dword [ebx+42], 0 cmp dword [ebx + process_information.box.width], 0
jnz @f jnz @f
cmp dword [ebx+46], 0 cmp dword [ebx + process_information.box.height], 0
jz .nodraw jz .nodraw
;-------------------------------------- ;--------------------------------------
align 4 align 4
@@: @@:
; do not draw OpenDialog windows ; do not draw OpenDialog windows
push edi push edi
mov edi, dword [ebx+10] mov edi, dword [ebx + process_information.process_name]
or edi, 0x20202020 or edi, 0x20202020
cmp edi, 'open' cmp edi, 'open'
jne @f jne @f
mov edi, dword [ebx+14] mov edi, dword [ebx + process_information.process_name + 4]
or edi, 0x20202020 or edi, 0x20202020
cmp dword [ebx+14], 'dial' cmp edi, 'dial'
jne @f jne @f
pop edi pop edi
@ -56,18 +56,18 @@ align 4
align 4 align 4
@@: @@:
pop edi pop edi
cmp dword [ebx+10], 'ICON' cmp dword [ebx + process_information.process_name], 'ICON'
jnz @f jnz @f
cmp [ebx+42], dword 51 cmp [ebx + process_information.box.width], dword 51
jnz @f jnz @f
cmp [ebx+46], dword 51 cmp [ebx + process_information.box.height], dword 51
jz .nodraw jz .nodraw
;-------------------------------------- ;--------------------------------------
align 4 align 4
@@: @@:
cmp [ebx+10], dword ' ' cmp dword[ebx + process_information.process_name], ' '
;-------------------------------------- ;--------------------------------------
align 4 align 4
.nodraw: .nodraw:
@ -180,8 +180,8 @@ align 4
shr ecx,16 shr ecx,16
add bx,cx add bx,cx
mov edx, procinfo_window_tabs+10 mov edx, procinfo_window_tabs.process_name
mcall 4,,[system_colours.work_button_text],,11 mcall 4,,[system_colours.work_button_text],, sizeof.process_information.process_name
;-------------------------------------- ;--------------------------------------
align 4 align 4
.nodraw: .nodraw:

View File

@ -8,10 +8,10 @@ draw_window:
mov [running_applications],-1 mov [running_applications],-1
mcall 12,1 mcall 12,1
mcall 48,3,system_colours,10*4 mcall 48,3,system_colours, sizeof.system_colors
mov eax, [system_colours+4*6] mov eax, [system_colours.work_button]
mov edx,[system_colours+4*6] mov edx,[system_colours.work_button]
mov eax,COLOR_CHANGE_MAGNITUDE mov eax,COLOR_CHANGE_MAGNITUDE
call subtract_color_change_magnitude call subtract_color_change_magnitude
mov [wcolor], edx mov [wcolor], edx
@ -306,7 +306,7 @@ align 4
align 4 align 4
@@: @@:
; Inserted code for drawing buttons 103, 104, 105 (Clean, Restore, Exchange windows) ; Inserted code for drawing buttons 103, 104, 105 (Clean, Restore, Exchange windows)
mov esi, dword [system_colours+24] ; drawing buttons mov esi, dword [system_colours.work_button] ; drawing buttons
and esi, 0x00ffffff and esi, 0x00ffffff
mov edx, 0x60000000 + 103 mov edx, 0x60000000 + 103
mov ecx, [height] mov ecx, [height]

View File

@ -34,7 +34,7 @@ win_key_flag rb 1
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
align 4 align 4
system_colours system_colors ; rd 10 system_colours system_colors
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
align 4 align 4
app_list rd 50 app_list rd 50
@ -48,16 +48,13 @@ path:
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
align 4 align 4
library_path: library_path:
process_info_buffer: process_info_buffer process_information
rb 1024
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
align 4 align 4
procinfo_for_detect: procinfo_for_detect process_information
rb 1024
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
align 4 align 4
procinfo_window_tabs: procinfo_window_tabs process_information
rb 1024
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
align 4 align 4
bootparam: bootparam:

View File

@ -11,13 +11,16 @@
use32 use32
org 0x0 org 0x0
db 'MENUET00' ; 8 byte id db 'MENUET01'
dd 38 ; required os dd 1 ; version
dd STARTAPP ; program start dd STARTAPP ; program start
dd I_END ; program image size dd I_END ; program image size
dd 0x100000 ; required amount of memory dd MEM ; size memory for program
dd 0x00000000 ; reserved=no extended header dd STACKTOP ; base stack pointer
dd 0
dd 0
include '../../../macros.inc'
include "ASPAPI.INC" include "ASPAPI.INC"
N_KEYCOLOR equ 0x00677889 ; Normal button color N_KEYCOLOR equ 0x00677889 ; Normal button color
@ -26,8 +29,6 @@ L_KEYCOLOR equ 0x00258778 ; Lock button color
TEXTCOLOR equ 0x00FFFFFF ; Button caption color TEXTCOLOR equ 0x00FFFFFF ; Button caption color
ASCII_KEYMAP_SIZE equ 128 ASCII_KEYMAP_SIZE equ 128
PROCINFO_SIZE equ 1024
PROCINFO_BUFF equ ascii_keymap + ASCII_KEYMAP_SIZE
STARTAPP: STARTAPP:
mov ecx, 1 ; to send scancodes. mov ecx, 1 ; to send scancodes.
@ -189,7 +190,7 @@ get_zkey_window_slot_number:
mov [zkey_window], eax mov [zkey_window], eax
set_event_mask: set_event_mask:
mov eax, 40 mov eax, 40
mov ebx, 39 mov ebx, EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE ; 39 ; 100111b
int 0x40 int 0x40
still: still:
@ -198,19 +199,20 @@ still:
call set_keyboard_mode call set_keyboard_mode
; delete_switch_button ; delete_switch_button
mov eax, 8 mov eax, 8
mov edx, 0x80700000 mov edx, BT_DEL + 0x00700000
int 0x40 int 0x40
mov byte [red_type], 2 mov byte [red_type], 2
call draw_window.draw_switch_button call draw_window.draw_switch_button
mov eax, 10 ; Wait for an event in the queue. mov eax, 10 ; Wait for an event in the queue.
int 0x40 int 0x40
cmp al,1 ; redraw request ? cmp al, EV_REDRAW ; redraw request ?
jz red jz red
cmp al,2 ; key in buffer ? cmp al, EV_KEY ; key in buffer ?
jz key jz key
cmp al,3 ; button in buffer ? cmp al, EV_BUTTON ; button in buffer ?
jz button jz button
jmp still jmp still
@ -391,7 +393,7 @@ get_receiver_window_keyboard_mode:
mov ebx, PROCINFO_BUFF mov ebx, PROCINFO_BUFF
mov ecx, [receiver_window] mov ecx, [receiver_window]
int 0x40 int 0x40
movzx ecx, byte [ebx + 75] movzx ecx, byte [ebx + process_information.keyboard_mode]
ret ret
;************************************ ;************************************
@ -477,4 +479,11 @@ red_type db 0 ; Type of window redraw. 0 - default , 1 - on ASCII_keymap
I_END: ; End of application code and data marker I_END: ; End of application code and data marker
ascii_keymap: ascii_keymap: rb ASCII_KEYMAP_SIZE
PROCINFO_BUFF process_information
rb 4096
STACKTOP:
MEM: