|
|
1.1.1.2 root 1: /*
2: Hatari - low640x8.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.
1.1 root 6:
1.1.1.2 root 7: Screen conversion function, Low Res to 640x8Bit
8: */
1.1 root 9:
1.1.1.3 ! root 10: static void Line_ConvertLowRes_640x8Bit(Uint32 *edi, Uint32 *ebp, Uint32 *esi, Uint32 eax)
1.1 root 11: {
1.1.1.2 root 12: Uint32 edx;
1.1.1.3 ! root 13: Uint32 ebx, ecx, ebpp;
! 14: int x;
1.1 root 15:
1.1.1.3 ! root 16: x = STScreenWidthBytes>>3; /* Amount to draw across in 16-pixels (8 bytes) */
1.1.1.2 root 17:
18: do /* x-loop */
19: {
20: /* Do 16 pixels at one time */
21: ebx = *edi;
22: ecx = *(edi+1);
23:
24: if((ScrUpdateFlag&0xe0000000) || ebx!=*ebp || ecx!=*(ebp+1)) /* Does differ? */
25: { /* copy word */
26:
27: bScreenContentsChanged = TRUE;
28:
29: #if SDL_BYTEORDER == SDL_BIG_ENDIAN
30: /* Plot in 'right-order' on big endian systems */
31: if(!bScrDoubleY) /* Double on Y? */
32: {
33: /* Plot pixels */
34: LOW_BUILD_PIXELS_0 ; /* Generate 'ecx' as pixels [4,5,6,7] */
35: PLOT_LOW_640_8BIT(6) ;
36: LOW_BUILD_PIXELS_1 ; /* Generate 'ecx' as pixels [12,13,14,15] */
37: PLOT_LOW_640_8BIT(2) ;
38: LOW_BUILD_PIXELS_2 ; /* Generate 'ecx' as pixels [0,1,2,3] */
39: PLOT_LOW_640_8BIT(4) ;
40: LOW_BUILD_PIXELS_3 ; /* Generate 'ecx' as pixels [8,9,10,11] */
41: PLOT_LOW_640_8BIT(0) ;
42: }
43: else
44: {
45: /* Plot pixels */
46: LOW_BUILD_PIXELS_0 ; /* Generate 'ecx' as pixels [4,5,6,7] */
47: PLOT_LOW_640_8BIT_DOUBLE_Y(6) ;
48: LOW_BUILD_PIXELS_1 ; /* Generate 'ecx' as pixels [12,13,14,15] */
49: PLOT_LOW_640_8BIT_DOUBLE_Y(2) ;
50: LOW_BUILD_PIXELS_2 ; /* Generate 'ecx' as pixels [0,1,2,3] */
51: PLOT_LOW_640_8BIT_DOUBLE_Y(4) ;
52: LOW_BUILD_PIXELS_3 ; /* Generate 'ecx' as pixels [8,9,10,11] */
53: PLOT_LOW_640_8BIT_DOUBLE_Y(0)
54: }
55: #else
56: /* Plot in 'wrong-order', as ebx is 68000 endian */
57: if(!bScrDoubleY) /* Double on Y? */
58: {
59: /* Plot pixels */
60: LOW_BUILD_PIXELS_0 ; /* Generate 'ecx' as pixels [4,5,6,7] */
61: PLOT_LOW_640_8BIT(2) ;
62: LOW_BUILD_PIXELS_1 ; /* Generate 'ecx' as pixels [12,13,14,15] */
63: PLOT_LOW_640_8BIT(6) ;
64: LOW_BUILD_PIXELS_2 ; /* Generate 'ecx' as pixels [0,1,2,3] */
65: PLOT_LOW_640_8BIT(0) ;
66: LOW_BUILD_PIXELS_3 ; /* Generate 'ecx' as pixels [8,9,10,11] */
67: PLOT_LOW_640_8BIT(4) ;
68: }
69: else
70: {
71: /* Plot pixels */
72: LOW_BUILD_PIXELS_0 ; /* Generate 'ecx' as pixels [4,5,6,7] */
73: PLOT_LOW_640_8BIT_DOUBLE_Y(2) ;
74: LOW_BUILD_PIXELS_1 ; /* Generate 'ecx' as pixels [12,13,14,15] */
75: PLOT_LOW_640_8BIT_DOUBLE_Y(6) ;
76: LOW_BUILD_PIXELS_2 ; /* Generate 'ecx' as pixels [0,1,2,3] */
77: PLOT_LOW_640_8BIT_DOUBLE_Y(0) ;
78: LOW_BUILD_PIXELS_3 ; /* Generate 'ecx' as pixels [8,9,10,11] */
79: PLOT_LOW_640_8BIT_DOUBLE_Y(4)
80: }
81: #endif
82:
83: }
84:
85: esi += 8; /* Next PC pixels */
86: edi += 2; /* Next ST pixels */
87: ebp += 2; /* Next ST copy pixels */
1.1 root 88: }
1.1.1.3 ! root 89: while(--x); /* Loop on X */
! 90: }
! 91:
! 92:
! 93: static void ConvertLowRes_640x8Bit(void)
! 94: {
! 95: Uint32 *edi, *ebp;
! 96: Uint32 *esi;
! 97: Uint32 eax;
! 98: int y;
! 99:
! 100: Convert_StartFrame(); /* Start frame, track palettes */
! 101:
! 102: for (y = STScreenStartHorizLine; y < STScreenEndHorizLine; y++) {
! 103:
! 104: /* Get screen addresses */
! 105: eax = STScreenLineOffset[y] + STScreenLeftSkipBytes; /* Offset for this line + Amount to skip on left hand side */
! 106: edi = (Uint32 *)((Uint8 *)pSTScreen + eax); /* ST format screen 4-plane 16 colours */
! 107: ebp = (Uint32 *)((Uint8 *)pSTScreenCopy + eax); /* Previous ST format screen */
! 108: esi = (Uint32 *)pPCScreenDest; /* PC format screen */
! 109:
! 110: AdjustLinePaletteRemap(y);
! 111:
! 112: if((AdjustLinePaletteRemap(y) & 0x00030000) == 0) /* Change palette table */
! 113: Line_ConvertLowRes_640x8Bit(edi, ebp, esi, eax);
! 114: else
! 115: Line_ConvertMediumRes_640x8Bit(edi, ebp, esi, eax);
! 116:
! 117: pPCScreenDest = (void *)(((Uint8 *)pPCScreenDest)+PCScreenBytesPerLine*2); /* Offset to next line */
! 118: }
1.1 root 119: }
1.1.1.2 root 120:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.