News:

Upgrading to the new 2022 2.1 SMF core (years in WIP)! Mobile/Phone support by default, finally! I must port all my custom features and redo the theme however, but worth the trouble! I may still look at XenForo too.

Main Menu

[CC65][linker][help] How can I configure CC65's linker to build PCE roms > 8k

Started by Fabrizio Caruso, February 06, 2018, 07:53:18 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Fabrizio Caruso

Hi everyone!

I am developing CROSS CHASE,
https://github.com/Fabrizio-Caruso/CROSS-CHASE
which is a universal 8 bit game for ALL 8-bit computer/consoles/handhelds. The very SAME code is used for about 100 different targets.


For targets with the 6502 CPU (and derivaties) I am using CC65.
For the PCEngine I have not been able to get it to build any rom bigger than 8k.
Currently I can get a working build if I use 8k in $E000-$FFFF.

Could someone please help me on this?

  Fabrizio

Fabrizio Caruso


elmer

Quote from: Fabrizio Caruso on February 06, 2018, 07:53:18 AMFor targets with the 6502 CPU (and derivaties) I am using CC65.

For the PCEngine I have not been able to get it to build any rom bigger than 8k.
Currently I can get a working build if I use 8k in $E000-$FFFF.

Could someone please help me on this?
See here ...

https://www.pcengine-fx.com/forums/index.php?topic=18654.msg448587#msg448587

But, after further investigation ...

I *really* don't recommend using CC65 on the PCE at this point, because the compiler and assembler really don't like that our PCE's HuC6280 processor has zero page at $2000 instead of $0000.

Also, their PCE library support was woeful the last time I looked.

They've been mulling-over how to fix CA65 for nearly 9 months now, and the trail has gone dead.


That's why I started putting so much effort into fixing up and improving HuC instead.

ccovell

Quote from: elmer on February 08, 2018, 04:13:10 PMI *really* don't recommend using CC65 on the PCE at this point, because the compiler and assembler really don't like that our PCE's HuC6280 processor has zero page at $2000 instead of $0000.
Is the compiler/assembler actually referencing ZP as word addresses each time?  :/

elmer

Quote from: ccovell on February 08, 2018, 07:47:44 PMIs the compiler/assembler actually referencing ZP as word addresses each time?  :/
If a label is tagged as a ZP label, then (IIRC) it will usually use ZP addressing ... except inside procedures, when all the rules change because nested label space handling is horribly broken in CA65.

BUT ... any label in $00xx range is automatically addressed as ZP if possible, and anything in our $20xx range is word-addressed.

I proposed a couple of quick-hack workarounds ... but they would still break in nested label spaces.

CA65 needs some serious work ... and the current maintainers are treating the source code like the Holy Grail.

Another reason for me to mess with HuC ... it *can* be messed with, and the only reason that its code sometimes sucks vs CC65, is because of specific CC65 peephole optimizations that could (not trivially, but with some work) be applied to HuC.

Both compilers are based off of Ron Cain's original Small C.

Gredler

Good to see you back around these parts Elmer, hope all is going well with you sir.

I have such little knowledge on this I didn't want to chime in, but I also wanted to say that Elmer would know whats up and that last I heard CC65 was a dead end and your efforts on HuC were due to that rabbit hole avoidance.