Author Topic: HUC - huc_misc.asm file check  (Read 1452 times)

nodtveidt

  • Guest
Re: HUC - huc_misc.asm file check
« Reply #30 on: September 20, 2013, 08:31:48 AM »
That reminds me of the QBASIC loyalists... nothing else was "good enough" because nothing else was easy enough.

How about if someone writes a serious tutorial series using the assembler rather than HuC? Something like what I wrote, only done with pceas rather than HuC. Maybe that would get more people interested in using the assembler. As it stands, the assembler is intimidating, and HuC's generated code is chock full o' macros, which can be confusing to follow... not to mention the fact that the default MagicKit library is designed for HuC and is very difficult to use without it, so you're probably going to have to write your own library code from scratch, and that's another hindrance.

People used these same arguments when I was involved with Nintendo DS homebrew. However, the proof was in the pudding; having the docs scattered all over the place and lacking any kind of cohesive, easy-to-understand documentation made it difficult for most people to get involved with devkitARM. PAlib, on the other hand, had extensive documentation that was easy-to-understand and all in one place, and thus had a tremendous following. You can argue that "the docs have nothing to do with it" all day long but the evidence is unmistakable that the docs are a large part of it.

Arkhan

  • Hero Member
  • *****
  • Posts: 14142
  • Fuck Elmer.
    • Incessant Negativity Software
Re: HUC - huc_misc.asm file check
« Reply #31 on: September 20, 2013, 09:03:44 AM »
There are a few solid reasons for C being appealing to use in favor of assembly:

1) Your game is "sort" of portable.   Aside from having to redo certain things like display, the bulk of your game logic is reusable on different platforms, should you ever want to do that.
2) There are certain things AI related that are easier to design/implement/mess with at a later time using C than they are with assembly.  


I went 100% z80 assembly for Inferno, because there isn't really an alternative.  Parts of the game logic were a pain in the ass to fiddle around with later when I decided I didn't like a few things.  It's not so much a "not comfortable" with it sort of thing, its more a "assembly is often tedious even if you're good at it" kind of thing.  

and now, should I ever want to port Inferno to PCE, or use the engine (which is pretty neat, admittedly) elsewhere, I'm going to have to do an actual port of z80 to 6502 or 68000 or whatever, instead of copy pasting large chunks of C code and only sweating the display stuff.  

This will prove to be a tedious pain in the dick because of simple things like 6502 loads modifying flags where z80 doesn't.  


It was a big enough pain back in the 80s to do something like port Ultima III from Apple II to C64, and those use the same CPU.

I can't imagine the awful time people had porting z80 games to C64 back then.   Especially because after all the pain, the games usually sucked.


You can argue that "the docs have nothing to do with it" all day long but the evidence is unmistakable that the docs are a large part of it.

Yeah.  There's a reason the MSX and C64 have such a huge development following.   They are documented well.



And, I don't think an assembler tutorial series is really that important.   Anyone who is willing to dive in face first into assembly-only programming is likely already used to what they're getting into.
« Last Edit: September 20, 2013, 09:06:08 AM by Arkhan »
[Fri 19:34]<nectarsis> been wanting to try that one for awhile now Ope
[Fri 19:33]<Opethian> l;ol huge dong

I'm a max level Forum Warrior.  I'm immortal.
If you're not ready to defend your claims, don't post em.

Arkhan

  • Hero Member
  • *****
  • Posts: 14142
  • Fuck Elmer.
    • Incessant Negativity Software
Re: HUC - huc_misc.asm file check
« Reply #32 on: September 20, 2013, 09:05:45 AM »
Ignore this post.   Firefox had a stroke.
[Fri 19:34]<nectarsis> been wanting to try that one for awhile now Ope
[Fri 19:33]<Opethian> l;ol huge dong

I'm a max level Forum Warrior.  I'm immortal.
If you're not ready to defend your claims, don't post em.

TheOldMan

  • Hero Member
  • *****
  • Posts: 958
Re: HUC - huc_misc.asm file check
« Reply #33 on: September 20, 2013, 09:29:10 AM »
Quote
I'm pretty sure it [HuC] wasn't originally meant to be anything other than a novelty type thing (from what I've been told).....If you wanted to do something serious, you used Assembly. And you wrote your own lib.

Whether it was ~meant~ to be a novelty or not, people are going to attempt to use it for real projects. Very few people are ever taught more than a passing kowledge of assembler now; heck, most aren't even taught C in university anymore. If you don't support something people understand, they won't develope for the system. It will never get beyond cult status.

Quote
HuC has quite a bit more in the limitation department than just library documentation or library itself and such. No matter what you do, it will never match using straight assembly. It's more than just speed too; it's flexibility (in which speed optimizations can directly derive from).
No arguement there. I was taught a long time ago that nothing will beat a well-written assembler program for sheer speed. And it is possible to do things in assembly that you can't do in C.

However, that's not a realistic arguement. How often do you really need every single cycle in a program? Does it really matter if it takes my C program 100 cycles and your assembler program 80, if we're polling the joypad? Processing a menu? Waiting to load something from CD?

Quote
...why then even bother with HuC if you can handle assembly just fine?
The real benefit of using HuC is that I can write something (okay, maybe not the fastest running) faster in C than I can in assembler. And, in general, with fewer problems. My programming time is worth more than the programs run time.

Quote
As it stands, the assembler is intimidating, and HuC's generated code is chock full o' macros, which can be confusing to follow... not to mention the fact that the default MagicKit library is designed for HuC and is very difficult to use without it, so you're probably going to have to write your own library code from scratch, and that's another hindrance.

The Magickit library is actually designed to be used in assembler, and it's not difficult to use ~most~ of it without HuC. So you don't really have to write a lot of library code from scratch. However, many of the functions have alternate entries for HuC (due to the way parameters are passed); this means you have understand a lot more than assembly to figure out how they work, starting from a HuC listing....

Quote
having the docs scattered all over the place and lacking any kind of cohesive, easy-to-understand documentation made it difficult for most people to get involved
Quote
If you know enough of how the underlying hardware works *and* how to effectively write good/fast assembly code...

And this, more than anything (except the bugs in HuC) is what I see as the problem. Want to know which VDG register does what? It's in the docs....somewhere. Of course, I have all of them memorized <sarc>! Now I need to know what the sound chip registers do. Of course, that information is.....where again?
The purpose of having a library in the first place is that I should not need to know ~how~ the hardware works: I should only need to know how the function to do something works. And both of these are lacking in the current developement environment - I not only need to understand the hardware, I need to search multiple files to find out what a function does, and how it does it.

And you guys can pick on the Basic/QBasic people all you want. They managed to get things done and move on, rather than spending months using a more "suitable" language. I remember a lot of good user-written games being done in a month, rather than a year.


nodtveidt

  • Guest
Re: HUC - huc_misc.asm file check
« Reply #34 on: September 20, 2013, 09:57:41 AM »
Nah, once I got the hang of C, QBASIC just wasn't up to snuff anymore for serious projects. It was getting out of the comfort zone of BASIC that was the challenge. I still do use BASIC nowadays from time to time though, but in the form of either VB for GUI-based utility apps or freeBASIC for commandline utility apps. I've done entire games in freeBASIC as well (such as Paradox Girl, the prequel to Lucretia).

Anyway, just in general, tutorials and whatnot for assembly would really help out a lot, especially for those people who have no coding experience. Not all coders learn from technical references; some learn by example. zeograd.com isn't exactly the greatest place to find example code; very few projects there come with source as it is, and even rarer still is the number of entries written in assembly.

Arkhan

  • Hero Member
  • *****
  • Posts: 14142
  • Fuck Elmer.
    • Incessant Negativity Software
Re: HUC - huc_misc.asm file check
« Reply #35 on: September 20, 2013, 10:31:47 AM »
and if the assembly has no comments, a new person is going to look at it and be like "what in the f*ck is this even doing."

[Fri 19:34]<nectarsis> been wanting to try that one for awhile now Ope
[Fri 19:33]<Opethian> l;ol huge dong

I'm a max level Forum Warrior.  I'm immortal.
If you're not ready to defend your claims, don't post em.

dshadoff

  • Full Member
  • ***
  • Posts: 175
Re: HUC - huc_misc.asm file check
« Reply #36 on: September 20, 2013, 12:18:36 PM »
I'm pretty sure it wasn't originally meant to be anything other than a novelty type thing (from what I've been told). I think, while additions were made for it (the lib grew, CD support, syscard lib extensions, etc) - it was never intended to be taken seriously.

Yes.  That's exactly the case, even if I wasn't able to properly express it earlier.

Although nobody is likely to believe it, it was only ever intended to be a proof-of-concept and a potential fast-prototyping platform.

I had always expressed, as Bonknuts notes, that the platform doesn't have too many spare cycles to be throwing away by doing 16-bit macro math on loop iterators, so it was never targeted at full-scale game writing.

In a way, it was actually intended to show how to write something in assembler on the PCE; a lot of assembly coding is knowing how to hit the hardware, and HuC does all the basic register setup - and tries to deal with a fair bit of variation (ie. resolution sizes, etc.).  The libraries were intended to read by other programmers; that's why they are so heavily commented.  (Anybody who has ever read somebody else's code in a professional capacity would see that the libraries are heavily-commented.  Not the compiler itself, though.  That was only modified in specific sections, and i never understood large parts of it.)

Other goals for the compiler were to use it as a platform to explore the concepts necessary for writing larger games on the PC Engine - that is to say:
- how to make use of banks (pin one code bank in memory, and use it as a pivot to bank another code bank in and out; store data in prescribed bank locations, etc.)
- *testing* CDROM card function accesses and other hardware features -> HuC was actually used as the test platform for determining how to use most CDROM card functions and other hardware accesses, as most of the functionality had never been discovered/used by hobbyists before.  Then standard HuC functions were written around them.
- writing standard everyday functions like joypad poll, BRAM access, etc. which would be used in every game, so they wouldn't need to be rewritten a million times.  I'm pretty sure it reads mouse position too, if I remember correctly.
- implementing overlays as a way of writing a game larger than memory.  This was more of a technology test/proof-of-concept, and probably the last thing I did before I had to give up and go back to 15-hour workdays (in my business, it's usually too much work, or too little - no middle ground).

My own "ultimate" goal was to use it to prototype a game; I had no confidence that a game would even be possible at the performance levels HuC afforded, but HuC generated assembler code which would work, and which could be modified and optimized after the fact.  My goal was to rough something in, see how it runs, then optimize as much as necessary in assembler for performance(I assumed that entire sections of the game would need it, but potentially only critical sections might).


Quote
So it begs the question, why then even bother with HuC if you can handle assembly just fine? There really isn't a good answer to that.
See above - quick prototypes, and roughing in a concept, to be optimized by hand.  Much faster than writing from scratch.
I even had ideas at one point of automatically removing library code which wasn't required, for space reasons.  Never got around to it though.


Quote
Anyway, I don't think documentation is the problem/reason why the console doesn't have more devs for it. There's plenty of documentation for it. Sure, it might not all be in one place - but it's out there. Actually, not really much different than SMS, NES, SNES, or the Genesis scene. People that know how to code for these type of old consoles, WILL find that documentation. They'll figure it out. I did.

I couldn't agree more.
That doesn't mean I don't sympathize with the fact that it is a struggle.

nodtveidt

  • Guest
Re: HUC - huc_misc.asm file check
« Reply #37 on: September 20, 2013, 02:23:44 PM »
Well, as you can see from the recent history of released games, HuC is most certainly good enough to produce quality software. :D

Arkhan

  • Hero Member
  • *****
  • Posts: 14142
  • Fuck Elmer.
    • Incessant Negativity Software
Re: HUC - huc_misc.asm file check
« Reply #38 on: September 20, 2013, 02:49:04 PM »
If it was only intended to be a novelty/prototyping platform, that intent was sure as shit never properly relayed out to people.

and yes, the libraries are heavily commented for the what, 4 of us here who are capable / willing to sit and read 6502 assembly, followed by comments on said assembly.

A C library generally implies that you don't have to actually read the source code.  It's a magical black box.   Inputs go in, outputs come out.   

It's such a common thing in the professional world that you often just have a compiled .lib file that can't even be looked at, and an accompanying header file with all of the function signatures for people to wire up to...

So what I'm saying is, your intent may have been for it to be a trampoline into going balls deep into assembly, where the programmer will be reading and figuring out all of the workings...

but, that's definitely not what you got.   Especially when Zeograd's Lair provides a multitude of open-source C stuff that leans towards the side of "write games in C, everyone!".  Heck there was even that PCE IDE that's up there.

It's way too accessible/shown off for it to be just a little novelty thing that only the hardcore should use to prototype stuff out and then dive into assembly.


and yeah, like Rover said, Atlantean in it's current form is still mostly written in C, aside from player inputs, the fixed-point stuff, and the scrolling. and some other bits.

the rest of it's still running mostly on C code at the moment, because quite honestly, I don't feel like screwing around with a game like Defender with straight 6502 assembly.   I'm not getting paid by the hour to sit here and mess with enemy behaviors. 

Besides, you can generally accomplish a lot more in 2ish hours of time spent in C than you can in 6502 when it comes to writing functional game code.

:)
[Fri 19:34]<nectarsis> been wanting to try that one for awhile now Ope
[Fri 19:33]<Opethian> l;ol huge dong

I'm a max level Forum Warrior.  I'm immortal.
If you're not ready to defend your claims, don't post em.