main.c 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #include "data.h";
  2. #include "pad.h";
  3. #include "event.h";
  4. #include "myEvents.h";
  5. #include "ressource.h";
  6. #include "PPU.h"
  7. #include "debug.h"
  8. #include <stdlib.h>
  9. padStatus pad1;
  10. void initInternalRegisters(void) {
  11. characterLocation[0] = 0x0000;
  12. characterLocation[1] = 0x0000;
  13. characterLocation[2] = 0x0000;
  14. characterLocation[3] = 0x0000;
  15. initDebugMap();
  16. }
  17. void preInit(void) {
  18. // For testing purpose ...
  19. // Insert code here to be executed before register init
  20. }
  21. void main(void) {
  22. word i,j;
  23. word crc01;
  24. word crc02;
  25. padStatus pad1;
  26. char line_header[32] = "OK2";
  27. char packet[4] = "TEST";
  28. initInternalRegisters();
  29. *(byte*) 0x2105 = 0x01; // MODE 1 value
  30. *(byte*) 0x212c = 0x01; // Plane 0 (bit one) enable register
  31. *(byte*) 0x212d = 0x00; // All subPlane disable
  32. *(byte*) 0x2100 = 0x0f; // enable background
  33. enableDebugScreen();
  34. printDebugScreen(line_header,0);
  35. printf("Debugging console test\n");
  36. printf("test me\n");
  37. printDebugScreen(line_header,1);
  38. while(1){
  39. while(!pad1.start) {
  40. waitForVBlank();
  41. pad1 = readPad((byte) 0);
  42. }
  43. }
  44. while(1);
  45. }
  46. void IRQHandler(void) {
  47. }
  48. void NMIHandler(void) {
  49. //processEvents();
  50. }