Advertisement
rilo

Show koala picture and play music

Jul 21st, 2017
852
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .var picture        = LoadBinary("picture.kla", BF_KOALA)
  2. .var music          = LoadSid("music.sid")
  3.        
  4. .pc = $0801 "Basic UpStart"
  5. basic:
  6. :BasicUpstart2(start)
  7.  
  8. .pc = * "Entrypoint"
  9. start: 
  10.                 jsr $ff81 // initialise VIC and screen editor
  11.                 jsr $ff84 // initialise SID, CIA and IRQ
  12.                 jsr $ff8a // initialise I/O vectors
  13.  
  14.                 lda #$00
  15.                 jsr music.init // initialise music
  16.  
  17.                 // copy the color screen to $d800-$dbff (actually $d800-$dbf7 is used)
  18.                 ldx #$00
  19. copycolors:     lda color,x
  20.                 sta $d800,x
  21.                 lda color+$100,x
  22.                 sta $d800+$100,x
  23.                 lda color+$200,x
  24.                 sta $d800+$200,x
  25.                 lda color+$300,x
  26.                 sta $d800+$300,x
  27.                 dex
  28.                 bne copycolors
  29.  
  30.                 lda backg // set background and border color
  31.                 sta $d020
  32.                 sta $d021
  33.  
  34.                 lda #%00111011 // enable bitmap mode (bit #5)
  35.                 sta $d011
  36.  
  37.                 lda #%00111000 // point screen memory to $0c00, bitmap memory to $2000
  38.                 sta $d018
  39.  
  40.                 lda #11011000 // enable multicolor
  41.                 sta $d016
  42.  
  43.                 // wait until raster is at $ff, then play music and repeat waiting
  44. repeat:         lda #$ff
  45. rasternotff:    cmp $d012
  46.                 bne rasternotff
  47.                 jsr music.play
  48.                 jmp repeat
  49.  
  50. .pc=music.location "Music"
  51. .fill music.size, music.getData(i)
  52.  
  53. .pc = $2000 "Bitmap data"
  54. bitmap:         .fill picture.getBitmapSize(), picture.getBitmap(i)
  55.  
  56. .pc = * "Bitmap Color data"
  57. color:          .fill picture.getColorRamSize(), picture.getColorRam(i)
  58.  
  59. .pc = * "Bitmap background color"
  60. backg:          .byte picture.getBackgroundColor()
  61.  
  62. .pc = $0c00 "Bitmap Screen data"
  63. screen:         .fill picture.getScreenRamSize(), picture.getScreenRam(i)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement