It is currently Mon Dec 11, 2017 4:31 am

All times are UTC - 7 hours



Forum rules


Related:



Post new topic Reply to topic  [ 70 posts ]  Go to page 1, 2, 3, 4, 5  Next
Author Message
 Post subject: PVsneslib - SNES JUKEBOX
PostPosted: Tue Jul 01, 2014 3:45 am 
Offline

Joined: Tue Jul 01, 2014 3:30 am
Posts: 34
UPDATE: Au 2016

Thanks to pvsneslib i made a cool jukebox for SNES, including lots of impulse tracker files i edited from games or pop music :).

Now (2016) I found my little rom and I tried to improve it. But i can't compile roms anymore with snesdev, this is the error:

Code:
CHECK HEADERS: the object files are from different projects


How could I solve that?

I attached the last version I could compile, it includes changing backgrounds and new music.

This is the source: https://db.tt/CMODHxWu

Image

Image

Image

Thanks


Attachments:
Music_Player_Snes.rar [1.48 MiB]
Downloaded 140 times


Last edited by Mills on Thu Aug 04, 2016 9:11 am, edited 4 times in total.
Top
 Profile  
 
PostPosted: Tue Jul 01, 2014 5:52 am 
Offline

Joined: Thu Oct 05, 2006 6:29 am
Posts: 911
Bit 13 of each BG map entry is a priority bit. Try using a low prio (0) for the BG0 and BG1 tiles, and a high priority for the BG2 tiles (if you're using mode 2, 4 or 6 the priority bit for BG2 has a different meaning).
If you're using display mode 1 there's also a BG2 priority setting in bit 3 of BGMODE ($2105) to take into account.


Top
 Profile  
 
PostPosted: Tue Jul 01, 2014 6:10 am 
Offline

Joined: Tue Jul 01, 2014 3:30 am
Posts: 34
mic_ wrote:
Bit 13 of each BG map entry is a priority bit. Try using a low prio (0) for the BG0 and BG1 tiles, and a high priority for the BG2 tiles (if you're using mode 2, 4 or 6 the priority bit for BG2 has a different meaning).
If you're using display mode 1 there's also a BG2 priority setting in bit 3 of BGMODE ($2105) to take into account.


I'm very noob at programming, i'm using C (pvsneslib) I don't know if i can acces the bit priority with this library. Or maybe i can edit it while converting maps with gfx2snes.

I´m using mode 1.

Thanks


Top
 Profile  
 
PostPosted: Tue Jul 01, 2014 6:58 am 
Offline

Joined: Tue Apr 24, 2012 12:22 pm
Posts: 53
I replied with PM, as you sent me a PM like this topic.

BG3_MODE1_PRORITY_HIGH is to use when setting mode.

Code:
setMode(BG_MODE1,BG3_MODE1_PRORITY_HIGH);


Top
 Profile  
 
PostPosted: Wed Jul 02, 2014 4:19 am 
Offline

Joined: Tue Jul 01, 2014 3:30 am
Posts: 34
alekmaul wrote:
I replied with PM, as you sent me a PM like this topic.

BG3_MODE1_PRORITY_HIGH is to use when setting mode.

Code:
setMode(BG_MODE1,BG3_MODE1_PRORITY_HIGH);


Thanks! That worked perfect.

Another problem now with music.

I can convert a song.it to spc and the music will play OK in many music players emulating the snes.

But when creating soundbanks for pvsneslib, some songs use two banks, for example like this:
Code:
;
.include "hdr.asm"

.bank 4
.section "SOUNDBANK" ; need dedicated bank(s)

SONGBANK1:
.incbin "soundbank.bnk" read $8000
.ends

.bank 5
.section "SOUNDBANK1" ; need dedicated bank(s)

SONGBANK2:
.incbin "soundbank.bnk" skip $8000
.ends


If i try to play this song inside pvsneslib i just can select one of the banks:

Code:
spcSetBank(&SONGBANK1);
spcAllocateSoundRegion(39);
spcLoad(SONG);
spcPlay(0);



The music plays with missing samples.

How do I play the song correctly?

Thanks a lot


Top
 Profile  
 
PostPosted: Wed Jul 02, 2014 11:49 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19322
Location: NE Indiana, USA (NTSC)
Assuming that .bank specifies a 32768-byte LoROM bank:
Perhaps the easiest way to just get it working is to copy the whole song into WRAM, the first bank into $7F0000-$7F7FFF and the second into $7F8000-$7FFFFF, and then copy from there to the SPC700.


Top
 Profile  
 
PostPosted: Wed Jul 02, 2014 12:07 pm 
Offline

Joined: Sun Aug 11, 2013 6:07 am
Posts: 57
Or you can recompile tcc816 for hirom (iirc you can just modify the wla header) and modify your projects header to use hirom, but I don't know if pvsneslib plays nice with hirom.


Top
 Profile  
 
PostPosted: Wed Jul 02, 2014 12:17 pm 
Offline

Joined: Tue Apr 24, 2012 12:22 pm
Posts: 53
Well, the 1st bank is number #1 for spcLoad, the second one (SOUNDBANK1) if #2, and so on
So ...
As explain in example, you must :
spcAllocateSoundRegion(39); -> only 1st time with big value you need (often you must set 0)

spcSetBank(&SONGBANK1); -> no, just need to set the spcLoad function

spcStop(); spcLoad(SONG);spcPlay(0); -> yes, that should work.

Tell me if it works for you.

Just check example, it works fine with it file :)

By the way, don't forget mod emulation with the current issues wrote in pvsneslib_snesmod.txt file


Last edited by alekmaul on Wed Jul 02, 2014 12:18 pm, edited 1 time in total.

Top
 Profile  
 
PostPosted: Wed Jul 02, 2014 12:17 pm 
Offline

Joined: Tue Jul 01, 2014 3:30 am
Posts: 34
I'll test it now alekmaul.

For the moment i reduced the size of some "huge" samples, so that the song fits inside one 32768-byte LoROM bank.

Surely i was expecting more from the spc sound. It looks like samples have some lenght limit, so big samples did not play very well (even if they fit in a rom bank).

I nearly finished my jukebox, now i just have to optimize some songs to play better. :D

Image


Top
 Profile  
 
PostPosted: Wed Jul 02, 2014 12:20 pm 
Offline

Joined: Tue Apr 24, 2012 12:22 pm
Posts: 53
Mills wrote:
I nearly finished my jukebox, now i just have to optimize some songs to play better. :D

That's great, i can help regarding songs. Kungfu Furby also sent me some advices regarding mod/it files to be comaptible with my current snesmod adaptation (remember that it is only a mukunda rewrite of his driver for PVSneslib ;) )
Nice to see some things written with PvSnesLib, that's great :D !


Top
 Profile  
 
PostPosted: Wed Jul 02, 2014 12:39 pm 
Offline

Joined: Tue Jul 01, 2014 3:30 am
Posts: 34
alekmaul wrote:
That's great, i can help regarding songs. Kungfu Furby also sent me some advices regarding mod/it files to be comaptible with my current snesmod adaptation (remember that it is only a mukunda rewrite of his driver for PVSneslib ;) )
Nice to see some things written with PvSnesLib, that's great :D !


Tested the big song without "spcSetBank(&SONGBANK1);" it did nothing...

I first tested songs with some plugin that plays them in windows so the driver was different.

This is one of the .it that converted to spc, plays well using winamp plugin for windows, and does not play well on pvsneslib. Maybe it is too much for the real snes :D

It was a .mod i found long time ago, and then decided to add the voice samples.


Attachments:
whatislove.zip [81.84 KiB]
Downloaded 113 times
Top
 Profile  
 
PostPosted: Wed Jul 02, 2014 1:18 pm 
Offline

Joined: Wed Jul 09, 2008 8:46 pm
Posts: 239
I have an ASM trick to get around that 32,768 byte limit (which is WLA DX deleting "unused banks"). Just have the first character in the name of the sections above the 32K limit be an exclamation point, and that problem should go away.

Thus, this is your new result...

Code:
;
.include "hdr.asm"

.bank 4
.section "SOUNDBANK" ; need dedicated bank(s)

SONGBANK1:
.incbin "soundbank.bnk" read $8000
.ends

.bank 5
.section "!SOUNDBANK1" ; need dedicated bank(s)

SONGBANK2:
.incbin "soundbank.bnk" skip $8000
.ends


Either that, or call the spcSetBank routine for each ROM bank (this is what alekmaul does with multi-LoROM-bank soundbanks), ending with the actual starting point of the soundbank.

I suspect misconceptions about the limit applying to the SPC700 partially comes from this problem.

The actual length limit for samples is more along the lines of a little more than 100,000 (that's prior to conversion, and it does not matter whether it is 8 bits or 16 bits... they both have the exact same filesize)... but that's if you really want to fill up the entire SPC700 memory with just a single sample (and not much pattern data).


Last edited by KungFuFurby on Wed Jul 02, 2014 1:29 pm, edited 1 time in total.

Top
 Profile  
 
PostPosted: Wed Jul 02, 2014 1:28 pm 
Offline

Joined: Tue Jul 01, 2014 3:30 am
Posts: 34
Problem is I need to specify the "SONGBANK1:" to play a song...

About songs. How can i create soundbanks from spc's?
I think converting then to .it and reconverting to spc will not be very good.


Top
 Profile  
 
PostPosted: Wed Jul 02, 2014 1:31 pm 
Offline

Joined: Wed Jul 09, 2008 8:46 pm
Posts: 239
Soundbanks have to be created from the .it files... not the .spc files.
The biggest reason why is because you might be dealing with completely different sound drivers in the .spc files.


Top
 Profile  
 
PostPosted: Wed Jul 02, 2014 2:43 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19322
Location: NE Indiana, USA (NTSC)
Does resetting the SPC700 to its IPL require resetting the entire console? If so, and you want to play SPCs that use different engines, you'll need to either find a reset command in each engine or add a circuit that momentarily pulls the reset pin low.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 70 posts ]  Go to page 1, 2, 3, 4, 5  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group