fix header

git-svn-id: svn://kolibrios.org@9344 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Doczom 2021-11-28 15:31:56 +00:00
parent 7cde259662
commit a7f798f637

View File

@ -6,14 +6,50 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
use32 use32
org 0x0 org 0x0
db 'MENUET00' ; 8 byte id ;db 'MENUET00' ; 8 byte id
dd 38 ; required os ;dd 38 ; required os
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 0x100000 ; required amount of memory
dd 0x00000000 ; reserved=no extended header ;dd 0x00000000 ; reserved=no extended header
db 'MENUET01'
dd 1
dd STARTAPP
dd I_END
dd MEM
dd STACKTOP
dd 0
dd 0
;macro start_draw_window x,y,xsize,ysize,areacolor,caption;,capsize
;{
; mov eax, 12 ; function 12:tell os about windowdraw
; mov ebx, 1 ; 1, start of draw
; int 0x40
; ; DRAW WINDOW
; mov eax, 48 ; function 48.4 : get skin height
; mov ebx, 4
; int 0x40
; push eax
; lea ecx, [y*65536+ysize+eax]; [y start] *65536 + [y size] + [skin_height]
; xor eax, eax ; function 0 : define and draw window
; mov ebx, x*65536+xsize ; [x start] *65536 + [x size]
; mov edx, areacolor ; color of work area RRGGBB
; ;mov esi, 0x00334455 ; color of grab bar RRGGBB
; mov edi, caption;0x00ddeeff ; color of frames RRGGBB
; int 0x40
; pop eax
;}
;
;macro end_draw_window
;{
; mov eax, 12 ; end of redraw
; mov ebx, 2
; int 0x40
;}
include "aspapi.inc" include "aspapi.inc"
SCREEN_WIDTH equ 100h SCREEN_WIDTH equ 100h
@ -22,7 +58,7 @@ SCREEN_HEIGHT equ 100h
STARTAPP: STARTAPP:
mov eax, 18 ;Get CPU speed mov eax, 18 ;Get CPU speed
mov ebx, 5 mov ebx, 5
int 0x40 int 0x40
shr eax, 28 shr eax, 28
@ -72,88 +108,91 @@ l2:
inc si inc si
jnz l11 jnz l11
call copy_buffer_to_video call copy_buffer_to_video
still: still:
mov eax, 11 ; Test if there is an event in the queue. mov eax, 11 ; Test if there is an event in the queue.
int 0x40 int 0x40
cmp al,1 ; redraw request ? cmp al,1 ; redraw request ?
jz red jz red
cmp al,2 ; key in buffer ? cmp al,2 ; key in buffer ?
jz key jz key
cmp al,3 ; button in buffer ? cmp al,3 ; button in buffer ?
jz button jz button
jmp MAIN jmp MAIN
red: red:
call draw_window call draw_window
jmp MAIN jmp MAIN
key: key:
mov eax, 2 mov eax, 2
int 0x40 int 0x40
cmp ah, 27 ; Test Esc in ASCII cmp ah, 27 ; Test Esc in ASCII
je close_app je close_app
jmp MAIN jmp MAIN
button: button:
mov eax, 17 ; Get pressed button code mov eax, 17 ; Get pressed button code
int 0x40 int 0x40
cmp ah, 1 ; Test x button cmp ah, 1 ; Test x button
je close_app je close_app
jmp MAIN jmp MAIN
draw_window: draw_window:
start_draw_window 100,70,SCREEN_WIDTH+9,SCREEN_HEIGHT+4,0x54224466,labelt;, 14;labellen-labelt start_draw_window 100,70,SCREEN_WIDTH+9,SCREEN_HEIGHT+4,0x54224466,labelt;, 14;labellen-labelt
mov dword [skin_h], eax mov dword [skin_h], eax
end_draw_window end_draw_window
ret ret
fail: fail:
; Type something here. ; Type something here.
close_app: close_app:
mov eax, -1 ; close this program mov eax, -1 ; close this program
int 0x40 int 0x40
copy_buffer_to_video: copy_buffer_to_video:
pusha pusha
; mov eax, 18 ;@WAITVSYNC(); ; mov eax, 18 ;@WAITVSYNC();
; mov ebx, 14 ; mov ebx, 14
; int 0x40 ; int 0x40
mov eax, 5 ;delay mov eax, 5 ;delay
mov ebx, dword [delay] mov ebx, dword [delay]
int 0x40 int 0x40
mov eax, dword [skin_h] mov eax, dword [skin_h]
lea edx, [5*65536+eax] lea edx, [5*65536+eax]
mov eax, 65 mov eax, 65
mov ebx, img mov ebx, img
mov ecx, SCREEN_WIDTH*65536+SCREEN_HEIGHT ;ecx = w*65536+h mov ecx, SCREEN_WIDTH*65536+SCREEN_HEIGHT ;ecx = w*65536+h
; mov edx, 5*65536+25 ;edx = x*65536+y ; mov edx, 5*65536+25 ;edx = x*65536+y
mov esi, 8 mov esi, 8
mov edi, Paleta mov edi, Paleta
xor ebp, ebp xor ebp, ebp
int 0x40 int 0x40
popa popa
ret ret
; DATA AREA ; DATA AREA
; Application Title ; Application Title
labelt db 'UnvWater demo',0 labelt db 'UnvWater demo',0
delay dd 0 delay dd 0
skin_h dd 25 ; Skin height. skin_h dd 25 ; Skin height.
I_END: I_END:
Paleta rb 1024 Paleta rb 1024
img db 1 img db 1
rb 10000h rb 10000h
rb 256
STACKTOP:
MEM: