Why NES have too ugly arch?

Discuss technical or other issues relating to programming the Nintendo Entertainment System, Famicom, or compatible systems. See the NESdev wiki for more information.

Moderator: Moderators

monobogdan
Posts: 24
Joined: Thu Mar 23, 2017 11:23 am

Re: Why NES have too ugly arch?

Post by monobogdan »

za909 wrote:It takes a miniscule amount of time to read in the grand scheme of things (even with an active DMC), and even then some games opted out for an unrolled loop and had the same code repeated 8 times. It works, and honestly my question would rather be why the designers of the Mega Drive felt that a controller port interrupt was necessary. Does such a thing improve responsivity noticeably at all?
SMD have more powerful CPU
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Why NES have too ugly arch?

Post by tepples »

Reading controllers in software using what amounts to bit-banged SPI has three advantages:
  1. It makes the hardware cheaper to manufacture.
  2. It doesn't really burden anything. I counted 228 cycles to read both controllers, which is two scanlines and less than 1% of CPU time.
  3. It makes the system more flexible, as manufacturers can make specialize controllers that send more detailed reports than the standard controller. Thwaite using the mouse is an example of this.
za909 wrote:my question would rather be why the designers of the Mega Drive felt that a controller port interrupt was necessary.
An interrupt is more necessary for a pin devoted to a 2D light gun's photodiode or serial communication between two machines. Polling is good enough for returning a Y coordinate from a light gun, based on the time between the start of a frame and when its sensor starts to receive light, in order to narrow down which targets are close. But retrieving both X and Y coordinates, as in the case of the Menacer, Justifier, or Super Scope, needs more precise circuitry.
User avatar
tokumaru
Posts: 12427
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: Why NES have too ugly arch?

Post by tokumaru »

monobogdan wrote:I'm talking about why nes can't self read input every frame
Is that all? A problem you can easily solve with a tiny routine you can call from the NMI handler, that you'll very likely write only once in your life and never think about it again? That hardly sounds like a significant design flaw to me.
User avatar
FrankenGraphics
Formerly WheelInventor
Posts: 2064
Joined: Thu Apr 14, 2016 2:55 am
Location: Gothenburg, Sweden
Contact:

Re: Why NES have too ugly arch?

Post by FrankenGraphics »

As for something else: I've thought more than once, though without any real reference, how a chunk of address range is wasted on mirrored features, but i don't know if this is normal for comparable systems.
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Why NES have too ugly arch?

Post by tepples »

The ColecoVision memory map has RAM from $6000 to $63FF, but it's mirrored all the way up to $7FFF. Its I/O map is full of mirroring as well.

For hardware external to the CPU die, incomplete decoding is cheaper. The NES APU is completely decoded (and thus not mirrored) because it's on the same die as the CPU.
User avatar
rainwarrior
Posts: 8734
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Why NES have too ugly arch?

Post by rainwarrior »

FrankenGraphics wrote:As for something else: I've thought more than once, though without any real reference, how a chunk of address range is wasted on mirrored features, but i don't know if this is normal for comparable systems.
It's very normal, and it's the opposite of a waste. Every mirror doubling is the result of one bit of the address being ignored (no circuitry, no cost). To restrict something to just one memory address means you need logic to deal with every single bit of the address.
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: Why NES have too ugly arch?

Post by lidnariq »

monobogdan wrote:SMD have more powerful CPU
We've been over this before.

Thousands of times across the internet.

In short: no, the Z80 at X MHz is roughly as capable as a 6502 at X/2 MHz.
User avatar
Bregalad
Posts: 8056
Joined: Fri Nov 12, 2004 2:49 pm
Location: Divonne-les-bains, France

Re: Why NES have too ugly arch?

Post by Bregalad »

rainwarrior wrote: It's very normal, and it's the opposite of a waste. Every mirror doubling is the result of one bit of the address being ignored (no circuitry, no cost). To restrict something to just one memory address means you need logic to deal with every single bit of the address.
Which I think the NES does for the $4000-$4017 registers, so logic is sort-of wasted on this. (Sort-of because this adress range was used by the FDS and other mappers).
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Why NES have too ugly arch?

Post by tepples »

lidnariq wrote:
monobogdan wrote:SMD have more powerful CPU
We've been over this before.

Thousands of times across the internet.

In short: no, the Z80 at X MHz is roughly as capable as a 6502 at X/2 MHz.
Mega Drive, not Master System.

But as for the Z80, I don't think the ratio is even as low as 2:1. It's probably 3:1, particularly if you're randomly accessing members of an actor data structure.
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: Why NES have too ugly arch?

Post by lidnariq »

Oh, pff, I keep on forgetting that this entire thread started with comparing the NES to things that are 5-20 years newer.
Pokun
Posts: 2681
Joined: Tue May 28, 2013 5:49 am
Location: Hokkaido, Japan

Re: Why NES have too ugly arch?

Post by Pokun »

The Mega Drive needs the interrupts for the blast processing to work properly.
Just kidding!
Bregalad wrote:
I fell that Nintendo should have "refreshed" the NES in 85 for the US launch and added in more things to bring it more up to date, having proven the model in Japan for 2 years first.
That's actually exactly what they did - the system looks completely different and cartridges aren't even compatible. They just made sure the software was (mostly) compatible.
Refreshed in design but not as Oziphantom meant. And I hardly think removing the microphone (which broke compatibility with some games) and the 15-pin expansion port is an upgrade. The new expansion port and controller ports are upgrades though.
psycopathicteen
Posts: 3140
Joined: Wed May 19, 2010 6:12 pm

Re: Why NES have too ugly arch?

Post by psycopathicteen »

If the NES was released a little bit later, maybe 1987, it could've had the following specs:

- 8 palettes of 4 colors for BG tiles, and 8 palettes of 3 colors for sprites
- 16kB of CHR-ROM, 512 tiles for sprites and 512 tiles for BG
- 16 sprites per scanline
- 8x8 or 8x16 sprites (selected per sprite)
- CHR patterns are stored with each pair of bytes representing an 8x1 sliver
- 6 byte FIFO
User avatar
TmEE
Posts: 960
Joined: Wed Feb 13, 2008 9:10 am
Location: Norway (50 and 60Hz compatible :P)
Contact:

Re: Why NES have too ugly arch?

Post by TmEE »

That interrupt on controller port in MD is for lightguns and RS232 communitation. When TH line is confed to be an input, and Port ints are enabled then high to low transition on the TH line creates a Port int to the 68K, in addition you can conf the VDP to freeze HV counter and read the pixel position where the Port int happened. Changing TH state by software will not cause Port ints, the change must come from external hardware (and to read normal controllers TH must be set as an output, so there can never be Port ints).
Oziphantom
Posts: 1565
Joined: Tue Feb 07, 2017 2:03 am

Re: Why NES have too ugly arch?

Post by Oziphantom »

tepples wrote:C64 sprites can be most usefully thought of as four 24x21-pixel sprites with 4 colors plus transparency. Each consists of a 1bpp outline plane on top of a chunkier multicolor plane. Thus you have four colors: the two shared multicolor sprite colors and two particular to a single sprite (the outline plane's color and the first multicolor color). Mayhem demonstrates this well.

One serious problem with C64 is that it takes unbearably long to load games from cassette tape. Unlike with NES, few games came on cartridge, and as I understand it, few people outside the USA got a 1541 disk drive because it was so expensive.

Dendy doesn't use "a 3.58Mhz colour clock". It uses the same color subcarrier and master clock frequency as the PAL NES, just with a /15 in the CPU instead of a /16 and a later NMI in the PPU. Use of /15 causes the number of CPU clocks per scanline, which is the important part, to match NTSC.
Sorry I mean Chroma clock. The Dendy is the special hacky Russian/Argentinean NES that uses PAL-M/N right? So it kinda works on NTSC-M displays and SECAM because those countries couldn't really get their TV standards straight? https://en.wikipedia.org/wiki/PAL#PAL-N
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Why NES have too ugly arch?

Post by tepples »

The UA6538 PPU in the Dendy outputs PAL video at the standard chroma subcarrier frequency (4.43 MHz). It is not PAL M or N.
Post Reply