Apparently the SMS is better than everything

Discussion of development of software for any "obsolete" computer or video game system. See the WSdev wiki and ObscureDev wiki for more information on certain platforms.
turboxray
Posts: 348
Joined: Thu Oct 31, 2019 12:56 am

Apparently the SMS is better than everything

Post by turboxray »

https://segaretro.org/Sega_Master_Syste ... comparison

It's great haha. Apparently, to get a systems' total "bus" width, you just add them altogether! Among other things :lol:
How is this site still around??? Crazy.
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Apparently the SMS is better than everything

Post by tepples »

In my opinion, NES vs. SMS comparison belongs in Other Retro Dev, alongside the last comparison topic ("I am a turncoat"). Does anyone second the move?

I'd like to see someone put up some benchmarks for work per clock between a 1.8 MHz 6502 and a 3.6 MHz Z80 to prove that "the Z80 has a significant performance advantage" as it claims. Here are some factors that may reduce effective processing speed, one within the Z80 and a couple in the rest of the system.
  • [IX+rr] is far slower than aaaa,X. The way to avoid this is to plan actor struct field order long in advance in order to use [HL] with INC L, but this adds to the programmer time/runtime tradeoff.
  • I demonstrated "software routines for sprite flipping" in the demo attached to "I am a turncoat". But having to stream flipped cels to VRAM rather than setting them and forgetting them the way you can with hardware flipping.
  • Having to render certain background effects in software to make up for the lack of mid-screen vertical scroll changes. You probably won't see anything like Rad Racer, Recca, or the tech demo shown in this tweet by @good_tune, except at the slideshow frame rate of Road Rash. Even a status bar in a 4- or 8-way scrolling game is a significant technical achievement.
Apart from the color depth advantage, the SMS VDP's 16-bit bus to VRAM also allows reading a nametable entry and its attribute table in a single video memory cycle (2 dots) instead of two (4 dots). This allows the VDP to make available time slots for CPU to write during draw time, which is where it gets its advantage in data transfer rate from the CPU and why tile streaming is more practical on SMS.
turboxray
Posts: 348
Joined: Thu Oct 31, 2019 12:56 am

Re: Apparently the SMS is better than everything

Post by turboxray »

Yeah. Probably best in other retro section.

The claims are pretty crazy. The 16bit addition one is great. Their example source is a single ADD rr,rr (being whatever pairs that are valid), but clearly omit the part you need to LOAD those regs with values. I mean, if all you did was that ADD instruction forever, then I guess it's technically valid? haha Yet the 6502 one loads values from memory, ADDs them, and stores them (they also include a stray RTS in there too ).

The multiplication one is similar. I'm not sure what that means, but the citation link is to a z80 CPC forum where the c64 2k table optimized method clearly beats all the z80 one (on CPC, by more than half).
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Apparently the SMS is better than everything

Post by tepples »

<sarcasm>2K table? That's like all the NES's RAM!</sarcasm> But seriously, a big LUT in the fixed bank is more convenient on SMS than on NES because SMS assigns 48K to the cartridge, with both $4000 and $8000 swappable. This is why I feel no shame in using 512 bytes for LUTs used by the sprite flipper (one identity and one bit-reverse).

In any case, let's start with a benchmark: 8-bit by 8-bit unsigned multiplication producing a 16-bit product in less than 100 bytes.

6502: The multiply routine in math.s of Thwaite takes 153 cycles.

Code: Select all

factor2 = $01
prodlo = $00

; Multiply A by Y, returning product in A:$0000
; Max cycles: 17+8*19 = 169; unrolling would save 39
mul8:
  lsr a        ; 2
  sta prodlo   ; 3
  sty factor2  ; 3
  lda #0       ; 2
  ldy #8       ; 2
  @loop:
    bcc @noadd     ; 2
      clc          ; 2
      adc factor2  ; 3
    @noadd:
    ror a          ; 2
    ror prodlo     ; 5
    dey            ; 2
    bne @loop      ; 3
               ; -1
  rts          ; 6
Z80: I just wrote this one, but it turned out to be an exact reinvention of this one published on Z80 Heaven

Code: Select all

; Multiply H by E, returning product in HL
; Max cycles: 23+8*42 = 359; unrolling would save 99
mul8:
  ld b, 8     ; 7
  ld l, 0     ; 7
  ld d, l     ; 4
  @loop:
    add hl, hl          ; 11
    jr nc, @hbitnotset  ;  7
      add hl, de        ; 11
    @hbitnotset:
    djnz @loop          ; 13
              ; -5
  ret         ; 10
Looks like a near tie.
6502 worst case: 169 cycles, 94 us
Z80 worst case: 359 cycles, 100 us

Conspicuous by absence from the table:
  • Random access to 8- and 16-bit properties of entities
  • Capabilities: Vertical split-screen scrolling, part fixed and part 8-way
turboxray
Posts: 348
Joined: Thu Oct 31, 2019 12:56 am

Re: Apparently the SMS is better than everything

Post by turboxray »

The 2k table one is still pretty valid haha. I mean c64 guys use it and they just have 64k of ram (part of which is video ram).
psycopathicteen
Posts: 3140
Joined: Wed May 19, 2010 6:12 pm

Re: Apparently the SMS is better than everything

Post by psycopathicteen »

I like how it went off on a tangent about vram bus bandwidth. The only reason why the SMS has a 16-bit bus is because the VDP has 4bpp colors as opposed to 2bpp on the NES.
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Apparently the SMS is better than everything

Post by tepples »

The 16-bit bus isn't only for the 4bpp. It's also for reading the tile number and attribute in the same 2-dot cycle, giving the remaining time slot of the background fetch pattern to the sprite unit and CPU data channel. This allows the SMS VDP to have only secondary OAM on the chip, saving enough die size to allow integration of the PSG on the VDP instead of the CPU. It also allows writes outside vblank.
User avatar
Bregalad
Posts: 8056
Joined: Fri Nov 12, 2004 2:49 pm
Location: Divonne-les-bains, France

Re: Apparently the SMS is better than everything

Post by Bregalad »

turboxray wrote: Fri Jan 03, 2020 8:08 pm https://segaretro.org/Sega_Master_Syste ... comparison

It's great haha. Apparently, to get a systems' total "bus" width, you just add them altogether! Among other things :lol:
How is this site still around??? Crazy.
Well, you just discovered yet another biased SEGA fan. Usually those guys like to spend their lives trying to prove the so-called technical supperiority of the Megadrive against the SNES. It's the first time I hear one "prooving" the supperiority of the SMS against the NES. I never saw the point in doing that. Especially not 30 years after the consoles' end of lifetime.

As for the sound part, at least they admit the NES have one more sound channel (they could have claimed the DPCM doesn't count and that NES has 4 channels). But they offuscate the Sega Master's System inability to produce any bass/low sound, which has always made this console's sound (and thuse the console as a whole) extremely repulsive to me.
psycopathicteen
Posts: 3140
Joined: Wed May 19, 2010 6:12 pm

Re: Apparently the SMS is better than everything

Post by psycopathicteen »

How did SMS games end up getting around the no-sprite flip limit? SMS sprites already took up more memory than NES sprites.
User avatar
Bregalad
Posts: 8056
Joined: Fri Nov 12, 2004 2:49 pm
Location: Divonne-les-bains, France

Re: Apparently the SMS is better than everything

Post by Bregalad »

turboxray wrote: Fri Jan 03, 2020 8:08 pm
It's great haha. Apparently, to get a systems' total "bus" width, you just add them altogether! Among other things :lol:
In this case the NES has 16 CPU adress lines, 8 CPU data lines, 14 PPU adress lines, 8 PPU data lines, we add the CIC and we have a 32-bit system :)
How did SMS games end up getting around the no-sprite flip limit? SMS sprites already took up more memory than NES sprites.
I belive the flip by software and this is simple to do. Still this wastes CPU time and VRAM bandwidth I imagine.
Last edited by Bregalad on Wed Jan 08, 2020 12:56 am, edited 1 time in total.
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Apparently the SMS is better than everything

Post by tepples »

psycopathicteen wrote: Tue Jan 07, 2020 11:46 am How did SMS games end up getting around the no-sprite flip limit?
Cel streaming driven by a bit reverse table.
(See the attachment to the first post in this topic.)
psycopathicteen wrote: Tue Jan 07, 2020 11:46 am SMS sprites already took up more memory than NES sprites.
True, but memory was also roughly proportionally larger.

VRAM write addresses run from $4000-$7FFF. ($8000-$8AFF is registers, $C000-$C01F is palette, and $0000-$3FFF is for VRAM readback.) One typical layout has the nametable at $7800-$7EFF and SAT at $7F00-$7FFF. This leaves $7800 - $4000 = 14 KiB or 448 tiles in VRAM at once. That's more than Game Boy (384), almost as many as NES (512), and enough to give each of the 64 sprites a unique pattern while keeping 320 (in 8x16 mode) or 384 (in 8x8 mode) for the background.
User avatar
tokumaru
Posts: 12427
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: Apparently the SMS is better than everything

Post by tokumaru »

Bregalad wrote: Tue Jan 07, 2020 9:48 amIt's the first time I hear one "prooving" the supperiority of the SMS against the NES.
The North American public is pretty ignorant when it comes to the Master System, so I actually think it makes a lot of sense to compare the NES against the SMS. The Master System is a pretty cool console that unfortunately didn't get much traction in North Amarica, partly because of Nintendo's dirty business practices back in the day.

This article in particular is obviously biased towards the Master System, but I'm sure you can find Nintendo fanboys doing the same with the NES if you look around. Clueless people can be found on both sides.

I like both systems and I'm not able to see a clear "winner" when comparing them. The SMS has better graphical capabilities (with a few catches), the NES has better sound and better controllers, and I don't have enough experience with the Z80 to say how it compares to the 6502 at the clocks used in these systems.
User avatar
Fisher
Posts: 1249
Joined: Sat Jul 04, 2015 9:58 am
Location: -29.794229 -55.795374

Re: Apparently the SMS is better than everything

Post by Fisher »

Well, just a few years ago I was able to forget my "heartache" about SMS and found how cool it is (was?).
I just feel I really lost a big amount of fun time discussing which was better instead actually playing the games.
The fact is all consoles have its pros and cons.

Back in the old days, when they were mainstream, there was a big commercial dispute happening and the kids were main the "targets" of that.
But unfortunately these disputes were not to create the best mascot, best games or anything, these were all just consequences of a dispute to make big bucks for their producers.
I don't think making money is a bad thing, as long as it's done legally and with ethics, what some companies lacked.

And since I think I already deviated enough of the main topic, so nowadays it's better to focus on trying to understand how stuff were made and have fun either playing or programming these old awesome machines. :wink:
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: Apparently the SMS is better than everything

Post by lidnariq »

tokumaru wrote: Tue Jan 07, 2020 5:19 pm The North American public is pretty ignorant when it comes to the Master System, so I actually think it makes a lot of sense to compare the NES against the SMS.
"Compare", definitely. Present things in a way that makes it look like the SMS is the unambiguous winner when it's really rather a tie? Ehh....
The SMS has better graphical capabilities (with a few catches), the NES has better sound and better controllers
In my opinion, the SMS is a "fully baked" design with a lot of compromises – due largely to its ancestry of off-the-shelf parts – while the NES is a "half-baked" design with a lot of accidental (and powerful and relevant) flexibility.
and I don't have enough experience with the Z80 to say how it compares to the 6502 at the clocks used in these systems.
Z80 is roughly equal to 6502 when clocked two to three times as fast (and in practice it always is), with a lot of variation depending on specific workload.
turboxray
Posts: 348
Joined: Thu Oct 31, 2019 12:56 am

Re: Apparently the SMS is better than everything

Post by turboxray »

lidnariq wrote: Tue Jan 07, 2020 6:48 pm In my opinion, the SMS is a "fully baked" design with a lot of compromises – due largely to its ancestry of off-the-shelf parts – while the NES is a "half-baked" design with a lot of accidental (and powerful and relevant) flexibility.
This haha.
Z80 is roughly equal to 6502 when clocked two to three times as fast (and in practice it always is), with a lot of variation depending on specific workload.
This too.


It's not just performance in specific situations, but also how efficiently either processor ramps up with limitations of memory start to be removed? I don't know to be honest. I know the z80 gets better performance from when data is 256 byte aligned (for obvious reasons), and the 65x excels with fast small LUTs for all kinds of things (even 2nd and 3rd order indirection), splitting data into byte value arrays (16bit, 24bit, 32bit, etc). Self-modifying code is pretty nice on the 65x as well, but it probably has more of an impact on the z80 because of its limited direct access memory modes. z80 is strong at sequential reading, which made it pretty decent for doing planar compositing in realtime (see Golden Axe, Altered Beast, etc), but it's pretty slow for random access and LUTs compared to the 65x.

In general though, I'm pretty sure there are more examples of SMS games running at 30fps than the NES. And being slower paced than NES games (not sure if that's by design or by limitation - real or imagined by the developer). Systems as a whole, I definitely see having a direct visual advantage as one impact (not that the NES doesn't have visual aspects the SMS can't do or do as well, like dynamic tiles).

The audio difference between the two, while not so drastic on paper, is huge in practice. The SMS stuff has that terrible 'same-y' sound. Even euro arpeggios can't fix it. It's just grating on the ears. Doesn't matter how good the game looks, if the sound is unpleasant then it's a no-go for me. I thought modern chiptuners would have pulled some nice sounding stuff out of the chip by now, but I've yet to hear anything going beyond that typical SMS sound. The FM addon for japanese models is definitely an upgrade, but it lacks character that its bigger cousins have (and I rather have NES sound chip over it). It's not offensive, but it's kinda bland.
Post Reply