Advertisement
Nightseeker

MD_TextTest Sonic Clackers new hello.asm

Jul 3rd, 2020
2,784
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     include 'init.asm'
  2.     include 'globals.asm'
  3.     include 'text.asm'
  4.  
  5. __main:
  6.  
  7.     move.w #0x8F02, vdp_control     ; Set autoincrement to 2 bytes
  8.  
  9.     ; ************************************
  10.     ; Move palettes to CRAM
  11.     ; ************************************
  12.     move.l #vdp_write_palettes, vdp_control ; Set up VDP to write to CRAM address 0x0000
  13.  
  14.     lea Palettes, a0  ; Load address of Palettes into a0
  15.     move.l #0x1F, d0  ; 128 bytes of data (4 palettes, 32 longwords, minus 1 for counter) in palettes
  16.  
  17.     @ColourLoop:
  18.     move.l (a0)+, vdp_data ; Move data to VDP data port, and increment source address
  19.     dbra d0, @ColourLoop
  20.  
  21.     ; ************************************
  22.     ; Load font
  23.     ; ************************************
  24.     lea        PixelFont, a0       ; Move font address to a0
  25.     move.l    #PixelFontVRAM, d0   ; Move VRAM dest address to d0
  26.     move.l    #PixelFontSizeT, d1  ; Move number of characters (font size in tiles) to d1
  27.     jsr        LoadFont            ; Jump to subroutine
  28.  
  29.     ; ************************************
  30.     ; Draw text
  31.     ; ************************************
  32.     lea     String1, a0          ; String address
  33.     move.l  #PixelFontTileID, d0 ; First tile id
  34.     move.w  #0x0501, d1          ; XY (5, 1)
  35.     move.l  #0x0, d2             ; Palette 0
  36.     jsr     DrawTextPlaneA       ; Call draw text subroutine
  37.  
  38.     lea     String2, a0          ; String address
  39.     move.l  #PixelFontTileID, d0 ; First tile id
  40.     move.w  #0x0502, d1          ; XY (5, 2)
  41.     move.l  #0x1, d2             ; Palette 1
  42.     jsr     DrawTextPlaneA       ; Call draw text subroutine
  43.  
  44.     lea     String3, a0          ; String address
  45.     move.l  #PixelFontTileID, d0 ; First tile id
  46.     move.w  #0x0503, d1          ; XY (5, 3)
  47.     move.l  #0x2, d2             ; Palette 2
  48.     jsr     DrawTextPlaneA       ; Call draw text subroutine
  49.  
  50.     lea     String4, a0          ; String address
  51.     move.l  #PixelFontTileID, d0 ; First tile id
  52.     move.w  #0x0504, d1          ; XY (5, 4)
  53.     move.l  #0x3, d2             ; Palette 3
  54.     jsr     DrawTextPlaneA       ; Call draw text subroutine
  55.  
  56.     lea     String5, a0          ; String address
  57.     move.l  #PixelFontTileID, d0 ; First tile id
  58.     move.w  #0x0106, d1          ; XY (1, 6)
  59.     move.l  #0x3, d2             ; Palette 3
  60.     jsr     DrawTextPlaneA       ; Call draw text subroutine
  61.    
  62.     lea     String6, a0          ; String address
  63.     move.l  #PixelFontTileID, d0 ; First tile id
  64.     move.w  #0x0107, d1          ; XY (1, 7)
  65.     move.l  #0x3, d2             ; Palette 3
  66.     jsr     DrawTextPlaneA       ; Call draw text subroutine
  67.  
  68.     stop #$2700 ; Halt CPU
  69.  
  70. Palettes:
  71.     dc.w 0x0000 ; Colour 0 - Transparent
  72.     dc.w 0x000E ; Colour 1 - Red
  73.     dc.w 0x0000
  74.     dc.w 0x0000
  75.     dc.w 0x0000
  76.     dc.w 0x0000
  77.     dc.w 0x0000
  78.     dc.w 0x0000
  79.     dc.w 0x0000
  80.     dc.w 0x0000
  81.     dc.w 0x0000
  82.     dc.w 0x0000
  83.     dc.w 0x0000
  84.     dc.w 0x0000
  85.     dc.w 0x0000
  86.     dc.w 0x0000
  87.  
  88.     dc.w 0x0000 ; Colour 0 - Transparent
  89.     dc.w 0x00E0 ; Colour 1 - Green
  90.     dc.w 0x0000
  91.     dc.w 0x0000
  92.     dc.w 0x0000
  93.     dc.w 0x0000
  94.     dc.w 0x0000
  95.     dc.w 0x0000
  96.     dc.w 0x0000
  97.     dc.w 0x0000
  98.     dc.w 0x0000
  99.     dc.w 0x0000
  100.     dc.w 0x0000
  101.     dc.w 0x0000
  102.     dc.w 0x0000
  103.     dc.w 0x0000
  104.  
  105.     dc.w 0x0000 ; Colour 0 - Transparent
  106.     dc.w 0x0E00 ; Colour 1 - Blue
  107.     dc.w 0x0000
  108.     dc.w 0x0000
  109.     dc.w 0x0000
  110.     dc.w 0x0000
  111.     dc.w 0x0000
  112.     dc.w 0x0000
  113.     dc.w 0x0000
  114.     dc.w 0x0000
  115.     dc.w 0x0000
  116.     dc.w 0x0000
  117.     dc.w 0x0000
  118.     dc.w 0x0000
  119.     dc.w 0x0000
  120.     dc.w 0x0000
  121.  
  122.     dc.w 0x0000 ; Colour 0 - Transparent
  123.     dc.w 0x0EEE ; Colour 1 - White
  124.     dc.w 0x0000
  125.     dc.w 0x0000
  126.     dc.w 0x0000
  127.     dc.w 0x0000
  128.     dc.w 0x0000
  129.     dc.w 0x0000
  130.     dc.w 0x0000
  131.     dc.w 0x0000
  132.     dc.w 0x0000
  133.     dc.w 0x0000
  134.     dc.w 0x0000
  135.     dc.w 0x0000
  136.     dc.w 0x0000
  137.     dc.w 0x0000
  138.  
  139.     ; Text strings (zero terminated)
  140. String1:
  141.     dc.b "SONIC CLACKERS NEWER",0
  142. String2:
  143.     dc.b "ANIMATION TEST",0
  144. String3:
  145.     dc.b "SONIC",0
  146. String4:
  147.     dc.b "TAILS",0
  148. String5:
  149.     dc.b "FIELD",0
  150. String6:
  151.     dc.b "ATTRACTION",0
  152.  
  153.     ; Include art assets
  154.     include 'fonts\pixelfont.asm'
  155.  
  156. __end    ; Very last line, end of ROM address
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement