{"url":"https://api.github.com/repos/stella-emu/stella/issues/606","repository_url":"https://api.github.com/repos/stella-emu/stella","labels_url":"https://api.github.com/repos/stella-emu/stella/issues/606/labels{/name}","comments_url":"https://api.github.com/repos/stella-emu/stella/issues/606/comments","events_url":"https://api.github.com/repos/stella-emu/stella/issues/606/events","html_url":"https://github.com/stella-emu/stella/issues/606","id":592445835,"node_id":"MDU6SXNzdWU1OTI0NDU4MzU=","number":606,"title":"Emulate RIOT Timer behavior on read/write at the wraparound cycle","user":{"login":"ale-79","id":24704739,"node_id":"MDQ6VXNlcjI0NzA0NzM5","avatar_url":"https://avatars.githubusercontent.com/u/24704739?v=4","gravatar_id":"","url":"https://api.github.com/users/ale-79","html_url":"https://github.com/ale-79","followers_url":"https://api.github.com/users/ale-79/followers","following_url":"https://api.github.com/users/ale-79/following{/other_user}","gists_url":"https://api.github.com/users/ale-79/gists{/gist_id}","starred_url":"https://api.github.com/users/ale-79/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ale-79/subscriptions","organizations_url":"https://api.github.com/users/ale-79/orgs","repos_url":"https://api.github.com/users/ale-79/repos","events_url":"https://api.github.com/users/ale-79/events{/privacy}","received_events_url":"https://api.github.com/users/ale-79/received_events","type":"User","user_view_type":"public","site_admin":false},"labels":[{"id":453306378,"node_id":"MDU6TGFiZWw0NTMzMDYzNzg=","url":"https://api.github.com/repos/stella-emu/stella/labels/bug","name":"bug","color":"ff2020","default":true,"description":"","archived_at":null,"archived_by":null},{"id":497208665,"node_id":"MDU6TGFiZWw0OTcyMDg2NjU=","url":"https://api.github.com/repos/stella-emu/stella/labels/needs%20research","name":"needs research","color":"f9d0c4","default":false,"description":null,"archived_at":null,"archived_by":null}],"state":"closed","locked":false,"assignees":[{"login":"sa666666","id":16061066,"node_id":"MDQ6VXNlcjE2MDYxMDY2","avatar_url":"https://avatars.githubusercontent.com/u/16061066?v=4","gravatar_id":"","url":"https://api.github.com/users/sa666666","html_url":"https://github.com/sa666666","followers_url":"https://api.github.com/users/sa666666/followers","following_url":"https://api.github.com/users/sa666666/following{/other_user}","gists_url":"https://api.github.com/users/sa666666/gists{/gist_id}","starred_url":"https://api.github.com/users/sa666666/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sa666666/subscriptions","organizations_url":"https://api.github.com/users/sa666666/orgs","repos_url":"https://api.github.com/users/sa666666/repos","events_url":"https://api.github.com/users/sa666666/events{/privacy}","received_events_url":"https://api.github.com/users/sa666666/received_events","type":"User","user_view_type":"public","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/stella-emu/stella/milestones/2","html_url":"https://github.com/stella-emu/stella/milestone/2","labels_url":"https://api.github.com/repos/stella-emu/stella/milestones/2/labels","id":2710029,"node_id":"MDk6TWlsZXN0b25lMjcxMDAyOQ==","number":2,"title":"Prio 2","description":null,"creator":{"login":"thrust26","id":24360774,"node_id":"MDQ6VXNlcjI0MzYwNzc0","avatar_url":"https://avatars.githubusercontent.com/u/24360774?v=4","gravatar_id":"","url":"https://api.github.com/users/thrust26","html_url":"https://github.com/thrust26","followers_url":"https://api.github.com/users/thrust26/followers","following_url":"https://api.github.com/users/thrust26/following{/other_user}","gists_url":"https://api.github.com/users/thrust26/gists{/gist_id}","starred_url":"https://api.github.com/users/thrust26/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thrust26/subscriptions","organizations_url":"https://api.github.com/users/thrust26/orgs","repos_url":"https://api.github.com/users/thrust26/repos","events_url":"https://api.github.com/users/thrust26/events{/privacy}","received_events_url":"https://api.github.com/users/thrust26/received_events","type":"User","user_view_type":"public","site_admin":false},"open_issues":41,"closed_issues":334,"state":"open","created_at":"2017-08-18T17:24:37Z","updated_at":"2026-11-08T07:56:36Z","due_on":null,"closed_at":null},"comments":21,"created_at":"2020-04-02T08:20:41Z","updated_at":"2020-10-05T19:20:25Z","closed_at":"2020-10-05T19:20:25Z","assignee":{"login":"sa666666","id":16061066,"node_id":"MDQ6VXNlcjE2MDYxMDY2","avatar_url":"https://avatars.githubusercontent.com/u/16061066?v=4","gravatar_id":"","url":"https://api.github.com/users/sa666666","html_url":"https://github.com/sa666666","followers_url":"https://api.github.com/users/sa666666/followers","following_url":"https://api.github.com/users/sa666666/following{/other_user}","gists_url":"https://api.github.com/users/sa666666/gists{/gist_id}","starred_url":"https://api.github.com/users/sa666666/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sa666666/subscriptions","organizations_url":"https://api.github.com/users/sa666666/orgs","repos_url":"https://api.github.com/users/sa666666/repos","events_url":"https://api.github.com/users/sa666666/events{/privacy}","received_events_url":"https://api.github.com/users/sa666666/received_events","type":"User","user_view_type":"public","site_admin":false},"author_association":"NONE","issue_field_values":[],"type":null,"active_lock_reason":null,"sub_issues_summary":{"total":0,"completed":0,"percent_completed":0},"issue_dependencies_summary":{"blocked_by":0,"total_blocked_by":0,"blocking":0,"total_blocking":0},"body":"Full discussion here: [https://atariage.com/forums/topic/303277-to-roll-or-not-to-roll/](https://atariage.com/forums/topic/303277-to-roll-or-not-to-roll/)\r\n\r\nThe behaviour should be the following:\r\n\r\n1- If the interrupt flag (bit 7 of TIMINT) is set, the programmed divider is ignored and the timer counts at 1T rate.\r\n\r\n2- Whenever the timer wrapsaround from 0 to $FF, the interrupt flag is set. (if it was already set, it stays that way)\r\n\r\n3- Writing or reading the timer clears the interrupt flag, unless the read/write happens at the exact wraparound cycle, in which case the flag is set afterwards. \r\n\r\n\r\n\r\n(1) and (2) are already emulated. (3) is not emulated for write accesses. It might be already working for read accesses, as that part is in the 6532 datasheet (Needs verification)\r\n\r\n\r\nTODO:\r\n- Confirm on real hardware in case of read access, both on the first wraparound and on subsequent ones (when the interrupt flag is already set)\r\n- Confirm on write access on the first wraparound. (Write on subsequent ones was the issue with the rom in the thread on AA and has been confirmed)\r\n- Once emulation is fixed, add a developer option to break on timer accesses on wraparound cycle.\r\n  ","closed_by":{"login":"sa666666","id":16061066,"node_id":"MDQ6VXNlcjE2MDYxMDY2","avatar_url":"https://avatars.githubusercontent.com/u/16061066?v=4","gravatar_id":"","url":"https://api.github.com/users/sa666666","html_url":"https://github.com/sa666666","followers_url":"https://api.github.com/users/sa666666/followers","following_url":"https://api.github.com/users/sa666666/following{/other_user}","gists_url":"https://api.github.com/users/sa666666/gists{/gist_id}","starred_url":"https://api.github.com/users/sa666666/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sa666666/subscriptions","organizations_url":"https://api.github.com/users/sa666666/orgs","repos_url":"https://api.github.com/users/sa666666/repos","events_url":"https://api.github.com/users/sa666666/events{/privacy}","received_events_url":"https://api.github.com/users/sa666666/received_events","type":"User","user_view_type":"public","site_admin":false},"reactions":{"url":"https://api.github.com/repos/stella-emu/stella/issues/606/reactions","total_count":1,"+1":1,"-1":0,"laugh":0,"hooray":0,"confused":0,"heart":0,"rocket":0,"eyes":0},"timeline_url":"https://api.github.com/repos/stella-emu/stella/issues/606/timeline","performed_via_github_app":null,"state_reason":"completed","pinned_comment":null}