src/osd/sdl/os2work.c
| r1805 | r1806 | |
| 178 | 178 | |
| 179 | 179 | |
| 180 | 180 | INLINE INT32 scalable_lock_acquire(scalable_lock *lock) |
| 181 | | |
| 181 | { |
| 182 | 182 | INT32 myslot = (atomic_increment32(&lock->nextindex) - 1) & (WORK_MAX_THREADS - 1); |
| 183 | 183 | |
| 184 | 184 | #if defined(__i386__) || defined(__x86_64__) |
| r1805 | r1806 | |
| 511 | 511 | // osd_Twork_item_queue_multiple |
| 512 | 512 | //============================================================ |
| 513 | 513 | |
| 514 | | osd_work_item *osd_work_item_queue_multiple(osd_work_queue *queue, osd_work_callback callback, INT32 numitems, void |
| 515 | | parambase, INT32 paramstep, UINT32 flags) |
| 514 | osd_work_item *osd_work_item_queue_multiple(osd_work_queue *queue, osd_work_callback callback, INT32 numitems, void *parambase, INT32 paramstep, UINT32 flags) |
| 516 | 515 | { |
| 517 | 516 | osd_work_item *itemlist = NULL; |
| 518 | 517 | osd_work_item **item_tailptr = &itemlist; |
| r1805 | r1806 | |
| 750 | 749 | // worker_thread_process |
| 751 | 750 | //============================================================ |
| 752 | 751 | |
| 753 | | static int execute_work_item(osd_work_item *item) |
| 752 | static void worker_thread_process(osd_work_queue *queue, work_thread_info *thread) |
| 754 | 753 | { |
| 755 | 754 | int threadid = thread - queue->thread; |
| 756 | 755 | |
src/osd/sdl/sound.c
| r1805 | r1806 | |
| 25 | 25 | #include "window.h" |
| 26 | 26 | #include "video.h" |
| 27 | 27 | #include "osdsdl.h" |
| 28 | | #include "deprecat.h" |
| 29 | 28 | |
| 30 | 29 | //============================================================ |
| 31 | 30 | // DEBUGGING |
| r1805 | r1806 | |
| 278 | 277 | // osd_update_audio_stream |
| 279 | 278 | //============================================================ |
| 280 | 279 | |
| 281 | | void osd_update_audio_stream(INT16 *buffer, int samples_this_frame) |
| 280 | void osd_update_audio_stream(running_machine *machine, INT16 *buffer, int samples_this_frame) |
| 282 | 281 | { |
| 283 | 282 | // if nothing to do, don't do it |
| 284 | | if (Machine->sample_rate != 0 && stream_buffer) |
| 283 | if (machine->sample_rate != 0 && stream_buffer) |
| 285 | 284 | { |
| 286 | 285 | int bytes_this_frame = samples_this_frame * sizeof(INT16) * 2; |
| 287 | 286 | int play_position, write_position, orig_write, stream_in; |
| 288 | 287 | |
| 289 | 288 | play_position = stream_playpos; |
| 290 | 289 | |
| 291 | | write_position = stream_playpos + ((Machine->sample_rate / 50) * sizeof(INT16) * 2); |
| 290 | write_position = stream_playpos + ((machine->sample_rate / 50) * sizeof(INT16) * 2); |
| 292 | 291 | orig_write = write_position; |
| 293 | 292 | |
| 294 | 293 | if (!stream_in_initialized) |
makefile.sdl
| r1805 | r1806 | |
| 1 | 1 | ########################################################################### |
| 2 | 2 | # |
| 3 | | # makefile.sdl |
| 3 | # makefile |
| 4 | 4 | # |
| 5 | | # Core makefile for building SDLMAME and derivatives |
| 5 | # Core makefile for building MAME and derivatives |
| 6 | 6 | # |
| 7 | | # Copyright (c) 1996-2007, Nicola Salmoria and the MAME Team. |
| 7 | # Copyright (c) Nicola Salmoria and the MAME Team. |
| 8 | 8 | # Visit http://mamedev.org for licensing and usage restrictions. |
| 9 | 9 | # |
| 10 | | # SDLMAME/MESS by Olivier Galibert and R. Belmont |
| 11 | | # |
| 12 | 10 | ########################################################################### |
| 13 | 11 | |
| 14 | 12 | |
| r1805 | r1806 | |
| 45 | 43 | OSD = sdl |
| 46 | 44 | endif |
| 47 | 45 | |
| 46 | ifndef CROSS_BUILD_OSD |
| 47 | CROSS_BUILD_OSD = $(OSD) |
| 48 | endif |
| 48 | 49 | |
| 49 | | |
| 50 | 50 | #------------------------------------------------- |
| 51 | 51 | # specify OS target, which further differentiates |
| 52 | 52 | # the underlying OS; supported values are: |
| r1805 | r1806 | |
| 98 | 98 | # uncomment next line to enable the debugger |
| 99 | 99 | # DEBUGGER = 1 |
| 100 | 100 | |
| 101 | | # uncomment next line to include the debugger |
| 101 | # uncomment next line to build a debug version |
| 102 | 102 | # DEBUG = 1 |
| 103 | 103 | |
| 104 | 104 | # uncomment next line to include the internal profiler |
| r1805 | r1806 | |
| 110 | 110 | # uncomment next line to use DRC PowerPC engine |
| 111 | 111 | X86_PPC_DRC = 1 |
| 112 | 112 | |
| 113 | | # uncomment next line to use DRC Voodoo rasterizers |
| 114 | | # X86_VOODOO_DRC = 1 |
| 113 | # uncomment next line to build using unix-style libsdl on Mac OS X |
| 114 | # (vs. the native framework port). Normal users should not enable this. |
| 115 | # MACOSX_USE_LIBSDL = 1 |
| 115 | 116 | |
| 116 | 117 | |
| 117 | | |
| 118 | 118 | #------------------------------------------------- |
| 119 | 119 | # specify build options; see each option below |
| 120 | 120 | # for details |
| r1805 | r1806 | |
| 192 | 192 | EXE = .exe |
| 193 | 193 | endif |
| 194 | 194 | |
| 195 | ifndef BUILD_EXE |
| 196 | BUILD_EXE = $(EXE) |
| 197 | endif |
| 198 | |
| 195 | 199 | # compiler, linker and utilities |
| 196 | 200 | AR = @ar |
| 197 | 201 | CC = @gcc |
| 198 | 202 | LD = @gcc |
| 199 | | HHC = @-hhc |
| 200 | 203 | MD = -mkdir$(EXE) |
| 201 | 204 | RM = @rm -f |
| 202 | 205 | |
| r1805 | r1806 | |
| 206 | 209 | # form the name of the executable |
| 207 | 210 | #------------------------------------------------- |
| 208 | 211 | |
| 209 | | # debug builds just get the 'd' suffix and nothing more |
| 212 | # debugger builds just get the 'd' suffix and nothing more |
| 210 | 213 | ifdef DEBUGGER |
| 211 | 214 | DEBUGSUFFIX = d |
| 212 | 215 | endif |
| r1805 | r1806 | |
| 283 | 286 | DEFS += -DMAME_PROFILER |
| 284 | 287 | endif |
| 285 | 288 | |
| 286 | | # define VOODOO_DRC if we are building the DRC Voodoo engine |
| 287 | | ifdef X86_VOODOO_DRC |
| 288 | | DEFS += -DVOODOO_DRC |
| 289 | | endif |
| 290 | 289 | |
| 291 | 290 | |
| 292 | | |
| 293 | 291 | #------------------------------------------------- |
| 294 | 292 | # compile flags |
| 295 | 293 | #------------------------------------------------- |
| r1805 | r1806 | |
| 332 | 330 | # if we are optimizing, include optimization options |
| 333 | 331 | # and make all errors into warnings |
| 334 | 332 | ifneq ($(OPTIMIZE),0) |
| 335 | | #CFLAGS += -Werror $(ARCHOPTS) -fno-strict-aliasing |
| 336 | 333 | CFLAGS += $(ARCHOPTS) -fno-strict-aliasing |
| 334 | ifneq ($(TARGETOS),os2) |
| 335 | CFLAGS += -Werror |
| 337 | 336 | endif |
| 337 | endif |
| 338 | 338 | |
| 339 | 339 | # if symbols are on, make sure we have frame pointers |
| 340 | 340 | ifdef SYMBOLS |
| r1805 | r1806 | |
| 367 | 367 | |
| 368 | 368 | # LDFLAGS are used generally; LDFLAGSEMULATOR are additional |
| 369 | 369 | # flags only used when linking the core emulator |
| 370 | LDFLAGS = |
| 370 | 371 | ifneq ($(TARGETOS),macosx) |
| 372 | ifneq ($(TARGETOS),os2) |
| 371 | 373 | LDFLAGS = -Wl,--warn-common |
| 372 | | else |
| 373 | | LDFLAGS= |
| 374 | 374 | endif |
| 375 | endif |
| 375 | 376 | LDFLAGSEMULATOR = |
| 376 | 377 | |
| 377 | 378 | # add profiling information for the linker |
| r1805 | r1806 | |
| 419 | 420 | LIBSOUND = $(OBJ)/libsound.a |
| 420 | 421 | LIBUTIL = $(OBJ)/libutil.a |
| 421 | 422 | LIBOCORE = $(OBJ)/libocore.a |
| 422 | | LIBOCORE_NOMAIN = $(OBJ)/libocore_nomain.a |
| 423 | 423 | LIBOSD = $(OBJ)/libosd.a |
| 424 | 424 | |
| 425 | 425 | VERSIONOBJ = $(OBJ)/version.o |
| r1805 | r1806 | |
| 462 | 462 | all: maketree buildtools emulator tools |
| 463 | 463 | |
| 464 | 464 | |
| 465 | #------------------------------------------------- |
| 466 | # defines needed by multiple make files |
| 467 | #------------------------------------------------- |
| 465 | 468 | |
| 469 | BUILDSRC = $(SRC)/build |
| 470 | BUILDOBJ = $(OBJ)/build |
| 471 | BUILDOUT = $(BUILDOBJ) |
| 472 | |
| 473 | |
| 466 | 474 | #------------------------------------------------- |
| 467 | 475 | # include the various .mak files |
| 468 | 476 | #------------------------------------------------- |
| r1805 | r1806 | |
| 475 | 483 | include $(SRC)/emu/emu.mak |
| 476 | 484 | include $(SRC)/lib/lib.mak |
| 477 | 485 | include $(SRC)/build/build.mak |
| 486 | -include $(SRC)/osd/$(CROSS_BUILD_OSD)/build.mak |
| 478 | 487 | include $(SRC)/tools/tools.mak |
| 479 | 488 | |
| 480 | 489 | # combine the various definitions to one |
| r1805 | r1806 | |
| 492 | 501 | |
| 493 | 502 | tools: maketree $(TOOLS) |
| 494 | 503 | |
| 495 | | help: maketree $(HELP) |
| 496 | | |
| 497 | 504 | maketree: $(sort $(OBJDIRS)) |
| 498 | 505 | |
| 499 | 506 | clean: |
| r1805 | r1806 | |
| 533 | 540 | |
| 534 | 541 | endif |
| 535 | 542 | |
| 536 | | |
| 537 | | |
| 538 | 543 | #------------------------------------------------- |
| 539 | 544 | # generic rules |
| 540 | 545 | #------------------------------------------------- |