chore: remove some magic constants
This commit is contained in:
		| @@ -8,6 +8,9 @@ const Scheduler = @import("scheduler.zig").Scheduler; | ||||
|  | ||||
| const Timer = std.time.Timer; | ||||
|  | ||||
| const window_scale = 3; | ||||
| const gba_width = @import("ppu.zig").width; | ||||
| const gba_height = @import("ppu.zig").height; | ||||
| const buf_pitch = @import("ppu.zig").buf_pitch; | ||||
|  | ||||
| pub fn main() anyerror!void { | ||||
| @@ -49,8 +52,8 @@ pub fn main() anyerror!void { | ||||
|         "Gameboy Advance Emulator", | ||||
|         SDL.SDL_WINDOWPOS_CENTERED, | ||||
|         SDL.SDL_WINDOWPOS_CENTERED, | ||||
|         240 * 3, | ||||
|         160 * 3, | ||||
|         gba_width * window_scale, | ||||
|         gba_height * window_scale, | ||||
|         SDL.SDL_WINDOW_SHOWN, | ||||
|     ) orelse sdlPanic(); | ||||
|     defer SDL.SDL_DestroyWindow(window); | ||||
|   | ||||
| @@ -5,8 +5,8 @@ const Io = @import("bus/io.zig").Io; | ||||
| const Scheduler = @import("scheduler.zig").Scheduler; | ||||
|  | ||||
| const Allocator = std.mem.Allocator; | ||||
| const width = 240; | ||||
| const height = 160; | ||||
| pub const width = 240; | ||||
| pub const height = 160; | ||||
| pub const buf_pitch = width * @sizeOf(u16); | ||||
| const buf_len = buf_pitch * height; | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user