Saturday, October 11, 2014

Atari 2600 Simulation

Full source code and data for our transistor-level simulation of the Atari 2600 is up on github:
https://github.com/gregjames/Sim2600

This Python version uses the same 6502 circuit node names and ids as our web-based javascript version but has no polygon geometry.  It includes our full netlist model of the Atari TIA and a simple emulation of the PIA, aka RIOT, and program ROM.  Leave it running long enough, and it'll render frames from classic games.




The simulation provides a cycle-accurate picture of what the console is doing based on the physical parts of its microchips.


102 comments:

  1. Awesome achievement! The Pitfall! screenshot shows there's a small bug. Looks like the sprites are being display 2 pixels too soon relative to the background. Notice how the latter is not centered and the finer limbs of the trees are not centered over the trunks.

    After thinking about this a bit, I would guess it is due to some phase offset between the 6502 and TIA clocks. The TIA outputs 3 pixels for each 6502 clock so it seems likely that the two of them are not in the correct phase. Though I haven't the foggiest notion what establishes that phase in the 2600.

    ReplyDelete
  2. Good eye. The simulation code transfers bits and the clock between the 6502 and TIA at each TIA half clock cycle. I'll look into which things happen on phase of the clocks.
    The 6502 clock is driven by an output of the TIA. The TIA takes the master clock, divides it by three, and sends it to the 6502. The TIA also controls the 6502 RDY pad in response to delays that the 6502 program sets up.

    ReplyDelete
  3. I believe the divide by three circuit in the TIA results in a 33.333% duty cycle for the 6502's clock. See http://www.indiabix.com/electronics-circuits/divide-by-3/

    Does the simulation account for that or does it assume a 50% duty cycle?

    ReplyDelete
  4. Yes - our model of the TIA drives the 6502 clock, and the TIA’s clock divider is captured in our netlist for the chip. It could be that we’re not transferring signals between the 6502 and TIA simulations at the correct phase of the TIA clock, or that our emulation of the RIOT timer is not correct. Our gate-level model of the RIOT is only about ⅓ complete, and we’re not using it here.

    ReplyDelete
  5. I had written an Atari 2600 emulator.
    https://youtu.be/anf3ftvWo24

    The bug also appeared in one of my development version. Unfortunately, that version was not retained. Instead, i had made a diff video to the version before and after that missing version.
    https://youtu.be/R7e2BtHAxLo

    The differences between the two versions contains two major parts. One is how WSYNC and VSYNC work, the other is how RESXXs works. I believe the bug is because of how RESXXs works. According to the spec
    http://problemkaputt.de/2k6specs.htm#videomobhorizontalpositioning

    RESXXs will set their positions to some strange values. Do not reference the code in the diff video because that is still wrong and i am not sure how to done it 100% correctly. Hope this message can help you fix the emulator.

    There is one question i would like to ask. How long could the emulator renders a frame? Is that more than one hour?

    ReplyDelete
  6. Conventions of pixies have existed in exceedingly differing societies around the globe for quite a long time. Pixies and pixie like creatures are otherwise called nature spirits, house spirits, dwarves, mythical people, little persons, mermaids and leprechauns. Perused more about the entrancing customs of pixies here. http://www.mordocrosswords.com/2016/02/acts-like-raptor.html

    ReplyDelete
  7. I am glad to see this Atari simulation because I thought Atari has been buried in history. healthybodyhealthymind.com/can-burning-sage-help-kill-airborne-bacteria/

    ReplyDelete
  8. Thank you for sharing this simulation. Keep on posting interesting topic.
    Regards | water softening filtration

    ReplyDelete
  9. If you're new to emulation, we suggest you read the Beginner's Guide you'll find it all here in https://hardwoodfloorrefinishingmn.com/

    ReplyDelete
  10. This is my first-time visit to your blog and I am very interested in the articles that you serve. Provide enough knowledge for me.
    garage door rollers

    ReplyDelete
  11. Thanks for the nice blog. It was very useful for me. I'm happy I found this blog.
    a1 appliance repair

    ReplyDelete
  12. I really appreciate this wonderful post that you have provided for us. I assure you this would be beneficial for most people.
    commercial garage door repair

    ReplyDelete
  13. I am extremely delighted with this web journal. It's a useful subject. It helps me all that much to take care of a few issues.
    garage door track adjustment

    ReplyDelete
  14. This is a wonderful article, Given so much info in it, These type of articles keeps the user's interest in the website.
    garage door antenna extension

    ReplyDelete
  15. It's always exciting to read articles from other writers and practice something from their websites.
    Garage Door Repair Doctors

    ReplyDelete
  16. So lucky to come across your excellent blog. Your blog brings me a great deal of fun. Good luck with the site.
    garage door parts mississauga

    ReplyDelete
  17. This is a wonderful article, Given so much info in it, These type of articles keeps the user's interest in the website.
    medical universities in Pakistan

    ReplyDelete
  18. I was exactly searching for. Thanks for such a post and please keep it up.
    garage door repair orleans

    ReplyDelete
  19. This is a wonderful article, Given so much info in it, These type of articles keeps the user's interest in the website.
    חברה לבניית אפליקציות

    ReplyDelete
  20. A very awesome blog post. We are really grateful for your blog post. You will find a lot of approaches after visiting your post.
    garage door repair Edmonton

    ReplyDelete
  21. I was exactly searching for. Thanks for such a post and please keep it up.
    שער כניסה לבית פרטי

    ReplyDelete
  22. This is my first-time visit to your blog and I am very interested in the articles that you serve. Provide enough knowledge for me.
    טבעות אירוסין מעוצבות

    ReplyDelete
  23. This is truly the web service provider I was looking for!
    overhead door vancouver

    ReplyDelete
  24. Excellent article. The writing style which you have used in this article is very good and it made the article of better quality.
    garage door jerks when closing

    ReplyDelete
  25. I was exactly searching for. Thanks for such a post and please keep it up.
    imperial technology

    ReplyDelete
  26. A very awesome blog post. We are really grateful for your blog post. You will find a lot of approaches after visiting your post.
    Smooth Garage Doors

    ReplyDelete
  27. I was exactly searching for. Thanks for such a post and please keep it up.
    garage door repair

    ReplyDelete
  28. I was exactly searching for. Thanks for such a post and please keep it up.
    garage door repair Scarborough

    ReplyDelete
  29. I like this post, And I figure that they have a great time to peruse this post, they might take a decent site to make an information, thanks for sharing it with me.
    duct cleaning pittsburgh

    ReplyDelete
  30. So lucky to come across your excellent blog. Your blog brings me a great deal of fun. Good luck with the site.
    Brigs Garage doors

    ReplyDelete
  31. It's always exciting to read articles from other writers and practice something from their websites.
    window repair

    ReplyDelete
  32. This is my first-time visit to your blog and I am very interested in the articles that you serve. Provide enough knowledge for me.
    garage door repair cleveland oh

    ReplyDelete
  33. This is truly the web service provider I was looking for!
    garage door repair dallas

    ReplyDelete
  34. I am extremely delighted with this web journal. It's a useful subject. It helps me all that much to take care of a few issues.
    garage door repair philadelphia pa

    ReplyDelete
  35. Excellent article. The writing style which you have used in this article is very good and it made the article of better quality.
    garage door installation near me

    ReplyDelete
  36. I really appreciate this wonderful post that you have provided for us. I assure you this would be beneficial for most people.
    commercial garage door installation

    ReplyDelete
  37. Thanks for the nice blog. It was very useful for me. I'm happy I found this blog.
    central air conditioning repair

    ReplyDelete
  38. A very awesome blog post. We are really grateful for your blog post. You will find a lot of approaches after visiting your post.
    kitchen remodeling houston tx

    ReplyDelete
  39. I was exactly searching for. Thanks for such a post and please keep it up.
    window repair

    ReplyDelete
  40. I like this post, And I figure that they have a great time to peruse this post, they might take a decent site to make an information, thanks for sharing it with me.
    Los Angeles Garage Doors

    ReplyDelete
  41. I am extremely delighted with this web journal. It's a useful subject. It helps me all that much to take care of a few issues.
    tree service tampa fl

    ReplyDelete
  42. Amazing that you share this informative blog, Really looking forward to read artical like this.
    mitsubishi ac 1.5 ton 5 star price 2021

    ReplyDelete
  43. This comment has been removed by the author.

    ReplyDelete
  44. This comment has been removed by the author.

    ReplyDelete
  45. This comment has been removed by the author.

    ReplyDelete
  46. I think you should post your works on your instagram profile. You can buy instagram followers to promote your page with your works.

    ReplyDelete

  47. Special thanks to (hackingsetting50@gmail.com) for exposing my cheating husband. Right with me i got a lot of evidences and proofs that shows that my husband is a fuck boy and as well a cheater ranging from his text messages, call logs, whats-app messages, deleted messages and many more, All thanks to

    (hackingsetting50@gmail.com), if not for him i will never know what has been going on for a long time.

    Contact him now and thank me later.


    ReplyDelete
  48. Wonderful post….. Indian visa from USA, This visa to India allows travellers from the United States to visit India for short term stays.

    ReplyDelete
  49. My brother recommended I might like this blog. He was entirely right. This post actually made my day. 토토사이트

    ReplyDelete
  50. I was very pleased to find this web-site. I wanted to thanks for your time for this wonderful read. 바카라사이트닷컴

    ReplyDelete
  51. I am lucky that I detected this site, just the right information that I was looking for. 파워볼사이트닷컴

    ReplyDelete
  52. Wow! Thanks for sharing it with us... keep it up... Here is some Important information for foreign travelers: India start issuing tourist visas again. Find out all the guidelines and information which is provided by the Indian Government with just one click.

    ReplyDelete
  53. You can learn python form many online platform. If you are not able watch content then use VPN softwares to access the content. I'm using this trick till now and making games with the help of python.

    ReplyDelete
  54. It is very much appreciated sir, Keep it up. Are you interested in traveling in India? We provide Indian e visa information. You can visit our Indian e visas page and read all visa requirements.

    ReplyDelete
  55. This comment has been removed by the author.

    ReplyDelete
  56. This comment has been removed by the author.

    ReplyDelete
  57. Great blog, thanks for sharing this insightful opinion St Louis Gutter Companies

    ReplyDelete
  58. I find this so cool and awesome. Keep sharing! Nicole

    ReplyDelete
  59. Awesome post, the information you shared was resourceful and I enjoyed reading it, thanks for sharing.

    ReplyDelete

  60. I really enjoyed reading this blog. It was explained and structured with perfection.

    ReplyDelete

  61. I want to to thank you for this good read!! I definitely enjoyed every little bit of it.

    ReplyDelete
    Replies
    1. Edmonton Income Tax Preparation Services https://taxedmonton.ca/services/personal-income-tax-return-preparation/

      Delete
    2. https://accountantsedmonton.ca/

      Delete
  62. https://bomcasaccountant.com/personal-and-corporate-tax-accountant-abbotsford-british-columbia/

    ReplyDelete
  63. I really loved it and thank you very much for sharing this with us.Great site with an awesome post. Thanks for sharing.
    Accountants Red Deer

    ReplyDelete
  64. Thanks for the article. Thank you for the help and your work.

    Weather

    ReplyDelete
  65. Nice post! Thanks for sharing this very useful info. concrete company

    ReplyDelete
  66. It's nice seeing this site again. Great work! demolition

    ReplyDelete
  67. Glad to check this blog, it's very informative. concrete contractor

    ReplyDelete
  68. I'm really impressed with your writing skills and the structure of your blog. Did you purchase this theme or did you customize it yourself? It's rare to come across such high-quality content on blogs nowadays.How to apply for e-visa in Cameroon ? To apply for a Cameroon tourist visa, visit the official e-visa application website. Complete the online form, upload required documents including passport and photo, pay the fee, and await approval. Upon approval, download and print the e-visa for presentation upon entry into Cameroon.

    ReplyDelete
  69. Glad to check this site, it's very informative. concrete patio

    ReplyDelete