make gdrom's REQ_SES honor size parameter

added assert if FPU exceptions are enabled
disabled -Wformat-truncation
This commit is contained in:
Anthony Pesch 2017-11-19 10:22:32 -05:00
parent 9f349b45f5
commit cf166a4cc5
8 changed files with 15 additions and 15 deletions

View File

@ -305,11 +305,22 @@ if(COMPILER_MSVC)
list(APPEND RELIB_FLAGS -D_SCL_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -DWIN32_LEAN_AND_MEAN -DNOMINMAX /GR- /W3 /WX /wd4100 /wd4127 /wd4505 /wd4512 /wd4800 /wd4351)
elseif(COMPILER_GCC OR COMPILER_CLANG)
list(APPEND RELIB_FLAGS -fms-extensions -Wall -Wextra -Werror -Wno-unused-function -Wno-unused-parameter -Wno-unused-variable -Wno-strict-aliasing -D_GNU_SOURCE)
list(APPEND RELIB_FLAGS
# used for unnamed structure fields
-fms-extensions
# enable most errors
-Wall -Wextra -Werror
# lax some of these common development warnings
-Wno-unused-function -Wno-unused-parameter -Wno-unused-variable -Wno-strict-aliasing
-D_GNU_SOURCE)
if(COMPILER_GCC)
list(APPEND RELIB_DEFS COMPILER_GCC=1)
# -format-truncation is too aggressive with snprintfs that are purposefully supposed
# to truncate on overflow
list(APPEND RELIB_FLAGS -Wno-format-truncation)
# some flavors of gcc require this to be defined for the PR* macros in inttypes.h
list(APPEND RELIB_FLAGS -D__STDC_FORMAT_MACROS)
elseif(COMPILER_CLANG)

View File

@ -181,9 +181,6 @@ void arm7_suspend(struct arm7 *arm) {
static void arm7_run(struct device *dev, int64_t ns) {
struct arm7 *arm = (struct arm7 *)dev;
struct armv3_context *ctx = &arm->ctx;
struct jit *jit = arm->jit;
static int64_t ARM7_CLOCK_FREQ = INT64_C(20000000);
int cycles = (int)NANO_TO_CYCLES(ns, ARM7_CLOCK_FREQ);
@ -232,7 +229,6 @@ static struct jit_guest *arm7_guest_create(struct arm7 *arm) {
static int arm7_init(struct device *dev) {
struct arm7 *arm = (struct arm7 *)dev;
struct dreamcast *dc = arm->dc;
/* initialize jit */
arm->guest = arm7_guest_create(arm);

View File

@ -67,7 +67,6 @@ static uint32_t bios_local_time() {
static void bios_override_settings(struct bios *bios) {
struct dreamcast *dc = bios->dc;
struct flash *flash = dc->flash;
struct gdrom *gd = dc->gdrom;
int region = 0;
int lang = 0;

View File

@ -92,9 +92,6 @@ enum {
static uint32_t bios_gdrom_send_cmd(struct bios *bios, uint32_t cmd_code,
uint32_t params) {
struct dreamcast *dc = bios->dc;
struct gdrom *gd = dc->gdrom;
struct holly *hl = dc->holly;
struct sh4 *sh4 = dc->sh4;
if (bios->status != GDC_STATUS_NONE) {
return 0;
@ -123,8 +120,6 @@ static uint32_t bios_gdrom_send_cmd(struct bios *bios, uint32_t cmd_code,
static void bios_gdrom_mainloop(struct bios *bios) {
struct dreamcast *dc = bios->dc;
struct gdrom *gd = dc->gdrom;
struct holly *hl = dc->holly;
struct sh4_context *ctx = &dc->sh4->ctx;
if (bios->status != GDC_STATUS_ACTIVE) {
return;

View File

@ -429,7 +429,7 @@ static void gdrom_spi_cmd(struct gdrom *gd, int arg) {
out[4] = (ses.fad & 0x0000ff00) >> 8;
out[5] = (ses.fad & 0x000000ff);
gdrom_spi_write(gd, out, sizeof(out));
gdrom_spi_write(gd, out, size);
} break;
case GD_SPI_GET_SCD: {

View File

@ -24,8 +24,6 @@ static void maple_unregister_dev(struct maple *mp, int port, int unit) {
static void maple_register_dev(struct maple *mp, const char *device_type,
int port, int unit) {
struct dreamcast *dc = mp->dc;
CHECK(!mp->devs[port][unit],
"maple_register_dev already registered for port=%d unit=%d", port,
unit);

View File

@ -751,7 +751,6 @@ void ta_texture_write(struct ta *ta, uint32_t dst, const uint8_t *src,
void ta_yuv_write(struct ta *ta, uint32_t dst, const uint8_t *src, int size) {
struct holly *hl = ta->dc->holly;
struct pvr *pvr = ta->dc->pvr;
CHECK(*hl->SB_LMMODE0 == 0);
CHECK(size % ta->yuv_macroblock_size == 0);

View File

@ -50,6 +50,8 @@ static void sh4_sr_updated(struct sh4 *sh4, uint32_t old_sr) {
static void sh4_fpscr_updated(struct sh4 *sh4, uint32_t old_fpscr) {
struct sh4_context *ctx = &sh4->ctx;
CHECK(!(ctx->fpscr & ENABLE_MASK), "FPU exceptions aren't supported");
if ((ctx->fpscr & FR_MASK) != (old_fpscr & FR_MASK)) {
sh4_swap_fpr_bank(ctx);
}