Hot answers tagged

109

One use is as a copyright mechanism. Many distributors would steal/copy programs and sell pirate or derivative copies, by changing the text strings inside the code and reordering the blocks, it was hard to prove the code had been stolen. Placing noops of different types you could put a signature sequence which was much easier to detect and hard to hide. A ...


74

Note: This answer mainly focuses on the NES, since that's what I'm most familiar with. Yes; this is called static recompilation or static binary translation, and it is theoretically possible -- jamulator by Andrew Kelly does it. However, recompilation can be incredibly difficult (to the point that falling back to interpretation at runtime may be required ...


69

The NES was also from the era where some sound and graphics resources were also executable code. (Typically, this worked the other way around. Identify a needed sound and listen to chunks of the binary to find a reasonable candidate.) Injecting NOPs can improve the look or sound derived from a section of executable. Example: "One of the more-challenging ...


60

No MMC3 tricks are used for this effect; just standard background and sprite manipulation. Tiles that are completely invisible are replaced with a blank tile, while black sprites forming a circle outline cover the partially-visible tiles. We can make the effect more obvious by drawing background and sprites separately (and coloring the circle sprites white ...


57

In Super Mario Bros, you can access warp zones in three areas of the game. There are two of these that are important for the minus world glitch: the one at the end of World 1-2 (following the exit pipe) and the one at the end of World 4-2 (also following the exit pipe). The first warp zone takes you normally to World 2, 3, and 4, while the second one only ...


52

Warp zones exist at the end of some levels. In order to access them, you have to break through blocks at the top of the level, then run along the top until a secret area becomes visible. In order to access the warp zone below you, you have to fall through a gap at the right-most side of the level. The loading of the right-most wall is what triggers the ...


42

The situation with the 386(DX) v. 386SX is similar to the situation with the 8086 v. 8088. The big issue isn’t the data lines (although they do have an impact on complexity and cost when routing a whole motherboard), the issue is mostly the cost of support components: motherboard chipsets (whether integrated or discrete), memory, etc. By going back to a 16-...


36

This is done by changing the scroll mid-screen. This is what the nametables look like on scanline 30 in Super Mario Bros, with the scroll shown: The horizontal scroll is 0 (you can barely see the white line on the left side). Here is the same image on scanline 31: Now the horizontal scroll is at the left edge of the visible area. The PPU draws the ...


34

I'm just speculating here, but one possible reason for using a 2-byte NOP would be if you wanted to change an existing 2-byte instruction into a NOP (to fix a bug, for instance), without changing the byte count for the instruction. (An undocumented 2-byte NOP might execute more quickly than two standard 1-byte NOPs in succession.) You might do this to ...


33

As seen in that incorrect† image, the levels seem to merge well. This wasn't a case of "Let's take these shapes, and see if they... whoa! They fit together!" It was more like, "Here's a big rectangle. Let's cut away some shapes." It's kind of like starting with a big batch of cookie dough, or silly putty, and cutting shapes out of that. Then, at ...


32

The Zapper worked by receiving light through the photodiode at the front of the gun in the barrel. mental_floss has a really great description of what happens: When you point at a duck and pull the trigger, the computer in the NES blacks out the screen and the Zapper diode begins reception. Then, the computer flashes a solid white block around the ...


30

A mistake? The instruction $89 on the 6502 is a two-byte NOP. Based on adjacent instructions in the opcode matrix, especially LDA #ii ($A9 ii), it would have been STA #ii, a store to an immediate value, which makes no sense. On the 65C02, this instruction is changed to BIT #ii, which almost behaves as a two-byte NOP. One hypothesis is that a programmer ...


28

This website might help. A guy (Chris Covell) picked up a children's picture book in Japan which shows kids how NES games were made. (Mostly focussing on Super Mario Bros. 3) Chris actually scanned the whole book and translated it so you can read it on the website! The book shows many things such as designing (with Shigeru Miyamoto smoking), programming, ...


27

The Picture Processing Unit (PPU) in the NES can only draw 64 sprites per frame and 8 sprites per horizontal line (scanline). If the game tries to draw more than that, some of them will be invisible. It could ruin the game if enemies became invisible because there were too many of them, so the developers programmed the games to change the order of sprites ...


24

Typically in cases like this, they are designed to fit together. Actually, it's not so much that they are separate maps that happen to fit together, but rather it's just one big map and each 'dungeon' is simply a piece of it. This can simplify the game design because what appears to the player as moving to a new map can be coded internally as simply moving ...


24

The cartridge contains extra RAM. The NES can use tiles in cartridge memory space, but that doesn't necessarily have to be ROM. With suitable RAM and memory mapping the cartridge can create a basic bitmap display out of tiles. The vectors are then rendered to that RAM using the NES CPU in the normal way.


23

You're correct about it being a consequence of cartridges being able to observe the PPU memory bus. The advanced video features of the MMC5 and other mappers might have been trivial to add if Nintendo provided more signals to expose the internal state of the PPU to the cartridge, but they didn't, so these chips function by carefully monitoring PPU memory ...


23

Subpixels in general are invisible fractional pixels that you cannot see, but are used internally to represent the positions of objects at a finer level than they're capable of being displayed at. So far as Super Mario goes they're represented as an integer with 16 subpixels per visible pixel. This allows inertia to be loosely modeled so that you can start ...


22

I worked with one and it was a pain to use. It was a cartridge made of static ram; the computer would write the contents to the cartridge and you would manually reset the console. it was slow, the upload would sometimes fail and there was no way to communicate anything back to the computer. We were using an assembler under MSDOS to make the games. On the ...


22

So that indicates extra data lines were very expensive; the difference between a 386SX and 386DX computer came to hundreds of dollars. Not really. Sure, they need to have some room and routing - and thus more thru hole connections, but over all, doing a 32 data lines instead of 16 isn't a big deal. It wasn't the data lines themselves, but rather the ...


21

In the case of the NES Advantage at least, the Turbo rate was adjustable, by turning the dial at the top of each button. You are right in assuming that the NES does not communicate the start of a frame to the controller. But also, these buttons do not need to know when the frames are. All they need to do is open and close the circuit; the software will ...


19

To a certain extent you can guess the number of cycles by counting the number of memory accesses. A 2-byte instruction will take a minimum of 2 cycles because you need to read 2 bytes. If the instruction needs to read or write a data byte add another cycle. For example, a zero-page read is a 2-byte instruction, but in addition to reading the instruction ...


19

The NES did not use an extra bit for sprite positions. A sprite's X-position was the position of its left edge, which means that sprites cannot be placed partially off the left side of the screen: However, the NES did actually provide the feature you're suggesting, in a way: bits 1 and 2 of the PPUMASK register can be used to keep the leftmost 8 pixels of ...


19

In many 8 bit games the position of the player's sprite is stored as the pixel coordinates it rests on. For many games that is adequate, but it has some limitations. If the game only uses whole pixel coordinates then the minimum movement speed is 1 pixel. In other words the resolution of the player's speedometer is 1 pixel. They can be moving at 1 pixel per ...


18

You can, provided that you have a cartridge reader that you can plug to the computer that runs the emulator. One such reader is Retrode; if you google "nes cartridge reader" you will find references to more similar products, even DIY kits.


18

The NES can be damaged by software, so removing the cartridge at just the wrong timing could theoretically damage the console. The 2CO2 PPU in the NES normally reads the background color from palette index 0, but this isn't hard-wired into the chip -- it actually reads the palette index of the background from four EXT pins. These pins are grounded on the ...


17

If you read this, you'll find that the CIC chip is actually a primitive 4-bit CPU with a small bit of ROM. The chip in the NES and the chip in the cartridge attempt to communicate, if expected communication does not happen the CIC resets the system. There is one chip inside the console, and one in every cartridge; the code inside the chip decides what to ...


16

So I've been doing a little more research on this and it appears that in the early days of the NES, Nintendo did not license a dev kit themselves. Developers were forced to hack away and make their own dev kits. A popular one at the time was the "NES Mission Control" created by Rocket Science Production. Bill & Ted's Excellent Adventure and The Mutant ...


16

I've done this partially with Commodore PET Space Invaders which I used as a test program to debug my Commodore PET emulator. I used a disassembler to convert the program to assembly language and I then went through the code annotating it as I found out what it does. When I understood what a bit of code did, I would look for its entry point (my disassembler ...


Only top voted, non community-wiki answers of a minimum length are eligible