-osd/windows/winutil.cpp: Better way to get module handle.

* This was leftover support for Windows 2000 and earlier that hadn't
  been cleaned up.

-atari: Don't forget your #include guards!
This commit is contained in:
Vas Crabb 2023-02-12 05:07:13 +11:00
parent fd6c192c2e
commit 6f93428f96
13 changed files with 70 additions and 15 deletions

View File

@ -6,6 +6,10 @@
Sky Diver Audio
***************************************************************************/
#ifndef MAME_ATARI_SKYDIVER_A_H
#define MAME_ATARI_SKYDIVER_A_H
#pragma once
#include "sound/discrete.h"
@ -24,3 +28,5 @@ Sky Diver Audio
DISCRETE_SOUND_EXTERN( skydiver_discrete );
#endif // MAME_ATARI_SKYDIVER_A_H

View File

@ -6,6 +6,10 @@
Sky Raider Audio
***************************************************************************/
#ifndef MAME_ATARI_SKYRAID_A_H
#define MAME_ATARI_SKYRAID_A_H
#pragma once
#include "sound/discrete.h"
@ -20,3 +24,5 @@ Sky Raider Audio
DISCRETE_SOUND_EXTERN( skyraid_discrete );
#endif // MAME_ATARI_SKYRAID_A_H

View File

@ -6,6 +6,10 @@
Sprint 2 / Sprint 1 / Dominos Audio
***************************************************************************/
#ifndef MAME_ATARI_SPRINT2_A_H
#define MAME_ATARI_SPRINT2_A_H
#pragma once
#include "sound/discrete.h"
@ -28,3 +32,5 @@ Sprint 2 / Sprint 1 / Dominos Audio
DISCRETE_SOUND_EXTERN( sprint2_discrete );
DISCRETE_SOUND_EXTERN( sprint1_discrete );
DISCRETE_SOUND_EXTERN( dominos_discrete );
#endif // MAME_ATARI_SPRINT2_A_H

View File

@ -6,6 +6,10 @@
Sprint 8 Audio
***************************************************************************/
#ifndef MAME_ATARI_SPRINT8_A_H
#define MAME_ATARI_SPRINT8_A_H
#pragma once
#include "sound/discrete.h"
@ -25,3 +29,5 @@ Sprint 8 Audio
DISCRETE_SOUND_EXTERN( sprint8_discrete );
#endif // MAME_ATARI_SPRINT8_A_H

View File

@ -821,9 +821,9 @@ GFXDECODE_END
void starshp1_state::starshp1(machine_config &config)
{
static constexpr XTAL MASTER_CLOCK = 12.096_MHz_XTAL;
static constexpr XTAL CPU_CLOCK = MASTER_CLOCK / 16;
static constexpr XTAL PIXEL_CLOCK = MASTER_CLOCK;
constexpr XTAL MASTER_CLOCK = 12.096_MHz_XTAL;
constexpr XTAL CPU_CLOCK = MASTER_CLOCK / 16;
constexpr XTAL PIXEL_CLOCK = MASTER_CLOCK;
// basic machine hardware
@ -843,12 +843,12 @@ void starshp1_state::starshp1(machine_config &config)
// video hardware
static constexpr int HTOTAL = 0x300;
static constexpr int HBEND = 0x000;
static constexpr int HBSTART = 0x200;
static constexpr int VTOTAL = 0x106;
static constexpr int VBEND = 0x000;
static constexpr int VBSTART = 0x0f0;
constexpr int HTOTAL = 0x300;
constexpr int HBEND = 0x000;
constexpr int HBSTART = 0x200;
constexpr int VTOTAL = 0x106;
constexpr int VBEND = 0x000;
constexpr int VBSTART = 0x0f0;
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
m_screen->set_raw(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART);

View File

@ -6,6 +6,10 @@
Starship 1 Audio
***************************************************************************/
#ifndef MAME_ATARI_STARSHP1_A_H
#define MAME_ATARI_STARSHP1_A_H
#pragma once
#include "sound/discrete.h"
@ -24,3 +28,5 @@ Starship 1 Audio
DISCRETE_SOUND_EXTERN( starshp1_discrete );
#endif // MAME_ATARI_STARSHP1_A_H

View File

@ -6,6 +6,10 @@
Subs Audio
***************************************************************************/
#ifndef MAME_ATARI_SUBS_A_H
#define MAME_ATARI_SUBS_A_H
#pragma once
#include "sound/discrete.h"
@ -21,3 +25,5 @@ Subs Audio
DISCRETE_SOUND_EXTERN( subs_discrete );
#endif // MAME_ATARI_SUBS_A_H

View File

@ -6,6 +6,10 @@
Tank 8 Audio
***************************************************************************/
#ifndef MAME_ATARI_TANK8_A_H
#define MAME_ATARI_TANK8_A_H
#pragma once
#include "sound/discrete.h"
@ -28,3 +32,5 @@ Tank 8 Audio
DISCRETE_SOUND_EXTERN( tank8_discrete );
#endif // MAME_ATARI_TANK8_A_H

View File

@ -10,8 +10,6 @@
#include "triplhnt_a.h"
#include "sound/discrete.h"
const char *const triplhnt_sample_names[] =
{

View File

@ -6,6 +6,10 @@
Triple Hunt Audio
***************************************************************************/
#ifndef MAME_ATARI_TRIPLHNT_A_H
#define MAME_ATARI_TRIPLHNT_A_H
#pragma once
#include "sound/discrete.h"
@ -20,3 +24,5 @@ Triple Hunt Audio
DISCRETE_SOUND_EXTERN( triplhnt_discrete );
extern const char *const triplhnt_sample_names[];
#endif // MAME_ATARI_TRIPLHNT_A_H

View File

@ -6,6 +6,10 @@
Video Pinball Audio
***************************************************************************/
#ifndef MAME_ATARI_VIDEOPIN_A_H
#define MAME_ATARI_VIDEOPIN_A_H
#pragma once
#include "sound/discrete.h"
@ -20,3 +24,5 @@ Video Pinball Audio
DISCRETE_SOUND_EXTERN( videopin_discrete );
#endif // MAME_ATARI_VIDEOPIN_A_H

View File

@ -25,8 +25,8 @@
#include <string_view>
#include <utility>
#include <dinput.h>
#include <windows.h>
#include <dinput.h>
#include <wrl/client.h>

View File

@ -125,9 +125,12 @@ std::string osd_subst_env(std::string_view src)
HMODULE WINAPI GetModuleHandleUni()
{
MEMORY_BASIC_INFORMATION mbi;
VirtualQuery((LPCVOID)GetModuleHandleUni, &mbi, sizeof(mbi));
return (HMODULE)mbi.AllocationBase;
HMODULE result = nullptr;
BOOL const succeeded = GetModuleHandleEx(
GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT | GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS,
LPCWSTR(uintptr_t(&GetModuleHandleUni)),
&result);
return succeeded ? result : nullptr;
}