fork download
  1. /* ------------------------------- Sprite mixer -------------------------------------- */
  2. for (Index=63;Index!=-1;Index--) {
  3.  
  4. u32 px = sprite_OAM[Index].PosX;
  5. u32 py = sprite_OAM[Index].PosY;
  6. u32 at = sprite_OAM[Index].Attrs;
  7. u32 id = sprite_OAM[Index].Tile_Id; /* cache reduce */
  8. /* -------------------------- OAM test -------------------------------- */
  9. if (0 == (at & OAM_DISABLE_BIT))
  10. /* enable this OAM ? */ {
  11. if (ntCTRL.Tran_Id != id)
  12. /* not TransTile ? */ {
  13. if (py < 232
  14. && px < 256)
  15. /* in Range ? */ {
  16. u32 ix = 0;
  17. u32 ex = 1;
  18. u32 rx = 8;
  19. u32 hx = 0;
  20. u32 iy = 0;
  21. u32 ey = 1;
  22. u32 ry = 8;
  23. u32 hy = 0;
  24. u32 ep = 0;
  25.  
  26. if (sprite_OAM[Index].Attrs & OAM_VERTFILP_BIT)
  27. /* vert flip */ {
  28. iy = 7;
  29. ey = -1;
  30. ry = -1;
  31. }
  32. if (sprite_OAM[Index].Attrs & OAM_HORIFILP_BIT)
  33. /* hori flip */ {
  34. ix = 7;
  35. ep = 7;
  36. ex = -1;
  37. rx = -1;
  38. }
  39. ptr_OAM = &pEmuVideoUpdate[py*272+px];
  40. pTile_Cur = &Sprite_PooL[((id&63)<<3)+((id>>6)<<3)*PPITH_DWORD]; // lock area
  41. if (at & OAM_BACKITOS_BIT)
  42. /* background sprite ? */ {
  43. for (iy = iy; iy != ry; iy += ey) {
  44. for (ix = ep; ix != rx; ix += ex) {
  45. /* ------------------- line render ------------------ */
  46. if (ptr_OAM[hx+hy*272] != tc) {
  47. ptr_OAM[hy*272+hx] = pTile_Cur[PPITH_DWORD*iy+ix];
  48. }
  49. hx++;
  50. }
  51. hx = 0; /* reset x pos */
  52. hy ++;
  53. }
  54. } else {
  55. /* foreground sprite ? */
  56. for (iy = iy; iy != ry; iy += ey) {
  57. for (ix = ep; ix != rx; ix += ex) {
  58. /* ------------------- line render ------------------ */
  59. if (pTile_Cur[PPITH_DWORD*iy+ix] != tc) {
  60. ptr_OAM[hy*272+hx] = pTile_Cur[PPITH_DWORD*iy+ix];
  61. }
  62. hx++;
  63. }
  64. hx = 0; /* reset x pos */
  65. hy ++;
  66. }
  67. }
  68. }
  69. }
  70. }
  71. }
  72. /* ------------------------------- Direct3D output -------------------------------------- */
  73. //#include "Inline_Misc2.h"
  74. //#
  75. /*== 100019CE A1 C0 CE 04 10 mov eax,dword ptr [_IBaseGraphics (1004CEC0h)]
  76. == 100019D3 8B 08 mov ecx,dword ptr [eax]
  77. == 100019D5 8B 51 44 mov edx,dword ptr [ecx+44h]
  78. == 100019D8 6A 00 push 0
  79. == 100019DA 6A 00 push 0
  80. == 100019DC 6A 00 push 0
  81. == 100019DE 6A 00 push 0
  82. == 100019E0 50 push eax
  83. == 100019E1 FF D2 call edx == */
  84. /*== nes5StepAlphaALLScreen(4,pEmuVideoUpdate);
  85. //__asm int 3
  86. IBaseGraphics->lpVtbl->Present(IBaseGraphics,0,0,0,0); == */ {
  87. STATIC ALIGN DWORD DWORDTLB[16] =
  88. /* Mask */ {
  89. 0x00000000, 0x00000000, 0x00000000, 0x00000000,
  90. 0x40004000, 0x00004000, 0x40004000, 0x00004000,
  91. 0x80008000, 0x00008000, 0x80008000, 0x00008000,
  92. 0xC000C000, 0x0000C000, 0xC000C000, 0x0000C000
  93.  
  94. };
  95. ASM_BEGIN
  96.  
  97. push ebx ; U - save old frame
  98. push ebp ; V - save old frame
  99. push esi ; U - save old frame
  100. push edi ; V - save old frame
  101. mov eax, DWORD PTR[Alpha_Count] ; U - fetch step count
  102. mov edi, DWORD PTR[GVPointer+4] ; V/N fetch VPointer
  103. cmp eax, 4 ; U -
  104. jb _BST ; V/N
  105. mov ebx, DWORD PTR[GVPointer+0] ; U - fetch Pitch
  106. mov esi, [pEmuVideoUpdate] ; V - fecth SPointer
  107. mov eax, 224
  108. sub ebx, 1024
  109. mov edx, 1
  110. mov ecx, 8 ; U loop_x
  111. mov ebp, 128
  112. align 16
  113. MIX256:
  114. ; -------------------------------------------------------
  115. ; fetch mem
  116. ; -------------------------------------------------------
  117. movdqa xmm0, [esi+000h]
  118. movdqa xmm1, [esi+010h]
  119. movdqa xmm2, [esi+020h]
  120. movdqa xmm3, [esi+030h]
  121. movdqa xmm4, [esi+040h]
  122. movdqa xmm5, [esi+050h]
  123. movdqa xmm6, [esi+060h]
  124. movdqa xmm7, [esi+070h]
  125. ; -------------------------------------------------------
  126. ; write mem
  127. ; -------------------------------------------------------
  128. movdqa [edi+000h], xmm0
  129. movdqa [edi+010h], xmm1
  130. movdqa [edi+020h], xmm2
  131. movdqa [edi+030h], xmm3
  132. movdqa [edi+040h], xmm4
  133. movdqa [edi+050h], xmm5
  134. movdqa [edi+060h], xmm6
  135. movdqa [edi+070h], xmm7
  136.  
  137. add esi, ebp
  138. add edi, ebp
  139. sub ecx, edx
  140. jne MIX256
  141. add esi, 64
  142. add edi, ebx
  143. mov ecx, 8
  144. sub eax, edx
  145. jne MIX256
  146. jmp __GGSA_REQANS_ERX
  147. align 16
  148. _BST:
  149. lea eax, [eax*4] ; U - *4
  150. mov esi, [pEmuVideoUpdate] ; V - fecth SPointer
  151. movdqa xmm7, xmmword ptr[eax*4+DWORDTLB]
  152. pxor xmm6, xmm6
  153. mov ebx, DWORD PTR[GVPointer+0] ; U - fetch Pitch
  154. mov eax, 224
  155. sub ebx, 1024
  156. mov edx, 1
  157. mov ecx, 16 ; U loop_x
  158. mov ebp, 64
  159.  
  160. align 16
  161. S_LOOP:
  162. movdqa xmm0, [esi+000h] ; fetch P0
  163. movdqa xmm1, [esi+010h] ; fetch P1
  164. movdqa xmm2, [esi+020h] ; fetch P2
  165. movdqa xmm3, [esi+030h] ; fetch P3
  166. movdqa xmm4, xmm0 ; xmm4 = xmm0 = P0
  167. punpcklbw xmm0, xmm6 ; RGB cross-decomposition L0-L1 (P0)
  168. pmulhuw xmm0, xmm7 ; RGB cross-mul get high L0-L1 (P0)
  169. movdqa xmm5, xmm1 ; xmm5 = xmm1 = P1
  170. punpckhbw xmm4, xmm6 ; RGB cross-decomposition H0-H1 (P0)
  171. pmulhuw xmm4, xmm7 ; RGB cross-mul get high H0-H1 (P0)
  172. punpcklbw xmm1, xmm6 ; RGB cross-decomposition L0-L1 (P1)
  173. packuswb xmm0, xmm4 ; P0 merge
  174. pmulhuw xmm1, xmm7 ; RGB cross-mul get high L0-L1 (P1)
  175. punpckhbw xmm5, xmm6 ; RGB cross-decomposition H0-H1 (P1)
  176. movdqa xmm4, xmm2 ; xmm4 = xmm2 = P2
  177. pmulhuw xmm5, xmm7 ; RGB cross-mul get high H0-H1 (P1)
  178. punpcklbw xmm2, xmm6 ; RGB cross-decomposition L0-L1 (P2)
  179. packuswb xmm1, xmm5 ; P1 merge
  180. pmulhuw xmm2, xmm7 ; RGB cross-mul get high L0-L1 (P2)
  181. punpckhbw xmm4, xmm6 ; RGB cross-decomposition H0-H1 (P2)
  182. movdqa xmm5, xmm3 ; xmm5 = xmm3 = P3
  183. pmulhuw xmm4, xmm7 ; RGB cross-mul get high H0-H1 (P2)
  184. punpcklbw xmm3, xmm6 ; RGB cross-decomposition L0-L1 (P3)
  185. packuswb xmm2, xmm4 ; P2 merge
  186. pmulhuw xmm3, xmm7 ; RGB cross-mul get high L0-L1 (P3)
  187. punpckhbw xmm5, xmm6 ; RGB cross-decomposition H0-H1 (P3)
  188. pmulhuw xmm5, xmm7 ; RGB cross-mul get high H0-H1 (P3)
  189. packuswb xmm3, xmm5 ; P3 merge
  190. movdqa [edi+000h], xmm0 ; write P0
  191. movdqa [edi+010h], xmm1 ; write P1
  192. movdqa [edi+020h], xmm2 ; write P2
  193. movdqa [edi+030h], xmm3 ; write P3
  194. add esi, ebp ; next 64 bytes
  195. add edi, ebp ; next 64 bytes
  196. sub ecx, edx ; loop_x --
  197. jne S_LOOP ; JCC contine/out
  198. add esi, 64 ; next line
  199. add edi, ebx ; next line
  200. mov ecx, 16
  201. sub eax, edx
  202. jne S_LOOP ; JCC contine/out
  203. __GGSA_REQANS_ERX:
  204. push eax
  205. push eax
  206. push eax
  207. push eax
  208. mov eax, DWORD PTR[IBaseGraphics]
  209. mov ecx, DWORD PTR[eax]
  210. mov edx, DWORD PTR[ecx+68]
  211. push eax
  212. call edx
  213. pop edi
  214. pop esi
  215. pop ebp
  216. pop ebx
  217.  
  218. ASM_END
  219. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c:2:2: error: expected identifier or '(' before 'for'
  for (Index=63;Index!=-1;Index--) {
  ^
prog.c:2:21: error: expected '=', ',', ';', 'asm' or '__attribute__' before '!=' token
  for (Index=63;Index!=-1;Index--) {
                     ^
prog.c:2:31: error: expected '=', ',', ';', 'asm' or '__attribute__' before '--' token
  for (Index=63;Index!=-1;Index--) {
                               ^
prog.c:86:63: error: expected identifier or '(' before '{' token
  IBaseGraphics->lpVtbl->Present(IBaseGraphics,0,0,0,0); == */ {
                                                               ^
prog.c:117:24: error: invalid suffix "h" on integer constant
      movdqa xmm0, [esi+000h]
                        ^
prog.c:118:24: error: invalid suffix "h" on integer constant
      movdqa xmm1, [esi+010h]
                        ^
prog.c:119:25: error: invalid suffix "h" on integer constant
      movdqa  xmm2, [esi+020h]
                         ^
prog.c:120:25: error: invalid suffix "h" on integer constant
      movdqa  xmm3, [esi+030h]
                         ^
prog.c:121:24: error: invalid suffix "h" on integer constant
      movdqa xmm4, [esi+040h]
                        ^
prog.c:122:24: error: invalid suffix "h" on integer constant
      movdqa xmm5, [esi+050h]
                        ^
prog.c:123:25: error: invalid suffix "h" on integer constant
      movdqa  xmm6, [esi+060h]
                         ^
prog.c:124:25: error: invalid suffix "h" on integer constant
      movdqa  xmm7, [esi+070h]
                         ^
prog.c:128:18: error: invalid suffix "h" on integer constant
      movdqa [edi+000h], xmm0
                  ^
prog.c:129:18: error: invalid suffix "h" on integer constant
      movdqa [edi+010h], xmm1
                  ^
prog.c:130:19: error: invalid suffix "h" on integer constant
      movdqa  [edi+020h], xmm2
                   ^
prog.c:131:19: error: invalid suffix "h" on integer constant
      movdqa  [edi+030h], xmm3
                   ^
prog.c:132:18: error: invalid suffix "h" on integer constant
      movdqa [edi+040h], xmm4 
                  ^
prog.c:133:18: error: invalid suffix "h" on integer constant
      movdqa [edi+050h], xmm5
                  ^
prog.c:134:19: error: invalid suffix "h" on integer constant
      movdqa  [edi+060h], xmm6
                   ^
prog.c:135:19: error: invalid suffix "h" on integer constant
      movdqa  [edi+070h], xmm7
                   ^
prog.c:162:28: error: invalid suffix "h" on integer constant
       movdqa   xmm0,  [esi+000h]   ; fetch P0
                            ^
prog.c:163:28: error: invalid suffix "h" on integer constant
       movdqa   xmm1,  [esi+010h]   ; fetch P1
                            ^
prog.c:164:27: error: invalid suffix "h" on integer constant
       movdqa  xmm2,  [esi+020h]   ; fetch P2
                           ^
prog.c:165:26: error: invalid suffix "h" on integer constant
       movdqa  xmm3, [esi+030h]   ; fetch P3
                          ^
prog.c:190:21: error: invalid suffix "h" on integer constant
       movdqa   [edi+000h], xmm0   ; write P0
                     ^
prog.c:191:21: error: invalid suffix "h" on integer constant
       movdqa   [edi+010h], xmm1   ; write P1
                     ^
prog.c:192:20: error: invalid suffix "h" on integer constant
       movdqa  [edi+020h], xmm2   ; write P2
                    ^
prog.c:193:20: error: invalid suffix "h" on integer constant
       movdqa  [edi+030h], xmm3   ; write P3
                    ^
stdout
Standard output is empty