Hello, I'm trying to get my game up and running in this new version of HuC (previously used a fork of Uli's) but I'm having problems. I'm trying one commit at the time.
...
The game however is just completely broken when running in Mednafen. I guess I will have to try all commits in-between (which doesn't compile due to the farptr error above) to find which commit is actually breaking my game.
Thanks for giving the new compiler a try!
To be honest ... I don't think that you're going to have much luck going commit-by-commit and looking for a problem.
farptrs were horribly broken in Uli's HuC because of his excellent "symbol + offset" optimization, which you're invoking there with your "set_map_data(
pce_ep1_map00 + 4, 32, 32);" line.
My early attempts to understand the code and figure out what was wrong sometimes caused other problems.
As far as I know, things are fixed now, but if you've found another corner-case that I'm not correctly dealing with, then I'll need to see some kind of example so that I can track down the problem.
And finally this commit introduces an assemble error that is still present in the HEAD commit:
commit: Change System Card variables in "equ.inc" to use a "__" prefix. 11/16/2016 08:15 John Brandwood
1> #[1] game.s
1> 2073 16:A8FF stx __ax
1> Undefined symbol in operand field!
1> 2073 16:A902 sta __ax+1
1> Undefined symbol in operand field!
1> 2075 16:A909 stx __cl
1> Undefined symbol in operand field!
1> 2082 16:A91A stx __dl
1> Undefined symbol in operand field!
1> 2084 16:A921 stx __di
1> Undefined symbol in operand field!
1> 2084 16:A924 sta __di+1
1> Undefined symbol in operand field!
1> 2096 16:A934 stx __al
1> Undefined symbol in operand field!
1> 2097 16:A939 sty __bl
1> Undefined symbol in operand field!
1> 2097 16:A93E sty __si
1> Undefined symbol in operand field!
1> 2097 16:A943 sty __si+1
1> Undefined symbol in operand field!
1> 2099 16:A94A stx __cl
1> Undefined symbol in operand field!
1> 2103 16:A954 stx __al
Not sure what the last one is about. Any pointers?
Errrr ... yes.
Uli changed the names of the system variables from the old HuC's single underscore "_ax" to just "ax".
He did that so that the system variables don't conflict with variables that you create in HuC (which automatically have a single underscore added to them in C).
But in doing that, he just made them conflict with variable names that you declare assembly code, and made them inaccessible to C code.
What I did was to rename them all with a double_underscore, which follows standard C practice of using a leading underscore in C for system/compiler variables, so "_ax" in C code becomes "__ax" in PCEAS after the C compiler has added its extra underscore to it.
Then in any assembly code, you use the "__ax" name.
If you're getting compiler errors like that, then it sounds like you're not using the complete new HuC package, and you're missing the variable declarations in equ.inc
Are you writing in pure HuC, or are you including your own assembly-language source files?
Are you using in-line assembly in the HuC source?
Are you providing your own headers?