mirror of https://github.com/nmlgc/ReC98.git
[Decompilation] [th05] Line sets: Copying lines up by 1 element
Which can't be a class method, but only because CX and DX would be swapped then… yup. Part of P0110, funded by [Anonymous] and Blue Bolt.
This commit is contained in:
parent
2ef3db3052
commit
9e06c45656
|
@ -60,3 +60,13 @@ void pascal near grcg_lineset_line_put(lineset_t near &set, int i)
|
|||
|
||||
grcg_line(x1, y1, x2, y2);
|
||||
}
|
||||
|
||||
// Copies lines [0; 17] to lines [1..18].
|
||||
void pascal near lineset_forward_copy(lineset_t near &set)
|
||||
{
|
||||
for(int i = (LINESET_LINE_COUNT - 2); i > 0; i--) {
|
||||
set.center[i] = set.center[i - 1];
|
||||
set.angle[i] = set.angle[i - 1];
|
||||
set.radius[i].v = set.radius[i - 1].v;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4029,60 +4029,12 @@ sub_D3C6 endp
|
|||
|
||||
GRCG_LINESET_LINE_PUT procdesc pascal near \
|
||||
set:near ptr, i:word
|
||||
LINESET_FORWARD_COPY procdesc pascal near \
|
||||
set:near ptr
|
||||
main__TEXT ends
|
||||
|
||||
main_0_TEXT segment word public 'CODE' use16
|
||||
|
||||
; =============== S U B R O U T I N E =======================================
|
||||
|
||||
; Attributes: bp-based frame
|
||||
|
||||
sub_D598 proc near
|
||||
|
||||
@@set = word ptr 4
|
||||
|
||||
push bp
|
||||
mov bp, sp
|
||||
mov cx, [bp+@@set]
|
||||
mov dx, (LINESET_LINE_COUNT - 2)
|
||||
jmp short loc_D5DA
|
||||
; ---------------------------------------------------------------------------
|
||||
|
||||
loc_D5A3:
|
||||
mov bx, dx
|
||||
dec bx
|
||||
shl bx, 2
|
||||
add bx, cx
|
||||
mov eax, dword ptr [bx+lineset_t.LS_center]
|
||||
mov bx, dx
|
||||
shl bx, 2
|
||||
add bx, cx
|
||||
mov dword ptr [bx+lineset_t.LS_center], eax
|
||||
mov bx, cx
|
||||
add bx, dx
|
||||
mov al, [bx+(lineset_t.LS_angle - 1)]
|
||||
mov bx, cx
|
||||
add bx, dx
|
||||
mov [bx+(lineset_t.LS_angle - 0)], al
|
||||
mov bx, dx
|
||||
dec bx
|
||||
add bx, bx
|
||||
add bx, cx
|
||||
mov ax, [bx+lineset_t.LS_radius]
|
||||
mov bx, dx
|
||||
add bx, bx
|
||||
add bx, cx
|
||||
mov [bx+lineset_t.LS_radius], ax
|
||||
dec dx
|
||||
|
||||
loc_D5DA:
|
||||
or dx, dx
|
||||
jg short loc_D5A3
|
||||
pop bp
|
||||
retn 2
|
||||
sub_D598 endp
|
||||
|
||||
|
||||
; =============== S U B R O U T I N E =======================================
|
||||
|
||||
; Attributes: bp-based frame
|
||||
|
@ -4099,8 +4051,7 @@ sub_D5E2 proc near
|
|||
; ---------------------------------------------------------------------------
|
||||
|
||||
loc_D5F1:
|
||||
push si
|
||||
call sub_D598
|
||||
call lineset_forward_copy pascal, si
|
||||
add [si+lineset_t.LS_radius], (4 shl 4)
|
||||
push si
|
||||
push ((192 shl 4) shl 16) or (184 shl 4)
|
||||
|
@ -4285,8 +4236,7 @@ var_2 = word ptr -2
|
|||
; ---------------------------------------------------------------------------
|
||||
|
||||
loc_D789:
|
||||
push si
|
||||
call sub_D598
|
||||
call lineset_forward_copy pascal, si
|
||||
mov ax, [si+lineset_t.LS_velocity_y]
|
||||
add [si+lineset_t.LS_center.y], ax
|
||||
cmp [si+lineset_t.LS_velocity_y], (-14 shl 4)
|
||||
|
@ -4469,8 +4419,7 @@ var_2 = word ptr -2
|
|||
; ---------------------------------------------------------------------------
|
||||
|
||||
loc_D8EE:
|
||||
push si
|
||||
call sub_D598
|
||||
call lineset_forward_copy pascal, si
|
||||
mov ax, [si+lineset_t.LS_velocity_y]
|
||||
add [si+lineset_t.LS_center.y], ax
|
||||
cmp [si+lineset_t.LS_velocity_y], (14 shl 4)
|
||||
|
|
Loading…
Reference in New Issue