Author Topic: Playing with the ObeyBrew tutorials  (Read 2927 times)

spenoza

  • Hero Member
  • *****
  • Posts: 2751
Playing with the ObeyBrew tutorials
« on: April 28, 2012, 05:00:20 PM »
I tried the first tutorial. While the explanations are very detailed about why you do certain steps and of certain programming conventions, the explanations are often a tad lacking when it comes to what the various commands are actually doing (in terms of forward learning). Then again it may be that palettes and color assignments aren't appropriate to delve too deeply into in lesson 1.

The output I got from huc is hello.s, not hello.pce. Looks like assembly output. How to I actually get it to a PCE file?
« Last Edit: April 28, 2012, 05:10:55 PM by spenoza »
<a href="http://www.pcedaisakusen.net/2/34/103/show-collection.htm" class="bbc_link" target="_blank">My meager PC Engine Collection so far.</a><br><a href="https://www.pcenginefx.com/forums/" class="bbc_link" target="_blank">PC Engine Software Bible</a><br><a href="http://www.racketboy.com/forum/" c

Arkhan

  • Hero Member
  • *****
  • Posts: 14142
  • Fuck Elmer.
    • Incessant Negativity Software
Re: Playing with the ObeyBrew tutorials
« Reply #1 on: April 28, 2012, 09:22:57 PM »
They're not commands, they're functions!   And, you don't need any forward learning.  Is that even a real thing?   I'm not sure how you learn forward.

and, are you sure you didn't get a .pce?   Post a screenshot of your build process.   

If you go huc hello.c on the command line, it should compile to assembly, and then assemble to a pce for you.   Did you do huc -s hello.c ??   That will give you assembly.

If you did that, just do pceas hello.s
[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.

soop

  • Hero Member
  • *****
  • Posts: 2828
Re: Playing with the ObeyBrew tutorials
« Reply #2 on: April 29, 2012, 12:04:45 AM »
Link me to the tutorial please?

cabbage

  • Sr. Member
  • ****
  • Posts: 342

spenoza

  • Hero Member
  • *****
  • Posts: 2751
Re: Playing with the ObeyBrew tutorials
« Reply #4 on: April 29, 2012, 07:18:13 AM »
They're not commands, they're functions!   And, you don't need any forward learning.  Is that even a real thing?   I'm not sure how you learn forward.

If I were in class I would care that I didn't call them functions, but since I'm not, I don't  : )

What I meant by forward learning is that some people think you should only learn what you need to know about what you're doing right at that step, meaning if you use a function for a particular purpose all you need to know is that it does what you want and what arguments you need to provide it with. Another theory of learning, one that suits me better, is if I'm using that function, go ahead and tell me all about it, not just what it does in this example but what it can do more broadly. I found the explanations in that tutorial were OK for that tutorial, but I would have liked a clearer, more forward looking explanation of what was going on with the palette functions. The explanation was a little murky on that. I knew what I was doing, but a clearer, more concise, and more general/broadly applicable wording might have been nice.

and, are you sure you didn't get a .pce?   Post a screenshot of your build process.  

If you go huc hello.c on the command line, it should compile to assembly, and then assemble to a pce for you.   Did you do huc -s hello.c ??   That will give you assembly.

If you did that, just do pceas hello.s

I didn't use the -s flag on HuC. It simply created a .s file in the directory with the .c, with no .pce anywhere to be found.

Part of the problem is that the zipped file of the HuC stuff subdivides all the files into different directories, but HuC seems to want everything lumped together in the same directory. So am I just supposed to work with one monolithic directory that has everything on the same level? And if so, why did the zip file put everything in directories?

NM, I'm apparently supposed to path this shit, which is annoying because my path is already pretty large, but oh well.
« Last Edit: April 29, 2012, 07:20:10 AM by spenoza »
<a href="http://www.pcedaisakusen.net/2/34/103/show-collection.htm" class="bbc_link" target="_blank">My meager PC Engine Collection so far.</a><br><a href="https://www.pcenginefx.com/forums/" class="bbc_link" target="_blank">PC Engine Software Bible</a><br><a href="http://www.racketboy.com/forum/" c

Arkhan

  • Hero Member
  • *****
  • Posts: 14142
  • Fuck Elmer.
    • Incessant Negativity Software
Re: Playing with the ObeyBrew tutorials
« Reply #5 on: April 29, 2012, 07:43:20 AM »
If I were in class I would care that I didn't call them functions, but since I'm not, I don't  : )

They were called functions before there were classes about programming.   If you want others to understand what you may be talking about, you should use the right words for things like that.

Quote
What I meant by forward learning is that some people think you should only learn what you need to know about what you're doing right at that step, meaning if you use a function for a particular purpose all you need to know is that it does what you want and what arguments you need to provide it with. Another theory of learning, one that suits me better, is if I'm using that function, go ahead and tell me all about it, not just what it does in this example but what it can do more broadly. I found the explanations in that tutorial were OK for that tutorial, but I would have liked a clearer, more forward looking explanation of what was going on with the palette functions. The explanation was a little murky on that. I knew what I was doing, but a clearer, more concise, and more general/broadly applicable wording might have been nice.

This is called "Look them up in the reference".    There is a reference in the HuC doc directory.  It explains what the arguments are and what the functions do.

Quote
I didn't use the -s flag on HuC. It simply created a .s file in the directory with the .c, with no .pce anywhere to be found.

That means you don't have everything installed right and it couldn't find the PCEAS.exe to assemble.   Did you run this from a cmd window?  It should have told you something along those lines.

Quote
NM, I'm apparently supposed to path this shit, which is annoying because my path is already pretty large, but oh well.

welcome to programming/using command line programs/DOS/the 80s

Also, it helps to follow the HuC installation instructions properly, lol.

http://www.zeograd.com/parse.php?src=hucf&path=0,2,#installation
« Last Edit: April 29, 2012, 07:46:03 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.

spenoza

  • Hero Member
  • *****
  • Posts: 2751
Re: Playing with the ObeyBrew tutorials
« Reply #6 on: April 29, 2012, 08:32:36 AM »
They were called functions before there were classes about programming.   If you want others to understand what you may be talking about, you should use the right words for things like that.

You are correct, of course, but I couldn't resist the opportunity to be a little snarky. I think you inspire it in me.

Quote
This is called "Look them up in the reference".    There is a reference in the HuC doc directory.  It explains what the arguments are and what the functions do.

Yes, and I've found it somewhat helpful so far, although the write-ups aren't always beginner friendly. I do think the first tutorial could use a little tightening-up in the writing/explanation department, but it is sufficient. It seems there is a gap between the level of explanation in the tutorial and the function references. It goes from "total noob" to "hrm... I kinda get it, but I don't completely understand". There's some ground in the middle that simply isn't addressed by the documentation. Then again, this is not a commercial, professional language, and nobody is getting paid to fill in the blanks.

Quote
That means you don't have everything installed right and it couldn't find the PCEAS.exe to assemble.   Did you run this from a cmd window?  It should have told you something along those lines.

It didn't, oddly. It did tell me it couldn't find huc.h and some .asm file, so I copied all the files into a separate directory with huc.exe, and at that point it would run and generate a .s file, but it didn't tell me specifically what I needed beyond that.

Quote
welcome to programming/using command line programs/DOS/the 80s

Also, it helps to follow the HuC installation instructions properly, lol.

You know, even when I did Pascal in DOS I was doing it in Dr. Pascal, which was a pre-configured programming environment designed for learning Pascal. When I did Java in college I was using Code Warrior and working on my Mac (or on Windows in the classroom). I'm used to screwing around with DOS and the command line, but I've never used a DOS programming language like this, so this is very new to me. Thanks for the link. I already found it and set up my PATH variables, so everything compiles properly now, but if I hadn't found it on my own you would've saved my bacon.

I'm looking forward to doing more of the tutorials when I have time, and hopefully I can do something with what I'll have learned.
<a href="http://www.pcedaisakusen.net/2/34/103/show-collection.htm" class="bbc_link" target="_blank">My meager PC Engine Collection so far.</a><br><a href="https://www.pcenginefx.com/forums/" class="bbc_link" target="_blank">PC Engine Software Bible</a><br><a href="http://www.racketboy.com/forum/" c

spenoza

  • Hero Member
  • *****
  • Posts: 2751
Re: Playing with the ObeyBrew tutorials
« Reply #7 on: April 29, 2012, 09:15:17 AM »
This comment is not about the tutorials, but about programming languages in general. I hate the _ underscore character. It is in an annoying place on the keyboard, yet programming functions use it all the damn time. Drives me nuts.
<a href="http://www.pcedaisakusen.net/2/34/103/show-collection.htm" class="bbc_link" target="_blank">My meager PC Engine Collection so far.</a><br><a href="https://www.pcenginefx.com/forums/" class="bbc_link" target="_blank">PC Engine Software Bible</a><br><a href="http://www.racketboy.com/forum/" c

Arkhan

  • Hero Member
  • *****
  • Posts: 14142
  • Fuck Elmer.
    • Incessant Negativity Software
Re: Playing with the ObeyBrew tutorials
« Reply #8 on: April 29, 2012, 09:39:44 AM »

Yes, and I've found it somewhat helpful so far, although the write-ups aren't always beginner friendly. I do think the first tutorial could use a little tightening-up in the writing/explanation department, but it is sufficient. It seems there is a gap between the level of explanation in the tutorial and the function references. It goes from "total noob" to "hrm... I kinda get it, but I don't completely understand". There's some ground in the middle that simply isn't addressed by the documentation. Then again, this is not a commercial, professional language, and nobody is getting paid to fill in the blanks.
Get used to it.  The PCE / HuC docs in general leave a bit to be desired.  You have to take what you can get and roll with it basically.

Quote
You know, even when I did Pascal in DOS I was doing it in Dr. Pascal, which was a pre-configured programming environment designed for learning Pascal. When I did Java in college I was using Code Warrior and working on my Mac (or on Windows in the classroom).
Classrooms should have taught you how to setup and deal with the bare basics:  a text editor, a source file, and a compiler configured to run from the command line properly.

You have to learn to walk before you can run, basically.

It's not a DOS programming language, it's just a DOS program.  Or, it may be a Windows one (depending which one you got), but its still command line, and still requires you to set all of that up properly.


Its all going to seem confusing at first.  Check out zeograd.com for open sourced stuff people did over the years.  You can learn from alot of it.
[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.

spenoza

  • Hero Member
  • *****
  • Posts: 2751
Re: Playing with the ObeyBrew tutorials
« Reply #9 on: April 29, 2012, 10:03:48 AM »
Classrooms should have taught you how to setup and deal with the bare basics:  a text editor, a source file, and a compiler configured to run from the command line properly.

...

Its all going to seem confusing at first.  Check out zeograd.com for open sourced stuff people did over the years.  You can learn from alot of it.

Well, I did take Java at a school where they only had a couple computer science classes. It was a small, liberal arts place. Very highly ranked, unless you wanted to do, say, comp sci. Instructor chose CodeWarrior because it was cross platform. On the Mac (under OS 6 - 9) you never had to go command line, and that's what I used most of the time. In that context, in that classroom, it made complete sense not to deal with command line stuff. Were it a school that had a program and was teaching more than just Java then I very much agree. Hell, I got as far as a checkers program that wouldn't let you make invalid moves. Where I quit was trying to program a decent checkers AI (or really any checkers AI, because I wasn't going to write a crappy one), because I was a senior in my last semester and my international studies thesis was not going to write itself.

My problem was simply not reading the directions. That's all. Pretty simple mistake, and fortunately, easy to fix (though not necessarily at 2:30 AM). And yeah, I'm expecting it to be a little confusing. I'm not expecting it to be easy, any way, though it would be nice. Maybe when I'm more comfortable with HuC I'll explore a few little assembly routines as well. I'm willing to hand-code arrays if that'll make a big difference (and if that's what's ruining an otherwise great idea/implementation).
<a href="http://www.pcedaisakusen.net/2/34/103/show-collection.htm" class="bbc_link" target="_blank">My meager PC Engine Collection so far.</a><br><a href="https://www.pcenginefx.com/forums/" class="bbc_link" target="_blank">PC Engine Software Bible</a><br><a href="http://www.racketboy.com/forum/" c

Bonknuts

  • Hero Member
  • *****
  • Posts: 3292
Re: Playing with the ObeyBrew tutorials
« Reply #10 on: April 29, 2012, 11:57:05 AM »
Maybe when I'm more comfortable with HuC I'll explore a few little assembly routines as well. I'm willing to hand-code arrays if that'll make a big difference (and if that's what's ruining an otherwise great idea/implementation).

 The >> and << shift operators are also pretty slow. And the increased amount you shift by also increases (by a lot). I.e. var>>=3; is a lot slower than var<<=1; which is already slow to begin with. Makes it very slow for doing fixed point numbers. The compiler should be placing a simple shift macro (with a fast loop) into the code listing, but it doesn't.

soop

  • Hero Member
  • *****
  • Posts: 2828
Re: Playing with the ObeyBrew tutorials
« Reply #11 on: May 04, 2012, 12:46:13 AM »
Just as an aside, whenever I code, I like to do it in a basic text editor.  I hate it when something tries to second guess you, or add redundant code.  Admittedly, it's not like I'm coding more than a few hundred lines at a time, but still.

The only thing I quite like is when things add colours to your code, like VIM.

Arkhan

  • Hero Member
  • *****
  • Posts: 14142
  • Fuck Elmer.
    • Incessant Negativity Software
Re: Playing with the ObeyBrew tutorials
« Reply #12 on: May 04, 2012, 02:55:15 AM »
I use notepad++ for anything really.

Except for way-larger-projects, where I use VisualStudio2003.

[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.

spenoza

  • Hero Member
  • *****
  • Posts: 2751
Re: Playing with the ObeyBrew tutorials
« Reply #13 on: May 07, 2012, 12:30:41 PM »
I like Crimson Editor. Plain text editor that auto indents and colorizes common syntax. Works well with HuC, IMO.
<a href="http://www.pcedaisakusen.net/2/34/103/show-collection.htm" class="bbc_link" target="_blank">My meager PC Engine Collection so far.</a><br><a href="https://www.pcenginefx.com/forums/" class="bbc_link" target="_blank">PC Engine Software Bible</a><br><a href="http://www.racketboy.com/forum/" c

soop

  • Hero Member
  • *****
  • Posts: 2828
Re: Playing with the ObeyBrew tutorials
« Reply #14 on: May 15, 2012, 09:39:49 AM »
 I can't install HuC - I'm using this one http://www.zeograd.com/download_presentation.php?lang=en&id=312
does it work in Windows 7?  I'm trying to unpack it and click huc.exe.