News:

Forum Updated! 

Main Menu

Cross-Human68k toolchain

Started by lydux, April 30, 2012, 07:09:20 AM

Previous topic - Next topic

neozeed

Quote from: kamiboy on January 19, 2019, 07:56:03 PM
If it is the ludyx toolchain youbare talking about I have developed many complex projects using it. Including a pretty comprehensive 2D platformer game engine.

At least you got lucky, it was unable to build a null version of doom that would even attempt to execute.

The GCC port is modified to use the HAS assembler, which at least produces stuff that'll run.

neko68k

I always ran into problems eventually. Even Soldam, which is 99% assembly, stopped working eventually under lydux toolchain.

kamiboy

I don’t think running something as comprehensive as doom is a good benchmark for that toolset. It is perfectly fine for doing your own projects from scratch. Porting code from other platforms, not so much.

Super

I've been playing around with the X68K using neozeed's GCC and was able to figure out how to load data into PCG-RAM, but I ran into a bit of a problem:
The data gets loaded fine, but for whatever reason it's twice as wide as it should be:



There isn't a whole lot of information out there on exactly how the X68000 formats it's graphical data (or at least not any information that I could find), so any tips (or possibly even utilities) would be highly appreciated.

I've attached my data file below in case you want to examine it.  Note that I didn't create a palette for it, so it would theoretically use palette colors #61 (a dark teal-ish color by default) and #FF (a very-slightly-greenish white by default).

neko68k

#84
PCG is 4-bit 1-dimensional packed into 8-bits. So you have 4-bit pixels where rows are stored sequentially in RAM.

[edit]
that is to say, two 4-bit pixels for each 8-bits. The high nibble is the left pixel, the low nibble is the right pixel.

[edit edit]
And 16x16 data is stored as 4 8x8's like so:


1|2 = 1|3|2|4
3|4

Super

Thanks for the clarification, neko! 
One hex editor session later, I was able to create a 192-byte file that, when loaded into PCG-RAM, shows a smiley face and a stick figure:


neko68k

My advice; grab a copy of the PUNI docs and a copy of Inside X68000. Nearly everything is covered at least a little in the PUNI docs and anything missing or in need of detail is almost certainly in Inside X68000. There is also some info on the wiki in English but it's pretty incomplete.

neozeed

Quote from: Super on February 05, 2019, 02:56:14 AM
Thanks for the clarification, neko! 
One hex editor session later, I was able to create a 192-byte file that, when loaded into PCG-RAM, shows a smiley face and a stick figure:



awesome job~!@

UD2

Hey all, I just succeeded on building this toolchain on modern Linux (Ubuntu 18.04). There are a few tricks needed to get it to behave and I wanted to leave them here for posterity.

First, you will need to configure the tools with --disable-werror since newer versions of GCC have more warnings and these will break the build with werror. Second, newer Texinfo will choke when trying to build the docs, so add "MAKEINFO=true" to every make command to nop it out. Finally, when building GCC, you will need to apply this patch or GCC will segfault when building libgcc: https://gcc.gnu.org/viewcvs/gcc/branches/gcc-4_7-branch/gcc/ira-int.h?r1=191605&r2=191604&pathrev=191605

I hope this helps. Happy hacking!

AnimaInCorpore

#89
Quote from: UD2 on July 18, 2019, 04:05:22 PMHey all, I just succeeded on building this toolchain on modern Linux (Ubuntu 18.04). There are a few tricks needed to get it to behave and I wanted to leave them here for posterity.
Thanks for the info. I've created a short script which should work on modern machines incorporating your mentioned "ira-int.h" changes. Please read the comments in this script when you're about to compile it for an aarch64 system (like Raspberry Pi 4).
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install bison texinfo flex expect libgmp-dev libmpfr-dev libmpc-dev build-essential git

mkdir gcc_x68k
cd gcc_x68k

git clone git://github.com/Lydux/binutils-2.22-human68k.git &
git clone git://github.com/Lydux/gcc-4.6.2-human68k.git &
git clone git://github.com/Lydux/newlib-1.19.0-human68k.git &

mkdir binutils-build
mkdir gcc-build
mkdir newlib-build

wait

printf 'diff --git a/gcc-4.6.2-human68k/gcc/ira-int.h.bak b/gcc-4.6.2-human68k/gcc/ira-int.h\nindex 049a07f..ddf1200 100644\n--- a/gcc-4.6.2-human68k/gcc/ira-int.h\n+++ b/gcc-4.6.2-human68k/gcc/ira-int.h\n@@ -1123,8 +1123,13 @@ static inline bool\n ira_allocno_object_iter_cond (ira_allocno_object_iterator *i, ira_allocno_t a,\n \t\t\t      ira_object_t *o)\n {\n-  *o = ALLOCNO_OBJECT (a, i->n);\n-  return i->n++ < ALLOCNO_NUM_OBJECTS (a);\n+   int n = i->n++;\n+   if (n < ALLOCNO_NUM_OBJECTS (a))\n+   {\n+      *o = ALLOCNO_OBJECT (a, n);\n+      return true;\n+   }\n+   return false;\n }\n \n /* Loop over all objects associated with allocno A.  In each\n' | patch -p1

cd binutils-build
../binutils-2.22-human68k/configure --prefix=/usr/local --target=human68k --disable-nls --disable-werror # --build=unknown-unknown-linux # add this for aarch64 machines.
sed -i 's/MAKEINFO = makeinfo/MAKEINFO = true/g' Makefile
make -j 4
sudo make install
cd ..

cd gcc-build
../gcc-4.6.2-human68k/configure --prefix=/usr/local --target=human68k --disable-nls --disable-libssp --with-newlib --without-headers --enable-languages=c --disable-werror # --build=unknown-unknown-linux # add this for aarch64 machines.
sed -i 's/MAKEINFO = makeinfo/MAKEINFO = true/g' Makefile
make -j 4
sudo make install
cd ..

cd newlib-build
../newlib-1.19.0-human68k/configure --prefix=/usr/local --target=human68k --disable-werror # --build=unknown-unknown-linux # add this for aarch64 machines.
sed -i 's/MAKEINFO = makeinfo/MAKEINFO = true/g' Makefile
make -j 4
sudo make install
cd ..

kroustibat

#90
Hello all,

I succeeded to install on windows 10 the linux toolchain binaries available on https://www.target-earth.net/wiki/doku.php?id=blog:x68_devtools using the windows linux subsystem (ubuntu 20.04LTS)

went like a breeze :) and i builded the ipl dumperfrom lydux without any troubles. Thanks Lydux and Megatron






FedericoTech

#91
Hi everyone,

I'm new in this forum, I just signed up in fact.

I have been researching about programming for the X68000. I have built a fairly good wealth of knowledge I'd like to share and exchange should there were anyone interested.

I'm writing also a blog that deals with the X68000 and have a github with plenty of examples.

I tested this buildchain by the way and was very helpful at the beginning.

FedericoTech

Hi there,

I have notices from some time ago that Lydux toolchain in windows stopped generating correct executables.
Needless to say that I reinstalled it a few times with the same outcome.
I wonder whether anyone else is experiencing the same issue.

I have tried the Linux version and it does work. I managed to make it work in a docker container in Docker Desktop and trick Code::Blocks to compile with it.

I'll make a tutorial on how to do it but I'd like that anyone confirm that they have the same problem.

FedericoTech

Hi there, I cloned Lydux's toolchain in my github at https://github.com/FedericoTech/newlib-1.19.0-human68k
There I fixed some buggy functions so that I can compile all the examples I did at https://github.com/FedericoTech/X68KTutorials

I did a Pull Request on Lydux so if he ever sees it and accepts them they would be also available in the official branch.

I hope it helps.