artial
Deep Blooper
Posts: 25
Homebrew skills: Make it work
Fave PCE Shooter: Superstar soldier
Currently Playing: Micro Mages
|
Post by artial on Sept 26, 2020 16:00:24 GMT
I started to port a recent homebrew commercial cart NES game to PCE - with approval from the NES team.
I studied Chris Covell excellent tutorials, converted the NES graphic assets to PCE format and displayed them on PCE. From there I ported the HuC asm code to ca65 (syntax differences) because I have the NES source as ca65 ASM (32k of code compiled on the NES).
So far so good.
One question regarding banks - do the 32k code need to be splitted in 8k banks, with code banks mapped at runtime?
Thanks!
|
|
artial
Deep Blooper
Posts: 25
Homebrew skills: Make it work
Fave PCE Shooter: Superstar soldier
Currently Playing: Micro Mages
|
Post by artial on Sept 26, 2020 19:08:04 GMT
I guess it should be fine to use bank 0 / page 7 for start up code, then page 3 - 6 to map the 32k of game code in banks 1-4, then put the assets in further banks and map assets to page 2.
|
|
|
Post by dshadoff on Sept 26, 2020 20:28:36 GMT
It all depends on how much you need access to at one moment.
Conventionally, $0000-$1FFF (MMR0) is mapped to hardware, bank $FF $2000-$3FFF (MMR1) is mapped to scratch RAM, bank $F8 $E000-$FFFF (MMR7) is mapped/pinned to bank $00 (for paging and interrupt servicing)
Beyond this, data tends to be in "lower half" of the remaining area, and code in the "upper half", but it's variable.
But this is a classical model and if you're writing in assembler, the choices are more or less under your control.
|
|
|
Post by turboxray on Sept 27, 2020 15:36:07 GMT
I guess it should be fine to use bank 0 / page 7 for start up code, then page 3 - 6 to map the 32k of game code in banks 1-4, then put the assets in further banks and map assets to page 2. MPR 7 (page $f000) can be swapped out just like any other page, so if your NES game swaps out all upper 32k at a time then it'll be fine. I did this for my NES2PCE conversions that run on the PCE. For my regular PCE hucard projects, I tend to have a whole 8k bank just for boot, and then use a normalized bank for MPR 7.
|
|
|
Post by dshadoff on Sept 27, 2020 15:46:29 GMT
If you do that, be conscious of how you will service interrupts (if you are using them), as the system checks CPU-mapped location $FFFx for the vectors.
I don’t recall whether zero page and the stack are mapped to CPU-mapped $20xx and $21xx pages (or absolute memory locations $F8:00xx and $F8:01xx), but if that segment remains mapped as suggested, you won’t need to know.
|
|
artial
Deep Blooper
Posts: 25
Homebrew skills: Make it work
Fave PCE Shooter: Superstar soldier
Currently Playing: Micro Mages
|
Post by artial on Sept 27, 2020 21:07:37 GMT
thanks for the suggestions - the whole nes code compiles under 32k so i put it on page 3 to 6 at leat for now it seems to do the job.
So far i only used mednafen, is there a PCE debugger that can takes labels like FCEUX for nes?
|
|