Add dosbox.conf option to control the physical address of the S3 linear framebuffer

This commit is contained in:
Jonathan Campbell 2018-07-13 02:55:36 -07:00
parent 198d5557f0
commit dc1b948d1b
4 changed files with 22 additions and 2 deletions

View File

@ -27,6 +27,8 @@
#define VGA_LFB_MAPPED
#define S3_LFB_BASE_DEFAULT 0xE0000000u
class PageHandler;
enum VGAModes {

View File

@ -929,6 +929,9 @@ void DOSBOX_SetupConfigSections(void) {
Pstring->Set_values(machines);
Pstring->Set_help("The type of machine DOSBox tries to emulate.");
Phex = secprop->Add_hex("svga lfb base", Property::Changeable::OnlyAtStart, 0);
Phex->Set_help("If nonzero, define the physical memory address of the linear framebuffer.");
Pint = secprop->Add_int("vmemdelay", Property::Changeable::WhenIdle,0);
Pint->SetMinMax(-1,100000);
Pint->Set_help( "VGA Memory I/O delay in nanoseconds. Set to -1 to use default, 0 to disable.\n"

View File

@ -135,6 +135,7 @@
#include "pc98_gdc_const.h"
#include "mixer.h"
#include "menu.h"
#include "mem.h"
#include <string.h>
#include <stdlib.h>
@ -164,6 +165,8 @@ extern uint8_t pc98_egc_srcmask[2]; /* host given (Neko: eg
extern uint8_t pc98_egc_maskef[2]; /* effective (Neko: egc.mask2) */
extern uint8_t pc98_egc_mask[2]; /* host given (Neko: egc.mask) */
uint32_t S3_LFB_BASE = S3_LFB_BASE_DEFAULT;
VGA_Type vga;
SVGA_Driver svga;
int enableCGASnow;
@ -534,6 +537,19 @@ void VGA_Reset(Section*) {
GDC_display_plane_wait_for_vsync = section->Get_bool("pc-98 buffer page flip");
S3_LFB_BASE = section->Get_hex("svga lfb base");
if (S3_LFB_BASE == 0) S3_LFB_BASE = S3_LFB_BASE_DEFAULT;
/* must be 64KB aligned */
S3_LFB_BASE += 0x7FFFUL;
S3_LFB_BASE &= ~0xFFFFUL;
/* must not overlap system RAM */
if (S3_LFB_BASE < (MEM_TotalPages()*4096))
S3_LFB_BASE = (MEM_TotalPages()*4096);
LOG(LOG_VGA,LOG_DEBUG)("S3 linear framebuffer at 0x%lx",(unsigned long)S3_LFB_BASE);
pc98_allow_scanline_effect = section->Get_bool("pc-98 allow scanline effect");
mainMenu.get_item("pc98_allow_200scanline").check(pc98_allow_scanline_effect).refresh_item(mainMenu);

View File

@ -19,8 +19,7 @@
#include "vga.h"
/* TODO: Make this user-configurable */
#define S3_LFB_BASE 0xE0000000u
extern uint32_t S3_LFB_BASE;
#define BIOSMEM_SEG 0x40u