|
Post by gredler on Jul 8, 2018 7:20:47 GMT
Mod edit: I moved this stuff over from Elmer’s programming links thread. From Elmer’s original post when creating this thread: “Please post questions and/or bug reports here.“
Does version 3.99 support squirrel mml music? I haven't heard back from DK about a fresh Catastrophy build using this latest version, but I think we may want to put some at least placeholder bleepybloopies in our test builds and wondered if the legacy sound support was still accessible in it. Thanks again for all the help and support!
|
|
|
Post by alekmaul on Jul 27, 2018 7:54:05 GMT
Hi elmer, As I can't create tickets on your github, I 'm posting here about a bug I found in your version regarding version 3.21 of huc. We can't anymore doing const declaration with HIGH/LOW/BANK in C, it is no more available. It was available in old HUC version. Regards
Exemple :
const char son_epee[]= {
LOW( pcm_epee + 20 ),
HIGH( pcm_epee + 20 ),
BANK( pcm_epee ),
0xDF
};
|
|
|
Post by elmer on Jul 28, 2018 16:12:01 GMT
Sorry if I misunderstood something but in which version squirrel is available. I can only see the st tracker in last version but I think we can't play sfx with more than 32 bytes with it. If you posted it in pcenginefx forum, I can't access because I'm not registered. Did you search here on this forum? It comes up on the first page of search results. It's the demo version from their website, fixed to compile on both the old and new versions of HuC. I believe that you'll need to contact Aetherbyte if you want the full version of their closed-source converter that supports sound effects. Aetherbyte do not wish to support folks using squirrel with the new HuC ... and if they don't care about the new HuC, then I'm not inclined to support Squirrel much beyond what I've already done to make the playback code work with both the old and new versions of HuC.
|
|
|
Post by elmer on Jul 28, 2018 17:37:19 GMT
We can't anymore doing const declaration with HIGH/LOW/BANK in C, it is no more available. It was available in old HUC version. Now this has been a very interesting rabbit hole to go down! I've looked at both the old and new versions of HuC, and neither of them actually supports HIGH(), LOW() or BANK() as builtin operators for HuC. For example, you cannot do ... main () { char a; a = BANK(pcm_epee + 20); return; } ... in either version of HuC. The HIGH(), LOW() and BANK() operators are actually assembly-language operators, and part of PCEAS, not the HuC variant of SmallC. The only reason that your example code actually works in the old HuC ... const char son_epee[]= { BANK( pcm_epee ) }; ... is that the old HuC just echoes everything on the line directly out into the assembly-language file. As far as I can see, you just got lucky that what you wrote worked in the way that you wanted it to in the old HuC. If you put a completely bogus function in there, such as ... const char son_epee[]= { UNIDENTIFIED( pcm_epee ) }; ... then the old HuC will just parrot that out into the assembly-language file, and PCEAS will flag the missing function "UNIDENTIFIED". That's not really how a C compiler should operate. If the function doesn't exist in C, then the C compiler should complain about it. That's what you are seeing the new version of HuC complain about. It's a part of the changes in the new HuC so that it can support macros with parameters ... which look just like function calls. For instance, this code doesn't work in the old HuC, but works perfectly in the new HuC ... #define BAT(pal, addr) (addr | (pal << 12))
const int map[]= { BAT(1, 0x1000) }; Honestly, from my POV, the "bug" was in the way that the old v3.21 HuC handled things, and not in the way that the new HuC handles things, even though you might find the old operation convenient. If you want to use assembly-language operators, such as HIGH(), LOW() and BANK() in HuC, in a supported way that works with both the old and new versions of the language, then you can do so in an #asm section, something like this ... #incbin(pcm_epee,"sample_file.bin")
extern char * son_epee;
main () { char * pData; pData = son_epee; return; }
#asm .bank CONST_BANK _son_epee: .db LOW( _pcm_epee + 20 ) .db HIGH( _pcm_epee + 20 ) .db BANK( _pcm_epee ) .db $DF .code #endasm
|
|
|
Post by gredler on Jul 28, 2018 22:56:29 GMT
Are there plans to implement anything other than simple tracker at some point?Sorry if you've already answered this,I might have missed that info. Deflemask fantasies huzak dreams
|
|
|
Post by Galahad on Jul 28, 2018 23:33:57 GMT
Problem when using put_tile,every 3rd tile will not show(it will display blank) can anyone confirm this.So tiles 0,1,2 will display fine and tile 3 will display blank,tile 4,5,6 will display and tile 7 will display blank ect...The tiles show in vram so I know that they have loaded correctly.
const char Stage1Tiles[] = { 3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4, 4,5,5,5,5,5,5,4,4,4,4,5,5,5,5,4, 4,5,5,5,5,5,5,5,4,4,5,5,5,5,5,4, 4,5,5,5,5,5,5,5,4,4,5,5,4,5,5,4, 4,5,5,5,4,4,4,4,4,5,5,5,4,5,5,4, 4,5,5,5,4,4,4,4,5,5,5,4,4,5,5,4, 4,5,5,5,5,5,5,5,5,5,5,4,4,5,5,4, 4,5,5,5,5,5,5,5,5,5,5,4,4,5,5,4, 4,5,5,5,4,5,5,5,5,5,4,4,4,5,5,4, 4,5,5,5,5,4,4,5,5,5,4,4,4,5,5,4, 4,5,5,5,5,4,4,5,5,4,4,4,4,5,5,4, 4,5,5,5,5,4,4,7,5,7,4,7,4,7,5,4, 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, 10,8,8,8,8,8,8,8,8,8,8,8,8,8,8,9 };
for (Row = 0; Row < 14; Row++) { for (Column = 0; Column < 16; Column++) { TileNum = *MapDataPointer; put_tile(TileNum,Column,Row); MapDataPointer++; } }
|
|
|
Post by elmer on Jul 29, 2018 0:28:45 GMT
Do we really want to keep on littering this "Programming Resource Links" thread with HuC bug reports and questions?
If we want a generalized new-version-of-HuC support and questions thread, then perhaps we should create one by name (and sticky it, if needed)!
P.S. ...
If anyone wants help with something, it is best to post a complete example (with all the files), so that advice can be given, problems can be quickly found, and speedily fixed.
P.P.S. ...
If you don't want to post files publicly, then consider sending them to me privately.
|
|
|
Post by alekmaul on Jul 29, 2018 5:26:20 GMT
Honestly, from my POV, the "bug" was in the way that the old v3.21 HuC handled things, and not in the way that the new HuC handles things, even though you might find the old operation convenient. If you want to use assembly-language operators, such as HIGH(), LOW() and BANK() in HuC, in a supported way that works with both the old and new versions of the language, then you can do so in an #asm section, something like this ... #incbin(pcm_epee,"sample_file.bin")
extern char * son_epee;
main () { char * pData; pData = son_epee; return; }
#asm .bank CONST_BANK _son_epee: .db LOW( _pcm_epee + 20 ) .db HIGH( _pcm_epee + 20 ) .db BANK( _pcm_epee ) .db $DF .code #endasm
thanks a lot for your reply elmer, that's really strange that no one found this problem in old verison. I will use an asm version to address my data, that's good Also, sorry about squirrel, I used the search button on Homebrew section and found nothing, it was good now with the one on top of forum, I found the zip file
|
|
|
Post by elmer on Jul 30, 2018 1:12:49 GMT
Problem when using put_tile,every 3rd tile will not show(it will display blank) can anyone confirm this.So tiles 0,1,2 will display fine and tile 3 will display blank,tile 4,5,6 will display and tile 7 will display blank ect...The tiles show in vram so I know that they have loaded correctly. Yes, there's a long-standing bug in there (back to at-least the old v3.21 version). The problem is that put_tile() doesn't use the tile-palette color lookup table properly. It doesn't set up the bank and so, in the new HuC, it ends up reading garbage data from the VDC, which then screws up the output. In the old HuC, the problem was masked, and it usually ended up reading from RAM or the CONST_BANK which, more often than not, made it seem to work properly. Anyway ... it's fixed now, and the fix is checked-in to github. Since nobody else is reporting this problem, I won't rush a new release of HuC just for this issue.
|
|
|
Post by theoldman on Jul 30, 2018 5:33:50 GMT
"The problem is that put_tile() doesn't use the tile-palette color lookup table properly. It doesn't set up the bank and so, in the new HuC, it ends up reading garbage data from the VDC, which then screws up the output. In the old HuC, the problem was masked, and it usually ended up reading from RAM or the CONST_BANK which, more often than not, made it seem to work properly."
Can you explain this please?
Why would put_tile() READ the VDC (I assume you mean vram via the read-data register) ?
If it's not reading VRam (and there's no reason it should), then yes, it would read either the RAM bank or the CONST_BANK. There's no where else for the tables to be.
And yes, create a question area for this stuff. And post your code so everyone can see what is going on. You don't have to post it all, just enough so the problem can be reproduced.
|
|
|
Post by elmer on Jul 30, 2018 18:57:32 GMT
Can you explain this please? Why would put_tile() READ the VDC (I assume you mean vram via the read-data register) ? FYI, some things are easiest to see if you just browse the commit history on github. In both the old and new versions of HuC, the pointer to the tile-palette color lookup table is declared as a far-pointer (i.e. it includes a bank number), and so it is obviously intended that it can be located in any bank. It is definitely used as a far-pointer in set_tile_data() and load_map(). But in put_tile(), it was only being used as a 16-bit pointer, and the bank was never set. This would usually work for put_tile() in the old HuC, but only when the pointer is located in the CONST or RAM banks ... which seems to be how people have commonly used it, but isn't really supposed to be a requirement in the implementation. The bug rears its ugly head immediately in the new HuC, because all far-pointers are now stored "normalized" (i.e. in the range $0000-$1FFF). Suddenly, the 16-bit pointer read of the tile-palette color lookup table now resolves into VDC register space ... and the result isn't pretty. So, I fixed put_tile() to set the bank properly, in the same way that load_map() already did, and now the code that Galahad sent me works properly. I sent him the updated HuC library file to drop into his copy of HuC. If it's not reading VRam (and there's no reason it should), then yes, it would read either the RAM bank or the CONST_BANK. There's no where else for the tables to be. Errr ... nope. The tile-palette color lookup table can be in any bank, that's part of the old HuC. In both versions of HuC, you can #incbin() it, or just define it in a #asm section, and put it anywhere. In the new version of HuC, you can use #inctilepal() to automatically generate it from the tileset, and it will definitely not be in the RAM bank or the CONST_BANK. And yes, create a question area for this stuff. And post your code so everyone can see what is going on. You don't have to post it all, just enough so the problem can be reproduced. Absolutely! We need a new thread, and people really should post complete compilable examples if they want help. As it is, Galahad sent me his files privately.
|
|