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.


70 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. Watch movies online sa-movie.com, watch new movies, series Netflix HD 4K หนังฝรั่ง, watch free movies on your mobile phone, Tablet, watch movies on the web.

    SEE4K Watch movies, watch movies, free series, load without interruption, sharp images in HD FullHD 4k, ดูหนังชนโรง all matters, all tastes, see anywhere, anytime, on mobile phones, tablets, computers.

    GangManga read manga, read manga, read manga online for free, fast loading, clear images in HD quality, อ่านมังงะ all titles, anywhere, anytime, on mobile, tablet, computer.

    Watch live football ดูบอลออนไลน์, watch football online, link to watch live football, watch football for free.

    ReplyDelete
  11. 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
  12. Thanks for the nice blog. It was very useful for me. I'm happy I found this blog.
    a1 appliance repair

    ReplyDelete
  13. 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
  14. 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
  15. 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
  16. It's always exciting to read articles from other writers and practice something from their websites.
    Garage Door Repair Doctors

    ReplyDelete
  17. 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
  18. 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
  19. I was exactly searching for. Thanks for such a post and please keep it up.
    garage door repair orleans

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

    ReplyDelete
  21. 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
  22. I was exactly searching for. Thanks for such a post and please keep it up.
    שער כניסה לבית פרטי

    ReplyDelete
  23. This is a wonderful article, Given so much info in it, These type of articles keeps the user's interest in the website.
    אלסק מצלמות אבטחה

    ReplyDelete
  24. 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
  25. This is truly the web service provider I was looking for!
    overhead door vancouver

    ReplyDelete
  26. 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
  27. I was exactly searching for. Thanks for such a post and please keep it up.
    imperial technology

    ReplyDelete
  28. 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
  29. I was exactly searching for. Thanks for such a post and please keep it up.
    garage door repair

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

    ReplyDelete
  31. 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
  32. 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
  33. It's always exciting to read articles from other writers and practice something from their websites.
    window repair

    ReplyDelete
  34. 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
  35. This is truly the web service provider I was looking for!
    garage door repair dallas

    ReplyDelete
  36. 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
  37. 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
  38. 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
  39. Thanks for the nice blog. It was very useful for me. I'm happy I found this blog.
    central air conditioning repair

    ReplyDelete
  40. 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
  41. I was exactly searching for. Thanks for such a post and please keep it up.
    window repair

    ReplyDelete
  42. 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
  43. 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
  44. toptan iç giyim tercih etmenizin sebebi kaliteyi ucuza satın alabilmektir. Ürünler yine orjinaldir ve size sorun yaşatmaz. Yine de bilinen tekstil markalarını tercih etmelisiniz.

    Digitürk başvuru güncel adresine hoşgeldiniz. Hemen başvuru yaparsanız anında kurulum yapmaktayız.

    tutku iç giyim Türkiye'nin önde gelen iç giyim markalarından birisi olmasının yanı sıra en çok satan markalardan birisidir. Ürünleri hem çok kalitelidir hem de pamuk kullanımı daha fazladır.

    nbb sütyen hem kaliteli hem de uygun fiyatlı sütyenler üretmektedir. Sütyene ek olarak sütyen takımı ve jartiyer gibi ürünleri de mevcuttur. Özellikle Avrupa ve Orta Doğu'da çokça tercih edilmektedir.

    yeni inci sütyen kaliteyi ucuz olarak sizlere ulaştırmaktadır. Çok çeşitli sütyen varyantları mevcuttur. iç giyime damga vuran markalardan biridir ve genellikle Avrupa'da ismi sıklıkla duyulur.

    iç giyim ürünlerine her zaman dikkat etmemiz gerekmektedir. Üretimde kullanılan malzemelerin kullanım oranları, kumaşın esnekliği, çekmezlik testi gibi birçok unsuru aynı anda değerlendirerek seçim yapmalıyız.

    iç giyim bayanların erkeklere göre daha dikkatli oldukları bir alandır. Erkeklere göre daha özenli ve daha seçici davranırlar. Biliyorlar ki iç giyimde kullandıkları şeyler kafalarındaki ve ruhlarındaki özellikleri dışa vururlar.

    ReplyDelete
  45. 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
  46. This comment has been removed by the author.

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

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

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

    ReplyDelete
  50. This website was... how do I tell it? Relevant!! I finally found something that helped me. Thanks. Eligible travelers can obtain electronic Visa Turkey by filling an online form with their personal details and passport information.

    ReplyDelete

  51. 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
  52. What a great explanation in yours posts.. International travelers who wish to travel to Azerbaijan for tourism and business purpose need to apply for Azerbaijan electronic visa through e visa application.

    ReplyDelete
  53. Keep up the work, great job! The Kenya government has introduced an online visa system that allows citizens to obtain a visit visa electronically. kenya entry requirements you can check online via kenya visa website.

    ReplyDelete