Author Topic: Cloning a Tandy TRS-80 Model 1  (Read 39319 times)

0 Members and 1 Guest are viewing this topic.

Offline GKTopic starter

  • Super Contributor
  • ***
  • Posts: 2607
  • Country: au
Re: Cloning a Tandy TRS-80 Model 1
« Reply #75 on: January 26, 2019, 08:21:01 am »
I would think you'd pretty-much *have* to be able to use both the keyboard and the joystick at the same time though.

That will be easy enough to implement.

Quote
To be honest though - while an interesting exercise I probably wouldn't use one.  Part of the 'thrill' of the retro machines is their sometimes awkward primitiveness...

Well, I for one dislike playing any kind of game on the keyboard, except perhaps for a text adventure. Another issue I have run up against, with some of my PET games is that the keys used aren't always in convenient or even even usable locations on the PS/2 format.

I'm going to build this interface, but with two Atari-standard joystick ports (with Genesis/MegaDrive controller compatibility) to support two player games.
« Last Edit: January 26, 2019, 09:00:47 am by GK »
Bzzzzt. No longer care, over this forum shit.........ZZzzzzzzzzzzzzzzz
 

Offline GKTopic starter

  • Super Contributor
  • ***
  • Posts: 2607
  • Country: au
Re: Cloning a Tandy TRS-80 Model 1
« Reply #76 on: January 26, 2019, 08:42:39 am »
Well I figured out why BASIC Level II wasn't booting. I probed the address decoder to see what was up and noticed that the CPU was stuck in a loop, doing nothing aside from continuously polling the keyboard at ~1 second intervals with address line A6 asserted only. Keys tied to A6 are "Enter", "Clear", "Break", the four cursor keys and "Space". As it therefore appeared as though the CPU was waiting for input in the from of one of these keys being pressed, I started to hit them in sequence...... bingo - holding down (as it is only polled every ~second) the break key boots the system and "MEMORY SIZE" pops up on the screen. Each subsequent press of the break key causes "MEMORY SIZE" to be printed again on a new line.

This isn't mentioned in the manual I have. Anyone know what is going on here? It's as though (guessing that) the computer is initially trying to boot from an external device, until you "break" out of it. There might be some aspect of my incomplete hardware that is causing it to initially boot this way?

As an aside, I can now load and run 500 baud software and have access to the full 48k of RAM (yippee):
 
Bzzzzt. No longer care, over this forum shit.........ZZzzzzzzzzzzzzzzz
 

Offline GKTopic starter

  • Super Contributor
  • ***
  • Posts: 2607
  • Country: au
Re: Cloning a Tandy TRS-80 Model 1
« Reply #77 on: January 26, 2019, 09:00:20 am »
OK, I  googled and found a hint:

"With an Expansion Interface connected, but without boot disk, the Model 1 will not start and show a screen of garbage chararacters. If BREAK is pressed during power up or reset the MEMORY SIZE? message is displayed. The reset button is at the left back side, next to the expansion connector. "

https://fjkraan.home.xs4all.nl/comp/trs80/basicDescription.html


So for some reason my breadboard machine when running Level II BASIC seems to think it has an expansion interface plugged in and is initially looking for a "boot disk"..........
Bzzzzt. No longer care, over this forum shit.........ZZzzzzzzzzzzzzzzz
 

Offline biff

  • Newbie
  • Posts: 9
  • Country: us
Re: Cloning a Tandy TRS-80 Model 1
« Reply #78 on: January 26, 2019, 01:47:57 pm »
OK, I  googled and found a hint:

"With an Expansion Interface connected, but without boot disk, the Model 1 will not start and show a screen of garbage chararacters. If BREAK is pressed during power up or reset the MEMORY SIZE? message is displayed. The reset button is at the left back side, next to the expansion connector. "

https://fjkraan.home.xs4all.nl/comp/trs80/basicDescription.html


So for some reason my breadboard machine when running Level II BASIC seems to think it has an expansion interface plugged in and is initially looking for a "boot disk"..........

The ROM attempts to determine the presence of the Expansion Interface by querying the FDC status register at memory location 37EC.  What does your implementation return when that location is queried?
Without an EI connected, that memory location doesn't decode - so the Z80 normally just sees 0 and ROM uses that as a flag to indicate there is no EI and skips the routine where it would attempt to read the boot sector of drive 0.
I'm betting your implementation is returning something else there.

Holding down the Break key at startup bypasses the 37EC check, so you always end up in Level II with or w/out an EI.

Just to be clear, w/out an EI - there is no need to hold down the Break key to enter Level II.

For a really good illustration of this boot procedure, download the George Phillips emulator here:
http://48k.ca/trs80gp.html

It runs under Windows - but works great under Linux or MacOS via Wine.

Start it via:

trs80gp.exe -m1 -dx -b 068B

And that will set a break point right in area of ROM where it performs the check - and shows a nice disassembly of what it is doing.

(The -dx tells the emulator to not emulate an expansion interface - so the FDC detection check will fail)
« Last Edit: January 26, 2019, 02:01:13 pm by biff »
 
The following users thanked this post: oPossum, GK

Offline GKTopic starter

  • Super Contributor
  • ***
  • Posts: 2607
  • Country: au
Re: Cloning a Tandy TRS-80 Model 1
« Reply #79 on: January 26, 2019, 03:30:33 pm »
OK, I  googled and found a hint:

"With an Expansion Interface connected, but without boot disk, the Model 1 will not start and show a screen of garbage chararacters. If BREAK is pressed during power up or reset the MEMORY SIZE? message is displayed. The reset button is at the left back side, next to the expansion connector. "

https://fjkraan.home.xs4all.nl/comp/trs80/basicDescription.html


So for some reason my breadboard machine when running Level II BASIC seems to think it has an expansion interface plugged in and is initially looking for a "boot disk"..........

The ROM attempts to determine the presence of the Expansion Interface by querying the FDC status register at memory location 37EC.  What does your implementation return when that location is queried?
Without an EI connected, that memory location doesn't decode - so the Z80 normally just sees 0 and ROM uses that as a flag to indicate there is no EI and skips the routine where it would attempt to read the boot sector of drive 0.
I'm betting your implementation is returning something else there.


My address decoder doesn't select anything in that location, which is located almost at the very top of an "unused" two kilobyte block located directly above the level II ROM space.
If that address is read the Z80 will just be reading random bytes (not necessarily - in fact highly unlikely - zero) as all of the data bus lines will be floating.

Just a random brain fart / stab in the dark here - I wonder if the memory devices used in the original TRS-80, paralleled up on the data bus, still weakly pulled down their data I/O pins when de-selected?
 
Bzzzzt. No longer care, over this forum shit.........ZZzzzzzzzzzzzzzzz
 

Offline kizmit99

  • Regular Contributor
  • *
  • Posts: 106
  • Country: us
Re: Cloning a Tandy TRS-80 Model 1
« Reply #80 on: January 26, 2019, 03:46:38 pm »
I'm pretty sure the boot code will treat either 0x00 or 0xFF (on a read of the FDC Status register) as no FDC present. 
The original chips used in the design would pretty consistently read a floating databus as all ones. 
Your CMOS chips likely aren't quite as predictable.

 
The following users thanked this post: GK

Offline GKTopic starter

  • Super Contributor
  • ***
  • Posts: 2607
  • Country: au
Re: Cloning a Tandy TRS-80 Model 1
« Reply #81 on: January 26, 2019, 03:48:36 pm »
Just a random brain fart / stab in the dark here - I wonder if the memory devices used in the original TRS-80, paralleled up on the data bus, still weakly pulled down their data I/O pins when de-selected?


BINGO!

I just bunged a 4k7 pull-down resistor on each line of the data bus and voila! Boots without BREAK every time!
Bzzzzt. No longer care, over this forum shit.........ZZzzzzzzzzzzzzzzz
 

Offline GKTopic starter

  • Super Contributor
  • ***
  • Posts: 2607
  • Country: au
Re: Cloning a Tandy TRS-80 Model 1
« Reply #82 on: January 26, 2019, 03:51:51 pm »
I'm pretty sure the boot code will treat either 0x00 or 0xFF (on a read of the FDC Status register) as no FDC present. 


Well, I can confirm 0x00  ;)
Bzzzzt. No longer care, over this forum shit.........ZZzzzzzzzzzzzzzzz
 

Offline kizmit99

  • Regular Contributor
  • *
  • Posts: 106
  • Country: us
Re: Cloning a Tandy TRS-80 Model 1
« Reply #83 on: January 26, 2019, 03:59:58 pm »
I'm using 0xff and that also works...  Plus, I was walking through the boot code several weeks back, and remember that code, as it was reading the register, then adding 1, then comparing to 2.  Seemed like an odd thing to do until I realized 0xff was -1, so +1 and now your checking for 0 or 1 (instead of -1 and 0).  Just an odd bit of hoops to reduce the code size (typical assembly level trickery)...
 

Offline GKTopic starter

  • Super Contributor
  • ***
  • Posts: 2607
  • Country: au
Re: Cloning a Tandy TRS-80 Model 1
« Reply #84 on: January 27, 2019, 12:06:10 am »
I think passively pulling up to 0xFF will be the preferable way to go in the final design, simply to minimize loading on the bus. For example the 74LS367 line drivers used in the original expansion unit could sink 24mA, but only source 2.4mA while complying with TTL threshold levels.
Bzzzzt. No longer care, over this forum shit.........ZZzzzzzzzzzzzzzzz
 

Offline MustardMan

  • Contributor
  • Posts: 44
  • Country: au
Re: Cloning a Tandy TRS-80 Model 1
« Reply #85 on: January 27, 2019, 09:43:56 pm »
Bit late on the "hanging while booting Level II" (already solved), but something that may be interesting...

The book "The Custom TRS-80 and Other Mysteries" (1982 - Dennis Bathory Kitsz) on page 26 talks about the "hanging" and why (including disassembed code). Page 22 also mentions the "jumpers" that select level I or II. The book is a fairly good read, and I would have loved to have known of it back in the day. Ahhh, the world without internet!

I think it was the 'hackaday' project (??) that talked about the differences in how different chips (eg: LS, C, HCT etc) let their outputs idle. Some high, some low. Hence, using a modern replacement that has an almost identical part number can lead to some rather unexpected problems (eg: replacing a 2764 ROM with a 27C64 ROM).

MM.

 
The following users thanked this post: oPossum

Offline nick_d

  • Regular Contributor
  • *
  • Posts: 120
Re: Cloning a Tandy TRS-80 Model 1
« Reply #86 on: January 29, 2019, 06:03:19 am »
I believe that TTL and LS-TTL inputs do not "float" as such but act as if pulled up, unless explicitly pulled down by a device on the bus. This is probably a point of incompatibility which would make the Z84C00 (CMOS Z80) not an exact drop in replacement for the Z8400 (NMOS Z80), despite that the input thresholds of the CMOS part have been set to approx 1.2V for NMOS compatibility (that is, the external interface is constructed with 74HCT-like gates).
cheers, Nick
 

Offline GKTopic starter

  • Super Contributor
  • ***
  • Posts: 2607
  • Country: au
Re: Cloning a Tandy TRS-80 Model 1
« Reply #87 on: February 03, 2019, 05:00:00 am »
Yes of course, in the original TRS-80 the data I/O pins of the Z80 were buffered to the data bus by a pair of 'LS244s, which will always read 0xFF when the bus is floating.

Good tip on "The Custom TRS-80 and Other Mysteries"! Complete PDF of the book available here: https://archive.org/details/Custom_TRS-80_and_Other_Mysteries_1982_Dennis_Bathory_Kitsz_a


BTW, can anyone out there elaborate upon what the lower-case modification incompatibility is supposed to be with Level II BASIC? :

Quote
Unlike most other lower case modifications, the Electric Pencil modification required a toggle switch to enable and disable lower case. This was important because the modification was incompatible with Level II BASIC and needed to be disabled before using it. Those toggle switches were once a common site on Model I keyboards.

Bzzzzt. No longer care, over this forum shit.........ZZzzzzzzzzzzzzzzz
 

Offline jeffheath

  • Regular Contributor
  • *
  • Posts: 71
  • Country: us
Re: Cloning a Tandy TRS-80 Model 1
« Reply #88 on: February 03, 2019, 11:10:48 pm »
Just found out you actually have the gerber files and schematics uploaded for the commodore pet... looks like I've got something to keep me busy for a looong time ;D Can't wait to see how this one turns out!
 

Offline kizmit99

  • Regular Contributor
  • *
  • Posts: 106
  • Country: us
Re: Cloning a Tandy TRS-80 Model 1
« Reply #89 on: February 03, 2019, 11:29:07 pm »
BTW, can anyone out there elaborate upon what the lower-case modification incompatibility is supposed to be with Level II BASIC? :
Please note - the following is from very old memories, not from taking a look at the schema/ROMS...  I *could* be miss-remembering this, but I think it's basically correct:

I didn't do the Electric Pencil mod, but I *think* the issue was actually with the font ROM having "giberish" in the first 32 positions.  I believe BASIC actually stores values of 0 through 32 for the alphabet, and relies on the original "missing bit" circuitry to "push" those characters up into positions 64 through 96 in the font ROM.  When the font ROM has the alphabet in positions 0 through 32, this alleviates that issue (which is why you don't see it).
 

Offline nick_d

  • Regular Contributor
  • *
  • Posts: 120
Re: Cloning a Tandy TRS-80 Model 1
« Reply #90 on: February 06, 2019, 04:25:51 am »
Is it Microsoft BASIC? There is a disassembled source code around for NASCOM Z80 BASIC, probably a similar version to what was used in the TRS-80 (single precision only, lacks commands such as RENUM). It would be relatively straightforward to compare this with Level II BASIC and disassemble only the missing parts. Then patch it for lower case. Some day I plan to disassemble the the most modern CP/M version like this, since the extra is not all that much.
cheers, Nick
 

Offline kizmit99

  • Regular Contributor
  • *
  • Posts: 106
  • Country: us
Re: Cloning a Tandy TRS-80 Model 1
« Reply #91 on: February 06, 2019, 04:30:00 am »
Yep, TRS80 Basic was licensed from Microsoft...  Seem to recall some BS story about Bill G. writing it over one weekend or some crap like that...
 

Online oPossum

  • Super Contributor
  • ***
  • Posts: 1453
  • Country: us
  • Very dangerous - may attack at any time
Re: Cloning a Tandy TRS-80 Model 1
« Reply #92 on: February 06, 2019, 04:44:33 am »
I think it was the first version of the Altair 8800 BASIC that was written in a short amount of time and tested on an emulator running on some model of DEC PDP.
 

Offline netdudeuk

  • Frequent Contributor
  • **
  • Posts: 462
  • Country: gb
Re: Cloning a Tandy TRS-80 Model 1
« Reply #93 on: February 06, 2019, 10:32:58 am »
I think it was the first version of the Altair 8800 BASIC that was written in a short amount of time and tested on an emulator running on some model of DEC PDP.

At least this is true.  They created a punched tape which Bill took to demo.
 

Offline BartH

  • Newbie
  • Posts: 1
  • Country: nl
Re: Cloning a Tandy TRS-80 Model 1
« Reply #94 on: February 08, 2019, 03:28:04 pm »
It would be relatively straightforward to compare this with Level II BASIC and disassemble only the missing parts. Then patch it for lower case.
cheers, Nick
No need for disassembling the ROM, this has already been done. The Model 1 did have lower case in its character ROM but was not able to display it, due to the 6 bit memory. When the need for Word Processing came (the next big thing in 1979 or so) Tandy came up with a lower case kit. It included the memory chip, a new character ROM and a cassette with a driver. As disk drives became cheaper and DOS'ses more common the drivers became part of the operating system.

So for reasons of compatibility with old software I would suggest to focus on adding (emulated) hard drives like the FreHD and using LDOS or NewDos/80 for lowercase drivers. The autoboot Model 1 rom's are also readily available (back in the day you booted initially from floppy before loading a HD-driver).

If you really want to use the Model 1 with lowercase and no floppy or HD you should change 1 byte in ROM: address 0x0473h contains 0x38h (JR,C) and should be changed to 0x18h (JR). This mod bypasses some code that essentially changes lower case back to upper case.

BTW later Model 1's contained the character rom in a socket so it didn't need desoldering when updating with the RS Lowercase kit. The later 'Japanese' Model 1's already contained the missing 7th bit and had a better character ROM. You still needed a driver or DOS to display the lower case characters.

Bart
 

Offline nick_d

  • Regular Contributor
  • *
  • Posts: 120
Re: Cloning a Tandy TRS-80 Model 1
« Reply #95 on: February 09, 2019, 06:18:15 am »
That's good to hear (about the lowercase support being much improved in later versions of the system). And, also, yes the disassembly has already been done, even if it isn't needed for this purpose. I was looking into it the other day and I discovered the book "Microsoft BASIC decoded and other mysteries" which I think you are referring to. Since Level II BASIC includes the double precision (though incomplete as cut down to fit in 12K) and other goodies, I think this disassembly may be a useful supplement to the NASCOM 8K BASIC disassembly for my purpose of analyzing the extended CP/M BASIC.
cheers, Nick
 

Offline b1ackmai1er

  • Newbie
  • Posts: 1
  • Country: au
Re: Cloning a Tandy TRS-80 Model 1
« Reply #96 on: March 10, 2019, 05:27:30 am »
Hi GK,

I came across your TRS-80 Model I development post in my search for a graphics font. Impressive work indeed.

I was wondering if you would be able to share a copy of the graphics character "rom". I saw you posted a hex file of the standard character set but you advised that the graphics character set is "generated". Would you still be able to do a dump of this character set and share it? Alternatively, if thise is generated by Z80 code, would you mind sharing the code?

I have found heaps of trs-80 font resources on the net but they are all font conversions to ttf or similiar. It's seems nearly impossible to get these back to a bit map rom.

Thanks for your time.

I'm chasing these to add a graphics character set for 128 to 256 character modification:

https://www.retrobrewcomputers.org/doku.php?id=boards:ecb:vdu:start
https://www.retrobrewcomputers.org/doku.php?id=boards:ecb:vdu:fonts

Regards Phillip
 

Offline rambobrite

  • Newbie
  • Posts: 3
  • Country: us
Re: Cloning a Tandy TRS-80 Model 1
« Reply #97 on: March 23, 2019, 12:20:50 am »
Regarding sound - the Model I was notorious for spewing RF interference.

If memory serves, Softside magazine had a program that would play "Don't it Make My Brown Eyes Blue" through for-next loops and the like. Just placing a radio near the computer would pick up the noise. (I won a free game from my Radio Shack on a bet, the manager being certain the Model I couldn't make sound.)

Some early games leveraged this "capability", until sound generation through the audio jack became a thing. I'll see if I can track any down.
 

Offline DDunfield

  • Regular Contributor
  • *
  • Posts: 173
  • Country: ca
Re: Cloning a Tandy TRS-80 Model 1
« Reply #98 on: March 23, 2019, 12:46:18 am »
Hey.. just noticed this thread. Good job on the TRS-80 M1 clone!

I've got a couple homebuilt TRS-80 Model IIIs on S-100 cards in my collection, I didn't build them, they were donated by the guy who built them.

http://www.classiccmp.org/dunfield/t80s/index.htm

Dave
 

Offline Rick-S

  • Newbie
  • Posts: 5
  • Country: us
Re: Cloning a Tandy TRS-80 Model 1
« Reply #99 on: April 02, 2019, 11:50:27 am »
GK, This  is an amazing project.  I'm in awe of your reverse engineering skills.  I can't wait until you get it complete to see the final outcome. 

 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf