Giter Club home page Giter Club logo

lightrec's People

Contributors

pcercuei avatar zachcook avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lightrec's Issues

Twisted Metal III SCUS94249

The game crashes right after the first loading screen in Wiistation and WiiSX.

When removing the BEQ "never taken" conversion in optimizer.c the crash goes away.

If I only allow the conversion if the BEQ doesn't have a load delay in its delay slot, the crash is also fixed.

F1 2000/F1 2001 (and possibly other games) crashes at first screen

Like the title says F1 2000 and F1 2001, both from EA (and possibly other games) when trying to play them using Lightrec, they crash on the first copyright screen.

Playing the USA versions of the game.

Tried latest PCSX-ReARMed, latest WiiSX... no luck with these.

Maybe it's related to missing ICache emulation in Lightrec, or something else?
Any fix for these? Thanks ;)

Rayman(SLUS00005) unknown opcode

WARNING: Unknown opcode: 0x00001770 at PC 0x80166518
WARNING: Unknown opcode: 0x00001770 at PC 0x80130c80
WARNING: Unknown opcode: 0x00001770 at PC 0x80130cb4
WARNING: Unknown opcode: 0x00001770 at PC 0x80130ce4
WARNING: Unknown opcode: 0x00001770 at PC 0x80130d34
WARNING: Unknown opcode: 0x00001770 at PC 0x80130d7c
WARNING: Unknown opcode: 0x00001770 at PC 0x801321a0

Digimon Rumble Arena - Black screen when battle starts (WiiSX/CubeSX)

L̶i̶k̶e̶ ̶t̶h̶e̶ ̶t̶i̶t̶l̶e̶ ̶s̶a̶y̶s̶ ̶o̶n̶ ̶t̶h̶e̶ ̶g̶a̶m̶e̶ ̶D̶i̶g̶i̶m̶o̶n̶ ̶R̶u̶m̶b̶l̶e̶ ̶A̶r̶e̶n̶a̶ ̶t̶h̶e̶ ̶g̶a̶m̶e̶ ̶c̶r̶a̶s̶h̶e̶s̶ ̶a̶t̶ ̶s̶t̶a̶r̶t̶ ̶o̶f̶ ̶b̶a̶t̶t̶l̶e̶s̶.̶ (see update)

Playing the USA release, on the latest implementation of Lightrec on WiiSX/CubeSX.

Unimplemented opcode in FF9 after lighting candle after intro

WARNING: Unimplemented opcode 0x00001174
WARNING: Unimplemented opcode 0x000015f8
WARNING: Unknown opcode: 0x00001174 at PC 0x00000874
WARNING: Unknown opcode: 0x000015f8 at PC 0x0000087c

Seems to be an invalid opcode, both beetle and pcsx_rearmed have the same behavior.

Any chance for port Lightrec to WiiSXRX/WiiStation?

So, i've saw your work at this (very old but still maintained) PlayStation 1 emulator for Wii, WiiSX (formerly PCSXGC), that you implemented Lightrec: https://github.com/pcercuei/pcsxgc/tree/lightrec

I was going to ask...
Since WiiSXRX (https://github.com/niuus/WiiSXRX) and WiiStation (formerly WiiSXRX_2022, https://github.com/xjsxjs197/WiiSXRX_2022) are both much better emulators of PS1 for Wii than the old PCSXGC, i was going to ask if you could try implementing your Lightrec to these PS1 emulators for Wii?

Thanks for your great work, it's so appreciated ;)

Yu-Gi-Oh SLUS01411

When attacking a card with the "square" button instead of "X", a 3D battle animation occurs, then the animation starts and after a few seconds the code dump occurs.
20230831_182744

dual licensing ?

I have been thinking about porting this to FBNeo and i was wondering if you would give authorization to use this under FBNeo's non-commercial license ? (we can't add GPL code to our codebase)

GPU Corruption in Duke Nukem Total Meltdown

Mismatch!
CYCLE 0x5fd313aa PC 0x8008f578 CP0 0x7fbedad6 CP2D 0x3d7fe434 CP2C 0xe5c30193 INT 0x0804 INTCYCLE 0x2ebf30b4 GPU 0x5402200f GPR 0x0fcf30dc - Interpreter
CYCLE 0x5fd313aa PC 0x8008f578 CP0 0x7fbedad6 CP2D 0x3d7fe434 CP2C 0xe5c30193 INT 0x0804 INTCYCLE 0x2ebf30b4 GPU 0x54022112 GPR 0x0fcf30dc - Dynarec
State before the mismatch:
CYCLE 0x5fd31382 PC 0x80091a10 CP0 0x7fbedad6 CP2D 0x3d7fe434 CP2C 0xe5c30193 INT 0x0804 INTCYCLE 0x2ebf30b4 GPU 0x5402200f GPR 0xf675572e

Wiki?

Hi, is there any tip on how to use your library within other application?

(Windows) Static compilation issues

On Windows, I am compilling lightrec as a statically linked object instead of a DLL.
Due to how lightrec.h defines __api as either __declspec("dllimport") or __declspec("dllexport"), I am getting warnings the while compiling lightrec.c related to these attributes, e.g.:

path/to/lightrec.c:692:5: warning: 'lightrec_execute' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
  692 | u32 lightrec_execute(struct lightrec_state *state, u32 pc, u32 target_cycle)

and afterwards I errors related to undeclared references to all the functions declared in lightrec.h, e.g.:

ld.exe: lightrec_user.o:lightrec_user.cpp:(.text+0x1ab1): undefined reference to `__imp_lightrec_execute'

I can work around those errors by adding a new macro that changes how __apiis defined for static compilation and defining it during compilation, like so:

#ifndef lightrec_STATIC
#   ifdef _WIN32
#      ifdef lightrec_EXPORTS
#         define __api __declspec(dllexport)
#      else
#         define __api __declspec(dllimport)
#      endif
#   elif __GNUC__ >= 4
#      define __api __attribute__((visibility ("default")))
#   else
#      define __api
#   endif
#else
#   define __api
#endif

Because this works for me, it suggests the attributes - as warned by the compiler - are causing my linker errors. Perhaps the workaround should be part of the codebase? Or maybe the function definitions in lightrec.c also need matching attributes?

Assertion in lightning due to change in lightrec

When building lightning with --enable-assertions, upon starting emulator using lightrec (tried beetle and pcsx_rearmed):

lightning/lib/lightning.c:2126: _jit_trampoline: Assertion `_jitc->tail && _jitc->tail->code == jit_code_prolog' failed.

Tried to bisect but had many skips due to segfaults:

There are only 'skip'ped commits left to test.
The first bad commit could be any of:
4e6308b
53fd0e1
2d43186
8c9b3b2
627b913
634aeaa
1f4d72e
9c34c17
c257610
We cannot bisect more!

Sled Storm - Musics not playing

The game Sled Storm works fine but the musics aren't playing.

Few things to note:

  • I only tried the USA version of the game.
  • I only tried lightrec on the RetroArch version of PCSX ReARMed. Tested on Windows 10 and a Linux Mint VM.
  • Tested with .bin/.cue format and .chd, same results.
  • Musics play fine with the HLE BIOS.
  • Musics play fine with lightrec interpreter.

MULT2 in gex 3

The MULT2 conversion seems to cause Gex 3 to crash shortly after starting a new game on Wiistation. Removing the conversion makes it work again.

If I add a is_known check on both registers it seems to fix the crash. I don't know if that is right though.

Like so:

case OP_SPECIAL_MULTU:
if (is_known(v, op->r.rs) && is_known(v, op->r.rt) &&
is_power_of_two(v[op->r.rs].value)) {
tmp = op->c.i.rs;
op->c.i.rs = op->c.i.rt;
op->c.i.rt = tmp;
} else if (!is_known(v, op->r.rt) || !is_known(v, op->r.rs) ||
!is_power_of_two(v[op->r.rt].value)) {
break;
}

out of bounds reads

This may crash if the memory block ends up at the end of page:

==1134698== Invalid read of size 1
==1134698==    at 0x17287058: lightrec_emit_end_of_block (emitter.c:109)
==1134698==    by 0x172872ED: rec_mtc (emitter.c:2130)
==1134698==    by 0x17286E66: lightrec_rec_opcode (emitter.c:3060)
==1134698==    by 0x1728D016: lightrec_compile_block (lightrec.c:1619)
==1134698==    by 0x1728F3B4: get_next_block_func (lightrec.c:788)
==1134698==    by 0x1728F480: lightrec_execute (lightrec.c:1814)
==1134698==    by 0x1724F930: lightrec_plugin_execute_internal (plugin.c:515)
==1134698==    by 0x17234DA3: psxExecuteBios (r3000a.c:252)
==1134698==    by 0x17234EA6: psxReset (r3000a.c:78)
==1134698==    by 0x1732394C: SysReset (main.c:816)
==1134698==    by 0x17322134: retro_load_game (libretro.c:1675)
==1134698==    by 0x1A6F88: core_load_game (in /home/notaz/src/emu/RetroArch/retroarch)
==1134698==  Address 0x16798728 is 4 bytes after a block of size 484 alloc'd
==1134698==    at 0x4848899: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==1134698==    by 0x1728F865: lightrec_malloc (memmanager.c:67)
==1134698==    by 0x1728F01D: lightrec_disassemble (lightrec.c:1394)
==1134698==    by 0x1728F01D: lightrec_precompile_block (lightrec.c:1434)
==1134698==    by 0x1728F01D: lightrec_get_block (lightrec.c:715)
==1134698==    by 0x1728F30D: get_next_block_func (lightrec.c:740)
==1134698==    by 0x1728F480: lightrec_execute (lightrec.c:1814)
==1134698==    by 0x1724F930: lightrec_plugin_execute_internal (plugin.c:515)
==1134698==    by 0x17234DA3: psxExecuteBios (r3000a.c:252)
==1134698==    by 0x17234EA6: psxReset (r3000a.c:78)
==1134698==    by 0x1732394C: SysReset (main.c:816)
==1134698==    by 0x17322134: retro_load_game (libretro.c:1675)
==1134698==    by 0x1A6F88: core_load_game (in /home/notaz/src/emu/RetroArch/retroarch)
==1134698==    by 0x24C3FC: content_file_load (in /home/notaz/src/emu/RetroArch/retroarch)
==1134698== 
==1134698== Invalid read of size 4
==1134698==    at 0x1728705E: lightrec_emit_end_of_block (emitter.c:110)
==1134698==    by 0x172872ED: rec_mtc (emitter.c:2130)
==1134698==    by 0x17286E66: lightrec_rec_opcode (emitter.c:3060)
==1134698==    by 0x1728D016: lightrec_compile_block (lightrec.c:1619)
==1134698==    by 0x1728F3B4: get_next_block_func (lightrec.c:788)
==1134698==    by 0x1728F480: lightrec_execute (lightrec.c:1814)
==1134698==    by 0x1724F930: lightrec_plugin_execute_internal (plugin.c:515)
==1134698==    by 0x17234DA3: psxExecuteBios (r3000a.c:252)
==1134698==    by 0x17234EA6: psxReset (r3000a.c:78)
==1134698==    by 0x1732394C: SysReset (main.c:816)
==1134698==    by 0x17322134: retro_load_game (libretro.c:1675)
==1134698==    by 0x1A6F88: core_load_game (in /home/notaz/src/emu/RetroArch/retroarch)
==1134698==  Address 0x6547d8c is 0 bytes after a block of size 44 alloc'd
==1134698==    at 0x4848899: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==1134698==    by 0x1728F865: lightrec_malloc (memmanager.c:67)
==1134698==    by 0x1728F01D: lightrec_disassemble (lightrec.c:1394)
==1134698==    by 0x1728F01D: lightrec_precompile_block (lightrec.c:1434)
==1134698==    by 0x1728F01D: lightrec_get_block (lightrec.c:715)
==1134698==    by 0x1728F30D: get_next_block_func (lightrec.c:740)
==1134698==    by 0x1728F480: lightrec_execute (lightrec.c:1814)
==1134698==    by 0x1724F930: lightrec_plugin_execute_internal (plugin.c:515)
==1134698==    by 0x17234DA3: psxExecuteBios (r3000a.c:252)
==1134698==    by 0x17234EA6: psxReset (r3000a.c:78)
==1134698==    by 0x1732394C: SysReset (main.c:816)
==1134698==    by 0x17322134: retro_load_game (libretro.c:1675)
==1134698==    by 0x1A6F88: core_load_game (in /home/notaz/src/emu/RetroArch/retroarch)
==1134698==    by 0x24C3FC: content_file_load (in /home/notaz/src/emu/RetroArch/retroarch)
==1134698== Invalid read of size 1
==1134698==    at 0x17287058: lightrec_emit_end_of_block (emitter.c:109)
==1134698==    by 0x17288961: rec_exit_early (emitter.c:2079)
==1134698==    by 0x17286E66: lightrec_rec_opcode (emitter.c:3060)
==1134698==    by 0x1728D016: lightrec_compile_block (lightrec.c:1619)
==1134698==    by 0x1728F3B4: get_next_block_func (lightrec.c:788)
==1134698==    by 0x40801AE8: ???
==1134698==  Address 0x76a7488 is 4 bytes after a block of size 20 alloc'd
==1134698==    at 0x4848899: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==1134698==    by 0x1728F865: lightrec_malloc (memmanager.c:67)
==1134698==    by 0x1728F01D: lightrec_disassemble (lightrec.c:1394)
==1134698==    by 0x1728F01D: lightrec_precompile_block (lightrec.c:1434)
==1134698==    by 0x1728F01D: lightrec_get_block (lightrec.c:715)
==1134698==    by 0x1728F30D: get_next_block_func (lightrec.c:740)
==1134698==    by 0x40801AE8: ???

Press reset on the console, Exception DSI crash

Hi, dear pcercuei:

I don't know if this issue should be mentioned here.
I also imported this very cool lightrec into the WiiStation(https://github.com/xjsxjs197/WiiSXRX_2022/).
Now, when press reset on the console, an exception occurred with DSI crash.
I'm trying to investigate and solve this problem, Basically confirm that have reached the following code branch.
vm.c
int vm_dsi_handler(u32 DSISR, u32 DAR)
{
u16 v_index;
u16 p_index;

if (DAR<(u32)VM_Base || DAR>=0x80000000)
	// Maybe this point
if ((DSISR&~0x02000000)!=0x40000000)
	// Maybe this point

.....
When press reset button, Is Virtual Memory mapping corrupted?
There's no clue at all. Can you help solve this issue ?

Thanks a lot.

full bus access for sb sh

It appears the r3000 puts the whole register on bus regardless if you write byte, half or full word. It's up to the receiving device to figure out what kind of write it is from the control signals. But apparently some hw registers don't look at the control signals at all and just latch the whole bus. There is at least scph7001 BIOS that relies on this behavior:

  lhu     $t9, 0($v1)  # v1 = 1f8010f0
  lui     $at, 0xFFF0
  ori     $at, $at, 0xFFFF
  and     $t0, $t9, $at 
  lui     $at, 8
  or      $t1, $t0, $at
  sh      $t1, 0($v1)

Lightrec's memhandlers seem to use u8 and u16 for data of sb and sh memhandlers respectively. My request is to have full u32 there.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.