├── .clang-format ├── .clang_complete ├── .clangd ├── .gitignore ├── LICENSE ├── cross_file.ini ├── docs ├── annotated.html ├── arch_2display_2tilemap_8h_source.html ├── bc_s.png ├── bdwn.png ├── bitmap_8h_source.html ├── classes.html ├── classgba_1_1display_1_1BackgroundControl-members.html ├── classgba_1_1display_1_1BackgroundControl.html ├── classgba_1_1display_1_1Color-members.html ├── classgba_1_1display_1_1Color.html ├── classgba_1_1display_1_1WindowControl-members.html ├── classgba_1_1display_1_1WindowControl.html ├── classgba_1_1display_1_1map_1_1Tile-members.html ├── classgba_1_1display_1_1map_1_1Tile.html ├── classgba_1_1display_1_1map_1_1details_1_1TileIndex-members.html ├── classgba_1_1display_1_1map_1_1details_1_1TileIndex.html ├── classgba_1_1graphics_1_1Map-members.html ├── classgba_1_1graphics_1_1Map.html ├── classgba_1_1graphics_1_1Palette-members.html ├── classgba_1_1graphics_1_1Palette.html ├── classgba_1_1graphics_1_1PalettedBitmap-members.html ├── classgba_1_1graphics_1_1PalettedBitmap.html ├── classgba_1_1graphics_1_1TiledBitmap-members.html ├── classgba_1_1graphics_1_1TiledBitmap.html ├── classgba_1_1graphics_1_1Tilemap-members.html ├── classgba_1_1graphics_1_1Tilemap.html ├── classgba_1_1graphics_1_1Tileset-members.html ├── classgba_1_1graphics_1_1Tileset.html ├── closed.png ├── dir_2aa70d42d36f2a9f8621d014746a51d6.html ├── dir_4b217d31fa69f08cb8cd05da7f9e2dd8.html ├── dir_4ec1b1598b4149375ef6f1696c5f8266.html ├── dir_5b80b7cb2b0029a2cdd17109ca8e7539.html ├── dir_82237e4e910c169b41fbe2a111821c46.html ├── dir_af6cd9beece7c413ba9713af96f1292a.html ├── dir_d44c64559bbebec7f509842c48db8b23.html ├── dir_dcc03c2e2323811097c160fa366bd9dc.html ├── dir_fae3efda648929c13d4b3601518ccdb2.html ├── directsound_8h_source.html ├── doc.png ├── doxy.conf ├── doxy.css ├── doxygen.css ├── doxygen.png ├── dynsections.js ├── effects_8h_source.html ├── engine_2graphics_2tilemap_8h_source.html ├── files.html ├── folderclosed.png ├── folderopen.png ├── functions.html ├── functions_func.html ├── functions_vars.html ├── general_8h_source.html ├── geometry_8h_source.html ├── graphics_8h_source.html ├── index.html ├── input_8h_source.html ├── interrupts_8h_source.html ├── jquery.js ├── layers_8h_source.html ├── map_8h_source.html ├── menu.js ├── menudata.js ├── namespacegba_1_1arch.html ├── namespacegba_1_1arch_1_1registers.html ├── namespacegba_1_1arch_1_1registers_1_1display.html ├── namespacegba_1_1arch_1_1registers_1_1io.html ├── namespacegba_1_1arch_1_1registers_1_1sound.html ├── namespacegba_1_1display_1_1map.html ├── namespacegba_1_1display_1_1mode3.html ├── namespacegba_1_1display_1_1mode4.html ├── namespacegba_1_1display_1_1mode5.html ├── namespacegba_1_1graphics.html ├── namespacemembers.html ├── namespacemembers_func.html ├── namespacemembers_vars.html ├── namespaces.html ├── namespaceutils.html ├── nav_f.png ├── nav_g.png ├── nav_h.png ├── objects_8h_source.html ├── open.png ├── palette_8h_source.html ├── registers_8h_source.html ├── search │ ├── all_0.html │ ├── all_0.js │ ├── all_1.html │ ├── all_1.js │ ├── all_2.html │ ├── all_2.js │ ├── all_3.html │ ├── all_3.js │ ├── all_4.html │ ├── all_4.js │ ├── all_5.html │ ├── all_5.js │ ├── all_6.html │ ├── all_6.js │ ├── all_7.html │ ├── all_7.js │ ├── all_8.html │ ├── all_8.js │ ├── all_9.html │ ├── all_9.js │ ├── all_a.html │ ├── all_a.js │ ├── all_b.html │ ├── all_b.js │ ├── all_c.html │ ├── all_c.js │ ├── all_d.html │ ├── all_d.js │ ├── all_e.html │ ├── all_e.js │ ├── classes_0.html │ ├── classes_0.js │ ├── classes_1.html │ ├── classes_1.js │ ├── classes_2.html │ ├── classes_2.js │ ├── classes_3.html │ ├── classes_3.js │ ├── classes_4.html │ ├── classes_4.js │ ├── classes_5.html │ ├── classes_5.js │ ├── classes_6.html │ ├── classes_6.js │ ├── classes_7.html │ ├── classes_7.js │ ├── classes_8.html │ ├── classes_8.js │ ├── close.png │ ├── functions_0.html │ ├── functions_0.js │ ├── functions_1.html │ ├── functions_1.js │ ├── functions_2.html │ ├── functions_2.js │ ├── functions_3.html │ ├── functions_3.js │ ├── functions_4.html │ ├── functions_4.js │ ├── functions_5.html │ ├── functions_5.js │ ├── functions_6.html │ ├── functions_6.js │ ├── functions_7.html │ ├── functions_7.js │ ├── functions_8.html │ ├── functions_8.js │ ├── functions_9.html │ ├── functions_9.js │ ├── functions_a.html │ ├── functions_a.js │ ├── functions_b.html │ ├── functions_b.js │ ├── functions_c.html │ ├── functions_c.js │ ├── functions_d.html │ ├── functions_d.js │ ├── mag_sel.png │ ├── namespaces_0.html │ ├── namespaces_0.js │ ├── namespaces_1.html │ ├── namespaces_1.js │ ├── nomatches.html │ ├── pages_0.html │ ├── pages_0.js │ ├── search.css │ ├── search.js │ ├── search_l.png │ ├── search_m.png │ ├── search_r.png │ ├── searchdata.js │ ├── variables_0.html │ ├── variables_0.js │ ├── variables_1.html │ ├── variables_1.js │ ├── variables_2.html │ ├── variables_2.js │ ├── variables_3.html │ ├── variables_3.js │ ├── variables_4.html │ ├── variables_4.js │ ├── variables_5.html │ ├── variables_5.js │ ├── variables_6.html │ ├── variables_6.js │ ├── variables_7.html │ └── variables_7.js ├── sound_8h_source.html ├── splitbar.png ├── structgba_1_1display_1_1WindowPosition-members.html ├── structgba_1_1display_1_1WindowPosition.html ├── structgba_1_1geometry_1_1Point-members.html ├── structgba_1_1geometry_1_1Point.html ├── structgba_1_1geometry_1_1Rect-members.html ├── structgba_1_1geometry_1_1Rect.html ├── structgba_1_1geometry_1_1Size-members.html ├── structgba_1_1geometry_1_1Size.html ├── sync_off.png ├── sync_on.png ├── tab_a.png ├── tab_b.png ├── tab_h.png ├── tab_s.png ├── tabs.css ├── uniongba_1_1display_1_1VRAMData-members.html ├── uniongba_1_1display_1_1VRAMData.html ├── video_8h_source.html └── window_8h_source.html ├── libgba-cpp ├── arch │ ├── cpu │ │ ├── interrupts.cpp │ │ └── interrupts.h │ ├── display │ │ ├── effects.cpp │ │ ├── effects.h │ │ ├── layers.cpp │ │ ├── layers.h │ │ ├── objects.cpp │ │ ├── objects.h │ │ ├── tilemap.cpp │ │ ├── tilemap.h │ │ ├── video.cpp │ │ ├── video.h │ │ ├── window.cpp │ │ └── window.h │ ├── meson.build │ ├── registers.h │ └── sound │ │ ├── directsound.cpp │ │ ├── directsound.h │ │ ├── sound.cpp │ │ └── sound.h ├── engine │ ├── graphics │ │ ├── bitmap.cpp │ │ ├── bitmap.h │ │ ├── graphics.h │ │ ├── map.h │ │ ├── maps.h │ │ ├── palette.cpp │ │ ├── palette.h │ │ └── tilemap.h │ ├── input.cpp │ ├── input.h │ └── meson.build ├── meson.build └── utils │ ├── general.h │ └── geometry.h ├── meson.build ├── meson_options.txt ├── readme.md ├── specs ├── gba.specs.in ├── gba_cart.ld ├── gba_crt0.s ├── gba_er.ld ├── gba_er.specs ├── gba_mb.ld ├── gba_mb.specs └── meson.build ├── tests ├── alphablend │ ├── main.cpp │ ├── readme.md │ ├── sample_map.h │ ├── sample_tiles.h │ └── screenshots │ │ ├── alphablend-0.png │ │ └── alphablend-1.png ├── gen_tilemap │ ├── forest_tileset.cpp │ ├── forest_tileset.h │ ├── main.cpp │ ├── map001.cpp │ ├── map001.h │ ├── meson.build │ ├── readme.md │ ├── sample_map.h │ └── screenshots │ │ └── gen_tilemap-0.png ├── interrupts │ ├── main.cpp │ └── readme.md ├── meson.build ├── mode5 │ ├── main.cpp │ ├── readme.md │ └── screenshots │ │ ├── mode5-0.png │ │ └── mode5-1.png ├── mosaic │ ├── main.cpp │ ├── readme.md │ ├── sample_map.h │ └── sample_tiles.h ├── pong │ ├── .gitignore │ ├── cross_file.ini │ ├── main.cpp │ ├── meson.build │ ├── readme.md │ └── screenshots │ │ └── pong-0.png ├── sound │ ├── main.cpp │ └── readme.md ├── tilemap │ ├── main.cpp │ ├── readme.md │ ├── sample.cpp │ ├── sample.h │ ├── sample_map.cpp │ ├── sample_map.h │ └── screenshots │ │ └── tilemap-0.png └── windowing │ ├── main.cpp │ ├── readme.md │ ├── sample_map.h │ ├── sample_tiles.h │ └── screenshots │ └── windowing-0.png └── tools └── readme.md /.clang_complete: -------------------------------------------------------------------------------- 1 | -std=c++17 2 | -mthumb 3 | -------------------------------------------------------------------------------- /.clangd: -------------------------------------------------------------------------------- 1 | CompileFlags: 2 | Add: [ 3 | -isystem=/opt/devkitpro/devkitARM/arm-none-eabi/include, 4 | -I/opt/devkitpro/devkitARM/arm-none-eabi/include/c++/13.2.0, 5 | -I/opt/devkitpro/devkitARM/arm-none-eabi/include, 6 | -I/opt/devkitpro/devkitARM/arm-none-eabi/include/c++/13.2.0/arm-none-eabi/, 7 | ] 8 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Really specific 2 | gba.specs 3 | 4 | # Build system 5 | build 6 | 7 | # IDE configs 8 | .vscode 9 | # Generated by clangd 10 | .cache 11 | 12 | # Emulator temporaries 13 | **/*.log 14 | **/*.sav 15 | 16 | # Python environment 17 | **/.venv 18 | **/__pycache__ 19 | 20 | # Prerequisites 21 | *.d 22 | 23 | # Compiled Object files 24 | *.slo 25 | *.lo 26 | *.o 27 | *.obj 28 | *.elf 29 | 30 | # Precompiled Headers 31 | *.gch 32 | *.pch 33 | 34 | # Compiled Dynamic libraries 35 | *.so 36 | *.dylib 37 | *.dll 38 | 39 | # Compiled Static libraries 40 | *.lai 41 | *.la 42 | *.a 43 | *.lib 44 | 45 | # Executables 46 | *.exe 47 | *.out 48 | *.app 49 | *.gba 50 | 51 | # Media 52 | *.xcf 53 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 João Paulo Taylor Ienczak Zanette 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /cross_file.ini: -------------------------------------------------------------------------------- 1 | # vi:syntax=toml 2 | [binaries] 3 | c = 'arm-none-eabi-gcc' 4 | cpp = 'arm-none-eabi-g++' 5 | ar = 'arm-none-eabi-ar' 6 | strip = 'arm-none-eabi-strip' 7 | 8 | [built-in options] 9 | cpp_eh = 'none' 10 | cpp_rtti = false 11 | cpp_args = [ 12 | '-ffast-math', 13 | '-fomit-frame-pointer', 14 | '-mthumb-interwork', ] 15 | default_library = 'static' 16 | 17 | [host_machine] 18 | system = 'none' 19 | cpu_family = 'arm' 20 | cpu = 'arm7tdmi' 21 | endian = 'little' 22 | 23 | [target_machine] 24 | system = 'none' 25 | cpu_family = 'arm' 26 | cpu = 'arm7tdmi' 27 | endian = 'little' 28 | -------------------------------------------------------------------------------- /docs/bc_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPTIZ/libgba-cpp/434211c92423fff67b4f574e055838c3d1d20f5f/docs/bc_s.png -------------------------------------------------------------------------------- /docs/bdwn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPTIZ/libgba-cpp/434211c92423fff67b4f574e055838c3d1d20f5f/docs/bdwn.png -------------------------------------------------------------------------------- /docs/closed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPTIZ/libgba-cpp/434211c92423fff67b4f574e055838c3d1d20f5f/docs/closed.png -------------------------------------------------------------------------------- /docs/dir_4ec1b1598b4149375ef6f1696c5f8266.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | LibGBA-CPP: include/libgba-cpp Directory Reference 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 |
21 | 22 | 23 | 24 | 29 | 30 | 31 |
25 |
LibGBA-CPP 26 |  Alpha 0.1 27 |
28 |
32 |
33 | 34 | 35 | 40 | 41 | 42 | 49 | 50 | 51 |
55 |
56 | 57 | 58 |
59 | 62 |
63 | 64 | 68 |
69 |
70 |
71 |
libgba-cpp Directory Reference
72 |
73 |
74 | 75 | 77 |

76 | Directories

78 |
79 | 80 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /docs/dir_5b80b7cb2b0029a2cdd17109ca8e7539.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | LibGBA-CPP: include/libgba-cpp/utils Directory Reference 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 |
21 | 22 | 23 | 24 | 29 | 30 | 31 |
25 |
LibGBA-CPP 26 |  Alpha 0.1 27 |
28 |
32 |
33 | 34 | 35 | 40 | 41 | 42 | 49 | 50 | 51 |
55 |
56 | 57 | 58 |
59 | 62 |
63 | 64 | 68 |
69 |
70 |
71 |
utils Directory Reference
72 |
73 |
74 |
75 | 76 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /docs/dir_82237e4e910c169b41fbe2a111821c46.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | LibGBA-CPP: include/libgba-cpp/arch/cpu Directory Reference 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 |
21 | 22 | 23 | 24 | 29 | 30 | 31 |
25 |
LibGBA-CPP 26 |  Alpha 0.1 27 |
28 |
32 |
33 | 34 | 35 | 40 | 41 | 42 | 49 | 50 | 51 |
55 |
56 | 57 | 58 |
59 | 62 |
63 | 64 | 68 |
69 |
70 |
71 |
cpu Directory Reference
72 |
73 |
74 |
75 | 76 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /docs/dir_af6cd9beece7c413ba9713af96f1292a.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | LibGBA-CPP: include/libgba-cpp/engine/graphics Directory Reference 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 |
21 | 22 | 23 | 24 | 29 | 30 | 31 |
25 |
LibGBA-CPP 26 |  Alpha 0.1 27 |
28 |
32 |
33 | 34 | 35 | 40 | 41 | 42 | 49 | 50 | 51 |
55 |
56 | 57 | 58 |
59 | 62 |
63 | 64 | 68 |
69 |
70 |
71 |
graphics Directory Reference
72 |
73 |
74 |
75 | 76 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /docs/dir_d44c64559bbebec7f509842c48db8b23.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | LibGBA-CPP: include Directory Reference 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 |
21 | 22 | 23 | 24 | 29 | 30 | 31 |
25 |
LibGBA-CPP 26 |  Alpha 0.1 27 |
28 |
32 |
33 | 34 | 35 | 40 | 41 | 42 | 49 | 50 | 51 |
55 |
56 | 57 | 58 |
59 | 62 |
63 | 64 | 68 |
69 |
70 |
71 |
include Directory Reference
72 |
73 |
74 |
75 | 76 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /docs/dir_dcc03c2e2323811097c160fa366bd9dc.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | LibGBA-CPP: include/libgba-cpp/arch/display Directory Reference 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 |
21 | 22 | 23 | 24 | 29 | 30 | 31 |
25 |
LibGBA-CPP 26 |  Alpha 0.1 27 |
28 |
32 |
33 | 34 | 35 | 40 | 41 | 42 | 49 | 50 | 51 |
55 |
56 | 57 | 58 |
59 | 62 |
63 | 64 | 68 |
69 |
70 |
71 |
display Directory Reference
72 |
73 |
74 |
75 | 76 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /docs/dir_fae3efda648929c13d4b3601518ccdb2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | LibGBA-CPP: include/libgba-cpp/arch/sound Directory Reference 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 |
21 | 22 | 23 | 24 | 29 | 30 | 31 |
25 |
LibGBA-CPP 26 |  Alpha 0.1 27 |
28 |
32 |
33 | 34 | 35 | 40 | 41 | 42 | 49 | 50 | 51 |
55 |
56 | 57 | 58 |
59 | 62 |
63 | 64 | 68 |
69 |
70 |
71 |
sound Directory Reference
72 |
73 |
74 |
75 | 76 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /docs/doc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPTIZ/libgba-cpp/434211c92423fff67b4f574e055838c3d1d20f5f/docs/doc.png -------------------------------------------------------------------------------- /docs/doxy.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPTIZ/libgba-cpp/434211c92423fff67b4f574e055838c3d1d20f5f/docs/doxy.css -------------------------------------------------------------------------------- /docs/doxygen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPTIZ/libgba-cpp/434211c92423fff67b4f574e055838c3d1d20f5f/docs/doxygen.png -------------------------------------------------------------------------------- /docs/folderclosed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPTIZ/libgba-cpp/434211c92423fff67b4f574e055838c3d1d20f5f/docs/folderclosed.png -------------------------------------------------------------------------------- /docs/folderopen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPTIZ/libgba-cpp/434211c92423fff67b4f574e055838c3d1d20f5f/docs/folderopen.png -------------------------------------------------------------------------------- /docs/menu.js: -------------------------------------------------------------------------------- 1 | /* 2 | @licstart The following is the entire license notice for the 3 | JavaScript code in this file. 4 | 5 | Copyright (C) 1997-2017 by Dimitri van Heesch 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation; either version 2 of the License, or 10 | (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License along 18 | with this program; if not, write to the Free Software Foundation, Inc., 19 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 20 | 21 | @licend The above is the entire license notice 22 | for the JavaScript code in this file 23 | */ 24 | function initMenu(relPath,searchEnabled,serverSide,searchPage,search) { 25 | function makeTree(data,relPath) { 26 | var result=''; 27 | if ('children' in data) { 28 | result+=''; 35 | } 36 | return result; 37 | } 38 | 39 | $('#main-nav').append(makeTree(menudata,relPath)); 40 | $('#main-nav').children(':first').addClass('sm sm-dox').attr('id','main-menu'); 41 | if (searchEnabled) { 42 | if (serverSide) { 43 | $('#main-menu').append('
  • '); 44 | } else { 45 | $('#main-menu').append('
  • '); 46 | } 47 | } 48 | $('#main-menu').smartmenus(); 49 | } 50 | /* @license-end */ 51 | -------------------------------------------------------------------------------- /docs/menudata.js: -------------------------------------------------------------------------------- 1 | /* 2 | @licstart The following is the entire license notice for the 3 | JavaScript code in this file. 4 | 5 | Copyright (C) 1997-2019 by Dimitri van Heesch 6 | 7 | This program is free software; you can redistribute it and/or modify 8 | it under the terms of version 2 of the GNU General Public License as published by 9 | the Free Software Foundation 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License along 17 | with this program; if not, write to the Free Software Foundation, Inc., 18 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 19 | 20 | @licend The above is the entire license notice 21 | for the JavaScript code in this file 22 | */ 23 | var menudata={children:[ 24 | {text:"Main Page",url:"index.html"}]} 25 | -------------------------------------------------------------------------------- /docs/nav_f.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPTIZ/libgba-cpp/434211c92423fff67b4f574e055838c3d1d20f5f/docs/nav_f.png -------------------------------------------------------------------------------- /docs/nav_g.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPTIZ/libgba-cpp/434211c92423fff67b4f574e055838c3d1d20f5f/docs/nav_g.png -------------------------------------------------------------------------------- /docs/nav_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPTIZ/libgba-cpp/434211c92423fff67b4f574e055838c3d1d20f5f/docs/nav_h.png -------------------------------------------------------------------------------- /docs/open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPTIZ/libgba-cpp/434211c92423fff67b4f574e055838c3d1d20f5f/docs/open.png -------------------------------------------------------------------------------- /docs/search/all_0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    11 |
    Loading...
    12 |
    13 | 18 |
    Searching...
    19 |
    No Matches
    20 | 28 |
    29 | 30 | 31 | -------------------------------------------------------------------------------- /docs/search/all_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['libgba_20_2d_20cpp_0',['LibGBA - CPP',['../index.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/search/all_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    11 |
    Loading...
    12 |
    13 | 18 |
    Searching...
    19 |
    No Matches
    20 | 28 |
    29 | 30 | 31 | -------------------------------------------------------------------------------- /docs/search/all_1.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['b',['b',['../classgba_1_1display_1_1Color.html#ac3604d8b56fb4490457b13d2f1afb7f7',1,'gba::display::Color']]], 4 | ['backgroundcontrol',['BackgroundControl',['../classgba_1_1display_1_1BackgroundControl.html',1,'gba::display']]], 5 | ['bg0_5fx_5foffset',['bg0_x_offset',['../namespacegba_1_1arch_1_1registers_1_1display.html#a2618a53b67d21bce5027aaa7ed8afe05',1,'gba::arch::registers::display']]], 6 | ['bg0_5fy_5foffset',['bg0_y_offset',['../namespacegba_1_1arch_1_1registers_1_1display.html#a6c9116b6d6989b126f957b3daae723fe',1,'gba::arch::registers::display']]], 7 | ['bg1_5fx_5foffset',['bg1_x_offset',['../namespacegba_1_1arch_1_1registers_1_1display.html#a46aae9d08879d0339c35e02b90e889e1',1,'gba::arch::registers::display']]], 8 | ['bg1_5fy_5foffset',['bg1_y_offset',['../namespacegba_1_1arch_1_1registers_1_1display.html#a4e6dfb2de4dc60dbbcafa2e171e86b39',1,'gba::arch::registers::display']]], 9 | ['bg2_5fx_5foffset',['bg2_x_offset',['../namespacegba_1_1arch_1_1registers_1_1display.html#a6d9f4f33127334f576c6af16b0743647',1,'gba::arch::registers::display']]], 10 | ['bg2_5fy_5foffset',['bg2_y_offset',['../namespacegba_1_1arch_1_1registers_1_1display.html#a553c5f399ed87846d2ca9b79b46e600b',1,'gba::arch::registers::display']]], 11 | ['bg3_5fx_5foffset',['bg3_x_offset',['../namespacegba_1_1arch_1_1registers_1_1display.html#aeeb49a47def1726400915f4a31e1ded4',1,'gba::arch::registers::display']]], 12 | ['bg3_5fy_5foffset',['bg3_y_offset',['../namespacegba_1_1arch_1_1registers_1_1display.html#a9cb67574ef8906bcafa1a3ff78c6b300',1,'gba::arch::registers::display']]], 13 | ['bg_5fcontrols',['bg_controls',['../namespacegba_1_1arch_1_1registers_1_1display.html#ac02ee78092eb78943699aa4f7bec303d',1,'gba::arch::registers::display']]], 14 | ['bottom',['bottom',['../structgba_1_1display_1_1WindowPosition.html#a9f400285b2c5f363a4452daa64f7571a',1,'gba::display::WindowPosition']]] 15 | ]; 16 | -------------------------------------------------------------------------------- /docs/search/all_2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    11 |
    Loading...
    12 |
    13 | 18 |
    Searching...
    19 |
    No Matches
    20 | 28 |
    29 | 30 | 31 | -------------------------------------------------------------------------------- /docs/search/all_2.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['c',['c',['../uniongba_1_1display_1_1VRAMData.html#a2188d2604d9deffa71841a36fca4bc46',1,'gba::display::VRAMData']]], 4 | ['char_5fbase_5fblock',['char_base_block',['../classgba_1_1display_1_1BackgroundControl.html#a978d897de962406ca253dfd7c32d7393',1,'gba::display::BackgroundControl']]], 5 | ['color',['Color',['../classgba_1_1display_1_1Color.html',1,'gba::display::Color'],['../classgba_1_1display_1_1Color.html#a3d78116b31a209e2459356c6d573b02c',1,'gba::display::Color::Color()=default'],['../classgba_1_1display_1_1Color.html#a97eb0485395fb290f36f1b5f92d9a813',1,'gba::display::Color::Color(unsigned value)'],['../classgba_1_1display_1_1Color.html#a673e8b66b79063c55bb1c36387866d5e',1,'gba::display::Color::Color(int r, int g, int b)'],['../uniongba_1_1display_1_1VRAMData.html#a040877ce2ee881dd474bf349e2b5851c',1,'gba::display::VRAMData::color()']]], 6 | ['colors',['colors',['../classgba_1_1graphics_1_1Palette.html#a1c33b062d9f760f34c297eb6423d34a7',1,'gba::graphics::Palette']]] 7 | ]; 8 | -------------------------------------------------------------------------------- /docs/search/all_3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    11 |
    Loading...
    12 |
    13 | 18 |
    Searching...
    19 |
    No Matches
    20 | 28 |
    29 | 30 | 31 | -------------------------------------------------------------------------------- /docs/search/all_3.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['flip_5fpages',['flip_pages',['../namespacegba_1_1display_1_1mode5.html#a6ceb9e450a42ec64c762c874358ad45a',1,'gba::display::mode5']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/search/all_4.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    11 |
    Loading...
    12 |
    13 | 18 |
    Searching...
    19 |
    No Matches
    20 | 28 |
    29 | 30 | 31 | -------------------------------------------------------------------------------- /docs/search/all_4.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['arch',['arch',['../namespacegba_1_1arch.html',1,'gba']]], 4 | ['display',['display',['../namespacegba_1_1arch_1_1registers_1_1display.html',1,'gba::arch::registers']]], 5 | ['g',['g',['../classgba_1_1display_1_1Color.html#a54e843b1eb9c1395933860948adb6085',1,'gba::display::Color']]], 6 | ['graphics',['graphics',['../namespacegba_1_1graphics.html',1,'gba']]], 7 | ['green_5fswap',['green_swap',['../namespacegba_1_1arch_1_1registers_1_1display.html#afd5d6b3462671e59193a1a3698ae1e18',1,'gba::arch::registers::display']]], 8 | ['io',['io',['../namespacegba_1_1arch_1_1registers_1_1io.html',1,'gba::arch::registers']]], 9 | ['map',['map',['../namespacegba_1_1display_1_1map.html',1,'gba::display']]], 10 | ['mode3',['mode3',['../namespacegba_1_1display_1_1mode3.html',1,'gba::display']]], 11 | ['mode4',['mode4',['../namespacegba_1_1display_1_1mode4.html',1,'gba::display']]], 12 | ['mode5',['mode5',['../namespacegba_1_1display_1_1mode5.html',1,'gba::display']]], 13 | ['registers',['registers',['../namespacegba_1_1arch_1_1registers.html',1,'gba::arch']]], 14 | ['sound',['sound',['../namespacegba_1_1arch_1_1registers_1_1sound.html',1,'gba::arch::registers']]] 15 | ]; 16 | -------------------------------------------------------------------------------- /docs/search/all_5.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    11 |
    Loading...
    12 |
    13 | 18 |
    Searching...
    19 |
    No Matches
    20 | 28 |
    29 | 30 | 31 | -------------------------------------------------------------------------------- /docs/search/all_5.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['libgba_20_2d_20cpp',['LibGBA - CPP',['../index.html',1,'']]], 4 | ['lcd_5fcontrol',['lcd_control',['../namespacegba_1_1arch_1_1registers_1_1display.html#aa257e5efeabfa48043b4192b311ac119',1,'gba::arch::registers::display']]], 5 | ['lcd_5fstatus',['lcd_status',['../namespacegba_1_1arch_1_1registers_1_1display.html#a8bc6a934bc0a9965261b74ea7464f6ad',1,'gba::arch::registers::display']]], 6 | ['left',['left',['../structgba_1_1display_1_1WindowPosition.html#a9af812325ff84634d39472f900a0d5e5',1,'gba::display::WindowPosition']]], 7 | ['load_5fmap',['load_map',['../namespacegba_1_1graphics.html#a0efb67edd37becadd4810439eac2ba43',1,'gba::graphics']]], 8 | ['load_5fpalette',['load_palette',['../namespacegba_1_1graphics.html#a6618262c18b51e7d75f3b49ec4c2a23c',1,'gba::graphics']]], 9 | ['load_5ftilemap',['load_tilemap',['../namespacegba_1_1graphics.html#ab8d7a21b9f95d1d30623e0a315bf1d80',1,'gba::graphics']]], 10 | ['load_5ftileset',['load_tileset',['../namespacegba_1_1graphics.html#a85c6fb9b6f9e50585d8cefca5bdd0f25',1,'gba::graphics']]] 11 | ]; 12 | -------------------------------------------------------------------------------- /docs/search/all_6.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    11 |
    Loading...
    12 |
    13 | 18 |
    Searching...
    19 |
    No Matches
    20 | 28 |
    29 | 30 | 31 | -------------------------------------------------------------------------------- /docs/search/all_6.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['map',['Map',['../classgba_1_1graphics_1_1Map.html',1,'gba::graphics']]], 4 | ['mosaic',['mosaic',['../classgba_1_1display_1_1BackgroundControl.html#a452d2c32efb612608761b230e28ecabd',1,'gba::display::BackgroundControl']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /docs/search/all_7.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    11 |
    Loading...
    12 |
    13 | 18 |
    Searching...
    19 |
    No Matches
    20 | 28 |
    29 | 30 | 31 | -------------------------------------------------------------------------------- /docs/search/all_7.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['obj_5fenable',['obj_enable',['../classgba_1_1display_1_1WindowControl.html#a6a41069207b3ea4c48ded8a16c92cd32',1,'gba::display::WindowControl']]], 4 | ['operator_5b_5d',['operator[]',['../classgba_1_1graphics_1_1Palette.html#a368f2c83139ac45d9d88173802e8ced1',1,'gba::graphics::Palette::operator[](std::size_t i)'],['../classgba_1_1graphics_1_1Palette.html#a6c3eb0d343ae60e97e5df012c01ff361',1,'gba::graphics::Palette::operator[](std::size_t i) const']]], 5 | ['outer_5fenable',['outer_enable',['../classgba_1_1display_1_1WindowControl.html#a0e02e61f4311eb0315ed24584f53780e',1,'gba::display::WindowControl']]], 6 | ['overflow',['overflow',['../classgba_1_1display_1_1BackgroundControl.html#af311ae0581ad0e4b43e4f2bfa4846182',1,'gba::display::BackgroundControl']]] 7 | ]; 8 | -------------------------------------------------------------------------------- /docs/search/all_8.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    11 |
    Loading...
    12 |
    13 | 18 |
    Searching...
    19 |
    No Matches
    20 | 28 |
    29 | 30 | 31 | -------------------------------------------------------------------------------- /docs/search/all_8.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['page',['page',['../namespacegba_1_1display_1_1mode5.html#a489e8184bf7d4a5a73c4769c277b7350',1,'gba::display::mode5']]], 4 | ['palette',['Palette',['../classgba_1_1graphics_1_1Palette.html',1,'gba::graphics::Palette'],['../classgba_1_1graphics_1_1Palette.html#ae1109af357dd9e88dbf98e15fcd99edf',1,'gba::graphics::Palette::Palette()']]], 5 | ['palette_5fmode',['palette_mode',['../classgba_1_1display_1_1BackgroundControl.html#a20ed5a7308d24d212795b8cf0d4602b8',1,'gba::display::BackgroundControl']]], 6 | ['palettedbitmap',['PalettedBitmap',['../classgba_1_1graphics_1_1PalettedBitmap.html',1,'gba::graphics']]], 7 | ['point',['Point',['../structgba_1_1geometry_1_1Point.html',1,'gba::geometry']]], 8 | ['priority',['priority',['../classgba_1_1display_1_1BackgroundControl.html#a766d250df0250c60bd538d2e6293a591',1,'gba::display::BackgroundControl']]] 9 | ]; 10 | -------------------------------------------------------------------------------- /docs/search/all_9.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    11 |
    Loading...
    12 |
    13 | 18 |
    Searching...
    19 |
    No Matches
    20 | 28 |
    29 | 30 | 31 | -------------------------------------------------------------------------------- /docs/search/all_9.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['r',['r',['../classgba_1_1display_1_1Color.html#ac745f2b0d3db7b1f8f185ba7a2aef450',1,'gba::display::Color']]], 4 | ['rect',['Rect',['../structgba_1_1geometry_1_1Rect.html',1,'gba::geometry']]], 5 | ['resize',['resize',['../classgba_1_1display_1_1BackgroundControl.html#a0531e5361149a426fa034ad51d37d84d',1,'gba::display::BackgroundControl']]], 6 | ['right',['right',['../structgba_1_1display_1_1WindowPosition.html#ad2395a2b0713119276f238869ffe6178',1,'gba::display::WindowPosition']]] 7 | ]; 8 | -------------------------------------------------------------------------------- /docs/search/all_a.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    11 |
    Loading...
    12 |
    13 | 18 |
    Searching...
    19 |
    No Matches
    20 | 28 |
    29 | 30 | 31 | -------------------------------------------------------------------------------- /docs/search/all_a.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['s',['s',['../uniongba_1_1display_1_1VRAMData.html#aafd1333eb385409ac4594fae2c44be3d',1,'gba::display::VRAMData']]], 4 | ['screen_5fbase_5fblock',['screen_base_block',['../classgba_1_1display_1_1BackgroundControl.html#aebc2820e92c383a0af2c059f7e600a82',1,'gba::display::BackgroundControl']]], 5 | ['screen_5fheight',['screen_height',['../namespacegba_1_1display_1_1mode3.html#a93bbaac20475a80159034baf9a7671f2',1,'gba::display::mode3::screen_height()'],['../namespacegba_1_1display_1_1mode4.html#a1b9a40026d789755286eff11b52316e3',1,'gba::display::mode4::screen_height()'],['../namespacegba_1_1display_1_1mode5.html#abc1b67933da4321357931d4267c6eaa5',1,'gba::display::mode5::screen_height()']]], 6 | ['screen_5fwidth',['screen_width',['../namespacegba_1_1display_1_1mode3.html#ac2b434afb2cbff2cfb8204f16f3e0ff2',1,'gba::display::mode3::screen_width()'],['../namespacegba_1_1display_1_1mode4.html#a6c9fb9b8e0e3855aab7c02c798e89454',1,'gba::display::mode4::screen_width()'],['../namespacegba_1_1display_1_1mode5.html#af3103ff59dac89a72fff382f4bde3726',1,'gba::display::mode5::screen_width()']]], 7 | ['size',['Size',['../structgba_1_1geometry_1_1Size.html',1,'gba::geometry::Size'],['../classgba_1_1graphics_1_1Palette.html#a7438aab2b6380e4e05f939a7a2c7d371',1,'gba::graphics::Palette::size()']]] 8 | ]; 9 | -------------------------------------------------------------------------------- /docs/search/all_b.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    11 |
    Loading...
    12 |
    13 | 18 |
    Searching...
    19 |
    No Matches
    20 | 28 |
    29 | 30 | 31 | -------------------------------------------------------------------------------- /docs/search/all_b.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['tile',['Tile',['../classgba_1_1display_1_1map_1_1Tile.html',1,'gba::display::map']]], 4 | ['tiledbitmap',['TiledBitmap',['../classgba_1_1graphics_1_1TiledBitmap.html',1,'gba::graphics']]], 5 | ['tileindex',['TileIndex',['../classgba_1_1display_1_1map_1_1details_1_1TileIndex.html',1,'gba::display::map::details']]], 6 | ['tilemap',['Tilemap',['../classgba_1_1graphics_1_1Tilemap.html',1,'gba::graphics::Tilemap'],['../namespacegba_1_1display_1_1map.html#a178a7cad95ee8a06e5388b795a35e152',1,'gba::display::map::tilemap()']]], 7 | ['tileset',['Tileset',['../classgba_1_1graphics_1_1Tileset.html',1,'gba::graphics::Tileset'],['../namespacegba_1_1display_1_1map.html#a0e52190297dd9abb7f3d1832015973fc',1,'gba::display::map::tileset()']]], 8 | ['top',['top',['../structgba_1_1display_1_1WindowPosition.html#ac3f4c1be1b061cba282d054a37a137f7',1,'gba::display::WindowPosition']]] 9 | ]; 10 | -------------------------------------------------------------------------------- /docs/search/all_c.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    11 |
    Loading...
    12 |
    13 | 18 |
    Searching...
    19 |
    No Matches
    20 | 28 |
    29 | 30 | 31 | -------------------------------------------------------------------------------- /docs/search/all_c.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['utils',['utils',['../namespaceutils.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/search/all_d.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    11 |
    Loading...
    12 |
    13 | 18 |
    Searching...
    19 |
    No Matches
    20 | 28 |
    29 | 30 | 31 | -------------------------------------------------------------------------------- /docs/search/all_d.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['value',['value',['../classgba_1_1display_1_1Color.html#a6d36ff1fb79d4c461439e60a11603f56',1,'gba::display::Color']]], 4 | ['value_5fof',['value_of',['../namespaceutils.html#aa5247b12c5ea4bb13163ae4e938dde71',1,'utils']]], 5 | ['vcount',['vcount',['../namespacegba_1_1arch_1_1registers_1_1display.html#a0e84f7193d6a43d2f311f1bb1231785b',1,'gba::arch::registers::display']]], 6 | ['vram',['vram',['../namespacegba_1_1display_1_1mode3.html#ad324f789401b237c51cfcfd06ec22bfd',1,'gba::display::mode3::vram(int x, int y)'],['../namespacegba_1_1display_1_1mode3.html#ac4c3fe9cd878968b01761e21afc8f924',1,'gba::display::mode3::vram(int index)'],['../namespacegba_1_1display_1_1mode4.html#a774bfc87c27b2cf31a2057d1c5a97ea2',1,'gba::display::mode4::vram(int x, int y)'],['../namespacegba_1_1display_1_1mode4.html#a07506016d27ff854db074dbd81117fd6',1,'gba::display::mode4::vram(int index)'],['../namespacegba_1_1display_1_1mode5.html#a4938f9a6aef67b9096f79f2643da905c',1,'gba::display::mode5::vram(int x, int y)'],['../namespacegba_1_1display_1_1mode5.html#afc35d19d2bdd5ac4e9a1688a96ca1bac',1,'gba::display::mode5::vram(int index)']]], 7 | ['vramdata',['VRAMData',['../uniongba_1_1display_1_1VRAMData.html',1,'gba::display']]] 8 | ]; 9 | -------------------------------------------------------------------------------- /docs/search/all_e.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    11 |
    Loading...
    12 |
    13 | 18 |
    Searching...
    19 |
    No Matches
    20 | 28 |
    29 | 30 | 31 | -------------------------------------------------------------------------------- /docs/search/all_e.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['window0_5fenable',['window0_enable',['../classgba_1_1display_1_1WindowControl.html#abd77b226e72b5494951625b0f24b137f',1,'gba::display::WindowControl']]], 4 | ['window1_5fenable',['window1_enable',['../classgba_1_1display_1_1WindowControl.html#afe93dcb09cbd1a4ae391ac973917330d',1,'gba::display::WindowControl']]], 5 | ['windowcontrol',['WindowControl',['../classgba_1_1display_1_1WindowControl.html',1,'gba::display']]], 6 | ['windowposition',['WindowPosition',['../structgba_1_1display_1_1WindowPosition.html',1,'gba::display']]] 7 | ]; 8 | -------------------------------------------------------------------------------- /docs/search/classes_0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    11 |
    Loading...
    12 |
    13 | 18 |
    Searching...
    19 |
    No Matches
    20 | 28 |
    29 | 30 | 31 | -------------------------------------------------------------------------------- /docs/search/classes_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['backgroundcontrol',['BackgroundControl',['../classgba_1_1display_1_1BackgroundControl.html',1,'gba::display']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/search/classes_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    11 |
    Loading...
    12 |
    13 | 18 |
    Searching...
    19 |
    No Matches
    20 | 28 |
    29 | 30 | 31 | -------------------------------------------------------------------------------- /docs/search/classes_1.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['color',['Color',['../classgba_1_1display_1_1Color.html',1,'gba::display']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/search/classes_2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    11 |
    Loading...
    12 |
    13 | 18 |
    Searching...
    19 |
    No Matches
    20 | 28 |
    29 | 30 | 31 | -------------------------------------------------------------------------------- /docs/search/classes_2.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['map',['Map',['../classgba_1_1graphics_1_1Map.html',1,'gba::graphics']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/search/classes_3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    11 |
    Loading...
    12 |
    13 | 18 |
    Searching...
    19 |
    No Matches
    20 | 28 |
    29 | 30 | 31 | -------------------------------------------------------------------------------- /docs/search/classes_3.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['palette',['Palette',['../classgba_1_1graphics_1_1Palette.html',1,'gba::graphics']]], 4 | ['palettedbitmap',['PalettedBitmap',['../classgba_1_1graphics_1_1PalettedBitmap.html',1,'gba::graphics']]], 5 | ['point',['Point',['../structgba_1_1geometry_1_1Point.html',1,'gba::geometry']]] 6 | ]; 7 | -------------------------------------------------------------------------------- /docs/search/classes_4.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    11 |
    Loading...
    12 |
    13 | 18 |
    Searching...
    19 |
    No Matches
    20 | 28 |
    29 | 30 | 31 | -------------------------------------------------------------------------------- /docs/search/classes_4.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['rect',['Rect',['../structgba_1_1geometry_1_1Rect.html',1,'gba::geometry']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/search/classes_5.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    11 |
    Loading...
    12 |
    13 | 18 |
    Searching...
    19 |
    No Matches
    20 | 28 |
    29 | 30 | 31 | -------------------------------------------------------------------------------- /docs/search/classes_5.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['size',['Size',['../structgba_1_1geometry_1_1Size.html',1,'gba::geometry']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/search/classes_6.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    11 |
    Loading...
    12 |
    13 | 18 |
    Searching...
    19 |
    No Matches
    20 | 28 |
    29 | 30 | 31 | -------------------------------------------------------------------------------- /docs/search/classes_6.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['tile',['Tile',['../classgba_1_1display_1_1map_1_1Tile.html',1,'gba::display::map']]], 4 | ['tiledbitmap',['TiledBitmap',['../classgba_1_1graphics_1_1TiledBitmap.html',1,'gba::graphics']]], 5 | ['tileindex',['TileIndex',['../classgba_1_1display_1_1map_1_1details_1_1TileIndex.html',1,'gba::display::map::details']]], 6 | ['tilemap',['Tilemap',['../classgba_1_1graphics_1_1Tilemap.html',1,'gba::graphics']]], 7 | ['tileset',['Tileset',['../classgba_1_1graphics_1_1Tileset.html',1,'gba::graphics']]] 8 | ]; 9 | -------------------------------------------------------------------------------- /docs/search/classes_7.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    11 |
    Loading...
    12 |
    13 | 18 |
    Searching...
    19 |
    No Matches
    20 | 28 |
    29 | 30 | 31 | -------------------------------------------------------------------------------- /docs/search/classes_7.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['vramdata',['VRAMData',['../uniongba_1_1display_1_1VRAMData.html',1,'gba::display']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/search/classes_8.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    11 |
    Loading...
    12 |
    13 | 18 |
    Searching...
    19 |
    No Matches
    20 | 28 |
    29 | 30 | 31 | -------------------------------------------------------------------------------- /docs/search/classes_8.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['windowcontrol',['WindowControl',['../classgba_1_1display_1_1WindowControl.html',1,'gba::display']]], 4 | ['windowposition',['WindowPosition',['../structgba_1_1display_1_1WindowPosition.html',1,'gba::display']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /docs/search/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPTIZ/libgba-cpp/434211c92423fff67b4f574e055838c3d1d20f5f/docs/search/close.png -------------------------------------------------------------------------------- /docs/search/functions_0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    11 |
    Loading...
    12 |
    13 | 18 |
    Searching...
    19 |
    No Matches
    20 | 28 |
    29 | 30 | 31 | -------------------------------------------------------------------------------- /docs/search/functions_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['at',['at',['../namespacegba_1_1arch_1_1registers.html#a2b90e335c92bd9b5ce405a817c72ceb4',1,'gba::arch::registers']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/search/functions_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    11 |
    Loading...
    12 |
    13 | 18 |
    Searching...
    19 |
    No Matches
    20 | 28 |
    29 | 30 | 31 | -------------------------------------------------------------------------------- /docs/search/functions_1.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['b',['b',['../classgba_1_1display_1_1Color.html#ac3604d8b56fb4490457b13d2f1afb7f7',1,'gba::display::Color']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/search/functions_2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    11 |
    Loading...
    12 |
    13 | 18 |
    Searching...
    19 |
    No Matches
    20 | 28 |
    29 | 30 | 31 | -------------------------------------------------------------------------------- /docs/search/functions_2.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['char_5fbase_5fblock',['char_base_block',['../classgba_1_1display_1_1BackgroundControl.html#a978d897de962406ca253dfd7c32d7393',1,'gba::display::BackgroundControl']]], 4 | ['color',['Color',['../classgba_1_1display_1_1Color.html#a3d78116b31a209e2459356c6d573b02c',1,'gba::display::Color::Color()=default'],['../classgba_1_1display_1_1Color.html#a97eb0485395fb290f36f1b5f92d9a813',1,'gba::display::Color::Color(unsigned value)'],['../classgba_1_1display_1_1Color.html#a673e8b66b79063c55bb1c36387866d5e',1,'gba::display::Color::Color(int r, int g, int b)']]], 5 | ['colors',['colors',['../classgba_1_1graphics_1_1Palette.html#a1c33b062d9f760f34c297eb6423d34a7',1,'gba::graphics::Palette']]] 6 | ]; 7 | -------------------------------------------------------------------------------- /docs/search/functions_3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    11 |
    Loading...
    12 |
    13 | 18 |
    Searching...
    19 |
    No Matches
    20 | 28 |
    29 | 30 | 31 | -------------------------------------------------------------------------------- /docs/search/functions_3.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['flip_5fpages',['flip_pages',['../namespacegba_1_1display_1_1mode5.html#a6ceb9e450a42ec64c762c874358ad45a',1,'gba::display::mode5']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/search/functions_4.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    11 |
    Loading...
    12 |
    13 | 18 |
    Searching...
    19 |
    No Matches
    20 | 28 |
    29 | 30 | 31 | -------------------------------------------------------------------------------- /docs/search/functions_4.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['g',['g',['../classgba_1_1display_1_1Color.html#a54e843b1eb9c1395933860948adb6085',1,'gba::display::Color']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/search/functions_5.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    11 |
    Loading...
    12 |
    13 | 18 |
    Searching...
    19 |
    No Matches
    20 | 28 |
    29 | 30 | 31 | -------------------------------------------------------------------------------- /docs/search/functions_5.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['load_5fmap',['load_map',['../namespacegba_1_1graphics.html#a0efb67edd37becadd4810439eac2ba43',1,'gba::graphics']]], 4 | ['load_5fpalette',['load_palette',['../namespacegba_1_1graphics.html#a6618262c18b51e7d75f3b49ec4c2a23c',1,'gba::graphics']]], 5 | ['load_5ftilemap',['load_tilemap',['../namespacegba_1_1graphics.html#ab8d7a21b9f95d1d30623e0a315bf1d80',1,'gba::graphics']]], 6 | ['load_5ftileset',['load_tileset',['../namespacegba_1_1graphics.html#a85c6fb9b6f9e50585d8cefca5bdd0f25',1,'gba::graphics']]] 7 | ]; 8 | -------------------------------------------------------------------------------- /docs/search/functions_6.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    11 |
    Loading...
    12 |
    13 | 18 |
    Searching...
    19 |
    No Matches
    20 | 28 |
    29 | 30 | 31 | -------------------------------------------------------------------------------- /docs/search/functions_6.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['mosaic',['mosaic',['../classgba_1_1display_1_1BackgroundControl.html#a452d2c32efb612608761b230e28ecabd',1,'gba::display::BackgroundControl']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/search/functions_7.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    11 |
    Loading...
    12 |
    13 | 18 |
    Searching...
    19 |
    No Matches
    20 | 28 |
    29 | 30 | 31 | -------------------------------------------------------------------------------- /docs/search/functions_7.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['obj_5fenable',['obj_enable',['../classgba_1_1display_1_1WindowControl.html#a6a41069207b3ea4c48ded8a16c92cd32',1,'gba::display::WindowControl']]], 4 | ['operator_5b_5d',['operator[]',['../classgba_1_1graphics_1_1Palette.html#a368f2c83139ac45d9d88173802e8ced1',1,'gba::graphics::Palette::operator[](std::size_t i)'],['../classgba_1_1graphics_1_1Palette.html#a6c3eb0d343ae60e97e5df012c01ff361',1,'gba::graphics::Palette::operator[](std::size_t i) const']]], 5 | ['outer_5fenable',['outer_enable',['../classgba_1_1display_1_1WindowControl.html#a0e02e61f4311eb0315ed24584f53780e',1,'gba::display::WindowControl']]], 6 | ['overflow',['overflow',['../classgba_1_1display_1_1BackgroundControl.html#af311ae0581ad0e4b43e4f2bfa4846182',1,'gba::display::BackgroundControl']]] 7 | ]; 8 | -------------------------------------------------------------------------------- /docs/search/functions_8.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    11 |
    Loading...
    12 |
    13 | 18 |
    Searching...
    19 |
    No Matches
    20 | 28 |
    29 | 30 | 31 | -------------------------------------------------------------------------------- /docs/search/functions_8.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['page',['page',['../namespacegba_1_1display_1_1mode5.html#a489e8184bf7d4a5a73c4769c277b7350',1,'gba::display::mode5']]], 4 | ['palette',['Palette',['../classgba_1_1graphics_1_1Palette.html#ae1109af357dd9e88dbf98e15fcd99edf',1,'gba::graphics::Palette']]], 5 | ['palette_5fmode',['palette_mode',['../classgba_1_1display_1_1BackgroundControl.html#a20ed5a7308d24d212795b8cf0d4602b8',1,'gba::display::BackgroundControl']]], 6 | ['priority',['priority',['../classgba_1_1display_1_1BackgroundControl.html#a766d250df0250c60bd538d2e6293a591',1,'gba::display::BackgroundControl']]] 7 | ]; 8 | -------------------------------------------------------------------------------- /docs/search/functions_9.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    11 |
    Loading...
    12 |
    13 | 18 |
    Searching...
    19 |
    No Matches
    20 | 28 |
    29 | 30 | 31 | -------------------------------------------------------------------------------- /docs/search/functions_9.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['r',['r',['../classgba_1_1display_1_1Color.html#ac745f2b0d3db7b1f8f185ba7a2aef450',1,'gba::display::Color']]], 4 | ['resize',['resize',['../classgba_1_1display_1_1BackgroundControl.html#a0531e5361149a426fa034ad51d37d84d',1,'gba::display::BackgroundControl']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /docs/search/functions_a.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    11 |
    Loading...
    12 |
    13 | 18 |
    Searching...
    19 |
    No Matches
    20 | 28 |
    29 | 30 | 31 | -------------------------------------------------------------------------------- /docs/search/functions_a.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['screen_5fbase_5fblock',['screen_base_block',['../classgba_1_1display_1_1BackgroundControl.html#aebc2820e92c383a0af2c059f7e600a82',1,'gba::display::BackgroundControl']]], 4 | ['size',['size',['../classgba_1_1graphics_1_1Palette.html#a7438aab2b6380e4e05f939a7a2c7d371',1,'gba::graphics::Palette']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /docs/search/functions_b.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    11 |
    Loading...
    12 |
    13 | 18 |
    Searching...
    19 |
    No Matches
    20 | 28 |
    29 | 30 | 31 | -------------------------------------------------------------------------------- /docs/search/functions_b.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['tilemap',['tilemap',['../namespacegba_1_1display_1_1map.html#a178a7cad95ee8a06e5388b795a35e152',1,'gba::display::map']]], 4 | ['tileset',['tileset',['../namespacegba_1_1display_1_1map.html#a0e52190297dd9abb7f3d1832015973fc',1,'gba::display::map']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /docs/search/functions_c.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    11 |
    Loading...
    12 |
    13 | 18 |
    Searching...
    19 |
    No Matches
    20 | 28 |
    29 | 30 | 31 | -------------------------------------------------------------------------------- /docs/search/functions_c.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['value',['value',['../classgba_1_1display_1_1Color.html#a6d36ff1fb79d4c461439e60a11603f56',1,'gba::display::Color']]], 4 | ['value_5fof',['value_of',['../namespaceutils.html#aa5247b12c5ea4bb13163ae4e938dde71',1,'utils']]], 5 | ['vram',['vram',['../namespacegba_1_1display_1_1mode3.html#ad324f789401b237c51cfcfd06ec22bfd',1,'gba::display::mode3::vram(int x, int y)'],['../namespacegba_1_1display_1_1mode3.html#ac4c3fe9cd878968b01761e21afc8f924',1,'gba::display::mode3::vram(int index)'],['../namespacegba_1_1display_1_1mode4.html#a774bfc87c27b2cf31a2057d1c5a97ea2',1,'gba::display::mode4::vram(int x, int y)'],['../namespacegba_1_1display_1_1mode4.html#a07506016d27ff854db074dbd81117fd6',1,'gba::display::mode4::vram(int index)'],['../namespacegba_1_1display_1_1mode5.html#a4938f9a6aef67b9096f79f2643da905c',1,'gba::display::mode5::vram(int x, int y)'],['../namespacegba_1_1display_1_1mode5.html#afc35d19d2bdd5ac4e9a1688a96ca1bac',1,'gba::display::mode5::vram(int index)']]] 6 | ]; 7 | -------------------------------------------------------------------------------- /docs/search/functions_d.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    11 |
    Loading...
    12 |
    13 | 18 |
    Searching...
    19 |
    No Matches
    20 | 28 |
    29 | 30 | 31 | -------------------------------------------------------------------------------- /docs/search/functions_d.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['window0_5fenable',['window0_enable',['../classgba_1_1display_1_1WindowControl.html#abd77b226e72b5494951625b0f24b137f',1,'gba::display::WindowControl']]], 4 | ['window1_5fenable',['window1_enable',['../classgba_1_1display_1_1WindowControl.html#afe93dcb09cbd1a4ae391ac973917330d',1,'gba::display::WindowControl']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /docs/search/mag_sel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPTIZ/libgba-cpp/434211c92423fff67b4f574e055838c3d1d20f5f/docs/search/mag_sel.png -------------------------------------------------------------------------------- /docs/search/namespaces_0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    11 |
    Loading...
    12 |
    13 | 18 |
    Searching...
    19 |
    No Matches
    20 | 28 |
    29 | 30 | 31 | -------------------------------------------------------------------------------- /docs/search/namespaces_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['arch',['arch',['../namespacegba_1_1arch.html',1,'gba']]], 4 | ['display',['display',['../namespacegba_1_1arch_1_1registers_1_1display.html',1,'gba::arch::registers']]], 5 | ['graphics',['graphics',['../namespacegba_1_1graphics.html',1,'gba']]], 6 | ['io',['io',['../namespacegba_1_1arch_1_1registers_1_1io.html',1,'gba::arch::registers']]], 7 | ['map',['map',['../namespacegba_1_1display_1_1map.html',1,'gba::display']]], 8 | ['mode3',['mode3',['../namespacegba_1_1display_1_1mode3.html',1,'gba::display']]], 9 | ['mode4',['mode4',['../namespacegba_1_1display_1_1mode4.html',1,'gba::display']]], 10 | ['mode5',['mode5',['../namespacegba_1_1display_1_1mode5.html',1,'gba::display']]], 11 | ['registers',['registers',['../namespacegba_1_1arch_1_1registers.html',1,'gba::arch']]], 12 | ['sound',['sound',['../namespacegba_1_1arch_1_1registers_1_1sound.html',1,'gba::arch::registers']]] 13 | ]; 14 | -------------------------------------------------------------------------------- /docs/search/namespaces_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    11 |
    Loading...
    12 |
    13 | 18 |
    Searching...
    19 |
    No Matches
    20 | 28 |
    29 | 30 | 31 | -------------------------------------------------------------------------------- /docs/search/namespaces_1.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['utils',['utils',['../namespaceutils.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/search/nomatches.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
    9 |
    No Matches
    10 |
    11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/search/pages_0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    11 |
    Loading...
    12 |
    13 | 18 |
    Searching...
    19 |
    No Matches
    20 | 28 |
    29 | 30 | 31 | -------------------------------------------------------------------------------- /docs/search/pages_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['libgba_20_2d_20cpp_1',['LibGBA - CPP',['../index.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/search/search_l.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPTIZ/libgba-cpp/434211c92423fff67b4f574e055838c3d1d20f5f/docs/search/search_l.png -------------------------------------------------------------------------------- /docs/search/search_m.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPTIZ/libgba-cpp/434211c92423fff67b4f574e055838c3d1d20f5f/docs/search/search_m.png -------------------------------------------------------------------------------- /docs/search/search_r.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPTIZ/libgba-cpp/434211c92423fff67b4f574e055838c3d1d20f5f/docs/search/search_r.png -------------------------------------------------------------------------------- /docs/search/searchdata.js: -------------------------------------------------------------------------------- 1 | var indexSectionsWithContent = 2 | { 3 | 0: "l", 4 | 1: "l" 5 | }; 6 | 7 | var indexSectionNames = 8 | { 9 | 0: "all", 10 | 1: "pages" 11 | }; 12 | 13 | var indexSectionLabels = 14 | { 15 | 0: "All", 16 | 1: "Pages" 17 | }; 18 | 19 | -------------------------------------------------------------------------------- /docs/search/variables_0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    11 |
    Loading...
    12 |
    13 | 18 |
    Searching...
    19 |
    No Matches
    20 | 28 |
    29 | 30 | 31 | -------------------------------------------------------------------------------- /docs/search/variables_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['bg0_5fx_5foffset',['bg0_x_offset',['../namespacegba_1_1arch_1_1registers_1_1display.html#a2618a53b67d21bce5027aaa7ed8afe05',1,'gba::arch::registers::display']]], 4 | ['bg0_5fy_5foffset',['bg0_y_offset',['../namespacegba_1_1arch_1_1registers_1_1display.html#a6c9116b6d6989b126f957b3daae723fe',1,'gba::arch::registers::display']]], 5 | ['bg1_5fx_5foffset',['bg1_x_offset',['../namespacegba_1_1arch_1_1registers_1_1display.html#a46aae9d08879d0339c35e02b90e889e1',1,'gba::arch::registers::display']]], 6 | ['bg1_5fy_5foffset',['bg1_y_offset',['../namespacegba_1_1arch_1_1registers_1_1display.html#a4e6dfb2de4dc60dbbcafa2e171e86b39',1,'gba::arch::registers::display']]], 7 | ['bg2_5fx_5foffset',['bg2_x_offset',['../namespacegba_1_1arch_1_1registers_1_1display.html#a6d9f4f33127334f576c6af16b0743647',1,'gba::arch::registers::display']]], 8 | ['bg2_5fy_5foffset',['bg2_y_offset',['../namespacegba_1_1arch_1_1registers_1_1display.html#a553c5f399ed87846d2ca9b79b46e600b',1,'gba::arch::registers::display']]], 9 | ['bg3_5fx_5foffset',['bg3_x_offset',['../namespacegba_1_1arch_1_1registers_1_1display.html#aeeb49a47def1726400915f4a31e1ded4',1,'gba::arch::registers::display']]], 10 | ['bg3_5fy_5foffset',['bg3_y_offset',['../namespacegba_1_1arch_1_1registers_1_1display.html#a9cb67574ef8906bcafa1a3ff78c6b300',1,'gba::arch::registers::display']]], 11 | ['bg_5fcontrols',['bg_controls',['../namespacegba_1_1arch_1_1registers_1_1display.html#ac02ee78092eb78943699aa4f7bec303d',1,'gba::arch::registers::display']]], 12 | ['bottom',['bottom',['../structgba_1_1display_1_1WindowPosition.html#a9f400285b2c5f363a4452daa64f7571a',1,'gba::display::WindowPosition']]] 13 | ]; 14 | -------------------------------------------------------------------------------- /docs/search/variables_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    11 |
    Loading...
    12 |
    13 | 18 |
    Searching...
    19 |
    No Matches
    20 | 28 |
    29 | 30 | 31 | -------------------------------------------------------------------------------- /docs/search/variables_1.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['c',['c',['../uniongba_1_1display_1_1VRAMData.html#a2188d2604d9deffa71841a36fca4bc46',1,'gba::display::VRAMData']]], 4 | ['color',['color',['../uniongba_1_1display_1_1VRAMData.html#a040877ce2ee881dd474bf349e2b5851c',1,'gba::display::VRAMData']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /docs/search/variables_2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    11 |
    Loading...
    12 |
    13 | 18 |
    Searching...
    19 |
    No Matches
    20 | 28 |
    29 | 30 | 31 | -------------------------------------------------------------------------------- /docs/search/variables_2.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['green_5fswap',['green_swap',['../namespacegba_1_1arch_1_1registers_1_1display.html#afd5d6b3462671e59193a1a3698ae1e18',1,'gba::arch::registers::display']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/search/variables_3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    11 |
    Loading...
    12 |
    13 | 18 |
    Searching...
    19 |
    No Matches
    20 | 28 |
    29 | 30 | 31 | -------------------------------------------------------------------------------- /docs/search/variables_3.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['lcd_5fcontrol',['lcd_control',['../namespacegba_1_1arch_1_1registers_1_1display.html#aa257e5efeabfa48043b4192b311ac119',1,'gba::arch::registers::display']]], 4 | ['lcd_5fstatus',['lcd_status',['../namespacegba_1_1arch_1_1registers_1_1display.html#a8bc6a934bc0a9965261b74ea7464f6ad',1,'gba::arch::registers::display']]], 5 | ['left',['left',['../structgba_1_1display_1_1WindowPosition.html#a9af812325ff84634d39472f900a0d5e5',1,'gba::display::WindowPosition']]] 6 | ]; 7 | -------------------------------------------------------------------------------- /docs/search/variables_4.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    11 |
    Loading...
    12 |
    13 | 18 |
    Searching...
    19 |
    No Matches
    20 | 28 |
    29 | 30 | 31 | -------------------------------------------------------------------------------- /docs/search/variables_4.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['right',['right',['../structgba_1_1display_1_1WindowPosition.html#ad2395a2b0713119276f238869ffe6178',1,'gba::display::WindowPosition']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/search/variables_5.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    11 |
    Loading...
    12 |
    13 | 18 |
    Searching...
    19 |
    No Matches
    20 | 28 |
    29 | 30 | 31 | -------------------------------------------------------------------------------- /docs/search/variables_5.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['s',['s',['../uniongba_1_1display_1_1VRAMData.html#aafd1333eb385409ac4594fae2c44be3d',1,'gba::display::VRAMData']]], 4 | ['screen_5fheight',['screen_height',['../namespacegba_1_1display_1_1mode3.html#a93bbaac20475a80159034baf9a7671f2',1,'gba::display::mode3::screen_height()'],['../namespacegba_1_1display_1_1mode4.html#a1b9a40026d789755286eff11b52316e3',1,'gba::display::mode4::screen_height()'],['../namespacegba_1_1display_1_1mode5.html#abc1b67933da4321357931d4267c6eaa5',1,'gba::display::mode5::screen_height()']]], 5 | ['screen_5fwidth',['screen_width',['../namespacegba_1_1display_1_1mode3.html#ac2b434afb2cbff2cfb8204f16f3e0ff2',1,'gba::display::mode3::screen_width()'],['../namespacegba_1_1display_1_1mode4.html#a6c9fb9b8e0e3855aab7c02c798e89454',1,'gba::display::mode4::screen_width()'],['../namespacegba_1_1display_1_1mode5.html#af3103ff59dac89a72fff382f4bde3726',1,'gba::display::mode5::screen_width()']]] 6 | ]; 7 | -------------------------------------------------------------------------------- /docs/search/variables_6.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    11 |
    Loading...
    12 |
    13 | 18 |
    Searching...
    19 |
    No Matches
    20 | 28 |
    29 | 30 | 31 | -------------------------------------------------------------------------------- /docs/search/variables_6.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['top',['top',['../structgba_1_1display_1_1WindowPosition.html#ac3f4c1be1b061cba282d054a37a137f7',1,'gba::display::WindowPosition']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/search/variables_7.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
    11 |
    Loading...
    12 |
    13 | 18 |
    Searching...
    19 |
    No Matches
    20 | 28 |
    29 | 30 | 31 | -------------------------------------------------------------------------------- /docs/search/variables_7.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['vcount',['vcount',['../namespacegba_1_1arch_1_1registers_1_1display.html#a0e84f7193d6a43d2f311f1bb1231785b',1,'gba::arch::registers::display']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/splitbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPTIZ/libgba-cpp/434211c92423fff67b4f574e055838c3d1d20f5f/docs/splitbar.png -------------------------------------------------------------------------------- /docs/sync_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPTIZ/libgba-cpp/434211c92423fff67b4f574e055838c3d1d20f5f/docs/sync_off.png -------------------------------------------------------------------------------- /docs/sync_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPTIZ/libgba-cpp/434211c92423fff67b4f574e055838c3d1d20f5f/docs/sync_on.png -------------------------------------------------------------------------------- /docs/tab_a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPTIZ/libgba-cpp/434211c92423fff67b4f574e055838c3d1d20f5f/docs/tab_a.png -------------------------------------------------------------------------------- /docs/tab_b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPTIZ/libgba-cpp/434211c92423fff67b4f574e055838c3d1d20f5f/docs/tab_b.png -------------------------------------------------------------------------------- /docs/tab_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPTIZ/libgba-cpp/434211c92423fff67b4f574e055838c3d1d20f5f/docs/tab_h.png -------------------------------------------------------------------------------- /docs/tab_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPTIZ/libgba-cpp/434211c92423fff67b4f574e055838c3d1d20f5f/docs/tab_s.png -------------------------------------------------------------------------------- /libgba-cpp/arch/cpu/interrupts.h: -------------------------------------------------------------------------------- 1 | #ifndef GBA_DRIVERS_CPU_INTERRUPTS_H 2 | #define GBA_DRIVERS_CPU_INTERRUPTS_H 3 | 4 | namespace gba::cpu { 5 | 6 | using handler_function_t = void(*)(); 7 | 8 | /** 9 | * Interrupt type. 10 | */ 11 | enum class Interrupt { 12 | VBLANK, 13 | HBLANK, 14 | VCOUNT, 15 | TIMER0, 16 | TIMER1, 17 | TIMER2, 18 | TIMER3, 19 | SERIAL, 20 | DMA0, 21 | DMA1, 22 | DMA2, 23 | DMA3, 24 | KEYPAD, 25 | CARTRIDGE, 26 | }; 27 | 28 | /** 29 | * Interrupt switchboard. 30 | */ 31 | void __attribute__((interrupt ("IRQ"))) __attribute__((section(".iwram"))) main_interrupt_switchboard(); 32 | 33 | /** 34 | * Enables/disables hardware interrupts. 35 | */ 36 | void interrupts_enabled(bool flag); 37 | 38 | /** 39 | * Enables/disables VBlank Interrupt. 40 | * 41 | * Raised when PPU reaches VBlank. 42 | */ 43 | void vblank_interrupt(bool enabled); 44 | 45 | /** 46 | * Enables/disables HBlank Interrupt. 47 | * 48 | * Raised when PPU reaches HBlank. 49 | */ 50 | void hblank_interrupt(bool enabled); 51 | 52 | /** 53 | * Enables/disables VCount Interrupt. 54 | * 55 | * Raised when PPU reaches selected value. 56 | * 57 | * @param value Scanline number to raise interrupt. 58 | */ 59 | void vcount_interrupt(bool enabled, unsigned value=0); 60 | 61 | /** 62 | * Enables/disables Serial Interrupt. 63 | * 64 | * Raised when serial port finishes its operation. 65 | */ 66 | void serial_interrupt(bool enabled); 67 | 68 | /** 69 | * Enables/disables Keypad Interrupt. 70 | * 71 | * Raised when player presses a key. 72 | */ 73 | void keypad_interrupt(bool enabled); 74 | 75 | /** 76 | * Enables/disables Cartridge Interrupt. 77 | * 78 | * Raised when cartridge is removed. 79 | */ 80 | void cartridge_interrupt(bool enabled); 81 | 82 | /** 83 | * Puts CPU to sleep. 84 | */ 85 | void halt(); 86 | 87 | void interrupt_handler(); 88 | void interrupt_handler(handler_function_t); 89 | void set_handler(Interrupt, handler_function_t); 90 | void unset_handler(Interrupt); 91 | void clear_handlers(); 92 | 93 | inline void no_action() { 94 | return; 95 | } 96 | 97 | inline void setup_interrupts() { 98 | interrupts_enabled(true); 99 | interrupt_handler(main_interrupt_switchboard); 100 | set_handler(Interrupt::VBLANK, no_action); 101 | } 102 | 103 | } 104 | 105 | #endif 106 | -------------------------------------------------------------------------------- /libgba-cpp/arch/display/effects.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | 5 | 6 | namespace { 7 | 8 | using namespace gba::arch::registers::display; 9 | 10 | using gba::display::RawPalette; 11 | 12 | auto mosaic_data = uint16_t{0u}; 13 | 14 | } 15 | 16 | 17 | namespace gba { 18 | 19 | void display::set_first_target(Layer layer, bool enabled) { 20 | effect_control[utils::value_of(layer)] = enabled; 21 | } 22 | 23 | void display::set_second_target(Layer layer, bool enabled) { 24 | effect_control[utils::value_of(layer) + 8] = enabled; 25 | } 26 | 27 | void display::backdrop_first_target(bool enabled) { 28 | effect_control[5] = enabled; 29 | } 30 | 31 | void display::backdrop_second_target(bool enabled) { 32 | effect_control[13] = enabled; 33 | } 34 | 35 | void display::select(SpecialEffect effect) { 36 | effect_control = (effect_control.to_ulong() & ~(0b11u << 6)) | ((utils::value_of(effect) & 0b11u) << 6); 37 | } 38 | 39 | void display::mosaic_bg_level(unsigned width, unsigned height) { 40 | mosaic_data = (mosaic_data & 0b11111111u) & (width | (height << 4)); 41 | mosaic_size = mosaic_data; 42 | } 43 | 44 | void display::mosaic_obj_level(unsigned width, unsigned height) { 45 | mosaic_data = (mosaic_data & (0b11111111u << 8)) & ((width | (height << 4)) << 8); 46 | mosaic_size = mosaic_data; 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /libgba-cpp/arch/display/effects.h: -------------------------------------------------------------------------------- 1 | #ifndef GBA_DRIVERS_DISPLAY_EFFECTS_H 2 | #define GBA_DRIVERS_DISPLAY_EFFECTS_H 3 | 4 | #include 5 | #include 6 | 7 | namespace gba::display { 8 | 9 | 10 | /** 11 | * Mosaic intensity for Background layers. 12 | */ 13 | void mosaic_bg_level(unsigned width, unsigned height); 14 | 15 | 16 | /** 17 | * Mosaic intensity for Object layer. 18 | */ 19 | void mosaic_obj_level(unsigned width, unsigned height); 20 | 21 | 22 | /** 23 | * Possible special color effects by hardware. 24 | */ 25 | enum class SpecialEffect { 26 | /** 27 | * No special effect. 28 | */ 29 | NONE, 30 | 31 | /** 32 | * Alpha blend effect. 33 | */ 34 | ALPHA_BLEND, 35 | 36 | /** 37 | * Change brightness to a lighter coloring. 38 | */ 39 | BRIGHTEN, 40 | 41 | /** 42 | * Change brightness to a more shady coloring. 43 | */ 44 | DARKEN, 45 | }; 46 | 47 | 48 | /** 49 | * Enables/disables layer as color effect's first target. 50 | */ 51 | void set_first_target(Layer layer, bool enabled=true); 52 | 53 | 54 | /** 55 | * Enables/disables layer as color effect's second target. 56 | */ 57 | void set_second_target(Layer layer, bool enabled=true); 58 | 59 | 60 | /** 61 | * Enables/disables backdrop as color effect's first target. 62 | */ 63 | void backdrop_first_target(bool enabled=true); 64 | 65 | 66 | /** 67 | * Enables backdrop as color effect's second target. 68 | */ 69 | void backdrop_second_target(bool enabled=true); 70 | 71 | 72 | /** 73 | * Changes current special effect. 74 | */ 75 | void select(SpecialEffect effect); 76 | 77 | 78 | /** 79 | * AlphaBlend first target intensity. 80 | */ 81 | inline auto& blend_first_target_strength() { 82 | return gba::arch::registers::display::blend_a; 83 | } 84 | 85 | 86 | /** 87 | * AlphaBlend second target intensity. 88 | */ 89 | inline auto& blend_second_target_strength() { 90 | return gba::arch::registers::display::blend_b; 91 | } 92 | 93 | } 94 | 95 | #endif 96 | -------------------------------------------------------------------------------- /libgba-cpp/arch/display/layers.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | 6 | namespace { 7 | 8 | using gba::display::BackgroundControl; 9 | using gba::display::RawPalette; 10 | 11 | using gba::arch::registers::display::bg_controls; 12 | 13 | static auto const bg_address = reinterpret_cast*>(0x0500'0000); 14 | static auto& bg_palette = *new (bg_address) RawPalette<256>{}; 15 | 16 | } 17 | 18 | BackgroundControl& gba::display::bg_control(gba::display::Layer layer) { 19 | return *(reinterpret_cast(0x0400'0008) + utils::value_of(layer)); 20 | } 21 | 22 | RawPalette<256>& gba::display::bg_palette() { 23 | return ::bg_palette; 24 | } 25 | -------------------------------------------------------------------------------- /libgba-cpp/arch/display/objects.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using gba::display::Color; 4 | using gba::display::RawPalette; 5 | 6 | namespace { 7 | 8 | static auto const obj_palette_address = reinterpret_cast*>(0x0500'0200); 9 | static auto& obj_palette = 10 | *new (obj_palette_address) RawPalette<256>{}; 11 | 12 | } 13 | 14 | namespace gba { 15 | 16 | RawPalette<256>& display::obj_palette() { 17 | return ::obj_palette; 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /libgba-cpp/arch/display/objects.h: -------------------------------------------------------------------------------- 1 | #ifndef GBA_DRIVERS_DISPLAY_OBJ_H 2 | #define GBA_DRIVERS_DISPLAY_OBJ_H 3 | 4 | #include 5 | 6 | namespace gba::display { 7 | 8 | /** 9 | * Object mapping mode. 10 | */ 11 | enum class ObjectMapping { 12 | /** 13 | * Object data as unidimensional array. 14 | */ 15 | MAP_ARRAY, 16 | 17 | /** 18 | * Object data as tile matrix. 19 | */ 20 | MAP_TILE_MATRIX, 21 | }; 22 | 23 | 24 | /** 25 | * Object Color Palette array. 26 | */ 27 | RawPalette<256>& obj_palette(); 28 | 29 | 30 | /** 31 | * Changes object mapping mode. 32 | */ 33 | inline void object_mapping(ObjectMapping map) { 34 | gba::arch::registers::display::lcd_control[6] = utils::value_of(map); 35 | } 36 | 37 | } 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /libgba-cpp/arch/display/tilemap.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace { 4 | 5 | using namespace gba::display; 6 | using map::Tile; 7 | 8 | static auto& tiles = *reinterpret_cast*>(0x0600'0000); 9 | static auto& tilemap = *reinterpret_cast*>(tiles.end()); 10 | 11 | } 12 | 13 | namespace gba::display { 14 | 15 | std::array& map::tileset() { 16 | return tiles; 17 | } 18 | 19 | std::array& map::tilemap() { 20 | return ::tilemap; 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /libgba-cpp/arch/display/tilemap.h: -------------------------------------------------------------------------------- 1 | #ifndef GBA_DRIVERS_DISPLAY_TILEMAP_H 2 | #define GBA_DRIVERS_DISPLAY_TILEMAP_H 3 | 4 | #include 5 | #include 6 | 7 | /** 8 | * Map manipulation elements. 9 | */ 10 | namespace gba::display::map { 11 | 12 | namespace details { 13 | 14 | /** 15 | * A pair of tile pixels. 16 | */ 17 | class TileIndex { 18 | public: 19 | TileIndex(uint32_t& data, int index): 20 | data{data}, 21 | index{index} 22 | {} 23 | 24 | void operator=(unsigned value) { 25 | data = (data & (~0xfu << index)) | ((value & 0xfu) << index); 26 | } 27 | 28 | private: 29 | uint32_t& data; 30 | const int index; 31 | }; 32 | 33 | } 34 | 35 | /** 36 | * A single 8x8 tile. 37 | */ 38 | class Tile { 39 | public: 40 | Tile() = default; 41 | 42 | Tile(std::array rows): 43 | rows_{move(rows)} 44 | {} 45 | 46 | /** 47 | * Row of palette indexes in tile. 48 | */ 49 | /* 50 | auto operator()(unsigned x, unsigned y) { 51 | return details::TileIndex(rows_[y], x << 2); 52 | } 53 | */ 54 | 55 | private: 56 | std::array rows_{}; 57 | }; 58 | 59 | 60 | /** 61 | * Tiles to fill maps with. 62 | */ 63 | std::array& tileset(); 64 | 65 | 66 | /** 67 | * The game map. 68 | */ 69 | std::array& tilemap(); 70 | 71 | } 72 | 73 | #endif 74 | -------------------------------------------------------------------------------- /libgba-cpp/arch/display/video.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | namespace { 5 | 6 | using gba::display::Page; 7 | using gba::display::Color; 8 | using gba::display::RawPalette; 9 | 10 | static auto page = Page::PAGE1; 11 | 12 | } 13 | 14 | Color& gba::display::mode5::vram(int x, int y) { 15 | return vram(x + screen_width * y); 16 | } 17 | 18 | Color& gba::display::mode5::vram(int index) { 19 | return vram_data()[index + utils::value_of(::page) * screen_width * screen_height]; 20 | } 21 | 22 | Page gba::display::mode5::page() { 23 | return ::page; 24 | } 25 | 26 | void gba::display::mode5::flip_pages() { 27 | select_page(::page); 28 | 29 | constexpr auto PAGE0 = Page::PAGE0; 30 | constexpr auto PAGE1 = Page::PAGE1; 31 | ::page = ::page == PAGE0 ? PAGE1 : PAGE0; 32 | } 33 | -------------------------------------------------------------------------------- /libgba-cpp/arch/display/window.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | 5 | using gba::display::WindowPosition; 6 | using gba::display::WindowControl; 7 | 8 | namespace { 9 | auto const win0_address = reinterpret_cast(0x0400'0040); 10 | auto const win1_address = reinterpret_cast(0x0400'0042); 11 | auto const win2_address = reinterpret_cast(0x0400'0048); 12 | auto& window0 = *new (win0_address) WindowPosition{}; 13 | auto& window1 = *new (win1_address) WindowPosition{}; 14 | auto& window_control = *new (win2_address) WindowControl{}; 15 | } 16 | 17 | namespace gba { 18 | 19 | WindowPosition& display::window0() { 20 | return ::window0; 21 | } 22 | 23 | WindowPosition& display::window1() { 24 | return ::window1; 25 | } 26 | 27 | WindowControl& display::window_control() { 28 | return ::window_control; 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /libgba-cpp/arch/display/window.h: -------------------------------------------------------------------------------- 1 | #ifndef GBA_DRIVERS_DISPLAY_WINDOW_H 2 | #define GBA_DRIVERS_DISPLAY_WINDOW_H 3 | 4 | #include 5 | 6 | #include 7 | 8 | namespace gba::display { 9 | 10 | /** 11 | * Usable window layer. 12 | */ 13 | enum class Window { 14 | /** 15 | * Window layer 0. 16 | */ 17 | WIN0, 18 | /** 19 | * Window layer 1. 20 | */ 21 | WIN1, 22 | /** 23 | * Object layer window. 24 | */ 25 | OBJ, 26 | }; 27 | 28 | 29 | /** 30 | * Controls window layer position. 31 | */ 32 | struct WindowPosition { 33 | /** 34 | * Window's right boundary coordinate. 35 | */ 36 | uint8_t right; 37 | 38 | /** 39 | * Window's left boundary coordinate. 40 | */ 41 | uint8_t left; 42 | 43 | private: 44 | [[maybe_unused]] 45 | uint8_t __do_not_plz[2]; 46 | 47 | public: 48 | /** 49 | * Window's bottom boundary coordinate. 50 | */ 51 | uint8_t bottom; 52 | 53 | /** 54 | * Window's upper boundary coordinate. 55 | */ 56 | uint8_t top; 57 | }; 58 | 59 | 60 | /** 61 | * Controls window layer properties. 62 | */ 63 | class WindowControl { 64 | public: 65 | /** 66 | * Enables/disables Window 0 for a background layer. 67 | * 68 | * @remarks Using Layer::OBJ is UB. 69 | */ 70 | void window0_enable(Layer layer, bool enabled=true) { 71 | data[utils::value_of(layer)] = enabled; 72 | } 73 | 74 | /** 75 | * Enables/disables Window 1 for a background layer. 76 | * 77 | * @remarks Using Layer::OBJ is UB. 78 | */ 79 | void window1_enable(Layer layer, bool enabled=true) { 80 | data[utils::value_of(layer) + 8] = enabled; 81 | } 82 | 83 | /** 84 | * Enables/disables Outer Window for a background layer. 85 | * 86 | * @remarks Using Layer::OBJ is UB. 87 | */ 88 | void outer_enable(Layer layer, bool enabled=true) { 89 | data[utils::value_of(layer) + 16] = enabled; 90 | } 91 | 92 | /** 93 | * Enables/disables Object Window for a background layer. 94 | */ 95 | void obj_enable(Layer layer, bool enabled=true) { 96 | data[utils::value_of(layer) + 24] = enabled; 97 | } 98 | 99 | private: 100 | std::bitset<32> data; 101 | }; 102 | 103 | 104 | WindowPosition& window0(); 105 | WindowPosition& window1(); 106 | WindowControl& window_control(); 107 | 108 | /** 109 | * Makes window layer visible/hidden. 110 | * 111 | * @param window Window layer. 112 | * @param visible True if visible, False if hidden. 113 | */ 114 | inline void set_window_visible(Window window, bool visible=true) { 115 | gba::arch::registers::display 116 | ::lcd_control[13 + utils::value_of(window)] = visible; 117 | } 118 | 119 | } 120 | 121 | #endif 122 | -------------------------------------------------------------------------------- /libgba-cpp/arch/meson.build: -------------------------------------------------------------------------------- 1 | arch_src = files([ 2 | 'cpu/interrupts.cpp', 3 | 'display/effects.cpp', 4 | 'display/layers.cpp', 5 | 'display/objects.cpp', 6 | 'display/tilemap.cpp', 7 | 'display/video.cpp', 8 | 'display/window.cpp', 9 | 'sound/directsound.cpp', 10 | 'sound/sound.cpp', 11 | ]) 12 | 13 | arch_public_headers = files([ 14 | 'registers.h', 15 | 'cpu/interrupts.h', 16 | 'display/effects.h', 17 | 'display/layers.h', 18 | 'display/objects.h', 19 | 'display/tilemap.h', 20 | 'display/video.h', 21 | 'display/window.h', 22 | 'sound/directsound.h', 23 | 'sound/sound.h', 24 | ]) 25 | 26 | install_headers(arch_public_headers) 27 | 28 | arch = static_library( 29 | 'libgba_arch', 30 | arch_src, 31 | include_directories : toplevel_inc, 32 | ) 33 | 34 | arch_dep = declare_dependency( 35 | link_with : arch, 36 | include_directories : toplevel_inc, 37 | ) 38 | -------------------------------------------------------------------------------- /libgba-cpp/arch/sound/directsound.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | 5 | #include "registers.h" 6 | 7 | using utils::value_of; 8 | using namespace gba::arch::registers::sound; 9 | 10 | namespace gba { 11 | 12 | void sound::ds_volume(Volume volume) { 13 | directsound_control = 14 | (directsound_control.to_ulong() & 0b11) | (value_of(volume) & 0b11); 15 | } 16 | 17 | // A side 18 | 19 | void sound::dsa_volume_ratio(sound::DSoundRatio ratio) { 20 | directsound_control[2] = ratio == DSoundRatio::RATIO100; 21 | } 22 | 23 | void sound::dsa_enabled_left(bool enabled) { 24 | directsound_control[9] = enabled; 25 | } 26 | 27 | void sound::dsa_enabled_right(bool enabled) { 28 | directsound_control[8] = enabled; 29 | } 30 | 31 | void sound::dsa_use_timer(bool use) { 32 | directsound_control[10] = use; 33 | } 34 | 35 | void sound::dsa_fifo_reset() { 36 | directsound_control[11] = true; 37 | } 38 | 39 | // B side 40 | 41 | void sound::dsb_volume_ratio(sound::DSoundRatio ratio) { 42 | directsound_control[3] = ratio == DSoundRatio::RATIO100; 43 | } 44 | 45 | void sound::dsb_enabled_left(bool enabled) { 46 | directsound_control[13] = enabled; 47 | } 48 | 49 | void sound::dsb_enabled_right(bool enabled) { 50 | directsound_control[12] = enabled; 51 | } 52 | 53 | void sound::dsb_use_timer(bool use) { 54 | directsound_control[14] = use; 55 | } 56 | 57 | void sound::dsb_fifo_reset() { 58 | directsound_control[15] = true; 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /libgba-cpp/arch/sound/directsound.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBGBACPP_DRIVERS_SOUND_DIRECT_SOUND_H 2 | #define LIBGBACPP_DRIVERS_SOUND_DIRECT_SOUND_H 3 | 4 | #include "sound.h" 5 | 6 | namespace gba::sound { 7 | 8 | /** 9 | * Direct Sound 10 | */ 11 | 12 | enum class DSoundRatio { 13 | RATIO50, 14 | RATIO100, 15 | }; 16 | 17 | void ds_volume(Volume); 18 | 19 | void dsa_volume_ratio(DSoundRatio); 20 | void dsa_enabled_left(bool); 21 | void dsa_enabled_right(bool); 22 | void dsa_use_timer(bool); 23 | void dsa_fifo_reset(); 24 | 25 | void dsb_volume_ratio(DSoundRatio); 26 | void dsb_enabled_left(bool); 27 | void dsb_enabled_right(bool); 28 | void dsb_use_timer(bool); 29 | void dsb_fifo_reset(); 30 | 31 | } 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /libgba-cpp/arch/sound/sound.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | 6 | using utils::value_of; 7 | using namespace gba::arch::registers::sound; 8 | 9 | namespace gba { 10 | 11 | void sound::set_enabled(bool flag) { 12 | status[7] = flag; 13 | } 14 | 15 | void sound::set_left(sound::Channel channel, bool enabled) { 16 | dmg_control[0x8 + value_of(channel)] = enabled; 17 | } 18 | 19 | void sound::set_right(sound::Channel channel, bool enabled) { 20 | dmg_control[0xc + value_of(channel)] = enabled; 21 | } 22 | 23 | void sound::left_volume(unsigned volume) { 24 | dmg_control = 25 | (dmg_control.to_ulong() & (~0b111u << 4)) | (volume & 0b111); 26 | } 27 | 28 | void sound::right_volume(unsigned volume) { 29 | dmg_control = 30 | (dmg_control.to_ulong() & ~0b111u) | (volume & 0b111); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /libgba-cpp/arch/sound/sound.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBGBACPP_DRIVERS_SOUND_SOUND_H 2 | #define LIBGBACPP_DRIVERS_SOUND_SOUND_H 3 | 4 | namespace gba::sound { 5 | 6 | /** 7 | * Must be on for registers to be accessed and for sound to play. 8 | */ 9 | void set_enabled(bool); 10 | 11 | /** 12 | * General 13 | */ 14 | 15 | enum class Channel { 16 | SQUARE1, 17 | SQUARE2, 18 | WAVE, 19 | NOISE, 20 | }; 21 | 22 | enum class Volume { 23 | VOLUME_25, 24 | VOLUME_50, 25 | VOLUME_100, 26 | }; 27 | 28 | void left_volume(unsigned); 29 | void right_volume(unsigned); 30 | 31 | void set_left(Channel, bool enabled=true); 32 | void set_right(Channel, bool enabled=true); 33 | 34 | void sweep_number(unsigned); 35 | 36 | enum class SweepMode { 37 | INCREMENT, 38 | DECREMENT, 39 | }; 40 | void sweep_mode(SweepMode); 41 | 42 | void sweep_step_time(unsigned); 43 | 44 | } 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /libgba-cpp/engine/graphics/bitmap.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace { 4 | 5 | using gba::graphics::Color; 6 | using gba::graphics::Palette; 7 | 8 | const std::array empty_palette = { 9 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25 | }; 26 | 27 | } 28 | 29 | const Palette Palette::EMPTY = Palette{empty_palette}; 30 | -------------------------------------------------------------------------------- /libgba-cpp/engine/graphics/bitmap.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBGBA_ENGINE_BITMAP_H 2 | #define LIBGBA_ENGINE_BITMAP_H 3 | 4 | #include 5 | 6 | #include 7 | 8 | 9 | namespace gba::graphics { 10 | 11 | 12 | class PalettedBitmap { 13 | public: 14 | PalettedBitmap( 15 | int width, 16 | int height, 17 | const Palette& palette); 18 | 19 | PalettedBitmap( 20 | int width, 21 | int height, 22 | const Palette& palette, 23 | uint8_t data[] 24 | ): 25 | width_{width}, 26 | height_{height}, 27 | palette_{palette}, 28 | data_{data} 29 | {} 30 | 31 | auto width() const { 32 | return width_; 33 | } 34 | 35 | auto height() const { 36 | return height_; 37 | } 38 | 39 | auto data() const { 40 | return data_; 41 | } 42 | 43 | auto palette() const { 44 | return palette_; 45 | } 46 | 47 | private: 48 | const int width_; 49 | const int height_; 50 | const Palette& palette_; 51 | const uint8_t* data_; 52 | }; 53 | 54 | 55 | class TiledBitmap { 56 | public: 57 | TiledBitmap( 58 | int width, 59 | int height, 60 | const Tileset& tileset, 61 | const Tilemap& tilemap): 62 | width_{width}, 63 | height_{height}, 64 | tileset_{tileset}, 65 | tilemap_{tilemap} 66 | {} 67 | 68 | auto tileset() const { 69 | return tileset_; 70 | } 71 | 72 | auto tilemap() const { 73 | return tilemap_; 74 | } 75 | 76 | auto width() const { 77 | return width_; 78 | } 79 | 80 | auto height() const { 81 | return height_; 82 | } 83 | 84 | private: 85 | const int width_; 86 | const int height_; 87 | const Tileset& tileset_; 88 | const Tilemap& tilemap_; 89 | }; 90 | 91 | 92 | } 93 | 94 | #endif 95 | -------------------------------------------------------------------------------- /libgba-cpp/engine/graphics/graphics.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBGBA_ENGINE_GRAPHICS_H 2 | #define LIBGBA_ENGINE_GRAPHICS_H 3 | 4 | #include 5 | 6 | /** 7 | * Graphics API 8 | */ 9 | namespace gba::graphics { 10 | 11 | using gba::display::Color; 12 | 13 | } 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /libgba-cpp/engine/graphics/map.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBGBA_ENGINE_MAP_H 2 | #define LIBGBA_ENGINE_MAP_H 3 | 4 | #include 5 | #include "tilemap.h" 6 | 7 | namespace gba::graphics { 8 | 9 | using gba::display::MapSize; 10 | 11 | class Map { 12 | public: 13 | Map(MapSize size, 14 | const Tileset& tileset, 15 | const Tilemap& tilemap): 16 | size_{size}, 17 | tileset_{tileset}, 18 | tilemap_{tilemap} 19 | {} 20 | 21 | const auto tileset() const { 22 | return tileset_; 23 | } 24 | 25 | const auto tilemap() const { 26 | return tilemap_; 27 | } 28 | 29 | const auto size() const { 30 | return size_; 31 | } 32 | 33 | const auto width() const { 34 | return gba::display::extract_size(size_).width; 35 | } 36 | 37 | const auto height() const { 38 | return gba::display::extract_size(size_).height; 39 | } 40 | 41 | private: 42 | const MapSize size_; 43 | const Tileset& tileset_; 44 | const Tilemap& tilemap_; 45 | }; 46 | 47 | } 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /libgba-cpp/engine/graphics/maps.h: -------------------------------------------------------------------------------- 1 | #ifndef GBA_ENGINE_GRAPHICS_MAPS_H 2 | #define GBA_ENGINE_GRAPHICS_MAPS_H 3 | 4 | #include 5 | 6 | #include 7 | 8 | #include "geometry.h" 9 | 10 | namespace gba::engine::graphics { 11 | 12 | template 13 | using TileSet = std::array; 14 | 15 | 16 | template 17 | class TileMap { 18 | using contents_t = std::array; 19 | public: 20 | TileMap(contents_t& contents): 21 | contents{contents} 22 | {} 23 | 24 | auto& length() const { 25 | return MapLength; 26 | } 27 | 28 | const auto& operator[](int i) const { 29 | return contents[i]; 30 | } 31 | 32 | private: 33 | const contents_t& contents; 34 | }; 35 | 36 | 37 | class Map { 38 | public: 39 | virtual auto length() const -> std::size_t = 0; 40 | virtual auto operator()(int x, int y) -> int& = 0; 41 | virtual auto operator()(int x, int y) const -> const int& = 0; 42 | }; 43 | 44 | 45 | template 46 | class BaseMap: Map { 47 | using tileset_t = TileSet; 48 | using tilemap_t = TileMap; 49 | public: 50 | BaseMap(tileset_t& tileset, tilemap_t& tilemap, geometry::Size size = {0, 0}): 51 | _tileset{tileset}, 52 | _tilemap{tilemap}, 53 | size{size} 54 | {} 55 | 56 | auto length() const override { 57 | return _tilemap.length(); 58 | } 59 | 60 | auto& tileset() { 61 | return _tileset; 62 | } 63 | 64 | const auto& tileset() const { 65 | return _tileset; 66 | } 67 | 68 | auto& tilemap() { 69 | return _tilemap; 70 | } 71 | 72 | const auto& tilemap() const { 73 | return _tilemap; 74 | } 75 | 76 | auto& operator()(int x, int y) override { 77 | return _tilemap[x + size.width * y]; 78 | } 79 | 80 | const auto& operator()(int x, int y) const override { 81 | return _tilemap[x + size.width * y]; 82 | } 83 | 84 | private: 85 | tileset_t& _tileset; 86 | tilemap_t& _tilemap; 87 | geometry::Size size; 88 | }; 89 | 90 | } 91 | 92 | #endif 93 | -------------------------------------------------------------------------------- /libgba-cpp/engine/graphics/palette.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | 5 | void gba::graphics::load_palette(const Palette& palette) { 6 | for (auto i = 0u; i < palette.size(); ++i) { 7 | display::bg_palette()[i] = palette[i].value(); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /libgba-cpp/engine/graphics/palette.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBGBA_ENGINE_PALETTE_H 2 | #define LIBGBA_ENGINE_PALETTE_H 3 | 4 | #include 5 | #include 6 | 7 | #include "graphics.h" 8 | 9 | namespace gba::graphics { 10 | 11 | /** 12 | * Bitmap color palette. 13 | */ 14 | class Palette { 15 | public: 16 | template 17 | Palette(const std::array& palette): 18 | size_{N}, 19 | palette_{palette.data()} 20 | {} 21 | 22 | template 23 | Palette(const std::array& palette): 24 | size_{N}, 25 | palette_{palette.data()} 26 | {} 27 | 28 | /** 29 | * @param palette Color array. 30 | * @param size Color array size. 31 | */ 32 | Palette(const uint16_t palette[], 33 | std::size_t size 34 | ): 35 | size_{size}, 36 | palette_{reinterpret_cast(palette)} 37 | {} 38 | 39 | /** 40 | * Accesses palette data. 41 | */ 42 | const auto& colors() const { 43 | return palette_; 44 | } 45 | 46 | /** 47 | * Accesses a single entry at given index. 48 | */ 49 | auto& operator[](std::size_t i) { 50 | return palette_[i]; 51 | } 52 | 53 | /** 54 | * Reads a single entry at given index. 55 | */ 56 | const auto& operator[](std::size_t i) const { 57 | return palette_[i]; 58 | } 59 | 60 | /** 61 | * Number of colors on palette. 62 | */ 63 | auto size() const { 64 | return size_; 65 | } 66 | 67 | static const Palette EMPTY; 68 | private: 69 | std::size_t size_; 70 | const Color* palette_; 71 | }; 72 | 73 | /** 74 | * Loads palette into memory. 75 | */ 76 | void load_palette(const Palette&); 77 | 78 | } 79 | 80 | #endif 81 | -------------------------------------------------------------------------------- /libgba-cpp/engine/input.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | auto gba::input::pressing(Key key) -> bool { 6 | auto index = static_cast(utils::value_of(key)); 7 | //return (*reinterpret_cast(0x0400'0130)) & (1 << index); 8 | return not arch::registers::io::keypad_status[index]; 9 | } 10 | -------------------------------------------------------------------------------- /libgba-cpp/engine/input.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBGBA_CPP_ENGINE_INPUT_H 2 | #define LIBGBA_CPP_ENGINE_INPUT_H 3 | 4 | namespace gba::input { 5 | 6 | enum class Key { 7 | A, 8 | B, 9 | SELECT, 10 | START, 11 | RIGHT, 12 | LEFT, 13 | UP, 14 | DOWN, 15 | R, 16 | L, 17 | }; 18 | 19 | auto pressing(Key) -> bool; 20 | auto update() -> void; 21 | 22 | } 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /libgba-cpp/engine/meson.build: -------------------------------------------------------------------------------- 1 | engine_src = files([ 2 | 'input.cpp', 3 | 'graphics/bitmap.cpp', 4 | 'graphics/palette.cpp', 5 | ]) 6 | 7 | 8 | engine_public_headers = files([ 9 | 'input.h', 10 | 'graphics/bitmap.h', 11 | 'graphics/graphics.h', 12 | 'graphics/map.h', 13 | 'graphics/maps.h', 14 | 'graphics/palette.h', 15 | 'graphics/tilemap.h', 16 | ]) 17 | 18 | install_headers(engine_public_headers) 19 | 20 | engine = static_library( 21 | 'libgba_engine', 22 | engine_src, 23 | include_directories : [toplevel_inc, include_directories('.')], 24 | ) 25 | 26 | engine_dep = declare_dependency( 27 | link_with: engine, 28 | include_directories : [toplevel_inc, include_directories('.')], 29 | ) 30 | -------------------------------------------------------------------------------- /libgba-cpp/meson.build: -------------------------------------------------------------------------------- 1 | subdir('arch') 2 | subdir('engine') 3 | 4 | libgba = static_library('gba', 5 | dependencies: [arch_dep, engine_dep, gba_runtime_dep], 6 | ) 7 | 8 | libgba_dep = declare_dependency( 9 | include_directories : toplevel_inc, 10 | link_with : libgba) 11 | -------------------------------------------------------------------------------- /libgba-cpp/utils/general.h: -------------------------------------------------------------------------------- 1 | #ifndef GBA_UTILS_GENERAL_H 2 | #define GBA_UTILS_GENERAL_H 3 | 4 | #include 5 | 6 | /** 7 | * General C++ Utilities. 8 | */ 9 | namespace utils { 10 | 11 | /** 12 | * Extracts value from enum. 13 | */ 14 | template 15 | constexpr auto value_of(Enum e) 16 | { 17 | return static_cast>(e); 18 | } 19 | 20 | } 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /libgba-cpp/utils/geometry.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBGBA_CPP_DRIVERS_GEOMETRY_H 2 | #define LIBGBA_CPP_DRIVERS_GEOMETRY_H 3 | 4 | namespace gba::geometry { 5 | 6 | struct Point { 7 | int x; 8 | int y; 9 | }; 10 | 11 | struct Size { 12 | int width; 13 | int height; 14 | }; 15 | 16 | struct Rect { 17 | int x; 18 | int y; 19 | int width; 20 | int height; 21 | 22 | auto top_left() const -> Point { 23 | return {x, y}; 24 | } 25 | 26 | auto top_right() const -> Point { 27 | return {x + width, y}; 28 | } 29 | 30 | auto bottom_left() const -> Point { 31 | return {x, y + height}; 32 | } 33 | 34 | auto bottom_right() const -> Point { 35 | return {x + width, y + height}; 36 | } 37 | 38 | auto size() const -> Size { 39 | return {width, height}; 40 | } 41 | }; 42 | 43 | } 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /meson.build: -------------------------------------------------------------------------------- 1 | project('libgba-cpp', 2 | 'cpp', 3 | version : '0.1.0', 4 | default_options : [ 5 | 'backend=ninja', 6 | 'cpp_std=c++20', 7 | 'warning_level=3', 8 | ], 9 | ) 10 | 11 | toplevel_inc = include_directories('.') 12 | 13 | subdir('specs') 14 | subdir('libgba-cpp') 15 | 16 | if get_option('build-tests') 17 | subdir('tests') 18 | endif 19 | -------------------------------------------------------------------------------- /meson_options.txt: -------------------------------------------------------------------------------- 1 | option('build-tests', type : 'boolean', value : false, description : 'Build ROMs from "tests" directory.') 2 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | LibGBA - CPP 2 | ============ 3 | 4 | What is it? 5 | ----------- 6 | 7 | It's a C++ library for GBA homebrew development. Focused on better API and 8 | abstraction, so programmers can focus more on game logic and call functions for 9 | effects instead of thinking in a too low-level way. 10 | 11 | Requirements 12 | ------------ 13 | 14 | A lot of statements are being written with C++11/14/17 features, so, the 15 | requirements are: 16 | 17 | - **Toolchain**: DevKitPro (to compile for GBA ARMv4 ISA and ARM7TDMI 18 | processor). 19 | - **Compiler**: GCC 7.1 or above; 20 | - **Build-system**: Meson 21 | 22 | Examples 23 | -------- 24 | 25 | - [AlphaBlending (BG Layers)](tests/alphablend) 26 | - [Generated Tilemaps](tests/gen_tilemap) 27 | - [Interrupts](tests/interrupts) 28 | - [Mode5](tests/mode5) 29 | - [Mosaic](tests/mosaic) 30 | - [Sound](tests/sound) 31 | - [Tilemap](tests/tilemap) 32 | - [Windowing](tests/windowing) 33 | 34 | Building 35 | -------- 36 | 37 | To build this project, after installing the [Requirements](#Requirements) and 38 | cloning this repository, enter the cloned repository's directory and run: 39 | 40 | ```console 41 | $ meson build --cross-file cross_file.ini 42 | ``` 43 | 44 | If you want to build examples as well, add `-Dbuild-tests=true` to the command: 45 | 46 | ```console 47 | $ meson build -Dbuild-tests=true 48 | ``` 49 | 50 | Running examples 51 | ---------------- 52 | 53 | After building the examples (see [Building](#Building)), you'll need a GBA 54 | emulator. My personal recommendations are: 55 | - [MGBA](https://mgba.io/): an open-source fully-featured GBA emulator with a 56 | lot of cool debugging tools. Can also link with GDB for a professional 57 | in-depth debugging. 58 | - [Visual Boy Advance-M](https://vba-m.com/): continuation of the almighty 59 | legendary VisualBoyAdvance. 60 | 61 | Examples are compiled into the `build/tests` directory. So to run, say, 62 | `alphablend` example, you should open `build/tests/alphablend.gba` with your 63 | emulator. 64 | 65 | Documentation 66 | ------------- 67 | 68 | - [API Documentation](https://jptiz.github.io/libgba-cpp/index.html) 69 | 70 | To-Do's 71 | ------- 72 | 73 | [Check issues](https://github.com/JPTIZ/libgba-cpp/issues). 74 | 75 | Bibliography 76 | ------------ 77 | 78 | There are two main contributions for the knowledge necessary to make this 79 | library: one is the greatly well explained tutorials [TONC by J 80 | Vijn](http://www.coranac.com/tonc/text/toc.htm) (which I really want to thank 81 | him for making it), and the other is the great [GBA Techical Manual by Martin 82 | Korth](http://problemkaputt.de/gbatek.htm). 83 | -------------------------------------------------------------------------------- /specs/gba.specs.in: -------------------------------------------------------------------------------- 1 | %rename link old_link 2 | 3 | *link: 4 | %(old_link) -T @SPECS_DIR@/gba_cart.ld%s --gc-sections 5 | 6 | *startfile: 7 | @CRT0_DIR@/gba_crt0%O%s crti%O%s crtbegin%O%s 8 | 9 | -------------------------------------------------------------------------------- /specs/gba_er.ld: -------------------------------------------------------------------------------- 1 | /***********************************/ 2 | /* NINTENDO E-READER LINKER SCRIPT */ 3 | /***********************************/ 4 | /* Author : Tim Schuerewegen */ 5 | /* Version : 1.0 */ 6 | /***********************************/ 7 | 8 | OUTPUT_FORMAT( "elf32-littlearm", "elf32-bigarm", "elf32-littlearm") 9 | OUTPUT_ARCH( arm) 10 | ENTRY( _start) 11 | 12 | SECTIONS 13 | { 14 | . = 0x02000000; 15 | 16 | .crt0 : 17 | { 18 | *(.crt0) 19 | . = ALIGN(4); 20 | } = 0xff 21 | 22 | .text : 23 | { 24 | *(.text) 25 | . = ALIGN(4); 26 | } = 0xff 27 | 28 | .rodata : 29 | { 30 | *(.rodata) 31 | . = ALIGN(4); 32 | } = 0xff 33 | 34 | .data : 35 | { 36 | *(.data) 37 | . = ALIGN(4); 38 | } = 0xff 39 | 40 | .bss : 41 | { 42 | __bss_start = .; 43 | *(.bss) 44 | . = ALIGN(4); 45 | __bss_end__ = ABSOLUTE(.); 46 | __end__ = ABSOLUTE(.); 47 | } 48 | } 49 | 50 | -------------------------------------------------------------------------------- /specs/gba_er.specs: -------------------------------------------------------------------------------- 1 | %rename link old_link 2 | %rename endfile old_endfile 3 | 4 | *link: 5 | -T gba_er.ld%s %(old_link) --gc-sections 6 | 7 | *startfile: 8 | er_crt0%O%s 9 | -------------------------------------------------------------------------------- /specs/gba_mb.specs: -------------------------------------------------------------------------------- 1 | %rename link old_link 2 | 3 | *link: 4 | -T gba_mb.ld%s %(old_link) --gc-sections 5 | 6 | *startfile: 7 | gba_crt0%O%s crti%O%s crtbegin%O%s 8 | 9 | -------------------------------------------------------------------------------- /specs/meson.build: -------------------------------------------------------------------------------- 1 | specs_in_files = files([ 2 | 'gba.specs.in' 3 | ]) 4 | 5 | specs_output = 'gba.specs' 6 | 7 | specs_conf = configuration_data({ 8 | 'SPECS_DIR' : '/'.join(meson.current_source_dir().split('\\')), 9 | 'CRT0_DIR' : '/'.join(meson.current_build_dir().split('\\')), 10 | }) 11 | 12 | specs_gen_file = configure_file( 13 | input : 'gba.specs.in', 14 | output : specs_output, 15 | configuration : specs_conf, 16 | ) 17 | 18 | specs_path = meson.current_build_dir() / specs_output 19 | 20 | gba_crt0 = custom_target( 21 | 'gba_crt0', 22 | input : 'gba_crt0.s', 23 | output : 'gba_crt0.o', 24 | command : ['arm-none-eabi-gcc', '-c', '@INPUT@', '-o', '@OUTPUT@'], 25 | ) 26 | 27 | gba_runtime_dep = declare_dependency( 28 | sources : gba_crt0, 29 | link_args : [ 30 | '-specs=@0@'.format(specs_path), 31 | # Include nosys for not implemented functions by previous spec file 32 | '-specs=nosys.specs', 33 | ] 34 | ) 35 | -------------------------------------------------------------------------------- /tests/alphablend/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "sample_tiles.h" 5 | #include "sample_map.h" 6 | 7 | using namespace gba::display; 8 | using namespace gba::display::map; 9 | 10 | using namespace resources::maps; 11 | using namespace test; 12 | 13 | void copy_palette() { 14 | for (auto i = 0u; i < sample_palette.size(); ++i) { 15 | bg_palette()[i + 1] = sample_palette[i]; 16 | } 17 | } 18 | 19 | void copy_tiles() { 20 | for (auto i = 0u; i < sample_tiles.size(); ++i) { 21 | tileset()[i + 1] = sample_tiles[i]; 22 | } 23 | } 24 | 25 | void gen_map() { 26 | for (auto i = 0u; i < layer0.size(); ++i) { 27 | auto x = i % 8; 28 | auto y = i / 8; 29 | tilemap()[x + 32 * y] = layer0[i]; 30 | } 31 | 32 | for (auto i = 0u; i < layer1.size(); ++i) { 33 | tilemap()[i + 3 + 32 * 3 + 0x400] = layer1[i]; 34 | } 35 | 36 | for (auto i = 0; i < 9; ++i) { 37 | tilemap()[(i % 3) + 3 + 32 * (3 + i / 3) + 0x800] = 0xb; 38 | } 39 | 40 | for (auto i = 0; i < 9; ++i) { 41 | tilemap()[(i % 3) + 5 + 32 * (5 + i / 3) + 0xC00] = 0xb; 42 | } 43 | } 44 | 45 | int main() { 46 | layer_visible(Layer::BG0); 47 | layer_visible(Layer::BG1); 48 | layer_visible(Layer::BG2); 49 | layer_visible(Layer::BG3); 50 | 51 | bg_control(Layer::BG0).screen_base_block(1); 52 | bg_control(Layer::BG1).screen_base_block(2); 53 | bg_control(Layer::BG2).screen_base_block(3); 54 | bg_control(Layer::BG3).screen_base_block(4); 55 | 56 | bg_control(Layer::BG0).priority(BGPriority::LOWEST); 57 | bg_control(Layer::BG1).priority(BGPriority::LOW); 58 | bg_control(Layer::BG2).priority(BGPriority::HIGH); 59 | bg_control(Layer::BG3).priority(BGPriority::HIGHEST); 60 | 61 | set_first_target(Layer::BG3); 62 | set_first_target(Layer::BG2); 63 | set_first_target(Layer::BG1); 64 | set_second_target(Layer::BG2); 65 | set_second_target(Layer::BG1); 66 | set_second_target(Layer::BG0); 67 | select(SpecialEffect::ALPHA_BLEND); 68 | 69 | copy_palette(); 70 | copy_tiles(); 71 | 72 | gen_map(); 73 | 74 | bg_oy(Layer::BG0) = -8; 75 | bg_oy(Layer::BG1) = -16; 76 | 77 | blend_first_target_strength() = 8; 78 | blend_second_target_strength() = 4; 79 | 80 | auto i = 0; 81 | 82 | while (true) { 83 | vsync(); 84 | 85 | bg_ox(Layer::BG1) = -i; 86 | 87 | ++i; 88 | } 89 | } 90 | 91 | -------------------------------------------------------------------------------- /tests/alphablend/readme.md: -------------------------------------------------------------------------------- 1 | Alphablend Test 2 | =============== 3 | 4 | This test just shows how alphablend can be used with LibGBA-CPP. 5 | 6 | | Function | Status | 7 | |---------------|---------| 8 | | Alphablend | Working | 9 | | Brighten | Working | 10 | | Lighten | Working | 11 | 12 | Explanation 13 | ----------- 14 | 15 | _TODO._ 16 | 17 | Screenshots 18 | ----------- 19 | 20 | ![Alphablend example 1](screenshots/alphablend-0.png) 21 | 22 | ![Alphablend example 2](screenshots/alphablend-1.png) 23 | -------------------------------------------------------------------------------- /tests/alphablend/sample_map.h: -------------------------------------------------------------------------------- 1 | #ifndef TEST_SAMPLE_MAP_H 2 | #define TEST_SAMPLE_MAP_H 3 | 4 | #include 5 | 6 | namespace test { 7 | 8 | static std::array layer0 = { 9 | 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, // 0..7 10 | 0x1, 0x4, 0x3, 0x3, 0x3, 0x3, 0x2, 0x1, // 8..15 11 | 0x1, 0x7, 0x1, 0x1, 0x1, 0x1, 0x7, 0x1, // 16.23 12 | 0x1, 0x7, 0x1, 0x1, 0x1, 0x1, 0x7, 0x1, // 24..31 13 | 0x1, 0x7, 0x1, 0x1, 0x1, 0x1, 0x7, 0x1, // 32..39 14 | 0x1, 0x7, 0x1, 0x1, 0x1, 0x1, 0x7, 0x1, // 40..47 15 | 0x1, 0x6, 0x3, 0x3, 0x3, 0x3, 0x5, 0x1, // 48..55 16 | 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, // 56..63 17 | }; 18 | 19 | static std::array layer1 = { 20 | 0x8, 0x9, 0x0, 0x9, 0x0, 0x9, 0x0, 0x8, 21 | }; 22 | 23 | } 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /tests/alphablend/sample_tiles.h: -------------------------------------------------------------------------------- 1 | #ifndef RESOURCES_SAMPLE_TILES_H 2 | #define RESOURCES_SAMPLE_TILES_H 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | 9 | namespace resources::maps { 10 | 11 | using gba::display::Color; 12 | using gba::display::map::Tile; 13 | 14 | const std::array sample_palette = { 15 | Color{0x1f, 0x00, 0x00}, // 0 16 | Color{0x00, 0x1f, 0x00}, // 1 17 | Color{0x00, 0x00, 0x17}, // 2 18 | Color{0x1f, 0x1f, 0x00}, // 3 19 | Color{0x00, 0x1f, 0x17}, // 4 20 | Color{0x1f, 0x00, 0x17}, // 5 21 | Color{0x1f, 0x1f, 0x1f}, // 6 22 | }; 23 | 24 | const std::array sample_tiles = { 25 | // 0 26 | Tile{{ 27 | 0x33333333, 28 | 0x33333333, 29 | 0x33333333, 30 | 0x33333333, 31 | 0x33333333, 32 | 0x33333333, 33 | 0x33333333, 34 | 0x33333333, 35 | 36 | }}, 37 | 38 | // 1 39 | Tile{{ 40 | 0x11111111, 41 | 0x12222222, 42 | 0x12111111, 43 | 0x12111111, 44 | 0x12111111, 45 | 0x12111111, 46 | 0x12111122, 47 | 0x12111121 48 | }}, 49 | 50 | // 2 51 | Tile{{ 52 | 0x11111111, 53 | 0x22222222, 54 | 0x11111111, 55 | 0x11111111, 56 | 0x11111111, 57 | 0x11111111, 58 | 0x22222222, 59 | 0x11111111 60 | }}, 61 | 62 | // 3 63 | Tile{{ 64 | 0x11111111, 65 | 0x22222221, 66 | 0x11111121, 67 | 0x11111121, 68 | 0x11111121, 69 | 0x11111121, 70 | 0x22111121, 71 | 0x12111121 72 | }}, 73 | 74 | // 4 75 | Tile{{ 76 | 0x12111121, 77 | 0x12111122, 78 | 0x12111111, 79 | 0x12111111, 80 | 0x12111111, 81 | 0x12111111, 82 | 0x12222222, 83 | 0x11111111 84 | }}, 85 | 86 | // 5 87 | Tile{{ 88 | 0x12111121, 89 | 0x22111121, 90 | 0x11111121, 91 | 0x11111121, 92 | 0x11111121, 93 | 0x11111121, 94 | 0x22222221, 95 | 0x11111111 96 | }}, 97 | 98 | // 6 99 | Tile{{ 100 | 0x12111121, 101 | 0x12111121, 102 | 0x12111121, 103 | 0x12111121, 104 | 0x12111121, 105 | 0x12111121, 106 | 0x12111121, 107 | 0x12111121 108 | }}, 109 | 110 | // 7 111 | Tile{{ 112 | 0x00044000, 113 | 0x04444440, 114 | 0x00044444, 115 | 0x00000444, 116 | 0x00044444, 117 | 0x04444440, 118 | 0x00044000, 119 | 0x00000000 120 | }}, 121 | 122 | // 8 123 | Tile{{ 124 | 0x00000000, 125 | 0x00000000, 126 | 0x00077000, 127 | 0x00777700, 128 | 0x00777700, 129 | 0x00077000, 130 | 0x00000000, 131 | 0x00000000 132 | }}, 133 | 134 | // 9 135 | Tile{{ 136 | 0x07654321, 137 | 0x01234567, 138 | 0x02644321, 139 | 0x17660321, 140 | 0x21234567, 141 | 0x64637254, 142 | 0x51734642, 143 | 0x62346177 144 | }}, 145 | }; 146 | 147 | } 148 | 149 | #endif 150 | -------------------------------------------------------------------------------- /tests/alphablend/screenshots/alphablend-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPTIZ/libgba-cpp/434211c92423fff67b4f574e055838c3d1d20f5f/tests/alphablend/screenshots/alphablend-0.png -------------------------------------------------------------------------------- /tests/alphablend/screenshots/alphablend-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPTIZ/libgba-cpp/434211c92423fff67b4f574e055838c3d1d20f5f/tests/alphablend/screenshots/alphablend-1.png -------------------------------------------------------------------------------- /tests/gen_tilemap/forest_tileset.h: -------------------------------------------------------------------------------- 1 | #ifndef TEST_MAPS_FOREST_H 2 | #define TEST_MAPS_FOREST_H 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | 9 | namespace test::maps { 10 | 11 | extern const gba::graphics::Palette forest_palette; 12 | extern const gba::graphics::Tileset forest_tileset; 13 | 14 | } 15 | 16 | #endif -------------------------------------------------------------------------------- /tests/gen_tilemap/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "map001.h" 4 | 5 | using namespace gba::display; 6 | using namespace gba::graphics; 7 | using namespace test::maps; 8 | 9 | 10 | int main() { 11 | force_blank(true); 12 | 13 | const auto& map = map001; 14 | 15 | change_mode(Mode::MODE0); 16 | layer_visible(Layer::BG0); 17 | layer_visible(Layer::BG1); 18 | 19 | load_map(map); 20 | 21 | force_blank(false); 22 | 23 | while (true) { 24 | vsync(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /tests/gen_tilemap/map001.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace test::maps { 6 | 7 | extern const gba::graphics::Map map001; 8 | 9 | } -------------------------------------------------------------------------------- /tests/gen_tilemap/meson.build: -------------------------------------------------------------------------------- 1 | test_gen_tilemap = executable('test_gen_tilemap.gba', 2 | files('main.cpp', 'map001.cpp', 'forest_tileset.cpp'), 3 | include_directories : toplevel_inc, 4 | dependencies : libgba_dep, 5 | ) 6 | -------------------------------------------------------------------------------- /tests/gen_tilemap/readme.md: -------------------------------------------------------------------------------- 1 | Generated Tilemaps 2 | ================== 3 | 4 | Actually used to test if [my map editor](https://github.com/jptiz/map-editor) 5 | is generating maps properly compatible with LibGBA-CPP. 6 | 7 | | Function | Status | 8 | |-----------------|--------------| 9 | | Single Layer | Working | 10 | | Multiple Layers | Working | 11 | | Link Tileset | Working | 12 | 13 | Explanation 14 | ----------- 15 | 16 | _TODO._ 17 | 18 | Screenshots 19 | ----------- 20 | 21 | ![Generated Tilemap Example 1](screenshots/gen_tilemap-0.png) 22 | 23 | -------------------------------------------------------------------------------- /tests/gen_tilemap/screenshots/gen_tilemap-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPTIZ/libgba-cpp/434211c92423fff67b4f574e055838c3d1d20f5f/tests/gen_tilemap/screenshots/gen_tilemap-0.png -------------------------------------------------------------------------------- /tests/interrupts/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | 6 | using namespace gba::display; 7 | using namespace gba::cpu; 8 | 9 | int main() { 10 | //setup_interrupts(); 11 | 12 | vblank_interrupt(true); 13 | bg_palette()[0] = Color{0, 0x1f, 0}; 14 | while (true) { 15 | halt(); 16 | bg_palette()[0] = Color{0, 0x1f, 0}; 17 | halt(); 18 | bg_palette()[0] = Color{0x1f, 0, 0}; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /tests/interrupts/readme.md: -------------------------------------------------------------------------------- 1 | Interrupts 2 | ========== 3 | 4 | Tests if interrupts are set and triggered correctly. 5 | 6 | | Function | Status | 7 | |--------------------------|-----------------| 8 | | Trigger Interrupt Handle | **Not working** | 9 | | Keyboard Interrupt | **Not working** | 10 | | VSync Interrupt | **Not working** | 11 | | HSync Interrupt | **Not working** | 12 | 13 | Explanation 14 | ----------- 15 | 16 | _TODO._ 17 | 18 | Screenshots 19 | ----------- 20 | 21 | Effects not visible with screenshots. 22 | -------------------------------------------------------------------------------- /tests/meson.build: -------------------------------------------------------------------------------- 1 | generic_test_dirs = [ 2 | 'alphablend', 3 | 'interrupts', 4 | 'pong', 5 | 'mode5', 6 | 'mosaic', 7 | 'sound', 8 | 'windowing', 9 | ] 10 | 11 | foreach test_dir : generic_test_dirs 12 | test_rom = executable('@0@.gba'.format(test_dir), 13 | files(test_dir / 'main.cpp'), 14 | dependencies : libgba_dep, 15 | ) 16 | endforeach 17 | 18 | custom_tests = [ 19 | 'gen_tilemap', 20 | ] 21 | 22 | foreach test_dir : custom_tests 23 | subdir(test_dir) 24 | endforeach 25 | -------------------------------------------------------------------------------- /tests/mode5/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void fill_screen(const gba::display::Color& color) { 5 | for (auto i = 0u; i < 160*120; ++i) { 6 | gba::display::mode5::vram(i) = color; 7 | } 8 | } 9 | 10 | int main() { 11 | using namespace gba::display; 12 | 13 | force_blank(true); 14 | change_mode(Mode::MODE5); 15 | layer_visible(Layer::BG2); 16 | 17 | fill_screen(Color{31, 0, 0}); 18 | mode5::flip_pages(); 19 | force_blank(false); 20 | 21 | auto first = false; 22 | while (true) { 23 | vsync(); 24 | first = not first; 25 | fill_screen(Color{31 >> first, 0, 0}); 26 | mode5::flip_pages(); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /tests/mode5/readme.md: -------------------------------------------------------------------------------- 1 | Mode 5 2 | ====== 3 | 4 | Tests if Mode 5 (Bitmapped) is properly handled. 5 | 6 | | Function | Status | 7 | |----------------|---------| 8 | | Fill 1st Frame | Working | 9 | | Fill 2st Frame | Working | 10 | | Page-Flip | Working | 11 | 12 | Explanation 13 | ----------- 14 | 15 | _TODO._ 16 | 17 | Screenshots 18 | ----------- 19 | 20 | Page 1: 21 | 22 | ![Mode 5 Example 1](screenshots/mode5-0.png) 23 | 24 | Page 2: 25 | 26 | ![Mode 5 Example 2](screenshots/mode5-1.png) 27 | -------------------------------------------------------------------------------- /tests/mode5/screenshots/mode5-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPTIZ/libgba-cpp/434211c92423fff67b4f574e055838c3d1d20f5f/tests/mode5/screenshots/mode5-0.png -------------------------------------------------------------------------------- /tests/mode5/screenshots/mode5-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPTIZ/libgba-cpp/434211c92423fff67b4f574e055838c3d1d20f5f/tests/mode5/screenshots/mode5-1.png -------------------------------------------------------------------------------- /tests/mosaic/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "sample_tiles.h" 5 | #include "sample_map.h" 6 | 7 | using namespace gba::display; 8 | using namespace gba::display::map; 9 | 10 | using namespace resources::maps; 11 | using namespace test; 12 | 13 | void copy_palette() { 14 | for (auto i = 0u; i < sample_palette.size(); ++i) { 15 | bg_palette()[i + 1] = sample_palette[i]; 16 | } 17 | } 18 | 19 | void copy_tiles() { 20 | for (auto i = 0u; i < sample_tiles.size(); ++i) { 21 | tileset()[i + 1] = sample_tiles[i]; 22 | } 23 | } 24 | 25 | void gen_map() { 26 | 27 | for (auto i = 0u; i < layer0.size(); ++i) { 28 | auto x = i % 8; 29 | auto y = i / 8; 30 | tilemap()[x + 32 * y] = layer0[i]; 31 | } 32 | 33 | for (auto i = 0u; i < layer1.size(); ++i) { 34 | tilemap()[i + 3 + 32 * 3 + 0x400] = layer1[i]; 35 | } 36 | } 37 | 38 | int main() { 39 | layer_visible(Layer::BG0); 40 | layer_visible(Layer::BG1); 41 | 42 | bg_control(Layer::BG0).screen_base_block(1); 43 | bg_control(Layer::BG1).screen_base_block(2); 44 | 45 | bg_control(Layer::BG0).priority(BGPriority::LOWEST); 46 | bg_control(Layer::BG1).priority(BGPriority::LOW); 47 | bg_control(Layer::BG2).priority(BGPriority::HIGH); 48 | bg_control(Layer::BG3).priority(BGPriority::HIGHEST); 49 | 50 | bg_ox(Layer::BG1) = 16; 51 | bg_oy(Layer::BG1) = -16; 52 | 53 | bg_control(Layer::BG0).mosaic(true); 54 | bg_control(Layer::BG1).mosaic(true); 55 | 56 | copy_palette(); 57 | copy_tiles(); 58 | 59 | gen_map(); 60 | 61 | auto i = 0; 62 | 63 | while (true) { 64 | vsync(); 65 | 66 | bg_ox(Layer::BG1) = -i; 67 | 68 | mosaic_bg_level(i, i); 69 | 70 | ++i; 71 | } 72 | } 73 | 74 | -------------------------------------------------------------------------------- /tests/mosaic/readme.md: -------------------------------------------------------------------------------- 1 | Mosaic Effect 2 | ============= 3 | 4 | Tests if Mosaic effect is properly handled. 5 | 6 | | Function | Status | 7 | |---------------|-----------------| 8 | | Enable Mosaic | **Not Working** | 9 | | Set Strength | **Not Working** | 10 | 11 | Explanation 12 | ----------- 13 | 14 | _TODO._ 15 | 16 | Screenshots 17 | ----------- 18 | 19 | _TODO._ 20 | -------------------------------------------------------------------------------- /tests/mosaic/sample_map.h: -------------------------------------------------------------------------------- 1 | #ifndef TEST_SAMPLE_MAP_H 2 | #define TEST_SAMPLE_MAP_H 3 | 4 | #include 5 | 6 | namespace test { 7 | 8 | static std::array layer0 = { 9 | 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 10 | 0x1, 0x4, 0x3, 0x3, 0x3, 0x3, 0x2, 0x1, 11 | 0x1, 0x7, 0x1, 0x1, 0x1, 0x1, 0x7, 0x1, 12 | 0x1, 0x7, 0x1, 0x1, 0x1, 0x1, 0x7, 0x1, 13 | 0x1, 0x7, 0x1, 0x1, 0x1, 0x1, 0x7, 0x1, 14 | 0x1, 0x7, 0x1, 0x1, 0x1, 0x1, 0x7, 0x1, 15 | 0x1, 0x6, 0x3, 0x3, 0x3, 0x3, 0x5, 0x1, 16 | 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 17 | }; 18 | 19 | static std::array layer1 = { 20 | 0x0, 0x8, 0x9, 0x0, 0x9, 0xa, 0x9, 0x9, 21 | }; 22 | 23 | } 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /tests/mosaic/sample_tiles.h: -------------------------------------------------------------------------------- 1 | #ifndef RESOURCES_SAMPLE_TILES_H 2 | #define RESOURCES_SAMPLE_TILES_H 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | 9 | namespace resources::maps { 10 | 11 | using gba::display::Color; 12 | using gba::display::map::Tile; 13 | 14 | static std::array sample_palette = { 15 | Color{0x1f, 0x00, 0x00}, 16 | Color{0x00, 0x1f, 0x00}, 17 | Color{0x00, 0x00, 0x17}, 18 | Color{0x1f, 0x1f, 0x00}, 19 | Color{0x00, 0x1f, 0x17}, 20 | Color{0x1f, 0x00, 0x17}, 21 | Color{0x1f, 0x1f, 0x1f}, 22 | }; 23 | 24 | static std::array sample_tiles = { 25 | Tile{{0x33333333, 26 | 0x33333333, 27 | 0x33333333, 28 | 0x33333333, 29 | 0x33333333, 30 | 0x33333333, 31 | 0x33333333, 32 | 0x33333333}}, 33 | 34 | Tile{{0x11111111, 35 | 0x12222222, 36 | 0x12111111, 37 | 0x12111111, 38 | 0x12111111, 39 | 0x12111111, 40 | 0x12111122, 41 | 0x12111121}}, 42 | 43 | Tile{{0x11111111, 44 | 0x22222222, 45 | 0x11111111, 46 | 0x11111111, 47 | 0x11111111, 48 | 0x11111111, 49 | 0x22222222, 50 | 0x11111111}}, 51 | 52 | Tile{{0x11111111, 53 | 0x22222221, 54 | 0x11111121, 55 | 0x11111121, 56 | 0x11111121, 57 | 0x11111121, 58 | 0x22111121, 59 | 0x12111121}}, 60 | 61 | Tile{{0x12111121, 62 | 0x12111122, 63 | 0x12111111, 64 | 0x12111111, 65 | 0x12111111, 66 | 0x12111111, 67 | 0x12222222, 68 | 0x11111111}}, 69 | 70 | Tile{{0x12111121, 71 | 0x22111121, 72 | 0x11111121, 73 | 0x11111121, 74 | 0x11111121, 75 | 0x11111121, 76 | 0x22222221, 77 | 0x11111111}}, 78 | 79 | Tile{{0x12111121, 80 | 0x12111121, 81 | 0x12111121, 82 | 0x12111121, 83 | 0x12111121, 84 | 0x12111121, 85 | 0x12111121, 86 | 0x12111121}}, 87 | 88 | Tile{{0x00044000, 89 | 0x04444440, 90 | 0x00044444, 91 | 0x00000444, 92 | 0x00044444, 93 | 0x04444440, 94 | 0x00044000, 95 | 0x00000000}}, 96 | 97 | Tile{{0x00000000, 98 | 0x00000000, 99 | 0x00077000, 100 | 0x00777700, 101 | 0x00777700, 102 | 0x00077000, 103 | 0x00000000, 104 | 0x00000000}}, 105 | 106 | Tile{{0x07654321, 107 | 0x01234567, 108 | 0x02644321, 109 | 0x17660321, 110 | 0x21234567, 111 | 0x64637254, 112 | 0x51734642, 113 | 0x62346177}}, 114 | }; 115 | 116 | } 117 | 118 | #endif 119 | -------------------------------------------------------------------------------- /tests/pong/.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | subprojects/libgba 3 | -------------------------------------------------------------------------------- /tests/pong/cross_file.ini: -------------------------------------------------------------------------------- 1 | [binaries] 2 | c = '/opt/devkitpro/devkitARM/bin/arm-none-eabi-gcc' 3 | cpp = '/opt/devkitpro/devkitARM/bin/arm-none-eabi-g++' 4 | ar = '/opt/devkitpro/devkitARM/bin/arm-none-eabi-ar' 5 | strip = '/opt/devkitpro/devkitARM/bin/arm-none-eabi-strip' 6 | 7 | [build-in options] 8 | cpp_eh = 'none' 9 | cpp_rtti = false 10 | cpp_args = [ 11 | '-ffast-math', 12 | '-fomit-frame-pointer', 13 | '-mthumb-interwork', ] 14 | default_library = 'static' 15 | 16 | [host_machine] 17 | system = 'none' 18 | cpu_family = 'arm' 19 | cpu = 'arm7tdmi' 20 | endian = 'little' 21 | -------------------------------------------------------------------------------- /tests/pong/meson.build: -------------------------------------------------------------------------------- 1 | project('gba-pong', 2 | 'cpp', 3 | default_options: [ 4 | 'cpp_std=c++20', 5 | ]) 6 | 7 | libgba = dependency('libgba', fallback : ['libgba', 'libgba_dep']) 8 | 9 | pong = executable('pong.gba', 10 | 'main.cpp', 11 | dependencies : libgba) 12 | -------------------------------------------------------------------------------- /tests/pong/readme.md: -------------------------------------------------------------------------------- 1 | Pong Game (mode 3) 2 | ================== 3 | 4 | Tests if a pong game example made for mode 3 works as expected. 5 | 6 | | Function | Status | 7 | |----------------|---------| 8 | | Draw objects | Working | 9 | | Basic input | Working | 10 | 11 | Explanation 12 | ----------- 13 | 14 | _TODO._ 15 | 16 | Screenshots 17 | ----------- 18 | 19 | In-game: 20 | 21 | ![Pong Game Example](screenshots/pong-0.png) 22 | -------------------------------------------------------------------------------- /tests/pong/screenshots/pong-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPTIZ/libgba-cpp/434211c92423fff67b4f574e055838c3d1d20f5f/tests/pong/screenshots/pong-0.png -------------------------------------------------------------------------------- /tests/sound/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void enable_dmas() { 5 | using namespace gba::arch::registers::io; 6 | 7 | dma1_control = (1 << 6) | // Fixed 8 | (1 << 9) | // Repeat 9 | (1 << 10) | // Word (32-bit) 10 | (1 << 12) | // FI 11 | (1 << 13) | // FO 12 | (1 << 15) // Enabled 13 | ; 14 | } 15 | 16 | int main() { 17 | using namespace gba::sound; 18 | 19 | set_enabled(true); 20 | set_left(Channel::SQUARE1, true); 21 | 22 | enable_dmas(); 23 | 24 | while (true) { 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /tests/sound/readme.md: -------------------------------------------------------------------------------- 1 | Sound 2 | ===== 3 | 4 | Tests if SFXs are properly handled. 5 | 6 | | Function | Status | 7 | |-----------------------|-----------------| 8 | | Enable Audio Channels | **Untested** | 9 | | Set Left/Right Volume | **Untested** | 10 | | Play Square Sound | **Not Working** | 11 | | Play Triangle Sound | **Not Working** | 12 | | Play Square Sound | **Not Working** | 13 | | Control Tone | **Untested** | 14 | 15 | Explanation 16 | ----------- 17 | 18 | _TODO._ 19 | 20 | Screenshots 21 | ----------- 22 | 23 | Effects not visible with screenshots. 24 | -------------------------------------------------------------------------------- /tests/tilemap/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "sample_map.h" 4 | 5 | using namespace gba::display; 6 | using namespace gba::graphics; 7 | using namespace resources::maps; 8 | 9 | 10 | int main() { 11 | force_blank(true); 12 | 13 | const auto map = gba::graphics::Map{ 14 | sample_tileset, 15 | sample_tilemap, 16 | layer0_tilemap, 17 | null_tilemap, 18 | null_tilemap, 19 | gba::graphics::MapSize::TEXT_256X256 20 | }; 21 | 22 | change_mode(Mode::MODE0); 23 | layer_visible(Layer::BG0); 24 | layer_visible(Layer::BG1); 25 | 26 | load_map(map); 27 | 28 | force_blank(false); 29 | 30 | while (true) { 31 | vsync(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /tests/tilemap/readme.md: -------------------------------------------------------------------------------- 1 | Tilemaps 2 | ======== 3 | 4 | Tests if: 5 | - Maps are displayed properly according to its layers and tileset; 6 | - Map loading is copying tilemap/tileset data correctly to VRAM; 7 | - Tile-map and Tile-data base-blocks are properly calculated. 8 | 9 | | Function | Status | 10 | |-----------------|--------------| 11 | | Single Layer | Working | 12 | | Multiple Layers | Working | 13 | | Tileset | Working | 14 | | Load Tilemap | Working | 15 | | Layer Priority | Working | 16 | | Map Switching | **Untested** | 17 | | 8x8 Tiles | Working | 18 | | 256-Color Tiles | **Untested** | 19 | 20 | Explanation 21 | ----------- 22 | 23 | _TODO._ 24 | 25 | Screenshots 26 | ----------- 27 | 28 | ![Tilemap Example 1](screenshots/tilemap-0.png) 29 | -------------------------------------------------------------------------------- /tests/tilemap/sample.h: -------------------------------------------------------------------------------- 1 | #ifndef RESOURCES_MAPS_SAMPLE_H 2 | #define RESOURCES_MAPS_SAMPLE_H 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | 9 | namespace resources::maps { 10 | 11 | extern const gba::graphics::Palette sample_palette; 12 | extern const gba::graphics::Tileset sample_tileset; 13 | 14 | } 15 | 16 | #endif -------------------------------------------------------------------------------- /tests/tilemap/sample_map.cpp: -------------------------------------------------------------------------------- 1 | //#include "sample_map.h" 2 | 3 | /* 4 | const uint16_t raw_tilemap[] = { 5 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 6 | 1, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 7 | 1, 7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 8 | 1, 7, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 9 | 1, 7, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 10 | 1, 7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 11 | 1, 6, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 12 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 13 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 14 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 15 | 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 16 | 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 17 | 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 18 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 19 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 20 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 21 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 22 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 23 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 24 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 25 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 26 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 27 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 28 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 29 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 30 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 3, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 31 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 32 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 33 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 34 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 35 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 36 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 37 | }; 38 | 39 | const gba::graphics::Map resources::maps::map1 = gba::graphics::Map{ 40 | sample_tileset, 41 | {raw_tilemap, 32*32}, 42 | null_map, 43 | null_map, 44 | null_map, 45 | gba::graphics::MapSize::TEXT_256X256 46 | }; 47 | */ 48 | -------------------------------------------------------------------------------- /tests/tilemap/screenshots/tilemap-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPTIZ/libgba-cpp/434211c92423fff67b4f574e055838c3d1d20f5f/tests/tilemap/screenshots/tilemap-0.png -------------------------------------------------------------------------------- /tests/windowing/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "sample_tiles.h" 6 | #include "sample_map.h" 7 | 8 | using namespace gba::display; 9 | using namespace gba::display::map; 10 | 11 | using namespace resources::maps; 12 | using namespace test; 13 | 14 | void copy_palette() { 15 | for (auto i = 0u; i < sample_palette.size(); ++i) { 16 | bg_palette()[i + 1] = sample_palette[i]; 17 | } 18 | } 19 | 20 | void copy_tiles() { 21 | for (auto i = 0u; i < sample_tiles.size(); ++i) { 22 | tileset()[i + 1] = sample_tiles[i]; 23 | } 24 | } 25 | 26 | void gen_map() { 27 | for (auto i = 0u; i < layer0.size(); ++i) { 28 | auto x = i % 8; 29 | auto y = i / 8; 30 | tilemap()[x + 32 * y] = layer0[i]; 31 | } 32 | 33 | for (auto i = 0u; i < layer1.size(); ++i) { 34 | tilemap()[i + 3 + 32 * 3 + 0x400] = layer1[i]; 35 | } 36 | } 37 | 38 | int main() { 39 | layer_visible(Layer::BG0); 40 | layer_visible(Layer::BG1); 41 | 42 | set_window_visible(Window::WIN0); 43 | set_window_visible(Window::WIN1); 44 | 45 | bg_control(Layer::BG0).screen_base_block(1); 46 | bg_control(Layer::BG1).screen_base_block(2); 47 | 48 | bg_control(Layer::BG3).priority(BGPriority::LOWEST); 49 | bg_control(Layer::BG2).priority(BGPriority::LOW); 50 | bg_control(Layer::BG1).priority(BGPriority::HIGH); 51 | bg_control(Layer::BG0).priority(BGPriority::HIGHEST); 52 | 53 | bg_ox(Layer::BG0) = -64; 54 | bg_oy(Layer::BG0) = -16; 55 | 56 | bg_ox(Layer::BG1) = 16; 57 | bg_oy(Layer::BG1) = -16; 58 | 59 | auto& window_control = gba::display::window_control(); 60 | auto& window0 = gba::display::window0(); 61 | auto& window1 = gba::display::window1(); 62 | 63 | window_control.window0_enable(Layer::BG0); 64 | window_control.window1_enable(Layer::BG1); 65 | 66 | copy_palette(); 67 | copy_tiles(); 68 | 69 | gen_map(); 70 | 71 | window0.left = 80; 72 | window0.right = 120; 73 | window0.top = 4; 74 | window0.bottom = 120; 75 | 76 | window1.left = 0; 77 | window1.right = 140; 78 | window1.top = 0; 79 | window1.bottom = 45; 80 | 81 | 82 | auto i = 0; 83 | while (true) { 84 | vsync(); 85 | 86 | bg_ox(Layer::BG1) = -i; 87 | ++i; 88 | } 89 | } 90 | 91 | -------------------------------------------------------------------------------- /tests/windowing/readme.md: -------------------------------------------------------------------------------- 1 | Windowing 2 | ========= 3 | 4 | Tests if Window-Clip systems are working correctly. 5 | 6 | | Function | Status | 7 | |-------------------|--------------| 8 | | BG Layer Clipping | Working | 9 | | Object Clipping | **Untested** | 10 | 11 | Explanation 12 | ----------- 13 | 14 | _TODO._ 15 | 16 | Screenshots 17 | ----------- 18 | 19 | It can be seen that the layer containing two Pacmans and three dots is clipped 20 | in bottom (as Window1 is On for BG1 with `bottom = 45`), while the layer 21 | containing a red and green square above a blue square is clipped in left and 22 | right (as Window0 is On for BG0 with `left = 80` and `right = 120`). 23 | 24 | ![Windowing Example 1](screenshots/windowing-0.png) 25 | -------------------------------------------------------------------------------- /tests/windowing/sample_map.h: -------------------------------------------------------------------------------- 1 | #ifndef TEST_SAMPLE_MAP_H 2 | #define TEST_SAMPLE_MAP_H 3 | 4 | #include 5 | 6 | namespace test { 7 | 8 | static std::array layer0 = { 9 | 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, // 0..7 10 | 0x1, 0x4, 0x3, 0x3, 0x3, 0x3, 0x2, 0x1, // 8..15 11 | 0x1, 0x7, 0x1, 0x1, 0x1, 0x1, 0x7, 0x1, // 16.23 12 | 0x1, 0x7, 0x1, 0x1, 0x1, 0x1, 0x7, 0x1, // 24..31 13 | 0x1, 0x7, 0x1, 0x1, 0x1, 0x1, 0x7, 0x1, // 32..39 14 | 0x1, 0x7, 0x1, 0x1, 0x1, 0x1, 0x7, 0x1, // 40..47 15 | 0x1, 0x6, 0x3, 0x3, 0x3, 0x3, 0x5, 0x1, // 48..55 16 | 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, // 56..63 17 | }; 18 | 19 | static std::array layer1 = { 20 | 0x8, 0x9, 0x0, 0x9, 0x0, 0x9, 0x0, 0x8, 21 | }; 22 | 23 | } 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /tests/windowing/sample_tiles.h: -------------------------------------------------------------------------------- 1 | #ifndef RESOURCES_SAMPLE_TILES_H 2 | #define RESOURCES_SAMPLE_TILES_H 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | 9 | namespace resources::maps { 10 | 11 | using gba::display::Color; 12 | using gba::display::map::Tile; 13 | 14 | const std::array sample_palette = { 15 | Color{0x1f, 0x00, 0x00}, // 0 16 | Color{0x00, 0x1f, 0x00}, // 1 17 | Color{0x00, 0x00, 0x17}, // 2 18 | Color{0x1f, 0x1f, 0x00}, // 3 19 | Color{0x00, 0x1f, 0x17}, // 4 20 | Color{0x1f, 0x00, 0x17}, // 5 21 | Color{0x1f, 0x1f, 0x1f}, // 6 22 | }; 23 | 24 | const std::array sample_tiles = { 25 | // 0 26 | Tile{{ 27 | 0x33333333, 28 | 0x33333333, 29 | 0x33333333, 30 | 0x33333333, 31 | 0x33333333, 32 | 0x33333333, 33 | 0x33333333, 34 | 0x33333333, 35 | 36 | }}, 37 | 38 | // 1 39 | Tile{{ 40 | 0x11111111, 41 | 0x12222222, 42 | 0x12111111, 43 | 0x12111111, 44 | 0x12111111, 45 | 0x12111111, 46 | 0x12111122, 47 | 0x12111121 48 | }}, 49 | 50 | // 2 51 | Tile{{ 52 | 0x11111111, 53 | 0x22222222, 54 | 0x11111111, 55 | 0x11111111, 56 | 0x11111111, 57 | 0x11111111, 58 | 0x22222222, 59 | 0x11111111 60 | }}, 61 | 62 | // 3 63 | Tile{{ 64 | 0x11111111, 65 | 0x22222221, 66 | 0x11111121, 67 | 0x11111121, 68 | 0x11111121, 69 | 0x11111121, 70 | 0x22111121, 71 | 0x12111121 72 | }}, 73 | 74 | // 4 75 | Tile{{ 76 | 0x12111121, 77 | 0x12111122, 78 | 0x12111111, 79 | 0x12111111, 80 | 0x12111111, 81 | 0x12111111, 82 | 0x12222222, 83 | 0x11111111 84 | }}, 85 | 86 | // 5 87 | Tile{{ 88 | 0x12111121, 89 | 0x22111121, 90 | 0x11111121, 91 | 0x11111121, 92 | 0x11111121, 93 | 0x11111121, 94 | 0x22222221, 95 | 0x11111111 96 | }}, 97 | 98 | // 6 99 | Tile{{ 100 | 0x12111121, 101 | 0x12111121, 102 | 0x12111121, 103 | 0x12111121, 104 | 0x12111121, 105 | 0x12111121, 106 | 0x12111121, 107 | 0x12111121 108 | }}, 109 | 110 | // 7 111 | Tile{{ 112 | 0x00044000, 113 | 0x04444440, 114 | 0x00044444, 115 | 0x00000444, 116 | 0x00044444, 117 | 0x04444440, 118 | 0x00044000, 119 | 0x00000000 120 | }}, 121 | 122 | // 8 123 | Tile{{ 124 | 0x00000000, 125 | 0x00000000, 126 | 0x00077000, 127 | 0x00777700, 128 | 0x00777700, 129 | 0x00077000, 130 | 0x00000000, 131 | 0x00000000 132 | }}, 133 | 134 | // 9 135 | Tile{{ 136 | 0x07654321, 137 | 0x01234567, 138 | 0x02644321, 139 | 0x17660321, 140 | 0x21234567, 141 | 0x64637254, 142 | 0x51734642, 143 | 0x62346177 144 | }}, 145 | }; 146 | 147 | } 148 | 149 | #endif 150 | -------------------------------------------------------------------------------- /tests/windowing/screenshots/windowing-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JPTIZ/libgba-cpp/434211c92423fff67b4f574e055838c3d1d20f5f/tests/windowing/screenshots/windowing-0.png -------------------------------------------------------------------------------- /tools/readme.md: -------------------------------------------------------------------------------- 1 | Dev Tools 2 | ========= 3 | 4 | Each development tool that once was in this directory has been moved to its own 5 | repository. As a result, this is a list of recommended tools (or just tools 6 | that I made -- not really _recommended_, just that they work) for GBA-dev: 7 | 8 | 1. [Bitmap exporter](https://github.com/jptiz/bitmap-to-code) 9 | > **Description** 10 | > 11 | > Used for exporting bitmap-files to any format given a template -- 12 | > including .cpp and .h sources. 13 | 14 | 2. [Map editor](https://github.com/jptiz/map-editor) 15 | > **Description** 16 | > 17 | > Used for editing maps and exporting them to any format given a template -- 18 | > including .cpp and .h. 19 | --------------------------------------------------------------------------------