Image Map Image Map
Page 1 of 21 1234511 ... LastLast
Results 1 to 10 of 202

Thread: Tek 405x web-browser emulator

  1. #1

    Default Tek 405x web-browser emulator

    Branching this thread off the "Saving ROM data from Tek 4052" to specifically discuss Tek 405x emulation. As far as I know, there have been two approaches, one is documented in another thread titled "Tek 4051 BASIC simulator" that was written in C++ by Brad-4051 and runs on Windows, and the second approach is a Javascript based emulator that runs in a web browser and does a native emulation of the actual 4051 hardware with an emulated 6800 running binaries from actual ROM dumps, started by daver2?

    Dave - could you place the code in some repository that supports version tracking, github perhaps, to make it easier for multiple contributors (even if it's just us two) and post a link here for this thread.

    Last month I skimmed through mc6800.js and TEKTRONIX4051.js. Today I spent several hours reviewing mc6800.js to better understand how the processor emulation is done, at least it's a good excuse for me to finally learn 6800 assembly and understand the processor's features. I've been adding more comments, documentation, and reorganizing a few functions around in mc6800.js. Eventually I will add placeholders for the Tek extended instructions to the Instruction Register case statement list so once we can locate documentation that describes what they do, we can flesh those out to support the 4052/54 emulation. Is there any reason to add an argument to the 6800 function to specify if it should ignore Tek extended instructions for 4051 emulation? I suspect it shouldn't be a problem to support those instructions because the 4051 ROM binaries will not even use those extended instructions at all.

    One general question or complaint, I'm not sure why we need to use "this" in front of everything, if the 6800 function is called then all these "this.whatever" variables and functions become global to the window accessible by all other javascript functions? I'm wondering why that is necessary, I'd think all 6800 internal registers and functions should remain within the 6800 and inaccessible for other Javascript code outside of the 6800?

    Dave - did you ever hear back from the guy who might have the documentation on the Tek extended instructions? Worst-case we probably could reverse engineer the 4052/54 processor microcode to figure out what the extended instructions do but that would be a real painful challenge.
    "One man's garbage is another man's treasure."

  2. #2


    Another question or feedback on the TEKTRONIX4051.js code, I notice all ROM images are explicitly documented in this file as a big array of bytes for each individual ROM. I assume a script was used to convert from the raw binary files to this format? Couldn't we have Javascript just read in a single binary file or at least a single separate Javascript file with all the individual ROM images prearranged together as a continuous block? This would be a good way to verify the assembled ROM file is correct if we ever want to make a modern replacement ROM that can cover the entire address space for repairing actual machines.
    "One man's garbage is another man's treasure."

  3. #3


    I went ahead and created a GitHub repository for the Tek 405x emulator here so anyone can contribute and we have version tracking:

    As of today, the content in there is exactly the same as in Dave's Google drive. I've made some progress in the past several weeks cleaning up and reorganizing the Javascript code, but in the process I broke the GPIB program load. Once I figure that out, I'll submit my recent changes. Currently the emulator only does the 4051. My goal is to finish cleaning up the code so it's more readable and maintainable, and then build onto it for 4052/54 emulation.
    "One man's garbage is another man's treasure."

  4. #4
    Join Date
    Aug 2009
    Oslo, Norway
    Blog Entries


    This is a nice effort! Hopefully more people join in.

  5. #5
    Join Date
    Jun 2012
    UK - Worcester


    I haven't forgotten about your PM, honest!

    I have just been too busy with work. I have some leave coming up shortly, so I will send you a PM to explain how I coded some of the stuff up!

    Thanks for creating the GitHub project.



  6. #6


    I love your emulator! I just contributed two Tek programs to the Github site - after joining Github

    One program is a May 78 Byte Magazine "Hidden Line" program I ported to a 4051 in the USAF in the 70's.
    Second program is my creation - Vipers on Patrol

    Based on old Vintage Computer website (still on article about Tektronix in Battlestar Galactica. The article had a picture of a computer plot of Vipers on Patrol - which he indicated came from a Battlestar Galactica demo tape.

    I printed, then digitized one of the Vipers with my 4052 and saved the data points to a tape file. Yesterday after running the Hidden Line program successfully on the emulator, I copied all the data into the main program since I couldn't figure out how to get the emulator to load another file. I used the emulator to find out whether the READ statements were limited to one DATA statement - which I was lead to believe from reading the programmers guide. Answer - no, a READ of a dimensioned variable will keep reading DATA statements until the variable is satisfied. This resulted in a great speedup on my original program. It only takes one DRAW statement to draw the X/Y array of lines, then the loop changes the VIEWPORT to scale and locate the next Viper.

    Vipers on Patrol.jpg

  7. #7


    I just added one more program - my Artillery program - to the Github. This program is now 40 years old, but I still find it addictive - and I like Angry Birds too
    I did have to make a couple of changes when I typed the program in from a thermal printout - it seems like the graphics scaling is a little off, and control-G should beep the speaker.

    I found my treasure trove of program listings from that era - so until I get my 4052 or 4054 running again, I plan to comb through the listings and input the best to the program folder on Github.


  8. #8


    I don't know if forking the Github code to add my changes is the best way - I'm learning

    I just uploaded changes to TEKTRONIX4051.js to double the line width and quadruple the size of the text characters. I also changed the cursor from bright blue to light green. I also uploaded a modified ARTILLERY that moved the text into the viewport. I tried a couple of the original programs like Startrek - I think they look more like the real 4051 screen now.


  9. #9


    One more emulator update.

    I doubled the line drawing width and doubled the character length and width and uploaded a new Tektronix4051.js file. I also uploaded some text position changes to my Artillery program to the program folder. I ran a couple of other programs in the folder like LINES and STARTREK, and I think it looks better.

    What do you guys think?


  10. #10

    Default 1982 Tektronix 4050 Series Basic Reference Guide

    Quote Originally Posted by Philcogrump View Post
    Branching this thread off the "Saving ROM data from Tek 4052...

    Dave - did you ever hear back from the guy who might have the documentation on the Tek extended instructions? Worst-case we probably could reverse engineer the 4052/54 processor microcode to figure out what the extended instructions do but that would be a real painful challenge.
    I found a box in my attic with 4052/4054 to 4052A/4054A upgrade boards. Included with the instructions was a 1982 Tek 4050 Series Basic Reference Guide (61 pages).
    I scanned it into a searchable PDF and put it on my Google Drive

    The guide has all the instructions for the 4051 and has highlighted new instructions for 4052 and 4054 in gray.

    Here is a list from the guide of all the Basic Keywords - click the link for the full size image, not the thumbnail.

    Attached Images Attached Images
    Last edited by nikola-wan; March 13th, 2018 at 05:46 PM. Reason: picture is too small


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts