2 * Written by Nick Kovac with minor changes by Claudio Matsuoka
7 static uint16_t selfmod[5][84];
10 #define PSINI_OFFSET 0
11 #define LSINI4_OFFSET 16384
12 #define LSINI16_OFFSET (16384 + 2 * 8192)
15 int plzline(int y, int vseg)
17 // vseg represented a segment, so multiply by sixteen (shift left by 4)
18 // to convert into an offset.
19 int nVgaYOffset = vseg << 4;
22 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12, 19, 18,
23 17, 16, 23, 22, 21, 20, 27, 26, 25, 24, 31, 30, 29, 28, 35,
24 34, 33, 32, 39, 38, 37, 36, 43, 42, 41, 40, 47, 46, 45, 44,
25 51, 50, 49, 48, 55, 54, 53, 52, 59, 58, 57, 56, 63, 62, 61,
26 60, 67, 66, 65, 64, 71, 70, 69, 68, 75, 74, 73, 72, 79, 78,
27 77, 76, 83, 82, 81, 80
34 for (i = 0; i < 84; i++) {
35 int ccc = cccTable[i];
41 offs = (y * 2) + selfmod[2][ccc];
42 bx = *(short *)&psini[offs];
45 offs = bx + selfmod[1][ccc];
49 offs = (y * 2) + selfmod[4][ccc];
50 bx = *(short *)&psini[offs];
53 offs = bx + (y * 2) + selfmod[3][ccc];
56 offs = (y * 2) + selfmod[2][ccc];
57 bx = *(short *)&psini[offs];
59 offs = bx + selfmod[1][ccc];
62 offs = (y * 2) + selfmod[4][ccc];
63 bx = *(short *)&psini[offs];
65 offs = bx + (y * 2) + selfmod[3][ccc];
75 eax |= (ah << 8) | al;
76 // vga_write32(nVgaYOffset + ccc, eax);
86 int setplzparas(int c1, int c2, int c3, int c4)
90 for (ccc = 0; ccc < 84; ccc++) {
91 uint16_t lc1, lc2, lc3, lc4;
93 lc1 = c1 + PSINI_OFFSET + (ccc * 8);
94 selfmod[1][ccc] = lc1;
96 lc2 = (c2 * 2) + LSINI16_OFFSET - (ccc * 8) + (80 * 8);
97 selfmod[2][ccc] = lc2;
99 lc3 = c3 + PSINI_OFFSET - (ccc * 4) + (80 * 4);
100 selfmod[3][ccc] = lc3;
102 lc4 = (c4 * 2) + LSINI4_OFFSET + (ccc * 32);
103 selfmod[4][ccc] = lc4;
109 word set_plzstart(word start)
113 mov al, 18h ; linecompare
114 mov ah, [Byte PTR start]
117 mov ah, [Byte PTR start+1]