Compare commits
No commits in common. "1f5073d0ace873011e0d697aeb7df6d3493d50e4" and "a6fc3cf7a64134657a532c85c4ce7ff181f1e62d" have entirely different histories.
1f5073d0ac
...
a6fc3cf7a6
|
@ -55,6 +55,5 @@ namespace Kernel
|
|||
BAN::StringView get_early_boot_command_line(uint32_t magic, uint32_t info);
|
||||
|
||||
extern BootInfo g_boot_info;
|
||||
extern bool g_disable_disk_write;
|
||||
|
||||
}
|
||||
|
|
|
@ -6,7 +6,6 @@ namespace Kernel
|
|||
{
|
||||
|
||||
BootInfo g_boot_info;
|
||||
bool g_disable_disk_write { false };
|
||||
|
||||
static MemoryMapEntry::Type bios_number_to_memory_type(uint32_t number)
|
||||
{
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
#include <kernel/BootInfo.h>
|
||||
#include <kernel/Lock/LockGuard.h>
|
||||
#include <kernel/Memory/Heap.h>
|
||||
#include <kernel/Memory/PageTable.h>
|
||||
|
@ -106,9 +105,6 @@ namespace Kernel
|
|||
|
||||
BAN::ErrorOr<void> DiskCache::sync()
|
||||
{
|
||||
if (g_disable_disk_write)
|
||||
return {};
|
||||
|
||||
for (auto& cache : m_cache)
|
||||
{
|
||||
if (cache.dirty_mask == 0)
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
#include <BAN/ScopeGuard.h>
|
||||
#include <BAN/StringView.h>
|
||||
#include <BAN/UTF8.h>
|
||||
#include <kernel/BootInfo.h>
|
||||
#include <kernel/FS/DevFS/FileSystem.h>
|
||||
#include <kernel/FS/VirtualFileSystem.h>
|
||||
#include <kernel/Lock/LockGuard.h>
|
||||
|
@ -266,13 +265,6 @@ namespace Kernel
|
|||
|
||||
LockGuard _(m_mutex);
|
||||
|
||||
if (g_disable_disk_write)
|
||||
{
|
||||
if (!m_disk_cache.has_value())
|
||||
return BAN::Error::from_errno(EIO);
|
||||
return m_disk_cache->write_to_cache(lba, buffer, true);
|
||||
}
|
||||
|
||||
if (!m_disk_cache.has_value())
|
||||
return write_sectors_impl(lba, sector_count, buffer);
|
||||
|
||||
|
|
|
@ -85,8 +85,6 @@ static void parse_command_line()
|
|||
cmdline.disable_usb = true;
|
||||
else if (argument == "noacpi")
|
||||
cmdline.disable_acpi = true;
|
||||
else if (argument == "readonly")
|
||||
Kernel::g_disable_disk_write = true;
|
||||
else if (argument == "nodebug")
|
||||
g_disable_debug = true;
|
||||
else if (argument.starts_with("ps2="))
|
||||
|
|
|
@ -1,47 +0,0 @@
|
|||
From 70c235938f0b64c4f08a478d3107e5254ad904c6 Mon Sep 17 00:00:00 2001
|
||||
From: Bananymous <bananymousosq@gmail.com>
|
||||
Date: Wed, 27 Nov 2024 13:28:42 +0200
|
||||
Subject: [PATCH] Remove unnecessary copy from framebuffer
|
||||
|
||||
---
|
||||
doomgeneric/doomgeneric.c | 2 --
|
||||
doomgeneric/doomgeneric_banan_os.cpp | 6 +++---
|
||||
2 files changed, 3 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/doomgeneric/doomgeneric.c b/doomgeneric/doomgeneric.c
|
||||
index 782a7e7..f4eb63e 100644
|
||||
--- a/doomgeneric/doomgeneric.c
|
||||
+++ b/doomgeneric/doomgeneric.c
|
||||
@@ -18,8 +18,6 @@ void doomgeneric_Create(int argc, char **argv)
|
||||
|
||||
M_FindResponseFile();
|
||||
|
||||
- DG_ScreenBuffer = malloc(DOOMGENERIC_RESX * DOOMGENERIC_RESY * 4);
|
||||
-
|
||||
DG_Init();
|
||||
|
||||
D_DoomMain ();
|
||||
diff --git a/doomgeneric/doomgeneric_banan_os.cpp b/doomgeneric/doomgeneric_banan_os.cpp
|
||||
index d00c30d..9d13b43 100644
|
||||
--- a/doomgeneric/doomgeneric_banan_os.cpp
|
||||
+++ b/doomgeneric/doomgeneric_banan_os.cpp
|
||||
@@ -80,13 +80,13 @@ void DG_Init()
|
||||
s_key_write_index = (s_key_write_index + 1) % s_key_queue_size;
|
||||
}
|
||||
);
|
||||
+
|
||||
+ ASSERT(DG_ScreenBuffer == nullptr);
|
||||
+ DG_ScreenBuffer = s_window->pixels().data();
|
||||
}
|
||||
|
||||
void DG_DrawFrame()
|
||||
{
|
||||
- for (size_t y = 0; y < DOOMGENERIC_RESY; y++)
|
||||
- for (size_t x = 0; x < DOOMGENERIC_RESX; x++)
|
||||
- s_window->set_pixel(x, y, 0xFF000000 | DG_ScreenBuffer[y * DOOMGENERIC_RESX + x]);
|
||||
s_window->invalidate();
|
||||
s_window->poll_events();
|
||||
}
|
||||
--
|
||||
2.47.1
|
||||
|
|
@ -43,8 +43,6 @@ namespace LibGUI
|
|||
return m_framebuffer[y * m_width + x];
|
||||
}
|
||||
|
||||
BAN::Span<uint32_t> pixels() { return m_framebuffer.span(); }
|
||||
|
||||
void fill_rect(int32_t x, int32_t y, uint32_t width, uint32_t height, uint32_t color);
|
||||
void fill(uint32_t color) { return fill_rect(0, 0, width(), height(), color); }
|
||||
|
||||
|
|
Loading…
Reference in New Issue