Author Topic: Look Up Tables in HuC?  (Read 1887 times)

DarkKobold

  • Hero Member
  • *****
  • Posts: 1200
Re: Look Up Tables in HuC?
« Reply #15 on: April 02, 2016, 05:10:11 PM »
I've worked with array access in HuC and have made fast access functions to help with this kind of problem. This stuff was trivial for me a couple of years back, but I'm sure I can jump right back into it.

 Is your problem speed? Or size limitation? Or both? I'm pretty limited on time right now, but if you're serious about this then PM me and I'll make time to help you with some custom made functions for your HuC project.

This was solely due to the fact that array access is faster with chars, but my arrays for level data are going to quickly exceed 256 bytes.

That said, I may take you up on your offer at some point soon, especially with increasing the speed of my tile collision routine. Its going to get many executions per frame, and if my code slows down, it will most likely be the culprit. I've just started coding the main game play part, rather than working on just the boss battles. Its turning out to be the most difficult, which probably isn't surprising.
Hey, you.

Bonknuts

  • Hero Member
  • *****
  • Posts: 3292
Re: Look Up Tables in HuC?
« Reply #16 on: April 03, 2016, 07:29:19 AM »
Just out of curiosity, how big do you think your index value would be into this array?

 Yeah, at some point array or pointer access is going to slow you down. The way HuC generates array and pointer code (which is always FAR access btw, even if the memory is fixed-near), is pretty bloated and slow. I use pragma fastcalls to make assembly functions which can return any type of data you need. Pragma fastcall even allows argument overloading so you can do something like GetByte(ptr, var) or var=GetByte(ptr) with the same custom function. Or whatever. You can easily customize it if you know you need to get a string of data or sequential elements. Things like that.

Arkhan

  • Hero Member
  • *****
  • Posts: 14142
  • Fuck Elmer.
    • Incessant Negativity Software
Re: Look Up Tables in HuC?
« Reply #17 on: April 18, 2016, 05:25:15 PM »
Not to mention, using arrays in conditional checks generates some awful lookong code.

Iirc, they both use x so theres lots of gooning around.

I found its ok to set arrays up in c, and then access and use them in assembly.

I tend to write in c and hand optimize problem spots after i bang out more important shit, like AI, and actual gameplay

Sent from my D6708 using Tapatalk

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

Bonknuts

  • Hero Member
  • *****
  • Posts: 3292
Re: Look Up Tables in HuC?
« Reply #18 on: May 01, 2016, 03:22:53 PM »
Not to mention, using arrays in conditional checks generates some awful lookong code.

Iirc, they both use x so theres lots of gooning around.

I found its ok to set arrays up in c, and then access and use them in assembly.

I tend to write in c and hand optimize problem spots after i bang out more important shit, like AI, and actual gameplay

Sent from my D6708 using Tapatalk


 I wonder if I could get credit for "independent study" course if I worked on HuC. Heh.

Gredler

  • Guest
Re: Look Up Tables in HuC?
« Reply #19 on: May 01, 2016, 04:40:21 PM »


Not to mention, using arrays in conditional checks generates some awful lookong code.

Iirc, they both use x so theres lots of gooning around.

I found its ok to set arrays up in c, and then access and use them in assembly.

I tend to write in c and hand optimize problem spots after i bang out more important shit, like AI, and actual gameplay

Sent from my D6708 using Tapatalk


 I wonder if I could get credit for "independent study" course if I worked on HuC. Heh.

Let's work it out man, can I help? I can contact your school if needed. Huc needs your love and support!!! ;)

TheOldMan

  • Hero Member
  • *****
  • Posts: 958
Re: Look Up Tables in HuC?
« Reply #20 on: May 01, 2016, 08:59:00 PM »
Quote
I wonder if I could get credit for "independent study" course if I worked on HuC. Heh.

Probably. That's how Insanity started....

Arkhan

  • Hero Member
  • *****
  • Posts: 14142
  • Fuck Elmer.
    • Incessant Negativity Software
Re: Look Up Tables in HuC?
« Reply #21 on: May 04, 2016, 01:11:03 PM »
Not to mention, using arrays in conditional checks generates some awful lookong code.

Iirc, they both use x so theres lots of gooning around.

I found its ok to set arrays up in c, and then access and use them in assembly.

I tend to write in c and hand optimize problem spots after i bang out more important shit, like AI, and actual gameplay

Sent from my D6708 using Tapatalk


 I wonder if I could get credit for "independent study" course if I worked on HuC. Heh.

What OldMan said.

I turned alot of this crap into college credit at the time. 

Turns out dicking off on my own, and with OldMan, was more educational than college was.
[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.

Gredler

  • Guest
Re: Look Up Tables in HuC?
« Reply #22 on: May 04, 2016, 02:48:01 PM »
Not to mention, using arrays in conditional checks generates some awful lookong code.

Iirc, they both use x so theres lots of gooning around.

I found its ok to set arrays up in c, and then access and use them in assembly.

I tend to write in c and hand optimize problem spots after i bang out more important shit, like AI, and actual gameplay

Sent from my D6708 using Tapatalk


 I wonder if I could get credit for "independent study" course if I worked on HuC. Heh.

What OldMan said.

I turned alot of this crap into college credit at the time. 

Turns out dicking off on my own, and with OldMan, was more educational than college was.

The personal projects and Internet collaborations I did in college werrt as important and educational as my curriculum in college, for sure. I was not wise enough to seek class credit for if, but sounds like I should have :P

NightWolve

  • Hero Member
  • *****
  • Posts: 5277
Re: Look Up Tables in HuC?
« Reply #23 on: May 05, 2016, 04:49:38 AM »
I tend to write in c and hand optimize problem spots after i bang out more important shit, like AI, and actual gameplay
I wonder if I could get credit for "independent study" course if I worked on HuC. Heh.
What OldMan said.

I turned alot of this crap into college credit at the time. 

Turns out dicking off on my own, and with OldMan, was more educational than college was.

I thought OldMan was joking, but that's cool! I could see it I guess, I remember a guy I ran into that was graduating before me had written a blackbook app for DOS all in "C". He gave me the source to help me learn a few things. So building apps or games as a final project of your choice in the language the class was taught in could be done if the format allows. I took a Compiler Theory class for needed credits which ended with building a minimal Pascal-compiler, even gave it a GUI using Borland C++, so a standard course like that is made-to-order to try to fit HuC into it somehow.

So yeah, it's possible he could work it into a class where the teacher lets you to choose your own final project in a way. But this was back before the transitioning years from "C" to Java, where courses were still taught in it with related books. At least for my university, they started to feel that Java was the end-all-be-all future, so C/C++ was being dumped/phased out in favor of it - nowadays it'd have to be in Java there, whatever you do... I got the benefit of all during the transition, started in C, some C++, Visual Basic 4/5 (special studies course), and some Java towards the end. Oh yeah, I took an 8086 Intel Assembly course as well. And my Physics minor actually allowed for studying with a Motorola MC6800 in one case.
« Last Edit: May 05, 2016, 06:28:22 AM by NightWolve »

Arkhan

  • Hero Member
  • *****
  • Posts: 14142
  • Fuck Elmer.
    • Incessant Negativity Software
Re: Look Up Tables in HuC?
« Reply #24 on: May 05, 2016, 05:10:00 AM »
Yeah, that semester, i signed up for compiler design, and computer number theory.

They cancelled the classes because noone else signed up.

I was already fiddling around with pce, so i basically went over oldmans and was like SHOW ME THINGS.

Then i filled out the forms to turn it into a class.

It was a funny coincidence that i was messing with pce, and oldman happened to be a fan. 

If i picked c64, this all may have been less exciting

Sent from my D6708 using Tapatalk

[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: Look Up Tables in HuC?
« Reply #25 on: May 05, 2016, 05:56:15 AM »
It was actually all pretty funny. He did Insanity for the spring semester, and mentioned that it would be neat if he could put it on CD and sell it.
He was really surprised when I pulled out some old bootlegs I made: Space Invaders, one of the Macross games, and Dracula X. Then we spent the entire summer learning the CD-system, adding music (and voices) and of course figuring out how to make a CD.
I never expected he would actually get it made and sell it.

BTW, Arkhan wasn't the first guy who asked me for help writing a game. He was just the only one who was willing to do the actual work (rather than say "It needs to do this" and expecting me to make it happen).

Bonknuts

  • Hero Member
  • *****
  • Posts: 3292
Re: Look Up Tables in HuC?
« Reply #26 on: May 05, 2016, 04:41:25 PM »
Lol - I hate you guys already! I wish someone in my family was like that. I didn't even know of anyone that programmed; family, friends, random arse people.

 But yeah, that's pretty awesome. 

Quote
Then i filled out the forms to turn it into a class.
Was it independent study credit, or actual course requisite that you got credit for? Aren't you working on your CS master's degree? How's that going?

 A bit off topic, but I learned that my university offers a CS:BA and CS:BS degree program. The BA is terminal of course, it's weird that they don't officially list it. I've been asking around and some other universities offer the same thing. It's lighter on math requirement, and don't need as many in depth upper division classes. I'm going the BS route and hopefully grad school, but I thought it was interesting.

Bonknuts

  • Hero Member
  • *****
  • Posts: 3292
Re: Look Up Tables in HuC?
« Reply #27 on: May 05, 2016, 08:38:23 PM »
So yeah, it's possible he could work it into a class where the teacher lets you to choose your own final project in a way. But this was back before the transitioning years from "C" to Java, where courses were still taught in it with related books. At least for my university, they started to feel that Java was the end-all-be-all future, so C/C++ was being dumped/phased out in favor of it - nowadays it'd have to be in Java there, whatever you do... I got the benefit of all during the transition, started in C, some C++, Visual Basic 4/5 (special studies course), and some Java towards the end. Oh yeah, I took an 8086 Intel Assembly course as well. And my Physics minor actually allowed for studying with a Motorola MC6800 in one case.

 The first course is Java, but from what I've seen of the course descriptions, C++ is definitely required for some classes. I've read that most system level code is still C (instead of C++), so I'm assuming that'll be for some upper division classes as well (OS, compiler, etc).

Arkhan

  • Hero Member
  • *****
  • Posts: 14142
  • Fuck Elmer.
    • Incessant Negativity Software
Re: Look Up Tables in HuC?
« Reply #28 on: May 09, 2016, 03:18:08 PM »
Lol - I hate you guys already! I wish someone in my family was like that. I didn't even know of anyone that programmed; family, friends, random arse people.

 But yeah, that's pretty awesome. 
Yeah, I got a little lucky that OldMan also likes the Turbo.   Having two people interested in the same thing is a good way for shit to actually get done.   

I had originally started ideas for Insanity on the C64 in BASIC/ASM using the goofy programmer reference guide, and one of those "how to make arcade games" books.

but, the C64 community is a bunch of insufferable f*cking morons, so I saw myself out.

Quote
Was it independent study credit, or actual course requisite that you got credit for? Aren't you working on your CS master's degree? How's that going?
Independent Study.  It counted as an elective for my degree.  You needed like, 20 credits of electives, or something.   Insanity became relevant coursework.   

I finished my masters like 3 years ago. 


Quote
A bit off topic, but I learned that my university offers a CS:BA and CS:BS degree program. The BA is terminal of course, it's weird that they don't officially list it. I've been asking around and some other universities offer the same thing. It's lighter on math requirement, and don't need as many in depth upper division classes. I'm going the BS route and hopefully grad school, but I thought it was interesting.

What do BA and BS even stand for.

I essentially double majored in CS and math.   I also discovered that many college students going for CS are complete f*cking tools and have no actual interest in anything other than getting done.   It's a joke.

the professors are all generally tenured, lazy goons.  That doesn't help.

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

Bonknuts

  • Hero Member
  • *****
  • Posts: 3292
Re: Look Up Tables in HuC?
« Reply #29 on: May 10, 2016, 04:27:23 AM »
BA= bachelors of Arts. BS = bachelors of Science.