I would have two questions...
a) how to start a .p game from ROM?
b) What is the memory configuration in case of 32kB of internal/external RAM expansion?
Let me elaborate a bit:
a) what I do is that I allow to execute all the BOOT initialization code of the ZX81 and stop execution before going to UPPER. Then I load the .p byte stream to $4009 and continue with a SLOW/FAST call (well, before that call I have to push $0676 into stack, set $4000 to $FF and $4001 to $80 - this is what I saw in the emulator during normal LOAD). Unfortunately this works with some games, but doesn't with some others (jbracing - I'm not sure if this is the case because of my faulty WRX implementation or because of the faulty RUN implementation).
b) Let's say we have 2x16 kB RAM block. The first 16kB is mapped to $4000 to $7FFF. I know that reading in the /M1 phase (T1 and T2) the CPU must get the values from $4000-$7FFF when reading $4000-$FFFF. Also, the RAM must return valid data during /RFSH. But from where? When the CPU accesses $8000-$BFFF shall it read the first or the second 16kB? And in $C000-$FFFF the CPU always get the values from $4000-$7FFF?
This could be one possible solution. Is there any reason to do it differently?
Code: Select all
\phase||T1-T2 (/M1)|T3/T4 (/RFSH)|/RD or /WR (after T4)|
accessing\ ++-----------+-------------+---------------------+
$4000-$7FFF||$4000-$7FFF| $4000-$7FFF | $4000-$7FFF |
$8000-$BFFF||$4000-$7FFF| $8000-$BFFF | $8000-$BFFF |
$C000-$FFFF||$4000-$7FFF| $8000-$BFFF | $4000-$7FFF |