WRITING A MINI INTRO WITH PICTURE AND SID TUNE (C64) PART 2

Last Updated or created 2023-08-02

Adding a picture:
Most used is loading a koala picture.
Never done it like this before, luckily loads of retro lovers are posting code examples.
There are a lot of tools now available on PC. (Windows and Linux)

Acme : compiler i’ve used for this example
Retropixels : converting jpg into koala
Exomizer : packing/compressing the C64 prg (16k to 5.4k)
Sidreloc : relocator for SID files.

Exomizer command with effect:
(NOTE on linux you have to use single qoutes!)

retropixels -r 64 --format prg bottom.jpg ; for a prg (not used)
retropixels bottom.jpg ; for a koala picture

exomizer sfx 0x080d bottom.prg -x 'lda $fb eor #$01 sta $fb beq skip dec $d020 inc $d020 skip:'
# 0x080d is the starting address

Code

!to "bottomsm.prg",cbm
; start prg
* = $0801
; header for sys auto start
!byte $0b, $08, $00, $00, $9e, $32, $30, $36, $31, $00, $00, $00

PICTURE = $2000
BITMAP = PICTURE
VIDEO = PICTURE+$1f40
COLOR = PICTURE+$2328
BACKGROUND = PICTURE+$2710

* = $080d

	sei
	lda #<irq
	ldx #>irq
	sta $314
	stx $315
	lda #$1b
	ldx #$00
	ldy #$7f 
	sta $d011
	stx $d012
	sty $dc0d
	lda #$01
	sta $d01a
	sta $d019 ; ACK any raster IRQs
	lda #$00
	jsr $1000 ; Call music

	lda #$00
	sta $d020 ; Border Color
	lda BACKGROUND
	sta $d021 ; Screen Color

	; Transfer Video and Color
	ldx #$00
.LOOP
	; Transfers video data
	lda VIDEO,x
	sta $0400,x
	lda VIDEO+$100,x
	sta $0500,x
	lda VIDEO+$200,x
	sta $0600,x
	lda VIDEO+$2e8,x
	sta $06e8,x
	; Transfers color data
	lda COLOR,x
	sta $d800,x
	lda COLOR+$100,x
	sta $d900,x
	lda COLOR+$200,x
	sta $da00,x
	lda COLOR+$2e8,x
	sta $dae8,x
	inx
	bne .LOOP

	; Bitmap Mode On
	lda #$3b
	sta $d011

	; MultiColor On
	lda #$d8
	sta $d016
	; When bitmap adress is $2000 ; Screen at $0400 ; Value of $d018 is $18
	lda #$18
	sta $d018
	cli
	.MYLOOP
	jmp .MYLOOP

irq
	lda #$01
	sta $d019 ; ACK any raster IRQs
	jsr $1003 ;Play the music
	jmp $ea31
   
; Data parts with headers cut
	* = $1000
	!binary "bottom1000.sid" ,, $7c+2


	* = PICTURE
	!binary "bottom.kla",,2
Spread the love

Leave a Reply

Your email address will not be published. Required fields are marked *