SHARE
TWEET

Untitled

a guest Jun 10th, 2016 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2. ;       2dofchar.dls        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  3. ;    Elliott Smith (2016)    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  4. ;----------------------------------------------------------------------------------------------;
  5. ;This is a hacky mess to demonstrate how DMA and layer movement can be (ab)used to display a   ;
  6. ;smooth-scrolling map that is larger than the 16x16 tile-wide layer tile buffer offered by the ;
  7. ;ECOGPU module.                                                                                ;
  8. ;Also demonstrated is a horrible method for polling the keypad for movement.                   ;
  9. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  10. ;------------------------------------------------------------------------------------------------------------------;
  11.  
  12. ;The top of the program should always contain the interrupt handlers. These are one word long, and should either
  13. ;contain an RFE if no action is to be taken (though they should be disabled in that case...) or a jump operation
  14. ;to direct the interrupt to the handler.
  15. ;JAL is a horrible idea here.
  16.             .seg    program
  17. IRQ7        j       DMAComp         ;DMA COMPLETE - we should only be waiting for DMAs at this time anyway.
  18. IRQ6        rfe    
  19. IRQ5        j       vblank          ;VBLANK
  20. IRQ4        rfe                     ;HBLANK
  21. IRQ3        rfe
  22. IRQ2        rfe
  23. IRQ1        rfe
  24. IRQ0        rfe
  25. UTE         rfe
  26. OFE         rfe
  27. MPE         rfe
  28. IME         rfe
  29. IIE         rfe
  30. FIE         rfe
  31.  
  32.             .seg    graphics
  33. ;Unfortunately this mess is the only way to embed binaries supported by the assembler.
  34. P_PAL_U         .halfu  16#0000,16#1803,16#34C6,16#4D89,16#6006,16#6E61,16#7F12,16#7F44
  35. P_PAL_L         .halfu  16#0000,16#1803,16#3003,16#34C6,16#4D89,16#6006,16#714C,16#0000
  36. P_PAL_LEN       .equ        16#20
  37.  
  38. P_U_F_0     .halfu  16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0660,16#0000,16#0660,16#0FF0,16#0000,16#05A0,16#0A50,16#05A0,16#0660,16#0990,16#0660,16#0180,16#0240,16#0E70,16#0000,16#0810,16#1FF8
  39. P_L_F_0     .halfu  16#0000,16#17E8,16#2BD4,16#0000,16#1BD8,16#2424,16#05A0,16#05A0,16#3A5C,16#0DB0,16#0DB0,16#1248,16#07E0,16#07E0,16#0810,16#0810,16#0810,16#17E8,16#15E8,16#11C8,16#2FF4,16#0FF0,16#03C0,16#1FF8,16#07E0,16#0000,16#0FF0,16#0C30,16#0000,16#03C0,16#0660,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000
  40. P_U_F_1     .halfu  16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0660,16#0000,16#0660,16#0FF0,16#0000,16#05A0,16#0A50,16#05A0,16#0660,16#0990,16#0660,16#0180,16#0240,16#0E70,16#0000,16#0810,16#1FF8
  41. P_L_F_1     .halfu  16#0000,16#17E8,16#2BD4,16#0000,16#1BD8,16#2424,16#05A0,16#05A0,16#3A5C,16#0DB0,16#0DB0,16#1248,16#07E0,16#07E0,16#0810,16#0810,16#0810,16#17E8,16#15E8,16#11C8,16#2FF4,16#0FF0,16#03C0,16#1FF8,16#07E0,16#0000,16#0FF0,16#0600,16#0000,16#01E0,16#0300,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000
  42. P_U_B_0     .halfu  16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0660,16#0000,16#0660,16#0FF0,16#0000,16#05A0,16#0A50,16#05A0,16#0660,16#0990,16#0660,16#0000,16#07E0,16#0990,16#0000,16#0FF0,16#1FF8
  43. P_L_B_0     .halfu  16#0000,16#1FF8,16#2814,16#0000,16#1FF8,16#25A4,16#0000,16#07E0,16#381C,16#0000,16#0000,16#1FF8,16#0000,16#0000,16#0FF0,16#0810,16#0810,16#17E8,16#17E8,16#13C8,16#2C34,16#0FF0,16#03C0,16#1FF8,16#07E0,16#0000,16#0FF0,16#0C30,16#0000,16#03C0,16#0660,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000
  44. P_U_B_1     .halfu  16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0660,16#0000,16#0660,16#0FF0,16#0000,16#05A0,16#0A50,16#05A0,16#0660,16#0990,16#0660,16#0000,16#07E0,16#0990,16#0000,16#0FF0,16#1FF8
  45. P_L_B_1     .halfu  16#0000,16#1FF8,16#2814,16#0000,16#1FF8,16#25A4,16#0000,16#07E0,16#381C,16#0000,16#0000,16#1FF8,16#0000,16#0000,16#0FF0,16#0810,16#0810,16#17E8,16#17E8,16#13C8,16#2C34,16#0FF0,16#03C0,16#1FF8,16#07E0,16#0000,16#0FF0,16#0600,16#0000,16#01E0,16#0300,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000
  46. P_U_S_0     .halfu  16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#001C,16#0000,16#001C,16#003E,16#0000,16#002C,16#0056,16#0028,16#000C,16#0002,16#03FC,16#0000,16#01F4,16#0FF8,16#0000,16#0EF8,16#1FFC
  47. P_L_S_0     .halfu  16#0000,16#1CF8,16#3F54,16#0300,16#0F78,16#3084,16#0D00,16#0D78,16#1284,16#0D00,16#0D00,16#12FC,16#07C0,16#07C0,16#0838,16#0300,16#0300,16#04F0,16#0180,16#01C0,16#0620,16#06C0,16#07E0,16#0E10,16#0720,16#00C0,16#0F30,16#0000,16#0000,16#07E0,16#0380,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000
  48. P_U_S_1     .halfu  16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#001C,16#0000,16#001C,16#003E,16#0000,16#002C,16#0056,16#0028,16#000C,16#0002,16#03FC,16#0000,16#01F4,16#0FF8,16#0000,16#0EF8,16#1FFC
  49. P_L_S_1     .halfu  16#0000,16#1CF8,16#3F54,16#0300,16#0F78,16#3084,16#0D00,16#0D78,16#1284,16#0D00,16#0D00,16#12FC,16#07C0,16#07C0,16#0838,16#0300,16#0380,16#0470,16#0180,16#01C0,16#0620,16#06C0,16#07E0,16#0E10,16#0730,16#00C0,16#0F20,16#1C18,16#0000,16#03E0,16#0E70,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000
  50. P_U_S_2     .halfu  16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#001C,16#0000,16#001C,16#003E,16#0000,16#002C,16#0056,16#0028,16#000C,16#0002,16#03FC,16#0000,16#01F4,16#0FF8,16#0000,16#0EF8,16#1FFC
  51. P_L_S_2     .halfu  16#0000,16#1CF8,16#3F54,16#0300,16#0F78,16#3084,16#0D00,16#0D78,16#1284,16#0D00,16#0D00,16#12FC,16#07C0,16#07C0,16#0838,16#0300,16#0380,16#0470,16#0180,16#01C0,16#0620,16#06C0,16#07E0,16#0E10,16#0728,16#00C0,16#0F30,16#1818,16#0000,16#07E0,16#0E30,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000
  52. P_SPR_LEN       .equ    16#5A0
  53.  
  54.  
  55. sprite          .halfu  2#0000000000000000,2#0000000000000000,2#0000000000000000,2#0000000000000000,2#0000000000000000,2#0000000000000000,2#0000000000000000,2#0000000000000000,2#0000000000000000,2#0000000000000000,2#0001111111111000,2#0001111111111000,2#0000000000000000,2#0001000000001000,2#0001000000001000,2#0000000000000000,2#0001001111001000,2#0001000000001000,2#0000000000000000,2#0001010000101000,2#0001001111001000,2#0000000000000000,2#0001000000101000,2#0001000000011000,2#0000000000000000,2#0001000001001000,2#0001000000101000,2#0000000000000000,2#0001000010001000,2#0001000001001000,2#0000000000000000,2#0001000100001000,2#0001000010001000,2#0000000000000000,2#0001000100001000,2#0001000010001000,2#0000000000000000,2#0001111111111000,2#0001111111111000,2#0000000000000000,2#0000000000000000,2#0000000000000000,2#0000000000000000,2#0000000000000000,2#0000000000000000,2#0000000000000000,2#0000000000000000,2#0000000000000000
  56. inst0           .byteu  2#11000000,2#00000000,2#01000000,2#01000000
  57. ;inst1          .byteu  2#00010000,2#00000100,2#01010000,2#01000000
  58. ;inst2          .byteu  2#00100000,2#00000100,2#01100000,2#01000000
  59. ;inst3          .byteu  2#00110000,2#00000100,2#01110000,2#01000000
  60. ;inst4          .byteu  2#01000000,2#00000100,2#10000000,2#01000000
  61. ;inst5          .byteu  2#01010000,2#00000100,2#10010000,2#01000000
  62. ;inst6          .byteu  2#01100000,2#00000100,2#10100000,2#01000000
  63. ;inst7          .byteu  2#01110000,2#00000100,2#10110000,2#01000000
  64. layer0          .byteu  2#00000001,2#00000000,2#00000000,2#00000000
  65. layer1          .byteu  2#00000001,2#00000000,2#00000000,2#00000000
  66. layer2          .byteu  2#00000000,2#00000000,2#00000000,2#00000000
  67. palette0        .halfu  2#0000001111100000, 2#0111111111100000, 2#0000001111111111, 2#0000000000011111, 2#0000000000000000, 2#0000000000000000, 2#0000000000000000, 2#0000000000000000
  68.  
  69. PAL_00      .halfu  16#18C2,16#2126,16#2586,16#2DE6,16#3A64,16#426C,16#46E5,16#52EF
  70. PAL_01      .halfu  16#18C2,16#2126,16#2586,16#2DE6,16#3A64,16#52EF,16#0000,16#0000
  71. PAL_02      .halfu  16#0A6C,16#1D25,16#29E8,16#2DED,16#328E,16#3A8C,16#42EF,16#52EF
  72. PAL_03      .halfu  16#18C2,16#2126,16#2586,16#2949,16#2DE6,16#3586,16#426C,16#52EF
  73. PAL_04      .halfu  16#0A6C,16#1D25,16#20A5,16#29E8,16#2DED,16#30E7,16#328E,16#416B
  74. PAL_05      .halfu  16#0000,16#1D25,16#2DED,16#3A8C,16#426C,16#42EF,16#52EF,16#5B31
  75. PAL_06      .halfu  16#0000,16#52D8,16#52EF,16#5F19,16#6B7B,16#739B,16#0000,16#0000
  76. PAL_07      .halfu  16#0A6C,16#1D25,16#29E8,16#2DED,16#328E,16#3A8C,16#42EF,16#52EF
  77. PAL_08      .halfu  16#0000,16#1D0C,16#294D,16#3DF0,16#739B,16#0000,16#0000,16#0000
  78. PAL_09      .halfu  16#0000,16#1D25,16#20A5,16#2DED,16#3A8C,16#42EF,16#0000,16#0000
  79. PAL_LEN     .equ        16#A0
  80.  
  81. SPR_00      .halfu  16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000
  82. SPR_01      .halfu  16#FFFF,16#FFFF,16#0000,16#FFFF,16#FC3C,16#0000,16#FFFF,16#F800,16#0000,16#FFFF,16#F000,16#0000,16#FFFF,16#E0C1,16#0000,16#FFFF,16#C1FF,16#00C1,16#FFFF,16#C3FF,16#01FF,16#FFFF,16#C7FF,16#03FF,16#FFFF,16#8FFF,16#07FF,16#FFFF,16#8FFF,16#07FF,16#FFFF,16#87FF,16#03F9,16#FFFF,16#87FF,16#03F9,16#FFFF,16#87FF,16#03BF,16#FFFF,16#C7FF,16#03EF,16#FFFF,16#CFFF,16#07FF,16#FFFF,16#CFFF,16#07FF
  83. SPR_02      .halfu  16#FFFF,16#FFFF,16#0000,16#FFFF,16#3C3C,16#0000,16#FFFF,16#0000,16#0000,16#FFFF,16#0000,16#0000,16#FFFF,16#C1C1,16#0000,16#FFFF,16#FFFF,16#C1C1,16#FFFF,16#FFFF,16#FFFF,16#FFFF,16#FFFF,16#FFFF,16#FFFF,16#FFFF,16#FFFF,16#FFFF,16#FFFF,16#FFFF,16#FFFF,16#FFFF,16#FFFF,16#FFFF,16#FFFF,16#9FFF,16#FFFF,16#FFFF,16#9FFF,16#FFFF,16#FFFF,16#FDFF,16#FFFF,16#FFFF,16#F7FF,16#FFFF,16#FFFF,16#FFFF
  84. SPR_03      .halfu  16#0000,16#FFFF,16#0000,16#0000,16#FFFF,16#0000,16#0000,16#E087,16#1F78,16#0F78,16#C000,16#3FFF,16#1F7B,16#C000,16#3FFF,16#1F7B,16#C000,16#3FFF,16#1F03,16#C000,16#3FFF,16#1E00,16#C0FC,16#3FFF,16#007F,16#E100,16#1F80,16#1CBF,16#C100,16#3F40,16#1CDF,16#C100,16#3F20,16#1CEF,16#C110,16#3F10,16#1CE7,16#C118,16#3F18,16#00DA,16#E125,16#1F25,16#0EBD,16#E000,16#1F42,16#0E7E,16#E000,16#1F81
  85. SPR_04      .halfu  16#0000,16#FFFF,16#0000,16#0000,16#FFFF,16#0000,16#0000,16#87C0,16#783F,16#781E,16#0001,16#FFFF,16#7BDE,16#0001,16#FFFF,16#7BDE,16#0001,16#FFFF,16#03C0,16#0001,16#FFFF,16#001E,16#FC00,16#FFE1,16#807F,16#3E00,16#7F80,16#C1BF,16#1C00,16#3E40,16#E3DF,16#0C00,16#1C20,16#F7EF,16#0010,16#0810,16#EFE7,16#0018,16#1018,16#DFDA,16#2025,16#2025,16#BFBD,16#4000,16#4042,16#7F7E,16#0000,16#8081
  86. SPR_05      .halfu  16#FFFF,16#8FFF,16#07FF,16#FFFF,16#8FFF,16#07FF,16#FFFF,16#87FF,16#03FF,16#FFFF,16#87FF,16#03FF,16#FFFF,16#87FF,16#03FF,16#FFFF,16#C7FF,16#03FF,16#FFFF,16#CFFF,16#07FF,16#FFFF,16#CFFF,16#07FF,16#FFFF,16#8FFF,16#07FF,16#FFFF,16#8FFF,16#07FF,16#FFFF,16#87FF,16#03FF,16#FFFF,16#87FF,16#03F9,16#FFFF,16#87FF,16#03F9,16#FFFF,16#C7FF,16#03BF,16#FFFF,16#CFFF,16#07EF,16#FFFF,16#CFFF,16#07FF
  87. SPR_06      .halfu  16#FFFF,16#FFFF,16#FFFF,16#FFFF,16#FFFF,16#FFFF,16#FFFF,16#FFFF,16#F9FF,16#FFFF,16#FFFF,16#F9FF,16#FFFF,16#FFFF,16#BFFF,16#FFFF,16#FFFF,16#EFFF,16#FFFF,16#FFFF,16#FFFF,16#FFFF,16#FFFF,16#FFFF,16#FFFF,16#FFFF,16#FFFF,16#FFFF,16#FFFF,16#FFFF,16#FFFF,16#FFFF,16#FFFF,16#FFFF,16#FFFF,16#FF9F,16#FFFF,16#FFFF,16#FF9F,16#FFFF,16#FFFF,16#FFFD,16#FFFF,16#FFFF,16#FFF7,16#FFFF,16#FFFF,16#FFFF
  88. SPR_07      .halfu  16#FFFF,16#FFF1,16#FFE0,16#FFFF,16#FFF1,16#FFE0,16#FFFF,16#FFE1,16#F9C0,16#FFFF,16#FFE1,16#F9C0,16#FFFF,16#FFE1,16#BFC0,16#FFFF,16#FFE3,16#EFC0,16#FFFF,16#FFF3,16#FFE0,16#FFFF,16#FFF3,16#FFE0,16#FFFF,16#FFF1,16#FFE0,16#FFFF,16#FFF1,16#FFE0,16#FFFF,16#FFE1,16#FFC0,16#FFFF,16#FFE1,16#FFC0,16#FFFF,16#FFE1,16#FFC0,16#FFFF,16#FFE3,16#FFC0,16#FFFF,16#FFF3,16#FFE0,16#FFFF,16#FFF3,16#FFE0
  89. SPR_08      .halfu  16#007F,16#E100,16#1F80,16#1C3F,16#C180,16#3FC0,16#1C1F,16#C1C0,16#3FE0,16#1C0F,16#C1E0,16#3FF0,16#1C07,16#C1E0,16#3FF8,16#001B,16#E1E4,16#1FE4,16#0E3D,16#E082,16#1FC2,16#0E7E,16#E000,16#1F81,16#0E7F,16#E000,16#1F80,16#0EBF,16#E000,16#1F40,16#00DF,16#C000,16#3F20,16#1DEF,16#C010,16#3E10,16#1DE7,16#C018,16#3E18,16#1DDA,16#C025,16#3E25,16#1DBD,16#C000,16#3E42,16#007E,16#C100,16#3F81
  90. SPR_09      .halfu  16#7E7F,16#0000,16#8180,16#BC3F,16#4180,16#43C0,16#D81F,16#07C0,16#27E0,16#E00F,16#17E0,16#1FF0,16#E007,16#0FE0,16#1FF8,16#C01B,16#3FE4,16#3FE4,16#803D,16#3F82,16#7FC2,16#007E,16#7F00,16#FF81,16#807F,16#3E00,16#7F80,16#C1BF,16#1C00,16#3E40,16#E3DF,16#0C00,16#1C20,16#F7EF,16#0010,16#0810,16#EFE7,16#0018,16#1018,16#DFDA,16#2025,16#2025,16#BFBD,16#4000,16#4042,16#7F7E,16#0000,16#8081
  91. SPR_0A      .halfu  16#7E00,16#0087,16#81F8,16#BC38,16#4183,16#43FC,16#D838,16#0783,16#27FC,16#E038,16#1783,16#1FFC,16#E038,16#0F83,16#1FFC,16#C000,16#3F87,16#3FF8,16#8070,16#3F07,16#7FF8,16#0070,16#7F07,16#FFF8,16#8070,16#3E07,16#7FF8,16#C170,16#1C07,16#3EF8,16#E300,16#0C03,16#1CFC,16#F7B8,16#0003,16#087C,16#EFB8,16#0003,16#107C,16#DFB8,16#2003,16#207C,16#BFB8,16#4003,16#407C,16#7F00,16#0083,16#80FC
  92. SPR_0B      .halfu  16#0E7F,16#E000,16#1F80,16#0E3F,16#E080,16#1FC0,16#001F,16#E1C0,16#1FE0,16#1C0F,16#C1E0,16#3FF0,16#1C07,16#C1E0,16#3FF8,16#1C1B,16#C1E4,16#3FE4,16#1C3D,16#C182,16#3FC2,16#007E,16#E100,16#1F81,16#1E00,16#C0FC,16#3FFF,16#1F03,16#C000,16#3FFF,16#1F7B,16#C000,16#3FFF,16#1F7B,16#C000,16#3FFF,16#0F78,16#C000,16#3FFF,16#0000,16#E087,16#1F78,16#0000,16#FFFF,16#0000,16#0000,16#FFFF,16#0000
  93. SPR_0C      .halfu  16#7E7F,16#0000,16#8180,16#BC3F,16#4180,16#43C0,16#D81F,16#07C0,16#27E0,16#E00F,16#17E0,16#1FF0,16#E007,16#0FE0,16#1FF8,16#C01B,16#3FE4,16#3FE4,16#803D,16#3F82,16#7FC2,16#007E,16#7F00,16#FF81,16#001E,16#FC00,16#FFE1,16#03C0,16#0001,16#FFFF,16#7BDE,16#0001,16#FFFF,16#7BDE,16#0001,16#FFFF,16#781E,16#0001,16#FFFF,16#0000,16#87C0,16#783F,16#0000,16#FFFF,16#0000,16#0000,16#FFFF,16#0000
  94. SPR_0D      .halfu  16#7E70,16#0007,16#81F8,16#BC70,16#4107,16#43F8,16#D800,16#0787,16#27F8,16#E038,16#1783,16#1FFC,16#E038,16#0F83,16#1FFC,16#C038,16#3F83,16#3FFC,16#8038,16#3F83,16#7FFC,16#0000,16#7F87,16#FFF8,16#0078,16#3F03,16#FFFC,16#C0F8,16#0003,16#FFFC,16#DEF8,16#0003,16#FFFC,16#DEF8,16#0003,16#FFFC,16#1EF0,16#0003,16#FFFC,16#0000,16#E107,16#1EF8,16#0000,16#FFFF,16#0000,16#0000,16#FFFF,16#0000
  95. SPR_0E      .halfu  16#7E70,16#0007,16#81F8,16#BC70,16#4107,16#43F8,16#D840,16#0707,16#27F8,16#E038,16#1700,16#1FFF,16#E07B,16#0F00,16#1FFF,16#C03B,16#3F80,16#3FFF,16#801B,16#3FC0,16#7FFF,16#0000,16#7F60,16#FFFF,16#807F,16#3E00,16#7F80,16#C1BF,16#1C00,16#3E40,16#E3DF,16#0C00,16#1C20,16#F7EF,16#0010,16#0810,16#EFE7,16#0018,16#1018,16#DFDA,16#2025,16#2025,16#BFBD,16#4000,16#4042,16#7F7E,16#0000,16#8081
  96. SPR_0F      .halfu  16#7E7F,16#0000,16#8180,16#BC3F,16#4180,16#43C0,16#D81F,16#07C0,16#27E0,16#E00F,16#17E0,16#1FF0,16#E007,16#0FE0,16#1FF8,16#C01B,16#3FE4,16#3FE4,16#803D,16#3F82,16#7FC2,16#007E,16#7F00,16#FF81,16#8000,16#3E60,16#7FFF,16#C11B,16#1CC0,16#3EFF,16#E33B,16#0C80,16#1CFF,16#F77B,16#0000,16#08FF,16#EF38,16#0000,16#10FF,16#DF40,16#2007,16#20F8,16#BF70,16#4007,16#40F8,16#7F70,16#0007,16#80F8
  97. SPR_10      .halfu  16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0180,16#0000,16#0000,16#0180,16#0000,16#0000,16#0180,16#0000,16#0180,16#03C0,16#0000,16#0240,16#05A0,16#0000,16#03C0,16#0E70,16#0000,16#1DB8,16#3BDC,16#0000,16#0E70,16#7DBE
  98. SPR_11      .halfu  16#0000,16#67E6,16#DFFB,16#0000,16#1998,16#F7EF,16#0000,16#0C30,16#7BDE,16#0000,16#4662,16#3DBC,16#2004,16#43C2,16#1E78,16#300C,16#4182,16#0FF0,16#1818,16#2424,16#03C0,16#1C38,16#0240,16#2184,16#1E78,16#0180,16#2004,16#0E70,16#0180,16#1008,16#0240,16#0180,16#0C30,16#0000,16#0180,16#0660,16#0000,16#0000,16#03C0,16#0000,16#0000,16#0180,16#0000,16#0000,16#0180,16#0000,16#0000,16#0180
  99. SPR_12      .halfu  16#0000,16#0000,16#0180,16#0000,16#0000,16#0180,16#0000,16#0000,16#0180,16#0000,16#0000,16#0180,16#0000,16#0000,16#0180,16#0000,16#0E70,16#0180,16#0000,16#0E70,16#05A0,16#0000,16#0E70,16#05A0,16#0000,16#0E70,16#05A0,16#0000,16#0FF0,16#0420,16#0000,16#0FF0,16#07E0,16#0000,16#0FF0,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000
  100. SPR_13      .halfu  16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0001,16#0000,16#0000,16#0001,16#0000
  101. SPR_14      .halfu  16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0240,16#0DB0,16#0DB0,16#0DB0,16#324C,16#3E7C,16#3FFC,16#4002,16#6BD6,16#7FFE,16#8001,16#BFFD,16#FFFF,16#0000,16#DFFB,16#FFFF,16#0000,16#5FFA
  102. SPR_15      .halfu  16#E000,16#E1F7,16#EE08,16#E000,16#E0E3,16#EB1C,16#F000,16#E001,16#F77E,16#F800,16#E000,16#FAFF,16#F803,16#C400,16#FCF4,16#F807,16#8603,16#FF18,16#F01F,16#8E07,16#FFE0,16#F07F,16#8C0F,16#FF80,16#F83F,16#854F,16#FFC0,16#F97F,16#C28F,16#FF80,16#F9FF,16#C207,16#FF00,16#F9FF,16#E207,16#FD00,16#F0BF,16#E743,16#FF40,16#E07F,16#EF81,16#FF80,16#C07F,16#CF80,16#DF80,16#C07F,16#DF80,16#C780
  103. SPR_16      .halfu  16#FFE2,16#FFFF,16#FFFD,16#FF8D,16#FFCF,16#FFF2,16#FFBB,16#FFEE,16#FFD5,16#FE6B,16#FF96,16#FFFD,16#FDFD,16#FFBA,16#FE47,16#FFFF,16#F478,16#F787,16#F9F9,16#B5FE,16#B607,16#F7FC,16#DFF3,16#D80F,16#F7FF,16#F720,16#F8DF,16#EF7E,16#E6B7,16#F9C9,16#EFFF,16#E03F,16#FFC0,16#EFFF,16#E1FF,16#FE00,16#EFFF,16#E5FF,16#FA00,16#F3FF,16#F3FF,16#FC00,16#EBFF,16#E5FF,16#FE00,16#D5FF,16#CBF3,16#FE0C
  104. SPR_17      .halfu  16#7FFE,16#8001,16#FFFF,16#37EC,16#C813,16#FFFF,16#799E,16#8661,16#FFFF,16#7FFE,16#8001,16#FFFF,16#1FF8,16#E007,16#FFFF,16#1E78,16#E187,16#FFFF,16#0420,16#FBDF,16#7FFE,16#0000,16#FFFF,16#BFFD,16#0000,16#FFFF,16#2FF4,16#0000,16#BFFD,16#CDB3,16#0000,16#CBD3,16#35AC,16#8001,16#75AE,16#CBD3,16#8001,16#7FFE,16#C663,16#8661,16#799E,16#FFFF,16#E7E7,16#1818,16#FFFF,16#7FFE,16#8001,16#FFFF
  105. SPR_18      .halfu  16#47FF,16#BFFF,16#4000,16#B1FF,16#43FF,16#BC00,16#55FF,16#ABFF,16#DC00,16#407F,16#BFFF,16#D600,16#1DBF,16#E27F,16#BF80,16#1E3F,16#E1FF,16#FFC8,16#1F9F,16#E03F,16#9FC9,16#0FEF,16#F01F,16#3FE2,16#04EF,16#FB0F,16#FFF0,16#6C67,16#9397,16#7EF8,16#FC07,16#03F7,16#FFF8,16#FF87,16#0077,16#FFF8,16#FFA7,16#0057,16#FFF8,16#FFCF,16#000F,16#FFF0,16#FF87,16#0077,16#FFD8,16#CF83,16#307B,16#FFAC
  106. SPR_19      .halfu  16#803B,16#3FC4,16#8CC4,16#8007,16#3FF8,16#9CF8,16#8007,16#3FF8,16#9FF8,16#8003,16#1FFC,16#BFCC,16#C000,16#1FFF,16#CBCF,16#C000,16#1FFF,16#C7FF,16#8000,16#3FFF,16#87FF,16#0000,16#7FFF,16#037F,16#0000,16#7FFF,16#00F3,16#0000,16#7FFF,16#00F2,16#0000,16#3FFF,16#40FF,16#0000,16#1FFF,16#4077,16#8000,16#0BFF,16#B403,16#8000,16#07FF,16#B000,16#C000,16#07EF,16#D010,16#E000,16#03EF,16#EC10
  107. SPR_1A      .halfu  16#19FE,16#06E1,16#3F1F,16#3AFE,16#1519,16#6FE7,16#3C7C,16#0B9B,16#77E7,16#1E18,16#75E5,16#6BFF,16#3F00,16#48FC,16#77FF,16#3E80,16#0170,16#7FFF,16#0D80,16#3264,16#7FFF,16#0108,16#7EA7,16#7FFF,16#809E,16#5F21,16#7FFF,16#C01F,16#21E0,16#3FFF,16#C02F,16#B1D0,16#BFFF,16#E05F,16#9820,16#9FFF,16#E035,16#C60A,16#C7FF,16#E000,16#E32F,16#E3FF,16#E000,16#C395,16#C3FF,16#E000,16#87CC,16#873F
  108. SPR_1B      .halfu  16#D9FE,16#C6E1,16#FF1F,16#BAFE,16#9519,16#EFE7,16#BC7C,16#8B9B,16#F7E7,16#9E18,16#F5E5,16#EBFF,16#BF00,16#C8FC,16#F7FF,16#BE80,16#8170,16#FFFF,16#8D80,16#B264,16#FFFF,16#C108,16#FEA7,16#FFFF,16#C09E,16#DF21,16#FFFF,16#E01F,16#E1E0,16#FFFF,16#F02F,16#F1D0,16#FFFF,16#F85F,16#F820,16#FFFF,16#FE35,16#F00A,16#F1FF,16#FC00,16#E12F,16#E1FF,16#F000,16#C795,16#C7FF,16#E000,16#8FCC,16#8F3F
  109. SPR_1C      .halfu  16#FFFF,16#0000,16#77EE,16#FFFF,16#0000,16#F99F,16#FFFF,16#0000,16#BFFD,16#7FFE,16#8001,16#BFFD,16#3FFC,16#C003,16#CE73,16#0FF0,16#F00F,16#F00F,16#0180,16#3E7C,16#FE7F,16#0000,16#9FF9,16#FFFF,16#8421,16#3BDC,16#7BDE,16#CE73,16#318C,16#318C,16#CC33,16#33CC,16#33CC,16#C423,16#33CC,16#3BDC,16#8001,16#67E6,16#7FFE,16#0000,16#D24B,16#FFFF,16#0000,16#8001,16#FFFF,16#0000,16#0E70,16#F18F
  110. SPR_1D      .halfu  16#E000,16#E1F7,16#EE08,16#E000,16#E0E3,16#EB1C,16#F000,16#F001,16#E77E,16#F800,16#F800,16#E2FF,16#FC00,16#F800,16#C0F7,16#FE00,16#F800,16#810F,16#FE10,16#F060,16#8175,16#FE08,16#F070,16#8179,16#FF0C,16#F802,16#808E,16#FF06,16#F809,16#C0EF,16#FF80,16#F806,16#C076,16#FFC0,16#FC00,16#E039,16#FFF0,16#FE00,16#E00F,16#FFFC,16#FF00,16#E003,16#FFFF,16#FFC0,16#F000,16#FFFF,16#FFFF,16#FC00
  111. SPR_1E      .halfu  16#C000,16#1FE1,16#1E1E,16#C000,16#3FF8,16#3C07,16#8000,16#3FF0,16#380F,16#8000,16#3FF0,16#380F,16#8000,16#3FF0,16#380F,16#C000,16#3FF8,16#3807,16#C000,16#1FFE,16#1C01,16#E000,16#9FFF,16#9E00,16#F000,16#8FFF,16#8F80,16#F800,16#C3FF,16#C3E0,16#FE00,16#E0FF,16#E0FC,16#FF80,16#F03F,16#F03F,16#FFF0,16#FC03,16#FC03,16#FFFF,16#FF00,16#FF00,16#FFFF,16#FFE0,16#FFE0,16#FFFF,16#FFFC,16#FFFC
  112. SPR_1F      .halfu  16#0420,16#0FF0,16#F42F,16#07E0,16#0C30,16#F7EF,16#07E0,16#0C30,16#F7EF,16#03C0,16#0420,16#FBDF,16#0000,16#03C0,16#FC3F,16#0000,16#0000,16#FFFF,16#0000,16#0000,16#FFFF,16#0000,16#8001,16#FFFF,16#0000,16#F00F,16#FFFF,16#0000,16#FFFF,16#FFFF,16#0000,16#FFFF,16#FFFF,16#8001,16#7FFE,16#7FFE,16#FFFF,16#0000,16#0000,16#1FF8,16#0000,16#0000,16#FFFF,16#FFFF,16#0000,16#FFFF,16#FFFF,16#0000
  113. SPR_20      .halfu  16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000
  114. SPR_LEN     .equ    16#C60
  115. ;Map data
  116. LAY_0           .word   16#580 ;map length
  117. LAY_0_WIDTH     .word   10#32
  118. LAY_0_HEIGHT    .word   10#22
  119. LAY_0_DATA      .halfu  16#0095,16#8095,16#039D,16#839D,16#039D,16#839D,16#039D,16#839D,16#039D,16#839D,16#039D,16#839D,16#039D,16#839D,16#039D,16#839D,16#039D,16#839D,16#039D,16#839D,16#039D,16#839D,16#039D,16#839D,16#039D,16#839D,16#039D,16#839D,16#039D,16#839D,16#0095,16#8095,16#0199,16#8199,16#0581,16#8582,16#8582,16#8582,16#8582,16#8582,16#8582,16#8582,16#8582,16#8582,16#8582,16#8582,16#8582,16#8582,16#8582,16#8582,16#8582,16#8582,16#8582,16#8582,16#8582,16#8582,16#8582,16#8582,16#8582,16#8582,16#8582,16#8581,16#0199,16#8199,16#0095,16#8095,16#4585,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C585,16#0095,16#8095,16#0199,16#8199,16#4585,16#C586,16#C586,16#0683,16#0684,16#0684,16#0684,16#0684,16#0684,16#0684,16#0684,16#0684,16#0684,16#0684,16#0684,16#0684,16#0684,16#0684,16#0684,16#0684,16#0684,16#0684,16#0684,16#8683,16#C586,16#C586,16#C586,16#C585,16#0199,16#8199,16#0095,16#8095,16#4585,16#C586,16#C586,16#0688,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#068A,16#C586,16#C586,16#C586,16#C585,16#0095,16#8095,16#0199,16#8199,16#4585,16#C586,16#C586,16#0688,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#068A,16#C586,16#C586,16#C586,16#C585,16#0199,16#8199,16#0095,16#8095,16#4585,16#C586,16#C586,16#068B,16#C684,16#C684,16#C684,16#C684,16#C684,16#C684,16#C684,16#C684,16#C684,16#C684,16#C684,16#C684,16#C684,16#C68E,16#C689,16#C689,16#C689,16#C689,16#C689,16#068A,16#C586,16#C586,16#C586,16#C585,16#0095,16#8095,16#0199,16#8199,16#4585,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C68A,16#C689,16#C689,16#C689,16#C689,16#C689,16#068A,16#C586,16#C586,16#C586,16#C585,16#0199,16#8199,16#0095,16#8095,16#4585,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C68A,16#C689,16#C689,16#C689,16#C689,16#C689,16#068A,16#C586,16#C586,16#C586,16#C585,16#0095,16#8095,16#0199,16#8199,16#4585,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C68A,16#C689,16#C689,16#C689,16#C689,16#C689,16#068A,16#C586,16#C586,16#C586,16#C585,16#0199,16#8199,16#0095,16#8095,16#4585,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C68A,16#C689,16#C689,16#C689,16#C689,16#C689,16#068A,16#C586,16#C586,16#C586,16#C585,16#0095,16#8095,16#0199,16#8199,16#4585,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C68A,16#C689,16#C689,16#C689,16#C689,16#C689,16#068A,16#C586,16#C586,16#C586,16#C585,16#0199,16#8199,16#0095,16#8095,16#4585,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C68A,16#C689,16#C689,16#C689,16#C689,16#C689,16#068A,16#C586,16#C586,16#C586,16#C585,16#0095,16#8095,16#0199,16#8199,16#4585,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C68A,16#C689,16#C689,16#C689,16#C689,16#C689,16#068A,16#C586,16#C586,16#C586,16#C585,16#0199,16#8199,16#0095,16#8095,16#4585,16#C586,16#0683,16#8684,16#8684,16#8684,16#8684,16#8684,16#8684,16#8684,16#8684,16#8684,16#8684,16#8684,16#8684,16#8684,16#8684,16#C68F,16#C689,16#C689,16#C689,16#C689,16#C689,16#068A,16#C586,16#C586,16#C586,16#C585,16#0095,16#8095,16#0199,16#8199,16#4585,16#C586,16#0688,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#468A,16#C586,16#C586,16#C586,16#C585,16#0199,16#8199,16#0095,16#8095,16#4585,16#C586,16#0688,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#468A,16#C586,16#C586,16#C586,16#C585,16#0095,16#8095,16#0199,16#8199,16#4585,16#C586,16#0688,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#C689,16#468A,16#C586,16#C586,16#C586,16#C585,16#0199,16#8199,16#0095,16#8095,16#4585,16#C586,16#4683,16#4684,16#4684,16#4684,16#4684,16#4684,16#4684,16#4684,16#4684,16#4684,16#4684,16#4684,16#4684,16#4684,16#4684,16#4684,16#4684,16#4684,16#4684,16#4684,16#4684,16#C683,16#C586,16#C586,16#C586,16#C585,16#0095,16#8095,16#0199,16#8199,16#4585,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C586,16#C585,16#0199,16#8199,16#0095,16#8095,16#4581,16#C582,16#C582,16#C582,16#C582,16#C582,16#C582,16#C582,16#C582,16#C582,16#C582,16#C582,16#C582,16#C582,16#C582,16#C582,16#C582,16#C582,16#C582,16#C582,16#C582,16#C582,16#C582,16#C582,16#C582,16#C582,16#C582,16#C581,16#039D,16#839D,16#0199,16#8199,16#0796,16#099C,16#0598,16#0796,16#099C,16#0598,16#0796,16#099C,16#0598,16#0796,16#099C,16#0598,16#0796,16#099C,16#0598,16#0796,16#099C,16#0598,16#0796,16#099C,16#0598,16#0796,16#099C,16#0598,16#0796,16#099C,16#0598,16#0796,16#099C,16#0598
  120.  
  121. LAY_1           .word   16#580 ;map length
  122. LAY_1_WIDTH     .word   10#32
  123. LAY_1_HEIGHT    .word   10#22
  124. LAY_1_DATA      .halfu  16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#a590,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#a591,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#a592,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#a590,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#2893,16#a694,16#a893,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#a591,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0696,16#0697,16#0498,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#a592,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#079a,16#809c,16#879b,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#079e,16#829f,16#879e,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#a590,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#a893,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#a591,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#a592,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#2893,16#a694,16#a893,16#2893,16#a694,16#a893,16#2893,16#a694,16#a893,16#2893,16#a694,16#a893,16#2893,16#a694,16#a893,16#2893,16#a694,16#a893,16#2893,16#a694,16#a893,16#2893,16#a694,16#a893,16#2893,16#a694,16#a893,16#2893,16#2694,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000,16#0000
  125.  
  126.  
  127.  
  128.             .seg    program
  129. ;DMA STUFF
  130. DMA_OFFSET  .wordu  16#10000
  131. DMASRC      .equ    16#7300
  132. DMADST      .equ    16#7304
  133. DMALEN      .equ    16#7308
  134. DMA_GO      .equ    16#730F         ;WRITE BYTES TO HERE. WRITING BYTES IS FASTER THAN WORDS.
  135.  
  136. ;INPUT AND HARDWARE STUFF
  137. HW_OFFSET   .wordu  16#FFFFFF00
  138. HW_PAD      .equ    16#0
  139. HW_PAD_H    .equ    16#0
  140. HW_PAD_V    .equ    16#1
  141. HW_PAD_AB   .equ    16#2
  142. HW_PAD_SS   .equ    16#3
  143.  
  144.  
  145. IRQ_ALL     .wordu  2#101000100000000000000001 ;Write to PSW to enable all interrupts except hblank
  146. IRQ_NOMOVE  .wordu  2#100000000000000000000001 ;While we're waiting for DMA to complete
  147.  
  148. TILE_SPR    .equ    16#3000
  149. S_PALETTE   .equ    16#6000
  150. T_PALETTE   .equ    16#6100
  151. INSTANCE    .equ    16#6200
  152. LAYER       .equ    16#6A00
  153. TILE        .equ    16#6400
  154. TILE_0      .equ    16#6400
  155. CONTROL     .equ    16#7300
  156.  
  157. L0_X        .equ    16#6A02
  158. L0_Y        .equ    16#6A03
  159. L1_X        .equ    16#6A06
  160. L1_Y        .equ    16#6A07
  161. L2_X        .equ    16#6A0A
  162. L2_Y        .equ    16#6A0B
  163. L3_X        .equ    16#6A0E
  164. L3_Y        .equ    16#6A0F
  165.  
  166. XMAX        .equ    10#224;
  167. YMAX        .equ    10#144;
  168. XSPEED      .equ    1;
  169. YSPEED      .equ    -1;
  170.  
  171. INSTIMG     .equ    INSTANCE+1;player sprite
  172. INSTX       .equ    INSTANCE+2  ;This is the player's absolute position on the screen
  173. INSTY       .equ    INSTANCE+3
  174.  
  175. RAM         .equ    16#8000     ;offset to RAM
  176. RAMWORD     .word   16#8000     ;offset for ram loader
  177.  
  178. StackStart  .word   16#8000
  179.  
  180.             .seg    ram
  181. stack       .space  10#2048             ;make room for the stack
  182.                
  183.             .seg    program
  184.             .start      init
  185.  
  186. init        lw      r1,IRQ_NOMOVE(r0)   ;disable VBLANK interrupt
  187.             movi2s  psw,r1
  188.             lw      r28,RAMWORD         ;initialize RAM offset register. NEVER TOUCH R28 AGAIN.
  189.             lw      r30,StackStart      ;initialize stack pointer
  190.             addi    r1,r0,5
  191.             sw      PlayerX-RAM(r28),r1
  192.             sw      PlayerY-RAM(r28),r1
  193.             ;First let's set up the background
  194.             addui   r1,r0,SPR_00;
  195.             addui   r2,r0,TILE_SPR
  196.             addui   r3,r0,SPR_LEN;
  197.             jal     StartDMA
  198.             addui   r1,r0,PAL_00
  199.             addui   r2,r0,T_PALETTE
  200.             addui   r3,r0,PAL_LEN
  201.             jal     StartDMA
  202.             addui   r1,r0,layer0    ;
  203.             addui   r2,r0,LAYER     ;dest
  204.             addui   r3,r0,16#c      ;copies 3 words = all 3 current layers. layer 3 is unused.
  205.             jal     StartDMA
  206.             addui   r1,r0,P_U_F_0           ;r1 <- pointer to sprite in memory
  207.             addui   r2,r0,0                 ;r2 <- dest (it's zero still because the tiles go in upper memory)
  208.             addui   r3,r0,P_SPR_LEN         ;r3 <- length of sprite
  209.             jal     StartDMA
  210.             addui   r1,r0,inst0
  211.             addui   r2,r0,INSTANCE
  212.             addui   r3,r0,10#4
  213.             jal     StartDMA
  214.             addui   r1,r0,P_PAL_U
  215.             addui   r2,r0,S_PALETTE ;offset because we already have 5 palettes in memory
  216.             addui   r3,r0,16#20
  217.             jal     StartDMA
  218.             nop
  219.             nop                        
  220.             lw      r1,IRQ_ALL(r0)      ;enable VBLANK interrupt
  221.             movi2s  psw,r1
  222.             lw      r7,DMA_OFFSET(r0)   ;shuffle gpu offset around
  223.             addi    r3,r0,10#64         ;x pos
  224.             addi    r4,r0,10#64         ;y pos
  225.             lw      r20,HW_OFFSET(r0)   ;get the location of the hardware
  226.             addui   r20,r20,HW_PAD      ;move it to the pad location
  227.             addui   r1,r0,LAY_0         ;initialize the map at 0,0
  228.             addui   r2,r0,0        
  229.             addui   r3,r0,0
  230.             addui   r4,r0,0
  231.             jal     loadMap
  232.             ;clr        r10                 ;r10 <- scrollx
  233.             ;clr        r11                 ;r11 <- scrolly
  234.             ;clr        r12                 ;r12 <- toffsetx
  235.             ;clr        r13                 ;r13 <- toffsety
  236.             lw      r1,IRQ_ALL          ;enable interrupts
  237.             movi2s  psw,r1
  238.             ;halt                       ;DEBUG: use this halt for testing initial setup without everything else shitting on it
  239.             j       vb_draw             ;god forgive me
  240.             j       main                ;everything setup; time to go!
  241.            
  242. ;game loop starts here         
  243. main        lw      r18,PlayerX-RAM(r28)            ;debug output
  244.             lw      r19,PlayerY-RAM(r28)
  245.             ;slai   r18,r18,4
  246.             ;slai   r19,r19,4
  247. ;main       wait
  248.             wait                    ;wait for something to happen!
  249.             j       main                ;loop!
  250.  
  251.            
  252.             .seg    ram
  253. PlayerX     .space  4   ;This is the player's position -in tiles-
  254. PlayerY     .space  4  
  255.  
  256. CameraX     .space  4
  257. CameraY     .space  4
  258.  
  259. MapX        .space  4       ;This is the map tile offset
  260. MapY        .space  4
  261.  
  262. MapOSTX     .space  4       ;The TOTAL map offset (if it was one big stitched up map with unlimited scrolling)
  263. MapOSTY     .space  4  
  264.  
  265. MapOSAX     .space  4       ;The ACTUAL map offset (offset from the current tile offset)
  266. MapOSAY     .space  4
  267.  
  268.  
  269. WalkCounter .space  4
  270. WalkH       .space  1
  271. WalkV       .space  1
  272.             .align  4
  273.            
  274. TempX       .space  4
  275. TempY       .space  4
  276.  
  277. FinalPX     .space  4       ;Player position after all transformations
  278. FinalPY     .space  4
  279. FinalMOX    .space  4       ;Map offset after all transformations
  280. FinalMOY    .space  4
  281. FinalMTX    .space  4       ;Map tile offset after all transformations
  282. FinalMTY    .space  4
  283.  
  284.             .seg    program
  285. ;vblank interrupt handler
  286. vblank      lw      r7,DMA_OFFSET
  287.             lw      r3,WalkCounter-RAM(r28)
  288.             beqz    r3,vb_check         ;if(!WalkCounter){goto dpad check}
  289.             subi    r3,r3,4             ;WalkCounter-=4;
  290.             sw      WalkCounter-RAM(r28),r3
  291.             jal     animatePlayer
  292.             ;bnez   r3,vb_notdone       ;clear both the walk direction markers if we're done walking
  293. vb_notdone  j       vb_draw
  294. vb_check    lb      r1,HW_PAD_H(r20)    ;load dpad horizontal status
  295.             lb      r2,HW_PAD_V(r20)    ;and vertically
  296.             bnez    r1,vb_walk          ;if(!DPAD_H&&!DPAD_Y){
  297.             beqz    r2,vb_end           ;   return;}
  298. vb_walk     jal     requestMove         ;else{ requestPlayerMove(dpadx, dpady);
  299.             jal     setPlayerDir
  300.             lw      r3,WalkCounter-RAM(r28)
  301. vb_draw     lw      r1,PlayerX-RAM(r28)
  302.             lw      r2,PlayerY-RAM(r28)
  303.             slai    r1,r1,4             ;PlayerX<<4
  304.             slai    r2,r2,4             ;PlayerY<<4 (fast way to PlayerXY*16)
  305.             ;lw     r3,WalkCounter      ;This is probably not necessary - it should still be loaded from vblank.
  306. vb_h        lb      r4,WalkH-RAM(r28)
  307.             beqz    r4,vb_v
  308.             slti    r5,r4,0             ;if(walkdir>0) {we're walking right}
  309.             bnez    r5,vb_h_l
  310.             sub     r1,r1,r3            ;PlayerX-=WalkCounter   //we're coming from the left.
  311.             ;lw     r14,3               ;DEBUG: INTENTIONAL MISALIGNED READ
  312.             j       vb_drawp
  313. vb_h_l      add     r1,r1,r3            ;PlayerX+=WalkCounter   //from the right
  314.             j       vb_drawp            ;now place the player
  315. vb_v        lb      r4,WalkV-RAM(r28)
  316.             beqz    r4,vb_drawp         ;this should really never trigger but...
  317.             slti    r5,r4,0             ;if(walkdir>0) {we're walking down}
  318.             bnez    r5,vb_v_u          
  319.             sub     r2,r2,r3
  320.             j       vb_drawp
  321. vb_v_u      add     r2,r2,r3
  322. vb_drawp    bnez    r3,vb_drawc
  323.             sb      WalkV-RAM(r28),r0
  324.             sb      WalkH-RAM(r28),r0
  325. vb_drawc    sw      FinalPX-RAM(r28),r1
  326.             sw      FinalPY-RAM(r28),r2
  327.             subi    r3,r1,10#144            ;camera offset from player top left
  328.             slei    r5,r3,0                 ;if(cameraX<0){
  329.             bnez    r5,vb_mosy              ;   goto cameraY};
  330.             sgei    r5,r3,10#256
  331.             bnez    r5,vb_fixx             
  332.             sub     r5,r1,r3
  333.             sw      FinalPX-RAM(r28),r5
  334.             sw      TempX-RAM(r28),r1
  335.             add     r1,r0,r3
  336.             jal     Mod16
  337.             add     r3,r0,r2                ;shuffle remainder into map offset
  338.             add     r4,r0,r1                ;shuffle modulo into temp space
  339.             sw      FinalMOX-RAM(r28),r2
  340.             sw      FinalMTX-RAM(r28),r1                ;save our map offset for X
  341.             j       vb_mosy
  342. vb_fixx     subi    r5,r1,10#256
  343.             sw      FinalPX-RAM(r28),r5
  344. vb_mosy     lw      r1,FinalPY-RAM(r28)
  345.             subi    r3,r1,10#80             ;camera offset from player top left
  346.             slei    r5,r3,0                 ;if(cameraX<0){
  347.             bnez    r5,vb_fixdy             ;   goto cameraY};
  348.             sgei    r5,r3,10#192
  349.             bnez    r5,vb_fixy
  350.             sub     r5,r1,r3
  351.             sw      FinalPY-RAM(r28),r5
  352.             sw      TempY-RAM(r28),r3
  353.             add     r1,r0,r3
  354.             jal     Mod16
  355.             add     r3,r0,r2                ;shuffle remainder into map offset
  356.             add     r4,r0,r1                ;shuffle modulo into temp space
  357.             sw      FinalMOY-RAM(r28),r2
  358.             sw      FinalMTY-RAM(r28),r1                ;save our map offset for X
  359.             j       vb_fixdy
  360. vb_fixy     subi    r5,r1,10#192
  361.             sw      FinalPY-RAM(r28),r5
  362. vb_fixdy    lw      r1,FinalPX-RAM(r28)
  363.             lw      r2,FinalPY-RAM(r28)
  364.             lw      r3,FinalMOX-RAM(r28)
  365.             lw      r4,FinalMOY-RAM(r28)
  366.             sb      L0_X(r7),r3             ;offsets the map by the distance walked
  367.             sb      L0_Y(r7),r4
  368. vb_blitp    sb      INSTX(r7),r1            ;this is what actually places the player.
  369.             sb      INSTY(r7),r2
  370.             ;add        r24,r0,r1           ;debug output
  371.             ;add        r25,r0,r2
  372.             lw      r1,FinalMTX-RAM(r28)
  373.             lw      r2,FinalMTY-RAM(r28)
  374.             add     r26,r0,r1           ;debug output
  375.             add     r27,r0,r2
  376.             jal     scrollMap      
  377. vb_end      lw      r1,IRQ_ALL
  378.             movi2s  psw,r1
  379.             j       main
  380.            
  381.            
  382. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  383. ;;;OffsetCamera ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  384. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  385. ;Finds the correct camera position based on player position   ;
  386. ;-------------------------------------------------------------;
  387. ;       r1  <-  PlayerX                                       ;
  388. ;       r2  <-  PlayerY                                       ;
  389. ;       Returns - CamX in r1, CamY in r2. Also saves.         ;
  390. ;-------------------------------------------------------------;
  391. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  392.             .seg    ram
  393. ;CamMaxX        .word   10#288      ;currently hard-coded for a 32x22 tile map, fix later.
  394. ;CamMaxY        .word   10#192      ;technically instantly fixed by writing over it in the map loader.
  395. ;TODO: WRITE THIS FUNCTION
  396.  
  397. ;CUR_FRAME  .word   0
  398. FRAME_DELAY .space  4
  399. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  400. ;;;animatePlayer ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  401. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  402. ;Cycles player animation                                      ;
  403. ;-------------------------------------------------------------;
  404. ;       uses: Nothing!                                        ;
  405. ;-------------------------------------------------------------;
  406. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  407.             .seg    program
  408. ap_r31      .equ    -4
  409. ap_r1       .equ    -8
  410. ap_r2       .equ    -12
  411. ap_r3       .equ    -16
  412. ap_r4       .equ    -20
  413. ap_r7       .equ    -24
  414. ap_len      .equ    28
  415.  
  416. animatePlayer   addi    r30,r30,ap_len
  417.                 sw      ap_r31(r30),r31
  418.                 sw      ap_r1(r30),r1
  419.                 sw      ap_r2(r30),r2
  420.                 sw      ap_r3(r30),r3
  421.                 sw      ap_r4(r30),r4
  422.                 sw      ap_r7(r30),r7
  423.                 lw      r3,FRAME_DELAY-RAM(r28)     ;frame delay is like
  424.                 addi    r3,r3,1
  425.                 sw      FRAME_DELAY-RAM(r28),r3
  426.                 andi    r4,r3,2#11          ;otherwise we go through all that bs to show the same frame
  427.                 ;bnez   r4,ap_end           ;even when the frame is being delayed
  428.                 lw      r7,DMA_OFFSET                  
  429.                 srai    r3,r3,1             ;by shifting right by 1, we give a frame delay of 2 cycles
  430.                 andi    r3,r3,2#11          ;cut off any overflow to loop animation
  431.                 ;lw     r1,CUR_FRAME
  432.                 lw      r2,P_BASE_FRAME-RAM(r28)
  433.                 andi    r4,r3,2#01          ;if it's an odd frame
  434.                 bnez    r4,ap_notodd
  435.                 ;addi   r4,r0,2#11000000
  436.                 ;sb     INSTANCE(r7),r4
  437.                 sb      INSTIMG(r7),r2
  438.                 j       ap_end
  439. ap_notodd       subi    r1,r2,8             ;if the base frame offset is 8, we're sideways
  440.                 beqz    r1,ap_side         
  441.                 addi    r2,r2,2             ;otherwise... inc frame counter
  442.                 sb      INSTIMG(r7),r2      ;use the second frame
  443.                 andi    r4,r3,2#10          ;see whether we're on frame 2 or 4
  444.                 bnez    r4,ap_frame4
  445.                 addi    r4,r0,2#11000000    ;use unflipped sprite on frame 2
  446.                 sb      INSTANCE(r7),r4
  447.                 j       ap_end
  448. ap_frame4       addi    r4,r0,2#11100000    ;use flipped sprite on frame 4
  449.                 sb      INSTANCE(r7),r4
  450.                 j       ap_end
  451. ap_side         andi    r4,r3,2#10          ;frame 2 or 4?
  452.                 bnez    r4,ap_sf4
  453.                 addi    r2,r2,2
  454.                 sb      INSTIMG(r7),r2
  455.                 j       ap_end
  456. ap_sf4          addi    r2,r2,4
  457.                 sb      INSTIMG(r7),r2
  458. ap_end          lw      r31,ap_r31(r30)
  459.                 lw      r1,ap_r1(r30)
  460.                 lw      r2,ap_r2(r30)
  461.                 lw      r3,ap_r3(r30)
  462.                 lw      r4,ap_r4(r30)
  463.                 lw      r7,ap_r7(r30)
  464.                 subi    r30,r30,ap_len
  465.                 jr      r31
  466.  
  467.  
  468. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  469. ;;;setPlayerDir ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  470. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  471. ;Faces the player sprite in the right direction               ;
  472. ;-------------------------------------------------------------;
  473. ;       uses: Nothing!                                        ;
  474. ;-------------------------------------------------------------;
  475. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  476. spd_r31         .equ    -4
  477. spd_r1          .equ    -8
  478. spd_r2          .equ    -12
  479. spd_r3          .equ    -16
  480. ;spd_r4         .equ    -20
  481. spd_r7          .equ    -24
  482. spd_len         .equ    28
  483.  
  484.                 .seg    ram
  485. P_BASE_FRAME    .space  4
  486. P_OLD_DIR       .space  4
  487.  
  488.                 .seg    program
  489. setPlayerDir    addi    r30,r30,spd_len
  490.                 sw      spd_r31(r30),r31
  491.                 sw      spd_r1(r30),r1
  492.                 sw      spd_r2(r30),r2
  493.                 sw      spd_r3(r30),r3
  494.                 ;sw     spd_r4(r30),r4
  495.                 sw      spd_r7(r30),r7
  496.                 lw      r7,DMA_OFFSET
  497.                 lw      r1,PDir-RAM(r28)
  498.                 lw      r2,P_OLD_DIR-RAM(r28)
  499.                 sub     r2,r2,r1
  500.                 beqz    r2,spd_skip
  501.                 sw      P_OLD_DIR-RAM(r28),r1   ;THIS FREEZES ERRYTHING
  502.                 slai    r1,r1,2         ;multiply by 4 to make into a jumptable offset
  503.                 lw      r1,spd_jtp(r1)  ;load jump table
  504.                 jr      r1
  505. spd_left        addi    r2,r0,8
  506.                 sb      INSTIMG(r7),r2
  507.                 addi    r3,r0,2#11000000
  508.                 sb      INSTANCE(r7),r3
  509.                 j       spd_end
  510. spd_right       addi    r2,r0,8
  511.                 sb      INSTIMG(r7),r2
  512.                 addi    r3,r0,2#11100000
  513.                 sb      INSTANCE(r7),r3
  514.                 j       spd_end
  515. spd_up          addi    r2,r0,4
  516.                 sb      INSTIMG(r7),r2
  517.                 j       spd_end
  518. spd_down        addi    r2,r0,0
  519.                 sb      INSTIMG(r7),r2
  520. spd_end         sw      P_BASE_FRAME-RAM(r28),r2
  521. spd_skip        lw      r1,spd_r1(r30)
  522.                 lw      r2,spd_r2(r30)
  523.                 lw      r3,spd_r3(r30)
  524.                 ;lw     r4,spd_r4(r30)
  525.                 lw      r7,spd_r7(r30)
  526.                 lw      r31,spd_r31(r30)
  527.                 subi    r30,r30,spd_len
  528.                 jr      r31
  529.  
  530. ;jump table for directional drawing
  531. spd_jtp         .word   spd_left
  532. spd_jtp1        .word   spd_right
  533. spd_jtp2        .word   spd_up
  534. spd_jtp3        .word   spd_down
  535.                
  536.                 .seg    ram
  537. PDir            .space  4
  538.                 .seg    program
  539. PDIR_L          .equ    2#00
  540. PDIR_R          .equ    2#01
  541. PDIR_U          .equ    2#10
  542. PDIR_D          .equ    2#11
  543. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  544. ;;;requestMove ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  545. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  546. ;Takes dpad input and tries to move the player                ;
  547. ;-------------------------------------------------------------;
  548. ;   r1      <-      dpad horizontal                           ;
  549. ;   r2      <-      dpad vertical                             ;
  550. ;-------------------------------------------------------------;
  551. ;TODO: Currently this just checks if we're on the edge and    ;
  552. ;      rejects the move in that case. Add a thing to it to    ;
  553. ;      make it interract with pathing maps.                   ;
  554. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  555.             .seg    program
  556. rm_r1       .equ    -4
  557. rm_r2       .equ    -8
  558. rm_r3       .equ    -12
  559. rm_r4       .equ    -16
  560. rm_r5       .equ    -20
  561. rm_r6       .equ    -24
  562. rm_r7       .equ    -28
  563. rm_r8       .equ    -32
  564. rm_r31      .equ    -36
  565. rm_len      .equ    40
  566.  
  567. requestMove addi    r30,r30,rm_len
  568.             sw      rm_r1(r30),r1       ;backup registers
  569.             sw      rm_r2(r30),r2
  570.             sw      rm_r3(r30),r3
  571.             sw      rm_r4(r30),r4
  572.             sw      rm_r5(r30),r5
  573.             sw      rm_r6(r30),r6
  574.             sw      rm_r7(r30),r7
  575.             sw      rm_r8(r30),r8
  576.             sw      rm_r31(r30),r31
  577.             bnez    r1,rm_h         ;h gets priority because yolo.
  578.             bnez    r2,rm_v
  579.             j       rm_end          ;this should never get triggered but, just in case!
  580. rm_h        lw      r3,PlayerX-RAM(r28)     ;load player's current x position (in tiles)
  581.             andi    r8,r1,2#10
  582.             beqz    r8,rm_right     ;this tests if the controller direction is negative, aka left
  583.             addi    r8,r0,PDIR_L    ;save
  584.             sw      PDir-RAM(r28),r8
  585.             j       rm_h_cont
  586. rm_right    addi    r8,r0,PDIR_R
  587.             sw      PDir-RAM(r28),r8
  588. rm_h_cont   add     r3,r3,r1        ;r3<-proposed new player x
  589.             slti    r7,r3,1         ;if(PlayerX+dpad_h<0){
  590.             bnez    r7,rm_end       ;   return;}                        //THIS SECTION REJECTS THE REQUEST
  591.             lw      r5,LAY_1_WIDTH  ;r5 <-  map width                   //IF IT WOULD PLACE THE PLAYER OUT OF
  592.             subi    r5,r5,1         ;sub 1 so we stay on the map intead of going outside
  593.             sgt     r7,r3,r5        ;if(PlayerX+dpad_h>map width){      //THE BOUNDS OF THE CURRENT MAP
  594.             bnez    r7,rm_end       ;   return;}
  595.             sb      WalkH-RAM(r28),r1
  596.             sb      WalkV-RAM(r28),r0
  597.             sw      PlayerX-RAM(r28),r3
  598.             j       rm_finishup
  599. rm_v        lw      r4,PlayerY-RAM(r28)
  600.             andi    r8,r2,2#10
  601.             beqz    r8,rm_down      ;this tests if the controller direction is negative, aka up
  602.             addi    r8,r0,PDIR_U    ;save
  603.             sw      PDir-RAM(r28),r8
  604.             j       rm_v_cont
  605. rm_down     addi    r8,r0,PDIR_D
  606.             sw      PDir-RAM(r28),r8
  607. rm_v_cont   add     r4,r4,r2
  608.             slti    r7,r4,1
  609.             bnez    r7,rm_end
  610.             lw      r5,LAY_1_HEIGHT
  611.             subi    r5,r5,1
  612.             sgt     r7,r4,r5
  613.             bnez    r7,rm_end
  614.             sb      WalkH-RAM(r28),r0
  615.             sb      WalkV-RAM(r28),r2
  616.             sw      PlayerY-RAM(r28),r4
  617. rm_finishup addi    r1,r0,10#16
  618.             sw      WalkCounter-RAM(r28),r1
  619. rm_end      lw      r1,rm_r1(r30)       ;restore registers
  620.             lw      r2,rm_r2(r30)
  621.             lw      r3,rm_r3(r30)
  622.             lw      r4,rm_r4(r30)
  623.             lw      r5,rm_r5(r30)
  624.             lw      r6,rm_r6(r30)
  625.             lw      r7,rm_r7(r30)
  626.             lw      r8,rm_r8(r30)
  627.             lw      r31,rm_r31(r30)
  628.             subi    r30,r30,rm_len
  629.             jr      r31
  630.            
  631.  
  632.            
  633. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  634. ;;;scrollMap ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  635. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  636. ;Takes an x and y value to scroll the map by.                 ;
  637. ;-------------------------------------------------------------;
  638. ;   r1  x   <- how far to move the map horizontally           ;
  639. ;   r2  y   <- aaand vertically                               ;
  640. ;-------------------------------------------------------------;
  641. ;Uses:                                                        ;
  642. ;r1,r2                                                        ;
  643. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  644.             .seg    ram
  645. mapX        .space  4
  646. mapY        .space  4
  647.             .seg    program
  648. ;Temp values
  649. sm_r3       .equ    -4
  650. sm_r4       .equ    -8
  651. sm_r5       .equ    -12
  652. ;sm_r6      .equ    -16
  653. ;sm_r7      .equ    -20
  654. sm_r31      .equ    -24
  655. sm_len      .equ    28
  656.  
  657. scrollMap   addi    r30,r30,sm_len
  658.             sw      sm_r3(r30),r3
  659.             sw      sm_r4(r30),r4
  660.             sw      sm_r5(r30),r5
  661.             ;sw     sm_r6(r30),r6
  662.             ;sw     sm_r7(r30),r7
  663.             sw      sm_r31(r30),r31
  664.             lw      r3,mapX-RAM(r28)
  665.             ;seq        r5,r1,r3            ;TODO: FIX THIS SECTION, IT FOR SOME REASON IGNORES Y UPDATES ATM
  666.             ;beqz   r5,smchanged
  667.             lw      r4,mapY-RAM(r28)
  668.             ;seq        r5,r2,r4
  669.             ;beqz   r5,scrollend
  670. smchanged   sw      mapX-RAM(r28),r1        ;store the new map values because the map blitter will eat them
  671.             sw      mapY-RAM(r28),r2
  672.             addui   r1,r0,LAY_0 ;load the pointer for layer 0, this is temp until we're storing current map somewhere.
  673.             ;add        r3,r0,r2    ;shuffle x and y into r2 and r3 to set up to call our function
  674.             ;add        r2,r0,r1
  675.             lw      r2,mapX-RAM(r28)
  676.             lw      r3,mapY-RAM(r28)
  677.             addui   r4,r0,0     ;we'll probably replace this with a method for blitting active layers soon(tm)
  678.             jal     loadMap
  679. scrollend   lw      r3,sm_r3(r30)
  680.             lw      r4,sm_r4(r30)
  681.             lw      r5,sm_r5(r30)
  682.             ;lw     r6,sm_r6(r30)
  683.             ;lw     r7,sm_r7(r30)
  684.             lw      r31,sm_r31(r30)
  685.             subi    r30,r30,sm_len
  686. scrollfend  jr      r31
  687.  
  688. ;;TODO: Reorder this so it uses r1 for x, r2 for y, r3 for source.
  689. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  690. ;;;loadMap ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  691. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  692. ;   Fills a whole map buffer from memory using an offset      ;
  693. ;-------------------------------------------------------------;
  694. ;   r1  Source <- start of map data in memory   (length)      ;
  695. ;   r2  x      <- x offset tiles                              ;
  696. ;   r3  y      <- y offset tiles                              ;
  697. ;   r4  layer  <- which layer to draw to                      ;
  698. ;-------------------------------------------------------------;
  699. ;   Uses:   r1,r2,r3,r4                                       ;
  700. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  701. lm_r5       .equ    -4
  702. lm_r6       .equ    -8
  703. lm_r7       .equ    -12
  704. lm_r8       .equ    -16
  705. lm_retaddr  .equ    -20
  706. lm_psw      .equ    -24
  707. lm_len      .equ    28
  708.  
  709. MAP_LENGTH  .equ    16#0        ;these are offsets from the map data in memory
  710. MAP_WIDTH   .equ    16#4        ;assuming the map was exported from the supergamebabby editor tool
  711. MAP_HEIGHT  .equ    16#8
  712. MAP_DATA    .equ    16#c
  713.  
  714. loadMap     addi    r30,r30,lm_len
  715.             sw      lm_r5(r30),r5       ;save registers we're gonna use
  716.             sw      lm_r6(r30),r6
  717.             sw      lm_r7(r30),r7
  718.             sw      lm_r8(r30),r8
  719.             sw      lm_retaddr(r30),r31 ;so we can get back where we came from
  720.             lw      r5,IRQ_NOMOVE
  721.             movi2s  psw,r5
  722.             clr     r6                  ;r6 <- offset
  723.             lw      r7,MAP_WIDTH(r1)    ;r7 <- map_width
  724.             add     r7,r7,r7            ;r7*=2; //so we can add it each loop
  725.             addui   r8,r0,10#16         ;r8 <- buffer_length //we'll use this to load all the rows
  726. lm_ymult    beqz    r3,lm_xadd          ;while(y){
  727.             add     r6,r6,r7            ;   offset+=16;
  728.             subui   r3,r3,1             ;   y--;
  729.             j       lm_ymult            ;}
  730. lm_xadd     add     r2,r2,r2            ;x+=x; //double so we get the offset right
  731.             add     r6,r6,r2            ;offset+=x;
  732.             ;add        r6,r6,r6            ;offset*=2; //double offset because we're working with halfwords
  733.             clr     r2                  ;make way for dest point
  734. lm_dstmult  beqz    r4,lm_tsetup        ;while(layerchoice){
  735.             addui   r2,r0,10#256        ;   layeroffset+=256
  736.             subui   r4,r4,1             ;   layerchoice--;
  737.             j       lm_dstmult          ;}
  738. lm_tsetup   add     r2,r2,r2            ;layeroffset*=2 //again, double offset
  739.             addui   r2,r2,TILE          ;layeroffset+=TILE_DATA_OFFSET; //the draw destination
  740.             addui   r3,r0,10#32         ;draw_length = 16*2; //we can only draw one row at a time
  741.             addui   r1,r1,MAP_DATA      ;get the pointer to the data of the map
  742.             add     r1,r1,r6            ;map pointer+=offset
  743. lm_tloop    beqz    r8,lm_end           ;while(buffer_length){
  744.             add     r5,r0,r1            ;   //StartDMA kills r1, gotta save it
  745.             jal     StartDMA            ;   StartDMA(from, to, length)
  746.             add     r1,r0,r5            ;   //and restore
  747.             add     r1,r1,r7            ;   draw_offset+=map_width //this puts us onto the next line
  748.             addui   r2,r2,10#32         ;   layer_offset+= 16*2; //Gotta draw to the next line too
  749.             subi    r8,r8,1             ;   buffer_length--;
  750.             j       lm_tloop            ;}
  751. lm_end      lw      r5,lm_r5(r30)       ;restore registers
  752.             lw      r6,lm_r6(r30)
  753.             lw      r7,lm_r7(r30)
  754.             lw      r8,lm_r8(r30)
  755.             lw      r31,lm_retaddr(r30)     ;restore return address
  756.             subi    r30,r30,lm_len
  757.             jr      r31
  758.            
  759. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  760. ;;;StartDMA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  761. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  762. ;   Starts a DMA transfer to the GPU, then sleeps the CPU     ;
  763. ;   until the transfer completes.                             ;
  764. ;   TODO: Rewrite this to use the stack so that we can queue  ;
  765. ;         multiple transfers and have the CPU continue        ;
  766. ;         working inbetween them.                             ;
  767. ;-------------------------------------------------------------;
  768. ;   r1  Source <- Absolute start address of transfer data     ;
  769. ;   r2  Dest   <- Destination address IN GPU of transfer      ;
  770. ;   r3  Length <- Length of data block in BYTES               ;
  771. ;-------------------------------------------------------------;
  772. ;   Uses:   r1,r2,r3,r15                                      ;
  773. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  774. sdma_r31    .equ    -4
  775. sdma_len    .equ    10#4
  776.             .seg    program
  777. StartDMA    addi    r30,r30,sdma_len
  778.             sw      sdma_r31(r30),r31
  779.             lw      r15,DMA_OFFSET(r0)  ;use the offset since it's too long
  780.             sw      DMASRC(r15),r1      ;set the source
  781.             sw      DMADST(r15),r2      ;Set the destination
  782.             sw      DMALEN(r15),r3      ;set the length
  783.             lw      r1,IRQ_NOMOVE(r0)
  784.             movi2s  psw,r1              ;enable interrupts
  785.             addi    r1,r0,1    
  786. DMAWait     beqz    r1,DMAEnd           ;lol this completely defeats the purpose of interrupt requests
  787.             sb      DMA_GO(r15),r1      ;GO!
  788.             wait
  789.             j       DMAWait
  790. DMAEnd      lw      r31,sdma_r31(r30)
  791.             subi    r30,sdma_len
  792.             jr      r31                 ;and we're done!
  793.            
  794. DMAComp     clr     r1
  795.             rfe    
  796.            
  797.            
  798. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  799. ;;;Modulo;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  800. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  801. ;   Compute the modulo of x%y, return result and remainder    ;
  802. ;-------------------------------------------------------------;
  803. ;   r1  x                                                     ;
  804. ;   r2  y                                                     ;
  805. ;-------------------------------------------------------------;
  806. ;   Returns:    r1  <-  x%y                                   ;
  807. ;               r2  <-  remainder                             ;
  808. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  809. mod_r3      .equ    -4
  810. mod_r4      .equ    -8
  811. mod_r5      .equ    -12
  812. mod_r31     .equ    -16
  813. mod_len     .equ    10#20
  814.             .seg    program
  815.            
  816. Modulo      addi    r30,r30,mod_len
  817.             sw      mod_r3(r30),r3
  818.             sw      mod_r4(r30),r4
  819.             sw      mod_r5(r30),r5
  820.             sw      mod_r31(r30),r31
  821.             clr     r4
  822. mod_loop    sub     r3,r1,r2
  823.             slti    r5,r3,0
  824.             bnez    r5,mod_end
  825.             addi    r4,r4,1
  826.             addi    r1,r3,0
  827.             j       mod_loop
  828. mod_end     add     r2,r3,r2
  829.             add     r1,r0,r4
  830.             ;add        r11,r0,r1 ;debug
  831.             ;add        r12,r0,r2 ;debug
  832.             lw      r3,mod_r3(r30)
  833.             lw      r4,mod_r4(r30)
  834.             lw      r5,mod_r5(r30)
  835.             lw      r31,mod_r31(r30)
  836.             subi    r30,r30,mod_len
  837.             jr      r31
  838.            
  839. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  840. ;;;Mod16;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  841. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  842. ;   Compute the modulo of x%16, return result and remainder   ;
  843. ;-------------------------------------------------------------;
  844. ;   r1  x                                                     ;
  845. ;-------------------------------------------------------------;
  846. ;   Returns:    r1  <-  quotient                              ;
  847. ;               r2  <-  remainder                             ;
  848. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;    
  849. mod16_r3        .equ    -4
  850. mod16_r4        .equ    -8
  851. mod16_r5        .equ    -12
  852. mod16_r31       .equ    -16
  853. mod16_len       .equ    20
  854.  
  855. Mod16       addi    r30,r30,mod16_len
  856.             sw      mod16_r31(r30),r31
  857.             sw      mod16_r3(r30),r3
  858.             andi    r2,r1,10#15     ;remainder
  859.             sub     r1,r1,r2        ;x -= x%16
  860.             srai    r3,r1,31        ;r1= abs(r1)
  861.             xor     r1,r1,r3
  862.             sub     r1,r1,r3
  863.             srai    r1,r1,10#4      ;x /= 16
  864.             lw      r31,mod16_r31(r30)
  865.             lw      r3,mod16_r3(r30)
  866.             subi    r30,r30,mod16_len
  867.             jr      r31
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top