|
|
1.1 root 1: /*
2: Hatari - med640x32.c
3:
4: This file is distributed under the GNU Public License, version 2 or at your
5: option any later version. Read the file gpl.txt for details.
6:
7: Screen Conversion, Medium Res to 640x32Bit
8: */
9:
1.1.1.3 ! root 10: static void ConvertMediumRes_640x32Bit(void)
! 11: {
! 12: Uint32 *edi, *ebp;
! 13: Uint32 *esi;
! 14: Uint32 eax;
! 15: int y;
! 16:
! 17: Convert_StartFrame(); /* Start frame, track palettes */
! 18:
! 19: for (y = STScreenStartHorizLine; y < STScreenEndHorizLine; y++)
! 20: {
! 21:
! 22: eax = STScreenLineOffset[y] + STScreenLeftSkipBytes; /* Offset for this line + Amount to skip on left hand side */
! 23: edi = (Uint32 *)((Uint8 *)pSTScreen + eax); /* ST format screen 4-plane 16 colors */
! 24: ebp = (Uint32 *)((Uint8 *)pSTScreenCopy + eax); /* Previous ST format screen */
! 25: esi = (Uint32 *)pPCScreenDest; /* PC format screen */
! 26:
! 27: if (AdjustLinePaletteRemap(y) & 0x00030000) /* Change palette table */
! 28: Line_ConvertMediumRes_640x32Bit(edi, ebp, esi, eax);
! 29: else
! 30: Line_ConvertLowRes_640x32Bit(edi, ebp, esi, eax);
! 31:
! 32: /* Offset to next line */
! 33: pPCScreenDest = (((Uint8 *)pPCScreenDest) + PCScreenBytesPerLine * 2);
! 34: }
! 35: }
! 36:
! 37:
1.1 root 38: static void Line_ConvertMediumRes_640x32Bit(Uint32 *edi, Uint32 *ebp, Uint32 *esi, Uint32 eax)
39: {
40: Uint32 ebx, ecx;
41: int x, update, Screen4BytesPerLine;
42:
43: x = STScreenWidthBytes >> 2; /* Amount to draw across in 16-pixels (4 bytes) */
44: Screen4BytesPerLine = PCScreenBytesPerLine/4;
45: update = ScrUpdateFlag & PALETTEMASK_UPDATEMASK;
46:
47: do /* x-loop */
48: {
49:
50: /* Do 16 pixels at one time */
51: ebx = *edi;
52:
53: if (update || ebx != *ebp) /* Does differ? */
54: {
55: /* copy word */
56:
1.1.1.2 root 57: bScreenContentsChanged = true;
1.1 root 58:
59: #if SDL_BYTEORDER == SDL_BIG_ENDIAN
60: /* Plot in 'right-order' on big endian systems */
61: if (!bScrDoubleY) /* Double on Y? */
62: {
1.1.1.3 ! root 63: MED_BUILD_PIXELS_0 ; /* Generate 'ecx' as pixels [12,13,14,15] */
1.1 root 64: PLOT_MED_640_32BIT(12) ;
1.1.1.3 ! root 65: MED_BUILD_PIXELS_1 ; /* Generate 'ecx' as pixels [4,5,6,7] */
1.1 root 66: PLOT_MED_640_32BIT(4) ;
1.1.1.3 ! root 67: MED_BUILD_PIXELS_2 ; /* Generate 'ecx' as pixels [8,9,10,11] */
1.1 root 68: PLOT_MED_640_32BIT(8) ;
1.1.1.3 ! root 69: MED_BUILD_PIXELS_3 ; /* Generate 'ecx' as pixels [0,1,2,3] */
1.1 root 70: PLOT_MED_640_32BIT(0) ;
71: }
72: else
73: {
1.1.1.3 ! root 74: MED_BUILD_PIXELS_0 ; /* Generate 'ecx' as pixels [12,13,14,15] */
1.1 root 75: PLOT_MED_640_32BIT_DOUBLE_Y(12) ;
1.1.1.3 ! root 76: MED_BUILD_PIXELS_1 ; /* Generate 'ecx' as pixels [4,5,6,7] */
1.1 root 77: PLOT_MED_640_32BIT_DOUBLE_Y(4) ;
1.1.1.3 ! root 78: MED_BUILD_PIXELS_2 ; /* Generate 'ecx' as pixels [8,9,10,11] */
1.1 root 79: PLOT_MED_640_32BIT_DOUBLE_Y(8) ;
1.1.1.3 ! root 80: MED_BUILD_PIXELS_3 ; /* Generate 'ecx' as pixels [0,1,2,3] */
1.1 root 81: PLOT_MED_640_32BIT_DOUBLE_Y(0) ;
82: }
83: #else
84: /* Plot in 'wrong-order', as ebx is 68000 endian */
85: if (!bScrDoubleY) /* Double on Y? */
86: {
87: MED_BUILD_PIXELS_0 ; /* Generate 'ecx' as pixels [4,5,6,7] */
88: PLOT_MED_640_32BIT(4) ;
89: MED_BUILD_PIXELS_1 ; /* Generate 'ecx' as pixels [12,13,14,15] */
90: PLOT_MED_640_32BIT(12) ;
91: MED_BUILD_PIXELS_2 ; /* Generate 'ecx' as pixels [0,1,2,3] */
92: PLOT_MED_640_32BIT(0) ;
93: MED_BUILD_PIXELS_3 ; /* Generate 'ecx' as pixels [8,9,10,11] */
94: PLOT_MED_640_32BIT(8) ;
95: }
96: else
97: {
98: MED_BUILD_PIXELS_0 ; /* Generate 'ecx' as pixels [4,5,6,7] */
99: PLOT_MED_640_32BIT_DOUBLE_Y(4) ;
100: MED_BUILD_PIXELS_1 ; /* Generate 'ecx' as pixels [12,13,14,15] */
101: PLOT_MED_640_32BIT_DOUBLE_Y(12) ;
102: MED_BUILD_PIXELS_2 ; /* Generate 'ecx' as pixels [0,1,2,3] */
103: PLOT_MED_640_32BIT_DOUBLE_Y(0) ;
104: MED_BUILD_PIXELS_3 ; /* Generate 'ecx' as pixels [8,9,10,11] */
105: PLOT_MED_640_32BIT_DOUBLE_Y(8) ;
106: }
107: #endif
108: }
109:
110: esi += 16; /* Next PC pixels */
111: edi += 1; /* Next ST pixels */
112: ebp += 1; /* Next ST copy pixels */
113: }
114: while (--x); /* Loop on X */
115:
116: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.