forked from KolibriOS/kolibrios
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:
parent
ef78b78d1c
commit
7f7718f532
@ -8,19 +8,12 @@
|
||||
use32
|
||||
org 0x0
|
||||
|
||||
;db 'MENUET00' ; 8 byte id
|
||||
;dd 38 ; required os
|
||||
;dd STARTAPP ; program start
|
||||
;dd I_END ; program image size
|
||||
;dd 0x100000 ; required amount of memory
|
||||
;dd 0x00000000 ; reserved=no extended header
|
||||
|
||||
db 'MENUET01'
|
||||
dd 1
|
||||
dd STARTAPP
|
||||
dd I_END
|
||||
dd MEM
|
||||
dd STACKTOP
|
||||
db 'MENUET01' ; header
|
||||
dd 1 ; version
|
||||
dd STARTAPP ; program start
|
||||
dd I_END ; program image size
|
||||
dd MEM ; size memory for program
|
||||
dd STACKTOP ; pointer of stack
|
||||
dd 0
|
||||
dd 0
|
||||
|
||||
|
@ -8,27 +8,42 @@ use32
|
||||
|
||||
org 0x0
|
||||
|
||||
db 'MENUET00' ; 8 byte id
|
||||
dd 38 ; required os
|
||||
db 'MENUET01' ; header
|
||||
dd 1 ; version
|
||||
dd START ; program start
|
||||
dd I_END ; image size
|
||||
dd 0x100000 ; reguired amount of memory
|
||||
dd 0x00000000 ; reserved=no extended header
|
||||
dd MEM ; size memory program
|
||||
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
|
||||
build_1 equ 0x80000 + 1*3*40*40
|
||||
build_2 equ 0x80000 + 2*3*40*40
|
||||
build_3 equ 0x80000 + 3*3*40*40
|
||||
block_width = 40
|
||||
block_height = 40
|
||||
block_line_size = block_width * 3
|
||||
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_2 equ 0x90000 + 1*3*70*51
|
||||
mario_3 equ 0x90000 + 2*3*70*51
|
||||
mario_4 equ 0x90000 + 3*3*70*51
|
||||
mario_5 equ 0x90000 + 4*3*70*51
|
||||
mario_6 equ 0x90000 + 5*3*70*51
|
||||
mario_green equ 0x90000 + 6*3*70*51
|
||||
loadp equ 0x90000 + 7*3*70*51
|
||||
mario_width = 50
|
||||
mario_height = 70
|
||||
mario_line_size = mario_width * 3
|
||||
mario_img_size = mario_width * mario_height * 3
|
||||
mario_draw_size = (mario_width shl 16) + mario_height
|
||||
mario_count_pixel = mario_width * mario_height
|
||||
|
||||
|
||||
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:
|
||||
@ -46,55 +61,51 @@ START:
|
||||
sta:
|
||||
|
||||
mov eax,field
|
||||
mov edx,1*65526+30
|
||||
mov [xxyy],dword 1*65536+22
|
||||
mov dword[xxyy], 1*65536 + wnd_header_size
|
||||
|
||||
stl:
|
||||
|
||||
cmp [eax],byte ' '
|
||||
jnz noempty
|
||||
cmp byte[eax], ' '
|
||||
jnz @f
|
||||
mov ebx,empty
|
||||
noempty:
|
||||
@@:
|
||||
|
||||
cmp [eax],byte '1'
|
||||
jnz no1
|
||||
cmp byte[eax], '1'
|
||||
jnz @f
|
||||
mov ebx,build_1
|
||||
no1:
|
||||
@@:
|
||||
|
||||
cmp [eax],byte '2'
|
||||
jnz no2
|
||||
cmp byte[eax], '2'
|
||||
jnz @f
|
||||
mov ebx,build_2
|
||||
no2:
|
||||
@@:
|
||||
|
||||
cmp [eax],byte '3'
|
||||
jnz no3
|
||||
cmp byte[eax], '3'
|
||||
jnz @f
|
||||
mov ebx,build_3
|
||||
no3:
|
||||
@@:
|
||||
|
||||
pusha
|
||||
|
||||
mov edx,[xxyy]
|
||||
|
||||
mov eax,7 ; display image
|
||||
mov ecx,40*65536+40
|
||||
mov ecx, block_draw_size
|
||||
int 0x40
|
||||
|
||||
popa
|
||||
|
||||
add word [xxyy+2],word 40
|
||||
cmp word [xxyy+2],word 40*12+1
|
||||
jnz nonewline
|
||||
mov word [xxyy+2],word 1
|
||||
add word [xxyy+0],word 40
|
||||
nonewline:
|
||||
add word [xxyy+2], block_width
|
||||
cmp word [xxyy+2], block_width*12+1
|
||||
jnz .nonewline
|
||||
|
||||
mov word [xxyy+2], 1
|
||||
add word [xxyy+0], block_height
|
||||
.nonewline:
|
||||
|
||||
add eax,1
|
||||
cmp eax,field+12*9
|
||||
jz nodraw
|
||||
jmp stl
|
||||
|
||||
nodraw:
|
||||
|
||||
cmp eax, field.end
|
||||
jnz stl
|
||||
|
||||
; ********* MAIN LOOP ***********
|
||||
|
||||
@ -105,14 +116,16 @@ wait_for_event:
|
||||
|
||||
mov eax,11 ; check for event
|
||||
int 0x40
|
||||
|
||||
cmp eax,1
|
||||
jz red
|
||||
cmp eax,2
|
||||
jz key
|
||||
cmp eax,3
|
||||
cmp eax,3 ; check pressed button
|
||||
jnz wait_for_event
|
||||
|
||||
jmp button
|
||||
mov eax, -1 ; close this program
|
||||
int 0x40
|
||||
|
||||
red:
|
||||
|
||||
@ -128,17 +141,17 @@ wait_for_event:
|
||||
mov eax,2 ; ah <- key
|
||||
int 0x40
|
||||
|
||||
cmp ah,176
|
||||
cmp ah,176 ; 'left'
|
||||
jnz key1
|
||||
mov byte [leftright],byte 1
|
||||
key1:
|
||||
|
||||
cmp ah,179
|
||||
cmp ah,179 ; 'right'
|
||||
jnz key2
|
||||
mov byte [leftright],byte 4
|
||||
key2:
|
||||
|
||||
cmp ah,177
|
||||
cmp ah,177 ; 'down'
|
||||
jnz key3
|
||||
mov al,byte [leftright]
|
||||
mov bl,al
|
||||
@ -153,13 +166,14 @@ wait_for_event:
|
||||
mov byte [leftright],bl
|
||||
key3:
|
||||
|
||||
cmp ah,178
|
||||
cmp ah,178 ; 'up'
|
||||
jnz key4
|
||||
cmp [velocity],dword 0xff
|
||||
jnz key4
|
||||
mov [velocity],dword 0x110
|
||||
key4:
|
||||
|
||||
; this code using for fix defects drawing(draw in caption area)
|
||||
mov eax,71 ;draw caption
|
||||
mov ebx,1
|
||||
mov ecx,title
|
||||
@ -169,41 +183,25 @@ wait_for_event:
|
||||
|
||||
;jmp wait_for_event
|
||||
|
||||
button:
|
||||
|
||||
mov eax,0xffffffff ; close this program
|
||||
int 0x40
|
||||
|
||||
|
||||
load_graph:
|
||||
|
||||
pusha
|
||||
|
||||
mov eax,6 ; 6 = open file
|
||||
mov ebx,filename
|
||||
mov ecx,0
|
||||
mov edx,0xFFFFFF
|
||||
mov esi,loadp
|
||||
mov edi,0 ; floppy
|
||||
int 0x40
|
||||
|
||||
; empty
|
||||
|
||||
; empty block init - set in 0x00500f color
|
||||
mov edi,empty
|
||||
mov ecx,40*40
|
||||
mov ecx, block_count_pixel
|
||||
mov eax,0x00500f
|
||||
cld
|
||||
emptyl:
|
||||
@@:
|
||||
mov [edi],eax
|
||||
add edi,3
|
||||
loop emptyl
|
||||
add edi, 3
|
||||
loop @b
|
||||
|
||||
mov [width],40*3
|
||||
mov [width_move],20
|
||||
mov [sub_esi],150*3+2
|
||||
mov [add_edi],40*3*2
|
||||
mov [width], block_line_size
|
||||
mov [width_move], block_width/2
|
||||
mov [height_move], block_height/2
|
||||
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 edi,build_1
|
||||
@ -216,26 +214,24 @@ load_graph:
|
||||
|
||||
|
||||
; build_3
|
||||
|
||||
mov edi,build_3
|
||||
mov esi,loadp+18*3+230*3+3*300*69
|
||||
mov ecx,40
|
||||
mov esi, res_base + 230*3+3*300*69
|
||||
mov ecx, block_height
|
||||
build_3l:
|
||||
pusha
|
||||
mov ecx,3*40
|
||||
mov ecx, block_line_size
|
||||
cld
|
||||
rep movsb
|
||||
popa
|
||||
sub esi,300*3
|
||||
add edi,40*3
|
||||
add edi, block_line_size
|
||||
loop build_3l
|
||||
|
||||
mov [width],50*3
|
||||
mov [width_move],25
|
||||
mov [sub_esi],150*3+2
|
||||
mov [add_edi],50*3*2
|
||||
mov [width], mario_line_size
|
||||
mov [width_move], mario_width/2
|
||||
mov [height_move], mario_height/2
|
||||
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 edi,mario_1
|
||||
@ -252,16 +248,21 @@ load_graph:
|
||||
jmp mario_mirror
|
||||
|
||||
|
||||
; copy in [edi], image x2
|
||||
convert:
|
||||
|
||||
imul esi,[imul_esi]
|
||||
add esi,[base] ; loadp+18*3+3*150*34+68
|
||||
|
||||
mov ecx,70
|
||||
mario_1l:
|
||||
mov eax, [width]
|
||||
shl eax, 1 ; *2
|
||||
mov ecx, [height_move] ;?
|
||||
|
||||
.new_line:
|
||||
pusha
|
||||
mov ecx,[width_move]
|
||||
putpix:
|
||||
|
||||
.putpix: ; set 4 pixel: edi, edi+3, edi+width, edi+width+3
|
||||
mov eax,[esi]
|
||||
mov [edi+00],ax
|
||||
mov [edi+03],ax
|
||||
@ -278,45 +279,41 @@ convert:
|
||||
mov [edi+ebx],al
|
||||
add esi,3
|
||||
add edi,6
|
||||
loop putpix
|
||||
loop .putpix
|
||||
popa
|
||||
sub esi,[sub_esi]
|
||||
add edi,[add_edi]
|
||||
loop mario_1l
|
||||
|
||||
sub esi,res_line_size
|
||||
add edi, eax
|
||||
loop .new_line
|
||||
|
||||
ret
|
||||
|
||||
sub_esi dd 0x0
|
||||
add_edi dd 0x0
|
||||
imul_esi dd 0x0
|
||||
base dd 0x0
|
||||
width dd 0x0
|
||||
width_move dd 0x0
|
||||
imul_esi dd 0
|
||||
base dd 0
|
||||
width dd 0
|
||||
width_move dd 0
|
||||
height_move dd 0
|
||||
|
||||
|
||||
|
||||
mario_mirror:
|
||||
|
||||
|
||||
; mario_green
|
||||
|
||||
mov edi,mario_green
|
||||
mov ecx,70*50
|
||||
mario_greenl:
|
||||
mov ecx, mario_count_pixel
|
||||
@@:
|
||||
mov [edi],dword 0x00500f
|
||||
add edi,3
|
||||
loop mario_greenl
|
||||
add edi, 3
|
||||
loop @b
|
||||
|
||||
; mario_4 - reverse mario_1
|
||||
|
||||
|
||||
; mario_4
|
||||
|
||||
mov edi,mario_4
|
||||
mov esi,mario_1+49*3
|
||||
mov ecx,70
|
||||
mov edi, mario_4
|
||||
mov esi, mario_1 + (mario_width - 1)*3
|
||||
mov ecx, mario_height
|
||||
m4l1:
|
||||
pusha
|
||||
mov ecx,50
|
||||
mov ecx, mario_width
|
||||
m4l2:
|
||||
mov eax,[esi]
|
||||
mov [edi],ax
|
||||
@ -326,19 +323,20 @@ mario_mirror:
|
||||
sub esi,3
|
||||
loop m4l2
|
||||
popa
|
||||
add esi,50*3
|
||||
add edi,50*3
|
||||
|
||||
add esi, mario_width*3
|
||||
add edi, mario_width*3
|
||||
loop m4l1
|
||||
|
||||
|
||||
; mario_5
|
||||
; mario_5 - reverse mario_2
|
||||
|
||||
mov edi,mario_5
|
||||
mov esi,mario_2+49*3
|
||||
mov ecx,70
|
||||
mov edi, mario_5
|
||||
mov esi, mario_2 + (mario_width - 1)*3
|
||||
mov ecx, mario_height
|
||||
m5l1:
|
||||
pusha
|
||||
mov ecx,50
|
||||
mov ecx, mario_width
|
||||
m5l2:
|
||||
mov eax,[esi]
|
||||
mov [edi],ax
|
||||
@ -348,19 +346,20 @@ mario_mirror:
|
||||
sub esi,3
|
||||
loop m5l2
|
||||
popa
|
||||
add esi,50*3
|
||||
add edi,50*3
|
||||
|
||||
add esi, mario_width*3
|
||||
add edi, mario_width*3
|
||||
loop m5l1
|
||||
|
||||
|
||||
; mario_6
|
||||
; mario_6 - reverse mario_3
|
||||
|
||||
mov edi,mario_6
|
||||
mov esi,mario_3+49*3
|
||||
mov ecx,70
|
||||
mov edi, mario_6
|
||||
mov esi, mario_3 + (mario_width - 1)*3
|
||||
mov ecx, mario_height
|
||||
m6l1:
|
||||
pusha
|
||||
mov ecx,50
|
||||
mov ecx, mario_width
|
||||
m6l2:
|
||||
mov eax,[esi]
|
||||
mov [edi],ax
|
||||
@ -370,13 +369,13 @@ mario_mirror:
|
||||
sub esi,3
|
||||
loop m6l2
|
||||
popa
|
||||
add esi,50*3
|
||||
add edi,50*3
|
||||
|
||||
add esi, mario_width*3
|
||||
add edi, mario_width*3
|
||||
loop m6l1
|
||||
|
||||
|
||||
popa
|
||||
|
||||
ret
|
||||
|
||||
|
||||
@ -547,129 +546,132 @@ draw_mario:
|
||||
|
||||
mov eax,[mariomem]
|
||||
cmp eax,[marioxy]
|
||||
jnz dm1
|
||||
jnz @f
|
||||
|
||||
call mario_delay
|
||||
|
||||
popa
|
||||
|
||||
ret
|
||||
|
||||
dm1:
|
||||
|
||||
@@:
|
||||
mov eax,[marioxy]
|
||||
mov [mariomem],eax
|
||||
|
||||
|
||||
cmp byte [leftright],byte 1 ; go left
|
||||
jnz no_m_left
|
||||
jmp m_left
|
||||
no_m_left:
|
||||
cmp byte [leftright], 1 ; go left
|
||||
jz m_left
|
||||
|
||||
cmp byte [leftright],byte 4 ; go right
|
||||
jnz no_m_right
|
||||
jmp m_right
|
||||
no_m_right:
|
||||
cmp byte [leftright], 4 ; go right
|
||||
jz m_right
|
||||
|
||||
cmp byte [leftright],byte 2 ; stand left
|
||||
cmp byte [leftright], 2 ; stand left
|
||||
jnz no_r_still
|
||||
|
||||
mov eax,7
|
||||
mov ebx,mario_green
|
||||
mov ecx,50*65536+70
|
||||
mov ecx, mario_draw_size
|
||||
mov edx,[marioxy]
|
||||
int 0x40
|
||||
|
||||
call advance_mario
|
||||
mov eax,7
|
||||
mov ebx,mario_1
|
||||
mov ecx,50*65536+70
|
||||
mov ecx, mario_draw_size
|
||||
mov edx,[marioxy]
|
||||
int 0x40
|
||||
|
||||
call mario_delay
|
||||
|
||||
popa
|
||||
ret
|
||||
no_r_still:
|
||||
|
||||
no_r_still:
|
||||
cmp byte [leftright],byte 3 ; stand right
|
||||
jnz no_l_still
|
||||
|
||||
mov eax,7
|
||||
mov ebx,mario_green
|
||||
mov ecx,50*65536+70
|
||||
mov ecx, mario_draw_size
|
||||
mov edx,[marioxy]
|
||||
int 0x40
|
||||
|
||||
call advance_mario
|
||||
mov eax,7
|
||||
mov ebx,mario_4
|
||||
mov ecx,50*65536+70
|
||||
mov ecx, mario_draw_size
|
||||
mov edx,[marioxy]
|
||||
int 0x40
|
||||
|
||||
call mario_delay
|
||||
|
||||
popa
|
||||
ret
|
||||
no_l_still:
|
||||
|
||||
popa
|
||||
ret
|
||||
|
||||
|
||||
|
||||
|
||||
m_left:
|
||||
|
||||
mov eax,7
|
||||
mov ebx,mario_green
|
||||
mov ecx,50*65536+70
|
||||
mov ecx, mario_draw_size
|
||||
mov edx,[marioxy]
|
||||
int 0x40
|
||||
|
||||
call advance_mario
|
||||
mov eax,7
|
||||
mov ebx,mario_1
|
||||
mov ecx,50*65536+70
|
||||
mov ecx, mario_draw_size
|
||||
mov edx,[marioxy]
|
||||
int 0x40
|
||||
|
||||
call mario_delay
|
||||
|
||||
mov eax,7
|
||||
mov ebx,mario_green
|
||||
mov ecx,50*65536+70
|
||||
mov ecx, mario_draw_size
|
||||
mov edx,[marioxy]
|
||||
int 0x40
|
||||
|
||||
call advance_mario
|
||||
mov eax,7
|
||||
mov ebx,mario_2
|
||||
mov ecx,50*65536+70
|
||||
mov ecx, mario_draw_size
|
||||
mov edx,[marioxy]
|
||||
int 0x40
|
||||
|
||||
call mario_delay
|
||||
|
||||
mov eax,7
|
||||
mov ebx,mario_green
|
||||
mov ecx,50*65536+70
|
||||
mov ecx, mario_draw_size
|
||||
mov edx,[marioxy]
|
||||
int 0x40
|
||||
|
||||
call advance_mario
|
||||
mov eax,7
|
||||
mov ebx,mario_3
|
||||
mov ecx,50*65536+70
|
||||
mov ecx, mario_draw_size
|
||||
mov edx,[marioxy]
|
||||
int 0x40
|
||||
|
||||
call mario_delay
|
||||
|
||||
mov eax,7
|
||||
mov ebx,mario_green
|
||||
mov ecx,50*65536+70
|
||||
mov ecx, mario_draw_size
|
||||
mov edx,[marioxy]
|
||||
int 0x40
|
||||
|
||||
call advance_mario
|
||||
mov eax,7
|
||||
mov ebx,mario_2
|
||||
mov ecx,50*65536+70
|
||||
mov ecx, mario_draw_size
|
||||
mov edx,[marioxy]
|
||||
int 0x40
|
||||
|
||||
call mario_delay
|
||||
|
||||
popa
|
||||
|
||||
ret
|
||||
|
||||
m_right:
|
||||
@ -677,64 +679,67 @@ draw_mario:
|
||||
|
||||
mov eax,7
|
||||
mov ebx,mario_green
|
||||
mov ecx,50*65536+70
|
||||
mov ecx, mario_draw_size
|
||||
mov edx,[marioxy]
|
||||
int 0x40
|
||||
|
||||
call advance_mario
|
||||
mov eax,7
|
||||
mov ebx,mario_4
|
||||
mov ecx,50*65536+70
|
||||
mov ecx, mario_draw_size
|
||||
mov edx,[marioxy]
|
||||
int 0x40
|
||||
|
||||
call mario_delay
|
||||
|
||||
mov eax,7
|
||||
mov ebx,mario_green
|
||||
mov ecx,50*65536+70
|
||||
mov ecx, mario_draw_size
|
||||
mov edx,[marioxy]
|
||||
int 0x40
|
||||
|
||||
call advance_mario
|
||||
mov eax,7
|
||||
mov ebx,mario_5
|
||||
mov ecx,50*65536+70
|
||||
mov ecx, mario_draw_size
|
||||
mov edx,[marioxy]
|
||||
int 0x40
|
||||
|
||||
call mario_delay
|
||||
|
||||
mov eax,7
|
||||
mov ebx,mario_green
|
||||
mov ecx,50*65536+70
|
||||
mov ecx, mario_draw_size
|
||||
mov edx,[marioxy]
|
||||
int 0x40
|
||||
|
||||
call advance_mario
|
||||
mov eax,7
|
||||
mov ebx,mario_6
|
||||
mov ecx,50*65536+70
|
||||
mov ecx, mario_draw_size
|
||||
mov edx,[marioxy]
|
||||
int 0x40
|
||||
|
||||
call mario_delay
|
||||
|
||||
mov eax,7
|
||||
mov ebx,mario_green
|
||||
mov ecx,50*65536+70
|
||||
mov ecx, mario_draw_size
|
||||
mov edx,[marioxy]
|
||||
int 0x40
|
||||
|
||||
call advance_mario
|
||||
mov eax,7
|
||||
mov ebx,mario_5
|
||||
mov ecx,50*65536+70
|
||||
mov ecx, mario_draw_size
|
||||
mov edx,[marioxy]
|
||||
int 0x40
|
||||
|
||||
call mario_delay
|
||||
|
||||
popa
|
||||
|
||||
ret
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
draw_window:
|
||||
|
||||
pusha
|
||||
@ -744,9 +749,9 @@ draw_window:
|
||||
int 0x40
|
||||
|
||||
mov eax,0 ; define and draw window
|
||||
mov ebx,80*65536+480+1
|
||||
mov ecx,20*65536+382
|
||||
mov edx,0x5466AA88
|
||||
mov ebx, (wnd_pos_x shl 16) + wnd_width ;80*65536+480+1
|
||||
mov ecx, (wnd_pos_y shl 16) + wnd_height ;20*65536+382
|
||||
mov edx,0x5466AA88 ; 4 type window + title + no draw work space
|
||||
mov edi,title
|
||||
int 0x40
|
||||
|
||||
@ -761,9 +766,6 @@ draw_window:
|
||||
|
||||
; DATA SECTION
|
||||
|
||||
filename:
|
||||
db 'MARIOALLBMP'
|
||||
|
||||
title:
|
||||
db 'SUPER MARIO - USE ARROW KEYS', 0
|
||||
|
||||
@ -778,6 +780,7 @@ field:
|
||||
db '1 1'
|
||||
db '1 1'
|
||||
db '222222222222'
|
||||
.end:
|
||||
|
||||
xxyy dd 0x0
|
||||
|
||||
@ -789,9 +792,33 @@ leftright dd 0x0
|
||||
|
||||
velocity dd 0x0
|
||||
|
||||
align 16
|
||||
loadp:
|
||||
file 'MARIOALL.BMP'
|
||||
|
||||
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:
|
||||
|
||||
|
||||
|
||||
|
@ -20,21 +20,14 @@ CK_UP2 equ 72
|
||||
CK_DOWN2 equ 80
|
||||
|
||||
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'
|
||||
dd 1
|
||||
dd START
|
||||
dd I_END
|
||||
dd MEM
|
||||
dd STACKTOP
|
||||
dd 1 ; version
|
||||
dd START ; program start
|
||||
dd I_END ; program image size
|
||||
dd MEM ; size memory for program
|
||||
dd STACKTOP ; pointer on stack
|
||||
dd 0
|
||||
dd 0
|
||||
|
||||
|
@ -465,7 +465,9 @@ struct process_information
|
||||
dw ? ; +52
|
||||
client_box BOX ; +54
|
||||
wnd_state db ? ; +70
|
||||
rb (1024-71)
|
||||
event_mask dd ? ; +71
|
||||
keyboard_mode db ? ; +75
|
||||
rb (1024-76)
|
||||
ends
|
||||
|
||||
struct system_colors
|
||||
|
@ -240,7 +240,7 @@ start_end_application:
|
||||
align 4
|
||||
@@:
|
||||
mov ebx, exec_fileinfo
|
||||
mov dword [ebx+21],end_name
|
||||
mov dword [ebx + 21],end_name
|
||||
mcall 70
|
||||
ret
|
||||
;------------------------------------------------------------------------------
|
||||
@ -255,7 +255,7 @@ start_mousemul_application:
|
||||
align 4
|
||||
@@:
|
||||
mov ebx, exec_fileinfo
|
||||
mov dword [ebx+21],mousemul_name
|
||||
mov dword [ebx + 21],mousemul_name
|
||||
mcall 70
|
||||
ret
|
||||
;------------------------------------------------------------------------------
|
||||
@ -291,7 +291,7 @@ align 4
|
||||
align 4
|
||||
@@:
|
||||
mov ebx, exec_fileinfo
|
||||
mov dword [ebx+21], run_name
|
||||
mov dword [ebx + 21], run_name
|
||||
mcall 70
|
||||
jmp begin_1.ret
|
||||
;------------------------------------------------------------------------------
|
||||
@ -307,7 +307,7 @@ start_PrintScreen_application:
|
||||
align 4
|
||||
@@:
|
||||
mov ebx, exec_fileinfo
|
||||
mov dword [ebx+21],printscreen_name
|
||||
mov dword [ebx + 21],printscreen_name
|
||||
mov [ebx+8],dword bootparam_printscreen
|
||||
mcall 70
|
||||
jmp begin_1.ret
|
||||
@ -579,7 +579,7 @@ START:
|
||||
mcall 66,1,1
|
||||
|
||||
mcall 9,process_info_buffer,-1
|
||||
mov ecx,[ebx+30] ; PID
|
||||
mov ecx, [ebx + process_information.PID] ; PID
|
||||
mcall 18,21
|
||||
mov [my_active_slot],eax ; WINDOW SLOT
|
||||
|
||||
@ -627,7 +627,7 @@ end if
|
||||
call set_work_ares_pf_screen
|
||||
|
||||
mcall 9,process_info_buffer,-1
|
||||
mov ecx,[process_info_buffer+30]
|
||||
mov ecx,[process_info_buffer.PID]
|
||||
mcall 18,21
|
||||
mov [this_slot],eax
|
||||
mov [max_slot],255
|
||||
@ -798,7 +798,7 @@ button:
|
||||
|
||||
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
|
||||
|
||||
cmp ecx,[current_active_slot]
|
||||
|
@ -1,7 +1,7 @@
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
context_menu_start:
|
||||
mcall 40,00100111b
|
||||
mcall 40, EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE ;00100111b
|
||||
mov ecx, [ctx_menu_PID]
|
||||
mcall 18,21
|
||||
mov ecx, eax
|
||||
@ -11,13 +11,13 @@ context_menu_start:
|
||||
align 4
|
||||
ctx_menu_still:
|
||||
mcall 10
|
||||
cmp eax, 2
|
||||
cmp eax, EV_KEY
|
||||
jz ctx_menu_key
|
||||
|
||||
cmp eax, 3
|
||||
cmp eax, EV_BUTTON
|
||||
jz ctx_menu_button
|
||||
|
||||
cmp eax, 6
|
||||
cmp eax, EV_MOUSE
|
||||
jz ctx_menu_mouse
|
||||
|
||||
call draw_ctx_menu
|
||||
@ -75,7 +75,7 @@ align 4
|
||||
mov edx, [n_slot]
|
||||
xor ecx, ecx
|
||||
|
||||
test [procinfo_for_detect+70],byte 2
|
||||
test [procinfo_for_detect.wnd_state],byte 2
|
||||
setnz cl
|
||||
add cl, cl
|
||||
;--------------------------------------
|
||||
@ -102,29 +102,29 @@ draw_ctx_menu:
|
||||
sub ecx, 60 ; 41
|
||||
shl ecx, 16
|
||||
add ecx, 60 ; 41
|
||||
mov esi, [system_colours + 4] ; sc.grab
|
||||
mov esi, [system_colours.grab] ; sc.grab
|
||||
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
|
||||
|
||||
inc edx
|
||||
mcall ,,<40,17>
|
||||
|
||||
mov ecx, [system_colours + 16] ; sc.grab_text
|
||||
mov ecx, [system_colours.grab_text] ; sc.grab_text
|
||||
or ecx, 0x10000000
|
||||
mcall 4,<32,4>,,ctx_menu_title,ctx_menu_title_end - ctx_menu_title
|
||||
|
||||
add ebx, 1 * 65536
|
||||
mcall
|
||||
|
||||
mov ecx, [system_colours + 32] ; sc.work_text
|
||||
mov ecx, [system_colours.work_text] ; sc.work_text
|
||||
or ecx, 0x80000000
|
||||
mcall ,<4,28>,,ctx_menu_text
|
||||
|
||||
mov edx, ctx_menu_text2
|
||||
|
||||
test byte [procinfo_for_detect+70], 2
|
||||
test byte [procinfo_for_detect.wnd_state], 2
|
||||
jz @f
|
||||
mov edx, ctx_menu_text3
|
||||
;--------------------------------------
|
||||
|
@ -28,26 +28,26 @@ align 4
|
||||
need_window_tab:
|
||||
; in: ebx->process info
|
||||
; out: ZF set <=> do not draw
|
||||
cmp byte [ebx+10], '@'
|
||||
cmp byte [ebx + process_information.process_name], '@'
|
||||
jz .nodraw
|
||||
; do not draw undefined (zero-sized) windows
|
||||
cmp dword [ebx+42], 0
|
||||
cmp dword [ebx + process_information.box.width], 0
|
||||
jnz @f
|
||||
cmp dword [ebx+46], 0
|
||||
cmp dword [ebx + process_information.box.height], 0
|
||||
jz .nodraw
|
||||
;--------------------------------------
|
||||
align 4
|
||||
@@:
|
||||
; do not draw OpenDialog windows
|
||||
push edi
|
||||
mov edi, dword [ebx+10]
|
||||
mov edi, dword [ebx + process_information.process_name]
|
||||
or edi, 0x20202020
|
||||
cmp edi, 'open'
|
||||
jne @f
|
||||
|
||||
mov edi, dword [ebx+14]
|
||||
mov edi, dword [ebx + process_information.process_name + 4]
|
||||
or edi, 0x20202020
|
||||
cmp dword [ebx+14], 'dial'
|
||||
cmp edi, 'dial'
|
||||
jne @f
|
||||
|
||||
pop edi
|
||||
@ -56,18 +56,18 @@ align 4
|
||||
align 4
|
||||
@@:
|
||||
pop edi
|
||||
cmp dword [ebx+10], 'ICON'
|
||||
cmp dword [ebx + process_information.process_name], 'ICON'
|
||||
jnz @f
|
||||
|
||||
cmp [ebx+42], dword 51
|
||||
cmp [ebx + process_information.box.width], dword 51
|
||||
jnz @f
|
||||
|
||||
cmp [ebx+46], dword 51
|
||||
cmp [ebx + process_information.box.height], dword 51
|
||||
jz .nodraw
|
||||
;--------------------------------------
|
||||
align 4
|
||||
@@:
|
||||
cmp [ebx+10], dword ' '
|
||||
cmp dword[ebx + process_information.process_name], ' '
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.nodraw:
|
||||
@ -180,8 +180,8 @@ align 4
|
||||
shr ecx,16
|
||||
add bx,cx
|
||||
|
||||
mov edx, procinfo_window_tabs+10
|
||||
mcall 4,,[system_colours.work_button_text],,11
|
||||
mov edx, procinfo_window_tabs.process_name
|
||||
mcall 4,,[system_colours.work_button_text],, sizeof.process_information.process_name
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.nodraw:
|
||||
|
@ -8,10 +8,10 @@ draw_window:
|
||||
mov [running_applications],-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 edx,[system_colours+4*6]
|
||||
mov eax, [system_colours.work_button]
|
||||
mov edx,[system_colours.work_button]
|
||||
mov eax,COLOR_CHANGE_MAGNITUDE
|
||||
call subtract_color_change_magnitude
|
||||
mov [wcolor], edx
|
||||
@ -306,7 +306,7 @@ align 4
|
||||
align 4
|
||||
@@:
|
||||
; 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
|
||||
mov edx, 0x60000000 + 103
|
||||
mov ecx, [height]
|
||||
|
@ -34,7 +34,7 @@ win_key_flag rb 1
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
system_colours system_colors ; rd 10
|
||||
system_colours system_colors
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
app_list rd 50
|
||||
@ -48,16 +48,13 @@ path:
|
||||
;-----------------------------------------------------------------------------
|
||||
align 4
|
||||
library_path:
|
||||
process_info_buffer:
|
||||
rb 1024
|
||||
process_info_buffer process_information
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
procinfo_for_detect:
|
||||
rb 1024
|
||||
procinfo_for_detect process_information
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
procinfo_window_tabs:
|
||||
rb 1024
|
||||
procinfo_window_tabs process_information
|
||||
;-----------------------------------------------------------------------------
|
||||
align 4
|
||||
bootparam:
|
||||
|
@ -11,13 +11,16 @@
|
||||
use32
|
||||
org 0x0
|
||||
|
||||
db 'MENUET00' ; 8 byte id
|
||||
dd 38 ; required os
|
||||
db 'MENUET01'
|
||||
dd 1 ; version
|
||||
dd STARTAPP ; program start
|
||||
dd I_END ; program image size
|
||||
dd 0x100000 ; required amount of memory
|
||||
dd 0x00000000 ; reserved=no extended header
|
||||
dd MEM ; size memory for program
|
||||
dd STACKTOP ; base stack pointer
|
||||
dd 0
|
||||
dd 0
|
||||
|
||||
include '../../../macros.inc'
|
||||
include "ASPAPI.INC"
|
||||
|
||||
N_KEYCOLOR equ 0x00677889 ; Normal button color
|
||||
@ -26,8 +29,6 @@ L_KEYCOLOR equ 0x00258778 ; Lock button color
|
||||
TEXTCOLOR equ 0x00FFFFFF ; Button caption color
|
||||
|
||||
ASCII_KEYMAP_SIZE equ 128
|
||||
PROCINFO_SIZE equ 1024
|
||||
PROCINFO_BUFF equ ascii_keymap + ASCII_KEYMAP_SIZE
|
||||
|
||||
STARTAPP:
|
||||
mov ecx, 1 ; to send scancodes.
|
||||
@ -189,7 +190,7 @@ get_zkey_window_slot_number:
|
||||
mov [zkey_window], eax
|
||||
set_event_mask:
|
||||
mov eax, 40
|
||||
mov ebx, 39
|
||||
mov ebx, EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE ; 39 ; 100111b
|
||||
int 0x40
|
||||
|
||||
still:
|
||||
@ -198,19 +199,20 @@ still:
|
||||
call set_keyboard_mode
|
||||
; delete_switch_button
|
||||
mov eax, 8
|
||||
mov edx, 0x80700000
|
||||
mov edx, BT_DEL + 0x00700000
|
||||
int 0x40
|
||||
|
||||
mov byte [red_type], 2
|
||||
call draw_window.draw_switch_button
|
||||
|
||||
mov eax, 10 ; Wait for an event in the queue.
|
||||
int 0x40
|
||||
|
||||
cmp al,1 ; redraw request ?
|
||||
cmp al, EV_REDRAW ; redraw request ?
|
||||
jz red
|
||||
cmp al,2 ; key in buffer ?
|
||||
cmp al, EV_KEY ; key in buffer ?
|
||||
jz key
|
||||
cmp al,3 ; button in buffer ?
|
||||
cmp al, EV_BUTTON ; button in buffer ?
|
||||
jz button
|
||||
|
||||
jmp still
|
||||
@ -391,7 +393,7 @@ get_receiver_window_keyboard_mode:
|
||||
mov ebx, PROCINFO_BUFF
|
||||
mov ecx, [receiver_window]
|
||||
int 0x40
|
||||
movzx ecx, byte [ebx + 75]
|
||||
movzx ecx, byte [ebx + process_information.keyboard_mode]
|
||||
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
|
||||
|
||||
ascii_keymap:
|
||||
ascii_keymap: rb ASCII_KEYMAP_SIZE
|
||||
|
||||
PROCINFO_BUFF process_information
|
||||
|
||||
rb 4096
|
||||
STACKTOP:
|
||||
MEM:
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user