Kodewerx

Our culture has advanced beyond all that you could possibly comprehend with one hundred percent of your brain.
It is currently Thu Mar 28, 2024 7:03 am

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: N64 Emu GS Code Problems
PostPosted: Sun May 03, 2009 12:54 pm 
Offline
Kommunist
Kommunist
User avatar

Joined: Sun May 03, 2009 8:11 am
Posts: 17
Location: somewhere over the rainbow
Title: pwntendoer
Could anyone explain to me why

This GS code crashes PJ64, but works in Mupen64Plus on Linux:
Green Shells Only
Code:
8107B000 3C05
8107B002 0003


...and this code doesn't work in Mupen64Plus under Linux, but works in PJ64:
Green Shells Only
Code:
8007B000 003C
8007B001 0005
8007B002 0000
8007B003 0003


Is it common for GS codes to only work under certain emulators?? I've never seen this problem before.

I've been doing some Mario Kart 64 asm hacking and I'm trying to share some of the interesting things I've found as GS codes. I don't know too much about GS codes and I keep running into stupid problems :? Thanks.


Top
 Profile  
Reply with quote  
PostPosted: Sun May 03, 2009 1:12 pm 
Offline
Kommunist
Kommunist
User avatar

Joined: Sun May 03, 2009 8:11 am
Posts: 17
Location: somewhere over the rainbow
Title: pwntendoer
Alright, fuck me. To answer my own question. The codes won't work when you're using 2 different roms on each emulator. Make sure each rom has the same CRC and you won't look like a dumbass like me.

Edit:
Double fuck me, even with the exact same rom, the problem persists. Weirdness.


Top
 Profile  
Reply with quote  
PostPosted: Sun May 03, 2009 1:34 pm 
Offline
Krew (Admin)
Krew (Admin)
User avatar

Joined: Sun Oct 01, 2006 9:26 pm
Posts: 3768
Title: All in a day's work.
It's a problem with "dynamic re-compiler" (dynarec) CPU cores and caching CPU cores. Some emulators trace the assembly instructions as they run the game, and then either cache the instructions (so they don't have to be read from emulated memory several times per second) or convert them directly into x86 instructions. The problem then, is deciding when the instructions have changed, so the cache can be marked dirty, and rebuilt later, or so the x86 instructions can be recompiled.

While most of these CPU cores do handle the cases where the game writes over its own instructions in memory, they usually don't handle the case where cheat codes do the writing. In other words, consider this an emulation bug.

_________________
I have to return some video tapes.

Feed me a stray cat.


Top
 Profile  
Reply with quote  
PostPosted: Sun May 03, 2009 1:38 pm 
Offline
Kommunist
Kommunist
User avatar

Joined: Sun May 03, 2009 8:11 am
Posts: 17
Location: somewhere over the rainbow
Title: pwntendoer
Parasyte wrote:
It's a problem with "dynamic re-compiler" (dynarec) CPU cores and caching CPU cores. Some emulators trace the assembly instructions as they run the game, and then either cache the instructions (so they don't have to be read from emulated memory several times per second) or convert them directly into x86 instructions. The problem then, is deciding when the instructions have changed, so the cache can be marked dirty, and rebuilt later, or so the x86 instructions can be recompiled.

While most of these CPU cores do handle the cases where the game writes over its own instructions in memory, they usually don't handle the case where cheat codes do the writing. In other words, consider this an emulation bug.


Thanks for your help. In that case, would using a pure interpreter core provide more reliable results? How reliable are GS codes expected to be when they are released to the community?


Top
 Profile  
Reply with quote  
PostPosted: Sun May 03, 2009 1:47 pm 
Offline
Krew (Admin)
Krew (Admin)
User avatar

Joined: Sun Oct 01, 2006 9:26 pm
Posts: 3768
Title: All in a day's work.
Pure interpreters are the best bet.

GS codes "should" be compatible with the actual hardware. But there are cases where it's not really possible to be fully compatible. For example, this code I posted might be too long to work on a real PSX GameShark: viewtopic.php?f=18&t=1408 ... But, it's still an interesting piece of work.

_________________
I have to return some video tapes.

Feed me a stray cat.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: Bing [Bot] and 149 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group