Any help you can provide to simplify running on the SAM would be much appreciated. I have patches for v1.07 that already make the game fully playable. The changes remap the second 128K screen location and support 128K paging. I haven't yet converted the sound effects from AY to SAA chip or changed the tape routines to use disk instead.
Many of my code patches are to change the second screen address from &C000 to &0000. This was needed to keep the second display at a location in internal RAM as the upper 32K is using external memory to support the 128K paging configuration. Your code already has functions for changing between screen 0 and 1 but I had to change some of the code as well as the values. Places that use OR to add bit 7 were changed to use XOR to toggle bit 6 instead. SET 7,r instructions were converted to RES 6,r, etc. There are some tricky CP H;JR C instructions that I need to patch during gameplay too. I can provide details of where I've patched but you probably have a much better idea from the source code. If your official code supported screen 1 at address &0000 as well as &C000 it would eliminate many of my patches.
Another area I changed was the 128K paging. I was able to change the OUT (C),A in many places to OUT (HEPR),A to write to a SAM paging port. I'm using banks &10 to &17 to be compatible with the values written to the 128K paging ports. One extra change I made was the screen selection bit, which is &08 on the Spectrum 128. I changed it to &10 so ORing the value with the 128K page has no effect, since SAM doesn't use the same port for changing the display. This required a couple of code changes to adapt to the new value. I can provide more details of these patches if you're interested.
Similar to the paging I had to change places that update the display to change the SAM display page. This was too big to patch inline so I'm patching a call to a routine that does the work. It uses the same screen selection bit as your code to decide which page to select.
The changes above are enough to have the game fully playable, but I was hoping to make some extra SAM improvements:
The SAM Coupé support line interrupts, which can generate an interrupt before a specific line on the main screen. I hoped to use this to keep the panel display at &5000, avoiding the expensive 2K+ copy from screen 0 to screen 1 every 2nd frame. However, if interrupts are disabled at this point in the TV scan the wrong page is viewed and the contents flicker. I know interrupts are disabled during the screen clear using the stack, and I wondered if it was possible to do this just after a HALT so interrupts are re-enabled before the TV scan reaches the interrupt point by the panel. I've not yet tried experimenting with this using patches.
A dream for SAM users has always been to use display mode 2 for the Elite display. This is similar to the 8x1 mode used by the Timex and Pentagon systems, which have a separate attribute byte for each screen byte. The display memory is a linear line layout with attributes 8K after the display bytes. This gives 2K free after the display data and 2K free after the attribute data, which can be used for other things. If Elite Legend avoided using locations &0000-17ff, &2000-37ff, &4000-57ff, &6000-77ff then two mode 2 displays could be mapped in permanently. This would also require changes to screen address conversion routines, and for any attribute drawing to fill 8 bytes instead of 1. It's difficult to achieve using patching and still a lot of work even with source code, so I don't expect you to do it.
I can continue to maintain patches to avoid you having to create a special SAM version, but if changes inside Elite Legend can simplify my patches that would be great![]()



Ответить с цитированием
Scorpion ZS 256 Turbo+/GMX 2MB/SMUC v1.3 OP/CF-IDE 2GB/TS ARM/Covox #DD/FDD 5'25/FDD 3'5/AT Kbrd & Mouse Ctrl v2.5/Universal PS/2 Kbrd Ctrl/ZX WiFi