.v64 and .n64 compatibility

Discuss ROM-compatibility related issues here.
Post Reply
User avatar
tony971
Posts: 15
Joined: Sun Feb 01, 2015 1:02 pm

.v64 and .n64 compatibility

Post by tony971 » Tue Feb 17, 2015 9:17 am

Mupen64plus has a pretty cool commit coming through right now. Have you seen it?

https://github.com/mupen64plus/mupen64plus-core/pull/80

User avatar
MarathonMan
Site Admin
Posts: 692
Joined: Fri Oct 04, 2013 4:49 pm

Re: .v64 and .n64 compatibility

Post by MarathonMan » Tue Feb 17, 2015 10:26 am

CEN64 takes a different approach and maps the ROM file straight into the process's virtual address space; NO reading or writing of the ROM data is required (until it gets used by the game, of course).

I'm very against byteswapping; it shouldn't have ever happened in the first place! :P

User avatar
Breadwinka
Posts: 54
Joined: Fri Oct 04, 2013 11:35 pm

Re: .v64 and .n64 compatibility

Post by Breadwinka » Tue Feb 17, 2015 2:45 pm

agreed they should have stuck with one. Luckily its not necessary for cen64 since the frontends will swap for you.

User avatar
Narann
Posts: 154
Joined: Mon Jun 16, 2014 4:25 pm
Contact:

Re: .v64 and .n64 compatibility

Post by Narann » Tue Feb 17, 2015 10:23 pm

MarathonMan wrote:I'm very against byteswapping; it shouldn't have ever happened in the first place! :P
...until you get a storm of pull requests to implement it. :mrgreen:

User avatar
teres
Posts: 19
Joined: Fri Apr 11, 2014 9:44 am

Re: .v64 and .n64 compatibility

Post by teres » Wed Feb 18, 2015 3:49 pm

...at which point one could do like byuu did and offer some kind of "sanitizer" tool to "fix" a folder full of roms in one go. Or just point people to ucon64.

beannaich
Posts: 149
Joined: Mon Oct 21, 2013 2:43 pm

Re: .v64 and .n64 compatibility

Post by beannaich » Thu Feb 19, 2015 12:54 am

Byteswapping is easily handled by a frontend. The core code really doesn't need to know that a file was originally byteswapped. All the core needs to care about is that the file is in the correct order when it is loaded.

User avatar
Narann
Posts: 154
Joined: Mon Jun 16, 2014 4:25 pm
Contact:

Re: .v64 and .n64 compatibility

Post by Narann » Thu Feb 19, 2015 12:56 am

But this would lead to the same exact code for every frontend no?

User avatar
MarathonMan
Site Admin
Posts: 692
Joined: Fri Oct 04, 2013 4:49 pm

Re: .v64 and .n64 compatibility

Post by MarathonMan » Thu Feb 19, 2015 10:17 am

Or write a tool to byteswap all of the users ROMs. ;)

(and refuse to load the others until that is done)

beannaich
Posts: 149
Joined: Mon Oct 21, 2013 2:43 pm

Re: .v64 and .n64 compatibility

Post by beannaich » Fri Feb 20, 2015 1:57 am

Narann wrote:But this would lead to the same exact code for every frontend no?
We're talking about maybe 20 lines of code. Its not like having to duplicate a library or anything. It could take all of 5 minutes to write and test.

User avatar
Narann
Posts: 154
Joined: Mon Jun 16, 2014 4:25 pm
Contact:

Re: .v64 and .n64 compatibility

Post by Narann » Fri Feb 20, 2015 9:52 am

beannaich wrote:We're talking about maybe 20 lines of code. Its not like having to duplicate a library or anything. It could take all of 5 minutes to write and test.
If so, why no handle this in the core? I'm just curious.

User avatar
MarathonMan
Site Admin
Posts: 692
Joined: Fri Oct 04, 2013 4:49 pm

Re: .v64 and .n64 compatibility

Post by MarathonMan » Fri Feb 20, 2015 11:27 am

Narann wrote:If so, why no handle this in the core? I'm just curious.
Partially because I'm against byteswapping, partially because CEN64 takes this approach:
MarathonMan wrote:CEN64 takes a different approach and maps the ROM file straight into the process's virtual address space; NO reading or writing of the ROM data is required (until it gets used by the game, of course).
Mapping the ROM into a read-only part of the address space:
  • Allows for the use of things like MEM_LARGE_PAGES on Windows, to permit the OS to use huge TLB pages.
  • Forces the emulator to crash on stray/out of bounds accesses or writes to the ROM mapping.
  • Allows the OS to more intelligently manage memory in the event that memory runs low (since the mapping is likely backed by the OS's disk cache as it is not copied into heap memory as done in traditional emulators (at which point, the OS doesn't really know that it's just a large block file located on the disk anymore).
However, because the image was mapped RO into the address space... the only way to support byteswapping is to modify the actual user's file. Which I'm even more against doing than byteswapping in memory. :D

Presence
Posts: 51
Joined: Fri Oct 18, 2013 9:27 am

Re: .v64 and .n64 compatibility

Post by Presence » Fri Feb 20, 2015 12:34 pm

I dislike byteswapping as well which is why I included a simple converter in CEN64-Qt rather than have it seemlessly launch byteswapped ROMs (which isn't hard to do). I prefer the consistency of having my entire collection in Z64 format.

Coding a tool to sanitize an entire directory of ROMs would be easy to do as well.

User avatar
Narann
Posts: 154
Joined: Mon Jun 16, 2014 4:25 pm
Contact:

Re: .v64 and .n64 compatibility

Post by Narann » Fri Feb 20, 2015 1:44 pm

This make sense. How does CEN64 handle big-endian processors? I guess they don't have to byswap other roms are they?

User avatar
MarathonMan
Site Admin
Posts: 692
Joined: Fri Oct 04, 2013 4:49 pm

Re: .v64 and .n64 compatibility

Post by MarathonMan » Sat Feb 21, 2015 2:23 am

Narann wrote:This make sense. How does CEN64 handle big-endian processors? I guess they don't have to byswap other roms are they?
Correct. Everything on the bus in CEN64 is accessed on word-aligned boundaries; little-endian processors will byteswap while big-endian processors will not.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest