Switching pages of ProfPZU.

ZXNet echo conference «code.zx»

From Vlad Sotnikov To All 21 March 2001

Hello All! I have prepared a subject for the author of the Z80Stealt emulator. However, I thought that she would be interested and real people, because we are still talking about this problem there are only rumors and does not exist in the slightest degree reliable information. So I hope that in during the discussion, the problem of switching pages ProfPZU will become more or less clear. Sorry for answering you so late - I must admit, your the request made me suffer enough to find out How do you still switch pages in ProfPZU? At first I I started digging the MOA SPM emulator. And ran into the team there, which he called SPM. It has the code #ED,#10 - and I needed a little time to understand that this method has nothing similar to how pages switch on a real spec. A in real Scorpio everything happens like this: It is known that to execute subroutines in additional pages, the RST #30 command is used, which is called when included Monitor ROM and 8th page. At the same time she has following format: RST #30 DW address of the subroutine DB page number (0...15) ... After the subroutine is executed, the main one is turned on again monitor page, and the 8th memory bank. Page numbers are the following correspondences: 0 - 128 ROM. 1 - 48 ROM. 2 - Monitor (main page) 3 - TR-DOS. ...From 4 to 15 - additional Monitor pages. But that's all external level. To find out what's really going on, I followed RST #30. There control is transferred to the 8th page, and the switching subroutine itself is placed ROM pages, and very confusing. If desired, you can take a look, but here is the final result I got from analysis of this confusing MOA code. All ProfPZU memory is divided into a certain amount segments, each of which contains 4 pages. B ProfPZU 27010 has 2 such segments, in 27020 there are 4 and in ROM 27040 probably also 4 segments, but the main pages are there duplicated. However, this is nothing more than a guess. I dug ROM 27020, and therefore I describe the 4 available in it segment. I don’t know exactly how everything happens in other ROMs. Within each segment, pages switch as standard for them in a way - through ports #1FFD, #7FFD and accessing the address #3D30 (sic MOA!) for the 3rd page of the segment. That is, let's say the 7th page of the ROM, which corresponds to the 3rd page 1st segment, enabled by placing the subroutine address on stack and accessing it at address #3D30, where it has RET command. And finally, the most important thing: how segment switching occurs. To do this it is necessary to consider value from a specific memory location when ROM is turned on Monitor, i.e. when the 1st bit of port #1FFD is set. Hereaddresses for these segments: 0 - #0100 1 - #010C 2 - #0108 3 - #0104 The highest value is #01. Low-order memory address values for segment switches are again in the main page Monitor at address #0110. To get the lowest value address, you must add the segment number to number #0110. This one I wrote this paragraph so that you can see what addresses correspond to segments in other versions of ProfPZU (27010 and 27040). I would like to note that the firmware is ProfPZU 27040 (512K), that travels on the network is most likely broken. However, you seem to Already wrote to me about this. As paradoxical as it may seem, such switching of pages - fact. You can verify this by writing the following subroutine: D.I. LD BC,#1FFD LD A,#12 OUT(C),A LD A,(#010C) LD BC,#1FFD XOR A OUT(C),A EI RET And the computer goes into a stupor. Now regarding the firmware ROM: unfortunately, I don't have it. But for the emulator I would recommended using ProfPZU 27010 firmware, because all these additional programs sitting in ROM memory are scary antediluvian and no one needs it - none of the real people almost never starts them. In principle, the firmware can be pull it out programmatically from a real spec like this: ORG #7000D.I. LD BC,#1FFD LD A,#12 OUT(C),A RST #30 DW COPY_PAGE DB page. LD BC,#1FFD XOR A OUT(C),A RET COPY_PAGE LD HL,0 LD DE,#8000 LD BC,#4000 LDIR: RET We substitute the page numbers and remove them from RAM. But there is small problem: every fourth segment page (3,7,11,15). The fact is that for spec these are TR-DOS pages, and if the executing code goes beyond the ROM, then “ROM 48” is turned on - the 1st page of the segment. And if the 3rd page it’s very easy to take (standard TR-DOS), then pages 7,11 and 15 cause difficulty. However, in case of firmware emulation 27010 we only need the 7th page. That's all, actually. If you have any questions, write. Be sure to write how my information helped you or did you already know all this? And write if you managed to pull out the 7th page. If not, I'll think of something. Happy, Vlad (Vega, ex Style Group). Best regards, Vega.