No Description

main.c 1.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. #include "include/gba.h"
  2. #include "sots.h"
  3. #include "jukebox_types.h"
  4. void unloadRoutine();
  5. void loadContent();
  6. int mainCallback() // main loop
  7. {
  8. JukeMem *jukeMemPtr;
  9. jukeMemPtr = (JukeMem *) globalVars;
  10. switch (jukeMemPtr->mode)
  11. {
  12. case ENTRY:
  13. if (fadeScreenDone == 0)
  14. {
  15. clearOAM();
  16. fadeScreenNormal();
  17. loadContent();
  18. jukeMemPtr->mode = FADEIN;
  19. }
  20. break;
  21. case FADEIN:
  22. if (fadeScreenDone == 0)
  23. {
  24. jukeMemPtr->mode = MAIN;
  25. }
  26. break;
  27. case MAIN:
  28. //songNumStartOrChange(404);
  29. jukeMemPtr->mode = FADEOUT;
  30. break;
  31. case FADEOUT:
  32. fadeScreenBlack();
  33. jukeMemPtr->mode = EXIT;
  34. break;
  35. case EXIT:
  36. if (fadeScreenDone == 0)
  37. {
  38. fadeScreenNormal();
  39. unloadRoutine();
  40. }
  41. break;
  42. }
  43. updateEverything();
  44. }
  45. int main()
  46. {
  47. globalVars = malloc(sizeof(JukeMem));
  48. storeCallback((void *)(&mainCallback + 1));
  49. fadeScreenBlack();
  50. JukeMem *jukeMemPtr;
  51. jukeMemPtr = (JukeMem *)globalVars;
  52. jukeMemPtr->mode = ENTRY;
  53. }
  54. void unloadRoutine()
  55. {
  56. storeCallback(nullCallback);
  57. free((void *)globalVars);
  58. someExitFunc();
  59. }
  60. void resetBackgrounds()
  61. {
  62. }
  63. void loadContent() // load all graphics from memory to VRAM and init registers
  64. {
  65. }