PVsneslib - SNES JUKEBOX

Discussion of hardware and software development for Super NES and Super Famicom. See the SNESdev wiki for more information.

Moderator: Moderators

Forum rules
  • For making cartridges of your Super NES games, see Reproduction.
Mills
Posts: 43
Joined: Tue Jul 01, 2014 3:30 am

Re: PVsneslib - SNES JUKEBOX

Post by Mills »

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
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: PVsneslib - SNES JUKEBOX

Post by tepples »

Mills wrote:Is it possible to make "perspective" in mode 7 without using any special chip?
F-Zero uses no coprocessor.
93143
Posts: 1717
Joined: Fri Jul 04, 2014 9:31 pm

Re: PVsneslib - SNES JUKEBOX

Post by 93143 »

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...
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: PVsneslib - SNES JUKEBOX

Post by tepples »

I think Pilotwings was developed back when Nintendo thought it was going to include a DSP on the SNES motherboard.
Mills
Posts: 43
Joined: Tue Jul 01, 2014 3:30 am

Re: PVsneslib - SNES JUKEBOX

Post by Mills »

I finally made it.
It includes 60 songs to play. Source includes .it music files.

:D
Attachments
JUKEBOX.rar
(1.35 MiB) Downloaded 292 times
SOURCE.rar
(3.96 MiB) Downloaded 296 times
User avatar
whicker
Posts: 228
Joined: Sun Dec 13, 2009 11:37 am
Location: Wisconsin

Re: PVsneslib - SNES JUKEBOX

Post by whicker »

Sounds good. Tried it from a SD2SNES.
Wasn't able to crash it.

What is love? (Baby don't hurt me)...
Mills
Posts: 43
Joined: Tue Jul 01, 2014 3:30 am

Re: PVsneslib - SNES JUKEBOX

Post by Mills »

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: Select all

if (BKG_W > 120) BKG_W = 0;
for (v = 0; v < 225; v++) REG_BG2HOFS = BKG_Wave[v+BKG_W] ;
BKG_W++; 
Thanks
Revenant
Posts: 462
Joined: Sat Apr 25, 2015 1:47 pm
Location: FL

Re: PVsneslib - SNES JUKEBOX

Post by Revenant »

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).
Mills
Posts: 43
Joined: Tue Jul 01, 2014 3:30 am

Re: PVsneslib - SNES JUKEBOX

Post by Mills »

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).
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: PVsneslib - SNES JUKEBOX

Post by tepples »

Hopefully I can make it into volume 2 once I figure out how to make Super NES music.
Mills
Posts: 43
Joined: Tue Jul 01, 2014 3:30 am

Re: PVsneslib - SNES JUKEBOX

Post by Mills »

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.
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: PVsneslib - SNES JUKEBOX

Post by lidnariq »

Maybe I'm confused, but isn't that "set up the correct HDMA table" ?
Mills
Posts: 43
Joined: Tue Jul 01, 2014 3:30 am

Re: PVsneslib - SNES JUKEBOX

Post by Mills »

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.
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: PVsneslib - SNES JUKEBOX

Post by lidnariq »

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?
Mills
Posts: 43
Joined: Tue Jul 01, 2014 3:30 am

Re: PVsneslib - SNES JUKEBOX

Post by Mills »

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.
Post Reply