PVsneslib - SNES JUKEBOX

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
PVsneslib - SNES JUKEBOX
by on (#130488)
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
Re: PVsneslib Layer problem - SNES JUKEBOX
by on (#130490)
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.
Re: PVsneslib Layer problem - SNES JUKEBOX
by on (#130491)
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
Re: PVsneslib Layer problem - SNES JUKEBOX
by on (#130492)
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);
Re: PVsneslib Layer problem - SNES JUKEBOX
by on (#130528)
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
Re: PVsneslib Layer problem - SNES JUKEBOX
by on (#130549)
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.
Re: PVsneslib Layer problem - SNES JUKEBOX
by on (#130553)
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.
Re: PVsneslib - SNES JUKEBOX
by on (#130555)
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
Re: PVsneslib - SNES JUKEBOX
by on (#130557)
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
Re: PVsneslib - SNES JUKEBOX
by on (#130558)
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 !
Re: PVsneslib - SNES JUKEBOX
by on (#130559)
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.
Re: PVsneslib - SNES JUKEBOX
by on (#130563)
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).
Re: PVsneslib - SNES JUKEBOX
by on (#130566)
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.
Re: PVsneslib - SNES JUKEBOX
by on (#130567)
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.
Re: PVsneslib - SNES JUKEBOX
by on (#130573)
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.
Re: PVsneslib - SNES JUKEBOX
by on (#130578)
tepples wrote:
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.


I'm very new to SNES programming, i wanted to use some spc from games (donkey kong, rock & roll racing), but i think i can't...

So I converted a bunch of impulse tracker files to soundbanks, and now i can play them without reset in pvsneslib.
Re: PVsneslib - SNES JUKEBOX
by on (#130596)
I want to include more music in this rom, so, if you know great tunes, or you made a cool IT, we can include them.

They can be any module (mod, s3m, xm, it..) or midi, not too big 8-).

Allready included:

Pollen Resurrection
Mortimer's Chipdisko
Aladdin (amiga)
Orgasmic Chipper 2
Artificial Sweetener
Banjoo Kazooie: Gruntilda's Lair
Bubbles
Crazy Drake
Crusader No Regret Xmas Mix
Funky Stars (1996)
Lemmings 3 (Amiga)
Metal Slug X - Mission 2
Lizardkings Theme
Lotus 3 - Spaceninja (Amiga)
Xenon2 Megablast - Menu (Amiga)
Jazz Jackrabbit - Menu
Shipwreckers/Overboard -Level1
Mario64 DS - vocals
Space Debris (1991)
Toy Story Menu/Credits (MOD)
Unreeeal Superhero 3
What is Love - Haddaway (with voice).
Visions
Kwazy Webbit Hole
Bitte ein Bit TITAN
Cyberculosis
Beach - Ape Scape
Satellite One
Uncle John From Jamaica
Alfred Chicken end
Frukt Fats Pop
Project X (Amiga)
Let's Swing it
The Day They Landed
Can-Can
Pentagonal Dreams
Sleep Walker -Tema5 (Dinamic Multimedia)
Titus The Fox -Menu (Amiga)
Re: PVsneslib - SNES JUKEBOX
by on (#130600)
Here are a few I can think of right now:

Nobody - Drift
Olof Gustafsson - Pinball Illusions Intro
Diabolus - Moorhill
Radix - Nemesis
Maktone - Class cracktro tune VI
Rez - r0t0f3ul!
Re: PVsneslib - SNES JUKEBOX
by on (#130601)
I could contribute some .it files. They're already specially made for the SNES, meaning conversion should work perfectly fine.

I also have .it files that when converted, can pull off pitch modulation and noise generation. There are two catches:

- Requires a special version of SNESMod (I have the corresponding binary on hand). This can play normal SNESMod music perfectly fine, just as long as these effects are not called (they are unused in Impulse Tracker files by default based off of the original tracker):
S05-S0C ~ Used for turning on and off pitch modulation and noise.
S1x-S2x ~ Used to set the noise frequency (take away 10h to get your frequency)
S92-S93 ~ Used as a special mute command that doesn't affect pitch modulation output

- Not completely safe for video game use (no SFX detection to turn off pitch modulation and noise in case one plays)
Re: PVsneslib - SNES JUKEBOX
by on (#130608)
KungFuFurby wrote:
I could contribute some .it files. They're already specially made for the SNES, meaning conversion should work perfectly fine.

I also have .it files that when converted, can pull off pitch modulation and noise generation. There are two catches:

- Requires a special version of SNESMod (I have the corresponding binary on hand). This can play normal SNESMod music perfectly fine, just as long as these effects are not called (they are unused in Impulse Tracker files by default based off of the original tracker):
S05-S0C ~ Used for turning on and off pitch modulation and noise.
S1x-S2x ~ Used to set the noise frequency (take away 10h to get your frequency)
S92-S93 ~ Used as a special mute command that doesn't affect pitch modulation output

- Not completely safe for video game use (no SFX detection to turn off pitch modulation and noise in case one plays)


Cool, you could upload them here :).
Tomorrow i'll upload the "first version" of the demo, with test songs.
Re: PVsneslib - SNES JUKEBOX
by on (#130627)
First version :). Changed some songs because i could not fit them inside a 32 k bank and spcload did not load them well.
Re: PVsneslib - SNES JUKEBOX
by on (#130649)
KungFuFurby wrote:
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.


Sorry I did not read your post carefully... It works!!!

I could get "what is love" song with a lot of voices playing in pvsnes :).
Re: PVsneslib - SNES JUKEBOX
by on (#130928)
thats awesome! i just tried it on my gdsf7. what is love playing on a snes made me laugh. jazz the jack rabbit! what a great game. Im going to have to see if i can find a download of it.
Re: PVsneslib - SNES JUKEBOX
by on (#130985)
brunog wrote:
thats awesome! i just tried it on my gdsf7. what is love playing on a snes made me laugh. jazz the jack rabbit! what a great game. Im going to have to see if i can find a download of it.


Whait to hear the new version, I got big songs playing. What is love now plays two big voice samples :).
Re: PVsneslib - SNES JUKEBOX
by on (#131168)
This is a cool little program. Some real ear worms, a lot of which I haven't heard before. Waiting patiently for the new version...

What the devil is going on with the bouncing arrows? Are they using uninitialized memory? Higan v094 accuracy core gives me different colours every time I boot it. Snes9X v1.53 is consistent, though it looks a bit weird, but higan balanced, higan performance, bsnes v072 (all cores), ZSNES v1.51 and no$sns v1.5 all give me black arrows...
Re: PVsneslib - SNES JUKEBOX
by on (#131242)
93143 wrote:
What the devil is going on with the bouncing arrows? Are they using uninitialized memory? Higan v094 accuracy core gives me different colours every time I boot it. Snes9X v1.53 is consistent, though it looks a bit weird, but higan balanced, higan performance, bsnes v072 (all cores), ZSNES v1.51 and no$sns v1.5 all give me black arrows...


I don't know, the palettes are wrong, i can't set them OK, it is my first snes code, so there are things i don't understand.

I upload "2.0" version, all songs included and source, it sometimes shows "libm error" when compiling.

Image

Songs included:

Super Frog (Amiga)
Mortimer's Chipdisko
Aladdin (amiga)
Orgasmic Chipper 2
Tux Racer
BK: Gruntilda's Lair
Bubbles
Crazy Drake
Crusader N regret XS
Funky Stars (1996)
Lemmings 3 (Amiga)
Metal Slug X - M2
Lizardkings Theme
Lotus 3 (amiga)
Xenon2 Megablast (A)
Jazz Jackrabbit
Shipwreckers 1
Mario DS - vocals
Space Debris (1991)
Toy Story (MOD)
Unreeeal Superhero 3
What is Love? - HD
Visions
Kwazy Webbit Hole
Bitte ein Bit TITAN
Cyberculosis
Beach - Ape Scape
Satellite One
Uncle John F Jamaica
Alfred Chicken end
Frukt Fats Pop
Project X (Amiga)
Let's Swing it
The Day They Landed
Can-Can
Pentagonal Dreams
Mozart Piisi
BraveNex
Pinball Dreams
Stop That Elephant!
Angry Birds (Riggs)
AXEL F
POPCORN 80's
Celestial Fantasia
Moorhill
Radix-Nemesis
Sanxion Remix
Outrun Remix
Tubular Vectors
Pollen Resurrection
My Dirty Old Kamel
On Melancholy Hill


I forgot... someone tested this on a real snes with powerpak, and worked perfect.

A "final" version would include:
- sprites with correct color.
- more than one song in a 32 Kb bank (when the songs are small).
- fade or pixelate effect and a credits.
Re: PVsneslib - SNES JUKEBOX
by on (#131247)
That's really great !
Thanks a lot to use PVSneslib and demonstrate such talent to do this jukebox.
Will try to investigate your errors with your source code.
Are you using last version available in googlecode ?
You must know that there is lots of const to remove in dma.c file, because they are useless, can't find time to remove them for a really stable verison of mode 7 :/
Re: PVsneslib - SNES JUKEBOX
by on (#131254)
alekmaul wrote:
That's really great !
Thanks a lot to use PVSneslib and demonstrate such talent to do this jukebox.
Will try to investigate your errors with your source code.
Are you using last version available in googlecode ?
You must know that there is lots of const to remove in dma.c file, because they are useless, can't find time to remove them for a really stable verison of mode 7 :/


Thanks, i'm not an expert, but this code does not need to be very optimized, surelly there will be a lot of useless things on it.

How can i fade in from a black screen at the beginning? i can see first the bkg's and then the screen goes black.. and then it makes the fade in :).
Re: PVsneslib - SNES JUKEBOX
by on (#131268)
Most of these songs I haven't heard of being converted to the SNES before... but three of them were previously utilized.

One of the songs you have, Satellite One, was used in the XMSNES demonstration ROM (so this is just a different sound driver). On a different note, Pollen Resurrection is actually the opening song to Skipp and Friends (and that has an earlier version of SNESMod on it... meaning this song is no different).
Plus, Pinball Dreams was already converted for SNES long ago because the actual game was ported over to the SNES. Thus, you should actually give the game a shot and compare that to the conversion you made. ^_^

Here is my contribution, with Super Quality audio samples! :D (that also means echo is not recommended for this song, as it's quite a large song!)

Wants Rock Badly for SNES Jukebox

Are you interested in a couple of Action 52 songs that I technically ported over to the SNES?
One of them is very familiar... the other not so familiar (that's because I used neither the NES nor Genesis version for this reference).

What is the intended color for the arrows, just out of my curiosity?
Re: PVsneslib - SNES JUKEBOX
by on (#131269)
KungFuFurby wrote:
Are you interested in a couple of Action 52 songs that I technically ported over to the SNES?
One of them is very familiar... the other not so familiar (that's because I used neither the NES nor Genesis version for this reference).

Is any of them "Think (About It)", "Cheetahmen", or "Calypso"?

Quote:
What is the intended color for the arrows, just out of my curiosity?

Red for quarter notes, blue for eighth notes, yellow for sixteenth notes, green for trip-- Oh wait, you didn't mean those arrows.
Re: PVsneslib - SNES JUKEBOX
by on (#131278)
KungFuFurby wrote:
Most of these songs I haven't heard of being converted to the SNES before... but three of them were previously utilized.

One of the songs you have, Satellite One, was used in the XMSNES demonstration ROM (so this is just a different sound driver). On a different note, Pollen Resurrection is actually the opening song to Skipp and Friends (and that has an earlier version of SNESMod on it... meaning this song is no different).
Plus, Pinball Dreams was already converted for SNES long ago because the actual game was ported over to the SNES. Thus, you should actually give the game a shot and compare that to the conversion you made. ^_^

Here is my contribution, with Super Quality audio samples! :D (that also means echo is not recommended for this song, as it's quite a large song!)

Wants Rock Badly for SNES Jukebox

Are you interested in a couple of Action 52 songs that I technically ported over to the SNES?
One of them is very familiar... the other not so familiar (that's because I used neither the NES nor Genesis version for this reference).

What is the intended color for the arrows, just out of my curiosity?


Thanks!.

I didn't like the pinball Dreams port so i took the amiga mod, and it sounds much better.. i think.

The rom is now 2 MB so we could make it 4 MB :) and fit a lot of your songs. Some of "my" songs are small and there could be two in the same rom bank, (i was not able to play them this way...)

Converting the IT, the biggest songs that i could convert are about 110 KB, I don't know if your song would fit without downsampling :)

If you look in the source folder the sprite of the arrows, they should look grey with a white border.

There are lots of awesome tracker songs, but most of them use a lot of channels :(
Re: PVsneslib - SNES JUKEBOX
by on (#131279)
Can I supply a bunch of (small) S3Ms for the collection, or do I have to convert them to SPC myself first?
Re: PVsneslib - SNES JUKEBOX
by on (#131282)
tepples wrote:
Can I supply a bunch of (small) S3Ms for the collection, or do I have to convert them to SPC myself first?


Don't convert them, just leave the files in it's original format.

Anyone knows how to rip gruntilda's laugh from the gruntilda's lair song (banjo kazooie)? I'd love to include that sample in the song for the jukebox.
Re: PVsneslib - SNES JUKEBOX
by on (#131283)
Mills wrote:
Converting the IT, the biggest songs that i could convert are about 110 KB, I don't know if your song would fit without downsampling :)


This is my proof that this works as actual SNES music without downsampling (as in, I used that exact same .it file to make this .spc file):

Wants Rock Badly .spc file

I pre-tested the conversion to .spc format before sending the .it file to you. Filesize of the .it file does not matter in certain cases (especially when downsizing to 8-bit samples has no difference in the final BRR filesize). Instead, I use a different method to determine whether or not the .it file fits...

I get the sum of all of the sample lengths using Schism Tracker, irregardless of 16-bit or 8-bit settings. End loop points represent the end of the sample if turned on (although ping-pong loop points results in additional length because it has to be unrolled), otherwise it is the entire sample.
For best results, loop points should be divisible by 16. Even then, you can end up with slight glitches in the samples, and therefore you have to manually adjust the samples.

A combined length of 100,000 is what I consider to be too much: technically the sample data still fits, but the pattern data will result in an almost guaranteed overflow.

I also use a hex editor to double check the filesize in the .spc file. :wink:

Speaking of which, one of those .it files you attempted to convert (tubular vectors) gave a memory overflow error on the converter... and yet you successfully loaded the song on SNES Jukebox. Actually, I've had this case before myself. There are two glitches, one of them potentially fatal, with this type of overflow:

- The first glitch only appears to occur when outputting .spc files (not soundbanks, and therefore your SNES Jukebox program is spared), but SNESMod, for some unusual reason, clears $FE00-$FF00 in SPC700 RAM, resulting in sample data loss. I know where this is happening (this is done for the echo, even when EDL is zero).
- There's a routine for handling streaming samples called through the TCALL opcode at $FFDE in SPC700 RAM. If this gets overwritten because of a memory overflow, then the sound driver crashes.

tepples wrote:
KungFuFurby wrote:
Are you interested in a couple of Action 52 songs that I technically ported over to the SNES?
One of them is very familiar... the other not so familiar (that's because I used neither the NES nor Genesis version for this reference).

Is any of them "Think (About It)", "Cheetahmen", or "Calypso"?


Actually, both of them are technically the Cheetahmen, except one of them is the NES Action 52 commercial theme (still... the commercial features the Cheetahmen).
Re: PVsneslib - SNES JUKEBOX
by on (#131284)
KungFuFurby wrote:
Mills wrote:
Converting the IT, the biggest songs that i could convert are about 110 KB, I don't know if your song would fit without downsampling :)


This is my proof that this works as actual SNES music without downsampling (as in, I used that exact same .it file to make this .spc file):

Wants Rock Badly .spc file

I pre-tested the conversion to .spc format before sending the .it file to you. Filesize of the .it file does not matter in certain cases (especially when downsizing to 8-bit samples has no difference in the final BRR filesize). Instead, I use a different method to determine whether or not the .it file fits...

I get the sum of all of the sample lengths using Schism Tracker, irregardless of 16-bit or 8-bit settings. End loop points represent the end of the sample if turned on (although ping-pong loop points results in additional length because it has to be unrolled), otherwise it is the entire sample.
For best results, loop points should be divisible by 16. Even then, you can end up with slight glitches in the samples, and therefore you have to manually adjust the samples.

A combined length of 100,000 is what I consider to be too much: technically the sample data still fits, but the pattern data will result in an almost guaranteed overflow.

I also use a hex editor to double check the filesize in the .spc file. :wink:


Hey thanks, thats what i did not understand.. is all about lengh not size :).

How do you keep the volume in the drum sample? in my converted spc's or soundbanks, the volume goes down and long samples fade out...

Unfortunately, many of the composers tend to use long looped "strings" samples, that have to be cut...
Re: PVsneslib - SNES JUKEBOX
by on (#131286)
Simple: the fadeout (found in the instrument area) value is your culprint. SNESMod instantly fades out the samples instead of using the value on note off.

I never touch the fadeout for that reason, actually. Plus, I prefer using actual volume envelopes instead.
Re: PVsneslib - SNES JUKEBOX
by on (#131290)
KungFuFurby wrote:
Simple: the fadeout (found in the instrument area) value is your culprint. SNESMod instantly fades out the samples instead of using the value on note off.

I never touch the fadeout for that reason, actually. Plus, I prefer using actual volume envelopes instead.


Never looked at that part in MPT :) Thanks!

I have to re-convert many of the songs now.
Re: PVsneslib - SNES JUKEBOX
by on (#131477)
A new version with improved songs, now 4MB rom because of some songs using two banks.

Is it possible to print fonts on top of a layer without erasing it?
I want to use mode 7, so the pvsneslib logo and the changing fonts-song names, must be at the same plane.
Re: PVsneslib - SNES JUKEBOX
by on (#131478)
Mills wrote:
Is it possible to print fonts on top of a layer without erasing it?

Use a paint program to mock up a screenshot of what it's supposed to look like and I can explain how you might achieve that effect using the S-PPU.
Re: PVsneslib - SNES JUKEBOX
by on (#131505)
tepples wrote:
Mills wrote:
Is it possible to print fonts on top of a layer without erasing it?

Use a paint program to mock up a screenshot of what it's supposed to look like and I can explain how you might achieve that effect using the S-PPU.


MODE 7 with 2 BKG: Rotating part (bkg1) using very few tiles, and the rest for the flat part (bkg2).

Image
Re: PVsneslib - SNES JUKEBOX
by on (#131516)
It is possible, but not using mode 7. You should simulate it using another mode, combined with scrolling updates, like in the game Axelay.

Alternatively you can simulate the static BG with sprites, in your cases it looks like feasible.
Re: PVsneslib - SNES JUKEBOX
by on (#131517)
I'd go with simulating the second flat background with sprites.
Re: PVsneslib - SNES JUKEBOX
by on (#131519)
Then, How can i use the consoleDrawText function from pvsneslib to write text in sprites?
Re: PVsneslib - SNES JUKEBOX
by on (#131531)
You might have to composite the text into sprite tiles yourself. Years ago, blargg and I wrote a 6502 variable width font (VWF) library that might be useful for something like this. The source code for this library is in vwf_draw.s in RHDE and the Action 53 menu.
Re: PVsneslib - SNES JUKEBOX
by on (#131549)
Mills wrote:
Then, How can i use the consoleDrawText function from pvsneslib to write text in sprites?

You can't.
You need to put your text into a table, according to the tiles of your text and then transfert it to VRAM after a vblank.
Just take a look in pvsneslib in vbl function, you will see how I send text to vram during a vblank (it is in console.c, in consoleVblank function).
Re: PVsneslib - SNES JUKEBOX
by on (#131659)
Maybe I try to use sprites and a mode 7 bkg.

Is it possible to make "perspective" in mode 7 without using any special chip?
I didn't see the option in pvsneslib, i just saw the flat rotating sample with no perspective.

Thanks
Re: PVsneslib - SNES JUKEBOX
by on (#131665)
Mills wrote:
Is it possible to make "perspective" in mode 7 without using any special chip?

F-Zero uses no coprocessor.
Re: PVsneslib - SNES JUKEBOX
by on (#131682)
It's basically down to how much math you need to do on the fly. Pilotwings probably needed a DSP-1 because it had to scale, rotate, and change perspective (X-axis rotation, ie: angling the camera up and down) based on control input, which seems like it would require real-time manipulation of HDMA tables. It also had a lot of green dots to track in 3D space.

F-Zero didn't change the perspective angle at all during a race; only the Z-axis rotation angle (left/right), and when it did change perspective it was in a prescheduled and (I imagine) easily tabulated way. It also had a fairly tiny handful of opponents on screen at the same time. Super Mario Kart didn't change the perspective angle either, but it had two playfields to keep track of and a lot more sprites that had to be handled in 3D...

Pilotwings was also a very early game; it's possible the programmers were too unfamiliar with the system to optimize their code well. But this hypothesis doesn't seem to fit Super Mario Kart. And since you're using C, I'm not sure it really matters anyway...

I'd guess that if your Mode 7 is following a predetermined pattern, even a complex one, you should be able to substantially reduce the amount of math required by tabulating stuff, and you shouldn't need a DSP-1. But I haven't tried any of this personally...
Re: PVsneslib - SNES JUKEBOX
by on (#131696)
I think Pilotwings was developed back when Nintendo thought it was going to include a DSP on the SNES motherboard.
Re: PVsneslib - SNES JUKEBOX
by on (#137305)
I finally made it.
It includes 60 songs to play. Source includes .it music files.

:D
Re: PVsneslib - SNES JUKEBOX
by on (#137445)
Sounds good. Tried it from a SD2SNES.
Wasn't able to crash it.

What is love? (Baby don't hurt me)...
Re: PVsneslib - SNES JUKEBOX
by on (#147404)
I updated the project, now using mode 3, (256 colors + 16 colors).

Image


I want to make a wavy background, is there any function to do this in pvsneslib?

I tried this way, but it is too slow:

Code:
if (BKG_W > 120) BKG_W = 0;
for (v = 0; v < 225; v++) REG_BG2HOFS = BKG_Wave[v+BKG_W] ;
BKG_W++;


Thanks
Re: PVsneslib - SNES JUKEBOX
by on (#147413)
Are you still accepting music submissions? I have a bunch of .it files I edited and converted just to play around with snesmod (mostly Amiga stuff, some others).
Re: PVsneslib - SNES JUKEBOX
by on (#147428)
Revenant wrote:
Are you still accepting music submissions? I have a bunch of .it files I edited and converted just to play around with snesmod (mostly Amiga stuff, some others).


Yes, i'll accept just a few.

The rom is now 4 MB and i don't want to make it bigger, i'll have to erase some of the songs i added (some of them are not playing very well).
Re: PVsneslib - SNES JUKEBOX
by on (#147450)
Hopefully I can make it into volume 2 once I figure out how to make Super NES music.
Re: PVsneslib - SNES JUKEBOX
by on (#147471)
So, anyone knows if the wave background effect can be done in pvsneslib?.
SGDK (megadrive-genesis development kit) includes a function to do that in C, so I thought it could be done on SNES.
Re: PVsneslib - SNES JUKEBOX
by on (#147476)
Maybe I'm confused, but isn't that "set up the correct HDMA table" ?
Re: PVsneslib - SNES JUKEBOX
by on (#147527)
lidnariq wrote:
Maybe I'm confused, but isn't that "set up the correct HDMA table" ?


I didn't know how it was called, I googled a bit and that's what i what. Not in asm, but in c with pvsneslib.
Re: PVsneslib - SNES JUKEBOX
by on (#147529)
I have never done this, but as far as I know, setting up HDMA on the SNES comes down to 1- set up the correct array in memory and then 2- correctly initializing the DMA/HDMA registers 3- starting HDMA during vblank.

Maybe someone else has some example code you could borrow?
Re: PVsneslib - SNES JUKEBOX
by on (#147530)
lidnariq wrote:
I have never done this, but as far as I know, setting up HDMA on the SNES comes down to 1- set up the correct array in memory and then 2- correctly initializing the DMA/HDMA registers 3- starting HDMA during vblank.

Maybe someone else has some example code you could borrow?


I don't know, there are some asm sources, but i'll never unserstand asm :D.

Pvsneslib has a gradient sample, and it is just a c function calling some predefined asm code to change brightness.
Re: PVsneslib - SNES JUKEBOX
by on (#147532)
Well, new release, :), some of the songs will be changed.

I didn't really understand how to load tiles and sprites into vram address, I just tested on emulator until they loaded OK, so it might fail on a real console.
Re: PVsneslib - SNES JUKEBOX
by on (#176648)
Updated at first post :D
Re: PVsneslib - SNES JUKEBOX
by on (#176701)
Mills wrote:
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?

Thanks

It is because PVSnesLib is compiled with options that are different of your options in makefile (for example, SRAM , fast/slow rom, and so on).
Check the makefile shipped with PVSnesLib and your makefile.
Re: PVsneslib - SNES JUKEBOX
by on (#176789)
alekmaul wrote:
Mills wrote:

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


How could I solve that?

Thanks

It is because PVSnesLib is compiled with options that are different of your options in makefile (for example, SRAM , fast/slow rom, and so on).
Check the makefile shipped with PVSnesLib and your makefile.


OK I changed the hdr.asm like the original:

Code:
Mine:
  CARTRIDGETYPE $00             ; $00 = only ROM
  ROMSIZE $08                  ; $0c
  SRAMSIZE $00 
               
Original
  CARTRIDGETYPE $02             ; $02 = ROM+SRAM, see WLA documentation for others
  ROMSIZE $08                   ; $08 = 2 Mbits,  see WLA doc for more..
  SRAMSIZE $01                  ; $01 = 16


It compiles with the original config, but it shows a lot of lines like this:
Code:
OBTAIN ROMBANKS:...
name.obj: 1MEM_INSERT: Overwrite at: ...
.
.
.


And some graphics look corrupted in the game, because the first two banks are being overwrited (they contain the palms bkg and the sprites).
Re: PVsneslib - SNES JUKEBOX
by on (#176790)
I have same things on my projects with no issue on graphics ...
Code:
Cavernsofdeath.obj: 1MEM_INSERT: Overwrite at $7fc0 (old $43 new $4c).
Cavernsofdeath.obj: 1MEM_INSERT: Overwrite at $7fc1 (old $41 new $49).
Cavernsofdeath.obj: 1MEM_INSERT: Overwrite at $7fc2 (old $56 new $42).
Cavernsofdeath.obj: 1MEM_INSERT: Overwrite at $7fc3 (old $45 new $53).

I think your graphics problems is elsewhere.
Re: PVsneslib - SNES JUKEBOX
by on (#176792)
alekmaul wrote:
I have same things on my projects with no issue on graphics ...
Code:
Cavernsofdeath.obj: 1MEM_INSERT: Overwrite at $7fc0 (old $43 new $4c).
Cavernsofdeath.obj: 1MEM_INSERT: Overwrite at $7fc1 (old $41 new $49).
Cavernsofdeath.obj: 1MEM_INSERT: Overwrite at $7fc2 (old $56 new $42).
Cavernsofdeath.obj: 1MEM_INSERT: Overwrite at $7fc3 (old $45 new $53).

I think your graphics problems is elsewhere.


Thanks, I surelly made something wrong with the banks.

:)
Re: PVsneslib - SNES JUKEBOX
by on (#176795)
Those hex values represent CAVE vs. LIBS.
Re: PVsneslib - SNES JUKEBOX
by on (#177015)
Any clue of why "PadsUp(0)" is not working?.

It worked perfect, and now it does nothing...

Thanks.

EDIT: I used it after wait vblank and it worked :)


I still can't figure out how to make a wavy background, there is no doc about hdma functions.
Re: PVsneslib - SNES JUKEBOX
by on (#177037)
hello,
try to use padsCurrent(0);

Will check why padsUp(0); is not working anymore :(

tepples wrote:
Those hex values represent CAVE vs. LIBS.

Sorry, don't understand this :(
Re: PVsneslib - SNES JUKEBOX
by on (#185069)
I'd really love to have a MSU-1 version of that JukeBox, where you can add your own .pcm files. I've already tried to mod it myself, but I'm very unexperienced and thus I've failed (surprise xP). If it wouldn't be too much work, would you mind creating(modding this one and probably decreaseing the song ammount, because 60 .pcm songs would be a little bit big - filezisewise) a MSU-1 JukeBox, or telling how to do so? And if you were to create one/mod this one, could you use "neutral" track names? - like "Track 1", "Track 2",... so that we can/could replace the .pcm files with own, custom .pcm files/tracks. Thanks alot for reading!

- I totally understand if you haven't got any time for that, it's just something I'd be really interested in.