{"action":"created","issue":{"url":"https://api.github.com/repos/nesbox/TIC-80/issues/618","repository_url":"https://api.github.com/repos/nesbox/TIC-80","labels_url":"https://api.github.com/repos/nesbox/TIC-80/issues/618/labels{/name}","comments_url":"https://api.github.com/repos/nesbox/TIC-80/issues/618/comments","events_url":"https://api.github.com/repos/nesbox/TIC-80/issues/618/events","html_url":"https://github.com/nesbox/TIC-80/issues/618","id":330321308,"node_id":"MDU6SXNzdWUzMzAzMjEzMDg=","number":618,"title":"A viable way to support RaspberryPi (with baremetal)","user":{"login":"msx80","id":2278103,"node_id":"MDQ6VXNlcjIyNzgxMDM=","avatar_url":"https://avatars3.githubusercontent.com/u/2278103?v=4","gravatar_id":"","url":"https://api.github.com/users/msx80","html_url":"https://github.com/msx80","followers_url":"https://api.github.com/users/msx80/followers","following_url":"https://api.github.com/users/msx80/following{/other_user}","gists_url":"https://api.github.com/users/msx80/gists{/gist_id}","starred_url":"https://api.github.com/users/msx80/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/msx80/subscriptions","organizations_url":"https://api.github.com/users/msx80/orgs","repos_url":"https://api.github.com/users/msx80/repos","events_url":"https://api.github.com/users/msx80/events{/privacy}","received_events_url":"https://api.github.com/users/msx80/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-06-07T15:20:45Z","updated_at":"2018-06-15T02:18:51Z","closed_at":null,"author_association":"NONE","body":"So the idea is to support RaspberryPi using baremetal mode, that is, without any operating system and talking directly to the hardware.\r\nThe nice thing about baremetal is that you have full control of the hardware, full speed, zero boot time, a single process, etc. The bad things is that you have to figure out how to talk to each individual piece of hardware, which would be a huge task per se.\r\nFortunately there's [a project called Circle](https://github.com/rsta2/circle/) that already does most of the job, it supports USB (mouse, keyboard, gamepad), audio, screen access, etc. There's plenty of [examples for each specific feature](https://github.com/rsta2/circle/tree/master/sample).\r\nIn particular you have direct access to memory mapped video of the Broadcom video chip, so you just write to a pointer and get things on the screen, completely sidestepping all the usual layers (sdl,opengl,kernel space etc).\r\n[Another project](https://github.com/smuehlst/circle-stdlib) built on top of Circle provides the C and C++ standard libraries built on top of it, providing basic dependencies to build stuff (like Lua)\r\n\r\nSo to port TIC for this platform all it's left to do is changing its \"system interface\" from SDL to circle specific functions (\"easily\" extractable from the samples). As nesbox said, TIC is pretty insulated from SDL and changing the undelying \"engine\" should be feasible.\r\n\r\nThere's already a [ZX spectrum emulator](http://zxmini.speccy.org) that is built around this exact technique (sources are not yet available but should be published, sooner or later).\r\n\r\nI made some experiments (on RPi Zero W) months ago and i managed to:\r\n- set the video mode to arbitrary resolution (ie 320x200) at 8 bit, which gets automatically scaled by the video chip\r\n- putting some stuff on screen\r\n- compile Lua and interface with it\r\n\r\nI have yet to do any performace test but i'm pretty sure that the gain (over regular linux+rpi) will be huge, possibly even enabling RPi Zero as a platform.\r\n\r\nIt's still a lot of work, and ARM has other weak points to deal with (like unaligned memory access), but i think it's at least feasible. I for once would love to see a computer instantly booting into TIC, and i know there's interest for a \"portable\" TIC console that could theoretically be built around this.\r\n\r\nI'll do some more experiments but if anyone wants to join/discuss/contribute, feel free :)"},"comment":{"url":"https://api.github.com/repos/nesbox/TIC-80/issues/comments/397493696","html_url":"https://github.com/nesbox/TIC-80/issues/618#issuecomment-397493696","issue_url":"https://api.github.com/repos/nesbox/TIC-80/issues/618","id":397493696,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NzQ5MzY5Ng==","user":{"login":"hseiken","id":25201804,"node_id":"MDQ6VXNlcjI1MjAxODA0","avatar_url":"https://avatars1.githubusercontent.com/u/25201804?v=4","gravatar_id":"","url":"https://api.github.com/users/hseiken","html_url":"https://github.com/hseiken","followers_url":"https://api.github.com/users/hseiken/followers","following_url":"https://api.github.com/users/hseiken/following{/other_user}","gists_url":"https://api.github.com/users/hseiken/gists{/gist_id}","starred_url":"https://api.github.com/users/hseiken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hseiken/subscriptions","organizations_url":"https://api.github.com/users/hseiken/orgs","repos_url":"https://api.github.com/users/hseiken/repos","events_url":"https://api.github.com/users/hseiken/events{/privacy}","received_events_url":"https://api.github.com/users/hseiken/received_events","type":"User","site_admin":false},"created_at":"2018-06-15T02:18:51Z","updated_at":"2018-06-15T02:18:51Z","author_association":"NONE","body":"Have you thought about using FPGA custom chipset instead of off the shelf solution?"}}
{"actor":{"display_login":"hseiken"}}