mirror of
https://github.com/holub/mame
synced 2025-07-04 17:38:08 +03:00
Make osdmini build again.
This commit is contained in:
parent
e4beed95a6
commit
f661970a4a
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -4196,6 +4196,7 @@ src/osd/osdmini/minimisc.c svneol=native#text/plain
|
||||
src/osd/osdmini/minisync.c svneol=native#text/plain
|
||||
src/osd/osdmini/minitime.c svneol=native#text/plain
|
||||
src/osd/osdmini/miniwork.c svneol=native#text/plain
|
||||
src/osd/osdmini/osdmini.h svneol=native#text/plain
|
||||
src/osd/osdmini/osdmini.mak svneol=native#text/plain
|
||||
src/osd/sdl/README_SDL13.txt svneol=native#text/plain
|
||||
src/osd/sdl/SDL1211_opengl.h svneol=native#text/plain
|
||||
|
@ -40,6 +40,7 @@
|
||||
//============================================================
|
||||
|
||||
#include "osdcore.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
|
||||
//============================================================
|
||||
@ -165,3 +166,55 @@ int osd_uchar_from_osdchar(UINT32 /* unicode_char */ *uchar, const char *osdchar
|
||||
*uchar = (UINT8)*osdchar;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
//============================================================
|
||||
// osd_stat
|
||||
//============================================================
|
||||
|
||||
osd_directory_entry *osd_stat(const char *path)
|
||||
{
|
||||
osd_directory_entry *result = NULL;
|
||||
|
||||
// create an osd_directory_entry; be sure to make sure that the caller can
|
||||
// free all resources by just freeing the resulting osd_directory_entry
|
||||
result = (osd_directory_entry *)malloc(sizeof(*result) + strlen(path) + 1);
|
||||
strcpy((char *)(result + 1), path);
|
||||
result->name = (char *)(result + 1);
|
||||
result->type = ENTTYPE_NONE;
|
||||
result->size = 0;
|
||||
|
||||
FILE *f = fopen(path, "rb");
|
||||
if (f != NULL)
|
||||
{
|
||||
fseek(f, 0, SEEK_END);
|
||||
result->type = ENTTYPE_FILE;
|
||||
result->size = ftell(f);
|
||||
fclose(f);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
//============================================================
|
||||
// osd_get_full_path
|
||||
//============================================================
|
||||
|
||||
file_error osd_get_full_path(char **dst, const char *path)
|
||||
{
|
||||
// derive the full path of the file in an allocated string
|
||||
// for now just fake it since we don't presume any underlying file system
|
||||
*dst = strdup(path);
|
||||
return FILERR_NONE;
|
||||
}
|
||||
|
||||
|
||||
//============================================================
|
||||
// osd_get_volume_name
|
||||
//============================================================
|
||||
|
||||
const char *osd_get_volume_name(int idx)
|
||||
{
|
||||
// we don't expose volumes
|
||||
return NULL;
|
||||
}
|
||||
|
@ -43,6 +43,7 @@
|
||||
#include "osdepend.h"
|
||||
#include "render.h"
|
||||
#include "clifront.h"
|
||||
#include "osdmini.h"
|
||||
|
||||
|
||||
//============================================================
|
||||
@ -94,7 +95,26 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
// cli_execute does the heavy lifting; if we have osd-specific options, we
|
||||
// would pass them as the third parameter here
|
||||
return cli_execute(argc, argv, NULL);
|
||||
mini_osd_interface osd;
|
||||
return cli_execute(argc, argv, osd, NULL);
|
||||
}
|
||||
|
||||
|
||||
//============================================================
|
||||
// constructor
|
||||
//============================================================
|
||||
|
||||
mini_osd_interface::mini_osd_interface()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//============================================================
|
||||
// destructor
|
||||
//============================================================
|
||||
|
||||
mini_osd_interface::~mini_osd_interface()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@ -147,20 +167,20 @@ void mini_osd_interface::update(bool skip_redraw)
|
||||
our_target->compute_minimum_size(minwidth, minheight);
|
||||
|
||||
// make that the size of our target
|
||||
our_target->render_target_set_bounds(minwidth, minheight);
|
||||
our_target->set_bounds(minwidth, minheight);
|
||||
|
||||
// get the list of primitives for the target at the current size
|
||||
const render_primitive_list *primlist = our_target->get_primitives();
|
||||
render_primitive_list &primlist = our_target->get_primitives();
|
||||
|
||||
// lock them, and then render them
|
||||
primlist->acquire_locK();
|
||||
primlist.acquire_lock();
|
||||
|
||||
// do the drawing here
|
||||
primlist->release_lock();
|
||||
primlist.release_lock();
|
||||
|
||||
// after 5 seconds, exit
|
||||
if (attotime_compare(timer_get_time(machine), attotime_make(5, 0)) > 0)
|
||||
machine->schedule_exit();
|
||||
if (attotime_compare(timer_get_time(&machine()), attotime_make(5, 0)) > 0)
|
||||
machine().schedule_exit();
|
||||
}
|
||||
|
||||
|
||||
|
@ -40,13 +40,14 @@
|
||||
//============================================================
|
||||
|
||||
#include "osdcore.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
|
||||
//============================================================
|
||||
// osd_alloc
|
||||
//============================================================
|
||||
|
||||
void *osd_alloc(size_t size)
|
||||
void *osd_malloc(size_t size)
|
||||
{
|
||||
return malloc(size);
|
||||
}
|
||||
@ -92,3 +93,15 @@ void osd_break_into_debugger(const char *message)
|
||||
{
|
||||
// there is no standard way to do this, so ignore it
|
||||
}
|
||||
|
||||
|
||||
//============================================================
|
||||
// osd_get_clipboard_text
|
||||
//============================================================
|
||||
|
||||
char *osd_get_clipboard_text(void)
|
||||
{
|
||||
// can't support clipboards generically
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -40,6 +40,7 @@
|
||||
//============================================================
|
||||
|
||||
#include "osdcore.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
|
||||
//============================================================
|
||||
@ -107,7 +108,7 @@ osd_work_item *osd_work_item_queue_multiple(osd_work_queue *queue, osd_work_call
|
||||
int itemnum;
|
||||
|
||||
// allocate memory to hold the result
|
||||
item = malloc(sizeof(*item));
|
||||
item = (osd_work_item *)malloc(sizeof(*item));
|
||||
if (item == NULL)
|
||||
return NULL;
|
||||
|
||||
|
98
src/osd/osdmini/osdmini.h
Normal file
98
src/osd/osdmini/osdmini.h
Normal file
@ -0,0 +1,98 @@
|
||||
//============================================================
|
||||
//
|
||||
// osdmini.h - Core header
|
||||
//
|
||||
//============================================================
|
||||
//
|
||||
// Copyright Aaron Giles
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or
|
||||
// without modification, are permitted provided that the
|
||||
// following conditions are met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above
|
||||
// copyright notice, this list of conditions and the
|
||||
// following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the
|
||||
// above copyright notice, this list of conditions and
|
||||
// the following disclaimer in the documentation and/or
|
||||
// other materials provided with the distribution.
|
||||
// * Neither the name 'MAME' nor the names of its
|
||||
// contributors may be used to endorse or promote
|
||||
// products derived from this software without specific
|
||||
// prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND
|
||||
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
// FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
// EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
|
||||
// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
// DAMAGE (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
// IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
//============================================================
|
||||
|
||||
#include "options.h"
|
||||
#include "osdepend.h"
|
||||
|
||||
|
||||
//============================================================
|
||||
// TYPE DEFINITIONS
|
||||
//============================================================
|
||||
|
||||
class mini_osd_interface : public osd_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
mini_osd_interface();
|
||||
virtual ~mini_osd_interface();
|
||||
|
||||
// general overridables
|
||||
virtual void init(running_machine &machine);
|
||||
virtual void update(bool skip_redraw);
|
||||
|
||||
// debugger overridables
|
||||
// virtual void init_debugger();
|
||||
// virtual void wait_for_debugger(device_t &device, bool firststop);
|
||||
|
||||
// audio overridables
|
||||
virtual void update_audio_stream(const INT16 *buffer, int samples_this_frame);
|
||||
virtual void set_mastervolume(int attenuation);
|
||||
|
||||
// input overridables
|
||||
virtual void customize_input_type_list(input_type_desc *typelist);
|
||||
|
||||
private:
|
||||
static void osd_exit(running_machine &machine);
|
||||
};
|
||||
|
||||
|
||||
|
||||
//============================================================
|
||||
// GLOBAL VARIABLES
|
||||
//============================================================
|
||||
|
||||
extern const options_entry mame_win_options[];
|
||||
|
||||
// defined in winwork.c
|
||||
extern int osd_num_processors;
|
||||
|
||||
|
||||
|
||||
//============================================================
|
||||
// FUNCTION PROTOTYPES
|
||||
//============================================================
|
||||
|
||||
// use if you want to print something with the verbose flag
|
||||
void CLIB_DECL mame_printf_verbose(const char *text, ...) ATTR_PRINTF(1,2);
|
||||
|
||||
// use this to ping the watchdog
|
||||
void winmain_watchdog_ping(void);
|
||||
void winmain_dump_stack();
|
Loading…
Reference in New Issue
Block a user