11using System ;
2- using System . IO ;
32using System . Numerics ;
3+
44using ImGuiNET ;
5+
56using ImGuiOpenTK ;
7+
68using Monoboy . Constants ;
79using Monoboy . Utility ;
8- using OpenTK . Graphics . OpenGL4 ;
10+
11+ using OpenTK . Graphics . OpenGL ;
912using OpenTK . Windowing . Common ;
1013using OpenTK . Windowing . Common . Input ;
1114using OpenTK . Windowing . Desktop ;
@@ -61,10 +64,10 @@ protected override void OnUpdateFrame(FrameEventArgs args)
6164
6265 UpdateJoypad ( ) ;
6366
64- if ( emulator . paused == false )
67+ if ( emulator . paused == false )
6568 {
6669 int cycles = 0 ;
67- while ( cycles < Constant . CyclesPerFrame )
70+ while ( cycles < Constant . CyclesPerFrame )
6871 {
6972 cycles += emulator . Step ( ) ;
7073 }
@@ -106,45 +109,45 @@ public override void ImGuiRender()
106109 windowFlags |= ImGuiWindowFlags . NoBringToFrontOnFocus ;
107110 windowFlags |= ImGuiWindowFlags . AlwaysAutoResize ;
108111
109- if ( ImGui . Begin ( "Monoboy" , windowFlags ) == false )
112+ if ( ImGui . Begin ( "Monoboy" , windowFlags ) == false )
110113 {
111114 ImGui . End ( ) ;
112115 return ;
113116 }
114117
115118 // Menubar
116- if ( ImGui . BeginMenuBar ( ) )
119+ if ( ImGui . BeginMenuBar ( ) )
117120 {
118- if ( ImGui . BeginMenu ( "File" ) )
121+ if ( ImGui . BeginMenu ( "File" ) )
119122 {
120- if ( ImGui . MenuItem ( "Open" , "Ctrl+O" ) )
123+ if ( ImGui . MenuItem ( "Open" , "Ctrl+O" ) )
121124 {
122125 openRom = TinyFileDialog . OpenFileDialog ( "Open Rom" , "" , new string [ ] { "*.gb" , "*.gbc" } , "Rom (.gb,.gbc)" , false ) ;
123126
124- if ( string . IsNullOrEmpty ( openRom ) == false )
127+ if ( string . IsNullOrEmpty ( openRom ) == false )
125128 {
126129 emulator . Open ( openRom ) ;
127130 }
128131 }
129- if ( ImGui . MenuItem ( "Quit" , "Alt+F4" ) )
132+ if ( ImGui . MenuItem ( "Quit" , "Alt+F4" ) )
130133 {
131134 Close ( ) ;
132135 }
133136 ImGui . EndMenu ( ) ;
134137 }
135138
136- if ( ImGui . BeginMenu ( "Debug" ) )
139+ if ( ImGui . BeginMenu ( "Debug" ) )
137140 {
138- if ( ImGui . MenuItem ( "Background Toggle" , null , ref BackgroundEnabled ) ) { }
139- if ( ImGui . MenuItem ( "Window Toggle" , null , ref WindowEnabled ) ) { }
140- if ( ImGui . MenuItem ( "Sprites Toggle" , null , ref SpritesEnabled ) ) { }
141+ if ( ImGui . MenuItem ( "Background Toggle" , null , ref BackgroundEnabled ) ) { }
142+ if ( ImGui . MenuItem ( "Window Toggle" , null , ref WindowEnabled ) ) { }
143+ if ( ImGui . MenuItem ( "Sprites Toggle" , null , ref SpritesEnabled ) ) { }
141144 ImGui . EndMenu ( ) ;
142145 }
143146
144- if ( ImGui . BeginMenu ( "Windows" ) )
147+ if ( ImGui . BeginMenu ( "Windows" ) )
145148 {
146- if ( ImGui . MenuItem ( "Background" , null , ref backgroundWindow ) ) { }
147- if ( ImGui . MenuItem ( "Tilemap" , null , ref tilemapWindow ) ) { }
149+ if ( ImGui . MenuItem ( "Background" , null , ref backgroundWindow ) ) { }
150+ if ( ImGui . MenuItem ( "Tilemap" , null , ref tilemapWindow ) ) { }
148151 ImGui . EndMenu ( ) ;
149152 }
150153
@@ -170,7 +173,7 @@ public override void ImGuiRender()
170173
171174 private void BackgroundWindow ( )
172175 {
173- if ( backgroundWindow == true )
176+ if ( backgroundWindow == true )
174177 {
175178 uint [ ] palette = { 0xD0D058 , 0xA0A840 , 0x708028 , 0x405010 } ;
176179
@@ -180,11 +183,11 @@ private void BackgroundWindow()
180183 ushort tilesetAddress = ( ushort ) ( tileset ? 0x0000 : 0x1000 ) ;
181184 ushort tilemapAddress = ( ushort ) ( tilemap ? 0x1C00 : 0x1800 ) ;
182185
183- for ( int y = 0 ; y < 256 ; y ++ )
186+ for ( int y = 0 ; y < 256 ; y ++ )
184187 {
185188 ushort row = ( ushort ) ( y / 8 ) ;
186189
187- for ( int x = 0 ; x < 256 ; x ++ )
190+ for ( int x = 0 ; x < 256 ; x ++ )
188191 {
189192 ushort colum = ( ushort ) ( x / 8 ) ;
190193
@@ -219,15 +222,15 @@ private void BackgroundWindow()
219222
220223 private void TilemapWindow ( )
221224 {
222- if ( tilemapWindow == true )
225+ if ( tilemapWindow == true )
223226 {
224227 uint [ ] palette = { 0xD0D058 , 0xA0A840 , 0x708028 , 0x405010 } ;
225228
226- for ( int y = 0 ; y < 192 ; y ++ )
229+ for ( int y = 0 ; y < 192 ; y ++ )
227230 {
228231 ushort row = ( ushort ) ( y / 8 ) ;
229232
230- for ( int x = 0 ; x < 128 ; x ++ )
233+ for ( int x = 0 ; x < 128 ; x ++ )
231234 {
232235 ushort colum = ( ushort ) ( x / 8 ) ;
233236
0 commit comments