Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void CreatePipe() {
- time_t t;
- ushort _Image = (ushort)(CurPipe.Image + sizeof(TxtGFX));
- int _Size = CurPipe.Image->Size >> 1;
- int _Height = (rand() % 12) + 2;
- extern void DrawPipe_ASM(void);
- #pragma aux DrawPipe_ASM = \
- "mov di, [_Image]" \
- "mov ax, [_Height]" \
- "mov cx, [_Size]" \
- "mov bx, 0ADBh" \
- "mov dx, 0B1B1h" \
- \
- "DrawRow:" \
- "mov [di], dx" \
- "mov [di+2], bx" \
- "mov [di+4], bx" \
- "mov [di+6], dx" \
- "add di, 8" \
- "sub cx, 4" \
- "jz End" \
- "dec ax" \
- "jz HitHeight" \
- "jmp DrawRow" \
- \
- "HitHeight:" \
- "mov [di], bx" \
- "mov [di+2], bx" \
- "mov [di+4], bx" \
- "mov [di+6], bx" \
- "add di, 8" \
- "mov si, 3" \
- "DrawGap:" \
- "mov [di], dx" \
- "mov [di+2], dx" \
- "mov [di+4], dx" \
- "mov [di+6], dx" \
- "add di, 8" \
- "dec si" \
- "jnz DrawGap" \
- "mov [di], bx" \
- "mov [di+2], bx" \
- "mov [di+4], bx" \
- "mov [di+6], bx" \
- "add di, 8" \
- "sub cx, 20" \
- "mov ax, 0xFF" \
- "jmp DrawRow" \
- \
- "End:" \
- modify [ax bx cx dx si di];
- //printf("%ld\n", time(&t));
- DrawPipe_ASM();
- //printf("%ld\n", time(&t));
- CurPipe.Height = _Height;
- PutGFX(30, 1, CurPipe.Image);
- UpdateScreen();
- return;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement