diff --git a/src/core/cdrom.cpp b/src/core/cdrom.cpp index 90bdead6..8c6e74e9 100644 --- a/src/core/cdrom.cpp +++ b/src/core/cdrom.cpp @@ -10,9 +10,6 @@ #include "spu.h" #include "system.h" #include -#ifdef WITH_IMGUI -#include "imgui.h" -#endif Log_SetChannel(CDROM); #if defined(CPU_X64) @@ -2719,205 +2716,3 @@ void CDROM::ClearSectorBuffers() for (u32 i = 0; i < NUM_SECTOR_BUFFERS; i++) m_sector_buffers[i].size = 0; } - -void CDROM::DrawDebugWindow() -{ -#ifdef WITH_IMGUI - static const ImVec4 active_color{1.0f, 1.0f, 1.0f, 1.0f}; - static const ImVec4 inactive_color{0.4f, 0.4f, 0.4f, 1.0f}; - const float framebuffer_scale = ImGui::GetIO().DisplayFramebufferScale.x; - - ImGui::SetNextWindowSize(ImVec2(800.0f * framebuffer_scale, 550.0f * framebuffer_scale), ImGuiCond_FirstUseEver); - if (!ImGui::Begin("CDROM State", nullptr)) - { - ImGui::End(); - return; - } - - // draw voice states - if (ImGui::CollapsingHeader("Media", ImGuiTreeNodeFlags_DefaultOpen)) - { - if (m_reader.HasMedia()) - { - const CDImage* media = m_reader.GetMedia(); - const CDImage::Position disc_position = CDImage::Position::FromLBA(m_current_lba); - - if (media->HasSubImages()) - { - ImGui::Text("Filename: %s [Subimage %u of %u] [%u buffered sectors]", media->GetFileName().c_str(), - media->GetCurrentSubImage() + 1u, media->GetSubImageCount(), m_reader.GetBufferedSectorCount()); - } - else - { - ImGui::Text("Filename: %s [%u buffered sectors]", media->GetFileName().c_str(), - m_reader.GetBufferedSectorCount()); - } - - ImGui::Text("Disc Position: MSF[%02u:%02u:%02u] LBA[%u]", disc_position.minute, disc_position.second, - disc_position.frame, disc_position.ToLBA()); - - if (media->GetTrackNumber() > media->GetTrackCount()) - { - ImGui::Text("Track Position: Lead-out"); - } - else - { - const CDImage::Position track_position = CDImage::Position::FromLBA( - m_current_lba - media->GetTrackStartPosition(static_cast(media->GetTrackNumber()))); - ImGui::Text("Track Position: Number[%u] MSF[%02u:%02u:%02u] LBA[%u]", media->GetTrackNumber(), - track_position.minute, track_position.second, track_position.frame, track_position.ToLBA()); - } - - ImGui::Text("Last Sector: %02X:%02X:%02X (Mode %u)", m_last_sector_header.minute, m_last_sector_header.second, - m_last_sector_header.frame, m_last_sector_header.sector_mode); - } - else - { - ImGui::Text("No media inserted."); - } - } - - if (ImGui::CollapsingHeader("Status/Mode", ImGuiTreeNodeFlags_DefaultOpen)) - { - ImGui::Columns(3); - - ImGui::Text("Status"); - ImGui::NextColumn(); - ImGui::Text("Secondary Status"); - ImGui::NextColumn(); - ImGui::Text("Mode Status"); - ImGui::NextColumn(); - - ImGui::TextColored(m_status.ADPBUSY ? active_color : inactive_color, "ADPBUSY: %s", - m_status.ADPBUSY ? "Yes" : "No"); - ImGui::NextColumn(); - ImGui::TextColored(m_secondary_status.error ? active_color : inactive_color, "Error: %s", - m_secondary_status.error ? "Yes" : "No"); - ImGui::NextColumn(); - ImGui::TextColored(m_mode.cdda ? active_color : inactive_color, "CDDA: %s", m_mode.cdda ? "Yes" : "No"); - ImGui::NextColumn(); - - ImGui::TextColored(m_status.PRMEMPTY ? active_color : inactive_color, "PRMEMPTY: %s", - m_status.PRMEMPTY ? "Yes" : "No"); - ImGui::NextColumn(); - ImGui::TextColored(m_secondary_status.motor_on ? active_color : inactive_color, "Motor On: %s", - m_secondary_status.motor_on ? "Yes" : "No"); - ImGui::NextColumn(); - ImGui::TextColored(m_mode.auto_pause ? active_color : inactive_color, "Auto Pause: %s", - m_mode.auto_pause ? "Yes" : "No"); - ImGui::NextColumn(); - - ImGui::TextColored(m_status.PRMWRDY ? active_color : inactive_color, "PRMWRDY: %s", - m_status.PRMWRDY ? "Yes" : "No"); - ImGui::NextColumn(); - ImGui::TextColored(m_secondary_status.seek_error ? active_color : inactive_color, "Seek Error: %s", - m_secondary_status.seek_error ? "Yes" : "No"); - ImGui::NextColumn(); - ImGui::TextColored(m_mode.report_audio ? active_color : inactive_color, "Report Audio: %s", - m_mode.report_audio ? "Yes" : "No"); - ImGui::NextColumn(); - - ImGui::TextColored(m_status.RSLRRDY ? active_color : inactive_color, "RSLRRDY: %s", - m_status.RSLRRDY ? "Yes" : "No"); - ImGui::NextColumn(); - ImGui::TextColored(m_secondary_status.id_error ? active_color : inactive_color, "ID Error: %s", - m_secondary_status.id_error ? "Yes" : "No"); - ImGui::NextColumn(); - ImGui::TextColored(m_mode.xa_filter ? active_color : inactive_color, "XA Filter: %s (File %u Channel %u)", - m_mode.xa_filter ? "Yes" : "No", m_xa_filter_file_number, m_xa_filter_channel_number); - ImGui::NextColumn(); - - ImGui::TextColored(m_status.DRQSTS ? active_color : inactive_color, "DRQSTS: %s", m_status.DRQSTS ? "Yes" : "No"); - ImGui::NextColumn(); - ImGui::TextColored(m_secondary_status.shell_open ? active_color : inactive_color, "Shell Open: %s", - m_secondary_status.shell_open ? "Yes" : "No"); - ImGui::NextColumn(); - ImGui::TextColored(m_mode.ignore_bit ? active_color : inactive_color, "Ignore Bit: %s", - m_mode.ignore_bit ? "Yes" : "No"); - ImGui::NextColumn(); - - ImGui::TextColored(m_status.BUSYSTS ? active_color : inactive_color, "BUSYSTS: %s", - m_status.BUSYSTS ? "Yes" : "No"); - ImGui::NextColumn(); - ImGui::TextColored(m_secondary_status.reading ? active_color : inactive_color, "Reading: %s", - m_secondary_status.reading ? "Yes" : "No"); - ImGui::NextColumn(); - ImGui::TextColored(m_mode.read_raw_sector ? active_color : inactive_color, "Read Raw Sectors: %s", - m_mode.read_raw_sector ? "Yes" : "No"); - ImGui::NextColumn(); - - ImGui::NextColumn(); - ImGui::TextColored(m_secondary_status.seeking ? active_color : inactive_color, "Seeking: %s", - m_secondary_status.seeking ? "Yes" : "No"); - ImGui::NextColumn(); - ImGui::TextColored(m_mode.xa_enable ? active_color : inactive_color, "XA Enable: %s", - m_mode.xa_enable ? "Yes" : "No"); - ImGui::NextColumn(); - - ImGui::NextColumn(); - ImGui::TextColored(m_secondary_status.playing_cdda ? active_color : inactive_color, "Playing CDDA: %s", - m_secondary_status.playing_cdda ? "Yes" : "No"); - ImGui::NextColumn(); - ImGui::TextColored(m_mode.double_speed ? active_color : inactive_color, "Double Speed: %s", - m_mode.double_speed ? "Yes" : "No"); - ImGui::NextColumn(); - - ImGui::Columns(1); - ImGui::NewLine(); - - if (HasPendingCommand()) - { - ImGui::TextColored(active_color, "Command: %s (0x%02X) (%d ticks remaining)", - s_command_info[static_cast(m_command)].name, static_cast(m_command), - m_command_event->IsActive() ? m_command_event->GetTicksUntilNextExecution() : 0); - } - else - { - ImGui::TextColored(inactive_color, "Command: None"); - } - - if (IsDriveIdle()) - { - ImGui::TextColored(inactive_color, "Drive: Idle"); - } - else - { - ImGui::TextColored(active_color, "Drive: %s (%d ticks remaining)", - s_drive_state_names[static_cast(m_drive_state)], - m_drive_event->IsActive() ? m_drive_event->GetTicksUntilNextExecution() : 0); - } - - ImGui::Text("Interrupt Enable Register: 0x%02X", m_interrupt_enable_register); - ImGui::Text("Interrupt Flag Register: 0x%02X", m_interrupt_flag_register); - } - - if (ImGui::CollapsingHeader("CD Audio", ImGuiTreeNodeFlags_DefaultOpen)) - { - if (m_drive_state == DriveState::Reading && m_mode.xa_enable) - { - ImGui::TextColored(active_color, "Playing: XA-ADPCM (File %u / Channel %u)", m_xa_current_file_number, - m_xa_current_channel_number); - } - else if (m_drive_state == DriveState::Playing) - { - ImGui::TextColored(active_color, "Playing: CDDA (Track %x)", m_last_subq.track_number_bcd); - } - else - { - ImGui::TextColored(inactive_color, "Playing: Inactive"); - } - - ImGui::TextColored(m_muted ? inactive_color : active_color, "Muted: %s", m_muted ? "Yes" : "No"); - ImGui::Text("Left Output: Left Channel=%02X (%u%%), Right Channel=%02X (%u%%)", m_cd_audio_volume_matrix[0][0], - ZeroExtend32(m_cd_audio_volume_matrix[0][0]) * 100 / 0x80, m_cd_audio_volume_matrix[1][0], - ZeroExtend32(m_cd_audio_volume_matrix[1][0]) * 100 / 0x80); - ImGui::Text("Right Output: Left Channel=%02X (%u%%), Right Channel=%02X (%u%%)", m_cd_audio_volume_matrix[0][1], - ZeroExtend32(m_cd_audio_volume_matrix[0][1]) * 100 / 0x80, m_cd_audio_volume_matrix[1][1], - ZeroExtend32(m_cd_audio_volume_matrix[1][1]) * 100 / 0x80); - - ImGui::Text("Audio FIFO Size: %u frames", m_audio_fifo.GetSize()); - } - - ImGui::End(); -#endif -} diff --git a/src/core/cdrom.h b/src/core/cdrom.h index ea3786c2..87511ffd 100644 --- a/src/core/cdrom.h +++ b/src/core/cdrom.h @@ -42,9 +42,6 @@ public: void WriteRegister(u32 offset, u8 value); void DMARead(u32* words, u32 word_count); - // Render statistics debug window. - void DrawDebugWindow(); - void SetReadaheadSectors(u32 readahead_sectors); /// Reads a frame from the audio FIFO, used by the SPU. diff --git a/src/core/dma.cpp b/src/core/dma.cpp index 7aa1cd91..24b0121d 100644 --- a/src/core/dma.cpp +++ b/src/core/dma.cpp @@ -12,9 +12,6 @@ #include "pad.h" #include "spu.h" #include "system.h" -#ifdef WITH_IMGUI -#include "imgui.h" -#endif Log_SetChannel(DMA); static u32 GetAddressMask() @@ -618,84 +615,3 @@ TickCount DMA::TransferDeviceToMemory(Channel channel, u32 address, u32 incremen CPU::CodeCache::InvalidateCodePages(address, word_count); return Bus::GetDMARAMTickCount(word_count); } - -void DMA::DrawDebugStateWindow() -{ -#ifdef WITH_IMGUI - static constexpr u32 NUM_COLUMNS = 10; - static constexpr std::array column_names = { - {"#", "Req", "Direction", "Chopping", "Mode", "Busy", "Enable", "Priority", "IRQ", "Flag"}}; - static constexpr std::array channel_names = { - {"MDECin", "MDECout", "GPU", "CDROM", "SPU", "PIO", "OTC"}}; - static constexpr std::array sync_mode_names = {{"Manual", "Request", "LinkedList", "Reserved"}}; - - const float framebuffer_scale = ImGui::GetIO().DisplayFramebufferScale.x; - - ImGui::SetNextWindowSize(ImVec2(850.0f * framebuffer_scale, 250.0f * framebuffer_scale), ImGuiCond_FirstUseEver); - if (!ImGui::Begin("DMA State", nullptr)) - { - ImGui::End(); - return; - } - - ImGui::Columns(NUM_COLUMNS); - ImGui::SetColumnWidth(0, 100.0f * framebuffer_scale); - ImGui::SetColumnWidth(1, 50.0f * framebuffer_scale); - ImGui::SetColumnWidth(2, 100.0f * framebuffer_scale); - ImGui::SetColumnWidth(3, 150.0f * framebuffer_scale); - ImGui::SetColumnWidth(4, 80.0f * framebuffer_scale); - ImGui::SetColumnWidth(5, 80.0f * framebuffer_scale); - ImGui::SetColumnWidth(6, 80.0f * framebuffer_scale); - ImGui::SetColumnWidth(7, 80.0f * framebuffer_scale); - ImGui::SetColumnWidth(8, 80.0f * framebuffer_scale); - ImGui::SetColumnWidth(9, 80.0f * framebuffer_scale); - - for (const char* title : column_names) - { - ImGui::TextUnformatted(title); - ImGui::NextColumn(); - } - - const ImVec4 active(1.0f, 1.0f, 1.0f, 1.0f); - const ImVec4 inactive(0.5f, 0.5f, 0.5f, 1.0f); - - for (u32 i = 0; i < NUM_CHANNELS; i++) - { - const ChannelState& cs = m_state[i]; - - ImGui::TextColored(cs.channel_control.enable_busy ? active : inactive, "%u[%s]", i, channel_names[i]); - ImGui::NextColumn(); - ImGui::TextColored(cs.request ? active : inactive, cs.request ? "Yes" : "No"); - ImGui::NextColumn(); - ImGui::Text("%s%s", cs.channel_control.copy_to_device ? "FromRAM" : "ToRAM", - cs.channel_control.address_step_reverse ? " Addr+" : " Addr-"); - ImGui::NextColumn(); - ImGui::TextColored(cs.channel_control.chopping_enable ? active : inactive, "%s/%u/%u", - cs.channel_control.chopping_enable ? "Yes" : "No", - cs.channel_control.chopping_cpu_window_size.GetValue(), - cs.channel_control.chopping_dma_window_size.GetValue()); - ImGui::NextColumn(); - ImGui::Text("%s", sync_mode_names[static_cast(cs.channel_control.sync_mode.GetValue())]); - ImGui::NextColumn(); - ImGui::TextColored(cs.channel_control.enable_busy ? active : inactive, "%s%s", - cs.channel_control.enable_busy ? "Busy" : "Idle", - cs.channel_control.start_trigger ? " (Trigger)" : ""); - ImGui::NextColumn(); - ImGui::TextColored(m_DPCR.GetMasterEnable(static_cast(i)) ? active : inactive, - m_DPCR.GetMasterEnable(static_cast(i)) ? "Enabled" : "Disabled"); - ImGui::NextColumn(); - ImGui::TextColored(m_DPCR.GetMasterEnable(static_cast(i)) ? active : inactive, "%u", - m_DPCR.GetPriority(static_cast(i))); - ImGui::NextColumn(); - ImGui::TextColored(m_DICR.IsIRQEnabled(static_cast(i)) ? active : inactive, - m_DICR.IsIRQEnabled(static_cast(i)) ? "Enabled" : "Disabled"); - ImGui::NextColumn(); - ImGui::TextColored(m_DICR.GetIRQFlag(static_cast(i)) ? active : inactive, - m_DICR.GetIRQFlag(static_cast(i)) ? "IRQ" : ""); - ImGui::NextColumn(); - } - - ImGui::Columns(1); - ImGui::End(); -#endif -} diff --git a/src/core/dma.h b/src/core/dma.h index 0cd1b116..d9c742fe 100644 --- a/src/core/dma.h +++ b/src/core/dma.h @@ -45,8 +45,6 @@ public: void SetMaxSliceTicks(TickCount ticks) { m_max_slice_ticks = ticks; } void SetHaltTicks(TickCount ticks) { m_halt_ticks = ticks; } - void DrawDebugStateWindow(); - private: static constexpr PhysicalMemoryAddress BASE_ADDRESS_MASK = UINT32_C(0x00FFFFFF); static constexpr PhysicalMemoryAddress ADDRESS_MASK = UINT32_C(0x001FFFFC); @@ -202,4 +200,4 @@ private: } m_DICR = {}; }; -extern DMA g_dma; \ No newline at end of file +extern DMA g_dma; diff --git a/src/core/gpu.cpp b/src/core/gpu.cpp index cef67e53..8cba5984 100644 --- a/src/core/gpu.cpp +++ b/src/core/gpu.cpp @@ -13,9 +13,6 @@ #include "system.h" #include "timers.h" #include -#ifdef WITH_IMGUI -#include "imgui.h" -#endif Log_SetChannel(GPU); std::unique_ptr g_gpu; @@ -1545,127 +1542,4 @@ bool GPU::DumpVRAMToFile(const char* filename, u32 width, u32 height, u32 stride return (stbi_write_png_to_func(write_func, fp.get(), width, height, 4, rgba8_buf.get(), sizeof(u32) * width) != 0); } -void GPU::DrawDebugStateWindow() -{ -#ifdef WITH_IMGUI - const float framebuffer_scale = ImGui::GetIO().DisplayFramebufferScale.x; - - ImGui::SetNextWindowSize(ImVec2(450.0f * framebuffer_scale, 550.0f * framebuffer_scale), ImGuiCond_FirstUseEver); - if (!ImGui::Begin("GPU", nullptr)) - { - ImGui::End(); - return; - } - - const bool is_idle_frame = m_stats.num_polygons == 0; - if (!is_idle_frame) - { - m_last_stats = m_stats; - m_stats = {}; - } - - if (ImGui::CollapsingHeader("Statistics", ImGuiTreeNodeFlags_DefaultOpen)) - { - const Stats& stats = m_last_stats; - - ImGui::Columns(2); - ImGui::SetColumnWidth(0, 200.0f * framebuffer_scale); - - ImGui::TextUnformatted("Idle Frame: "); - ImGui::NextColumn(); - ImGui::Text("%s", is_idle_frame ? "Yes" : "No"); - ImGui::NextColumn(); - - ImGui::TextUnformatted("VRAM Reads: "); - ImGui::NextColumn(); - ImGui::Text("%u", stats.num_vram_reads); - ImGui::NextColumn(); - - ImGui::TextUnformatted("VRAM Fills: "); - ImGui::NextColumn(); - ImGui::Text("%u", stats.num_vram_fills); - ImGui::NextColumn(); - - ImGui::TextUnformatted("VRAM Writes: "); - ImGui::NextColumn(); - ImGui::Text("%u", stats.num_vram_writes); - ImGui::NextColumn(); - - ImGui::TextUnformatted("VRAM Copies: "); - ImGui::NextColumn(); - ImGui::Text("%u", stats.num_vram_copies); - ImGui::NextColumn(); - - ImGui::TextUnformatted("Vertices Processed: "); - ImGui::NextColumn(); - ImGui::Text("%u", stats.num_vertices); - ImGui::NextColumn(); - - ImGui::TextUnformatted("Polygons Drawn: "); - ImGui::NextColumn(); - ImGui::Text("%u", stats.num_polygons); - ImGui::NextColumn(); - - ImGui::Columns(1); - } - - DrawRendererStats(is_idle_frame); - - if (ImGui::CollapsingHeader("GPU", ImGuiTreeNodeFlags_DefaultOpen)) - { - static constexpr std::array state_strings = { - {"Idle", "Reading VRAM", "Writing VRAM", "Drawing Polyline"}}; - - ImGui::Text("State: %s", state_strings[static_cast(m_blitter_state)]); - ImGui::Text("Dither: %s", m_GPUSTAT.dither_enable ? "Enabled" : "Disabled"); - ImGui::Text("Draw To Displayed Field: %s", m_GPUSTAT.draw_to_displayed_field ? "Enabled" : "Disabled"); - ImGui::Text("Draw Set Mask Bit: %s", m_GPUSTAT.set_mask_while_drawing ? "Yes" : "No"); - ImGui::Text("Draw To Masked Pixels: %s", m_GPUSTAT.check_mask_before_draw ? "Yes" : "No"); - ImGui::Text("Reverse Flag: %s", m_GPUSTAT.reverse_flag ? "Yes" : "No"); - ImGui::Text("Texture Disable: %s", m_GPUSTAT.texture_disable ? "Yes" : "No"); - ImGui::Text("PAL Mode: %s", m_GPUSTAT.pal_mode ? "Yes" : "No"); - ImGui::Text("Interrupt Request: %s", m_GPUSTAT.interrupt_request ? "Yes" : "No"); - ImGui::Text("DMA Request: %s", m_GPUSTAT.dma_data_request ? "Yes" : "No"); - } - - if (ImGui::CollapsingHeader("CRTC", ImGuiTreeNodeFlags_DefaultOpen)) - { - const auto& cs = m_crtc_state; - ImGui::Text("Clock: %s", (m_console_is_pal ? (m_GPUSTAT.pal_mode ? "PAL-on-PAL" : "NTSC-on-PAL") : - (m_GPUSTAT.pal_mode ? "PAL-on-NTSC" : "NTSC-on-NTSC"))); - ImGui::Text("Horizontal Frequency: %.3f KHz", ComputeHorizontalFrequency() / 1000.0f); - ImGui::Text("Vertical Frequency: %.3f Hz", ComputeVerticalFrequency()); - ImGui::Text("Dot Clock Divider: %u", cs.dot_clock_divider); - ImGui::Text("Vertical Interlace: %s (%s field)", m_GPUSTAT.vertical_interlace ? "Yes" : "No", - cs.interlaced_field ? "odd" : "even"); - ImGui::Text("Current Scanline: %u (tick %u)", cs.current_scanline, cs.current_tick_in_scanline); - ImGui::Text("Display Disable: %s", m_GPUSTAT.display_disable ? "Yes" : "No"); - ImGui::Text("Displaying Odd Lines: %s", cs.active_line_lsb ? "Yes" : "No"); - ImGui::Text("Color Depth: %u-bit", m_GPUSTAT.display_area_color_depth_24 ? 24 : 15); - ImGui::Text("Start Offset in VRAM: (%u, %u)", cs.regs.X.GetValue(), cs.regs.Y.GetValue()); - ImGui::Text("Display Total: %u (%u) horizontal, %u vertical", cs.horizontal_total, - cs.horizontal_total / cs.dot_clock_divider, cs.vertical_total); - ImGui::Text("Configured Display Range: %u-%u (%u-%u), %u-%u", cs.regs.X1.GetValue(), cs.regs.X2.GetValue(), - cs.regs.X1.GetValue() / cs.dot_clock_divider, cs.regs.X2.GetValue() / cs.dot_clock_divider, - cs.regs.Y1.GetValue(), cs.regs.Y2.GetValue()); - ImGui::Text("Output Display Range: %u-%u (%u-%u), %u-%u", cs.horizontal_display_start, cs.horizontal_display_end, - cs.horizontal_display_start / cs.dot_clock_divider, cs.horizontal_display_end / cs.dot_clock_divider, - cs.vertical_display_start, cs.vertical_display_end); - ImGui::Text("Cropping: %s", Settings::GetDisplayCropModeName(g_settings.display_crop_mode)); - ImGui::Text("Visible Display Range: %u-%u (%u-%u), %u-%u", cs.horizontal_visible_start, cs.horizontal_visible_end, - cs.horizontal_visible_start / cs.dot_clock_divider, cs.horizontal_visible_end / cs.dot_clock_divider, - cs.vertical_visible_start, cs.vertical_visible_end); - ImGui::Text("Display Resolution: %ux%u", cs.display_width, cs.display_height); - ImGui::Text("Display Origin: %u, %u", cs.display_origin_left, cs.display_origin_top); - ImGui::Text("Displayed/Visible VRAM Portion: %ux%u @ (%u, %u)", cs.display_vram_width, cs.display_vram_height, - cs.display_vram_left, cs.display_vram_top); - ImGui::Text("Padding: Left=%d, Top=%d, Right=%d, Bottom=%d", cs.display_origin_left, cs.display_origin_top, - cs.display_width - cs.display_vram_width - cs.display_origin_left, - cs.display_height - cs.display_vram_height - cs.display_origin_top); - } - - ImGui::End(); -#endif -} - void GPU::DrawRendererStats(bool is_idle_frame) {} diff --git a/src/core/gpu.h b/src/core/gpu.h index 660181eb..2485073f 100644 --- a/src/core/gpu.h +++ b/src/core/gpu.h @@ -83,9 +83,6 @@ public: virtual void ResetGraphicsAPIState(); virtual void RestoreGraphicsAPIState(); - // Render statistics debug window. - void DrawDebugStateWindow(); - bool IsHardwareRenderer(); void CPUClockChanged(); diff --git a/src/core/gpu_hw.cpp b/src/core/gpu_hw.cpp index ddb8fa89..0a705f3c 100644 --- a/src/core/gpu_hw.cpp +++ b/src/core/gpu_hw.cpp @@ -11,9 +11,6 @@ #include #include #include -#ifdef WITH_IMGUI -#include "imgui.h" -#endif Log_SetChannel(GPU_HW); template @@ -1402,77 +1399,6 @@ void GPU_HW::DrawRendererStats(bool is_idle_frame) m_last_renderer_stats = m_renderer_stats; m_renderer_stats = {}; } - -#ifdef WITH_IMGUI - if (ImGui::CollapsingHeader("Renderer Statistics", ImGuiTreeNodeFlags_DefaultOpen)) - { - static const ImVec4 active_color{1.0f, 1.0f, 1.0f, 1.0f}; - static const ImVec4 inactive_color{0.4f, 0.4f, 0.4f, 1.0f}; - const auto& stats = m_last_renderer_stats; - - ImGui::Columns(2); - ImGui::SetColumnWidth(0, 200.0f * ImGui::GetIO().DisplayFramebufferScale.x); - - ImGui::TextUnformatted("Resolution Scale:"); - ImGui::NextColumn(); - ImGui::Text("%u (VRAM %ux%u)", m_resolution_scale, VRAM_WIDTH * m_resolution_scale, - VRAM_HEIGHT * m_resolution_scale); - ImGui::NextColumn(); - - ImGui::TextUnformatted("Effective Display Resolution:"); - ImGui::NextColumn(); - ImGui::Text("%ux%u", m_crtc_state.display_vram_width * m_resolution_scale, - m_crtc_state.display_vram_height * m_resolution_scale); - ImGui::NextColumn(); - - ImGui::TextUnformatted("True Color:"); - ImGui::NextColumn(); - ImGui::TextColored(m_true_color ? active_color : inactive_color, m_true_color ? "Enabled" : "Disabled"); - ImGui::NextColumn(); - - ImGui::TextUnformatted("Scaled Dithering:"); - ImGui::NextColumn(); - ImGui::TextColored(m_scaled_dithering ? active_color : inactive_color, m_scaled_dithering ? "Enabled" : "Disabled"); - ImGui::NextColumn(); - - ImGui::TextUnformatted("Texture Filtering:"); - ImGui::NextColumn(); - ImGui::TextColored((m_texture_filtering != GPUTextureFilter::Nearest) ? active_color : inactive_color, "%s", - Settings::GetTextureFilterDisplayName(m_texture_filtering)); - ImGui::NextColumn(); - - ImGui::TextUnformatted("PGXP:"); - ImGui::NextColumn(); - ImGui::TextColored(g_settings.gpu_pgxp_enable ? active_color : inactive_color, "Geom"); - ImGui::SameLine(); - ImGui::TextColored((g_settings.gpu_pgxp_enable && g_settings.gpu_pgxp_culling) ? active_color : inactive_color, - "Cull"); - ImGui::SameLine(); - ImGui::TextColored( - (g_settings.gpu_pgxp_enable && g_settings.gpu_pgxp_texture_correction) ? active_color : inactive_color, "Tex"); - ImGui::SameLine(); - ImGui::TextColored((g_settings.gpu_pgxp_enable && g_settings.gpu_pgxp_vertex_cache) ? active_color : inactive_color, - "Cache"); - ImGui::NextColumn(); - - ImGui::TextUnformatted("Batches Drawn:"); - ImGui::NextColumn(); - ImGui::Text("%u", stats.num_batches); - ImGui::NextColumn(); - - ImGui::TextUnformatted("VRAM Read Texture Updates:"); - ImGui::NextColumn(); - ImGui::Text("%u", stats.num_vram_read_texture_updates); - ImGui::NextColumn(); - - ImGui::TextUnformatted("Uniform Buffer Updates: "); - ImGui::NextColumn(); - ImGui::Text("%u", stats.num_uniform_buffer_updates); - ImGui::NextColumn(); - - ImGui::Columns(1); - } -#endif } GPU_HW::ShaderCompileProgressTracker::ShaderCompileProgressTracker(std::string title, u32 total) diff --git a/src/core/host_display.h b/src/core/host_display.h index ef801abe..f5f04971 100644 --- a/src/core/host_display.h +++ b/src/core/host_display.h @@ -125,13 +125,6 @@ public: virtual void SetVSync(bool enabled) = 0; -#ifdef WITH_IMGUI - /// ImGui context management, usually called by derived classes. - virtual bool CreateImGuiContext() = 0; - virtual void DestroyImGuiContext() = 0; - virtual bool UpdateImGuiFontTexture() = 0; -#endif - const void* GetDisplayTextureHandle() const { return m_display_texture_handle; } const s32 GetDisplayTopMargin() const { return m_display_top_margin; } const s32 GetDisplayWidth() const { return m_display_width; } diff --git a/src/core/mdec.cpp b/src/core/mdec.cpp index 6b31171c..4df6e857 100644 --- a/src/core/mdec.cpp +++ b/src/core/mdec.cpp @@ -5,9 +5,6 @@ #include "dma.h" #include "interrupt_controller.h" #include "system.h" -#ifdef WITH_IMGUI -#include "imgui.h" -#endif Log_SetChannel(MDEC); MDEC g_mdec; @@ -721,46 +718,3 @@ void MDEC::HandleSetScaleCommand() m_remaining_halfwords -= 32; std::memcpy(m_scale_table.data(), packed_data.data(), m_scale_table.size() * sizeof(s16)); } - -void MDEC::DrawDebugStateWindow() -{ -#ifdef WITH_IMGUI - const float framebuffer_scale = ImGui::GetIO().DisplayFramebufferScale.x; - - ImGui::SetNextWindowSize(ImVec2(300.0f * framebuffer_scale, 350.0f * framebuffer_scale), ImGuiCond_FirstUseEver); - if (!ImGui::Begin("MDEC State", nullptr)) - { - ImGui::End(); - return; - } - - static constexpr std::array state_names = { - {"None", "Decoding Macroblock", "Writing Macroblock", "SetIqTab", "SetScale"}}; - static constexpr std::array output_depths = {{"4-bit", "8-bit", "24-bit", "15-bit"}}; - static constexpr std::array block_names = {{"Crblk", "Cbblk", "Y1", "Y2", "Y3", "Y4", "Output"}}; - - ImGui::Text("Blocks Decoded: %u", m_total_blocks_decoded); - ImGui::Text("Data-In FIFO Size: %u (%u bytes)", m_data_in_fifo.GetSize(), m_data_in_fifo.GetSize() * 4); - ImGui::Text("Data-Out FIFO Size: %u (%u bytes)", m_data_out_fifo.GetSize(), m_data_out_fifo.GetSize() * 4); - ImGui::Text("DMA Enable: %s%s", m_enable_dma_in ? "In " : "", m_enable_dma_out ? "Out" : ""); - ImGui::Text("Current State: %s", state_names[static_cast(m_state)]); - ImGui::Text("Current Block: %s", block_names[m_current_block]); - ImGui::Text("Current Coefficient: %u", m_current_coefficient); - - if (ImGui::CollapsingHeader("Status", ImGuiTreeNodeFlags_DefaultOpen)) - { - ImGui::Text("Data-Out FIFO Empty: %s", m_status.data_out_fifo_empty ? "Yes" : "No"); - ImGui::Text("Data-In FIFO Full: %s", m_status.data_in_fifo_full ? "Yes" : "No"); - ImGui::Text("Command Busy: %s", m_status.command_busy ? "Yes" : "No"); - ImGui::Text("Data-In Request: %s", m_status.data_in_request ? "Yes" : "No"); - ImGui::Text("Output Depth: %s", output_depths[static_cast(m_status.data_output_depth.GetValue())]); - ImGui::Text("Output Signed: %s", m_status.data_output_signed ? "Yes" : "No"); - ImGui::Text("Output Bit 15: %u", ZeroExtend32(m_status.data_output_bit15.GetValue())); - ImGui::Text("Current Block: %u", ZeroExtend32(m_status.current_block.GetValue())); - ImGui::Text("Parameter Words Remaining: %d", - static_cast(SignExtend32(m_status.parameter_words_remaining.GetValue()))); - } - - ImGui::End(); -#endif -} diff --git a/src/core/mdec.h b/src/core/mdec.h index 14b20d7f..21d376c2 100644 --- a/src/core/mdec.h +++ b/src/core/mdec.h @@ -27,8 +27,6 @@ public: void DMARead(u32* words, u32 word_count); void DMAWrite(const u32* words, u32 word_count); - void DrawDebugStateWindow(); - private: static constexpr u32 DATA_IN_FIFO_SIZE = 1024; static constexpr u32 DATA_OUT_FIFO_SIZE = 768; @@ -148,4 +146,4 @@ private: u32 m_total_blocks_decoded = 0; }; -extern MDEC g_mdec; \ No newline at end of file +extern MDEC g_mdec; diff --git a/src/core/spu.cpp b/src/core/spu.cpp index e1413fd0..7c3b7f55 100644 --- a/src/core/spu.cpp +++ b/src/core/spu.cpp @@ -9,9 +9,6 @@ #include "host_interface.h" #include "interrupt_controller.h" #include "system.h" -#ifdef WITH_IMGUI -#include "imgui.h" -#endif Log_SetChannel(SPU); SPU g_spu; @@ -1918,189 +1915,3 @@ void SPU::UpdateEventInterval() m_tick_event->Schedule(downcount); } - -void SPU::DrawDebugStateWindow() -{ -#ifdef WITH_IMGUI - static const ImVec4 active_color{1.0f, 1.0f, 1.0f, 1.0f}; - static const ImVec4 inactive_color{0.4f, 0.4f, 0.4f, 1.0f}; - const float framebuffer_scale = ImGui::GetIO().DisplayFramebufferScale.x; - - ImGui::SetNextWindowSize(ImVec2(800.0f * framebuffer_scale, 800.0f * framebuffer_scale), ImGuiCond_FirstUseEver); - if (!ImGui::Begin("SPU State", nullptr)) - { - ImGui::End(); - return; - } - - // status - if (ImGui::CollapsingHeader("Status", ImGuiTreeNodeFlags_DefaultOpen)) - { - static constexpr std::array transfer_modes = { - {"Transfer Stopped", "Manual Write", "DMA Write", "DMA Read"}}; - const std::array offsets = {{100.0f * framebuffer_scale, 200.0f * framebuffer_scale, - 300.0f * framebuffer_scale, 420.0f * framebuffer_scale, - 500.0f * framebuffer_scale, 600.0f * framebuffer_scale}}; - - ImGui::Text("Control: "); - ImGui::SameLine(offsets[0]); - ImGui::TextColored(m_SPUCNT.enable ? active_color : inactive_color, "SPU Enable"); - ImGui::SameLine(offsets[1]); - ImGui::TextColored(m_SPUCNT.mute_n ? inactive_color : active_color, "Mute SPU"); - ImGui::SameLine(offsets[2]); - ImGui::TextColored(m_SPUCNT.external_audio_enable ? active_color : inactive_color, "External Audio"); - ImGui::SameLine(offsets[3]); - ImGui::TextColored(m_SPUCNT.ram_transfer_mode != RAMTransferMode::Stopped ? active_color : inactive_color, "%s", - transfer_modes[static_cast(m_SPUCNT.ram_transfer_mode.GetValue())]); - - ImGui::Text("Status: "); - ImGui::SameLine(offsets[0]); - ImGui::TextColored(m_SPUSTAT.irq9_flag ? active_color : inactive_color, "IRQ9"); - ImGui::SameLine(offsets[1]); - ImGui::TextColored(m_SPUSTAT.dma_request ? active_color : inactive_color, "DMA Request"); - ImGui::SameLine(offsets[2]); - ImGui::TextColored(m_SPUSTAT.dma_read_request ? active_color : inactive_color, "DMA Read"); - ImGui::SameLine(offsets[3]); - ImGui::TextColored(m_SPUSTAT.dma_write_request ? active_color : inactive_color, "DMA Write"); - ImGui::SameLine(offsets[4]); - ImGui::TextColored(m_SPUSTAT.transfer_busy ? active_color : inactive_color, "Transfer Busy"); - ImGui::SameLine(offsets[5]); - ImGui::TextColored(m_SPUSTAT.second_half_capture_buffer ? active_color : inactive_color, "Second Capture Buffer"); - - ImGui::Text("Interrupt: "); - ImGui::SameLine(offsets[0]); - ImGui::TextColored(m_SPUCNT.irq9_enable ? active_color : inactive_color, - m_SPUCNT.irq9_enable ? "Enabled @ 0x%04X (actual 0x%08X)" : "Disabled @ 0x%04X (actual 0x%08X)", - m_irq_address, (ZeroExtend32(m_irq_address) * 8) & RAM_MASK); - - ImGui::Text("Volume: "); - ImGui::SameLine(offsets[0]); - ImGui::Text("Left: %d%%", ApplyVolume(100, m_main_volume_left.current_level)); - ImGui::SameLine(offsets[1]); - ImGui::Text("Right: %d%%", ApplyVolume(100, m_main_volume_right.current_level)); - - ImGui::Text("CD Audio: "); - ImGui::SameLine(offsets[0]); - ImGui::TextColored(m_SPUCNT.cd_audio_enable ? active_color : inactive_color, - m_SPUCNT.cd_audio_enable ? "Enabled" : "Disabled"); - ImGui::SameLine(offsets[1]); - ImGui::TextColored(m_SPUCNT.cd_audio_enable ? active_color : inactive_color, "Left Volume: %d%%", - ApplyVolume(100, m_cd_audio_volume_left)); - ImGui::SameLine(offsets[3]); - ImGui::TextColored(m_SPUCNT.cd_audio_enable ? active_color : inactive_color, "Right Volume: %d%%", - ApplyVolume(100, m_cd_audio_volume_left)); - - ImGui::Text("Transfer FIFO: "); - ImGui::SameLine(offsets[0]); - ImGui::TextColored(m_transfer_event->IsActive() ? active_color : inactive_color, "%u halfwords (%u bytes)", - m_transfer_fifo.GetSize(), m_transfer_fifo.GetSize() * 2); - } - - // draw voice states - if (ImGui::CollapsingHeader("Voice State", ImGuiTreeNodeFlags_DefaultOpen)) - { - static constexpr u32 NUM_COLUMNS = 12; - - ImGui::Columns(NUM_COLUMNS); - - // headers - static constexpr std::array column_titles = { - {"#", "InterpIndex", "SampleIndex", "CurAddr", "StartAddr", "RepeatAddr", "SampleRate", "VolLeft", "VolRight", - "ADSRPhase", "ADSRVol", "ADSRTicks"}}; - static constexpr std::array adsr_phases = {{"Off", "Attack", "Decay", "Sustain", "Release"}}; - for (u32 i = 0; i < NUM_COLUMNS; i++) - { - ImGui::TextUnformatted(column_titles[i]); - ImGui::NextColumn(); - } - - // states - for (u32 voice_index = 0; voice_index < NUM_VOICES; voice_index++) - { - const Voice& v = m_voices[voice_index]; - ImVec4 color = v.IsOn() ? ImVec4(1.0f, 1.0f, 1.0f, 1.0f) : ImVec4(0.5f, 0.5f, 0.5f, 1.0f); - ImGui::TextColored(color, "%u", ZeroExtend32(voice_index)); - ImGui::NextColumn(); - if (IsVoiceNoiseEnabled(voice_index)) - ImGui::TextColored(color, "NOISE"); - else - ImGui::TextColored(color, "%u", ZeroExtend32(v.counter.interpolation_index.GetValue())); - ImGui::NextColumn(); - ImGui::TextColored(color, "%u", ZeroExtend32(v.counter.sample_index.GetValue())); - ImGui::NextColumn(); - ImGui::TextColored(color, "%04X", ZeroExtend32(v.current_address)); - ImGui::NextColumn(); - ImGui::TextColored(color, "%04X", ZeroExtend32(v.regs.adpcm_start_address)); - ImGui::NextColumn(); - ImGui::TextColored(color, "%04X", ZeroExtend32(v.regs.adpcm_repeat_address)); - ImGui::NextColumn(); - ImGui::TextColored(color, "%.2f", (float(v.regs.adpcm_sample_rate) / 4096.0f) * 44100.0f); - ImGui::NextColumn(); - ImGui::TextColored(color, "%d%%", ApplyVolume(100, v.left_volume.current_level)); - ImGui::NextColumn(); - ImGui::TextColored(color, "%d%%", ApplyVolume(100, v.right_volume.current_level)); - ImGui::NextColumn(); - ImGui::TextColored(color, "%s", adsr_phases[static_cast(v.adsr_phase)]); - ImGui::NextColumn(); - ImGui::TextColored(color, "%d%%", ApplyVolume(100, v.regs.adsr_volume)); - ImGui::NextColumn(); - ImGui::TextColored(color, "%d", v.adsr_envelope.counter); - ImGui::NextColumn(); - } - - ImGui::Columns(1); - } - - if (ImGui::CollapsingHeader("Reverb", ImGuiTreeNodeFlags_DefaultOpen)) - { - ImGui::TextColored(m_SPUCNT.reverb_master_enable ? active_color : inactive_color, "Master Enable: %s", - m_SPUCNT.reverb_master_enable ? "Yes" : "No"); - ImGui::Text("Voices Enabled: "); - - for (u32 i = 0; i < NUM_VOICES; i++) - { - ImGui::SameLine(0.0f, 16.0f); - - const bool active = IsVoiceReverbEnabled(i); - ImGui::TextColored(active ? active_color : inactive_color, "%u", i); - } - - ImGui::TextColored(m_SPUCNT.cd_audio_reverb ? active_color : inactive_color, "CD Audio Enable: %s", - m_SPUCNT.cd_audio_reverb ? "Yes" : "No"); - - ImGui::TextColored(m_SPUCNT.external_audio_reverb ? active_color : inactive_color, "External Audio Enable: %s", - m_SPUCNT.external_audio_reverb ? "Yes" : "No"); - - ImGui::Text("Base Address: 0x%08X (%04X)", m_reverb_base_address, m_reverb_registers.mBASE); - ImGui::Text("Current Address: 0x%08X", m_reverb_current_address); - ImGui::Text("Current Amplitude: Input (%d, %d) Output (%d, %d)", s_last_reverb_input[0], s_last_reverb_input[1], - s_last_reverb_output[0], s_last_reverb_output[1]); - ImGui::Text("Output Volume: Left %d%% Right %d%%", ApplyVolume(100, m_reverb_registers.vLOUT), - ApplyVolume(100, m_reverb_registers.vROUT)); - - ImGui::Text("Pitch Modulation: "); - for (u32 i = 1; i < NUM_VOICES; i++) - { - ImGui::SameLine(0.0f, 16.0f); - - const bool active = IsPitchModulationEnabled(i); - ImGui::TextColored(active ? active_color : inactive_color, "%u", i); - } - } - - if (ImGui::CollapsingHeader("Hacks", ImGuiTreeNodeFlags_DefaultOpen)) - { - if (ImGui::Button("Key Off All Voices")) - { - for (u32 i = 0; i < NUM_VOICES; i++) - { - m_voices[i].KeyOff(); - m_voices[i].adsr_envelope.counter = 0; - m_voices[i].regs.adsr_volume = 0; - } - } - } - - ImGui::End(); -#endif -} diff --git a/src/core/spu.h b/src/core/spu.h index 65be67f3..e6cc4260 100644 --- a/src/core/spu.h +++ b/src/core/spu.h @@ -41,9 +41,6 @@ public: void DMARead(u32* words, u32 word_count); void DMAWrite(const u32* words, u32 word_count); - // Render statistics debug window. - void DrawDebugStateWindow(); - // Executes the SPU, generating any pending samples. void GeneratePendingSamples(); @@ -434,4 +431,4 @@ private: #endif }; -extern SPU g_spu; \ No newline at end of file +extern SPU g_spu; diff --git a/src/core/timers.cpp b/src/core/timers.cpp index 9ebc2f1b..a583c77b 100644 --- a/src/core/timers.cpp +++ b/src/core/timers.cpp @@ -4,9 +4,6 @@ #include "gpu.h" #include "interrupt_controller.h" #include "system.h" -#ifdef WITH_IMGUI -#include "imgui.h" -#endif Log_SetChannel(Timers); Timers g_timers; @@ -391,77 +388,3 @@ void Timers::UpdateSysClkEvent() { m_sysclk_event->Schedule(GetTicksUntilNextInterrupt()); } - -void Timers::DrawDebugStateWindow() -{ -#ifdef WITH_IMGUI - static constexpr u32 NUM_COLUMNS = 10; - static constexpr std::array column_names = { - {"#", "Value", "Target", "Sync", "Reset", "IRQ", "IRQRepeat", "IRQToggle", "Clock Source", "Reached"}}; - static constexpr std::array sync_mode_names = { - {"PauseOnGate", "ResetOnGate", "ResetAndRunOnGate", "FreeRunOnGate"}}; - static constexpr std::array, 3> clock_source_names = { - {{{"SysClk", "DotClk", "SysClk", "DotClk"}}, - {{"SysClk", "HBlank", "SysClk", "HBlank"}}, - {{"SysClk", "DotClk", "SysClk/8", "SysClk/8"}}}}; - - const float framebuffer_scale = ImGui::GetIO().DisplayFramebufferScale.x; - - ImGui::SetNextWindowSize(ImVec2(800.0f * framebuffer_scale, 100.0f * framebuffer_scale), ImGuiCond_FirstUseEver); - if (!ImGui::Begin("Timer State", nullptr)) - { - ImGui::End(); - return; - } - - ImGui::Columns(NUM_COLUMNS); - ImGui::SetColumnWidth(0, 20.0f * framebuffer_scale); - ImGui::SetColumnWidth(1, 50.0f * framebuffer_scale); - ImGui::SetColumnWidth(2, 50.0f * framebuffer_scale); - ImGui::SetColumnWidth(3, 100.0f * framebuffer_scale); - ImGui::SetColumnWidth(4, 80.0f * framebuffer_scale); - ImGui::SetColumnWidth(5, 80.0f * framebuffer_scale); - ImGui::SetColumnWidth(6, 80.0f * framebuffer_scale); - ImGui::SetColumnWidth(7, 80.0f * framebuffer_scale); - ImGui::SetColumnWidth(8, 80.0f * framebuffer_scale); - ImGui::SetColumnWidth(9, 80.0f * framebuffer_scale); - - for (const char* title : column_names) - { - ImGui::TextUnformatted(title); - ImGui::NextColumn(); - } - - for (u32 i = 0; i < NUM_TIMERS; i++) - { - const CounterState& cs = m_states[i]; - ImGui::PushStyleColor(ImGuiCol_Text, - cs.counting_enabled ? ImVec4(1.0f, 1.0f, 1.0f, 1.0f) : ImVec4(0.5f, 0.5f, 0.5f, 1.0f)); - ImGui::Text("%u", i); - ImGui::NextColumn(); - ImGui::Text("%u", cs.counter); - ImGui::NextColumn(); - ImGui::Text("%u", cs.target); - ImGui::NextColumn(); - ImGui::Text("%s", - cs.mode.sync_enable ? sync_mode_names[static_cast(cs.mode.sync_mode.GetValue())] : "Disabled"); - ImGui::NextColumn(); - ImGui::Text("%s", cs.mode.reset_at_target ? "@Target" : "@Overflow"); - ImGui::NextColumn(); - ImGui::Text("%s%s", cs.mode.irq_at_target ? "Target " : "", cs.mode.irq_on_overflow ? "Overflow" : ""); - ImGui::NextColumn(); - ImGui::Text("%s", cs.mode.irq_repeat ? "Yes" : "No"); - ImGui::NextColumn(); - ImGui::Text("%s", cs.mode.irq_pulse_n ? "Yes" : "No"); - ImGui::NextColumn(); - ImGui::Text("%s%s", clock_source_names[i][cs.mode.clock_source], cs.external_counting_enabled ? " (External)" : ""); - ImGui::NextColumn(); - ImGui::Text("%s%s", cs.mode.reached_target ? "Target " : "", cs.mode.reached_overflow ? "Overflow" : ""); - ImGui::NextColumn(); - ImGui::PopStyleColor(); - } - - ImGui::Columns(1); - ImGui::End(); -#endif -} diff --git a/src/core/timers.h b/src/core/timers.h index 16334d54..d91a3932 100644 --- a/src/core/timers.h +++ b/src/core/timers.h @@ -22,8 +22,6 @@ public: void SetGate(u32 timer, bool state); - void DrawDebugStateWindow(); - void CPUClocksChanged(); // dot clock/hblank/sysclk div 8 @@ -100,4 +98,4 @@ private: u32 m_sysclk_div_8_carry = 0; // partial ticks for timer 3 with sysclk/8 }; -extern Timers g_timers; \ No newline at end of file +extern Timers g_timers;