[cc65] pcengine port problem...

Date view Thread view Subject view

From: Groepaz (groepaz_at_gmx.net)
Date: 2003-09-28 02:13:14


tjam, i've looked into my pcengine port again and indeed found the little 
nasty problem that caused the weirdo crashing :=P

i have to explain.... the pcengine uses a (imho very smart) way to do 
bankswitching ... some i/o stuff is mapped over the zeropage, and memory 
vs i/o access is distinguished by the actual opcode used for the access... eg

lda $0001 (3 byte opcode, absolute addressing) accesses the i/o area and
lda $01 (2 byte opcode, zeropage addressing) accesses the memory in zeropage.

this has a drawback however, which is that memory in the zeropage can ONLY be 
accessed by zeropage-addressing, which means that for example the "callax"
function (which uses an indirect jump, using a vector in zeropage) fails 
miserably as it is (there is no indirect jump with zeropage addressing) :=P

now the question is what other library functions may suffer from this problem 
(i am going to create alternative versions for the pcengine port).... its 
easy to grep the source for indirect jumps, but any other memory access (ie 
zeropage access that ends up to be done via 3 byte opcodes) is kindof hard to 
locate :/ (maybe a warning can be added to help locating them?)

gpz

ps: mmh... i dont think thats possible cleanly myself, but if you think 
there's a better solution than providing alternative versions of the runtime 
library stuff, let me know :) - it might become just a little bit worse than 
with the nes though :=P

----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo_at_musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.


Date view Thread view Subject view

This archive was generated by hypermail 2.1.3 : 2003-09-28 02:18:09 CEST