|
|
1.1 root 1: /*
2: Hatari - macros.h
3:
4: Lookup tables and macros for screen conversion routines.
5:
6: This file is distributed under the GNU Public License, version 2 or at your
7: option any later version. Read the file gpl.txt for details.
8: */
9:
10: #ifndef HATARI_CONVERTMACROS_H
11: #define HATARI_CONVERTMACROS_H
12:
13: /* For palette we don't go from colour '0' as the whole background
14: * would change, so go from this value
15: */
16: #define BASECOLOUR 0x0A
17: #define BASECOLOUR_LONG 0x0A0A0A0A
18:
19: /* Remap tables to convert from plane format to byte-per-pixel
20: * (Upper is for 4-Planes so if shifted by 2)
21: */
1.1.1.2 root 22: static const Uint32 Remap_2_Planes[256] = {
1.1 root 23: 0x00000000, 0x01000000, 0x00010000, 0x01010000, 0x00000100, 0x01000100, 0x00010100, 0x01010100,
24: 0x00000001, 0x01000001, 0x00010001, 0x01010001, 0x00000101, 0x01000101, 0x00010101, 0x01010101,
25: 0x02000000, 0x03000000, 0x02010000, 0x03010000, 0x02000100, 0x03000100, 0x02010100, 0x03010100,
26: 0x02000001, 0x03000001, 0x02010001, 0x03010001, 0x02000101, 0x03000101, 0x02010101, 0x03010101,
27: 0x00020000, 0x01020000, 0x00030000, 0x01030000, 0x00020100, 0x01020100, 0x00030100, 0x01030100,
28: 0x00020001, 0x01020001, 0x00030001, 0x01030001, 0x00020101, 0x01020101, 0x00030101, 0x01030101,
29: 0x02020000, 0x03020000, 0x02030000, 0x03030000, 0x02020100, 0x03020100, 0x02030100, 0x03030100,
30: 0x02020001, 0x03020001, 0x02030001, 0x03030001, 0x02020101, 0x03020101, 0x02030101, 0x03030101,
31: 0x00000200, 0x01000200, 0x00010200, 0x01010200, 0x00000300, 0x01000300, 0x00010300, 0x01010300,
32: 0x00000201, 0x01000201, 0x00010201, 0x01010201, 0x00000301, 0x01000301, 0x00010301, 0x01010301,
33: 0x02000200, 0x03000200, 0x02010200, 0x03010200, 0x02000300, 0x03000300, 0x02010300, 0x03010300,
34: 0x02000201, 0x03000201, 0x02010201, 0x03010201, 0x02000301, 0x03000301, 0x02010301, 0x03010301,
35: 0x00020200, 0x01020200, 0x00030200, 0x01030200, 0x00020300, 0x01020300, 0x00030300, 0x01030300,
36: 0x00020201, 0x01020201, 0x00030201, 0x01030201, 0x00020301, 0x01020301, 0x00030301, 0x01030301,
37: 0x02020200, 0x03020200, 0x02030200, 0x03030200, 0x02020300, 0x03020300, 0x02030300, 0x03030300,
38: 0x02020201, 0x03020201, 0x02030201, 0x03030201, 0x02020301, 0x03020301, 0x02030301, 0x03030301,
39: 0x00000002, 0x01000002, 0x00010002, 0x01010002, 0x00000102, 0x01000102, 0x00010102, 0x01010102,
40: 0x00000003, 0x01000003, 0x00010003, 0x01010003, 0x00000103, 0x01000103, 0x00010103, 0x01010103,
41: 0x02000002, 0x03000002, 0x02010002, 0x03010002, 0x02000102, 0x03000102, 0x02010102, 0x03010102,
42: 0x02000003, 0x03000003, 0x02010003, 0x03010003, 0x02000103, 0x03000103, 0x02010103, 0x03010103,
43: 0x00020002, 0x01020002, 0x00030002, 0x01030002, 0x00020102, 0x01020102, 0x00030102, 0x01030102,
44: 0x00020003, 0x01020003, 0x00030003, 0x01030003, 0x00020103, 0x01020103, 0x00030103, 0x01030103,
45: 0x02020002, 0x03020002, 0x02030002, 0x03030002, 0x02020102, 0x03020102, 0x02030102, 0x03030102,
46: 0x02020003, 0x03020003, 0x02030003, 0x03030003, 0x02020103, 0x03020103, 0x02030103, 0x03030103,
47: 0x00000202, 0x01000202, 0x00010202, 0x01010202, 0x00000302, 0x01000302, 0x00010302, 0x01010302,
48: 0x00000203, 0x01000203, 0x00010203, 0x01010203, 0x00000303, 0x01000303, 0x00010303, 0x01010303,
49: 0x02000202, 0x03000202, 0x02010202, 0x03010202, 0x02000302, 0x03000302, 0x02010302, 0x03010302,
50: 0x02000203, 0x03000203, 0x02010203, 0x03010203, 0x02000303, 0x03000303, 0x02010303, 0x03010303,
51: 0x00020202, 0x01020202, 0x00030202, 0x01030202, 0x00020302, 0x01020302, 0x00030302, 0x01030302,
52: 0x00020203, 0x01020203, 0x00030203, 0x01030203, 0x00020303, 0x01020303, 0x00030303, 0x01030303,
53: 0x02020202, 0x03020202, 0x02030202, 0x03030202, 0x02020302, 0x03020302, 0x02030302, 0x03030302,
54: 0x02020203, 0x03020203, 0x02030203, 0x03030203, 0x02020303, 0x03020303, 0x02030303, 0x03030303,
55: };
56:
1.1.1.2 root 57: static const Uint32 Remap_2_Planes_Upper[256] = {
1.1 root 58: 0x00000000, 0x04000000, 0x00040000, 0x04040000, 0x00000400, 0x04000400, 0x00040400, 0x04040400,
59: 0x00000004, 0x04000004, 0x00040004, 0x04040004, 0x00000404, 0x04000404, 0x00040404, 0x04040404,
60: 0x08000000, 0x0C000000, 0x08040000, 0x0C040000, 0x08000400, 0x0C000400, 0x08040400, 0x0C040400,
61: 0x08000004, 0x0C000004, 0x08040004, 0x0C040004, 0x08000404, 0x0C000404, 0x08040404, 0x0C040404,
62: 0x00080000, 0x04080000, 0x000C0000, 0x040C0000, 0x00080400, 0x04080400, 0x000C0400, 0x040C0400,
63: 0x00080004, 0x04080004, 0x000C0004, 0x040C0004, 0x00080404, 0x04080404, 0x000C0404, 0x040C0404,
64: 0x08080000, 0x0C080000, 0x080C0000, 0x0C0C0000, 0x08080400, 0x0C080400, 0x080C0400, 0x0C0C0400,
65: 0x08080004, 0x0C080004, 0x080C0004, 0x0C0C0004, 0x08080404, 0x0C080404, 0x080C0404, 0x0C0C0404,
66: 0x00000800, 0x04000800, 0x00040800, 0x04040800, 0x00000C00, 0x04000C00, 0x00040C00, 0x04040C00,
67: 0x00000804, 0x04000804, 0x00040804, 0x04040804, 0x00000C04, 0x04000C04, 0x00040C04, 0x04040C04,
68: 0x08000800, 0x0C000800, 0x08040800, 0x0C040800, 0x08000C00, 0x0C000C00, 0x08040C00, 0x0C040C00,
69: 0x08000804, 0x0C000804, 0x08040804, 0x0C040804, 0x08000C04, 0x0C000C04, 0x08040C04, 0x0C040C04,
70: 0x00080800, 0x04080800, 0x000C0800, 0x040C0800, 0x00080C00, 0x04080C00, 0x000C0C00, 0x040C0C00,
71: 0x00080804, 0x04080804, 0x000C0804, 0x040C0804, 0x00080C04, 0x04080C04, 0x000C0C04, 0x040C0C04,
72: 0x08080800, 0x0C080800, 0x080C0800, 0x0C0C0800, 0x08080C00, 0x0C080C00, 0x080C0C00, 0x0C0C0C00,
73: 0x08080804, 0x0C080804, 0x080C0804, 0x0C0C0804, 0x08080C04, 0x0C080C04, 0x080C0C04, 0x0C0C0C04,
74: 0x00000008, 0x04000008, 0x00040008, 0x04040008, 0x00000408, 0x04000408, 0x00040408, 0x04040408,
75: 0x0000000C, 0x0400000C, 0x0004000C, 0x0404000C, 0x0000040C, 0x0400040C, 0x0004040C, 0x0404040C,
76: 0x08000008, 0x0C000008, 0x08040008, 0x0C040008, 0x08000408, 0x0C000408, 0x08040408, 0x0C040408,
77: 0x0800000C, 0x0C00000C, 0x0804000C, 0x0C04000C, 0x0800040C, 0x0C00040C, 0x0804040C, 0x0C04040C,
78: 0x00080008, 0x04080008, 0x000C0008, 0x040C0008, 0x00080408, 0x04080408, 0x000C0408, 0x040C0408,
79: 0x0008000C, 0x0408000C, 0x000C000C, 0x040C000C, 0x0008040C, 0x0408040C, 0x000C040C, 0x040C040C,
80: 0x08080008, 0x0C080008, 0x080C0008, 0x0C0C0008, 0x08080408, 0x0C080408, 0x080C0408, 0x0C0C0408,
81: 0x0808000C, 0x0C08000C, 0x080C000C, 0x0C0C000C, 0x0808040C, 0x0C08040C, 0x080C040C, 0x0C0C040C,
82: 0x00000808, 0x04000808, 0x00040808, 0x04040808, 0x00000C08, 0x04000C08, 0x00040C08, 0x04040C08,
83: 0x0000080C, 0x0400080C, 0x0004080C, 0x0404080C, 0x00000C0C, 0x04000C0C, 0x00040C0C, 0x04040C0C,
84: 0x08000808, 0x0C000808, 0x08040808, 0x0C040808, 0x08000C08, 0x0C000C08, 0x08040C08, 0x0C040C08,
85: 0x0800080C, 0x0C00080C, 0x0804080C, 0x0C04080C, 0x08000C0C, 0x0C000C0C, 0x08040C0C, 0x0C040C0C,
86: 0x00080808, 0x04080808, 0x000C0808, 0x040C0808, 0x00080C08, 0x04080C08, 0x000C0C08, 0x040C0C08,
87: 0x0008080C, 0x0408080C, 0x000C080C, 0x040C080C, 0x00080C0C, 0x04080C0C, 0x000C0C0C, 0x040C0C0C,
88: 0x08080808, 0x0C080808, 0x080C0808, 0x0C0C0808, 0x08080C08, 0x0C080C08, 0x080C0C08, 0x0C0C0C08,
89: 0x0808080C, 0x0C08080C, 0x080C080C, 0x0C0C080C, 0x08080C0C, 0x0C080C0C, 0x080C0C0C, 0x0C0C0C0C,
90: };
91:
1.1.1.2 root 92: static const Uint32 Remap_1_Plane[16] = {
1.1 root 93: 0x00000000+BASECOLOUR_LONG, 0x01000000+BASECOLOUR_LONG, 0x00010000+BASECOLOUR_LONG, 0x01010000+BASECOLOUR_LONG, 0x00000100+BASECOLOUR_LONG, 0x01000100+BASECOLOUR_LONG, 0x00010100+BASECOLOUR_LONG, 0x01010100+BASECOLOUR_LONG,
94: 0x00000001+BASECOLOUR_LONG, 0x01000001+BASECOLOUR_LONG, 0x00010001+BASECOLOUR_LONG, 0x01010001+BASECOLOUR_LONG, 0x00000101+BASECOLOUR_LONG, 0x01000101+BASECOLOUR_LONG, 0x00010101+BASECOLOUR_LONG, 0x01010101+BASECOLOUR_LONG,
95: };
96:
97:
98: #define LOW_BUILD_PIXELS_0 \
99: { \
100: ebx &= 0x0f0f0f0f; \
101: ecx &= 0x0f0f0f0f; \
102: eax = (ebx >> 12) | ebx; \
103: edx = (ecx >> 12) | ecx; \
104: ecx = Remap_2_Planes_Upper[edx & 0x00ff]; \
105: ecx += Remap_2_Planes[eax & 0x00ff]; \
106: }
107:
108: #define LOW_BUILD_PIXELS_1 \
109: { \
110: ecx = Remap_2_Planes_Upper[(edx >> 8) & 0x00ff]; \
111: ecx += Remap_2_Planes[(eax >> 8) & 0x00ff]; \
112: }
113:
114: #define LOW_BUILD_PIXELS_2 \
115: { \
116: ebx = (*edi & 0xf0f0f0f0) >> 4; \
117: ecx = (*(edi+1) & 0xf0f0f0f0) >> 4; \
118: eax = (ebx >> 12) | ebx; \
119: edx = (ecx >> 12) | ecx; \
120: ecx = Remap_2_Planes_Upper[edx & 0x00ff]; \
121: ecx += Remap_2_Planes[eax & 0x00ff]; \
122: }
123:
124: #define LOW_BUILD_PIXELS_3 \
125: { \
126: ecx = Remap_2_Planes_Upper[(edx >> 8) & 0x00ff]; \
127: ecx += Remap_2_Planes[(eax >> 8) & 0x00ff]; \
128: }
129:
130:
131: #define MED_BUILD_PIXELS_0 \
132: { \
133: ebx &= 0x0f0f0f0f; \
134: eax = (ebx >> 12) | ebx; \
135: ecx = Remap_2_Planes[eax & 0x000000ff]; \
136: }
137:
138: #define MED_BUILD_PIXELS_1 \
139: { \
140: ecx = Remap_2_Planes[(eax >> 8) & 0x000000ff]; \
141: }
142:
143: #define MED_BUILD_PIXELS_2 \
144: { \
145: ebx = (*edi & 0xf0f0f0f0) >> 4; \
146: eax = (ebx >> 12) | ebx; \
147: ecx = Remap_2_Planes[eax & 0x000000ff]; \
148: }
149:
150: #define MED_BUILD_PIXELS_3 \
151: { \
152: ecx = Remap_2_Planes[(eax >> 8) & 0x000000ff]; \
153: }
154:
155:
156: /* Routines to create 'ecx' pixels - MUST be called in this order */
157: #define HIGH_BUILD_PIXELS_0 \
158: { \
159: eax = (ebx & 0x0000000f); \
160: }
161:
162: #define HIGH_BUILD_PIXELS_1 \
163: { \
164: eax = (ebx >> 4) & 0x0000000f;\
165: }
166:
167: #define HIGH_BUILD_PIXELS_2 \
168: { \
169: eax = (ebx >> 8) & 0x0000000f;\
170: }
171:
172: #define HIGH_BUILD_PIXELS_3 \
173: { \
174: eax = (ebx >> 12) & 0x0000000f;\
175: }
176:
177:
1.1.1.3 ! root 178: /* Plot Low Resolution (320xH) 32-Bit pixels */
! 179: #define PLOT_LOW_320_32BIT(offset) \
! 180: { \
! 181: esi[offset] = (Uint32)STRGBPalette[ecx & 0x00ff]; \
! 182: esi[offset+1] = (Uint32)STRGBPalette[(ecx >> 8) & 0x00ff]; \
! 183: esi[offset+2] = (Uint32)STRGBPalette[(ecx >> 16) & 0x00ff]; \
! 184: esi[offset+3] = (Uint32)STRGBPalette[(ecx >> 24) & 0x00ff]; \
! 185: }
! 186:
! 187: /* Plot Low Resolution (640xH) 32-Bit pixels */
! 188: #define PLOT_LOW_640_32BIT(offset) \
! 189: { \
! 190: esi[offset+0] = esi[offset+1] = STRGBPalette[ecx & 0x000000ff]; \
! 191: esi[offset+2] = esi[offset+3] = STRGBPalette[(ecx >> 8) & 0x000000ff]; \
! 192: esi[offset+4] = esi[offset+5] = STRGBPalette[(ecx >> 16) & 0x000000ff]; \
! 193: esi[offset+6] = esi[offset+7] = STRGBPalette[(ecx >> 24) & 0x000000ff]; \
! 194: }
! 195:
! 196: /* Plot Low Resolution (640xH) 16-Bit pixels (Double on Y) */
! 197: #define PLOT_LOW_640_32BIT_DOUBLE_Y(offset) \
! 198: { \
! 199: ebx = STRGBPalette[ecx & 0x000000ff]; \
! 200: esi[offset+0] = esi[offset+1] = esi[offset+Screen4BytesPerLine+0] \
! 201: = esi[offset+Screen4BytesPerLine+1] = ebx; \
! 202: ebx = STRGBPalette[(ecx >> 8) & 0x000000ff]; \
! 203: esi[offset+2] = esi[offset+3] = esi[offset+Screen4BytesPerLine+2] \
! 204: = esi[offset+Screen4BytesPerLine+3] = ebx; \
! 205: ebx = STRGBPalette[(ecx >> 16) & 0x000000ff]; \
! 206: esi[offset+4] = esi[offset+5] = esi[offset+Screen4BytesPerLine+4] \
! 207: = esi[offset+Screen4BytesPerLine+5] = ebx; \
! 208: ebx = STRGBPalette[(ecx >> 24) & 0x000000ff]; \
! 209: esi[offset+6] = esi[offset+7] = esi[offset+Screen4BytesPerLine+6] \
! 210: = esi[offset+Screen4BytesPerLine+7] = ebx; \
! 211: }
! 212:
! 213: /* Plot Medium Resolution(640xH) 32-Bit pixels */
! 214: #define PLOT_MED_640_32BIT(offset) \
! 215: { \
! 216: esi[offset+0] = STRGBPalette[ecx & 0x000000ff]; \
! 217: esi[offset+1] = STRGBPalette[(ecx >> 8) & 0x000000ff]; \
! 218: esi[offset+2] = STRGBPalette[(ecx >> 16) & 0x000000ff]; \
! 219: esi[offset+3] = STRGBPalette[(ecx >> 24) & 0x000000ff]; \
! 220: }
! 221:
! 222: /* Plot Medium Resolution(640xH) 32-Bit pixels (Double on Y) */
! 223: #define PLOT_MED_640_32BIT_DOUBLE_Y(offset) \
! 224: { \
! 225: esi[offset+0+Screen4BytesPerLine] = \
! 226: esi[offset+0] = STRGBPalette[ecx & 0x000000ff]; \
! 227: esi[offset+1+Screen4BytesPerLine] = \
! 228: esi[offset+1] = STRGBPalette[(ecx >> 8) & 0x000000ff]; \
! 229: esi[offset+2+Screen4BytesPerLine] = \
! 230: esi[offset+2] = STRGBPalette[(ecx >> 16) & 0x000000ff]; \
! 231: esi[offset+3+Screen4BytesPerLine] = \
! 232: esi[offset+3] = STRGBPalette[(ecx >> 24) & 0x000000ff]; \
! 233: }
! 234:
! 235:
! 236: /* Plot Spectrum512 Resolution (320xH) 32-Bit pixels */
! 237: #define PLOT_SPEC512_LEFT_LOW_320_32BIT(offset) \
! 238: { \
! 239: esi[offset] = STRGBPalette[ecx & 0x000000ff]; \
! 240: }
! 241:
! 242: /* Plot Spectrum512 Resolution (320xH) 32-Bit pixels */
! 243: #define PLOT_SPEC512_MID_320_32BIT PLOT_MED_640_32BIT
! 244:
! 245: /* Plot Spectrum512 Resolution(320xH) 32-Bit pixels */
! 246: #define PLOT_SPEC512_END_LOW_320_32BIT(offset) \
! 247: { \
! 248: esi[offset] = STRGBPalette[ecx & 0x000000ff]; \
! 249: esi[offset+1] = STRGBPalette[(ecx >> 8) & 0x000000ff]; \
! 250: esi[offset+2] = STRGBPalette[(ecx >> 16) & 0x000000ff]; \
! 251: }
! 252:
! 253:
! 254: /* Plot Spectrum512 Resolution (640xH) 32-Bit pixels */
! 255: #define PLOT_SPEC512_LEFT_LOW_640_32BIT(offset) \
! 256: { \
! 257: esi[offset] = esi[offset+1] = STRGBPalette[ecx & 0x000000ff]; \
! 258: }
! 259:
! 260: /* Plot Spectrum512 Resolution (640xH) 32-Bit pixels */
! 261: #define PLOT_SPEC512_MID_640_32BIT PLOT_LOW_640_32BIT
! 262:
! 263: /* Plot Spectrum512 Resolution (640xH) 32-Bit pixels */
! 264: #define PLOT_SPEC512_END_LOW_640_32BIT(offset) \
! 265: { \
! 266: esi[offset+0] = esi[offset+1] = STRGBPalette[ecx & 0x000000ff]; \
! 267: esi[offset+2] = esi[offset+3] = STRGBPalette[(ecx >> 8) & 0x000000ff]; \
! 268: esi[offset+4] = esi[offset+5] = STRGBPalette[(ecx >> 16) & 0x000000ff]; \
! 269: }
! 270:
! 271: /* Plot Spectrum512 Resolution (640xH) 32-Bit pixels (Double on Y) */
! 272: #define PLOT_SPEC512_LEFT_LOW_640_32BIT_DOUBLE_Y(offset) \
! 273: { \
! 274: esi[offset+Screen4BytesPerLine] = esi[offset+Screen4BytesPerLine+1] = \
! 275: esi[offset] = esi[offset+1] = STRGBPalette[ecx & 0x000000ff]; \
! 276: }
! 277:
! 278: /* Plot Spectrum512 Resolution (640xH) 16-Bit pixels (Double on Y) */
! 279: #define PLOT_SPEC512_MID_640_32BIT_DOUBLE_Y PLOT_LOW_640_32BIT_DOUBLE_Y
! 280:
! 281: /* Plot Spectrum512 Resolution (640xH) 16-Bit pixels (Double on Y) */
! 282: #define PLOT_SPEC512_END_LOW_640_32BIT_DOUBLE_Y(offset) \
! 283: { \
! 284: ebx = STRGBPalette[ecx & 0x000000ff]; \
! 285: esi[offset+Screen4BytesPerLine] = esi[offset+Screen4BytesPerLine+1] \
! 286: = esi[offset] = esi[offset+1] = ebx; \
! 287: ebx = STRGBPalette[(ecx >> 8) & 0x000000ff]; \
! 288: esi[offset+2+Screen4BytesPerLine] = esi[offset+3+Screen4BytesPerLine] \
! 289: = esi[offset+2] = esi[offset+3] = ebx; \
! 290: ebx = STRGBPalette[(ecx >> 16) & 0x000000ff]; \
! 291: esi[offset+4+Screen4BytesPerLine] = esi[offset+5+Screen4BytesPerLine] \
! 292: = esi[offset+4] = esi[offset+5] = ebx; \
! 293: }
! 294:
! 295:
1.1 root 296: /* Plot Low Resolution (320xH) 16-Bit pixels */
297: #define PLOT_LOW_320_16BIT(offset) \
298: { \
299: esi[offset] = (Uint16)STRGBPalette[ecx & 0x00ff]; \
300: esi[offset+1] = (Uint16)STRGBPalette[(ecx >> 8) & 0x00ff]; \
301: esi[offset+2] = (Uint16)STRGBPalette[(ecx >> 16) & 0x00ff]; \
302: esi[offset+3] = (Uint16)STRGBPalette[(ecx >> 24) & 0x00ff]; \
303: }
304:
305: /* Plot Low Resolution (320xH) 8-Bit pixels */
306: #define PLOT_LOW_320_8BIT(offset) \
307: { \
308: esi[offset] = SDL_SwapLE32(ecx + BASECOLOUR_LONG); \
309: }
310:
311: /* Plot Low Resolution (640xH) 8-Bit pixels */
312: #define PLOT_LOW_640_8BIT(offset) \
313: { \
314: ebpp = ecx + BASECOLOUR_LONG; \
315: ecx = ((ebpp & 0x0000ff00) << 8) | (ebpp & 0x000000ff); \
316: esi[offset] = SDL_SwapLE32((ecx << 8) | ecx); \
317: ecx = ((ebpp & 0x00ff0000) >> 8) | (ebpp & 0xff000000); \
318: esi[offset+1] = SDL_SwapLE32((ecx >> 8) | ecx); \
319: }
320:
321: /* Plot Low Resolution (640xH) 8-Bit pixels (double on Y) */
322: #define PLOT_LOW_640_8BIT_DOUBLE_Y(offset) \
323: { \
324: ebpp = ecx + BASECOLOUR_LONG; \
325: ecx = ((ebpp & 0x0000ff00) << 8) | (ebpp & 0x000000ff); \
1.1.1.3 ! root 326: esi[offset+Screen4BytesPerLine] = \
1.1 root 327: esi[offset] = SDL_SwapLE32((ecx << 8) | ecx); \
328: ecx = ((ebpp & 0x00ff0000) >> 8) | (ebpp & 0xff000000); \
1.1.1.3 ! root 329: esi[offset+1+Screen4BytesPerLine] = \
1.1 root 330: esi[offset+1] = SDL_SwapLE32((ecx >> 8) | ecx); \
331: }
332:
333: /* Plot Low Resolution (640xH) 16-Bit pixels */
334: #define PLOT_LOW_640_16BIT(offset) \
335: { \
336: esi[offset] = STRGBPalette[ecx & 0x000000ff]; \
337: esi[offset+1] = STRGBPalette[(ecx >> 8) & 0x000000ff]; \
338: esi[offset+2] = STRGBPalette[(ecx >> 16) & 0x000000ff]; \
339: esi[offset+3] = STRGBPalette[(ecx >> 24) & 0x000000ff]; \
340: }
341:
342: /* Plot Low Resolution (640xH) 16-Bit pixels (Double on Y) */
343: #define PLOT_LOW_640_16BIT_DOUBLE_Y(offset) \
344: { \
345: ebx = STRGBPalette[ecx & 0x000000ff]; \
1.1.1.3 ! root 346: esi[offset] = esi[offset+Screen4BytesPerLine] = ebx; \
1.1 root 347: ebx = STRGBPalette[(ecx >> 8) & 0x000000ff]; \
1.1.1.3 ! root 348: esi[offset+1] = esi[offset+1+Screen4BytesPerLine] = ebx; \
1.1 root 349: ebx = STRGBPalette[(ecx >> 16) & 0x000000ff]; \
1.1.1.3 ! root 350: esi[offset+2] = esi[offset+2+Screen4BytesPerLine] = ebx; \
1.1 root 351: ebx = STRGBPalette[(ecx >> 24) & 0x000000ff]; \
1.1.1.3 ! root 352: esi[offset+3] = esi[offset+3+Screen4BytesPerLine] = ebx; \
1.1 root 353: }
354:
355:
356: /* Plot Medium Resolution (640xH) 8-Bit pixels */
357: #define PLOT_MED_640_8BIT(offset) \
358: { \
359: esi[offset] = SDL_SwapLE32(ecx + BASECOLOUR_LONG); \
360: }
361:
362: /* Plot Medium Resolution (640xH) 8-Bit pixels (Double on Y) */
363: #define PLOT_MED_640_8BIT_DOUBLE_Y(offset) \
364: { \
1.1.1.3 ! root 365: esi[offset] = esi[offset+Screen4BytesPerLine] =\
1.1 root 366: SDL_SwapLE32(ecx + BASECOLOUR_LONG); \
367: }
368:
369: /* Plot Medium Resolution(640xH) 16-Bit pixels */
370: #define PLOT_MED_640_16BIT(offset) \
371: { \
372: esi[offset] = (Uint16)STRGBPalette[ecx & 0x000000ff]; \
373: esi[offset+1] = (Uint16)STRGBPalette[(ecx >> 8) & 0x000000ff]; \
374: esi[offset+2] = (Uint16)STRGBPalette[(ecx >> 16) & 0x000000ff]; \
375: esi[offset+3] = (Uint16)STRGBPalette[(ecx >> 24) & 0x000000ff]; \
376: }
377:
378: /* Plot Medium Resolution(640xH) 16-Bit pixels (Double on Y) */
379: #define PLOT_MED_640_16BIT_DOUBLE_Y(offset) \
380: { \
1.1.1.3 ! root 381: esi[offset+Screen2BytesPerLine] =\
1.1 root 382: esi[offset] = (Uint16)STRGBPalette[ecx & 0x000000ff]; \
1.1.1.3 ! root 383: esi[offset+1+Screen2BytesPerLine] =\
1.1 root 384: esi[offset+1] = (Uint16)STRGBPalette[(ecx >> 8) & 0x000000ff]; \
1.1.1.3 ! root 385: esi[offset+2+Screen2BytesPerLine] =\
1.1 root 386: esi[offset+2] = (Uint16)STRGBPalette[(ecx >> 16) & 0x000000ff]; \
1.1.1.3 ! root 387: esi[offset+3+Screen2BytesPerLine] =\
1.1 root 388: esi[offset+3] = (Uint16)STRGBPalette[(ecx >> 24) & 0x000000ff]; \
389: }
390:
391:
392: /* Plot High Resolution (640xH) 8-Bit pixels */
393: #define PLOT_HIGH_640_8BIT(offset) \
394: { \
395: esi[offset] = SDL_SwapLE32(Remap_1_Plane[eax]); \
396: }
397:
398:
399: /* Plot Spectrum512 Resolution(320xH) 16-Bit pixels */
400: #define PLOT_SPEC512_LEFT_LOW_320_16BIT(offset) \
401: { \
402: esi[offset] = (Uint16)STRGBPalette[ecx & 0x000000ff]; \
403: }
404:
405: /* Plot Spectrum512 Resolution(320xH) 16-Bit pixels */
406: #define PLOT_SPEC512_MID_320_16BIT PLOT_MED_640_16BIT
407:
408: /* Plot Spectrum512 Resolution(320xH) 16-Bit pixels */
409: #define PLOT_SPEC512_END_LOW_320_16BIT(offset) \
410: { \
411: esi[offset] = (Uint16)STRGBPalette[ecx & 0x000000ff]; \
412: esi[offset+1] = (Uint16)STRGBPalette[(ecx >> 8) & 0x000000ff]; \
413: esi[offset+2] = (Uint16)STRGBPalette[(ecx >> 16) & 0x000000ff]; \
414: }
415:
416:
417: /* Plot Spectrum512 Resolution (640xH) 16-Bit pixels */
418: #define PLOT_SPEC512_LEFT_LOW_640_16BIT(offset) \
419: { \
420: esi[offset] = STRGBPalette[ecx & 0x000000ff]; \
421: }
422:
423: /* Plot Spectrum512 Resolution (640xH) 16-Bit pixels */
424: #define PLOT_SPEC512_MID_640_16BIT PLOT_LOW_640_16BIT
425:
426: /* Plot Spectrum512 Resolution (640xH) 16-Bit pixels */
427: #define PLOT_SPEC512_END_LOW_640_16BIT(offset) \
428: { \
429: esi[offset] = STRGBPalette[ecx & 0x000000ff]; \
430: esi[offset+1] = STRGBPalette[(ecx >> 8) & 0x000000ff]; \
431: esi[offset+2] = STRGBPalette[(ecx >> 16) & 0x000000ff]; \
432: }
433:
434: /* Plot Spectrum512 Resolution (640xH) 16-Bit pixels (Double on Y) */
435: #define PLOT_SPEC512_LEFT_LOW_640_16BIT_DOUBLE_Y(offset) \
436: { \
1.1.1.3 ! root 437: esi[offset+Screen4BytesPerLine] = \
1.1 root 438: esi[offset] = STRGBPalette[ecx & 0x000000ff]; \
439: }
440:
441: /* Plot Spectrum512 Resolution (640xH) 16-Bit pixels (Double on Y) */
442: #define PLOT_SPEC512_MID_640_16BIT_DOUBLE_Y PLOT_LOW_640_16BIT_DOUBLE_Y
443:
444: /* Plot Spectrum512 Resolution (640xH) 16-Bit pixels (Double on Y) */
445: #define PLOT_SPEC512_END_LOW_640_16BIT_DOUBLE_Y(offset) \
446: { \
447: ebx = STRGBPalette[ecx & 0x000000ff]; \
1.1.1.3 ! root 448: esi[offset] = esi[offset+Screen4BytesPerLine] = ebx; \
1.1 root 449: ebx = STRGBPalette[(ecx >> 8) & 0x000000ff]; \
1.1.1.3 ! root 450: esi[offset+1] = esi[offset+1+Screen4BytesPerLine] = ebx; \
1.1 root 451: ebx = STRGBPalette[(ecx >> 16) & 0x000000ff]; \
1.1.1.3 ! root 452: esi[offset+2] = esi[offset+2+Screen4BytesPerLine] = ebx; \
1.1 root 453: }
454:
455: #endif /* HATARI_CONVERTMACROS_H */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.