Skip to content

Commit

Permalink
queue chunk could now support 0.6 but actually i have no idea
Browse files Browse the repository at this point in the history
  • Loading branch information
ChillerDragon committed Dec 17, 2024
1 parent 2c7b288 commit cdb0f3c
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/queue_chunk.asm
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,25 @@ queue_chunk:
; rsi = payload size
; rdx = msg id
; r10 = system (CHUNK_SYSTEM or CHUNK_GAME)
; supports both 0.6 and 0.7

; resend flag is not supported yet

push_registers

; r8 is packet header len depending on connection version
; do not overwrite this anywhere in this function!
mov r8d, PACKET_HEADER_LEN

push rax
mov al, byte [connection_version]
cmp al, 7
je .version7
mov r8d, PACKET6_HEADER_LEN
.version7:
._: ; clear label for debugger
pop rax

; increment num chunks
push rax
mov byte al, [out_packet_header_num_chunks]
Expand Down Expand Up @@ -51,7 +65,7 @@ queue_chunk:

; set output buffer
mov dword r11d, [udp_payload_index]
lea rsi, [udp_send_buf + PACKET_HEADER_LEN + r11d]
lea rsi, [udp_send_buf + r8d + r11d]

; flags are already in rax
call pack_chunk_header
Expand Down Expand Up @@ -82,7 +96,7 @@ queue_chunk:
; destination buffer
mov r11, 0
mov dword r11d, [udp_payload_index]
lea rax, [udp_send_buf + PACKET_HEADER_LEN + r11d]
lea rax, [udp_send_buf + r8d + r11d]

; source buffer is already in rdi
; size is already in rsi
Expand Down

0 comments on commit cdb0f3c

Please sign in to comment.