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: 494
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: 172
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: 494
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
Acidchild/Padua
Meikel aka ZUX/Sparks
Weetibix
kbs/Pht/Lxt
ΛΛdZ
Fungus/Nostalgia
Guests online: 124
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 Edge of Disgrace  (9.6)
6 What Is The Matrix 2  (9.6)
7 The Demo Coder  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 No Listen  (9.6)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 Dawnfall V1.1  (9.5)
7 Rainbow Connection  (9.5)
8 Onscreen 5k  (9.5)
9 Morph  (9.5)
10 Libertongo  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Triad  (9.3)
5 Censor Design  (9.3)
Top Crackers
1 Mr. Z  (9.9)
2 Antitrack  (9.8)
3 OTD  (9.8)
4 Fungus  (9.8)
5 S!R  (9.8)

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