EZ Lazy bitmap assembly programming on the Commodore 64
Vložit
- čas přidán 8. 07. 2024
- In today's video, you're going to learn how to code very easily bitmap graphics on the Commodore 64, in machine language. I'm using a friendly tool aimed at programmers, who wish to have an easy-to-use code for their demos or games, or just the fun of it, although it might not be the best tool providing the best graphics.
The internet tool used during the video is the following:
8bitworkshop.com/dithertron/#...
My books in French available on Amazon
amzn.eu/d/0b0I82kk
amzn.eu/d/01ZhDRJQ
Dans la vidéo de ce jour, vous allez apprendre à programmer des graphismes matriciels type bitmap sur le Commodore 64, en langage machine. J'utilise un outil facile à utiliser, à destination des programmeurs désireux de pouvoir produire un code facile à intégrer dans un jeu ou une démo, ou simplement pour l'amusement, bien qu'il ne s'agisse pas du meilleur outil permettant de générer les meilleurs graphismes.
L'outil internet utilisé est le suivant :
8bitworkshop.com/dithertron/#...
Mes livres en Français disponibles sur Amazon
amzn.eu/d/0b0I82kk
amzn.eu/d/01ZhDRJQ
#koala
#c64
#bitmap
#6502 - Věda a technologie
Thanks very much for the link to the image converter and the tutorial! I found that by adding a Basic header line to the source code, it isn't necessary to manually type a SYS command. Below is the Kick assembler source code for anyone who might find it useful...
.const CharData=ScreenData+8000
.const ColorData=CharData+1000
.const XtraData=ColorData+1000
.const BackupColorData=XtraData+2
.const Src=$fb
.const Dest=$fd
.const UseMultiColorGraphics=1
*=$801 "Basic"
BasicUpstart2(start)
start:
lda $d020
sta vars
lda XtraData+1
sta $d020 // border
lda $d021
sta vars+1
lda XtraData+0
sta $d021 // background
lda $d011
sta vars+2
lda #$3B // 25 rows, on, bitmap
sta $d011 // VIC control #1
lda $d016
sta vars+3
lda #$18 // 40 column, multicolor
sta $d016 // VIC control #2
lda $dd00
sta vars+4
lda #$02
sta $dd00 // set VIC bank ($4000-$7FFF)
lda $d018
sta vars+5
lda #$80
sta $d018 // set VIC screen to $6000
// backup color RAM
lda #$00
sta Src
lda #$d8
sta Src+1
lda #BackupColorData
sta Dest+1
ldx #4
jsr CopyMem
// copy color RAM
lda #ColorData
sta Src+1
lda #0
sta Dest
lda #$d8
sta Dest+1
ldx #4
jsr CopyMem
// copy screen memory
lda #ScreenData
sta Src+1
lda #$40
sta Dest+1
ldx #32
jsr CopyMem
// copy char memory
lda #CharData
sta Src+1
lda #$60
sta Dest+1
ldx #4
jsr CopyMem
// get keypress and exit
jsr $ffe4
beq *-3
lda vars+5
sta $d018
lda vars+4
sta $dd00
lda vars+3
sta $d016
lda vars+2
sta $d011
lda vars+1
sta $d021
lda vars
sta $d020
// restore color RAM
lda #BackupColorData
sta Src+1
lda #$d8
sta Dest+1
ldx #4
jsr CopyMem
rts
// copy data from Src to Dest (x = number of pages)
CopyMem:
ldy #0
!: lda (Src),y
sta (Dest),y
iny
bne !-
inc Src+1
inc Dest+1
dex
bne !-
rts
vars:
.fill 6,0
// bitmap data
ScreenData:
.import binary "parrot-c64.multi.bin"