8x16 and whatever else unreg wants to know

Are you new to 6502, NES, or even programming in general? Post any of your questions here. Remember - the only dumb question is the question that remains unasked.

Moderator: Moderators

unregistered
Posts: 1318
Joined: Thu Apr 23, 2009 11:21 pm
Location: cypress, texas

Re: 8x16 and whatever else unreg wants to know

Post by unregistered »

Kasumi wrote:
3.) The song's tempo is a bit faster than it was in FamiTracker. Is that normal? Or must something be fixed in my code? Could just lower the tempo in FamiTracker, I guess, but don't know if that would be the best solution.

Tempos differing slightly will be par for the course. One of the better things you can do is leave tempo at 150 and only change speed for future songs. You can read some of the why of this here: http://famitracker.com/forum/posts.php? ... &pid=15140 but only speed changes doesn't really cover the whole range of things you might want to do. There are some things where you'll just have to deal with it.

Edit: Well, wait, reading your previous post it seems like you're totally using tempo 150 and speed 6. So... ignore the above, I guess?
At the top the tempo is 150 and the speed is 6, but after adding F07 to the fx1 column at the top of Pulse 1, the song sounds just fine now!! :mrgreen: :D Guess my FamiTone2 speeds the song up by 1 for some reason. (what I learned (for others): FamiTracker uses an inversed speed setting... raising the speed setting to 7 actually slows the song. And "speeds the song up by 1" means the speed setting must have been set to 5 tempo must be increased by my FamiTone2. :))

edit: maybe the speedup is a result of using 65 rows?

edit2: Well, maybe not; because 65 rows just makes each frame a 16th note longer and the length of the song has nothing to do with how fast it is played; at least that's what occured to me after reading and rereading the page you linked to, Kasumi. Thank you so much for that link!! :D

final edit.

edited again: strikeout and italics; it makes more sense, now, I think. :)
Last edited by unregistered on Fri Feb 16, 2018 10:49 am, edited 1 time in total.
unregistered
Posts: 1318
Joined: Thu Apr 23, 2009 11:21 pm
Location: cypress, texas

Re: 8x16 and whatever else unreg wants to know

Post by unregistered »

unregistered wrote:
Kasumi wrote:There is likely no existing and automatic way to do any of that. :(
Maybe the external harddisk could be repaired... I think there was a power outage and afterwards it stopped working. My computer was plugged into a powerstrip so maybe all the 1s and 0s are still there. Going to try getting that done; that feels like the right thing to do. Well, thanks again Kasumi for all of your much appreciated help!! :D

edit.
I've been so blessed!! :mrgreen: :) The harddrive started working after the repair shop guy plugged it in! Have the old famitone files now too and after following your instruction Kasumi, now there's a FamiTone2 asm file holding both songs! :D And that D00 you suggested works wonderfully! Thank you so much Kasumi! :D

Both modules need to start with F07 for them to play at a FamiTracker-normal speed. : )
unregistered
Posts: 1318
Joined: Thu Apr 23, 2009 11:21 pm
Location: cypress, texas

Re: 8x16 and whatever else unreg wants to know

Post by unregistered »

The section at the top of my FamiTracker's .txt music file lists 14 MACRO lines, but there are only 7 instruments. Are all of those lines needed? I see that some of them list the volume settings that some of the instruments use and two others list the arpeggios of two of the instruments, but there is:
a MACRO line at the bottom wrote:

Code: Select all

MACRO       4   3   -1   -1   0 : 1
That 1, after the colon, must be for Duty 1, but I removed all of the Duty 1s from the song. Does FamiTracker not remove things like that even after a user has removed them? If so, is there a way to clear and rebuild its MACRO memory? :)
tepples
Posts: 22705
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: 8x16 and whatever else unreg wants to know

Post by tepples »

You are correct in guessing that the duty, arpeggio, and volume of an instrument count as separate envelopes. The general form of an envelope is as follows, where the asterisk represents an element repeated 0 or more times:

Code: Select all

MACRO type index looppoint releasepoint arpstyle : value value*
The type parameter means the following:
  • MACRO 0 is volume
  • MACRO 1 is arpeggio, where arpstyle is 0 for absolute, 1 for fixed, or 2 for relative
  • MACRO 2 is pitch
  • MACRO 3 is hi-pitch (rarely used)
  • MACRO 4 is duty[1]
Thus MACRO 4 3 -1 -1 0 : 1 means "Duty envelope 3, no loop point, no release point, value 1".

Try "Edit > Cleanup > Remove unused instruments" before exporting the text file. Does that remove envelopes not used by any instrument as well? If not, let me know, and I'll post it on the issue tracker section of FamiTracker forums and HertzDevil forums.


[1] In an FTM authored for FamiTone2, each duty envelope will have only one value. FamiTone reads only the first value from each duty envelope, whereas Pently reads as many steps of duty as there are steps in the volume envelope.
unregistered
Posts: 1318
Joined: Thu Apr 23, 2009 11:21 pm
Location: cypress, texas

Re: 8x16 and whatever else unreg wants to know

Post by unregistered »

^Thanks so much tepples! :D

I think you gave me the same response before; sorry I forgot about the "Edit>Cleanup>Remove unused instruments". Spent a while learning, by trial and error, how to manually remove all the extra envelopes, in FamiTracker, and now my file is down to having only 7 MACROS! :) FamiTracker should have a "Edit>Cleanup>Remove unused sequences"... because the only way to remove that MACRO 4 line was to double-click on instrument 00, click on "Duty / Noise", increase the "Sequence #" box until the "Sequence editor" value box read 1, delete that value, press enter, decrease the "Sequence #" box back down to where it started, and uncheck the "Duty / Noise" box (because instrument 00 doesn't use Duty).

After going back and adding that unused Duty1 envelope, "Remove unused instruments" did not remove it.

KIND NOTE:
tepples wrote:MACRO 4 is duty[1]
That "[1]" refers to the note at the bottom of his post, not duty1. :)
tepples
Posts: 22705
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: 8x16 and whatever else unreg wants to know

Post by tepples »

I figured out why "Remove unused instruments" isn't working and reported the bug on famitracker.com.

What's happening is that if a used instrument refers to a particular sequence number, FamiTracker doesn't consider whether it's checked or unchecked before determining whether or not to remove the sequence. So a workaround is to change all unchecked sequences to use either a used Sequence # or a nonexistent one before removing unused instruments.
unregistered
Posts: 1318
Joined: Thu Apr 23, 2009 11:21 pm
Location: cypress, texas

Re: 8x16 and whatever else unreg wants to know

Post by unregistered »

Ah-ha tepples, you figured out my actions when I quickly went back and created that unused Duty1 sequence! :shock: Good bug report; thank you so much! :D

Sorry, it was a mistake :( for me to write:
unregistered wrote:... because the only way to remove that MACRO 4 line was to
You solved the problem that I didn't understand or even recognize. :beer:

edit: Added the mug smiley because I feel tepples should be toasted; honestly, I have never consumed and will never consume beer. : )
unregistered
Posts: 1318
Joined: Thu Apr 23, 2009 11:21 pm
Location: cypress, texas

Re: 8x16 and whatever else unreg wants to know

Post by unregistered »

After rereading the the wiki's "MMC1 technical reference":
  • MMC1 always has an 8kb PRG-RAM bank at $6000-$7FFF
  • This bank is switchable in only SOROM and SXROM.
  • When using SOROM or SXROM, you actually have 32kbs of PRG-RAM in banks 0 through 3.
That's true right? :)

1.) I don't know how to switch the PRG-RAM banks. :oops: How does one accomplish that? Thought it would be cool if you could use bit4 to switch between setting bank of PRG-ROM or PRG-RAM, but it is used for something else:
[color=#8040FF]nesdev wiki's MMC1 technical reference[/color] wrote:PRG bank (internal, $E000-$FFFF)

Code: Select all

 4bit0
 -----
 RPPPP
 |||||
 |++++- Select 16 KB PRG ROM bank (low bit ignored in 32 KB mode)
 +----- PRG RAM chip enable (0: enabled; 1: disabled; ignored on MMC1A)
2.) How would you set a game to use SOROM or SXROM?

Those are two questions that seem unsolvable to just me. Right now, 8kb of PRG-RAM seems like a continent of space to me; but, I think, having access to 4 continents wouldn't be a hindrance. :)
lidnariq
Posts: 11429
Joined: Sun Apr 13, 2008 11:12 am

Re: 8x16 and whatever else unreg wants to know

Post by lidnariq »

Keep on reading down through the page:
nesdevwiki:MMC1 § SOROM, SUROM, and SXROM
unregistered
Posts: 1318
Joined: Thu Apr 23, 2009 11:21 pm
Location: cypress, texas

Re: 8x16 and whatever else unreg wants to know

Post by unregistered »

lidnariq wrote:Keep on reading down through the page:
nesdevwiki:MMC1 § SOROM, SUROM, and SXROM
Thank you very much lidnariq! :D In the "Heuristic disambiguation" part it says I can't use 32 KiB of PRG-RAM because our game uses the "large" CHR-ROM (128 KiB) and that makes sense. It is important to read everything carefully and that's what I understand now. Hopefully I'll be blessed with learning that.

Would it be possible to load all 128 KiB of CHR-ROM into PRG-ROM and then, after switching to use "small" CHR-RAM, just copy it into the 8 KiB CHR-RAM when needed? But, then I'd need 128 KiB of PRG-ROM. That would take 4 PRG-ROM banks, I think, and so that's not possible for our game. : )

Will use the default 8 KiB continent of PRG-RAM. :)
tepples
Posts: 22705
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: 8x16 and whatever else unreg wants to know

Post by tepples »

unregistered wrote:Would it be possible to load all 128 KiB of CHR-ROM into PRG-ROM and then, after switching to use "small" CHR-RAM, just copy it into the 8 KiB CHR-RAM when needed?
Yes. You could watch Battletoads (AOROM) or the Haunted: Halloween '85 demo (BNROM) stream stuff into CHR RAM during gameplay, or watch the Action 53 menu, RHDE: Furniture Fight, or my port of the 240p Test Suite stream software-composited text in a proportional font into CHR RAM whenever a menu or help screen is open.
unregistered wrote:But, then I'd need 128 KiB of PRG-ROM. That would take 4 PRG-ROM banks, I think, and so that's not possible for our game. : )
Switching from SKROM (128-256 KiB PRG ROM, 128 KiB CHR ROM, 8 KiB WRAM) to SUROM (512 KiB PRG ROM, 8 KiB CHR RAM, 8 KiB WRAM) already buys you an extra 256 KiB of PRG ROM. Or are you already using 512 KiB on another mapper (like UNROM 512 or oversize BNROM)?
unregistered
Posts: 1318
Joined: Thu Apr 23, 2009 11:21 pm
Location: cypress, texas

Re: 8x16 and whatever else unreg wants to know

Post by unregistered »

Wow!! :mrgreen: :D Switching to SUROM would give us 32 16KiB banks? We must be using SKROM with 256 KiB PRG-ROM.
unregistered
Posts: 1318
Joined: Thu Apr 23, 2009 11:21 pm
Location: cypress, texas

Re: 8x16 and whatever else unreg wants to know

Post by unregistered »

Now the P bit on the SOROM, SUROM, SXROM "CHR bank 0" and "CHR bank 1" makes sense. That allows 16 16KiB banks when that bit is 0 and 16 new 16KiB banks when it is 1. But, I have to set both of those CHR banks each time I want to change that P bit or change the SXROM PRG-RAM banks. This so great to understand all of this! :mrgreen: :D Thank you very much tepples and lidnariq! :D

edit: We aren't restricted to 128KiB of space for CHR anymore! So good! :D I bet the creators, including you tepples, of Battletoads and the other games you suggested me to look at were joyful to learn about this too. :)


final edit: ...I don't mean to imply that our game will reach the same league as any of the games tepples mentioned; am just so happy and thought those people must have felt the same happiness. : )
unregistered
Posts: 1318
Joined: Thu Apr 23, 2009 11:21 pm
Location: cypress, texas

Re: 8x16 and whatever else unreg wants to know

Post by unregistered »

After rereading the
link, I noticed that if we use 8KiB CHR bank switching then: we just have to set "CHR bank 0"; "CHR bank 1" is ignored! :mrgreen: :D

Also want to thank Banshaku for his helpful SXROM research, in November 2008, nearly 10 years ago. :)
unregistered
Posts: 1318
Joined: Thu Apr 23, 2009 11:21 pm
Location: cypress, texas

Re: 8x16 and whatever else unreg wants to know

Post by unregistered »

On Programming_MMC1 it has a section that says the "MMC1 1C" might not power on in fixed-$C000 mode so I should add the reset_stub in the last 16 bytes of each bank. I would like to place 16KiB of CHR files in one bank; the bank is 16KiB so there wouldn't be room for the reset_stub. Before our game starts (is playable), it sets MMC1 into fixed-$C000 mode. So that would nullify the reset_stub's usefulness in each PRG bank, I think; but, that's just me thinking... am I right? :)
Post Reply