File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
src/BizHawk.Emulation.Cores/Consoles/Nintendo/Ares64 Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -66,6 +66,21 @@ static bool IsGBRom(byte[] rom)
66
66
return ninLogoSha1 == SHA1Checksum . ComputeDigestHex ( new ReadOnlySpan < byte > ( rom ) . Slice ( 0x104 , 48 ) ) ;
67
67
}
68
68
69
+ // TODO: this is normally handled frontend side
70
+ // except XML files don't go through RomGame
71
+ // (probably should, but needs refactoring)
72
+ foreach ( var d in lp . Roms . Select ( static r => r . RomData ) )
73
+ {
74
+ // magic N64 rom bytes are 0x80, 0x37, 0x12, 0x40
75
+ // this should hopefully only ever detect N64 roms and not other kinds of files sent through here...
76
+ if ( ( d [ 1 ] is 0x80 && d [ 0 ] is 0x37 && d [ 3 ] is 0x12 && d [ 2 ] is 0x40 ) // .v64 byteswapped
77
+ || ( d [ 3 ] is 0x80 && d [ 2 ] is 0x37 && d [ 1 ] is 0x12 && d [ 0 ] is 0x40 ) // .n64 little-endian
78
+ || ( d [ 0 ] is 0x80 && d [ 1 ] is 0x37 && d [ 2 ] is 0x12 && d [ 3 ] is 0x40 ) ) // .z64 native
79
+ {
80
+ N64RomByteswapper . ToZ64Native ( d ) ;
81
+ }
82
+ }
83
+
69
84
var gbRoms = lp . Roms . FindAll ( r => IsGBRom ( r . FileData ) ) . Select ( r => r . FileData ) . ToArray ( ) ;
70
85
var rom = lp . Roms . Find ( r => ! gbRoms . Contains ( r . FileData ) && ( char ) r . RomData [ 0x3B ] is 'N' or 'C' ) ? . RomData ;
71
86
var ( disk , error ) = TransformDisk ( lp . Roms . Find ( r => ! gbRoms . Contains ( r . FileData ) && r . RomData != rom ) ? . FileData ) ;
You can’t perform that action at this time.
0 commit comments