Home Creators Posts Import Register Favorites Logout

Downloads

Content

Hello my patrons! Next up on the main channel we I'm working on an Apple IIgs. I was worried going into this that the repair would be straightforward and easy, but the presented symptoms are anything but that. So join me where I try to collect as much evidence as I can about what is going on with this machine, so I can find a solution to get it working again. This one is going deep and a bit off the rails, but what else is new with me lately?!

Thanks for all the support!

Direct link: https://youtu.be/MVDTuu-QOe8

Files

This Apple IIgs repair got really weird

0:00 Intro 00:46 Tour of this Apple IIgs 11:49 PSU service 22:46 Basic troubleshooting 33:54 Advanced troubleshooting 46:28 Maybe it's the ROM 1:00:56 Collecting evidence -- Links Adrian's Digital Basement ][ (Second Channel) https://www.youtube.com/channel/UCbtwi4wK1YXd9AyV_4UcE6g Support the channel on Patreon: https://www.patreon.com/adriansdigitalbasement My GitHub repository: https://github.com/misterblack1?tab=repositories --- Instructional videos My video on chip removal without damage: https://www.youtube.com/watch?v=XQVjwPsVFd8 --- Music Intro music and other tracks by: Nathan Divino @itsnathandivino

Comments

Frank Fontana

Aw yessss another 1.5 hour marathon, absolute bliss, and early access to it makes it all that sweeter

Mike C

I need to know more about the Freddie Mercury wallpaper. It looks awesome

David Hatt

The last time you disappeared this deep down a no-boot rabbit hole, you surfaced with an awesome new Amiga diag ROM. So very much looking forward to what comes out of Part II. Certainly a very interesting issue!

Cameron J

I think something went wrong with the permissions of the video. Yesterday it was watchable but today it says "This video is private". Though I vaugely recall you (or maybe another channel) said something a while ago that just prior to public display it temporarily goes into that state. Maybe it's just that?

John parka

The longer , the better , if it's a four hour video , that's awesome lol

tim1724

wow. ok. so a lot to cover here. The tl;dr version is that I think most likely there's a problem with the FPI. either the chip is bad (super rare) or there's a problem with the address bus lines between the FPI and the Mega II. Although I can't quite see how the system would be so close to working if that were the case… this is a really weird one. Anyway, I'm going to write a whole bunch of replies to this comment, broken up by topic. (Some right now, possibly some more later after I think about the problem some more.) Some of it won't necessarily be relevant to the problem at hand, but will correct some mistakes or fill in gaps in your video.

tim1724

First of all, I strongly recommend downloading a copy of the Apple IIGS Hardware Reference (2nd edition) if you don't already have that book. It's the most worn out book on my bookshelf, because I refer to it so often. (I have several PDFs of scans, but I've been referencing the physical copy since I was in 8th or 9th grade and have notes and corrections in there.) The 2nd edition corrects some errors and adds coverage of the ROM 3 board. I think this one may be the best scan: https://archive.org/details/Apple_IIgs_Hardware_Reference_HiRes It omits the schematics. (This edition included separate schematics for the ROM 00/01 motherboard and the ROM 3 motherboard.) It looks like you have a copy of those, at least. Apple's official list of corrections (covering both editions) can be found in Apple IIGS Technical Note #30, a copy of which can be found here: https://archive.org/details/IIgs_2523030_Hardware_Ref I'm guessing none of those corrections will affect anything needed in this repair, but I figured I should mention it for completeness. (I'm pretty sure I've also run across one or two other errors not in the list of corrections, but again I don't think they matter here.)

tim1724

You mentioned in the video that you don't know what all the ICs do. (Although you seem to have a good handle on nearly all of them.) • 65C816: obviously the CPU • FPI: Fast Processor Interface: This is the bridge between the Fast (2.8 MHz) side of the IIGS (CPU, ROM, Fast RAM, RAM expansion slot) and the Mega II (1 MHz) side of the IIGS. The FPI also generates RAS/CAS lines for the internal Fast RAM (128KB on ROM 0/1 or 1 MB on the ROM 3) and for up to 4 MB of RAM in the expansion slot, thus greatly simplifying the design of expansion cards. (If a card has more than 4 MB (or uses DRAM with a different RAS/CAS setup than ones supported by the FPI) then the card needs its own address decoding logic. Of course modern 8MB cards usually just use SRAM instead.) The FPI also generates φ2 for the CPU, as you discovered. The FPI has to generate the clock for several reasons: — The IIGS allows you to switch between Fast (2.8 MHz) and Normal (1 MHz) operation. The FPI handles switching the clock speed. (Note that in addition to the user-controllable overall speed control, the FPI will also force a 1 Mhz clock in some situations, determined by the Speed register. Specifically, it can be configured to watch the addresses that would be used by 5.25" floppy controllers as those devices depend on exact cycle timing. So it forces 1 Mhz operation whenever it sees a motor on soft switch accessed until it sees an access to the corresponding motor off soft switch. This can be configured individually for slots 4–7. There's no way to enable this behavior for slots 1–3, so 5.25" drives should not be installed in those slots in a IIGS.) — The FPI has to synchronize CPU access to the Mega II bus. The CPU is running at 2.8 MHz, which is not a nice multiple of the 1 Mhz Mega II bus. Not to mention that the Mega II bus already stretches every 65th cycle to match the traditional Apple II clock (which of course is due to the timing needs of the video subsystem of the earlier Apple II models, in order to keep NTSC colors consistent across sacn lines). — The FPI handles DRAM refresh for the Fast RAM. So it stretches clock cycles if needed in order to prevent the CPU from accessing RAM during a refresh cycle. (Note that this stretching only happens when accessing Fast RAM; when addressing ROM the FPI does not need to stretch clock cycles. This is why the IIGS runs at 2.8 MHz when running code from ROM but is effectively only 2.6 MHz when running code from RAM; that 7% speed drop is due to the DRAM refresh cycles.) — The FPI handles DMA between I/O slots and the built-in Fast RAM (and up to 4 MB of RAM on an expansion card) and needs to halt the CPU during those operations. As far as I know the FPI does not pull READY low; it just stretches the clock signal to pause the CPU. (But I could be wrong; the schematics shows that READY is connected to the FPI.) Chapter 2 of the hardware reference contains some details of the clock stretching but not a full description. There was a Kansasfest talk around ten years ago where someone reverse engineered a full description of the timing. It's on Youtube, I'm pretty sure. Some of the soft switches from the Mega II (such as those controlling the language card and auxiliary memory) have to be duplicated on the FPI to keep Finally, what I think is most relevant for your specific problem, the FPI handles the shadowing between banks $00/01 and $E0/E1. More about that in a separate reply, because wow is the IIGS memory architecture complicated. (This is the real secret to the Apple II compatibility. Although they did have one major screw-up in the original FPI; it was unable to shadow text page 2. They simply left it out and didn't notice until it was too late to fix. Hence the "Alternate Display Mode" CDA that installs an interrupt routine to periodically copy text page 2 from Fast RAM to Slow RAM. At significant performance cost. The ROM 3 used the CYA (“control your Apple”) variant of the FPI which in addition to being modified to handle more internal ROM and Fast RAM also added the missing text page 2 bit to the shadowing control register so it can so Alternate Display Mode on the ROM 3 just toggles that bit rather than installing a very expensive interrupt routine.) For now, back to the list of chips:

tim1724

• Mega II: The Apple-IIe-on-a-chip which handles standard Apple II video modes (including video generation and handling the relevant soft switches), provides the memory mapping for the slow RAM (including all the soft switches for language card, aux memory, etc), The 1-bit speaker click softswitch, most of the game connector stuff (but annunciators are handled by the Slotmaker IC for some reason), and other random stuff. Video output is a 4-bit digital signal (each pixel is one of the sixteen standard low-res colors) • VGC: Video Graphics Controller generates the Super High Res graphics mode and also handles transforming the 4-bit digital video output of the Mega II into RGB and composite signals when the standard video modes are in use. (And of course it applies the text foreground/background colors when outputting text modes.) It provides a 12-bit digital RGB signal (which is great for tapping into for the best RGB2HDMI output). IIRC the digital RGB gets turned into analog RGB through external resistor packs. The VGC also generates a bunch of different kinds of interrupts, some related to video signal (scan line interrupts and VBL interrupt) and some based on wall clock time (the 1 second and 1/4 second interrupts). The VGC handles the connection to the Real Time Clock chip The VGC even provides two signals for the disk port: pin 4 (3.5DISK) which selects between 3.5" and 5.25" drives, and ping 16 HDSEL for choosing between the upper and lower heads on a 3.5" drive. Why are these two 3.5" disk signals on the VGC? Who knows. Presumably just because they happened to have some spare pins available on the VGC and enough gates available in its address decoding logic to hook them up to a register at $C031. • MC1377: converts the analog RGB to composite output. • 344-0040: The Real Time Clock (or "ser clk" for serial clock on the motherboard silk screen) • Ensoniq 5503: wavetable audio • Sound GLU: provides the interface between the Mega II bus, the 5503, and the sound RAM • Zilog 8530 Serial Communications Controller: provides the two serial ports (Printer Port and Modem Port) • ADB microcontroller. Note that the ROM 0/1 version of this chip connects _directly_ to the IIe keyboard/numpad connectors as the keyboard matrix scanning hardware is built into the ROM 0/1 version of this chip. (The ROM 3 has a different version of this chip that presumably drops the keyboard matrix scanning as the ROM 3 motherboard lacks those connectors. But I'm not sure. The ROM 3 version of the chip also adds a few accessibility features.) • ADB GLU: this connects the ADB microcontroller to the Mega II bus. • Slotmaker: It's mostly responsible for address decoding for slots, for things like the IOSEL signal on the slots. And since it's already doing address decoding, Slotmaker is also responsible for a signal labeled C038-F, which is presumably pulled low whenever an address in the range C038–C03F appears on the Mega II bus. This is used in the chip select logic for both the Sound GLU and the 8530 (SCC), as their registers are in that range. Slotmaker also handles the annunciators. (I can only assume they ran out of pins on the Mega II.)

tim1724

ok, I think that's most of the chips. The rest is mostly jellybean logic (mostly used more address decoding stuff, the circuit reading joysticks, etc.) If I left something out and it's not obvious what something is, feel free to ask about it. edit: oh wait. That includes three 74HCT245 bus transceivers between the FPI chip and Mega II side of the computer (two for the Mega II address bus and one for the Mega II data bus) … those seem likely. I'll address those down in the reply that begins "Ok, now we can finally get to the point"

tim1724

So, on to other stuff. Lately Jawaid Bazyar has been working on extending his Apple II emulator to include the ROM 1 IIGS. As part of that he needed to know how various pieces of hardware behaved at both initial power on and on reset. So he made a very simple ROM that just captures the state of all the soft switches he was interested in, saves it to RAM, then initializes all the hardware (pretty much the same way Apple's initialization code does it), then reads back his saved values to display on screen. If anyone is working on a IIGS version of your Apple II diagnostics ROM, it may be useful to look at his source code in order to initialize the IIGS hardware properly. The github repo is here: https://github.com/jawaidbazyar2/gstestrom I ran that test ROM in my ROM 3 (put it in the FE-FF socket, which corresponds to the ROM 0/1 socket… the ROM 0/1 only has ROM in banks $FE–FF, whereas the ROM 3 has ROM in banks $FC-FF) in order to get more data for Jawaid (in case different variants of the Mega II and VGC chips behaved differently on startup) Oh, and that ROM was able to suspect something I've long suspected: the Mega II starts out in lo-res mode before you initialize it. And it also told us something else interesting, that I hadn't guessed: the Mega II starts off displaying page 2. I've toyed with the idea of writing my own diagnostics ROM for a while, but I haven't gotten to it yet. (And I probably won't have time to work on it until at least fall.) One annoyance is that while _some_ IIGS motherboards have a 32-pin ROM socket that can take an EPROM, others have only a 28-pin socket (as a mask ROM doesn't need as many pins as the EPROM). So in that case an adapter is needed to use an EPROM. And even on a IIGS that does have a 32 pin socket (or where the 28 pin socket has been replaced with a 32-pin socket) note that the pinout doesn't match the JEDEC-standard 1 Megabit (128k KB). Why? Well, the problem is that the A16 pin on a standard 1 Mbit chip is in a position that doesn't exist on a 28 pin chip. And the mask ROM manufacturers didn't want to use a 32 pin package when everything could just as easily fit in a 28 pin chip. So on a 1 Mbit mask rom they moved A16 to the pin that's normally OE on a normal EPROM. This mess only exists on 1Mbit (128KB) chips, as far as I know. And it's well documented in the arcade machine restoration community, because most arcade machines of that era used these chips. The Mac SE also has the same problem. I bought a tube of used Hitachi HN27C301 chips from Aliexpress to be able to flash Jawaid's test ROM because it matches the pinout and my T48 claimed to support it. Well, the T48 can write it _but_ it doesn't actually know that the pins are swapped. So I had to make an adapter board to swap the pins (2 and 24) to make it work in my T48. But it works in my IIGS fine. (I have a ROM 3, and while the bank FC-FD ROM socket on my board is only 28 pins, I'm lucky enough to have a 32 pin socket for the FE-FF ROM socket, which is the ROM that corresponds to the ROM in the ROM 0/1 motherboard, so that worked great for burning Jawaid's ROM to an HN27C301 and plugging it directly into that socket.)

tim1724

Ok, now we need to look at the IIGS's memory mapping, because that's most likely where your problem is. The RAM chips labeled "Slow RAM"(as well as the cards and built-in peripherals, as well as all soft switches and such) are mapped to 65C816 banks $E0 and $E1. Bank $E0 is the equivalent of the main memory on a IIe/IIc and bank $E1 is the auxiliary memory. You might have been expecting it to be mapped as banks $00/01. After all, 8-bit code needs to talk to all the various I/O devices on the Mega II bus, as well as video memory. But what if Apple had put the slow RAM in those banks? What would that do to native code? Well, it would have made things a lot slower. The 65C816 stack and direct page can _only_ live in bank $00, because the stack pointer and direct page register are only 16 bits wide. So if bank $00 were slow memory, then every single stack operation and direct page access would be executed at 1 Mhz. That would really suck. Also, if video memory and the 4K of I/O addresses were mapped to bank $00, then that would greatly reduce the amount of space available for the stack and direct page. Aside from its 24-bit address bus, the next biggest advantage of the 65C816 over the 65C02 is its wide array of stack-based addressing modes and its larger stack pointer, both essential features to running efficient C or Pascal code. And being able to give every process its own stack and direct page (as well as giving various OS components their own stack and direct page) was a huge part of Apple's vision for the IIGS. So bank $00 needed to be Fast RAM and it was necessary for the video frame buffer and I/O addresses to be elsewhere. So Apple chose to map the 128 KB of Slow RAM (and I/O address) in banks $E0 and $E1, well out of the way of fast RAM. Fast RAM starts at bank $00 and works its way up from there. The 128 KB of built-in Fast RAM on a ROM 0/1 machine is in banks $00–01. The 1024 KB of built-in Fast RAM in a ROM 3 machine are bans $00–0F. Any RAM in the memory expansion slot is mapped starting at bank $02 on a ROM 0/1 machine or bank $10 in a ROM 3 machine. So if all the standard Apple II hardware is up in banks $E0 and $E1, how can Apple IIe emulation work if a 65C816 in emulation mode is stuck only accessing bank $00? Well, a couple of things. first of all, the FPI has the ability to shadow memory writes to $00 and $01 into banks $E0 and $E1. (There's also an option to map writes to every even bank to bank $E0 and every odd bank to $E1, but there's no good reason to ever enable that, not all emulators bother supporting it, and there's only one or two pieces of software ever written for the IIGS that use that feature. It's a pretty bizarre feature. Turning it on will almost certainly immediately crash the machine when running GS/OS or ProDOS 16. And quite possibly even when running 8-bit code, if certain features are in use.) The shadow register allows you to choose which pieces of the first two banks should be shadowed. (so, for example, you might only want writes to the text page and I/O addresses to be shadowed, but have other areas not shadowed. Only certain pieces can be shadowed (mostly the video memory and I/O addresses) and on ROM 0/1 machines text page 2 is among the areas that can't be shadowed. (They didn't notice until too late to fix it, so the Alternate Display Mode CDA was created to enable an interrupt routine to periodically copy text page 2 from banks $00/01 to $E0/E1. (or maybe only $00->E0? Because I don't think 80 column mode supports page 2. Not sure) They fixed this in the CYA for the ROM 3, but it's disabled by default for compatibility with ROM 1 software. So there's still an Alternate Display Mode CDA, but it just toggles the text page 2 bit in the Shadow register. No interrupt routine needed. Hooray!)

tim1724

So this shadowing mechanism solves all sorts of problems: • Native code can use all of bank $00 for direct page and stack. (Well, you need to populate the reset vector and interrupt vectors at the top of bank $00, but that's only a few bytes. And hopefully your stack won't wrap all the way around and clobber them!) • Stack and direct page accesses won't be forced to run at 1 Mhz. • Emulation mode can still access video memory and I/O addresses through shadowing. The details of how shadowing works are a little tricky. Reads from RAM don't need to go through shadowing; assuming all writes are going to banks $00–01 and being shadowed to $E0–E1, then you could read from either slow or fast RAM and get the same result. So the FPI will just let all reads happen from the faster memory. The only time that would break is if something on the Mega II side of the machine writes to RAM. None of the built-in peripherals support DMA, so they won't cause problems. But if card supports DMA (such as certain SCSI cards) then they need to follow all the rules and cooperate with the FPI to make sure DMA works. I won't go into detail here, as it's not relevant to your situation. Obviously reads from I/O addresses ($C000–CFFFF) need to hit the Mega II bus (unless they're to soft switches implemented by the FPI) so they'll slow down to 1 Mhz. When running IIe compatibility stuff the appropriate pieces of ROM are mapped into banks $00–01 by the FPI; reads from these can be fast as the ROM is on the Fast side of the machine. Writes to RAM usually don't need to slow down; most of the time you won't get writes close enough together to cause problems. If the writes are spaced out enough the FPI will continue to run the CPU at 2.8 MHz and let it fetch the next instruction out of fast RAM (or ROM) while the slower write operation is happening on the Mega II bus. But it needs to read or write the Mega II bus on the next cycle, then it will stretch the cycle as needed to let the previous write finish. Oh, and the FPI has to implement all the same language card and aux memory soft switches that the Mega II supports, so it can emulate all that behavior in banks $00–01.

tim1724

Ok, now we can finally get to the point. Your memory testing code was running entirely in bank $00, since it was for the Apple ][+ so there is nothing but bank $00 on that machine. So it was happily reading and writing bank $00, with writes being shadowed to bank $E0. I think it's reasonably safe to assume the bank $00 RAM works. Now the writes to video memory are being mirrored by the FPI into the Mega II side of the machine. They pass through some 74HCT245 bus transceivers (two for the 16-bit* Mega II address bus BABUS (labeled UJ5 and UK5 on the ROM 1 schematic) and one for the 8 bit data bus MDBUS (UI5). And then MDBUS connects to the slot data bus (SDBUS) via another 74HCT245 (labeled UF2), but your problem looks like just an addressing error to me, so I don't think the data bus is involved.) Given that you're seeing these video output problems on the VGA card I think that rules out the Mega II as a likely culprit, as the card is connected to SDBUS and BABUS without going through the Mega II. I would definitely want to inspect those bus transceivers, particularly the two for the address bus. * Yes, the Mega II has 128 KB of RAM, so there's a 17th bit to choose between the IIe/IIc-style main and aux banks, called M2B0 in the hardware reference or M2BA0 in the schematic but it doesn't go through the bus transceiver. And on ROM 1 boards that signal is only present in slot 3. (Rom 3 has it on slots 1-6) It's intended to make video cards easier to build, because then they don't have to follow the aux bank soft switches to know whether which bus accesses are for main memory and which are aux memory.

tim1724

I think there was other stuff I wanted to mention, but I don't remember now. I might have to rewatch the video. Anyway, if you have any questions (about this or pretty much anything relating to the IIGS, whether hardware or software) don't hesitate to shoot me a message. I've been immersed in all of this stuff since the late 80s and I've touched pretty much every part of it at some point or another.

tim1724

Oh, one more thing. The original source code for the entire IIGS firmware is readily available. It's bundled in the leaked copy of the system 6.0.1 source code: https://archive.org/details/GSOS_6.0.1_source Note that for obvious reasons it's all in Apple II (or classic Mac) text format, so carriage returns no linefeeds. It's not the most well organized code and the comments suck, so let me know if you need help finding anything.

tim1724

Yes, it's normal and it's a shortcoming in Youtube's system for scheduled released. So anytime Adrian schedules a video for release YouTube makes it private for a while before it goes public.