It is currently Sat Nov 18, 2017 8:24 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 23 posts ]  Go to page Previous  1, 2
Author Message
PostPosted: Sat Feb 15, 2014 3:23 am 
Offline

Joined: Fri Feb 14, 2014 11:16 pm
Posts: 30
Location: Linköping, Sweden
I got famitone2 (v1.0) working after some struggling... In the process I found a bug in nesasmc which causes asm6 version of famitone2 to be broken in v1.0 (famitone2_asm6.asm)! Reason is that "HIGH" function is incorrectly converted to "<" on line 131 in nesasmc.cpp. As a fix, change "<" to ">" and reconvert famitone2.asm. (I'm not using asm6 though. I have my own assembler.)

In addition to this, I encountered cryptic error message "Pattern not found" when converting a song with text2data. Reason is, text2data assumes no gaps in patterns, i.e. if max pattern number is 1E, all patterns in range 00..1E must exist. Otherwise you get the error. I got this error because I used FamiTracker "clear unused patterns". As a workaround, I exported song as text and modified the file so that there were be no gaps in patterns (i.e. modified lines starting w/ "ORDER" and "PATTERN"). Then I imported the fixed one back to FamiTracker.

After this I got a problem with wrong instruments played by famitone2 during runtime. Reason was that text2data skipped exporting unused instruments to conserve space, and while doing so, it didn't adjust exported patterns accordingly (i.e. if instrument 1 is unused, song instruments 2,3,4 will incorrectly play instruments 3,4,5 during runtime). As a workaround, I just used the unused instruments somewhere in the song -- pretty stupid, but works :) To find unused instruments in FamiTracker, I used "clear unused instruments". Then I replaced the cleared instruments with dummy ones.

Anyways, good work Shiru! It needs bit polishing, but is really good. Have you considered using Python (or similar) instead of C for the tools? Text file parsing would be at least 10x easier with Python than C...


Top
 Profile  
 
PostPosted: Sat Feb 15, 2014 6:40 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19226
Location: NE Indiana, USA (NTSC)
tsone wrote:
Have you considered using Python (or similar) instead of C for the tools? Text file parsing would be at least 10x easier with Python than C...

But that would make Python a dependency. Under Windows, a user has to explicitly download 15 megs of interpreter and ask the computer's administrator (head of household, school/library IT, etc.) to install it. It's not like GNU/Linux where most distributions install Python from the disc.


Top
 Profile  
 
PostPosted: Tue Feb 25, 2014 3:10 pm 
Offline
Formerly 43110
User avatar

Joined: Wed Feb 05, 2014 7:01 am
Posts: 313
Location: us-east
So today I was getting a infinite loop crash from FamiToneUpdate, so I traced it down to the branch always in env_read_value (line 545)

During the loop FT_TEMP_PTR was pointing to a unused part of the rom. I'm not sure how to diagnose why that happened, but as a result Y ended up being $FF before the increment and fell through to env_special which looped to env_read_value with Y still being set to $FF. I changed the branch to a jmp and the infinite loop was fixed. I then also changed the branch always in set_speed (line 890) to a jmp just in case.


Top
 Profile  
 
PostPosted: Tue Feb 25, 2014 4:00 pm 
Offline
User avatar

Joined: Mon Apr 04, 2011 11:49 am
Posts: 1919
Location: WhereverIparkIt, USA
Might I recommend making note of the existence of famitone2 in the original famitone's thread first post? The first place google led me was the thread of the old version and only realized there was a second version by chance when perusing unread posts.

_________________
If you're gonna play the Game Boy, you gotta learn to play it right. -Kenny Rogers


Top
 Profile  
 
PostPosted: Tue Feb 25, 2014 8:40 pm 
Offline

Joined: Fri Feb 14, 2014 11:16 pm
Posts: 30
Location: Linköping, Sweden
43110 wrote:
So today I was getting a infinite loop crash from FamiToneUpdate, so I traced it down to the branch always in env_read_value (line 545)

During the loop FT_TEMP_PTR was pointing to a unused part of the rom. ...


I got exact same symptoms. First of all, don't use broken ASM6 conversion of famitone2 (v1.0 release). It corrupts the high byte of FT_TEMP_PTR, causing unexpected behavior such as INF loops. If you're not using ASM6 source, then issue is likely caused by text2data. Did you verify all instruments are used in the song (in FamiTracker)?

Why? text2data does not handle correctly songs with unused instruments. If there are unused instruments, invalid pattern data may be generated by text2data, causing famitone2 to play non-existent instruments, which in turn will lead to unexpected behavior such as INF looping. Please check my previous post.


Top
 Profile  
 
PostPosted: Tue Feb 25, 2014 8:50 pm 
Offline

Joined: Fri Feb 14, 2014 11:16 pm
Posts: 30
Location: Linköping, Sweden
I just found out that empty patterns (without notes, effects etc.) are not exported to text by FamiTracker (v0.4.2). This means text2data can give "Pattern not found" error for a valid reason (since pattern truly doesn't exist in the text).

As a workaround, one can add a do-nothing note or effect in the empty pattern (so that the pattern will be exported). Then text2data will find the pattern without error.


Top
 Profile  
 
PostPosted: Tue Feb 25, 2014 9:20 pm 
Offline
Formerly 43110
User avatar

Joined: Wed Feb 05, 2014 7:01 am
Posts: 313
Location: us-east
tsone wrote:
First of all, don't use broken ASM6 conversion of famitone2 (v1.0 release). It corrupts the high byte of FT_TEMP_PTR

tsone wrote:
In the process I found a bug in nesasmc which causes asm6 version of famitone2 to be broken in v1.0 (famitone2_asm6.asm)! Reason is that "HIGH" function is incorrectly converted to "<" on line 131 in nesasmc.cpp.

:oops: That was it. Fortunately there's only one place the HIGH function is used, and it's for the envelope pointer.
Code:
--- famitone2_asm6.asm   2014-02-09 23:43:08.000000000 -0500
+++ famitone2_asm6_fix.asm   2014-02-25 23:06:06.020665072 -0500
@@ -305,7 +305,7 @@
 
    lda #< (_FT2DummyEnvelope)
    sta FT_ENV_ADR_L,x
-   lda #<(_FT2DummyEnvelope)
+   lda #>(_FT2DummyEnvelope)
    sta FT_ENV_ADR_H,x
    lda #0
    sta FT_ENV_REPEAT,x


Top
 Profile  
 
PostPosted: Sat May 10, 2014 9:16 am 
Offline

Joined: Sat Nov 23, 2013 4:23 pm
Posts: 10
Location: Papillion, Nebraska
I'm having a problem with Famitone2. During the game (that I'm working on), the triangle channel in my song is silent. I've even tried putting the song in the demo supplied with Famitone2, and it still makes no difference, but the other song in the demo still plays fine and so does that sound effect that uses the triangle channel. Also, the pitch envelopes in the song aren't working, but like I said the pitch envelopes in the other demo song work.

I also tried including one of the demo songs into my game to see if it would work fine there, and it does. That leads me to believe that it has to be a problem with the music data (for my song), but I don't know what it is.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 23 posts ]  Go to page Previous  1, 2

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