Is it possible to disable anti-aliasing in N64 games via GameShark cheats?

Locked
User avatar
Archive
Posts: 891479
Joined: June 25th, 2019, 11:00 am

Is it possible to disable anti-aliasing in N64 games via GameShark cheats?

Post by Archive » June 27th, 2019, 12:44 pm

posted by mdmx on Feb 11, 2016:

more codes for you.

(M) is a so called 'Enable' code. Without it, the game won't start. Usually you can find these codes on the internet. However I haven't found (M) codes for the following games:
Sin & Punishment, Dezaemon 3D, Shadowgate (PAL).
If you have them, please send me a pm.

1080° Snowboarding (PAL):
DE000400 0000 (M)
800917FD 0000
8009182D 0000
800917FE 0032
8009182E 0032

Banjo Kazooie (PAL):
DE000400 0000 (M)
8124C628 1000 (M)
812874C4 1000 (M)
812D3F80 2400 (M)
802770FD 0000
8027712D 0000
802770FE 0032
8027712E 0032

Conker's Bad Fur Day (PAL):
8002C0DD 0000
8002C10D 0000
8002C0DE 0032
8002C10E 0032


Diddy Kong Racing v1.0 (US):
DE000400 0000 (M)
F1024FC0 1000 (M)
F1024FC2 0002 (M)
F105F97C 1000 (M)
F105F97E 0004 (M)
800E481D 0000
800E484D 0000
800E481E 0032
800E484E 0032

F-Zero X (PAL):
game is already pretty sharp, so this code won't make a huge difference
DE067000 0000 (M)
800C582E 0032
800C585E 0032

Multi Racing Championship (US):
800909BD 0000
800909ED 0000
800909BE 0032
800909EE 0032

NBA Hangtime (PAL):
8009C14D 0000
8009C17D 0000
8009C14E 0032
8009C17E 0032

Polaris Snow Cross (US):
80086F5D 0000
80086F8D 0000
80086F5E 0032
80086F8E 0032

Star Soldier Vanishing Earth (JP):
game is already pretty sharp, so this code won't make a huge difference
80081F1D 0000
80081F4D 0000
80081F1E 0032
80081F4E 0032

Wave Race 64 Rumble Pak Edition (JP):
800EAA6D 0000
800EAA9D 0000
800EAA6E 0032
800EAA9E 0032

Wipeout 64 (PAL):
800976FD 0000
800976FE 0032
 

User avatar
Archive
Posts: 891479
Joined: June 25th, 2019, 11:00 am

Is it possible to disable anti-aliasing in N64 games via GameShark cheats?

Post by Archive » June 27th, 2019, 12:44 pm

posted by joe19 on Feb 11, 2016:

saturnu said:






i did a bit research and found out, that __osViInit() checks the tv_type at 0x80000300 and store the matching ctrl bytes of OS_VI_XXX_LAN1 in in modep of __osViNext. after that i searched for the first appearance (and checked the following bytes, too) of 0x0000324e (ctrl NTSC_LAN1) and replaced it with 0x0000320e (NTSC_LPN1).

than i recaled the header checksum and guess what, (software) AA was off.

sure osViSetMode can overwrite modep but if it is called with the constants, it might be as simple as patching the videotable.

Looks like you and I are following very similar research paths Image. I also took a look at __osViInit and discovered the 0x80000300 check and mode table reference. I noticed that the 0xA4400000 control register was 0 prior to this function being called (meaning that it is the first to set the register). Note however, that the single 32 bit value 0x0000324e is not enough to define the mode since the mode is a structure that is 0x50 bytes long (you can see its definition in the header file os_vi.h). There are a few modes that set the VI ctrl reg to 0x0324e - NTSC_LPF1, NTSC_HPN1, NTSC_HPF1, and the corresponding PAL/MPAL/FPAL entries. The value for NTSC_LAN1 that I found was 0x0000311E (perhaps you made a typo? or maybe I'm mistaken...).

Anyway, changing the mode table entry to 320E does indeed set it to NTSC_LPN1. However, when I try this, the games that I've tested this on appear to modify the register again and overwrite the change. The change appears to be coming from the osViSetSpecialFeatures call, which unfortunately, is compressed in the games that I've tested it on making a patch difficult.

Not sure what you mean by 'header checksum' - which header are you referring to?
 

User avatar
Archive
Posts: 891479
Joined: June 25th, 2019, 11:00 am

Is it possible to disable anti-aliasing in N64 games via GameShark cheats?

Post by Archive » June 27th, 2019, 12:44 pm

posted by saturnu on Jul 6, 2017:

yes, it is overwritten by osViSetSpecialFeatures
i pm you my new patcher, but it is only working for a few games, where it could find a
specific signature version of osViSetSpecialFeatures. like in starfox us v1.0
:>

- the checksum inside the rom header at 0x10 CRC1/CRC2 ^^
- yes it was a typo 0x0000311e is the correct value for NTSC_LAN1 ctrl





Spoiler: patcher output
-== N64 VideoTable AA-patcher v0.1 ==- by saturnu
Star Fox 64 (USA).z64 found
Rom size: 12582912
search for mode: 2
searching...
vt entry found!
found at offset: 000c4454
search for mode: 3
searching...
error: mode: 3 no VT offset found
search for mode: 6
searching...
error: mode: 6 no VT offset found
search for mode: 7
searching...
error: mode: 7 no VT offset found
search for mode: 10
searching...
error: mode: 10 no VT offset found
search for mode: 11
searching...
error: mode: 11 no VT offset found
search for mode: 16
searching...
vt entry maybe found! (5/8)
try anyway Image
found at offset: 000c44a4
search for mode: 17
searching...
error: mode: 17 no VT offset found
search for mode: 20
searching...
error: mode: 20 no VT offset found
search for mode: 21
searching...
error: mode: 21 no VT offset found
search for mode: 24
searching...
error: mode: 24 no VT offset found
search for mode: 25
searching...
error: mode: 25 no VT offset found
search for mode: 30
searching...
vt entry found!
found at offset: 000c44f4
search for mode: 31
searching...
error: mode: 31 no VT offset found
search for mode: 34
searching...
error: mode: 34 no VT offset found
search for mode: 35
searching...
error: mode: 35 no VT offset found
search for mode: 38
searching...
error: mode: 38 no VT offset found
search for mode: 39
searching...
error: mode: 39 no VT offset found
3/18 modes patched!
osViSetSpecialFeatures offset 1 found
osViSetSpecialFeatures offset 2 found
file patched!
done...


universal patcher betatest :>
not really - at the moment it isn't working with a lot of roms at all.

https://f.zdev.com/dl/smurbq.zip

It's tested with
Star Fox 64 US 1.0
Lylat Wars E
Super Mario 64 E
 

User avatar
Archive
Posts: 891479
Joined: June 25th, 2019, 11:00 am

Is it possible to disable anti-aliasing in N64 games via GameShark cheats?

Post by Archive » June 27th, 2019, 12:44 pm

posted by andykara2003 on Feb 12, 2016:

saturnu said:






universal patcher betatest :>
not really - at the moment it isn't working with a lot of roms at all.

https://f.zdev.com/dl/smurbq.zip

It's tested with
Star Fox 64 US 1.0
Lylat Wars E
Super Mario 64 E

Wow, this would be a godsend! Looking at MDMX's Turok 1 post, It seems that for at least some games, there are various degrees of how much the image can be sharpened; I don't suppose there could be an option in the patcher to choose the degree of sharpness we want the games to end up at?
 

User avatar
Archive
Posts: 891479
Joined: June 25th, 2019, 11:00 am

Is it possible to disable anti-aliasing in N64 games via GameShark cheats?

Post by Archive » June 27th, 2019, 12:44 pm

posted by hyperterminal on Feb 12, 2016:

Saturnu, thank you for your patcher. I will now start testing. For my EverDrive 64 i would prefer not to patch the rom itself, but to create ips files, so that I can keep the original rom dumps on my sd card and just add the ips files for the autopatcher.
 

User avatar
Archive
Posts: 891479
Joined: June 25th, 2019, 11:00 am

Is it possible to disable anti-aliasing in N64 games via GameShark cheats?

Post by Archive » June 27th, 2019, 12:44 pm

posted by saturnu on Feb 12, 2016:

atm i'm working on an improved version, that's searching for the patch offsets instead of using byte chains to detect the function. ^^
the uploaded patcher in the thread isn't very usefull at it's current state. ^^

the osViSetSpecialFeatures varies a lot. :>
 

User avatar
Archive
Posts: 891479
Joined: June 25th, 2019, 11:00 am

Is it possible to disable anti-aliasing in N64 games via GameShark cheats?

Post by Archive » June 27th, 2019, 12:44 pm

posted by PixelButts on Feb 12, 2016:

Has anyone been able to identify if the N64 has any actual processing differences with these codes in effect?

I would imagine it has a less stressful processing time as it's removing an extra step in the way it displays the game but I could be wrong.
 

User avatar
Archive
Posts: 891479
Joined: June 25th, 2019, 11:00 am

Is it possible to disable anti-aliasing in N64 games via GameShark cheats?

Post by Archive » June 27th, 2019, 12:44 pm

posted by Fandangos on Feb 12, 2016:

saturnu said:






atm i'm working on an improved version, that's searching for the patch offsets instead of using byte chains to detect the function. ^^
the uploaded patcher in the thread isn't very usefull at it's current state. ^^

the osViSetSpecialFeatures varies a lot. :>

You are awesome!

One idea would be that it spits a game shark code in YAML file so it can be used in your alt menu just selecting cheats on or off, the only problem with this is that it would count on game shark compatibility to work.


Does Alt Menu or the Original ED64 menu supports on the fly ips patching?
 

User avatar
Archive
Posts: 891479
Joined: June 25th, 2019, 11:00 am

Is it possible to disable anti-aliasing in N64 games via GameShark cheats?

Post by Archive » June 27th, 2019, 12:44 pm

posted by mdmx on Feb 16, 2016:

saturnu said:






atm i'm working on an improved version, that's searching for the patch offsets instead of using byte chains to detect the function. ^^
the uploaded patcher in the thread isn't very usefull at it's current state. ^^

the osViSetSpecialFeatures varies a lot. :>

Thanks for your efforts. Is it possible to output GameShark codes optionally? I ask this because I prefer to use the original cartridges.
 

User avatar
Archive
Posts: 891479
Joined: June 25th, 2019, 11:00 am

Is it possible to disable anti-aliasing in N64 games via GameShark cheats?

Post by Archive » June 27th, 2019, 12:44 pm

posted by joe19 on Feb 12, 2016:

Perhaps a modification to the n64hijacker that saturnu linked to earlier would be a more universal solution. That program allows you to run code before the game starts - when used with the patcher.asm program that was linked to, a ROM can be patched to include GS cheats embedded inside of it. Unfortunately, as we saw earlier in this thread, it seems that writing to the 0xA4400000 register directly does not work - I think it is because the cheat codes are applied at each interrupt (e.g. vertical trace) which is the same time that the context buffer switch occurs, leading to a conflict and garbage output on the screen.

However, we can still use n64hijacker to automate the sequence of finding all context buffers, and patching them instead of modifying the VI ctrl register directly by doing this:
- read VI ctrl/status register (0xA4400000)
- search RAM for any values that match what's inside that register (indicating a context buffer)
- save these addresses so that they don't need to be searched for again
- install gameshark-style cheat that will overwrite the addresses that were found with the desired values

What patcher.asm currently does is install an exception handler. The handler that it installs will go through the list of codes that the user supplies and apply them to the game one by one. We just need to modify the handler in patcher.asm so that before going through the GS code list, it searches for the context buffers and adds a GS code to its existing list. This would essentially automate what the participants of this thread have been doing manually- i.e. opening up an emulator, searching for occurrences of the VI register value in memory and writing a GS cheat to patch those addresses.
 

Locked