CROSS CHASE massively cross-platform 8-bit game
Page 1 of 1

Author:  Fabrizio Caruso [ Thu Nov 09, 2017 7:19 am ]
Post subject:  CROSS CHASE massively cross-platform 8-bit game


I am developing the massively cross-platform simple game CROSS CHASE written in ANSI C:

The game is supposed to run on ANY 8 bit computer/console/handheld from the 70s and 80s (using either the Motorola 6809, the MOS 6502, the Zilog Z80 or their derivatives). "ANY" = any system with enough memory and display size for which an ANSI C compiler exists.
It currently supports about 40 different systems and about 60 configurations (e.g., expanded memory, expanded display, etc.).
I am using CMOC/WinCMOC (6809), CC65 (6502), Z88DK (Z80) and lots of other tools.

REMARK: The project is not a collection of ports. All versions are supposed to be generated by the very same code except in some cases for a few bits for sound and graphics. This is achieved through abstractions and macros.

For the PCEngine I am blocked by the linker configuration in CC65 because I don't know how to configure the linker so that I can have more than 8k of available memory for my code. Who could help?? Should I open a thread somewhere else on this forum?

For the NES I have made a fully working and playable prototype, which is currently only using black and white because of lack of support in the conio library in CC65. I will have to use some lower level routines to produce better graphics.

Author:  tepples [ Thu Nov 09, 2017 8:42 am ]
Post subject:  Re: CROSS CHASE massively cross-platform 8-bit game

The license

The license of this repository is the license of zlib with an added non-commercial clause:

Permission is granted to anyone to use this software for non-commercial applications
If you use this software in a product

Apart from the belief among some analysts that noncommercial clauses are considered harmful (see opinion articles by Richard Stallman, Eric S. Raymond, Eric Moeller, Joris Pekel), this appears to contradict itself.

Your question: Memory mapping

I've never programmed for the TG16, but I have shipped a commercial game using (a clone of) MMC3. So what I'm about to write is extrapolation from how ld65 is used with NES mappers, combined with the article "PC Engine Memory Mapping".

Like the MMC3, FME-7, and VRC7 mappers on the NES, the HuC6280 CPU's built-in MMU divides the 64 KiB address space into 8 KiB windows. But unlike NES mappers, which fix particular windows to particular banks, the HuC6280 makes all eight windows switchable, calling them MPR0 through MPR7. They're mapped as follows:

  • MPR0 ($0000): I/O (bank $FF)
  • MPR1 ($2000): RAM (bank $F8)
  • MPR2 ($4000) through MPR6 ($C000): ROM (banks $01 through $F7)
  • MPR7 ($E000): ROM home bank (bank $00)

Perhaps the easiest way to proceed is to put your C code in $4000-$DFFF (40 KiB).

So here's an untested linker configuration file. It offers a fixed bank at $E000 (.segment "LOWCODE") for startup code and assembly language I/O routines, two 8 KiB banks at $4000 (.segment "BANK1" and .segment "BANK2") for things like tile data that only the I/O routines need to access, and a 40 KiB continuous area at $4000-$DFFF for your C code.

# 512 kbit HuCard linker script
# Copyright 2017 Damian Yerrick
# Copying and distribution of this file, with or without
# modification, are permitted in any medium without royalty
# provided the copyright notice and this notice are preserved.
# This file is offered as-is, without any warranty.
  ZP:     start = $10, size = $f0, type = rw;
  # use first $10 zeropage locations as locals
  HEADER: start = 0, size = $0010, type = ro, file = %O, fill=yes, fillval=$00;
  RAM:    start = $2200, size = $1E00, type = rw;
  ROM0:   start = $E000, size = $2000, type = ro, file = %O, fill=yes, fillval=$FF, bank=0;
  ROM1:   start = $4000, size = $2000, type = ro, file = %O, fill=yes, fillval=$FF, bank=1;
  ROM2:   start = $4000, size = $2000, type = ro, file = %O, fill=yes, fillval=$FF, bank=2;
  ROM37:  start = $4000, size = $A000, type = ro, file = %O, fill=yes, fillval=$FF, bank=3;

  ZEROPAGE: load = ZP, type = zp;
  BSS:      load = RAM, type = bss, define = yes, align = $100;

  # Fixed bank segments
  LOWCODE:  load = ROM0, type = ro, align = $100;
  STARTUP:  load = ROM0, type = ro, align = $100, optional = yes;
  ONCE:     load = ROM0, type = ro, align = $100;
  VECTORS:  load = ROM0, type = ro, start = $FFF6;

  # Auxiliary segments
  BANK1:    load = ROM1, type = ro, align = $100, optional = yes;
  BANK2:    load = ROM2, type = ro, align = $100, optional = yes;

  # Main C code segments
  CODE:     load = ROM37, type = ro, align = $100;
  RODATA:   load = ROM37, type = ro, align = $100;

  %O: format = bin;

The startup code is then responsible for setting the MPRs to [$FF, $F8, $03, $04, $05, $06, $07, $00] before the C code runs.

Author:  Fabrizio Caruso [ Thu Nov 16, 2017 2:16 pm ]
Post subject:  Re: CROSS CHASE massively cross-platform 8-bit game

Thanks for your reply!

Unfortunately my understanding of what I need to do other than just using your proposed cfg file is very limited.

Am I supposed to write some startup code myself? I have no idea how to select the banks.

I only need 16k to get my game to work on the NES.

Why can't I just add

ROM37: start = $4000, size = $A000, type = ro, file = %O, fill=yes, fillval=$FF;


CODE: load = ROM37, type = ro;

What are the options bank=0/1/2/3 used for? Are they necessary?

Author:  OmegaMax [ Sat Nov 18, 2017 11:37 am ]
Post subject:  Re: CROSS CHASE massively cross-platform 8-bit game

There is a pce development thread on these forums

Author:  tepples [ Sat Nov 18, 2017 1:22 pm ]
Post subject:  Re: CROSS CHASE massively cross-platform 8-bit game

From your link:
Only registered members are allowed to access this section.
Please login below or register an account with

From the registration form:
This connection is not secure. Logins entered
here could be compromised. Learn More

The registration form appears to display through HTTPS, but none of the theme graphics display. I wasn't able to verify that the form actually submits and allows me to register in the time that I had allotted to test the form.

Page 1 of 1 All times are UTC - 7 hours
Powered by phpBB® Forum Software © phpBB Group