forked from KolibriOS/kolibrios
* New function 65 (PutImagePalette) + documentation
* KFar 0.19 (requires new kernel) git-svn-id: svn://kolibrios.org@283 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
983c7036a5
commit
b1fda0395c
@ -133,7 +133,7 @@ iglobal
|
||||
dd sys_pci ; 62-PCI functions
|
||||
dd sys_msg_board ; 63-System message board
|
||||
dd sys_resize_app_memory ; 64-Resize application memory usage
|
||||
dd undefined_syscall ; 65-UTF
|
||||
dd syscall_putimage_palette; 65-PutImagePalette
|
||||
dd sys_process_def ; 66-Process definitions - keyboard
|
||||
dd sys_window_move ; 67-Window move or resize
|
||||
dd new_services ; 68-Some internal services
|
||||
|
@ -1,273 +0,0 @@
|
||||
Advanced Power Management
|
||||
|
||||
SYSTEM CALL
|
||||
|
||||
eax = 49
|
||||
dx = íîìåð ôóíêöèè APM BIOS (àíàëîãè÷åí ax â ðåàëüíîì ðåæèìå)
|
||||
îñòàëüíûå (bx, cx) ðåãèñòðû ïî ñïåöèôèêàöèè (ñì. apm.txt)
|
||||
ðåçóëüòàò : ïî ñïåöèôèêàöèè (âêëþ÷àÿ CF), ñòàðøàÿ ÷àñòü 32 áèòíûõ ðåãèñòðîâ íå îïðåäåëåíà
|
||||
|
||||
|
||||
MEMORY MAP
|
||||
|
||||
Boot:
|
||||
0x9040 - dword - entry point of APM BIOS
|
||||
0x9044 - word - version (BCD)
|
||||
0x9046 - word - flags
|
||||
|
||||
|
||||
ÈÇÌÅÍÅÍÈß
|
||||
|
||||
bootcode.inc
|
||||
syscall.inc
|
||||
kernel.asm
|
||||
bootcode.inc
|
||||
shutdown.inc
|
||||
|
||||
##############[boot\bootcode.inc]##################
|
||||
|
||||
Òðè íîâûõ äåñêðèïòîðà
|
||||
|
||||
.............
|
||||
.............
|
||||
|
||||
; GDT TABLE
|
||||
|
||||
gdts:
|
||||
|
||||
dw gdte-$-1
|
||||
dd gdts
|
||||
dw 0
|
||||
|
||||
int_code_l:
|
||||
os_code_l:
|
||||
|
||||
dw 0xffff
|
||||
dw 0x0000
|
||||
db 0x00
|
||||
dw 11011111b *256 +10011010b
|
||||
db 0x00
|
||||
|
||||
int_data_l:
|
||||
os_data_l:
|
||||
|
||||
dw 0xffff
|
||||
dw 0x0000
|
||||
db 0x00
|
||||
dw 11011111b *256 +10010010b
|
||||
db 0x00
|
||||
; --------------- APM ---------------------
|
||||
apm_code_32:
|
||||
dw 0x0f ; limit 64kb
|
||||
db 0, 0, 0
|
||||
dw 11010000b *256 +10011010b
|
||||
db 0x00
|
||||
apm_code_16:
|
||||
dw 0x0f
|
||||
db 0, 0, 0
|
||||
dw 10010000b *256 +10011010b
|
||||
db 0x00
|
||||
apm_data_16:
|
||||
dw 0x0f
|
||||
db 0, 0, 0
|
||||
dw 10010000b *256 +10010010b
|
||||
db 0x00
|
||||
; -----------------------------------------
|
||||
app_code_l:
|
||||
dw ((0x80000000-std_application_base_address) shr 12) and 0xffff
|
||||
dw 0
|
||||
db 0
|
||||
dw 11010000b*256+11111010b+256*((0x80000000-std_application_base_address) shr 28)
|
||||
db std_application_base_address shr 24
|
||||
|
||||
app_data_l:
|
||||
dw (0x80000000-std_application_base_address) shr 12 and 0xffff
|
||||
dw 0
|
||||
db 0
|
||||
dw 11010000b*256+11110010b+256*((0x80000000-std_application_base_address) shr 28)
|
||||
db std_application_base_address shr 24
|
||||
|
||||
graph_data_l:
|
||||
|
||||
dw 0x3ff
|
||||
dw 0x0000
|
||||
db 0x00
|
||||
dw 11010000b *256 +11110010b
|
||||
db 0x00
|
||||
|
||||
tss0_l:
|
||||
|
||||
.............
|
||||
.............
|
||||
|
||||
##############[core\syscall.inc]###################
|
||||
|
||||
.............
|
||||
.............
|
||||
|
||||
|
||||
dd display_number ; 47-WriteNum
|
||||
dd display_settings ; 48-SetRedrawType and SetButtonType
|
||||
dd sys_apm ; 49-Advanced Power Management (APM)
|
||||
dd random_shaped_window ; 50-Window shape & scale
|
||||
dd syscall_threads ; 51-Threads
|
||||
|
||||
|
||||
.............
|
||||
.............
|
||||
|
||||
##############[kernel.asm]#########################
|
||||
|
||||
|
||||
×àñòü 1 (ïîñëå ìåòêè "; SAVE REAL MODE VARIABLES"):
|
||||
|
||||
.............
|
||||
.............
|
||||
|
||||
; SAVE REAL MODE VARIABLES
|
||||
|
||||
; --------------- APM ---------------------
|
||||
mov eax, [0x2f0000 + 0x9040] ; entry point
|
||||
mov dword[apm_entry], eax
|
||||
mov word [apm_entry + 4], apm_code_32 - gdts
|
||||
|
||||
mov eax, [0x2f0000 + 0x9044] ; version & flags
|
||||
mov [apm_vf], eax
|
||||
; -----------------------------------------
|
||||
|
||||
.............
|
||||
.............
|
||||
|
||||
×àñòü 2 (ñèñòåìíûé âûçîâ, ðàñïîëîæåíèå íå êðèòè÷íî,
|
||||
ÿ ðàñïîëîæèë ïåðåä ìåòêîé "undefined_syscall:")
|
||||
|
||||
.............
|
||||
.............
|
||||
|
||||
; --------------- APM ---------------------
|
||||
apm_entry dp 0
|
||||
apm_vf dd 0
|
||||
align 4
|
||||
sys_apm:
|
||||
cmp word [apm_vf], 0 ; Check APM BIOS enable
|
||||
jne @f
|
||||
or [esp + 56], byte 1 ; error
|
||||
mov [esp + 36], dword 8 ; 32-bit protected-mode interface not supported
|
||||
ret
|
||||
|
||||
@@: xchg eax, ecx
|
||||
xchg ebx, ecx
|
||||
|
||||
cmp al, 3
|
||||
ja @f
|
||||
and [esp + 56], byte 0xfe ; emulate func 0..3 as func 0
|
||||
mov eax, [apm_vf]
|
||||
mov [esp + 36], eax
|
||||
shr eax, 16
|
||||
mov [esp + 32], eax
|
||||
ret
|
||||
|
||||
@@: call pword [apm_entry] ; call APM BIOS
|
||||
mov [esp + 8 ], edi
|
||||
mov [esp + 12], esi
|
||||
mov [esp + 24], ebx
|
||||
mov [esp + 28], edx
|
||||
mov [esp + 32], ecx
|
||||
mov [esp + 36], eax
|
||||
setc al
|
||||
and [esp + 56], byte 0xfe
|
||||
or [esp + 56], al
|
||||
ret
|
||||
; -----------------------------------------
|
||||
|
||||
align 4
|
||||
|
||||
undefined_syscall: ; Undefined system call
|
||||
|
||||
.............
|
||||
.............
|
||||
|
||||
##############[boot\bootcode.inc]##################
|
||||
|
||||
Ïåðåä ìåòêîé "; DISPLAY VESA INFORMATION"
|
||||
|
||||
.............
|
||||
.............
|
||||
|
||||
; --------------- APM ---------------------
|
||||
push 0
|
||||
pop es
|
||||
mov word [es : 0x9044], 0 ; ver = 0.0 (APM not found)
|
||||
mov ax, 0x5300
|
||||
xor bx, bx
|
||||
int 0x15
|
||||
jc apm_end ; APM not found
|
||||
test cx, 2
|
||||
jz apm_end ; APM 32-bit protected-mode interface not supported
|
||||
mov [es : 0x9044], ax ; Save APM Version
|
||||
mov [es : 0x9046], cx ; Save APM flags
|
||||
|
||||
; Write APM ver ----
|
||||
jmp @f
|
||||
msg_apm:db ' APM x.x ', 0
|
||||
@@: and ax, 0xf0f
|
||||
add ax, '00'
|
||||
mov si, msg_apm - 0x10000
|
||||
mov [si + 5], ah
|
||||
mov [si + 7], al
|
||||
_setcursor 0, 3
|
||||
call printplain
|
||||
_setcursor d80x25_top_num,0
|
||||
; ------------------
|
||||
|
||||
mov ax, 0x5304 ; Disconnect interface
|
||||
xor bx, bx
|
||||
int 0x15
|
||||
mov ax, 0x5303 ; Connect 32 bit mode interface
|
||||
xor bx, bx
|
||||
int 0x15
|
||||
; init selectors
|
||||
movzx eax, ax ; real-mode segment base address of protected-mode 32-bit code segment
|
||||
shl eax, 4
|
||||
mov [apm_code_32 - 0x10000 + 2], ax
|
||||
shr eax, 16
|
||||
mov [apm_code_32 - 0x10000 + 4], al
|
||||
movzx ecx, cx ; real-mode segment base address of protected-mode 16-bit code segment
|
||||
shl ecx, 4
|
||||
mov [apm_code_16 - 0x10000 + 2], cx
|
||||
shr ecx, 16
|
||||
mov [apm_code_16 - 0x10000 + 4], cl
|
||||
movzx edx, dx ; real-mode segment base address of protected-mode 16-bit data segment
|
||||
shl edx, 4
|
||||
mov [apm_data_16 - 0x10000 + 2], dx
|
||||
shr edx, 16
|
||||
mov [apm_data_16 - 0x10000 + 4], dl
|
||||
mov [es : 0x9040], ebx ; offset of APM entry point
|
||||
apm_end:
|
||||
; -----------------------------------------
|
||||
|
||||
|
||||
; DISPLAY VESA INFORMATION
|
||||
|
||||
.............
|
||||
.............
|
||||
|
||||
##############[boot\shutdown.inc]##################
|
||||
|
||||
Ðåøåíèå ïðîáëåìû APM poweroff
|
||||
|
||||
.............
|
||||
.............
|
||||
|
||||
APM_PowerOff:
|
||||
mov ax, 5304h
|
||||
xor bx, bx
|
||||
int 15h
|
||||
;!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
mov ax,0x5300
|
||||
xor bx,bx
|
||||
int 0x15
|
||||
push ax
|
||||
|
||||
.............
|
||||
.............
|
@ -3461,6 +3461,26 @@ IPC
|
||||
‚맮¢ äãªæ¨¨ ¡ã¤¥â ¨£®à¨à®¢ âìáï, ¥á«¨ ¯à¨«®¦¥¨¥ ᮧ¤ áâ
|
||||
«®ª «ìãî ªãç㠢맮¢®¬ 68.11.
|
||||
|
||||
======================================================================
|
||||
========= ”ãªæ¨ï 65 - ¢ë¢¥á⨠¨§®¡à ¦¥¨¥ á ¯ «¨âன ¢ ®ª®. ========
|
||||
======================================================================
|
||||
<EFBFBD> à ¬¥âàë:
|
||||
* eax = 65 - ®¬¥à äãªæ¨¨
|
||||
* ebx = 㪠§ â¥«ì ¨§®¡à ¦¥¨¥
|
||||
* ecx = [à §¬¥à ¯® ®á¨ x]*65536 + [à §¬¥à ¯® ®á¨ y]
|
||||
* edx = [ª®®à¤¨ â ¯® ®á¨ x]*65536 + [ª®®à¤¨ â ¯® ®á¨ y]
|
||||
* esi = ç¨á«® ¡¨â ¯¨ªá¥«ì, ¤®«¦® ¡ëâì 8 ¢ ⥪ã饩 ॠ«¨§ 樨
|
||||
* edi = 㪠§ â¥«ì ¯ «¨âàã (256 梥⮢ 0x00RRGGBB)
|
||||
‚®§¢à é ¥¬®¥ § 票¥:
|
||||
* äãªæ¨ï ¥ ¢®§¢à é ¥â § 票ï
|
||||
‡ ¬¥ç ¨ï:
|
||||
* Š®®à¤¨ âë ¨§®¡à ¦¥¨ï - íâ® ª®®à¤¨ âë ¢¥à奣® «¥¢®£® 㣫
|
||||
¨§®¡à ¦¥¨ï ®â®á¨â¥«ì® ®ª .
|
||||
* <20> §¬¥à ¨§®¡à ¦¥¨ï ¢ ¡ ©â å ¥áâì xsize*ysize.
|
||||
* Š ¦¤ë© ¡ ©â ¨§®¡à ¦¥¨ï à áᬠâਢ ¥âáï ª ª ¨¤¥ªá ¢ ¯ «¨âà¥.
|
||||
* …᫨ ¨§®¡à ¦¥¨¥ ¨á¯®«ì§ã¥â ¥ ¢á¥ 256 梥⮢, ¬¥ìè¥,
|
||||
à §¬¥à ¯ «¨âàë ¬®¦¥â ¡ëâì ¬¥ìè¥ 256.
|
||||
|
||||
======================================================================
|
||||
================= ”ãªæ¨ï 66 - à ¡®â á ª« ¢¨ âãன. =================
|
||||
======================================================================
|
||||
|
@ -3428,6 +3428,26 @@ Remarks:
|
||||
The function call will be ignored after creation of process heap
|
||||
with function 68.11.
|
||||
|
||||
======================================================================
|
||||
======== Function 65 - draw image with palette in the window. ========
|
||||
======================================================================
|
||||
Parameters:
|
||||
* eax = 65 - function number
|
||||
* ebx = pointer to the image
|
||||
* ecx = [size on axis x]*65536 + [size on axis y]
|
||||
* edx = [coordinate on axis x]*65536 + [coordinate on axis y]
|
||||
* esi = number of bits per pixel, must be 8
|
||||
* edi = pointer to palette (256 colors 0x00RRGGBB)
|
||||
Returned value:
|
||||
* function does not return value
|
||||
Remarks:
|
||||
* Coordinates of the image are coordinates of the upper left corner
|
||||
of the image relative to the window.
|
||||
* Size of the image in bytes is xsize*ysize.
|
||||
* Each byte of image is index in the palette.
|
||||
* If the image uses less than 256 colors, palette size may be
|
||||
less than 256 too.
|
||||
|
||||
======================================================================
|
||||
================== Function 66 - work with keyboard. =================
|
||||
======================================================================
|
||||
|
@ -71,7 +71,7 @@ macro epiloguedef procname,flag,parmbytes,localbytes,reglist
|
||||
if parmbytes | localbytes
|
||||
leave
|
||||
end if
|
||||
if flag and 10000b
|
||||
if (flag and 10000b) | (parmbytes=0)
|
||||
retn
|
||||
else
|
||||
retn parmbytes
|
||||
|
@ -1365,7 +1365,9 @@ sys_setup:
|
||||
mov word [midisp],bx
|
||||
ret
|
||||
|
||||
iglobal
|
||||
midi_base dw 0
|
||||
endg
|
||||
|
||||
nsyse1:
|
||||
|
||||
@ -1501,7 +1503,9 @@ cd_base db 0
|
||||
nosethd:
|
||||
ret
|
||||
|
||||
iglobal
|
||||
hd_base db 0
|
||||
endg
|
||||
|
||||
nsyse7:
|
||||
|
||||
@ -1667,12 +1671,13 @@ sys_getsetup:
|
||||
mov [esp+36],dword 1
|
||||
ret
|
||||
|
||||
|
||||
iglobal
|
||||
align 4
|
||||
mousefn dd msscreen, mswin, msbutton, msset
|
||||
dd app_load_cursor
|
||||
dd app_set_cursor
|
||||
dd app_delete_cursor
|
||||
endg
|
||||
|
||||
readmousepos:
|
||||
|
||||
@ -3972,6 +3977,11 @@ sys_putimage:
|
||||
add dx,word[edi+0x80000+APPDATA.wnd_clientbox.left]
|
||||
rol edx,16
|
||||
.forced:
|
||||
push esi ebp
|
||||
mov ebp, putimage_get24bpp
|
||||
mov esi, putimage_init24bpp
|
||||
sys_putimage_bpp:
|
||||
; call [disable_mouse] ; this will be done in xxx_putimage
|
||||
; mov eax, vga_putimage
|
||||
cmp [0xfe0c], word 0x12
|
||||
jz @f ;.doit
|
||||
@ -3986,12 +3996,55 @@ sys_putimage:
|
||||
inc [mouse_pause]
|
||||
call eax
|
||||
dec [mouse_pause]
|
||||
pop ebp esi
|
||||
jmp [draw_pointer]
|
||||
|
||||
syscall_putimage_palette:
|
||||
lea edi, [esi+std_application_base_address]
|
||||
mov esi, edx
|
||||
mov edx, ecx
|
||||
mov ecx, ebx
|
||||
lea ebx, [eax+std_application_base_address]
|
||||
sys_putimage_palette:
|
||||
; ebx = pointer to image
|
||||
; ecx = [xsize]*65536 + [ysize]
|
||||
; edx = [xstart]*65536 + [ystart]
|
||||
; esi = number of bits per pixel, must be 8
|
||||
; edi = pointer to palette
|
||||
mov eax, [0x3000]
|
||||
shl eax, 8
|
||||
add dx, word [eax+0x80000+APPDATA.wnd_clientbox.top]
|
||||
rol edx, 16
|
||||
add dx, word [eax+0x80000+APPDATA.wnd_clientbox.left]
|
||||
rol edx, 16
|
||||
.forced:
|
||||
push esi ebp
|
||||
mov ebp, putimage_get8bpp
|
||||
mov esi, putimage_init8bpp
|
||||
jmp sys_putimage_bpp
|
||||
|
||||
putimage_init24bpp:
|
||||
lea eax, [eax*3]
|
||||
putimage_init8bpp:
|
||||
ret
|
||||
|
||||
putimage_get24bpp:
|
||||
mov eax, [esi]
|
||||
add esi, 3
|
||||
ret 4
|
||||
putimage_get8bpp:
|
||||
movzx eax, byte [esi]
|
||||
push edx
|
||||
mov edx, [esp+8]
|
||||
mov eax, [edx+eax*4]
|
||||
pop edx
|
||||
inc esi
|
||||
ret 4
|
||||
|
||||
; eax x beginning
|
||||
; ebx y beginning
|
||||
; ecx x end
|
||||
; edx y end
|
||||
; edx y end
|
||||
; edi color
|
||||
|
||||
__sys_drawbar:
|
||||
@ -4003,6 +4056,7 @@ __sys_drawbar:
|
||||
add edx,[esi+0x80000+APPDATA.wnd_clientbox.top]
|
||||
.forced:
|
||||
inc [mouse_pause]
|
||||
; call [disable_mouse]
|
||||
cmp [0xfe0c],word 0x12
|
||||
je dbv20
|
||||
sdbv20:
|
||||
|
@ -709,6 +709,12 @@ Vesa12_getpixel32:
|
||||
|
||||
|
||||
vesa12_putimage:
|
||||
; ebx = pointer to image
|
||||
; ecx = size [x|y]
|
||||
; edx = coordinates [x|y]
|
||||
; ebp = pointer to 'get' function
|
||||
; esi = pointer to 'init' function
|
||||
; edi = parameter for 'get' function
|
||||
|
||||
; mov ebx,image
|
||||
; mov ecx,320*65536+240
|
||||
@ -730,8 +736,7 @@ vesa12_putimage:
|
||||
add ebx,[ecx-twdw+WDATA.box.top]
|
||||
push eax
|
||||
mov eax,ebx ; y
|
||||
mov ebx,[0xfe08]
|
||||
mul ebx
|
||||
mul dword [0xfe08]
|
||||
pop ecx
|
||||
add eax,ecx ; x
|
||||
add eax,ecx
|
||||
@ -747,29 +752,18 @@ vesa12_putimage:
|
||||
|
||||
; x size
|
||||
|
||||
movzx eax,word [esp+6]
|
||||
mov ecx,eax
|
||||
add ecx,eax
|
||||
add ecx,eax
|
||||
cmp [0xfbf1],byte 24 ; 24 or 32 bpp ? - x size
|
||||
jz pi24312
|
||||
add ecx,eax
|
||||
|
||||
pi24312:
|
||||
movzx ecx,word [esp+6]
|
||||
|
||||
mov esi,[esp+8]
|
||||
movzx ebx,word [esp+4]
|
||||
|
||||
; check limits while draw ?
|
||||
|
||||
push eax
|
||||
push ecx
|
||||
mov eax,[0x3010]
|
||||
mov ecx,[eax+draw_data-0x3000+RECT.left]
|
||||
cmp ecx,0
|
||||
cmp dword [eax+draw_data-0x3000+RECT.left], 0
|
||||
jnz dbcblimitlset212
|
||||
mov ecx,[eax+draw_data-0x3000+RECT.top]
|
||||
cmp ecx,0
|
||||
cmp dword [eax+draw_data-0x3000+RECT.top], 0
|
||||
jnz dbcblimitlset212
|
||||
mov ecx,[eax+draw_data-0x3000+RECT.right]
|
||||
cmp ecx,[0xfe00]
|
||||
@ -778,84 +772,67 @@ vesa12_putimage:
|
||||
cmp ecx,[0xfe04]
|
||||
jnz dbcblimitlset212
|
||||
pop ecx
|
||||
pop eax
|
||||
push dword 0
|
||||
push 0
|
||||
jmp dbcblimitlno212
|
||||
|
||||
dbcblimitlset212:
|
||||
|
||||
pop ecx
|
||||
pop eax
|
||||
push dword 1
|
||||
push 1
|
||||
|
||||
dbcblimitlno212:
|
||||
|
||||
cmp [0xfbf1],byte 24 ; 24 or 32 bpp ?
|
||||
jz pi24bit12
|
||||
jmp pi32bit12
|
||||
jnz pi32bit12
|
||||
|
||||
pi24bit12:
|
||||
|
||||
cld
|
||||
push eax
|
||||
push ebx
|
||||
push edx
|
||||
xor edx,edx
|
||||
mov eax,ecx
|
||||
mov ebx,3
|
||||
div ebx
|
||||
mov ecx,eax
|
||||
pop edx
|
||||
pop ebx
|
||||
pop eax
|
||||
|
||||
newpi12:
|
||||
|
||||
push edi
|
||||
push esi
|
||||
push ecx
|
||||
push ebx
|
||||
|
||||
xor edx,edx
|
||||
mov eax,edi
|
||||
sub eax,[0xfe80]
|
||||
mov edx,edi
|
||||
sub edx,[0xfe80]
|
||||
mov ebx,3
|
||||
div ebx
|
||||
add eax,WinMapAddress
|
||||
add edx,WinMapAddress
|
||||
mov ebx,[0x3000]
|
||||
mov bh,[esp+4*4]
|
||||
mov bh,[esp+4*3]
|
||||
|
||||
np2412:
|
||||
|
||||
cmp bl,[eax]
|
||||
cmp bl,[edx]
|
||||
jnz imp24no12
|
||||
mov edx,[esi]
|
||||
cmp bh,0
|
||||
jz imp24yes12
|
||||
; mov eax,[esi]
|
||||
push dword [esp+4*3+20]
|
||||
call ebp
|
||||
; cmp bh,0
|
||||
; jz imp24yes12
|
||||
; call dbcplimit
|
||||
; jnz imp24no12
|
||||
|
||||
imp24yes12:
|
||||
|
||||
push eax
|
||||
push edi
|
||||
push eax
|
||||
mov eax,edi
|
||||
sub eax,[0xfe80]
|
||||
shr eax,16
|
||||
call set_bank
|
||||
pop eax
|
||||
and edi,0xffff
|
||||
add edi,0xa0000
|
||||
mov [edi],edx
|
||||
shr edx,2
|
||||
mov [edi+2],dl
|
||||
sti
|
||||
mov [edi],ax
|
||||
shr eax,16
|
||||
mov [edi+2],al
|
||||
pop edi
|
||||
pop eax
|
||||
|
||||
imp24no12:
|
||||
|
||||
inc eax
|
||||
add esi,3
|
||||
inc edx
|
||||
; add esi,3
|
||||
add edi,3
|
||||
dec ecx
|
||||
jnz np2412
|
||||
@ -864,73 +841,63 @@ vesa12_putimage:
|
||||
|
||||
pop ebx
|
||||
pop ecx
|
||||
pop esi
|
||||
pop edi
|
||||
|
||||
add edi,[0xfe08]
|
||||
xor eax,eax
|
||||
mov ax,[esp+4+2+4]
|
||||
lea eax,[eax+eax*2]
|
||||
add esi,eax
|
||||
dec ebx
|
||||
jz nonewpi12
|
||||
jmp newpi12
|
||||
jnz newpi12
|
||||
|
||||
nonewpi12:
|
||||
|
||||
add esp,7*4
|
||||
mov eax,0
|
||||
ret
|
||||
pop eax edx ecx ebx eax edi esi
|
||||
xor eax, eax
|
||||
ret
|
||||
|
||||
|
||||
pi32bit12:
|
||||
|
||||
cld
|
||||
shr ecx,2
|
||||
|
||||
newpi3212:
|
||||
|
||||
push edi
|
||||
push esi
|
||||
push ecx
|
||||
push ebx
|
||||
|
||||
mov eax,edi
|
||||
sub eax,[0xfe80]
|
||||
shr eax,2
|
||||
add eax,WinMapAddress
|
||||
mov edx,edi
|
||||
sub edx,[0xfe80]
|
||||
shr edx,2
|
||||
add edx,WinMapAddress
|
||||
mov ebx,[0x3000]
|
||||
mov bh,[esp+4*4]
|
||||
mov bh,[esp+4*3]
|
||||
|
||||
np3212:
|
||||
|
||||
cmp bl,[eax]
|
||||
cmp bl,[edx]
|
||||
jnz imp32no12
|
||||
mov edx,[esi]
|
||||
cmp bh,0
|
||||
jz imp32yes12
|
||||
; mov eax,[esi]
|
||||
push dword [esp+4*3+20]
|
||||
call ebp
|
||||
; cmp bh,0
|
||||
; jz imp32yes12
|
||||
; call dbcplimit
|
||||
; jnz imp32no12
|
||||
|
||||
imp32yes12:
|
||||
|
||||
push eax
|
||||
push edi
|
||||
push eax
|
||||
mov eax,edi
|
||||
sub eax,[0xfe80]
|
||||
shr eax,16
|
||||
call set_bank
|
||||
and edi,0xffff
|
||||
add edi,0xa0000
|
||||
mov [edi],edx
|
||||
sti
|
||||
pop edi
|
||||
pop eax
|
||||
and edi,0xffff
|
||||
mov [edi+0xa0000],eax
|
||||
pop edi
|
||||
|
||||
imp32no12:
|
||||
|
||||
inc eax
|
||||
add esi,3
|
||||
inc edx
|
||||
; add esi,3
|
||||
add edi,4
|
||||
dec ecx
|
||||
jnz np3212
|
||||
@ -939,22 +906,17 @@ vesa12_putimage:
|
||||
|
||||
pop ebx
|
||||
pop ecx
|
||||
pop esi
|
||||
pop edi
|
||||
|
||||
add edi,[0xfe08]
|
||||
movzx eax,word [esp+4+2+4]
|
||||
lea eax,[eax+eax*2]
|
||||
add esi,eax
|
||||
dec ebx
|
||||
jz nonewpi3212
|
||||
jmp newpi3212
|
||||
jnz newpi3212
|
||||
|
||||
nonewpi3212:
|
||||
|
||||
add esp,7*4
|
||||
mov eax,0
|
||||
ret
|
||||
pop eax edx ecx ebx eax edi esi
|
||||
xor eax, eax
|
||||
ret
|
||||
|
||||
|
||||
vesa12_read_screen_pixel:
|
||||
|
@ -76,29 +76,27 @@ virtual at esp
|
||||
.abs_cx dd ?
|
||||
.abs_cy dd ?
|
||||
.line_increment dd ?
|
||||
.source_bpp dd ?
|
||||
.winmap_newline dd ?
|
||||
.screen_newline dd ?
|
||||
.stack_data = 4*13
|
||||
.stack_data = 4*12
|
||||
.edi dd ?
|
||||
.esi dd ?
|
||||
.ebp dd ?
|
||||
end virtual
|
||||
|
||||
align 4
|
||||
align 16
|
||||
; ebx = pointer
|
||||
; ecx = size [x|y]
|
||||
; edx = coordinates [x|y]
|
||||
; ebp = pointer to 'get' function
|
||||
; esi = pointer to 'init' function
|
||||
; edi = parameter for 'get' function
|
||||
vesa20_putimage:
|
||||
pushad
|
||||
call [disable_mouse]
|
||||
|
||||
sub esp, putimg.stack_data
|
||||
|
||||
mov [putimg.source_bpp], 3
|
||||
; test ebx, 0x80000000
|
||||
; jz @f
|
||||
; inc [putimg.source_bpp]
|
||||
; @@:
|
||||
; and ebx, 0x7FFFFFFF
|
||||
|
||||
; save pointer to image
|
||||
mov [putimg.pti], ebx
|
||||
|
||||
@ -164,7 +162,8 @@ vesa20_putimage:
|
||||
mov eax, [putimg.image_sx]
|
||||
sub eax, [putimg.real_sx]
|
||||
;; imul eax, [putimg.source_bpp]
|
||||
lea eax, [eax + eax * 2]
|
||||
; lea eax, [eax + eax * 2]
|
||||
call esi
|
||||
mov [putimg.line_increment], eax
|
||||
|
||||
; winmap new line increment
|
||||
@ -183,7 +182,7 @@ vesa20_putimage:
|
||||
mov [putimg.screen_newline], eax
|
||||
|
||||
; pointer to image
|
||||
mov ecx, [putimg.pti]
|
||||
mov esi, [putimg.pti]
|
||||
|
||||
; pointer to screen
|
||||
mov edx, [putimg.abs_cy]
|
||||
@ -213,29 +212,32 @@ vesa20_putimage:
|
||||
mov edi, [putimg.real_sy]
|
||||
align 4
|
||||
.new_line:
|
||||
mov esi, [putimg.real_sx]
|
||||
mov ecx, [putimg.real_sx]
|
||||
|
||||
; push ebp edx
|
||||
align 4
|
||||
.new_x:
|
||||
|
||||
push [putimg.edi]
|
||||
mov eax, [putimg.ebp+4]
|
||||
call eax
|
||||
cmp [ebp], bl
|
||||
jne .skip
|
||||
mov eax, [ecx] ; ecx = RRBBGGRR
|
||||
; mov eax, [esi] ; eax = RRBBGGRR
|
||||
mov [edx], ax
|
||||
shr eax, 16
|
||||
mov [edx+2], al
|
||||
.skip:
|
||||
|
||||
add ecx, 3 ;[putimg.source_bpp]
|
||||
; add esi, 3 ;[putimg.source_bpp]
|
||||
add edx, 3
|
||||
inc ebp
|
||||
|
||||
dec esi
|
||||
dec ecx
|
||||
jnz .new_x
|
||||
; pop edx ebp
|
||||
|
||||
add ecx, [putimg.line_increment]
|
||||
add esi, [putimg.line_increment]
|
||||
add edx, [putimg.screen_newline] ;[BytesPerScanLine]
|
||||
add ebp, [putimg.winmap_newline] ;[ScreenWidth]
|
||||
;inc ebp
|
||||
@ -251,27 +253,30 @@ put_image_end_32:
|
||||
mov edi, [putimg.real_sy]
|
||||
align 4
|
||||
.new_line:
|
||||
mov esi, [putimg.real_sx]
|
||||
mov ecx, [putimg.real_sx]
|
||||
|
||||
; push ebp edx
|
||||
align 4
|
||||
.new_x:
|
||||
|
||||
push [putimg.edi]
|
||||
mov eax, [putimg.ebp+4]
|
||||
call eax
|
||||
cmp [ebp], bl
|
||||
jne .skip
|
||||
mov eax, [ecx] ; ecx = RRBBGGRR
|
||||
; mov eax, [esi] ; ecx = RRBBGGRR
|
||||
mov [edx], eax
|
||||
.skip:
|
||||
|
||||
add ecx, [putimg.source_bpp]
|
||||
; add esi, [putimg.source_bpp]
|
||||
add edx, 4
|
||||
inc ebp
|
||||
|
||||
dec esi
|
||||
dec ecx
|
||||
jnz .new_x
|
||||
; pop edx ebp
|
||||
|
||||
add ecx, [putimg.line_increment]
|
||||
add esi, [putimg.line_increment]
|
||||
add edx, [putimg.screen_newline] ;[BytesPerScanLine]
|
||||
add ebp, [putimg.winmap_newline] ;[ScreenWidth]
|
||||
;inc ebp
|
||||
|
@ -215,7 +215,7 @@ GenericBox:
|
||||
mov eax, esi
|
||||
pop esi
|
||||
sub eax, esi
|
||||
inc eax ; eax = äëèíà çàãîëîâêà + 2
|
||||
inc eax ; eax = ¤«¨ § £®«®¢ª + 2
|
||||
mov ecx, [ebx+dlgtemplate.width]
|
||||
cmp eax, ecx
|
||||
jbe .fullhea
|
||||
@ -236,9 +236,9 @@ GenericBox:
|
||||
mov ah, [ebx+dlgtemplate.header_color]
|
||||
mov al, ' '
|
||||
stosw
|
||||
dec ecx
|
||||
.2:
|
||||
jecxz .3
|
||||
dec ecx
|
||||
jz .3
|
||||
lodsb
|
||||
test al, al
|
||||
jz .4
|
||||
@ -404,6 +404,8 @@ GenericBox:
|
||||
call draw_keybar
|
||||
mov eax, ebp
|
||||
call mf_free
|
||||
or [cursor_x], -1
|
||||
or [cursor_y], -1
|
||||
call draw_image
|
||||
popad
|
||||
ret 8
|
||||
@ -955,11 +957,18 @@ virtual at 0
|
||||
dlgitemtemplate:
|
||||
; <EFBFBD>«¥¬¥âë:
|
||||
; 1 = áâ â¨ç¥áª¨© ⥪áâ
|
||||
; 2 = ª®¯ª
|
||||
; 3 = ¯®«¥ । ªâ¨à®¢ ¨ï
|
||||
.type dd ?
|
||||
.x1 dd ?
|
||||
.y1 dd ?
|
||||
.x2 dd ?
|
||||
.y2 dd ?
|
||||
; „ ë¥:
|
||||
; ¤«ï ⥪áâ : const char* data - ASCIIZ-áâப
|
||||
; ¤«ï ª®¯ª¨: const char* data - § £®«®¢®ª
|
||||
; ¤«ï । ªâ®à : struct {unsigned maxlength; unsigned pos; unsigned start;
|
||||
; char data[maxlength+1];}* data;
|
||||
.data dd ?
|
||||
.flags dd ?
|
||||
; ”« £¨:
|
||||
@ -967,6 +976,9 @@ dlgitemtemplate:
|
||||
; 1 = ¢ëà ¢¨¢ ¨¥ ¯® æ¥âàã
|
||||
; 2 = ¢ëà ¢¨¢ ¨¥ ¢¯à ¢®
|
||||
; 4 = í«¥¬¥â ¨¬¥¥â 䮪ãá ¢¢®¤
|
||||
; 8 = í«¥¬¥â ¬®¦¥â ¨¬¥âì 䮪ãá ¢¢®¤
|
||||
; 10h: ¤«ï ª®¯ª¨ = ª®¯ª ¯® 㬮«ç ¨î (Enter ¥-ª®¯ª¥)
|
||||
; ¤«ï ¯®«ï ¢¢®¤ = ¤ ë¥ ¡ë«¨ ¬®¤¨ä¨æ¨à®¢ ë
|
||||
.size = $
|
||||
end virtual
|
||||
; struct DLGDATA
|
||||
@ -1017,12 +1029,16 @@ ManagerDlgProc:
|
||||
jz .tab
|
||||
cmp al, 0x48
|
||||
jz .up
|
||||
cmp al, 0x50
|
||||
jz .down
|
||||
jecxz @f
|
||||
cmp [ebx+dlgitemtemplate.type], 3
|
||||
jz .key_edit
|
||||
@@:
|
||||
cmp al, 0x4B
|
||||
jz .left
|
||||
cmp al, 0x4D
|
||||
jz .right
|
||||
cmp al, 0x50
|
||||
jz .down
|
||||
.ret0:
|
||||
xor eax, eax
|
||||
ret 16
|
||||
@ -1030,8 +1046,22 @@ ManagerDlgProc:
|
||||
or eax, -1
|
||||
ret 16
|
||||
.enter:
|
||||
cmp [ebx+dlgitemtemplate.type], 2
|
||||
jnz @f
|
||||
.enter_found:
|
||||
mov eax, ebx
|
||||
ret 16
|
||||
@@:
|
||||
mov ebx, [esp+4]
|
||||
add ebx, dlgtemplate.size+12
|
||||
.enter_find:
|
||||
cmp [ebx+dlgitemtemplate.type], 2
|
||||
jnz @f
|
||||
test [ebx+dlgitemtemplate.flags], 0x10
|
||||
jnz .enter_found
|
||||
@@:
|
||||
add ebx, dlgitemtemplate.size
|
||||
jmp .enter_find
|
||||
.tab:
|
||||
test [ctrlstate], 3
|
||||
jnz .shift_tab
|
||||
@ -1043,19 +1073,20 @@ ManagerDlgProc:
|
||||
jz .find_first_btn
|
||||
@@:
|
||||
add ebx, dlgitemtemplate.size
|
||||
cmp [ebx+dlgitemtemplate.type], 2
|
||||
jz .btn_found
|
||||
test [ebx+dlgitemtemplate.flags], 8
|
||||
jnz .btn_found
|
||||
loop @b
|
||||
.find_first_btn:
|
||||
mov ebx, [esp+4]
|
||||
add ebx, dlgtemplate.size+12
|
||||
@@:
|
||||
cmp [ebx+dlgitemtemplate.type], 2
|
||||
jz .btn_found
|
||||
test [ebx+dlgitemtemplate.flags], 8
|
||||
jnz .btn_found
|
||||
add ebx, dlgitemtemplate.size
|
||||
jmp @b
|
||||
.btn_found:
|
||||
or byte [ebx+dlgitemtemplate.flags], 4
|
||||
.ret_draw:
|
||||
mov ebx, [esp+4]
|
||||
call .dodraw
|
||||
call draw_image
|
||||
@ -1072,20 +1103,135 @@ ManagerDlgProc:
|
||||
jz .find_last_btn
|
||||
@@:
|
||||
sub ebx, dlgitemtemplate.size
|
||||
cmp [ebx+dlgitemtemplate.type], 2
|
||||
loopnz @b
|
||||
jz .btn_found
|
||||
test [ebx+dlgitemtemplate.flags], 8
|
||||
loopz @b
|
||||
jnz .btn_found
|
||||
.find_last_btn:
|
||||
mov ebx, [eax+dlgtemplate.size+8]
|
||||
imul ebx, dlgitemtemplate.size
|
||||
lea ebx, [ebx+eax+dlgtemplate.size+12]
|
||||
@@:
|
||||
sub ebx, dlgitemtemplate.size
|
||||
cmp [ebx+dlgitemtemplate.type], 2
|
||||
jnz @b
|
||||
test [ebx+dlgitemtemplate.flags], 8
|
||||
jz @b
|
||||
jmp .btn_found
|
||||
.key_edit:
|
||||
; ®¡à ¡®âª ª« ¢¨è ¢ ¯®«¥ ¢¢®¤
|
||||
test al, 0x80
|
||||
jnz .ret0
|
||||
or [ebx+dlgitemtemplate.flags], 0x10
|
||||
mov edx, [ebx+dlgitemtemplate.data]
|
||||
cmp al, 0x4B
|
||||
jz .editor_left
|
||||
cmp al, 0x4D
|
||||
jz .editor_right
|
||||
cmp al, 0x47
|
||||
jz .editor_home
|
||||
cmp al, 0x4F
|
||||
jz .editor_end
|
||||
cmp al, 0x0E
|
||||
jz .editor_backspace
|
||||
cmp al, 0x53
|
||||
jz .editor_del
|
||||
test [ctrlstate], 0x3C
|
||||
jnz .ret_draw
|
||||
; query keyboard layout
|
||||
pushad
|
||||
push 26
|
||||
pop eax
|
||||
push 2
|
||||
pop ebx
|
||||
xor ecx, ecx
|
||||
cmp [ctrlstate], 1
|
||||
sbb ecx, -2
|
||||
mov edx, layout
|
||||
int 0x40
|
||||
popad
|
||||
; translate scancode to ASCII
|
||||
movzx eax, al
|
||||
movzx eax, byte [layout+eax]
|
||||
push eax
|
||||
; insert entered symbol
|
||||
xor eax, eax
|
||||
lea edi, [edx+12]
|
||||
or ecx, -1
|
||||
repnz scasb
|
||||
not ecx
|
||||
pop eax
|
||||
cmp ecx, [edx]
|
||||
ja .ret_test ; buffer capacity exceeded
|
||||
lea edi, [edx+ecx+12-1]
|
||||
mov esi, [edx+4]
|
||||
lea esi, [edx+esi+12]
|
||||
@@:
|
||||
mov cl, [edi]
|
||||
mov [edi+1], cl
|
||||
dec edi
|
||||
cmp edi, esi
|
||||
jae @b
|
||||
mov [esi], al
|
||||
inc dword [edx+4]
|
||||
@@: jmp .ret_test
|
||||
.editor_left:
|
||||
mov ecx, [edx+4]
|
||||
jecxz @f
|
||||
dec dword [edx+4]
|
||||
@@: jmp .ret_test
|
||||
.editor_right:
|
||||
mov ecx, [edx+4]
|
||||
cmp byte [edx+ecx+12], 0
|
||||
jz @b
|
||||
inc dword [edx+4]
|
||||
jmp @b
|
||||
.editor_home:
|
||||
and dword [edx+4], 0
|
||||
jmp @b
|
||||
.editor_end:
|
||||
lea edi, [edx+12]
|
||||
xor eax, eax
|
||||
or ecx, -1
|
||||
repnz scasb
|
||||
not ecx
|
||||
dec ecx
|
||||
mov [edx+4], ecx
|
||||
.ret_test:
|
||||
mov eax, [edx+4]
|
||||
cmp [edx+8], eax
|
||||
jl .ret_test.l1
|
||||
mov [edx+8], eax
|
||||
jmp .ret_test.l2
|
||||
.ret_test.l1:
|
||||
add eax, [ebx+dlgitemtemplate.x1]
|
||||
sub eax, [ebx+dlgitemtemplate.x2]
|
||||
cmp [edx+8], eax
|
||||
jge .ret_test.l2
|
||||
mov [edx+8], eax
|
||||
.ret_test.l2:
|
||||
jmp .ret_draw
|
||||
.editor_backspace:
|
||||
mov ecx, [edx+4]
|
||||
jecxz .ret_test
|
||||
dec dword [edx+4]
|
||||
lea esi, [edx+ecx+12]
|
||||
lea edi, [esi-1]
|
||||
.copy_and_ret_test:
|
||||
@@:
|
||||
lodsb
|
||||
stosb
|
||||
test al, al
|
||||
jnz @b
|
||||
jmp .ret_test
|
||||
.editor_del:
|
||||
mov ecx, [edx+4]
|
||||
lea edi, [ecx+edx+12]
|
||||
lea esi, [edi+1]
|
||||
cmp byte [edi], 0
|
||||
jz .ret_test
|
||||
jmp .copy_and_ret_test
|
||||
|
||||
.dodraw:
|
||||
or [cursor_x], -1
|
||||
or [cursor_y], -1
|
||||
add ebx, dlgtemplate.size+8
|
||||
mov ecx, [ebx]
|
||||
add ebx, 4
|
||||
@ -1096,7 +1242,12 @@ ManagerDlgProc:
|
||||
dec eax
|
||||
jz .draw_text
|
||||
dec eax
|
||||
jz .draw_button
|
||||
dec eax
|
||||
jnz .draw_loop_continue
|
||||
call draw_editbox
|
||||
jmp .draw_loop_continue
|
||||
.draw_button:
|
||||
call draw_button
|
||||
jmp .draw_loop_continue
|
||||
.draw_text:
|
||||
@ -1114,6 +1265,7 @@ draw_static_text:
|
||||
draw_text:
|
||||
; ®¯à¥¤¥«ï¥¬ ¤«¨ã áâப¨
|
||||
mov esi, [ebx+dlgitemtemplate.data]
|
||||
draw_text_esi:
|
||||
test esi, esi
|
||||
jz .ret
|
||||
or ecx, -1
|
||||
@ -1163,6 +1315,11 @@ draw_text:
|
||||
pop ecx
|
||||
cmp ecx, edx
|
||||
jbe .text_copy
|
||||
cmp [ebx+dlgitemtemplate.type], 3
|
||||
jnz @f
|
||||
mov ecx, edx
|
||||
jmp .text_copy
|
||||
@@:
|
||||
cmp edx, 3
|
||||
jb .ret
|
||||
mov al, '.'
|
||||
@ -1203,3 +1360,27 @@ draw_button:
|
||||
mov ah, [dialog_selected_btn_color]
|
||||
@@:
|
||||
jmp draw_text
|
||||
|
||||
draw_editbox:
|
||||
mov edx, [ebx+dlgitemtemplate.data]
|
||||
test [ebx+dlgitemtemplate.flags], 4
|
||||
jz @f
|
||||
mov eax, [ebx+dlgitemtemplate.x1]
|
||||
add eax, [edx+4]
|
||||
sub eax, [edx+8]
|
||||
mov ecx, [esp+16]
|
||||
add eax, [ecx+dlgtemplate.x]
|
||||
mov [cursor_x], eax
|
||||
mov eax, [ebx+dlgitemtemplate.y1]
|
||||
add eax, [ecx+dlgtemplate.y]
|
||||
mov [cursor_y], eax
|
||||
@@:
|
||||
mov ah, [dialog_edit_color]
|
||||
test [ebx+dlgitemtemplate.flags], 10h
|
||||
jnz @f
|
||||
mov ah, [dialog_unmodified_edit_color]
|
||||
@@:
|
||||
mov esi, [ebx+dlgitemtemplate.data]
|
||||
add esi, [edx+8]
|
||||
add esi, 12
|
||||
jmp draw_text_esi
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user