An FUZIX target for ZX Spectrum 128.
-This is mid rework as a banked platform test be warned.
-
-The new memory layout looks like this
-
-
-0000-3FFF ROM (we hack it a bit to allow for our RST and IRQ vectors
- but in theory we can avoid that)
+0000-3FFF Fixed BASIC ROM
4000-7FFF Kernel data, common read/write space, constants, common read
only, plenty of space
8000-BFFF _DISCARD area - blown away when we exec init
processes but leaves us with common at 0x4000 so its tight below 0x8000
The other half of the problem on the ZX Spectrum128 is the fact binaries
-must be linked with a different base (0xC000 for 16K, 0x8000 for 32K).
-
-
-
-
-
+must be linked with a different base (0xC000 for 16K, 0x8000 for 32K) so
+we need to sort out relocatables
Big part of the code was taken from z80pack and msx1 ports.
ZX Spectrum has a memory layout like follows:
0000-3FFF ROM
-4000-57FF Screen pixel data
+4000-57FF Screen pixel data (movable into bank 7 on the 128K)
5800-5AFF Screen attributes data
5B00-FFFF RAM
-1 memory bank exists at 0xC000, one of 6 16384-byte pages can be mapped there.
+1 memory bank exists at 0xC000, one of 6 16384-byte pages can be mapped there
+on the 128.
+
+TODO:
-So the fuzix port is limited to those features:
+Use IM2 so we can capture timer interrupts correctly. This is a hack but
+it's necessary and is also how all the spectrum games do it.
-1) Code1 segment should be flashed into ROM (instead of BASIC-128 in a simplest case).
-2) We have memory "hole" at screen area (4000-5AFF), which we can not use for code or data.
- So we can not allow Code1 to be larger than 0x4000 bytes.
-3) We need to store some bootloader procedure in Code1, which should read fuzix image
- data from somewhere (for now this is done via emulator hack) and place it in RAM at
- correct addresses.
-4) Common area can not be at F000 as usual because F000 belongs to banking area.
-5) Maximum user program size is 16384 bytes.
-6) ZX Spectrum 128 had not any official floppy disk controller. Third-party hardware
- (like popular in Eastern Europe Betadisk Interface) was designed to be compatible
- with old software, so contains some terrible features like FDC port visibility
- limited to 256-bytes long area of ROM. Outside this area any requests to FDC ports
- are ignored. This makes disk driver implementation very tricky until we have more
- smart linker.
\ No newline at end of file