Advertisement
Zoinkity

F-Zero X Gateway64

Aug 14th, 2020
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. The F-Zero X source was kind enough to include some mention of building for Gateway64.
  2. The file in question is kn_backup.c
  3.  
  4. There is an explict undefine of the Gateway build flag:
  5. #undef GATEWAY_SW
  6. #define GATEWAY_SW 0
  7.  
  8. If GATEWAY_SW is True an unsigned short regGateWay is created. This is used to throw the game into a pause state when you hit the paywall.
  9. It also murders the SRAM DMAs, making it impossible to save. Uncomment the line and eliminate the one below it.
  10.  
  11. void sramDma( u32 flag, uint sramOffsetAddr, void *pData, uint dataSize )
  12. {
  13. //#if GATEWAY_SW
  14. #if 0
  15. int i;
  16. uchar *p;
  17. #endif /* GATEWAY_SW */
  18.  
  19. //#if GATEWAY_SW
  20. #if 0
  21. /* GATEWAYはSRAMアクセスなし */
  22. if( flag == OS_READ ) {
  23. p = (uchar *)pData;
  24. for( i = 0 ; i < dataSize ; i ++ ) {
  25. *p = 0xff;
  26. p ++;
  27. }
  28. }
  29.  
  30.  
  31. It also has its own DMA function to read the paywall flag:
  32.  
  33. #if GATEWAY_SW
  34. static void gatewayDma( u32 flag, void *pData, uint dataSize )
  35. {
  36. osWritebackDCache( pData, dataSize );
  37. osInvalDCache( osPhysicalToVirtual((uint)pData), (int)dataSize );
  38.  
  39. sramIoMesg.hdr.pri = OS_MESG_PRI_NORMAL;
  40. sramIoMesg.hdr.retQueue = &MesgQ_DMA;
  41. sramIoMesg.dramAddr = pData;
  42. sramIoMesg.devAddr = 0xff70000;
  43. sramIoMesg.size = dataSize;
  44.  
  45. osEPiStartDma( pSramHandle, &sramIoMesg, flag );
  46. (void)osRecvMesg( &MesgQ_DMA, NULL, OS_MESG_BLOCK );
  47. }
  48.  
  49. void writeGateWay( ushort value )
  50. {
  51. regGateWay = value;
  52.  
  53. gatewayDma( OS_WRITE, &regGateWay, sizeof( regGateWay ) );
  54. }
  55.  
  56. #endif
  57.  
  58.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement