18,7 → 18,7 |
dd 0x0 , 0x0 ; I_Param , I_Path |
|
include 'lang.inc' |
include 'macros.inc' |
include '..\..\..\macros.inc' |
|
delay dd 145 |
wait_for dd 0x0 |
28,12 → 28,13 |
mov dword [prompt], p9 |
mov dword [promptlen], p9len - p9 |
|
red: |
call draw_window ; at first, draw the window |
|
still: |
|
mov eax,10 ; wait here for event |
int 0x40 |
mcall |
|
cmp eax,1 ; redraw request ? |
jz red |
43,19 → 44,14 |
jz button |
|
jmp still |
|
red: ; redraw |
call draw_window |
jmp still |
|
key: ; Keys are not valid at this part of the |
mov eax,2 ; loop. Just read it and ignore |
int 0x40 |
mcall |
jmp still |
|
button: ; button |
mov eax,17 ; get id |
int 0x40 |
mcall |
|
cmp ah,1 ; button id=1 ? |
jnz noclose |
65,13 → 61,13 |
mov eax, 53 |
mov ebx, 1 |
mov ecx, [socketNum] |
int 0x40 |
mcall |
|
mov [socketNum], dword 0 |
|
|
mov eax,0xffffffff ; close this program |
int 0x40 |
or eax,-1 ; close this program |
mcall |
|
noclose: |
cmp ah,2 ; copy file to local machine? |
119,13 → 115,13 |
|
f11: |
mov eax,10 |
int 0x40 |
mcall |
cmp eax,2 |
jz fbu |
jmp still |
fbu: |
mov eax,2 |
int 0x40 ; get key |
mcall ; get key |
shr eax,8 |
cmp eax,8 |
jnz nobs |
162,7 → 158,7 |
shl ecx,16 |
mov cx,8 |
mov edx,0x224466 |
int 0x40 |
mcall |
|
mov eax,4 |
mov ebx,103*65536 |
170,7 → 166,7 |
mov ecx,0xffffff |
mov edx,[addr] |
mov esi,15 |
int 0x40 |
mcall |
|
ret |
|
309,7 → 305,7 |
|
; Get a random # for the local socket port # |
mov eax, 3 |
int 0x40 |
mcall |
mov ecx, eax |
shr ecx, 8 ; Set up the local port # with a random # |
|
318,7 → 314,7 |
mov ebx, 0 |
mov edx, 69 ; remote port |
mov esi, [tftp_IP] ; remote IP ( in intenet format ) |
int 0x40 |
mcall |
|
mov [socketNum], eax |
|
328,12 → 324,12 |
mov eax, 53 |
mov ebx, 3 |
mov ecx, [socketNum] |
int 0x40 ; read byte |
mcall ; read byte |
|
mov eax, 53 |
mov ebx, 2 |
mov ecx, [socketNum] |
int 0x40 ; any more data? |
mcall ; any more data? |
|
cmp eax, 0 |
jne cfr001 ; yes, so get it |
344,13 → 340,13 |
mov ecx, [socketNum] |
mov edx, [tftp_len] |
mov esi, tftp_filename |
int 0x40 |
mcall |
|
cfr002: |
|
mov eax,23 ; wait here for event |
mov ebx,1 ; Time out after 10ms |
int 0x40 |
mcall |
|
cmp eax,1 ; redraw request ? |
je cfr003 |
363,7 → 359,7 |
mov eax, 53 |
mov ebx, 2 |
mov ecx, [socketNum] |
int 0x40 |
mcall |
|
cmp eax, 0 |
je cfr002 |
385,12 → 381,12 |
mov eax, 53 |
mov ebx, 3 |
mov ecx, [socketNum] |
int 0x40 ; read byte |
mcall ; read byte |
|
mov eax, 53 |
mov ebx, 3 |
mov ecx, [socketNum] |
int 0x40 ; read byte |
mcall ; read byte |
|
pop eax |
; bl holds tftp opcode. Can only be 3 (data) or 5 ( error ) |
404,7 → 400,7 |
mov eax, 53 |
mov ebx, 3 |
mov ecx, [socketNum] |
int 0x40 ; read byte |
mcall ; read byte |
|
mov [blockNumber], bl |
|
411,7 → 407,7 |
mov eax, 53 |
mov ebx, 3 |
mov ecx, [socketNum] |
int 0x40 ; read byte |
mcall ; read byte |
|
mov [blockNumber+1], bl |
|
419,7 → 415,7 |
mov eax, 53 |
mov ebx, 3 |
mov ecx, [socketNum] |
int 0x40 ; read byte |
mcall ; read byte |
|
mov esi, [fileposition] |
mov [esi], bl |
429,7 → 425,7 |
mov eax, 53 |
mov ebx, 2 |
mov ecx, [socketNum] |
int 0x40 ; any more data? |
mcall ; any more data? |
|
cmp eax, 0 |
jne cfr007 ; yes, so get it |
442,11 → 438,11 |
mov eax,5 ; wait for correct timer position |
; to trigger new play block |
mov ebx,1 |
int 0x40 |
mcall |
|
mov eax,26 |
mov ebx,9 |
int 0x40 |
mcall |
|
cmp eax,[wait_for] |
jb wait_more |
463,11 → 459,11 |
mov eax,55 |
mov ebx,0 |
mov ecx,0x10000 |
int 0x40 |
mcall |
|
mov eax,55 |
mov ebx,1 |
int 0x40 |
mcall |
|
mov [fileposition],0x20000 |
|
486,7 → 482,7 |
mov ecx, [socketNum] |
mov edx, ackLen - ack |
mov esi, ack |
int 0x40 |
mcall |
|
; If # of chars in the frame is less that 516, |
; this frame is the last |
500,7 → 496,7 |
mov edx, [filesize] |
mov ecx, I_END + 512 |
mov esi, 0 |
int 0x40 |
mcall |
|
jmp cfrexit |
|
509,12 → 505,12 |
mov eax, 53 |
mov ebx, 3 |
mov ecx, [socketNum] |
int 0x40 ; read byte |
mcall ; read byte |
|
mov eax, 53 |
mov ebx, 2 |
mov ecx, [socketNum] |
int 0x40 ; any more data? |
mcall ; any more data? |
|
cmp eax, 0 |
jne cfrerr ; yes, so get it |
527,12 → 523,12 |
|
cfr004: ; key pressed |
mov eax,2 ; just read it and ignore |
int 0x40 |
mcall |
jmp cfr002 |
|
cfr005: ; button |
mov eax,17 ; get id |
int 0x40 |
mcall |
|
cmp ah,1 ; button id=1 ? |
jne cfr002 ; If not, ignore. |
542,12 → 538,12 |
mov eax, 53 |
mov ebx, 1 |
mov ecx, [socketNum] |
int 0x40 |
mcall |
|
mov [socketNum], dword 0 |
|
mov eax,-1 ; close this program |
int 0x40 |
mcall |
|
jmp $ |
|
556,7 → 552,7 |
mov eax, 53 |
mov ebx, 1 |
mov ecx, [socketNum] |
int 0x40 |
mcall |
|
mov [socketNum], dword 0 |
|
578,7 → 574,7 |
|
mov eax,12 ; function 12:tell os about windowdraw |
mov ebx,1 ; 1, start of draw |
int 0x40 |
mcall |
|
; DRAW WINDOW |
mov eax,0 ; function 0 : define and draw window |
585,37 → 581,24 |
mov ebx,100*65536+230 ; [x start] *65536 + [x size] |
mov ecx,100*65536+170 ; [y start] *65536 + [y size] |
mov edx,0x13224466 ; color of work area RRGGBB |
mov edi,labelt |
int 0x40 |
mov edi,title |
mcall |
|
|
mov eax,8 ; COPY BUTTON |
mov ebx,20*65536+190 |
mov ecx,79*65536+15 |
mov edx,3 |
mov esi,0x557799 |
; int 0x40 |
|
mov eax,8 ; DELETE BUTTON |
mov ebx,20*65536+190 |
mov ecx,111*65536+15 |
mov edx,2 |
mov esi,0x557799 |
int 0x40 |
mcall |
|
mov eax,8 |
mov ebx,200*65536+10 |
mov ecx,34*65536+10 |
mov edx,4 |
mov esi,0x557799 |
int 0x40 |
mcall |
|
mov eax,8 |
mov ebx,200*65536+10 |
mov ecx,50*65536+10 |
mov edx,5 |
mov esi,0x557799 |
int 0x40 |
mcall |
|
|
; Copy the file name to the screen buffer |
642,13 → 625,13 |
|
; Re-draw the screen text |
cld |
mov eax,4 |
mov ebx,25*65536+35 ; draw info text with function 4 |
mov ecx,0xffffff |
mov edx,text |
mov esi,40 |
newline: |
mov eax,4 |
int 0x40 |
mcall |
add ebx,16 |
add edx,40 |
cmp [edx],byte 'x' |
657,7 → 640,7 |
|
mov eax,12 ; function 12:tell os about windowdraw |
mov ebx,2 ; 2, end of draw |
int 0x40 |
mcall |
|
ret |
|
691,7 → 674,7 |
db 'x' ; <- END MARKER, DONT DELETE |
|
|
labelt db 'TFTP Wave Player',0 |
title db 'TFTP Wave Player',0 |
|
prompt: dd 0 |
promptlen: dd 0 |