Author Topic: Stupid @#$@!# HuC hit another imaginary limit.  (Read 408 times)

DarkKobold

  • Hero Member
  • *****
  • Posts: 1200
Stupid @#$@!# HuC hit another imaginary limit.
« on: November 05, 2016, 12:03:10 PM »
So, I was coding in HuC, and I hit some new imaginary limit. Essentially, I've hit a limit to either the number of functions, or total function size that I can write. Essentially, what happens, is if I add in all my code, the game "freezes" and nothing happens on start up. If I delete any function, and replace it with empty code, the code compiles and works fine. The ROM is only at 350ish KB right now, and I thought I could go as high as 1MB.

I've hit some sort of programming limit, that has killed my ability to make progress.

Hey, you.

megatron-uk

  • Full Member
  • ***
  • Posts: 219
Re: Stupid @#$@!# HuC hit another imaginary limit.
« Reply #1 on: November 05, 2016, 12:26:21 PM »
Remember that all your code and data needs to fit in 8KB banks that the PCE maps in and out as needed.

Perhaps you have a function that is so large it is over the size of an 8KB bank?

One thing I tried previously was re-arranging the order of my functions, so that when assembled they fit in different banks. That might help? I don't know if the compiler and assembler is smart enough to do that by default?

DarkKobold

  • Hero Member
  • *****
  • Posts: 1200
Re: Stupid @#$@!# HuC hit another imaginary limit.
« Reply #2 on: November 05, 2016, 12:32:09 PM »
Remember that all your code and data needs to fit in 8KB banks that the PCE maps in and out as needed.

Perhaps you have a function that is so large it is over the size of an 8KB bank?

One thing I tried previously was re-arranging the order of my functions, so that when assembled they fit in different banks. That might help? I don't know if the compiler and assembler is smart enough to do that by default?

I've exceeded the 8kb bank limit before. HuC at least warns you about that. This seems... different. The code just straight up won't run.
Hey, you.

Gredler

  • Guest
Re: Stupid @#$@!# HuC hit another imaginary limit.
« Reply #3 on: November 08, 2016, 06:37:28 AM »
DK is there more info you can provide? I wonder if cleaning up the directories and combing through the combined code a bit would reveal something? Scary to hear this is a straight up blocker, I wonder if the new branch of HuC will help?

Sunray

  • Newbie
  • *
  • Posts: 18
Re: Stupid @#$@!# HuC hit another imaginary limit.
« Reply #4 on: November 08, 2016, 07:20:16 AM »
I hit the max number of structs (32) pretty quickly in Ulis HuC. I bumped the constant and recompiled, works! Might be that simple for the function limit as well, although I have a lot of functions and no problem yet.
« Last Edit: November 08, 2016, 10:41:24 PM by Sunray »

elmer

  • Hero Member
  • *****
  • Posts: 2153
Re: Stupid @#$@!# HuC hit another imaginary limit.
« Reply #5 on: November 08, 2016, 10:58:07 PM »
So, I was coding in HuC, and I hit some new imaginary limit. Essentially, I've hit a limit to either the number of functions, or total function size that I can write. Essentially, what happens, is if I add in all my code, the game "freezes" and nothing happens on start up. If I delete any function, and replace it with empty code, the code compiles and works fine. The ROM is only at 350ish KB right now, and I thought I could go as high as 1MB.

Do you run your game in Mednafen, or some other emulator with a debugger?

If so, you've hit the the time for some serious debugging! Mednafen's Trace Log and the listing file from HuC should give you a fighting chance of figuring out where things go off-the-rails.

sirhcman

  • Guest
Re: Stupid @#$@!# HuC hit another imaginary limit.
« Reply #6 on: November 11, 2016, 01:23:28 AM »
Did you ever figure this out DarkKobold?

Arkhan

  • Hero Member
  • *****
  • Posts: 14142
  • Fuck Elmer.
    • Incessant Negativity Software
Re: Stupid @#$@!# HuC hit another imaginary limit.
« Reply #7 on: November 14, 2016, 01:27:51 PM »
 

Is it ANY function , or only some that cause the game to start working?   If you replace the contents of the functions with literally nothing, it starts working?

How many functions do you have?




Check your listing file and see if HuC has done something strange and jammed something overtop of something else?
[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.