News: 11 March 2016 - Forum Rules

Author Topic: Anyone Interested in Doing "SMB Special" for NES?  (Read 313054 times)

frantik

  • Hero Member
  • *****
  • Posts: 644
    • View Profile
Re: Anyone Interested in Doing "SMB Special" for NES?
« Reply #140 on: March 14, 2008, 09:04:51 pm »
Well I was able to fit only 4 worlds into the original space allotted for 8.  I do have left over enemies but I doubt I could even construct an entire world 5 with them.  I would estimate about twice as much room for level data is required.

It doesn't look like SMBS uses the castle looping technique.  this means a fair amount of code can be cleared up

Code: [Select]
; $c047-$c06a ( 0x4057 - 0x407a ) enemies and loop commands core routine
; $c06b-$c075 ( 0x407b - 0x4085 ) loop command world number data
; $c076-$c080 ( 0x4086 - 0x4090 ) loop command page number data
; $c081-$c08b ( 0x4091 - 0x409b ) loop command Y position data
; $c08c-$c0cb ( 0x409c - 0x40db ) game level loopback handler (this makes the looping happen)
; $c0cc-$c12e ( 0x40dc - 0x413e ) loop command processing core

i think some of that area is used by the upside down pipes and/or piranha plant routines though so you might want to double check.

MathUser2929

  • Hero Member
  • *****
  • Posts: 1645
    • View Profile
Re: Anyone Interested in Doing "SMB Special" for NES?
« Reply #141 on: March 15, 2008, 09:04:20 am »
If you still have some space left in the original rom then I would suggest trying to make another level or two with it if u got enough space. Beacause you never know how much space the next 4 worlds are gonna take. If they got even more blocks laying around then the first four levels your gonna need whatever space you can get.

Karatorian

  • Sr. Member
  • ****
  • Posts: 381
  • "Gotta get get ... 6502"
    • View Profile
    • Studio Karatorian
Re: Anyone Interested in Doing "SMB Special" for NES?
« Reply #142 on: March 15, 2008, 01:24:42 pm »
What is the castle looping technique? I've never heard of it. An additional bit of code that perhaps could be removed is the warp zone specific stuff. SMBS doesn;t have any warp zones, so unless we add them, the warp zone code would be unused.
Current ProjectsFinal Fantasy EngineSMB Special for NESStudio Karatorian
@loop: lda (src),y — sta (dst),y — iny — bne @loop — inc src+1 — inc dst+1 — dex — bne @loop

Hamtaro126

  • Full Member
  • ***
  • Posts: 178
  • I'm Back!
    • View Profile
Re: Anyone Interested in Doing "SMB Special" for NES?
« Reply #143 on: March 15, 2008, 02:33:02 pm »
You can either use mapper 69 (Sunsoft's FME7 mapper) or mapper 5 (MMC5) to help expand levels in new expansion at $6000-7FFF, or use MMC1 or MMC3 to put levels in WRAM/SRAM @ 6000-7FFF. Although I'd use the MMC5/FME7 space more than the usual WRAM/SRAM.

By The Way: I might try to create a SMB-SPECIAL style one-screen level changer. (one with and without expansion levels) But if I have the nessicary time to do it. (I am currently using SMB1 Disassembly by Doppleganger to do my hacks)
I Hath Returned...

BTW My username is not Hamtaro129. THAT IS WRONG, Please correct immediately or I will try to correct it myself!

frantik

  • Hero Member
  • *****
  • Posts: 644
    • View Profile
Re: Anyone Interested in Doing "SMB Special" for NES?
« Reply #144 on: March 15, 2008, 03:50:15 pm »
What is the castle looping technique? I've never heard of it.

well not really a technique i guess but in some of the castles you have to follow the correct path, otherwise the castle loops back and you have to do it again.  SMBS does not have this in it i dont think

SMB2J-2Q

  • Full Member
  • ***
  • Posts: 135
    • View Profile
Re: Anyone Interested in Doing "SMB Special" for NES?
« Reply #145 on: March 15, 2008, 04:03:18 pm »
I don't want the timer in my SMB hack to tick any faster, please.
Sorry to say, but I don't think it's your hack anymore... With frantik and Karatorian doing all the work if they want to make it as close a port as they can, it's their say.

I came up with the idea in the first place.

Also, I do not want to lose the scrolling for this hack. It was my idea to have a version of SMBS in which the screen scrolls. Combine SMBS with NES engineering...

frantik

  • Hero Member
  • *****
  • Posts: 644
    • View Profile
Re: Anyone Interested in Doing "SMB Special" for NES?
« Reply #146 on: March 15, 2008, 04:14:54 pm »
Quote
I came up with the idea in the first place.

no offense but i sincerely doubt you're the 1st person to want to play SMBS on the NES ;)

but anyways everyone is welcome to contribute to this project.  the more you contribute, the more the other people who have contributed (namely me and Karatorian so far) will value your opinion regarding the direction of the hack. ;)

SMB2J-2Q

  • Full Member
  • ***
  • Posts: 135
    • View Profile
Re: Anyone Interested in Doing "SMB Special" for NES?
« Reply #147 on: March 15, 2008, 04:21:46 pm »
What is the castle looping technique? I've never heard of it.

well not really a technique i guess but in some of the castles you have to follow the correct path, otherwise the castle loops back and you have to do it again.  SMBS does not have this in it i dont think

Actually, in SMBS there is looping in parts of World 7-4 (you have to use pipes to advance to other parts of the stage, a la World 8-4 in SMB for NES):
http://www.youtube.com/watch?v=b9KvjAQIW_o

Like the NES version, World 8-4 in SMBS also makes use of pipes to advance from one part of the stage to the next:
http://www.youtube.com/watch?v=azPuClxuMUI

~Ben (SMB2J-2Q)


frantik

  • Hero Member
  • *****
  • Posts: 644
    • View Profile
Re: Anyone Interested in Doing "SMB Special" for NES?
« Reply #148 on: March 15, 2008, 04:50:29 pm »
i mean like in 4-4, 7-4 and 8-4 of SMB where you have to walk on the right bricks other wise the level loops without using any pipes.  that doesn't look like it occurs in SMBS, so that part of the code can be used for other things

Karatorian

  • Sr. Member
  • ****
  • Posts: 381
  • "Gotta get get ... 6502"
    • View Profile
    • Studio Karatorian
Re: Anyone Interested in Doing "SMB Special" for NES?
« Reply #149 on: March 15, 2008, 05:06:40 pm »
Well, I've finished my SMB MMC1 expansion proof of concept hack. It doesn't currently do anything noticable, but things have changed "under the hood". As mentioned above, I've moved the sound engine into a bank of it's own. The call from the main loop into the sound engine has been replaced with a call to a custom function that switches banks, calls the real sound engine entry point, and then switches banks back. The only other change was the addition of a call to a mapper setup function in the startup routine.

So far, in my limited testing, everything appears to work perfectly. As I've said, it doesn't do anything noticable, put I've posted it to my website, just in case anyone wants to check it out or do some more testing, etc.

My next step is going to be working on intergrating the changes frantik has made so far. It shouldn't be too difficult, but we may run into complications down the line. I'm not sure how flexible the level editor frantik is using is and whether or not it'll be able to edit the expanded rom directly. If not, I'll have to come up with some sort of exportation and importation tools.

In regards to the looping, in SMBS, if you walk past the end of chunk 16, you end up back at chunk 1. It's not the same effect, and it isn't actually used in any of the levels, so I think we could safely reclaim that bit of code, but given the amount of space I've gained, I don't think it'd be neccessary.

As I'm building from ASM sources, I can simply expand the area used to store the levels. The following code will simply be pushed down into the area that was previously occupied by the sound engine. As doppleganger's source is completely cleaned up, with labels and defines for everything, relocation of code is completely transparent. (After relocating the sound engine, I didn't have to edit it at all.)
Current ProjectsFinal Fantasy EngineSMB Special for NESStudio Karatorian
@loop: lda (src),y — sta (dst),y — iny — bne @loop — inc src+1 — inc dst+1 — dex — bne @loop

frantik

  • Hero Member
  • *****
  • Posts: 644
    • View Profile
Re: Anyone Interested in Doing "SMB Special" for NES?
« Reply #150 on: March 15, 2008, 06:59:33 pm »
Sounds good so far Karatorian :D

regarding the level editor, it will not be able to edit the expanded rom because it expects the CHR-ROM to be at 0x8010. It rejects roms without the proper iNES header, though if you modify the header it will read any file, but it will not render the level correctly without the CHR-ROM in the correct place. 

if a rom can be made using mapper 0 the level editor will support it.  the best thing to do would be to make a mapper 0 rom with expanded level data and no sound engine, edit that rom in the editor, then insert the level data into the mmc-1 rom

just to check your rom mapping.. is this correct?

0x0010 - 0x400F - original 1st half of rom
0x4010 - 0x800F - empty bank
0x8010 - 0xC00F - sound engine
0xC010 - 0x1000F - original 2nd half of rom (not including sound engine)
0x10010 - EOF - CHR-ROM
« Last Edit: March 15, 2008, 07:05:08 pm by frantik »

MathUser2929

  • Hero Member
  • *****
  • Posts: 1645
    • View Profile
Re: Anyone Interested in Doing "SMB Special" for NES?
« Reply #151 on: March 15, 2008, 10:01:55 pm »
I think frantik is saying what I was gonna say. You could edit another rom first with the final 4 worlds first. And then stick that rom to the back of the newly expanded rom.

frantik

  • Hero Member
  • *****
  • Posts: 644
    • View Profile
Re: Anyone Interested in Doing "SMB Special" for NES?
« Reply #152 on: March 15, 2008, 10:24:33 pm »
... except i'm almost done with world 5 now too ;)  really what needs to be done that no one is working on is the code for new enemies.  if someone wants to develop the code for any of the enemies, even replacing existing enemies, that code could be incorporated into expanded rom

SMB2J-2Q

  • Full Member
  • ***
  • Posts: 135
    • View Profile
Re: Anyone Interested in Doing "SMB Special" for NES?
« Reply #153 on: March 16, 2008, 12:09:34 am »
... except i'm almost done with world 5 now too ;)  really what needs to be done that no one is working on is the code for new enemies.  if someone wants to develop the code for any of the enemies, even replacing existing enemies, that code could be incorporated into expanded rom


You could get the Crabs and Fighter Flies from the Mario Bros. ROM and the Hammer and Barrels from Donkey Kong, both NES versions.

~Ben (SMB2J-2Q)

frantik

  • Hero Member
  • *****
  • Posts: 644
    • View Profile
Re: Anyone Interested in Doing "SMB Special" for NES?
« Reply #154 on: March 16, 2008, 02:15:11 am »
Ok here's world 5:

Download Worlds 1-4 updated
Download World 5







Patch world 5  onto a new rom since it only contains world 5 and not worlds 1-4. 

I also modified the height of the balance ropes.  In SMBS they have two heights.  I choose the one which is more commonly used.  I updated worlds 1-4 with this info

Download Worlds 1-4 updated
Download World 5


oh and the long firebar in 5-4 spins the wrong way.. if there arent any more long fire bars or any swinging the other way then hopefully it will trivial to switch its direction

edit:  yep theres long firebars going both ways.  hopefully it won't be too hard to add.  one of the fast spinning bars can be replaced with the long bar or something

edit2:  well i added a 2nd long firebar... but it only spins for one quarter turn and then it stops lol.  making the one long firebar spin the opposite way isn't hard at all though just change one bit.  perhaps we could just add something where it spins a certain way depending on the level or something since we're adding custom code
« Last Edit: March 16, 2008, 07:59:50 pm by frantik »

Karatorian

  • Sr. Member
  • ****
  • Posts: 381
  • "Gotta get get ... 6502"
    • View Profile
    • Studio Karatorian
Re: Anyone Interested in Doing "SMB Special" for NES?
« Reply #155 on: March 16, 2008, 05:24:03 am »
frantik, your understanding of the expanded ROM's layout is correct. I didn't even think about the location of the CHR-ROM having changed, but now that you mention it, I can see how it would matter. The method you've proposed should be workable and fairly easy to impliment with the setup I currently have.

What I was actually wondering about was whether the editor would be able to make use of additional space for levels if such space was provided. Specifically, I was wondering what sort of control it allows over where in the ROM the levels are located and whether it has any limit on how much space it'll let you use up. It seems like there might be such restrictions to prevent you from overwriting other parts of the ROM and corrupting it.

I've also realized that my current code leads to the creation of a woefully inefficant IPS patch. Due to my simply having added a call to my mapper setup routine in the main intialization, the entire contents of the rest of the ROM where shifted down three bytes. At the time I didn't think this'd be an issue, but the IPS format has no provisions for insertions or deletions and only handles overwrites, leading to a (relatively) huge patch.

However, given the nature of ROM expansions, even if I corrected this particular issue, all of the ROM's contents past the first 16k will still be affected by the limitations of the IPS format. This basically leads to the patch containing a large portion of the ROM's contents. The only reason the patch isn't even larger is that large chunks of the expanded ROM are (currently) empty (containing zeros) and so can be compressed by IPS's RLE compression.

Perhaps it's nothing and I shouldn't worry about it, but it seems a little bit distressing. In particular, with over half of the original ROM's contents contained in the patch, it seems that the (supposed) legal distinction between ROMs and patches is considerably blurred (in cases like this). Not that I'm worried about legal action or anything, but it is an issue hackers who use ROM expansion should be aware of and consider the implications of.
Current ProjectsFinal Fantasy EngineSMB Special for NESStudio Karatorian
@loop: lda (src),y — sta (dst),y — iny — bne @loop — inc src+1 — inc dst+1 — dex — bne @loop

frantik

  • Hero Member
  • *****
  • Posts: 644
    • View Profile
Re: Anyone Interested in Doing "SMB Special" for NES?
« Reply #156 on: March 16, 2008, 06:08:12 am »
What I was actually wondering about was whether the editor would be able to make use of additional space for levels if such space was provided. Specifically, I was wondering what sort of control it allows over where in the ROM the levels are located and whether it has any limit on how much space it'll let you use up. It seems like there might be such restrictions to prevent you from overwriting other parts of the ROM and corrupting it.

I am unsure exactly what limitations the editor has on the data.  It seems pretty flexible however and I wouldn't be surprised if it didn't have any limitations and simply looks at the region defined by the various pointers.  can you whip up a rom for me with  expanded level data? add say 100 bytes onto the last room's data or something and see if smb util will still edit it properly


Regarding IPS issues:

yeah thats something I was going to have to deal with with SMU.. i was actually going include with the patch a program which would take the original SMB rom and create a new ROM with the correct structure.  then the patch would be applied to the newly created rom.  of course in SMU all i'm planning on doing is having two copies of the original rom with different level data and just swap from one to the other at world 5 so it would be a lot easier to format the rom since all i would need to do is strip the header off one, strip the CHR-ROM off another and tack the two together. 

since you're rearranging the code the program would also have to know where to offset the code by X amount of byte which would be pretty tedious if you had lots of changes

MathUser2929

  • Hero Member
  • *****
  • Posts: 1645
    • View Profile
Re: Anyone Interested in Doing "SMB Special" for NES?
« Reply #157 on: March 16, 2008, 10:38:09 am »
I thought i t was gonna be more people, but it looks like it came down to just you two working on the hack. At least we'll get the level edits, if not the enemies, or other features. That's probably as much as we can hope for.

Anyhow yeah, I hope u guys figure out how to properly make a patch out of this. Cause I can imagine this site having a problem with hosting a patch that contains the original code and we don't want this patch getting lost on some geocities site or something. It should be hosted here. And good work on world 5.

Karatorian

  • Sr. Member
  • ****
  • Posts: 381
  • "Gotta get get ... 6502"
    • View Profile
    • Studio Karatorian
Re: Anyone Interested in Doing "SMB Special" for NES?
« Reply #158 on: March 16, 2008, 08:27:26 pm »
As for IPS related issues, if we run into difficulties with getting it hosted on RHDN, we'll come up with a solution of one sort or another. Possible solutions include using a more advanced patch format that can handle relocations, using a custom patching program, or as frantik plans for SMBU, using a custom tool to rearange the ROM prior to patching. On the other tentacle, it may not matter. Surely, in amoungst all the patches hosted here, there's bound to be at least a few ROM expansions, which are all quite likely to contain a signifigant portion of the original ROM if in IPS format. (Besides, RHDN hosts complete disassemblies, such as the one I'm using, which contain (in a modified form), ROM contents as well.)

I should be able to produce a patch that adds space to the level area for level editing testing without too much difficulty. I should be able to get something worked up sometime tonight.

As for the ASM hacking required to get the additional enemies and power-ups implimented, I wouldn't give up hope just yet. I've only just begun my work on the ASM, but as my work on the level dumping utils is pretty much complete, ASM hacking has now become my focus area for this project.

Furthermore, perhasps some more people would get involved if prompted to do so. If it looks as though I won't be able to handle the ASM hacks on my own, we could always post a help wanted ad.
Current ProjectsFinal Fantasy EngineSMB Special for NESStudio Karatorian
@loop: lda (src),y — sta (dst),y — iny — bne @loop — inc src+1 — inc dst+1 — dex — bne @loop

frantik

  • Hero Member
  • *****
  • Posts: 644
    • View Profile
Re: Anyone Interested in Doing "SMB Special" for NES?
« Reply #159 on: March 16, 2008, 10:06:54 pm »
Once I finish the level entry I will be able to contribute to the asm hacking more.. though it wouldn't hurt to have a dedicated asm hacker on board i suppose, especially someone who's actually added new enemies to SMB, if there is anybody around like that



« Last Edit: March 16, 2008, 11:26:02 pm by frantik »