Joined: May 22, 2003 Posts: 23948 Location: NSW, Australia XP: 3,060,914
Posted: Sun Aug 19, 2012 11:16 am Post subject: commodore 64 (c64) programming
Does anyone have experience coding 6502 assembly? The reason i ask is that i am working on programming a demo, or should i say intro, on the commodore 64 which i will be releasing with my entire collection of c64 stuff via torrents. I have already been working on this project for over 12 months on and off, and have loads to go and backup.
I just thought id see if anyone on HQ ever did code on the commodore 64 OR NOT.. I know DJB did, and never really coded more did music and graphics back then.
heres a little example of a demo i am working on:
Code:
;------------------------------------------------------------------
; C64 Demo Raster, Starfield, SID Music
; Developed by Kent Patfield (patto/pearl)
; Music by Kent Patfield (patto/pearl)
; Font by Kent Patfield (patto/pearl)
; Logo by Kent Patfield (patto/pearl)
; DASM Cross Assembler (compile: dasm demo.asm -odemo.prg)
;==================================================================
processor 6502 ; C=64
;---------------------------------------------
; Create a Loader (don't need to SYS 2061)
;=============================================
org $0801
.byte $0b,$08,$01,$00,$9e,$32,$30,$36,$31,$00,$00,$00 ;= SYS 2061 (on load)
;------------------------------------------------------------
; Main Application ( eg. $080d = SYS 2061 / $0810 SYS 2064)
;============================================================
org $080d
BEGIN ; LET'S BEGIN THE DEMO EH?!?
sidinit = $c000 ; music init
sidplay = $c003 ; music subroutine
SHOWMESSAGE
jsr $e544 ; clear screen
lda #$18 ; load the custom charset
sta $d018 ; screen memory is at $0400 and charset at $2000
ldx #$00 ; set the x-register to zero
WRITE: lda MESSAGE,x ; load the x3'th character msg into accumulator
jsr $ffd2 ; write the value in the accumulator to the screen
inx ; increase X
cpx #13 ; Render is 54 character long
bne WRITE ; If X=54 break else Loop through each of the characters and write to screen
ldx #$00 ; set the x-register to zero
SETCOLOR: lda #$01 ; setting the color of our characters.
sta $d800,x ; color is stored at $d800
inx ; increase X
cpx #$13 ; Render is 54 character long
bne SETCOLOR
Joined: Oct 03, 2005 Posts: 6381 Location: Canada XP: 35,604
Posted: Wed Aug 22, 2012 10:52 pm Post subject:
Its been so long Ive forgotten how to code that LOL _________________________________________________________
|
All times are GMT |Page 1 of 1
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum