1
0
Fork 0

added support for a config class/file. System not initialized perfect yet!

(env is not fixed)


Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@289
This commit is contained in:
Peter Veenstra 2002-09-17 20:07:25 +00:00
parent f02d440dc9
commit d0fc1da99b
31 changed files with 502 additions and 120 deletions

View file

@ -24,7 +24,7 @@
#include "mixer.h"
#include "timer.h"
#include "hardware.h"
#include "setup.h"
/*
Thanks to vdmsound for nice simple way to implement this
*/
@ -192,8 +192,9 @@ static void ADLIB_OutputHandler (char * towrite) {
void ADLIB_Init(void) {
void ADLIB_Init(Section* sec) {
Section_prop * section=static_cast<Section_prop *>(sec);
if(!section->Get_bool("STATUS")) return;
timer1.isMasked=true;
timer1.base=0;
timer1.count=0;

View file

@ -203,7 +203,7 @@ Bit16u DMA_16_Write(Bit32u dmachan,Bit8u * buffer,Bit16u count) {
void DMA_Init(void) {
void DMA_Init(Section* sec) {
for (Bit32u i=0;i<0x10;i++) {
IO_RegisterWriteHandler(i,write_dma,"DMA1");
}

View file

@ -22,11 +22,11 @@
#include "mixer.h"
#include "mem.h"
#include "hardware.h"
#include "setup.h"
#define CMS_RATE 22050
#define CMS_VOLUME 6000
#define FREQ_SHIFT 16
#define SIN_ENT 1024
@ -213,7 +213,11 @@ static void CMS_OutputHandler (char * towrite) {
};
void CMS_Init(void) {
void CMS_Init(Section* sec) {
Section_prop * section=static_cast<Section_prop *>(sec);
if(!section->Get_bool("STATUS")) return;
Bits i;
/* Register the Mixer CallBack */
cms_chan=MIXER_AddChannel(CMS_CallBack,CMS_RATE,"CMS");

View file

@ -80,7 +80,7 @@ void IO_FreeWriteHandler(Bit32u port) {
}
void IO_Init(void) {
void IO_Init(Section * sect) {
for (Bitu i=0;i<IO_MAX;i++) {
IO_RegisterReadHandler(i,&IO_ReadDefault,"Default Read");
IO_RegisterWriteHandler(i,&IO_WriteDefault,"Default Write");

View file

@ -91,7 +91,7 @@ void JOYSTICK_Move_Y(Bitu which,float y) {
}
void JOYSTICK_Init(void) {
void JOYSTICK_Init(Section* sec) {
IO_RegisterReadHandler(0x201,read_p201,"JOYSTICK");
IO_RegisterWriteHandler(0x201,write_p201,"JOYSTICK");
stick[0].enabled=false;

View file

@ -321,7 +321,7 @@ void KEYBOARD_AddKey(Bitu keytype,bool pressed) {
KEYBOARD_AddCode(ret);
};
void KEYBOARD_Init(void) {
void KEYBOARD_Init(Section* sec) {
IO_RegisterWriteHandler(0x60,write_p60,"Keyboard");
IO_RegisterReadHandler(0x60,read_p60,"Keyboard");
IO_RegisterWriteHandler(0x61,write_p61,"Keyboard");

View file

@ -222,7 +222,7 @@ Bit32u mem_readd(PhysPt pt){
void MEM_Init(void) {
void MEM_Init(Section * sect) {
/* Init all tables */
Bitu i;
i=MAX_PAGES;
@ -235,7 +235,7 @@ void MEM_Init(void) {
/* Allocate the first mb of memory */
memory=(Bit8u *)malloc(1024*1024);
if (!memory) {
E_Exit("Can't allocate memory for memory");
throw("Can't allocate memory for memory");
}
/* Setup tables for first mb */
MEM_SetupMapping(0,PAGE_COUNT(1024*1024),memory);

View file

@ -217,7 +217,7 @@ static void MIXER_CallBack(void * userdata, Uint8 *stream, int len) {
void MIXER_Init(void) {
void MIXER_Init(Section* sec) {
/* Initialize the internal stuff */
first_channel=0;
mix_ticks=GetTicks();

View file

@ -95,7 +95,7 @@ static void PCSPEAKER_CallBack(Bit8u * stream,Bit32u len) {
}
}
void PCSPEAKER_Init(void) {
void PCSPEAKER_Init(Section* sec) {
spkr.chan=MIXER_AddChannel(&PCSPEAKER_CallBack,SPKR_RATE,"PC-SPEAKER");
MIXER_Enable(spkr.chan,false);
MIXER_SetMode(spkr.chan,MIXER_16MONO);

View file

@ -312,7 +312,7 @@ void PIC_runIRQs(void) {
}
void PIC_Init(void) {
void PIC_Init(Section* sec) {
/* Setup pic0 and pic1 with initial values like DOS has normally */
PIC_IRQCheck=0;
PIC_IRQActive=PIC_NOIRQ;

View file

@ -23,6 +23,7 @@
#include "dma.h"
#include "pic.h"
#include "hardware.h"
#include "setup.h"
#define SB_BASE 0x220
#define SB_IRQ 5
@ -603,14 +604,16 @@ static void SB_OutputHandler (char * towrite) {
void SBLASTER_Init(void) {
void SBLASTER_Init(Section* sec) {
Section_prop * section=static_cast<Section_prop *>(sec);
if(!section->Get_bool("STATUS")) return;
sb.chan=MIXER_AddChannel(&SBLASTER_CallBack,22050,"SBLASTER");
MIXER_Enable(sb.chan,false);
sb.state=DSP_S_NORMAL;
/* Setup the hardware handler part */
sb.base=SB_BASE;
sb.irq=SB_IRQ;
sb.dma=SB_DMA;
sb.base=section->Get_hex("BASE");
sb.irq=section->Get_int("IRQ");
sb.dma=section->Get_int("DMA");
SB_Enable(true);
sb.hwblock.dev_name="SB";

View file

@ -25,6 +25,7 @@
#include "inout.h"
#include "mixer.h"
#include "mem.h"
#include "setup.h"
#define TANDY_DIV 111860
#define TANDY_RATE 22050
@ -125,7 +126,9 @@ static void TANDYSOUND_CallBack(Bit8u * stream,Bit32u len) {
}
};
void TANDY_Init(void) {
void TANDYSOUND_Init(Section* sec) {
Section_prop * section=static_cast<Section_prop *>(sec);
if(!section->Get_bool("STATUS")) return;
IO_RegisterWriteHandler(0xc0,write_pc0,"Tandy Sound");
tandy_chan=MIXER_AddChannel(&TANDYSOUND_CallBack,TANDY_RATE,"TANDY");
MIXER_Enable(tandy_chan,false);

View file

@ -297,7 +297,7 @@ void TIMER_CheckPIT(void) {
}
void TIMER_Init(void) {
void TIMER_Init(Section* sect) {
Bitu i;
IO_RegisterWriteHandler(0x40,write_latch,"PIT Timer 0");
IO_RegisterWriteHandler(0x42,write_latch,"PIT Timer 2");

View file

@ -146,7 +146,7 @@ void VGA_StartResize(void) {
}
void VGA_Init() {
void VGA_Init(Section* sec) {
vga.draw.resizing=false;
VGA_SetupMemory();
VGA_SetupMisc();