{"action":"created","issue":{"url":"https://api.github.com/repos/mgba-emu/mgba/issues/1000","repository_url":"https://api.github.com/repos/mgba-emu/mgba","labels_url":"https://api.github.com/repos/mgba-emu/mgba/issues/1000/labels{/name}","comments_url":"https://api.github.com/repos/mgba-emu/mgba/issues/1000/comments","events_url":"https://api.github.com/repos/mgba-emu/mgba/issues/1000/events","html_url":"https://github.com/mgba-emu/mgba/issues/1000","id":299897962,"number":1000,"title":"Pokemon Pinball (GBC) crashes","user":{"login":"Zowayix","id":31366697,"avatar_url":"https://avatars0.githubusercontent.com/u/31366697?v=4","gravatar_id":"","url":"https://api.github.com/users/Zowayix","html_url":"https://github.com/Zowayix","followers_url":"https://api.github.com/users/Zowayix/followers","following_url":"https://api.github.com/users/Zowayix/following{/other_user}","gists_url":"https://api.github.com/users/Zowayix/gists{/gist_id}","starred_url":"https://api.github.com/users/Zowayix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zowayix/subscriptions","organizations_url":"https://api.github.com/users/Zowayix/orgs","repos_url":"https://api.github.com/users/Zowayix/repos","events_url":"https://api.github.com/users/Zowayix/events{/privacy}","received_events_url":"https://api.github.com/users/Zowayix/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-02-24T01:27:47Z","updated_at":"2018-02-24T21:37:17Z","closed_at":null,"author_association":"NONE","body":"In the latest mGBA nightly build, Pokemon Pinball will crash in about a few seconds of gameplay. The menu and Pokedex seem to be fine, but as soon as you actually start playing, it'll just crash seemingly randomly, and reset to a corrupted palette, like this:\r\n![pokemon pinball usa rumble version sgb enhanced gb compatible -0](https://user-images.githubusercontent.com/31366697/36623811-51c4b0a2-195c-11e8-8af8-a5f09fc0a14e.png)\r\n\r\nThis doesn't seem to happen in 0.6.1, just at some point between then and the latest nightly build.\r\n\r\nThere doesn't seem to be any particular thing that triggers the crash, though the ball falling down the middle seems to always crash, if it hasn't crashed before then. My first theory was that it was rumble-related, but sometimes the ball ends up hitting one of the bumpers and I can feel a (pretty weak) rumble on my controller (Logitech F710), so that part's fine.\r\n\r\nIt'll even crash after a while if you just leave the ball there at the beginning and never launch it.\r\n\r\nTested on European, USA, and Japanese versions just to make sure; it all happens.\r\n\r\nmGBA build: 0.7-5037-523fb63c (compiled from the most recent git)\r\nPC specs:\r\n - PC 1: Xubuntu 17.10, Intel i7-3720QM @ 2.6GHz, integrated Ivy Bridge graphics\r\n - PC 2: Antergos (fully updated), AMD A4-1200 @ 1GHz, integrated AMD 8180G\r\n\r\nI think that should be everything I needed to mention."},"comment":{"url":"https://api.github.com/repos/mgba-emu/mgba/issues/comments/368262224","html_url":"https://github.com/mgba-emu/mgba/issues/1000#issuecomment-368262224","issue_url":"https://api.github.com/repos/mgba-emu/mgba/issues/1000","id":368262224,"user":{"login":"endrift","id":605502,"avatar_url":"https://avatars3.githubusercontent.com/u/605502?v=4","gravatar_id":"","url":"https://api.github.com/users/endrift","html_url":"https://github.com/endrift","followers_url":"https://api.github.com/users/endrift/followers","following_url":"https://api.github.com/users/endrift/following{/other_user}","gists_url":"https://api.github.com/users/endrift/gists{/gist_id}","starred_url":"https://api.github.com/users/endrift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/endrift/subscriptions","organizations_url":"https://api.github.com/users/endrift/orgs","repos_url":"https://api.github.com/users/endrift/repos","events_url":"https://api.github.com/users/endrift/events{/privacy}","received_events_url":"https://api.github.com/users/endrift/received_events","type":"User","site_admin":false},"created_at":"2018-02-24T21:37:17Z","updated_at":"2018-02-24T21:37:17Z","author_association":"OWNER","body":"This is a really weird case because it's sitting on an edge case in interrupt handling that I don't know how to deal with properly:\r\n\r\n```A: 00 F: A0 (AF: 00A0)\r\nB: 15 C: 67 (BC: 1567)\r\nD: 01 E: 70 (DE: 0170)\r\nH: FF L: FF (HL: FFFF)\r\nPC: 0565 SP: DFF7\r\nROM: 03 RAM: 00 WRAM: 01 VRAM: 00\r\n[Z-H-]\r\n00:0565:  3600\tld [hl], $00```\r\n\r\nIt writes $00 to `IE` to try to disable interrupts but sometimes it does this at the same time as an IRQ firing. There's a small window where the IRQ has been asserted so the hardware will jump to the interrupt vector as soon as the instruction is over *but* the instruction can write to the interrupts enabled register before it ends. When this happens it jumps to 0 because it sees and interrupt was asserted but it can't find the interrupt vector associated."}}
{"actor":{"display_login":"endrift"}}