From 54048b3407d23af7959e4f94701aba7cb1119ad8 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Fri, 2 Oct 2020 02:42:28 +1000 Subject: -imagedev/cassimg.cpp: Make the interface look something like C++. -sound/tiasound.cpp: Use some vaguely C++-like code internally. --- src/lib/formats/h8_cas.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/lib/formats/h8_cas.cpp') diff --git a/src/lib/formats/h8_cas.cpp b/src/lib/formats/h8_cas.cpp index ec92a94b10f..80ad3e07f5a 100644 --- a/src/lib/formats/h8_cas.cpp +++ b/src/lib/formats/h8_cas.cpp @@ -11,17 +11,17 @@ We output a leader, followed by the contents of the H8T file. ********************************************************************/ -#include - #include "h8_cas.h" +#include + #define WAVEENTRY_LOW -32768 #define WAVEENTRY_HIGH 32767 #define H8_WAV_FREQUENCY 9600 // image size -static int h8_image_size; +static int h8_image_size; // FIXME: global variable prevents multiple instances static int h8_put_samples(int16_t *buffer, int sample_pos, int count, int level) { @@ -115,7 +115,7 @@ static int h8_cassette_calculate_size_in_samples(const uint8_t *bytes, int lengt return h8_handle_cassette(nullptr, bytes); } -static const struct CassetteLegacyWaveFiller h8_legacy_fill_wave = +static const cassette_image::LegacyWaveFiller h8_legacy_fill_wave = { h8_cassette_fill_wave, /* fill_wave */ -1, /* chunk_size */ @@ -126,17 +126,17 @@ static const struct CassetteLegacyWaveFiller h8_legacy_fill_wave = 0 /* trailer_samples */ }; -static cassette_image::error h8_cassette_identify(cassette_image *cassette, struct CassetteOptions *opts) +static cassette_image::error h8_cassette_identify(cassette_image *cassette, cassette_image::Options *opts) { - return cassette_legacy_identify(cassette, opts, &h8_legacy_fill_wave); + return cassette->legacy_identify(opts, &h8_legacy_fill_wave); } static cassette_image::error h8_cassette_load(cassette_image *cassette) { - return cassette_legacy_construct(cassette, &h8_legacy_fill_wave); + return cassette->legacy_construct(&h8_legacy_fill_wave); } -static const struct CassetteFormat h8_cassette_image_format = +static const cassette_image::Format h8_cassette_image_format = { "h8t", h8_cassette_identify, -- cgit v1.2.3-70-g09d2 angha3_drop'>shangha3_drop MAME - Multiple Arcade Machine Emulator
summaryrefslogtreecommitdiffstatshomepage
blob: 7a73e6a82a9f7bbbaaea8081697d85aee105eb61 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// license:BSD-3-Clause
// copyright-holders:Aaron Giles
//============================================================
//
//  main.c - Win32 main program
//
//============================================================

// standard windows headers
#ifdef OSD_SDL
#define _WIN32_WINNT 0x0400
#endif
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <tchar.h>
#include <stdlib.h>

// MAMEOS headers
#include "strconv.h"

extern int utf8_main(int argc, char *argv[]);



//============================================================
//  main
//============================================================

// undo the command-line #define that maps main to utf8_main in all other cases
#ifndef WINUI
#undef main
#undef wmain
#endif
#ifdef UNICODE
extern "C" int _tmain(int argc, TCHAR **argv)
{
	int i, rc;
	char **utf8_argv;

	/* convert arguments to UTF-8 */
	utf8_argv = (char **) malloc(argc * sizeof(*argv));
	if (utf8_argv == NULL)
		return 999;
	for (i = 0; i < argc; i++)
	{
		utf8_argv[i] = utf8_from_tstring(argv[i]);
		if (utf8_argv[i] == NULL)
			return 999;
	}

	/* run utf8_main */
	rc = utf8_main(argc, utf8_argv);

	/* free arguments */
	for (i = 0; i < argc; i++)
		osd_free(utf8_argv[i]);
	free(utf8_argv);

	return rc;
}
#endif