Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: Notesfiles $Revision: 1.7.0.10 $; site trsvax Path: utzoo!watmath!clyde!cbosgd!ihnp4!inuxc!pur-ee!uiucdcs!convex!trsvax!uhclem From: uhclem@trsvax Newsgroups: net.micro.trs-80 Subject: Re: Again: What makes the Model 4 work? Message-ID: <70700051@trsvax> Date: Fri, 15-Nov-85 11:37:00 EST Article-I.D.: trsvax.70700051 Posted: Fri Nov 15 11:37:00 1985 Date-Received: Mon, 18-Nov-85 06:30:20 EST References: <408@houem.UUCP> Lines: 53 Nf-ID: #R:houem.UUCP:408:trsvax:70700051:000:2414 Nf-From: trsvax!uhclem Nov 15 10:37:00 1985 How to set your Model 4 screen to 80x24 or 40x24 while staying in Model III mode. This is pretty easy. There is a port called OPREG$ (0x84) which controls the memory mapping and the CRTC-program select. It looks liks this: B7 B6 B5 B4 B3 B2 B1 B0 Page Fix Memory Memory Invert 80/64 Select Select Upper (0) Bit 1 Bit 0 Video Bit 1 Bit 0 Memory (Alt Set Select) Bit 2 controls if the CRTC is programmed for 80x24/40x24 or 64x16/32x16. The half-width adjustment is in port 0xEC (MODOUT), bit 2 (MODSEL). Bits 1 & 0 of OPREG$ decide what memory map to use. Since you want to stay in Model III mode, these bits should remain 0. This keeps the ROMs selected, and places the keyboard at 0x3800 and the video at 0x3C00. The Page bit (Bit 7) selects which 1K of the 2K video RAM is addressable at 0x3C00. It does not affect which page is shown on the screen in any mode. So what you get to do is write code to break your screen requests up and turn that bit on if you want the upper 1K and off if you want the lower 1K. OPREG$ is unknown to the Model III ROM and operating systems, so you will need to keep a copy of its contents in RAM somewhere as it is a write-only port. MODOUT is known, and Model III systems maintain a copy of it at 0x4210. So if you modify this port, be sure to read the copy at that address, and/or bits in it, store it back, then write to the port. (By the way, Bits 6-4 control banking when you have 128K.) All of the above information can be found in the Model 4/4P Technical Reference Manual 26-2110, and some of it was in Model III/4 Cassette BASIC Reference Manual or something like that. (Should have come with your 16K machine.) "Thank you, Uh Clem." Frank Durda IV @ "If you took the bugs out it wouldn't be crashy, would it?!?"