Language…
10 users online: Batata Douce, DanMario24YT, ForthRightMC, Isikoro, kurtistrydiz, LightAligns, mathew,  Saphros, simon.caio, TheOrangeToad - Guests: 288 - Bots: 375
Users: 64,795 (2,378 active)
Latest user: mathew

The SM64 Console Compatibility thread.

Here you go:
https://youtu.be/NyGuHhnD_JA

It froze after the Mario screen as you can see, so I still had to do the MIO0 realign thing myself (step one in this post). So, ImportTest2.z64 is just ImportTest.z64 after doing the realign thing. Not sure if that was intentional or overlooked or what, but I thought it was worth mentioning. I can also see the same sort of warping/distortion I've seen in the more recent Level Importers (from at least 1.9.3S onwards)(video link).

Hope this helps and good luck with your importer. :)

I got a cheap N64 flash-cart off of amazon, so now I can actually test stuff out and add to this discussion. Thanks for your earlier help macN64. #tb{:)}

Originally posted by macN64
I can also see the same sort of warping/distortion I've seen in the more recent Level Importers (from at least 1.9.3S onwards)(video link).


The distortions you see are caused by the level importer setting the camera's far value in the geometry layout as a negative number.

Each level geometry layout has a 0x0A command that sets the properties for the Near & Far values for the camera. Both the Near & Far values are loaded up as signed 16-bit values in the ASM code.

Code
  lw    $t8, 0x8038bd80 # lui $t8, 0x8039/lw $t8, -0x4280($t8)
  lh    $t9, 4($t8) # get the camera Near value (s16) from the 0x0A cmd
  sh    $t9, 0x2c($sp)
  lw    $t0, 0x8038bd80 # lui $t0, 0x8039/lw $t0, -0x4280($t0)
  lh    $t1, 6($t0) # get the camera Far value (s16) from the 0x0A cmd
  sh    $t1, 0x2a($sp)


In the recent versions of the level importer, skelux set the far value to 0x9696 for some odd reason. This doesn't affect emulators at all, but it does cause the distortion effect on console.

To fix this bug, all you need to do is this:

Code
Find all: 0A 01 00 2D 00 64 96 96 80 29 AA 3C
Replace with: 0A 01 00 2D 00 64 7F FF 80 29 AA 3C


Here is a video of it working:

Nice! This is something I've been looking into (by comparing test roms), but your find and replace solution is much better than what I'd been doing. It never occurred to me to take the other bytes round about into account, so that you could do a simple “Find-All, Replace-With” to fix it. So thanks for that Davideesk! :D

Doing something similar, I think I've now got a working fix for the missing alpha textures in older hacks:
Code
Find All: 15 06 00 00 0E
Replace With: 15 04 00 00 0E


Before and after video:
https://youtu.be/WatepcGoJBk

As usual, I don't know why this works, only that, seemingly, it does. #tb{^^}

Edit: Kaze tells me the number I change here is generally to do with the drawing layer. 06 is seemingly for water, and 04 is for alpha. Thanks Kaze!
Anyone want to make an open source program to fix Compatibility issues with SM64?

I would do it but I wouldn't know where to start, it would also I only know Java and Python so it wouldn't be very usable.
Team CornersoftYoutube

Originally posted by queueRAM
Originally posted by Kazeshin
ah, so 803D0000 cant be used? that might be what tricked me into thinking that DMAcopy wouldn't work. I've tried to fix the DMAcopy for chaos edition, which loads code to 803D0000, but when trying to print a string from there, i got weird randomly changing strings.

i suggest to move the data to 807B0000, which is a huge unused RAMarea.


Yeah, 803D0000 is definitely being used by something on the console, still not sure by what. Thanks for the info on 807B0000 - it appears to be unused, so I switched to using that and updated my notes and tool above.


Just a little update on this.

The memory from 0x8038F800 to 0x803FFFFF is filled up with constantly written values that can't be modified on console, so we should stay away from this region until we actually know what it is. Project64 is weird in this case as the data is very different and is pretty much static. It doesn't even fill up the entire space. For a while I thought 0x803F0000 was empty and used it for custom ASM code, until queueRAM told me that it wasn't actually empty.

Edit: Shygoo has let me know that this region is actually the framebuffer (http://n64devkit.square7.ch/nusystem/tutorial/3.htm#3). So yeah, this region is off-limits when it comes to console compatibility.
In very dumbed down instructions, how would I and what tools would I need in order to attempt to fix a hack. Are there any hacks more likely to work due to less sprites and such? I also thought this would be a good place to apologize for the dick I have been, I'm just passionate and it comes out all wrong. Plus, kinda trolly lol. I also forgot how much of an asshole I was on that old thread, jeez.
Your layout has been removed.
Originally posted by aterraformer
how would I and what tools would I need in order to attempt to fix a hack.

Currently, the only tools are a hex editor and my retooled sm64compress which fixes some alignment issues and a sound allocation that was mis-pointed in older hacks to an area used by some other hardware on console. As far as how to go about using these tools, sm64compress is pretty simple from the command prompt, or just drag-and-drop a ROM hack on it and it will generate a <ROM NAME>.out.z64 file. The past 10 or so posts in this thread provide some details about what else can or should be changed in the display lists to make things render properly on console. We have not figured out the best sets of commands yet. David and macN64 can speak more on those though.

Originally posted by aterraformer
Are there any hacks more likely to work due to less sprites and such?

Good question. Certainly TT64-only hacks that only retexture, move around objects, and change dialog (such as Luigi's Mansion 64.5) would be good candidates because they don't introduce new display lists which I think we're having the most problems with now. Next likely would be hacks with lower polygon counts. You can see in macN64's Year of the Plumber video, the lower polygon starting spiral runs pretty well, however, the game severely lags once entering the main castle area.

Originally posted by aterraformer
I also thought this would be a good place to apologize

I'm not much one for apologies and such so don't be offended that i don't really say much about it. I'll let your actions speak on your sincerity. You are always welcome to help the cause for console compatibility by trying to help us figure things out.
So I'm trying to work with Super Mario 74 for now and was wondering if I was doing anything right. First I dragged it into sm64compress, then I used this replacement and the more recent alpha texture fix. I'm just wondering, are the previously mentioned stuff already included with sm64compress or not needed for certain hacks? I realize the start up wouldn't be but I'm not so sure about the music fixes. Also, has there been any development on the fog levels? Is there a different code string that it points to or is it one in the same, and that's the problem.

Clearly I have 0 idea what I'm talking about but I'm trying dammit!

Edit: I'll just put this embarrassment here too. So I was under the odd impression that the sm64compress could actually shrink the rom file. I was going to try injecting hacks into different wads like Majora's Mask, Ogre Battle and Sin & Punishment but alas, I was a fool for thinking that. I suppose there's no actual way to do that? I guess it's just hard for me to believe that ALL that space is needed but then again, coming from someone who hasn't a clue of what goes into SM64 hacking.
Your layout has been removed.
Originally posted by aterraformer
I was under the odd impression that the sm64compress could actually shrink the rom file. I was going to try injecting hacks into different wads like Majora's Mask, Ogre Battle and Sin & Punishment but alas, I was a fool for thinking that.

Not a bad assumption! The original intent of sm64compress was indeed to shrink the ROM by shifting the level data around and compressing the MIO0 sections. However, that got sidetracked by all the other changes that we were discovering needed to be made to the ROM for compatibility. I probably know enough now that I could give the compression another shot without totally breaking the ROM. I'll see if I can fit this in my spare time this week.

Originally posted by aterraformer
So I'm trying to work with Super Mario 74 for now and was wondering if I was doing anything right. First I dragged it into sm64compress, then I used this replacement and the more recent alpha texture fix. I'm just wondering, are the previously mentioned stuff already included with sm64compress or not needed for certain hacks?

sm64compress only makes its best attempt to realign all the MIO0 blocks to 16-byte boundaries and corrects the music pointer. It doesn't incorporate any of the other ideas, so you are correct in that some manual find/replace is still needed. Until we know for sure what the correct fixes are, I don't really want to go through the hassle of putting anything into a tool.
Originally posted by queueRAM
I can fit this in my spare time this week.

That would be great! I would definitely like to try testing on the WiiVC too. That being said, I'm open to any hacker or anyone really out there that doesn't have means to test on N64 or WiiVC (I don't know how accurate Dolphin is for this) to help test for them.

I thought I would keep you guys updated on my progress. I'm attempting to play through SM74 on N64. I have to say, I'm really impressed! It runs really well! It slows down every once and a while but it is a lot rarer than you would think.
I have entered:
Dice-Fortress
Skyward Slopes
Azure-Abyss
Toxic-Switch of Danger
Bowser's Badlands-Battlefield
Tower of the East
System of a Town
Haunted Factory

As of yet, the only issues I have experienced were in Toxic-Switch of Danger and the Bowser arena. It's just the textures being wrong though which in no way affects gameplay. Not sure if anything later on with happen or too many sprites but it seems very hopeful so far!

Edit: I tried the same 2 hex edits with Shining Stars, Green Stars, 74EE, and the original StarRevenge. I kept getting an Error 0xF0 upon trying to load. Oddly enough, this effected other games on my SD card. They would eventually load after a reset or something but it made me want to try another SD card, same error. Really not sure what I'm doing wrong. I thought at least one of those hacks would at least be able to boot the title screen. Do you think it's the Everdrive/SD card?
Your layout has been removed.
Super Mario 74 update: Dust-Switch of Identity looks pretty bad but still doable!
Your layout has been removed.
Originally posted by aterraformer
Originally posted by queueRAM
I can fit this in my spare time this week.

That would be great!

Just to make sure your expectations aren't too high of me this week, I had an "if" in there :)
Originally posted by queueRAM
I'll see if I can fit this in my spare time this week.


Originally posted by aterraformer
I'm open to any hacker or anyone really out there that doesn't have means to test on N64 or WiiVC (I don't know how accurate Dolphin is for this) to help test for them.

Thanks, I appreciate the offer. I think macN64, Davideesk, and myself all have flash cartridges to test with. I've only ever test VC in Dolphin before. As you mentioned, we'll have to work out shrinking the ROMs down before that though!

Originally posted by aterraformer
I thought I would keep you guys updated on my progress. I'm attempting to play through SM74 on N64. I have to say, I'm really impressed! It runs really well! It slows down every once and a while but it is a lot rarer than you would think.

Wow, I'm actually pleasantly surprised it runs that well. That is encouraging. Did you have to make any changes other than those we've specified so far?

Originally posted by aterraformer
As of yet, the only issues I have experienced were in Toxic-Switch of Danger and the Bowser arena. It's just the textures being wrong though which in no way affects gameplay. Not sure if anything later on with happen or too many sprites but it seems very hopeful so far!

Interesting, do you have any screenshots (even just pictures of the screen from a camera) to show the glitches you are seeing? I wonder if the levels are too big and are spilling over into another occupied area of memory or we didn't catch all the DMAs.

Originally posted by aterraformer
I tried the same 2 hex edits with Shining Stars, Green Stars, 74EE, and the original StarRevenge. I kept getting an Error 0xF0 upon trying to load. Oddly enough, this effected other games on my SD card. They would eventually load after a reset or something but it made me want to try another SD card, same error. Really not sure what I'm doing wrong. I thought at least one of those hacks would at least be able to boot the title screen. Do you think it's the Everdrive/SD card?

I'm not sure what Error 0xF0 could mean. There are posts in the forums with other error codes, but this was the closest I could find:
http://krikzz.com/forum/index.php?topic=3479.0
Regarding these other ROMs, maybe something in a newer version of the level importer is changing something else I'm not aware of. I'll have to examine them more closely.
Originally posted by queueRAM
I'll see if I can fit this in my spare time this week.

Oh yeah, no rush of course!

Originally posted by queueRAM
Did you have to make any changes other than those we've specified so far?

Not at all. These were the only two that I used:
Code
Find All: FC 12 7F FF FF FF F8 38
Replace With: FC 12 18 24 FF 33 FF FF

Code
Find All: 15 06 00 00 0E
Replace With: 15 04 00 00 0E

To be honest, I wish I had any idea of what else to add!

Originally posted by queueRAM
Interesting, do you have any screenshots (even just pictures of the screen from a camera) to show the glitches you are seeing

I streamed all of SM74 actually:
part 1
Bowser starting at 1:34:36
Metal Cap level starting at 1:37:12
part 2
Vanish Cap level starting at 1:12:50

If you would rather me highlight, just let me know. I know Twitch video player is not exactly ideal.
Your layout has been removed.
Originally posted by aterraformer
Originally posted by queueRAM
Interesting, do you have any screenshots (even just pictures of the screen from a camera) to show the glitches you are seeing

I streamed all of SM74 actually:
part 1
Bowser starting at 1:34:36
Metal Cap level starting at 1:37:12
part 2
Vanish Cap level starting at 1:12:50

The timestamps were enough for me to see what you were talking about! Thanks for recording and linking to those. This gives me hope.

I finally made my way through the sm64compress changes I've been wanting to. It is a bit more intelligent than before, so it can correctly identify blocks in level scripts, sequence banks, and some level script it copies out to 0x80400000. I will need to make more changes to support all ROMs, but this is a good start. It's still a command-line tool, but has added flags to correct the F3D and geo layout. I recommend running it with:
Code
sm64compress -f -g [ROM file]


sm64compress v0.2a
Source

By default it will:
- find all 0x17, 0x18, 0x1A level commands and find data
- find sequence bank (usually at 0x2F00000 or 0x3E00000)
- find some level script at 0x1200000 that is copied to 0x80400000
- remove unused space between all the blocks
- update all level script references and asm pointers
- update hardcoded audio patch (0x803D0000 -> 0x805C0000)
- update checksum

Command line flags to optionally:
-d: dump raw block data (new and old) to files
-f: fix F3D combine blending parameters (FC127FFFFFFFF838 -> FC121824FF33FFFF)
-g: fix geo layout 0x15 display layer (150600000E -> 150400000E)
-v: verbose output
-c: compress 0x17 blocks and recompress 0x18 and 0x1A blocks (experimental, doesn't run)

Things it doesn't do, but will be added in future:
- restore checksum asm code if removed (thing that triggers the CIC error)
- crashes when running on The Missing Stars. Still need to look into the ROM.

cen64 screenshots to snapshot progress
SM74 runs on console, but has same issues you reported with textures on some levels:

SM64 Green Stars locks up when trying to enter a level in cen64:

Luigi's Mansion has boot problems on console and graphic problems in cen64:

Super Mario Rainbow Road has boot problems on console (suspect audio) and some graphic problems in cen64:

Super Mario Star Road has boot problems on console (suspect audio) and lags in cen64:

Edit: bonus gif of SMSR:
Most hacks still seem unable to inject into wads, which makes no sense to me. For example, SM74 compresses to 41.9mb, Ogre Battle and Majora's Mask are both 47mb but apparently that's still not enough. I was able to inject Bob-omb Richard since somehow it went from 65mb to 24mb! Craziness. I hope something could be done about slowdown as well. Dust-Switch of Identity and Flowery Gardens are awful. Not sure how I super cleared both (except for that one bonus crap in Flowery ugh)
Your layout has been removed.
So far, not a single VC inject gets past the spinning N logo. Nice.
Your layout has been removed.
I think this shit destroyed my everdrive. Every time I select a rom, any card, I get the error. I can only run by pressing start to load the last played. SM74 runs. So I lost my 91 star file. For no reason. I haven't done much on the card besides inserting and removing hacks and copying the save file out so I could test that I could move the save file and format my usual sd card. Well no amount of formatting actually helped any other card. Also, the save is like 20 different files, all the same name. So when moving, all but one have to be renamed. So was it just my fault for buying this instead of 64drive or what?
Your layout has been removed.
Does it take sd cards? If so maybe that died.
Team CornersoftYoutube
Yes and I've tried 2 others and a micro
Your layout has been removed.
So I glitched to the end. Swampy Spring, Ombru-Sphere, and Bowser's Crystal Palace are pretty much unplayably slow but run nonetheless. I was unable to test the final battle since those two jumps of the level are wicked but I assume it's beatable on console. Swampy Spring also looks pretty bad, I'm not even sure if it was beatable with how wrong the textures were. Lastly, I was unable to clip the Luminium-Sphere door but I assume it's just as slow.
Your layout has been removed.