Jump to content
IGNORED

Sound system with vbcc


swapd0

Recommended Posts

Hello

 

I'm coding a Jaguar game and I need a sound system that allows me to play mod files and some sound effects at the same time.

 

I've tried u235se but the object file is not compatible with vbcc, if I try to use rln as linker it doesn't recognise the compiled c source code.

 

Thanks

 

Link to comment
Share on other sites

Never used SMAC to build any of my stuff so this may not work. Didn't throw out any warnings or errors. But could you try the attached object file instead of the release version and let me know if it works for you?

 

attachicon.gifU-235SE-0.22-SMAC.zip

 

 

I'm using rmac on OSX, and the problem that I've is that it looks that it can't link c files compiled with vbcc, but I've DrTypo's tube source code and he uses vbcc, but sln as linker.

rln -v -e -l -rd -a 4000 x x -o game.jag obj/main.o obj/imgobjects.o obj/blitter.o obj/player.o obj/playerGrfx.o obj/cpuPlayer.o obj/backgroundGrfx.o obj/overlaysGrfx.o obj/playfield.o obj/sprite.o obj/sound.o obj/joypad.o obj/video.o u235se/u235se.obj

Reboot's Linker for Atari Jaguar
Copyright (c) 199x Allan K. Pratt, 2014 Reboot
V1.2.2 Feb 23 2018 (OSX/Linux)

dofile() : `obj/main.o' NORMAL
dofile() : `obj/imgobjects.o' NORMAL
dofile() : `obj/blitter.o' NORMAL
dofile() : `obj/player.o' NORMAL
dofile() : `obj/playerGrfx.o' NORMAL
dofile() : `obj/cpuPlayer.o' NORMAL
dofile() : `obj/backgroundGrfx.o' NORMAL
dofile() : `obj/ballGrfx.o' NORMAL
dofile() : `obj/overlaysGrfx.o' NORMAL
dofile() : `obj/playfield.o' NORMAL
dofile() : `obj/sprite.o' NORMAL
dofile() : `obj/sound.o' NORMAL
dofile() : `obj/joypad.o' NORMAL
dofile() : `obj/video.o' NORMAL
dofile() : `u235se/u235se.obj' NORMAL
Output file is game.jag
Read file obj/main.o
obj/main.o is not a supported object file
Link aborted.
make: *** [build] Error 1

Link to comment
Share on other sites

I'm using rmac on OSX, and the problem that I've is that it looks that it can't link c files compiled with vbcc, but I've DrTypo's tube source code and he uses vbcc, but sln as linker.

Reboot's Linker for Atari Jaguar
Copyright (c) 199x Allan K. Pratt, 2014 Reboot
V1.2.2 Feb 23 2018 (OSX/Linux)

 

Just saying, latest rln version is v1.5.2. Maybe try compiling the latest version from http://shamusworld.gotdns.org/git/rlnand try that? (link points to the git repo btw).

  • Like 2
Link to comment
Share on other sites

 

Just saying, latest rln version is v1.5.2. Maybe try compiling the latest version from http://shamusworld.gotdns.org/git/rlnand try that? (link points to the git repo btw).

 

Downloaded and compiled, It's the same version that I have.

 

I've downloaded sln source code, let's try it. If it doesn't work I'll try the Remover's library.

Link to comment
Share on other sites

  • 1 month later...

I assume you are using U235 SE ?

 

Have the volumes of those channels been set?

 

Another thing that bit me a few times was my SCART cable was slightly out of the TV, so either left or right wasn't connected :D It doesn't sound like that is the case as at least one of the other SFX channels would work.

 

There is no reason why a sample that plays on channel 4 won't play on any of the other channels, volume setting is all I can think of off the top of my head. Have you tried playing it on channels 0-3 as well?

Link to comment
Share on other sites

Setting the volume has no effect :(

 

With this code I've sounds on channel 0, 2, 4 & 6

_play_sound::
	move.l 4(sp),d0							; Put address of sample bank in d0
	move.l	d0,U235SE_ptr_sample_bank

	and.w #$fff0,d0							; mask off the low nibble
	or.w #$b,d0								; add Set Sample Bank instruction

	lea playlist,a0							; The address of the sound effect playlist
	move.l d0,(a0)+							; Write Set bank to playlist

	move.w next_voice,d0
	addq.w #2,d0
	and.w #$e,d0
	move.w d0,next_voice

	move.l volumes(pc,d0.w),d1
	move.l d1,(a0)+
	move.l voices(pc,d0.w),d1
	move.l d1,(a0)+
	move.l #0,(a0)+		; terminate the end of the list - Or the SE will skip off through RAM making a mess

	move.l	#playlist,U235SE_sfxplaylist_ptr	; set the playlist pointer
	rts

next_voice:
	dc.w 0
voices:
	dc.l $02
	dc.l $12
	dc.l $22
	dc.l $32
	dc.l $42
	dc.l $52
	dc.l $62
	dc.l $72
volumes:
	dc.l $4003
	dc.l $4013
	dc.l $4023
	dc.l $4033
	dc.l $4043
	dc.l $4053
	dc.l $4063
	dc.l $4073

	data
.phrase
playlist:
	dc.l 0,0,0,0,0,0,0,0,0,0
	dc.l $ff		; playlist termination
 

With this version I got sound on channels 0 & 4 (look at voice table, I start with channel 4 now)

_play_sound::
	move.l 4(sp),d0							; Put address of sample bank in d0
	move.l	d0,U235SE_ptr_sample_bank

	and.w #$fff0,d0							; mask off the low nibble
	or.w #$b,d0								; add Set Sample Bank instruction

	lea playlist,a0							; The address of the sound effect playlist
	move.l d0,(a0)+							; Write Set bank to playlist

	move.w next_voice,d0
	addq.w #2,d0
	and.w #$e,d0
	move.w d0,next_voice

	move.l volumes(pc,d0.w),d1
	move.l d1,(a0)+
	move.l voices(pc,d0.w),d1
	move.l d1,(a0)+
	move.l #0,(a0)+		; terminate the end of the list - Or the SE will skip off through RAM making a mess

	move.l	#playlist,U235SE_sfxplaylist_ptr				; set the playlist pointer
	rts

next_voice:
	dc.w 0
voices:
	dc.l $42
	dc.l $52
	dc.l $62
	dc.l $72
	dc.l $02
	dc.l $12
	dc.l $22
	dc.l $32
volumes:
	dc.l $4043
	dc.l $4053
	dc.l $4063
	dc.l $4073
	dc.l $4003
	dc.l $4013
	dc.l $4023
	dc.l $4033

	data
.phrase
playlist:
	dc.l 0,0,0,0,0,0,0,0,0,0
	dc.l $ff		; playlist termination

Also I don't know why I need the last dc.l $ff if I remove it I got no sound (the docs don't say anything about this), and If I remove it and write the code like this it doesn't work...


	move.l volumes(pc,d0.w),d1
	move.l d1,(a0)+
	move.l voices(pc,d0.w),d1
	move.l d1,(a0)+
	move.l #$ff,(a0)+	
	move.l #0,(a0)+	

	move.l	#playlist,U235SE_sfxplaylist_ptr
	rts

Edited by swapd0
Link to comment
Share on other sites

For debugging I have used the skunk console mode, then written some simple 68K debug routines that will send strings back via the console. Trivial to write something that will dump registers or hex values into strings and send them over the link.

 

It's certainly no full featured debug system but for a few minutes of quick hacking you can get a very useful library of functions together that will give you at least some visibility of what is going on in that black box of Jaguar goodness :)

 

Not sure about the $ff command at the end of the list. That is documented as being there to shutdown the SE completely, from reports back the current release build it doesn't work properly in all cases (just my test cases :/ ) so YMMV with it. But you shouldn't need to issue it on every list. As long as there is a terminator all should be good. I'd possibly also try and keep the lists long aligned too, I may be misremembering but I know unaligned long reads from RISC RAM = wacky fun times and not what you want, I cannot remember if the same is true for main RAM and the DSP (with it's 16bit bus)

  • Like 1
Link to comment
Share on other sites

  • 2 years later...
On 4/12/2018 at 3:03 AM, swapd0 said:

I should spend some time to make my remote debugger to work with the skunkboard and port it to OS-X

I don't suppose this ever happened?  If not, I'd love to take a stab at this myself if you have the old source sitting around.

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...