Skip to content
This repository has been archived by the owner on Jul 10, 2023. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'origin/master' into vmemstuff2
Browse files Browse the repository at this point in the history
  • Loading branch information
davidgfnet committed May 11, 2019
2 parents b74db6e + ec97068 commit 555b39b
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 82 deletions.
18 changes: 10 additions & 8 deletions core/hw/pvr/Renderer_if.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ TA_context* _pvrrc;
void SetREP(TA_context* cntx);
void killtex();
bool render_output_framebuffer();
static void rend_create_renderer();

void dump_frame(const char* file, TA_context* ctx, u8* vram, u8* vram_ref = NULL) {
FILE* fw = fopen(file, "wb");
Expand Down Expand Up @@ -266,6 +267,13 @@ bool rend_frame(TA_context* ctx, bool draw_osd) {

bool rend_single_frame()
{
if (renderer_changed)
{
renderer_changed = false;
rend_term_renderer();
rend_create_renderer();
rend_init_renderer();
}
//wait render start only if no frame pending
do
{
Expand Down Expand Up @@ -362,6 +370,7 @@ void rend_init_renderer()
}
printf("Selected renderer initialization failed. Falling back to default renderer.\n");
renderer = fallback_renderer;
fallback_renderer = NULL; // avoid double-free
}
}

Expand All @@ -377,7 +386,6 @@ void rend_term_renderer()
delete fallback_renderer;
fallback_renderer = NULL;
}
tactx_Term();
}

void* rend_thread(void* p)
Expand All @@ -391,13 +399,6 @@ void* rend_thread(void* p)
{
if (rend_single_frame())
renderer->Present();
if (renderer_changed)
{
renderer_changed = false;
rend_term_renderer();
rend_create_renderer();
rend_init_renderer();
}
}

rend_term_renderer();
Expand Down Expand Up @@ -538,6 +539,7 @@ void rend_end_render()
void rend_stop_renderer()
{
renderer_enabled = false;
tactx_Term();
}

void rend_vblank()
Expand Down
13 changes: 10 additions & 3 deletions core/linux-dist/x11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,11 @@ void input_x11_init()
printf("X11 Keyboard input disabled by config.\n");
}

static int x11_error_handler(Display *, XErrorEvent *)
{
return 0;
}

void x11_window_create()
{
if (cfgLoadInt("pvr", "nox11", 0) == 0)
Expand Down Expand Up @@ -519,20 +524,22 @@ void x11_window_create()
GLX_CONTEXT_PROFILE_MASK_ARB, GLX_CONTEXT_CORE_PROFILE_BIT_ARB,
None
};
int (*old_handler)(Display *, XErrorEvent *) = XSetErrorHandler(&x11_error_handler);

x11_glc = glXCreateContextAttribsARB(x11Display, bestFbc, 0, True, context_attribs);
if (!x11_glc)
{
printf("Open GL 4.3 not supported\n");
// Try GL 3.1
// Try GL 3.0
context_attribs[1] = 3;
context_attribs[3] = 1;
context_attribs[3] = 0;
x11_glc = glXCreateContextAttribsARB(x11Display, bestFbc, 0, True, context_attribs);
if (!x11_glc)
{
die("Open GL 3.1 not supported\n");
die("Open GL 3.0 not supported\n");
}
}
XSetErrorHandler(old_handler);
XSync(x11Display, False);

#endif
Expand Down
4 changes: 2 additions & 2 deletions core/rec-x86/rec_x86_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -326,8 +326,8 @@ void ngen_Compile(RuntimeBlockInfo* block, SmcCheckEnum smc_checks, bool reset,

if (prof.enable)
{
if (force_checks)
x86e->Emit(op_add32,&prof.counters.blkrun.force_check,1);
//if (force_checks)
// x86e->Emit(op_add32,&prof.counters.blkrun.force_check,1);

x86e->Emit(op_add32,&prof.counters.blkrun.cycles[block->guest_cycles],1);
}
Expand Down
85 changes: 16 additions & 69 deletions core/serialize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1050,33 +1050,28 @@ bool dc_serialize(void **data, unsigned int *total_size)
REICAST_S(sch_list[modem_sched].tag) ;
REICAST_S(sch_list[modem_sched].start) ;
REICAST_S(sch_list[modem_sched].end) ;
#else
int modem_dummy = 0;
REICAST_S(modem_dummy);
REICAST_S(modem_dummy);
REICAST_S(modem_dummy);
#endif

REICAST_S(SCIF_SCFSR2);
REICAST_S(SCIF_SCFRDR2);
REICAST_S(SCIF_SCFDR2);


REICAST_S(BSC_PDTRA);




REICAST_SA(tmu_shift,3);
REICAST_SA(tmu_mask,3);
REICAST_SA(tmu_mask64,3);
REICAST_SA(old_mode,3);
REICAST_SA(tmu_ch_base,3);
REICAST_SA(tmu_ch_base64,3);




REICAST_SA(CCN_QACR_TR,2);




REICAST_SA(UTLB,64);
REICAST_SA(ITLB,4);
#if defined(NO_MMU)
Expand All @@ -1086,8 +1081,6 @@ bool dc_serialize(void **data, unsigned int *total_size)
REICAST_S(mmu_error_TT);
#endif



REICAST_S(NullDriveDiscType);
REICAST_SA(q_subchannel,96);

Expand Down Expand Up @@ -1129,22 +1122,16 @@ bool dc_serialize(void **data, unsigned int *total_size)
REICAST_S(div_som_reg2);
REICAST_S(div_som_reg3);



REICAST_S(LastAddr);
REICAST_S(LastAddr_min);
REICAST_SA(block_hash,1024);


REICAST_SA(RegisterWrite,sh4_reg_count);
REICAST_SA(RegisterRead,sh4_reg_count);
REICAST_S(fallback_blocks);
REICAST_S(total_blocks);
REICAST_S(REMOVED_OPS);




REICAST_SA(kcode,4);
REICAST_SA(rt,4);
REICAST_SA(lt,4);
Expand Down Expand Up @@ -1245,12 +1232,7 @@ static bool dc_unserialize_libretro(void **data, unsigned int *total_size)
//this is one-time init, no updates - don't need to serialize
//extern _vmem_handler area0_handler;




REICAST_USA(reply_11,16) ;


REICAST_USA(reply_11,16);

REICAST_US(sns_asc);
REICAST_US(sns_ascq);
Expand Down Expand Up @@ -1364,8 +1346,6 @@ static bool dc_unserialize_libretro(void **data, unsigned int *total_size)

REICAST_USA(mem_b.data, mem_b.size);



REICAST_US(IRLPriority);
REICAST_USA(InterruptEnvId,32);
REICAST_USA(InterruptBit,32);
Expand All @@ -1374,9 +1354,6 @@ static bool dc_unserialize_libretro(void **data, unsigned int *total_size)
REICAST_US(interrupt_vmask);
REICAST_US(decoded_srimask);




REICAST_US(i) ;
if ( i == 0 )
do_sqw_nommu = &do_sqw_nommu_area_3 ;
Expand All @@ -1401,9 +1378,6 @@ static bool dc_unserialize_libretro(void **data, unsigned int *total_size)
REICAST_US(old_rm);
REICAST_US(old_dn);




REICAST_US(sh4_sched_ffb);
REICAST_US(sh4_sched_intr);

Expand Down Expand Up @@ -1452,33 +1426,28 @@ static bool dc_unserialize_libretro(void **data, unsigned int *total_size)
REICAST_US(sch_list[modem_sched].tag) ;
REICAST_US(sch_list[modem_sched].start) ;
REICAST_US(sch_list[modem_sched].end) ;
#else
int modem_dummy;
REICAST_US(modem_dummy);
REICAST_US(modem_dummy);
REICAST_US(modem_dummy);
#endif

REICAST_US(SCIF_SCFSR2);
REICAST_US(SCIF_SCFRDR2);
REICAST_US(SCIF_SCFDR2);


REICAST_US(BSC_PDTRA);




REICAST_USA(tmu_shift,3);
REICAST_USA(tmu_mask,3);
REICAST_USA(tmu_mask64,3);
REICAST_USA(old_mode,3);
REICAST_USA(tmu_ch_base,3);
REICAST_USA(tmu_ch_base64,3);




REICAST_USA(CCN_QACR_TR,2);




REICAST_USA(UTLB,64);
REICAST_USA(ITLB,4);
#if defined(NO_MMU)
Expand All @@ -1488,9 +1457,6 @@ static bool dc_unserialize_libretro(void **data, unsigned int *total_size)
REICAST_US(mmu_error_TT);
#endif




REICAST_US(NullDriveDiscType);
REICAST_USA(q_subchannel,96);

Expand Down Expand Up @@ -1545,9 +1511,6 @@ static bool dc_unserialize_libretro(void **data, unsigned int *total_size)
REICAST_US(div_som_reg2);
REICAST_US(div_som_reg3);




//REICAST_USA(CodeCache,CODE_SIZE) ;
//REICAST_USA(SH4_TCB,CODE_SIZE+4096);
REICAST_US(LastAddr);
Expand Down Expand Up @@ -1611,16 +1574,13 @@ bool dc_unserialize(void **data, unsigned int *total_size)
REICAST_US(timers[i].m_step);
}


REICAST_USA(aica_ram.data,aica_ram.size) ;
REICAST_US(VREG);
REICAST_US(ARMRST);
REICAST_US(rtc_EN);

REICAST_USA(aica_reg,0x8000);



REICAST_USA(volume_lut,16);
REICAST_USA(tl_lut,256 + 768);
REICAST_USA(AEG_ATT_SPS,64);
Expand All @@ -1635,14 +1595,11 @@ bool dc_unserialize(void **data, unsigned int *total_size)
REICAST_USA(mxlr,64);
REICAST_US(samples_gen);


register_unserialize(sb_regs, data, total_size) ;
REICAST_US(SB_ISTNRM);
REICAST_US(SB_FFST_rc);
REICAST_US(SB_FFST);



//this is one-time init, no updates - don't need to serialize
//extern RomChip sys_rom;
REICAST_US(sys_nvmem.size);
Expand Down Expand Up @@ -1754,8 +1711,6 @@ bool dc_unserialize(void **data, unsigned int *total_size)

REICAST_USA(mem_b.data, mem_b.size);



REICAST_US(IRLPriority);
REICAST_USA(InterruptEnvId,32);
REICAST_USA(InterruptBit,32);
Expand All @@ -1764,9 +1719,6 @@ bool dc_unserialize(void **data, unsigned int *total_size)
REICAST_US(interrupt_vmask);
REICAST_US(decoded_srimask);




REICAST_US(i) ;
if ( i == 0 )
do_sqw_nommu = &do_sqw_nommu_area_3 ;
Expand Down Expand Up @@ -1842,6 +1794,11 @@ bool dc_unserialize(void **data, unsigned int *total_size)
REICAST_US(sch_list[modem_sched].tag) ;
REICAST_US(sch_list[modem_sched].start) ;
REICAST_US(sch_list[modem_sched].end) ;
#else
int modem_dummy;
REICAST_US(modem_dummy);
REICAST_US(modem_dummy);
REICAST_US(modem_dummy);
#endif

REICAST_US(SCIF_SCFSR2);
Expand Down Expand Up @@ -1879,8 +1836,6 @@ bool dc_unserialize(void **data, unsigned int *total_size)
#endif




REICAST_US(NullDriveDiscType);
REICAST_USA(q_subchannel,96);

Expand All @@ -1896,7 +1851,6 @@ bool dc_unserialize(void **data, unsigned int *total_size)
// REICAST_US(i); // VRAM_MASK



REICAST_US(naomi_updates);
REICAST_US(i); // BoardID
REICAST_US(GSerialBuffer);
Expand Down Expand Up @@ -1935,25 +1889,18 @@ bool dc_unserialize(void **data, unsigned int *total_size)
REICAST_US(div_som_reg2);
REICAST_US(div_som_reg3);




//REICAST_USA(CodeCache,CODE_SIZE) ;
//REICAST_USA(SH4_TCB,CODE_SIZE+4096);
REICAST_US(LastAddr);
REICAST_US(LastAddr_min);
REICAST_USA(block_hash,1024);


REICAST_USA(RegisterWrite,sh4_reg_count);
REICAST_USA(RegisterRead,sh4_reg_count);
REICAST_US(fallback_blocks);
REICAST_US(total_blocks);
REICAST_US(REMOVED_OPS);




REICAST_USA(kcode,4);
REICAST_USA(rt,4);
REICAST_USA(lt,4);
Expand Down
1 change: 1 addition & 0 deletions shell/android-studio/reicast/src/main/jni/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ WEBUI := 1
USE_GLES := 1
CHD5_LZMA := 1
CHD5_FLAC := 1
USE_MODEM := 1

ifneq ($(TARGET_ARCH_ABI),armeabi-v7a)
NOT_ARM := 1
Expand Down
Loading

0 comments on commit 555b39b

Please sign in to comment.