SHOW:
|
|
- or go back to the newest paste.
| 1 | seg000:E8AB draw_sprite_whiteflash proc near ; CODE XREF: draw_sprite_list+AEp | |
| 2 | seg000:E8AB ; DATA XREF: draw_sprite_list:loc_E462o | |
| 3 | seg000:E8AB | |
| 4 | seg000:E8AB ; FUNCTION CHUNK AT seg000:E8A8 SIZE 00000003 BYTES | |
| 5 | seg000:E8AB ; FUNCTION CHUNK AT seg000:EBE4 SIZE 00000137 BYTES | |
| 6 | seg000:E8AB | |
| 7 | seg000:E8AB mov dx, 3CEh | |
| 8 | seg000:E8AE mov ax, 1003h ; Set Logical OP of Data Rotate Reg. to OR | |
| 9 | seg000:E8B1 out dx, ax ; EGA: graph 1 and 2 addr reg: | |
| 10 | seg000:E8B1 ; unknown register | |
| 11 | seg000:E8B2 mov dx, bx ; dx = starting byte in scanline | |
| 12 | seg000:E8B4 sar dx, 1 | |
| 13 | seg000:E8B6 sar dx, 1 | |
| 14 | seg000:E8B8 sar dx, 1 | |
| 15 | seg000:E8BA mov ax, es:word_0 ; al = Flags, ah = sprite height (this is used later!!) | |
| 16 | seg000:E8BE test al, 40h | |
| 17 | seg000:E8C0 jnz short loc_E8A8 | |
| 18 | seg000:E8C2 shl di, 1 ; Non-0x40 sprite | |
| 19 | seg000:E8C2 ; Set si to the proper shift | |
| 20 | seg000:E8C4 add dx, ylookup[di] ; dx = offset from VGA start address | |
| 21 | seg000:E8C8 cmp al, 1 | |
| 22 | seg000:E8CA jbe short loc_E922 | |
| 23 | seg000:E8CC cmp al, 2 | |
| 24 | seg000:E8CE jz short loc_E916 | |
| 25 | seg000:E8D0 cmp al, 4 | |
| 26 | seg000:E8D2 jz short loc_E91D | |
| 27 | seg000:E8D4 and bx, 7 ; flags & 0x8 -> eight shifts (pixel smoothness) | |
| 28 | seg000:E8D7 shl bx, 1 | |
| 29 | seg000:E8D9 | |
| 30 | seg000:E8D9 loc_E8D9: ; CODE XREF: draw_sprite_whiteflash+70j | |
| 31 | seg000:E8D9 ; draw_sprite_whiteflash+75j | |
| 32 | seg000:E8D9 mov si, es:[bx+(size sprite)] ; for 2, 4, or 8 shifts, going the source planes | |
| 33 | seg000:E8D9 ; are arranged in order of shift amount | |
| 34 | seg000:E8DD mov cl, 0 | |
| 35 | ||
| 36 | ||
| 37 | seg000:E8DF do_planeBits: ; CODE XREF: draw_sprite_whiteflash+8Fj | |
| 38 | seg000:E8DF lods byte ptr es:[si] ; get the first byte of the plane (i.e., the planeBits), which | |
| 39 | seg000:E8DF ; determines to which planes data should be written | |
| 40 | seg000:E8E1 xchg ax, bx ; bl = planeBits; bh = sprite height (from function start) | |
| 41 | seg000:E8E1 ; al = Bytes per plane, if it's bit-1 image | |
| 42 | seg000:E8E2 lds di, page_1_address | |
| 43 | seg000:E8E6 add di, dx ; di = offset from start addres | |
| 44 | seg000:E8E8 mov word ptr [bp+sprite_drawstruct.planeBits], bx | |
| 45 | seg000:E8EB add dx, ss:page_2_offset | |
| 46 | seg000:E8F0 mov [bp+sprite_drawstruct.page2_offset], dx | |
| 47 | seg000:E8F3 mov [bp+sprite_drawstruct.page1_offset], di | |
| 48 | seg000:E8F6 mov ch, bh | |
| 49 | seg000:E8F8 mov dl, ch ; dl = ch = sprite height | |
| 50 | seg000:E8FA xor dh, dh | |
| 51 | seg000:E8FC xor bh, bh | |
| 52 | seg000:E8FE shl bx, 1 ; Jump to plane-bit dependent drawing code | |
| 53 | seg000:E900 and cl, 7 ; cl = left edge of sprite x-coord MOD 8 | |
| 54 | seg000:E903 jz short draw_left_aligned | |
| 55 | seg000:E905 | |
| 56 | seg000:E905 draw_non_left_aligned: ; draw sprite where dest is | |
| 57 | seg000:E905 mov [bp+sprite_drawstruct.planeBits], al ; not aligned on a byte boundary | |
| 58 | seg000:E908 mov bp, di | |
| 59 | seg000:E90A jmp word ptr cs:off_E888[bx-2] | |
| 60 | seg000:E90F ; --------------------------------------------------------------------------- | |
| 61 | seg000:E90F | |
| 62 | seg000:E90F draw_left_aligned: ; CODE XREF: draw_sprite_whiteflash+58j | |
| 63 | seg000:E90F mov bp, di ; draw sprite whose dest is aligned | |
| 64 | seg000:E90F ; on a left boundary | |
| 65 | seg000:E90F ; This includes shifted sprites | |
| 66 | seg000:E911 jmp cs:off_E896[bx] | |
| 67 | seg000:E916 ; --------------------------------------------------------------------------- | |
| 68 | seg000:E916 |