├── .gitignore ├── README.md ├── build └── README.md ├── loadBitmap.asm ├── res ├── README.md └── bitmap │ ├── tentacles.col │ ├── tentacles.map │ └── tentacles.scr ├── screenshots └── load_bitmap.png ├── showHiddenImg.asm └── src ├── constants.asm ├── data_img_rclogo.asm ├── load_res.asm ├── rut_clear_screen.asm ├── rut_load_bitmap.asm ├── rut_load_image.asm └── rut_show_image.asm /.gitignore: -------------------------------------------------------------------------------- 1 | *.sid 2 | *.prg 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Commodore 64 demo effects examples 2 | 3 | ![c64-effects](screenshots/load_bitmap.png) 4 | 5 | - Load bitmap from files 6 | - Show hidden image loaded directly in memory 7 | 8 | Project kick started with [c64-boilerplate](https://github.com/jvalen/c64-boilerplate) 9 | -------------------------------------------------------------------------------- /build/README.md: -------------------------------------------------------------------------------- 1 | # Build folder 2 | 3 | ##### The executable file will be generated here 4 | -------------------------------------------------------------------------------- /loadBitmap.asm: -------------------------------------------------------------------------------- 1 | !cpu 6502 2 | !to "build/load_bitmap.prg",cbm 3 | 4 | ; Allow us to run the program just launching 'RUN' 5 | * = $0801 6 | !byte $0d,$08,$dc,$07,$9e,$20,$34,$39 7 | !byte $31,$35,$32,$00,$00,$00 8 | * = $c000 9 | 10 | jsr init_screen 11 | 12 | jsr loadbitmap 13 | 14 | ; Disable interrupt 15 | sei 16 | 17 | ldy #$7f 18 | sty $dc0d 19 | sty $dd0d 20 | lda $dc0d 21 | lda $dd0d 22 | 23 | lda #$01 24 | sta $d01a 25 | 26 | lda $d011 27 | and #$7f 28 | sta $d011 29 | 30 | lda #irq 32 | sta $314 33 | stx $315 34 | 35 | lda #$00 36 | sta $d012 37 | 38 | cli 39 | jmp * 40 | 41 | ; custom interrupt routine 42 | irq dec $d019 43 | 44 | inc $d020 ; Flash the boarder 45 | 46 | jmp $ea81 47 | 48 | 49 | * = $2000 ; bitmap data address 50 | !bin "res/bitmap/tentacles.map" ; bitmap data file 51 | * = $3F40 ; bitmap characters address 52 | !bin "res/bitmap/tentacles.scr" ; bitmap characters file 53 | * = $4328 ; bitmap color address 54 | !bin "res/bitmap/tentacles.col" ; bitmap color file 55 | 56 | ; load source 57 | !source "src/rut_clear_screen.asm" 58 | !source "src/rut_load_bitmap.asm" 59 | -------------------------------------------------------------------------------- /res/README.md: -------------------------------------------------------------------------------- 1 | # Resources 2 | 3 | ##### Put the SID file you want to play and other resources 4 | -------------------------------------------------------------------------------- /res/bitmap/tentacles.col: -------------------------------------------------------------------------------- 1 |        -------------------------------------------------------------------------------- /res/bitmap/tentacles.map: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HowittColet/c64-effects/eea0240cdbe67de1937daec34efde63f718792dc/res/bitmap/tentacles.map -------------------------------------------------------------------------------- /res/bitmap/tentacles.scr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HowittColet/c64-effects/eea0240cdbe67de1937daec34efde63f718792dc/res/bitmap/tentacles.scr -------------------------------------------------------------------------------- /screenshots/load_bitmap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HowittColet/c64-effects/eea0240cdbe67de1937daec34efde63f718792dc/screenshots/load_bitmap.png -------------------------------------------------------------------------------- /showHiddenImg.asm: -------------------------------------------------------------------------------- 1 | !cpu 6502 2 | !to "build/show_hidden_img.prg",cbm 3 | 4 | ; Allow us to run the program just launching 'RUN' 5 | * = $0801 6 | !byte $0d,$08,$dc,$07,$9e,$20,$34,$39 7 | !byte $31,$35,$32,$00,$00,$00 8 | * = $c000 9 | 10 | jsr init_screen 11 | jsr sid_init 12 | jsr load_image 13 | 14 | ; Disable interrupt 15 | sei 16 | 17 | ldy #$7f 18 | sty $dc0d 19 | sty $dd0d 20 | lda $dc0d 21 | lda $dd0d 22 | 23 | lda #$01 24 | sta $d01a 25 | 26 | lda $d011 27 | and #$7f 28 | sta $d011 29 | 30 | lda #irq 32 | sta $314 33 | stx $315 34 | 35 | lda #$00 36 | sta $d012 37 | 38 | cli 39 | jmp * 40 | 41 | ; custom interrupt routine 42 | irq dec $d019 43 | 44 | jsr sid_play 45 | inc $d020 46 | jsr show_img 47 | 48 | jmp $ea81 49 | 50 | ; load source 51 | !source "src/constants.asm" 52 | 53 | !source "src/rut_clear_screen.asm" 54 | !source "src/rut_load_image.asm" 55 | !source "src/rut_show_image.asm" 56 | 57 | !source "src/data_img_rclogo.asm" 58 | 59 | !source "src/load_res.asm" 60 | -------------------------------------------------------------------------------- /src/constants.asm: -------------------------------------------------------------------------------- 1 | address_music = $5000 ; loading address for your sid tune, you may change that 2 | sid_init = $5f80 ; init routine for your music, you may change that 3 | sid_play = $5012 ; play you music routine, you may change that 4 | -------------------------------------------------------------------------------- /src/data_img_rclogo.asm: -------------------------------------------------------------------------------- 1 | picture0 2 | !byte $1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1 3 | !byte $1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1 4 | !byte $1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1 5 | !byte $1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1 6 | !byte $1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1 7 | !byte $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$1,$1,$1,$1,$1,$1,$1,$1,$1,$1 31 | !byte $1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1 32 | !byte $1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1 33 | !byte $1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1 34 | !byte $1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1 35 | -------------------------------------------------------------------------------- /src/load_res.asm: -------------------------------------------------------------------------------- 1 | ; load sid music 2 | 3 | * = address_music ; address to load the music data 4 | !bin "res/Commando.sid",, $7c+2 ; remove header from sid and cut off 5 | ; original loading address 6 | -------------------------------------------------------------------------------- /src/rut_clear_screen.asm: -------------------------------------------------------------------------------- 1 | ; Clear screen routine 2 | ; Will set the screen ram with the ' ' char and color ram with black color 3 | init_screen ldx #$00 4 | stx $d021 5 | stx $d020 6 | 7 | clear lda #$20 8 | sta $0400,x 9 | sta $0500,x 10 | sta $0600,x 11 | sta $06e8,x 12 | lda #$00 13 | sta $d800,x 14 | sta $d900,x 15 | sta $da00,x 16 | sta $dae8,x 17 | inx 18 | bne clear 19 | 20 | rts 21 | -------------------------------------------------------------------------------- /src/rut_load_bitmap.asm: -------------------------------------------------------------------------------- 1 | ; Load bitmap 2 | loadbitmap 3 | lda #$00 4 | sta $d020 5 | sta $d021 6 | 7 | ldx #$00 8 | loaddccimage 9 | lda $3f40,x 10 | sta $0400,x 11 | lda $4040,x 12 | sta $0500,x 13 | lda $4140,x 14 | sta $0600,x 15 | lda $4240,x 16 | sta $0700,x 17 | 18 | lda $4328,x 19 | sta $d800,x 20 | lda $4428,x 21 | sta $d900,x 22 | lda $4528,x 23 | sta $da00,x 24 | lda $4628,x 25 | sta $db00,x 26 | inx 27 | bne loaddccimage 28 | 29 | lda #$3b 30 | sta $d011 31 | 32 | lda #$18 33 | sta $d016 34 | 35 | lda #$18 36 | sta $d018 37 | 38 | rts 39 | -------------------------------------------------------------------------------- /src/rut_load_image.asm: -------------------------------------------------------------------------------- 1 | ; load picture routine 2 | ; it will load the img data with the label 'pictureN' 3 | load_image ldx #$00 4 | draw lda #$20 5 | sta $0400,x 6 | sta $0500,x 7 | sta $0600,x 8 | sta $06e8,x 9 | lda picture0,x 10 | sta $d800,x 11 | lda picture1,x 12 | sta $d900,x 13 | lda picture2,x 14 | sta $da00,x 15 | lda picture3,x 16 | sta $db00,x 17 | inx 18 | bne draw 19 | rts 20 | -------------------------------------------------------------------------------- /src/rut_show_image.asm: -------------------------------------------------------------------------------- 1 | ; Show image routine 2 | ; It will change the characters stored in the screen ram with the $e0 char 3 | show_img lda #$e0 4 | screenram sta $0400 5 | inc screenram+1 6 | bne skip 7 | inc screenram+2 8 | skip 9 | rts 10 | --------------------------------------------------------------------------------