Author Topic: N64 Development Tools  (Read 34557 times)

0 Members and 1 Guest are viewing this topic.

Offline 64scener

  • Neo-Newbie
  • Newbie
  • *
  • Posts: 47
    • 64scener
Re: N64 Development Tools
« Reply #30 on: May 03, 2010, 03:41:05 AM »
haha... awesome :-)

Offline Conle

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2203
Re: N64 Development Tools
« Reply #31 on: July 12, 2010, 02:46:39 PM »
Here is libdragon compiled for 64bit : http://www.sendspace.com/file/090nbt  (95MB)
Without this you cant compile anything using the 32bit compiled version since it complains about libmpfr.so.1
 ~sm-57.gif~.gif

Offline DragonMinded

  • Newbie
  • *
  • Posts: 18
Re: N64 Development Tools
« Reply #32 on: July 18, 2010, 02:51:40 PM »
Not to be incredibly pedantic, but "libdragon" is simply the development library used to provide hardware support on the N64.  The toolchains are separate from that.  What you have provided is a pre-compiled version of the toolchain usable on 64-bit Linux systems that also includes the libdragon library and samples ready to use (nice touch on the bundle actually).  It is preferred if you simply submit a patch to the original buildscripts so that others may build their own 64 bit edition (not everyone is running a vanilla Linux install on x86).

Obligatory penguins that are marginally relevant:  ~sm-41.gif~  ~sm-58.gif~.gif

Offline Conle

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2203
Re: N64 Development Tools
« Reply #33 on: July 18, 2010, 03:25:56 PM »
Not to be incredibly pedantic, but "libdragon" is simply the development library used to provide hardware support on the N64.  The toolchains are separate from that.  What you have provided is a pre-compiled version of the toolchain usable on 64-bit Linux systems that also includes the libdragon library and samples ready to use (nice touch on the bundle actually).  It is preferred if you simply submit a patch to the original buildscripts so that others may build their own 64 bit edition (not everyone is running a vanilla Linux install on x86).

Obligatory penguins that are marginally relevant:  ~sm-41.gif~  ~sm-58.gif~.gif

Hi!

There is already a 32bit precompiled lib on the forums , so i thought to provide the 64bit also.
Regarding making a patch , its not actually needed. The only thing i had to do was to remove "-Werror" from
some of the tools that im not going to use for now , since they were failing to compile and the main script
was going crazy.The errors where actually conversion errors , like , here's a quick example :

This
Code: [Select]
mkdfs.c

/* Offset from start of filesystem */
inline int32_t sector_offset(void *sector)
{
    uint32_t x = (uint32_t)sector - (uint32_t)dfs;

    return x;
}

Must be changed to this:
Code: [Select]
/* Offset from start of filesystem */
inline int32_t sector_offset(void *sector)
{
    return  (int32_t)( ((uint32_t)sector) - ((uint32_t)dfs) );
}

Offline mic_

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 632
Re: N64 Development Tools
« Reply #34 on: August 23, 2010, 11:05:25 PM »
Is there a reason why the prefixed (mips64-elf-) binaries aren't included in the toolchain zip? The bin directory contains 3 files (bin2c, bin2o and genromfs), while the mips64/bin directory contains the unprefixed gcc/binutils binaries.

Offline Conle

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2203
Re: N64 Development Tools
« Reply #35 on: August 23, 2010, 11:20:05 PM »
Is there a reason why the prefixed (mips64-elf-) binaries aren't included in the toolchain zip? The bin directory contains 3 files (bin2c, bin2o and genromfs), while the mips64/bin directory contains the unprefixed gcc/binutils binaries.

mic , check the latest libdragon update in the mailing list , uncomment the lines from the sh script(found in tools dir) that download and extract the proper libs
, set the install path , then run the script.

Now go 1 directory back , and do a: make && make install

To do all these you need a linux machine(Or a virtual machine like VirtualBox).You'd need to make a new sdk for windows in case you're trying to compile from win system.

ps -- We need a new thread with all the updates  :)

Offline mic_

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 632
Re: N64 Development Tools
« Reply #36 on: August 23, 2010, 11:22:18 PM »
I'm doing this on a Linux machine obviously :P

I'll try the scripts you mentioned.

Offline mic_

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 632
Re: N64 Development Tools
« Reply #37 on: August 23, 2010, 11:31:10 PM »
It fails to connect to sourceware.org during the downloading phase. It might because of the proxy server though (about which I can't do anything). I'll try again later on another machine.

Offline Conle

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2203
Re: N64 Development Tools
« Reply #38 on: August 23, 2010, 11:34:34 PM »
Here's all the necessary steps :

Edit /tools/build :

Code: [Select]
# EDIT THIS LINE TO CHANGE YOUR INSTALL PATH!
export INSTALL_PATH= INSTALL PATH HERE!

# Set up path for newlib to compile later
export PATH=$PATH:$INSTALL_PATH/bin

# Versions
export BINUTILS_V=2.19.51
export GCC_V=4.4.0
export NEWLIB_V=1.17.0

# Download stage
wget -c ftp://sourceware.org/pub/binutils/snapshots/binutils-$BINUTILS_V.tar.bz2
wget -c http://mirrors.ibiblio.org/pub/mirrors/gnu/ftp/gnu/gcc/gcc-$GCC_V/gcc-$GCC_V.tar.gz
wget -c ftp://sources.redhat.com/pub/newlib/newlib-$NEWLIB_V.tar.gz

# Extract stage
tar -xvjf binutils-$BINUTILS_V.tar.bz2
tar -xvzf gcc-$GCC_V.tar.gz
tar -xvzf newlib-$NEWLIB_V.tar.gz

Now edit the makefiles in mksprite/,mkdfs/,dumpdfs/ and remove -Werror

And now run the script :
Code: [Select]
sh build


Go 1 directory back and export the installation path(You have to export this path everytime that you compile code):
Code: [Select]
export N64_INST=/home/username/n64dev/libdragon/mips64-elf

Finally make and install the libraries:
Code: [Select]
make
make install

You're all set now :)

Offline Conle

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2203
Re: N64 Development Tools
« Reply #39 on: August 23, 2010, 11:35:30 PM »
It fails to connect to sourceware.org during the downloading phase. It might because of the proxy server though (about which I can't do anything). I'll try again later on another machine.

Hmm , it must be your proxy for sure  :(

Offline Conle

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2203
Re: N64 Development Tools
« Reply #40 on: August 23, 2010, 11:39:48 PM »
Found some mirrors with a quick google search :

Binutils:
http://sources-redhat.mirrors.airband.net/binutils/snapshots/binutils-2.19.51.tar.bz2

Gcc 4.4.0:
http://ftp.gnu.org/gnu/gcc/gcc-4.4.0/gcc-4.4.0.tar.gz

newlib 1.17.0:
ftp://sources.redhat.com/pub/newlib/newlib-1.17.0.tar.gz

Now just comment back the download stage and just let the script to extract them.
Hope it works  ~sm-70.gif~.gif

Offline ChillyWilly

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1751
  • Just a coding machine.
Re: N64 Development Tools
« Reply #41 on: August 24, 2010, 03:54:55 AM »
Is there a reason why the prefixed (mips64-elf-) binaries aren't included in the toolchain zip? The bin directory contains 3 files (bin2c, bin2o and genromfs), while the mips64/bin directory contains the unprefixed gcc/binutils binaries.

They are. You're looking in the wrong bin dir. It's the way I like to setup my toolchains: the root of the toolchain for a console has a bin directory with tools related to the toolchain, but not part of gcc. Then there is the gcc toolchain directory. When you look in that directory, you see the "normal" gcc toolchain layout.

Offline smccd

  • Newbie
  • *
  • Posts: 1
  • NEO newbie
Re: N64 Development Tools
« Reply #42 on: January 06, 2015, 08:26:04 PM »
 ~sm-56.gif~.gif

I apologize for necroing an older thread, but it's the most relevant.

Has anyone compiled libdragon's /tools directory under windows? I'm having a great deal of trouble, and would appreciate if anyone who did posted a zip with the three (dumpdfs, mkdfs, mksprite).

Thanks in advance!!

Offline mic_

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 632
Re: N64 Development Tools
« Reply #43 on: January 06, 2015, 08:41:43 PM »
If you have cygwin installed, building dumpdfs and mkdfs should be as simple as going to the respective directories and running "make".
Trying to make mksprite generates some build errors, and I'm not sure why. It could be that it relies on an old version of libpng.

Offline sanni

  • Moderator
  • Hero Member
  • *****
  • Posts: 502
Re: N64 Development Tools
« Reply #44 on: January 06, 2015, 10:09:53 PM »
About the mksprite errors:
I figured out how to fix this... the issue resided in the Makefile. After some digging, I was able to make it compile with this makefile:

Code: [Select]
INSTALLDIR = $(N64_INST)
CFLAGS = -std=gnu99 -O2 -Wall -I../../include -lpng

all: mksprite convtool

mksprite: mksprite.c
$(CC) $< -o $@ $(CFLAGS)

convtool: convtool.c
$(CC) $< -o $@ $(CFLAGS)

install: mksprite convtool
install -D --mode=755 mksprite $(INSTALLDIR)/bin
install -D --mode=755 convtool $(INSTALLDIR)/bin

.PHONY: clean install

clean:
rm -rf mksprite
rm -rf convtool


Basically, remove -Werror from the CFLAGS variable and add the lines under mksprite and convtool.


That way I could compile them without error but they still don't want to work for me somehow

Quote

C:\devKitN64\libdragon\tools>make
make -C dumpdfs
make[1]: Entering directory `/c/devKitN64/libdragon/tools/dumpdfs'
cc -std=gnu99 -O2 -Wall -I../../include    dumpdfs.c   -o dumpdfs
make[1]: Leaving directory `/c/devKitN64/libdragon/tools/dumpdfs'
make -C mkdfs
make[1]: Entering directory `/c/devKitN64/libdragon/tools/mkdfs'
cc -std=gnu99 -O2 -Wall -Werror -I../../include    mkdfs.c   -o mkdfs
make[1]: Leaving directory `/c/devKitN64/libdragon/tools/mkdfs'
make -C mksprite
make[1]: Entering directory `/c/devKitN64/libdragon/tools/mksprite'
cc mksprite.c -o mksprite -std=gnu99 -O2 -Wall -I../../include -lpng
cc convtool.c -o convtool -std=gnu99 -O2 -Wall -I../../include -lpng
convtool.c: In function 'main':
convtool.c:15:9: warning: variable 'ret' set but not used [-Wunused-but-set-vari
able]
     int ret;
         ^
make[1]: Leaving directory `/c/devKitN64/libdragon/tools/mksprite'
gcc -o chksum64 chksum64.c
gcc -o n64tool n64tool.c

C:\devKitN64\libdragon\tools>

When I tried to compile a rom I get the following error then:
Quote
C:\devKitN64\libdragon\examples\dfsdemo>make clean
rm -f *.v64 *.elf *.o *.bin *.dfs

C:\devKitN64\libdragon\examples\dfsdemo>make
C:/devKitN64/mips64-elf/bin/mips64-elf-gcc -std=gnu99 -march=vr4300 -mtune=vr430
0 -O2 -G0 -Wall -Werror -IC:/devKitN64/mips64-elf/include -IC:/devKitN64/mips64-
elf/mips64-elf/include   -c -o dfsdemo.o dfsdemo.c
C:/devKitN64/mips64-elf/bin/mips64-elf-ld -o dfsdemo.elf dfsdemo.o -G0 -LC:/devK
itN64/mips64-elf/lib -LC:/devKitN64/mips64-elf/mips64-elf/lib -ldragon -lmikmod
-lc -lm -ldragonsys -Tn64ld.x
C:/devKitN64/mips64-elf/bin/mkdfs test.dfs ./filesystem/
Adding './filesystem/aurora.mod' to filesystem image.
Adding './filesystem/BUTTERFL.XM' to filesystem image.
Adding './filesystem/CTGOBLIN.S3M' to filesystem image.
Adding './filesystem/resonance2.mod' to filesystem image.
Adding './filesystem/squired.xm' to filesystem image.
Adding './filesystem/SUNDANCE.MOD' to filesystem image.
C:/devKitN64/mips64-elf/bin/mips64-elf-objcopy dfsdemo.elf dfsdemo.bin -O binary

rm -f dfsdemo.v64
C:/devKitN64/mips64-elf/bin/n64tool -b -l 8M -t "DragonFS Demo" -h C:/devKitN64/
mips64-elf/lib/header -o dfsdemo.v64 dfsdemo.bin -s 1M test.dfs
Couldn't pad image!
C:/devKitN64/mips64-elf/bin/chksum64 dfsdemo.v64
CHKSUM64 V1.2   Copyright (C) 1997 Andreas Sterbenz (stan@sbox.tu-graz.ac.at)
This program is released under the terms of the GNU public license. NO WARRANTY

The image 'dfsdemo.v64' is in V64 (byte-swapped) format.
Old Checksum:        ED 42 A2 D4  7A 71 CD 91
Calculated Checksum: 56 4D F1 7B  E3 8A 8E CB
New checksum successfully written.

C:\devKitN64\libdragon\examples\dfsdemo>

And the rom can't access the filesystem. The Linux toolchain works though.

Anyway, here are the compiled tools, maybe someone can figure out what I am doing wrong

« Last Edit: January 06, 2015, 10:15:22 PM by sanni »