It is currently Fri Dec 15, 2017 6:49 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 12 posts ] 
Author Message
PostPosted: Mon May 30, 2016 10:13 am 
Offline
User avatar

Joined: Sun May 15, 2016 7:20 am
Posts: 17
Location: Cambridge, UK
I've been able to compile my own VegaPlay ROM but there are things about the program which I felt were needed just to make it more interesting than just a collection of NSF files.

I wanted to have the screen be more visually appealing. I've made a custom background and it looks nice but it's still static and I was wanting to make them flash different colours just to make it more lively. I also wasn't a fan of how the track instantly changes as soon as you scroll up or down. I'd rather have it like in FamiCompo or have the currently playing track play while you move the cursor and only stop to change when you press A or something. So a way to pause/play and select new song.

I tried looking at LogoNES to see how flickering colours could work. I've also looked at the files and how they work for the past 2 evenings and I'm really just breaking the program more than anything.

I know that when it says something like "BEQ EndDrawChk" it sends the message to "EndDrawChk" and begins its cycle. However I don't know what the difference between those CEQ, GRA, PEL phrases mean and what they do alongside the $4000 or $45 $c10.

If any of you guys are like pros at this kind of stuff It'd be awesome if you could tell me how to code this out or explain how some areas work so I could do it myself.

Thanks.

_________________
-------------Social Media----------------------------
Twitter: https://twitter.com/thom_hex2a03
Facebook: https://www.facebook.com/hexospherenes/
~~~~~~Music to be found~~~~~~~~~~~~~
Bandcamp: https://hexosphere.bandcamp.com/
Soundcloud: https://soundcloud.com/hexosphere/


Top
 Profile  
 
PostPosted: Mon May 30, 2016 10:57 am 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6534
Location: Seattle
CanYouNot wrote:
I was wanting to make them flash different colours
The NES provides relatively strict requirements on just how much background data you can upload at a time. Without going into that complexity, you should probably limit yourself to:
1- palette updates (including color rotation) and
2- sprites
only.

Quote:
pause
Given the structure of NSFs... you can only pause if you are either willing for
1- the notes to be left on while it's paused, or
2- if you're ok with having any sustained notes not being restarted when you unpause, or
3- Some notes incorrectly being on when you unpause


Also, because of the structure of NSFs, you may be limited on memory available for your not-music. I don't actually remember how much memory Famitracker's driver uses, though.

Did you see this older thread? It's only a little polish, but it is a little.


Top
 Profile  
 
PostPosted: Mon May 30, 2016 11:18 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19348
Location: NE Indiana, USA (NTSC)
lidnariq wrote:
CanYouNot wrote:
pause

Given the structure of NSFs... you can only pause if you are either willing for
1- the notes to be left on while it's paused, or
2- if you're ok with having any sustained notes not being restarted when you unpause, or
3- Some notes incorrectly being on when you unpause

Or 4- Figuring out how to convince a particular music engine to restart the note correctly when you unpause. For example, if you silence the channels by writing $00 to all envelope registers ($4000, $4004, $4008, and $400C) and leaving $4015 alone, and then you scribble $FF over the RAM locations where an engine stores "previous period high byte" values that it uses for avoiding phase resets, it may restart the note.

(suppresses urge to make a "polish" pun)


Top
 Profile  
 
PostPosted: Mon May 30, 2016 11:46 am 
Offline
User avatar

Joined: Sun May 15, 2016 7:20 am
Posts: 17
Location: Cambridge, UK
Quote:
Given the structure of NSFs... you can only pause if you are either willing for
1- the notes to be left on while it's paused, or
2- if you're ok with having any sustained notes not being restarted when you unpause, or
3- Some notes incorrectly being on when you unpause


Also, because of the structure of NSFs, you may be limited on memory available for your not-music. I don't actually remember how much memory Famitracker's driver uses, though.


If we can't pause the audio, then there's surely a way to stop the audio when say you press START and when you press it again it plays whatever track is highlighted from the beginning?
What would go after these commands?
Code:
CheckStart:
   LDA #%00001000
   AND JustPressed
   BEQ CheckDown
   

Because I think those first 3 lines are for when the ROM begins and it checks through all the buttons?

I'm also looking at it's colour flicker function and trying to see how I could implement it into VegaPlay.

_________________
-------------Social Media----------------------------
Twitter: https://twitter.com/thom_hex2a03
Facebook: https://www.facebook.com/hexospherenes/
~~~~~~Music to be found~~~~~~~~~~~~~
Bandcamp: https://hexosphere.bandcamp.com/
Soundcloud: https://soundcloud.com/hexosphere/


Top
 Profile  
 
PostPosted: Mon May 30, 2016 11:52 am 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5898
Location: Canada
For pausing a playing NSF, I'd recommend writing $00 to $4015 to silence all channels, and then when resuming write $0F to it to re-enable them before continuing. (Edit: Oh, sorry, just noticed Tepples arleady suggested this above. Futher commentary below though.)

This is not a perfect method: any playing DPCM sample will not survive the pause, and some NSF engines might have not resume their sound until the next note, or may even have problems with writing to $4015 silencing a channel permanently, but in my experience most of them do pretty well with this technique.


Top
 Profile  
 
PostPosted: Mon May 30, 2016 11:59 am 
Offline
User avatar

Joined: Sun May 15, 2016 7:20 am
Posts: 17
Location: Cambridge, UK
rainwarrior wrote:
For pausing a playing NSF, I'd recommend writing $00 to $4015 to silence all channels, and then when resuming write $0F to it to re-enable them before continuing. (Edit: Oh, sorry, just noticed Tepples arleady suggested this above. Futher commentary below though.)

This is not a perfect method: any playing DPCM sample will not survive the pause, and some NSF engines might have not resume their sound until the next note, or may even have problems with writing to $4015 silencing a channel permanently, but in my experience most of them do pretty well with this technique.


yeah alright then.

I don't think I'll have it be a pause function then, it seems like it sort of ruins it a bit. I think I'll resort to a Stop/Play function somehow and the colour flicker thing.
Is the code for stopping/playing simple though?

_________________
-------------Social Media----------------------------
Twitter: https://twitter.com/thom_hex2a03
Facebook: https://www.facebook.com/hexospherenes/
~~~~~~Music to be found~~~~~~~~~~~~~
Bandcamp: https://hexosphere.bandcamp.com/
Soundcloud: https://soundcloud.com/hexosphere/


Top
 Profile  
 
PostPosted: Mon May 30, 2016 12:06 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5898
Location: Canada
Stopping is the same as pausing, really. Write $00 to $4015 to silence, and stop executing PLAY every frame.

Restarting means to run the NSF INIT function again before you resume executing PLAY once per frame. (You also need to zero out the RAM areas it uses before calling INIT, and initialize some other things, information here. VegaPlay should already have a function that does all this before it calls the NSF's INIT though, so just re-use that.)


I don't think it "ruins" the track to use the pause/resume method I suggested, though. In the vast majority of cases it sounds quite natural. I called it imperfect simply because it's not entirely foolproof.

In the music compilation ROMs I've made, it was sufficient for almost all tracks I've encountered. For the one or two oddball tracks that didn't unpause cleanly I just added some special code for that track. Depends on the engine, though, and I don't believe any of the problem tracks were using contemporary versions of Famitracker, which is what you're using, right?


Top
 Profile  
 
PostPosted: Mon May 30, 2016 12:42 pm 
Offline
User avatar

Joined: Sun May 15, 2016 7:20 am
Posts: 17
Location: Cambridge, UK
When I think I've gotten it to work, it says that the line '.ORG $fffa' is a value out of range.
Does this mean the file is too big? I've tested the compiler by using a NSF with only 2 tracks and it still says it.
Unless there's a limit to how big the .asm can be.

So why is it saying ORG fffa is a value out of range?

Code:
;       ----------------------------------------------------

   .ORG $fffa              ; vectors
   .DW NMI
   .DW Reset
   .DW IRQ


Sorry if this is real obvious and I'm just doing everything wrong guys. I'm not good at programming but I'm trying to understand this.

_________________
-------------Social Media----------------------------
Twitter: https://twitter.com/thom_hex2a03
Facebook: https://www.facebook.com/hexospherenes/
~~~~~~Music to be found~~~~~~~~~~~~~
Bandcamp: https://hexosphere.bandcamp.com/
Soundcloud: https://soundcloud.com/hexosphere/


Top
 Profile  
 
PostPosted: Mon May 30, 2016 12:52 pm 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6534
Location: Seattle
That error means you've put too much code to fit in the remaining 1.5 KiB that the first .org statement at the top of the file left for you.

I tentatively think you could get away with just removing the .org $fa00, and then you'll have the same 32762-byte pool for the entire including NSF and your graphical updates, not a fixed division.


Top
 Profile  
 
PostPosted: Mon May 30, 2016 1:02 pm 
Offline
User avatar

Joined: Sun May 15, 2016 7:20 am
Posts: 17
Location: Cambridge, UK
lidnariq wrote:
That error means you've put too much code to fit in the remaining 1.5 KiB that the first .org statement at the top of the file left for you.

I tentatively think you could get away with just removing the .org $fa00, and then you'll have the same 32762-byte pool for the entire including NSF and your graphical updates, not a fixed division.

I removed the .org $fa00 and it compiled, however the ROM crashes when I attempt to run it.

I'll just include the .asm so you can see where the problem may lie, which I feel like would be more than I think.


Attachments:
vegaplay.asm [11.43 KiB]
Downloaded 39 times

_________________
-------------Social Media----------------------------
Twitter: https://twitter.com/thom_hex2a03
Facebook: https://www.facebook.com/hexospherenes/
~~~~~~Music to be found~~~~~~~~~~~~~
Bandcamp: https://hexosphere.bandcamp.com/
Soundcloud: https://soundcloud.com/hexosphere/
Top
 Profile  
 
PostPosted: Mon May 30, 2016 1:15 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5898
Location: Canada
You removed the .org $fffa, not the .org $fa00. The former is critical for placing the vectors.


Top
 Profile  
 
PostPosted: Mon May 30, 2016 1:49 pm 
Offline
User avatar

Joined: Sun May 15, 2016 7:20 am
Posts: 17
Location: Cambridge, UK
Okay I just looked over the asm file and I've gotten ridden of uneeded strings and all that.
I've fixed some errors I've found.

It compiles which is good and the select button is able to do the colour flicker thing.
The music plays too! However the screen isn't aligned right. The colours align with the music!? that's so cool!
However the image not being in the right place kind of annoys me but I also kind of like it. Just because of the glitchy look,

But I can't change song. Probably a mistake in the coding the up down buttons.

I'll share the .asm


Attachments:
VegaPlay.asm [11.01 KiB]
Downloaded 40 times

_________________
-------------Social Media----------------------------
Twitter: https://twitter.com/thom_hex2a03
Facebook: https://www.facebook.com/hexospherenes/
~~~~~~Music to be found~~~~~~~~~~~~~
Bandcamp: https://hexosphere.bandcamp.com/
Soundcloud: https://soundcloud.com/hexosphere/
Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 4 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