• Please review our updated Terms and Rules here

Model II video - random characters

dhoelzer

Veteran Member
Joined
Oct 20, 2012
Messages
523
Location
New York
Greetings-

Now that I have my model II mostly fully functional once again (and have managed to create a new P&T disk.. whew.. that 8" media that is tandy compatible is hard to come by), it's finally come time to think about and resolve a pesky problem.

With the system running I will get random bits getting flipped in the video RAM. At this point I have already replaced all four of the SRAM chips to no avail, so it's time to start looking further afield, but this is beyond my expertise. First, you will likely want to know how I know it's the video board. I'm basing this assumption on:

The system never crashes.
The system never shows signs that any program memory is ever corrupted.
The memory test runs flawlessly on the 64k of RAM, though I would question how well the $F800-$FFFF is tested since it's never overwritten with the test pattern.
I've also socketed and replaced the RAM on the 64k board some time back thinking that it could be related (and not having thought through that nothing crashes..)

So, that brings me to the video controller / keyboard interface card. This is the 8709048 Rev C card found in all Model IIs that i know of. Any first steps or suggestions? Tools available:

Scope, voltmeter, logic analyzer, logic probe

Thanks!
 
I've found one manual at:
https://ia601705.us.archive.org/35/...nical_Reference_Manual_1980_Radio_Shack_a.pdf

You need to download it, then read it a couple of times in the Video & Keyboard sections. I can't locate the Video address yet. If I remember correctly on the Model 3 & 4 it was
03C00H or maybe 03000H, I forget. If you can get a debugger running on the OS you can try writing directly to the Video Address and see if you can get it displayed.

LD A,41H
LD HL,SOURCE
LD DE, DEST
LD BC,NUMBYTES
LDIR

should write an "A" to the display on a Model 3 or Model 4, if I remember correctly.

The Model II also has Banked (paged) memory so you may not see that section of Memory written to, unless you understand how it flips in the required Bank (page).

Do you know the Video Address for the Screen Display? 03C00H???
What do you really mean with this statement? "I will get random bits getting flipped in the video RAM?" How are you viewing the Contents of the Video RAM?
Are you really talking about what is displayed on the CRT?

Are all the Dots of each Alpha & Numeric Character correctly displayed? What is being flipped on the CRT's Display? Dots, Characters, Words, Graphics?

You could always build an Z80 Exercizer and troubleshoot with it. It's an interesting project giving you full control of the Z80 with a Arduino Mega 2560.


Larry
 
The model II video memory begins at $F800, as I stated. :)

The flipped bits result in entire characters, not dots. Either spurious characters appear or existing characters modify. I've tried to analyze it to see if it's on some specific bit boundary but so far nothing is apparent.

I may have failed to mention that the bits, once flipped, will actually scroll just fine... This is the other thing that seems to tell me that it's something specific to the video / keyboard board since this type of corruption in the 64k ram card would be extremely destructive to running programs.

Thanks for the suggested assembly. I was actually planning to do something similar, but cycling through all of the characters and then verifying them before change, but I had to sit down and read the VEDIT.COM manual last night to figure out how to create the file. :)

I've found one manual at:
https://ia601705.us.archive.org/35/...nical_Reference_Manual_1980_Radio_Shack_a.pdf

You need to download it, then read it a couple of times in the Video & Keyboard sections. I can't locate the Video address yet. If I remember correctly on the Model 3 & 4 it was
03C00H or maybe 03000H, I forget. If you can get a debugger running on the OS you can try writing directly to the Video Address and see if you can get it displayed.

LD A,41H
LD HL,SOURCE
LD DE, DEST
LD BC,NUMBYTES
LDIR

should write an "A" to the display on a Model 3 or Model 4, if I remember correctly.

The Model II also has Banked (paged) memory so you may not see that section of Memory written to, unless you understand how it flips in the required Bank (page).

Do you know the Video Address for the Screen Display? 03C00H???
What do you really mean with this statement? "I will get random bits getting flipped in the video RAM?" How are you viewing the Contents of the Video RAM?
Are you really talking about what is displayed on the CRT?

Are all the Dots of each Alpha & Numeric Character correctly displayed? What is being flipped on the CRT's Display? Dots, Characters, Words, Graphics?

You could always build an Z80 Exercizer and troubleshoot with it. It's an interesting project giving you full control of the Z80 with a Arduino Mega 2560.


Larry
 
As you suspect, since the video board uses its onboard 2K ram only, I doubt there are any related issues with the main 64K ram. Can you clarify if you are seeing all proper characters or are you actually seeing spurious pixels? Is there any consistency to the issue? A picture says 1000 words so a screen shot would be helpful.

Also, remember with your test assembly code that you first need to set bit 7 on port FF to give the CPU access to the video ram.
 
Last edited:
Thanks Pski.

Proper characters. When I say bits flipped, I'm saying that the 0x41 for an 'A' (ok, honestly, I've never checked if this thing actually uses ascii, so work with me here) is turning into a 0x45 ('D') when the 3rd bit from the right gets toggled. Unfortunately there doesn't seem (yet) to be any consistent way that this bits are flipping, but I seriously doubt it's in the character generator ROM if that's what you're thinking. I'll snap a picture or two later today.


As you suspect, since the video board uses its onboard 2K ram only, I doubt there are any related issues with the main 64K ram. Can you clarify if you are seeing all proper characters or are you actually seeing spurious pixels? Is there any consistency to the issue? A picture says 1000 words so a screen shot would be helpful.

Also, remember with your test assembly code that you first need to set bit 7 on port FF to give the CPU access to the video ram.
 
Just to preserve for posterity and save someone else beating their head against a wall...

I just spent two hours trying to figure out why my simple 20 line Z-80 assembly program refused to assemble correctly. To say that the errors generated aren't helpful would be generous. In fact, it wasn't until I dumped the resulting binary and saw that it was mostly empty that I looked much more closely and realized that it was not outputting a LST as it assembled.. it was generating errors of some cryptic kind with "S" and "U" to the far left, which meant nothing to me.

Thinking that perhaps this assembler uses some really weird notation that I've not seen before, I found this paragraph in the P&T CP/M manual that explains my entire problem: "An 8080 assembler (ASM) is included with P&T CP/M 2 for developing machine language programs and routines. Since it is an 8080 assembler, it cannot directly assemble z-80 code. If a program does not use any of the Z-80 instructions there is no problem."

heh... No Z-80 codes... like "LD", "IN", "OR"... This simple coding exercise just got way more interesting.
 
Yes, I didn't think about that. I typically use yaze-ag-2.30.x on Linux (Debian) and it takes care of the Z80 Opcode problem. Plus I can work on my Laptop.

Here is a section I copied out of one of my source files.

;
5000 21003C LD HL,3C00 -- Source
5003 11013C LD DE,3C01 -- Destination
5006 01FF03 LD BC,03FF -- Num of Bytes
5009 3641 LD (HL),41 -- Stuff with "A"
500B EDB0 LDIR -- Do all in BC

You could just use a debugger like TBUG or HTASMON (TASMON) if you are running TRSDOS or Newdos. I'm not sure what Version DOS the Model II used.

I have the TBUG.PDF document and two .CAS (Cassette Tape copies) files, but not exactly sure how to get the .CAS into something you could easily use.
Perhaps someone else has been there before, and will respond.

This site says it's easy. I sent the files to my brother who has that emulator running. He is trying to get copies from the .CAS files for you.
http://gamingafter40.blogspot.com/2010/12/how-to-emulate-trs-80-model-iiii.html

More later.

Larry
 
Last edited:
There were also a couple of assemblers that used 8080 syntax but added the Z80 codes in. I think that DRI had a version of MAC that did that.

I never did care for Z80 syntax--assigning a meaning to parentheses other than grouping just rubs me the wrong way.

But when you have to use it, you use it.
 
Thanks for this. I actually already hand coded the entire thing in hex using the opcode lookup table. :)

Yes, I didn't think about that. I typically use yaze-ag-2.30.x on Linux (Debian) and it takes care of the Z80 Opcode problem. Plus I can work on my Laptop.

Here is a section I copied out of one of my source files.

;
5000 21003C LD HL,3C00 -- Source
5003 11013C LD DE,3C01 -- Destination
5006 01FF03 LD BC,03FF -- Num of Bytes
5009 3641 LD (HL),41 -- Stuff with "A"
500B EDB0 LDIR -- Do all in BC

You could just use a debugger like TBUG or HTASMON (TASMON) if you are running TRSDOS or Newdos. I'm not sure what Version DOS the Model II used.

I have the TBUG.PDF document and two .CAS (Cassette Tape copies) files, but not exactly sure how to get the .CAS into something you could easily use.
Perhaps someone else has been there before, and will respond.

This site says it's easy. I sent the files to my brother who has that emulator running. He is trying to get copies from the .CAS files for you.
http://gamingafter40.blogspot.com/2010/12/how-to-emulate-trs-80-model-iiii.html

More later.

Larry
 
I'm with you Chuck... I can adjust to the quote/noquote thing, but what gets me is that it's a CP/M for a Z80 based machine with the assembler but no one bothered to add in the Z80 specific instructions?? :) Apparently there was the MAC that you could pay some money for that included a set of macros that would translate something like "EI" into the appropriate hex since even that assembler didn't actually support it.

Given how prolific the Z80 was and how the 8080 essentially vanished by comparison, it's quite surprising to me. Then again, this is definitely a niche computer.

Anyone have any good tips on VEDIT for the model II? I actually kinda like it but there are functions for which there are no keys on this keyboard and no easy way to figure out how to do things like go into INSERT rather than OVERWRITE mode.

There were also a couple of assemblers that used 8080 syntax but added the Z80 codes in. I think that DRI had a version of MAC that did that.

I never did care for Z80 syntax--assigning a meaning to parentheses other than grouping just rubs me the wrong way.

But when you have to use it, you use it.
 
Back
Top