summaryrefslogtreecommitdiffstats
path: root/src/osd
diff options
context:
space:
mode:
Diffstat (limited to 'src/osd')
-rw-r--r--src/osd/portmedia/pmmidi.c62
-rw-r--r--src/osd/sdl/debugqt.c8
-rw-r--r--src/osd/sdl/debugqtmainwindow.c532
-rw-r--r--src/osd/sdl/debugqtview.c386
-rw-r--r--src/osd/sdl/debugqtview.h38
-rw-r--r--src/osd/sdl/debugqtwindow.h4
-rw-r--r--src/osd/sdl/sdlsocket.c10
-rw-r--r--src/osd/windows/d3dcomm.h4
-rw-r--r--src/osd/windows/d3dhlsl.c954
-rw-r--r--src/osd/windows/d3dhlsl.h42
-rw-r--r--src/osd/windows/drawd3d.c262
-rw-r--r--src/osd/windows/drawd3d.h14
-rw-r--r--src/osd/windows/winmain.c18
-rw-r--r--src/osd/windows/winmain.h10
-rw-r--r--src/osd/windows/winsocket.c12
15 files changed, 1177 insertions, 1179 deletions
diff --git a/src/osd/portmedia/pmmidi.c b/src/osd/portmedia/pmmidi.c
index 222941509d5..0485f9e63d1 100644
--- a/src/osd/portmedia/pmmidi.c
+++ b/src/osd/portmedia/pmmidi.c
@@ -12,8 +12,8 @@
static const int RX_EVENT_BUF_SIZE = 512;
-#define MIDI_SYSEX 0xf0
-#define MIDI_EOX 0xf7
+#define MIDI_SYSEX 0xf0
+#define MIDI_EOX 0xf7
struct osd_midi_device
{
@@ -196,13 +196,13 @@ int osd_read_midi_channel(osd_midi_device *dev, UINT8 *pOut)
if (dev->rx_sysex)
{
- if (status & 0x80) // sys real-time imposing on us?
+ if (status & 0x80) // sys real-time imposing on us?
{
if ((status == 0xf2) || (status == 0xf3))
{
*pOut++ = status;
- *pOut++ = Pm_MessageData1(dev->rx_evBuf[msg].message);
- *pOut++ = Pm_MessageData2(dev->rx_evBuf[msg].message);
+ *pOut++ = Pm_MessageData1(dev->rx_evBuf[msg].message);
+ *pOut++ = Pm_MessageData2(dev->rx_evBuf[msg].message);
bytesOut += 3;
}
else
@@ -211,7 +211,7 @@ int osd_read_midi_channel(osd_midi_device *dev, UINT8 *pOut)
bytesOut++;
}
}
- else // shift out the sysex bytes
+ else // shift out the sysex bytes
{
for (int i = 0; i < 4; i++)
{
@@ -231,18 +231,18 @@ int osd_read_midi_channel(osd_midi_device *dev, UINT8 *pOut)
{
switch ((status>>4) & 0xf)
{
- case 0xc: // 2-byte messages
+ case 0xc: // 2-byte messages
case 0xd:
*pOut++ = status;
- *pOut++ = Pm_MessageData1(dev->rx_evBuf[msg].message);
+ *pOut++ = Pm_MessageData1(dev->rx_evBuf[msg].message);
bytesOut += 2;
break;
- case 0xf: // system common
+ case 0xf: // system common
switch (status & 0xf)
{
- case 0: // System Exclusive
- *pOut++ = status; // this should be OK: the shortest legal sysex is F0 tt dd F7, I believe
+ case 0: // System Exclusive
+ *pOut++ = status; // this should be OK: the shortest legal sysex is F0 tt dd F7, I believe
*pOut++ = (dev->rx_evBuf[msg].message>>8) & 0xff;
*pOut++ = (dev->rx_evBuf[msg].message>>16) & 0xff;
*pOut++ = (dev->rx_evBuf[msg].message>>24) & 0xff;
@@ -250,28 +250,28 @@ int osd_read_midi_channel(osd_midi_device *dev, UINT8 *pOut)
dev->rx_sysex = true;
break;
- case 7: // End of System Exclusive
+ case 7: // End of System Exclusive
*pOut++ = status;
bytesOut += 1;
break;
- case 2: // song pos
- case 3: // song select
+ case 2: // song pos
+ case 3: // song select
*pOut++ = status;
- *pOut++ = Pm_MessageData1(dev->rx_evBuf[msg].message);
- *pOut++ = Pm_MessageData2(dev->rx_evBuf[msg].message);
+ *pOut++ = Pm_MessageData1(dev->rx_evBuf[msg].message);
+ *pOut++ = Pm_MessageData2(dev->rx_evBuf[msg].message);
bytesOut += 3;
break;
- default: // all other defined Fx messages are 1 byte
+ default: // all other defined Fx messages are 1 byte
break;
}
break;
default:
*pOut++ = status;
- *pOut++ = Pm_MessageData1(dev->rx_evBuf[msg].message);
- *pOut++ = Pm_MessageData2(dev->rx_evBuf[msg].message);
+ *pOut++ = Pm_MessageData1(dev->rx_evBuf[msg].message);
+ *pOut++ = Pm_MessageData2(dev->rx_evBuf[msg].message);
bytesOut += 3;
break;
}
@@ -289,17 +289,17 @@ void osd_write_midi_channel(osd_midi_device *dev, UINT8 data)
#ifndef DISABLE_MIDI
int bytes_needed = 0;
PmEvent ev;
- ev.timestamp = 0; // use the current time
+ ev.timestamp = 0; // use the current time
// handle sysex
if (dev->last_status == MIDI_SYSEX)
{
-// printf("sysex: %02x (%d)\n", data, dev->xmit_cnt);
+// printf("sysex: %02x (%d)\n", data, dev->xmit_cnt);
// if we get a status that isn't sysex, assume it's system common
if ((data & 0x80) && (data != MIDI_EOX))
{
-// printf("common during sysex!\n");
+// printf("common during sysex!\n");
ev.message = Pm_Message(data, 0, 0);
Pm_Write(dev->pmStream, &ev, 1);
return;
@@ -315,7 +315,7 @@ void osd_write_midi_channel(osd_midi_device *dev, UINT8 data)
dev->xmit_in[0] = dev->xmit_in[1] = dev->xmit_in[2] = dev->xmit_in[3] = 0;
dev->xmit_cnt = 0;
-// printf("SysEx packet: %08x\n", ev.message);
+// printf("SysEx packet: %08x\n", ev.message);
// if this is EOX, kill the running status
if (data == MIDI_EOX)
@@ -345,7 +345,7 @@ void osd_write_midi_channel(osd_midi_device *dev, UINT8 data)
if ((dev->xmit_cnt == 1) && (dev->xmit_in[0] == MIDI_SYSEX))
{
-// printf("Start SysEx!\n");
+// printf("Start SysEx!\n");
dev->last_status = MIDI_SYSEX;
return;
}
@@ -353,27 +353,27 @@ void osd_write_midi_channel(osd_midi_device *dev, UINT8 data)
// are we there yet?
switch ((dev->xmit_in[0]>>4) & 0xf)
{
- case 0xc: // 2-byte messages
+ case 0xc: // 2-byte messages
case 0xd:
bytes_needed = 2;
break;
- case 0xf: // system common
+ case 0xf: // system common
switch (dev->xmit_in[0] & 0xf)
{
- case 0: // System Exclusive is handled above
+ case 0: // System Exclusive is handled above
break;
- case 7: // End of System Exclusive
+ case 7: // End of System Exclusive
bytes_needed = 1;
break;
- case 2: // song pos
- case 3: // song select
+ case 2: // song pos
+ case 3: // song select
bytes_needed = 3;
break;
- default: // all other defined Fx messages are 1 byte
+ default: // all other defined Fx messages are 1 byte
bytes_needed = 1;
break;
}
diff --git a/src/osd/sdl/debugqt.c b/src/osd/sdl/debugqt.c
index 8a4972da48d..33a842e3dd0 100644
--- a/src/osd/sdl/debugqt.c
+++ b/src/osd/sdl/debugqt.c
@@ -82,7 +82,7 @@ static void xml_configuration_save(running_machine &machine, int config_type, xm
// Create an xml node
xml_data_node *debugger_node;
debugger_node = xml_add_child(parentnode, "window", NULL);
- if (debugger_node == NULL)
+ if (debugger_node == NULL)
continue;
xml_set_attribute_int(debugger_node, "type", xmlConfigurations[i].m_type);
@@ -144,7 +144,7 @@ static void load_and_clear_main_window_config(std::vector<WindowQtConfig>& confi
if (configs[i].m_type == WindowQtConfig::WIN_TYPE_MAIN)
{
mainQtWindow->setGeometry(configs[i].m_position.x(), configs[i].m_position.y(),
- configs[i].m_size.x(), configs[i].m_size.y());
+ configs[i].m_size.x(), configs[i].m_size.y());
break;
}
}
@@ -168,8 +168,8 @@ static void setup_additional_startup_windows(running_machine& machine, std::vect
default: break;
}
foo->setGeometry(configs[i].m_position.x(), configs[i].m_position.y(),
- configs[i].m_size.x(), configs[i].m_size.y());
- foo->show();
+ configs[i].m_size.x(), configs[i].m_size.y());
+ foo->show();
}
}
diff --git a/src/osd/sdl/debugqtmainwindow.c b/src/osd/sdl/debugqtmainwindow.c
index 58630e390e8..5e4a88404e3 100644
--- a/src/osd/sdl/debugqtmainwindow.c
+++ b/src/osd/sdl/debugqtmainwindow.c
@@ -4,318 +4,318 @@
#include "debug/dvdisasm.h"
-MainWindow::MainWindow(running_machine* machine, QWidget* parent) :
- WindowQt(machine, parent),
- m_historyIndex(0),
- m_inputHistory()
+MainWindow::MainWindow(running_machine* machine, QWidget* parent) :
+ WindowQt(machine, parent),
+ m_historyIndex(0),
+ m_inputHistory()
{
- setGeometry(300, 300, 1000, 600);
-
- //
- // The main frame and its input and log widgets
- //
- QFrame* mainWindowFrame = new QFrame(this);
-
- // The input line
- m_inputEdit = new QLineEdit(mainWindowFrame);
- connect(m_inputEdit, SIGNAL(returnPressed()), this, SLOT(executeCommand()));
- m_inputEdit->installEventFilter(this);
-
-
- // The log view
- m_consoleView = new DebuggerView(DVT_CONSOLE,
- m_machine,
- mainWindowFrame);
- m_consoleView->setFocusPolicy(Qt::NoFocus);
- m_consoleView->setPreferBottom(true);
-
- QVBoxLayout* vLayout = new QVBoxLayout(mainWindowFrame);
- vLayout->addWidget(m_consoleView);
- vLayout->addWidget(m_inputEdit);
- vLayout->setSpacing(3);
- vLayout->setContentsMargins(4,0,4,2);
-
- setCentralWidget(mainWindowFrame);
-
- //
- // Menu bars
- //
- // Create two commands
- QAction* breakpointSetAct = new QAction("Toggle Breakpoint At Cursor", this);
- QAction* runToCursorAct = new QAction("Run To Cursor", this);
- breakpointSetAct->setShortcut(Qt::Key_F9);
- runToCursorAct->setShortcut(Qt::Key_F4);
- connect(breakpointSetAct, SIGNAL(triggered(bool)), this, SLOT(toggleBreakpointAtCursor(bool)));
- connect(runToCursorAct, SIGNAL(triggered(bool)), this, SLOT(runToCursor(bool)));
-
- // Right bar options
- QActionGroup* rightBarGroup = new QActionGroup(this);
- QAction* rightActRaw = new QAction("Raw Opcodes", this);
- QAction* rightActEncrypted = new QAction("Encrypted Opcodes", this);
- QAction* rightActComments = new QAction("Comments", this);
- rightActRaw->setCheckable(true);
- rightActEncrypted->setCheckable(true);
- rightActComments->setCheckable(true);
- rightActRaw->setActionGroup(rightBarGroup);
- rightActEncrypted->setActionGroup(rightBarGroup);
- rightActComments->setActionGroup(rightBarGroup);
- rightActRaw->setShortcut(QKeySequence("Ctrl+R"));
- rightActEncrypted->setShortcut(QKeySequence("Ctrl+E"));
- rightActComments->setShortcut(QKeySequence("Ctrl+C"));
- rightActRaw->setChecked(true);
- connect(rightBarGroup, SIGNAL(triggered(QAction*)), this, SLOT(rightBarChanged(QAction*)));
-
- // Assemble the options menu
- QMenu* optionsMenu = menuBar()->addMenu("&Options");
- optionsMenu->addAction(breakpointSetAct);
- optionsMenu->addAction(runToCursorAct);
- optionsMenu->addSeparator();
- optionsMenu->addActions(rightBarGroup->actions());
-
-
- //
- // Dock windows
- //
- QMenu* dockMenu = menuBar()->addMenu("Doc&ks");
-
- setCorner(Qt::TopRightCorner, Qt::TopDockWidgetArea);
- setCorner(Qt::TopLeftCorner, Qt::LeftDockWidgetArea);
-
- // The processor dock
- QDockWidget* cpuDock = new QDockWidget("processor", this);
- cpuDock->setAllowedAreas(Qt::LeftDockWidgetArea);
- m_procFrame = new ProcessorDockWidget(m_machine, cpuDock);
- cpuDock->setWidget(dynamic_cast<QWidget*>(m_procFrame));
-
- addDockWidget(Qt::LeftDockWidgetArea, cpuDock);
- dockMenu->addAction(cpuDock->toggleViewAction());
-
- // The disassembly dock
- QDockWidget* dasmDock = new QDockWidget("dasm", this);
- dasmDock->setAllowedAreas(Qt::TopDockWidgetArea);
- m_dasmFrame = new DasmDockWidget(m_machine, dasmDock);
- dasmDock->setWidget(m_dasmFrame);
-
- addDockWidget(Qt::TopDockWidgetArea, dasmDock);
- dockMenu->addAction(dasmDock->toggleViewAction());
+ setGeometry(300, 300, 1000, 600);
+
+ //
+ // The main frame and its input and log widgets
+ //
+ QFrame* mainWindowFrame = new QFrame(this);
+
+ // The input line
+ m_inputEdit = new QLineEdit(mainWindowFrame);
+ connect(m_inputEdit, SIGNAL(returnPressed()), this, SLOT(executeCommand()));
+ m_inputEdit->installEventFilter(this);
+
+
+ // The log view
+ m_consoleView = new DebuggerView(DVT_CONSOLE,
+ m_machine,
+ mainWindowFrame);
+ m_consoleView->setFocusPolicy(Qt::NoFocus);
+ m_consoleView->setPreferBottom(true);
+
+ QVBoxLayout* vLayout = new QVBoxLayout(mainWindowFrame);
+ vLayout->addWidget(m_consoleView);
+ vLayout->addWidget(m_inputEdit);
+ vLayout->setSpacing(3);
+ vLayout->setContentsMargins(4,0,4,2);
+
+ setCentralWidget(mainWindowFrame);
+
+ //
+ // Menu bars
+ //
+ // Create two commands
+ QAction* breakpointSetAct = new QAction("Toggle Breakpoint At Cursor", this);
+ QAction* runToCursorAct = new QAction("Run To Cursor", this);
+ breakpointSetAct->setShortcut(Qt::Key_F9);
+ runToCursorAct->setShortcut(Qt::Key_F4);
+ connect(breakpointSetAct, SIGNAL(triggered(bool)), this, SLOT(toggleBreakpointAtCursor(bool)));
+ connect(runToCursorAct, SIGNAL(triggered(bool)), this, SLOT(runToCursor(bool)));
+
+ // Right bar options
+ QActionGroup* rightBarGroup = new QActionGroup(this);
+ QAction* rightActRaw = new QAction("Raw Opcodes", this);
+ QAction* rightActEncrypted = new QAction("Encrypted Opcodes", this);
+ QAction* rightActComments = new QAction("Comments", this);
+ rightActRaw->setCheckable(true);
+ rightActEncrypted->setCheckable(true);
+ rightActComments->setCheckable(true);
+ rightActRaw->setActionGroup(rightBarGroup);
+ rightActEncrypted->setActionGroup(rightBarGroup);
+ rightActComments->setActionGroup(rightBarGroup);
+ rightActRaw->setShortcut(QKeySequence("Ctrl+R"));
+ rightActEncrypted->setShortcut(QKeySequence("Ctrl+E"));
+ rightActComments->setShortcut(QKeySequence("Ctrl+C"));
+ rightActRaw->setChecked(true);
+ connect(rightBarGroup, SIGNAL(triggered(QAction*)), this, SLOT(rightBarChanged(QAction*)));
+
+ // Assemble the options menu
+ QMenu* optionsMenu = menuBar()->addMenu("&Options");
+ optionsMenu->addAction(breakpointSetAct);
+ optionsMenu->addAction(runToCursorAct);
+ optionsMenu->addSeparator();
+ optionsMenu->addActions(rightBarGroup->actions());
+
+
+ //
+ // Dock windows
+ //
+ QMenu* dockMenu = menuBar()->addMenu("Doc&ks");
+
+ setCorner(Qt::TopRightCorner, Qt::TopDockWidgetArea);
+ setCorner(Qt::TopLeftCorner, Qt::LeftDockWidgetArea);
+
+ // The processor dock
+ QDockWidget* cpuDock = new QDockWidget("processor", this);
+ cpuDock->setAllowedAreas(Qt::LeftDockWidgetArea);
+ m_procFrame = new ProcessorDockWidget(m_machine, cpuDock);
+ cpuDock->setWidget(dynamic_cast<QWidget*>(m_procFrame));
+
+ addDockWidget(Qt::LeftDockWidgetArea, cpuDock);
+ dockMenu->addAction(cpuDock->toggleViewAction());
+
+ // The disassembly dock
+ QDockWidget* dasmDock = new QDockWidget("dasm", this);
+ dasmDock->setAllowedAreas(Qt::TopDockWidgetArea);
+ m_dasmFrame = new DasmDockWidget(m_machine, dasmDock);
+ dasmDock->setWidget(m_dasmFrame);
+
+ addDockWidget(Qt::TopDockWidgetArea, dasmDock);
+ dockMenu->addAction(dasmDock->toggleViewAction());
}
void MainWindow::setProcessor(device_t* processor)
{
- // Cpu swap
- m_procFrame->view()->view()->set_source(*m_procFrame->view()->view()->source_list().match_device(processor));
- m_dasmFrame->view()->view()->set_source(*m_dasmFrame->view()->view()->source_list().match_device(processor));
-
- // Scrollbar refresh - seems I should be able to do in the DebuggerView
- m_dasmFrame->view()->verticalScrollBar()->setValue(m_dasmFrame->view()->view()->visible_position().y);
- m_dasmFrame->view()->verticalScrollBar()->setValue(m_dasmFrame->view()->view()->visible_position().y);
-
- // Window title
- astring title;
- title.printf("Debug: %s - %s '%s'", m_machine->system().name, processor->name(), processor->tag());
- setWindowTitle(title.cstr());
+ // Cpu swap
+ m_procFrame->view()->view()->set_source(*m_procFrame->view()->view()->source_list().match_device(processor));
+ m_dasmFrame->view()->view()->set_source(*m_dasmFrame->view()->view()->source_list().match_device(processor));
+
+ // Scrollbar refresh - seems I should be able to do in the DebuggerView
+ m_dasmFrame->view()->verticalScrollBar()->setValue(m_dasmFrame->view()->view()->visible_position().y);
+ m_dasmFrame->view()->verticalScrollBar()->setValue(m_dasmFrame->view()->view()->visible_position().y);
+
+ // Window title
+ astring title;
+ title.printf("Debug: %s - %s '%s'", m_machine->system().name, processor->name(), processor->tag());
+ setWindowTitle(title.cstr());
}
// Used to intercept the user clicking 'X' in the upper corner
void MainWindow::closeEvent(QCloseEvent* event)
{
- debugActQuit();
+ debugActQuit();
}
// Used to intercept the user hitting the up arrow in the input widget
bool MainWindow::eventFilter(QObject* obj, QEvent* event)
{
- // Only filter keypresses
- QKeyEvent* keyEvent = NULL;
- if (event->type() == QEvent::KeyPress)
- {
- keyEvent = static_cast<QKeyEvent*>(event);
- }
- else
- {
- return QObject::eventFilter(obj, event);
- }
-
- // Catch up & down keys
- if (keyEvent->key() == Qt::Key_Up || keyEvent->key() == Qt::Key_Down)
- {
- if (keyEvent->key() == Qt::Key_Up)
- {
- if (m_historyIndex > 0)
- m_historyIndex--;
- }
- else if (keyEvent->key() == Qt::Key_Down)
- {
- if (m_historyIndex < m_inputHistory.size())
- m_historyIndex++;
- }
-
- // Populate the input edit or clear it if you're at the end
- if (m_historyIndex == m_inputHistory.size())
- {
- m_inputEdit->setText("");
- }
- else
- {
- m_inputEdit->setText(m_inputHistory[m_historyIndex]);
- }
- }
- else if (keyEvent->key() == Qt::Key_Enter)
- {
- executeCommand(false);
- }
- else
- {
- return QObject::eventFilter(obj, event);
- }
-
- return true;
+ // Only filter keypresses
+ QKeyEvent* keyEvent = NULL;
+ if (event->type() == QEvent::KeyPress)
+ {
+ keyEvent = static_cast<QKeyEvent*>(event);
+ }
+ else
+ {
+ return QObject::eventFilter(obj, event);
+ }
+
+ // Catch up & down keys
+ if (keyEvent->key() == Qt::Key_Up || keyEvent->key() == Qt::Key_Down)
+ {
+ if (keyEvent->key() == Qt::Key_Up)
+ {
+ if (m_historyIndex > 0)
+ m_historyIndex--;
+ }
+ else if (keyEvent->key() == Qt::Key_Down)
+ {
+ if (m_historyIndex < m_inputHistory.size())
+ m_historyIndex++;
+ }
+
+ // Populate the input edit or clear it if you're at the end
+ if (m_historyIndex == m_inputHistory.size())
+ {
+ m_inputEdit->setText("");
+ }
+ else
+ {
+ m_inputEdit->setText(m_inputHistory[m_historyIndex]);
+ }
+ }
+ else if (keyEvent->key() == Qt::Key_Enter)
+ {
+ executeCommand(false);
+ }
+ else
+ {
+ return QObject::eventFilter(obj, event);
+ }
+
+ return true;
}
void MainWindow::toggleBreakpointAtCursor(bool changedTo)
{
- debug_view_disasm* dasmView = downcast<debug_view_disasm*>(m_dasmFrame->view()->view());
- if (dasmView->cursor_visible())
- {
- if (debug_cpu_get_visible_cpu(*m_machine) == dasmView->source()->device())
- {
- offs_t address = downcast<debug_view_disasm *>(dasmView)->selected_address();
- device_debug *cpuinfo = dasmView->source()->device()->debug();
-
- // Find an existing breakpoint at this address
- INT32 bpindex = -1;
- for (device_debug::breakpoint* bp = cpuinfo->breakpoint_first();
- bp != NULL;
- bp = bp->next())
- {
- if (address == bp->address())
- {
- bpindex = bp->index();
- break;
- }
- }
-
- // If none exists, add a new one
- astring command;
- if (bpindex == -1)
- {
- command.printf("bpset 0x%X", address);
- }
- else
- {
- command.printf("bpclear 0x%X", bpindex);
- }
- debug_console_execute_command(*m_machine, command, 1);
- }
- }
-
- refreshAll();
+ debug_view_disasm* dasmView = downcast<debug_view_disasm*>(m_dasmFrame->view()->view());
+ if (dasmView->cursor_visible())
+ {
+ if (debug_cpu_get_visible_cpu(*m_machine) == dasmView->source()->device())
+ {
+ offs_t address = downcast<debug_view_disasm *>(dasmView)->selected_address();
+ device_debug *cpuinfo = dasmView->source()->device()->debug();
+
+ // Find an existing breakpoint at this address
+ INT32 bpindex = -1;
+ for (device_debug::breakpoint* bp = cpuinfo->breakpoint_first();
+ bp != NULL;
+ bp = bp->next())
+ {
+ if (address == bp->address())
+ {
+ bpindex = bp->index();
+ break;
+ }
+ }
+
+ // If none exists, add a new one
+ astring command;
+ if (bpindex == -1)
+ {
+ command.printf("bpset 0x%X", address);
+ }
+ else
+ {
+ command.printf("bpclear 0x%X", bpindex);
+ }
+ debug_console_execute_command(*m_machine, command, 1);
+ }
+ }
+
+ refreshAll();
}
void MainWindow::runToCursor(bool changedTo)
{
- debug_view_disasm* dasmView = downcast<debug_view_disasm*>(m_dasmFrame->view()->view());
- if (dasmView->cursor_visible())
- {
- if (debug_cpu_get_visible_cpu(*m_machine) == dasmView->source()->device())
- {
- offs_t address = downcast<debug_view_disasm*>(dasmView)->selected_address();
- astring command;
- command.printf("go 0x%X", address);
- debug_console_execute_command(*m_machine, command, 1);
- }
- }
+ debug_view_disasm* dasmView = downcast<debug_view_disasm*>(m_dasmFrame->view()->view());
+ if (dasmView->cursor_visible())
+ {
+ if (debug_cpu_get_visible_cpu(*m_machine) == dasmView->source()->device())
+ {
+ offs_t address = downcast<debug_view_disasm*>(dasmView)->selected_address();
+ astring command;
+ command.printf("go 0x%X", address);
+ debug_console_execute_command(*m_machine, command, 1);
+ }
+ }
}
void MainWindow::rightBarChanged(QAction* changedTo)
{
- debug_view_disasm* dasmView = downcast<debug_view_disasm*>(m_dasmFrame->view()->view());
- if (changedTo->text() == "Raw Opcodes")
- {
- dasmView->set_right_column(DASM_RIGHTCOL_RAW);
- }
- else if (changedTo->text() == "Encrypted Opcodes")
- {
- dasmView->set_right_column(DASM_RIGHTCOL_ENCRYPTED);
- }
- else if (changedTo->text() == "Comments")
- {
- dasmView->set_right_column(DASM_RIGHTCOL_COMMENTS);
- }
- m_dasmFrame->view()->viewport()->update();
+ debug_view_disasm* dasmView = downcast<debug_view_disasm*>(m_dasmFrame->view()->view());
+ if (changedTo->text() == "Raw Opcodes")
+ {
+ dasmView->set_right_column(DASM_RIGHTCOL_RAW);
+ }
+ else if (changedTo->text() == "Encrypted Opcodes")
+ {
+ dasmView->set_right_column(DASM_RIGHTCOL_ENCRYPTED);
+ }
+ else if (changedTo->text() == "Comments")
+ {
+ dasmView->set_right_column(DASM_RIGHTCOL_COMMENTS);
+ }
+ m_dasmFrame->view()->viewport()->update();
}
void MainWindow::executeCommand(bool withClear)
{
- QString command = m_inputEdit->text();
-
- // A blank command is a "silent step"
- if (command == "")
- {
- debug_cpu_get_visible_cpu(*m_machine)->debug()->single_step();
- return;
- }
-
- // If the user asked for help on a specific command, enhance the call
- if (command.trimmed().startsWith("help", Qt::CaseInsensitive))
- {
- if (command.split(" ", QString::SkipEmptyParts).length() == 2)
- {
- const int width = m_consoleView->view()->visible_size().x;
- command.append(QString(", %1").arg(width, 1, 16));
- }
- }
-
- // Send along the command
- debug_console_execute_command(*m_machine,
- command.toLocal8Bit().data(),
- true);
-
- // Add history & set the index to be the top of the stack
- addToHistory(command);
-
- // Clear out the text and reset the history pointer only if asked
- if (withClear)
- {
- m_inputEdit->clear();
- m_historyIndex = m_inputHistory.size();
- }
-
- // Refresh
- m_consoleView->viewport()->update();
- m_procFrame->view()->update();
- m_dasmFrame->view()->update();
+ QString command = m_inputEdit->text();
+
+ // A blank command is a "silent step"
+ if (command == "")
+ {
+ debug_cpu_get_visible_cpu(*m_machine)->debug()->single_step();
+ return;
+ }
+
+ // If the user asked for help on a specific command, enhance the call
+ if (command.trimmed().startsWith("help", Qt::CaseInsensitive))
+ {
+ if (command.split(" ", QString::SkipEmptyParts).length() == 2)
+ {
+ const int width = m_consoleView->view()->visible_size().x;
+ command.append(QString(", %1").arg(width, 1, 16));
+ }
+ }
+
+ // Send along the command
+ debug_console_execute_command(*m_machine,
+ command.toLocal8Bit().data(),
+ true);
+
+ // Add history & set the index to be the top of the stack
+ addToHistory(command);
+
+ // Clear out the text and reset the history pointer only if asked
+ if (withClear)
+ {
+ m_inputEdit->clear();
+ m_historyIndex = m_inputHistory.size();
+ }
+
+ // Refresh
+ m_consoleView->viewport()->update();
+ m_procFrame->view()->update();
+ m_dasmFrame->view()->update();
}
void MainWindow::debugActClose()
{
- m_machine->schedule_exit();
+ m_machine->schedule_exit();
}
void MainWindow::addToHistory(const QString& command)
{
- if (command == "")
- return;
-
- // Always push back when there is no previous history
- if (m_inputHistory.size() == 0)
- {
- m_inputHistory.push_back(m_inputEdit->text());
- return;
- }
-
- // If there is previous history, make sure it's not what you just executed
- if (m_inputHistory.back() != m_inputEdit->text())
- {
- m_inputHistory.push_back(m_inputEdit->text());
- }
+ if (command == "")
+ return;
+
+ // Always push back when there is no previous history
+ if (m_inputHistory.size() == 0)
+ {
+ m_inputHistory.push_back(m_inputEdit->text());
+ return;
+ }
+
+ // If there is previous history, make sure it's not what you just executed
+ if (m_inputHistory.back() != m_inputEdit->text())
+ {
+ m_inputHistory.push_back(m_inputEdit->text());
+ }
}
diff --git a/src/osd/sdl/debugqtview.c b/src/osd/sdl/debugqtview.c
index fdcd4ae43b2..77e868f5b6a 100644
--- a/src/osd/sdl/debugqtview.c
+++ b/src/osd/sdl/debugqtview.c
@@ -3,201 +3,201 @@
#include "debugqtview.h"
-DebuggerView::DebuggerView(const debug_view_type& type,
- running_machine* machine,
- QWidget* parent) :
- QAbstractScrollArea(parent),
- m_preferBottom(false),
- m_view(NULL),
- m_machine(machine)
+DebuggerView::DebuggerView(const debug_view_type& type,
+ running_machine* machine,
+ QWidget* parent) :
+ QAbstractScrollArea(parent),
+ m_preferBottom(false),
+ m_view(NULL),
+ m_machine(machine)
{
- // I like setting the font per-view since it doesn't override the menuing fonts.
- QFont viewFontRequest("Courier New");
- viewFontRequest.setFixedPitch(true);
- viewFontRequest.setPointSize(11);
- setFont(viewFontRequest);
-
- m_view = m_machine->debug_view().alloc_view(type,
- DebuggerView::debuggerViewUpdate,
- this);
-
- connect(verticalScrollBar(), SIGNAL(valueChanged(int)),
- this, SLOT(verticalScrollSlot(int)));
- connect(horizontalScrollBar(), SIGNAL(valueChanged(int)),
- this, SLOT(horizontalScrollSlot(int)));
+ // I like setting the font per-view since it doesn't override the menuing fonts.
+ QFont viewFontRequest("Courier New");
+ viewFontRequest.setFixedPitch(true);
+ viewFontRequest.setPointSize(11);
+ setFont(viewFontRequest);
+
+ m_view = m_machine->debug_view().alloc_view(type,
+ DebuggerView::debuggerViewUpdate,
+ this);
+
+ connect(verticalScrollBar(), SIGNAL(valueChanged(int)),
+ this, SLOT(verticalScrollSlot(int)));
+ connect(horizontalScrollBar(), SIGNAL(valueChanged(int)),
+ this, SLOT(horizontalScrollSlot(int)));
}
void DebuggerView::paintEvent(QPaintEvent* event)
{
- // Tell the MAME debug view how much real estate is available
- QFontMetrics actualFont = fontMetrics();
- const int fontWidth = MAX(1, actualFont.width('_'));
- const int fontHeight = MAX(1, actualFont.height());
- m_view->set_visible_size(debug_view_xy(width()/fontWidth, height()/fontHeight));
-
-
- // Handle the scroll bars
- const int verticalScrollCharDiff = m_view->total_size().y - m_view->visible_size().y;
- const int scrollSize = verticalScrollCharDiff < 0 ? 0 : verticalScrollCharDiff;
- bool atEnd = false;
- if (verticalScrollBar()->value() == verticalScrollBar()->maximum())
- {
- atEnd = true;
- }
- verticalScrollBar()->setRange(0, scrollSize);
- if (m_preferBottom && atEnd)
- {
- verticalScrollBar()->setValue(scrollSize);
- }
-
-
- // Draw the viewport widget
- QPainter painter(viewport());
- painter.fillRect(0, 0, width(), height(), QBrush(Qt::white));
- painter.setBackgroundMode(Qt::OpaqueMode);
- painter.setBackground(QColor(255,255,255));
-
- // Background control
- QBrush bgBrush;
- bgBrush.setStyle(Qt::SolidPattern);
- painter.setPen(QPen(QColor(0,0,0)));
-
- size_t viewDataOffset = 0;
- const debug_view_xy& visibleCharDims = m_view->visible_size();
- for (int y = 0; y < visibleCharDims.y; y++)
- {
- for (int x = 0; x < visibleCharDims.x; x++)
- {
- const unsigned char textAttr = m_view->viewdata()[viewDataOffset].attrib;
-
- if (x == 0 || textAttr != m_view->viewdata()[viewDataOffset-1].attrib)
- {
- // Text color handling
- QColor fgColor(0,0,0);
- QColor bgColor(255,255,255);
-
- if(textAttr & DCA_ANCILLARY)
- {
- bgColor.setRgb(0xe0, 0xe0, 0xe0);
- }
- if(textAttr & DCA_SELECTED)
- {
- bgColor.setRgb(0xff, 0x80, 0x80);
- }
- if(textAttr & DCA_CURRENT)
- {
- bgColor.setRgb(0xff, 0xff, 0x00);
- }
- if ((textAttr & DCA_SELECTED) && (textAttr & DCA_CURRENT))
- {
- bgColor.setRgb(0xff,0xc0,0x80);
- }
- if(textAttr & DCA_CHANGED)
- {
- fgColor.setRgb(0xff, 0x00, 0x00);
- }
- if(textAttr & DCA_INVALID)
- {
- fgColor.setRgb(0x00, 0x00, 0xff);
- }
- if(textAttr & DCA_DISABLED)
- {
- fgColor.setRgb((fgColor.red() + bgColor.red()) >> 1,
- (fgColor.green() + bgColor.green()) >> 1,
- (fgColor.blue() + bgColor.blue()) >> 1);
- }
- if(textAttr & DCA_COMMENT)
- {
- fgColor.setRgb(0x00, 0x80, 0x00);
- }
-
- bgBrush.setColor(bgColor);
- painter.setBackground(bgBrush);
- painter.setPen(QPen(fgColor));
- }
-
- // Your character is not guaranteed to take up the entire fontWidth x fontHeight, so fill before.
- painter.fillRect(x*fontWidth, y*fontHeight, fontWidth, fontHeight, bgBrush);
-
- // There is a touchy interplay between font height, drawing difference, visible position, etc
- // Fonts don't get drawn "down and to the left" like boxes, so some wiggling is needed.
- painter.drawText(x*fontWidth,
- (y*fontHeight + (fontHeight*0.80)),
- QString(m_view->viewdata()[viewDataOffset].byte));
- viewDataOffset++;
- }
- }
+ // Tell the MAME debug view how much real estate is available
+ QFontMetrics actualFont = fontMetrics();
+ const int fontWidth = MAX(1, actualFont.width('_'));
+ const int fontHeight = MAX(1, actualFont.height());
+ m_view->set_visible_size(debug_view_xy(width()/fontWidth, height()/fontHeight));
+
+
+ // Handle the scroll bars
+ const int verticalScrollCharDiff = m_view->total_size().y - m_view->visible_size().y;
+ const int scrollSize = verticalScrollCharDiff < 0 ? 0 : verticalScrollCharDiff;
+ bool atEnd = false;
+ if (verticalScrollBar()->value() == verticalScrollBar()->maximum())
+ {
+ atEnd = true;
+ }
+ verticalScrollBar()->setRange(0, scrollSize);
+ if (m_preferBottom && atEnd)
+ {
+ verticalScrollBar()->setValue(scrollSize);
+ }
+
+
+ // Draw the viewport widget
+ QPainter painter(viewport());
+ painter.fillRect(0, 0, width(), height(), QBrush(Qt::white));
+ painter.setBackgroundMode(Qt::OpaqueMode);
+ painter.setBackground(QColor(255,255,255));
+
+ // Background control
+ QBrush bgBrush;
+ bgBrush.setStyle(Qt::SolidPattern);
+ painter.setPen(QPen(QColor(0,0,0)));
+
+ size_t viewDataOffset = 0;
+ const debug_view_xy& visibleCharDims = m_view->visible_size();
+ for (int y = 0; y < visibleCharDims.y; y++)
+ {
+ for (int x = 0; x < visibleCharDims.x; x++)
+ {
+ const unsigned char textAttr = m_view->viewdata()[viewDataOffset].attrib;
+
+ if (x == 0 || textAttr != m_view->viewdata()[viewDataOffset-1].attrib)
+ {
+ // Text color handling
+ QColor fgColor(0,0,0);
+ QColor bgColor(255,255,255);
+
+ if(textAttr & DCA_ANCILLARY)
+ {
+ bgColor.setRgb(0xe0, 0xe0, 0xe0);
+ }
+ if(textAttr & DCA_SELECTED)
+ {
+ bgColor.setRgb(0xff, 0x80, 0x80);
+ }
+ if(textAttr & DCA_CURRENT)
+ {
+ bgColor.setRgb(0xff, 0xff, 0x00);
+ }
+ if ((textAttr & DCA_SELECTED) && (textAttr & DCA_CURRENT))
+ {
+ bgColor.setRgb(0xff,0xc0,0x80);
+ }
+ if(textAttr & DCA_CHANGED)
+ {
+ fgColor.setRgb(0xff, 0x00, 0x00);
+ }
+ if(textAttr & DCA_INVALID)
+ {
+ fgColor.setRgb(0x00, 0x00, 0xff);
+ }
+ if(textAttr & DCA_DISABLED)
+ {
+ fgColor.setRgb((fgColor.red() + bgColor.red()) >> 1,
+ (fgColor.green() + bgColor.green()) >> 1,
+ (fgColor.blue() + bgColor.blue()) >> 1);
+ }
+ if(textAttr & DCA_COMMENT)
+ {
+ fgColor.setRgb(0x00, 0x80, 0x00);
+ }
+
+ bgBrush.setColor(bgColor);
+ painter.setBackground(bgBrush);
+ painter.setPen(QPen(fgColor));
+ }
+
+ // Your character is not guaranteed to take up the entire fontWidth x fontHeight, so fill before.
+ painter.fillRect(x*fontWidth, y*fontHeight, fontWidth, fontHeight, bgBrush);
+
+ // There is a touchy interplay between font height, drawing difference, visible position, etc
+ // Fonts don't get drawn "down and to the left" like boxes, so some wiggling is needed.
+ painter.drawText(x*fontWidth,
+ (y*fontHeight + (fontHeight*0.80)),
+ QString(m_view->viewdata()[viewDataOffset].byte));
+ viewDataOffset++;
+ }
+ }
}
void DebuggerView::keyPressEvent(QKeyEvent* event)
{
- if (m_view == NULL)
- return QWidget::keyPressEvent(event);
-
- Qt::KeyboardModifiers keyMods = QApplication::keyboardModifiers();
- const bool ctrlDown = keyMods.testFlag(Qt::ControlModifier);
-
- int keyPress = -1;
- switch (event->key())
- {
- case Qt::Key_Up:
- keyPress = DCH_UP;
- break;
- case Qt::Key_Down:
- keyPress = DCH_DOWN;
- break;
- case Qt::Key_Left:
- keyPress = DCH_LEFT;
- if (ctrlDown) keyPress = DCH_CTRLLEFT;
- break;
- case Qt::Key_Right:
- keyPress = DCH_RIGHT;
- if (ctrlDown) keyPress = DCH_CTRLRIGHT;
- break;
- case Qt::Key_PageUp:
- keyPress = DCH_PUP;
- break;
- case Qt::Key_PageDown:
- keyPress = DCH_PDOWN;
- break;
- case Qt::Key_Home:
- keyPress = DCH_HOME;
- if (ctrlDown) keyPress = DCH_CTRLHOME;
- break;
- case Qt::Key_End:
- keyPress = DCH_END;
- if (ctrlDown) keyPress = DCH_CTRLEND;
- break;
- case Qt::Key_0: keyPress = '0'; break;
- case Qt::Key_1: keyPress = '1'; break;
- case Qt::Key_2: keyPress = '2'; break;
- case Qt::Key_3: keyPress = '3'; break;
- case Qt::Key_4: keyPress = '4'; break;
- case Qt::Key_5: keyPress = '5'; break;
- case Qt::Key_6: keyPress = '6'; break;
- case Qt::Key_7: keyPress = '7'; break;
- case Qt::Key_8: keyPress = '8'; break;
- case Qt::Key_9: keyPress = '9'; break;
- case Qt::Key_A: keyPress = 'a'; break;
- case Qt::Key_B: keyPress = 'b'; break;
- case Qt::Key_C: keyPress = 'c'; break;
- case Qt::Key_D: keyPress = 'd'; break;
- case Qt::Key_E: keyPress = 'e'; break;
- case Qt::Key_F: keyPress = 'f'; break;
- default:
- return QWidget::keyPressEvent(event);
- }
-
- m_view->set_cursor_visible(true);
- m_view->process_char(keyPress);
-
- // Catch the view up with the cursor
- verticalScrollBar()->setValue(m_view->visible_position().y);
-
- viewport()->update();
- update();
+ if (m_view == NULL)
+ return QWidget::keyPressEvent(event);
+
+ Qt::KeyboardModifiers keyMods = QApplication::keyboardModifiers();
+ const bool ctrlDown = keyMods.testFlag(Qt::ControlModifier);
+
+ int keyPress = -1;
+ switch (event->key())
+ {
+ case Qt::Key_Up:
+ keyPress = DCH_UP;
+ break;
+ case Qt::Key_Down:
+ keyPress = DCH_DOWN;
+ break;
+ case Qt::Key_Left:
+ keyPress = DCH_LEFT;
+ if (ctrlDown) keyPress = DCH_CTRLLEFT;
+ break;
+ case Qt::Key_Right:
+ keyPress = DCH_RIGHT;
+ if (ctrlDown) keyPress = DCH_CTRLRIGHT;
+ break;
+ case Qt::Key_PageUp:
+ keyPress = DCH_PUP;
+ break;
+ case Qt::Key_PageDown:
+ keyPress = DCH_PDOWN;
+ break;
+ case Qt::Key_Home:
+ keyPress = DCH_HOME;
+ if (ctrlDown) keyPress = DCH_CTRLHOME;
+ break;
+ case Qt::Key_End:
+ keyPress = DCH_END;
+ if (ctrlDown) keyPress = DCH_CTRLEND;
+ break;
+ case Qt::Key_0: keyPress = '0'; break;
+ case Qt::Key_1: keyPress = '1'; break;
+ case Qt::Key_2: keyPress = '2'; break;
+ case Qt::Key_3: keyPress = '3'; break;
+ case Qt::Key_4: keyPress = '4'; break;
+ case Qt::Key_5: keyPress = '5'; break;
+ case Qt::Key_6: keyPress = '6'; break;
+ case Qt::Key_7: keyPress = '7'; break;
+ case Qt::Key_8: keyPress = '8'; break;
+ case Qt::Key_9: keyPress = '9'; break;
+ case Qt::Key_A: keyPress = 'a'; break;
+ case Qt::Key_B: keyPress = 'b'; break;
+ case Qt::Key_C: keyPress = 'c'; break;
+ case Qt::Key_D: keyPress = 'd'; break;
+ case Qt::Key_E: keyPress = 'e'; break;
+ case Qt::Key_F: keyPress = 'f'; break;
+ default:
+ return QWidget::keyPressEvent(event);
+ }
+
+ m_view->set_cursor_visible(true);
+ m_view->process_char(keyPress);
+
+ // Catch the view up with the cursor
+ verticalScrollBar()->setValue(m_view->visible_position().y);
+
+ viewport()->update();
+ update();
}
@@ -208,7 +208,7 @@ void DebuggerView::mousePressEvent(QMouseEvent* event)
QFontMetrics actualFont = fontMetrics();
const int fontWidth = MAX(1, actualFont.width('_'));
const int fontHeight = MAX(1, actualFont.height());
-
+
debug_view_xy topLeft = m_view->visible_position();
debug_view_xy clickViewPosition;
clickViewPosition.x = topLeft.x + (event->x() / fontWidth);
@@ -223,23 +223,21 @@ void DebuggerView::mousePressEvent(QMouseEvent* event)
void DebuggerView::verticalScrollSlot(int value)
{
- m_view->set_visible_position(debug_view_xy(horizontalScrollBar()->value(), value));
+ m_view->set_visible_position(debug_view_xy(horizontalScrollBar()->value(), value));
}
void DebuggerView::horizontalScrollSlot(int value)
{
- m_view->set_visible_position(debug_view_xy(value, verticalScrollBar()->value()));
+ m_view->set_visible_position(debug_view_xy(value, verticalScrollBar()->value()));
}
void DebuggerView::debuggerViewUpdate(debug_view& debugView, void* osdPrivate)
{
- // Get a handle to the DebuggerView being updated & redraw
- DebuggerView* dView = (DebuggerView*)osdPrivate;
- dView->verticalScrollBar()->setValue(dView->view()->visible_position().y);
- dView->viewport()->update();
- dView->update();
+ // Get a handle to the DebuggerView being updated & redraw
+ DebuggerView* dView = (DebuggerView*)osdPrivate;
+ dView->verticalScrollBar()->setValue(dView->view()->visible_position().y);
+ dView->viewport()->update();
+ dView->update();
}
-
-
diff --git a/src/osd/sdl/debugqtview.h b/src/osd/sdl/debugqtview.h
index 1e926949114..b62002e3f68 100644
--- a/src/osd/sdl/debugqtview.h
+++ b/src/osd/sdl/debugqtview.h
@@ -8,38 +8,38 @@
class DebuggerView : public QAbstractScrollArea
{
- Q_OBJECT
-
+ Q_OBJECT
+
public:
- DebuggerView(const debug_view_type& type,
- running_machine* machine,
- QWidget* parent=NULL);
- virtual ~DebuggerView() {}
+ DebuggerView(const debug_view_type& type,
+ running_machine* machine,
+ QWidget* parent=NULL);
+ virtual ~DebuggerView() {}
- void paintEvent(QPaintEvent* event);
+ void paintEvent(QPaintEvent* event);
- // Callback to allow MAME to refresh the view
- static void debuggerViewUpdate(debug_view& debugView, void* osdPrivate);
+ // Callback to allow MAME to refresh the view
+ static void debuggerViewUpdate(debug_view& debugView, void* osdPrivate);
- // Setters and accessors
- void setPreferBottom(bool pb) { m_preferBottom = pb; }
- debug_view* view() { return m_view; }
+ // Setters and accessors
+ void setPreferBottom(bool pb) { m_preferBottom = pb; }
+ debug_view* view() { return m_view; }
protected:
- void keyPressEvent(QKeyEvent* event);
- void mousePressEvent(QMouseEvent* event);
+ void keyPressEvent(QKeyEvent* event);
+ void mousePressEvent(QMouseEvent* event);
private slots:
- void verticalScrollSlot(int value);
- void horizontalScrollSlot(int value);
+ void verticalScrollSlot(int value);
+ void horizontalScrollSlot(int value);
private:
- bool m_preferBottom;
+ bool m_preferBottom;
- debug_view* m_view;
- running_machine* m_machine;
+ debug_view* m_view;
+ running_machine* m_machine;
};
diff --git a/src/osd/sdl/debugqtwindow.h b/src/osd/sdl/debugqtwindow.h
index ae87a767c05..f9d3e6a735c 100644
--- a/src/osd/sdl/debugqtwindow.h
+++ b/src/osd/sdl/debugqtwindow.h
@@ -70,8 +70,8 @@ public:
};
public:
- WindowQtConfig() :
- m_type(WIN_TYPE_MAIN),
+ WindowQtConfig() :
+ m_type(WIN_TYPE_MAIN),
m_size(800, 600),
m_position(120, 120)
{}
diff --git a/src/osd/sdl/sdlsocket.c b/src/osd/sdl/sdlsocket.c
index 7c20b1a7b93..e7e294a92c5 100644
--- a/src/osd/sdl/sdlsocket.c
+++ b/src/osd/sdl/sdlsocket.c
@@ -55,7 +55,7 @@ file_error sdl_open_socket(const char *path, UINT32 openflags, osd_file **file,
sscanf( path+strlen(sdlfile_socket_identifier), "%255[^:]:%d", hostname, &port );
-// printf("Connecting to server '%s' on port '%d'\n", hostname, port);
+// printf("Connecting to server '%s' on port '%d'\n", hostname, port);
if (((*file)->socket = socket(AF_INET, SOCK_STREAM, 0)) == -1)
{
@@ -77,25 +77,25 @@ file_error sdl_open_socket(const char *path, UINT32 openflags, osd_file **file,
// listening socket support
if (openflags & OPEN_FLAG_CREATE)
{
-// printf("Listening for client at '%s' on port '%d'\n", hostname, port);
+// printf("Listening for client at '%s' on port '%d'\n", hostname, port);
// bind socket...
if (bind((*file)->socket, (struct sockaddr *)&sai, sizeof(struct sockaddr)) == -1)
{
return FILERR_ACCESS_DENIED;
}
-
+
// start to listen...
if (listen((*file)->socket, 1) == -1) {
return FILERR_ACCESS_DENIED;
}
-
+
// mark socket as "listening"
(*file)->handle = 0;
*filesize = 0;
return FILERR_NONE;
}
-// printf("Connecting to server '%s' on port '%d'\n", hostname, port);
+// printf("Connecting to server '%s' on port '%d'\n", hostname, port);
if (connect((*file)->socket, (struct sockaddr *)&sai, sizeof(struct sockaddr)) == -1)
{
return FILERR_ACCESS_DENIED;
diff --git a/src/osd/windows/d3dcomm.h b/src/osd/windows/d3dcomm.h
index 2ac96074006..41318dc0822 100644
--- a/src/osd/windows/d3dcomm.h
+++ b/src/osd/windows/d3dcomm.h
@@ -86,8 +86,8 @@ struct d3d_poly_info
UINT32 flags; // rendering flags
DWORD modmode; // texture modulation mode
d3d_texture_info * texture; // pointer to texture info
- float line_time; // used by vectors
- float line_length; // used by vectors
+ float line_time; // used by vectors
+ float line_length; // used by vectors
};
diff --git a/src/osd/windows/d3dhlsl.c b/src/osd/windows/d3dhlsl.c
index 06f9894a026..373526dbdd8 100644
--- a/src/osd/windows/d3dhlsl.c
+++ b/src/osd/windows/d3dhlsl.c
@@ -914,17 +914,17 @@ void hlsl_info::init(d3d_base *d3dintf, win_window_info *window)
ini_file.gets(buf, 1024);
sscanf(buf, "yiq_phase_count %d\n", &options->yiq_phase_count);
- ini_file.gets(buf, 1024);
- sscanf(buf, "vector_time_scale %f\n", &options->vector_time_scale);
+ ini_file.gets(buf, 1024);
+ sscanf(buf, "vector_time_scale %f\n", &options->vector_time_scale);
- ini_file.gets(buf, 1024);
- sscanf(buf, "vector_time_period %f\n", &options->vector_time_period);
+ ini_file.gets(buf, 1024);
+ sscanf(buf, "vector_time_period %f\n", &options->vector_time_period);
- ini_file.gets(buf, 1024);
- sscanf(buf, "vector_length_scale %f\n", &options->vector_length_scale);
+ ini_file.gets(buf, 1024);
+ sscanf(buf, "vector_length_scale %f\n", &options->vector_length_scale);
- ini_file.gets(buf, 1024);
- sscanf(buf, "vector_length_ratio %f\n", &options->vector_length_ratio);
+ ini_file.gets(buf, 1024);
+ sscanf(buf, "vector_length_ratio %f\n", &options->vector_length_ratio);
}
}
}
@@ -979,10 +979,10 @@ void hlsl_info::init(d3d_base *d3dintf, win_window_info *window)
options->yiq_q = winoptions.screen_yiq_q();
options->yiq_scan_time = winoptions.screen_yiq_scan_time();
options->yiq_phase_count = winoptions.screen_yiq_phase_count();
- options->vector_time_scale = winoptions.screen_vector_time_scale();
- options->vector_time_period = winoptions.screen_vector_time_period();
- options->vector_length_scale = winoptions.screen_vector_length_scale();
- options->vector_length_ratio = winoptions.screen_vector_length_ratio();
+ options->vector_time_scale = winoptions.screen_vector_time_scale();
+ options->vector_time_period = winoptions.screen_vector_time_period();
+ options->vector_length_scale = winoptions.screen_vector_length_scale();
+ options->vector_length_ratio = winoptions.screen_vector_length_ratio();
}
options->params_dirty = true;
@@ -1001,58 +1001,58 @@ void hlsl_info::init(d3d_base *d3dintf, win_window_info *window)
void hlsl_info::init_fsfx_quad(void *vertbuf)
{
- // Called at the start of each frame by the D3D code in order to reserve two triangles
- // that are guaranteed to be at a fixed position so as to simply use D3DPT_TRIANGLELIST, 0, 2
- // instead of having to do bookkeeping about a specific screen quad
- if (!master_enable || !d3dintf->post_fx_available)
- return;
+ // Called at the start of each frame by the D3D code in order to reserve two triangles
+ // that are guaranteed to be at a fixed position so as to simply use D3DPT_TRIANGLELIST, 0, 2
+ // instead of having to do bookkeeping about a specific screen quad
+ if (!master_enable || !d3dintf->post_fx_available)
+ return;
- d3d_info *d3d = (d3d_info *)window->drawdata;
+ d3d_info *d3d = (d3d_info *)window->drawdata;
- // get a pointer to the vertex buffer
- fsfx_vertices = (d3d_vertex *)vertbuf;
- if (fsfx_vertices == NULL)
- return;
+ // get a pointer to the vertex buffer
+ fsfx_vertices = (d3d_vertex *)vertbuf;
+ if (fsfx_vertices == NULL)
+ return;
- // fill in the vertexes clockwise
- fsfx_vertices[0].x = 0.0f;
- fsfx_vertices[0].y = 0.0f;
- fsfx_vertices[1].x = d3d->width;
- fsfx_vertices[1].y = 0.0f;
- fsfx_vertices[2].x = 0.0f;
- fsfx_vertices[2].y = d3d->height;
- fsfx_vertices[3].x = d3d->width;
- fsfx_vertices[3].y = 0.0f;
- fsfx_vertices[4].x = 0.0f;
- fsfx_vertices[4].y = d3d->height;
- fsfx_vertices[5].x = d3d->width;
- fsfx_vertices[5].y = d3d->height;
+ // fill in the vertexes clockwise
+ fsfx_vertices[0].x = 0.0f;
+ fsfx_vertices[0].y = 0.0f;
+ fsfx_vertices[1].x = d3d->width;
+ fsfx_vertices[1].y = 0.0f;
+ fsfx_vertices[2].x = 0.0f;
+ fsfx_vertices[2].y = d3d->height;
+ fsfx_vertices[3].x = d3d->width;
+ fsfx_vertices[3].y = 0.0f;
+ fsfx_vertices[4].x = 0.0f;
+ fsfx_vertices[4].y = d3d->height;
+ fsfx_vertices[5].x = d3d->width;
+ fsfx_vertices[5].y = d3d->height;
- fsfx_vertices[0].u0 = 0.0f;
- fsfx_vertices[0].v0 = 0.0f;
+ fsfx_vertices[0].u0 = 0.0f;
+ fsfx_vertices[0].v0 = 0.0f;
- fsfx_vertices[1].u0 = 1.0f;
- fsfx_vertices[1].v0 = 0.0f;
+ fsfx_vertices[1].u0 = 1.0f;
+ fsfx_vertices[1].v0 = 0.0f;
- fsfx_vertices[2].u0 = 0.0f;
- fsfx_vertices[2].v0 = 1.0f;
+ fsfx_vertices[2].u0 = 0.0f;
+ fsfx_vertices[2].v0 = 1.0f;
- fsfx_vertices[3].u0 = 1.0f;
- fsfx_vertices[3].v0 = 0.0f;
+ fsfx_vertices[3].u0 = 1.0f;
+ fsfx_vertices[3].v0 = 0.0f;
- fsfx_vertices[4].u0 = 0.0f;
- fsfx_vertices[4].v0 = 1.0f;
+ fsfx_vertices[4].u0 = 0.0f;
+ fsfx_vertices[4].v0 = 1.0f;
- fsfx_vertices[5].u0 = 1.0f;
- fsfx_vertices[5].v0 = 1.0f;
+ fsfx_vertices[5].u0 = 1.0f;
+ fsfx_vertices[5].v0 = 1.0f;
- // set the color, Z parameters to standard values
- for (int i = 0; i < 6; i++)
- {
- fsfx_vertices[i].z = 0.0f;
- fsfx_vertices[i].rhw = 1.0f;
- fsfx_vertices[i].color = D3DCOLOR_ARGB(255, 255, 255, 255);
- }
+ // set the color, Z parameters to standard values
+ for (int i = 0; i < 6; i++)
+ {
+ fsfx_vertices[i].z = 0.0f;
+ fsfx_vertices[i].rhw = 1.0f;
+ fsfx_vertices[i].color = D3DCOLOR_ARGB(255, 255, 255, 255);
+ }
}
@@ -1068,22 +1068,22 @@ int hlsl_info::create_resources(bool reset)
d3d_info *d3d = (d3d_info *)window->drawdata;
- HRESULT result = (*d3dintf->device.get_render_target)(d3d->device, 0, &backbuffer);
- if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device get_render_target call\n", (int)result);
-
- result = (*d3dintf->device.create_texture)(d3d->device, 4, 4, 1, D3DUSAGE_RENDERTARGET, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &black_texture);
- if (result != D3D_OK)
- {
- mame_printf_verbose("Direct3D: Unable to init video-memory target for black texture (%08x)\n", (UINT32)result);
- return 1;
- }
- (*d3dintf->texture.get_surface_level)(black_texture, 0, &black_surface);
- result = (*d3dintf->device.set_render_target)(d3d->device, 0, black_surface);
- if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device set_render_target call\n", (int)result);
- result = (*d3dintf->device.clear)(d3d->device, 0, NULL, D3DCLEAR_TARGET, D3DCOLOR_ARGB(0,0,0,0), 0, 0);
- if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device clear call\n", (int)result);
- result = (*d3dintf->device.set_render_target)(d3d->device, 0, backbuffer);
- if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device set_render_target call\n", (int)result);
+ HRESULT result = (*d3dintf->device.get_render_target)(d3d->device, 0, &backbuffer);
+ if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device get_render_target call\n", (int)result);
+
+ result = (*d3dintf->device.create_texture)(d3d->device, 4, 4, 1, D3DUSAGE_RENDERTARGET, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &black_texture);
+ if (result != D3D_OK)
+ {
+ mame_printf_verbose("Direct3D: Unable to init video-memory target for black texture (%08x)\n", (UINT32)result);
+ return 1;
+ }
+ (*d3dintf->texture.get_surface_level)(black_texture, 0, &black_surface);
+ result = (*d3dintf->device.set_render_target)(d3d->device, 0, black_surface);
+ if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device set_render_target call\n", (int)result);
+ result = (*d3dintf->device.clear)(d3d->device, 0, NULL, D3DCLEAR_TARGET, D3DCOLOR_ARGB(0,0,0,0), 0, 0);
+ if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device clear call\n", (int)result);
+ result = (*d3dintf->device.set_render_target)(d3d->device, 0, backbuffer);
+ if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device set_render_target call\n", (int)result);
result = (*d3dintf->device.create_texture)(d3d->device, (int)snap_width, (int)snap_height, 1, D3DUSAGE_DYNAMIC, D3DFMT_A8R8G8B8, D3DPOOL_SYSTEMMEM, &avi_copy_texture);
if (result != D3D_OK)
@@ -1243,35 +1243,35 @@ int hlsl_info::create_resources(bool reset)
// create the vector shader
#if HLSL_VECTOR
- char bloom_cstr[1024];
- sprintf(bloom_cstr, "%s\\bloom.fx", fx_dir);
- TCHAR *bloom_name = tstring_from_utf8(bloom_cstr);
-
- result = (*d3dintf->device.create_effect)(d3d->device, bloom_name, &bloom_effect);
- if(result != D3D_OK)
- {
- mame_printf_verbose("Direct3D: Unable to load bloom.fx\n");
- return 1;
- }
- if (bloom_name)
- osd_free(bloom_name);
-
- char downsample_cstr[1024];
- sprintf(downsample_cstr, "%s\\downsample.fx", fx_dir);
- TCHAR *downsample_name = tstring_from_utf8(downsample_cstr);
-
- result = (*d3dintf->device.create_effect)(d3d->device, downsample_name, &downsample_effect);
- if(result != D3D_OK)
- {
- mame_printf_verbose("Direct3D: Unable to load downsample.fx\n");
- return 1;
- }
- if (downsample_name)
- osd_free(downsample_name);
-
- char vector_cstr[1024];
- sprintf(vector_cstr, "%s\\vector.fx", fx_dir);
- TCHAR *vector_name = tstring_from_utf8(vector_cstr);
+ char bloom_cstr[1024];
+ sprintf(bloom_cstr, "%s\\bloom.fx", fx_dir);
+ TCHAR *bloom_name = tstring_from_utf8(bloom_cstr);
+
+ result = (*d3dintf->device.create_effect)(d3d->device, bloom_name, &bloom_effect);
+ if(result != D3D_OK)
+ {
+ mame_printf_verbose("Direct3D: Unable to load bloom.fx\n");
+ return 1;
+ }
+ if (bloom_name)
+ osd_free(bloom_name);
+
+ char downsample_cstr[1024];
+ sprintf(downsample_cstr, "%s\\downsample.fx", fx_dir);
+ TCHAR *downsample_name = tstring_from_utf8(downsample_cstr);
+
+ result = (*d3dintf->device.create_effect)(d3d->device, downsample_name, &downsample_effect);
+ if(result != D3D_OK)
+ {
+ mame_printf_verbose("Direct3D: Unable to load downsample.fx\n");
+ return 1;
+ }
+ if (downsample_name)
+ osd_free(downsample_name);
+
+ char vector_cstr[1024];
+ sprintf(vector_cstr, "%s\\vector.fx", fx_dir);
+ TCHAR *vector_name = tstring_from_utf8(vector_cstr);
result = (*d3dintf->device.create_effect)(d3d->device, vector_name, &vector_effect);
if(result != D3D_OK)
@@ -1351,7 +1351,7 @@ void hlsl_info::begin_frame()
d3d_render_target *rt = find_render_target(d3d->width, d3d->height, 0, 0);
if (rt == NULL)
{
- return;
+ return;
}
HRESULT result = (*d3dintf->device.set_render_target)(d3d->device, 0, rt->target[0]);
@@ -1368,42 +1368,42 @@ void hlsl_info::begin_frame()
//============================================================
void hlsl_info::blit(d3d_surface *dst, d3d_texture *src, d3d_surface *new_dst, D3DPRIMITIVETYPE prim_type,
- UINT32 prim_index, UINT32 prim_count, int dstw, int dsth)
+ UINT32 prim_index, UINT32 prim_count, int dstw, int dsth)
{
- d3d_info *d3d = (d3d_info *)window->drawdata;
+ d3d_info *d3d = (d3d_info *)window->drawdata;
- HRESULT result = (*d3dintf->device.set_render_target)(d3d->device, 0, dst);
- if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device set_render_target call\n", (int)result);
+ HRESULT result = (*d3dintf->device.set_render_target)(d3d->device, 0, dst);
+ if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device set_render_target call\n", (int)result);
- curr_effect = effect;
+ curr_effect = effect;
- (*d3dintf->effect.set_texture)(curr_effect, "Diffuse", src);
+ (*d3dintf->effect.set_texture)(curr_effect, "Diffuse", src);
- (*d3dintf->effect.set_float)(curr_effect, "TargetWidth", (float)dstw);
- (*d3dintf->effect.set_float)(curr_effect, "TargetHeight", (float)dsth);
- (*d3dintf->effect.set_float)(curr_effect, "PostPass", 1.0f);
- (*d3dintf->effect.set_float)(curr_effect, "PincushionAmount", options->pincushion);
- (*d3dintf->effect.set_float)(curr_effect, "Brighten", 0.0f);
+ (*d3dintf->effect.set_float)(curr_effect, "TargetWidth", (float)dstw);
+ (*d3dintf->effect.set_float)(curr_effect, "TargetHeight", (float)dsth);
+ (*d3dintf->effect.set_float)(curr_effect, "PostPass", 1.0f);
+ (*d3dintf->effect.set_float)(curr_effect, "PincushionAmount", options->pincushion);
+ (*d3dintf->effect.set_float)(curr_effect, "Brighten", 0.0f);
- unsigned int num_passes = 0;
- (*d3dintf->effect.begin)(curr_effect, &num_passes, 0);
+ unsigned int num_passes = 0;
+ (*d3dintf->effect.begin)(curr_effect, &num_passes, 0);
- for (UINT pass = 0; pass < num_passes; pass++)
- {
- (*d3dintf->effect.begin_pass)(curr_effect, pass);
- // add the primitives
- HRESULT result = (*d3dintf->device.draw_primitive)(d3d->device, prim_type, prim_index, prim_count);
- if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device draw_primitive call\n", (int)result);
- (*d3dintf->effect.end_pass)(curr_effect);
- }
+ for (UINT pass = 0; pass < num_passes; pass++)
+ {
+ (*d3dintf->effect.begin_pass)(curr_effect, pass);
+ // add the primitives
+ HRESULT result = (*d3dintf->device.draw_primitive)(d3d->device, prim_type, prim_index, prim_count);
+ if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device draw_primitive call\n", (int)result);
+ (*d3dintf->effect.end_pass)(curr_effect);
+ }
- (*d3dintf->effect.end)(curr_effect);
+ (*d3dintf->effect.end)(curr_effect);
- if (new_dst)
- {
- HRESULT result = (*d3dintf->device.set_render_target)(d3d->device, 0, new_dst);
- if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device set_render_target call\n", (int)result);
- }
+ if (new_dst)
+ {
+ HRESULT result = (*d3dintf->device.set_render_target)(d3d->device, 0, new_dst);
+ if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device set_render_target call\n", (int)result);
+ }
}
@@ -1413,7 +1413,7 @@ void hlsl_info::blit(d3d_surface *dst, d3d_texture *src, d3d_surface *new_dst, D
//============================================================
void hlsl_info::blit(d3d_surface *dst, d3d_texture *src, d3d_surface *new_dst, D3DPRIMITIVETYPE prim_type,
- UINT32 prim_index, UINT32 prim_count)
+ UINT32 prim_index, UINT32 prim_count)
{
d3d_info *d3d = (d3d_info *)window->drawdata;
@@ -1430,10 +1430,10 @@ void hlsl_info::blit(d3d_surface *dst, d3d_texture *src, d3d_surface *new_dst, D
(*d3dintf->effect.set_texture)(curr_effect, "Diffuse", src);
- (*d3dintf->effect.set_float)(curr_effect, "TargetWidth", (float)d3d->width);
- (*d3dintf->effect.set_float)(curr_effect, "TargetHeight", (float)d3d->height);
- (*d3dintf->effect.set_float)(curr_effect, "ScreenWidth", (float)d3d->width);
- (*d3dintf->effect.set_float)(curr_effect, "ScreenHeight", (float)d3d->height);
+ (*d3dintf->effect.set_float)(curr_effect, "TargetWidth", (float)d3d->width);
+ (*d3dintf->effect.set_float)(curr_effect, "TargetHeight", (float)d3d->height);
+ (*d3dintf->effect.set_float)(curr_effect, "ScreenWidth", (float)d3d->width);
+ (*d3dintf->effect.set_float)(curr_effect, "ScreenHeight", (float)d3d->height);
(*d3dintf->effect.set_float)(curr_effect, "PostPass", 1.0f);
(*d3dintf->effect.set_float)(curr_effect, "PincushionAmount", options->pincushion);
(*d3dintf->effect.set_float)(curr_effect, "Brighten", 1.0f);
@@ -1475,22 +1475,22 @@ void hlsl_info::end_frame()
render_snapshot(snap_target);
}
- if (!lines_pending)
- return;
+ if (!lines_pending)
+ return;
- lines_pending = false;
- /*d3d_info *d3d = (d3d_info *)window->drawdata;
+ lines_pending = false;
+ /*d3d_info *d3d = (d3d_info *)window->drawdata;
- d3d_render_target *rt = find_render_target(d3d->width, d3d->height, 0, 0);
- if (!rt)
- return;
+ d3d_render_target *rt = find_render_target(d3d->width, d3d->height, 0, 0);
+ if (!rt)
+ return;
- blit(backbuffer, rt->texture[0], NULL, vecbuf_type, vecbuf_index, vecbuf_count);*/
+ blit(backbuffer, rt->texture[0], NULL, vecbuf_type, vecbuf_index, vecbuf_count);*/
/*d3d_render_target *rt = find_render_target(d3d->width, d3d->height, 0, 0);
if (rt == NULL)
{
- return;
+ return;
}
blit(backbuffer, rt->texture[1], NULL, vecbuf_type, vecbuf_index, vecbuf_count);
@@ -1973,9 +1973,9 @@ void hlsl_info::render_quad(d3d_poly_info *poly, int vertnum)
(*d3dintf->effect.end)(curr_effect);
- curr_effect = post_effect;
- (*d3dintf->effect.set_float)(curr_effect, "TargetWidth", (float)d3d->width);
- (*d3dintf->effect.set_float)(curr_effect, "TargetHeight", (float)d3d->height);
+ curr_effect = post_effect;
+ (*d3dintf->effect.set_float)(curr_effect, "TargetWidth", (float)d3d->width);
+ (*d3dintf->effect.set_float)(curr_effect, "TargetHeight", (float)d3d->height);
/* Scanlines and shadow mask, at high res for AVI logging*/
if(avi_output_file != NULL)
@@ -2022,156 +2022,156 @@ void hlsl_info::render_quad(d3d_poly_info *poly, int vertnum)
snap_rendered = true;
}
- /* Scanlines and shadow mask */
- curr_effect = post_effect;
+ /* Scanlines and shadow mask */
+ curr_effect = post_effect;
- (*d3dintf->effect.set_texture)(curr_effect, "Diffuse", rt->texture[0]);
+ (*d3dintf->effect.set_texture)(curr_effect, "Diffuse", rt->texture[0]);
- //(*d3dintf->effect.set_float)(curr_effect, "TargetWidth", (float)rt->target_width);
- //(*d3dintf->effect.set_float)(curr_effect, "TargetHeight", (float)rt->target_height);
+ //(*d3dintf->effect.set_float)(curr_effect, "TargetWidth", (float)rt->target_width);
+ //(*d3dintf->effect.set_float)(curr_effect, "TargetHeight", (float)rt->target_height);
#if HLSL_VECTOR
- result = (*d3dintf->device.set_render_target)(d3d->device, 0, rt->target[1]);
+ result = (*d3dintf->device.set_render_target)(d3d->device, 0, rt->target[1]);
#else
- result = (*d3dintf->device.set_render_target)(d3d->device, 0, backbuffer);
+ result = (*d3dintf->device.set_render_target)(d3d->device, 0, backbuffer);
#endif
- if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device set_render_target call\n", (int)result);
+ if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device set_render_target call\n", (int)result);
- (*d3dintf->effect.begin)(curr_effect, &num_passes, 0);
+ (*d3dintf->effect.begin)(curr_effect, &num_passes, 0);
- for (UINT pass = 0; pass < num_passes; pass++)
- {
- (*d3dintf->effect.begin_pass)(curr_effect, pass);
- // add the primitives
- result = (*d3dintf->device.draw_primitive)(d3d->device, poly->type, vertnum, poly->count);
- if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device draw_primitive call\n", (int)result);
- (*d3dintf->effect.end_pass)(curr_effect);
- }
+ for (UINT pass = 0; pass < num_passes; pass++)
+ {
+ (*d3dintf->effect.begin_pass)(curr_effect, pass);
+ // add the primitives
+ result = (*d3dintf->device.draw_primitive)(d3d->device, poly->type, vertnum, poly->count);
+ if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device draw_primitive call\n", (int)result);
+ (*d3dintf->effect.end_pass)(curr_effect);
+ }
- (*d3dintf->effect.end)(curr_effect);
+ (*d3dintf->effect.end)(curr_effect);
#if HLSL_VECTOR
- /* Bloom */
- curr_effect = downsample_effect;
-
- (*d3dintf->effect.set_texture)(curr_effect, "Diffuse", rt->texture[1]);
-
- int bloom_size = (rt->target_width < rt->target_height) ? rt->target_width : rt->target_height;
- int bloom_index = 0;
- int bloom_width = rt->target_width;
- int bloom_height = rt->target_height;
- for(; bloom_size >= 2 && bloom_index < 11; bloom_size >>= 1)
- {
- float source_size[2] = { bloom_width, bloom_height };
- float target_size[2] = { bloom_width >> 1, bloom_height >> 1 };
- (*d3dintf->effect.set_vector)(curr_effect, "TargetSize", 2, target_size);
- (*d3dintf->effect.set_vector)(curr_effect, "SourceSize", 2, source_size);
-
- (*d3dintf->effect.begin)(curr_effect, &num_passes, 0);
-
- (*d3dintf->effect.set_texture)(curr_effect, "Diffuse", (bloom_index == 0) ? rt->texture[1] : ct->bloom_texture[bloom_index - 1]);
-
- if (ct->bloom_target[bloom_index] == NULL)
- {
- (*d3dintf->effect.end)(curr_effect);
- break;
- }
-
- HRESULT result = (*d3dintf->device.set_render_target)(d3d->device, 0, ct->bloom_target[bloom_index]);
- if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device set_render_target call 7:%d\n", (int)result, bloom_size);
- //result = (*d3dintf->device.clear)(d3d->device, 0, NULL, D3DCLEAR_TARGET, D3DCOLOR_ARGB(0,0,0,0), 0, 0);
- //if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device clear call\n", (int)result);
-
- for (UINT pass = 0; pass < num_passes; pass++)
- {
- (*d3dintf->effect.begin_pass)(curr_effect, pass);
- // add the primitives
- result = (*d3dintf->device.draw_primitive)(d3d->device, D3DPT_TRIANGLELIST, 0, 2);
- if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device draw_primitive call\n", (int)result);
- (*d3dintf->effect.end_pass)(curr_effect);
- }
-
- (*d3dintf->effect.end)(curr_effect);
-
- bloom_index++;
- bloom_width >>= 1;
- bloom_height >>= 1;
- }
-
- /* Bloom composite pass*/
- curr_effect = bloom_effect;
-
- float target_size[2] = { rt->target_width, rt->target_height };
- (*d3dintf->effect.set_vector)(curr_effect, "TargetSize", 2, target_size);
-
- (*d3dintf->effect.set_texture)(curr_effect, "DiffuseA", rt->texture[1]);
- (*d3dintf->effect.set_float)(curr_effect, "DiffuseScaleA", 1.0f);
-
- char name[9] = "Diffuse*";
- char scale[14] = "DiffuseScale*";
- for(int index = 1; index < bloom_index; index++)
- {
- name[7] = 'A' + index;
- scale[12] = 'A' + index;
- (*d3dintf->effect.set_texture)(curr_effect, name, ct->bloom_texture[index - 1]);
- (*d3dintf->effect.set_float)(curr_effect, scale, 1.0f);
- }
- for(int index = bloom_index; index < 11; index++)
- {
- name[7] = 'A' + index;
- scale[12] = 'A' + index;
- (*d3dintf->effect.set_texture)(curr_effect, name, black_texture);
- (*d3dintf->effect.set_float)(curr_effect, scale, 0.0f);
- }
-
- (*d3dintf->effect.begin)(curr_effect, &num_passes, 0);
-
- result = (*d3dintf->device.set_render_target)(d3d->device, 0, rt->target[2]);
- if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device set_render_target call 8\n", (int)result);
-
- for (UINT pass = 0; pass < num_passes; pass++)
- {
- (*d3dintf->effect.begin_pass)(curr_effect, pass);
- // add the primitives
- result = (*d3dintf->device.draw_primitive)(d3d->device, D3DPT_TRIANGLELIST, 0, 2);
- if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device draw_primitive call\n", (int)result);
- (*d3dintf->effect.end_pass)(curr_effect);
- }
-
- (*d3dintf->effect.end)(curr_effect);
-
- curr_effect = effect;
-
- //(*d3dintf->effect.set_float)(curr_effect, "PostPass", 1.0f);
-
- //blit(backbuffer, ct->last_texture, NULL, poly->type, vertnum, poly->count, d3d->width, d3d->height);
-
- result = (*d3dintf->device.set_render_target)(d3d->device, 0, backbuffer);
- if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device set_render_target call 9\n", (int)result);
-
- (*d3dintf->effect.set_texture)(curr_effect, "Diffuse", rt->texture[2]);
-
- (*d3dintf->effect.set_float)(curr_effect, "RawWidth", poly->texture != NULL ? (float)poly->texture->rawwidth : 8.0f);
- (*d3dintf->effect.set_float)(curr_effect, "RawHeight", poly->texture != NULL ? (float)poly->texture->rawheight : 8.0f);
- (*d3dintf->effect.set_float)(curr_effect, "WidthRatio", poly->texture != NULL ? (1.0f / (poly->texture->ustop - poly->texture->ustart)) : 0.0f);
- (*d3dintf->effect.set_float)(curr_effect, "HeightRatio", poly->texture != NULL ? (1.0f / (poly->texture->vstop - poly->texture->vstart)) : 0.0f);
- (*d3dintf->effect.set_float)(curr_effect, "TargetWidth", (float)d3d->width);
- (*d3dintf->effect.set_float)(curr_effect, "TargetHeight", (float)d3d->height);
- (*d3dintf->effect.set_float)(curr_effect, "PostPass", 0.0f);
- (*d3dintf->effect.set_float)(curr_effect, "PincushionAmount", options->pincushion);
-
- (*d3dintf->effect.begin)(curr_effect, &num_passes, 0);
-
- for (UINT pass = 0; pass < num_passes; pass++)
- {
- (*d3dintf->effect.begin_pass)(curr_effect, pass);
- // add the primitives
- HRESULT result = (*d3dintf->device.draw_primitive)(d3d->device, poly->type, vertnum, poly->count);
- if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device draw_primitive call\n", (int)result);
- (*d3dintf->effect.end_pass)(curr_effect);
- }
-
- (*d3dintf->effect.end)(curr_effect);
+ /* Bloom */
+ curr_effect = downsample_effect;
+
+ (*d3dintf->effect.set_texture)(curr_effect, "Diffuse", rt->texture[1]);
+
+ int bloom_size = (rt->target_width < rt->target_height) ? rt->target_width : rt->target_height;
+ int bloom_index = 0;
+ int bloom_width = rt->target_width;
+ int bloom_height = rt->target_height;
+ for(; bloom_size >= 2 && bloom_index < 11; bloom_size >>= 1)
+ {
+ float source_size[2] = { bloom_width, bloom_height };
+ float target_size[2] = { bloom_width >> 1, bloom_height >> 1 };
+ (*d3dintf->effect.set_vector)(curr_effect, "TargetSize", 2, target_size);
+ (*d3dintf->effect.set_vector)(curr_effect, "SourceSize", 2, source_size);
+
+ (*d3dintf->effect.begin)(curr_effect, &num_passes, 0);
+
+ (*d3dintf->effect.set_texture)(curr_effect, "Diffuse", (bloom_index == 0) ? rt->texture[1] : ct->bloom_texture[bloom_index - 1]);
+
+ if (ct->bloom_target[bloom_index] == NULL)
+ {
+ (*d3dintf->effect.end)(curr_effect);
+ break;
+ }
+
+ HRESULT result = (*d3dintf->device.set_render_target)(d3d->device, 0, ct->bloom_target[bloom_index]);
+ if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device set_render_target call 7:%d\n", (int)result, bloom_size);
+ //result = (*d3dintf->device.clear)(d3d->device, 0, NULL, D3DCLEAR_TARGET, D3DCOLOR_ARGB(0,0,0,0), 0, 0);
+ //if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device clear call\n", (int)result);
+
+ for (UINT pass = 0; pass < num_passes; pass++)
+ {
+ (*d3dintf->effect.begin_pass)(curr_effect, pass);
+ // add the primitives
+ result = (*d3dintf->device.draw_primitive)(d3d->device, D3DPT_TRIANGLELIST, 0, 2);
+ if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device draw_primitive call\n", (int)result);
+ (*d3dintf->effect.end_pass)(curr_effect);
+ }
+
+ (*d3dintf->effect.end)(curr_effect);
+
+ bloom_index++;
+ bloom_width >>= 1;
+ bloom_height >>= 1;
+ }
+
+ /* Bloom composite pass*/
+ curr_effect = bloom_effect;
+
+ float target_size[2] = { rt->target_width, rt->target_height };
+ (*d3dintf->effect.set_vector)(curr_effect, "TargetSize", 2, target_size);
+
+ (*d3dintf->effect.set_texture)(curr_effect, "DiffuseA", rt->texture[1]);
+ (*d3dintf->effect.set_float)(curr_effect, "DiffuseScaleA", 1.0f);
+
+ char name[9] = "Diffuse*";
+ char scale[14] = "DiffuseScale*";
+ for(int index = 1; index < bloom_index; index++)
+ {
+ name[7] = 'A' + index;
+ scale[12] = 'A' + index;
+ (*d3dintf->effect.set_texture)(curr_effect, name, ct->bloom_texture[index - 1]);
+ (*d3dintf->effect.set_float)(curr_effect, scale, 1.0f);
+ }
+ for(int index = bloom_index; index < 11; index++)
+ {
+ name[7] = 'A' + index;
+ scale[12] = 'A' + index;
+ (*d3dintf->effect.set_texture)(curr_effect, name, black_texture);
+ (*d3dintf->effect.set_float)(curr_effect, scale, 0.0f);
+ }
+
+ (*d3dintf->effect.begin)(curr_effect, &num_passes, 0);
+
+ result = (*d3dintf->device.set_render_target)(d3d->device, 0, rt->target[2]);
+ if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device set_render_target call 8\n", (int)result);
+
+ for (UINT pass = 0; pass < num_passes; pass++)
+ {
+ (*d3dintf->effect.begin_pass)(curr_effect, pass);
+ // add the primitives
+ result = (*d3dintf->device.draw_primitive)(d3d->device, D3DPT_TRIANGLELIST, 0, 2);
+ if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device draw_primitive call\n", (int)result);
+ (*d3dintf->effect.end_pass)(curr_effect);
+ }
+
+ (*d3dintf->effect.end)(curr_effect);
+
+ curr_effect = effect;
+
+ //(*d3dintf->effect.set_float)(curr_effect, "PostPass", 1.0f);
+
+ //blit(backbuffer, ct->last_texture, NULL, poly->type, vertnum, poly->count, d3d->width, d3d->height);
+
+ result = (*d3dintf->device.set_render_target)(d3d->device, 0, backbuffer);
+ if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device set_render_target call 9\n", (int)result);
+
+ (*d3dintf->effect.set_texture)(curr_effect, "Diffuse", rt->texture[2]);
+
+ (*d3dintf->effect.set_float)(curr_effect, "RawWidth", poly->texture != NULL ? (float)poly->texture->rawwidth : 8.0f);
+ (*d3dintf->effect.set_float)(curr_effect, "RawHeight", poly->texture != NULL ? (float)poly->texture->rawheight : 8.0f);
+ (*d3dintf->effect.set_float)(curr_effect, "WidthRatio", poly->texture != NULL ? (1.0f / (poly->texture->ustop - poly->texture->ustart)) : 0.0f);
+ (*d3dintf->effect.set_float)(curr_effect, "HeightRatio", poly->texture != NULL ? (1.0f / (poly->texture->vstop - poly->texture->vstart)) : 0.0f);
+ (*d3dintf->effect.set_float)(curr_effect, "TargetWidth", (float)d3d->width);
+ (*d3dintf->effect.set_float)(curr_effect, "TargetHeight", (float)d3d->height);
+ (*d3dintf->effect.set_float)(curr_effect, "PostPass", 0.0f);
+ (*d3dintf->effect.set_float)(curr_effect, "PincushionAmount", options->pincushion);
+
+ (*d3dintf->effect.begin)(curr_effect, &num_passes, 0);
+
+ for (UINT pass = 0; pass < num_passes; pass++)
+ {
+ (*d3dintf->effect.begin_pass)(curr_effect, pass);
+ // add the primitives
+ HRESULT result = (*d3dintf->device.draw_primitive)(d3d->device, poly->type, vertnum, poly->count);
+ if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device draw_primitive call\n", (int)result);
+ (*d3dintf->effect.end_pass)(curr_effect);
+ }
+
+ (*d3dintf->effect.end)(curr_effect);
#endif
poly->texture->cur_frame++;
@@ -2180,150 +2180,150 @@ void hlsl_info::render_quad(d3d_poly_info *poly, int vertnum)
options->params_dirty = false;
}
#if HLSL_VECTOR
- else if(PRIMFLAG_GET_VECTOR(poly->flags) && vector_enable)
- {
- d3d_render_target *rt = find_render_target(d3d->width, d3d->height, 0, 0);
- if (rt == NULL)
- {
- return;
- }
-
- lines_pending = true;
-
- curr_effect = vector_effect;
- //curr_effect = effect;
-
- if(options->params_dirty)
- {
- (*d3dintf->effect.set_float)(curr_effect, "TargetWidth", (float)d3d->width);
- (*d3dintf->effect.set_float)(curr_effect, "TargetHeight", (float)d3d->height);
- }
-
- float time_params[2] = { poly->line_time, options->vector_time_scale };
- float length_params[3] = { poly->line_length, options->vector_length_scale, options->vector_length_ratio };
- (*d3dintf->effect.set_vector)(curr_effect, "TimeParams", 2, time_params);
- (*d3dintf->effect.set_vector)(curr_effect, "LengthParams", 3, length_params);
-
- (*d3dintf->effect.begin)(curr_effect, &num_passes, 0);
-
- HRESULT result = (*d3dintf->device.set_render_target)(d3d->device, 0, rt->target[0]);
- if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device set_render_target call\n", (int)result);
-
- for (UINT pass = 0; pass < num_passes; pass++)
- {
- (*d3dintf->effect.begin_pass)(curr_effect, pass);
- // add the primitives
- HRESULT result = (*d3dintf->device.draw_primitive)(d3d->device, poly->type, vertnum, poly->count);
- if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device draw_primitive call\n", (int)result);
- (*d3dintf->effect.end_pass)(curr_effect);
- }
-
- (*d3dintf->effect.end)(curr_effect);
- result = (*d3dintf->device.set_render_target)(d3d->device, 0, backbuffer);
- if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device set_render_target call\n", (int)result);
-
- curr_effect = effect;
-
- (*d3dintf->effect.set_float)(curr_effect, "FixedAlpha", 1.0f);
- }
- else if (PRIMFLAG_GET_VECTORBUF(poly->flags) && vector_enable)
- {
- //if (!lines_pending)
- //return;
- //lines_pending = false;
-
- d3d_info *d3d = (d3d_info *)window->drawdata;
-
- d3d_render_target *rt = find_render_target(d3d->width, d3d->height, 0, 0);
- if (rt == NULL)
- {
- return;
- }
-
- /* Bloom */
- curr_effect = downsample_effect;
-
- (*d3dintf->effect.set_texture)(curr_effect, "Diffuse", rt->texture[0]);
-
- int bloom_size = (d3d->width < d3d->height) ? d3d->width : d3d->height;
- int bloom_index = 0;
- int bloom_width = d3d->width;
- int bloom_height = d3d->height;
- for(; bloom_size >= 2 && bloom_index < 11; bloom_size >>= 1)
- {
- float source_size[2] = { bloom_width, bloom_height };
- float target_size[2] = { bloom_width >> 1, bloom_height >> 1 };
- (*d3dintf->effect.set_vector)(curr_effect, "TargetSize", 2, target_size);
- (*d3dintf->effect.set_vector)(curr_effect, "SourceSize", 2, source_size);
-
- (*d3dintf->effect.begin)(curr_effect, &num_passes, 0);
-
- (*d3dintf->effect.set_texture)(curr_effect, "Diffuse", (bloom_index == 0) ? rt->texture[0] : rt->bloom_texture[bloom_index - 1]);
-
- HRESULT result = (*d3dintf->device.set_render_target)(d3d->device, 0, rt->bloom_target[bloom_index]);
- if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device set_render_target call 6\n", (int)result);
- //result = (*d3dintf->device.clear)(d3d->device, 0, NULL, D3DCLEAR_TARGET, D3DCOLOR_ARGB(0,0,0,0), 0, 0);
- //if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device clear call\n", (int)result);
-
- for (UINT pass = 0; pass < num_passes; pass++)
- {
- (*d3dintf->effect.begin_pass)(curr_effect, pass);
- // add the primitives
- result = (*d3dintf->device.draw_primitive)(d3d->device, poly->type, vertnum, poly->count);
- if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device draw_primitive call\n", (int)result);
- (*d3dintf->effect.end_pass)(curr_effect);
- }
-
- (*d3dintf->effect.end)(curr_effect);
-
- bloom_index++;
- bloom_width >>= 1;
- bloom_height >>= 1;
- }
-
- /* Bloom composite pass*/
- curr_effect = bloom_effect;
-
- float target_size[2] = { d3d->width, d3d->height };
- (*d3dintf->effect.set_vector)(curr_effect, "TargetSize", 2, target_size);
-
- (*d3dintf->effect.set_texture)(curr_effect, "DiffuseA", rt->texture[0]);
- (*d3dintf->effect.set_float)(curr_effect, "DiffuseScaleA", 1.0f);
-
- char name[9] = "Diffuse*";
- char scale[14] = "DiffuseScale*";
- for(int index = 1; index < bloom_index; index++)
- {
- name[7] = 'A' + index;
- scale[12] = 'A' + index;
- (*d3dintf->effect.set_texture)(curr_effect, name, rt->bloom_texture[index - 1]);
- (*d3dintf->effect.set_float)(curr_effect, scale, 1.0f);
- }
- for(int index = bloom_index; index < 11; index++)
- {
- name[7] = 'A' + index;
- scale[12] = 'A' + index;
- (*d3dintf->effect.set_texture)(curr_effect, name, black_texture);
- (*d3dintf->effect.set_float)(curr_effect, scale, 0.0f);
- }
-
- (*d3dintf->effect.begin)(curr_effect, &num_passes, 0);
-
- HRESULT result = (*d3dintf->device.set_render_target)(d3d->device, 0, rt->target[1]);
- if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device set_render_target call 6\n", (int)result);
- //result = (*d3dintf->device.clear)(d3d->device, 0, NULL, D3DCLEAR_TARGET, D3DCOLOR_ARGB(0,0,0,0), 0, 0);
- //if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device clear call\n", (int)result);
-
- for (UINT pass = 0; pass < num_passes; pass++)
- {
- (*d3dintf->effect.begin_pass)(curr_effect, pass);
- // add the primitives
- result = (*d3dintf->device.draw_primitive)(d3d->device, poly->type, vertnum, poly->count);
- if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device draw_primitive call\n", (int)result);
- (*d3dintf->effect.end_pass)(curr_effect);
- }
-
- (*d3dintf->effect.end)(curr_effect);
+ else if(PRIMFLAG_GET_VECTOR(poly->flags) && vector_enable)
+ {
+ d3d_render_target *rt = find_render_target(d3d->width, d3d->height, 0, 0);
+ if (rt == NULL)
+ {
+ return;
+ }
+
+ lines_pending = true;
+
+ curr_effect = vector_effect;
+ //curr_effect = effect;
+
+ if(options->params_dirty)
+ {
+ (*d3dintf->effect.set_float)(curr_effect, "TargetWidth", (float)d3d->width);
+ (*d3dintf->effect.set_float)(curr_effect, "TargetHeight", (float)d3d->height);
+ }
+
+ float time_params[2] = { poly->line_time, options->vector_time_scale };
+ float length_params[3] = { poly->line_length, options->vector_length_scale, options->vector_length_ratio };
+ (*d3dintf->effect.set_vector)(curr_effect, "TimeParams", 2, time_params);
+ (*d3dintf->effect.set_vector)(curr_effect, "LengthParams", 3, length_params);
+
+ (*d3dintf->effect.begin)(curr_effect, &num_passes, 0);
+
+ HRESULT result = (*d3dintf->device.set_render_target)(d3d->device, 0, rt->target[0]);
+ if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device set_render_target call\n", (int)result);
+
+ for (UINT pass = 0; pass < num_passes; pass++)
+ {
+ (*d3dintf->effect.begin_pass)(curr_effect, pass);
+ // add the primitives
+ HRESULT result = (*d3dintf->device.draw_primitive)(d3d->device, poly->type, vertnum, poly->count);
+ if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device draw_primitive call\n", (int)result);
+ (*d3dintf->effect.end_pass)(curr_effect);
+ }
+
+ (*d3dintf->effect.end)(curr_effect);
+ result = (*d3dintf->device.set_render_target)(d3d->device, 0, backbuffer);
+ if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device set_render_target call\n", (int)result);
+
+ curr_effect = effect;
+
+ (*d3dintf->effect.set_float)(curr_effect, "FixedAlpha", 1.0f);
+ }
+ else if (PRIMFLAG_GET_VECTORBUF(poly->flags) && vector_enable)
+ {
+ //if (!lines_pending)
+ //return;
+ //lines_pending = false;
+
+ d3d_info *d3d = (d3d_info *)window->drawdata;
+
+ d3d_render_target *rt = find_render_target(d3d->width, d3d->height, 0, 0);
+ if (rt == NULL)
+ {
+ return;
+ }
+
+ /* Bloom */
+ curr_effect = downsample_effect;
+
+ (*d3dintf->effect.set_texture)(curr_effect, "Diffuse", rt->texture[0]);
+
+ int bloom_size = (d3d->width < d3d->height) ? d3d->width : d3d->height;
+ int bloom_index = 0;
+ int bloom_width = d3d->width;
+ int bloom_height = d3d->height;
+ for(; bloom_size >= 2 && bloom_index < 11; bloom_size >>= 1)
+ {
+ float source_size[2] = { bloom_width, bloom_height };
+ float target_size[2] = { bloom_width >> 1, bloom_height >> 1 };
+ (*d3dintf->effect.set_vector)(curr_effect, "TargetSize", 2, target_size);
+ (*d3dintf->effect.set_vector)(curr_effect, "SourceSize", 2, source_size);
+
+ (*d3dintf->effect.begin)(curr_effect, &num_passes, 0);
+
+ (*d3dintf->effect.set_texture)(curr_effect, "Diffuse", (bloom_index == 0) ? rt->texture[0] : rt->bloom_texture[bloom_index - 1]);
+
+ HRESULT result = (*d3dintf->device.set_render_target)(d3d->device, 0, rt->bloom_target[bloom_index]);
+ if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device set_render_target call 6\n", (int)result);
+ //result = (*d3dintf->device.clear)(d3d->device, 0, NULL, D3DCLEAR_TARGET, D3DCOLOR_ARGB(0,0,0,0), 0, 0);
+ //if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device clear call\n", (int)result);
+
+ for (UINT pass = 0; pass < num_passes; pass++)
+ {
+ (*d3dintf->effect.begin_pass)(curr_effect, pass);
+ // add the primitives
+ result = (*d3dintf->device.draw_primitive)(d3d->device, poly->type, vertnum, poly->count);
+ if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device draw_primitive call\n", (int)result);
+ (*d3dintf->effect.end_pass)(curr_effect);
+ }
+
+ (*d3dintf->effect.end)(curr_effect);
+
+ bloom_index++;
+ bloom_width >>= 1;
+ bloom_height >>= 1;
+ }
+
+ /* Bloom composite pass*/
+ curr_effect = bloom_effect;
+
+ float target_size[2] = { d3d->width, d3d->height };
+ (*d3dintf->effect.set_vector)(curr_effect, "TargetSize", 2, target_size);
+
+ (*d3dintf->effect.set_texture)(curr_effect, "DiffuseA", rt->texture[0]);
+ (*d3dintf->effect.set_float)(curr_effect, "DiffuseScaleA", 1.0f);
+
+ char name[9] = "Diffuse*";
+ char scale[14] = "DiffuseScale*";
+ for(int index = 1; index < bloom_index; index++)
+ {
+ name[7] = 'A' + index;
+ scale[12] = 'A' + index;
+ (*d3dintf->effect.set_texture)(curr_effect, name, rt->bloom_texture[index - 1]);
+ (*d3dintf->effect.set_float)(curr_effect, scale, 1.0f);
+ }
+ for(int index = bloom_index; index < 11; index++)
+ {
+ name[7] = 'A' + index;
+ scale[12] = 'A' + index;
+ (*d3dintf->effect.set_texture)(curr_effect, name, black_texture);
+ (*d3dintf->effect.set_float)(curr_effect, scale, 0.0f);
+ }
+
+ (*d3dintf->effect.begin)(curr_effect, &num_passes, 0);
+
+ HRESULT result = (*d3dintf->device.set_render_target)(d3d->device, 0, rt->target[1]);
+ if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device set_render_target call 6\n", (int)result);
+ //result = (*d3dintf->device.clear)(d3d->device, 0, NULL, D3DCLEAR_TARGET, D3DCOLOR_ARGB(0,0,0,0), 0, 0);
+ //if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device clear call\n", (int)result);
+
+ for (UINT pass = 0; pass < num_passes; pass++)
+ {
+ (*d3dintf->effect.begin_pass)(curr_effect, pass);
+ // add the primitives
+ result = (*d3dintf->device.draw_primitive)(d3d->device, poly->type, vertnum, poly->count);
+ if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device draw_primitive call\n", (int)result);
+ (*d3dintf->effect.end_pass)(curr_effect);
+ }
+
+ (*d3dintf->effect.end)(curr_effect);
/* Phosphor */
curr_effect = phosphor_effect;
@@ -2359,51 +2359,51 @@ void hlsl_info::render_quad(d3d_poly_info *poly, int vertnum)
(*d3dintf->effect.end)(curr_effect);
- //curr_effect = effect;
+ //curr_effect = effect;
- //blit(backbuffer, rt->bloom_texture[5], NULL, poly->type, vertnum, poly->count);
- //blit(rt->target[2], rt->texture[0], NULL, poly->type, vertnum, poly->count);
- blit(backbuffer, rt->texture[0], NULL, poly->type, vertnum, poly->count);
- //blit(backbuffer, rt->texture[0], NULL, poly->type, vertnum, poly->count);
+ //blit(backbuffer, rt->bloom_texture[5], NULL, poly->type, vertnum, poly->count);
+ //blit(rt->target[2], rt->texture[0], NULL, poly->type, vertnum, poly->count);
+ blit(backbuffer, rt->texture[0], NULL, poly->type, vertnum, poly->count);
+ //blit(backbuffer, rt->texture[0], NULL, poly->type, vertnum, poly->count);
- result = (*d3dintf->device.set_render_target)(d3d->device, 0, rt->target[0]);
- if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device set_render_target call\n", (int)result);
- result = (*d3dintf->device.clear)(d3d->device, 0, NULL, D3DCLEAR_TARGET, D3DCOLOR_ARGB(0,0,0,0), 0, 0);
- if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device clear call\n", (int)result);
- result = (*d3dintf->device.set_render_target)(d3d->device, 0, backbuffer);
- if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device set_render_target call\n", (int)result);
+ result = (*d3dintf->device.set_render_target)(d3d->device, 0, rt->target[0]);
+ if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device set_render_target call\n", (int)result);
+ result = (*d3dintf->device.clear)(d3d->device, 0, NULL, D3DCLEAR_TARGET, D3DCOLOR_ARGB(0,0,0,0), 0, 0);
+ if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device clear call\n", (int)result);
+ result = (*d3dintf->device.set_render_target)(d3d->device, 0, backbuffer);
+ if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device set_render_target call\n", (int)result);
- /*curr_effect = post_effect;
+ /*curr_effect = post_effect;
- (*d3dintf->effect.set_texture)(curr_effect, "Diffuse", rt->texture[0]);
+ (*d3dintf->effect.set_texture)(curr_effect, "Diffuse", rt->texture[0]);
- (*d3dintf->effect.set_float)(curr_effect, "TargetWidth", (float)d3d->width);
- (*d3dintf->effect.set_float)(curr_effect, "TargetHeight", (float)d3d->height);
+ (*d3dintf->effect.set_float)(curr_effect, "TargetWidth", (float)d3d->width);
+ (*d3dintf->effect.set_float)(curr_effect, "TargetHeight", (float)d3d->height);
(*d3dintf->effect.set_float)(curr_effect, "RawWidth", (float)poly->texture->rawwidth);
(*d3dintf->effect.set_float)(curr_effect, "RawHeight", (float)poly->texture->rawheight);
(*d3dintf->effect.set_float)(curr_effect, "WidthRatio", 1.0f / (poly->texture->ustop - poly->texture->ustart));
(*d3dintf->effect.set_float)(curr_effect, "HeightRatio", 1.0f / (poly->texture->vstop - poly->texture->vstart));
- result = (*d3dintf->device.set_render_target)(d3d->device, 0, rt->target[1]);
- if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device set_render_target call\n", (int)result);
+ result = (*d3dintf->device.set_render_target)(d3d->device, 0, rt->target[1]);
+ if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device set_render_target call\n", (int)result);
- (*d3dintf->effect.begin)(curr_effect, &num_passes, 0);
+ (*d3dintf->effect.begin)(curr_effect, &num_passes, 0);
- for (UINT pass = 0; pass < num_passes; pass++)
- {
- (*d3dintf->effect.begin_pass)(curr_effect, pass);
- // add the primitives
- result = (*d3dintf->device.draw_primitive)(d3d->device, poly->type, vertnum, poly->count);
- if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device draw_primitive call\n", (int)result);
- (*d3dintf->effect.end_pass)(curr_effect);
- }
+ for (UINT pass = 0; pass < num_passes; pass++)
+ {
+ (*d3dintf->effect.begin_pass)(curr_effect, pass);
+ // add the primitives
+ result = (*d3dintf->device.draw_primitive)(d3d->device, poly->type, vertnum, poly->count);
+ if (result != D3D_OK) mame_printf_verbose("Direct3D: Error %08X during device draw_primitive call\n", (int)result);
+ (*d3dintf->effect.end_pass)(curr_effect);
+ }
- (*d3dintf->effect.end)(curr_effect);*/
+ (*d3dintf->effect.end)(curr_effect);*/
- vecbuf_type = poly->type;
- vecbuf_index = vertnum;
- vecbuf_count = poly->count;
- }
+ vecbuf_type = poly->type;
+ vecbuf_index = vertnum;
+ vecbuf_count = poly->count;
+ }
#endif
else
{
@@ -2733,10 +2733,10 @@ void hlsl_info::delete_resources(bool reset)
file.printf("yiq_q %f\n", options->yiq_q);
file.printf("yiq_scan_time %f\n", options->yiq_scan_time);
file.printf("yiq_phase_count %d\n", options->yiq_phase_count);
- file.printf("vector_time_scale %f\n", options->vector_time_scale);
- file.printf("vector_time_period %f\n", options->vector_time_period);
- file.printf("vector_length_scale %f\n", options->vector_length_scale);
- file.printf("vector_length_ratio %f\n", options->vector_length_ratio);
+ file.printf("vector_time_scale %f\n", options->vector_time_scale);
+ file.printf("vector_time_period %f\n", options->vector_time_period);
+ file.printf("vector_length_scale %f\n", options->vector_length_scale);
+ file.printf("vector_length_ratio %f\n", options->vector_length_ratio);
}
while (targethead != NULL)
@@ -2745,16 +2745,16 @@ void hlsl_info::delete_resources(bool reset)
}
#if HLSL_VECTOR
- if (downsample_effect != NULL)
- {
- (*d3dintf->effect.release)(downsample_effect);
- downsample_effect = NULL;
- }
- if (bloom_effect != NULL)
- {
- (*d3dintf->effect.release)(bloom_effect);
- bloom_effect = NULL;
- }
+ if (downsample_effect != NULL)
+ {
+ (*d3dintf->effect.release)(downsample_effect);
+ downsample_effect = NULL;
+ }
+ if (bloom_effect != NULL)
+ {
+ (*d3dintf->effect.release)(bloom_effect);
+ bloom_effect = NULL;
+ }
#endif
if (effect != NULL)
{
@@ -2807,11 +2807,11 @@ void hlsl_info::delete_resources(bool reset)
yiq_decode_effect = NULL;
}
- if (black_texture != NULL)
- {
- (*d3dintf->texture.release)(black_texture);
- black_texture = NULL;
- }
+ if (black_texture != NULL)
+ {
+ (*d3dintf->texture.release)(black_texture);
+ black_texture = NULL;
+ }
if (avi_copy_texture != NULL)
{
diff --git a/src/osd/windows/d3dhlsl.h b/src/osd/windows/d3dhlsl.h
index 7d508ddb2a1..25c6cf77077 100644
--- a/src/osd/windows/d3dhlsl.h
+++ b/src/osd/windows/d3dhlsl.h
@@ -48,7 +48,7 @@
// CONSTANTS
//============================================================
-#define HLSL_VECTOR (0)
+#define HLSL_VECTOR (0)
//============================================================
// TYPE DEFINITIONS
@@ -92,7 +92,7 @@ struct hlsl_options
float phosphor[3];
float saturation;
- // NTSC
+ // NTSC
bool yiq_enable;
float yiq_cc;
float yiq_a;
@@ -106,11 +106,11 @@ struct hlsl_options
float yiq_scan_time;
int yiq_phase_count;
- // Vectors
- float vector_time_scale;
- float vector_time_period;
- float vector_length_scale;
- float vector_length_ratio;
+ // Vectors
+ float vector_time_scale;
+ float vector_time_period;
+ float vector_length_scale;
+ float vector_length_ratio;
};
class hlsl_info
@@ -150,7 +150,7 @@ public:
void avi_update_snap(d3d_surface *surface);
void render_snapshot(d3d_surface *surface);
void record_texture();
- void init_fsfx_quad(void *vertbuf);
+ void init_fsfx_quad(void *vertbuf);
void set_texture(d3d_texture_info *texture);
d3d_render_target * find_render_target(d3d_texture_info *info);
@@ -165,11 +165,11 @@ public:
slider_state *init_slider_list();
private:
- void blit(d3d_surface *dst, d3d_texture *src, d3d_surface *new_dst,
- D3DPRIMITIVETYPE prim_type, UINT32 prim_index, UINT32 prim_count,
- int dstw, int dsth);
- void blit(d3d_surface *dst, d3d_texture *src, d3d_surface *new_dst,
- D3DPRIMITIVETYPE prim_type, UINT32 prim_index, UINT32 prim_count);
+ void blit(d3d_surface *dst, d3d_texture *src, d3d_surface *new_dst,
+ D3DPRIMITIVETYPE prim_type, UINT32 prim_index, UINT32 prim_count,
+ int dstw, int dsth);
+ void blit(d3d_surface *dst, d3d_texture *src, d3d_surface *new_dst,
+ D3DPRIMITIVETYPE prim_type, UINT32 prim_index, UINT32 prim_count);
void enumerate_screens();
void end_avi_recording();
@@ -201,9 +201,9 @@ private:
bitmap_argb32 shadow_bitmap; // shadow mask bitmap for post-processing shader
d3d_texture_info * shadow_texture; // shadow mask texture for post-processing shader
hlsl_options * options; // current uniform state
- D3DPRIMITIVETYPE vecbuf_type;
- UINT32 vecbuf_index;
- UINT32 vecbuf_count;
+ D3DPRIMITIVETYPE vecbuf_type;
+ UINT32 vecbuf_index;
+ UINT32 vecbuf_count;
avi_file * avi_output_file; // AVI file
bitmap_rgb32 avi_snap; // AVI snapshot
@@ -215,8 +215,8 @@ private:
d3d_surface * avi_final_target; // AVI upscaled surface
d3d_texture * avi_final_texture; // AVI upscaled texture
- d3d_surface * black_surface; // black dummy surface
- d3d_texture * black_texture; // black dummy texture
+ d3d_surface * black_surface; // black dummy surface
+ d3d_texture * black_texture; // black dummy texture
bool render_snap; // whether or not to take HLSL post-render snapshot
bool snap_rendered; // whether we just rendered our HLSL post-render shot or not
@@ -228,7 +228,7 @@ private:
int snap_height; // snapshot height
bool lines_pending; // whether or not we have lines to flush on the next quad
- bool initialized; // whether or not we're initialize
+ bool initialized; // whether or not we're initialize
// HLSL effects
d3d_surface * backbuffer; // pointer to our device's backbuffer
@@ -244,8 +244,8 @@ private:
d3d_effect * yiq_encode_effect; // pointer to the YIQ encoder effect object
d3d_effect * yiq_decode_effect; // pointer to the YIQ decoder effect object
#if HLSL_VECTOR
- d3d_effect * bloom_effect; // pointer to the bloom composite effect
- d3d_effect * downsample_effect; // pointer to the bloom downsample effect
+ d3d_effect * bloom_effect; // pointer to the bloom composite effect
+ d3d_effect * downsample_effect; // pointer to the bloom downsample effect
d3d_effect * vector_effect; // pointer to the vector-effect object
#endif
d3d_vertex * fsfx_vertices; // pointer to our full-screen-quad object
diff --git a/src/osd/windows/drawd3d.c b/src/osd/windows/drawd3d.c
index c103c67eca7..d87dc5fd2c0 100644
--- a/src/osd/windows/drawd3d.c
+++ b/src/osd/windows/drawd3d.c
@@ -625,46 +625,46 @@ mtlog_add("drawd3d_window_draw: begin_scene");
d3d->lockedbuf = NULL;
- // loop over primitives
- if(d3d->hlsl->enabled())
- {
- d3d->hlsl_buf = (void*)primitive_alloc(d3d, 6);
- d3d->hlsl->init_fsfx_quad(d3d->hlsl_buf);
- }
+ // loop over primitives
+ if(d3d->hlsl->enabled())
+ {
+ d3d->hlsl_buf = (void*)primitive_alloc(d3d, 6);
+ d3d->hlsl->init_fsfx_quad(d3d->hlsl_buf);
+ }
mtlog_add("drawd3d_window_draw: count lines");
- int line_count = 0;
- for (prim = window->primlist->first(); prim != NULL; prim = prim->next())
- if (prim->type == render_primitive::LINE && PRIMFLAG_GET_VECTOR(prim->flags))
- line_count++;
+ int line_count = 0;
+ for (prim = window->primlist->first(); prim != NULL; prim = prim->next())
+ if (prim->type == render_primitive::LINE && PRIMFLAG_GET_VECTOR(prim->flags))
+ line_count++;
mtlog_add("drawd3d_window_draw: primitive loop begin");
- // Rotating index for vector time offsets
- static int start_index = 0;
- int line_index = 0;
- windows_options &options = downcast<windows_options &>(window->machine().options());
- float period = options.screen_vector_time_period();
+ // Rotating index for vector time offsets
+ static int start_index = 0;
+ int line_index = 0;
+ windows_options &options = downcast<windows_options &>(window->machine().options());
+ float period = options.screen_vector_time_period();
for (prim = window->primlist->first(); prim != NULL; prim = prim->next())
- {
+ {
switch (prim->type)
{
case render_primitive::LINE:
- if (PRIMFLAG_GET_VECTOR(prim->flags))
- {
- if (period == 0.0f || line_count == 0)
- {
- draw_line(d3d, prim, 1.0f);
- }
- else
- {
- draw_line(d3d, prim, (float)(start_index + line_index) / ((float)line_count * period));
- line_index++;
- }
- }
- else
- {
- draw_line(d3d, prim, 0.0f);
- }
+ if (PRIMFLAG_GET_VECTOR(prim->flags))
+ {
+ if (period == 0.0f || line_count == 0)
+ {
+ draw_line(d3d, prim, 1.0f);
+ }
+ else
+ {
+ draw_line(d3d, prim, (float)(start_index + line_index) / ((float)line_count * period));
+ line_index++;
+ }
+ }
+ else
+ {
+ draw_line(d3d, prim, 0.0f);
+ }
break;
case render_primitive::QUAD:
@@ -674,12 +674,12 @@ mtlog_add("drawd3d_window_draw: primitive loop begin");
default:
throw emu_fatalerror("Unexpected render_primitive type");
}
- }
- start_index += (int)((float)line_index * period);
- if (line_count > 0)
- {
- start_index %= line_count;
- }
+ }
+ start_index += (int)((float)line_index * period);
+ if (line_count > 0)
+ {
+ start_index %= line_count;
+ }
mtlog_add("drawd3d_window_draw: primitive loop end");
window->primlist->release_lock();
@@ -1580,22 +1580,22 @@ static void draw_line(d3d_info *d3d, const render_primitive *prim, float line_ti
poly->flags = prim->flags;
poly->modmode = D3DTOP_MODULATE;
poly->texture = d3d->vector_texture;
- poly->line_time = line_time;
- poly->line_length = 1.0f;
- if (PRIMFLAG_GET_VECTOR(poly->flags))
- {
- float dx = fabs(prim->bounds.x1 - prim->bounds.x0);
- float dy = fabs(prim->bounds.y1 - prim->bounds.y0);
- float length2 = dx * dx + dy * dy;
- if (length2 > 0.0f)
- {
- poly->line_length = sqrt(length2);
- }
- else
- {
- // use default length of 1.0f from above
- }
- }
+ poly->line_time = line_time;
+ poly->line_length = 1.0f;
+ if (PRIMFLAG_GET_VECTOR(poly->flags))
+ {
+ float dx = fabs(prim->bounds.x1 - prim->bounds.x0);
+ float dy = fabs(prim->bounds.y1 - prim->bounds.y0);
+ float length2 = dx * dx + dy * dy;
+ if (length2 > 0.0f)
+ {
+ poly->line_length = sqrt(length2);
+ }
+ else
+ {
+ // use default length of 1.0f from above
+ }
+ }
}
}
@@ -1690,7 +1690,7 @@ static void draw_quad(d3d_info *d3d, const render_primitive *prim)
poly->flags = prim->flags;
poly->modmode = modmode;
poly->texture = texture;
- //poly->
+ //poly->
}
@@ -1759,14 +1759,14 @@ static void primitive_flush_pending(d3d_info *d3d)
d3d->hlsl->begin_draw();
- if (d3d->hlsl->enabled())
- {
- vertnum = 6;
- }
- else
- {
- vertnum = 0;
- }
+ if (d3d->hlsl->enabled())
+ {
+ vertnum = 6;
+ }
+ else
+ {
+ vertnum = 0;
+ }
// now do the polys
for (polynum = 0; polynum < d3d->numpolys; polynum++)
@@ -2718,19 +2718,19 @@ static void texture_update(d3d_info *d3d, const render_primitive *prim)
d3d_cache_target::~d3d_cache_target()
{
- for (int index = 0; index < 11; index++)
- {
- if (bloom_texture[index] != NULL)
- {
- (*d3dintf->texture.release)(bloom_texture[index]);
- bloom_texture[index] = NULL;
- }
- if (bloom_target[index] != NULL)
- {
- (*d3dintf->surface.release)(bloom_target[index]);
- bloom_target[index] = NULL;
- }
- }
+ for (int index = 0; index < 11; index++)
+ {
+ if (bloom_texture[index] != NULL)
+ {
+ (*d3dintf->texture.release)(bloom_texture[index]);
+ bloom_texture[index] = NULL;
+ }
+ if (bloom_target[index] != NULL)
+ {
+ (*d3dintf->surface.release)(bloom_target[index]);
+ bloom_target[index] = NULL;
+ }
+ }
if (last_texture != NULL)
{
@@ -2751,33 +2751,33 @@ d3d_cache_target::~d3d_cache_target()
bool d3d_cache_target::init(d3d_info *d3d, d3d_base *d3dintf, int width, int height, int prescale_x, int prescale_y, bool bloom)
{
- if (bloom)
- {
- int bloom_size = (width * prescale_x < height * prescale_y) ? width * prescale_x : height * prescale_y;
- int bloom_index = 0;
- int bloom_width = width * prescale_x;
- int bloom_height = height * prescale_y;
- for (; bloom_size >= 2 && bloom_index < 11; bloom_size >>= 1)
- {
- bloom_width >>= 1;
- bloom_height >>= 1;
- HRESULT result = (*d3dintf->device.create_texture)(d3d->device, bloom_width, bloom_height, 1, D3DUSAGE_RENDERTARGET, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &bloom_texture[bloom_index]);
- if (result != D3D_OK)
- {
- return false;
- }
- (*d3dintf->texture.get_surface_level)(bloom_texture[bloom_index], 0, &bloom_target[bloom_index]);
- bloom_index++;
- }
- }
+ if (bloom)
+ {
+ int bloom_size = (width * prescale_x < height * prescale_y) ? width * prescale_x : height * prescale_y;
+ int bloom_index = 0;
+ int bloom_width = width * prescale_x;
+ int bloom_height = height * prescale_y;
+ for (; bloom_size >= 2 && bloom_index < 11; bloom_size >>= 1)
+ {
+ bloom_width >>= 1;
+ bloom_height >>= 1;
+ HRESULT result = (*d3dintf->device.create_texture)(d3d->device, bloom_width, bloom_height, 1, D3DUSAGE_RENDERTARGET, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &bloom_texture[bloom_index]);
+ if (result != D3D_OK)
+ {
+ return false;
+ }
+ (*d3dintf->texture.get_surface_level)(bloom_texture[bloom_index], 0, &bloom_target[bloom_index]);
+ bloom_index++;
+ }
+ }
HRESULT result = (*d3dintf->device.create_texture)(d3d->device, width * prescale_x, height * prescale_y, 1, D3DUSAGE_RENDERTARGET, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &last_texture);
if (result != D3D_OK)
return false;
(*d3dintf->texture.get_surface_level)(last_texture, 0, &last_target);
- target_width = width * prescale_x;
- target_height = height * prescale_y;
+ target_width = width * prescale_x;
+ target_height = height * prescale_y;
return true;
}
@@ -2788,19 +2788,19 @@ bool d3d_cache_target::init(d3d_info *d3d, d3d_base *d3dintf, int width, int hei
d3d_render_target::~d3d_render_target()
{
- for (int index = 0; index < 11; index++)
- {
- if (bloom_texture[index] != NULL)
- {
- (*d3dintf->texture.release)(bloom_texture[index]);
- bloom_texture[index] = NULL;
- }
- if (bloom_target[index] != NULL)
- {
- (*d3dintf->surface.release)(bloom_target[index]);
- bloom_target[index] = NULL;
- }
- }
+ for (int index = 0; index < 11; index++)
+ {
+ if (bloom_texture[index] != NULL)
+ {
+ (*d3dintf->texture.release)(bloom_texture[index]);
+ bloom_texture[index] = NULL;
+ }
+ if (bloom_target[index] != NULL)
+ {
+ (*d3dintf->surface.release)(bloom_target[index]);
+ bloom_target[index] = NULL;
+ }
+ }
for (int index = 0; index < 5; index++)
{
@@ -2885,29 +2885,29 @@ bool d3d_render_target::init(d3d_info *d3d, d3d_base *d3dintf, int width, int he
return false;
(*d3dintf->texture.get_surface_level)(prescaletexture, 0, &prescaletarget);
- for (int index = 0; index < 11; index++)
- {
- bloom_texture[index] = NULL;
- bloom_target[index] = NULL;
- }
+ for (int index = 0; index < 11; index++)
+ {
+ bloom_texture[index] = NULL;
+ bloom_target[index] = NULL;
+ }
}
else
- {
- int bloom_size = (width < height) ? width : height;
- int bloom_index = 0;
- int bloom_width = width;
- int bloom_height = height;
- for (; bloom_size >= 2 && bloom_index < 11; bloom_size >>= 1)
- {
- bloom_width >>= 1;
- bloom_height >>= 1;
- result = (*d3dintf->device.create_texture)(d3d->device, bloom_width, bloom_height, 1, D3DUSAGE_RENDERTARGET, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &bloom_texture[bloom_index]);
- if (result != D3D_OK)
- return false;
- (*d3dintf->texture.get_surface_level)(bloom_texture[bloom_index], 0, &bloom_target[bloom_index]);
- bloom_index++;
- }
- }
+ {
+ int bloom_size = (width < height) ? width : height;
+ int bloom_index = 0;
+ int bloom_width = width;
+ int bloom_height = height;
+ for (; bloom_size >= 2 && bloom_index < 11; bloom_size >>= 1)
+ {
+ bloom_width >>= 1;
+ bloom_height >>= 1;
+ result = (*d3dintf->device.create_texture)(d3d->device, bloom_width, bloom_height, 1, D3DUSAGE_RENDERTARGET, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &bloom_texture[bloom_index]);
+ if (result != D3D_OK)
+ return false;
+ (*d3dintf->texture.get_surface_level)(bloom_texture[bloom_index], 0, &bloom_target[bloom_index]);
+ bloom_index++;
+ }
+ }
target_width = width * prescale_x;
target_height = height * prescale_y;
diff --git a/src/osd/windows/drawd3d.h b/src/osd/windows/drawd3d.h
index 7cca9fee099..a4e3ef40c19 100644
--- a/src/osd/windows/drawd3d.h
+++ b/src/osd/windows/drawd3d.h
@@ -72,8 +72,8 @@ public:
d3d_surface *last_target;
d3d_texture *last_texture;
- int target_width;
- int target_height;
+ int target_width;
+ int target_height;
int width;
int height;
@@ -83,8 +83,8 @@ public:
d3d_cache_target *next;
d3d_cache_target *prev;
- d3d_surface *bloom_target[11];
- d3d_texture *bloom_texture[11];
+ d3d_surface *bloom_target[11];
+ d3d_texture *bloom_texture[11];
};
/* d3d_render_target is the information about a Direct3D render target chain */
@@ -116,8 +116,8 @@ public:
d3d_render_target *next;
d3d_render_target *prev;
- d3d_surface *bloom_target[11];
- d3d_texture *bloom_texture[11];
+ d3d_surface *bloom_target[11];
+ d3d_texture *bloom_texture[11];
};
/* d3d_info is the information about Direct3D for the current screen */
@@ -143,7 +143,7 @@ struct d3d_info
d3d_poly_info poly[VERTEX_BUFFER_SIZE/3]; // array to hold polygons as they are created
int numpolys; // number of accumulated polygons
- bool restarting; // if we're restarting
+ bool restarting; // if we're restarting
d3d_texture_info * texlist; // list of active textures
int dynamic_supported; // are dynamic textures supported?
diff --git a/src/osd/windows/winmain.c b/src/osd/windows/winmain.c
index 58e0232ca07..902290fa687 100644
--- a/src/osd/windows/winmain.c
+++ b/src/osd/windows/winmain.c
@@ -375,7 +375,7 @@ const options_entry windows_options::s_option_entries[] =
{ WINOPTION_FLOOR";fs_floor", "0.0,0.0,0.0",OPTION_STRING, "signal floor level" },
{ WINOPTION_PHOSPHOR";fs_phosphor", "0.0,0.0,0.0",OPTION_STRING, "phosphorescence decay rate (0.0 is instant, 1.0 is forever)" },
/* NTSC simulation below this line */
- { NULL, NULL, OPTION_HEADER, "NTSC POST-PROCESSING OPTIONS" },
+ { NULL, NULL, OPTION_HEADER, "NTSC POST-PROCESSING OPTIONS" },
{ WINOPTION_YIQ_ENABLE";yiq", "0", OPTION_BOOLEAN, "enable YIQ-space HLSL post-processing" },
{ WINOPTION_YIQ_CCVALUE";yiqcc", "3.59754545",OPTION_FLOAT, "Color Carrier frequency for NTSC signal processing" },
{ WINOPTION_YIQ_AVALUE";yiqa", "0.5", OPTION_FLOAT, "A value for NTSC signal processing" },
@@ -388,14 +388,14 @@ const options_entry windows_options::s_option_entries[] =
{ WINOPTION_YIQ_QVALUE";yiqq", "0.6", OPTION_FLOAT, "Q filter cutoff frequency for NTSC signal processing" },
{ WINOPTION_YIQ_SCAN_TIME";yiqsc", "52.6", OPTION_FLOAT, "Horizontal scanline duration for NTSC signal processing (in usec)" },
{ WINOPTION_YIQ_PHASE_COUNT";yiqp", "2", OPTION_INTEGER, "Phase Count value for NTSC signal processing" },
- { WINOPTION_YIQ_SCAN_TIME";yiqsc", "52.6", OPTION_FLOAT, "Horizontal scanline duration for NTSC signal processing (in usec)" },
- { WINOPTION_YIQ_PHASE_COUNT";yiqp", "2", OPTION_INTEGER, "Phase Count value for NTSC signal processing" },
- /* Vector simulation below this line */
- { NULL, NULL, OPTION_HEADER, "VECTOR POST-PROCESSING OPTIONS" },
- { WINOPTION_VECTOR_TIME_SCALE";vectime", "0.0", OPTION_FLOAT, "How much the fade rate affects vector fade" },
- { WINOPTION_VECTOR_TIME_PERIOD";vecperiod", "0.1", OPTION_FLOAT, "Vector fade rate versus screen refresh rate" },
- { WINOPTION_VECTOR_LENGTH_SCALE";veclength", "0.9", OPTION_FLOAT, "How much length affects vector fade" },
- { WINOPTION_VECTOR_LENGTH_RATIO";vecsize", "4.0", OPTION_FLOAT, "Vector fade length (4.0 - vectors fade the most at and above 4 pixels, etc.)" },
+ { WINOPTION_YIQ_SCAN_TIME";yiqsc", "52.6", OPTION_FLOAT, "Horizontal scanline duration for NTSC signal processing (in usec)" },
+ { WINOPTION_YIQ_PHASE_COUNT";yiqp", "2", OPTION_INTEGER, "Phase Count value for NTSC signal processing" },
+ /* Vector simulation below this line */
+ { NULL, NULL, OPTION_HEADER, "VECTOR POST-PROCESSING OPTIONS" },
+ { WINOPTION_VECTOR_TIME_SCALE";vectime", "0.0", OPTION_FLOAT, "How much the fade rate affects vector fade" },
+ { WINOPTION_VECTOR_TIME_PERIOD";vecperiod", "0.1", OPTION_FLOAT, "Vector fade rate versus screen refresh rate" },
+ { WINOPTION_VECTOR_LENGTH_SCALE";veclength", "0.9", OPTION_FLOAT, "How much length affects vector fade" },
+ { WINOPTION_VECTOR_LENGTH_RATIO";vecsize", "4.0", OPTION_FLOAT, "Vector fade length (4.0 - vectors fade the most at and above 4 pixels, etc.)" },
// per-window options
{ NULL, NULL, OPTION_HEADER, "PER-WINDOW VIDEO OPTIONS" },
diff --git a/src/osd/windows/winmain.h b/src/osd/windows/winmain.h
index 167ca9ec476..eb3b234643e 100644
--- a/src/osd/windows/winmain.h
+++ b/src/osd/windows/winmain.h
@@ -1,4 +1,4 @@
- //============================================================
+ //============================================================
//
// winmain.h - Win32 main program and core headers
//
@@ -243,10 +243,10 @@ public:
float screen_yiq_q() const { return float_value(WINOPTION_YIQ_QVALUE); }
float screen_yiq_scan_time() const { return float_value(WINOPTION_YIQ_SCAN_TIME); }
int screen_yiq_phase_count() const { return int_value(WINOPTION_YIQ_PHASE_COUNT); }
- float screen_vector_time_scale() const { return float_value(WINOPTION_VECTOR_TIME_SCALE); }
- float screen_vector_time_period() const { return float_value(WINOPTION_VECTOR_TIME_PERIOD); }
- float screen_vector_length_scale() const { return float_value(WINOPTION_VECTOR_LENGTH_SCALE); }
- float screen_vector_length_ratio() const { return float_value(WINOPTION_VECTOR_LENGTH_RATIO); }
+ float screen_vector_time_scale() const { return float_value(WINOPTION_VECTOR_TIME_SCALE); }
+ float screen_vector_time_period() const { return float_value(WINOPTION_VECTOR_TIME_PERIOD); }
+ float screen_vector_length_scale() const { return float_value(WINOPTION_VECTOR_LENGTH_SCALE); }
+ float screen_vector_length_ratio() const { return float_value(WINOPTION_VECTOR_LENGTH_RATIO); }
const char *screen_offset() const { return value(WINOPTION_OFFSET); }
const char *screen_scale() const { return value(WINOPTION_SCALE); }
const char *screen_power() const { return value(WINOPTION_POWER); }
diff --git a/src/osd/windows/winsocket.c b/src/osd/windows/winsocket.c
index d5ebaafc2d4..90eeeb26e9a 100644
--- a/src/osd/windows/winsocket.c
+++ b/src/osd/windows/winsocket.c
@@ -43,7 +43,7 @@ bool win_init_sockets()
/* check for correct version */
if ( LOBYTE( wsaData.wVersion ) != 2 ||
- HIBYTE( wsaData.wVersion ) != 0 )
+ HIBYTE( wsaData.wVersion ) != 0 )
{
/* incorrect WinSock version */
WSACleanup();
@@ -95,25 +95,25 @@ file_error win_open_socket(const char *path, UINT32 openflags, osd_file **file,
// listening socket support
if (openflags & OPEN_FLAG_CREATE)
{
-// printf("Listening for client at '%s' on port '%d'\n", hostname, port);
+// printf("Listening for client at '%s' on port '%d'\n", hostname, port);
// bind socket...
if (bind((*file)->socket, (struct sockaddr *)&sai, sizeof(struct sockaddr)) == -1)
{
return FILERR_ACCESS_DENIED;
}
-
+
// start to listen...
if (listen((*file)->socket, 1) == -1) {
return FILERR_ACCESS_DENIED;
}
-
+
// mark socket as "listening"
(*file)->handle = 0;
*filesize = 0;
return FILERR_NONE;
}
-
-// printf("Connecting to server '%s' on port '%d'\n", hostname, port);
+
+// printf("Connecting to server '%s' on port '%d'\n", hostname, port);
if (connect((*file)->socket, (struct sockaddr *)&sai, sizeof(struct sockaddr)) == -1)
{
return FILERR_ACCESS_DENIED;