- Cleaned up game names (primary sets no longer have revision labels in title).

- Added volume controls to UI.
- Renamed "Sega Rally Controls" to "Sega Rally/Dirt Devils Controls" (even though Dirt Devils has no hand brake).
- Hooked up gear shifting and view change for Dirt Devils.
- Removed debug printf()'s from DSB.cpp.
- Removed debug printf() from Real3D.cpp.
- Disabled assertions in SCSPDSP.cpp.
- Converted all error messages in Amp library to Supermodel format.
This commit is contained in:
Bart Trzynadlowski 2011-09-08 05:08:16 +00:00
parent 4040b7eeee
commit abd86a5624
13 changed files with 137 additions and 63 deletions

View file

@ -1,4 +1,3 @@
//TODO: clean up game titles (for example: Star Wars is incorrectly labeled rev.A)
/**
** Supermodel
** A Sega Model 3 Arcade Emulator.
@ -106,7 +105,7 @@ const struct GameInfo g_Model3GameList[] =
// Daytona USA 2 (Revision A)
{
"daytona2",
"Daytona USA 2: Battle on the Edge (Revision A)",
"Daytona USA 2: Battle on the Edge",
"Sega",
1998,
0x21,
@ -272,7 +271,7 @@ const struct GameInfo g_Model3GameList[] =
// Dirt Devils (Revision A)
{
"dirtdvls",
"Dirt Devils (Revision A)",
"Dirt Devils",
"Sega",
1998,
0x21,
@ -280,7 +279,7 @@ const struct GameInfo g_Model3GameList[] =
TRUE, // 32 MB of banked CROM (Mirror)
0x4000000, // 64 MB of VROM
0xC00000, // 12 MB of sample ROMs
GAME_INPUT_COMMON|GAME_INPUT_VEHICLE,
GAME_INPUT_COMMON|GAME_INPUT_VEHICLE|GAME_INPUT_SHIFT4|GAME_INPUT_RALLY,
0, // no MPEG board
false, // no drive board
@ -334,7 +333,7 @@ const struct GameInfo g_Model3GameList[] =
// Dirt Devils (Alt)(Revision A)
{
"dirtdvlsa",
"Dirt Devils (Alt)(Revision A)",
"Dirt Devils (Alt.)",
"Sega",
1998,
0x21,
@ -342,7 +341,7 @@ const struct GameInfo g_Model3GameList[] =
TRUE, // 32 MB of banked CROM (Mirror)
0x4000000, // 64 MB of VROM
0xC00000, // 12 MB of sample ROMs
GAME_INPUT_COMMON|GAME_INPUT_VEHICLE,
GAME_INPUT_COMMON|GAME_INPUT_VEHICLE|GAME_INPUT_SHIFT4,
0, // no MPEG board
false, // no drive board
@ -534,7 +533,7 @@ const struct GameInfo g_Model3GameList[] =
// Fighting Vipers 2 (Revision A)
{
"fvipers2",
"Fighting Vipers 2 (Revision A)",
"Fighting Vipers 2",
"Sega",
1998,
0x20,
@ -676,7 +675,7 @@ const struct GameInfo g_Model3GameList[] =
// Harley-Davidson & L.A. Riders (Revision A)
{
"harley",
"Harley-Davidson & L.A. Riders (Revision A)",
"Harley-Davidson & L.A. Riders",
"Sega",
1997,
0x20,
@ -1374,7 +1373,7 @@ const struct GameInfo g_Model3GameList[] =
// Scud Race Plus (Revision A)
{
"scudp",
"Scud Race Plus (Revision A)",
"Scud Race Plus",
"Sega",
1997,
0x15,
@ -1608,7 +1607,7 @@ const struct GameInfo g_Model3GameList[] =
// Spikeout (Revision C)
{
"spikeout",
"Spikeout (Revision C)",
"Spikeout",
"Sega",
1998,
0x21,
@ -1977,7 +1976,7 @@ const struct GameInfo g_Model3GameList[] =
// Virtua Fighter 3 (Revision C)
{
"vf3",
"Virtua Fighter 3 (Revision C)",
"Virtua Fighter 3",
"Sega",
1996,
0x10,
@ -2196,7 +2195,7 @@ const struct GameInfo g_Model3GameList[] =
// Virtual On: Oratorio Tangram (Revision B)
{
"von2",
"Virtual On: Oratorio Tangram (Revision B)",
"Virtual On: Oratorio Tangram",
"Sega",
1998,
0x20,
@ -2268,10 +2267,10 @@ const struct GameInfo g_Model3GameList[] =
}
},
// Virtual On: Oratorio Tangram (Ver 5.4g)
// Virtual On: Oratorio Tangram (Version 5.4g)
{
"von254g",
"Virtual On: Oratorio Tangram (Ver 5.4g)",
"Virtual On: Oratorio Tangram (Version 5.4g)",
"Sega",
1998,
0x20,
@ -2857,7 +2856,7 @@ const struct GameInfo g_Model3GameList[] =
// Virtua Striker 2 '99.1 (Revision B)
{
"vs2v991",
"Virtua Striker 2 '99.1 (Revision B)",
"Virtua Striker 2 '99.1",
"Sega",
1999,
0x21,

View file

@ -65,7 +65,7 @@ const char* CInput::GetInputGroup()
case GAME_INPUT_VEHICLE: return "Racing Game Steering Controls";
case GAME_INPUT_SHIFT4: return "Racing Game Gear Shift";
case GAME_INPUT_VR: return "Racing Game VR View Buttons";
case GAME_INPUT_RALLY: return "Sega Rally Buttons";
case GAME_INPUT_RALLY: return "Sega Rally/Dirt Devils Buttons";
case GAME_INPUT_TWIN_JOYSTICKS: return "Virtual On Controls";
case GAME_INPUT_ANALOG_JOYSTICK: return "Analog Joystick";
case GAME_INPUT_GUN1: // Fall through to below

View file

@ -15,7 +15,11 @@ CInputs::CInputs(CInputSystem *system) : m_system(system)
uiSaveState = AddSwitchInput("UISaveState", "Save State", GAME_INPUT_UI, "KEY_F5");
uiChangeSlot = AddSwitchInput("UIChangeSlot", "Change Save Slot", GAME_INPUT_UI, "KEY_F6");
uiLoadState = AddSwitchInput("UILoadState", "Load State", GAME_INPUT_UI, "KEY_F7");
uiDumpInpState = AddSwitchInput("UIDumpInputState", "Dump Input State", GAME_INPUT_UI, "KEY_F8");
uiMusicVolUp = AddSwitchInput("UIMusicVolUp", "Increase Music Volume", GAME_INPUT_UI, "KEY_F10");
uiMusicVolDown = AddSwitchInput("UIMusicVolDown", "Decrease Music Volume", GAME_INPUT_UI, "KEY_F9");
uiSoundVolUp = AddSwitchInput("UISoundVolUp", "Increase Sound Volume", GAME_INPUT_UI, "KEY_F12");
uiSoundVolDown = AddSwitchInput("UISoundVolDown", "Decrease Sound Volume", GAME_INPUT_UI, "KEY_F11");
uiDumpInpState = AddSwitchInput("UIDumpInputState", "Dump Input State", GAME_INPUT_UI, "NONE"); // disabled for release
uiClearNVRAM = AddSwitchInput("UIClearNVRAM", "Clear NVRAM", GAME_INPUT_UI, "KEY_ALT+KEY_N");
uiSelectCrosshairs = AddSwitchInput("UISelectCrosshairs", "Select Crosshairs", GAME_INPUT_UI, "KEY_ALT+KEY_I");
uiToggleFrLimit = AddSwitchInput("UIToggleFrameLimit", "Toggle Frame Limiting", GAME_INPUT_UI, "KEY_ALT+KEY_T");

View file

@ -70,6 +70,10 @@ public:
CSwitchInput *uiSaveState;
CSwitchInput *uiChangeSlot;
CSwitchInput *uiLoadState;
CSwitchInput *uiMusicVolUp;
CSwitchInput *uiMusicVolDown;
CSwitchInput *uiSoundVolUp;
CSwitchInput *uiSoundVolDown;
CSwitchInput *uiDumpInpState;
CSwitchInput *uiClearNVRAM;
CSwitchInput *uiSelectCrosshairs;

View file

@ -1,4 +1,3 @@
//TODO: amp can print error messages -- change them to Supermodel error messages
/**
** Supermodel
** A Sega Model 3 Arcade Emulator.
@ -679,7 +678,7 @@ static const char *stateName[] =
void CDSB2::WriteMPEGFIFO(UINT8 byte)
{
printf("fifo: %x (state %s)\n", byte, stateName[mpegState]);
//printf("fifo: %x (state %s)\n", byte, stateName[mpegState]);
switch (mpegState)
{
case ST_IDLE:
@ -695,7 +694,7 @@ void CDSB2::WriteMPEGFIFO(UINT8 byte)
usingMPEGStart = mpegStart;
usingMPEGEnd = mpegEnd;
MPEG_PlayMemory((const char *) &mpegROM[mpegStart], mpegEnd-mpegStart);
printf("playing %X\n", mpegStart);
//printf("playing %X\n", mpegStart);
mpegState = ST_IDLE;
playing = 1;
}
@ -739,7 +738,7 @@ void CDSB2::WriteMPEGFIFO(UINT8 byte)
if (playing)
{
printf("Setting loop point to %x\n", mpegStart);
//printf("Setting loop point to %x\n", mpegStart);
usingLoopStart = mpegStart;
usingLoopEnd = mpegEnd-mpegStart;
MPEG_SetLoop((const char *) &mpegROM[usingLoopStart], usingLoopEnd);
@ -763,17 +762,19 @@ void CDSB2::WriteMPEGFIFO(UINT8 byte)
//printf("mpegEnd=%x\n", mpegEnd);
// default to full stereo
// mixer_set_stereo_volume(0, 255, 255);
// mixer_set_stereo_pan(0, MIXER_PAN_RIGHT, MIXER_PAN_LEFT);
//mixer_set_stereo_volume(0, 255, 255);
//mixer_set_stereo_pan(0, MIXER_PAN_RIGHT, MIXER_PAN_LEFT);
mpegState = ST_IDLE;
break;
// case ST_GOTA0:
/*
case ST_GOTA0:
// ch 0 mono
// mixer_set_stereo_volume(0, 0, 255);
// printf("ch 0 mono\n");
// mixer_set_stereo_pan(0, MIXER_PAN_CENTER, MIXER_PAN_CENTER);
mixer_set_stereo_volume(0, 0, 255);
printf("ch 0 mono\n");
mixer_set_stereo_pan(0, MIXER_PAN_CENTER, MIXER_PAN_CENTER);
mpegState = ST_IDLE;
// break;
break;
*/
case ST_GOTA4: // dayto2pe plays advertise tune from this state by writing 0x75
mpegState = ST_IDLE;
if (byte == 0x75)
@ -783,7 +784,7 @@ void CDSB2::WriteMPEGFIFO(UINT8 byte)
usingMPEGStart = mpegStart;
usingMPEGEnd = mpegEnd;
MPEG_PlayMemory((const char *) &mpegROM[mpegStart], mpegEnd-mpegStart);
printf("playing %X (from st_gota4)\n", mpegStart);
//printf("playing %X (from st_gota4)\n", mpegStart);
playing = 1;
}
break;
@ -792,9 +793,9 @@ void CDSB2::WriteMPEGFIFO(UINT8 byte)
break;
case ST_GOTB1:
// ch 1 mono
// printf("ch 1 mono\n");
// mixer_set_stereo_volume(0, 255, 0);
// mixer_set_stereo_pan(0, MIXER_PAN_CENTER, MIXER_PAN_CENTER);
//printf("ch 1 mono\n");
//mixer_set_stereo_volume(0, 255, 0);
//mixer_set_stereo_pan(0, MIXER_PAN_CENTER, MIXER_PAN_CENTER);
mpegState = ST_IDLE;
break;
case ST_GOTB4:
@ -862,7 +863,7 @@ UINT8 CDSB2::Read8(UINT32 addr)
return ram[addr^1];
}
// printf("R8 @ %x\n", addr);
//printf("R8 @ %x\n", addr);
return 0;
}
@ -878,7 +879,7 @@ UINT16 CDSB2::Read16(UINT32 addr)
return *(UINT16 *) &ram[addr];
}
// printf("R16 @ %x\n", addr);
//printf("R16 @ %x\n", addr);
return 0;
}
@ -899,7 +900,7 @@ UINT32 CDSB2::Read32(UINT32 addr)
lo = *(UINT16 *) &ram[addr+2];
return (hi<<16)|lo;
}
// printf("R32 @ %x\n", addr);
//printf("R32 @ %x\n", addr);
return 0;
}
@ -920,7 +921,7 @@ void CDSB2::Write8(UINT32 addr, UINT8 data)
return;
}
// printf("W8: %x @ %x (PC=%x)\n", data, addr, m68k_get_reg(NULL, M68K_REG_PC));
//printf("W8: %x @ %x (PC=%x)\n", data, addr, m68k_get_reg(NULL, M68K_REG_PC));
}
void CDSB2::Write16(UINT32 addr, UINT16 data)
@ -1109,9 +1110,9 @@ void CDSB2::LoadState(CBlockFile *StateFile)
MPEG_StopPlaying();
//DEBUG
printf("mpegStart=%X, mpegEnd=%X\n", mpegStart, mpegEnd);
printf("usingMPEGStart=%X, usingMPEGEnd=%X\n", usingMPEGStart, usingMPEGEnd);
printf("usingLoopStart=%X, usingLoopEnd=%X\n", usingLoopStart, usingLoopEnd);
//printf("mpegStart=%X, mpegEnd=%X\n", mpegStart, mpegEnd);
//printf("usingMPEGStart=%X, usingMPEGEnd=%X\n", usingMPEGStart, usingMPEGEnd);
//printf("usingLoopStart=%X, usingLoopEnd=%X\n", usingLoopStart, usingLoopEnd);
}

View file

@ -647,7 +647,8 @@ void CReal3D::UploadTexture(UINT32 header, UINT16 *texData)
case 0x80: // MAME thinks these might be a gamma table
//break;
default: // unknown
printf("unknown texture format %02X\n", header>>24);
DebugLog("Unknown texture format %02X\n", header>>24);
//printf("unknown texture format %02X\n", header>>24);
break;
}

View file

@ -2,12 +2,10 @@
// - remove UI dump input state
// - VBL timing?
// - Controls for Dirt Devils, and other recent games (is bass working?)
// - Stereo reverse option (see Srally2 sound test menu)
// - Comment source code, clean up
// - BOOL -> bool, TRUE/FALSE -> true/false
// - Add option for building with /MD in MSVC Makefile
// - Remove SUPERMODEL_SOUND
// - EmulateSCSP -> EmulateSound ?
/**
** Supermodel
@ -824,6 +822,58 @@ int Supermodel(const char *zipFile, CInputs *Inputs, CINIFile *CmdLine)
Debugger->Reset();
#endif // SUPERMODEL_DEBUGGER
}
else if (Inputs->uiMusicVolUp->Pressed())
{
// Increase music volume by 10%
int vol = (int) g_Config.GetMusicVolume() + 10;
if (vol > 200)
vol = 200;
g_Config.SetMusicVolume(vol);
printf("Music volume: %d%%", vol);
if (200 == vol)
puts(" (maximum)");
else
printf("\n");
}
else if (Inputs->uiMusicVolDown->Pressed())
{
// Decrease music volume by 10%
int vol = (int) g_Config.GetMusicVolume() - 10;
if (vol < 0)
vol = 0;
g_Config.SetMusicVolume(vol);
printf("Music volume: %d%%", vol);
if (0 == vol)
puts(" (muted)");
else
printf("\n");
}
else if (Inputs->uiSoundVolUp->Pressed())
{
// Increase sound volume by 10%
int vol = (int) g_Config.GetSoundVolume() + 10;
if (vol > 200)
vol = 200;
g_Config.SetSoundVolume(vol);
printf("Sound volume: %d%%", vol);
if (200 == vol)
puts(" (maximum)");
else
printf("\n");
}
else if (Inputs->uiSoundVolDown->Pressed())
{
// Decrease sound volume by 10%
int vol = (int) g_Config.GetSoundVolume() - 10;
if (vol < 0)
vol = 0;
g_Config.SetSoundVolume(vol);
printf("Sound volume: %d%%", vol);
if (0 == vol)
puts(" (muted)");
else
printf("\n");
}
else if (Inputs->uiDumpInpState->Pressed())
{
// Dump input states

View file

@ -32,7 +32,7 @@
#include <new>
#include <cstring>
#include "Types.h"
#include "Supermodel.h"
#include "MPEG.h"
//#include "m1snd.h"
@ -89,12 +89,12 @@ int decodeMPEGOneFrame(struct AUDIO_HEADER *header)
if (header->layer==1) {
if (layer3_frame(header,cnt)) {
warn(" error. blip.\n");
ErrorLog("Internal error in MPEG decoder (%s:%d).", __FILE__, __LINE__);
return -1;
}
} else if (header->layer==2)
if (layer2_frame(header,cnt)) {
warn(" error. blip.\n");
ErrorLog("Internal error in MPEG decoder (%s:%d).", __FILE__, __LINE__);
return -1;
}
@ -121,19 +121,19 @@ int g,snd_eof=0;
//printf("%d Hz, layer %d\n", t_sampling_frequency[header.ID][header.sampling_frequency], header.layer);
if (setup_audio(&header)!=0) {
warn("Cannot set up audio. Exiting\n");
if (setup_audio(&header)!=0) { // will never fail (setup_audio() does nothing)
ErrorLog("Internal error in MPEG decoder (%s:%d).", __FILE__, __LINE__);
return -1;
}
if (header.layer==1) {
if (layer3_frame(&header,cnt)) {
warn(" error. blip.\n");
ErrorLog("Internal error in MPEG decoder (%s:%d).", __FILE__, __LINE__);
return -1;
}
} else if (header.layer==2)
if (layer2_frame(&header,cnt)) {
warn(" error. blip.\n");
ErrorLog("Internal error in MPEG decoder (%s:%d).", __FILE__, __LINE__);
return -1;
}
@ -173,17 +173,20 @@ void initialise_globals(void)
void report_header_error(int err)
{
switch (err) {
case GETHDR_ERR: die("error reading mpeg bitstream. exiting.\n");
case GETHDR_ERR:
ErrorLog("Internal error in MPEG decoder: unable to read bit stream.");
break;
case GETHDR_NS : warn("this is a file in MPEG 2.5 format, which is not defined\n");
warn("by ISO/MPEG. It is \"a special Fraunhofer format\".\n");
warn("amp does not support this format. sorry.\n");
case GETHDR_NS :
ErrorLog("Internal error in MPEG decoder: invalid MPEG format encountered.");
break;
case GETHDR_FL1: warn("ISO/MPEG layer 1 is not supported by amp.\n");
case GETHDR_FL1:
ErrorLog("Internal error in MPEG decoder: unsupported MPEG format encountered.");
break;
case GETHDR_FF : warn("free format bitstreams are not supported. sorry.\n");
case GETHDR_FF :
ErrorLog("Internal error in MPEG decoder: unsupported bit stream encountered.");
break;
case GETHDR_SYN: warn("oops, we're out of sync.\n");
case GETHDR_SYN:
ErrorLog("Internal error in MPEG decoder: out of sync!");
break;
case GETHDR_EOF:
default: ; /* some stupid compilers need the semicolon */

View file

@ -13,6 +13,8 @@
#define HUFFMAN
#include "huffman.h"
#include "Supermodel.h"
static inline unsigned int viewbits(int n)
{
unsigned int pos,ret_value;
@ -65,7 +67,8 @@ int len;
* have another table with huffman tables lengths, and
* it would be a mess. just in case, scream&shout.
*/
printf(" h_cue clobbered. this is a bug. blip.\n");
ErrorLog("Internal error in MPEG decoder (%s:%d).", __FILE__, __LINE__); // h_cue clobbered
exit (-1);
}
chunk <<= 32-19;

View file

@ -14,6 +14,8 @@
#define LAYER2
#include "layer2.h"
#include "Supermodel.h"
int layer2_frame(struct AUDIO_HEADER *header,int cnt)
{
int i,s,sb,ch,gr,bitrate,bound=0;
@ -80,7 +82,7 @@ int hsize,fs,mean_frame_size;
nbal=(char (*)[])&t_nbal2;
sblimit=8;
break;
default : printf(" bit alloc info no gud ");
default : ErrorLog("Internal error in MPEG decoder (%s:%d).", __FILE__, __LINE__);
}
break;
case 1 : switch (bitrate) /* 1 = 48 kHz */
@ -101,7 +103,7 @@ int hsize,fs,mean_frame_size;
nbal=(char (*)[])&t_nbal2;
sblimit=8;
break;
default : printf(" bit alloc info no gud ");
default : ErrorLog("Internal error in MPEG decoder (%s:%d).", __FILE__, __LINE__);
}
break;
case 2 : switch (bitrate) /* 2 = 32 kHz */
@ -125,10 +127,10 @@ int hsize,fs,mean_frame_size;
nbal=(char (*)[])&t_nbal3;
sblimit=12;
break;
default : printf("bit alloc info not ok\n");
default : ErrorLog("Internal error in MPEG decoder (%s:%d).", __FILE__, __LINE__);
}
break;
default : printf("sampling freq. not ok/n");
default : ErrorLog("Internal error in MPEG decoder (%s:%d).", __FILE__, __LINE__); // sampling frequency no good
} else {
bit_alloc_index=(char (*)[][16])&t_allocMPG2;
nbal=(char (*)[])&t_nbalMPG2;

View file

@ -18,6 +18,8 @@
#define MISC2
#include "misc2.h"
#include "Supermodel.h"
/*
* fras == Formula for Requantization and All Scaling **************************
*/
@ -623,7 +625,7 @@ float a[2];
*/
if (info->window_switching_flag[gr][0] && info->block_type[gr][0]==2)
if (info->mixed_block_flag[gr][0]) {
die("mixed block? hmmmm...., downmix for mixed blocks is not yet implemented\n");
ErrorLog("Internal error in MPEG decoder: mixed blocks encountered.");
} else {
int window,window_len;
int isbound[3];

View file

@ -1,3 +1,7 @@
/*
* None of these functions should ever be called in Supermodel.
*/
/* this file is a part of amp software
util.c: created by Andrew Richards

View file

@ -1,6 +1,7 @@
#include "Supermodel.h"
#include "SCSPDSP.h"
#include <assert.h>
//#include <assert.h>
#define assert(x) ; // disable assert() for releases
#include <memory.h>
#include <stdio.h>
#include <malloc.h>