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


Forums > C64 Coding > Kick Assembler & SID Player
2010-03-25 17:01
breeze
Account closed

Registered: Mar 2009
Posts: 20
Kick Assembler & SID Player

In previous work I used the built-in sid-player Kick Assembler and the SID wa play correctly. At least in the rumor was is not noticeable.

Working on new intro, I was encountered a problem with play the SID module. The module has play incorrect sounds with some distortions.

I tried to create an executable PRG-file using PSID64 and found that the sound is clear and correct.

So I formed the opinion that the embedded player in the Kick Assembler is slightly incorrect.

Maybe I am wrong and I do something wrong. But you can show me an example of another SID-player, and that I could test and solve own problem. Maybe somehow i can use the player from PSID64?

p.s. Many thanks in advance. Because of this trouble, we must postpone the our new release.
 
... 1 post hidden. Click here to view all posts....
 
2010-03-25 17:38
breeze
Account closed

Registered: Mar 2009
Posts: 20
Quote: I think you're using zeropage addresses the music player uses as well. change your zps and check again

I am a little not quite understand what I need to do. Here is an example of code that is used in Kick Assembler:

.var music = LoadSid("Nightshift.sid")
:BasicUpstart2(start)
start:
lda #$00
sta $d020
sta $d021
ldx #0
ldy #0
lda #music.startSong-1
jsr music.init	
sei
lda #<irq1
sta $0314
lda #>irq1
sta $0315
asl $d019
lda #$7b
sta $dc0d
lda #$81
sta $d01a
lda #$1b
sta $d011
lda #$80
sta $d012
cli
this:	jmp this

irq1:  	
asl $d019
inc $d020
jsr music.play 
dec $d020
pla
tay
pla
tax
pla
rti

.pc=music.location "Music"
.fill music.size, music.getData(i)
2010-03-25 17:42
Skate

Registered: Jul 2003
Posts: 490
nothing seems to be wrong with that piece of code. where is the music located? $1000?
2010-03-25 17:50
Slammer

Registered: Feb 2004
Posts: 416
A couple of suggestions:

* Which sid module are you using? If you are trying to play a multispeed sid, then it wont work.
* When you run the music in an emulator, the sound might not be simulating the sid chip correctly (try a different one, or a c64).
* Have you tried swithing between the old and the new sid-chip in the emulator?
2010-03-25 17:57
breeze
Account closed

Registered: Mar 2009
Posts: 20
Sorry, I did not notice how over time the allotted for the interrupt is over. While I was writing an example, I decided to call at interupt only the music and the problem disappeared.

There is a lack of programming experience under C64. Sorry >_<
2010-03-25 21:16
SIDWAVE
Account closed

Registered: Apr 2002
Posts: 2238
your irq ends with pla tay pla tax etc...
but it dont start with pha txa pha...
so it is fuxxoring the regs
2010-03-25 21:30
Mace

Registered: May 2002
Posts: 1799
What Jan said.
2010-03-25 22:28
breeze
Account closed

Registered: Mar 2009
Posts: 20
Quote: your irq ends with pla tay pla tax etc...
but it dont start with pha txa pha...
so it is fuxxoring the regs


hmm... and it's true, somehow I missed this point in mind... thanks!
2010-03-25 22:38
Stone

Registered: Oct 2006
Posts: 168
What are you guys on? When using the irq vectors at $0314, all the registers are pushed on the stack for you by the kernal irq handler, so the irq end bit is perfectly fine. If this wasn't the case, the popping of registers would do more than thrash the registers, it would underflow the stack as well, causing a random jump (CRASH).
2010-03-26 10:16
breeze
Account closed

Registered: Mar 2009
Posts: 20
Quote: What are you guys on? When using the irq vectors at $0314, all the registers are pushed on the stack for you by the kernal irq handler, so the irq end bit is perfectly fine. If this wasn't the case, the popping of registers would do more than thrash the registers, it would underflow the stack as well, causing a random jump (CRASH).

Here is how ... thanks! Now I'll know!
2010-03-26 13:04
Skate

Registered: Jul 2003
Posts: 490
while we are talking on irqs, I just wrote an experimental code to see how irq fuckes up register values if we don't save them.

there is a little waiting time in the main loop between lda and sta. irq fucks up register values when waiting time block intersects with irq rasters. not a surprise, that's the expected result. but it also shows that if we always catch $d012 in our main loop and if we are sure main loop and irqs never conflict (rasterwise), then we wouldn't need to save a,x,y registers at all (no pha pla or sta lda stuff). of course main loop should never trust registers from the last frame. that's nothing unknown but I've never thought of getting rid of saving register values. I've always stored and restored register values even if main loop is just "jmp *". I just noticed it's not a must. maybe it can be useful in a very rare case in the future. :)

This information only applies while we are working in disabled kernal mode.

	!to "irqtest.prg",cbm

	* = $0801
	!byte $0c, $08, $00, $00, $9e, $32, $30, $36, $31, $00, $00, $00

	* = $080d
	sei
	lda #$35
	sta $01
	lda #$7f
	sta $dc0d
	sta $dd0d
	lda #$01
	sta $d01a
	lda #$80
	sta $d012
	lda #$1b
	sta $d011
	lda #<irq
	ldx #>irq
	sta $fffe
	stx $ffff
	asl $d019
	bit $dc0d
	bit $dd0d
	cli
-
	lda #$02
	ldx #$00
	dex
	bne *-1
	sta $d021
	jmp -

irq
;	sta toA
;	stx toX
;	sty toY
	inc $d020
	lda #$00 : pnt = *-1
	tax
	tay
	inc pnt
	asl $d019
;	lda #0 : toA = *-1
;	ldx #0 : toX = *-1
;	ldy #0 : toY = *-1
	rti
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
t0m3000/ibex-crew
Honcho
MCM/ONSLAUGHT
Colt45RPM
Guests online: 121
Top Demos
1 Next Level  (9.8)
2 Mojo  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Comaland 100%  (9.6)
6 No Bounds  (9.6)
7 Uncensored  (9.6)
8 Wonderland XIV  (9.6)
9 Memento Mori  (9.6)
10 Bromance  (9.5)
Top onefile Demos
1 It's More Fun to Com..  (9.7)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 TRSAC, Gabber & Pebe..  (9.5)
6 Rainbow Connection  (9.5)
7 Onscreen 5k  (9.5)
8 Wafer Demo  (9.5)
9 Dawnfall V1.1  (9.5)
10 Quadrants  (9.5)
Top Groups
1 Oxyron  (9.3)
2 Nostalgia  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Diskmag Editors
1 Jazzcat  (9.4)
2 Magic  (9.4)
3 hedning  (9.2)
4 Newscopy  (9.1)
5 Elwix  (9.1)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.041 sec.