This page is a mirror of Tepples' nesdev forum mirror (URL TBD).
Last updated on Oct-18-2019 Download

NES Transcoder - Can Anyone try to Reprogram?

NES Transcoder - Can Anyone try to Reprogram?
by on (#32860)
I am planning to use this for a NES to Sega Genesis conversion of SMB. But first I need someone to reprogram NES Transcoder, If the Author is here. Please make another version.

URL:
http://hamtaro126.sitesled.com/NESTranscoder.zip

by on (#32862)
Uh...reprogrammed how? What does the program do? I can't find any information about it on Google.

I'm going to assume (based on the lone text file included) that it converts 6502 code to 68k, which is just one of many steps involved in getting SMB to run on a Genesis. Based on your past record, I have to ask: do you even know what you're getting yourself into?

by on (#32865)
BMF54123 wrote:
Uh...reprogrammed how? What does the program do? I can't find any information about it on Google.

I'm going to assume (based on the lone text file included) that it converts 6502 code to 68k, which is just one of many steps involved in getting SMB to run on a Genesis. Based on your past record, I have to ask: do you even know what you're getting yourself into?


1: It basically turns 6502 ROM format into 6502 or 68k. But for it to be better, as well as accurate, It requires work. I do know how VB works, So I could let someone do something about it. As it cuts code improperly, and it is a bug.

2: I already know that I must recode the video, audio, and more if I port SMB to genesis. I have some code and programs from Romhacking.net and a few genesis dev sites that can be used.

3: It was by Orbit2002, But he went away (Might be no more interest in NESdev?)
Re: NES Transcoder - Can Anyone try to Reprogram?
by on (#32866)
Hamtaro126 wrote:
Please make another version.

I don't think you can ask people to work for you like that... even if you say "please"! :shock:

by on (#32886)
Oh it's easy. All you have to do is grab the SMB Disasm someone did and rewrite it for the 68000 using the Genesis hardware. Should only take you a couple minutes with the Convert-NEStoGenesis-omatic-For-Noobs program.

The second sentence was serious though.

by on (#32894)
For anybody who has programmed the Genesis and the NES, how fundamentally different is the Genesis VDP from the NES PPU? Sure, the attribute tables differ (one attribute per tile, like the GBC and SNES, not for every 2x2 block of tiles) and the pattern table format differs (4-bit packed, like the GBA, not 2-bit planar).

by on (#32897)
I believe the MD VDP can emulate everything the NES PPU can do relatively easy... The attribute thing you mentioned, for example, as long as MD has a better resolution than the NES, we're safe, since replicating data is not a big deal. Converting the patterns for sure would not be a problem.

I know the VDP has a video mode with a resolution that's 256 pixels wide (in addition to the more common 320), and I think you can set the height to 240, making the screen the same size as in the PPU. The name tables (don't remember if they're called that), however, can't be 30 tiles tall, it has to be 32 or 64. Not really a problem for a side scroller. It supports sprites of various sizes, from 8x8 to 32x32, so there is no problem in using 8x8 or 8x16. I'm not really sure how it handles sprite priorities, but I know that each background tile can be in front or behind of them, something the NES doesn't have. That's all I can think of right now. At least for SMB, it seems pretty doable without many modifications.

EDIT: Although a direct conversion seems possible from a graphical point of view, if the game is going to look the same, what's the point?

by on (#32901)
Maybe to Sega-ize the soundtrack. And maybe to also add some new features.
Re: NES Transcoder - Can Anyone try to Reprogram?
by on (#32902)
Hamtaro126 wrote:
I am planning to use this for a NES to Sega Genesis conversion of SMB.


You are funny.

Why would anyone want to develop on the Genesis? You can count the games with good music on one bollock.

by on (#32903)
tokumaru wrote:
I believe the MD VDP can emulate everything the NES PPU can do relatively easy... The attribute thing you mentioned, for example, as long as MD has a better resolution than the NES, we're safe, since replicating data is not a big deal. Converting the patterns for sure would not be a problem.

I know the VDP has a video mode with a resolution that's 256 pixels wide (in addition to the more common 320), and I think you can set the height to 240, making the screen the same size as in the PPU. The name tables (don't remember if they're called that), however, can't be 30 tiles tall, it has to be 32 or 64. Not really a problem for a side scroller. It supports sprites of various sizes, from 8x8 to 32x32, so there is no problem in using 8x8 or 8x16. I'm not really sure how it handles sprite priorities, but I know that each background tile can be in front or behind of them, something the NES doesn't have. That's all I can think of right now. At least for SMB, it seems pretty doable without many modifications.

EDIT: Although a direct conversion seems possible from a graphical point of view, if the game is going to look the same, what's the point?


Tokumaru: I want it converted because the Genesis has better features, But I cannot do it on the SNES, Because it is hard to know how to put certain tiles (Status bar, Tiles, etc) in the SNES's PPU (Layer Related) and the Genesis is a little better anyways. As for the SNES's sound, It is kinda hard to create.

Anyone: If anyone wants recode the SMB disassembly for me, and I can create Graphics (and optionally Maps and Sound). and turn it to a accurate conversion, Please PM me.

by on (#32905)
tokumaru wrote:
I know the VDP has a video mode with a resolution that's 256 pixels wide (in addition to the more common 320), and I think you can set the height to 240, making the screen the same size as in the PPU.

SMB1 doesn't really use anything outside the center 208 lines anyway.

Quote:
EDIT: Although a direct conversion seems possible from a graphical point of view, if the game is going to look the same, what's the point?

It'd be the opposite of your Somari sequel: to show how much effort an NES->Genesis port would involve. A few plug-and-play TV games are known to use a Genesis-on-a-chip. Or to try an All-Stars style graphical upgrade. Or to provide enough space in the palette to get Mario+Luigi co-op going, just as Sonic 2 has Sonic+Tails.

by on (#32906)
This reminds me of those PCE NES ROM set compilation pirates that I found once.

Which is funny because I played it on PCE Advance, which means the gameboy is emulating the PCE ROM which is an emulation of Super Mario Bros.

by on (#32907)
I just checked again and it seems like I was wrong about the display size... well, kinda... only in PAL you can have 240 scanlines, in NTSC, apparently, the closest you can get to the NES is 256x224. This would still probably work pretty well, since NES games shouldn't have anything interesting in the top and bottom 8 scanlines. In this mode you can use 64 sprites, exactly what's needed to mimic the NES.

The best playfield size to emulate vertical mirroring would be 64x32 tiles, I guess. Something I didn't mention before was palettes... There are 4 of them each one with 16 colors. One could probably use the first 4 colors of each palette for the BG and the following 4 for the sprites. The patterns would have to be further adjusted for this, but in the end it would work pretty much like the NES.

Oh, and the priority control for sprites works pretty much like we're used to. The tiles of each background plane also have priority control, but if those are left untouched it should work like the NES. There are horizontal and vertical flipping bits too.

by on (#32909)
tepples wrote:
It'd be the opposite of your Somari sequel

Oh crap, don't call it that! :evil:

Quote:
to show how much effort an NES->Genesis port would involve.

From what I can see, the Genesis/MD can handle it all pretty well. The only real problem I found, PPUxVDP-wise, is that you can't have a 30-tile tall name table. This would be a problem if there was any vertical scrolling involved, which is not the case of SMB though.

I just had an idea though... since the NES has only one BG layer while the MD has 2, it should be possible to have both be 32-tile tall and have them aligned as if they were 30-tile tall, each one simulating a name table. Using transparent tiles on the 2 unused rows should do the trick.

Quote:
A few plug-and-play TV games are known to use a Genesis-on-a-chip. Or to try an All-Stars style graphical upgrade. Or to provide enough space in the palette to get Mario+Luigi co-op going, just as Sonic 2 has Sonic+Tails.

I see. However, in the case of graphical updates, mapping PPU features directly into VDP features is not all that important, since the graphics will be redone anyway you could very well redesign them to make better use of all the features.

by on (#32910)
tokumaru wrote:
Quote:
A few plug-and-play TV games are known to use a Genesis-on-a-chip. Or to try an All-Stars style graphical upgrade. Or to provide enough space in the palette to get Mario+Luigi co-op going, just as Sonic 2 has Sonic+Tails.

I see. However, in the case of graphical updates, mapping PPU features directly into VDP features is not all that important, since the graphics will be redone anyway you could very well redesign them to make better use of all the features.

True, but it's also useful to establish an effort-improvement curve. For example, it takes x effort to make a 1:1 port, or x+y effort to add this kind of enhancement, or...

by on (#32913)
Yuji Naka supposedly wrote a NES emulator for Genesis.

by on (#32914)
Quote:
Yuji Naka supposedly wrote a NES emulator for Genesis.


I wrote a partial NES emulator for the Megadrive a couple of years ago. I never wrote any rendering code, so the only graphical output it had was displaying the current NES palette every frame. Of course the speed was horrible..

by on (#32915)
Hamtaro126 wrote:
Tokumaru: I want it converted because the Genesis has better features, But I cannot do it on the SNES, Because it is hard to know how to put certain tiles (Status bar, Tiles, etc) in the SNES's PPU (Layer Related) and the Genesis is a little better anyways.


I have to question your decision here.

1) The SNES's CPU is backwards compatible with the NES's (it even has a 6502 "emulation" mode), so code conversion wouldn't even be necessary apart for a few initialization things and things you'd have to do anyway (like the code that interfaces with the PPU/APU/etc)

2) I'm curious as to what features you claim are better on the Genesis. From what I understand the only advantage Genesis has up on the SNES is its CPU is faster -- but since you'd be doing a code conversion with a conversion utility, you'd probably lose all that speed increase because the new code would be bloated compared to the original (look at the conversion file that comes with the program you linked -- it converts one 6502 instruction to like 6 or 7 68000 instructions.. unless the Genesis CPU is 6x the speed of the NES CPU, which I doubt, your conversion will actually run slower than the original game).

As far as the SNES goes, it has tons of features -- but the only one you'd probably use would be DMA... and probalby HDMA to split the screen (unless you put the status bar on another layer, which would probably be easier)

3) The same nametable concepts that apply to the NES apply to the SNES as well. The only real difference is the SNES is 32x32 tiles and the NES is 32x30 tiles -- and the tiles are formatted a bit differently (SNES has bits to H/V flip tiles, assign attributes, etc). I can't imagine that Genesis' tile format is more similar to the NES's.

Quote:
As for the SNES's sound, It is kinda hard to create.


How do you figure? The hardest part is creating the BRR encoded samples -- but you could probably just rip those from Mario All Stars or a similar game. Hell you probably even be able to rip the music engine straight out of All Stars and drop it right into the conversion -- that way you wouldn't have to rescore the soundtrack and write a new music engine like you would have to on the Genesis.

by on (#32916)
I'd say the SNES's video processor kicks the Genesis' butt. And while Genesis has a beefier CPU which is clocked twice as high, it also takes 4 cycles to execute the simplest instructions on it (iirc).

by on (#32917)
Disch wrote:
Hamtaro126 wrote:
Tokumaru: I want it converted because the Genesis has better features, But I cannot do it on the SNES, Because it is hard to know how to put certain tiles (Status bar, Tiles, etc) in the SNES's PPU (Layer Related) and the Genesis is a little better anyways.


I have to question your decision here.

1) The SNES's CPU is backwards compatible with the NES's (it even has a 6502 "emulation" mode), so code conversion wouldn't even be necessary apart for a few initialization things and things you'd have to do anyway (like the code that interfaces with the PPU/APU/etc)

But here's another reason: The lockout chip on the Genesis is well known: just write "SEGA" to one specific memory location within the first few instructions. The one on the Super NES isn't, nor is it back-compatible with that of the NES.

Quote:
2) I'm curious as to what features you claim are better on the Genesis. From what I understand the only advantage Genesis has up on the SNES is its CPU is faster -- but since you'd be doing a code conversion with a conversion utility, you'd probably lose all that speed increase because the new code would be bloated compared to the original (look at the conversion file that comes with the program you linked -- it converts one 6502 instruction to like 6 or 7 68000 instructions.. unless the Genesis CPU is 6x the speed of the NES CPU, which I doubt, your conversion will actually run slower than the original game).

Sometimes it's possible to recognize more than one 6502 instruction and translate it to one 68000 instruction. For example, I believe there's one 68000 instruction 'dbeq' that does the equivalent of 68000 'dex; bpl'. Things like 'lda #something; sta somewhere' can be optimized into memory-to-memory 'move' instructions. But still, the amount of time spent optimizing the CPU would figure into the cost-benefit curve, probably with a lower weight for optimizations that can be performed automatically for each ROM.

Quote:
As far as the SNES goes, it has tons of features -- but the only one you'd probably use would be DMA... and probalby HDMA to split the screen (unless you put the status bar on another layer, which would probably be easier)

All-Stars appears to use the third (low-color) layer for both the status bar and a parallax plane.

Quote:
3) The same nametable concepts that apply to the NES apply to the SNES as well. The only real difference is the SNES is 32x32 tiles and the NES is 32x30 tiles -- and the tiles are formatted a bit differently (SNES has bits to H/V flip tiles, assign attributes, etc). I can't imagine that Genesis' tile format is more similar to the NES's.

Documents from zophar.net (I admit, they're old) disclose this:
Code:
FEDCBA9876543210  MD VDP nametable format
||||||||||||||||
|||||+++++++++++- Tile number
||||+------------ 1: Flip horizontally
|||+------------- 1: Flip vertically
|++-------------- Palette number
+---------------- Priority

FEDCBA9876543210  SHVC PPU nametable format
||||||||||||||||
||||||++++++++++- Tile number
|||+++----------- Palette number
||+-------------- Priority
|+--------------- 1: Flip horizontally
+---------------- 1: Flip vertically


Quote:
Quote:
As for the SNES's sound, It is kinda hard to create.

How do you figure?

One hard part is to get the equivalent of "hello world" even working on the SPC700.

Quote:
The hardest part is creating the BRR encoded samples

Really? Couldn't one just take samples from the mod archive, write a BRR encoder, and encode those samples?

Quote:
-- but you could probably just rip those from Mario All Stars or a similar game. Hell you probably even be able to rip the music engine straight out of All Stars and drop it right into the conversion -- that way you wouldn't have to rescore the soundtrack and write a new music engine like you would have to on the Genesis.

As I understand it, we're using SMB1 only as an example of a generic NROM/CNROM/U*ROM game that would be ported. So we have to pretend All-Stars doesn't exist, as it wouldn't for the other games.

by on (#32925)
tepples wrote:
One hard part is to get the equivalent of "hello world" even working on the SPC700.


Crappy "hello world" code

tepples wrote:
Really? Couldn't one just take samples from the mod archive, write a BRR encoder, and encode those samples?


Brr encoder

There is also XMSNES a XM -> SPC tool, never tried it myself though
http://ekid.nintendev.com/xms/

by on (#32939)
Disch wrote:
1) The SNES's CPU is backwards compatible with the NES's (it even has a 6502 "emulation" mode), so code conversion wouldn't even be necessary apart for a few initialization things and things you'd have to do anyway (like the code that interfaces with the PPU/APU/etc)


Has anyone looked through All-stars and the NES games to see if code was reused? I just tried and ran into technical problems with the SNES9x debugger.

I did manage to find a string of instructions that looked almost identical except for a few extra ones in All-stars and different addresses.

by on (#32941)
The games are based on the original source code, so yes, a lot of code was reused. SMB3 even has its level select and debug mode intact, though the level select was not fully updated to match the new hardware, and it displays graphical glitches as a result (though it is still completely functional).

SMB2 and SMB3 seem to have fared better during the conversion process than SMB1 and Lost Levels, though: both of those games have some odd quirks not present in the originals (for example, Super Mario does not rebound properly when he smashes a brick).

The SMAS ROM is interesting to browse through in a tile editor, as all of the graphics are uncompressed. Some of the original NES graphics are still present, some unused graphics were redrawn, and there are some completely new unused graphics, including a page of Mario poses in various stages of tweaking (slightly different shading, hands in various positions).

by on (#32955)
Why does Hamtaro keep asking for people to create things for him? It's like if someone were to ask somebody to build a jetpack. Or like if someone was like "Oh I have a good idea but I'm not doing any of the work"

by on (#32960)
CKY-2K/Clay Man wrote:
Why does Hamtaro keep asking for people to create things for him?

Because it creates interesting discussion.

by on (#32967)
BMF54123 wrote:
SMB2 and SMB3 seem to have fared better during the conversion process than SMB1 and Lost Levels, though: both of those games have some odd quirks not present in the originals (for example, Super Mario does not rebound properly when he smashes a brick).


That was probably done on purpose, but yeah, I definitely prefer the original graphics, physics, and music for SMB and lost levels. The GBC port is fantastic in that regard (once you get used to the extra scrolling).

by on (#32973)
strat wrote:
BMF54123 wrote:
SMB2 and SMB3 seem to have fared better during the conversion process than SMB1 and Lost Levels, though: both of those games have some odd quirks not present in the originals (for example, Super Mario does not rebound properly when he smashes a brick).


That was probably done on purpose, but yeah, I definitely prefer the original graphics, physics, and music for SMB and lost levels. The GBC port is fantastic in that regard (once you get used to the extra scrolling).



Does SMB deluxe had the whole NES palette or is it just a bunch of GBC colors of all the aquired colors of the game?

by on (#32978)
I'm not sure what you mean by 'acquired colors' but they're identical for the most part. The shades on GBC might be brighter. If the screenshots were properly scaled and cropped it might be hard to tell them apart.

Disappointingly, the deluxe version of Lost Levels has the tileset from SMB and Mario doesn't bounce, so it's not adequate for playing the original.

by on (#32979)
Super Mario Bros DX came out after nesticle, so maybe Nintendo just used that palette.
Re: NES Transcoder - Can Anyone try to Reprogram?
by on (#32980)
Hamtaro126 wrote:
I am planning to use this for a NES to Sega Genesis conversion of SMB. But first I need someone to reprogram NES Transcoder, If the Author is here. Please make another version.

URL:
http://hamtaro126.sitesled.com/NESTranscoder.zip


How nice of you to publish my code on the web like this without asking for permission. ;-) Where did you get it?
Re: NES Transcoder - Can Anyone try to Reprogram?
by on (#32996)
oRBIT2002 wrote:
Hamtaro126 wrote:
I am planning to use this for a NES to Sega Genesis conversion of SMB. But first I need someone to reprogram NES Transcoder, If the Author is here. Please make another version.

URL:
http://hamtaro126.sitesled.com/NESTranscoder.zip


How nice of you to publish my code on the web like this without asking for permission. ;-) Where did you get it?


Orbit2002: I apologize, I had it in my E-mail from you, But I thought you discontinued it!

BTW: Orbit2002, Just so you know, Can I please open source it? (in LGPL)

BTW2: Orbit2002 is free to redo it!, It is still code that might be helpful!
Re: NES Transcoder - Can Anyone try to Reprogram?
by on (#33016)
Hamtaro126 wrote:
BTW2: Orbit2002 is free to redo it!, It is still code that might be helpful!

Somehow I doubt it at this point.

by on (#33036)
strat wrote:
I'm not sure what you mean by 'acquired colors' but they're identical for the most part. The shades on GBC might be brighter. If the screenshots were properly scaled and cropped it might be hard to tell them apart.

Disappointingly, the deluxe version of Lost Levels has the tileset from SMB and Mario doesn't bounce, so it's not adequate for playing the original.


I mean does it have like all the colors from NES or do they just get the specific colors for all the palettes needing those colors? so like if they have all the palettes using colors from NES that they need, and they exclude the other colors not needed?