Re: [cc65] Interrupt driven SID player

From: Daniel Pralle <dpralle1gmx.de>
Date: 2013-07-06 20:39:53
Hi,


 I am an Atari guy and I have no idea how to play a SID :)
However, the RMT-player for the A8 uses aswell an "init" and "play"
routine. What I didn't find in the docs back then was that I have to
preload A, Y and X with information for the init routine.

A quick googel revela dthis quote:


And a LDA/LDX/LDY #$00 (or some other song number) before the jump to
init is a good idea...



So maybe it's the same in your case as it was back then with my RMT
replaying?

link:
http://www.lemon64.com/forum/viewtopic.php?t=42461&sid=e6e0546efd6a20354cb429b03fd58fac


If not, just ignore that mail :)

Happy SIDing :)




On Sat, 06 Jul 2013 20:32:16 +0200
Maik Merten <maikmerten@googlemail.com> wrote:

> Hi there,
> 
> reading the nice tutorials over at 
> http://dustlayer.com/c64-coding-tutorials I try to get some insights 
> into 6502 assembler. For instance, following 
> http://dustlayer.com/c64-coding-tutorials/2013/4/8/episode-2-3-did-i-interrupt-you 
> I was able to hook into the raster interrupt and make the border
> flash in the irq routine (the latter is not part of the tutorial, but
> a shortcut of mine to see the program lives).
> 
> The next step I would like to pursue is playing SID tunes. As far as
> I understand this involves three steps:
> 
>   * ensure that the SID data (without headers of the .sid file
> format) is loaded at a predefined location, usually $1000
>   * invoke the init routine, usually also at $1000
>   * once every screen refresh, invoke a play routine, often at $1003
> 
> Using a SID file from the HVSC which is reported by xsidplay to have 
> $1000 and $1003 as addresses, I try to include the SID data portion
> into my program as follows:
> 
> (Complete source code attached, an archive including all files is 
> available at 
> https://docs.google.com/file/d/0B11N4VzriA21alFyU1o3RGxsbUU/edit?usp=sharing 
> )
> 
> ---------------------------------
> 
> sid_init = $1000
> sid_play = $1003
> 
> ; ######## include a SID file for which xsidplay reports $1000 and
> $1003 .org $1000
> _siddata: .incbin "Xoo_Divided.sid",$7c+2 ; skip header and two bytes
> of load address
> .reloc
> 
> ---------------------------------
> 
> 
> (The offset is calculated as $7c for the SID v2 header and two bytes 
> designated as the load address, as indicated by the .sid file format 
> specification for the case of 0x08 and 0x09 containing 0x00
> respectively)
> 
> Anyway, doing a jsr sid_init during setup will freeze the machine or 
> terminate the program (depending on the SID file). So apparently I'm 
> executing nonsense, and I wonder if, e.g., my way of including the
> SID data is flawed or if I have a more conceptual misunderstanding.
> Or perhaps the way my assembler routines are wired to the C main
> program is problematic? I suspect something stupid :-(
> 
> I would greatly appreciate any help!
> 
> 
> Best regards,
> 
> Maik
> 
> 

----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Sat Jul 6 20:40:03 2013

This archive was generated by hypermail 2.1.8 : 2013-07-06 20:40:05 CEST