Author Topic: N64 Development Tools  (Read 31044 times)

0 Members and 1 Guest are viewing this topic.

Offline Conle

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2203
Re: N64 Development Tools
« Reply #45 on: January 06, 2015, 11:04:54 PM »
Regarding the n64tool's error that trashes the image after the hdr+bin are merged ,try to replace output_zeros in n64tool with this (it  makes absolutely no sense for that function to expect alignment
 since the input is already the required bytes to pad the size! ...bad naming...) :

Code: [Select]
int output_zeros(FILE* f,int amount) {
for (;amount > 0;--amount)
fputc(0,f);

return 0;
}

For example , imagine the case of sizeof(hdr+bin) being aligned , then merged with unaligned fs data , resulting in non aligned remainder , which
makes the code to jump to this case:
Quote
if(amount & 3 != 0)
{
/* Don't support odd word alignments */
return -1;
}

All calls to that function expect (int)0 for positive result , without explicit statement in the comparison , which may result in different code for the jump instruction being generated between different gcc versions....



« Last Edit: January 06, 2015, 11:21:34 PM by Conle »

Offline sanni

  • Moderator
  • Hero Member
  • *****
  • Posts: 502
Re: N64 Development Tools
« Reply #46 on: January 08, 2015, 11:40:24 PM »
Did some more testing, it seems like the culprit is mkdfs. I compiled the same libdragon dfsdemo example both with my Windows and Linux setup.

The testfile that goes into the filesystem folder is 660KB. The resulting dfs file compiled in Linux is 672KB and when I compile the example in Windows it's only 4KB. So yeah, that sure won't work.
In Linux I compiled the mkdfs executable with gcc 4.8.2 and in Windows with gcc 4.8.1.

Maybe it simply doesn't like Windows 8.1 x64  ~sm-73.gif~.gif

Offline Conle

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2203
Re: N64 Development Tools
« Reply #47 on: January 09, 2015, 02:56:41 AM »
Did some more testing, it seems like the culprit is mkdfs. I compiled the same libdragon dfsdemo example both with my Windows and Linux setup.

The testfile that goes into the filesystem folder is 660KB. The resulting dfs file compiled in Linux is 672KB and when I compile the example in Windows it's only 4KB. So yeah, that sure won't work.
In Linux I compiled the mkdfs executable with gcc 4.8.2 and in Windows with gcc 4.8.1.

Maybe it simply doesn't like Windows 8.1 x64  ~sm-73.gif~.gif

2 things to check:
1.
Can you try to replace all sector calculations on pointers with ptrdiff_t instead uint32_t  or either do the calculations on actual pointers and then return the typecasted diff?
I find it odd that the author decided to use actual malloc'd pointers typecasted to u32 then return the difference between segments....

2.Directory separator code handling for windows build is missing(actually there's no win build :P ) ...Check add_directory function