[cc65] CIA Timers, SID gate, Structs Vs Poking, NES?

Date view Thread view Subject view

From: Veli-Pekka Tätilä (vtatila_at_mail.student.oulu.fi)
Date: 2004-01-09 13:26:06


Hi list,
This is my first post in here, I hope this is the right list. I'm more like
a musician than a programmer so sorry if some of these questions seem
newbish. I've programmed a bit with C already but am not familiar with the
C64 in particular apart from the SID chip. That is to say, I've got the
HardSId card which has the SID chip on a PCI card in hardware and am
thinking of creating a simple text-mode step sequencer for generating
x0x-like percussive noise drum loops. I could then use the program to run
the real SID chip inside an emulator and capture the output in wavefiles for
example to be used in Sonar later on.

1) I don't really understand the CIA even after reading the section on it in
the C64 programmers guide and looking at the memory map. Could some kind
soul explain me how the timer chip basically works? I'd need to do a
function that will generate an interrupt after a given number of
milliseconds has passed. I'll be using this as the basis for my sequencers
timing. Handling interrupts is also all new to me so could you please give a
simple example in C related to the timer question above? I know the concept
of an intterupt and used to fight with IRQ conflicts in the good(?) old DOS
days but that's about it, really.

2) I've already gotten some noise out of the SID chip but began wondering
how the gate works exactly. Can I retrigger the envelope while it's at the
sustain phase by simply reopening the gate or do I always need to close it
before a reopen? Also any ideas on how musical pitch would be represented
nicely, is a lookup table preferd to finding out the values algorithmically?

3) Just out of curiousity, is poking the memory directly with the macro
introduced in the FAQ faster than assigning to a field of one of those
structs? I personally find the struct version much easier to work with.

4) Is it possible to write programs for the NES using this same compiler? I
think it uses the same processor as the C64 but haven't seen any NES
specific structs in the headers.

Any help greatly appreciated.

With kind regards Veli-Pekka Tätilä (vtatila_at_mail.student.oulu.fi)
Accessibility, VG music, synthesizers and programming:
http://www.student.oulu.fi/~vtatila

----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo_at_musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.


Date view Thread view Subject view

This archive was generated by hypermail 2.1.3 : 2004-01-09 13:30:56 CET