gba/docs/searchindex.json

1 line
174 KiB
JSON
Raw Normal View History

2018-11-11 07:44:47 +11:00
{"doc_urls":["introduction.html#introduction","introduction.html#other-works","ch0/index.html#chapter-0-development-setup","ch0/index.html#per-system-setup","ch0/index.html#per-project-setup","ch0/index.html#compiling","ch1/index.html#ch-1-hello-gba","ch1/hello1.html#hello1","ch1/hello1.html#explaining-hello1","ch1/hello1.html#all-those-magic-numbers","ch1/hello1.html#sidebar-volatile","ch1/io_registers.html#io-registers","ch1/the_display_control.html#the-display-control","ch1/the_display_control.html#video-modes","ch1/the_display_control.html#cgb-mode","ch1/the_display_control.html#page-flipping","ch1/the_display_control.html#oam-vram-and-blanking","ch1/the_display_control.html#screen-layers","ch1/the_display_control.html#in-conclusion","ch1/video_memory_intro.html#video-memory-intro","ch1/video_memory_intro.html#rgb15","ch1/video_memory_intro.html#mode-3","ch1/video_memory_intro.html#mode-4","ch1/video_memory_intro.html#mode-5","ch1/video_memory_intro.html#in-conclusion"],"index":{"documentStore":{"docInfo":{"0":{"body":16,"breadcrumbs":1,"title":1},"1":{"body":30,"breadcrumbs":1,"title":1},"10":{"body":141,"breadcrumbs":6,"title":2},"11":{"body":143,"breadcrumbs":6,"title":2},"12":{"body":49,"breadcrumbs":6,"title":2},"13":{"body":170,"breadcrumbs":6,"title":2},"14":{"body":24,"breadcrumbs":6,"title":2},"15":{"body":32,"breadcrumbs":6,"title":2},"16":{"body":57,"breadcrumbs":7,"title":3},"17":{"body":54,"breadcrumbs":6,"title":2},"18":{"body":20,"breadcrumbs":5,"title":1},"19":{"body":88,"breadcrumbs":7,"title":3},"2":{"body":20,"breadcrumbs":4,"title":4},"20":{"body":1,"breadcrumbs":5,"title":1},"21":{"body":1,"breadcrumbs":6,"title":2},"22":{"body":1,"breadcrumbs":6,"title":2},"23":{"body":1,"breadcrumbs":6,"title":2},"24":{"body":1,"breadcrumbs":5,"title":1},"3":{"body":106,"breadcrumbs":3,"title":3},"4":{"body":56,"breadcrumbs":3,"title":3},"5":{"body":385,"breadcrumbs":1,"title":1},"6":{"body":39,"breadcrumbs":4,"title":4},"7":{"body":83,"breadcrumbs":5,"title":1},"8":{"body":245,"breadcrumbs":6,"title":2},"9":{"body":55,"breadcrumbs":7,"title":3}},"docs":{"0":{"body":"Here's a book that'll help you program in Rust on the GBA. It's very \"work in progress\". At the moment there's only one demo program.","breadcrumbs":"Introduction","id":"0","title":"Introduction"},"1":{"body":"If you want to read more about developing on the GBA there are some other good resources as well: Tonc , a tutorial series written for C, but it's what I based the ordering of this book's sections on. GBATEK , a homebrew tech manual for GBA/NDS/DSi. We will regularly link to parts of it when talking about various bits of the GBA.","breadcrumbs":"Other Works","id":"1","title":"Other Works"},"10":{"body":"We'll get into what all that is in a moment, but first let's ask ourselves: Why are we doing volatile writes? You've probably never used it before at all. What is volatile anyway? Well, the optimizer is pretty aggressive some of the time, and so it'll skip reads and writes when it thinks can. Like if you write to a pointer once, and then again a moment later, and it didn't see any other reads in between, it'll think that it can just skip doing that first write since it'll get overwritten anyway. Sometimes that's right, but sometimes it's wrong. Marking a read or write as volatile tells the compiler that it really must do that action, and in the exact order that we wrote it out. It says that there might even be special hardware side effects going on that the compiler isn't aware of. In this case, the Display Control write sets a video mode, and the Video RAM writes set pixels that will show up on the screen. Similar to \"atomic\" operations you might have heard about, all volatile operations are enforced to happen in the exact order that you specify them, but only relative to other volatile operations. So something like c.volatile_write(5);\na += b;\nd.volatile_write(7); might end up changing a either before or after the change to c , but the write to d will always happen after the write to c . If you ever use volatile stuff on other platfor