Skip to content

Commit

Permalink
Merge tag 'mame0233' into rel233
Browse files Browse the repository at this point in the history
MAME 0.233
  • Loading branch information
mahlemiut committed Jul 1, 2021
2 parents eaa65a3 + 05d0cf6 commit 7a9788e
Show file tree
Hide file tree
Showing 9 changed files with 127 additions and 94 deletions.
4 changes: 2 additions & 2 deletions android-project/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.mamedev.mame"
android:versionCode="232"
android:versionName="0.232"
android:versionCode="233"
android:versionName="0.233"
android:installLocation="auto">

<!-- OpenGL ES 2.0 -->
Expand Down
2 changes: 1 addition & 1 deletion hash/ibm5150.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5180,7 +5180,7 @@ Known PC Booter Games Not Dumped, Or Dumped and Lost when Demonlord's Site went
</software>

<software name="freedos13rc4_720">
<description>FreeDOS 1.3 Release Candidate 4 (Floppy-Only Edition, 3.5" 720k)</description>
<description>FreeDOS 1.3 Release Candidate 4 (Floppy-Only Edition, 3.5" 720k)</description>
<year>2021</year>
<publisher>The FreeDOS Project</publisher>
<info name="version" value="1.3-RC4"/>
Expand Down
4 changes: 2 additions & 2 deletions hash/ibm5170.xml
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ license:CC0
</software>

<software name="freedos13rc4_120" cloneof="freedos13rc4">
<description>FreeDOS 1.3 Release Candidate 4 (Floppy-Only Edition, 5.25" 1.2mb)</description>
<description>FreeDOS 1.3 Release Candidate 4 (Floppy-Only Edition, 5.25" 1.2MB)</description>
<year>2021</year>
<publisher>The FreeDOS Project</publisher>
<info name="version" value="1.3-RC4"/>
Expand Down Expand Up @@ -755,7 +755,7 @@ license:CC0
</software>

<software name="freedos13rc4_144" cloneof="freedos13rc4">
<description>FreeDOS 1.3 Release Candidate 4 (Floppy-Only Edition, 3.5" 1.44m)</description>
<description>FreeDOS 1.3 Release Candidate 4 (Floppy-Only Edition, 3.5" 1.44MB)</description>
<year>2021</year>
<publisher>The FreeDOS Project</publisher>
<info name="version" value="1.3-RC4"/>
Expand Down
2 changes: 1 addition & 1 deletion hash/spectrum_cass.xml
Original file line number Diff line number Diff line change
Expand Up @@ -137183,7 +137183,7 @@ license:CC0
</software>

<software name="uchimatab" cloneof="uchimata">
<description>Uchi-Mata (IBSA/Erbe, serie leyenda)</description>
<description>Uchi-Mata (IBSA/Erbe, Serie Leyenda)</description>
<year>1988</year>
<publisher>IBSA/Erbe Software</publisher>
<part name="cass" interface="spectrum_cass">
Expand Down
4 changes: 2 additions & 2 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1760,14 +1760,14 @@ endif

ifeq (posix,$(SHELLTYPE))
$(GENDIR)/version.cpp: makefile $(GENDIR)/git_desc | $(GEN_FOLDERS)
@echo '#define BARE_BUILD_VERSION "0.232"' > $@
@echo '#define BARE_BUILD_VERSION "0.233"' > $@
@echo 'extern const char bare_build_version[];' >> $@
@echo 'extern const char build_version[];' >> $@
@echo 'const char bare_build_version[] = BARE_BUILD_VERSION;' >> $@
@echo 'const char build_version[] = BARE_BUILD_VERSION "W ($(NEW_GIT_VERSION))";' >> $@
else
$(GENDIR)/version.cpp: makefile $(GENDIR)/git_desc | $(GEN_FOLDERS)
@echo #define BARE_BUILD_VERSION "0.232" > $@
@echo #define BARE_BUILD_VERSION "0.233" > $@
@echo extern const char bare_build_version[]; >> $@
@echo extern const char build_version[]; >> $@
@echo const char bare_build_version[] = BARE_BUILD_VERSION; >> $@
Expand Down
1 change: 1 addition & 0 deletions scripts/target/mame/mess.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1899,6 +1899,7 @@ files {
MAME_DIR .. "src/mame/machine/lynx.cpp",
MAME_DIR .. "src/mame/drivers/pofo.cpp",
MAME_DIR .. "src/mame/machine/pofo_kbd.cpp",
MAME_DIR .. "src/mame/machine/pofo_kbd.h",
MAME_DIR .. "src/mame/drivers/tvboy.cpp",
}

Expand Down
160 changes: 90 additions & 70 deletions src/emu/rendutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
#include "jpeglib.h"
#include "jerror.h"

#include <csetjmp>
#include <cstdlib>


namespace {

Expand Down Expand Up @@ -113,6 +116,18 @@ void jpeg_corefile_source::source(j_decompress_ptr cinfo, util::core_file &file)
src->next_input_byte = nullptr;
}


struct jpeg_setjmp_error_mgr : public jpeg_error_mgr
{
jpeg_setjmp_error_mgr()
{
jpeg_std_error(this);
error_exit = [] (j_common_ptr cinfo) { std::longjmp(static_cast<jpeg_setjmp_error_mgr *>(cinfo->err)->m_jump_buffer, 1); };
}

std::jmp_buf m_jump_buffer;
};

} // anonymous namespace


Expand Down Expand Up @@ -672,73 +687,74 @@ void render_load_jpeg(bitmap_argb32 &bitmap, util::core_file &file)
// deallocate previous bitmap
bitmap.reset();

// create a JPEG source for the file
// set up context for error handling
jpeg_decompress_struct cinfo;
jpeg_error_mgr jerr;
cinfo.err = jpeg_std_error(&jerr);
jerr.error_exit = [] (j_common_ptr cinfo) { throw cinfo->err; };
jpeg_setjmp_error_mgr jerr;
cinfo.err = &jerr;
JSAMPARRAY buffer = nullptr;
try
int w, h, s, row_stride, j, i;
if (setjmp(jerr.m_jump_buffer)) // setjmp must be used in control expression
{
jpeg_create_decompress(&cinfo);
cinfo.mem->max_memory_to_use = 128 * 1024 * 1024;
jpeg_corefile_source::source(&cinfo, file);

// read JPEG header and start decompression
jpeg_read_header(&cinfo, TRUE);
jpeg_start_decompress(&cinfo);

// allocates the destination bitmap
int w = cinfo.output_width;
int h = cinfo.output_height;
int s = cinfo.output_components;
bitmap.allocate(w, h);
char msg[1024];
(cinfo.err->format_message)(reinterpret_cast<j_common_ptr>(&cinfo), msg);
osd_printf_error("JPEG error reading data from file: %s\n", msg);
bitmap.reset();
goto cleanup; // use goto to ensure longjmp can't cross an initialisation
}

// allocates a buffer to receive the information and copy them into the bitmap
int row_stride = cinfo.output_width * cinfo.output_components;
JSAMPARRAY buffer = reinterpret_cast<JSAMPARRAY>(malloc(sizeof(JSAMPROW)));
buffer[0] = reinterpret_cast<JSAMPROW>(malloc(sizeof(JSAMPLE) * row_stride));
// create a JPEG source for the file
jpeg_create_decompress(&cinfo);
cinfo.mem->max_memory_to_use = 128 * 1024 * 1024;
jpeg_corefile_source::source(&cinfo, file);

// read JPEG header and start decompression
jpeg_read_header(&cinfo, TRUE);
jpeg_start_decompress(&cinfo);

// allocates the destination bitmap
w = cinfo.output_width;
h = cinfo.output_height;
s = cinfo.output_components;
bitmap.allocate(w, h);

// allocates a buffer to receive the information and copy them into the bitmap
row_stride = cinfo.output_width * cinfo.output_components;
buffer = reinterpret_cast<JSAMPARRAY>(std::malloc(sizeof(JSAMPROW)));
buffer[0] = reinterpret_cast<JSAMPROW>(std::malloc(sizeof(JSAMPLE) * row_stride));

while (cinfo.output_scanline < cinfo.output_height)
{
j = cinfo.output_scanline;
jpeg_read_scanlines(&cinfo, buffer, 1);

while (cinfo.output_scanline < cinfo.output_height)
if (s == 1)
{
int j = cinfo.output_scanline;
jpeg_read_scanlines(&cinfo, buffer, 1);

if (s == 1)
{
for (int i = 0; i < w; ++i)
bitmap.pix(j, i) = rgb_t(0xFF, buffer[0][i], buffer[0][i], buffer[0][i]);
for (i = 0; i < w; ++i)
bitmap.pix(j, i) = rgb_t(0xff, buffer[0][i], buffer[0][i], buffer[0][i]);

}
else if (s == 3)
{
for (int i = 0; i < w; ++i)
bitmap.pix(j, i) = rgb_t(0xFF, buffer[0][i * s], buffer[0][i * s + 1], buffer[0][i * s + 2]);
}
else
{
osd_printf_error("Cannot read JPEG data from file.\n");
bitmap.reset();
break;
}
}

// finish decompression and frees the memory
jpeg_finish_decompress(&cinfo);
}
catch (jpeg_error_mgr *)
{
char msg[1024];
(cinfo.err->format_message)(reinterpret_cast<j_common_ptr>(&cinfo), msg);
osd_printf_error("JPEG error reading data from file: %s\n", msg);
bitmap.reset();
else if (s == 3)
{
for (i = 0; i < w; ++i)
bitmap.pix(j, i) = rgb_t(0xff, buffer[0][i * s], buffer[0][i * s + 1], buffer[0][i * s + 2]);
}
else
{
osd_printf_error("Cannot read JPEG data from file.\n");
bitmap.reset();
break;
}
}

// finish decompression and free the memory
jpeg_finish_decompress(&cinfo);
cleanup:
jpeg_destroy_decompress(&cinfo);
if (buffer)
{
if (buffer[0])
free(buffer[0]);
free(buffer);
std::free(buffer[0]);
std::free(buffer);
}
}

Expand Down Expand Up @@ -917,37 +933,41 @@ static bool copy_png_alpha_to_bitmap(bitmap_argb32 &bitmap, const util::png_info
ru_imgformat render_detect_image(util::core_file &file)
{
// PNG: check for valid header
util::png_error const png = util::png_info::verify_header(file);
file.seek(0, SEEK_SET);
if (util::png_error::NONE == png)
return RENDUTIL_IMGFORMAT_PNG;
{
util::png_error const png = util::png_info::verify_header(file);
file.seek(0, SEEK_SET);
if (util::png_error::NONE == png)
return RENDUTIL_IMGFORMAT_PNG;
}

// JPEG: attempt to read header with libjpeg
jpeg_decompress_struct cinfo;
jpeg_error_mgr jerr;
cinfo.err = jpeg_std_error(&jerr);
jerr.error_exit = [] (j_common_ptr cinfo) { throw cinfo->err; };
try
{
jpeg_decompress_struct cinfo;
jpeg_setjmp_error_mgr jerr;
cinfo.err = &jerr;
if (setjmp(jerr.m_jump_buffer)) // setjmp must be used in control expression
goto notjpeg; // use goto to ensure longjmp can't cross an initialisation

jpeg_create_decompress(&cinfo);
cinfo.mem->max_memory_to_use = 128 * 1024 * 1024;
jpeg_corefile_source::source(&cinfo, file);
jpeg_read_header(&cinfo, TRUE);
jpeg_destroy_decompress(&cinfo);
file.seek(0, SEEK_SET);
return RENDUTIL_IMGFORMAT_JPEG;
}
catch (jpeg_error_mgr *)
{

notjpeg:
jpeg_destroy_decompress(&cinfo);
file.seek(0, SEEK_SET);
}

// Microsoft DIB: check for valid header
util::msdib_error const msdib = util::msdib_verify_header(file);
file.seek(0, SEEK_SET);
if (util::msdib_error::NONE == msdib)
return RENDUTIL_IMGFORMAT_MSDIB;
{
util::msdib_error const msdib = util::msdib_verify_header(file);
file.seek(0, SEEK_SET);
if (util::msdib_error::NONE == msdib)
return RENDUTIL_IMGFORMAT_MSDIB;
}

// TODO: add more as necessary
return RENDUTIL_IMGFORMAT_UNKNOWN;
Expand Down
32 changes: 16 additions & 16 deletions src/mame/drivers/chanbara.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,24 +291,24 @@ static INPUT_PORTS_START( chanbara )
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")

PORT_START ("P1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_UP )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_LEFT )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_RIGHT )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_DOWN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_UP )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_LEFT )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_RIGHT )
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_DOWN ) PORT_4WAY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_UP ) PORT_4WAY
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_LEFT ) PORT_4WAY
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_RIGHT ) PORT_4WAY
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN ) PORT_4WAY
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_UP ) PORT_4WAY
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_LEFT ) PORT_4WAY
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_RIGHT ) PORT_4WAY

PORT_START ("P2")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN ) PORT_COCKTAIL
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_UP ) PORT_COCKTAIL
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_LEFT ) PORT_COCKTAIL
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_RIGHT ) PORT_COCKTAIL
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_DOWN ) PORT_COCKTAIL
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_UP ) PORT_COCKTAIL
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_LEFT ) PORT_COCKTAIL
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_RIGHT ) PORT_COCKTAIL
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_DOWN ) PORT_4WAY PORT_COCKTAIL
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_UP ) PORT_4WAY PORT_COCKTAIL
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_LEFT ) PORT_4WAY PORT_COCKTAIL
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_RIGHT ) PORT_4WAY PORT_COCKTAIL
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN ) PORT_4WAY PORT_COCKTAIL
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_UP ) PORT_4WAY PORT_COCKTAIL
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_LEFT ) PORT_4WAY PORT_COCKTAIL
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_RIGHT ) PORT_4WAY PORT_COCKTAIL
INPUT_PORTS_END

/***************************************************************************/
Expand Down
12 changes: 12 additions & 0 deletions src/mame/drivers/playmark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,18 @@ static INPUT_PORTS_START( bigtwinb )
PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW2:3") // No nudes, No Censor dipswitch
PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )

PORT_MODIFY("P1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)

PORT_MODIFY("P2")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
INPUT_PORTS_END

static INPUT_PORTS_START( wbeachvl )
Expand Down

0 comments on commit 7a9788e

Please sign in to comment.