Skip to content

Commit

Permalink
Added SDL3 frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
andreas-jonsson committed Oct 11, 2024
1 parent c271cea commit cae343b
Show file tree
Hide file tree
Showing 14 changed files with 98 additions and 1 deletion.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
27 changes: 27 additions & 0 deletions front/sdl3/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Copyright (c) 2019-2024 Andreas T Jonsson <mail@andreasjonsson.se>
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software in
// a product, an acknowledgment (see the following) in the product
// documentation is required.
//
// This product make use of the VirtualXT software emulator.
// Visit https://virtualxt.org for more information.
//
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
//
// 3. This notice may not be removed or altered from any source distribution.

int main(int argc, char *argv[]) {
(void)argc; (void)argv;
return 0;
}
20 changes: 20 additions & 0 deletions front/sdl3/virtualxt.docopt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Usage: virtualxt [options]

Options:
-h --help Show this screen.
-v --version Display version.
--hdboot Prefer booting from harddrive.
--halt Debug break on startup.
--mute Disable audio.
--a20 Enable support for A20 line.
--no-activity Disable disk activity indicator.
--no-idle Disable CPU idle on INT28.
--clean Remove config file and write a new default one.
--edit Open config file in system text editor.
--locate Locate the configuration directory.
--rifs=PATH Share directory with guest OS via RIFS. (Experimental)
--config=PATH Set config directory.
--trace=FILE Write CPU trace to file.
--frequency=MHZ CPU frequency. [default: 10.0]
-a --floppy=FILE Mount floppy image as drive A.
-c --harddrive=FILE Mount harddrive image as drive C.
52 changes: 51 additions & 1 deletion premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ workspace "virtualxt"
end
end

files { "front/sdl/*.h", "front/sdl/*.c" }
files { "front/sdl2/*.h", "front/sdl2/*.c" }
includedirs { "lib/vxt/include", "lib/inih", "lib/microui/src", "front/common" }
links { "vxt", "inih", "microui" }

Expand Down Expand Up @@ -359,7 +359,57 @@ workspace "virtualxt"

filter "toolset:gcc"
buildoptions { "-Wno-uninitialized", "-Wno-missing-field-initializers", "-Wno-missing-braces" }

project "sdl3-frontend"
kind "ConsoleApp"
targetname "virtualxt"
targetdir "build/sdl3"

files "modules/modules.h"
includedirs "modules"

if not _OPTIONS["no-modules"] then
if _OPTIONS["dynamic"] then
dependson "modules"
else
links(modules)
for _,f in ipairs(modules_link_callback) do
f()
filter {}
end
end
end

files { "front/sdl3/*.h", "front/sdl3/*.c" }
includedirs { "lib/vxt/include", "lib/inih", "lib/microui/src", "front/common" }
links { "vxt", "inih", "microui" }

cleancommands {
"{RMDIR} build/sdl3",
"make clean %{cfg.buildcfg}"
}

filter "action:vs*"
libdirs { path.join(_OPTIONS["sdl-config"], "lib", "x64") }
includedirs { path.join(_OPTIONS["sdl-config"], "include") }
links { "SDL3", "SDL3main" }

filter "not action:vs*"
local sdl_cfg = path.join(_OPTIONS["sdl-config"], "sdl3-config")
buildoptions { string.format("`%s --cflags`", sdl_cfg) }
linkoptions { string.format("`%s --libs`", sdl_cfg) }

filter "toolset:clang or gcc"
links "m"
buildoptions "-Wno-unused-parameter"
linkoptions "-Wl,-rpath,'$$ORIGIN'/../lib"

filter "toolset:clang"
buildoptions { "-Wno-missing-field-initializers", "-Wno-missing-braces" }

filter "toolset:gcc"
buildoptions { "-Wno-uninitialized", "-Wno-missing-field-initializers", "-Wno-missing-braces" }

project "terminal-frontend"
kind "ConsoleApp"
targetname "vxterm"
Expand Down

0 comments on commit cae343b

Please sign in to comment.