Bez popisu

sots.c 1.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. #include "include/gba.h"
  2. #include "oam_types.h"
  3. void initStuff()
  4. {
  5. int(*func)(void) = (int(*)(void))0x08006975; //OK / Clear OAM
  6. func();
  7. int(*func2)(void) = (int(*)(void))0x0800870D; //OK
  8. func2();
  9. int(*func3)(u8) = (int(*)(u8))0x080017BD; //OK
  10. func3((u8)0x0);
  11. }
  12. void updateEverything()
  13. {
  14. int(*func)(void) = (int(*)(void))0x080A9129; //Transliterate... OK
  15. func();
  16. int(*func2)(void) = (int(*)(void))0x080069C1; //OK
  17. func2();
  18. int(*func3)(void) = (int(*)(void))0x08006A0D; //OK
  19. func3();
  20. int(*func4)(void) = (int(*)(void))0x080A1A39; // Transliterate... OK
  21. func4();
  22. }
  23. void updateEverything2()
  24. {
  25. int(*func)(void) = (int(*)(void))0x08007189; //OK
  26. func();
  27. int(*func2)(void) = (int(*)(void))0x0800742D; //OK
  28. func2();
  29. int(*func3)(void) = (int(*)(void))0x080A19DD; //Transliterate... OK
  30. func3();
  31. }
  32. void fadeScreenBlack()
  33. {
  34. int(*func)(u32, u32, u32, u32, u32) = (int(*)(u32, u32, u32, u32, u32))0x080A1AF1;
  35. func(0xFFFFFFFF, 0x0, 0, 0x10, 0x0000);
  36. }
  37. void fadeScreenNormal()
  38. {
  39. int(*func)(u32, u32, u32, u32, u32) = (int(*)(u32, u32, u32, u32, u32))0x080A1AF1;
  40. func(0xFFFFFFFF, 0x0, 0x10, 0, 0x0000);
  41. }
  42. Sprite *createSprite(int *addr, int *addr2, u16 XPos, u16 YPos, u8 i)
  43. {
  44. int(*func)(int *) = (int(*)(int *))0x080084F9; //OK
  45. func(addr);
  46. int(*func2)(int *, u16, u16, u8) = (int(*)(int *, u16, u16, u8))0x08006DF5; //OK
  47. int result = func2(addr2, XPos, YPos, (u8)0);
  48. result = ((result * 0x44) + ((int)objBaseAddr));
  49. return (Sprite *)result;
  50. }
  51. void CpuSet(void *srcPtr, void *dstPtr, int lengthMode)
  52. {
  53. SystemCall(0xB);
  54. }
  55. void deleteSprite(Sprite *spritePtr)
  56. {
  57. CpuSet((void *)0x0830238C, (Sprite *)spritePtr, 0x4000011);
  58. }