patterns: Fix quirks of nes.hexpat with famiclones and miscellaneous fixes (#467)

* Add credit to ne.hexpat

* Add many changes to nes.hexpat

* Fixing dependance on variables declared in if statement

* Added mappers and inline to NES 2.0 header, removed needless parenthesises

* Add files via upload

* Add files via upload

* Create nsf.hexpat

* Used full name of the SNES on description

* Add SNES, NSF & NSFe, new description for NES

* Removing erroneous condition in ips.hexpat's truncatedSize

* Removing unnecessary std.string import in ips.hexpat

* Added both locations for sections in PE, clearer variable names, reorganized DOS stub

* Delete patterns/nsfe.hexpat

* Delete patterns/nsfmetadata.hexpat

* Added chunks from NSFe to NSF

* Added NSFe

* Fix size of truncatedSize in ips.hexpat

* More mappers, deprecated tag, and constants to nes

* Fixed official header's constants

* Various corrections

* Fix on declaration of sections, reserved words made into padding

* Added hacked algorithm for longer PRG ROM size, fixed iNES check

* For nes.hexpat, fixed mapper 51 still having its submapper's name

* Fix bug that makes size negative on standard roms

---------

Co-authored-by: Nik <werwolv98@gmail.com>
This commit is contained in:
gmestanley
2026-01-03 16:25:48 -03:00
committed by GitHub
parent 190f9d891b
commit 8a9bd577ad
2 changed files with 361 additions and 287 deletions

View File

@@ -47,10 +47,10 @@ struct DOSHeader {
u16 initialCSValue [[hex::spec_name("e_cs")]];
u16 relocationsTablePointer [[hex::spec_name("e_lfarlc")]];
u16 overlayNumber [[hex::spec_name("e_ovno")]];
u16 reservedWords[4] [[hex::spec_name("e_res")]];
padding[8];
u16 oemIdentifier [[hex::spec_name("e_oemid")]];
u16 oemInformation [[hex::spec_name("e_oeminfo")]];
u16 otherReservedWords[10] [[hex::spec_name("e_res2")]];
padding[20];
u32 coffHeaderPointer [[hex::spec_name("e_lfanew")]];
};
@@ -1115,7 +1115,7 @@ struct Section {
} [[name(sectionsTable[currentSectionIndex-1].name)]];
Section sections[coffHeader.numberOfSections] @ coffHeader.optionalHeader.sizeOfHeaders * !sectionsTable[0].sizeOfRawData
+ sectionsTable[0].ptrRawData * sectionsTable[0].sizeOfRawData>0;
+ sectionsTable[0].ptrRawData * (sectionsTable[0].sizeOfRawData>0);
// Symbol & String Tables
enum SectionNumberType : s16 {