Creating tools for researching NES games. What is the NES file extension? My computer does not show file extensions, what should I do?

- Extension (format) is the characters at the end of the file after the last dot.
- The computer determines the file type by its extension.
- By default, Windows does not show file name extensions.
- Some characters cannot be used in the file name and extension.
- Not all formats are related to the same program.
- Below are all the programs that can be used to open the NES file.

Jnes is one of the simplest emulators for the Dandy game console, featuring support for most games for this console, as well as a number of additional features. The Jnes emulator supports online play, which is rare in other emulators. This makes it possible for you and your friend, who will play on the second joystick, to enjoy the game. Also, the Jnes program supports light gun emulation. To simulate it, a regular computer mouse is used. In addition, for the Jnes program to work, you do not need to install any additional modules or programs, and the utility itself consists of one file...

Nestopia is one of the most powerful Dendy console emulators, supporting a large number of different features and featuring a clear user interface. Its size indicates the abundance of possibilities. Other NES emulators tend to be much smaller in size. The program allows you to save the game anywhere, for which you can use hotkeys. The distinctive feature here is that the program provides a large number of slots for your saved games, which is useful for any player. In addition, it supports all formats in which games for this console are stored, and we are talking about yes...

FCEUX is an emulator for the Dendy console, allowing you to run games from this console on personal computers. This emulator has a clear user interface and several additional features. For example, the emulator allows you to record gameplay, supports working with joysticks, and also allows you to play with a partner over the network, or in split-screen mode, using either 2 joysticks or different parts of the same keyboard. However, in fairness, we note that it is not always possible to press several keys on the keyboard at the same time, and therefore playing on the keyboard is less comfortable.

And at the same time a ZIP file. It is fully functional as both an NES ROM and a ZIP file at the same time.

What's in this ZIP file? ROM source code.

What happens if you compile this source code? It will create a NES ROM, which is also a ZIP file containing the source code of that NES ROM.

Launched ROM

This NES ROM can be "burned" onto an NES cartridge and will work on the NES. Even if you convert all the data from the cartridge, the NES image will still be a ZIP file.

Source of inspiration

Issue 0x14 of PoC||GTFO was both a PDF, a ZIP file, and an NES ROM. It was this release that inspired me to create an NES game from scratch for Tymkrs.

The method I used to create the NES ROM, which is also a ZIP file, is NOT the same method used in issue 0x14 PoC||GTFO. My method embeds the ZIP file into the NES ROM and allows you to burn the NES image to the cartridge while preserving the data in the ZIP file. In the method used by PoC||GTFO, the ZIP file data is stored outside of the NES ROM file, so release 0x14 of PoC||GTFO cannot be written to a cartridge with the ZIP file data saved.

NES ROM File Format

This NES image uses the iNES file format. The iNES file format is actually quite simple.

At the beginning of the ROM there is an iNES header that tells a bit of information about the NES ROM so that emulators can understand the NES image data. Following the iNES header is PRG data, which is the NES ROM software logic data. Then comes the CHR data, that is, sets of background tiles and sprites. All the empty space in the PRG is padded, and there can be a few bytes at the end of the PRG data (this NES ROM has 6 required bytes at the end of the PRG data that I can't change).


iNES File Format

ZIP file format

There are quite a lot of components to ZIP files, so we'll focus on the parts that are important to us.

For each file and directory contained in a ZIP file, there is a Central Directory File Header. Any central directory file header can be found by searching the 0x504B0102 header signature bytes in the ZIP file. The important piece of information is the Local Header Offset because when we embed the ZIP file into the NES ROM we will be changing each offset.


ZIP Central Directory File Header Format

ZIP files determine their beginning and end by going to the end of the file and moving toward the beginning until they reach bytes 0x504B0506 of the End of Central Directory Record signature. When embedding the ZIP file into the NES ROM, it is important for us to update the Central Directory Offset at the end of the Central Directory entry. We can also specify the length of the ZIP file comment (ZIP File Comment Length) and this number of bytes after the end of the ZIP file data will be the ZIP file comment.


ZIP Central Directory Entry End Format

Hiding the ZIP file in the NES ROM

If we find enough padding in the PRG data, we can simply replace that empty data with a ZIP file. In my NES ROM, I counted the padding bytes from the end of the PRG data until I had enough space to embed the ZIP file and recorded how far into the NES ROM I started embedding the ZIP file. I then updated all the ZIP file data offsets by adding the distance where the ZIP file starts in the NES image. I then set the ZIP file's comment length size to equal the size of the rest of the NES ROM data, i.e. the end of the PRG data and all of the CHR data.


NESZIP file format

This file remains an NES image because none of the required PRG data and CHR data are corrupted. It is also a ZIP file because all offsets are correct and all data after the ZIP data is declared as a ZIP comment.

Let's first test the file to make sure it is both an NES ROM and a ZIP file. After downloading the file as an NES ROM, I make a copy of it.


Copy of NES ROM

Renaming the file allows me to change the extension from .nes to .zip.


Changing the extension of the NES ROM copy to .zip

After changing the extension to .zip, the file is considered a ZIP file.

When you unpack this file, a directory is created.


If we look at the contents of the directory, we can see the source code of the file. We simply took the NES ROM, renamed it to a ZIP file, and successfully extracted it.


While updating the ZIP file data offsets, I decided to have a little fun with the ZIP file. The central directory file headers indicate the Host OS on which the ZIP file was created, so I decided to make the ZIP file claim to have been created on an Atari ST.

Create a recursion

In fact, this part is the easiest. The zipped source code became a ZIP file small enough to be easily embedded into an NES ROM, so I decided to make the NES/ZIP recursive. It didn't take much work to automate the process of creating a source code ZIP file, or to automate the process of embedding a ZIP file into the NES ROM.

Let's sum it up

This project is a simple proof of concept, demonstrating the ability to embed a ZIP file into an NES ROM in a way that creates a file that becomes both a ZIP file and an NES image, and allows the data to be written to a cartridge with all its properties preserved.

Since I chose to make this NES ROM compatible with NES-NROM-128 PCBs (due to their simplicity), the process will work for almost any NES ROM as long as it has enough padding in the PRG data to embed the ZIP file.

Implementing this process on other NES ROMs may require additional work because different 6502 assemblers may indent PRG data differently. I have not tested this method with more complex NES games that have bank switching. I also have not tested the ability to add padding to the PRG data size to accommodate larger ZIP files.

With that said, don't be surprised if I give you an NES cartridge with a secret ZIP file hidden in the NES ROM data.

Source

The source code for this project is available on GitHub (or can be obtained by extracting the NES ROM file) and is licensed under a BSD 2-Clause License.

If you have installed on your computer antivirus program Can scan all files on your computer, as well as each file individually. You can scan any file by right-clicking on the file and selecting the appropriate option to scan the file for viruses.

For example, in this figure it is highlighted file my-file.nes, then you need to right-click on this file and select the option in the file menu "scan with AVG". When you select this option, AVG Antivirus will open and scan the file for viruses.


Sometimes an error may occur as a result incorrect software installation, which may be due to a problem encountered during the installation process. This may interfere with your operating system link your NES file to the correct application software, influencing the so-called "file extension associations".

Sometimes simple reinstalling Jnes may solve your problem by linking NES to Jnes correctly. In other cases, problems with file associations may result from bad software programming developer and you may need to contact the developer for further assistance.


Advice: Try updating Jnes to the latest version to ensure you have the latest patches and updates.


This may seem too obvious, but often The NES file itself may be causing the problem. If you received a file via an email attachment or downloaded it from a website and the download process was interrupted (such as a power outage or other reason), the file may become damaged. If possible, try getting a new copy of the NES file and try opening it again.


Carefully: A damaged file can cause collateral damage to previous or existing malware on your PC, so it is important to keep your computer running an updated antivirus at all times.


If your NES file related to the hardware on your computer to open the file you may need update device drivers associated with this equipment.

This problem usually associated with media file types, which depend on successfully opening the hardware inside the computer, e.g. sound card or video card. For example, if you are trying to open an audio file but cannot open it, you may need to update sound card drivers.


Advice: If when you try to open a NES file you receive .SYS file error message, the problem could probably be associated with corrupted or outdated device drivers that need to be updated. This process can be made easier by using driver update software such as DriverDoc.


If the steps do not solve the problem and you are still having problems opening NES files, this may be due to lack of available system resources. Some versions of NES files may require a significant amount of resources (e.g. memory/RAM, processing power) to properly open on your computer. This problem is quite common if you are using fairly old computer hardware and at the same time a much newer operating system.

This problem can occur when the computer is having trouble keeping up with a task because the operating system (and other services running in the background) may consume too many resources to open a NES file. Try closing all applications on your PC before opening the Nintendo (NES) ROM File. Freeing up all available resources on your computer will provide the best conditions for attempting to open the NES file.


If you completed all the steps described above and your NES file still won't open, you may need to run equipment update. In most cases, even when using older versions of hardware, the processing power can still be more than sufficient for most user applications (unless you're doing a lot of CPU-intensive work, such as 3D rendering, financial/scientific modeling, or intensive multimedia work) . Thus, it is likely that your computer does not have enough memory(commonly called "RAM" or random access memory) to perform the task of opening a file.

You have found a suitable game for yourself that you would like to remember and play. You downloaded it and now you have a question: how to play dandy games on computer?

All dandy games exist in the following format: NES. This format cannot be opened just like that. To open the NES format we need dandy emulators games.

There are a lot of dandy emulators, but there are only a few that are convenient and normal.

Below are the dandy emulators, which can be downloaded immediately by clicking on the link.

For myself, I selected two emulators that I use.

The first is VirtuaNES 0.97e, which I use for almost all games.

And the second Nestopia 1.40, which I use to open multi-games.

Using the VirtuaNES 0.97e emulator as an example, I will now explain: how to play dandy games on a computer?

First download it to your computer:

Then unzip the archive and open the unzipped VirtuaNES folder.

Then open the file "VirtuaNES.exe".

Having opened it, we will see a black screen and at the top the inscription “File (F)”, etc. This is the emulator.

Step 1. Open the game.

To open the game, click "File(F)" at the top and select "Open(O)". Or just press the keyboard shortcut "Ctrl+O".

The “Open Rom file” window will appear in front of us. Here we indicate the path / select the dandy game itself that we want to open.

And click the "Open" button.

When you open some games, a window will appear that says:
"Because a NES header is illegal, there can be the thing that does not work normally. Do execute?".

When this window appears, click the “Yes” button.

All dandy game is open. You can already play.

Step 2: Setting up controls

You can already play, but how? We don't know the control keys. Let's set them up.

To configure the control, click "Option(C)" at the top and select "Controller(C)".

To configure the first player's controls, you must have the "Controller1" tab open.

For the second player, the "Controller2" tab.

In the first player tab, you should have “10FPS” selected in two columns.

For myself, I installed the control keys, which are shown in the screenshot below. This control setup is quite convenient.

We set it up for the second player in the same way, only the control keys are different.

Step 3. Open the file immediately and always

In order for the dandy game to open immediately upon double-clicking, that is, download it from our website, open it and you can already play.

You need to open the game in nes format, then select “Select a program from the list manually” and click “OK”.

Check the box next to “Use this for all files of this type” and click “OK”.

Now you can launch all the games you downloaded from our site at once.

You won't need to open the emulator and press "File(F)" etc. You will just need to open the game.

If the inscriptions do not appear on your monitor, then you need to move the cursor over the game and press the right mouse button.

Then click “Open with” and “Select program”. Then click "Browse".

Select the emulator and check the box next to the option “Use this for all files of this type.”

Click "OK" and we can safely play.

To pause the game you need to press the space bar, and to continue the game you need to press the P key.

By constantly pressing the space bar, the game runs in slow motion mode.

If, while passing a game, you need to close it, and then, when you have free time to play, continue the game from the same moment. You need to press the S key to save and L to continue the game.