Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in 
CSDb User Forums


Forums > C64 Coding > Adding SID Music to Compiled Basic
2019-09-04 16:06
MrElijahGardner

Registered: Jul 2019
Posts: 7
Adding SID Music to Compiled Basic

I'm working on a new game. Here is an older video clip as the game has progressed quite a bit since then.
https://youtube.com/watch?v=o9wBsf8FM88

It is written in basic and then compiled. How can I go about adding Sid Music to it? Any suggestions?

Thanks in Advance
 
... 5 posts hidden. Click here to view all posts....
 
2019-09-04 17:23
MrElijahGardner

Registered: Jul 2019
Posts: 7
I'm using Basic 64 It will let me change the program start memory
2019-09-04 17:38
TheRyk

Registered: Mar 2009
Posts: 602
Doing sth exactly once a frame in BASIC (even compiled) is tricky at least. That's why some mini ML part called only once via SYS and then setting up an IRQ would help.

An uncompiled example how to load ML code (and a .SID-file is nothing but ML code plus data) into areas outside of BASIC memory can be found here:
http://c64games.de/phpseiten/spieledetail.php?filnummer=336
Check out the very first 2 blocks file in the first disk image of the ZIP
It does nothing but loading 5 files ML, Charset ("Zeichen"), Sprites and Sounds and title screen into RAM higher than $9FFF and finally loading the MAIN code ("MF-PRG")
2019-09-04 18:11
MrElijahGardner

Registered: Jul 2019
Posts: 7
Thanks for the example of loading the multiple files. That is easy I can handle that no problem.

My assembly skills are garbage. I know there isnt much to doing an IRQ but not really sure where to start. Is there an example you can point me to.

It would be really awesome if there was an easy way just to poke the IRQ routine into memory to then call the play once per frame part.
2019-09-04 18:32
TWW

Registered: Jul 2009
Posts: 453
Well documented IRQ routine:

https://codebase64.org/doku.php?id=base:introduction_to_raster_..

EDIT: Use 0315/0315 instead of fffe/ffff and #$37 insted of #$35 for setting $01.
2019-09-04 19:26
MrElijahGardner

Registered: Jul 2019
Posts: 7
#$35 for setting $01? This is because we don't want to turn the rom and kernal off correct? I'm not sure why we even need to mess with this address?

Use 0315/0315 instead of fffe/ffff? What is the address of interrupt code referring too?

I wasn't kidding when I said assembly isn't one of my strong point. I'm going to keep plugging away. All the help so far has been great.
2019-09-04 19:50
4mat

Registered: May 2010
Posts: 51
Long while back I remember using Music Assembler for a few compiled basic things. Calling the save address automatically sets up an IRQ routine for you and plays the track.

Music-Assembler V1.0

But yeah better to have your own routine so you can set up different tracks and manually control them.
2019-09-04 20:07
MrElijahGardner

Registered: Jul 2019
Posts: 7
Still trying to figure out music assembler but I think that is the easiest way to achieve the result I need. I tested it with some of the tracks on the disk and it does exactly what I need as long as it gives me some flexibility on the memory addresses.

I was getting ready to go play on the train tracks. THANK YOU
2019-09-04 21:30
TWW

Registered: Jul 2009
Posts: 453
Quote: Long while back I remember using Music Assembler for a few compiled basic things. Calling the save address automatically sets up an IRQ routine for you and plays the track.

Music-Assembler V1.0

But yeah better to have your own routine so you can set up different tracks and manually control them.


Ok, I wrote a small IRQ routine which will play music while in Basic. The source and the actual machine code is shown below. You have to poke in the data to some address ($c000`perhaps) and update the 0314/0315 pointers and also change the music init and play jsr's.

Then you call the routine by sys 49152 or whatever it was $c000 was decimal.




EDIT: haha I quot'ed the wrong post, sorry.
2019-09-04 22:46
MrElijahGardner

Registered: Jul 2019
Posts: 7
Thank you,

I'm getting it to work now (-:
2019-09-05 08:47
Count Zero

Registered: Jan 2003
Posts: 922
<offtopic>
This is Lemon talk.
</offtopic>
Previous - 1 | 2 - Next
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
Broti/DT/KRN
Erol
dano/padua
krissz
Frantic/Hack'n'Trade
A3/AFL
The Human Co../Maste..
iAN CooG/HVSC
Guests online: 256
Top Demos
1 Uncensored  (9.7)
2 Unboxed  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.7)
5 Comaland 100%  (9.6)
6 The Shores of Reflec..  (9.6)
7 Lunatico  (9.6)
8 C=Bit 18  (9.5)
9 Wonderland XII  (9.5)
10 Old Men in Used Cars  (9.5)
Top onefile Demos
1 Dawnfall V1.1  (9.5)
2 Smile to the Sky  (9.5)
3 Pandemoniac Part 5 o..  (9.5)
4 The Tuneful Eight [u..  (9.5)
5 Crystal Gazer  (9.5)
6 Daah, Those Acid Pil..  (9.5)
7 Rewind  (9.5)
8 Instinct  (9.5)
9 Innervasion  (9.4)
10 Bad Boy  (9.4)
Top Groups
1 PriorArt  (9.7)
2 Fossil  (9.6)
3 Performers  (9.6)
4 Oxyron  (9.5)
5 Censor Design  (9.4)
Top Logo Graphicians
1 Pal  (9.5)
2 Mermaid  (9.2)
3 Yazoo  (9.1)
4 Elko  (9.1)
5 Compyx  (9.0)

Home - Disclaimer
Copyright © No Name 2001-2019
Page generated in: 0.051 sec.