This commit is contained in:
Jonathan Campbell 2018-09-02 00:06:34 -07:00
commit e2d8f2219a
2313 changed files with 661816 additions and 163635 deletions

183
.editorconfig Normal file
View File

@ -0,0 +1,183 @@
# EditorConfig is awesome: https://EditorConfig.org
# top-most EditorConfig file
root = true
[*.{c,cpp,h}]
end_of_line = lf
indent_style = space
indent_size = 4
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 120
#### Resharper specific
### https://www.jetbrains.com/help/resharper/EditorConfig_CPP_CppBlankLinesPageScheme.html
keep_blank_lines_in_declarations = 2
keep_blank_lines_in_code = 2
blank_lines_around_class_definition = 1
blank_lines_around_function_declaration = 1
blank_lines_around_function_definition = 1
blank_lines_around_single_line_function_definition = 1
blank_lines_around_namespace = 1
blank_lines_around_other_declaration = 0
### https://www.jetbrains.com/help/resharper/EditorConfig_CPP_CppBracesPageScheme.html
namespace_declaration_braces = next_line
linkage_specification_braces = next_line
type_declaration_braces = next_line
place_namespace_definitions_on_same_line = false
invocable_declaration_braces = next_line
anonymous_method_declaration_braces = next_line
case_block_braces = next_line
other_braces = next_line
expression_braces = inside
empty_block_style = multiline
simple_block_style = line_break
### https://www.jetbrains.com/help/resharper/EditorConfig_CPP_CppIndentStylePageSchema.html
indent_style = space
cpp_indent_size = 4
#tab_width = 4 #see editorconfig site ?
cpp_alignment_tab_fill_style = use_spaces
### https://www.jetbrains.com/help/resharper/EditorConfig_CPP_CppOtherPageScheme.html
cpp_continuous_line_indent = single
# Indent namespace members ?
linkage_specification_indentation = all
# Indent access specifier from class ?
indent_wrapped_function_names = false
indent_switch_labels = false
indent_method_decl_pars = inside
indent_invocation_pars = inside
indent_statement_pars = inside
indent_preprocessor_directives = none
align_multiple_declaration = true
align_multiline_parameter = true
align_multiline_argument = true
align_first_arg_by_paren = true
align_multiline_type_parameter = true
align_multiline_type_argument = true
align_multiline_extends_list = true
align_multiline_ctor_init = true
outdent_commas = false
align_ternary = align_all
align_multiline_calls_chain = true
outdent_dots = false
align_multiline_binary_expressions_chain = true
# these two could be false
int_align_eq = true
int_align_declaration_names = true
int_align_comments = true
### https://www.jetbrains.com/help/resharper/EditorConfig_CPP_CppSpacesPageScheme.html
## In Declarations
cpp_space_before_ptr_in_data_member = false
cpp_space_after_ptr_in_data_member = true
cpp_space_before_ptr_in_data_members = true
cpp_space_after_ptr_in_data_members = false
cpp_space_before_ptr_in_method = false
cpp_space_after_ptr_in_method = true
cpp_space_after_comma_in_declaration = true
cpp_space_before_comma_in_declaration = false
cpp_space_after_comma_in_method = true
cpp_space_before_comma_in_method = false
cpp_space_after_comma_in_enum = true
cpp_space_before_comma_in_enum = false
cpp_space_after_comma_in_base_clause = true
cpp_space_before_comma_in_base_clause = false
cpp_space_between_method_declaration_name_and_open_parenthesis = false
cpp_space_between_method_declaration_parameter_list_parentheses = false
cpp_space_between_method_declaration_empty_parameter_list_parentheses = false
cpp_space_before_template_params = true
cpp_space_within_template_params = false
cpp_space_within_empty_template_params = false
cpp_space_after_comma_in_template_params = true
cpp_space_before_comma_in_template_params = false
cpp_space_before_template_args = false
cpp_space_within_template_args = false
cpp_space_after_comma_in_template_args = true
cpp_space_before_comma_in_template_args = false
cpp_space_between_closing_angle_brackets_in_template_args = false
cpp_space_around_alias_eq = true
cpp_space_around_deref_in_trailing_return_type = false
cpp_space_before_colon_in_inheritance_clause = true
cpp_space_after_colon_in_inheritance_clause = true
## In Control Statements
cpp_space_after_keywords_in_control_flow_statements = false
cpp_space_between_parentheses_of_control_flow_statements = false
cpp_space_before_semicolon_in_for_statement = false
cpp_space_after_semicolon_in_for_statement = true
cpp_space_before_for_colon = true
cpp_space_after_for_colon = true
cpp_space_before_colon_in_case = false
cpp_space_after_colon_in_case = true
## In Expressions
cpp_space_around_binary_operator = true
cpp_space_around_assignment_operator = true
cpp_space_around_dot = false
cpp_space_within_parentheses = false
cpp_space_before_open_square_brackets = false
cpp_space_within_array_access_brackets = false
cpp_space_before_method_call_parentheses = false
cpp_space_before_empty_method_call_parentheses = false
cpp_space_between_typecast_parentheses = false
cpp_space_after_cast = false
cpp_space_between_method_call_parameter_list_parentheses = false
cpp_space_between_method_call_empty_parameter_list_parentheses = false
cpp_space_before_comma_in_method_call = false
cpp_space_after_comma_in_method_call = true
cpp_space_before_comma_in_initializer_braces = false
cpp_space_after_comma_in_initializer_braces = true
cpp_space_before_ternary_quest = true
cpp_space_after_ternary_quest = true
cpp_space_before_ternary_colon = true
cpp_space_after_ternary_colon = true
cpp_space_before_initializer_braces = true
cpp_space_within_initializer_braces = true
cpp_space_within_empty_initializer_braces = true
## Other
cpp_space_before_trailing_comment = true
cpp_disable_space_changes_before_trailing_comment = false
### https://www.jetbrains.com/help/resharper/EditorConfig_CPP_CppWrappingPageScheme.html
## Place on New Line
new_line_before_else = true
new_line_before_while = false
cpp_new_line_before_catch = true
simple_embedded_statement_style = line_break
cpp_simple_case_statement_style = line_break
function_definition_return_type_style = on_single_line
toplevel_function_definition_return_type_style = on_single_line
function_declaration_return_type_style = on_single_line
toplevel_function_declaration_return_type_style = on_single_line
cpp_break_template_declaration = line_break
cpp_member_initializer_list_style = line_break
line_break_before_comma_in_member_initializer_lists = false
line_break_after_comma_in_member_initializer_lists = true
## Line Wrapping
cpp_max_line_length = 120
cpp_wrap_before_comma = false
cpp_wrap_ternary_expr_style = chop_if_long
cpp_wrap_before_ternary_opsigns = true
cpp_wrap_before_colon = true
cpp_wrap_enumeration_style = chop_always
cpp_wrap_braced_init_list_style = wrap_if_long
cpp_wrap_base_clause_style = chop_if_long
cpp_wrap_ctor_initializer_style = chop_if_long
cpp_wrap_parameters_style = wrap_if_long
cpp_wrap_before_declaration_lpar = false
cpp_wrap_after_declaration_lpar = true
cpp_wrap_arguments_style = wrap_if_long
cpp_wrap_before_invocation_lpar = false
cpp_wrap_after_invocation_lpar = true

29
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@ -0,0 +1,29 @@
---
name: Bug report
about: Create a report to help us improve DOSBox-X
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Environment (please complete the following information):**
- Operating system
- DOSBox-X release version or commit SHA1 this issue occurred on
- Used configuration, e.g. ```dosbox.conf```
**Additional context**
Add any other context about the problem here.

View File

@ -0,0 +1,17 @@
---
name: Feature request
about: Suggest an idea for this project
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

61
.gitignore vendored
View File

@ -3,6 +3,11 @@
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
# autoconfig nonsense
*.in
aclocal.m4
configure
# User-specific files
*.suo
*.user
@ -12,6 +17,10 @@
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# subgit
subgit
subgit/*
# Build results
[Dd]ebug/
[Dd]ebugPublic/
@ -322,3 +331,55 @@ windows-installer/DOSBox-X-setup-*.zip
*.deps
dosbox-x
Makefile
doxygen
doxygen/*
vs2015/sdl/linux-host
vs2015/sdl/linux-host/*
vs2015/sdl/linux-build
vs2015/sdl/linux-build/*
vs2015/sdl/include/SDL_config.h
vs2015/zlib/linux-host
vs2015/zlib/linux-host/*
vs2015/zlib/linux-build
vs2015/zlib/linux-build/*
vs2015/libpng/linux-host
vs2015/libpng/linux-host/*
vs2015/libpng/linux-build
vs2015/libpng/linux-build/*
/vs2015/libpdcurses/wincon/xmas.exe
/vs2015/libpdcurses/wincon/worm.exe
/vs2015/libpdcurses/wincon/tuidemo.exe
/vs2015/libpdcurses/wincon/testcurs.exe
/vs2015/libpdcurses/wincon/rain.exe
/vs2015/libpdcurses/wincon/ptest.exe
/vs2015/libpdcurses/wincon/pdcurses.lib
/vs2015/libpdcurses/wincon/ozdemo.exe
/vs2015/libpdcurses/wincon/firework.exe
/vs2015/libpdcurses/wincon/xmas.exe
/vs2015/libpdcurses/wincon/worm.exe
/vs2015/libpdcurses/wincon/tuidemo.exe
/vs2015/libpdcurses/wincon/testcurs.exe
/vs2015/libpdcurses/wincon/rain.exe
/vs2015/libpdcurses/wincon/ptest.exe
/vs2015/libpdcurses/wincon/pdcurses.lib
/vs2015/libpdcurses/wincon/ozdemo.exe
/vs2015/libpdcurses/wincon/firework.exe
/vs2015/libpdcurses/wincon/xmas.exe
/vs2015/libpdcurses/wincon/worm.exe
/vs2015/libpdcurses/wincon/tuidemo.exe
/vs2015/libpdcurses/wincon/testcurs.exe
/vs2015/libpdcurses/wincon/rain.exe
/vs2015/libpdcurses/wincon/ptest.exe
/vs2015/libpdcurses/wincon/pdcurses.lib
/vs2015/libpdcurses/wincon/ozdemo.exe
/vs2015/libpdcurses/wincon/firework.exe
.vscode/settings.json

163
.vscode/c_cpp_properties.json vendored Normal file
View File

@ -0,0 +1,163 @@
{
"configurations": [
{
"name": "SDL1 Debug Win32/Win64",
"browse": {
"path": [
"${workspaceFolder}"
],
"limitSymbolsToIncludedHeaders": true
},
"includePath": [
"${workspaceFolder}/include",
"${workspaceFolder}/src",
"${workspaceFolder}/src/aviwriter",
"${workspaceFolder}/src/hardware/snd_pc98/cbus",
"${workspaceFolder}/src/hardware/snd_pc98/common",
"${workspaceFolder}/src/hardware/snd_pc98/generic",
"${workspaceFolder}/src/hardware/snd_pc98/sound",
"${workspaceFolder}/src/hardware/snd_pc98/sound/getsnd",
"${workspaceFolder}/src/hardware/snd_pc98/x11",
"${workspaceFolder}/src/mt32",
"${workspaceFolder}/vs2015",
"${workspaceFolder}/vs2015/libpdcurses",
"${workspaceFolder}/vs2015/libpng",
"${workspaceFolder}/vs2015/pcap",
"${workspaceFolder}/vs2015/sdl/include",
"${workspaceFolder}/vs2015/sdlnet",
"${workspaceFolder}/vs2015/zlib"
],
"defines": [
"_DEBUG",
"_MBCS",
"_CRT_SECURE_NO_WARNINGS",
"WIN32",
"__WIN32__",
"C_SDL1",
"_FILE_OFFSET_BITS=64"
],
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "msvc-x64"
},
{
"name": "SDL1 Release Win32/Win64",
"browse": {
"path": [
"${workspaceFolder}"
],
"limitSymbolsToIncludedHeaders": true
},
"includePath": [
"${workspaceFolder}/include",
"${workspaceFolder}/src",
"${workspaceFolder}/src/aviwriter",
"${workspaceFolder}/src/hardware/snd_pc98/cbus",
"${workspaceFolder}/src/hardware/snd_pc98/common",
"${workspaceFolder}/src/hardware/snd_pc98/generic",
"${workspaceFolder}/src/hardware/snd_pc98/sound",
"${workspaceFolder}/src/hardware/snd_pc98/sound/getsnd",
"${workspaceFolder}/src/hardware/snd_pc98/x11",
"${workspaceFolder}/src/mt32",
"${workspaceFolder}/vs2015",
"${workspaceFolder}/vs2015/libpdcurses",
"${workspaceFolder}/vs2015/libpng",
"${workspaceFolder}/vs2015/pcap",
"${workspaceFolder}/vs2015/sdl/include",
"${workspaceFolder}/vs2015/sdlnet",
"${workspaceFolder}/vs2015/zlib"
],
"defines": [
"_MBCS",
"_CRT_SECURE_NO_WARNINGS",
"WIN32",
"__WIN32__",
"C_SDL1",
"_FILE_OFFSET_BITS=64"
],
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "msvc-x64"
},
{
"name": "SDL2 Debug Win32/Win64",
"browse": {
"path": [
"${workspaceFolder}"
],
"limitSymbolsToIncludedHeaders": true
},
"includePath": [
"${workspaceFolder}/include",
"${workspaceFolder}/src",
"${workspaceFolder}/src/aviwriter",
"${workspaceFolder}/src/hardware/snd_pc98/cbus",
"${workspaceFolder}/src/hardware/snd_pc98/common",
"${workspaceFolder}/src/hardware/snd_pc98/generic",
"${workspaceFolder}/src/hardware/snd_pc98/sound",
"${workspaceFolder}/src/hardware/snd_pc98/sound/getsnd",
"${workspaceFolder}/src/hardware/snd_pc98/x11",
"${workspaceFolder}/src/mt32",
"${workspaceFolder}/vs2015",
"${workspaceFolder}/vs2015/libpdcurses",
"${workspaceFolder}/vs2015/libpng",
"${workspaceFolder}/vs2015/pcap",
"${workspaceFolder}/vs2015/sdl2/include",
"${workspaceFolder}/vs2015/sdlnet",
"${workspaceFolder}/vs2015/zlib"
],
"defines": [
"_DEBUG",
"_MBCS",
"_CRT_SECURE_NO_WARNINGS",
"WIN32",
"__WIN32__",
"C_SDL2",
"_FILE_OFFSET_BITS=64"
],
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "msvc-x64"
},
{
"name": "SDL2 Release Win32/Win64",
"browse": {
"path": [
"${workspaceFolder}"
],
"limitSymbolsToIncludedHeaders": true
},
"includePath": [
"${workspaceFolder}/include",
"${workspaceFolder}/src",
"${workspaceFolder}/src/aviwriter",
"${workspaceFolder}/src/hardware/snd_pc98/cbus",
"${workspaceFolder}/src/hardware/snd_pc98/common",
"${workspaceFolder}/src/hardware/snd_pc98/generic",
"${workspaceFolder}/src/hardware/snd_pc98/sound",
"${workspaceFolder}/src/hardware/snd_pc98/sound/getsnd",
"${workspaceFolder}/src/hardware/snd_pc98/x11",
"${workspaceFolder}/src/mt32",
"${workspaceFolder}/vs2015",
"${workspaceFolder}/vs2015/libpdcurses",
"${workspaceFolder}/vs2015/libpng",
"${workspaceFolder}/vs2015/pcap",
"${workspaceFolder}/vs2015/sdl2/include",
"${workspaceFolder}/vs2015/sdlnet",
"${workspaceFolder}/vs2015/zlib"
],
"defines": [
"_MBCS",
"_CRT_SECURE_NO_WARNINGS",
"WIN32",
"__WIN32__",
"C_SDL2",
"_FILE_OFFSET_BITS=64"
],
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "msvc-x64"
}
],
"version": 4
}

99
.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,99 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "(Windows) Launch SDL1 Debug Win32",
"type": "cppvsdbg",
"request": "launch",
"program": "${workspaceFolder}/bin/Win32/Debug/dosbox-x.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}/bin/Win32/Debug",
"environment": [],
"externalConsole": true
},
{
"name": "(Windows) Launch SDL1 Debug Win64",
"type": "cppvsdbg",
"request": "launch",
"program": "${workspaceFolder}/bin/x64/Debug/dosbox-x.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}/bin/x64/Debug",
"environment": [],
"externalConsole": true
},
{
"name": "(Windows) Launch SDL1 Release Win32",
"type": "cppvsdbg",
"request": "launch",
"program": "${workspaceFolder}/bin/Win32/Release/dosbox-x.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}/bin/Win32/Release",
"environment": [],
"externalConsole": true
},
{
"name": "(Windows) Launch SDL1 Release Win64",
"type": "cppvsdbg",
"request": "launch",
"program": "${workspaceFolder}/bin/x64/Release/dosbox-x.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}/bin/x64/Release",
"environment": [],
"externalConsole": true
},
{
"name": "(Windows) Launch SDL2 Debug Win32",
"type": "cppvsdbg",
"request": "launch",
"program": "${workspaceFolder}/bin/Win32/Debug SDL2/dosbox-x.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}/bin/Win32/Debug SDL2",
"environment": [],
"externalConsole": true
},
{
"name": "(Windows) Launch SDL2 Debug Win64",
"type": "cppvsdbg",
"request": "launch",
"program": "${workspaceFolder}/bin/x64/Debug SDL2/dosbox-x.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}/bin/x64/Debug SDL2",
"environment": [],
"externalConsole": true
},
{
"name": "(Windows) Launch SDL2 Release Win32",
"type": "cppvsdbg",
"request": "launch",
"program": "${workspaceFolder}/bin/Win32/Release SDL2/dosbox-x.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}/bin/Win32/Release SDL2",
"environment": [],
"externalConsole": true
},
{
"name": "(Windows) Launch SDL2 Release Win64",
"type": "cppvsdbg",
"request": "launch",
"program": "${workspaceFolder}/bin/x64/Release SDL2/dosbox-x.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}/bin/x64/Release SDL2",
"environment": [],
"externalConsole": true
},
]
}

146
.vscode/tasks.json vendored Normal file
View File

@ -0,0 +1,146 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "build Windows SDL1 Debug Win32",
"type": "shell",
"command": "msbuild",
"args": [
"/property:GenerateFullPaths=true",
"/p:Configuration=Debug",
"/p:Platform=Win32",
"/t:build",
"vs2015/dosbox-x.sln"
],
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"reveal": "silent"
},
"problemMatcher": "$msCompile"
},
{
"label": "build Windows SDL1 Debug Win64",
"type": "shell",
"command": "msbuild",
"args": [
"/property:GenerateFullPaths=true",
"/p:Configuration=Debug",
"/p:Platform=x64",
"/t:build",
"vs2015/dosbox-x.sln"
],
"group": "build",
"presentation": {
"reveal": "silent"
},
"problemMatcher": "$msCompile"
},
{
"label": "build Windows SDL1 Release Win32",
"type": "shell",
"command": "msbuild",
"args": [
"/property:GenerateFullPaths=true",
"/p:Configuration=Release",
"/p:Platform=Win32",
"/t:build",
"vs2015/dosbox-x.sln"
],
"group": "build",
"presentation": {
"reveal": "silent"
},
"problemMatcher": "$msCompile"
},
{
"label": "build Windows SDL1 Release Win64",
"type": "shell",
"command": "msbuild",
"args": [
"/property:GenerateFullPaths=true",
"/p:Configuration=Release",
"/p:Platform=x64",
"/t:build",
"vs2015/dosbox-x.sln"
],
"group": "build",
"presentation": {
"reveal": "silent"
},
"problemMatcher": "$msCompile"
},
{
"label": "build Windows SDL2 Debug Win32",
"type": "shell",
"command": "msbuild",
"args": [
"/property:GenerateFullPaths=true",
"/p:Configuration='Debug SDL2'",
"/p:Platform=Win32",
"/t:build",
"vs2015/dosbox-x.sln"
],
"group": "build",
"presentation": {
"reveal": "silent"
},
"problemMatcher": "$msCompile"
},
{
"label": "build Windows SDL2 Debug Win64",
"type": "shell",
"command": "msbuild",
"args": [
"/property:GenerateFullPaths=true",
"/p:Configuration='Debug SDL2'",
"/p:Platform=x64",
"/t:build",
"vs2015/dosbox-x.sln"
],
"group": "build",
"presentation": {
"reveal": "silent"
},
"problemMatcher": "$msCompile"
},
{
"label": "build Windows SDL2 Release Win32",
"type": "shell",
"command": "msbuild",
"args": [
"/property:GenerateFullPaths=true",
"/p:Configuration='Release SDL2'",
"/p:Platform=Win32",
"/t:build",
"vs2015/dosbox-x.sln"
],
"group": "build",
"presentation": {
"reveal": "silent"
},
"problemMatcher": "$msCompile"
},
{
"label": "build Windows SDL2 Release Win64",
"type": "shell",
"command": "msbuild",
"args": [
"/property:GenerateFullPaths=true",
"/p:Configuration='Release SDL2'",
"/p:Platform=x64",
"/t:build",
"vs2015/dosbox-x.sln"
],
"group": "build",
"presentation": {
"reveal": "silent"
},
"problemMatcher": "$msCompile"
}
]
}

1272
CHANGELOG

File diff suppressed because it is too large Load Diff

374
CMakeLists.txt Normal file
View File

@ -0,0 +1,374 @@
cmake_minimum_required(VERSION 3.10)
project(dosbox-x C CXX) # C for CheckIncludeFiles
include(CheckTypeSize)
include(CheckIncludeFiles)
include(CheckFunctionExists) # for HAVE_MPROTECT, HAVE_SET_PRIORITY
### options with safe-defaults (laid out like config.h.in)
# Define if building universal (internal helper macro)
# #undef AC_APPLE_UNIVERSAL_BUILD
# Compiling on BSD
# #undef BSD
if(MSVC)
set(C_ATTRIBUTE_ALWAYS_INLINE 0)
elseif(GNU)
set(C_ATTRIBUTE_ALWAYS_INLINE 1)
else()
message(FATAL_ERROR "Option not implemented")
endif()
if(MSVC OR GNU)
set(C_ATTRIBUTE_FASTCALL 1)
else()
message(FATAL_ERROR "Option not implemented")
endif()
option(C_AVCODEC "Define to 1 to use FFMPEG libavcodec for video capture" OFF)
if(C_AVCODEC)
set(C_AVCODEC 1)
endif()
option(C_CORE_INLINE "Define to 1 to use inlined memory functions in cpu core" ON)
if(C_CORE_INLINE)
set(C_CORE_INLINE 1)
endif()
option(C_DEBUG "Define to 1 to enable internal debugger, requires libcurses" OFF)
if(C_DEBUG)
set(C_DEBUG 1)
endif()
option(C_DIRECTLPT "Define to 1 if you want parallel passthrough support (Win32, Linux)" OFF)
if(C_DIRECTLPT)
set(C_DIRECTLPT 1)
endif()
option(C_DIRECTSERIAL "Define to 1 if you want serial passthrough support (Win32, Posix and OS/2)" OFF)
if(C_DIRECTSERIAL)
set(C_DIRECTSERIAL 1)
endif()
option(C_DYNAMIC_X86 "Define to 1 to use x86 dynamic cpu core" ON)
if(C_DYNAMIC_X86)
set(C_DYNAMIC_X86 1)
endif()
option(C_FLUIDSYNTH "Define to 1 to enable fluidsynth MIDI synthesis" OFF)
if(C_FLUIDSYNTH)
set(C_FLUIDSYNTH 1)
endif()
option(C_FPU "Define to 1 to enable floating point emulation" ON)
if(C_FPU)
set(C_FPU 1)
endif()
if(MSVC)
set(HAVE__ATTRIBUTE__ 0)
elseif(GNU)
set(HAVE__ATTRIBUTE__ 1)
else()
message(FATAL_ERROR "Option not implemented")
endif()
if(MSVC)
set(C_HAS_BUILTIN_EXPECT 0)
elseif(GNU)
set(C_HAS_BUILTIN_EXPECT 1)
else()
message(FATAL_ERROR "Option not implemented")
endif()
check_function_exists(mprotect HAVE_MPROTECT)
if(HAVE_MPROTECT)
set(HAVE_MPROTECT 1)
endif()
option(C_HEAVY_DEBUG "Define to 1 to enable heavy debugging, also have to enable C_DEBUG" OFF)
if(C_HEAVY_DEBUG)
set(C_HEAVY_DEBUG 1)
endif()
option(C_IPX "Define to 1 to enable IPX over Internet networking, requires SDL_net" OFF)
if(C_IPX)
set(C_IPX 1)
endif()
option(C_LIBPNG "Define to 1 if you have libpng" ON)
if(C_LIBPNG)
set(C_LIBPNG 1)
endif()
option(C_MODEM "Define to 1 to enable internal modem support, requires SDL_net" OFF)
if(C_MODEM)
set(C_MODEM 1)
endif()
option(C_MT32 "Define to 1 to enable MT32 emulation (x86/x86_64 only)" OFF)
if(C_MT32)
set(C_MT32 1)
endif()
option(C_NE2000 "Define to 1 to enable NE2000 ethernet passthrough, requires libpcap" OFF)
if(C_NE2000)
set(C_NE2000 1)
endif()
option(C_OPENGL "Define to 1 to use opengl display output support" OFF)
if(C_OPENGL)
set(C_OPENGL 1)
endif()
option(C_SDL1 "Set to 1 to enable SDL 1.x support" OFF)
if(C_SDL1)
set(C_SDL1 1)
endif()
option(C_SDL2 "Set to 1 to enable SDL 2.x support" ON)
if(C_SDL2)
set(C_SDL2 1)
endif()
# TODO C_SDL_NET
check_function_exists(setpriority HAVE_SET_PRIORITY)
if(HAVE_SET_PRIORITY)
set(C_SET_PRIORITY 1)
endif()
option(C_SSHOT "Define to 1 to enable screenshots, requires libpng" ON)
if(C_SSHOT)
set(C_SSHOT 1)
endif()
option(C_UNALIGNED_MEMORY "Define to 1 to use a unaligned memory access" ON)
if(C_UNALIGNED_MEMORY)
set(C_UNALIGNED_MEMORY 1)
endif()
set(VERSION "0.82.1" CACHE STRING "Version number of package")
set(PACKAGE_STRING "dosbox-x 0.821" CACHE STRING "Define to the full name and version of this package")
# set(PACKAGE "dosbox-x" CACHE STRING "Name of package")
# set(PACKAGE_BUGREPORT "https://github.com/joncampbell123/dosbox-x/issues" CACHE STRING "Define to the address where bug reports for this package should be sent")
# set(PACKAGE_NAME "dosbox-x" CACHE STRING "Define to the full name of this package")
# set(PACKAGE_TARNAME "dosbox-x" CACHE STRING "Define to the one symbol short name of this package")
# set(PACKAGE_URL "http://dosbox-x.software" CACHE STRING "Define to the home page for this package")
# set(PACKAGE_VERSION "0.821" CACHE STRING "Define to the version of this package")
# set(_FILE_OFFSET_BITS "64" CACHE STRING "Number of bits in a file offset, on hosts where this is settable")
set_property(GLOBAL PROPERTY USE_FOLDERS ON) # solution filters in VS
include(${CMAKE_CURRENT_SOURCE_DIR}/include/CMakeLists.txt)
include(${CMAKE_CURRENT_SOURCE_DIR}/src/CMakeLists.txt)
include(${CMAKE_CURRENT_SOURCE_DIR}/src/aviwriter/CMakeLists.txt)
include(${CMAKE_CURRENT_SOURCE_DIR}/src/builtin/CMakeLists.txt)
include(${CMAKE_CURRENT_SOURCE_DIR}/src/cpu/CMakeLists.txt)
include(${CMAKE_CURRENT_SOURCE_DIR}/src/cpu/core_dyn_x86/CMakeLists.txt)
include(${CMAKE_CURRENT_SOURCE_DIR}/src/cpu/core_dynrec/CMakeLists.txt)
include(${CMAKE_CURRENT_SOURCE_DIR}/src/cpu/core_full/CMakeLists.txt)
include(${CMAKE_CURRENT_SOURCE_DIR}/src/cpu/core_normal/CMakeLists.txt)
include(${CMAKE_CURRENT_SOURCE_DIR}/src/debug/CMakeLists.txt)
include(${CMAKE_CURRENT_SOURCE_DIR}/src/dos/CMakeLists.txt)
include(${CMAKE_CURRENT_SOURCE_DIR}/src/fpu/CMakeLists.txt)
include(${CMAKE_CURRENT_SOURCE_DIR}/src/gui/CMakeLists.txt)
include(${CMAKE_CURRENT_SOURCE_DIR}/src/hardware/CMakeLists.txt)
include(${CMAKE_CURRENT_SOURCE_DIR}/src/hardware/parport/CMakeLists.txt)
include(${CMAKE_CURRENT_SOURCE_DIR}/src/hardware/reSID/CMakeLists.txt)
include(${CMAKE_CURRENT_SOURCE_DIR}/src/hardware/serialport/CMakeLists.txt)
include(${CMAKE_CURRENT_SOURCE_DIR}/src/hardware/snd_pc98/cbus/CMakeLists.txt)
include(${CMAKE_CURRENT_SOURCE_DIR}/src/hardware/snd_pc98/common/CMakeLists.txt)
include(${CMAKE_CURRENT_SOURCE_DIR}/src/hardware/snd_pc98/generic/CMakeLists.txt)
include(${CMAKE_CURRENT_SOURCE_DIR}/src/hardware/snd_pc98/sound/CMakeLists.txt)
include(${CMAKE_CURRENT_SOURCE_DIR}/src/hardware/snd_pc98/sound/getsnd/CMakeLists.txt)
include(${CMAKE_CURRENT_SOURCE_DIR}/src/hardware/snd_pc98/x11/CMakeLists.txt)
include(${CMAKE_CURRENT_SOURCE_DIR}/src/ints/CMakeLists.txt)
include(${CMAKE_CURRENT_SOURCE_DIR}/src/libs/CMakeLists.txt)
include(${CMAKE_CURRENT_SOURCE_DIR}/src/libs/gui_tk/CMakeLists.txt)
include(${CMAKE_CURRENT_SOURCE_DIR}/src/libs/porttalk/CMakeLists.txt)
include(${CMAKE_CURRENT_SOURCE_DIR}/src/libs/zmbv/CMakeLists.txt)
include(${CMAKE_CURRENT_SOURCE_DIR}/src/misc/CMakeLists.txt)
include(${CMAKE_CURRENT_SOURCE_DIR}/src/mt32/CMakeLists.txt)
include(${CMAKE_CURRENT_SOURCE_DIR}/src/mt32/freeverb/CMakeLists.txt)
include(${CMAKE_CURRENT_SOURCE_DIR}/src/mt32/sha1/CMakeLists.txt)
include(${CMAKE_CURRENT_SOURCE_DIR}/src/platform/CMakeLists.txt)
include(${CMAKE_CURRENT_SOURCE_DIR}/src/shell/CMakeLists.txt)
set(ROOT
# suppresses default VS filters, desired but why official way fails ?
"${CMAKE_BINARY_DIR}/config.h"
)
source_group("\\" FILES ${ROOT})
add_executable(dosbox-x
${ROOT}
${INCLUDES}
${SRC}
${SRC_AVIWRITER}
${SRC_BUILTIN}
${SRC_CPU}
${SRC_CPU_CORE_DYN_X86}
${SRC_CPU_CORE_DYN_REC}
${SRC_CPU_CORE_FULL}
${SRC_CPU_CORE_NORMAL}
${SRC_DEBUG}
${SRC_DOS}
${SRC_FPU}
${SRC_GUI}
${SRC_HARDWARE}
${SRC_HARDWARE_PARPORT}
${SRC_HARDWARE_RESID}
${SRC_HARDWARE_SERIALPORT}
${SRC_HARDWARE_SND_PC98}
${SRC_HARDWARE_SND_PC98_CBUS}
${SRC_HARDWARE_SND_PC98_COMMON}
${SRC_HARDWARE_SND_PC98_GENERIC}
${SRC_HARDWARE_SND_PC98_SOUND}
${SRC_HARDWARE_SND_PC98_SOUND_GETSND}
${SRC_HARDWARE_SND_PC98_X11}
${SRC_INTS}
${SRC_LIBS}
${SRC_LIBS_GUI_TK}
${SRC_LIBS_PORTTALK}
${SRC_LIBS_ZMBV}
${SRC_MISC}
${SRC_MT32}
${SRC_MT32_FREEVERB}
${SRC_MT32_SHA1}
${SRC_PLATFORM}
${SRC_SHELL}
)
CHECK_INCLUDE_FILES(inttypes.h HAVE_INTTYPES_H)
CHECK_INCLUDE_FILES(memory.h HAVE_MEMORY_H)
CHECK_INCLUDE_FILES(netinet/in.h HAVE_NETINET_IN_H)
CHECK_INCLUDE_FILES(pwd.h HAVE_PWD_H)
CHECK_INCLUDE_FILES(stdint.h HAVE_STDINT_H)
CHECK_INCLUDE_FILES(stdlib.h HAVE_STDLIB_H)
CHECK_INCLUDE_FILES(strings.h HAVE_STRINGS_H)
CHECK_INCLUDE_FILES(string.h HAVE_STRING_H)
CHECK_INCLUDE_FILES(sys/socket.h HAVE_SYS_SOCKET_H)
CHECK_INCLUDE_FILES(sys/stat.h HAVE_SYS_STAT_H)
CHECK_INCLUDE_FILES(sys/types.h HAVE_SYS_TYPES_H)
CHECK_INCLUDE_FILES(unistd.h HAVE_UNISTD_H)
CHECK_TYPE_SIZE("unsigned char" SIZEOF_UNSIGNED_CHAR)
CHECK_TYPE_SIZE("unsigned short" SIZEOF_UNSIGNED_SHORT)
CHECK_TYPE_SIZE("unsigned int" SIZEOF_UNSIGNED_INT)
CHECK_TYPE_SIZE("unsigned long" SIZEOF_UNSIGNED_LONG)
CHECK_TYPE_SIZE("unsigned long long" SIZEOF_UNSIGNED_LONG_LONG)
CHECK_TYPE_SIZE("int *" SIZEOF_INT_P)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/config.cmake.h
${CMAKE_CURRENT_BINARY_DIR}/config.h
)
include_directories("include")
include_directories(${CMAKE_BINARY_DIR}) # unistd.h, config.h
include_directories(".") # TODO fix dumb bios.cpp include syntax
include_directories("src/aviwriter")
include_directories("src") # TODO lazyflags in fpu_instructions.h
include_directories("src/hardware/snd_pc98/cbus")
include_directories("src/hardware/snd_pc98/common")
include_directories("src/hardware/snd_pc98/generic")
include_directories("src/hardware/snd_pc98/sound")
include_directories("src/hardware/snd_pc98/sound/getsnd")
include_directories("src/hardware/snd_pc98/x11")
include_directories("${ZLIB_INCLUDE_DIR}/SDL2") # nasty hack (vcpkg-specific)
if (NOT MSVC)
# x86 intrinsic include in src/mt32/mmath.h fails on bare i686 target
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse4.1")
endif ()
if (WIN32 AND (NOT MSVC))
# Always build static binaries on MinGW
SET(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
SET(CMAKE_EXE_LINKER_FLAGS "-static")
endif ()
if (MSVC)
# create fake unistd.h
file(WRITE "${CMAKE_BINARY_DIR}/unistd.h" "")
endif ()
if (WIN32)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
add_definitions(-D__WIN32__)
add_definitions(-D CMAKE_BUILD) # shim for _nhandle
else ()
set(SRC_LIBS_ZMBV "")
endif ()
if(C_SDL1)
if (MSVC)
find_path(SDL_INCLUDE_DIR .)
find_path(LIBPNG_INCLUDE_DIR .)
find_path(ZLIB_INCLUDE_DIR .)
include_directories("${SDL_INCLUDE_DIR}")
include_directories("${LIBPNG_INCLUDE_DIR}")
include_directories("${ZLIB_INCLUDE_DIR}")
find_library(SDL_LIBRARY sdl.lib)
find_library(SDLMAIN_LIBRARY sdlmain.lib)
find_library(LIBPNG_LIBRARY libpng16.lib)
find_library(ZLIB_LIBRARY zlib.lib)
else ()
find_package(SDL REQUIRED)
include_directories(${SDL_INCLUDE_DIR})
find_package(PNG REQUIRED)
include_directories(${PNG_INCLUDE_DIR})
find_package(ZLIB REQUIRED)
include_directories(${ZLIB_INCLUDE_DIR})
find_package(OpenGL REQUIRED)
endif ()
if (WIN32)
set(EXTRA_LIBS
winmm
imm32)
endif ()
if (MSVC)
set(EXTRA_LIBS ${EXTRA_LIBS}
opengl32.lib
${SDL_LIBRARY}
${SDLMAIN_LIBRARY}
${LIBPNG_LIBRARY}
${ZLIB_LIBRARY})
else ()
set(EXTRA_LIBS
${SDL_LIBRARY}
${OPENGL_LIBRARIES}
${PNG_LIBRARIES}
${ZLIB_LIBRARIES}
${EXTRA_LIBS})
if (WIN32)
set(EXTRA_LIBS ${EXTRA_LIBS} dxguid)
endif ()
endif ()
elseif(C_SDL2)
find_package(sdl2 REQUIRED)
find_package(PNG REQUIRED)
set(EXTRA_LIBS PNG::PNG)
set(EXTRA_LIBS ${EXTRA_LIBS} SDL2::SDL2 SDL2::SDL2main)
else()
message(FATAL_ERROR "No SDL version selected !")
endif()
if (C_SDL1 AND C_SDL2)
message(FATAL_ERROR "Either SDL1 or SDL2 must be selected, not both !")
endif()
target_link_libraries(dosbox-x PRIVATE ${EXTRA_LIBS})
set_target_properties(dosbox-x PROPERTIES LINKER_LANGUAGE CXX)
# DEBUG print what's going on inside CMake
# get_cmake_property(_variableNames VARIABLES)
# list (SORT _variableNames)
# foreach (_variableName ${_variableNames})
# message(STATUS "${_variableName}=${${_variableName}}")
# endforeach()

31
CODE_OF_CONDUCT.md Normal file
View File

@ -0,0 +1,31 @@
# Community guidelines
Be fair, and work cooperatively. This is a open source project where anyone with an interest in MS-DOS, emulation, and/or DOSBox-X is welcome to talk, chat, develop, and contribute to the project.
Leave your politics at the door. The focus of this project is DOSBox-X and topics related to it including emulation, games, software, hardware, accuracy, code, development, and documentation. Anything else is off-topic and will be treated as such.
I (Jonathan Campbell) will block users from this project that are hostile to this project, it's developers, and/or users with an explicit explanation as to why. That includes threats, slander, gossip, doxxing, and spreading misinformation about myself and/or other users of this project, whether here or anywhere else, on the internet or in real life.
Humor and jokes are welcome as long as they are on-topic. This is a fun hobby project where enthusiasts can get together to hack, modify, explore and share a common interest in this project and the aforementioned topics listed above.
I (Jonathan Campbell), as the owner of this project, reserve the right to block users from this project that violate this Code of Conduct or otherwise disrupt this project according to my judgement. Other users whom I have given access to do so, may block users from this project that explicitly violate this Code of Conduct.
This Code of Conduct is applicable to the DOSBox-X project at https://github.com/joncampbell123/dosbox-x. Forks and projects derived from https://github.com/joncampbell123/dosbox-x may have their own Code of Conduct independent of the main DOSBox-X project, to be upheld and maintained by the owner of that repository only within the domain of that repository. The fork or derived project is free to allow or block users according to the whims and policy of the repository owner, independent of the main DOSBox-X project.
Participation in this project is always voluntary. There is no requirement or obligation to work on this project continuously or in a consistent manner, or at all.
Definition of terms:
* [Anyone, any person at all](https://www.merriam-webster.com/dictionary/anyone)
* [Person, human, individual](https://www.merriam-webster.com/dictionary/person)
* [Interest, a quality in a thing arousing interest](https://www.merriam-webster.com/dictionary/interest)
* [Focus, directed attention](https://www.merriam-webster.com/dictionary/focus)
* [Hostile, marked by malevolence, of an enemy, openly opposed, not hospitable](https://www.merriam-webster.com/dictionary/hostile)
* [Threats, an expression of intention to inflict evil, injury, or damage](https://www.merriam-webster.com/dictionary/threats)
* [Slander, to utter slander against, defame](https://www.merriam-webster.com/dictionary/slander)
* [Defame, to harm the reputation of by communicating false statements about : to harm the reputation of by libel](https://www.merriam-webster.com/dictionary/defame)
* [Gossip, rumor or report of an intimate nature](https://www.merriam-webster.com/dictionary/gossip)
* [Dox, to publicly identify or publish private information about (someone) especially as a form of punishment or revenge](https://www.merriam-webster.com/dictionary/dox)
* [Enthusiast, one who tends to become ardently absorbed in an interest](https://www.merriam-webster.com/dictionary/enthusiast)
* [Joke, something said or done to provoke laughter; especially : a brief oral narrative with a climactic humorous twist, something not to be taken seriously : a trifling matter](https://www.merriam-webster.com/dictionary/joke)
* [Humor, something that is or is designed to be comical or amusing](https://www.merriam-webster.com/dictionary/humor)
* [Hobby, an activity or interest pursued for pleasure or relaxation and not as a main occupation](http://www.dictionary.com/browse/hobby)

31
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,31 @@
## First steps
Before contributing, please check the Issues tab to see whether your potential contribution is already being discussed, or if you'd like to discuss about it first.
## Scope of contributions that are welcome
- the normal operation of games within DOSBox-X
- architectural symmetry with a real DOS environment
- improving a platform-specific build of DOSBox-X or getting it on par with other platforms supported
- non-implemented (or incorrectly) system calls
- missing or incorrect hardware emulation, e.g. video, sound, input
- fixes and/or improvements that allows demoscene productions to run in DOSBox-X
You do not necessarily need to be versed in coding, in this case you will certainly spend most of your time in the Issues tab; either submitting bugs or asking for new features.
## Code
For the code style, please refer to the .editorconfig file, your development environment probably supports it (see https://editorconfig.org/).
The emphasis is put on code clarity, simplicity and documented whenever possible.
Documenting can be 'dynamic', Doxygen-commented methods are preferred but evocative method names are also accepted as long as they're self-explanative.
Recommendations about coding:
- favor the writing of short methods, opposed to long methods, with the exception for really simple to understand code
- maximize code reuse, i.e. don't repeat yourself (DRY)
- simplify your code path for extra clarity, avoid crazing nesting
Obviously when you'll dig in, you will quickly spot that there are many places where these rules are simply not followed ! Over the years, hundreds of people have worked on DOSBox (which DOSBox-X is a fork of), while that helped to raise this project to where it is today, it certainly didn't in terms of clean code. But keep the faith, a huge code cleanup endeavor has started with the goal to raise the metrics of DOSBox-X guts, hopefully ASAP.
That said, welcome to this repository !

1800
Doxyfile Normal file

File diff suppressed because it is too large Load Diff

View File

@ -3,30 +3,31 @@
EXTRA_DIST = autogen.sh
SUBDIRS = src include
.PHONY: dosbox.app
.PHONY: dosbox-x.app
dosbox.app: src/dosbox src/dosbox.icns
rm -Rfv dosbox.app
mkdir dosbox.app
mkdir dosbox.app/Contents
mkdir dosbox.app/Contents/MacOS
mkdir dosbox.app/Contents/Resources
cp -v src/dosbox.plist dosbox.app/Contents/Info.plist
cp -v src/dosbox.pkginfo dosbox.app/Contents/PkgInfo
cp -v src/dosbox.icns dosbox.app/Contents/Resources/DosBox.icns
cp -v src/dosbox dosbox.app/Contents/MacOS/DosBox
dosbox-x.app: src/dosbox-x src/dosbox.icns
rm -Rfv dosbox-x.app
mkdir dosbox-x.app
mkdir dosbox-x.app/Contents
mkdir dosbox-x.app/Contents/MacOS
mkdir dosbox-x.app/Contents/Resources
cp -v src/dosbox.plist dosbox-x.app/Contents/Info.plist
cp -v src/dosbox.pkginfo dosbox-x.app/Contents/PkgInfo
cp -v src/dosbox.icns dosbox-x.app/Contents/Resources/DosBox.icns
cp -v font/FREECG98.BMP dosbox-x.app/Contents/Resources/freecg98.bmp
cp -v src/dosbox-x dosbox-x.app/Contents/MacOS/DosBox
# this is where it gets ugly
otool -L dosbox.app/Contents/MacOS/DosBox | grep '/usr/local/lib' | while read X; do Y=`echo "$$X" | sed -E '/^ +/s///' | cut -d ' ' -f 1`; \
otool -L dosbox-x.app/Contents/MacOS/DosBox | grep '/usr/local/lib' | while read X; do Y=`echo "$$X" | sed -E '/^ +/s///' | cut -d ' ' -f 1`; \
dylib=`basename $$Y`; \
cp -v $$Y dosbox.app/Contents/MacOS/; \
install_name_tool -change $$Y @executable_path/$$dylib dosbox.app/Contents/MacOS/DosBox; \
cp -v $$Y dosbox-x.app/Contents/MacOS/; \
install_name_tool -change $$Y @executable_path/$$dylib dosbox-x.app/Contents/MacOS/DosBox; \
done
# and the libs too
for pass in 1 2 3 4 5; do \
for dolib in dosbox.app/Contents/MacOS/*.dylib; do \
for dolib in dosbox-x.app/Contents/MacOS/*.dylib; do \
otool -L "$$dolib" | grep '/usr/local/lib' | while read X; do Y=`echo "$$X" | sed -E '/^ +/s///' | cut -d ' ' -f 1`; \
dylib=`basename $$Y`; \
cp -vn $$Y dosbox.app/Contents/MacOS/; \
cp -vn $$Y dosbox-x.app/Contents/MacOS/; \
echo "$$Y"; \
install_name_tool -change $$Y @executable_path/$$dylib "$$dolib"; \
install_name_tool -id @executable_path/$$dylib "$$dolib"; \
@ -43,3 +44,27 @@ src/dosbox.icns: src/dosbox.ico
iconutil -c icns -o src/dosbox.icns src/dosbox.iconset
rm -Rfv src/dosbox.iconset
dox:
rm -Rfv doxygen
doxygen
dox-site-update:
if [[ !( -d ../dosbox-x-gh-pages ) ]]; then git clone -b gh-pages https://github.com/joncampbell123/dosbox-x.git ../dosbox-x-gh-pages; fi
(cd ../dosbox-x-gh-pages && rm -Rfv doxygen)
cp -Rf doxygen ../dosbox-x-gh-pages/
(cd ../dosbox-x-gh-pages && git add doxygen/)
(cd ../dosbox-x-gh-pages && git commit doxygen/)
compat-site-update:
if [[ !( -d ../dosbox-x-gh-pages ) ]]; then git clone -b gh-pages https://github.com/joncampbell123/dosbox-x.git ../dosbox-x-gh-pages; fi
true # ----------
(cd /mnt/main/emu/demotest && ./make-compat-chart.pl)
cp /mnt/main/emu/demotest/compat-chart.html ../dosbox-x-gh-pages/demoscene-compat.html
true # ----------
(cd /mnt/main/emu/msdostest && ./make-compat-chart.pl)
cp /mnt/main/emu/msdostest/compat-chart.html ../dosbox-x-gh-pages/msdos-compat.html
true # ----------
(cd ../dosbox-x-gh-pages && git add demoscene-compat.html)
(cd ../dosbox-x-gh-pages && git add msdos-compat.html)
(cd ../dosbox-x-gh-pages && git commit -m 'more' {msdos,demoscene}-compat.html)

View File

@ -1,822 +0,0 @@
# Makefile.in generated by automake 1.14.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
# Main Makefile for DOSBox
VPATH = @srcdir@
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = .
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(top_srcdir)/configure $(am__configure_deps) \
$(srcdir)/config.h.in AUTHORS COPYING INSTALL NEWS README \
THANKS compile config.guess config.sub depcomp install-sh \
missing
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno config.status.lineno
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
ctags-recursive dvi-recursive html-recursive info-recursive \
install-data-recursive install-dvi-recursive \
install-exec-recursive install-html-recursive \
install-info-recursive install-pdf-recursive \
install-ps-recursive install-recursive installcheck-recursive \
installdirs-recursive pdf-recursive ps-recursive \
tags-recursive uninstall-recursive
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
am__recursive_targets = \
$(RECURSIVE_TARGETS) \
$(RECURSIVE_CLEAN_TARGETS) \
$(am__extra_recursive_targets)
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
cscope distdir dist dist-all distcheck
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
$(LISP)config.h.in
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
BEGIN { nonempty = 0; } \
{ items[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique. This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
am__define_uniq_tagged_files = \
list='$(am__tagged_files)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
CSCOPE = cscope
DIST_SUBDIRS = $(SUBDIRS)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
am__remove_distdir = \
if test -d "$(distdir)"; then \
find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
&& rm -rf "$(distdir)" \
|| { sleep 5 && rm -rf "$(distdir)"; }; \
else :; fi
am__post_remove_distdir = $(am__remove_distdir)
am__relativize = \
dir0=`pwd`; \
sed_first='s,^\([^/]*\)/.*$$,\1,'; \
sed_rest='s,^[^/]*/*,,'; \
sed_last='s,^.*/\([^/]*\)$$,\1,'; \
sed_butlast='s,/*[^/]*$$,,'; \
while test -n "$$dir1"; do \
first=`echo "$$dir1" | sed -e "$$sed_first"`; \
if test "$$first" != "."; then \
if test "$$first" = ".."; then \
dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
else \
first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
if test "$$first2" = "$$first"; then \
dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
else \
dir2="../$$dir2"; \
fi; \
dir0="$$dir0"/"$$first"; \
fi; \
fi; \
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
done; \
reldir="$$dir2"
DIST_ARCHIVES = $(distdir).tar.gz
GZIP_ENV = --best
DIST_TARGETS = dist-gzip
distuninstallcheck_listfiles = find . -type f -print
am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
| sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
distcleancheck_listfiles = find . -type f -print
ACLOCAL = @ACLOCAL@
ALSA_CFLAGS = @ALSA_CFLAGS@
ALSA_LIBS = @ALSA_LIBS@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
SDL2_CFLAGS = @SDL2_CFLAGS@
SDL2_CONFIG = @SDL2_CONFIG@
SDL2_LIBS = @SDL2_LIBS@
SDL_CFLAGS = @SDL_CFLAGS@
SDL_CONFIG = @SDL_CONFIG@
SDL_LIBS = @SDL_LIBS@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
WINDRES = @WINDRES@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
EXTRA_DIST = autogen.sh
SUBDIRS = src include
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
.SUFFIXES:
am--refresh: Makefile
@:
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \
$(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
echo ' $(SHELL) ./config.status'; \
$(SHELL) ./config.status;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
$(top_srcdir)/configure: $(am__configure_deps)
$(am__cd) $(srcdir) && $(AUTOCONF)
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
$(am__aclocal_m4_deps):
config.h: stamp-h1
@test -f $@ || rm -f stamp-h1
@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
@rm -f stamp-h1
cd $(top_builddir) && $(SHELL) ./config.status config.h
$(srcdir)/config.h.in: $(am__configure_deps)
($(am__cd) $(top_srcdir) && $(AUTOHEADER))
rm -f stamp-h1
touch $@
distclean-hdr:
-rm -f config.h stamp-h1
# This directory's subdirectories are mostly independent; you can cd
# into them and run 'make' without going through this Makefile.
# To change the values of 'make' variables: instead of editing Makefiles,
# (1) if the variable is set in 'config.status', edit 'config.status'
# (which will cause the Makefiles to be regenerated when you run 'make');
# (2) otherwise, pass the desired values on the 'make' command line.
$(am__recursive_targets):
@fail=; \
if $(am__make_keepgoing); then \
failcom='fail=yes'; \
else \
failcom='exit 1'; \
fi; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-recursive
TAGS: tags
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
empty_fix=.; \
else \
include_option=--include; \
empty_fix=; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test ! -f $$subdir/TAGS || \
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
$(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: ctags-recursive
CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscope: cscope.files
test ! -s cscope.files \
|| $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
clean-cscope:
-rm -f cscope.files
cscope.files: clean-cscope cscopelist
cscopelist: cscopelist-recursive
cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-rm -f cscope.out cscope.in.out cscope.po.out cscope.files
distdir: $(DISTFILES)
$(am__remove_distdir)
test -d "$(distdir)" || mkdir "$(distdir)"
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
$(am__make_dryrun) \
|| test -d "$(distdir)/$$subdir" \
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|| exit 1; \
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
$(am__relativize); \
new_distdir=$$reldir; \
dir1=$$subdir; dir2="$(top_distdir)"; \
$(am__relativize); \
new_top_distdir=$$reldir; \
echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
($(am__cd) $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$$new_top_distdir" \
distdir="$$new_distdir" \
am__remove_distdir=: \
am__skip_length_check=: \
am__skip_mode_fix=: \
distdir) \
|| exit 1; \
fi; \
done
-test -n "$(am__skip_mode_fix)" \
|| find "$(distdir)" -type d ! -perm -755 \
-exec chmod u+rwx,go+rx {} \; -o \
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r "$(distdir)"
dist-gzip: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__post_remove_distdir)
dist-bzip2: distdir
tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
$(am__post_remove_distdir)
dist-lzip: distdir
tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
$(am__post_remove_distdir)
dist-xz: distdir
tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
$(am__post_remove_distdir)
dist-tarZ: distdir
@echo WARNING: "Support for shar distribution archives is" \
"deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__post_remove_distdir)
dist-shar: distdir
@echo WARNING: "Support for distribution archives compressed with" \
"legacy program 'compress' is deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
$(am__post_remove_distdir)
dist-zip: distdir
-rm -f $(distdir).zip
zip -rq $(distdir).zip $(distdir)
$(am__post_remove_distdir)
dist dist-all:
$(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
$(am__post_remove_distdir)
# This target untars the dist file and tries a VPATH configuration. Then
# it guarantees that the distribution is self-contained by making another
# tarfile.
distcheck: dist
case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \
GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.lz*) \
lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
*.tar.xz*) \
xz -dc $(distdir).tar.xz | $(am__untar) ;;\
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
esac
chmod -R a-w $(distdir)
chmod u+w $(distdir)
mkdir $(distdir)/_build $(distdir)/_inst
chmod a-w $(distdir)
test -d $(distdir)/_build || exit 0; \
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& am__cwd=`pwd` \
&& $(am__cd) $(distdir)/_build \
&& ../configure \
$(AM_DISTCHECK_CONFIGURE_FLAGS) \
$(DISTCHECK_CONFIGURE_FLAGS) \
--srcdir=.. --prefix="$$dc_install_base" \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
&& $(MAKE) $(AM_MAKEFLAGS) install \
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
distuninstallcheck \
&& chmod -R a-w "$$dc_install_base" \
&& ({ \
(cd ../.. && umask 077 && mkdir "$$dc_destdir") \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
} || { rm -rf "$$dc_destdir"; exit 1; }) \
&& rm -rf "$$dc_destdir" \
&& $(MAKE) $(AM_MAKEFLAGS) dist \
&& rm -rf $(DIST_ARCHIVES) \
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
&& cd "$$am__cwd" \
|| exit 1
$(am__post_remove_distdir)
@(echo "$(distdir) archives ready for distribution: "; \
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
distuninstallcheck:
@test -n '$(distuninstallcheck_dir)' || { \
echo 'ERROR: trying to run $@ with an empty' \
'$$(distuninstallcheck_dir)' >&2; \
exit 1; \
}; \
$(am__cd) '$(distuninstallcheck_dir)' || { \
echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
exit 1; \
}; \
test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
|| { echo "ERROR: files left after uninstall:" ; \
if test -n "$(DESTDIR)"; then \
echo " (check DESTDIR support)"; \
fi ; \
$(distuninstallcheck_listfiles) ; \
exit 1; } >&2
distcleancheck: distclean
@if test '$(srcdir)' = . ; then \
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
exit 1 ; \
fi
@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|| { echo "ERROR: files left in build directory after distclean:" ; \
$(distcleancheck_listfiles) ; \
exit 1; } >&2
check-am: all-am
check: check-recursive
all-am: Makefile config.h
installdirs: installdirs-recursive
installdirs-am:
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-recursive
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-recursive
clean-am: clean-generic mostlyclean-am
distclean: distclean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-hdr distclean-tags
dvi: dvi-recursive
dvi-am:
html: html-recursive
html-am:
info: info-recursive
info-am:
install-data-am:
install-dvi: install-dvi-recursive
install-dvi-am:
install-exec-am:
install-html: install-html-recursive
install-html-am:
install-info: install-info-recursive
install-info-am:
install-man:
install-pdf: install-pdf-recursive
install-pdf-am:
install-ps: install-ps-recursive
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf $(top_srcdir)/autom4te.cache
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-generic
pdf: pdf-recursive
pdf-am:
ps: ps-recursive
ps-am:
uninstall-am:
.MAKE: $(am__recursive_targets) all install-am install-strip
.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
am--refresh check check-am clean clean-cscope clean-generic \
cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \
dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \
distcheck distclean distclean-generic distclean-hdr \
distclean-tags distcleancheck distdir distuninstallcheck dvi \
dvi-am html html-am info info-am install install-am \
install-data install-data-am install-dvi install-dvi-am \
install-exec install-exec-am install-html install-html-am \
install-info install-info-am install-man install-pdf \
install-pdf-am install-ps install-ps-am install-strip \
installcheck installcheck-am installdirs installdirs-am \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \
uninstall-am
.PHONY: dosbox.app
dosbox.app: src/dosbox src/dosbox.icns
rm -Rfv dosbox.app
mkdir dosbox.app
mkdir dosbox.app/Contents
mkdir dosbox.app/Contents/MacOS
mkdir dosbox.app/Contents/Resources
cp -v src/dosbox.plist dosbox.app/Contents/Info.plist
cp -v src/dosbox.pkginfo dosbox.app/Contents/PkgInfo
cp -v src/dosbox.icns dosbox.app/Contents/Resources/DosBox.icns
cp -v src/dosbox dosbox.app/Contents/MacOS/DosBox
# this is where it gets ugly
otool -L dosbox.app/Contents/MacOS/DosBox | grep '/usr/local/lib' | while read X; do Y=`echo "$$X" | sed -E '/^ +/s///' | cut -d ' ' -f 1`; \
dylib=`basename $$Y`; \
cp -v $$Y dosbox.app/Contents/MacOS/; \
install_name_tool -change $$Y @executable_path/$$dylib dosbox.app/Contents/MacOS/DosBox; \
done
# and the libs too
for pass in 1 2 3 4 5; do \
for dolib in dosbox.app/Contents/MacOS/*.dylib; do \
otool -L "$$dolib" | grep '/usr/local/lib' | while read X; do Y=`echo "$$X" | sed -E '/^ +/s///' | cut -d ' ' -f 1`; \
dylib=`basename $$Y`; \
cp -vn $$Y dosbox.app/Contents/MacOS/; \
echo "$$Y"; \
install_name_tool -change $$Y @executable_path/$$dylib "$$dolib"; \
install_name_tool -id @executable_path/$$dylib "$$dolib"; \
done; \
done; \
done
src/dosbox.icns: src/dosbox.ico
rm -Rfv src/dosbox.iconset
mkdir src/dosbox.iconset
sips -z 16 16 src/dosbox.png --out src/dosbox.iconset/icon_16x16.png
sips -z 32 32 src/dosbox.png --out src/dosbox.iconset/icon_16x16@2.png
sips -z 32 32 src/dosbox.png --out src/dosbox.iconset/icon_32x32.png
iconutil -c icns -o src/dosbox.icns src/dosbox.iconset
rm -Rfv src/dosbox.iconset
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View File

@ -0,0 +1,146 @@
2018/07/02 test results and findings.
Test units:
COMP-Compro1997 An old Pentium ? from 1997, with ATI AGP VGA
COMP-IBMPS2-30 An old IBM PS/2 Model 30 (286) with VGA
COMP-P2ISA1997 An old Pentium II from 1997, with S3 VGA
COMP-IBM5150 An old IBM 5150, 8088, with CGA
COMP-Old486y91 An old 486SX 33MHz, with Tseng ET4000
DOSBox-X-1e6bb8dc469761d46217d44615c06a7ff95f2e49 DOSBox-X, by indicated commit
DOSLIB-848166fcacb6292773253273ef192ddae7942064 DOSLIB, by indicated commit
Equipment:
- Composite video capture (PEXHDCAP 1080p60). None of my Happauge USB capture
sticks were willing to capture the CGA composite video output for some reason,
nor would the Happauge WinTV in one of my machines. The PEXHDCAP was able to
but had curious brightness problems as screen contents changed.
- HDMI video capture (PEXHDCAP 1080p30)
- VGA to HDMI adapter (one that matches the mode and converts as-is)
- A mobile phone, pointed at the LCD TV set (second try, IBM 5150 test)
Software:
- DOSBox-X build:
git commit 1e6bb8dc469761d46217d44615c06a7ff95f2e49
- DOSLIB build:
git commit 848166fcacb6292773253273ef192ddae7942064
Findings:
- On the IBM 5150, The IBM BIOS (I think it dates from 1982) is indeed missing
the "number of rows - 1" value in the BIOS data area. This confirms comments
in TEST-FW\VIDEO\PC\TEST.C about how it may not exist according to the
definitions listed in IBM ROM BIOS source code from 1984, while the 1986
listing does list it.
- On the IBM 5150, INT 10h appears to have a bug where all CGA modes work, but
setting mode 7 produces a video mode with horizontal and vertical timing that
is incompatible with NTSC. During that part, neither my capture card nor the
LCD TV set would display anything.
Perhaps the bug, theoretically, is the application of MDA monitor timing for
INT 10h mode 7 even on CGA.
- The EGA palette assumed in 16-color modes didn't always match the TEST-FW
video's assumptions, but the differences are not jarring. They're understandable.
- In the 256-color mode test, three different attribute controller to DAC to
DAC mask behaviors were seen.
The most common, seen on all but two, is that the attribute controller appears
to affect both the low nibble and upper bits (high nibble?) of the 8-bit
color palette index.
When the test program flashes the attribute controller palette #1 for example,
it appears to affect not only every 16th color starting from #1, but also
colors #16-#31.
Generally, flashing attribute controller palette N affects:
Every 16th color starting at N
Colors (N * 16) to (N * 16 + 15)
This remapping needs more investigation on how exactly it works. This should
be done as a separate palette test program targeting only the VGA.
Results so far suggest that both the low nibble and high nibble are translated
through the attribute controller palette registers.
On the Tseng ET4000, the attribute controller only affects the low 4 bits.
It does not affect any of the higher bits.
Flashing attribute color palette N affects only every 16th color starting at N.
Finally, perhaps the most erroneous is DOSBox-X (and DOSBox SVN).
Due to optimizations around lazily updating only part of the color palette,
DOSBox-X only updates ONE color palette entry when the attribute controller
palette is flashing.
Flashing attribute controller palette N affects:
One color at DAC palette entry N
Questions to answer in further development:
For a separate program in TEST-FW\VIDEO\PC, focused on the VGA:
- How exactly does the attribute controller affect all 8 bits of 256-color pixels?
The TEST-FW\VIDEO\PC\TEST.C program only shows what happens when flashing the
attribute controller palette entry between it's initial value and 0x3F (if the
initial value is dimmer than neutral gray) or 0x00 (if brigher than gray).
- How do Attribute Controller registers 0x10 and 0x14 affect this mapping?
See http://www.osdever.net/FreeVGA/vga/attrreg.htm
These registers are documented to affect the color palette entry coming from
the attribute controller, bits 4-5 in one case, and bits 6-7 in non-256-color
modes.
Interesting to check: What happens if register 0x10 bit 6 (8-bit color enable)
is switched off in 256-color mode?
- How does the DAC mask (3C6h) affect the attribute controller, VGA palette,
various AC bits?
It's not clear where the DAC mask is applied, though as "Pel mask" it may be
at the final stage before conversion through the VGA palette. Test program
should confirm this.
Test routine ideas:
- Interactive mode to fiddle with attribute controller, color palette, and
attribute controller bits, with 256-color palette on screen to show effects.
- Non-interactive mode to run through combinations of these bits, for capture
and logging purposes.
Related demoscene capture ideas:
"Copper" (ftp.scene.org/pub/parties/1992/theparty92/demo/copper.zip)
- This demo uses VGA palette tricks that only seem to work in DOSBox-X and
are said only to work on Tseng ET4000AX cards.
Test on ET4000 card vs S3 and ATI to note where it works exactly.
Noted in the past is that on S3 and Paradise chipsets, the "line fading"
effects (explicitly said and during scrolling credits) show absolutely
nothing on-screen.
- This demo abuses the horizontal sync pulse in some parts to make the
picture "wobble", which causes modern VGA monitors and LCDS to switch off
instead. Pull out an old VGA CRT or two and see if the effect can be
recorded off the screen. Noted in past test runs, is that the effect
makes an audible though quiet "ringing" sound in the back of the picture
tube as the CRT tries to follow this "wobble" effect.

View File

@ -0,0 +1,116 @@
2018/07/05 test results and findings.
Test units:
COMP-IBMPS2-30 An old IBM PS/2 Model 30 (286) with VGA
DOSLIB-d7d079bfd75a71b4c4d5b2afc9efc5e69cefa152 DOSLIB, by indicated commit
Equipment:
- HDMI video capture (PEXHDCAP 1080p30)
- VGA to HDMI adapter (one that matches the mode and converts as-is)
Software:
- DOSLIB build:
git commit d7d079bfd75a71b4c4d5b2afc9efc5e69cefa152
Findings:
- VGA DAC test program shows straightforward attribute controller translation, as if
the 8-bit value is split into two 4-bit nibbles and translated on it's way through
the AC palette.
- Switching off 8BIT in the attribute controller shows a strange sort of 640x200
256-color mode, except that each pixel displayed looks as if half the value sent
to the DAC is loaded per pixel clock before becoming the full 8-bit value.
It's not certain yet whether the nibble value is loaded in or shifted in.
It's not certain yet which nibble is loaded first.
- Switching on the 8BIT in the attribute controller for any other video mode seems
to halve the video resolution (skip every other pixel) without any other effects.
- The "MONO" bit, listed on FreeVGA as apparently doing nothing, appears to influence
how the blink attribute is applied on it's way to the DAC.
- On an IBM PS/2 model 30 (VGA), the blink attribute can be switched on in any VGA
graphics mode, which then acts on bit 3 in all modes except 256-color mode where it
affects bit 3 and bit 7 (possibly related to the 4-bit 256-color shift behavior listed
above).
- If MONO=0, and graphics mode, the blink attribute seems to remap like this:
if (color >= 8) {
color = (color & 7) + (blink << 3);
}
else {
color |= 8;
}
- If MONO=1, or alphanumeric (text) mode, the blink attribute seems to remap like this:
color = (color & 7) + (blink << 3);
- Noted, according to VGA register snapshots, is that the BIOS sets MONO=0 for all modes except
mode 7 (80x25 mono text) and mode 15 (640x350 2-color graphics) where MONO=1.
- The DAC mask appears to apply after the Color Select register is applied to bits 7-6.
It also applies after application of Color Select applied to bits 5-4.
- Color Select bits 7-6 / 5-4 do not apply in 256-color mode (ignored). The bit to apply
bits 5-4 from Color Select (P54S) is ignored in 256-color mode. 256-color mode will
not apply any bits from Color Select.
- It appears the attribute controller palette translation (4-to-6) is done first, then
combined with Color Select, before being masked by DAC mask register 3C6h.
Other ideas to follow:
- Jim Leonard on Twitter wants to know if the vertical retrace interrupt works.
Ref: https://twitter.com/MobyGamer/status/1015097180883955712
Ref: https://www.vogons.org/viewtopic.php?t=58445
Questions to answer in further development:
- Is the blink attribute applied before or after the attribute palette remapping?
- What nibble is loaded first when 8BIT=0 in 256-color mode?
- What other VGA cards does this 256-color 8BIT=0 behavior occur, or more specifically,
what do clone cards do in this case?
- Is the value simply replaced a nibble at a time or is it shifted 4 bits and loaded?
- The Tseng ET4000, known to replace only the low 4 bits, should be re-tested with the
new code and to see what odd behaviors it has.
- Do other SVGA cards remap through the attribute controller in a way that the blink
attribute can affect the output in any mode?
- Regarding the vertical retrace interrupt, does it work on the PS/2?
- What other SVGA cards does the vertical retrace interrupt work on?
- Do these SVGA cards work as documented, or do they ignore certain behaviors, act different,
etc?
- What does the Tseng ET3000 do with the attribute controller palette? Is it the same as the
ET4000 or different?
- What does Color Select do on the ET3000/ET4000 cards? If you switch on the P54S bit in
256-color mode, what happens to the palette? Theoretically, according to COPPER.EXE, it
means the low 4 bits get translated by the attribute controller and the upper 4 bits
are replaced with the Color Select Register. Verify this on real hardware.
Ideas for further development:
- DOSLIB VGA test program to demonstrate vertical retrace interrupt, whether it's occurring,
whether it works as documented.

1072
OLD-REFERENCE/winres.rc Executable file

File diff suppressed because it is too large Load Diff

23
PULL_REQUEST_TEMPLATE.md Normal file
View File

@ -0,0 +1,23 @@
# Description
_Summary of changes brought by this PR._
**Does this PR address some issue(s) ?**
_Add the issue(s) fixed, e.g. ```#1234```_
**Does this PR introduce new feature(s) ?**
_Describe the feature(s) introduced._
**Are there any breaking changes ?**
_Describe the breaking changes in detail._
**Additional information**
_Add any additional information that may be useful._

3196
README

File diff suppressed because it is too large Load Diff

100
README.Windows Normal file
View File

@ -0,0 +1,100 @@
Getting started with DOSBox-X development under Windows 10
Visual Studio
-------------
Setting up the environment from scratch
---------------------------------------
- download Visual Studio installer from https://www.visualstudio.com/downloads
- launch the installer
- in 'Workloads' tab, tick 'Desktop development with C++'
- in 'Individual components' tab, 'SDKs, libraries, and frameworks' section, tick 'Windows 8.1 SDK'
- in 'Individual components' tab, 'Compilers, build tools, and runtimes' section, tick 'Windows Universal CRT SDK'
- download the DirectX SDK (June 2010) from https://www.microsoft.com/en-us/download/details.aspx?id=6812
- launch the installer and follow the instructions
- if you encounter error S1023 during installation, follow the instructions at https://support.microsoft.com/en-us/help/2728613/s1023-error-when-you-install-the-directx-sdk-june-2010
- open the DOSBox-X Visual Studio solution located in 'vs2015' folder of the repository
- for debugging, you might want to change 'Working Directory' default value of $(ProjectDir) to $(TargetDir)
Note that Visual Studio must be closed prior installing the DirectX SDK, else it won't pick up environment variables set by the DirectX SDK and this will result in building errors.
Pass additional options to the custom-build of SDL1
---------------------------------------------------
You can do that through the SDL1AdditionalOptions environment variable:
REM adding a preprocessor define
SET SDL1AdditionalOptions=/DMY_DEFINE
MSBUILD ...
Visual Studio Code
------------------
1. Install the building environment
If you have a side install of regular Visual Studio and already set up the development environment for DOSBox-X, you can skip this step.
Get and install Build Tools for Visual Studio 2017 from https://www.visualstudio.com/downloads/#other and install the following options:
Workloads
Visual C++ build tools
Individual components
Compilers, build tools, and runtimes
Windows Universal CRT SDK
SDKs, libraries, and frameworks
Windows 8.1 SDK
2. Add msbuild to path environment variable
- open Developer Command Prompt for VS 2017
- type 'where msbuild' and take note of first occurrence found
- open environment variables editor by running '%windir%\System32\rundll32.exe sysdm.cpl,EditEnvironmentVariables'
- add the found path to the environment variable
3. Setup VSCode build task
The default build task is 'build Windows SDL1 Debug Win32', you can switch to another in Tasks menu, Configure Default Build Task.
3. Setup C/C++ extension from Microsoft
Switch to the extensions pane and install it, its identifier is ms-vscode.cpptools. When done, open the Command Palette and search for 'C/Cpp: Select a Configuration' to select the appropriate configuration for your build task.
4. Setup the debugging
To change configuration, switch to the Debug pane and choose desired one in the combo box.
You can also do that from the bottom blue bar, but for some reason, VSCode does not always show it on startup; to remedy this problem execute the former procedure.
You can now build and debug DOSBox-X.
5. Notes and TODO
Even though it leverages existing Visual Studio solution, you do not need Visual Studio to be installed on your system, build tools are sufficient.
These instructions were written in an already set up environment, should some step be not reproducible, open an issue with the exact details so this guide can be improved.
The section about configuring IntelliSense still needs to be written.
CMake
-----
The CMakeLists.txt is provided as an alternative to the solution in 'vs2015' folder but with a few limitiations compared to it:
- VCPKG from Microsoft is the package manager used to fetch dependencies, consequently, only an SDL2 build is possible
- statically linking dependencies is not supported
Joystick improvements for SDL1 build
------------------------------------
XInput is now supported through the SDL_JOYSTICK_XINPUT define, this fixes the long plaguing issue where triggers were seen as the third axis on Xbox controllers. The resulting experience was an unsable input since both triggers shared the same the axis in the default DirectInput driver provided by Microsoft, for compatibility reasons. Some might have noticed that an earlier version of the device driver did not exhibit such behavior, at the cost of breaking legacy compatibility. By enabling this flag, XInput will be used in place of DirectInput. Consequently, the third axis will be the horizontal axis of the right thumbstick and triggers will act as the fifth and sixth axes when using the 'ch' joystick type.
To enable it:
set SDL1AdditionalOptions=/DSDL_JOYSTICK_XINPUT
msbuild dosbox-x.sln /p:Configuration=Debug /p:Platform=Win32

17
README.cmake.md Normal file
View File

@ -0,0 +1,17 @@
The CMake is provided as an alternative to the manually-crafted Visual Studio solutions, but over time was expanded to support other platforms.
# Windows
It leverages vcpkg for its dependencies, as a consequence only SDL2 is supported.
Note: DOSBox configuration options defaults have been set for this environment.
To install the required dependencies: ```vcpkg install zlib sdl2 libpng```.
# Linux
Both SDL versions are supported.
TODO
Thanks to https://github.com/mkoloberdin for the Linux patches.

137
README.joystick Normal file
View File

@ -0,0 +1,137 @@
Overview of latest joystick parameters in dosbox.conf
=====================================================
Sample configuration:
[joystick]
# Following settings define deadzone and response curve for DOS joystick axes.
# They are to be used when your software input method IS a joystick,
# contrarily to the settings in the [mapper] section below.
# First joystick has twice as much settings as the second one,
# this because when your joystick type is 4axis, fcs or ch,
# they in fact do combine both joystick ports to make an uber DOS joystick.
# see https://www.dosbox.com/DOSBoxManual.html#Joystick for more information
# Settings of interest per joystick type:
# 2axis
# player 1: joy1deadzone1, joy1response1
# player 2: joy2deadzone1, joy2response1
# 4axis, 4axis_2, fcs, ch
# player 1: joy1deadzone1, joy1deadzone2, joy1response1, joy1response2
# player 2: N/A
joy1deadzone1=0.26
joy1deadzone2=0.26
joy2deadzone1=0.26
joy1response1=3.00
joy1response2=3.00
joy2response1=3.00
# Following settings allows you to remap physical axes, this is useful
# when either your device or software has a fixed layout.
joy1axis0=0
joy1axis1=1
joy1axis2=2
joy1axis3=3
joy1axis4=4
joy1axis5=5
joy1axis6=6
joy1axis7=7
joy2axis0=0
joy2axis1=1
joy2axis2=2
joy2axis3=3
joy2axis4=4
joy2axis5=5
joy2axis6=6
joy2axis7=7
# Fix Xbox One Controller triggers acting as 3rd axis (4axis):
# joy1axis2=4
# Both directions of your right thumbstick are now working.
[mapper]
# Following settings specify deadzone for a mapper binding to be triggerred.
# This is useful when you wish to map some physical joystick axes to act as keys,
# i.e. use left thumbstick to emit WSAD keys.
joy1deadzone0-=0.60
joy1deadzone0+=0.60
joy1deadzone1-=0.60
joy1deadzone1+=0.60
joy1deadzone2-=0.20
joy1deadzone2+=0.20
joy1deadzone3-=0.20
joy1deadzone3+=0.20
joy1deadzone4-=0.20
joy1deadzone4+=0.20
joy1deadzone5-=0.20
joy1deadzone5+=0.20
joy1deadzone6-=0.20
joy1deadzone6+=0.20
joy1deadzone7-=0.20
joy1deadzone7+=0.20
joy2deadzone0-=0.60
joy2deadzone0+=0.60
joy2deadzone1-=0.60
joy2deadzone1+=0.60
joy2deadzone2-=0.20
joy2deadzone2+=0.20
joy2deadzone3-=0.20
joy2deadzone3+=0.20
joy2deadzone4-=0.20
joy2deadzone4+=0.20
joy2deadzone5-=0.20
joy2deadzone5+=0.20
joy2deadzone6-=0.20
joy2deadzone6+=0.20
joy2deadzone7-=0.20
joy2deadzone7+=0.20
Deadzone
--------
Allows an axis to be at rest below a certain threshold. As a result, axis value at rest will stay fairly stable whereas previously lot of jittering could be seen. A default value of 0.26 will do fine on contemporary gamepads (e.g. Xbox One Controller). A higher value might be needed for not so new devices as they tend to loosen over time.
Response
--------
Smoothing of joystick movement. Player input is smoothed using a power function, 'response' being the exponent parameter. A value of 1.0 produces a linear (unfiltered) input. A value of 3.0 produces a cubic interpolation (good for aiming). Beware though that as you increase the exponent, the produced input is less uniform overall. As exponent increases, you gain precision at center but lose precision at edges; also the overall circle shape that a linear input produces 'morphs' to a rhombus shape. Recommended range is between 1.0 and 5.0.
Tip 1:
Setting a negative value will generate the opposite behavior.
Tip 2:
Do not set to 0.0 as this will invariably generate a movement.
Mapper deadzones
----------------
Tip 1:
To ensure the triggering of bi-directional command like move forward but strafe at the same time, deadzone values shall be less than ~0.7071 (the maximum possible extent when diagonally moving with a joystick with a circular restriction).
Tip 2:
The mapper deadzones are affected by 'axes mapping', this is not likely to be a problem as you are looking to emulate keyboard presses using a joystick. However, make sure to set 'axes mapping' to their default value, or simply remove them from your configuration.
General notes
-------------
You will want to try and experiment as on what settings works best for software A and software B, and will probably end up with software-specific configurations.
Please note that most DOS software supporting joystick input will not react properly when you adjust CPU cycles while they are being run, i.e. either find the appropriate number of CPU cycles it requires first or restart it for a consistent joystick experience.
DOSBox-X supports 6 buttons joysticks, to enable support, set joystick type to 4axis. You will find that 5th and 6th buttons are in fact the negative sides of the 2nd port joystick axes. To remedy this problem and use buttons instead, in the mapper add bindings to 'Axis 3 X-' and 'Axis 4 Y-' to buttons you which to act as 5th and 6th buttons on your device. Note that you can only have a single 6 buttons joystick at any time, this is due to how they are implemented (such device in fact use both joystick ports).

60
README.xbrz Normal file
View File

@ -0,0 +1,60 @@
xBRZ (https://sourceforge.net/projects/xbrz/) scaler is integrated into DOSBox-X.
To enable, use
scaler=xbrz
or
scaler=xbrz_bilinear
option in [render] section.
The difference between two options is in the post-scaling resize method.
xBRZ scaler uses fixed scale factors, 2X to 6X, which are usually not exactly
matching the display window. So nearest size xBRZ scaler output is then
resized (upscaled/dowscaled) using either nearest neighbor ('xbrz') or
bilinear ('xbrz_bilinear') algorithm to match the window size.
It is highly recommended to use 'direct3d' or any of the 'opengl' output modes
with xBRZ because bilinear post-scaler performance is terrible and nearest
neighbor post-scaler does not provide good results.
In 'direct3d' / 'opengl' output modes, there is no difference between
'xbrz' and 'xbrz_bilinear' variants, because software post-scaler is not used
and output is post-scaled by the output interface/hardware.
Differences from reference implementation on xBRZ site / in Daum build:
- DOSBox-X implementation supports 'surface', 'direct3d' and 'opengl' outputs
(including opengl variants 'openglnb' and 'openglhq')
- Windowed mode is fully working with xBRZ scaler enabled
- You can combine xBRZ with 'direct3d' mode post-scalers to get i.e. TV effect
- Enabling xBRZ scaler does not disable 'aspect' option, it is honored
Things to notice:
- The scaler is very CPU intensive so it will run with decent speed for
games and demos only on high-end CPUs. Keep this in mind. You can try
to correct performance for high output resolutions by using either
'xbrz fixed scale factor' or 'xbrz max scale factor' options to limit
xBRZ scale factor (lower factors improve performance), of course this
reduces image quality for higher output resolutions proportionally.
- Using 'direct3d' or 'opengl' mode actually improves performance a lot
because it gets rid of the software post-scaler pass.
- xBRZ scaler code uses parallel processing internally. There is also
'xbrz slice' option that affects parallelism, its default (16) gives
good results on 4-8 core CPUs.
- When xBRZ scaler is enabled, internal DOSBox scaler options are disabled
because any pre-scaling will break xBRZ algorithm. For the same very reason,
'doublescan' option is always turned off internally when xBRZ is enabled.
- When using xBRZ in 'surface' output mode and window/screen sizes less than
2x of the original DOS resolution, 'xbrz' scaler can degrade quality instead
of improving it, use 'direct3d'/'opengl' outputs or 'xbrz_bilinear' scaler
variant to avoid this.
Caveats / issues / things to do / incomplete:
- In case video adapter interface uses non-standard color scheme / byte order,
colors with xBRZ scaler enabled would most probably be garbled.
[YET TO REPRODUCE ANYWHERE]

Binary file not shown.

Binary file not shown.

View File

@ -27,6 +27,11 @@ AC_ARG_ENABLE(sdl2, [ --enable-sdl2 Enable SDL 2.x],
fi
fi
if test -x vs2015/sdl2/linux-host/bin/sdl2-config ; then
SDL2_CONFIG=vs2015/sdl2/linux-host/bin/sdl2-config
PATH=vs2015/sdl2/linux-host/bin:$PATH
fi
AC_PATH_PROG(SDL2_CONFIG, sdl2-config, no)
min_sdl2_version=ifelse([$1], ,0.11.0,$1)
AC_MSG_CHECKING(for SDL2 - version >= $min_sdl2_version)
@ -77,6 +82,11 @@ AC_ARG_ENABLE(sdl, [ --enable-sdl Enable SDL 1.x],
fi
fi
if test -x vs2015/sdl/linux-host/bin/sdl-config ; then
SDL_CONFIG=vs2015/sdl/linux-host/bin/sdl-config
PATH=vs2015/sdl/linux-host/bin:$PATH
fi
AC_PATH_PROG(SDL_CONFIG, sdl-config, no)
min_sdl_version=ifelse([$1], ,0.11.0,$1)
AC_MSG_CHECKING(for SDL - version >= $min_sdl_version)

1150
aclocal.m4 vendored

File diff suppressed because it is too large Load Diff

49
appveyor.yml Normal file
View File

@ -0,0 +1,49 @@
#---------------------------------#
# general configuration #
#---------------------------------#
branches:
only:
- master
only_commits:
files:
- src\
- vs2015\
#---------------------------------#
# environment configuration #
#---------------------------------#
image: Visual Studio 2017
init:
- git config --global core.autocrlf true
#---------------------------------#
# build configuration #
#---------------------------------#
platform:
- x64
configuration: Release
build:
project: vs2015\dosbox-x.sln
after_build:
- ps : >-
$shortHash = $env:APPVEYOR_REPO_COMMIT.Substring(0, 7);
7z a dosbox-x-windows-$shortHash.zip C:\projects\dosbox-x\vs2015\..\bin\x64\Release\changelog.txt;
7z a dosbox-x-windows-$shortHash.zip C:\projects\dosbox-x\vs2015\..\bin\x64\Release\dosbox.reference.conf;
7z a dosbox-x-windows-$shortHash.zip C:\projects\dosbox-x\vs2015\..\bin\x64\Release\dosbox-x.exe;
7z a dosbox-x-windows-$shortHash.zip C:\projects\dosbox-x\vs2015\..\bin\x64\Release\FREECG98.BMP;
#---------------------------------#
# artifacts configuration #
#---------------------------------#
artifacts:
- path: dosbox-x-windows-*.zip
name: DOSBox-X Windows Build

18
avi_zmbv_to_720p.sh Executable file
View File

@ -0,0 +1,18 @@
#!/bin/bash
file="$1"
bitrate=15000000
aspect_ratio=4:3
overscan_percent=10
final_height=720
final_width=960
# non-editable part
render_width=$((($final_width * (100-$overscan_percent))/100))
render_height=$((($final_height * (100-$overscan_percent))/100))
# announce
echo "Rendering as $render_width x $render_height encoding to $final_width x $final_height"
# go
ffmpeg -i "$file" -acodec aac -ab 384000 -vcodec libx264 -pix_fmt yuv420p -vsync vfr -bsf:a aac_adtstoasc -vf "scale=$render_width:$render_height,pad=width=$final_width:height=$final_height:"'x=(ow-iw)/2:y=(oh-ih)/2' -vb "$bitrate" -minrate "$bitrate" -maxrate "$bitrate" -bufsize 8000000 -g 15 -bf 2 -threads 0 -aspect "$aspect_ratio" -y -f mp4 "$file.mp4" || exit 1

15
build
View File

@ -1,4 +1,19 @@
#!/bin/bash
# I'm sick and tired of all the churn the three versions of autoconf
# are causing in this repo. Stop committing the configure scripts
# and just autoregen.
./autogen.sh || exit 1
# fix
chmod +x vs2015/sdl/build-scripts/strip_fPIC.sh
# prefer to compile against our own copy of SDL 1.x
echo Compiling our internal SDL 1.x
(cd vs2015/sdl && ./build-dosbox.sh) || exit 1
# now compile ourself
echo Compiling DOSBox-X
chmod +x configure
./configure --enable-core-inline --disable-debug --enable-avcodec --prefix=/usr || exit 1
make -j3 || exit 1

View File

@ -1,4 +1,19 @@
#!/bin/bash
# I'm sick and tired of all the churn the three versions of autoconf
# are causing in this repo. Stop committing the configure scripts
# and just autoregen.
./autogen.sh || exit 1
# fix
chmod +x vs2015/sdl/build-scripts/strip_fPIC.sh
# prefer to compile against our own copy of SDL 1.x
echo Compiling our internal SDL 1.x
(cd vs2015/sdl && ./build-dosbox.sh) || exit 1
# now compile ourself
echo Compiling DOSBox-X
chmod +x configure
./configure --enable-core-inline --enable-debug=heavy --enable-avcodec --prefix=/usr || exit 1
make -j3 || exit 1

View File

@ -1,9 +1,24 @@
#!/bin/bash
# I'm sick and tired of all the churn the three versions of autoconf
# are causing in this repo. Stop committing the configure scripts
# and just autoregen.
./autogen.sh || exit 1
# fix
chmod +x vs2015/sdl/build-scripts/strip_fPIC.sh
chmod +x configure
export CFLAGS="$CFLAGS -g3 -O0 -fno-inline -fno-omit-frame-pointer"
export CXXFLAGS="$CXXFLAGS -g3 -O0 -fno-inline -fno-omit-frame-pointer"
# prefer to compile against our own copy of SDL 1.x
echo Compiling our internal SDL 1.x
(cd vs2015/sdl && ./build-dosbox.sh) || exit 1
# now compile ourself
echo Compiling DOSBox-X
# NTS: --disable-dynamic-core is needed. the dynamic core doesn't work properly with the CFLAGS given above
./configure --enable-core-inline --enable-debug=heavy --prefix=/usr --disable-dynamic-core || exit 1
make -j3 || exit 1

View File

@ -1,4 +1,13 @@
#!/bin/bash
# I'm sick and tired of all the churn the three versions of autoconf
# are causing in this repo. Stop committing the configure scripts
# and just autoregen.
./autogen.sh || exit 1
# fix
chmod +x vs2015/sdl/build-scripts/strip_fPIC.sh
chmod +x configure
export CFLAGS="$CFLAGS -g3 -O0 -fno-inline -fno-omit-frame-pointer"

View File

@ -1,4 +1,19 @@
#!/bin/bash
# I'm sick and tired of all the churn the three versions of autoconf
# are causing in this repo. Stop committing the configure scripts
# and just autoregen.
./autogen.sh || exit 1
# fix
chmod +x vs2015/sdl/build-scripts/strip_fPIC.sh
# prefer to compile against our own copy of SDL 1.x
echo Compiling our internal SDL 1.x
(cd vs2015/sdl && ./build-dosbox.sh) || exit 1
# now compile ourself
echo Compiling DOSBox-X
chmod +x configure
./configure --enable-core-inline --enable-debug=heavy --prefix=/usr || exit 1
make -j3 || exit 1

View File

@ -1,4 +1,19 @@
#!/bin/bash
# I'm sick and tired of all the churn the three versions of autoconf
# are causing in this repo. Stop committing the configure scripts
# and just autoregen.
./autogen.sh || exit 1
# fix
chmod +x vs2015/sdl/build-scripts/strip_fPIC.sh
# prefer to compile against our own copy of SDL 1.x
echo Compiling our internal SDL 1.x
(cd vs2015/sdl && ./build-dosbox.sh) || exit 1
# now compile ourself
echo Compiling DOSBox-X
chmod +x configure
./configure --enable-core-inline --enable-debug=heavy --enable-avcodec --prefix=/usr --disable-mt32 || exit 1
make -j3 || exit 1

View File

@ -1,4 +1,20 @@
#!/bin/bash
# I'm sick and tired of all the churn the three versions of autoconf
# are causing in this repo. Stop committing the configure scripts
# and just autoregen.
./autogen.sh || exit 1
# fix
chmod +x vs2015/sdl/build-scripts/strip_fPIC.sh
# prefer to compile against our own copy of SDL 2.x IF the system does not provide one
x=`which sdl2-config`
if test -z "$x" ; then
echo Compiling our internal SDL 2.x
(cd vs2015/sdl2 && ./build-dosbox.sh) || exit 1
fi
chmod +x configure
./configure --enable-core-inline --enable-debug=heavy --enable-avcodec --prefix=/usr --enable-sdl2 || exit 1
make -j3 || exit 1

44
build-macosx Executable file
View File

@ -0,0 +1,44 @@
#!/bin/bash
# I'm sick and tired of all the churn the three versions of autoconf
# are causing in this repo. Stop committing the configure scripts
# and just autoregen.
./autogen.sh || exit 1
# where are we?
top=`pwd`
if test -z "$top" ; then exit 1; fi
# fix
chmod +x vs2015/sdl/build-scripts/strip_fPIC.sh
# prefer to compile against our own copy of SDL 1.x
echo Compiling our internal SDL 1.x
(cd vs2015/sdl && ./build-dosbox.sh) || exit 1
# perfer to compile against our own zlib
echo Compiling our internal zlib
(cd vs2015/zlib && ./build-dosbox.sh) || exit 1
new="-I$top/vs2015/zlib/linux-host/include "
nld="-L$top/vs2015/zlib/linux-host/lib "
export CFLAGS="$new$CFLAGS"
export LDFLAGS="$nld$LDFLAGS"
export CPPFLAGS="$new$CPPFLAGS"
export CXXFLAGS="$new$CXXFLAGS"
# perfer to compile against our own libpng (comment this out to disable)
echo Compiling our internal libpng
(cd vs2015/libpng && ./build-dosbox.sh) || exit 1
new="-I$top/vs2015/libpng/linux-host/include "
nld="-L$top/vs2015/libpng/linux-host/lib "
export CFLAGS="$new$CFLAGS"
export LDFLAGS="$nld$LDFLAGS"
export CPPFLAGS="$new$CPPFLAGS"
export CXXFLAGS="$new$CXXFLAGS"
# now compile ourself
echo Compiling DOSBox-X
chmod +x configure
./configure --enable-core-inline --enable-debug=heavy --enable-avcodec --prefix=/usr || exit 1
make -j3 || exit 1

47
build-macosx-sdl2 Executable file
View File

@ -0,0 +1,47 @@
#!/bin/bash
# I'm sick and tired of all the churn the three versions of autoconf
# are causing in this repo. Stop committing the configure scripts
# and just autoregen.
./autogen.sh || exit 1
# where are we?
top=`pwd`
if test -z "$top" ; then exit 1; fi
# fix
chmod +x vs2015/sdl/build-scripts/strip_fPIC.sh
# prefer to compile against our own copy of SDL 2.x IF the system does not provide one
x=`which sdl2-config`
if test -z "$x" ; then
echo Compiling our internal SDL 2.x
(cd vs2015/sdl2 && ./build-dosbox.sh) || exit 1
fi
# perfer to compile against our own zlib
echo Compiling our internal zlib
(cd vs2015/zlib && ./build-dosbox.sh) || exit 1
new="-I$top/vs2015/zlib/linux-host/include "
nld="-L$top/vs2015/zlib/linux-host/lib "
export CFLAGS="$new$CFLAGS"
export LDFLAGS="$nld$LDFLAGS"
export CPPFLAGS="$new$CPPFLAGS"
export CXXFLAGS="$new$CXXFLAGS"
# perfer to compile against our own libpng (comment this out to disable)
echo Compiling our internal libpng
(cd vs2015/libpng && ./build-dosbox.sh) || exit 1
new="-I$top/vs2015/libpng/linux-host/include "
nld="-L$top/vs2015/libpng/linux-host/lib "
export CFLAGS="$new$CFLAGS"
export LDFLAGS="$nld$LDFLAGS"
export CPPFLAGS="$new$CPPFLAGS"
export CXXFLAGS="$new$CXXFLAGS"
# now compile ourself
echo Compiling DOSBox-X
chmod +x configure
./configure --enable-core-inline --enable-debug=heavy --enable-avcodec --prefix=/usr --enable-sdl2 || exit 1
make -j3 || exit 1

48
build-mingw Normal file
View File

@ -0,0 +1,48 @@
#!/bin/bash
# I'm sick and tired of all the churn the three versions of autoconf
# are causing in this repo. Stop committing the configure scripts
# and just autoregen.
./autogen.sh || exit 1
# where are we?
top=`pwd`
if test -z "$top" ; then exit 1; fi
# fix
chmod +x vs2015/sdl/build-scripts/strip_fPIC.sh
# prefer to compile against our own copy of SDL 1.x
echo Compiling our internal SDL 1.x
(cd vs2015/sdl && ./build-dosbox.sh) || exit 1
# NTS: MinGW provides zlib for us
if false; then
# perfer to compile against our own zlib
echo Compiling our internal zlib
(cd vs2015/zlib && ./build-dosbox.sh) || exit 1
new="-I$top/vs2015/zlib/linux-host/include "
nld="-L$top/vs2015/zlib/linux-host/lib "
export CFLAGS="$new$CFLAGS"
export LDFLAGS="$nld$LDFLAGS"
export CPPFLAGS="$new$CPPFLAGS"
export CXXFLAGS="$new$CXXFLAGS"
fi
# perfer to compile against our own libpng (comment this out to disable)
echo Compiling our internal libpng
(cd vs2015/libpng && ./build-dosbox.sh) || exit 1
new="-I$top/vs2015/libpng/linux-host/include "
nld="-L$top/vs2015/libpng/linux-host/lib "
export CFLAGS="$new$CFLAGS"
export LDFLAGS="$nld$LDFLAGS"
export CPPFLAGS="$new$CPPFLAGS"
export CXXFLAGS="$new$CXXFLAGS"
# now compile ourself
echo Compiling DOSBox-X
chmod +x configure
# FIXME: I would like MinGW builds to enable the debugger, eventually
./configure --enable-core-inline --enable-d3d9 --enable-d3d-shaders --prefix=/usr || exit 1
make -j3 || exit 1

48
build-mingw-hx-dos Normal file
View File

@ -0,0 +1,48 @@
#!/bin/bash
# I'm sick and tired of all the churn the three versions of autoconf
# are causing in this repo. Stop committing the configure scripts
# and just autoregen.
./autogen.sh || exit 1
# where are we?
top=`pwd`
if test -z "$top" ; then exit 1; fi
# fix
chmod +x vs2015/sdl/build-scripts/strip_fPIC.sh
# prefer to compile against our own copy of SDL 1.x
echo Compiling our internal SDL 1.x
(cd vs2015/sdl && ./build-dosbox.sh hx-dos) || exit 1
# NTS: MinGW provides zlib for us
if false; then
# perfer to compile against our own zlib
echo Compiling our internal zlib
(cd vs2015/zlib && ./build-dosbox.sh) || exit 1
new="-I$top/vs2015/zlib/linux-host/include "
nld="-L$top/vs2015/zlib/linux-host/lib "
export CFLAGS="$new$CFLAGS"
export LDFLAGS="$nld$LDFLAGS"
export CPPFLAGS="$new$CPPFLAGS"
export CXXFLAGS="$new$CXXFLAGS"
fi
# perfer to compile against our own libpng (comment this out to disable)
echo Compiling our internal libpng
(cd vs2015/libpng && ./build-dosbox.sh) || exit 1
new="-I$top/vs2015/libpng/linux-host/include "
nld="-L$top/vs2015/libpng/linux-host/lib "
export CFLAGS="$new$CFLAGS"
export LDFLAGS="$nld$LDFLAGS"
export CPPFLAGS="$new$CPPFLAGS"
export CXXFLAGS="$new$CXXFLAGS"
# now compile ourself
echo Compiling DOSBox-X
chmod +x configure
# FIXME: I would like MinGW builds to enable the debugger, eventually
./configure --enable-core-inline --disable-mt32 --disable-opengl --enable-hx-dos --prefix=/usr || exit 1
make -j3 || exit 1

48
build-mingw-lowend Normal file
View File

@ -0,0 +1,48 @@
#!/bin/bash
# I'm sick and tired of all the churn the three versions of autoconf
# are causing in this repo. Stop committing the configure scripts
# and just autoregen.
./autogen.sh || exit 1
# where are we?
top=`pwd`
if test -z "$top" ; then exit 1; fi
# fix
chmod +x vs2015/sdl/build-scripts/strip_fPIC.sh
# prefer to compile against our own copy of SDL 1.x
echo Compiling our internal SDL 1.x
(cd vs2015/sdl && ./build-dosbox.sh) || exit 1
# NTS: MinGW provides zlib for us
if false; then
# perfer to compile against our own zlib
echo Compiling our internal zlib
(cd vs2015/zlib && ./build-dosbox.sh) || exit 1
new="-I$top/vs2015/zlib/linux-host/include "
nld="-L$top/vs2015/zlib/linux-host/lib "
export CFLAGS="$new$CFLAGS"
export LDFLAGS="$nld$LDFLAGS"
export CPPFLAGS="$new$CPPFLAGS"
export CXXFLAGS="$new$CXXFLAGS"
fi
# perfer to compile against our own libpng (comment this out to disable)
echo Compiling our internal libpng
(cd vs2015/libpng && ./build-dosbox.sh) || exit 1
new="-I$top/vs2015/libpng/linux-host/include "
nld="-L$top/vs2015/libpng/linux-host/lib "
export CFLAGS="$new$CFLAGS"
export LDFLAGS="$nld$LDFLAGS"
export CPPFLAGS="$new$CPPFLAGS"
export CXXFLAGS="$new$CXXFLAGS"
# now compile ourself
echo Compiling DOSBox-X
chmod +x configure
# FIXME: I would like MinGW builds to enable the debugger, eventually
./configure --enable-core-inline --disable-mt32 --prefix=/usr || exit 1
make -j3 || exit 1

51
build-mingw-sdl2 Normal file
View File

@ -0,0 +1,51 @@
#!/bin/bash
# I'm sick and tired of all the churn the three versions of autoconf
# are causing in this repo. Stop committing the configure scripts
# and just autoregen.
./autogen.sh || exit 1
# where are we?
top=`pwd`
if test -z "$top" ; then exit 1; fi
# fix
chmod +x vs2015/sdl/build-scripts/strip_fPIC.sh
# prefer to compile against our own copy of SDL 2.x IF the system does not provide one
x=`which sdl2-config`
if test -z "$x" ; then
echo Compiling our internal SDL 2.x
(cd vs2015/sdl2 && ./build-dosbox.sh) || exit 1
fi
# NTS: MinGW provides zlib for us
if false; then
# perfer to compile against our own zlib
echo Compiling our internal zlib
(cd vs2015/zlib && ./build-dosbox.sh) || exit 1
new="-I$top/vs2015/zlib/linux-host/include "
nld="-L$top/vs2015/zlib/linux-host/lib "
export CFLAGS="$new$CFLAGS"
export LDFLAGS="$nld$LDFLAGS"
export CPPFLAGS="$new$CPPFLAGS"
export CXXFLAGS="$new$CXXFLAGS"
fi
# perfer to compile against our own libpng (comment this out to disable)
echo Compiling our internal libpng
(cd vs2015/libpng && ./build-dosbox.sh) || exit 1
new="-I$top/vs2015/libpng/linux-host/include "
nld="-L$top/vs2015/libpng/linux-host/lib "
export CFLAGS="$new$CFLAGS"
export LDFLAGS="$nld$LDFLAGS"
export CPPFLAGS="$new$CPPFLAGS"
export CXXFLAGS="$new$CXXFLAGS"
# now compile ourself
echo Compiling DOSBox-X
chmod +x configure
# FIXME: I would like MinGW builds to enable the debugger, eventually
./configure --enable-core-inline --prefix=/usr --enable-sdl2 || exit 1
make -j3 || exit 1

48
build-mingw-sdldraw Normal file
View File

@ -0,0 +1,48 @@
#!/bin/bash
# I'm sick and tired of all the churn the three versions of autoconf
# are causing in this repo. Stop committing the configure scripts
# and just autoregen.
./autogen.sh || exit 1
# where are we?
top=`pwd`
if test -z "$top" ; then exit 1; fi
# fix
chmod +x vs2015/sdl/build-scripts/strip_fPIC.sh
# prefer to compile against our own copy of SDL 1.x
echo Compiling our internal SDL 1.x
(cd vs2015/sdl && ./build-dosbox.sh) || exit 1
# NTS: MinGW provides zlib for us
if false; then
# perfer to compile against our own zlib
echo Compiling our internal zlib
(cd vs2015/zlib && ./build-dosbox.sh) || exit 1
new="-I$top/vs2015/zlib/linux-host/include "
nld="-L$top/vs2015/zlib/linux-host/lib "
export CFLAGS="$new$CFLAGS"
export LDFLAGS="$nld$LDFLAGS"
export CPPFLAGS="$new$CPPFLAGS"
export CXXFLAGS="$new$CXXFLAGS"
fi
# perfer to compile against our own libpng (comment this out to disable)
echo Compiling our internal libpng
(cd vs2015/libpng && ./build-dosbox.sh) || exit 1
new="-I$top/vs2015/libpng/linux-host/include "
nld="-L$top/vs2015/libpng/linux-host/lib "
export CFLAGS="$new$CFLAGS"
export LDFLAGS="$nld$LDFLAGS"
export CPPFLAGS="$new$CPPFLAGS"
export CXXFLAGS="$new$CXXFLAGS"
# now compile ourself
echo Compiling DOSBox-X
chmod +x configure
# FIXME: I would like MinGW builds to enable the debugger, eventually
./configure --enable-core-inline --enable-force-menu-sdldraw --enable-d3d9 --enable-d3d-shaders --prefix=/usr || exit 1
make -j3 || exit 1

View File

@ -0,0 +1,8 @@
@echo off
pushd
cd vs2015
set SDL1AdditionalOptions=/DSDL_JOYSTICK_XINPUT
msbuild dosbox-x.sln /p:Configuration=Release /p:Platform=Win32
msbuild dosbox-x.sln /p:Configuration=Release /p:Platform=x64
set SDL1AdditionalOptions=
popd

View File

@ -1,3 +1,5 @@
/* modified for CMake build */
/* config.h.in. Generated from configure.ac by autoheader. */
@ -21,93 +23,91 @@
/* Define if building universal (internal helper macro) */
#undef AC_APPLE_UNIVERSAL_BUILD
#cmakedefine AC_APPLE_UNIVERSAL_BUILD @AC_APPLE_UNIVERSAL_BUILD@
/* Compiling on BSD */
#undef BSD
#cmakedefine BSD @BSD@
/* Determines if the compilers supports always_inline attribute. */
#undef C_ATTRIBUTE_ALWAYS_INLINE
#cmakedefine C_ATTRIBUTE_ALWAYS_INLINE @C_ATTRIBUTE_ALWAYS_INLINE@
/* Determines if the compilers supports fastcall attribute. */
#undef C_ATTRIBUTE_FASTCALL
#cmakedefine C_ATTRIBUTE_FASTCALL @C_ATTRIBUTE_FASTCALL@
/* Define to 1 to use FFMPEG libavcodec for video capture */
#undef C_AVCODEC
#cmakedefine C_AVCODEC @C_AVCODEC@
/* Define to 1 to use inlined memory functions in cpu core */
#undef C_CORE_INLINE
#cmakedefine C_CORE_INLINE @C_CORE_INLINE@
/* Define to 1 to enable internal debugger, requires libcurses */
#undef C_DEBUG
#cmakedefine C_DEBUG @C_DEBUG@
/* Define to 1 if you want parallel passthrough support (Win32, Linux). */
#undef C_DIRECTLPT
#cmakedefine C_DIRECTLPT @C_DIRECTLPT@
/* Define to 1 if you want serial passthrough support (Win32, Posix and OS/2).
*/
#undef C_DIRECTSERIAL
/* Define to 1 if you want serial passthrough support (Win32, Posix and OS/2). */
#cmakedefine C_DIRECTSERIAL @C_DIRECTSERIAL@
/* Define to 1 to use x86 dynamic cpu core */
#undef C_DYNAMIC_X86
#cmakedefine C_DYNAMIC_X86 @C_DYNAMIC_X86@
/* Define to 1 to enable fluidsynth MIDI synthesis */
#undef C_FLUIDSYNTH
#cmakedefine C_FLUIDSYNTH @C_FLUIDSYNTH@
/* Define to 1 to enable floating point emulation */
#undef C_FPU
#cmakedefine C_FPU @C_FPU@
/* Determines if the compilers supports attributes for structures. */
#undef C_HAS_ATTRIBUTE
#cmakedefine HAVE___ATTRIBUTE__ @HAVE___ATTRIBUTE__@
/* Determines if the compilers supports __builtin_expect for branch
prediction. */
#undef C_HAS_BUILTIN_EXPECT
/* Determines if the compilers supports __builtin_expect for branch prediction. */
#cmakedefine HAVE___BUILTIN_EXPECT
/* Define to 1 if you have the mprotect function */
#undef C_HAVE_MPROTECT
#cmakedefine C_HAVE_MPROTECT @C_HAVE_MPROTECT@
/* Define to 1 to enable heavy debugging, also have to enable C_DEBUG */
#undef C_HEAVY_DEBUG
#cmakedefine C_HEAVY_DEBUG @C_HEAVY_DEBUG@
/* Define to 1 to enable IPX over Internet networking, requires SDL_net */
#undef C_IPX
#cmakedefine C_IPX @C_IPX@
/* Define to 1 if you have libpng */
#undef C_LIBPNG
#cmakedefine C_LIBPNG @C_LIBPNG@
/* Define to 1 to enable internal modem support, requires SDL_net */
#undef C_MODEM
#cmakedefine C_MODEM @C_MODEM@
/* Define to 1 to enable MT32 emulation (x86/x86_64 only) */
#undef C_MT32
#cmakedefine C_MT32 @C_MT32@
/* Define to 1 to enable NE2000 ethernet passthrough, requires libpcap */
#undef C_NE2000
#cmakedefine C_NE2000 @C_NE2000@
/* Define to 1 to use opengl display output support */
#undef C_OPENGL
#cmakedefine C_OPENGL @C_OPENGL@
/* Set to 1 to enable SDL 1.x support */
#undef C_SDL1
#cmakedefine C_SDL1 @C_SDL1@
/* Set to 1 to enable SDL 2.x support */
#undef C_SDL2
#cmakedefine C_SDL2 @C_SDL2@
/* Indicate whether SDL_net is present */
#undef C_SDL_NET
#cmakedefine C_SDL_NET @C_SDL_NET@
/* Define to 1 if you have setpriority support */
#undef C_SET_PRIORITY
#cmakedefine C_SET_PRIORITY @C_SET_PRIORITY@
/* Define to 1 to enable screenshots, requires libpng */
#undef C_SSHOT
#cmakedefine C_SSHOT @C_SSHOT@
/* The type of cpu this target has */
#undef C_TARGETCPU
/* Define to 1 to use a unaligned memory access */
#undef C_UNALIGNED_MEMORY
#cmakedefine C_UNALIGNED_MEMORY @C_UNALIGNED_MEMORY@
/* define to 1 if you have XKBlib.h and X11 lib */
#undef C_X11_XKB
@ -128,43 +128,43 @@
#undef HAVE_ALSA
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
#cmakedefine HAVE_INTTYPES_H @HAVE_INTTYPES_H@
/* Define to 1 if you have the `asound' library (-lasound). */
#undef HAVE_LIBASOUND
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
#cmakedefine HAVE_MEMORY_H @HAVE_INTTYPES_H@
/* Define to 1 if you have the <netinet/in.h> header file. */
#undef HAVE_NETINET_IN_H
#cmakedefine HAVE_NETINET_IN_H @HAVE_NETINET_IN_H@
/* Define to 1 if you have the <pwd.h> header file. */
#undef HAVE_PWD_H
#cmakedefine HAVE_PWD_H @HAVE_PWD_H@
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
#cmakedefine HAVE_STDINT_H @HAVE_STDINT_H@
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
#cmakedefine HAVE_STDLIB_H @HAVE_STDLIB_H@
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
#cmakedefine HAVE_STRINGS_H @HAVE_STRINGS_H@
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
#cmakedefine HAVE_STRING_H @HAVE_STRING_H@
/* Define to 1 if you have the <sys/socket.h> header file. */
#undef HAVE_SYS_SOCKET_H
#cmakedefine HAVE_SYS_SOCKET_H @HAVE_SYS_SOCKET_H@
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
#cmakedefine HAVE_SYS_STAT_H @HAVE_SYS_STAT_H@
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
#cmakedefine HAVE_SYS_TYPES_H @HAVE_SYS_TYPES_H@
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
#cmakedefine HAVE_UNISTD_H @HAVE_UNISTD_H@
/* Compiling on GNU/Linux */
#undef LINUX
@ -176,43 +176,43 @@
#undef OS2
/* Name of package */
#undef PACKAGE
#define PACKAGE "dosbox-x"
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
#cmakedefine PACKAGE_BUGREPORT "@PACKAGE_BUGREPORT@"
/* Define to the full name of this package. */
#undef PACKAGE_NAME
#cmakedefine PACKAGE_NAME "@PACKAGE_NAME@"
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
#cmakedefine PACKAGE_STRING "@PACKAGE_STRING@"
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
#cmakedefine PACKAGE_TARNAME "@PACKAGE_TARNAME@"
/* Define to the home page for this package. */
#undef PACKAGE_URL
#cmakedefine PACKAGE_URL "@PACKAGE_URL@"
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* The size of `int *', as computed by sizeof. */
#undef SIZEOF_INT_P
#cmakedefine PACKAGE_VERSION "@PACKAGE_VERSION@"
/* The size of `unsigned char', as computed by sizeof. */
#undef SIZEOF_UNSIGNED_CHAR
/* The size of `unsigned int', as computed by sizeof. */
#undef SIZEOF_UNSIGNED_INT
/* The size of `unsigned long', as computed by sizeof. */
#undef SIZEOF_UNSIGNED_LONG
/* The size of `unsigned long long', as computed by sizeof. */
#undef SIZEOF_UNSIGNED_LONG_LONG
#cmakedefine SIZEOF_UNSIGNED_CHAR @SIZEOF_UNSIGNED_CHAR@
/* The size of `unsigned short', as computed by sizeof. */
#undef SIZEOF_UNSIGNED_SHORT
#cmakedefine SIZEOF_UNSIGNED_SHORT @SIZEOF_UNSIGNED_SHORT@
/* The size of `unsigned int', as computed by sizeof. */
#cmakedefine SIZEOF_UNSIGNED_INT @SIZEOF_UNSIGNED_INT@
/* The size of `unsigned long', as computed by sizeof. */
#cmakedefine SIZEOF_UNSIGNED_LONG @SIZEOF_UNSIGNED_LONG@
/* The size of `unsigned long long', as computed by sizeof. */
#cmakedefine SIZEOF_UNSIGNED_LONG_LONG @SIZEOF_UNSIGNED_LONG_LONG@
/* The size of `int *', as computed by sizeof. */
#cmakedefine SIZEOF_INT_P @SIZEOF_INT_P@
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
@ -221,7 +221,7 @@
#undef TM_IN_SYS_TIME
/* Version number of package */
#undef VERSION
#cmakedefine VERSION "@VERSION@"
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */
@ -241,7 +241,7 @@
#endif
/* Number of bits in a file offset, on hosts where this is settable. */
#undef _FILE_OFFSET_BITS
#cmakedefine _FILE_OFFSET_BITS @_FILE_OFFSET_BITS@
/* Define for large files, on AIX-style hosts. */
#undef _LARGE_FILES

View File

@ -1,5 +1,5 @@
dnl Init.
AC_INIT(dosbox-x,0.82,[https://github.com/joncampbell123/dosbox-x/issues],[],[http://dosbox-x.software])
AC_INIT(dosbox-x,0.82.9,[https://github.com/joncampbell123/dosbox-x/issues],[],[http://dosbox-x.software])
AC_PREREQ(2.60)
AC_CONFIG_SRCDIR(README)
@ -61,6 +61,7 @@ AC_PROG_MAKE_SET
AC_PROG_CC
AC_PROG_CPP
AC_PROG_CXX
AC_PROG_OBJCXX
AC_PROG_INSTALL
AC_PROG_RANLIB
AC_PREFIX_DEFAULT([/usr/local])
@ -119,10 +120,68 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([
#endif
])],[],[AC_DEFINE([socklen_t],[int],[Define to `int` if you don't have socklen_t])])
dnl C++0x is now considered deprecated.
dnl This warning will stay here for a long enough period of time before making C++11 mandatory.
dnl AC_CHECK_CXXFLAGS will prepend gnu++11 to CXXFLAGS if supported, for us.
dnl our code adds -std=gnu++0x if not supported where the function would not do anything.
dnl This code checks the CXX flags but does not keep the changes because AC_CHECK_CXXFLAGS
dnl also adds it to CPPFLAGS which then also affects the C compilation (with warnings like
dnl "-std=gnu++11 is not valid for C")
OLDCFLAGS="$CFLAGS"
OLDCPPFLAGS="$CPPFLAGS"
OLDCXXFLAGS="$CXXFLAGS"
AC_MSG_CHECKING([checking for C++11 support])
AC_CHECK_CXXFLAGS([ -std=gnu++11 ], [ ], [ CXXFLAGS="$CXXFLAGS -std=gnu++0x" ])
AC_CHECK_CXXFLAGS([ -std=gnu++11 ], [ ], [
warn_cpp0x=1
])
CXXFLAGS="$OLDCXXFLAGS"
CPPFLAGS="$OLDCPPFLAGS"
CFLAGS="$OLDCFLAGS"
if test x$warn_cpp0x = x1; then
AC_MSG_ERROR([ Your compiler must support C++11 or better ])
fi
CFLAGS="$CFLAGS -std=gnu11";
CXXFLAGS="$CXXFLAGS -std=gnu++0x";
dnl yksoft1 wants a MinGW build for Windows that doesn't use the Windows menu system.
AH_TEMPLATE(C_FORCE_MENU_SDLDRAW,[Define to 1 to force SDL-drawn menus])
AC_ARG_ENABLE(force-menu-sdldraw,AC_HELP_STRING([--enable-force-menu-sdldraw],[Force SDL drawn menus]),enable_force_menu_sdldraw=yes)
dnl This is how the build script can specify a HX DOS extender target
AH_TEMPLATE(C_HX_DOS,[Define to 1 to target HX DOS])
AC_ARG_ENABLE(hx-dos,AC_HELP_STRING([--enable-hx-dos],[Enable HX target]),enable_hx=yes)
dnl Optimize for speed by default
AC_ARG_ENABLE(optimize,AC_HELP_STRING([--disable-optimize],[Don't enable compiler optimizations]))
dnl FIXME: Remove default "-O2" set by some autotools versions. TODO: check availability of sed.
CFLAGS=["`echo $CFLAGS' ' | sed -e 's/-O[^ ]* //g'`"]
CXXFLAGS=["`echo $CXXFLAGS' ' | sed -e 's/-O[^ ]* //g'`"]
if test x$enable_optimize != xno; then
CFLAGS="$CFLAGS -O2"
CXXFLAGS="$CXXFLAGS -O2"
fi
dnl Some stuff for the icon.
case "$host" in
*-*-cygwin* | *-*-mingw32*)
if test x$enable_hx == xyes; then
CXXFLAGS="$CXXFLAGS -DHX_DOS"
AC_DEFINE(C_HX_DOS,1,[Targeting HX DOS extender])
fi
;;
esac
if test x$enable_force_menu_sdldraw == xyes; then
CXXFLAGS="$CXXFLAGS -DFORCE_SDLDRAW"
AC_DEFINE(C_FORCE_MENU_SDLDRAW,1,[Force SDL drawn menus])
fi
dnl TEST: Environ can be included
AC_MSG_CHECKING(if environ can be included)
@ -215,13 +274,11 @@ case "$host" in
;;
esac
dnl Scalars in the code use MMX/SSE intrinsics on x86 and x86_64
dnl Some default CPU flags
case "$host_cpu" in
x86_64 | amd64)
CXXFLAGS="$CXXFLAGS -mmmx -msse -msse2"
;;
i?86)
CXXFLAGS="$CXXFLAGS -mmmx -msse -msse2"
# SSE is part of the x86_64 ABI
CXXFLAGS="$CXXFLAGS -msse"
;;
esac
@ -233,14 +290,39 @@ if test x$host = xi386-pc-os2-emx ; then
LIBS="$LIBS -los2me"
fi
dnl I would like to know of any concerns given by the C++ compiler.
dnl Clang/LLVM already does this to some degree, let's get GCC to do it too.
AC_CHECK_CXXFLAGS([ -Wall ])
AC_CHECK_CXXFLAGS([ -Wextra ])
AC_CHECK_CXXFLAGS([ -pedantic ])
#AC_CHECK_CXXFLAGS([ -Wconversion ]) DO NOT ENABLE. THIS WARNING IS WAY TOO PEDANTIC TO BE USEFUL, EXCEPT FOR SPECIFIC CASES
#AC_CHECK_CXXFLAGS([ -Wsign-conversion ])
AC_CHECK_CXXFLAGS([ -Wconversion-null ])
dnl Let GCC 7.3.x know that the "fall through" switch cases in this codebase
dnl are often intentional.
AC_CHECK_CXXFLAGS([ -Wno-implicit-fallthrough ])
dnl Stop reporting "type punning" warnings, I'm sick of hearing about it.
AC_CHECK_CXXFLAGS([ -Wno-strict-aliasing ])
dnl other
AC_CHECK_CXXFLAGS([ -Wno-missing-field-initializers ])
AC_CHECK_CXXFLAGS([ -Wno-format-zero-length ])
dnl Clang/LLVM warning: don't care the address of a member may be unaligned, unless targeting ARM!
AC_CHECK_CXXFLAGS([ -Wno-address-of-packed-member ])
dnl Clang/LLVM warning: don't care about int to void*, since void* is either same size or larger
AC_CHECK_CXXFLAGS([ -Wno-int-to-void-pointer-cast ])
dnl Clang/LLVM warning: extended field designator
AC_CHECK_CXXFLAGS([ -Wno-extended-offsetof ])
dnl Some stuff for the icon.
case "$host" in
*-*-cygwin* | *-*-mingw32*)
dnl Some stuff for the ico
AC_CHECK_TOOL(WINDRES, windres, :)
LDFLAGS="-static -static-libgcc -static-libstdc++ $LDFLAGS"
;;
*)
WINDRES=":"
@ -257,18 +339,24 @@ case "$host" in
if test x$have_sdl_net_lib = xyes -a x$have_sdl_net_h = xyes ; then
LIBS="$LIBS -lws2_32"
fi
dnl FEATURE: Whether to support direct parallel port passthrough
AC_DEFINE(C_DIRECTLPT, 1, [ Define to 1 if you want parallel passthrough support (Win32, Linux).])
;;
*-*-darwin*)
dnl We have a problem here: both Mac OS X and Darwin report
dnl the same signature "powerpc-apple-darwin*" - so we have
dnl to do more to distinguish them.
dnl For now I am lazy and do not add proper detection code.
macosx=1
OBJCXXFLAGS="$OBJCXXFLAGS -std=gnu++0x";
AC_DEFINE(MACOSX, 1, [Compiling on Mac OS X])
LIBS="$LIBS -framework CoreMIDI -framework AudioUnit -framework AudioToolbox"
;;
*-*-linux*)
AC_DEFINE(LINUX, 1, [Compiling on GNU/Linux])
CXXFLAGS="$CXXFLAGS -D_XOPEN_SOURCE=700 -D_POSIX_C_SOURCE=200809L"
dnl FEATURE: Whether to support direct parallel port passthrough
AC_DEFINE(C_DIRECTLPT, 1, [ Define to 1 if you want parallel passthrough support (Win32, Linux).])
;;
*-*-freebsd* | *-*-dragonfly* | *-*-netbsd* | *-*-openbsd*)
dnl Disabled directserial for now. It doesn't do anything without
@ -283,6 +371,8 @@ case "$host" in
;;
esac
AM_CONDITIONAL(MACOSX, test x"$macosx" == x"1")
dnl The target cpu checks for dynamic cores
AH_TEMPLATE(C_TARGETCPU,[The type of cpu this target has])
AC_MSG_CHECKING(for target cpu type)
@ -344,11 +434,34 @@ else
fi
fi
dnl Some stuff for the icon.
case "$host" in
*-*-cygwin* | *-*-mingw32*)
dnl MinGW puts ncurses headers in a subdir
ncursescfg=`ncursesw6-config --cflags`
CXXFLAGS="$CXXFLAGS $ncursescfg"
CPPFLAGS="$CPPFLAGS $ncursescfg"
CFLAGS="$CFLAGS $ncursescfg"
;;
*)
WINDRES=":"
;;
esac
dnl LIBRARY TEST: ncurses
AC_CHECK_HEADER(curses.h,have_curses_h=yes,)
AC_CHECK_LIB(curses, initscr, have_curses_lib=yes, , )
AC_CHECK_LIB(ncurses, initscr, have_ncurses_lib=yes, , )
AC_CHECK_LIB(pdcurses, initscr, have_pdcurses_lib=yes, , )
# Check if this system's ncurses uses a separate tinfo library
AC_CHECK_LIB(tinfo, nodelay,
if test x$have_ncurses_lib = xyes ; then
LIBS="$LIBS -ltinfo";
fi)
dnl LIBRARY TEST: libzlib
AC_CHECK_HEADER(zlib.h,have_zlib_h=yes,)
AC_CHECK_LIB(z, inflateEnd, have_zlib_lib=yes, ,)
dnl LIBRARY TEST: libpng
AC_CHECK_HEADER(png.h,have_png_h=yes,)
@ -368,7 +481,7 @@ AC_CHECK_HEADER(X11/XKBlib.h, have_x11_h=yes, have_x11_h=no, )
dnl LIBRARY TEST: Fluidsynth support
AC_CHECK_HEADER(fluidsynth.h,have_fluidsynth_h=yes,)
AC_CHECK_LIB(fluidsynth, new_fluid_synth, have_fluidsynth_lib=yes,,)
AC_CHECK_LIB(fluidsynth, fluid_synth_sysex, have_fluidsynth_lib=yes,,)
dnl LIBRARY TEST: FFMPEG support
AC_CHECK_LIB(avcodec,avcodec_open2,have_ffmpeg=yes,have_ffmpeg=no,)
@ -379,6 +492,10 @@ AC_CHECK_LIB(GL, main, have_gl_lib=yes, have_gl_lib=no , )
AC_CHECK_LIB(opengl32, main, have_opengl32_lib=yes,have_opengl32_lib=no , )
AC_CHECK_HEADER(GL/gl.h, have_gl_h=yes , have_gl_h=no , )
dnl LIBRARY TEST: Direct3D 9 header support
AC_CHECK_HEADER(d3d9.h, have_d3d9_h=yes , have_d3d9_h=no , )
AC_CHECK_HEADER(d3dx9math.h, have_d3dx9math_h=yes , have_d3dx9math_h=no , )
dnl ================== SDL net special test for OS/2
if test x$host = xi386-pc-os2-emx ; then
LIBS_BACKUP=$LIBS;
@ -389,6 +506,14 @@ if test x$host = xi386-pc-os2-emx ; then
LIBS=$LIBS_BACKUP
fi
dnl FEATURE: xBRZ
AH_TEMPLATE(C_XBRZ,[Define to 1 to enable XBRZ scaler])
AC_ARG_ENABLE(xbrz,AC_HELP_STRING([--enable-xbrz],[compile with xBRZ scaler (default yes)]),enable_xbrz=$enableval,enable_xbrz=yes)
AM_CONDITIONAL(C_XBRZ, test "x$enable_xbrz" == "xyes")
if test x$enable_xbrz = xyes; then
AC_DEFINE(C_XBRZ,1)
fi
dnl FEATURE: MIDI through ALSA
AC_ARG_ENABLE(alsa-midi,
AC_HELP_STRING([--enable-alsa-midi],[compile with alsa midi support (default yes)]),
@ -406,21 +531,19 @@ AH_TEMPLATE(C_MT32,[Define to 1 to enable MT32 emulation (x86/x86_64 only)])
AC_ARG_ENABLE(mt32,AC_HELP_STRING([--disable-mt32],[Disable MT32 emulation]),,enable_mt32=yes)
AC_MSG_CHECKING(whether MT32 emulation will be enabled)
# HACK: Don't enable MT32 on SDL2
if test -n "$SDL2_LIBS"; then
enable_mt32=no
fi
# test
# Note that MT32 (MUNT) requires the SSE extensions
if test x$enable_mt32 = xyes ; then
case "$host_cpu" in
x86_64 | amd64)
AC_MSG_RESULT(yes)
AC_DEFINE(C_MT32,1)
CXXFLAGS="$CXXFLAGS -mmmx -msse -msse2"
;;
i?86)
AC_MSG_RESULT(yes)
AC_DEFINE(C_MT32,1)
CXXFLAGS="$CXXFLAGS -mmmx -msse -msse2"
;;
*)
enable_mt32=no
@ -482,8 +605,13 @@ if test x$enable_dynamic_x86 = xno -o x$enable_dynamic_core = xno; then
AC_MSG_RESULT(no)
else
if test x$c_targetcpu = xx86 ; then
AC_DEFINE(C_DYNAMIC_X86,1)
AC_DEFINE(C_DYNAMIC_X86,32)
AC_MSG_RESULT(yes)
elif test x$c_targetcpu = xx86_64 ; then
true
dnl TODO
dnl AC_DEFINE(C_DYNAMIC_X86,64)
dnl AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
@ -514,9 +642,6 @@ fi
dnl FEATURE: Whether to support direct serial port passthrough
AC_DEFINE(C_DIRECTSERIAL, 1, [ Define to 1 if you want serial passthrough support (Win32, Posix and OS/2).])
dnl FEATURE: Whether to support direct parallel port passthrough
AC_DEFINE(C_DIRECTLPT, 1, [ Define to 1 if you want parallel passthrough support (Win32, Linux).])
dnl FEATURE: Whether to support SDL net, and emulate modem and IPX connections
AH_TEMPLATE(C_SDL_NET,[Indicate whether SDL_net is present])
AH_TEMPLATE(C_MODEM,[Define to 1 to enable internal modem support, requires SDL_net])
@ -534,6 +659,13 @@ if test -z "$SDL2_LIBS"; then
fi
fi
dnl FEATURE: Whether to support libz, and enable snapshots
AH_TEMPLATE(C_LIBZ,[Define to 1 if you have libz])
if test x$have_zlib_lib = xyes -a x$have_zlib_h = xyes ; then
LIBS="$LIBS -lz"
AC_DEFINE(C_LIBZ,1)
fi
dnl FEATURE: Whether to support libpng, and enable snapshots
AH_TEMPLATE(C_LIBPNG,[Define to 1 if you have libpng])
AH_TEMPLATE(C_SSHOT,[Define to 1 to enable screenshots, requires libpng])
@ -558,7 +690,7 @@ dnl FEATURE: Whether to use X11 XKBlib
AH_TEMPLATE(C_X11_XKB,[define to 1 if you have XKBlib.h and X11 lib])
AC_MSG_CHECKING(for XKBlib support)
if test x$have_x11_lib = xyes -a x$have_x11_h = xyes ; then
LIBS="$LIBS -lX11"
LIBS="$LIBS -lX11 -lxkbfile"
AC_DEFINE(C_X11_XKB,1)
AC_MSG_RESULT(yes)
else
@ -625,31 +757,78 @@ case "$host" in
esac
fi
dnl FEATURE: Whether to use Direct3D 9 output
AH_TEMPLATE(HAVE_D3D9_H,[Define to 1 to use Direct3D 9 display output support])
AC_ARG_ENABLE(d3d9,AC_HELP_STRING([--enable-d3d9],[Enable Direct3D 9 support]),enable_d3d9=$enableval,enable_d3d9=no)
AC_MSG_CHECKING(whether Direct3D 9 display output will be enabled)
dnl FEATURE: Direct3D9 shaders
AH_TEMPLATE(C_D3DSHADERS,[Define to 1 to use Direct3D shaders])
AC_ARG_ENABLE(d3d-shaders,AC_HELP_STRING([--enable-d3d-shaders],[Enable Direct3D shaders]),enable_d3d_shaders=$enableval,enable_d3d_shaders=no)
# HACK: Don't enable Direct 3D 9 on SDL2
if test -n "$SDL2_LIBS"; then
enable_d3d9=no
enable_d3d_shaders=no
fi
if test x$enable_d3d9 = xyes; then
case "$host" in
*-*-cygwin* | *-*-mingw32*)
if test x$have_d3d9_h = xyes -a x$have_d3dx9math_h = xyes ; then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_D3D9_H,1)
if test x$enable_d3d_shaders = xyes; then
AC_DEFINE(C_D3DSHADERS,1)
fi
else
AC_MSG_RESULT(no)
fi
;;
*)
AC_MSG_RESULT(no)
;;
esac
else
AC_MSG_RESULT(no)
fi
AC_CONFIG_FILES([
Makefile
src/Makefile
src/cpu/Makefile
src/cpu/core_full/Makefile
src/cpu/core_normal/Makefile
src/cpu/core_dyn_x86/Makefile
src/debug/Makefile
src/dos/Makefile
src/fpu/Makefile
src/gui/Makefile
src/mt32/Makefile
src/hardware/Makefile
src/hardware/serialport/Makefile
src/hardware/reSID/Makefile
src/hardware/parport/Makefile
src/aviwriter/Makefile
src/ints/Makefile
src/libs/Makefile
src/libs/zmbv/Makefile
src/libs/gui_tk/Makefile
src/libs/porttalk/Makefile
src/output/Makefile
src/builtin/Makefile
src/misc/Makefile
src/shell/Makefile
src/platform/Makefile
src/xBRZ/Makefile
include/Makefile
dosbox-x.spec
make-rpm.sh
])
AC_OUTPUT
# HACK: it's a script...
chmod +x make-rpm.sh
# HACK: Write all PACKAGE defines to vs2015/config_package.h so Windows builds are kept in sync
grep -E 'PACKAGE|VERSION' config.h >vs2015/config_package.h

View File

@ -0,0 +1,330 @@
http://stanislavs.org/helppc/bios_data_area.html
BDA - BIOS Data Area - PC Memory Map
Address Size Description
00:00 256dwords Interrupt vector table
30:00 256bytes Stack area used during post and bootstrap
40:00 word COM1 port address
40:02 word COM2 port address
40:04 word COM3 port address
40:06 word COM4 port address
40:08 word LPT1 port address
40:0A word LPT2 port address
40:0C word LPT3 port address
40:0E word LPT4 port address (except PS/2)
Extended BIOS Data Area segment (PS/2, see EBDA)
40:10 2 bytes Equipment list flags (see INT 11)
|7|6|5|4|3|2|1|0| 40:10 (value in INT 11 register AL)
| | | | | | | `- IPL diskette installed
| | | | | | `-- math coprocessor
| | | | |-+--- old PC system board RAM < 256K
| | | | | `-- pointing device installed (PS/2)
| | | | `--- not used on PS/2
| | `------ initial video mode
`--------- # of diskette drives, less 1
|7|6|5|4|3|2|1|0| 40:11 (value in INT 11 register AH)
| | | | | | | `- 0 if DMA installed
| | | | `------ number of serial ports
| | | `------- game adapter
| | `-------- not used, internal modem (PS/2)
`----------- number of printer ports
40:12 byte PCjr: infrared keyboard link error count
40:13 word Memory size in Kbytes (see INT 12)
40:15 byte Reserved
40:16 byte PS/2 BIOS control flags
40:17 byte Keyboard flag byte 0 (see KB FLAGS)
|7|6|5|4|3|2|1|0| keyboard flag byte 0
| | | | | | | `--- right shift key depressed
| | | | | | `---- left shift key depressed
| | | | | `----- CTRL key depressed
| | | | `------ ALT key depressed
| | | `------- scroll-lock is active
| | `-------- num-lock is active
| `--------- caps-lock is active
`---------- insert is active
40:18 byte Keyboard flag byte 1 (see KB FLAGS)
|7|6|5|4|3|2|1|0| keyboard flag byte
| | | | | | | `--- left CTRL key depressed
| | | | | | `---- left ALT key depressed
| | | | | `----- system key depressed and held
| | | | `------ suspend key has been toggled
| | | `------- scroll lock key is depressed
| | `-------- num-lock key is depressed
| `--------- caps-lock key is depressed
`---------- insert key is depressed
40:19 byte Storage for alternate keypad entry
40:1A word Offset from 40:00 to keyboard buffer head
40:1C word Offset from 40:00 to keyboard buffer tail
40:1E 32bytes Keyboard buffer (circular queue buffer)
40:3E byte Drive recalibration status
|7|6|5|4|3|2|1|0| drive recalibration status
| | | | | | | `-- 1=recalibrate drive 0
| | | | | | `--- 1=recalibrate drive 1
| | | | | `---- 1=recalibrate drive 2
| | | | `----- 1=recalibrate drive 3
| `---------- unused
`----------- 1=working interrupt flag
40:3F byte Diskette motor status
|7|6|5|4|3|2|1|0| diskette motor status
| | | | | | | `-- 1=drive 0 motor on
| | | | | | `--- 1=drive 1 motor on
| | | | | `---- 1=drive 2 motor on
| | | | `----- 1=drive 3 motor on
| `---------- unused
`----------- 1=write operation
40:40 byte Motor shutoff counter (decremented by INT 8)
40:41 byte Status of last diskette operation (see INT 13,1)
|7|6|5|4|3|2|1|0| status of last diskette operation
| | | | | | | `--- invalid diskette command
| | | | | | `---- diskette address mark not found
| | | | | `----- sector not found
| | | | `------ diskette DMA error
| | | `------- CRC check / data error
| | `-------- diskette controller failure
| `--------- seek to track failed
`---------- diskette time-out
40:42 7 bytes NEC diskette controller status (see FDC)
40:49 byte Current video mode (see VIDEO MODE)
40:4A word Number of screen columns
40:4C word Size of current video regen buffer in bytes
40:4E word Offset of current video page in video regen buffer
40:50 8 words Cursor position of pages 1-8, high order byte=row
low order byte=column; changing this data isn't
reflected immediately on the display
40:60 byte Cursor ending (bottom) scan line (don't modify)
40:61 byte Cursor starting (top) scan line (don't modify)
40:62 byte Active display page number
40:63 word Base port address for active 6845 CRT controller
3B4h = mono, 3D4h = color
40:65 byte 6845 CRT mode control register value (port 3x8h)
EGA/VGA values emulate those of the MDA/CGA
40:66 byte CGA current color palette mask setting (port 3d9h)
EGA and VGA values emulate the CGA
40:67 dword CS:IP for 286 return from protected mode
dword Temp storage for SS:SP during shutdown
dword Day counter on all products after AT
dword PS/2 Pointer to reset code with memory preserved
5 bytes Cassette tape control (before AT)
40:6C dword Daily timer counter, equal to zero at midnight;
incremented by INT 8; read/set by INT 1A
40:70 byte Clock rollover flag, set when 40:6C exceeds 24hrs
40:71 byte BIOS break flag, bit 7 is set if Ctrl-Break was
*ever* hit; set by INT 9
40:72 word Soft reset flag via Ctl-Alt-Del or JMP FFFF:0
1234h Bypass memory tests & CRT initialization
4321h Preserve memory
5678h System suspend
9ABCh Manufacturer test
ABCDh Convertible POST loop
????h many other values are used during POST
40:74 byte Status of last hard disk operation (see INT 13,1)
40:75 byte Number of hard disks attached
40:76 byte XT fixed disk drive control byte
40:77 byte Port offset to current fixed disk adapter
40:78 4 bytes Time-Out value for LPT1,LPT2,LPT3(,LPT4 except PS/2)
40:7C 4 bytes Time-Out value for COM1,COM2,COM3,COM4
40:80 word Keyboard buffer start offset (seg=40h,BIOS 10-27-82)
40:82 word Keyboard buffer end offset (seg=40h,BIOS 10-27-82)
40:84 byte Rows on the screen (less 1, EGA+)
40:85 word Point height of character matrix (EGA+)
byte PCjr: character to be repeated if the typematic
repeat key takes effect
40:86 byte PCjr: initial delay before repeat key action begins
40:87 byte PCjr: current Fn function key number
byte Video mode options (EGA+)
|7|6|5|4|3|2|1|0| Video mode options (EGA+)
| | | | | | | `-- 1=alphanumeric cursor emulation enabled
| | | | | | `--- 1=video subsystem attached to monochrome
| | | | | `---- reserved
| | | | `----- 1=video subsystem is inactive
| | | `------ reserved
| `--------- video RAM 00-64K 10-192K 01-128K 11-256K
`---------- video mode number passed to INT 10, function 0
40:88 byte PCjr: third keyboard status byte
EGA feature bit switches, emulated on VGA
|7|6|5|4|3|2|1|0| EGA feature bit switches (EGA+)
| | | | | | | `-- EGA SW1 config (1=off)
| | | | | | `--- EGA SW2 config (1=off)
| | | | | `---- EGA SW3 config (1=off)
| | | | `----- EGA SW4 config (1=off)
| | | `------ Input FEAT0 (ISR0 bit 5) after output on FCR0
| | `------- Input FEAT0 (ISR0 bit 6) after output on FCR0
| `-------- Input FEAT1 (ISR0 bit 5) after output on FCR1
`--------- Input FEAT1 (ISR0 bit 6) after output on FCR1
40:89 byte Video display data area (MCGA and VGA)
|7|6|5|4|3|2|1|0| Video display data area (MCGA and VGA)
| | | | | | | `-- 1=VGA is active
| | | | | | `--- 1=gray scale is enabled
| | | | | `---- 1=using monochrome monitor
| | | | `----- 1=default palette loading is disabled
| | | `------ see table below
| | `------- reserved
| `-------- 1=display switching enabled
`--------- alphanumeric scan lines (see table below)
Bit7 Bit4 Scan Lines
0 0 350 line mode
0 1 400 line mode
1 0 200 line mode
1 1 reserved
40:8A byte Display Combination Code (DCC) table index (EGA+)
40:8B byte Last diskette data rate selected
|7|6|5|4|3|2|1|0| last diskette data rate selected
| | | | `--------- reserved
| | `------------ last floppy drive step rate selected
`-------------- last floppy data rate selected
Data Rate Step Rate
00 500K bps 00 step rate time of 0C
01 300K bps 01 step rate time of 0D
10 250K bps 10 step rate time of 0A
11 reserved 11 reserved
40:8C byte Hard disk status returned by controller
40:8D byte Hard disk error returned by controller
40:8E byte Hard disk interrupt control flag(bit 7=working int)
40:8F byte Combination hard/floppy disk card when bit 0 set
40:90 4 bytes Drive 0,1,2,3 media state
|7|6|5|4|3|2|1|0| drive media state (4 copies)
| | | | | `------- drive/media state (see below)
| | | | `------- reserved
| | | `------- 1=media/drive established
| | `------- double stepping required
`--------- data rate: 00=500K bps 01=300K bps
10=250K bps 11=reserved
Bits
210 Drive Media State
000 360Kb diskette/360Kb drive not established
001 360Kb diskette/1.2Mb drive not established
010 1.2Mb diskette/1.2Mb drive not established
011 360Kb diskette/360Kb drive established
100 360Kb diskette/1.2Mb drive established
101 1.2Mb diskette/1.2Mb drive established
110 Reserved
111 None of the above
40:94 byte Track currently seeked to on drive 0
40:95 byte Track currently seeked to on drive 1
40:96 byte Keyboard mode/type
|7|6|5|4|3|2|1|0| Keyboard mode/type
| | | | | | | `--- last code was the E1 hidden code
| | | | | | `---- last code was the E0 hidden code
| | | | | `----- right CTRL key depressed
| | | | `------ right ALT key depressed
| | | `------- 101/102 enhanced keyboard installed
| | `-------- force num-lock if Rd ID & KBX
| `--------- last char was first ID char
`---------- read ID in process
40:97 byte Keyboard LED flags
|7|6|5|4|3|2|1|0| Keyboard LED flags
| | | | | | | `--- scroll lock indicator
| | | | | | `---- num-lock indicator
| | | | | `----- caps-lock indicator
| | | | `------ circus system indicator
| | | `------- ACK received
| | `-------- re-send received flag
| `--------- mode indicator update
`---------- keyboard transmit error flag
40:98 dword Pointer to user wait complete flag
40:9C dword User wait Time-Out value in microseconds
40:A0 byte RTC wait function flag
|7|6|5|4|3|2|1|0| INT 15,86 RTC wait function flag
| | | | | | | `--- 1= wait pending
| `-------------- not used
`--------------- 1=INT 15,86 wait time elapsed
40:A1 byte LANA DMA channel flags
40:A2 2 bytes Status of LANA 0,1
40:A4 dword Saved hard disk interrupt vector
40:A8 dword BIOS Video Save/Override Pointer Table address
(see VIDEO TABLES)
40:AC 8 bytes Reserved
40:B4 byte Keyboard NMI control flags (convertible)
40:B5 dword Keyboard break pending flags (convertible)
40:B9 byte Port 60 single byte queue (convertible)
40:BA byte Scan code of last key (convertible)
40:BB byte NMI buffer head pointer (convertible)
40:BC byte NMI buffer tail pointer (convertible)
40:BD 16bytes NMI scan code buffer (convertible)
40:CE word Day counter (convertible and after)
40:F0 16bytes Intra-Applications Communications Area (IBM Technical
Reference incorrectly locates this at 50:F0-50:FF)
Address Size Description (BIOS/DOS Data Area)
50:00 byte Print screen status byte
00 = PrtSc not active,
01 = PrtSc in progress
FF = error
50:01 3 bytes Used by BASIC
50:04 byte DOS single diskette mode flag, 0=A:, 1=B:
50:05 10bytes POST work area
50:0F byte BASIC shell flag; set to 2 if current shell
50:10 word BASICs default DS value (DEF SEG)
50:12 dword Pointer to BASIC INT 1C interrupt handler
50:16 dword Pointer to BASIC INT 23 interrupt handler
50:1A dword Pointer to BASIC INT 24 disk error handler
50:20 word DOS dynamic storage
50:22 14bytes DOS diskette initialization table (INT 1E)
50:30 4bytes MODE command
70:00 I/O drivers from IO.SYS/IBMBIO.COM
The following map varies in size and locus
07C0:0 Boot code is loaded here at startup (31k mark)
A000:0 EGA/VGA RAM for graphics display mode 0Dh & above
B000:0 MDA RAM, Hercules graphics display RAM
B800:0 CGA display RAM
C000:0 EGA/VGA BIOS ROM (thru C7FF)
C400:0 Video adapter ROM space
C600:0 256bytes PGA communication area
C800:0 16K Hard disk adapter BIOS ROM
C800:5 XT Hard disk ROM format, AH=Drive, AL=Interleave
D000:0 32K Cluster adapter BIOS ROM
D800:0 PCjr conventionalsoftware cartridge address
E000:0 64K Expansion ROM space (hardwired on AT+)
128K PS/2 System ROM (thru F000)
F000:0 System monitor ROM
PCjr: software cartridge override address
F400:0 System expansion ROMs
F600:0 IBM ROM BASIC (AT)
F800:0 PCjr software cartridge override address
FC00:0 BIOS ROM
FF00:0 System ROM
FFA6:E ROM graphics character table
FFFF:0 ROM bootstrap code
FFFF:5 8 bytes ROM date (not applicable for all clones)
FFFF:E byte ROM machine id (see MACHINE ID)

View File

@ -1,461 +0,0 @@
# Makefile.in generated by automake 1.13.1 from Makefile.am.
# docs/Makefile. Generated from Makefile.in by configure.
# Copyright (C) 1994-2012 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
# Main Makefile for DOSBox
am__make_dryrun = \
{ \
am__dry=no; \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
*) \
for am__flg in $$MAKEFLAGS; do \
case $$am__flg in \
*=*|--*) ;; \
*n*) am__dry=yes; break;; \
esac; \
done;; \
esac; \
test $$am__dry = yes; \
}
pkgdatadir = $(datadir)/dosbox
pkgincludedir = $(includedir)/dosbox
pkglibdir = $(libdir)/dosbox
pkglibexecdir = $(libexecdir)/dosbox
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = i686-pc-linux-gnu
host_triplet = i686-pc-linux-gnu
subdir = docs
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_$(V))
am__v_P_ = $(am__v_P_$(AM_DEFAULT_VERBOSITY))
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_$(V))
am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_$(V))
am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
am__v_at_0 = @
am__v_at_1 =
SOURCES =
DIST_SOURCES =
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__uninstall_files_from_dir = { \
test -z "$$files" \
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
man1dir = $(mandir)/man1
am__installdirs = "$(DESTDIR)$(man1dir)"
NROFF = nroff
MANS = $(man_MANS)
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = ${SHELL} /usr/src/dosbox-x/missing aclocal-1.13
ALSA_CFLAGS =
ALSA_LIBS = -lasound -lm -ldl -lpthread
AMTAR = $${TAR-tar}
AM_DEFAULT_VERBOSITY = 1
AUTOCONF = ${SHELL} /usr/src/dosbox-x/missing autoconf
AUTOHEADER = ${SHELL} /usr/src/dosbox-x/missing autoheader
AUTOMAKE = ${SHELL} /usr/src/dosbox-x/missing automake-1.13
AWK = gawk
CC = gcc
CCDEPMODE = depmode=gcc3
CFLAGS = -g -O2
CPP = gcc -E
CPPFLAGS = -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT
CXX = g++
CXXCPP =
CXXDEPMODE = depmode=gcc3
CXXFLAGS = -g -O2 -std=gnu++11 -mmmx -msse -msse2
CYGPATH_W = echo
DEFS = -DHAVE_CONFIG_H
DEPDIR = .deps
ECHO_C =
ECHO_N = -n
ECHO_T =
EGREP = /usr/bin/grep -E
EXEEXT =
GREP = /usr/bin/grep
INSTALL = /usr/bin/install -c
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_PROGRAM = ${INSTALL}
INSTALL_SCRIPT = ${INSTALL}
INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
LDFLAGS =
LIBOBJS =
LIBS = -lasound -lm -ldl -lpthread -L/usr/lib -Wl,-rpath,/usr/lib -lSDL -lncurses -lpng -lz -lpcap -lSDL_net -lX11 -lfluidsynth
LTLIBOBJS =
MAKEINFO = ${SHELL} /usr/src/dosbox-x/missing makeinfo
MKDIR_P = /bin/mkdir -p
OBJEXT = o
PACKAGE = dosbox
PACKAGE_BUGREPORT =
PACKAGE_NAME = dosbox
PACKAGE_STRING = dosbox SVN-Daum
PACKAGE_TARNAME = dosbox
PACKAGE_URL =
PACKAGE_VERSION = SVN-Daum
PATH_SEPARATOR = :
RANLIB = ranlib
SDL_CFLAGS = -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT
SDL_CONFIG = /usr/bin/sdl-config
SDL_LIBS = -L/usr/lib -Wl,-rpath,/usr/lib -lSDL -lpthread
SET_MAKE =
SHELL = /bin/sh
STRIP =
VERSION = SVN-Daum
WINDRES = :
abs_builddir = /usr/src/dosbox-x/docs
abs_srcdir = /usr/src/dosbox-x/docs
abs_top_builddir = /usr/src/dosbox-x
abs_top_srcdir = /usr/src/dosbox-x
ac_ct_CC = gcc
ac_ct_CXX = g++
am__include = include
am__leading_dot = .
am__quote =
am__tar = $${TAR-tar} chof - "$$tardir"
am__untar = $${TAR-tar} xf -
bindir = ${exec_prefix}/bin
build = i686-pc-linux-gnu
build_alias =
build_cpu = i686
build_os = linux-gnu
build_vendor = pc
builddir = .
datadir = ${datarootdir}
datarootdir = ${prefix}/share
docdir = ${datarootdir}/doc/${PACKAGE_TARNAME}
dvidir = ${docdir}
exec_prefix = ${prefix}
host = i686-pc-linux-gnu
host_alias =
host_cpu = i686
host_os = linux-gnu
host_vendor = pc
htmldir = ${docdir}
includedir = ${prefix}/include
infodir = ${datarootdir}/info
install_sh = ${SHELL} /usr/src/dosbox-x/install-sh
libdir = ${exec_prefix}/lib
libexecdir = ${exec_prefix}/libexec
localedir = ${datarootdir}/locale
localstatedir = ${prefix}/var
mandir = ${datarootdir}/man
mkdir_p = $(MKDIR_P)
oldincludedir = /usr/include
pdfdir = ${docdir}
prefix = /usr
program_transform_name = s,x,x,
psdir = ${docdir}
sbindir = ${exec_prefix}/sbin
sharedstatedir = ${prefix}/com
srcdir = .
sysconfdir = ${prefix}/etc
target_alias =
top_build_prefix = ../
top_builddir = ..
top_srcdir = ..
man_MANS = dosbox.1
EXTRA_DIST = $(man_MANS) README.video PORTING
all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu docs/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu docs/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
install-man1: $(man_MANS)
@$(NORMAL_INSTALL)
@list1=''; \
list2='$(man_MANS)'; \
test -n "$(man1dir)" \
&& test -n "`echo $$list1$$list2`" \
|| exit 0; \
echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \
$(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \
{ for i in $$list1; do echo "$$i"; done; \
if test -n "$$list2"; then \
for i in $$list2; do echo "$$i"; done \
| sed -n '/\.1[a-z]*$$/p'; \
fi; \
} | while read p; do \
if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; echo "$$p"; \
done | \
sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
sed 'N;N;s,\n, ,g' | { \
list=; while read file base inst; do \
if test "$$base" = "$$inst"; then list="$$list $$file"; else \
echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
$(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
fi; \
done; \
for i in $$list; do echo "$$i"; done | $(am__base_list) | \
while read files; do \
test -z "$$files" || { \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \
done; }
uninstall-man1:
@$(NORMAL_UNINSTALL)
@list=''; test -n "$(man1dir)" || exit 0; \
files=`{ for i in $$list; do echo "$$i"; done; \
l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
sed -n '/\.1[a-z]*$$/p'; \
} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir)
tags TAGS:
ctags CTAGS:
cscope cscopelist:
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(MANS)
installdirs:
for dir in "$(DESTDIR)$(man1dir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am: install-man
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am:
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man: install-man1
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-man
uninstall-man: uninstall-man1
.MAKE: install-am install-strip
.PHONY: all all-am check check-am clean clean-generic cscopelist-am \
ctags-am distclean distclean-generic distdir dvi dvi-am html \
html-am info info-am install install-am install-data \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am install-info \
install-info-am install-man install-man1 install-pdf \
install-pdf-am install-ps install-ps-am install-strip \
installcheck installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
pdf-am ps ps-am tags-am uninstall uninstall-am uninstall-man \
uninstall-man1
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View File

@ -0,0 +1,29 @@
== Floppy image swapping ==
If you are booting from floppy using the BOOT command
(but not yet the IMGMOUNT command), you can use the
SwapFloppy key combination through the mapper to swap
between floppies.
This key combination is CTRL+F4 (CTRL+SHIFT+F4 on Linux)
by default, but can be changed through the mapper interface.
== CD-ROM image swapping ==
IMGMOUNT can be used to attach multiple ISO images to
a CD-ROM drive. At first, the first ISO image is presented
to the guest as the CD-ROM drive. To emulate the act of
removing the CD and putting in the next one, use the
SwapCD key combination through the mapper.
This key combination is CTRL+F3 (CTRL+SHIFT+F3 on Linux)
by default, but can be changed through the mapper interface.
To provide a realistic CD change delay, CD switching is
emulated as first the removal of the CD-ROM media from
the drive, followed by a 4 second delay, followed by the
emulation of inserting the new CD and waiting for the
CD-ROM drive to spin up and read it. This delay is
necessary for some OSes like Windows 95 who cannot
detect CD changes if the changeover happens too fast.

View File

@ -0,0 +1,92 @@
# Setup Windows 3.1 in DOSBox-X
(instructions tested against `dosbox-x-windows-20180901-124401-windows.zip`)
## Remarks
### Mouse
During the graphical portion of the installation, you will see that there are two mouse pointers visible on the screen but only one is moving and does nothing. This is because DOSBox-X mouse integration driver for Windows needs to be installed first. To use the mouse at this point, capture it with <key>Ctrl</key>+<key>F10</key>.
Or
If you don't want mouse integration from within Windows 3.1 (i.e. you prefer the old behavior), do not add `integration device=true` to the `[cpu]` section in `dosbox.conf` and skip the mouse integration driver installation section below.
### Video
This guide assumes you are using the default DOSBox-X machine `svga_s3` for which DOSBox-X sets video memory to `512Kb` by default. To use higher resolutions and color depths, adjust `vmemsize` in `[dosbox]` accordingly to your needs (see `dosbox.reference.conf`).
## Installation
### Windows 3.1
- download and extract [DOSBox-X](https://github.com/joncampbell123/dosbox-x/releases)
- next to `DOSBox-X.exe`, create a `VirtualHD` directory
- inside `VirtualHD` create a `WINSETUP` directory
- extract Windows 3.1 floppies into it ([7-Zip](https://www.7-zip.org/) can extract IMG files)
- next to `DOSBox-x.exe` create a `dosbox.conf` with the following content:
```
[cpu]
cycles=25000
integration device=true
[sblaster]
irq=5
[autoexec]
@ECHO OFF
PATH=%PATH%;C:\WINDOWS
MOUNT C .\VirtualHD
C:
```
- start DOSBox-X
- launch Windows installation `C:\WINSETUP\SETUP.EXE`
- install Windows using `Express Setup (Recommended)` option
- follow the installation instructions
- when asked, reboot, start Windows by typing `WIN`
### Mouse integration driver
- launch `Windows Setup` program
- open menu item `Options\Change System Settings`
- in `Mouse`, pick `Other mouse (Requires disk from OEM)...`
- type location to where you've extracted the driver and press `OK`
- `DOSBox-X Mouse Pointer Integration` is selected by default
- press `OK`
- press `OK` again
- press `Restart Windows`
### S3 video driver
- launch `Windows Setup` program
- open menu item `Options\Change System Settings`
- in `Display`, pick `Other display (Requires disk from OEM)...`
- type location to where you've extracted the driver and press `OK`
- `S3 Trio64V 1.70.04 640x480 256` is selected by default
- press `OK`
- press `OK` again
- when asked for the driver location again, type `C:\WINDOWS\SYSTEM`
- press `OK`
- press `Restart Windows`
### Sound Blaster 16 sound driver
- installation must be done from command-prompt, exit Windows if not already
- `cd` to where you've extract the driver and run `INSTALL.EXE`
- choose `Full Installation (Recommended)`
- follow installation instructions
- when asked to overwrite some files, choose `Backup`
- restart DOSBox-X
- start Windows
- the installer finishes with setting up the group of audio software for Windows
## Links
Here are some extra references to further tweak your installation:
[Windows 3.1x DOSBox Guide](https://www.vogons.org/viewtopic.php?t=9405)
[Windows 3x Downloads](http://www.sierrahelp.com/Utilities/Emulators/DOSBox/3x_Downloads.html)
[VOGONS Vintage Driver Library](http://vogonsdrivers.com/)
Tip : backup your working installation before attempting to install other drivers.

Binary file not shown.

28
dosbox-x.spec.in Normal file
View File

@ -0,0 +1,28 @@
BuildRequires: libX11 libX11-devel libXext libXext-devel libpng libpng-devel alsa-lib alsa-lib-devel ncurses ncurses-devel zlib zlib-devel mesa-libGL mesa-libGL-devel pulseaudio-libs pulseaudio-libs-devel make, libtool, gcc
Requires: libX11 libXext libpng alsa-lib ncurses zlib mesa-libGL pulseaudio-libs
Name: @PACKAGE_NAME@
Version: @PACKAGE_VERSION@
Release: 0%{?dist}
Summary: @PACKAGE_DESCRIPTION@
License: GPL
URL: http://www.dosbox-x.com
Group: Applications/Emulators
Source0: @PACKAGE_NAME@-@PACKAGE_VERSION@.tar.xz
%description
%prep
%autosetup -n dosbox-x
%build
./build-debug-no-avcodec
%check
%install
%make_install
%files
%{_bindir}/*
%{_datadir}/dosbox-x/*

1635
dosbox.reference.conf Normal file

File diff suppressed because it is too large Load Diff

14
env-gcc-4.8-rpi.sh Executable file
View File

@ -0,0 +1,14 @@
#!/bin/bash
#
# Look for GCC-4.8
x=`which gcc-4.8`
gdir=`dirname $x`
export CC="$gdir/gcc-4.8"
export CPP="$gdir/cpp-4.8"
export CXX="$gdir/g++-4.8"
echo Starting subshell. Type exit to exit.
$SHELL

View File

@ -16,6 +16,7 @@ echo GCC is in $gdir
export CC="$gdir/gcc"
export CPP="$gdir/cpp"
export CXX="$gdir/g++"
export PATH="$gdir:$PATH"
echo Starting subshell. Type exit to exit.

View File

@ -1,23 +0,0 @@
#!/bin/bash
#
# Look for GCC-4.9
x=`which gcc-4.9 2>/dev/null`
if [ -n "$x" ]; then
gdir=`dirname $x`
elif [ -f "/usr/gcc-4.9/bin/gcc" ]; then
gdir="/usr/gcc-4.9/bin"
else
echo Cannot find GCC 4.9
exit 1
fi
echo GCC is in $gdir
export CC="$gdir/gcc"
export CPP="$gdir/cpp"
export CXX="$gdir/g++"
echo Starting subshell. Type exit to exit.
$SHELL

180
include/8255.h Normal file
View File

@ -0,0 +1,180 @@
#include <stdio.h>
#include <stdint.h>
//! \brief Intel 8255 base emulation class
//!
//! \description Intel 8255 Programmable Peripheral Interface emulation class.
//! The base class handles the functions and register I/O to
//! emulate the 8255, while the subclass implements behavior
//! of hardware attached to the 8255.
//!
//! All emulation is written to follow Intel's datasheet as
//! closely as possible.
//!
//! <a target="_blank" href="http://hackipedia.org/browse/Hardware/By%20company/Intel/8255,%20Programmable%20Peripheral%20Interface/8255A,%208255A-5%20Programmable%20Peripheral%20Interface%20(1991-08).pdf">Intel 8255A datasheet</a>
//!
//! NOTE: Mode 2 emulation has NOT been tested yet!
class Intel8255 {
public:
//!
//! Port enumeration (A, B, and C)
//!
enum {
//! Port A (input or output)
PortA=0,
//! Port B (input or output)
PortB=1,
//! Port C (input, output, or half input half output)
PortC=2
};
public:
//! Constructor
Intel8255();
//! Destructor
virtual ~Intel8255();
public:
//! Reset state (as if activating reset signal)
void reset(void);
//! External acknowledgement of port A
void ackPortA(void);
//! External acknowledgement of port B
void ackPortB(void);
//! Strobed Input (latch to port A)
virtual void strobePortA(void);
//! Strobed Input (latch to port B)
virtual void strobePortB(void);
//! Called when CPU reads port A
uint8_t readPortA(void);
//! Called when CPU reads port B
uint8_t readPortB(void);
//! Called when CPU reads port C
uint8_t readPortC(void);
//! Called when CPU reads control port
uint8_t readControl(void);
//! Called when CPU reads from the chip
uint8_t readByPort(const uint8_t p03);
//! Called when CPU writes port A
void writePortA(const uint8_t data,uint8_t mask=0xFFU);
//! Called when CPU writes port B
void writePortB(const uint8_t data,uint8_t mask=0xFFU);
//! Called when CPU writes port C
void writePortC(const uint8_t data,uint8_t mask=0xFFU);
//! Called when CPU writes control port
void writeControl(const uint8_t data);
//! Called when CPU writes to the chip
void writeByPort(const uint8_t p03,const uint8_t data);
public:
//! Called by 8255 emulation to latch from port A pins
virtual uint8_t inPortA(void) const;
//! Called by 8255 emulation to latch from port B pins
virtual uint8_t inPortB(void) const;
//! Called by 8255 emulation to latch from port C pins
virtual uint8_t inPortC(void) const;
public:
//! Called by 8255 emulation when latching to port A pins
virtual void outPortA(const uint8_t mask);
//! Called by 8255 emulation when latching to port B pins
virtual void outPortB(const uint8_t mask);
//! Called by 8255 emulation when latching to port C pins
virtual void outPortC(const uint8_t mask);
public:
//! Internal 8255 emulation code to update INTR A signal
void updateINTR_A(void);
//! Internal 8255 emulation code to update INTR B signal
void updateINTR_B(void);
public:
//! Internal 8255 emulation code to check INTR A change and dispatch signal
void checkINTR_A(void);
//! Internal 8255 emulation code to check INTR B change and dispatch signal
void checkINTR_B(void);
public:
//! Called by 8255 emulation when INTR A signal changes to dispatch signal
virtual void sigINTR_A(void);
//! Called by 8255 emulation when INTR B signal changes to dispatch signal
virtual void sigINTR_B(void);
public:
//! \brief Retrieve the name of this chip (for debug/UI purposes)
inline const char* getName(void) const {
return nil_if_null(ppiName);
}
public:
//! \brief Retrieve the name of a pin on the chip related to port A, B, or C (what it's connected to) (for debug/UI purposes)
inline const char* pinName(const unsigned int port,const unsigned int i) const {
return nil_if_null(pinNames[port][i]);
}
//! \brief Retrieve the name of a port (A, B, or C) (for debug/UI purposes)
inline const char* portName(const unsigned int port) const {
return nil_if_null(portNames[port]);
}
public:
//! Port A write mask. Controls which bits are writeable
uint8_t portAWriteMask;
//! Port B write mask. Controls which bits are writeable
uint8_t portBWriteMask;
//! Port C write mask. Controls which bits are writeable
uint8_t portCWriteMask;
public:
//! PPI chip name (for debug/UI purposes)
const char* ppiName;
public:
//! Pin names (for debug/UI purposes)
const char* pinNames[3/*port*/][8/*bit*/];
//! Port names (for debug/UI purposes)
const char* portNames[3/*port*/];
public:
//! Port A output latch
uint8_t latchOutPortA;
//! Port B output latch
uint8_t latchOutPortB;
//! Port C output latch
uint8_t latchOutPortC;
//! PPI mode byte
uint8_t mode;
/* bit[7:7] = 1 mode set flag
* bit[6:5] = mode select 00=mode 0 01=mode 1 1x=mode 2
* bit[4:4] = Port A 1=input 0=output
* bit[3:3] = Port C upper 1=input 0=output
* bit[2:2] = mode select 0=mode 0 1=mode 1
* bit[1:1] = Port B 1=input 0=output
* bit[0:0] = Port C lower 1=input 0=output */
public:
//! Input Buffer Full, port A contains information (port A, Mode 1)
bool IBF_A;
//! Input Buffer Full, port B contains information (port B, Mode 1)
bool IBF_B;
//! Output Buffer Full, port A contains information for the external device (port A, Mode 1)
bool OBF_A;
//! Output Buffer Full, port B contains information for the external device (port B, Mode 1)
bool OBF_B;
public:
//! Interrupt Request A (to the microprocessor)
bool INTR_A;
//! Interrupt Request B (to the microprocessor)
bool INTR_B;
//! Previous Interrupt Request A state (for change detection)
bool pINTR_A;
//! Previous Interrupt Request B state (for change detection)
bool pINTR_B;
public:
//! Interrupt 1 enable (mode 2)
bool INTE_1;
//! Interrupt 2 enable (mode 2)
bool INTE_2; /* mode 2 */
//! Interrupt A enable
bool INTE_A;
//! Interrupt B enable
bool INTE_B;
protected:
//! Return string "str", or "" (empty string) if str == NULL
static inline const char *nil_if_null(const char *str) {
return (str != NULL) ? str : "";
}
};

81
include/CMakeLists.txt Normal file
View File

@ -0,0 +1,81 @@
set(INCLUDES
"${CMAKE_CURRENT_LIST_DIR}/8255.h"
"${CMAKE_CURRENT_LIST_DIR}/bios.h"
"${CMAKE_CURRENT_LIST_DIR}/bios_disk.h"
"${CMAKE_CURRENT_LIST_DIR}/bitmapinfoheader.h"
"${CMAKE_CURRENT_LIST_DIR}/build_timestamp.h"
"${CMAKE_CURRENT_LIST_DIR}/builtin.h"
"${CMAKE_CURRENT_LIST_DIR}/byteorder.h"
"${CMAKE_CURRENT_LIST_DIR}/callback.h"
"${CMAKE_CURRENT_LIST_DIR}/clockdomain.h"
"${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt"
"${CMAKE_CURRENT_LIST_DIR}/control.h"
"${CMAKE_CURRENT_LIST_DIR}/cp437_uni.h"
"${CMAKE_CURRENT_LIST_DIR}/cp932_uni.h"
"${CMAKE_CURRENT_LIST_DIR}/cpu.h"
"${CMAKE_CURRENT_LIST_DIR}/cross.h"
"${CMAKE_CURRENT_LIST_DIR}/crypt.h"
"${CMAKE_CURRENT_LIST_DIR}/debug.h"
"${CMAKE_CURRENT_LIST_DIR}/dma.h"
"${CMAKE_CURRENT_LIST_DIR}/dosbox.h"
"${CMAKE_CURRENT_LIST_DIR}/dos_inc.h"
"${CMAKE_CURRENT_LIST_DIR}/dos_system.h"
"${CMAKE_CURRENT_LIST_DIR}/fpu.h"
"${CMAKE_CURRENT_LIST_DIR}/hardware.h"
"${CMAKE_CURRENT_LIST_DIR}/ide.h"
"${CMAKE_CURRENT_LIST_DIR}/informational.h"
"${CMAKE_CURRENT_LIST_DIR}/inout.h"
"${CMAKE_CURRENT_LIST_DIR}/ioapi.h"
"${CMAKE_CURRENT_LIST_DIR}/iowin32.h"
"${CMAKE_CURRENT_LIST_DIR}/ipx.h"
"${CMAKE_CURRENT_LIST_DIR}/ipxserver.h"
"${CMAKE_CURRENT_LIST_DIR}/joystick.h"
"${CMAKE_CURRENT_LIST_DIR}/keyboard.h"
"${CMAKE_CURRENT_LIST_DIR}/keymap.h"
"${CMAKE_CURRENT_LIST_DIR}/logging.h"
"${CMAKE_CURRENT_LIST_DIR}/Makefile.am"
"${CMAKE_CURRENT_LIST_DIR}/mapper.h"
"${CMAKE_CURRENT_LIST_DIR}/mem.h"
"${CMAKE_CURRENT_LIST_DIR}/menu.h"
"${CMAKE_CURRENT_LIST_DIR}/menudef.h"
"${CMAKE_CURRENT_LIST_DIR}/mixer.h"
"${CMAKE_CURRENT_LIST_DIR}/mmx.h"
"${CMAKE_CURRENT_LIST_DIR}/modules.h"
"${CMAKE_CURRENT_LIST_DIR}/mouse.h"
"${CMAKE_CURRENT_LIST_DIR}/mztools.h"
"${CMAKE_CURRENT_LIST_DIR}/ne2000.h"
"${CMAKE_CURRENT_LIST_DIR}/np2glue.h"
"${CMAKE_CURRENT_LIST_DIR}/paging.h"
"${CMAKE_CURRENT_LIST_DIR}/parport.h"
"${CMAKE_CURRENT_LIST_DIR}/pc98_cg.h"
"${CMAKE_CURRENT_LIST_DIR}/pc98_dac.h"
"${CMAKE_CURRENT_LIST_DIR}/pc98_gdc.h"
"${CMAKE_CURRENT_LIST_DIR}/pc98_gdc_const.h"
"${CMAKE_CURRENT_LIST_DIR}/pci_bus.h"
"${CMAKE_CURRENT_LIST_DIR}/pic.h"
"${CMAKE_CURRENT_LIST_DIR}/programs.h"
"${CMAKE_CURRENT_LIST_DIR}/qcow2_disk.h"
"${CMAKE_CURRENT_LIST_DIR}/rawint.h"
"${CMAKE_CURRENT_LIST_DIR}/regionalloctracking.h"
"${CMAKE_CURRENT_LIST_DIR}/regs.h"
"${CMAKE_CURRENT_LIST_DIR}/render.h"
"${CMAKE_CURRENT_LIST_DIR}/resource.h"
"${CMAKE_CURRENT_LIST_DIR}/selftest.h"
"${CMAKE_CURRENT_LIST_DIR}/serialport.h"
"${CMAKE_CURRENT_LIST_DIR}/setup.h"
"${CMAKE_CURRENT_LIST_DIR}/shell.h"
"${CMAKE_CURRENT_LIST_DIR}/shiftjis.h"
"${CMAKE_CURRENT_LIST_DIR}/support.h"
"${CMAKE_CURRENT_LIST_DIR}/timer.h"
"${CMAKE_CURRENT_LIST_DIR}/uint64_const.h"
"${CMAKE_CURRENT_LIST_DIR}/unzip.h"
"${CMAKE_CURRENT_LIST_DIR}/util_pointer.h"
"${CMAKE_CURRENT_LIST_DIR}/util_units.h"
"${CMAKE_CURRENT_LIST_DIR}/vga.h"
"${CMAKE_CURRENT_LIST_DIR}/video.h"
"${CMAKE_CURRENT_LIST_DIR}/voodoo.h"
"${CMAKE_CURRENT_LIST_DIR}/waveformatex.h"
"${CMAKE_CURRENT_LIST_DIR}/wave_mmreg.h"
"${CMAKE_CURRENT_LIST_DIR}/zip.h"
)
source_group("Includes" FILES ${INCLUDES}/)

View File

@ -1,530 +0,0 @@
# Makefile.in generated by automake 1.14.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = include
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(noinst_HEADERS)
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
SOURCES =
DIST_SOURCES =
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
HEADERS = $(noinst_HEADERS)
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
BEGIN { nonempty = 0; } \
{ items[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique. This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
am__define_uniq_tagged_files = \
list='$(am__tagged_files)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
ALSA_CFLAGS = @ALSA_CFLAGS@
ALSA_LIBS = @ALSA_LIBS@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
SDL2_CFLAGS = @SDL2_CFLAGS@
SDL2_CONFIG = @SDL2_CONFIG@
SDL2_LIBS = @SDL2_LIBS@
SDL_CFLAGS = @SDL_CFLAGS@
SDL_CONFIG = @SDL_CONFIG@
SDL_LIBS = @SDL_LIBS@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
WINDRES = @WINDRES@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
noinst_HEADERS = \
bios.h \
bios_disk.h \
util_pointer.h \
callback.h \
cpu.h \
cross.h \
control.h \
debug.h \
dma.h \
dos_inc.h \
dos_system.h \
dosbox.h \
fpu.h \
hardware.h \
inout.h \
joystick.h \
ipx.h \
ipxserver.h \
keyboard.h \
logging.h \
mapper.h \
mem.h \
mixer.h \
modules.h \
mouse.h \
parport.h \
paging.h \
pci_bus.h \
pic.h \
programs.h \
qcow2_disk.h \
render.h \
regs.h \
render.h \
serialport.h \
setup.h \
shell.h \
support.h \
timer.h \
vga.h \
video.h \
ne2000.h \
mmx.h \
menu.h \
menudef.h \
resource.h \
voodoo.h \
ioapi.h \
iowin32.h \
unzip.h \
zip.h \
crypt.h \
mztools.h
all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign include/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign include/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-am
TAGS: tags
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
$(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: ctags-am
CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscopelist: cscopelist-am
cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(HEADERS)
installdirs:
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am:
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am:
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am:
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
cscopelist-am ctags ctags-am distclean distclean-generic \
distclean-tags distdir dvi dvi-am html html-am info info-am \
install install-am install-data install-data-am install-dvi \
install-dvi-am install-exec install-exec-am install-html \
install-html-am install-info install-info-am install-man \
install-pdf install-pdf-am install-ps install-ps-am \
install-strip installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \
uninstall-am
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View File

@ -40,7 +40,25 @@
/* #define bios_expansion_memory_size (*(unsigned int *) 0x415) */
#define BIOS_KEYBOARD_STATE 0x417
#define BIOS_KEYBOARD_FLAGS1 BIOS_KEYBOARD_STATE
#define BIOS_KEYBOARD_FLAGS1_RSHIFT_PRESSED (1 << 0)
#define BIOS_KEYBOARD_FLAGS1_LSHIFT_PRESSED (1 << 1)
#define BIOS_KEYBOARD_FLAGS1_CTRL_PRESSED (1 << 2)
#define BIOS_KEYBOARD_FLAGS1_ALT_PRESSED (1 << 3)
#define BIOS_KEYBOARD_FLAGS1_SCROLL_LOCK_ACTIVE (1 << 4)
#define BIOS_KEYBOARD_FLAGS1_NUMLOCK_ACTIVE (1 << 5)
#define BIOS_KEYBOARD_FLAGS1_CAPS_LOCK_ACTIVE (1 << 6)
#define BIOS_KEYBOARD_FLAGS1_INSERT_ACTIVE (1 << 7)
#define BIOS_KEYBOARD_FLAGS2 0x418
#define BIOS_KEYBOARD_FLAGS2_LCTRL_PRESSED (1 << 0)
#define BIOS_KEYBOARD_FLAGS2_LALT_PRESSED (1 << 1)
#define BIOS_KEYBOARD_FLAGS2_SYSTEMKEY_HELD (1 << 2)
#define BIOS_KEYBOARD_FLAGS2_SUSPENDKEY_TOGGLED (1 << 3)
#define BIOS_KEYBOARD_FLAGS2_SCROLL_LOCK_PRESSED (1 << 4)
#define BIOS_KEYBOARD_FLAGS2_NUM_LOCK_PRESSED (1 << 5)
#define BIOS_KEYBOARD_FLAGS2_CAPS_LOCK_PRESSED (1 << 6)
#define BIOS_KEYBOARD_FLAGS2_INSERT_PRESSED (1 << 7)
#define BIOS_KEYBOARD_TOKEN 0x419
/* used for keyboard input with Alt-Number */
#define BIOS_KEYBOARD_BUFFER_HEAD 0x41a
@ -95,7 +113,24 @@
#define BIOS_VIDEO_COMBO 0x48a
#define BIOS_KEYBOARD_FLAGS3 0x496
#define BIOS_KEYBOARD_FLAGS3_HIDDEN_E1 (1 << 0)
#define BIOS_KEYBOARD_FLAGS3_HIDDEN_E0 (1 << 1)
#define BIOS_KEYBOARD_FLAGS3_RCTRL_PRESSED (1 << 2)
#define BIOS_KEYBOARD_FLAGS3_RALT_PRESSED (1 << 3)
#define BIOS_KEYBOARD_FLAGS3_ENHANCED_KEYBOARD (1 << 4)
#define BIOS_KEYBOARD_FLAGS3_NUM_LOCK_FORCED (1 << 5)
#define BIOS_KEYBOARD_FLAGS3_ID_CHAR_WAS_LAST (1 << 6)
#define BIOS_KEYBOARD_FLAGS3_ID_READ_IN_PROCESS (1 << 7)
#define BIOS_KEYBOARD_LEDS 0x497
#define BIOS_KEYBOARD_LEDS_SCROLL_LOCK (1 << 0)
#define BIOS_KEYBOARD_LEDS_NUM_LOCK (1 << 1)
#define BIOS_KEYBOARD_LEDS_CAPS_LOCK (1 << 2)
#define BIOS_KEYBOARD_LEDS_CIRCUS (1 << 3)
#define BIOS_KEYBOARD_LEDS_ACK (1 << 4)
#define BIOS_KEYBOARD_LEDS_RESEND (1 << 5)
#define BIOS_KEYBOARD_LEDS_MODE (1 << 6)
#define BIOS_KEYBOARD_LEDS_TRANSMIT_ERROR (1 << 7)
#define BIOS_WAIT_FLAG_POINTER 0x498
#define BIOS_WAIT_FLAG_COUNT 0x49c
@ -107,6 +142,9 @@
#define BIOS_VIDEO_SAVEPTR 0x4a8
#define CURSOR_SCAN_LINE_NORMAL (0x6)
#define CURSOR_SCAN_LINE_INSERT (0x4)
#define CURSOR_SCAN_LINE_END (0x7)
//#define BIOS_DEFAULT_IRQ0_LOCATION (RealMake(0xf000,0xfea5))
//#define BIOS_DEFAULT_IRQ1_LOCATION (RealMake(0xf000,0xe987))
@ -151,6 +189,15 @@ void INT10_ReloadRomFonts();
void BIOS_SetComPorts (Bit16u baseaddr[]);
void BIOS_SetLPTPort (Bitu port, Bit16u baseaddr);
// \brief Synchronizes emulator num lock state with host.
void BIOS_SynchronizeNumLock();
// \brief Synchronizes emulator caps lock state with host.
void BIOS_SynchronizeCapsLock();
// \brief Synchronizes emulator scroll lock state with host.
void BIOS_SynchronizeScrollLock();
bool ISAPNP_RegisterSysDev(const unsigned char *raw,Bitu len,bool already=false);
class ISAPnPDevice {
@ -195,20 +242,20 @@ public:
IRQFormatInfo_LowTrueLevelSensitive = 0x8
};
// IRQ format, helper IRQ mask generator
static inline const uint16_t irq2mask(const int IRQ) {
static inline uint16_t irq2mask(const int IRQ) {
if (IRQ < 0 || IRQ > 15) return 0;
return (uint16_t)1 << (unsigned char)IRQ;
return (uint16_t)(1U << (unsigned char)IRQ);
}
static inline const uint16_t irq2mask(const int a,const int b) {
static inline uint16_t irq2mask(const int a,const int b) {
return irq2mask(a) | irq2mask(b);
}
static inline const uint16_t irq2mask(const int a,const int b,const int c) {
static inline uint16_t irq2mask(const int a,const int b,const int c) {
return irq2mask(a) | irq2mask(b) | irq2mask(c);
}
static inline const uint16_t irq2mask(const int a,const int b,const int c,const int d) {
static inline uint16_t irq2mask(const int a,const int b,const int c,const int d) {
return irq2mask(a) | irq2mask(b) | irq2mask(c) | irq2mask(d);
}
static inline const uint16_t irq2mask(const int a,const int b,const int c,const int d,const int e) {
static inline uint16_t irq2mask(const int a,const int b,const int c,const int d,const int e) {
return irq2mask(a) | irq2mask(b) | irq2mask(c) | irq2mask(d) | irq2mask(e);
}
// DMA format transfer type
@ -224,20 +271,20 @@ public:
DMASpeedSupported_TypeF=3
};
// DMA format
static inline const uint16_t dma2mask(const int DMA) {
static inline uint16_t dma2mask(const int DMA) {
if (DMA < 0 || DMA > 7 || DMA == 4) return 0;
return (uint16_t)1 << (unsigned char)DMA;
return (uint16_t)(1U << (unsigned char)DMA);
}
static inline const uint16_t dma2mask(const int a,const int b) {
static inline uint16_t dma2mask(const int a,const int b) {
return dma2mask(a) | dma2mask(b);
}
static inline const uint16_t dma2mask(const int a,const int b,const int c) {
static inline uint16_t dma2mask(const int a,const int b,const int c) {
return dma2mask(a) | dma2mask(b) | dma2mask(c);
}
static inline const uint16_t dma2mask(const int a,const int b,const int c,const int d) {
static inline uint16_t dma2mask(const int a,const int b,const int c,const int d) {
return dma2mask(a) | dma2mask(b) | dma2mask(c) | dma2mask(d);
}
static inline const uint16_t dma2mask(const int a,const int b,const int c,const int d,const int e) {
static inline uint16_t dma2mask(const int a,const int b,const int c,const int d,const int e) {
return dma2mask(a) | dma2mask(b) | dma2mask(c) | dma2mask(d) | dma2mask(e);
}
public:

View File

@ -41,21 +41,29 @@ struct diskGeo {
Bit16u cylcount; /* Cylinders per side */
Bit16u biosval; /* Type to return from BIOS */
Bit16u bytespersect; /* Bytes per sector */
Bit16u rootentries; /* Root directory entries */
Bit8u sectcluster; /* Sectors per cluster */
Bit8u mediaid; /* Media ID */
};
extern diskGeo DiskGeometryList[];
extern const Bit8u freedos_mbr[];
class imageDisk {
public:
enum {
enum IMAGE_TYPE {
ID_BASE=0,
ID_EL_TORITO_FLOPPY,
ID_VFD
ID_VFD,
ID_MEMORY,
ID_VHD,
ID_D88
};
public:
virtual Bit8u Read_Sector(Bit32u head,Bit32u cylinder,Bit32u sector,void * data);
virtual Bit8u Write_Sector(Bit32u head,Bit32u cylinder,Bit32u sector,void * data);
virtual Bit8u Read_Sector(Bit32u head,Bit32u cylinder,Bit32u sector,void * data,unsigned int req_sector_size=0);
virtual Bit8u Write_Sector(Bit32u head,Bit32u cylinder,Bit32u sector,const void * data,unsigned int req_sector_size=0);
virtual Bit8u Read_AbsoluteSector(Bit32u sectnum, void * data);
virtual Bit8u Write_AbsoluteSector(Bit32u sectnum, void * data);
virtual Bit8u Write_AbsoluteSector(Bit32u sectnum, const void * data);
virtual void Set_Reserved_Cylinders(Bitu resCyl);
virtual Bit32u Get_Reserved_Cylinders();
@ -63,27 +71,31 @@ public:
virtual void Get_Geometry(Bit32u * getHeads, Bit32u *getCyl, Bit32u *getSect, Bit32u *getSectSize);
virtual Bit8u GetBiosType(void);
virtual Bit32u getSectSize(void);
imageDisk();
imageDisk(FILE *imgFile, Bit8u *imgName, Bit32u imgSizeK, bool isHardDisk);
imageDisk(FILE* diskimg, const char* diskName, Bit32u cylinders, Bit32u heads, Bit32u sectors, Bit32u sector_size, bool hardDrive);
virtual ~imageDisk() { if(diskimg != NULL) { fclose(diskimg); diskimg=NULL; } };
int class_id;
bool hardDrive;
bool active;
FILE *diskimg;
IMAGE_TYPE class_id;
std::string diskname;
bool active;
Bit32u sector_size;
Bit32u heads, cylinders, sectors;
bool hardDrive;
Bit64u diskSizeK;
protected:
imageDisk(IMAGE_TYPE class_id);
FILE *diskimg;
Bit8u floppytype;
Bit32u sector_size;
Bit32u heads,cylinders,sectors;
Bit32u reserved_cylinders;
Bit64u current_fpos;
Bit64u image_base;
Bit64u image_length;
private:
volatile int refcount;
bool auto_delete_on_refcount_zero;
public:
int Addref() {
return ++refcount;
}
@ -93,17 +105,56 @@ public:
fprintf(stderr,"WARNING: imageDisk Release() changed refcount to %d\n",ret);
abort();
}
if (ret == 0 && auto_delete_on_refcount_zero) delete this;
if (ret == 0) delete this;
return ret;
}
};
class imageDiskD88 : public imageDisk {
public:
virtual Bit8u Read_Sector(Bit32u head,Bit32u cylinder,Bit32u sector,void * data,unsigned int req_sector_size=0);
virtual Bit8u Write_Sector(Bit32u head,Bit32u cylinder,Bit32u sector,const void * data,unsigned int req_sector_size=0);
virtual Bit8u Read_AbsoluteSector(Bit32u sectnum, void * data);
virtual Bit8u Write_AbsoluteSector(Bit32u sectnum, const void * data);
imageDiskD88(FILE *imgFile, Bit8u *imgName, Bit32u imgSizeK, bool isHardDisk);
virtual ~imageDiskD88();
unsigned char fd_type_major;
unsigned char fd_type_minor;
enum { /* major */
DISKTYPE_2D = 0,
DISKTYPE_2DD,
DISKTYPE_2HD
};
struct vfdentry {
uint8_t track,head,sector;
uint16_t sector_size;
uint32_t data_offset;
uint32_t entry_offset; // offset of the 12-byte entry this came from (if nonzero)
vfdentry() : track(0), head(0), sector(0), sector_size(0), data_offset(0), entry_offset(0) {
}
uint16_t getSectorSize(void) const {
return sector_size;
}
};
vfdentry *findSector(Bit8u head,Bit8u track,Bit8u sector/*TODO: physical head?*/,unsigned int req_sector_size=0);
std::vector<vfdentry> dents;
};
class imageDiskVFD : public imageDisk {
public:
virtual Bit8u Read_Sector(Bit32u head,Bit32u cylinder,Bit32u sector,void * data);
virtual Bit8u Write_Sector(Bit32u head,Bit32u cylinder,Bit32u sector,void * data);
virtual Bit8u Read_Sector(Bit32u head,Bit32u cylinder,Bit32u sector,void * data,unsigned int req_sector_size=0);
virtual Bit8u Write_Sector(Bit32u head,Bit32u cylinder,Bit32u sector,const void * data,unsigned int req_sector_size=0);
virtual Bit8u Read_AbsoluteSector(Bit32u sectnum, void * data);
virtual Bit8u Write_AbsoluteSector(Bit32u sectnum, void * data);
virtual Bit8u Write_AbsoluteSector(Bit32u sectnum, const void * data);
imageDiskVFD(FILE *imgFile, Bit8u *imgName, Bit32u imgSizeK, bool isHardDisk);
virtual ~imageDiskVFD();
@ -131,17 +182,161 @@ public:
}
};
vfdentry *findSector(Bit8u head,Bit8u track,Bit8u sector/*TODO: physical head?*/);
vfdentry *findSector(Bit8u head,Bit8u track,Bit8u sector/*TODO: physical head?*/,unsigned int req_sector_size=0);
std::vector<vfdentry> dents;
};
class imageDiskMemory : public imageDisk {
public:
virtual Bit8u Read_AbsoluteSector(Bit32u sectnum, void * data);
virtual Bit8u Write_AbsoluteSector(Bit32u sectnum, const void * data);
virtual Bit8u GetBiosType(void);
virtual void Set_Geometry(Bit32u setHeads, Bit32u setCyl, Bit32u setSect, Bit32u setSectSize);
// Parition and format the ramdrive
virtual Bit8u Format();
// Create a hard drive image of a specified size; automatically select c/h/s
imageDiskMemory(Bit32u imgSizeK);
// Create a hard drive image of a specified geometry
imageDiskMemory(Bit16u cylinders, Bit16u heads, Bit16u sectors, Bit16u sectorSize);
// Create a floppy image of a specified geometry
imageDiskMemory(diskGeo floppyGeometry);
// Create a copy-on-write memory image of an existing image
imageDiskMemory(imageDisk* underlyingImage);
virtual ~imageDiskMemory();
private:
void init(diskGeo diskParams, bool isHardDrive, imageDisk* underlyingImage);
bool CalculateFAT(Bit32u partitionStartingSector, Bit32u partitionLength, bool isHardDrive, Bit32u rootEntries, Bit32u* rootSectors, Bit32u* sectorsPerCluster, bool* isFat16, Bit32u* fatSectors, Bit32u* reservedSectors);
Bit8u * * ChunkMap;
Bit32u sectors_per_chunk;
Bit32u chunk_size;
Bit32u total_chunks;
Bit32u total_sectors;
imageDisk* underlyingImage;
diskGeo floppyInfo;
};
class imageDiskVHD : public imageDisk {
public:
enum ErrorCodes : int
{
OPEN_SUCCESS = 0,
ERROR_OPENING = 1,
INVALID_DATA = 2,
UNSUPPORTED_TYPE = 3,
INVALID_MATCH = 4,
INVALID_DATE = 5,
PARENT_ERROR = 0x10,
ERROR_OPENING_PARENT = 0x11,
PARENT_INVALID_DATA = 0x12,
PARENT_UNSUPPORTED_TYPE = 0x13,
PARENT_INVALID_MATCH = 0x14,
PARENT_INVALID_DATE = 0x15
};
enum VHDTypes : Bit32u
{
VHD_TYPE_NONE = 0,
VHD_TYPE_FIXED = 2,
VHD_TYPE_DYNAMIC = 3,
VHD_TYPE_DIFFERENCING = 4
};
VHDTypes vhdType;
virtual Bit8u Read_AbsoluteSector(Bit32u sectnum, void * data);
virtual Bit8u Write_AbsoluteSector(Bit32u sectnum, const void * data);
static ErrorCodes Open(const char* fileName, const bool readOnly, imageDisk** imageDisk);
static VHDTypes GetVHDType(const char* fileName);
virtual ~imageDiskVHD();
private:
struct Geometry {
Bit16u cylinders;
Bit8u heads;
Bit8u sectors;
};
struct VHDFooter {
char cookie[8];
Bit32u features;
Bit32u fileFormatVersion;
Bit64u dataOffset;
Bit32u timeStamp;
char creatorApp[4];
Bit32u creatorVersion;
Bit32u creatorHostOS;
Bit64u originalSize;
Bit64u currentSize;
Geometry geometry;
VHDTypes diskType;
Bit32u checksum;
char uniqueId[16];
char savedState;
char reserved[427];
void SwapByteOrder();
Bit32u CalculateChecksum();
bool IsValid();
};
struct ParentLocatorEntry {
Bit32u platformCode;
Bit32u platformDataSpace;
Bit32u platformDataLength;
Bit32u reserved;
Bit64u platformDataOffset;
};
struct DynamicHeader {
char cookie[8];
Bit64u dataOffset;
Bit64u tableOffset;
Bit32u headerVersion;
Bit32u maxTableEntries;
Bit32u blockSize;
Bit32u checksum;
Bit8u parentUniqueId[16];
Bit32u parentTimeStamp;
Bit32u reserved;
Bit16u parentUnicodeName[256];
ParentLocatorEntry parentLocatorEntry[8];
char reserved2[256];
void SwapByteOrder();
Bit32u CalculateChecksum();
bool IsValid();
};
imageDiskVHD() : imageDisk(ID_VHD), parentDisk(NULL), copiedFooter(false), currentBlock(0xFFFFFFFF), currentBlockAllocated(false), currentBlockDirtyMap(NULL) { }
static ErrorCodes TryOpenParent(const char* childFileName, const ParentLocatorEntry &entry, Bit8u* data, const Bit32u dataLength, imageDisk** disk, const Bit8u* uniqueId);
static ErrorCodes Open(const char* fileName, const bool readOnly, imageDisk** imageDisk, const Bit8u* matchUniqueId);
virtual bool loadBlock(const Bit32u blockNumber);
static bool convert_UTF16_for_fopen(std::string &string, const void* data, const Bit32u dataLength);
imageDisk* parentDisk;// = 0;
Bit64u footerPosition;
VHDFooter footer;
VHDFooter originalFooter;
bool copiedFooter;// = false;
DynamicHeader dynamicHeader;
Bit32u sectorsPerBlock;
Bit32u blockMapSectors;
Bit32u blockMapSize;
Bit32u currentBlock;// = 0xFFFFFFFF;
bool currentBlockAllocated;// = false;
Bit32u currentBlockSectorOffset;
Bit8u* currentBlockDirtyMap;// = 0;
};
void updateDPT(void);
void incrementFDD(void);
#define MAX_HDD_IMAGES 2
//in order to attach to the virtual IDE controllers, the disk must be mounted
// in the BIOS first (the imageDiskList array), so the IDE controller can obtain
// a reference to the drive in the imageDiskList array
#define MAX_HDD_IMAGES 4
#define MAX_DISK_IMAGES 6 //MAX_HDD_IMAGES + 2
extern imageDisk *imageDiskList[2 + MAX_HDD_IMAGES];
extern imageDisk *imageDiskList[MAX_DISK_IMAGES];
extern imageDisk *diskSwap[20];
extern Bits swapPosition;
extern Bit16u imgDTASeg; /* Real memory location of temporary DTA pointer for fat image disk access */

396
include/bitop.h Normal file
View File

@ -0,0 +1,396 @@
#include <limits.h>
#include <stdint.h>
#include <utility>
namespace bitop {
/* Return the number of bits of the data type.
*
* The return value is sizeof() * CHAR_BIT. On most platforms today, CHAR_BIT == 8.
* CHAR_BIT could be other values if this is compiled on older mainframe platforms where
* a 'char' is less or more than 8 bits.
*
* @return Number of bits in data type T
*/
template <typename T=unsigned int> static inline constexpr unsigned int type_bits(void) {
return (unsigned int)sizeof(T) * (unsigned int)CHAR_BIT;
}
/* Return data type T with all bits 0
*
* The memory storage of such a value should show ALL bits set to 0.
*
* On CPUs today that use signed 2's complement integers, it is expected that: allzero() - (T)1u == allones()
* Subtracting 1 from all zeros should result in all ones.
*
* @return Type T with zero bits
*/
template <typename T=unsigned int> static inline constexpr T allzero(void) {
return (T)0;
}
/* Return data type T with all bits 1
*
* The memory storage of such a value should show ALL bits set to 1.
*
* On CPUs today that use signed 2's complement integers, it is expected that: allones() + (T)1u == allzero()
* Adding 1 to all ones should result in all zeros.
*
* @return Type T with set bits
*/
template <typename T=unsigned int> static inline constexpr T allones(void) {
return (T)( ~((T)0) );
}
/* Return data type T with value inverted
*
* This is to avoid typecast messes when masking by the inverse of a constant
*
* @return Type T with value inverted
*/
template <typename T=unsigned int> static inline constexpr T invert(const T v) {
return (T)( ~v );
}
/* private recursion function */
template <typename T=unsigned int> static inline constexpr unsigned int _bitlength_recursion(const T v,const unsigned int bits) {
return (v != allzero()) ? _bitlength_recursion(v >> (T)1u,bits + 1u) : bits;
}
/* Return minimum number of bits required to represent value 'v' in data type 'T'
*
* This function is declared constexpr so that the compiler can evaluate a constant value at compile
* time and insert the result as constant into the code. Since constexpr cannot use if(), while() and
* so on, recursion is used instead.
*
* @return Number of bits needed
*/
template <typename T=unsigned int,const T v> static inline constexpr unsigned int bitlength(void) {
return _bitlength_recursion<T>(v,0);
}
template <const unsigned int v> static inline constexpr unsigned int bitlength(void) {
return bitlength<unsigned int,v>();
}
/* non-constant version for runtime use */
template <typename T=unsigned int> static inline unsigned int bitlength(T v) {
unsigned int c = 0;
while ((v & 0xFFUL) == 0xFFUL) {
v >>= (T)8UL;
c += (T)8;
}
while (v != allzero<T>()) {
v >>= (T)1UL;
c++;
}
return c;
}
/* private recursion function */
template <typename T=unsigned int> static inline constexpr unsigned int _bitseqlength_recursionlsb(const T v,const unsigned int bits) {
return (v & 1u) ? _bitseqlength_recursionlsb<T>(v >> (T)1u,bits + 1u) : bits;
}
/* private common function */
template <typename T=unsigned int> static inline void _bitseqlengthlsb_1(unsigned int &c,T &v) {
while ((v & 0xFFUL) == 0xFFUL) {
v >>= (T)8UL;
c += (T)8;
}
while (v & 1u) {
v >>= (T)1UL;
c++;
}
}
/* Return number of sequential 1 bits counting from LSB in value 'v' of type 'T'
*
* THis counts bits from the LSB upward until a zero bit is encountered.
*
* A constexpr version is provided for use at compile time and a non-constexpr
* version is provided for use at runtime.
*
* @return Number of bits
*/
template <typename T=unsigned int,const T v> static inline constexpr unsigned int bitseqlengthlsb(void) {
return _bitseqlength_recursionlsb(v,0);
}
template <const unsigned int v> static inline constexpr unsigned int bitseqlengthlsb(void) {
return bitseqlengthlsb<unsigned int,v>();
}
template <typename T=unsigned int> static inline unsigned int bitseqlengthlsb(T v) {
unsigned int c = 0;
_bitseqlengthlsb_1(/*&*/c,/*&*/v);
return c;
}
/* Return binary mask of bit 'a'
*
* The returned bitmask should be usable to mask off bit 'a' and only bit 'a'.
*
* The function is constexpr to enable compile-time evaluation.
*
* @return Bitmask
*/
template <const unsigned int a,typename T=unsigned int> static inline constexpr T bit2mask(void) {
static_assert(a < type_bits<T>(), "bit2mask constexpr bit count too large for data type");
return (T)1U << (T)a;
}
template <typename T=unsigned int> static inline constexpr T bit2mask(const unsigned int a) {
return (T)1U << (T)a;
}
/* Return binary mask of MSB in type 'T'
*
* The returned bitmask should be usable to mask off the most significant bit of data type 'T'
*
* @return Bitmask
*/
template <typename T=unsigned int> static inline constexpr T type_msb_mask(void) {
return bit2mask<T>(type_bits<T>() - 1u);
}
/* Return binary mask of 'a' LSB bits starting at bit offset 'offset' in type 'T'
*
* The returned bitmask should be usable to mask off 'a' bits starting from the bottom (LSB) at bit 'offset'.
*
* Examples: bitcount2masklsb<1,0>() = 0x00000001U a=1 offset=0 bits 0 to 0
* bitcount2masklsb<4,0>() = 0x0000000FU a=4 offset=0 bits 3 to 0
* bitcount2masklsb<16,0>() = 0x0000FFFFU a=16 offset=0 bits 15 to 0
* bitcount2masklsb<4,4>() = 0x000000F0U a=4 offset=4 bits 7 to 4
*
* @return Bitmask
*/
template <const unsigned int a,const unsigned int offset,typename T=unsigned int> static inline constexpr T bitcount2masklsb(void) {
/* NTS: special case for a == type_bits because shifting the size of a register OR LARGER is undefined.
* On Intel x86 processors, with 32-bit integers, x >> 32 == x >> 0 because only the low 5 bits are used
* a % type_bits<T>() is there to keep a < type_bits<T> in case your C++11 compiler likes to trigger
* all static_assert<> clauses even if the ternary would not choose that path. */
static_assert(a <= type_bits<T>(), "bitcount2masklsb constexpr bit count too large for data type");
static_assert(offset < type_bits<T>(), "bitcount2masklsb constexpr offset count too large for data type");
static_assert((a+offset) <= type_bits<T>(), "bitcount2masklsb constexpr bit count + offset count too large for data type");
return ((a < type_bits<T>()) ? (bit2mask<a % type_bits<T>(),T>() - (T)1u) : allones<T>()) << (T)offset;
}
template <const unsigned int a,typename T=unsigned int> static inline constexpr T bitcount2masklsb(void) {
return bitcount2masklsb<a,0u,T>();
}
template <typename T=unsigned int> static inline constexpr T bitcount2masklsb(const unsigned int a,const unsigned int offset=0) {
/* NTS: special case for a == type_bits because shifting the size of a register OR LARGER is undefined.
* On Intel x86 processors, with 32-bit integers, x >> 32 == x >> 0 because only the low 5 bits are used */
return ((a < type_bits<T>()) ? (bit2mask<T>(a) - (T)1u) : allones<T>()) << (T)offset;
}
/* Return binary mask of 'a' MSB bits starting at bit offset 'offset' in type 'T'
*
* The returned bitmask should be usable to mask off 'a' bits starting from the top (MSB) at bit 'offset'.
*
* Examples: bitcount2maskmsb<1,0>() = 0x80000000U a=1 offset=0 bits 31 to 31
* bitcount2maskmsb<4,0>() = 0xF0000000U a=4 offset=0 bits 31 to 28
* bitcount2maskmsb<16,0>() = 0xFFFF0000U a=16 offset=0 bits 31 to 16
* bitcount2maskmsb<4,4>() = 0x0F000000U a=4 offset=4 bits 27 to 24
*
* @return Bitmask
*/
template <const unsigned int a,const unsigned int offset,typename T=unsigned int> static inline constexpr T bitcount2maskmsb(void) {
/* NTS: special case for a == type_bits because shifting the size of a register OR LARGER is undefined.
* On Intel x86 processors, with 32-bit integers, x >> 32 == x >> 0 because only the low 5 bits are used
* a % type_bits<T>() is there to keep a < type_bits<T> in case your C++11 compiler likes to trigger
* all static_assert<> clauses even if the ternary would not choose that path. */
static_assert(a <= type_bits<T>(), "bitcount2maskmsb constexpr bit count too large for data type");
static_assert(offset < type_bits<T>(), "bitcount2maskmsb constexpr offset count too large for data type");
static_assert((a+offset) <= type_bits<T>(), "bitcount2maskmsb constexpr bit count + offset count too large for data type");
return ((a != (T)0) ? ((T)(allones<T>() << (T)(type_bits<T>() - a)) >> (T)offset) : allzero<T>());
}
template <const unsigned int a,typename T=unsigned int> static inline constexpr T bitcount2maskmsb(void) {
return bitcount2maskmsb<a,0u,T>();
}
template <typename T=unsigned int> static inline constexpr T bitcount2maskmsb(const unsigned int a,const unsigned int offset=0) {
/* NTS: special case for a == type_bits because shifting the size of a register OR LARGER is undefined.
* On Intel x86 processors, with 32-bit integers, x >> 32 == x >> 0 because only the low 5 bits are used */
return ((a != (T)0) ? ((T)(allones<T>() << (T)(type_bits<T>() - a)) >> (T)offset) : allzero<T>());
}
/* Indicate whether 'a' is a power of 2.
*
* This code will NOT work correctly if a == 0, the result is to be considered undefined.
* Note that in real mathematics, there is no value x for which 2 to the power of 'x' equals zero.
* But you might be able to plug infinity into x to get really close to zero.
*
* The reason this works is that the binary value of an unsigned integer that holds a power of 2,
* when the power is 0 <= x < (number of bits), is exactly one '1' bit surrounded by zeros.
*
* 2^0 == 1 00000001
* 2^1 == 2 00000010
* 2^2 == 4 00000100
* 2^3 == 8 00001000
* 2^4 == 16 00010000
* 2^5 == 32 00100000
* 2^6 == 64 01000000
* 2^7 == 128 10000000
*
* Subtracting 1 from the power of 2 changes bit 'x' to zero and all bits 0 to (x-1) to one.
*
* 2^0 - 1 == 0 00000000 | 00000001 2^0 == 1
* 2^1 - 1 == 1 00000001 | 00000010 2^1 == 2
* 2^2 - 1 == 3 00000011 | 00000100 2^2 == 4
* 2^3 - 1 == 7 00000111 | 00001000 2^3 == 8
* 2^4 - 1 == 15 00001111 | 00010000 2^4 == 16
* 2^5 - 1 == 31 00011111 | 00100000 2^5 == 32
* 2^6 - 1 == 63 00111111 | 01000000 2^6 == 64
* 2^7 - 1 == 127 01111111 | 10000000 2^7 == 128
*
* Since subtracting 1 from 2^x changes the single bit to zero, ANDing (2^x) and (2^x - 1) should always
* produce a zero value.
*
* No other integer value has this property.
*
* 6 & 5 == 110 & 101 00000100
* 7 & 6 == 111 & 110 00000110
* 8 & 7 == 1000 & 0111 00000000
* 9 & 8 == 1001 & 1000 00001000
* 10 & 9 == 1010 & 1001 00001000
*
* AND truth table: +---------
* | --
* OUTPUT = a AND b --------+ -
* | +----- A · B
* OUTPUT is '1' if both a and b are '1' --------+ -
* | --
* 0 1 <- a +---------
* +----
* 0 |0 0
* 1 |0 1
* ^
* b
*
* For integer values, apply the AND operator to the same bit position from both integers for each bit across the width of the integer.
*
* @return Boolean true if 'a' is a power of 2 */
template <typename T=unsigned int> static inline constexpr bool ispowerof2(const unsigned int a) {
return (a & (a-(T)1u)) == 0;
}
/* Return log2(v), or the bit position of the highest '1' bit of value 'v'
*
* A value of '0' will return allones<unsigned int>() to indicate an invalid value.
*
* The constexpr templated version will trigger a static_assert if v == 0.
*
* log2(2^32 - 1) == 31 2^32 - 1 = 0xFFFFFFFF
* log2(2^31) == 31
* log2(2^30) == 30
* log2(2^16) == 16 2^16 == 65536
* log2(2^4) == 4 2^4 == 16
* log2(2^1) == 1 2^1 == 2
* log2(2^0) == 0 2^0 == 1
* log2(0) == ~0u (UINT_MAX or allones())
*
* @return Bitmask
*/
/* private recursion function */
template <typename T=unsigned int> static inline constexpr unsigned int _log2_recursion(const T v,const unsigned int bits) {
/* NTS: The additional check against v == allzero() is needed to avoid an infinite recursion loop */
return (v != allzero<T>()) ?
(((v & type_msb_mask<T>()) == allzero<T>()) ? _log2_recursion(v << (T)1u,bits - 1u) : bits) :
(~0u);
}
template <typename T=unsigned int,const T v> static inline constexpr unsigned int log2(void) {
return _log2_recursion<T>(v,type_bits<T>() - 1u);
}
template <const unsigned int v> static inline constexpr unsigned int log2(void) {
return log2<unsigned int,v>();
}
/* non-constant version for runtime use */
template <typename T=unsigned int> static inline unsigned int log2(T v) {
if (v != allzero<T>()) {
unsigned int c = type_bits<T>() - 1u;
while (!(v & type_msb_mask<T>())) {
v <<= (T)1UL;
c--;
}
return c;
}
return ~0u;
}
/* return type, pair */
class bitseqlengthandpos_ret_t {
public:
bitseqlengthandpos_ret_t(const unsigned int _start,const unsigned int _length) : start(_start), length(_length) { }
public:
bool operator==(const bitseqlengthandpos_ret_t &n) const {
return (n.start == start) &&
(n.length == length);
}
bool empty(void) const {
return (start == 0u && length == 0u);
}
public:
unsigned int start, length;
};
/* return a pair struct representing start and length of a series of 1 bits */
template <typename T=unsigned int> static inline bitseqlengthandpos_ret_t bitseqlengthandpos(T v) {
if (v != bitop::allzero<T>()) {
unsigned int start=0,length=0;
/* count zeros */
while ((v & (T)0xFFUL) == (T)0x00UL) {
start += (T)8;
v >>= (T)8UL;
}
while (!(v & (T)1u)) {
start++;
v >>= (T)1UL;
}
/* count ones */
while ((v & (T)0xFFUL) == (T)0xFFUL) {
length += (T)8;
v >>= (T)8UL;
}
while (v & (T)1u) {
length++;
v >>= (T)1UL;
}
return bitseqlengthandpos_ret_t(start,length);
}
return bitseqlengthandpos_ret_t(0u,0u);
}
void self_test(void);
}

View File

@ -0,0 +1,3 @@
/*auto-generated*/
#define UPDATED_STR "Sep 1, 2018 10:39:29am"
#define COPYRIGHT_END_YEAR "2018"

View File

@ -1,6 +1,9 @@
#include "dos_inc.h"
extern struct BuiltinFileBlob bfb_DSXMENU_EXE_PC; // DSXMENU.EXE
extern struct BuiltinFileBlob bfb_DSXMENU_EXE_PC98; // DSXMENU.EXE
extern struct BuiltinFileBlob bfb_CWSDPMI_EXE; // CWSDPMI.EXE
extern struct BuiltinFileBlob bfb_DOS32A_EXE; // DOS32A.EXE
extern struct BuiltinFileBlob bfb_DOS4GW_EXE; // DOS4GW.EXE

126
include/byteorder.h Normal file
View File

@ -0,0 +1,126 @@
/* MinGW implements some MSVC idioms, so always test for MinGW first. */
#if defined(__MINGW32__)
# if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
# define htobe16(x) htons(x)
# define htole16(x) (x)
# define be16toh(x) ntohs(x)
# define le16toh(x) (x)
# define htobe32(x) htonl(x)
# define htole32(x) (x)
# define be32toh(x) ntohl(x)
# define le32toh(x) (x)
# define htobe64(x) htonll(x)
# define htole64(x) (x)
# define be64toh(x) ntohll(x)
# define le64toh(x) (x)
# elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
# define htobe16(x) (x)
# define htole16(x) __builtin_bswap16(x)
# define be16toh(x) (x)
# define le16toh(x) __builtin_bswap16(x)
# define htobe32(x) (x)
# define htole32(x) __builtin_bswap32(x)
# define be32toh(x) (x)
# define le32toh(x) __builtin_bswap32(x)
# define htobe64(x) (x)
# define htole64(x) __builtin_bswap64(x)
# define be64toh(x) (x)
# define le64toh(x) __builtin_bswap64(x)
# else
# error Unexpected __BYTE_ORDER__
# endif /* __MINGW__ __BYTE_ORDER__ */
#elif defined(_MSC_VER)
# if BYTE_ORDER == LITTLE_ENDIAN
# define htobe16(x) htons(x)
# define htole16(x) (x)
# define be16toh(x) ntohs(x)
# define le16toh(x) (x)
# define htobe32(x) htonl(x)
# define htole32(x) (x)
# define be32toh(x) ntohl(x)
# define le32toh(x) (x)
# define htobe64(x) htonll(x)
# define htole64(x) (x)
# define be64toh(x) ntohll(x)
# define le64toh(x) (x)
# elif BYTE_ORDER == BIG_ENDIAN
# define htobe16(x) (x)
# define htole16(x) __builtin_bswap16(x)
# define be16toh(x) (x)
# define le16toh(x) __builtin_bswap16(x)
# define htobe32(x) (x)
# define htole32(x) __builtin_bswap32(x)
# define be32toh(x) (x)
# define le32toh(x) __builtin_bswap32(x)
# define htobe64(x) (x)
# define htole64(x) __builtin_bswap64(x)
# define be64toh(x) (x)
# define le64toh(x) __builtin_bswap64(x)
# else
# error Unexpected BYTE_ORDER.
# endif /* _MSC_VER BYTE_ORDER */
#elif defined(__APPLE__)
/* This is a simple compatibility shim to convert
* BSD/Linux endian macros to the Mac OS X equivalents. */
#include <libkern/OSByteOrder.h>
#define htobe16(x) OSSwapHostToBigInt16(x)
#define htole16(x) OSSwapHostToLittleInt16(x)
#define be16toh(x) OSSwapBigToHostInt16(x)
#define le16toh(x) OSSwapLittleToHostInt16(x)
#define htobe32(x) OSSwapHostToBigInt32(x)
#define htole32(x) OSSwapHostToLittleInt32(x)
#define be32toh(x) OSSwapBigToHostInt32(x)
#define le32toh(x) OSSwapLittleToHostInt32(x)
#define htobe64(x) OSSwapHostToBigInt64(x)
#define htole64(x) OSSwapHostToLittleInt64(x)
#define be64toh(x) OSSwapBigToHostInt64(x)
#define le64toh(x) OSSwapLittleToHostInt64(x)
#elif defined(__linux__) || defined(__CYGWIN__)
#include <endian.h>
#elif defined(__OpenBSD__)
#include <sys/endian.h>
#elif defined(__NetBSD__) || defined(__FreeBSD__) || defined(__DragonFly__)
#include <sys/endian.h>
#define be16toh(x) betoh16(x)
#define le16toh(x) letoh16(x)
#define be32toh(x) betoh32(x)
#define le32toh(x) letoh32(x)
#define be64toh(x) betoh64(x)
#define le64toh(x) letoh64(x)
#endif

View File

@ -33,8 +33,8 @@ enum { CB_RETN,CB_RETF,CB_RETF8,CB_IRET,CB_IRETD,CB_IRET_STI,CB_IRET_EOI_PIC1,
CB_INT21,CB_INT13,CB_VESA_START,CB_IRET_EOI_PIC2,CB_CPM };
/* NTS: Cannot make runtime configurable, because CB_MAX is used to define an array */
#define CB_MAX 128
#define CB_SIZE 32
#define CB_MAX 128U
#define CB_SIZE 32U
/* we can make THESE configurable though! */
//#define CB_SEG 0xF000
@ -54,8 +54,8 @@ static INLINE PhysPt CALLBACK_PhysPointer(Bitu callback) {
return PhysMake(CB_SEG,(Bit16u)(CB_SOFFSET+callback*CB_SIZE));
}
static INLINE PhysPt CALLBACK_GetBase(void) {
return (CB_SEG << 4) + CB_SOFFSET;
static inline PhysPt CALLBACK_GetBase(void) {
return (PhysPt)(((PhysPt)CB_SEG << (PhysPt)4U) + (PhysPt)CB_SOFFSET);
}
Bitu CALLBACK_Allocate();

View File

@ -21,8 +21,8 @@
#define DOSBOX_CONTROL_H
#ifdef _MSC_VER
#pragma warning ( disable : 4786 )
#pragma warning ( disable : 4290 )
//#pragma warning ( disable : 4786 )
//#pragma warning ( disable : 4290 )
#endif
#ifndef DOSBOX_PROGRAMS_H
@ -59,10 +59,11 @@ private:
typedef std::list<Section*>::reverse_iterator reverse_it;
typedef std::list<Section*>::const_iterator const_it;
typedef std::list<Section*>::const_reverse_iterator const_reverse_it;
void (* _start_function)(void);
// void (* _start_function)(void);
bool secure_mode; //Sandbox mode
public:
bool initialised;
std::vector<std::string> auto_bat_additional;
std::vector<std::string> startup_params;
std::vector<std::string> configfiles;
Config(CommandLine * cmd):cmdline(cmd),secure_mode(false) {
@ -90,10 +91,13 @@ public:
opt_erasemapper = false;
opt_resetmapper = false;
opt_startmapper = false;
opt_fastbioslogo = false;
opt_date_host_forced = false;
opt_disable_numlock_check = false;
opt_disable_dpi_awareness = false;
}
opt_time_limit = -1;
opt_log_con = false;
}
~Config();
Section_line * AddSection_line(char const * const _name,void (*_initfunction)(Section*));
@ -109,12 +113,15 @@ public:
bool SecureMode() const { return secure_mode; }
void SwitchToSecureMode() { secure_mode = true; }//can't be undone
public:
bool opt_log_con;
double opt_time_limit;
std::string opt_editconf,opt_opensaves,opt_opencaptures,opt_lang;
std::vector<std::string> config_file_list;
std::vector<std::string> opt_c;
bool opt_disable_dpi_awareness;
bool opt_disable_numlock_check;
bool opt_date_host_forced;
bool opt_fastbioslogo;
bool opt_break_start;
bool opt_erasemapper;
bool opt_resetmapper;

View File

@ -52,25 +52,25 @@
#define CPU_ARCHTYPE_PPROSLOW 0x60
/* CPU Cycle Timing */
extern Bit32s CPU_Cycles;
extern Bit32s CPU_CycleLeft;
extern Bit32s CPU_CycleMax;
extern Bit32s CPU_OldCycleMax;
extern Bit32s CPU_CyclePercUsed;
extern Bit32s CPU_CycleLimit;
extern Bit64s CPU_IODelayRemoved;
extern cpu_cycles_count_t CPU_Cycles;
extern cpu_cycles_count_t CPU_CycleLeft;
extern cpu_cycles_count_t CPU_CycleMax;
extern cpu_cycles_count_t CPU_OldCycleMax;
extern cpu_cycles_count_t CPU_CyclePercUsed;
extern cpu_cycles_count_t CPU_CycleLimit;
extern cpu_cycles_count_t CPU_IODelayRemoved;
extern cpu_cycles_count_t CPU_CyclesSet;
extern unsigned char CPU_AutoDetermineMode;
extern char core_mode[16];
extern bool CPU_CycleAutoAdjust;
extern bool CPU_SkipCycleAutoAdjust;
extern Bitu CPU_AutoDetermineMode;
extern Bitu CPU_CyclesCur;
extern Bit32s CPU_CyclesSet;
extern char core_mode[16];
extern bool enable_weitek;
extern Bitu CPU_ArchitectureType;
extern unsigned char CPU_ArchitectureType;
extern Bitu CPU_PrefetchQueueSize;
extern unsigned int CPU_PrefetchQueueSize;
/* Some common Defines */
/* A CPU Handler */
@ -194,61 +194,61 @@ void CPU_Push32(Bitu value);
void CPU_SetFlags(Bitu word,Bitu mask);
#define EXCEPTION_UD 6
#define EXCEPTION_DF 8
#define EXCEPTION_TS 10
#define EXCEPTION_NP 11
#define EXCEPTION_SS 12
#define EXCEPTION_GP 13
#define EXCEPTION_PF 14
#define EXCEPTION_UD 6u
#define EXCEPTION_DF 8u
#define EXCEPTION_TS 10u
#define EXCEPTION_NP 11u
#define EXCEPTION_SS 12u
#define EXCEPTION_GP 13u
#define EXCEPTION_PF 14u
#define CR0_PROTECTION 0x00000001
#define CR0_MONITORPROCESSOR 0x00000002
#define CR0_FPUEMULATION 0x00000004
#define CR0_TASKSWITCH 0x00000008
#define CR0_FPUPRESENT 0x00000010
#define CR0_WRITEPROTECT 0x00010000
#define CR0_PAGING 0x80000000
#define CR0_PROTECTION 0x00000001u
#define CR0_MONITORPROCESSOR 0x00000002u
#define CR0_FPUEMULATION 0x00000004u
#define CR0_TASKSWITCH 0x00000008u
#define CR0_FPUPRESENT 0x00000010u
#define CR0_WRITEPROTECT 0x00010000u
#define CR0_PAGING 0x80000000u
// *********************************************************************
// Descriptor
// *********************************************************************
#define DESC_INVALID 0x00
#define DESC_286_TSS_A 0x01
#define DESC_LDT 0x02
#define DESC_286_TSS_B 0x03
#define DESC_286_CALL_GATE 0x04
#define DESC_TASK_GATE 0x05
#define DESC_286_INT_GATE 0x06
#define DESC_286_TRAP_GATE 0x07
#define DESC_INVALID 0x00u
#define DESC_286_TSS_A 0x01u
#define DESC_LDT 0x02u
#define DESC_286_TSS_B 0x03u
#define DESC_286_CALL_GATE 0x04u
#define DESC_TASK_GATE 0x05u
#define DESC_286_INT_GATE 0x06u
#define DESC_286_TRAP_GATE 0x07u
#define DESC_386_TSS_A 0x09
#define DESC_386_TSS_B 0x0b
#define DESC_386_CALL_GATE 0x0c
#define DESC_386_INT_GATE 0x0e
#define DESC_386_TRAP_GATE 0x0f
#define DESC_386_TSS_A 0x09u
#define DESC_386_TSS_B 0x0bu
#define DESC_386_CALL_GATE 0x0cu
#define DESC_386_INT_GATE 0x0eu
#define DESC_386_TRAP_GATE 0x0fu
/* EU/ED Expand UP/DOWN RO/RW Read Only/Read Write NA/A Accessed */
#define DESC_DATA_EU_RO_NA 0x10
#define DESC_DATA_EU_RO_A 0x11
#define DESC_DATA_EU_RW_NA 0x12
#define DESC_DATA_EU_RW_A 0x13
#define DESC_DATA_ED_RO_NA 0x14
#define DESC_DATA_ED_RO_A 0x15
#define DESC_DATA_ED_RW_NA 0x16
#define DESC_DATA_ED_RW_A 0x17
#define DESC_DATA_EU_RO_NA 0x10u
#define DESC_DATA_EU_RO_A 0x11u
#define DESC_DATA_EU_RW_NA 0x12u
#define DESC_DATA_EU_RW_A 0x13u
#define DESC_DATA_ED_RO_NA 0x14u
#define DESC_DATA_ED_RO_A 0x15u
#define DESC_DATA_ED_RW_NA 0x16u
#define DESC_DATA_ED_RW_A 0x17u
/* N/R Readable NC/C Confirming A/NA Accessed */
#define DESC_CODE_N_NC_A 0x18
#define DESC_CODE_N_NC_NA 0x19
#define DESC_CODE_R_NC_A 0x1a
#define DESC_CODE_R_NC_NA 0x1b
#define DESC_CODE_N_C_A 0x1c
#define DESC_CODE_N_C_NA 0x1d
#define DESC_CODE_R_C_A 0x1e
#define DESC_CODE_R_C_NA 0x1f
#define DESC_CODE_N_NC_A 0x18u
#define DESC_CODE_N_NC_NA 0x19u
#define DESC_CODE_R_NC_A 0x1au
#define DESC_CODE_R_NC_NA 0x1bu
#define DESC_CODE_N_C_A 0x1cu
#define DESC_CODE_N_C_NA 0x1du
#define DESC_CODE_R_C_A 0x1eu
#define DESC_CODE_R_C_NA 0x1fu
#ifdef _MSC_VER
#pragma pack (1)
@ -358,9 +358,12 @@ public:
void Load(PhysPt address);
void Save(PhysPt address);
PhysPt GetBase (void) {
return (saved.seg.base_24_31<<24) | (saved.seg.base_16_23<<16) | saved.seg.base_0_15;
}
PhysPt GetBase (void) const {
return (PhysPt)(
((PhysPt)saved.seg.base_24_31 << (PhysPt)24U) |
((PhysPt)saved.seg.base_16_23 << (PhysPt)16U) |
(PhysPt)saved.seg.base_0_15);
}
bool GetExpandDown (void) {
#if 0
Bit32u limit_0_15 :16;
@ -387,27 +390,27 @@ public:
/* it's data. return the 'E' bit */
return (saved.seg.type & 4) != 0;
}
Bitu GetLimit (void) {
Bitu limit = (saved.seg.limit_16_19<<16) | saved.seg.limit_0_15;
if (saved.seg.g) return (limit<<12) | 0xFFF;
Bitu GetLimit (void) const {
const Bitu limit = ((Bitu)saved.seg.limit_16_19 << (Bitu)16U) | (Bitu)saved.seg.limit_0_15;
if (saved.seg.g) return ((Bitu)limit << (Bitu)12U) | (Bitu)0xFFFU;
return limit;
}
Bitu GetOffset(void) {
return (saved.gate.offset_16_31 << 16) | saved.gate.offset_0_15;
Bitu GetOffset(void) const {
return ((Bitu)saved.gate.offset_16_31 << (Bitu)16U) | (Bitu)saved.gate.offset_0_15;
}
Bitu GetSelector(void) {
Bitu GetSelector(void) const {
return saved.gate.selector;
}
Bitu Type(void) {
Bitu Type(void) const {
return saved.seg.type;
}
Bitu Conforming(void) {
return saved.seg.type & 8;
Bitu Conforming(void) const {
return saved.seg.type & 8U;
}
Bitu DPL(void) {
Bitu DPL(void) const {
return saved.seg.dpl;
}
Bitu Big(void) {
Bitu Big(void) const {
return saved.seg.big;
}
public:
@ -420,53 +423,53 @@ public:
class DescriptorTable {
public:
PhysPt GetBase (void) { return table_base; }
Bitu GetLimit (void) { return table_limit; }
void SetBase (PhysPt _base) { table_base = _base; }
void SetLimit (Bitu _limit) { table_limit= _limit; }
PhysPt GetBase (void) const { return table_base; }
Bitu GetLimit (void) const { return table_limit; }
void SetBase (PhysPt _base) { table_base = _base; }
void SetLimit (Bitu _limit) { table_limit= _limit; }
bool GetDescriptor (Bitu selector, Descriptor& desc) {
selector&=~7;
if (selector>=table_limit) return false;
desc.Load(table_base+(selector));
return true;
}
bool GetDescriptor (Bitu selector, Descriptor& desc) {
selector&=~7U;
if (selector>=table_limit) return false;
desc.Load((PhysPt)(table_base+selector));
return true;
}
protected:
PhysPt table_base;
Bitu table_limit;
PhysPt table_base;
Bitu table_limit;
};
class GDTDescriptorTable : public DescriptorTable {
public:
bool GetDescriptor(Bitu selector, Descriptor& desc) {
Bitu address=selector & ~7;
if (selector & 4) {
Bitu address=selector & ~7U;
if (selector & 4U) {
if (address>=ldt_limit) return false;
desc.Load(ldt_base+address);
desc.Load((PhysPt)(ldt_base+address));
return true;
} else {
if (address>=table_limit) return false;
desc.Load(table_base+address);
desc.Load((PhysPt)(table_base+address));
return true;
}
}
bool SetDescriptor(Bitu selector, Descriptor& desc) {
Bitu address=selector & ~7;
if (selector & 4) {
Bitu address=selector & ~7U;
if (selector & 4U) {
if (address>=ldt_limit) return false;
desc.Save(ldt_base+address);
desc.Save((PhysPt)(ldt_base+address));
return true;
} else {
if (address>=table_limit) return false;
desc.Save(table_base+address);
desc.Save((PhysPt)(table_base+address));
return true;
}
}
Bitu SLDT(void) {
Bitu SLDT(void) const {
return ldt_value;
}
bool LLDT(Bitu value) {
bool LLDT(Bitu value) {
if ((value&0xfffc)==0) {
ldt_value=0;
ldt_base=0;
@ -491,15 +494,15 @@ private:
class TSS_Descriptor : public Descriptor {
public:
Bitu IsBusy(void) {
Bitu IsBusy(void) const {
return saved.seg.type & 2;
}
Bitu Is386(void) {
Bitu Is386(void) const {
return saved.seg.type & 8;
}
void SetBusy(bool busy) {
if (busy) saved.seg.type|=2;
else saved.seg.type&=~2;
void SetBusy(const bool busy) {
if (busy) saved.seg.type|=(2U);
else saved.seg.type&=(~2U); /* -Wconversion cannot silence without hard-coding ~2U & 0x1F */
}
};
@ -538,13 +541,13 @@ struct CPUBlock {
extern CPUBlock cpu;
static INLINE void CPU_SetFlagsd(Bitu word) {
Bitu mask=cpu.cpl ? FMASK_NORMAL : FMASK_ALL;
static INLINE void CPU_SetFlagsd(const Bitu word) {
const Bitu mask=cpu.cpl ? FMASK_NORMAL : FMASK_ALL;
CPU_SetFlags(word,mask);
}
static INLINE void CPU_SetFlagsw(Bitu word) {
Bitu mask=(cpu.cpl ? FMASK_NORMAL : FMASK_ALL) & 0xffff;
static INLINE void CPU_SetFlagsw(const Bitu word) {
const Bitu mask=(cpu.cpl ? FMASK_NORMAL : FMASK_ALL) & 0xffff;
CPU_SetFlags(word,mask);
}

View File

@ -32,7 +32,8 @@
#if defined (_MSC_VER) /* MS Visual C++ */
#include <direct.h>
#include <io.h>
#define LONGTYPE(a) a##i64
#define ULONGTYPE(a) a##ULL
#define LONGTYPE(a) a##LL
#define snprintf _snprintf
#define vsnprintf _vsnprintf
#define alloca _alloca
@ -40,6 +41,7 @@
#else /* LINUX / GCC */
#include <dirent.h>
#include <unistd.h>
#define ULONGTYPE(a) a##ULL
#define LONGTYPE(a) a##LL
#endif
@ -70,6 +72,7 @@ static inline float powf (float x, float y) { return (float) pow (x,y); }
class Cross {
public:
static void GetPlatformResDir(std::string& in);
static void GetPlatformConfigDir(std::string& in);
static void GetPlatformConfigName(std::string& in);
static void CreatePlatformConfigDir(std::string& in);

View File

@ -45,7 +45,6 @@ public:
Bit8u DMA16;
bool increment;
bool autoinit;
Bit8u trantype;
bool masked;
bool tcount;
bool request;
@ -81,7 +80,7 @@ public:
}
void SetPage(Bit8u val) {
pagenum=val;
pagebase=(pagenum >> DMA16_PAGESHIFT) << (16+DMA16_PAGESHIFT);
pagebase=(Bitu)((Bitu)(pagenum >> DMA16_PAGESHIFT) << (Bitu)(16u + DMA16_PAGESHIFT));
}
void Raise_Request(void) {
request=true;

View File

@ -124,7 +124,6 @@ extern Bitu DOS_FILES;
#define DOS_SDA_SEG 0xb2 // dos swappable area
#define DOS_SDA_OFS 0
#define DOS_CDS_SEG 0x108
#define DOS_FIRST_SHELL 0x118
#define DOS_MEM_START 0x158 // regression to r3437 fixes nascar 2 colors
//#define DOS_MEM_START 0x16f //First Segment that DOS can use
@ -138,10 +137,9 @@ extern Bit16u DOS_INFOBLOCK_SEG;// 0x80 // sysvars (list of lists)
extern Bit16u DOS_CONDRV_SEG;// 0xa0
extern Bit16u DOS_CONSTRING_SEG;// 0xa8
extern Bit16u DOS_SDA_SEG;// 0xb2 // dos swappable area
extern Bit16u DOS_SDA_SEG_SIZE;
extern Bit16u DOS_SDA_OFS;// 0
extern Bit16u DOS_CDS_SEG;// 0x108
extern Bit16u DOS_FIRST_SHELL;// 0x118
extern Bit16u DOS_FIRST_SHELL_END;
extern Bit16u DOS_MEM_START;// 0x158 // regression to r3437 fixes nascar 2 colors
extern Bit16u DOS_PRIVATE_SEGMENT;// 0xc800
@ -320,6 +318,7 @@ static INLINE Bit16u DOS_PackDate(Bit16u year,Bit16u mon,Bit16u day) {
#define DOSERR_REMOVE_CURRENT_DIRECTORY 16
#define DOSERR_NOT_SAME_DEVICE 17
#define DOSERR_NO_MORE_FILES 18
#define DOSERR_WRITE_PROTECTED 19
#define DOSERR_FILE_ALREADY_EXISTS 80
@ -683,14 +682,11 @@ extern DOS_InfoBlock dos_infoblock;
struct DOS_Block {
DOS_Date date;
bool hostdate;
DOS_Version version;
Bit16u firstMCB;
Bit16u errorcode;
Bit16u psp();//{return DOS_SDA(DOS_SDA_SEG,DOS_SDA_OFS).GetPSP();};
void psp(Bit16u _seg);//{ DOS_SDA(DOS_SDA_SEG,DOS_SDA_OFS).SetPSP(_seg);};
Bit16u env;
RealPt cpmentry;
RealPt dta();//{return DOS_SDA(DOS_SDA_SEG,DOS_SDA_OFS).GetDTA();};
void dta(RealPt _dta);//{DOS_SDA(DOS_SDA_SEG,DOS_SDA_OFS).SetDTA(_dta);};
Bit8u return_code,return_mode;
@ -720,4 +716,12 @@ static INLINE Bit8u RealHandle(Bit16u handle) {
return psp.GetFileHandle(handle);
}
struct DOS_GetMemLog_Entry {
Bit16u segbase;
Bit16u pages;
std::string who;
};
extern std::list<DOS_GetMemLog_Entry> DOS_GetMemLog;
#endif

View File

@ -78,11 +78,11 @@ public:
DOS_File & operator= (const DOS_File & orig);
virtual ~DOS_File(){if(name) delete [] name;};
virtual bool Read(Bit8u * data,Bit16u * size)=0;
virtual bool Write(Bit8u * data,Bit16u * size)=0;
virtual bool Write(const Bit8u * data,Bit16u * size)=0;
virtual bool Seek(Bit32u * pos,Bit32u type)=0;
virtual bool Close()=0;
/* ert, 20100711: Locking extensions */
virtual bool LockFile(Bit8u mode, Bit32u pos, Bit16u size) { return false; };
virtual bool LockFile(Bit8u mode, Bit32u pos, Bit16u size) { (void)mode; (void)pos; (void)size; return false; };
virtual Bit16u GetInformation(void)=0;
virtual void SetName(const char* _name) { if (name) delete[] name; name = new char[strlen(_name)+1]; strcpy(name,_name); }
virtual char* GetName(void) { return name; };
@ -125,7 +125,7 @@ public:
DOS_Device():DOS_File(),devnum(0){};
virtual ~DOS_Device() {};
virtual bool Read(Bit8u * data,Bit16u * size);
virtual bool Write(Bit8u * data,Bit16u * size);
virtual bool Write(const Bit8u * data,Bit16u * size);
virtual bool Seek(Bit32u * pos,Bit32u type);
virtual bool Close();
virtual Bit16u GetInformation(void);
@ -260,19 +260,21 @@ public:
virtual Bits UnMount(void)=0;
/* these 4 may only be used by DOS_Drive_Cache because they have special calling conventions */
virtual void *opendir(const char *dir) {return NULL;};
virtual void closedir(void *handle) {};
virtual bool read_directory_first(void *handle, char* entry_name, bool& is_directory) { return false; };
virtual bool read_directory_next(void *handle, char* entry_name, bool& is_directory) { return false; };
virtual void *opendir(const char *dir) { (void)dir; return NULL; };
virtual void closedir(void *handle) { (void)handle; };
virtual bool read_directory_first(void *handle, char* entry_name, bool& is_directory) { (void)handle; (void)entry_name; (void)is_directory; return false; };
virtual bool read_directory_next(void *handle, char* entry_name, bool& is_directory) { (void)handle; (void)entry_name; (void)is_directory; return false; };
virtual const char * GetInfo(void);
char * GetBaseDir(void);
bool readonly;
bool nocachedir;
char curdir[DOS_PATHLENGTH];
char info[256];
/* Can be overridden for example in iso images */
virtual char const * GetLabel() {return "NOLABEL";};
virtual void SetLabel(const char *label, bool iscdrom, bool updatable) {};
virtual void SetLabel(const char *label, bool iscdrom, bool updatable) { (void)label; (void)iscdrom; (void)updatable; };
virtual void EmptyCache() {};
virtual void MediaChange() {};
// disk cycling functionality (request resources)

View File

@ -44,15 +44,22 @@
# define HAS_LONG_DOUBLE 1
#endif
#define UPDATED_STR "April 9, 2015"
GCC_ATTRIBUTE(noreturn) void E_Exit(const char * message,...) GCC_ATTRIBUTE( __format__(__printf__, 1, 2));
typedef Bits cpu_cycles_count_t;
typedef Bitu cpu_cycles_countu_t;
#include "clockdomain.h"
class Config;
class Section;
#if defined(__GNUC__)
# define DEPRECATED __attribute__((deprecated))
#else
# define DEPRECATED
#endif
enum MachineType {
MCH_HERC,
MCH_CGA,
@ -61,7 +68,12 @@ enum MachineType {
MCH_EGA,
MCH_VGA,
MCH_AMSTRAD,
MCH_PC98
MCH_PC98,
MCH_FM_TOWNS, // STUB!!
MCH_MCGA, // IBM PS/2 model 30 Multi-Color Graphics Adapter
MCH_MDA
};
enum SVGACards {
@ -79,8 +91,8 @@ extern SVGACards svgaCard;
extern MachineType machine;
extern bool SDLNetInited;
extern bool mono_cga;
extern bool mainline_compatible_mapping;
extern bool mainline_compatible_bios_mapping;
extern bool DEPRECATED mainline_compatible_mapping;
extern bool DEPRECATED mainline_compatible_bios_mapping;
#ifdef __SSE__
extern bool sse1_available;
@ -98,8 +110,11 @@ void DOSBOX_Init(void);
/* machine tests for use with if() statements */
#define IS_TANDY_ARCH ((machine==MCH_TANDY) || (machine==MCH_PCJR))
#define IS_EGAVGA_ARCH ((machine==MCH_EGA) || (machine==MCH_VGA))
#define IS_VGA_ARCH (machine==MCH_VGA)
#define IS_PC98_ARCH (machine==MCH_PC98)
#define IS_EGA_ARCH (machine==MCH_EGA)
#define IS_VGA_ARCH (machine==MCH_VGA)
#define IS_PC98_ARCH (machine==MCH_PC98)
#define IS_FM_TOWNS (machine==MCH_FM_TOWNS)
/* machine tests for use with switch() statements */
#define TANDY_ARCH_CASE MCH_TANDY: case MCH_PCJR
@ -107,6 +122,8 @@ void DOSBOX_Init(void);
#define VGA_ARCH_CASE MCH_VGA
#define PC98_ARCH_CASE MCH_PC98
#define FM_TOWNS_ARCH_CASE MCH_FM_TOWNS
#ifndef DOSBOX_LOGGING_H
#include "logging.h"
#endif // the logging system.
@ -114,13 +131,10 @@ void DOSBOX_Init(void);
extern ClockDomain clockdom_PCI_BCLK;
extern ClockDomain clockdom_ISA_OSC;
extern ClockDomain clockdom_ISA_BCLK;
extern ClockDomain clockdom_8254_PIT;
extern ClockDomain clockdom_8250_UART;
signed long long time_to_clockdom(ClockDomain &src,double t);
unsigned long long update_clockdom_from_now(ClockDomain &dst);
unsigned long long update_ISA_OSC_clock();
unsigned long long update_8254_PIT_clock();
unsigned long long update_ISA_BCLK_clock();
unsigned long long update_PCI_BCLK_clock();
@ -143,4 +157,7 @@ int utf16le_decode(const char **ptr,const char *fence);
typedef char utf8_t;
typedef uint16_t utf16_t;
/* for DOS filename handling we want a toupper that uses the MS-DOS code page within not the locale of the host */
int ascii_toupper(int c);
#endif /* DOSBOX_DOSBOX_H */

View File

@ -199,38 +199,38 @@ static INLINE void FPU_SetCW(Bitu word){
static INLINE Bitu FPU_GET_TOP(void) {
return (fpu.sw & 0x3800)>>11;
return (fpu.sw & 0x3800U) >> 11U;
}
static INLINE void FPU_SET_TOP(Bitu val){
fpu.sw &= ~0x3800;
fpu.sw |= (val&7)<<11;
fpu.sw &= ~0x3800U;
fpu.sw |= (val & 7U) << 11U;
}
static INLINE void FPU_SET_C0(Bitu C){
fpu.sw &= ~0x0100;
if(C) fpu.sw |= 0x0100;
fpu.sw &= ~0x0100U;
if(C) fpu.sw |= 0x0100U;
}
static INLINE void FPU_SET_C1(Bitu C){
fpu.sw &= ~0x0200;
if(C) fpu.sw |= 0x0200;
fpu.sw &= ~0x0200U;
if(C) fpu.sw |= 0x0200U;
}
static INLINE void FPU_SET_C2(Bitu C){
fpu.sw &= ~0x0400;
if(C) fpu.sw |= 0x0400;
fpu.sw &= ~0x0400U;
if(C) fpu.sw |= 0x0400U;
}
static INLINE void FPU_SET_C3(Bitu C){
fpu.sw &= ~0x4000;
if(C) fpu.sw |= 0x4000;
fpu.sw &= ~0x4000U;
if(C) fpu.sw |= 0x4000U;
}
static INLINE void FPU_SET_D(Bitu C){
fpu.sw &= ~0x0002;
if(C) fpu.sw |= 0x0002;
fpu.sw &= ~0x0002U;
if(C) fpu.sw |= 0x0002U;
}

View File

@ -12,7 +12,9 @@ extern void (*ide_inits[MAX_IDE_CONTROLLERS])(Section *);
void IDE_Auto(signed char &index,bool &slave);
void IDE_CDROM_Attach(signed char index,bool slave,unsigned char drive_index);
void IDE_CDROM_Detach(unsigned char drive_index);
void IDE_Hard_Disk_Attach(signed char index,bool slave,unsigned char bios_drive_index);
void IDE_Hard_Disk_Detach(unsigned char bios_drive_index);
void IDE_ResetDiskByBIOS(unsigned char disk);
#endif

View File

@ -73,8 +73,8 @@ static const Bitu IOMASK_FULL = 0xFFFFU; /* full 16-bit decode */
* ~(0x10 - 1) = ~0xF = 0xFFFFFFF0
*
*/
static inline const Bitu IOMASK_Range(const Bitu x) {
return ~(x - 1);
static inline constexpr Bitu IOMASK_Range(const Bitu x) {
return ~((Bitu)x - (Bitu)1U);
}
/* combine range mask with IOMASK value.
@ -84,7 +84,7 @@ static inline const Bitu IOMASK_Range(const Bitu x) {
* IOMASK_Combine(IOMASK_ISA_10BIT,IOMASK_Range(16));
*
*/
static inline const Bitu IOMASK_Combine(const Bitu a,const Bitu b) {
static inline constexpr Bitu IOMASK_Combine(const Bitu a,const Bitu b) {
return a & b;
}
@ -168,15 +168,15 @@ void IO_InitCallouts(void);
typedef uint32_t IO_Callout_t;
static inline uint32_t IO_Callout_t_comb(const enum IO_Type_t t,const uint32_t idx) {
static inline constexpr uint32_t IO_Callout_t_comb(const enum IO_Type_t t,const uint32_t idx) {
return ((uint32_t)t << (uint32_t)28) + idx;
}
static inline enum IO_Type_t IO_Callout_t_type(const IO_Callout_t t) {
static inline constexpr enum IO_Type_t IO_Callout_t_type(const IO_Callout_t t) {
return (enum IO_Type_t)(t >> 28);
}
static inline uint32_t IO_Callout_t_index(const IO_Callout_t t) {
static inline constexpr uint32_t IO_Callout_t_index(const IO_Callout_t t) {
return t & (((uint32_t)1 << (uint32_t)28) - (uint32_t)1);
}

View File

@ -66,7 +66,9 @@ enum KBD_KEYS {
/* for Japanese A01 (106) key [http://www.mediafire.com/download/t968ydz6ky92myl/dosbox74.zip] */
/* see reference image [https://upload.wikimedia.org/wikipedia/commons/thumb/b/bc/KB_Japanese.svg/1280px-KB_Japanese.svg.png] */
KBD_jp_yen, KBD_jp_backslash,
KBD_jp_yen, KBD_jp_backslash, KBD_colon, KBD_caret, KBD_atsign, KBD_jp_ro, KBD_help, KBD_kpcomma,
KBD_stop, KBD_copy, KBD_vf1, KBD_vf2, KBD_vf3, KBD_vf4, KBD_vf5, KBD_kana,
KBD_nfer, KBD_xfer,
KBD_LAST
};

24
include/keymap.h Normal file
View File

@ -0,0 +1,24 @@
/* DOSBox-X keymap handling */
#ifndef __DOSBOX_X_KEYMAP
#define __DOSBOX_X_KEYMAP
/* these enumerations are meant to represent the host OS keyboard map,
* as well as the keymap used by the mapper interface */
enum {
// #0
DKM_US=0, // US keyboard layout
DKM_DEU, // German keyboard layout (one concerned user, in issue tracker)
DKM_JPN_PC98, // Japanese PC98 keyboard layout (for PC-98 emulation)
DKM_JPN, // Japanese keyboard layout (one concerned user, in issue tracker, with suggestion for mapping Ro)
DKM_MAX
};
extern unsigned int mapper_keyboard_layout;
extern unsigned int host_keyboard_layout;
const char *DKM_to_string(const unsigned int dkm);
const char *DKM_to_descriptive_string(const unsigned int dkm);
#endif //__DOSBOX_X_KEYMAP

View File

@ -19,15 +19,21 @@
#ifndef DOSBOX_MAPPER_H
#define DOSBOX_MAPPER_H
enum MapKeys {
MK_f1,MK_f2,MK_f3,MK_f4,MK_f5,MK_f6,MK_f7,MK_f8,MK_f9,MK_f10,MK_f11,MK_f12,
MK_return,MK_kpminus,MK_kpplus,MK_equals,MK_scrolllock,MK_printscreen,MK_pause,MK_home,
MK_1, MK_2, MK_3, MK_4
#include "include/menu.h"
enum MapKeys {
MK_nothing,
MK_f1,MK_f2,MK_f3,MK_f4,MK_f5,MK_f6,MK_f7,MK_f8,MK_f9,MK_f10,MK_f11,MK_f12,
MK_return,MK_kpminus,MK_kpplus,MK_minus,MK_equals,MK_scrolllock,MK_printscreen,MK_pause,MK_home,MK_rightarrow,
MK_1, MK_2, MK_3, MK_4,
MK_c, MK_d, MK_f, MK_m, MK_r, MK_s, MK_v, MK_w,
MK_escape,
MK_MAX
};
typedef void (MAPPER_Handler)(bool pressed);
void MAPPER_AddHandler(MAPPER_Handler * handler,MapKeys key,Bitu mods,char const * const eventname,char const * const buttonname);
void MAPPER_AddHandler(MAPPER_Handler * handler,MapKeys key,Bitu mods,char const * const eventname,char const * const buttonname,DOSBoxMenu::item **ret_menuitem=NULL);
void MAPPER_Init(void);
void MAPPER_StartUp();
void MAPPER_Run(bool pressed);
@ -38,5 +44,7 @@ void MAPPER_LosingFocus(void);
#define MMOD1 0x1
#define MMOD2 0x2
#define MMOD3 0x4
#define MMODHOST 0x8
#endif

View File

@ -23,280 +23,162 @@
#include "dosbox.h"
#endif
/* MinGW implements some MSVC idioms, so always test for MinGW first. */
#if defined(__MINGW32__)
#include "byteorder.h"
# if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
#define MEM_PAGESIZE (4096U)
# define htobe16(x) htons(x)
# define htole16(x) (x)
# define be16toh(x) ntohs(x)
# define le16toh(x) (x)
typedef Bit8u const * ConstHostPt; /* host (virtual) memory address aka ptr */
# define htobe32(x) htonl(x)
# define htole32(x) (x)
# define be32toh(x) ntohl(x)
# define le32toh(x) (x)
typedef Bit8u * HostPt; /* host (virtual) memory address aka ptr */
# define htobe64(x) htonll(x)
# define htole64(x) (x)
# define be64toh(x) ntohll(x)
# define le64toh(x) (x)
typedef Bit32u PhysPt; /* guest physical memory pointer */
typedef Bit32u LinearPt; /* guest linear memory address */
typedef Bit32u RealPt; /* guest real-mode memory address (16:16 -> seg:offset) */
typedef Bit16u SegmentVal; /* guest segment value */
# elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
typedef Bit32s MemHandle;
# define htobe16(x) (x)
# define htole16(x) __builtin_bswap16(x)
# define be16toh(x) (x)
# define le16toh(x) __builtin_bswap16(x)
extern HostPt MemBase;
# define htobe32(x) (x)
# define htole32(x) __builtin_bswap32(x)
# define be32toh(x) (x)
# define le32toh(x) __builtin_bswap32(x)
# define htobe64(x) (x)
# define htole64(x) __builtin_bswap64(x)
# define be64toh(x) (x)
# define le64toh(x) __builtin_bswap64(x)
# else
# error Unexpected __BYTE_ORDER__
# endif /* __MINGW__ __BYTE_ORDER__ */
#elif defined(_MSC_VER)
# if BYTE_ORDER == LITTLE_ENDIAN
# define htobe16(x) htons(x)
# define htole16(x) (x)
# define be16toh(x) ntohs(x)
# define le16toh(x) (x)
# define htobe32(x) htonl(x)
# define htole32(x) (x)
# define be32toh(x) ntohl(x)
# define le32toh(x) (x)
# define htobe64(x) htonll(x)
# define htole64(x) (x)
# define be64toh(x) ntohll(x)
# define le64toh(x) (x)
# elif BYTE_ORDER == BIG_ENDIAN
# define htobe16(x) (x)
# define htole16(x) __builtin_bswap16(x)
# define be16toh(x) (x)
# define le16toh(x) __builtin_bswap16(x)
# define htobe32(x) (x)
# define htole32(x) __builtin_bswap32(x)
# define be32toh(x) (x)
# define le32toh(x) __builtin_bswap32(x)
# define htobe64(x) (x)
# define htole64(x) __builtin_bswap64(x)
# define be64toh(x) (x)
# define le64toh(x) __builtin_bswap64(x)
# else
# error Unexpected BYTE_ORDER.
# endif /* _MSC_VER BYTE_ORDER */
#elif defined(__APPLE__)
/* This is a simple compatibility shim to convert
* BSD/Linux endian macros to the Mac OS X equivalents. */
#include <libkern/OSByteOrder.h>
#define htobe16(x) OSSwapHostToBigInt16(x)
#define htole16(x) OSSwapHostToLittleInt16(x)
#define be16toh(x) OSSwapBigToHostInt16(x)
#define le16toh(x) OSSwapLittleToHostInt16(x)
#define htobe32(x) OSSwapHostToBigInt32(x)
#define htole32(x) OSSwapHostToLittleInt32(x)
#define be32toh(x) OSSwapBigToHostInt32(x)
#define le32toh(x) OSSwapLittleToHostInt32(x)
#define htobe64(x) OSSwapHostToBigInt64(x)
#define htole64(x) OSSwapHostToLittleInt64(x)
#define be64toh(x) OSSwapBigToHostInt64(x)
#define le64toh(x) OSSwapLittleToHostInt64(x)
#elif defined(__linux__) || defined(__CYGWIN__)
#include <endian.h>
#elif defined(__OpenBSD__)
#include <sys/endian.h>
#elif defined(__NetBSD__) || defined(__FreeBSD__) || defined(__DragonFly__)
#include <sys/endian.h>
#define be16toh(x) betoh16(x)
#define le16toh(x) letoh16(x)
#define be32toh(x) betoh32(x)
#define le32toh(x) letoh32(x)
#define be64toh(x) betoh64(x)
#define le64toh(x) letoh64(x)
#endif
typedef Bit8u *HostPt; /* host (virtual) memory address aka ptr */
typedef Bit32u PhysPt; /* guest physical memory pointer */
typedef Bit32u LinearPt; /* guest linear memory address */
typedef Bit32u RealPt; /* guest real-mode memory address (16:16 -> seg:offset) */
typedef Bit16u SegmentVal; /* guest segment value */
typedef Bit32s MemHandle;
#define MEM_PAGESIZE 4096
extern HostPt MemBase;
HostPt GetMemBase(void);
bool MEM_A20_Enabled(void);
void MEM_A20_Enable(bool enable);
HostPt GetMemBase(void);
bool MEM_A20_Enabled(void);
void MEM_A20_Enable(bool enable);
/* Memory management / EMS mapping */
HostPt MEM_GetBlockPage(void);
Bitu MEM_FreeTotal(void); //Free 4 kb pages
Bitu MEM_FreeLargest(void); //Largest free 4 kb pages block
Bitu MEM_TotalPages(void); //Total amount of 4 kb pages
Bitu MEM_AllocatedPages(MemHandle handle); // amount of allocated pages of handle
MemHandle MEM_AllocatePages(Bitu pages,bool sequence);
MemHandle MEM_AllocatePages_A20_friendly(Bitu pages,bool sequence);
MemHandle MEM_GetNextFreePage(void);
PhysPt MEM_AllocatePage(void);
void MEM_ReleasePages(MemHandle handle);
bool MEM_ReAllocatePages(MemHandle & handle,Bitu pages,bool sequence);
HostPt MEM_GetBlockPage(void);
Bitu MEM_FreeTotal(void); //Free 4 kb pages
Bitu MEM_FreeLargest(void); //Largest free 4 kb pages block
Bitu MEM_TotalPages(void); //Total amount of 4 kb pages
Bitu MEM_AllocatedPages(MemHandle handle); // amount of allocated pages of handle
MemHandle MEM_AllocatePages(Bitu pages,bool sequence);
MemHandle MEM_AllocatePages_A20_friendly(Bitu pages,bool sequence);
MemHandle MEM_GetNextFreePage(void);
PhysPt MEM_AllocatePage(void);
void MEM_ReleasePages(MemHandle handle);
bool MEM_ReAllocatePages(MemHandle & handle,Bitu pages,bool sequence);
MemHandle MEM_NextHandle(MemHandle handle);
MemHandle MEM_NextHandleAt(MemHandle handle,Bitu where);
MemHandle MEM_NextHandle(MemHandle handle);
MemHandle MEM_NextHandleAt(MemHandle handle,Bitu where);
/*
The folowing six functions are used everywhere in the end so these should be changed for
Working on big or little endian machines
The folowing six functions are used everywhere in the end so these should be changed for
Working on big or little endian machines
*/
#if !defined(C_UNALIGNED_MEMORY)
/* meaning: we're probably being compiled for a processor that doesn't like unaligned WORD access,
on such processors typecasting memory as uint16_t and higher can cause a fault if the
address is not aligned to that datatype when we read/write through it. */
address is not aligned to that datatype when we read/write through it. */
static INLINE Bit8u host_readb(HostPt off) {
return *off;
static INLINE Bit8u host_readb(ConstHostPt const off) {
return *off;
}
static INLINE Bit16u host_readw(HostPt off) {
return (Bit16u)host_readb(off) + ((Bit16u)host_readb(off+1) << (Bit16u)8);
static INLINE Bit16u host_readw(ConstHostPt const off) {
return (Bit16u)host_readb(off) + ((Bit16u)host_readb(off+(uintptr_t)1U) << (Bit16u)8U);
}
static INLINE Bit32u host_readd(HostPt off) {
return (Bit32u)host_readw(off) + ((Bit32u)host_readw(off+2) << (Bit32u)16);
static INLINE Bit32u host_readd(ConstHostPt const off) {
return (Bit32u)host_readw(off) + ((Bit32u)host_readw(off+(uintptr_t)2U) << (Bit32u)16U);
}
static INLINE Bit64u host_readq(HostPt off) {
return (Bit64u)host_readd(off) + ((Bit64u)host_readd(off+4) << (Bit64u)32);
static INLINE Bit64u host_readq(ConstHostPt const off) {
return (Bit64u)host_readd(off) + ((Bit64u)host_readd(off+(uintptr_t)4U) << (Bit64u)32U);
}
static INLINE void host_writeb(HostPt off,Bit8u val) {
*off = val;
static INLINE void host_writeb(HostPt const off,const Bit8u val) {
*off = val;
}
static INLINE void host_writew(HostPt off,Bit16u val) {
host_writeb(off,(Bit8u)(val));
host_writeb(off+1,(Bit8u)(val >> (Bit16u)8));
static INLINE void host_writew(HostPt const off,const Bit16u val) {
host_writeb(off, (Bit8u)(val));
host_writeb(off+1U,(Bit8u)(val >> (Bit16u)8U));
}
static INLINE void host_writed(HostPt off,Bit32u val) {
host_writew(off,(Bit16u)(val));
host_writew(off+2,(Bit16u)(val >> (Bit32u)16));
static INLINE void host_writed(HostPt const off,const Bit32u val) {
host_writew(off, (Bit16u)(val));
host_writew(off+2U,(Bit16u)(val >> (Bit32u)16U));
}
static INLINE void host_writeq(HostPt off,Bit64u val) {
host_writed(off,(Bit32u)(val));
host_writed(off+4,(Bit32u)(val >> (Bit64u)32));
static INLINE void host_writeq(HostPt const off,const Bit64u val) {
host_writed(off, (Bit32u)(val));
host_writed(off+4U,(Bit32u)(val >> (Bit64u)32U));
}
#else
static INLINE Bit8u host_readb(HostPt off) {
return *(Bit8u *)off;
static INLINE Bit8u host_readb(ConstHostPt const off) {
return *(const Bit8u *)off;
}
static INLINE Bit16u host_readw(HostPt off) {
return le16toh((*(Bit16u *)off)); // BSD endian.h
static INLINE Bit16u host_readw(ConstHostPt const off) {
return le16toh((*(const Bit16u *)off)); // BSD endian.h
}
static INLINE Bit32u host_readd(HostPt off) {
return le32toh((*(Bit32u *)off)); // BSD endian.h
static INLINE Bit32u host_readd(ConstHostPt const off) {
return le32toh((*(const Bit32u *)off)); // BSD endian.h
}
static INLINE Bit64u host_readq(HostPt off) {
return le64toh((*(Bit64u *)off)); // BSD endian.h
static INLINE Bit64u host_readq(ConstHostPt const off) {
return le64toh((*(const Bit64u *)off)); // BSD endian.h
}
static INLINE void host_writeb(HostPt off,Bit8u val) {
*(Bit8u *)(off) = val;
static INLINE void host_writeb(HostPt const off,const Bit8u val) {
*(Bit8u *)(off) = val;
}
static INLINE void host_writew(HostPt off,Bit16u val) {
*(Bit16u *)(off) = htole16(val);
static INLINE void host_writew(HostPt const off,const Bit16u val) {
*(Bit16u *)(off) = htole16(val);
}
static INLINE void host_writed(HostPt off,Bit32u val) {
*(Bit32u *)(off) = htole32(val);
static INLINE void host_writed(HostPt const off,const Bit32u val) {
*(Bit32u *)(off) = htole32(val);
}
static INLINE void host_writeq(HostPt off,Bit64u val) {
*(Bit64u *)(off) = htole64(val);
static INLINE void host_writeq(HostPt const off,const Bit64u val) {
*(Bit64u *)(off) = htole64(val);
}
#endif
static INLINE void var_write(Bit8u * var, Bit8u val) {
host_writeb((HostPt)var, val);
static INLINE void var_write(Bit8u * const var, const Bit8u val) {
host_writeb((HostPt)var, val);
}
static INLINE void var_write(Bit16u * var, Bit16u val) {
host_writew((HostPt)var, val);
static INLINE void var_write(Bit16u * const var, const Bit16u val) {
host_writew((HostPt)var, val);
}
static INLINE void var_write(Bit32u * var, Bit32u val) {
host_writed((HostPt)var, val);
static INLINE void var_write(Bit32u * const var, const Bit32u val) {
host_writed((HostPt)var, val);
}
static INLINE void var_write(Bit64u * var, Bit64u val) {
host_writeq((HostPt)var, val);
static INLINE void var_write(Bit64u * const var, const Bit64u val) {
host_writeq((HostPt)var, val);
}
/* The Folowing six functions are slower but they recognize the paged memory system */
Bit8u mem_readb(PhysPt pt);
Bit16u mem_readw(PhysPt pt);
Bit32u mem_readd(PhysPt pt);
Bit8u mem_readb(const PhysPt pt);
Bit16u mem_readw(const PhysPt pt);
Bit32u mem_readd(const PhysPt pt);
void mem_writeb(PhysPt pt,Bit8u val);
void mem_writew(PhysPt pt,Bit16u val);
void mem_writed(PhysPt pt,Bit32u val);
void mem_writeb(const PhysPt pt,const Bit8u val);
void mem_writew(const PhysPt pt,const Bit16u val);
void mem_writed(const PhysPt pt,const Bit32u val);
void phys_writes(PhysPt addr, const char* string, Bitu length);
static INLINE void phys_writeb(PhysPt addr,Bit8u val) {
host_writeb(MemBase+addr,val);
/* WARNING: These will cause a segfault or out of bounds access IF
* addr is beyond the end of memory */
static INLINE void phys_writeb(const PhysPt addr,const Bit8u val) {
host_writeb(MemBase+addr,val);
}
static INLINE void phys_writew(PhysPt addr,Bit16u val){
host_writew(MemBase+addr,val);
static INLINE void phys_writew(const PhysPt addr,const Bit16u val) {
host_writew(MemBase+addr,val);
}
static INLINE void phys_writed(PhysPt addr,Bit32u val){
host_writed(MemBase+addr,val);
static INLINE void phys_writed(const PhysPt addr,const Bit32u val) {
host_writed(MemBase+addr,val);
}
static INLINE Bit8u phys_readb(PhysPt addr) {
return host_readb(MemBase+addr);
static INLINE Bit8u phys_readb(const PhysPt addr) {
return host_readb(MemBase+addr);
}
static INLINE Bit16u phys_readw(PhysPt addr){
return host_readw(MemBase+addr);
static INLINE Bit16u phys_readw(const PhysPt addr) {
return host_readw(MemBase+addr);
}
static INLINE Bit32u phys_readd(PhysPt addr){
return host_readd(MemBase+addr);
static INLINE Bit32u phys_readd(const PhysPt addr) {
return host_readd(MemBase+addr);
}
/* These don't check for alignment, better be sure it's correct */
@ -314,64 +196,70 @@ void mem_strcpy(PhysPt dest,PhysPt src);
/* The folowing functions are all shortcuts to the above functions using physical addressing */
static INLINE Bit8u real_readb(Bit16u seg,Bit16u off) {
return mem_readb((seg<<4)+off);
}
static INLINE Bit16u real_readw(Bit16u seg,Bit16u off) {
return mem_readw((seg<<4)+off);
}
static INLINE Bit32u real_readd(Bit16u seg,Bit16u off) {
return mem_readd((seg<<4)+off);
static inline constexpr PhysPt PhysMake(const Bit16u seg,const Bit16u off) {
return ((PhysPt)seg << (PhysPt)4U) + (PhysPt)off;
}
static INLINE void real_writeb(Bit16u seg,Bit16u off,Bit8u val) {
mem_writeb(((seg<<4)+off),val);
}
static INLINE void real_writew(Bit16u seg,Bit16u off,Bit16u val) {
mem_writew(((seg<<4)+off),val);
}
static INLINE void real_writed(Bit16u seg,Bit16u off,Bit32u val) {
mem_writed(((seg<<4)+off),val);
static inline constexpr Bit16u RealSeg(const RealPt pt) {
return (Bit16u)((RealPt)pt >> (RealPt)16U);
}
static INLINE Bit16u RealSeg(RealPt pt) {
return (Bit16u)(pt>>16);
static inline constexpr Bit16u RealOff(const RealPt pt) {
return (Bit16u)((RealPt)pt & (RealPt)0xffffu);
}
static INLINE Bit16u RealOff(RealPt pt) {
return (Bit16u)(pt&0xffff);
static inline constexpr PhysPt Real2Phys(const RealPt pt) {
return (PhysPt)(((PhysPt)RealSeg(pt) << (PhysPt)4U) + (PhysPt)RealOff(pt));
}
static INLINE PhysPt Real2Phys(RealPt pt) {
return (RealSeg(pt)<<4) +RealOff(pt);
}
static INLINE PhysPt PhysMake(Bit16u seg,Bit16u off) {
return (seg<<4)+off;
}
static INLINE RealPt RealMake(Bit16u seg,Bit16u off) {
return (seg<<16)+off;
}
static INLINE void RealSetVec(Bit8u vec,RealPt pt) {
mem_writed(vec<<2,pt);
}
static INLINE void RealSetVec(Bit8u vec,RealPt pt,RealPt &old) {
old = mem_readd(vec<<2);
mem_writed(vec<<2,pt);
static inline constexpr RealPt RealMake(const Bit16u seg,const Bit16u off) {
return (RealPt)(((RealPt)seg << (RealPt)16U) + (RealPt)off);
}
/* convert physical address to 4:16 real pointer (example: 0xABCDE -> 0xA000:0xBCDE) */
static INLINE RealPt PhysToReal416(PhysPt phys) {
return RealMake((phys>>4)&0xF000,phys&0xFFFF);
static inline constexpr RealPt PhysToReal416(const PhysPt phys) {
return RealMake((Bit16u)(((PhysPt)phys >> (PhysPt)4U) & (PhysPt)0xF000U),(Bit16u)((PhysPt)phys & (PhysPt)0xFFFFU));
}
static INLINE RealPt RealGetVec(Bit8u vec) {
return mem_readd(vec<<2);
}
static inline constexpr PhysPt RealVecAddress(const Bit8u vec) {
return (PhysPt)((unsigned int)vec << 2U);
}
static INLINE Bit8u real_readb(const Bit16u seg,const Bit16u off) {
return mem_readb(PhysMake(seg,off));
}
static INLINE Bit16u real_readw(const Bit16u seg,const Bit16u off) {
return mem_readw(PhysMake(seg,off));
}
static INLINE Bit32u real_readd(const Bit16u seg,const Bit16u off) {
return mem_readd(PhysMake(seg,off));
}
static INLINE void real_writeb(const Bit16u seg,const Bit16u off,const Bit8u val) {
mem_writeb(PhysMake(seg,off),val);
}
static INLINE void real_writew(const Bit16u seg,const Bit16u off,const Bit16u val) {
mem_writew(PhysMake(seg,off),val);
}
static INLINE void real_writed(const Bit16u seg,const Bit16u off,const Bit32u val) {
mem_writed(PhysMake(seg,off),val);
}
static INLINE RealPt RealGetVec(const Bit8u vec) {
return mem_readd(RealVecAddress(vec));
}
static INLINE void RealSetVec(const Bit8u vec,const RealPt pt) {
mem_writed(RealVecAddress(vec),(Bit32u)pt);
}
static INLINE void RealSetVec(const Bit8u vec,const RealPt pt,RealPt &old) {
const PhysPt addr = RealVecAddress(vec);
old = mem_readd(addr);
mem_writed(addr,pt);
}
#endif

View File

@ -17,9 +17,12 @@
*/
#include <string>
#include "config.h"
#include "menudef.h"
void SetVal(const std::string secname, std::string preval, const std::string val);
#include <SDL_video.h>
#ifdef __WIN32__
#include "programs.h"
@ -41,7 +44,6 @@ void MountDrive_2(char drive, const char drive2[DOS_PATHLENGTH], std::string dri
void MENU_Check_Drive(HMENU handle, int cdrom, int floppy, int local, int image, int automount, int umount, char drive);
bool MENU_SetBool(std::string secname, std::string value);
void MENU_swapstereo(bool enabled);
void GUI_Shortcut(int select);
void* GetSetSDLValue(int isget, std::string target, void* setval);
void Go_Boot(const char boot_drive[_MAX_DRIVE]);
void Go_Boot2(const char boot_drive[_MAX_DRIVE]);
@ -57,6 +59,7 @@ extern bool DOSBox_Kor(void);
extern unsigned int hdd_defsize;
extern char hdd_size[20];
extern HWND GetHWND(void);
extern HWND GetSurfaceHWND(void);
extern void GetDefaultSize(void);
#define SCALER(opscaler,opsize) \
if ((render.scale.op==opscaler) && (render.scale.size==opsize))
@ -81,6 +84,11 @@ extern void GetDefaultSize(void);
#else
void DOSBox_CheckOS(int &id, int &major, int &minor);
void DOSBox_RefreshMenu(void);
void DOSBox_SetMenu(void);
void DOSBox_NoMenu(void);
// dummy Win32 functions for less #ifdefs
#define GetHWND() (0)
#define SetMenu(a,b)
@ -88,10 +96,424 @@ extern void GetDefaultSize(void);
#define GetMenu(a) (0)
// menu.cpp replacements; the optimizer will completely remove code based on these
#define DOSBox_SetMenu()
#define DOSBox_RefreshMenu()
#define DOSBox_CheckOS(a, b, c) do { (a)=0; (b)=0; (c)=0; } while(0)
#define VER_PLATFORM_WIN32_NT (1)
#define DOSBox_Kor() !strncmp("ko", getenv("LANG"), 2) // dirty hack.
#endif
/* menu interface mode */
#define DOSBOXMENU_NULL (0) /* nothing */
#define DOSBOXMENU_HMENU (1) /* Windows HMENU resources */
#define DOSBOXMENU_NSMENU (2) /* Mac OS X NSMenu / NSMenuItem resources */
#define DOSBOXMENU_SDLDRAW (3) /* menus that WE draw on the SDL surface */
#if C_FORCE_MENU_SDLDRAW /* Programmer/Dev wants to compile with SDL drawn menus even if host OS offers menus (shrug) Ok */
# define DOSBOXMENU_TYPE DOSBOXMENU_SDLDRAW
#elif defined(WIN32) && !defined(C_SDL2) && !defined(HX_DOS)
# define DOSBOXMENU_TYPE DOSBOXMENU_HMENU
#elif defined(MACOSX) && !defined(C_SDL2)
# define DOSBOXMENU_TYPE DOSBOXMENU_NSMENU
#elif defined(C_SDL2) /* SDL 2.x only */
# define DOSBOXMENU_TYPE DOSBOXMENU_SDLDRAW
#elif !defined(C_SDL2) /* SDL 1.x only */
# define DOSBOXMENU_TYPE DOSBOXMENU_SDLDRAW
#else
# define DOSBOXMENU_TYPE DOSBOXMENU_NULL
#endif
void GUI_Shortcut(int select);
#define DOSBOXMENU_ACCELMARK_STR "\x01"
#define DOSBOXMENU_ACCELMARK_CHAR '\x01'
#include <map>
#include <vector>
#ifndef MENU_DOSBOXMENU_H
#define MENU_DOSBOXMENU_H
class DOSBoxMenu {
public:
DOSBoxMenu(const DOSBoxMenu &src) = delete; /* don't copy me */
DOSBoxMenu(const DOSBoxMenu &&src) = delete; /* don't move me */
public:
class item;
public:
enum item_type_t {
item_type_id=0,
submenu_type_id,
separator_type_id,
vseparator_type_id,
MAX_id
};
public:
typedef uint16_t item_handle_t;
typedef bool (*callback_t)(DOSBoxMenu * const,item * const);
typedef std::string mapper_event_t; /* event name */
public:
class displaylist {
friend DOSBoxMenu;
public:
displaylist();
~displaylist();
#if DOSBOXMENU_TYPE == DOSBOXMENU_SDLDRAW
public:
void DrawDisplayList(DOSBoxMenu &menu,bool updateScreen=true);
item_handle_t itemFromPoint(DOSBoxMenu &menu,int x,int y);
#endif
protected:
bool items_changed = false;
bool order_changed = false;
std::vector<item_handle_t> disp_list;
public:
const std::vector<item_handle_t> &get_disp_list(void) const {
return disp_list;
}
};
public:
static constexpr item_handle_t unassigned_item_handle = ((item_handle_t)(0xFFFFU));
static constexpr callback_t unassigned_callback = NULL;
static const mapper_event_t unassigned_mapper_event; /* empty std::string */
public:
struct accelerator {
accelerator() { }
accelerator(char _key,unsigned char _instance=0) : key(_key), key_instance(_instance) { }
char key = 0; /* ascii code i.e. 'g' */
unsigned char key_instance = 0; /* which occurrence of the letter in the text */
};
public:
class item {
friend DOSBoxMenu;
public:
item();
~item();
protected:
std::string name; /* item name */
std::string text; /* item text */
std::string shortcut_text; /* shortcut text on the right */
std::string description; /* description text */
struct accelerator accelerator; /* menu accelerator */
protected:
item_handle_t parent_id = unassigned_item_handle;
item_handle_t master_id = unassigned_item_handle;
enum item_type_t type = item_type_id;
protected:
struct status {
status() : changed(false), allocated(false),
enabled(true), checked(false),
in_use(false) { };
unsigned int changed:1;
unsigned int allocated:1;
unsigned int enabled:1;
unsigned int checked:1;
unsigned int in_use:1;
} status;
protected:
callback_t callback_func = unassigned_callback;
mapper_event_t mapper_event = unassigned_mapper_event;
public:
displaylist display_list;
public:
uint64_t user_defined = 0;
#if DOSBOXMENU_TYPE == DOSBOXMENU_HMENU /* Windows menu handle */
protected:
HMENU winMenu = NULL;
protected:
void winAppendMenu(HMENU handle);
std::string winConstructMenuText(void);
#endif
#if DOSBOXMENU_TYPE == DOSBOXMENU_NSMENU /* Mac OS X menu handle */
protected:
void* nsMenuItem = NULL;
void* nsMenu = NULL;
protected:
void nsAppendMenu(void *nsMenu);
#endif
#if DOSBOXMENU_TYPE == DOSBOXMENU_SDLDRAW
protected:
SDL_Rect screenBox = {0,0,0,0}; /* absolute screen coords */
SDL_Rect checkBox = {0,0,0,0}; /* relative to screenbox */
SDL_Rect textBox = {0,0,0,0}; /* relative to screenbox */
SDL_Rect shortBox = {0,0,0,0}; /* relative to screenbox */
SDL_Rect popupBox = {0,0,0,0}; /* absolute screen coords */
bool boxInit = false;
bool itemHover = false;
bool needRedraw = false;
bool itemHilight = false;
bool itemVisible = false;
bool borderTop = false;
public:
void removeFocus(DOSBoxMenu &menu);
void removeHover(DOSBoxMenu &menu);
void drawMenuItem(DOSBoxMenu &menu);
void showItem(DOSBoxMenu &menu,bool show=true);
item& setHover(DOSBoxMenu &menu,bool ho=true);
item& setHilight(DOSBoxMenu &menu,bool hi=true);
void placeItem(DOSBoxMenu &menu,int x,int y,bool isTopLevel=false);
void placeItemFinal(DOSBoxMenu &menu,int finalwidth,bool isTopLevel=false);
void layoutSubmenu(DOSBoxMenu &menu, bool isTopLevel=false);
void updateScreenFromPopup(DOSBoxMenu &menu);
void updateScreenFromItem(DOSBoxMenu &menu);
void drawBackground(DOSBoxMenu &menu);
public:
inline bool isHilight(void) const {
return itemHilight;
}
#endif
protected:
item& allocate(const item_handle_t id,const enum item_type_t type,const std::string &name);
void deallocate(void);
public:
inline bool checkResetRedraw(void) {
#if DOSBOXMENU_TYPE == DOSBOXMENU_SDLDRAW
bool r = needRedraw;
needRedraw = false;
return r;
#else
return false;
#endif
}
inline const std::string &get_name(void) const {
return name;
}
inline item_handle_t get_master_id(void) const {
return master_id;
}
inline bool is_allocated(void) const {
return master_id != unassigned_item_handle;
}
inline bool has_vis_text(void) const {
return type <= submenu_type_id;
}
inline bool has_vis_shortcut_text(void) const {
return type <= item_type_id;
}
inline bool has_vis_description(void) const {
return false;
}
inline bool has_vis_accelerator(void) const {
return type <= item_type_id;
}
inline bool has_vis_enabled(void) const {
return type <= submenu_type_id;
}
inline bool can_enable(void) const {
return type <= submenu_type_id;
}
inline bool has_vis_checked(void) const {
return type <= item_type_id;
}
inline bool can_check(void) const {
return type <= item_type_id;
}
public:
void refresh_item(DOSBoxMenu &menu);
inline bool has_changed(void) const {
return status.changed;
}
void clear_changed(void) {
status.changed = false;
}
public:
inline item &check(const bool f=true) {
if (status.checked != f) {
status.checked = f;
if (can_check() && has_vis_checked())
status.changed = 1;
}
return *this;
}
inline bool is_checked(void) const {
return status.checked;
}
public:
inline item &enable(const bool f=true) {
if (status.enabled != f) {
status.enabled = f;
if (can_enable() && has_vis_enabled())
status.changed = 1;
}
return *this;
}
inline bool is_enabled(void) const {
return status.enabled;
}
public:
inline item_type_t get_type(void) const {
return type;
}
void set_type(const item_type_t t) {
if (type >= separator_type_id && t >= separator_type_id)
type = t;
}
public:
inline callback_t get_callback_function(void) const {
return callback_func;
}
inline item &set_callback_function(const callback_t f) {
callback_func = f;
return *this;
}
public:
inline mapper_event_t get_mapper_event(void) const {
return mapper_event;
}
inline item &set_mapper_event(const mapper_event_t e) {
mapper_event = e;
return *this;
}
public:
inline const std::string &get_text(void) const {
return text;
}
inline item &set_text(const std::string &str) {
if (has_vis_text() && text != str)
status.changed = 1;
text = str;
return *this;
}
public:
inline const std::string &get_shortcut_text(void) const {
return shortcut_text;
}
inline item &set_shortcut_text(const std::string &str) {
if (has_vis_shortcut_text() && shortcut_text != str)
status.changed = 1;
shortcut_text = str;
return *this;
}
public:
inline const std::string &get_description(void) const {
return description;
}
inline item &set_description(const std::string &str) {
if (has_vis_description() && description != str)
status.changed = 1;
description = str;
return *this;
}
public:
inline const struct accelerator &get_accelerator(void) const {
return accelerator;
}
inline item &set_accelerator(const struct accelerator &str) {
if (has_vis_accelerator()/* && accelerator != str*//*TODO*/)
status.changed = 1;
accelerator = str;
return *this;
}
};
public:
DOSBoxMenu();
~DOSBoxMenu();
public:
bool item_exists(const item_handle_t i);
bool item_exists(const std::string &name);
item& get_item(const item_handle_t i);
item& get_item(const std::string &name);
item_handle_t get_item_id_by_name(const std::string &name);
item& alloc_item(const enum item_type_t type,const std::string &name);
void delete_item(const item_handle_t i);
void clear_all_menu_items(void);
void dump_log_debug(void);
void dump_log_displaylist(DOSBoxMenu::displaylist &ls, unsigned int indent);
const char* TypeToString(const enum item_type_t type);
void rebuild(void);
void unbuild(void);
public:
displaylist display_list;
protected:
std::vector<item> master_list;
std::map<std::string,item_handle_t> name_map;
item_handle_t master_list_alloc = 0;
#if DOSBOXMENU_TYPE == DOSBOXMENU_HMENU /* Windows menu handle */
protected:
HMENU winMenu = NULL;
bool winMenuInit(void);
void winMenuDestroy(void);
bool winMenuSubInit(DOSBoxMenu::item &item);
public:
HMENU getWinMenu(void) const;
bool mainMenuWM_COMMAND(unsigned int id);
public:
static constexpr unsigned int winMenuMinimumID = 0x1000;
#endif
#if DOSBOXMENU_TYPE == DOSBOXMENU_NSMENU /* Mac OS X NSMenu / NSMenuItem handle */
protected:
void* nsMenu = NULL;
bool nsMenuInit(void);
void nsMenuDestroy(void);
bool nsMenuSubInit(DOSBoxMenu::item &item);
public:
void* getNsMenu(void) const;
bool mainMenuAction(unsigned int id);
public:
static constexpr unsigned int nsMenuMinimumID = 0x1000;
#endif
#if DOSBOXMENU_TYPE == DOSBOXMENU_SDLDRAW
public:
bool needRedraw = false;
bool menuVisible = false;
item_handle_t menuUserAttentionAt = unassigned_item_handle;
item_handle_t menuUserHoverAt = unassigned_item_handle;
public:
SDL_Rect menuBox = {0,0,0,0};
public:
inline bool isVisible(void) const {
return menuVisible;
}
inline bool needsRedraw(void) const {
return needRedraw;
}
inline void setRedraw(void) {
needRedraw = true;
}
inline void clearRedraw(void) {
needRedraw = false;
}
public:
void showMenu(bool show=true);
void setScale(size_t s);
void removeHover(void);
void removeFocus(void);
void updateRect(void);
void layoutMenu(void);
public:
static constexpr size_t menuBarHeightBase = (16 + 1);
size_t menuBarHeight = menuBarHeightBase;
public:
size_t screenWidth = 320;
public:
static constexpr size_t fontCharWidthBase = 8;
static constexpr size_t fontCharHeightBase = 16;
static constexpr size_t dropshadowX = 8;
static constexpr size_t dropshadowY = 8;
public:
size_t fontCharScale = 1;
size_t fontCharWidth = fontCharWidthBase;
size_t fontCharHeight = fontCharHeightBase;
#endif
public:
void dispatchItemCommand(item &item);
public:
static constexpr size_t master_list_limit = 4096;
public:
void displaylist_append(displaylist &ls,const DOSBoxMenu::item_handle_t item_id);
void displaylist_clear(displaylist &ls);
};
extern DOSBoxMenu mainMenu;
#endif /* MENU_DOSBOXMENU_H */

View File

@ -20,18 +20,14 @@
#include <windows.h>
#include <windowsx.h>
#include "resource.h"
#endif
#define menu_compatible menu.compatible
#define menu_gui menu.gui
#define menu_startup menu.startup
#else
#define menu_gui menu.gui
// If these are used, the optimizer can completely remove code that is not
// needed on Linux. This way, code is less cluttered with #ifdefs
#define menu_compatible (false)
#define menu_gui (false)
#define menu_startup (false)
#endif
#ifndef MENUDEF_H
#define MENUDEF_H
struct MENU_Block {
bool toggle; // toggle menu bar
@ -47,3 +43,5 @@ struct MENU_Block {
};
extern MENU_Block menu;
#endif /* MENUDEF_H */

View File

@ -29,16 +29,6 @@
typedef void (*MIXER_MixHandler)(Bit8u * sampdate,Bit32u len);
typedef void (*MIXER_Handler)(Bitu len);
enum BlahModes {
MIXER_8MONO,MIXER_8STEREO,
MIXER_16MONO,MIXER_16STEREO
};
enum MixerModes {
M_8M,M_8S,
M_16M,M_16S
};
#define MIXER_BUFSIZE (16*1024)
#define MIXER_BUFMASK (MIXER_BUFSIZE-1)
extern Bit8u MixTemp[MIXER_BUFSIZE];

View File

@ -21,6 +21,13 @@
#ifndef DOSBOX_MOUSE_H
#define DOSBOX_MOUSE_H
enum MOUSE_EMULATION
{
MOUSE_EMULATION_NEVER,
MOUSE_EMULATION_ALWAYS,
MOUSE_EMULATION_INTEGRATION,
MOUSE_EMULATION_LOCKED,
};
void Mouse_ShowCursor(void);
void Mouse_HideCursor(void);
@ -36,6 +43,7 @@ void Mouse_ButtonPressed(Bit8u button);
void Mouse_ButtonReleased(Bit8u button);
void Mouse_AutoLock(bool enable);
bool Mouse_IsLocked();
void Mouse_NewVideoMode(void);
#endif

323
include/np2glue.h Normal file
View File

@ -0,0 +1,323 @@
/* The purpose of this header is to provide defines and macros
* to help port code from Neko Project II and match the typedefs
* it uses. */
#include <math.h>
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <stdlib.h>
#include <limits.h>
#if defined(WIN32)
# include <windows.h>
# include <io.h>
# if defined(_MSC_VER)
# pragma warning(disable:4996)
# endif
#endif
#if defined(WIN32) && !defined(strcasecmp)
#define strcasecmp strcmpi
#endif
#define SUPPORT_PX
#if !defined(MAX_PATH)
#define MAX_PATH PATH_MAX
#endif
#ifdef WIN32
# define BYTESEX_LITTLE
# define _G_DIR_SEPARATOR '\\'
#else
# include "byteorder.h"
# define _G_DIR_SEPARATOR '/'
# if !defined(BYTE_ORDER) || !defined(LITTLE_ENDIAN) || !defined(BIG_ENDIAN)
# error byteorder not enough information
# endif
# if BYTE_ORDER == LITTLE_ENDIAN
# define BYTESEX_LITTLE
# elif BYTE_ORDER == BIG_ENDIAN
# define BYTESEX_BIG
# else
# error unknown byte order
# endif
#endif
enum {
SUCCESS = 0,
FAILURE = 1
};
enum {
PCBASECLOCK25 = 2457600,
PCBASECLOCK20 = 1996800
};
enum {
CPUMODE_8MHZ = 0x20,
PCMODEL_VF = 0,
PCMODEL_VM = 1,
PCMODEL_VX = 2,
PCMODELMASK = 0x3f,
PCMODEL_PC9821 = 0x40,
PCMODEL_EPSON = 0x80,
PCHDD_SASI = 0x01,
PCHDD_SCSI = 0x02,
PCHDD_IDE = 0x04,
PCROM_BIOS = 0x01,
PCROM_SOUND = 0x02,
PCROM_SASI = 0x04,
PCROM_SCSI = 0x08,
PCROM_BIOS9821 = 0x10,
PCSOUND_NONE = 0x00,
PCCBUS_PC9861K = 0x0001,
PCCBUS_MPU98 = 0x0002
};
// GLUE TYPEDEFS
// WARNING: Windows targets will want to IFDEF some of these out as they will
// conflict with the typedefs in windows.h
typedef uint32_t UINT32;
typedef int32_t SINT32;
typedef uint16_t UINT16;
typedef int16_t SINT16;
typedef uint8_t UINT8;
typedef int8_t SINT8;
typedef uint32_t UINT;
typedef uint32_t REG8; /* GLIB guint32 -> UINT -> REG8 */
#ifndef WIN32
typedef uint8_t BOOL;
typedef uint8_t BYTE;
#endif
typedef char OEMCHAR;
typedef void* NEVENTITEM;
#define OEMTEXT(x) x
#define SOUNDCALL
static inline uint16_t LOADINTELWORD(void *x) {
return *((uint16_t*)(x));
}
static inline void STOREINTELWORD(void *x,uint16_t y) {
*((uint16_t*)(x)) = y;
}
static inline uint32_t LOADINTELDWORD(void *x) {
return *((uint32_t*)(x));
}
static inline void STOREINTELDWORD(void *x,uint32_t y) {
*((uint32_t*)(x)) = y;
}
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
/* TODO: Move into another header */
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
#ifndef PI
#define PI M_PI
#endif
#ifndef WIN32
static inline void ZeroMemory(void *p,size_t l) {
memset(p,0,l);
}
static inline void FillMemory(void *p,size_t l,unsigned char c) {
memset(p,c,l);
}
#endif
static inline void pcm86io_bind(void) {
/* dummy */
}
#ifdef __cplusplus
extern "C" {
#endif
void sound_sync(void);
#ifdef __cplusplus
}
#endif
#define BRESULT UINT8
#ifdef __cplusplus
extern "C" {
#endif
#if 1
void _TRACEOUT(const char *fmt,...);
#else
static inline void _TRACEOUT(const char *fmt,...) { };
#endif
#define TRACEOUT(a) _TRACEOUT a
#ifdef __cplusplus
}
#endif
typedef struct {
// ƒGƒ~ƒ…ƒŒ[ƒg’†‚ɂ悭ŽQÆ‚³‚ê‚é“z
UINT8 uPD72020;
UINT8 DISPSYNC;
UINT8 RASTER;
UINT8 realpal;
UINT8 LCD_MODE;
UINT8 skipline;
UINT16 skiplight;
UINT8 KEY_MODE;
UINT8 XSHIFT;
UINT8 BTN_RAPID;
UINT8 BTN_MODE;
UINT8 dipsw[3];
UINT8 MOUSERAPID;
UINT8 calendar;
UINT8 usefd144;
UINT8 wait[6];
// ƒŠƒZƒbƒgŽž‚Æ‚©‚ ‚ñ‚Ü‚èŽQÆ‚³‚ê‚È‚¢“z
OEMCHAR model[8];
UINT baseclock;
UINT multiple;
UINT8 memsw[8];
UINT8 ITF_WORK;
UINT8 EXTMEM;
UINT8 grcg;
UINT8 color16;
UINT32 BG_COLOR;
UINT32 FG_COLOR;
UINT16 samplingrate;
UINT16 delayms;
UINT8 SOUND_SW;
UINT8 snd_x;
UINT8 snd14opt[3];
UINT8 snd26opt;
UINT8 snd86opt;
UINT8 spbopt;
UINT8 spb_vrc; // ver0.30
UINT8 spb_vrl; // ver0.30
UINT8 spb_x; // ver0.30
UINT8 BEEP_VOL;
UINT8 vol14[6];
UINT8 vol_fm;
UINT8 vol_ssg;
UINT8 vol_adpcm;
UINT8 vol_pcm;
UINT8 vol_rhythm;
UINT8 mpuenable;
UINT8 mpuopt;
UINT8 pc9861enable;
UINT8 pc9861sw[3];
UINT8 pc9861jmp[6];
UINT8 fddequip;
UINT8 MOTOR;
UINT8 MOTORVOL;
UINT8 PROTECTMEM;
UINT8 hdrvacc;
OEMCHAR sasihdd[2][MAX_PATH]; // ver0.74
#if defined(SUPPORT_SCSI)
OEMCHAR scsihdd[4][MAX_PATH]; // ver0.74
#endif
OEMCHAR fontfile[MAX_PATH];
OEMCHAR biospath[MAX_PATH];
OEMCHAR hdrvroot[MAX_PATH];
} NP2CFG;
#ifdef __cplusplus
extern "C" {
#endif
unsigned char *CGetMemBase();
void getbiospath(OEMCHAR *path, const OEMCHAR *fname, int maxlen);
REG8 joymng_getstat(void);
REG8 keystat_getjoy(void);
extern NP2CFG pccore;
#define np2cfg pccore
#ifdef __cplusplus
}
#endif
#ifdef reg
#undef reg
#endif
#ifndef min
#define min(a,b) (((a) < (b)) ? (a) : (b))
#endif
#ifndef NELEMENTS
#define NELEMENTS(a) ((int)(sizeof(a) / sizeof(a[0])))
#endif
#define _MEM_INIT()
#define _MALLOC(a, b) malloc(a)
#define _MFREE(a) free(a)
#define _HANDLE_ADD(a, b)
#define _HANDLE_REM(a)
#define _MEM_USED(a)
#ifndef WIN32
#define CopyMemory(d,s,n) memcpy((d), (s), (n))
#endif
typedef FILE * FILEH;
#ifndef FASTCALL
#define FASTCALL
#endif
#define IOOUTCALL FASTCALL
#define IOINPCALL FASTCALL
typedef void (IOOUTCALL *IOOUT)(UINT port, REG8 val);
typedef REG8 (IOINPCALL *IOINP)(UINT port);
#ifdef __cplusplus
extern "C" {
#endif
void pic_setirq(REG8 irq);
void pic_resetirq(REG8 irq);
void cbuscore_attachsndex(UINT port, const IOOUT *out, const IOINP *inp);
#ifdef __cplusplus
}
#endif

View File

@ -52,13 +52,13 @@ static const Bitu MEMMASK_FULL = 0x000FFFFFU; /* full 32-bit decode (32 - 1
/* WARNING: Will only produce a correct result if 'x' is a nonzero power of two.
* For use with MEMMASK_Combine. 'x' is in units of PAGES not BYTES.
*/
static inline const Bitu MEMMASK_Range(const Bitu x) {
static inline Bitu MEMMASK_Range(const Bitu x) {
return ~(x - 1);
}
/* combine range mask with MEMMASK value.
*/
static inline const Bitu MEMMASK_Combine(const Bitu a,const Bitu b) {
static inline Bitu MEMMASK_Combine(const Bitu a,const Bitu b) {
return a & b;
}
@ -106,10 +106,10 @@ public:
virtual bool writed_checked(PhysPt addr,Bitu val);
PageHandler (void) { }
Bitu flags;
const Bitu getFlags() const {
Bitu getFlags() const {
return flags;
}
void setFlags(Bitu flagsNew) {
void setFlags(const Bitu flagsNew) {
flags = flagsNew;
}
@ -307,41 +307,41 @@ extern PagingBlock paging;
/* Some support functions */
PageHandler * MEM_GetPageHandler(Bitu phys_page);
PageHandler * MEM_GetPageHandler(const Bitu phys_page);
/* Unaligned address handlers */
Bit16u mem_unalignedreadw(PhysPt address);
Bit32u mem_unalignedreadd(PhysPt address);
void mem_unalignedwritew(PhysPt address,Bit16u val);
void mem_unalignedwrited(PhysPt address,Bit32u val);
Bit16u mem_unalignedreadw(const PhysPt address);
Bit32u mem_unalignedreadd(const PhysPt address);
void mem_unalignedwritew(const PhysPt address,const Bit16u val);
void mem_unalignedwrited(const PhysPt address,const Bit32u val);
bool mem_unalignedreadw_checked(PhysPt address,Bit16u * val);
bool mem_unalignedreadd_checked(PhysPt address,Bit32u * val);
bool mem_unalignedwritew_checked(PhysPt address,Bit16u val);
bool mem_unalignedwrited_checked(PhysPt address,Bit32u val);
bool mem_unalignedreadw_checked(const PhysPt address,Bit16u * const val);
bool mem_unalignedreadd_checked(const PhysPt address,Bit32u * const val);
bool mem_unalignedwritew_checked(const PhysPt address,Bit16u const val);
bool mem_unalignedwrited_checked(const PhysPt address,Bit32u const val);
#if defined(USE_FULL_TLB)
static INLINE HostPt get_tlb_read(PhysPt address) {
static INLINE HostPt get_tlb_read(const PhysPt address) {
return paging.tlb.read[address>>12];
}
static INLINE HostPt get_tlb_write(PhysPt address) {
static INLINE HostPt get_tlb_write(const PhysPt address) {
return paging.tlb.write[address>>12];
}
static INLINE PageHandler* get_tlb_readhandler(PhysPt address) {
static INLINE PageHandler* get_tlb_readhandler(const PhysPt address) {
return paging.tlb.readhandler[address>>12];
}
static INLINE PageHandler* get_tlb_writehandler(PhysPt address) {
static INLINE PageHandler* get_tlb_writehandler(const PhysPt address) {
return paging.tlb.writehandler[address>>12];
}
/* Use these helper functions to access linear addresses in readX/writeX functions */
static INLINE PhysPt PAGING_GetPhysicalPage(PhysPt linePage) {
static INLINE PhysPt PAGING_GetPhysicalPage(const PhysPt linePage) {
return (paging.tlb.phys_page[linePage>>12]<<12);
}
static INLINE PhysPt PAGING_GetPhysicalAddress(PhysPt linAddr) {
static INLINE PhysPt PAGING_GetPhysicalAddress(const PhysPt linAddr) {
return (paging.tlb.phys_page[linAddr>>12]<<12)|(linAddr&0xfff);
}
@ -349,10 +349,10 @@ static INLINE PhysPt PAGING_GetPhysicalAddress(PhysPt linAddr) {
void PAGING_InitTLBBank(tlb_entry **bank);
static INLINE tlb_entry *get_tlb_entry(PhysPt address) {
Bitu index=(address>>12);
static INLINE tlb_entry *get_tlb_entry(const PhysPt address) {
const Bitu index=(address >> 12U);
if (TLB_BANKS && (index > TLB_SIZE)) {
Bitu bank=(address>>BANK_SHIFT) - 1;
const Bitu bank=(address >> BANK_SHIFT) - 1U;
if (!paging.tlbh_banks[bank])
PAGING_InitTLBBank(&paging.tlbh_banks[bank]);
return &paging.tlbh_banks[bank][index & BANK_MASK];
@ -360,26 +360,26 @@ static INLINE tlb_entry *get_tlb_entry(PhysPt address) {
return &paging.tlbh[index];
}
static INLINE HostPt get_tlb_read(PhysPt address) {
static INLINE HostPt get_tlb_read(const PhysPt address) {
return get_tlb_entry(address)->read;
}
static INLINE HostPt get_tlb_write(PhysPt address) {
static INLINE HostPt get_tlb_write(const PhysPt address) {
return get_tlb_entry(address)->write;
}
static INLINE PageHandler* get_tlb_readhandler(PhysPt address) {
static INLINE PageHandler* get_tlb_readhandler(const PhysPt address) {
return get_tlb_entry(address)->readhandler;
}
static INLINE PageHandler* get_tlb_writehandler(PhysPt address) {
static INLINE PageHandler* get_tlb_writehandler(const PhysPt address) {
return get_tlb_entry(address)->writehandler;
}
/* Use these helper functions to access linear addresses in readX/writeX functions */
static INLINE PhysPt PAGING_GetPhysicalPage(PhysPt linePage) {
static INLINE PhysPt PAGING_GetPhysicalPage(const PhysPt linePage) {
tlb_entry *entry = get_tlb_entry(linePage);
return (entry->phys_page<<12);
}
static INLINE PhysPt PAGING_GetPhysicalAddress(PhysPt linAddr) {
static INLINE PhysPt PAGING_GetPhysicalAddress(const PhysPt linAddr) {
tlb_entry *entry = get_tlb_entry(linAddr);
return (entry->phys_page<<12)|(linAddr&0xfff);
}
@ -387,62 +387,62 @@ static INLINE PhysPt PAGING_GetPhysicalAddress(PhysPt linAddr) {
/* Special inlined memory reading/writing */
static INLINE Bit8u mem_readb_inline(PhysPt address) {
HostPt tlb_addr=get_tlb_read(address);
static INLINE Bit8u mem_readb_inline(const PhysPt address) {
const HostPt tlb_addr=get_tlb_read(address);
if (tlb_addr) return host_readb(tlb_addr+address);
else return (Bit8u)(get_tlb_readhandler(address))->readb(address);
}
static INLINE Bit16u mem_readw_inline(PhysPt address) {
static INLINE Bit16u mem_readw_inline(const PhysPt address) {
if ((address & 0xfff)<0xfff) {
HostPt tlb_addr=get_tlb_read(address);
const HostPt tlb_addr=get_tlb_read(address);
if (tlb_addr) return host_readw(tlb_addr+address);
else return (Bit16u)(get_tlb_readhandler(address))->readw(address);
} else return mem_unalignedreadw(address);
}
static INLINE Bit32u mem_readd_inline(PhysPt address) {
static INLINE Bit32u mem_readd_inline(const PhysPt address) {
if ((address & 0xfff)<0xffd) {
HostPt tlb_addr=get_tlb_read(address);
const HostPt tlb_addr=get_tlb_read(address);
if (tlb_addr) return host_readd(tlb_addr+address);
else return (get_tlb_readhandler(address))->readd(address);
} else return mem_unalignedreadd(address);
}
static INLINE void mem_writeb_inline(PhysPt address,Bit8u val) {
HostPt tlb_addr=get_tlb_write(address);
static INLINE void mem_writeb_inline(const PhysPt address,const Bit8u val) {
const HostPt tlb_addr=get_tlb_write(address);
if (tlb_addr) host_writeb(tlb_addr+address,val);
else (get_tlb_writehandler(address))->writeb(address,val);
}
static INLINE void mem_writew_inline(PhysPt address,Bit16u val) {
if ((address & 0xfff)<0xfff) {
HostPt tlb_addr=get_tlb_write(address);
static INLINE void mem_writew_inline(const PhysPt address,const Bit16u val) {
if ((address & 0xfffu)<0xfffu) {
const HostPt tlb_addr=get_tlb_write(address);
if (tlb_addr) host_writew(tlb_addr+address,val);
else (get_tlb_writehandler(address))->writew(address,val);
} else mem_unalignedwritew(address,val);
}
static INLINE void mem_writed_inline(PhysPt address,Bit32u val) {
if ((address & 0xfff)<0xffd) {
HostPt tlb_addr=get_tlb_write(address);
static INLINE void mem_writed_inline(const PhysPt address,const Bit32u val) {
if ((address & 0xfffu)<0xffdu) {
const HostPt tlb_addr=get_tlb_write(address);
if (tlb_addr) host_writed(tlb_addr+address,val);
else (get_tlb_writehandler(address))->writed(address,val);
} else mem_unalignedwrited(address,val);
}
static INLINE bool mem_readb_checked(PhysPt address, Bit8u * val) {
HostPt tlb_addr=get_tlb_read(address);
static INLINE bool mem_readb_checked(const PhysPt address, Bit8u * const val) {
const HostPt tlb_addr=get_tlb_read(address);
if (tlb_addr) {
*val=host_readb(tlb_addr+address);
return false;
} else return (get_tlb_readhandler(address))->readb_checked(address, val);
}
static INLINE bool mem_readw_checked(PhysPt address, Bit16u * val) {
if ((address & 0xfff)<0xfff) {
HostPt tlb_addr=get_tlb_read(address);
static INLINE bool mem_readw_checked(const PhysPt address, Bit16u * const val) {
if ((address & 0xfffu)<0xfffu) {
const HostPt tlb_addr=get_tlb_read(address);
if (tlb_addr) {
*val=host_readw(tlb_addr+address);
return false;
@ -450,9 +450,9 @@ static INLINE bool mem_readw_checked(PhysPt address, Bit16u * val) {
} else return mem_unalignedreadw_checked(address, val);
}
static INLINE bool mem_readd_checked(PhysPt address, Bit32u * val) {
if ((address & 0xfff)<0xffd) {
HostPt tlb_addr=get_tlb_read(address);
static INLINE bool mem_readd_checked(const PhysPt address, Bit32u * const val) {
if ((address & 0xfffu)<0xffdu) {
const HostPt tlb_addr=get_tlb_read(address);
if (tlb_addr) {
*val=host_readd(tlb_addr+address);
return false;
@ -460,17 +460,17 @@ static INLINE bool mem_readd_checked(PhysPt address, Bit32u * val) {
} else return mem_unalignedreadd_checked(address, val);
}
static INLINE bool mem_writeb_checked(PhysPt address,Bit8u val) {
HostPt tlb_addr=get_tlb_write(address);
static INLINE bool mem_writeb_checked(const PhysPt address,const Bit8u val) {
const HostPt tlb_addr=get_tlb_write(address);
if (tlb_addr) {
host_writeb(tlb_addr+address,val);
return false;
} else return (get_tlb_writehandler(address))->writeb_checked(address,val);
}
static INLINE bool mem_writew_checked(PhysPt address,Bit16u val) {
if ((address & 0xfff)<0xfff) {
HostPt tlb_addr=get_tlb_write(address);
static INLINE bool mem_writew_checked(const PhysPt address,const Bit16u val) {
if ((address & 0xfffu)<0xfffu) {
const HostPt tlb_addr=get_tlb_write(address);
if (tlb_addr) {
host_writew(tlb_addr+address,val);
return false;
@ -478,9 +478,9 @@ static INLINE bool mem_writew_checked(PhysPt address,Bit16u val) {
} else return mem_unalignedwritew_checked(address,val);
}
static INLINE bool mem_writed_checked(PhysPt address,Bit32u val) {
if ((address & 0xfff)<0xffd) {
HostPt tlb_addr=get_tlb_write(address);
static INLINE bool mem_writed_checked(const PhysPt address,const Bit32u val) {
if ((address & 0xfffu)<0xffdu) {
const HostPt tlb_addr=get_tlb_write(address);
if (tlb_addr) {
host_writed(tlb_addr+address,val);
return false;
@ -488,7 +488,6 @@ static INLINE bool mem_writed_checked(PhysPt address,Bit32u val) {
} else return mem_unalignedwrited_checked(address,val);
}
extern bool dosbox_enable_nonrecursive_page_fault; /* user option */
extern bool dosbox_allow_nonrecursive_page_fault; /* when set, do nonrecursive mode (when executing instruction) */
#include <exception>

View File

@ -38,7 +38,7 @@ public:
device_LPT(Bit8u num, class CParallel* pp);
virtual ~device_LPT();
bool Read(Bit8u * data,Bit16u * size);
bool Write(Bit8u * data,Bit16u * size);
bool Write(const Bit8u * data,Bit16u * size);
bool Seek(Bit32u * pos,Bit32u type);
bool Close();
Bit16u GetInformation(void);

45
include/pc98_cg.h Normal file
View File

@ -0,0 +1,45 @@
#include "vga.h" /* uses VGA font RAM as CG ROM */
/* mapping function from 16-bit WORD to font RAM offset */
/* in: code = 16-bit JIS code word (unshifted)
* line = scan line within character cell
* right_half = 1 if right half, 0 if left half (double-wide only)
* out: byte offset in FONT RAM (0x00000-0x7FFFF inclusive)
*
* NTS: Font ROM/RAM in PC-98 is laid out as follows in this emulation:
*
* 0x00 0xAA ASCII single-wide character AA offset = (AA * 16)
* 0xHH 0xLL Double-wide char (HH != 0) number HHLL offset = ((HH & 0x7F) * 256) + ((LL & 0x7F) * 2) + right_half
*
* Visual layout:
*
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+................
* | | | | | | | | | | | | | | | | |................ 0x00 to 0xFF, 8-bit wide, at 0x0000
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+................
* | | | | | | | | |................ 0x0100 to 0x7F7F, 16-bit wide, at 0x0100, lower 7 bits only each byte
* +---+---+---+---+---+---+---+---+................
*
* This is not necessarily how the font data is stored in ROM on actual hardware.
* The hardware appears to accept 16 bits but only use the low 7 bits of each byte for double-wide.
* 0x80 0xAA is NOT an alias of single-wide chars. */
static inline uint32_t pc98_font_char_to_ofs(const uint16_t code,const uint8_t line,const uint8_t right_half) {
if (code & 0xFF00) {
/* double-wide. this maps 0x01-0x7F, 0x80 to 0x80, 0x81-0xFF to 0x01-0x7F */
const uint16_t x_code = (code & 0x7F) + ((((code + 0x7F00) & 0x7F00) + 0x0100) >> 1); /* 16-bit to 14-bit conversion. */
return ((((uint32_t)x_code * (uint32_t)16) + (uint32_t)(line & 0xF)) * (uint32_t)2) + (uint32_t)right_half;
}
else {
/* single-wide */
return ((uint32_t)code * (uint32_t)16) + (line & 0xF);
}
}
static inline uint8_t pc98_font_char_read(const uint16_t code,const uint8_t line,const uint8_t right_half) {
return vga.draw.font[pc98_font_char_to_ofs(code,line,right_half)];
}
static inline void pc98_font_char_write(const uint16_t code,const uint8_t line,const uint8_t right_half,const uint8_t byte) {
vga.draw.font[pc98_font_char_to_ofs(code,line,right_half)] = byte;
}

24
include/pc98_dac.h Normal file
View File

@ -0,0 +1,24 @@
void pc98_update_palette(void);
void pc98_update_digpal(unsigned char ent);
void pc98_set_digpal_entry(unsigned char ent,unsigned char grb);
void pc98_set_digpal_pair(unsigned char start,unsigned char pair);
unsigned char pc98_get_digpal_pair(unsigned char start);
void VGA_DAC_UpdateColor( Bitu index );
extern uint32_t pc98_text_palette[8];
extern uint8_t pc98_16col_analog_rgb_palette_index;
extern uint8_t pc98_pal_analog[256*3]; /* G R B 0x0..0xF */
extern uint8_t pc98_pal_digital[8]; /* G R B 0x0..0x7 */
/* 4-bit to 6-bit expansion */
static inline unsigned char dac_4to6(unsigned char c4) {
/* a b c d . .
*
* becomes
*
* a b c d a b */
return (c4 << 2) | (c4 >> 2);
}

131
include/pc98_gdc.h Normal file
View File

@ -0,0 +1,131 @@
#define PC98_GDC_FIFO_SIZE 32 /* taken from Neko Project II, but what is it really? */
#define GDC_COMMAND_BYTE 0x100
enum {
GDC_MASTER=0,
GDC_SLAVE=1
};
// VOPBIT_* source: Neko Project II
// operate: bit0 access page
// bit1 egc enable
// bit2 grcg bit6
// bit3 grcg bit7
// bit4 analog enable (16/256-color mode). 8-color mode if not.
// bit5 pc9821 vga
enum {
VOPBIT_ACCESS = 0,
VOPBIT_EGC = 1,
VOPBIT_GRCG = 2,
VOPBIT_ANALOG = 4,
VOPBIT_VGA = 5
};
union pc98_tile {
uint8_t b[2];
uint16_t w;
};
struct PC98_GDC_state {
PC98_GDC_state();
void reset_fifo(void);
void reset_rfifo(void);
void flush_fifo_old(void);
bool write_fifo(const uint16_t c);
bool write_fifo_command(const unsigned char c);
bool write_fifo_param(const unsigned char c);
bool rfifo_has_content(void);
uint8_t read_status(void);
uint8_t rfifo_read_data(void);
void idle_proc(void);
void force_fifo_complete(void);
void take_cursor_char_setup(unsigned char bi);
void take_cursor_pos(unsigned char bi);
void take_reset_sync_parameters(void);
void cursor_advance(void);
void begin_frame(void);
void next_line(void);
void load_display_partition(void);
void next_display_partition(void);
size_t fifo_can_read(void);
bool fifo_empty(void);
Bit16u read_fifo(void);
/* NTS:
*
* We're following the Neko Project II method of FIFO emulation BUT
* I wonder if the GDC maintains two FIFOs and allows stacking params
* in one and commands in another....? */
uint8_t cmd_parm_tmp[8]; /* temp storage before accepting params */
uint8_t rfifo[PC98_GDC_FIFO_SIZE];
uint8_t rfifo_read,rfifo_write;
uint16_t fifo[PC98_GDC_FIFO_SIZE]; /* NTS: Neko Project II uses one big FIFO for command and data, which makes sense to me */
uint8_t fifo_read,fifo_write;
uint8_t param_ram[16];
uint8_t param_ram_wptr;
uint16_t scan_address;
uint8_t row_height;
uint8_t row_line;
uint8_t display_partition;
uint16_t display_partition_rem_lines;
uint8_t display_partition_mask;
uint16_t active_display_lines; /* AL (translated) */
uint16_t active_display_words_per_line;/* AW bits (translated) */
uint16_t display_pitch;
uint8_t horizontal_sync_width; /* HS (translated) */
uint8_t vertical_sync_width; /* VS (translated) */
uint8_t horizontal_front_porch_width;/* HFP (translated) */
uint8_t horizontal_back_porch_width;/* HBP (translated) */
uint8_t vertical_front_porch_width; /* VFP (translated) */
uint8_t vertical_back_porch_width; /* VBP (translated) */
uint8_t display_mode; /* CG bits */
/* CG = 00 = mixed graphics & character
* CG = 01 = graphics mode
* CG = 10 = character mode
* CG = 11 = invalid */
uint8_t video_framing; /* IS bits */
/* IS = 00 = non-interlaced
* IS = 01 = invalid
* IS = 10 = interlaced repeat field for character displays
* IS = 11 = interlaced */
uint8_t current_command;
uint8_t proc_step;
uint8_t cursor_blink_state;
uint8_t cursor_blink_count; /* count from 0 to BR - 1 */
uint8_t cursor_blink_rate; /* BR */
bool draw_only_during_retrace; /* F bits */
bool dynamic_ram_refresh; /* D bits */
bool master_sync; /* master source generation */
bool display_enable;
bool cursor_enable;
bool cursor_blink;
bool idle;
bool doublescan; /* 200-line as 400-line */
};
typedef union pc98_tile egc_quad[4];
extern bool gdc_analog;
extern uint32_t pc98_text_palette[8];
extern struct PC98_GDC_state pc98_gdc[2];
extern egc_quad pc98_gdc_tiles;
extern uint8_t pc98_gdc_vramop;
extern uint8_t pc98_gdc_modereg;

13
include/pc98_gdc_const.h Normal file
View File

@ -0,0 +1,13 @@
enum {
GDC_CMD_RESET = 0x00, // 0 0 0 0 0 0 0 0
GDC_CMD_DISPLAY_BLANK = 0x0C, // 0 0 0 0 1 1 0 DE
GDC_CMD_SYNC = 0x0E, // 0 0 0 0 1 1 1 DE
GDC_CMD_CURSOR_POSITION = 0x49, // 0 1 0 0 1 0 0 1
GDC_CMD_CURSOR_CHAR_SETUP = 0x4B, // 0 1 0 0 1 0 1 1
GDC_CMD_PITCH_SPEC = 0x47, // 0 1 0 0 0 1 1 1
GDC_CMD_START_DISPLAY = 0x6B, // 0 1 1 0 1 0 1 1
GDC_CMD_VERTICAL_SYNC_MODE = 0x6E, // 0 1 1 0 1 1 1 M
GDC_CMD_PARAMETER_RAM_LOAD = 0x70 // 0 1 1 1 S S S S S[3:0] = starting address in parameter RAM
};

View File

@ -19,8 +19,8 @@
#ifndef DOSBOX_PCI_H
#define DOSBOX_PCI_H
#define PCI_MAX_PCIBUSSES 256
#define PCI_MAX_PCIDEVICES 32
#define PCI_MAX_PCIBUSSES 255
#define PCI_MAX_PCIDEVICES 32
#define PCI_MAX_PCIFUNCTIONS 8
class PCI_Device {
@ -51,8 +51,10 @@ public:
/* configuration space I/O */
virtual void config_write(Bit8u regnum,Bitu iolen,Bit32u value) {
if (iolen == 1) {
const unsigned char mask = config_writemask[regnum];
const unsigned char nmask = ~mask;
/* only allow writing to the bits marked off as writeable */
config[regnum] = (config[regnum] & (~config_writemask[regnum])) + (config_writemask[regnum] & value);
config[regnum] = (config[regnum] & nmask) + ((unsigned char)value & mask);
}
else if (iolen == 4 && (regnum&3) == 2) { /* unaligned DWORD write (subdividable into two WORD writes) */
config_write(regnum,2,value&0xFFFF);

View File

@ -19,47 +19,50 @@
#ifndef DOSBOX_PIC_H
#define DOSBOX_PIC_H
#include "dosbox.h"
/* CPU Cycle Timing */
extern Bit32s CPU_Cycles;
extern Bit32s CPU_CycleLeft;
extern Bit32s CPU_CycleMax;
extern cpu_cycles_count_t CPU_Cycles;
extern cpu_cycles_count_t CPU_CycleLeft;
extern cpu_cycles_count_t CPU_CycleMax;
typedef void (PIC_EOIHandler) (void);
typedef void (* PIC_EventHandler)(Bitu val);
enum PIC_irq_hacks {
PIC_irq_hack_none=0, // dispatch IRQ normally
PIC_irq_hack_cs_equ_ds // do not fire IRQ unless segment registers in the CPU are DS == CS
// explanation: a handful of games and demos have Sound Blaster interrupt service
// routines that assume DS == CS and they make no attempt to reload DS to refer
// to local variables properly. eventually these programs crash or malfunction
// because sooner or later, the ISR is called with CS != DS. This hack can be
// used to prevent those games/demos from crashing.
PIC_irq_hack_none=0, // dispatch IRQ normally
PIC_irq_hack_cs_equ_ds=(1u<<0u) // do not fire IRQ unless segment registers in the CPU are DS == CS
// explanation: a handful of games and demos have Sound Blaster interrupt service
// routines that assume DS == CS and they make no attempt to reload DS to refer
// to local variables properly. eventually these programs crash or malfunction
// because sooner or later, the ISR is called with CS != DS. This hack can be
// used to prevent those games/demos from crashing.
};
extern enum PIC_irq_hacks PIC_IRQ_hax[16];
extern unsigned int PIC_IRQ_hax[16];
void PIC_Set_IRQ_hack(int IRQ,enum PIC_irq_hacks hack);
enum PIC_irq_hacks PIC_parse_IRQ_hack_string(const char *str);
void PIC_Set_IRQ_hack(int IRQ,unsigned int hack);
unsigned int PIC_parse_IRQ_hack_string(const char *str);
extern Bitu PIC_IRQCheck;
extern Bitu PIC_Ticks;
static INLINE float PIC_TickIndex(void) {
return (CPU_CycleMax-CPU_CycleLeft-CPU_Cycles)/(float)CPU_CycleMax;
typedef double pic_tickindex_t;
static INLINE pic_tickindex_t PIC_TickIndex(void) {
return ((pic_tickindex_t)(CPU_CycleMax-CPU_CycleLeft-CPU_Cycles)) / ((pic_tickindex_t)CPU_CycleMax);
}
static INLINE Bits PIC_TickIndexND(void) {
return CPU_CycleMax-CPU_CycleLeft-CPU_Cycles;
}
static INLINE Bits PIC_MakeCycles(double amount) {
return (Bits)(CPU_CycleMax*amount);
static INLINE Bits PIC_MakeCycles(const pic_tickindex_t amount) {
return (Bits)((pic_tickindex_t)CPU_CycleMax * amount);
}
static INLINE double PIC_FullIndex(void) {
return PIC_Ticks+(double)PIC_TickIndex();
static INLINE pic_tickindex_t PIC_FullIndex(void) {
return (pic_tickindex_t)PIC_Ticks + PIC_TickIndex();
}
void PIC_ActivateIRQ(Bitu irq);
@ -69,7 +72,7 @@ void PIC_runIRQs(void);
bool PIC_RunQueue(void);
//Delay in milliseconds
void PIC_AddEvent(PIC_EventHandler handler,float delay,Bitu val=0);
void PIC_AddEvent(PIC_EventHandler handler,pic_tickindex_t delay,Bitu val=0);
void PIC_RemoveEvents(PIC_EventHandler handler);
void PIC_RemoveSpecificEvents(PIC_EventHandler handler, Bitu val);

View File

@ -71,6 +71,11 @@ public:
bool GetOptGNUSingleCharCheck(std::string &name);
void ChangeOptStyle(enum opt_style opt_style);
void EndOpt();
bool GetCurrentArgv(std::string &argv);
bool CurrentArgvEnd(void);
void EatCurrentArgv(void);
void NextArgv(void);
private:
typedef std::list<std::string>::iterator cmd_it;
std::string opt_gnu_getopt_singlechar; /* non-empty if we hit GNU options like -abcd => -a -b -c -d */
@ -82,27 +87,36 @@ private:
bool FindEntry(char const * const name,cmd_it & it,bool neednext=false);
};
/*! \brief Base Program class for built-in programs on drive Z:
*
* \description This provides the base class for built-in programs registered on drive Z:.
* In most cases, the class will override just the Run() method.
*/
class Program {
public:
Program();
virtual ~Program(){
Program(); //! Constructor
virtual ~Program(){ //! Default destructor
if (cmd != NULL) delete cmd;
if (psp != NULL) delete psp;
}
unsigned char exit_status;
std::string temp_line;
CommandLine * cmd;
DOS_PSP * psp;
virtual void Run(void)=0;
bool GetEnvStr(const char * entry,std::string & result);
bool GetEnvNum(Bitu num,std::string & result);
Bitu GetEnvCount(void);
bool SetEnv(const char * entry,const char * new_string);
void WriteOut(const char * format,...); /* Write to standard output */
void WriteOut_NoParsing(const char * format); /* Write to standard output, no parsing */
void ChangeToLongCmd();
void DebugDumpEnv();
void WriteExitStatus();
/*! \brief Exit status of the program
*/
unsigned char exit_status; //! Exit status, returned to the parent DOS process
std::string temp_line; //! Temporary string object for parsing
CommandLine * cmd; //! Command line object
DOS_PSP * psp; //! DOS kernel Program Segment Prefix associated with this program at runtime
virtual void Run(void)=0; //! Run() method, called when the program is run. Subclass must override this
bool GetEnvStr(const char * entry,std::string & result); //! Return an environment variable by name
bool GetEnvNum(Bitu num,std::string & result); //! Return an environment variable by index
Bitu GetEnvCount(void); //! Return the number of enviormental variables
bool SetEnv(const char * entry,const char * new_string); //! Set environment variable
void WriteOut(const char * format,...); //! Write to standard output
void WriteOut_NoParsing(const char * format); //! Write to standard output, no parsing
void ChangeToLongCmd(); //! Get command line from shell instead of PSP
void DebugDumpEnv(); //! Dump environment block to log
void WriteExitStatus(); //! Write exit status to CPU register AL for return to MS-DOS
};
typedef void (PROGRAMS_Main)(Program * * make);

97
include/ptrop.h Normal file
View File

@ -0,0 +1,97 @@
#include <stdint.h>
namespace ptrop {
/* return the misalignment in bytes of 'p' in the context of a data type of size 'A',
* 'A' must be a power of 2, or else this code will not work. */
static inline constexpr uintptr_t misalignment(const uintptr_t p,const uintptr_t A) {
return p & (A - (uintptr_t)1u);
}
template <const uintptr_t A> static inline constexpr uintptr_t misalignment(const uintptr_t p) { // DEFER
return misalignment(p,A);
}
template <typename A> static inline constexpr uintptr_t misalignment(const uintptr_t p) { // DEFER
return misalignment<(uintptr_t)sizeof(A)>(p);
}
template <typename T=unsigned char,typename A=T> static inline constexpr uintptr_t misalignment(T* const p) { // DEFER
return misalignment<A>((uintptr_t)((unsigned char*)p));
}
template <typename T=unsigned char,const uintptr_t A> static inline constexpr uintptr_t misalignment(T* const p) { // DEFER
return misalignment<A>((uintptr_t)((unsigned char*)p));
}
/* indicate whether pointer 'p' is aligned to type of size 'A' */
static inline constexpr bool isaligned(const uintptr_t p,const uintptr_t A) {
return misalignment(p,A) == (uintptr_t)0;
}
template <const uintptr_t A> static inline constexpr bool isaligned(const uintptr_t p) { // DEFER
return isaligned(p,A);
}
template <typename A> static inline constexpr bool isaligned(const uintptr_t p) { // DEFER
return isaligned<(uintptr_t)sizeof(A)>(p);
}
template <typename T=unsigned char,typename A=T> static inline constexpr bool isaligned(T* const p) { // DEFER
return isaligned<A>((uintptr_t)((unsigned char*)p));
}
template <typename T=unsigned char,const uintptr_t A> static inline constexpr bool isaligned(T* const p) { // DEFER
return isaligned<A>((uintptr_t)((unsigned char*)p));
}
/* take pointer 'p' and align downward to type of size 'A' */
static inline constexpr uintptr_t aligndown(const uintptr_t p,const uintptr_t A) {
return p - misalignment(p,A);
}
template <const uintptr_t A> static inline constexpr uintptr_t aligndown(const uintptr_t p) { // DEFER
return aligndown(p,A);
}
template <typename A> static inline constexpr uintptr_t aligndown(const uintptr_t p) { // DEFER
return aligndown<(uintptr_t)sizeof(A)>(p);
}
template <typename T=unsigned char,typename A=T> static inline constexpr T* aligndown(T* const p) { // DEFER
return (T*)aligndown<A>((uintptr_t)((unsigned char*)p));
}
template <typename T=unsigned char,const uintptr_t A> static inline constexpr T* aligndown(T* const p) { // DEFER
return (T*)aligndown<A>((uintptr_t)((unsigned char*)p));
}
/* take pointer 'p' and align upward to type of size 'A' */
static inline constexpr uintptr_t alignup(const uintptr_t p,const uintptr_t A) {
return aligndown(p + (uintptr_t)A - (uintptr_t)1u,A);
}
template <const uintptr_t A> static inline constexpr uintptr_t alignup(const uintptr_t p) { // DEFER
return alignup(p,A);
}
template <typename A> static inline constexpr uintptr_t alignup(const uintptr_t p) { // DEFER
return alignup<(uintptr_t)sizeof(A)>(p);
}
template <typename T=unsigned char,typename A=T> static inline constexpr T* alignup(T* const p) { // DEFER
return (T*)alignup<A>((uintptr_t)((unsigned char*)p));
}
template <typename T=unsigned char,const uintptr_t A> static inline constexpr T* alignup(T* const p) { // DEFER
return (T*)alignup<A>((uintptr_t)((unsigned char*)p));
}
void self_test(void);
}

View File

@ -129,7 +129,7 @@ public:
virtual Bit8u Read_AbsoluteSector(Bit32u sectnum, void* data);
virtual Bit8u Write_AbsoluteSector(Bit32u sectnum, void* data);
virtual Bit8u Write_AbsoluteSector(Bit32u sectnum, const void* data);
private:

View File

@ -4,175 +4,29 @@
#include <stdint.h>
static inline uint8_t __le_ts_u8(const uint8_t *p) { /* typesafe */
return *p;
}
static inline uint8_t __le_u8(const void *p) {
return *((uint8_t*)(p));
}
static inline uint16_t __le_ts_u16(const uint16_t *p) { /* typesafe */
return *p;
}
static inline uint16_t __le_u16(const void *p) {
return *((uint16_t*)(p));
}
static inline int8_t __le_ts_s8(const int8_t *p) { /* typesafe */
return *p;
}
static inline int8_t __le_s8(const void *p) {
return *((int8_t*)(p));
}
static inline int16_t __le_ts_s16(const int16_t *p) { /* typesafe */
return *p;
}
static inline int16_t __le_s16(const void *p) {
return *((int16_t*)(p));
}
/* TODO: typesafe versions of the functions below */
static inline void __w_be_u24(void *_d,uint32_t data) {
unsigned char *d = (unsigned char*)(_d);
*d++ = data >> 16;
*d++ = data >> 8;
*d++ = data;
}
static inline void __w_le_u16(const void *p,const uint16_t val) {
*((uint16_t*)(p)) = val;
}
static inline void __w_be_u16(const void *p,const uint16_t val) {
((uint8_t*)(p))[0] = val >> 8UL;
((uint8_t*)(p))[1] = val;
}
static inline uint32_t __le_u24(const void *p) {
return *((uint32_t*)(p)) & 0xFFFFFF;
}
static inline int32_t __le_s24(const void *p) {
return ((int32_t)(*((uint32_t*)(p)) << 8)) >> 8; /* NTS: unsigned shift to move low 24 bits over, then signed shift to stretch it down */
}
static inline uint32_t __le_u32(const void *p) {
return *((uint32_t*)(p));
}
static inline int32_t __le_s32(const void *p) {
return *((int32_t*)(p));
}
static inline void __w_le_u32(const void *p,const uint32_t val) {
*((uint32_t*)(p)) = val;
}
static inline void __w_be_u32(const void *p,const uint32_t val) {
((uint8_t*)(p))[0] = val >> 24UL;
((uint8_t*)(p))[1] = val >> 16UL;
((uint8_t*)(p))[2] = val >> 8UL;
((uint8_t*)(p))[3] = val;
}
static inline uint64_t __le_u64(const void *p) {
return *((uint64_t*)(p));
}
static inline float __le_float32(void *p) {
return *((float*)(p));
}
static inline double __le_float64(void *p) {
return *((double*)(p));
}
static inline void __w_le_u64(const void *p,const uint64_t val) {
*((uint64_t*)(p)) = val;
}
static inline uint16_t __be_u16(void *p) {
const unsigned char *c = (const unsigned char *)p;
return (((uint16_t)c[0]) << 8U) |
(((uint16_t)c[1]) << 0U);
}
static inline int16_t __be_s16(void *p) {
return (int16_t)__be_u16(p);
}
static inline uint32_t __be_u24(const void *p) {
const unsigned char *c = (const unsigned char *)p;
return (((uint32_t)c[0]) << 16U) |
(((uint32_t)c[1]) << 8U) |
(((uint32_t)c[2]) << 0U);
}
static inline int32_t __be_s24(const void *p) {
return ((int32_t)(__be_u24(p) << 8)) >> 8; /* NTS: unsigned shift to move low 24 bits over, then signed shift to stretch it down */
}
static inline uint32_t __be_u32(void *p) {
const unsigned char *c = (const unsigned char *)p;
return (((uint32_t)c[0]) << 24U) |
(((uint32_t)c[1]) << 16U) |
(((uint32_t)c[2]) << 8U) |
(((uint32_t)c[3]) << 0U);
}
static inline int32_t __be_s32(void *p) {
return (int32_t)__be_u32(p);
}
static inline uint64_t __be_u64(void *p) {
const unsigned char *c = (const unsigned char *)p;
return (((uint64_t)c[0]) << 56ULL) |
(((uint64_t)c[1]) << 48ULL) |
(((uint64_t)c[2]) << 40ULL) |
(((uint64_t)c[3]) << 32ULL) |
(((uint64_t)c[4]) << 24ULL) |
(((uint64_t)c[5]) << 16ULL) |
(((uint64_t)c[6]) << 8ULL) |
(((uint64_t)c[7]) << 0ULL);
}
static inline void __w_be_u64(const void *p,const uint64_t val) {
((uint8_t*)(p))[0] = val >> 56ULL;
((uint8_t*)(p))[1] = val >> 48ULL;
((uint8_t*)(p))[2] = val >> 40ULL;
((uint8_t*)(p))[3] = val >> 32ULL;
((uint8_t*)(p))[4] = val >> 24UL;
((uint8_t*)(p))[5] = val >> 16UL;
((uint8_t*)(p))[6] = val >> 8UL;
((uint8_t*)(p))[7] = val;
}
static inline uint16_t __be_to_he_16(uint16_t val) {
return (val << 8) | (val >> 8);
}
static inline uint16_t __he_to_be_16(uint16_t val) {
return (val << 8) | (val >> 8);
}
static inline uint32_t __be_to_he_32(uint32_t val) {
val = ((val & 0xFF00FF00) >> 8) | ((val & 0x00FF00FF) << 8);
return (val << 16) | (val >> 16);
}
static inline uint32_t __he_to_be_32(uint32_t val) {
val = ((val & 0xFF00FF00) >> 8) | ((val & 0x00FF00FF) << 8);
return (val << 16) | (val >> 16);
}
#endif /* __ISP_UTILS_MISC_RAWINT_H */

View File

@ -25,22 +25,22 @@
#include "mem.h"
#endif
#define FLAG_CF 0x00000001
#define FLAG_PF 0x00000004
#define FLAG_AF 0x00000010
#define FLAG_ZF 0x00000040
#define FLAG_SF 0x00000080
#define FLAG_OF 0x00000800
#define FLAG_CF 0x00000001U
#define FLAG_PF 0x00000004U
#define FLAG_AF 0x00000010U
#define FLAG_ZF 0x00000040U
#define FLAG_SF 0x00000080U
#define FLAG_OF 0x00000800U
#define FLAG_TF 0x00000100
#define FLAG_IF 0x00000200
#define FLAG_DF 0x00000400
#define FLAG_TF 0x00000100U
#define FLAG_IF 0x00000200U
#define FLAG_DF 0x00000400U
#define FLAG_IOPL 0x00003000
#define FLAG_NT 0x00004000
#define FLAG_VM 0x00020000
#define FLAG_AC 0x00040000
#define FLAG_ID 0x00200000
#define FLAG_IOPL 0x00003000U
#define FLAG_NT 0x00004000U
#define FLAG_VM 0x00020000U
#define FLAG_AC 0x00040000U
#define FLAG_ID 0x00200000U
#define FMASK_TEST (FLAG_CF | FLAG_PF | FLAG_AF | FLAG_ZF | FLAG_SF | FLAG_OF)
#define FMASK_NORMAL (FMASK_TEST | FLAG_DF | FLAG_TF | FLAG_IF )
@ -123,8 +123,8 @@ static INLINE RealPt RealMakeSeg(SegNames index,Bit16u off) {
static INLINE void SegSet16(Bitu index,Bit16u val) {
Segs.val[index]=val;
Segs.phys[index]=val << 4;
Segs.val[index]=(Bitu)val;
Segs.phys[index]=(PhysPt)((unsigned int)val << 4U);
/* real mode does not update limit */
}

View File

@ -31,6 +31,15 @@
//Enable this for scalers to support 0 input for empty lines
//#define RENDER_NULL_INPUT
enum ASPECT_MODES {
ASPECT_FALSE = 0
,ASPECT_TRUE
#if C_SURFACE_POSTRENDER_ASPECT
,ASPECT_NEAREST
,ASPECT_BILINEAR
#endif
};
typedef struct {
struct {
Bit8u red;
@ -82,16 +91,18 @@ typedef struct {
Bit8u *cacheRead;
Bitu inHeight, inLine, outLine;
} scale;
RenderPal_t pal;
RenderPal_t pal;
bool updating;
bool active;
bool aspect;
int aspect;
bool aspectOffload;
bool fullFrame;
bool forceUpdate;
bool autofit;
} Render_t;
extern Render_t render;
extern Bitu last_gfx_flags;
extern ScalerLineHandler_t RENDER_DrawLine;
void RENDER_SetSize(Bitu width,Bitu height,Bitu bpp,float fps,double scrn_ratio);
bool RENDER_StartUpdate(void);

View File

@ -1,4 +1,3 @@
#define IDR_MENU 101
#define dosbox_ico 102
#define ID_OPENFILE 103
#define ID_KEYMAP 104
@ -6,10 +5,8 @@
#define ID_CAPMOUSE 106
#define ID_PAUSE 107
#define ID_SURFACE 108
#define ID_DDRAW 109
#define ID_OPENGL 110
#define ID_OPENGLNB 111
#define ID_OPENGLHQ 112
#define ID_DIRECT3D 113
#define ID_D3D_PS 114
#define ID_TOGGLE 115
@ -359,7 +356,6 @@
#define ID_MOUNT_IMAGE_Y 459
#define ID_FORCESCALER 460
#define ID_VSYNC_HOST 461
#define ID_OVERLAY 462
#define ID_WINRES_USER 463
#define ID_WINRES_DESKTOP 464
#define ID_WINFULL_USER 465
@ -538,9 +534,6 @@
#define ID_OVERSCAN_8 639
#define ID_OVERSCAN_9 640
#define ID_OVERSCAN_10 641
#define ID_DRVFORCE_DIRECTX 642
#define ID_DRVFORCE_WINDIB 643
#define ID_DRVFORCE_AUTO 644
#define ID_CPUTYPE_PENTIUM_MMX 645
#define ID_SB_SB16VIBRA 646
#define ID_MUTE 647
@ -717,4 +710,30 @@
#define ID_GLIDE_EMU_OPENGL 818
#define ID_GLIDE_EMU_AUTO 819
#define ID_ALWAYS_ON_TOP 820
#define ID_RESET_RESCALE 821
#define ID_RESET 822
#define ID_MTWAVE 823
#define ID_RESTART_DOS 824
#define ID_PC98_GDC5MHZ 825
#define ID_PC98_200SCANLINEEFFECT 826
#define ID_PC98_FOURPARTITIONSGRAPHICS 827
#define ID_PC98_4MHZ_TIMER 828
#define ID_PC98_5MHZ_TIMER 829
#define ID_PC98_CLEAR_TEXT_LAYER 830
#define ID_PC98_CLEAR_GRAPHICS_LAYER 831
#define ID_CPUTYPE_8086 832
#define ID_CPUTYPE_8086_PREFETCH 833
#define ID_CPUTYPE_80186 834
#define ID_CPUTYPE_80186_PREFETCH 835
#define ID_CPUTYPE_286 836
#define ID_CPUTYPE_286_PREFETCH 837
#define ID_CPUTYPE_486_PREFETCH 838
#define ID_CPUTYPE_PENTIUM_PRO 839
#define ID_SHOWCONSOLE 840
#define ID_PC98_ENABLEEGC 841
#define ID_PC98_ENABLEGRCG 842
#define ID_PC98_ENABLE16COLORS 843
#if defined(WIN32)
# define ID_WIN_SYSMENU_RESTOREMENU 0x0F00
# define ID_WIN_SYSMENU_TOGGLEMENU 0x0F01
#endif

Some files were not shown because too many files have changed in this diff Show More