
Super Mario Bros. has been released for the Commodore 64 - muterad_murilax
https://www.lemon64.com/forum/viewtopic.php?t=71262
======
muterad_murilax
Gameplay video:

[https://www.youtube.com/watch?v=XIwlhQpC0-k](https://www.youtube.com/watch?v=XIwlhQpC0-k)

~~~
koala_man
Impressive. Without the intro and careful scrutiny, I would not have realized
that this is not a NES

~~~
vidarh
Not that surprising, given the CPU in the NES is a second sourced near-6502
(Ricoh 2A03) though running a bit faster apparently. But there's nothing in
there that's hard to do on a C64 (and in fact before this there was The Great
Giana Sisters, released in '87, that was so similar - including a near
identical first level - that Nintendo threatened to sue and it was taken out
of the stores; but of course "everyone" had copies soon enough anyway)

EDIT: Here's a video of the C64 version of Giana Sisters:
[https://www.youtube.com/watch?v=8teXm6723-g&t=1309s](https://www.youtube.com/watch?v=8teXm6723-g&t=1309s)

~~~
ddtaylor
I think the NES's PPU is a lot more powerful in some ways than the C64 VIC-II
chip. The NES's PPU supports multiple background layers, priority, pixel
collision detection and has up to 64 sprites on screen at once - albeit with
some limitations on how many are on each scanline. The VIC-II can only do 8
sprites at a time without scanline raster tricks (and if we count those the
NES can do more than 64 too)

~~~
phoboslab
IIRC the NES PPU only supports one background layer. You can just change the
scroll position mid-frame to give it the illusion of multiple background
layers.

See here for some clever examples of this technique. Everything that's
overlapping is done with sprites:

[https://youtu.be/ZGyFQ9aRp_U?t=579](https://youtu.be/ZGyFQ9aRp_U?t=579)

~~~
ddtaylor
You're right, I was thinking of the SNES which had multiple background layers.

------
jonathankoren
This is interesting, because I used to have a bootleg “Super Mario Bros” for
the C64 back in the day.

The gameplay was similar, and it certainly had characters that looked like
SMB, but after about world 1-1, the game got progressively different. Like one
novel element the game had were these walkways that would disappear as you
walked over them.

It wasn’t a bad game. Just a different game. I think this it[0]. Apparently
it’s a resedited version of the SMB knockoff The Great Giana Sisters [1],
which I had never heard of until now.

[0]
[https://www.youtube.com/watch?v=OgFzyM3my7M](https://www.youtube.com/watch?v=OgFzyM3my7M)

[1] [https://www.retrogamer.net/retro_games80/the-making-of-
the-g...](https://www.retrogamer.net/retro_games80/the-making-of-the-great-
giana-sisters/)

~~~
Sharlin
Oh, the memories. _Giana Sisters_ was the first video game I ever seriously
played.

~~~
Kurtz79
Yup, the first thing I thought when I read the title was "well, we already had
our own Mario".

To be fair, it was a decent ripoff, but controls and levels were nowhere as
good as NES Super Mario.

~~~
jonathankoren
Controlwise they were limited by the 4-way digital joystick with one fire
button. They are fine what they had to work with.

------
gaogao
The smooth scrolling is pretty hard. One of my favorite bits of Masters of
Doom about id Software was when they hacked a port of Super Mario Bros 3 to
the PC, but as history can tell, Nintendo didn't bite on that one.

[https://www.youtube.com/watch?v=1YWD6Y9FUuw](https://www.youtube.com/watch?v=1YWD6Y9FUuw)

~~~
BurningCycles
Well this is on the Commodore 64, and smooth scrolling was quite easy on this
machine as it had hardware support for scrolling and raster interrupts.

~~~
gaogao
I stand corrected, as what I had mentioned was only necessary given lack of
hardware support for scrolling. Good catch.

~~~
codesushi42
Yes. It was hard for Commander Keen because DOS used a screen buffer that was
written to first before rendering the pixels to screen, which was quite slow
back then.

In comparison, game consoles used blitting, and would directly send the lines
to the CRT to draw. I assume C64 is the same.

~~~
comex
That’s true, but this is from the readme

> VSP (VARIABLE SCREEN POSITIONING)

> This port relies on the VSP-technique for scrolling. If you experience
> crashes while playing the game, this is most likely the issue. You may find
> out if your computer is prone to crashing by running VSP Lab.

I don’t know anything about the C64, but it sounds like scrolling the screen
in this case wasn’t easy at all, if it required a technique that outright
crashes on some C64s.

~~~
jepler
Best explanation of vsp (or, vsp-induced crashing) I'm aware of:
[https://www.linusakesson.net/scene/safevsp/index.php](https://www.linusakesson.net/scene/safevsp/index.php)

~~~
codesushi42
Interesting. So is VSP something that was officially documented, or was it an
undocumented hack that was discovered?

The blast processing trick on the Genesis would be something similar then.
There's a syncing issue with that one too:
[https://www.youtube.com/watch?v=rvvL6S5Buiw](https://www.youtube.com/watch?v=rvvL6S5Buiw)

~~~
vidarh
It's an undocumented hack. The C64 officially does support vertically and
horizontally shifting the display one whole character position pixel by pixel
by changing a register, but VSP is a hack that allows scrolling much more
without copying memory.

It's odd to use for such a simple game as Mario, as I can't see how it's
possibly complex enough that they couldn't afford to scroll "normally".

~~~
phire
The CPU isn't really fast enough to fine-scroll large sections of the screen.

It runs at about 1mhz, and which means there are about 16,000 CPU cycles per
frame. The CPU typically takes 3-7 cycles per instruction, so you have a
maximum of 5600 instructions per frame.

The there is a useful "rotate memory left/right" instruction which takes 7
cycles. An unrolled loop of these could shift about 2000 bytes of memory
left/right per frame. A 160x200 2bit color bitmap mode screen takes up 8000
bytes, so at the very least you can shift ¼ of the screen.

That might be enough for super Mario Bros, if you can be smart about empty
areas.

Except, I skipped over a few things. To scroll 2bit graphics, you have to
rotate twice. 14 cycles per byte, so we are down to ⅛ of the screen.

And such scrolling only works if each line uses the same 4 colors. To have
more than 4 colors per line you have to shift the attribute bytes too, and
deal with attribute clashes when a tile is halfway between two vic2 tiles.

You would be lucky to shift a sixteenth of the screen per frame, with zero
time left over for processing gameplay and sprites.

~~~
vidarh
> The CPU isn't really fast enough to fine-scroll large sections of the
> screen.

That's fine; it is not how you'd do it on the C64. Nor was VSP very common.

> The there is a useful "rotate memory left/right" instruction which takes 7
> cycles. An unrolled loop of these could shift about 2000 bytes of memory
> left/right per frame. A 160x200 2bit color bitmap mode screen takes up 8000
> bytes, so at the very least you can shift ¼ of the screen.

Nobody used bitmaps to for scrollers on the C64 (or indeed for most games). A
game screen using character mode takes at most 2000 byes if you need to scroll
the entire screen, including color RAM, which you wouldn't be doing as you'd
spend some space on other things, like score displays etc., and putting more
static decorations was indeed a common way of cutting down on the amount
actually scrolled. Another way was to do level designs so that you did not
have to scroll everything every time. E.g. by keeping some lines using the
same colour, or fill part of the screen with sprites instead of characters.

To scroll the first 7 pixels in any direction then only requires updating a
single register to shift the screen. This applies for bitmaps too, so there
really are _no_ circumstances where you'd bit-shift bitmaps to scroll.

For the 8th pixel you need to copy, but you don't need to complete the copy in
one frame; you just need to outpace the raster-beam. So the moment it has
rendered the first full line of text, you can scroll it; as long as you take
care to not speed past the rendering, then you can continue following past. If
you do this you have nearly two full frames to complete the copy, for about
1000 byes per frame.

------
gattilorenz
> Since the NES-processor is clocked (roughly 70%) faster than a stock C64
> there can be slowdowns during gameplay

Well, it's impressive that it works without being always painfully slow, then.
How is this done?

~~~
tenebrisalietum
The more significant advantage of the NES over the C64 is the way hardware
scrolling works.

The NES supports a 4-screen screen memory or "nametable", and the PPU, or
graphics chip, can be programmed with one or two register writes to basically
display any position within that 4 screens. Scrolling is just updates to the
scroll registers and populating new video data on the incoming edge (which has
to happen during VBLANK).

Whereas the C64's VIC-II can only select a few fixed places to start reading
video memory to render the screen (2k boundaries for text mode). It can finely
shift the screen left or right up to 8 pixels, but scrolling past that
requires a many, many cycle recopy of RAM to video memory. Throw in the need
to recopy color memory as well and that puts the C64 at a serious
disadvantage.

Looks like this game on the C64 used some really advanced technique called
VSP, which tells the VIC to I guess read from arbitrary memory addresses
instead of the fixed ones it normally supports. This apparently exposed a VIC-
II hardware bug that can corrupt RAM (since VIC-II is responsible for DRAM
refresh). Really interesting. Seems some systems are more susceptible to this
hardware bug than others, and there's difficult software workarounds for it.

~~~
vidarh
Scrolling at _most_ requires copying 2K. In practice much less - even without
VSP, Mario levels usually have lots of long runs of the same tiles all over
the screen that makes it simple to optimize the copying (or rather optimize
which parts you don't need to copy).

For that matter you _could_ double buffer and spread the copying of the tiles
(not the colors) over multiple frames. The normal approach if you for whatever
reason could find a way to copy what you needed, though, was simply
constraining the amount of the screen you used a bit and e.g. putting extra
decoration top/bottom.

But really, Mario should not be a challenge to do this for - the C64 had tons
of platform games of similar complexity. Especially Giana Sisters - put this
video of Giana Sisters side by side with the Mario version above from the
start of level 1, and see why Nintendo threatened the publishers:

[https://www.youtube.com/watch?v=8teXm6723-g](https://www.youtube.com/watch?v=8teXm6723-g)

(EDIT: I've not checked, but e.g. the clouds in Giana Sisters in some of the
levels looks like they might be sprites - using sprites for some of the
"background" objects, especially if mostly vertically separated from the main
game area was certainly a common method of reducing the amount of background
that needed to be copied; notice how the levels without clouds mostly have
several lines worth of tiles that doesn't require colour updates near the top
and bottom, and often hardly ever requires any copying at all - e.g. mostly
unbroken runs of floor tiles; many of the levels requires pretty much no
colour updates anywhere)

The only reason I can see for using VSP here is because it means less need to
actually figure out how to do the copying efficiently.

~~~
djmips
you don't need to double buffer to amortize the copy time. That is you don't
need to do all of the copying in the vertical sync time. As long as you stay
ahead of the raster you can spread the copy over the subsequent frame. So in
my scrolling routine I start copying the top portion and work my way down the
screen to stay ahead of the raster. Interrupts still fire during this time and
handle some game updates / joystick reads.

------
jimrhods23
This is amazing!

When I was a kid, this is exactly what I wanted. We had a Commodore 64, but my
parents wouldn't get an NES. They eventually got me one, but it was when all
of my friends already had the SNES.

~~~
gnarbarian
LOL your parents were sadistic.

~~~
benj111
No they aren't

[https://xkcd.com/606/](https://xkcd.com/606/)

~~~
Insanity
Does not hold up nowadays, at least not for multiplayer games which is why a
majority of people play. If you get the game after 5 years, most of the online
games will be dead.

On the other hand, here I am, playing Counter-Strike:Source every weekend with
a group of friends. But I'd say CS:S (and the older games in general) are not
following the modern trend of multiplayer games. I doubt the latest CoD
(whichever one it is) will be playable online in 5 years.

------
jwr
Cool clone, but we all know that Giana Sisters is the original game.

~~~
weinzierl
It is embarrassing but I really only learned more than a decade later that
Giana Sisters was not the original.

In Germany, and I guess in many other European countries, Giana Sisters on C64
was really _the_ Jump and Run game (that's what we called that kind of game
back then) of the 8-bit era. Super Mario was not heard of. This all changed
when the Game Boy came out because it had Super Mario, but this was of course
a few years after the 8-bit home computer wave peaked here. So many of my
generation learned about Super Mario years after they knew Giana Sisters.

For those that have never heard about Giana Sisters. It is essentially a Super
Mario clone with Mario and Luigi replaced by two girls - Giana and Maria. The
levels and the game-play are not 100% identical by very similar. It was sold
only for a very short period of time because Nintendo intervened. It was still
hugely popular and most copies were just pirated.

~~~
zapzupnz
Some company later released Great Giana Sisters games for the Nintendo DS (and
presumably some other platforms, maybe PC) with updated graphics. Roughly the
same gameplay but very different look and feel.

------
zamadatix
For an extremely limited port check out SMB ported to the Atari 2600
[https://youtu.be/8fSO-UTdCI8](https://youtu.be/8fSO-UTdCI8)

~~~
colordrops
Wow, this would have been the #1 seller on the platform if it came out during
the 2600's heyday. Quality is much better than most other 2600 games.

~~~
guidedlight
Unfortunately that port uses a 32kb ROM which likely would have never get
published, due to the huge expense of doing so.

That’s why the quality is so much higher. It’s a great example of what can be
achieved when these limitations no longer apply.

My favourite modern day Atari 2600 port is Pac-Man 4k.
[https://youtu.be/dAYuBcuvIww](https://youtu.be/dAYuBcuvIww)

------
loser777
Wished they had taken the opportunity to show off the C64's solid sound chip
hardware advantage over the NES ;)
[https://www.youtube.com/watch?v=X_cbQh8og70](https://www.youtube.com/watch?v=X_cbQh8og70)

------
bitwize
Wow. This is the real deal, not a spritehack of Giana Sisters. Modulo a bit of
slowdown, it's faithful to the original. Absolutely bananas. How did they get
that high resolution with all the sprite colors?

------
axilmar
What is so special about this? was the C64 supposed to be not powerful enough
for SMB?

The game 'Great Gianna Sisters', which exists for C64, is very similar to SMB.

~~~
rpiguy
NES is more powerful. 70% faster CPU, GPU is much more powerful. Commodore 64
was engineered in 1981 and released in 1982. NES is almost five years newer.
C64 had a RAM advantage, but later NES carts had mapper chips.

~~~
muterad_murilax
Actually, the Famicom (Japanese NES) came out in 1983. Super Mario Bros. was
released in 1985.

------
lux
Is there a list of SMB ports online somewhere? I was searching the other day
and found some scattered info but didn't find quite what I was looking for.

~~~
LocalH
As far as actual ports of the NES code go, I think there was one back in the
day on the TG16/PCE, there was one a few years back for the Genesis/MD, and
this. I also want to say I think someone ported it to the SNES?

~~~
muterad_murilax
I don't know if it qualifies as a port, but Hudson Soft's Super Mario Bros.
Special for Japanese home computers comes to mind. (It completely lacks
scrolling and takes some liberties with the level design and includes extra
power-ups, though.)

Also there is of course Super Mario Bros. Deluxe for the Game Boy Color,
ported by Nintendo themselves.

------
riq_
Best possible combination: Super Mario Bros for the C64 using NES bluetooth
gamepads: [https://youtu.be/G77mDe3NuBs](https://youtu.be/G77mDe3NuBs)

------
tibbon
What are the biggest differences between a C64 and NES really? They both use a
6502 right? What prevents you from just overclocking the C64 to match the
speed of the NES? Different memory layout?

~~~
throwaway2048
8 bit micros of the era are much more dependent on their graphics hardware,
what makes this demo impressive is that the c64 had a much more limited
graphics chip than the NES (fewer sprites, fewer colors, and no support for
tile based scrolling)

~~~
vidarh
> no support for tile based scrolling

Pretty every scrolling game on the C64 uses the character mode as "tiles". It
may well have been more limited than the NES - I have no idea what the NES
hardware was like, but it reduced the amount of copying enough that it was
rarely a major problem. The low number of hardware sprites usable per raster
line was sometimes a limitation, but not very often - people got around it by
using characters and/or careful level design.

While this is cool, I'm surprised people find this impressive - it's nothing
special for C64 games. E.g. compare the Mario clone Giana Sisters (1987):

[https://www.youtube.com/watch?v=8teXm6723-g](https://www.youtube.com/watch?v=8teXm6723-g)

To a more technically impressive C64 scrolling game like R-Type:

[https://www.youtube.com/watch?v=Bft5BhWIzTU](https://www.youtube.com/watch?v=Bft5BhWIzTU)

Or Shadow of the Beast (though a shadow - sorry - of the Amiga version) with
its many parallax layers:

[https://www.youtube.com/watch?v=R_GdJiEjSho](https://www.youtube.com/watch?v=R_GdJiEjSho)

Both have heavy use of a mix of raster interrupts to scroll independent parts
of the screen separately, and sprites, coupled with updating the bitmap of
some custom characters.

~~~
djmips
Getting an exact port like SMB is very impressive both to the initiated and
the uninitiated. Great Gianna Sisters aside, this SMB port is impressive. To
the uninitiated it's impressive because they may have never expected the C64
could do such a thing. But that's fine.

To the initiated this port is impressive because of the level of polish;
attention to detail and quality of the gameplay matching the original.

Anybody can carve wood but only a great artist can do it very well.

This is a game not a tech demo. The Shadow of the Beast was a demo even on the
Amiga.

Where we agree is R-Type. Superb.

~~~
vidarh
The level of polish may be artistically impressive to those familiar with the
original game, but it's not particularly _technically_ impressive. It's not a
complex game by C64 standards, and to have slowdowns in such a simple game
does not feel like it's polished.

I get that this is a port, and that they've more concerned with matching the
original as closely as possible and less with optimizing for the C64, and
that's of course a valid choice, and praising them for matching the original
is not something I take issue with.

I'm just surprised that people find it impressive.

To me, looking at it, I wasn't impressed because I remember the games I played
at the time, and it just doesn't compare all that favorably.

------
ddingus
That is amazing work!

So nice to see that hardware continue to see development and people pushing
the boundaries.

------
politician
The real question now is whether 4:55 is still the fastest time the game can
be finished.

~~~
LocalH
It's so close to the original, that I think it's probably possible, especially
if running on a turbo system.

------
altitudinous
Surely Nintendo are going to be all over this and get it removed?

~~~
viraptor
I'm not sure. Given all the romhacks of SMW produced in the last couple of
years and nobody getting sued (even though the authors are known/popular), I
don't think they'd bother with suing for the C64 port. Just search for
"romhack" on twitch.tv if you haven't seen those yet.

~~~
throwaway2048
They don't sue, but they aggressively take down and demonetize any Nintendo
related content on YouTube (even if only extremely tangential)

------
reneberlin
<3 Time to resurrect my C64 from the cellar. <3

------
themodelplumber
I just barely learned about the (not exactly new) Star Wars RPG REUP and now I
see this. Some of these fan-created projects are amazing.

------
zeristor
What next? Manic Miner for the ZX Spectrum?

------
sys_64738
Is this a reskinned Great Gianna Sisters?

~~~
prvc
No.

------
huxflux
Seven years of dev, true heroes!

------
mproud
C&D any time now…

------
codesushi42
Wow, very impressive.

I have been meaning to check out this book on C64 game programming, for anyone
interested: [https://www.amazon.com/Retro-Game-Dev-Derek-
Morris/dp/069298...](https://www.amazon.com/Retro-Game-Dev-Derek-
Morris/dp/0692980652/)

------
anonlastname
Thank god. Now I can finally sleep at night.

------
jphalimi
I am sorry if this is off-topic, but is this board running phpBB2 from 15
years ago? I have used most versions of phpBB until 2015, they all came with
so many security holes, I have been hacked so many times because of it, how is
this board still up and running!?

------
piokoch
Aside from the main topic (amazing stuff, undoubtedly). It was sooo good to
visit normal forum, not Twitter, not Facebook, not Reddit, just a forum run by
passionate people.

Sadly, European Union is working very hard to make maintenance of such forums
almost impossible.

First we got GDPR and "right to be forgotten", so anyone can demand ones posts
to be deleted. Then came infamous article 11 and 13, with obligatory content
filtering. Now, there is TERREG regulation being accepted, which requires
removal of "terrorists content" in 1 hour, otherwise there are huge fines.
This will not stop spreading terrorist content, obviously, but a malicious
person can post something "terroristic" in the middle of the night and report
forum owner, who would have 1 hour to delete such content...

