Source code of Famicom Ninja Game released

You can talk about almost anything that you want to on this board.

Moderator: Moderators

Post Reply
User avatar
Gilbert
Posts: 564
Joined: Sun Dec 12, 2010 10:27 pm
Location: Hong Kong
Contact:

Source code of Famicom Ninja Game released

Post by Gilbert »

Don't know whether anyone knows this or is this already discussed here, but a certain programmer released on GitHub the original source code of Huds*n Soft's (censorship NOT applied by the forum's filters, so do not look for your mom :roll: ) of the Famicom game Ninja Hatt*ri Kun, which was quite popular back in the day.
https://github.com/omuanko/nnjhtrkn

More info here (Japanese). It needs an old assembler called ACT65 on CP/M86 to assemble (the game was before H*dson wrote their own assembler which was later also used in PCE game development), but I think it wouldn't be hard to edit them to use modern ones such as ASM6 and CA65.
Pokun
Posts: 2681
Joined: Tue May 28, 2013 5:49 am
Location: Hokkaido, Japan

Re: Source code of Famicom Ninja Game released

Post by Pokun »

Why do you apply censorship then?
Speaking of Hudson's assembler, I remember reading somewhere (probably on this forum) that nesasm/pceas was derived from Hudson's assembler that they used for NES and PC Engine development. But according to the Magickit readme it's based on the source of J. H. Van Ornum's old assembler from 1984 (I guess it's the one called as6502 that he wrote at AT&T Bell Labs), so this might not be the case.


Anyway thanks for sharing this! It's great to finally see some original source code from a Japanese developer of a classic game. It's fun to see that the comments are written in Japanese but using roman letters.

They explain that it was common to use half-width roman alphabet characters only in file names and in source code to avoid problems. CP/M would only allow ASCII in file names and they have to be 8+3 characters long.
(On modern computers in Japan everything is usually written with full-width Japanese characters, including in filenames. This is a pain when using a console environment where you have to type long filenames with a mix of characters. I remember my old programming teacher in Sweden teaching me to only use short filenames in ASCII and no spaces to make files easier to handle. Then again he had been a programmer almost as long as computers existed).

They also explain that the source is built executing the "A.BAT" file in an environment that can run CP/M executables and act65 is also available.

They say it's an "absolute assembler", which means it doesn't produce any intermediary files because there is no linker. It takes a single source as input and outputs a single assembled file. I guess asm6 and nesasm both counts as absolute assemblers in that case.

At the end of "HAT.A65" there are a bunch of "link" directives which seems to link all source files in to a single large source file that is fed to the assembler. So this "link" directive is basically like the "include" directive in asm6 and nesasm.

Then he says that in the middle of the '80s, computers started to become 16-bit and DOS and linkers started to emerge at this time. This may look primitive but was much better than assembling by hand, he adds. There is a 1982 usenet post here explaining ACT-65 in English.
Funny that we are still using absolute assemblers today, although ca65 is about equally popular here to asm6 and nesasm.

He goes on saying that computers could only display 80 columns and 25 or 24 lines if the function key display is disabled. Only being able to view the source code in such a low resolution scares him he says.
I guess that's one aspect of retro computers that most people doesn't miss. Having to do productive work on them (the reason the computers existed in the first place).

Finally he says that although the source could be created using disassembly, this source is incredibly important and has historical value since it comes from one of the earliest console development environments, just a few years after VCS. And that's the reason why he released this on git in the first place.
I can only agree, although I have no idea what VCS is. :)
User avatar
NOOPr
Posts: 75
Joined: Tue Feb 27, 2018 10:41 am
Location: Brazil
Contact:

Re: Source code of Famicom Ninja Game released

Post by NOOPr »

Gilbert, thanks for share!
Pokun, thanks for the translation!

I think that VCS stands for Atari Video Computer System, the Atari 2600 one.
User avatar
nesrocks
Posts: 563
Joined: Thu Aug 13, 2015 4:40 pm
Location: Rio de Janeiro - Brazil
Contact:

Re: Source code of Famicom Ninja Game released

Post by nesrocks »

Amazing!!

If he ever reads this, or anyone else: please release source codes if you have them (and if you can). It is ALWAYS welcome!
https://twitter.com/bitinkstudios <- Follow me on twitter! Thanks!
https://www.patreon.com/bitinkstudios <- Support me on Patreon!
User avatar
Bregalad
Posts: 8056
Joined: Fri Nov 12, 2004 2:49 pm
Location: Divonne-les-bains, France

Re: Source code of Famicom Ninja Game released

Post by Bregalad »

Amazing !

Apparently the "perversion" of using [] for indirection instead of () for 6502 code already started back then ^^

Also there was a debuging device using $6000-$7FFF and some ZP RAM as well apparently.
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Source code of Famicom Ninja Game released

Post by tepples »

Might the censorship have something to do with trying to hide this from Konami's legal representatives? (Konami acquired this game's publisher.)

Filenames without spaces are still useful in programming, as build tools such as Make don't handle spaces transparently. It's also good to keep filenames short enough to be typeable, but the 8.3 limit in particular hasn't been that important since Windows XP eclipsed Windows 9x's usage share.

VCS also stands for version control software.
Pokun
Posts: 2681
Joined: Tue May 28, 2013 5:49 am
Location: Hokkaido, Japan

Re: Source code of Famicom Ninja Game released

Post by Pokun »

The source is referred to as a "certain programmer" throughout the article, so I guess he (or she) wants to be anonymous.
Yeah I also thought VCS could be version control software. By "console development environment" I didn't mean console in the modern context of "game console" but rather a computer console (virtual or physical).

Bregalad wrote: Mon Jan 13, 2020 7:54 am Apparently the "perversion" of using [] for indirection instead of () for 6502 code already started back then ^^
Hudson's assembler peas which is used with Develo (comes both in a PC-98 and an MSX version I think) also seems to use [] for indirection. Maybe they where inspired by act65 that they used before they made their own assembler.
Ironically J. H. Van Ornum's as6502 seems to use () for indirection while [] are reserved for mathematical expression parenthesis, so it's kind of strange that magickit/nesasm/pceas didn't go the same route. Maybe they where inspired by Hudson's assembler.
User avatar
Gilbert
Posts: 564
Joined: Sun Dec 12, 2010 10:27 pm
Location: Hong Kong
Contact:

Re: Source code of Famicom Ninja Game released

Post by Gilbert »

Pokun wrote: Mon Jan 13, 2020 5:19 am Why do you apply censorship then?
Just to keep the spirit of the original programmer who leaked the source code while keeping his identity and the game's name "anonymous", even though everyone knows who he is and what the game is, so I opted to apply "useless censorship" here instead of like, calling Hu*son Soft Mother Soft.
User avatar
Gilbert
Posts: 564
Joined: Sun Dec 12, 2010 10:27 pm
Location: Hong Kong
Contact:

Re: Source code of Famicom Ninja Game released

Post by Gilbert »

tepples wrote: Mon Jan 13, 2020 8:42 am Might the censorship have something to do with trying to hide this from Konami's legal representatives? (Konami acquired this game's publisher.)
Probably this and that it was a licensed game of a very famous anime/comic from very famous authors (not to mention that the show became extremely popular in India since the 00's which uncancelled the show in recent years) so making this anonymous and applying slight censorship at least keep it under the radar like less likely to pop up as a result from web search.

I did hesitate a bit before posting here as the source contains copyrighted assets, but then it's the original source code released by the original developer (but possibly not the copyright holder(s)) instead of an disassembly (I think the SMB disassembly proposedly misses out the CHR rom to avoid troubles though). I think this may be in a gray area similar to NSFs, but if this is deemed a violation of the forum rules feel free to lock/remove this thread.
Post Reply