HuC - Newbie questions?

Started by Trenton_net, 06/20/2016, 03:01 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Trenton_net

Hey everyone,

So I had a look at HuC on Github (https://github.com/uli/huc) and it seems interesting enough to play with. But lacking some kind of direction, I had some newbie questions regarding it. :-)

For example, I assume the development environment is probably Linux only and not Windows? Or at the very least, I need Cygwin installed? Also, they provide you with 'make' files all over the place, but what exactly do I need to use them (for example compiling the examples)? Is there a proper way I need to setup and compile HuC for the first time, before I can use the compiler to make my own PCE binaries?

Any help would be appreciated as I'm pretty green to all of this. The example code looks straight forward enough, but getting all the tooling setup is another story lol!

PS: If your using something like the Everdrive to run your binaries on, what is the maximum PCE size allowed? I assume HuC will generate PCE binaries of any arbitrary size? Or will it actually warn you if you exceed a particular amount?

elmer

AFAIK, HuC has traditionally been for Windows-based machines.

It's annoying that Uli added some unix-specific code in his changes that broke Windows compatibility, which means that folks now need to run cygwin to compile his upgraded version HuC for Windows.

I'm curious enough to see his changes that I'm installing cygwin on a old machine, and will attempt to compile/upload a build for folks to play with.

Are you an experienced C programmer?

Do you have any linux experience?

Do you actually want to install/run cygwin (you don't need it if you just want to use makefiles for your PCE development)?

OldMan

QuoteAFAIK, HuC has traditionally been for Windows-based machines.
Odd. I always thought it was for linux machines, with windows compatability via cygwin.
Fwiw, the call used to fork the assembler isn't completely compatible with cygwin; that's why you
sometimes have to hit a key to get back to the prompt.

elmer

Quote from: TheOldMan on 06/20/2016, 03:41 PMOdd. I always thought it was for linux machines, with windows compatability via cygwin.
Linux-ish, yep, but definitely not cygwin ... I haven't seen any old binary packages that included the huge cygwin1.dll file.

AFAIK, it used to be built with msys/mingw which is much cleaner, but Uli's changes added some code that requires some linux library functions that mingw doesn't support.

He didn't need to do it that way, but he did, and so you're stuck with needing to include 3.6MB of cygwin dlls now. At least until/unless someone rewrites a couple of his additions in a more cross-platform fashion.

Anyway, here's a prebuilt Windows package of Artemio Urbina's fork of Uli's version of HuC, and no cygwin installation is needed.

Artemio added a few extra nice features on top of Uli's changes.

https://www.dropbox.com/s/4dy8tujysefqupd/huc-aurbina-2016-06-20.zip?dl=0

BTW ... if someone wants to host that, then please go ahead, I don't particularly want it cluttering up my DropBox account forever.

I'll be curious to see if it generates better code than the example that Arkhan got me to run in the other recent HuC thread.

P.S.

To compile it from source, you just need to install cygwin, and then add the "gcc-core", "gcc-g++" and "git" packages, and those should pull in all the other packages that you need as dependencies.

I may have manually added the "make" package, too, but I think that came in automatically as a dependency.

Trenton_net

#4
Quote from: elmer on 06/20/2016, 03:31 PMAFAIK, HuC has traditionally been for Windows-based machines.

It's annoying that Uli added some unix-specific code in his changes that broke Windows compatibility, which means that folks now need to run cygwin to compile his upgraded version HuC for Windows.

I'm curious enough to see his changes that I'm installing cygwin on a old machine, and will attempt to compile/upload a build for folks to play with.

Are you an experienced C programmer?

Do you have any linux experience?

Do you actually want to install/run cygwin (you don't need it if you just want to use makefiles for your PCE development)?
Hey,

I'm somewhat experienced with C++, and I'm very experienced with Linux generally. The reason I ask what platform this toolchain works best on is because I wasn't sure if some of the programs referenced, like "mod2mml" was built for Linux or Windows.

I assume if I'm using Linux, I can just install g++, build the main HuC compiler, then I'll get a "bin" folder with all the tools like "mod2mml" all ready for use?

spenoza

I think we need to push for Ruby on Rails for Hu6280. How can we be expected to program if we can't use, like, real words and stuff? Geez...

(No, I'm not lampooning anyone in this thread or otherwise on this forum.)

elmer

Quote from: Trenton_net on 06/20/2016, 04:28 PMI'm somewhat experienced with C++, and I'm very experienced with Linux generally. The reason I ask what platform this toolchain works best on is because I wasn't sure if some of the programs referenced, like "mod2mml" was built for Linux or Windows.
Everything is just command-line based.

If you're comfortable in linux (and have the right packages installed), then it's all as simple as a "git clone" and a "make", and then everything will be in the huc/bin directory.


Quote from: elmer on 06/20/2016, 04:15 PMI'll be curious to see if it generates better code than the example that Arkhan got me to run in the other recent HuC thread.
And the answer is "yes", it does.

It is still really, really horrible compared to hand-written assembly, but it's not quite as bad as it was.


**********************************************
Original C Source ("char" is unsigned)
**********************************************

char arr1[8];
char arr2[8];

void foo1 (char index)
{
  if (arr1[index] < arr2[index]) foo2();
}


**********************************************
Old HuC generated code
**********************************************

       __pushw
       __ldwi   _arr1
       __pushw
       __ldb_s  2
       __addws
       __ldb_p
       __pushw
       __ldwi  _arr2
       __pushw
       __ldb_s  4
       __addws
       __ldb_p
         jsr    lt
       __lbeq   LL3
         call   _foo2
LL3:   __addmi  2,__stack
         rts


**********************************************
Uli HuC generated code
**********************************************

        __pushw
        __ldwi  _arr1
        __addb_s        0
        __ldb_p
        __pushw
        __ldwi  _arr2
        __addb_s        2
        __ldb_p
          jsr   lt
        __lbeq  LL3
          call  _foo2
LL3:    __addmi 2,__stack
          rts

Arkhan Asylum

Insanity was half developed on a Linux install before the laptop died and I used a Windows one after that.

That version of HuC had existed since what, 2003 or 2005?

This "max-level forum psycho" (:lol:) destroyed TWO PC Engine groups in rage: one by Aaron Lambert on Facebook "Because Chris 'Shadowland' Runyon!," then the other by Aaron Nanto "Because Le NightWolve!" Him and PCE Aarons don't have a good track record together... Both times he blamed the Aarons in a "Look-what-you-made-us-do?!" manner, never himself nor his deranged, destructive, toxic turbo troll gang!

elmer

Quote from: guest on 06/20/2016, 05:17 PMI think we need to push for Ruby on Rails for Hu6280. How can we be expected to program if we can't use, like, real words and stuff? Geez...
:lol: :wink:


Quote from: guest on 06/20/2016, 09:16 PMInsanity was half developed on a Linux install before the laptop died and I used a Windows one after that.

That version of HuC had existed since what, 2003 or 2005?
Yep, definitely dual-platform, using linux-style development tools (makefiles).

But AFAIK, it's always been dual-platform using mingw as the development environment for the Windows version ... I could be wrong on that, though.

It's only Uli's recent changes that have broken the compatibility with mingw, and forced the use of the heavier-weight cygwin in order to compile a Windows version of HuC.

I've always thought of the Windows version as the "main" one, just because that was most users platform-of-choice up until just the last few years.

I've been running linux machines too for many years ... but I still find that it has enough annoyances as a desktop that I spend nearly all of my time in Windows.

I think that I'm going to finally be forced into developing on linux in order to get the 6502 simulator for SDCC written.

Hopefully gdb has some decent front-ends by now.  [-o&lt;

TurboXray

I've never even touched linux. Mostly because I haven't had the need to.

Arkhan Asylum

Quote from: TurboXray on 06/20/2016, 11:48 PMI've never even touched linux. Mostly because I haven't had the need to.
Once you realize you can make GNOME look like Amiga OS, you will want to need to Linux.
This "max-level forum psycho" (:lol:) destroyed TWO PC Engine groups in rage: one by Aaron Lambert on Facebook "Because Chris 'Shadowland' Runyon!," then the other by Aaron Nanto "Because Le NightWolve!" Him and PCE Aarons don't have a good track record together... Both times he blamed the Aarons in a "Look-what-you-made-us-do?!" manner, never himself nor his deranged, destructive, toxic turbo troll gang!

Trenton_net

Quote from: guest on 06/23/2016, 05:05 AM
Quote from: TurboXray on 06/20/2016, 11:48 PMI've never even touched linux. Mostly because I haven't had the need to.
Once you realize you can make GNOME look like Amiga OS, you will want to need to Linux.
I agree. If you thought Android gave users freedom of choice, then Linux will just blow your mind.

I used to be a hard-line Windows supporter (MS-DOS, Windows 2000, etc), but once I tasted Linux I never went back. As long as you can ignore all the BS and FUD people try to spout about it (Ie. It's too hard for the average Joe to use, etc), and are not actually afraid of learning something "new" (Ie. Anything not made by Microsoft), then you'll find its one of the most liberating and powerful operating systems around. Just grab any distribution that uses DEB packages/repos (Ie. Ubuntu, Mint, Debian) and you'll be already set!

I remember the first day I installed Linux, I went "Ok, So first I need to uninstall all the pre-installed junk, and then re-install all the proper apps I want one by one." and then I realized "Oh, Firefox is already installed. Libre Office is already installed. I guess I don't need to remove and add as much as I thought". Even then, installing stuff was a breeze! Just pick the handful of items you want to install from the repos (or app-store if you will), click GO, and just get a coffee. It literally does it all for you. Best of all, non of this "You just installed Flash! Because this application is garbage, it requires you to restart your computer now. Ok or Cancel". :-)

Psycho Punch

Trenton_net your experience is not consistent with mine (and many others), I use arch nowadays but when I used to try to get into those "easy" distributions, it would ALWAYS self-destruct after some updates. No, the "average joe" doesn't want to dive into a tty screen to dick around with configuration files and packages without any sort of user friendly software, and it is not because they're afraid of learning "new" stuff. These linux distributions were never geared towards user experience and saying "lol they're too dumb to learn how to use anything outside of micro$oft products" isn't helping to bring anyone on board.

You just updated your distribution! But we broke your X Window Server and we won't notify you, good luck next reboot! A breeze, indeed.
This Toxic Turbo Turd/Troll & Clone Warrior calls himself "Burning Fight!!" on Neo-Geo.com
For a good time, reach out to: aleffrenan94@gmail.com or punchballmariobros@gmail.com
Like DildoKobold, dildos are provided free of charge, no need to bring your own! :lol:
He also ran scripts to steal/clone this forum which blew up the error logs! I had to delete THOUSANDS of errors cause of this nutcase!
how_to_spell_ys_sign_origin_ver.webp