User talk:Chadderz

From Custom Mario Kart
Jump to navigation Jump to search

CTGPR title screen

Hi chadderz, I saw you a preparing a CTGPR 1.02. I have designed a title screen image that I thought could be used considering that the CTGPR 1.01 title screen image is not very resembling to the original mkwii style: CTGPR I also made a "bokeboke" one: CTGPR bokeboke

GenieEte0 19:42, 12 June 2012

Hi chadders, 2 questions about Modifier and CTools:

  • Can your tools (de-)compress any kind oy yaz0 files or only U8/SZS and BRRES/SZS files.
  • Can your tools handle uncompressed U8 and BRRES files?

I need this info to write some hints in the tool sections of YAZ0 (File Format) and of U8 (File Format)
Wiimm 16:33, 16 April 2011 (CEST)

Only U8/SZS will be decompressed. Yes, the tools can handle uncompressed files.
Chadderz 23:53, 16 April 2011 (CEST)

Hi Chadderz, I hope that one day, the post effects can be easier to edit and understand. It would be a really great contribution to a track like GBA Luigi Circuit.

ALPHAMARIOX 10:56, 20 April 2011 (CMT)

I'm focusing on getting a CTools KMP editor first, but then I will look at other formats like post effects, as well as things like menu formats.
Chadderz 01:01, 1 May 2011 (CEST)

Happy 18th Birthday Chadderz :P. Without you MKWii wouldn'd be so much hacked :P

Tock 14:02, 8 June 2011 (CEST)

For the KMP Editor, It'd be a great idea to have Auto Configuration for Enemy/Item Routes. And for the Y positions to be simplified, not only have a map within the KMP editor, but display the course model too. (Though this will be a lot of work, I guarantee that).
ALPHAMARIOX 5:32, 2 July 2011 (CMST)

I was already intending to have both a 3d view in the editor, and more automated detection.
Chadderz 23:29, 3 July 2011 (CEST)


Hey Chadderz! You've heard of the "Super Mario Galaxy 2.5" project, right? Anyways, users there claim that you and Mr. Bean are helping to contribute to that hack by making a multiplayer mode for Super Mario Galaxy 2. Are you and Bean really a part of that hack? Or are people just pretending/lying?

SuperMario64DS 21:05, 25 September 2011 (CEST)

Sorry for the delay; hadn't noticed this! We did start work on the multiplayer; and made quite some progress, but something must have distracted us because we stopped. I don't remember why. We haven't worked on it for quite a while, but we still have all that we did. We may go back to it at some point. Sadly, now that I'm at university, I have little time for any of this, so it won't be until the next vecation at least.
Chadderz 07:59, 25 October 2011 (CEST)

CTGP Revolution Translate.

How do I translate v1.02.0000? Do you give people the files? Or do i need to translate v1.01.0000?
PC Freak 11:16, 11 April 2012 (CEST)

By the chance, I still need you to send me the files to translate. Sorry for bothering but I'm very impatient.
MrSkopelos27 11:24, 11 April 2012
Given how large the translation will be, I've decided we will also do it on the wiki. I'm just creating the articles (one per translation), they will be up before the end of today.
Chadderz 13:22, 11 April 2012 (CEST)

Why my username was delete , I don't understand...

Because that section was only for translating to languages which aren't already in the Game. French is already a game language, so doesn't belong there.
Chadderz 20:55, 11 April 2012 (CEST)
I could translate the PAL Spanish part,didn't knew about NTSC-U part. U can put trasnlation to Spanish (PAL) by x,y and z; and translation to Spanish (NTSC-U) by x,y and z. ;)
08Juan80 16:35, 15 April 2012 (UTC)
I think the translations are complete, i edited it a little bit.--Funkykong975 11:59, 26 May 2012 (UTC)

The Language transaltion

It's a general spanish, for the mexican and spanish people. The mexican people can understand the same language that the spanish, so we don't need to do a second-spanish language. I have some questions for you, ¿why the name page of your programs is chadderz is a geek? ¿The speed-o-meter will be to multiplayer mode? ¿How you can record the video from the TV? I can record with the same quality... And the last, ¿What is the name of the program to do multi channel brtsm? I can't do it with brawl box or Audacity.


Did you see the email I did send you?--Gericom 11:29, 14 July 2012 (UTC)

CTGPR Modifications

Can i release Texture Hack GP Revolution based on your distribution with texture hacked tracks and title screen ???? User:dswii3ds (talk)


I have seen that you have created the CTGP 2.8 and 4.4, I would create such a distribution, could you help me to edit the main.dol, please?. --Super-Mario68 (talk) 20:11, 20 September 2013

CTGPR Channel

The channel is not downloading onto my wii... I have the flat Wii w/o GC ports ("Family Edition" as Nintendo calls it) running 4.3 . I can still run the channel via HBC and Riivolution (I haven't tried Riivo actually) but it is a minor annoyance... sorry if I seem desperate (I already PM'ed Bean on youtube) :| The bar just goes about halfway in and the screen shows the "starting" message. I left it on for 1 hour and 23 minutes and the screen didn't change :/ invis (talk) 07:00, 13 January 2014 (UTC)

What exactly are you trying to do with it? Do you mean installing it to the Wii menu? If so, I admit we've never tested on a Family Edition before.
Chadderz (talk) 13:02, 14 January 2014 (UTC)
Yes, I am trying to install it to the Wii Menu. Sorry that I wasn't able to provide more information :/ invis (talk) 02:43, 17 January 2014 (UTC)

SZS Modifier

Did you use to create the SZS modifier?


I've sent an email to [email protected] Have you seen it? Sorry for disturbing, SlimShady (talk) 20:54, 27 January 2014 (UTC)

Why does CTGPR use 49 regions?

Why does CTGPR 1.03 use 49 regions? Does every minor update switch to a new region as a result of your overprotective loading software? --PretendingToBePro (talk) 19:36, 18 March 2014 (UTC)

Yes, it's too stop update conflicts, and also to make it more difficult to hack. We didn't originally reserve this many regions, someone else did it for us, but since there are 65535 confirmed regions, I don't foresee a problem.
Chadderz (talk) 21:46, 10 April 2014 (UTC)

Source code

Will you ever release the sources for SZS Modifier? -- Suigetsu, the transformation (talk) 04:25, 12 April 2014 (UTC)

No, it is so badly written that it wouldn't help anyone, and I no longer have a working version.
Chadderz (talk) 10:49, 20 April 2014 (UTC)
Oh, ok :/
-- Suigetsu, the transformation (talk) 13:33, 20 April 2014 (UTC)

CTGP-R 1.02 Source Code

I just downloaded your newly released source code for MKWii, and followed the instructions to do it, but it keeps saying "'make' is not recognized as an internal or external command, operatable program, or batch file." What do I do? I am using Windows 8's terminal to do it. User:Miles5x5 (talk) 2:23, 20 April 2014 (EST)

You need to install devkitpro as mentioned at the start of the building file.
Chadderz (talk) 08:06, 21 April 2014 (UTC)

SZS Explorer

When I try to open SZS Explorer by double clicking, it never show up. Please fix this as fast as you can.--CustomArio (talk) 06:23, 4 August 2014 (UTC)

It works for me, so I consider the problem fixed.
Chadderz (talk) 06:47, 4 August 2014 (UTC)
But as a programmer, you should think of your program's compatibility on other computer. More information: my computer is running Windows 8.--CustomArio (talk) 07:50, 4 August 2014 (UTC)
I have confirmed the SZS Explorer works on a Windows 8. CTools is no longer in active development so you will have to solve this yourself.
Chadderz (talk) 08:49, 4 August 2014 (UTC)
Is that true? Then my computer must be faulty. Anyway, thanks.--CustomArio (talk) 04:04, 6 August 2014 (UTC)

CTGP Revolution Source Code

I installed Devkit. But subsequent work does not know.
Chadderz please tell me
--Ac mkw (talk) 00:52, 7 August 2014 (UTC)

I don't know what you mean, but there is a BUILDING file which explains how to build the source.
Chadderz (talk) 19:23, 7 August 2014 (UTC)
I read BUILDING. But Partial "To build the project, open a terminal in this directory and use the following" and do not know.
Ac mkw (talk) 07:54, 8 August 2014 (UTC)
I'm sorry but I really don't have time to be helping everyone through the process. The source code is only intended for programmers who understand Makefiles and assembly code. The information you need is all in the BUILDING document, you'll have to look for further help elsewhere.
Chadderz (talk) 08:03, 8 August 2014 (UTC)
I understand. Thank you for letting me know.
Ac mkw (talk) 08:10, 8 August 2014 (UTC)

MK8 Stuff

Hello Chadderz, how did you get all the files out of the MK8 disc? Is there a way to dump a WiiU Disc and extract it or did you get all the files described in the MK8 Wiki via your exploit? -- Leseratte (talk) 21:40, 7 August 2014 (UTC)

Hey Leseratte, no there is no public way to extract disks. We can do it with the exploit I made, and other teams have shown they're able to do it because they know the Wii U common key, but nothing has been released that allows dumping disks. With publically available tools it is possible to dump the browser's files which do included some file formats of note (SARC, BFSAR, BFSTM), but no one has released an easy way to do this either (though I think people are working on it).
Chadderz (talk) 06:56, 8 August 2014 (UTC)

CTGPR-Source question

Hi Chadderz,

I have two short questions about the CTGP-R-Sources:

When you vote for a track (online), the track selecting menu always selects the track that was driven on in the next track choosing. I think this is not good, because if you vote for a track, and a track vote of another player was selected, you will more likely chosse your own track again instead of the one that was currently driven.

Is there a way to change this behaviour while building the source? Or are you able to find out how to change this behaviour back to original?

Thn one does not have to scroll through all the cups before each race to find the track one wants to select.

Second question: When you use the "Random"-Feature in a Friend room, you can't pick a track for the rest of the GP - the game will now always force random until the GP has ended. Any way to change this?

-- Leseratte (talk) 08:38, 9 August 2014 (UTC)

Hi Leseratte,
These are both known bugs with CTGP-R, I believe the first has been fixed as of 1.03 but I haven't ported the fix back to 1.02. I can't remember if we did fix the friend room bug. I have a lot of jobs to do at the moment, so I can't promise when I'll be able to port the fix back to the 1.02 source. You can try fixing it yourself, though I know the code is a little complicated.
Chadderz (talk) 08:42, 9 August 2014 (UTC)
Thanks for your quick reply,
as I do not understand any assembler stuff, I doubt that I'll be able to fix that on my own. (I won't even know which file I have to look at ...)
But good to know that the first bug is fixed in 1.03, maybe you find time to port it somewhen in the future.
Leseratte (talk) 08:53, 9 August 2014 (UTC)
I've now tried fixing it, but even when using unmodified sources (only downloading the pack and executing "make rmcp") my Wii freezes when pressing "+" in the offline VS track menu. Is this "normal" and do I have to test online? Or should the random track choosing work offline, too? -- Leseratte (talk) 16:59, 9 August 2014 (UTC)
No; it should be possible to use the randomiser in offline mode, I'm not sure what you've done wrong to be getting that error. Perhaps I never tested the randomiser functionality and it is broken in the source, but I'm fairly sure the first published version of the source was byte for byte identical to CTGP-R v1.02 which worked. When I get chance I'll look into it.
Chadderz (talk) 17:34, 9 August 2014 (UTC)
I've now tested the first version of the code I found at github and the freeze still occurs. It also occurs when pressing "+" in WiFi instead of the Button "Random". It'd be great if you could at least take a short look if this also happens for you or if there must be an problem with my build system.
If it's important, I'm using the PAL version of the game.
Leseratte (talk) 05:50, 10 August 2014 (UTC)
I've just had a quick look over the code and noticed a bug specifically to do with the install address for the button activator of the randomiser. I don't think it would cause your problem but it could do. In any case, I've just committed a fix so you should try using that.
Chadderz (talk) 07:47, 10 August 2014 (UTC)
Thanks for the Bugfix, selecting random works now. -- Leseratte (talk) 08:03, 10 August 2014 (UTC)

About region pool

Hi Chadderz

You are managing a network of CTGP Revolution v1.03 you? Please tell me if you're managing you.

Region pool of CTGP Revolution v1.03 do you a patch to which file? And how do you patch? AC_mkw (talk) 08:59, 9 August 2014 (UTC)

The region pool of CTGP-R v1.03 is automatically managed by our server, and cannot be changed by the user.
The region of packs built from the CTGP-R v1.02 source code can be controlled by one of the build options.
Chadderz (talk) 09:01, 9 August 2014 (UTC)
How you create the server?
AC (talk) 11:04, 9 September 2014 (UTC)
The server is programmed in C# and Java.
Chadderz (talk) 07:26, 13 September 2014 (UTC)

CTGP Revolution Text files&menupatch

hi Chadderz
Please me menupatch files and text files of all of CTGP Revolution v1.03
I want it is not a v1.02.

User:Ac_mkw (talk) 23:23, 11 August 2014 (UTC)

The same files control the menus in v1.03 as in v1.02, and they can be altered with My Stuff. You should take one from v1.02 and update it to work with the extra cups.
Chadderz (talk) 06:12, 12 August 2014 (UTC)

Updates on Incendia Castle

No updates on Incendia Castle and/or Six King Labyrinth? --Michael (talk) 03:36, 21 August 2014 (UTC)

Are you refering to MK8? If so, patience is a virtue, news will come when we have some.
Chadderz (talk) 06:02, 21 August 2014 (UTC)
Mario Kart Wii version.
Michael (talk) 10:58, 21 August 2014 (UTC)
I don't believe there are any plans for updates, you'd have to ask Bean really though.
Chadderz (talk) 05:39, 25 August 2014 (UTC)

MK8 Charcter texturing hack

So, I took a look at the MK8 Wiki. Saw there isn't any.charcter.hacks there..yet. descompress the charcters yet? Well, will, could I do a test texture? I mean, you deacompress the files, and I do the texture work. Thanks :P


Yes, in theory we can do character texture hacks, we're focusing on creating a custom track right now. We can't send you the game's original texture files, as they belong to Nintendo.
Chadderz (talk) 01:34, 26 August 2014 (UTC)
I understand. Makes sense since MK8 is a "young game", and you could troible with.Nintendo if you share the files.... ~~anEoTselkie

CTGP Revolution Font

Please tell us the name of the font for me CTGP Revolution --Unsigned comment by Ac_mkw (talk).

Gentium Basic. Chadderz (talk) 11:47, 1 September 2014 (UTC)
Tell me the name of the font for this image.
Tell me where to download it if "Gentium Basic" is the font name of the image if.
AC (talk) 12:00, 1 September 2014 (UTC)
Gentium Basic. It's not hard to find, I don't know where we got it. Chadderz (talk) 12:04, 1 September 2014 (UTC)
I was searching on Google. I do not know because there are many.
Talking about change, but I want to take a Skype contact with you AC (talk) 12:09, 1 September 2014 (UTC)
I think all of the links on Google are probably correct, it is a well known font.
Chadderz (talk) 07:26, 13 September 2014 (UTC)
I've found the name of the font. So tell me about, such as the color of the font.
AC (talk) 08:02, 13 September 2014 (UTC)
I don't know what colour the font is, nor the exact parameters. It was drawn on Micrsoft Expression Design using a gradient fill, outline and shadow.
Chadderz (talk) 08:06, 13 September 2014 (UTC)
Thank you for letting me know.
Why you do not authenticate the Skype contact me?
AC (talk) 08:18, 13 September 2014 (UTC)
I already have hundreds of Skype contacts and I'm trying to avoid having too many. You can already contact me on here of course.
Chadderz (talk) 09:02, 13 September 2014 (UTC)
I would seen by other people in the talk page. I use Skype to avoid it. So to authenticate contact me.
AC (talk) 10:23, 13 September 2014 (UTC)

About Greek language

Hi Chadderz! I just wanted to nitifite you that I made some changes to the Greek language of the CTGP-R Channel with the most notable being the grammatical change to the "Mario Kart" phrase as I wrote it in English just like other languages (except Japanese and Korean) because... probably because it was written in English in the Greek instruction manual too. And because it was written in English in the Russian language too. and because Greece is in Europe. OK I don't have any more "becuase" for that thing. See for yourself too because Bean has to update the Greek language sometime in the future. (And why I made those minor changes after the Greek language was released... Godammit.) Sarantis (talk) 15:04, 11 September 2014 (UTC)
Hi Sarantis, thanks for letting me know. We have a big problem with updating language files actually. I admit that in retrospect it was a badly designed system, but basically it requires a massive, manadtory update to update them. This is the main reason we've been slow on introducing new langauges. I'll let Bean (who is in charge of updates) know and if we get enough langauge updates together he'll do them all together (and hopefully we can make it easier to update in future).
Chadderz (talk) 07:26, 13 September 2014 (UTC)

Countdownmode + normal mode on the same time

I talked with AC and he said that the countdown + normal mode work on the same time. I think that's wrong, because when you load the riivolution pack the gct change the normal race modes to countdown and not only battle like in ctgp-r So you only can choose one of the them for a custom track distirbution, except a riivolution switcher --Horsti12™ THE Clouddealer (talk) 15:31, 14 September 2014 (UTC)

Oh, I didn't know the riivo pack altered normal races, Bean made countdown so I don't know all the details. I think a Riivo switcher would be the best option then. Bean said at some point he would release the version of countdown he put in ctgpr v1.03 as a standalone riivo pack, so when he does that it should have the battle mode.
Chadderz (talk) 15:34, 14 September 2014 (UTC)

CT-Code MOD System

You said that I can simple include cheats in the CTGP_CODE when I port gct to mod "The MOD system allows the addition of 'cheat like' codes. If you look in the bad1/bad1data/mod folder you'll see lots of .mod files. Each of these contains a series of patches to be applied to the DOL or the REL, so you can port the GCT into that format."

Can you explain this a little bit more please? --Horsti12 (talk) 14:10, 21 September 2014 (UTC)

The MOD system let's you change the memory of the game when CT-Code boots. A simple example is, which was the unban code. This file describes a simple change to the memory in which the address mod_unban_addr (see is altered to be the instruction "li r5,3". This is exactly the same as the common 041D0E50 38A00003 GCT unban code because 38A00003 means "li r5,3" (see and mod_unban_addr is 801D0E50 in PAL, and 04XXXXXX YYYYYYYY in GCT means write YYYYYYYY to address 80XXXXXX. This is an example of how simple 04 GCT codes can be ported. C2XXXXXX YYYYYYYY codes are also easily ported as these effectively write multilple values instead of just one. More complex GCT codes require translating into ASM. It's certainly not terribly easy to port GCT codes, but then it wasn't designed to be; the more different our system, the harder it would be for would-be hackers to attack CTWW in v1.02.
Chadderz (talk) 17:14, 21 September 2014 (UTC)
Would it be possible to put the source code of the "Lap count modifier" inside such a mod file to use the Lap Count modifier in an ISO without cheat code?
I've tried disassembling it with the page you wrote, but I got lots of errors while compiling.
Leseratte (talk) 16:14, 22 September 2014 (UTC)
Yes, that absolutely would be possible, in fact that is how it is implemented. Unfortunately it's implemented in the v1.03 version, which is different from v1.02, hence the need to back-port the features we've added (see #CT-Code v1.03 Features).
Chadderz (talk) 16:59, 22 September 2014 (UTC)
Let's say I wanna port this code: 048A5380 00000003. I added a new line "PROVIDE(test = 0x808a5380);" inside the rmcp.ld, created a new mod file: MOD_DOL(mod_test, test, .long 0x2000000; ), and added it to the bad1mod-makefile.
With my code, I get this error: powerpc-eabi-ld:build/rmcp/m0d.text.elf.ld:103: syntax error
Leseratte (talk) 16:56, 28 September 2014 (UTC)
EDIT: I now was able to compile the CTCODE but when I run the game, the cheat code does not work...
What am I doing wrong? -- Leseratte (talk) 17:16, 28 September 2014 (UTC)
First of all, I noticed you've put ".long 0x2000000" which would write 0x20000000 rather than 0x00000003 like the GCT code you posted does. You'd want ".int 0x00000003" to write that instead.
Secondly, there is a slight difference I forgot to mention between the GCT code and the MOD code in that the 04 will set the value every frame, whereas the MOD_DOL sets it only once. I'd guess in this case the value would need to be set every frame. Therefore, you would need to instead alter the code which sets the value.
Finally, I think that address is probably in the StaticR.rel not main.dol, so you need to use MOD_REL not MOD_DOL.
Chadderz (talk) 09:46, 29 September 2014 (UTC)
I only had a "2" instead of an "3" because I mixed up the two values. The disassembler wrote "20000000" instead of "00000002", but even with this value and "MOD_REL" it does not work. You are talking about "setting this value every frame". I tried putting this code inside a loop (is it this what you mean?) but it did not work either: "0: .int 0x00000002; b 0b;".
Or did you mean something else by "alter the code which sets the value"? Is there any way to check with Dolphin if the value is overwritten by the game? -- Leseratte (talk) 14:53, 29 September 2014 (UTC)
The disassembler you're using must be in Little Endian mode not Big Endian like the Wii, explaining why it put 02000000 not 00000002.
The loop you have written would not work because you are combining code and data. ".int 0x00000002" is not an instruction, it is literally the 4 bytes 00 00 00 02. "b 0b" is an instruction. Most of the time the MOD system is used to insert instructions into the games existing code, rather than set values, as values change over time but instructions do not. Normally you would find the instruction which sets a value and change that rather than change the value.
You can check which instruction sets a value in Dolphin using a breakpoint. I believe you run Dolphin with /D on the command line to enable debugging features such as breakpoints. You would then need to set a write breakpoint on the address you mentioned to see which line(s) of code alter it. You could then change how they modify it, for example by changing the instruction to "nop" which does nothing. Alternatively you can breakpoint to see how the value is loaded and replace those instructions with "li rXX,2" which would instead always load the value 2 into rXX.
Chadderz (talk) 08:50, 30 September 2014 (UTC)

One last question about the "C2" code type: You said it is also easy portable since it only writes multiple bytes. Can you please give me an example on how to port C2 codes? Simply inserting the values in the StaticR.rel at the correct offset won't work, I assume, because there are only 4 byte space. Probably, there has to be a code like "jump to some unused location", and I'd have to find an unused part in the StaticR.rel to copy the code to.

Can you show me how to handle a C2 code with the CTCODE mod system? -- Leseratte (talk) 16:56, 8 November 2014 (UTC) EDIT: I think I just found out my mistake. I'll try again and answer again if it does not work.

CT-Code v1.03 Features

You also said that you will port in the future the CTGP_CODE v1.03 to v1.02 when you finish your exams, is that in progress or is it cancaled, just tell me if you work on it atm or not --Horsti12 (talk) 14:10, 21 September 2014 (UTC)

It's not currently in progress, but I do intend to do it. I admit it's not top of my prorities list right now, with MK8 hacking and my PhD to think about. I wouldn't want to promise it by any particular date, but I will do it at some point.
Chadderz (talk) 17:14, 21 September 2014 (UTC)

Network Protocol details

Hello Chadderz,

I have two little questions about some details in the MKWii network protocol - would be great if you'd be able to answer them. This would be great for improving Wiimms mkw-ana.

First question: Yesterday during our MKWii tournament we had a crazy situation: After each race, the Wiis send their driven time to all other Wiis to determine the rankings. Yesterday, we had two groups of two players (Player 1 & 4 and Player 6 & 7) who transmitted exactly the same time (we did not have seen this rare event in the last two years...).

This looked like this in Wiimms tool mkw-ana:

> RESULT.RACE GRPR.3.2, race=10, id=12, 150 ccm
#                    racing  delta      points   
# #  pos mii name     time  in msec   tool  wii 
  1.  0  Player 1   2:22.205     -    +15   +10
  1.  3  Player 4   2:22.205     0    +15   +15
  3.  5  Player 6   2:22.552   347     +7   +5
  3.  6  Player 7   2:22.552     0     +7   +7
  5.  1  Player 2   2:23.746  1194     +3   +3
  6.  2  Player 3   2:24.086   340     +1   +1
  7.  4  Player 5   2:25.559  1473     +0   +0

The column "tool" are the points given by the tool, the column "wii" are the points given by the wii (extracted from a picture of the result screen) mkw-ana assigned both players the better point count - 15P and 7P. The game gave us the following points (same order as above): 10; 15; 5; 7; 3; 1; 0

I had the guess that the game might prefer the one who has the greatest slot ID - but unfortunately, in this race the "room slots" and the "race slots" were the same, so we could not figure out what exactly is used by the game to define who gets more points.

Are you able to find out which player(s) are preferred by the game if multiple players have the exact same racing time?

Second question:

To detect players who use a VR cheat, it would be great if the server was able to calculate, how much VR a player got for winning/loosing a race. I found a formula in the, but I tested it and the formula is wrong.

Do you have a way to find out how the Wii calculates VR points?

It would be great if you could answer these two questions, please.

-- Leseratte (talk) 19:36, 24 October 2014 (UTC)

Hi, I'm now working, so I don't have so much time to look at this sort of thing. If I get chance I'll have a look, or you can try asking Bean if he can find it with the USB Gecko.
Chadderz (talk) 09:33, 25 October 2014 (UTC)

Can you help me with something.

I'm making a distribution called CTGP 2.8 (Remastered) and a few features I'm including... well I don't know how to code like Countdown Mode and Random Track Selection and when I enable Draggable BlueShells in Wii-CT-Code Master it enables the extra course slots for no reason.So if you can a help me with this then the distribution can be completed. 4tbMyles8110mkwii 11:30 31 January 2015 (UTC)

The Countdown Mode isn't possible, because the wii-ct-code master use the v1.02 CTGP_CODE which didn't have the max lap count modifier & Speed Modifier and the countdown mode included for the other things you should use Wiimms SZS Tools --Horsti12 (talk) 19:39, 31 January 2015 (UTC)
Then what's the what am I supposed to type?
4tbMyles8110mkwii 9:39 1 February 2015 (UTC)

SZS Modifier Error

I attempted to load the SZS Modifier on my new computer and have come across an issue. For the SZS Modifier, I receive the following message: Unable to locate application file 'SZSModifierSetup.msi'.

See the setup log file located at 'C:\Users\HP_ADM~1\AppData\Local\Temp\VSDF8B0.tmp\install.log' for more information.

The new computer runs Windows 10. My previous computer ran Windows XP and it worked fine. Any suggestions? Thank you.--Littlelum (talk) 02:50, 1 September 2016 (UTC)

I can launch the SZS Modifier just fine, and I have Windows 10. Did you try uninstalling and reinstalling...? Did you try any other methods to resolve your issue...? --Michael (talk) 05:16, 1 September 2016 (UTC)

Making code patches for Mario Kart Wii

I want to make patches for mkwii and I don't have a usb gecko. I have devkitpro. Where should I start? Do I need to code in C in devkitpro or make asm directly? iSYan (talk) 22:13, 4 October 2017 (UTC)

Buy an USB Gecko. It is nearly impossible to make game patches without one. Then, look at other patches (for example, C2 codes), and use the Gecko and try to understand what they do. Then write your own (a C2 code is basically just ASM) -- Leseratte (talk) 03:46, 5 October 2017 (UTC)
I'd agree with Leseratte that a USB Gecko is useful. They're no longer in production so they may be hard to find. I believe Shuriken USB is an identical device which recently got released, so may be easier to purchase, I've not tried one myself. If you can't get either then you'll be stuck using Dolphin, if you start it with the "/D" command line option you'll get access to some debugging features which may be enough to develop codes.
I'd suggest you read the articles on Assembly Code and GCT Cheat Codes if you haven't already and the Compiler article may help understand the game's code. The game code is all ASM, codes you develop will generally either be trivial GCT Cheat Codes or ASM for anything complicated. The ASM is then packaged up into C2 GCT codes as Leseratte mentioned.
Writing mods in C is possible, but is rarely worth the effort. I've made a tool to make writing C game mods slightly easier which may be useful to you called Brainslug.
Chadderz (talk) 08:12, 5 October 2017 (UTC)
Alright. Also, do you have a disassembler for the game's code and a ram map so I can start studying the game's code? I'd like to study that while I learn ppc. iSYan (talk) 01:38, 8 October 2017 (UTC)
Both Dolphin and the tools that work with the USB Gecko (Gecko dotNet and Wiird) all come with inbuilt disassemblers. Personally, when I want I full game disassembly I use powerpc-eabi-objdump from devkitPro. There are no address maps for MKWii that I know of publicly. That's why the debugging tools are so useful; you can breakpoint interesting code or data to find out when it is used and then start analysing the code from there. A handful of articles on this wiki in the Function Category pages have addresses in which you could also use as a reference.
Chadderz (talk) 07:50, 8 October 2017 (UTC)
Also, I've heard that DOL's from games and DOL's from homebrew apps are completely different. Is that true? If so, how are they different? iSYan (talk) 16:14, 8 October 2017 (UTC)
Not completely different no, they're about the same in terms of file format (a very minor variation). The code is all PPC asm. gcc, the devkitpro compiler, generates somewhat different looking code compared with the game's compiler. They also use totally different libraries. They are far more alike than different though, and both would be find to analyse and understand.
Chadderz (talk) 16:20, 8 October 2017 (UTC)
Ok. And was the CTGP channel developped in PPC or C? Maybe I'd start making some channels like it. iSYan (talk) 17:02, 8 October 2017 (UTC)
Almost entirely C. The game mod parts are part C part PPC. Chadderz (talk) 17:04, 8 October 2017 (UTC)
And if I wanted to make a channel like that, what tools would I need to download and how would I make it patch the files? iSYan (talk) 17:11, 8 October 2017 (UTC)
It's just developed using devkitPro. It's not a question of tools; we had to program it to do everything it can do. Maybe take a look at Brainslug for an example of an app coded to load a game and mod it in some way. Chadderz (talk) 17:15, 8 October 2017 (UTC)
Ok. I was wondering about the GUI and the C code to install the patches when we click "Launch Game". Is it just a few images loaded by the code? iSYan (talk) 17:21, 8 October 2017 (UTC)
There is nothing special about the GUI, any guide for homebrew app gui would teach you that. Installing the patches is complicated and unique. As I say, Brainslug my offer some hints on how to do that. Chadderz (talk) 17:38, 8 October 2017 (UTC)
Ok. Also, when I installed the CTGP source, it said in the BUILDING file: A code section to be appended to the main executable of the game (main.dol) which should be loaded at 0x802A5000. But I checked the main.dol, and it ends before 0x802A5000. Do I have to fill the gap with 00's? iSYan (talk) 17:48, 8 October 2017 (UTC)
Yes anything which loads the right stuff at the right address will do. The way we did it is to add a new section, meaning using some of the unused parts of the header and extending the file. The dol actually ends at 8038917c (in PAL) so 802A5000 does actually overlap the game's .bss section so it is 'in the dol' but not as a loadable address. You could also just download CTGP 1.02 and take a look at the dol file to see how we did it. Chadderz (talk) 17:59, 8 October 2017 (UTC)
So for the NTSC-U main.dol, would it be the same offset? Also, my main.dol ends at 0x29F340. And if I subtract 0x80004000 from 0x802A5000, the result is 0x2A1000, which is past the end of the file. iSYan (talk) 18:08, 8 October 2017 (UTC)
Subtracting 0x80004000 is not how DOLs work. You need to look at the header which is (somewhat) documented at DOL (File Format). Different parts of the file need different adjustments. Chadderz (talk) 18:13, 8 October 2017 (UTC)

ct-code questions

Hi Chadderz, I am just playing around with the ct-code and I have a few questions:

- I found the following comment in one of the README files: "Unfortunately, for simplicity, MOD2 remains in memory prementantly. Therefore we want to make it as small as possible, so anything which can be done in MOD1 should be." Is there a reason - other than "we had no time" - you didn't just call free() on the pointer at the end of the code in /bad1/bad1Data/mod/mod2.mod? That code only runs once, and I didn't see any other place in the code that would need the mod2 pointer. Am I missing something? Wouldn't it work to just call free() after applying these patches? Or does that result in any other problems I don't know of?

- You changed CupSelectCup.brctr and CourseSelectCup.brctr to have the new CTGP menu with the arrows scrolling through the code. Opening the BRCTR in a BRCTR editor, I have found the modifications you did to move the buttons and change their size, and I found the mods in menu.mod which scroll the menu when they are pressed. However, I was unable to find the code parts related to navigating through these buttons. Is that behavior (what button will be selected next when I press one of the cursor buttons) in the brctr? Is it in the menu.mod and I missed it? I don't like the fact that I can't select the arrow buttons while on the bottom row and would like to change that somehow...

- Do you happen to know if MKWii has a memmem() function somewhere? I don't have that on my function list, and writing memmem() using a loop around memcmp() sounds slow and not a great solution when called on a larger memory space ..

Thanks for answering my questions, -- Leseratte (talk) 14:13, 13 October 2017 (UTC)

Hi Leseratte,
- I no longer recall whether or not there is anything that relies on MOD2 remaining resident, but given that I wrote "for simplicity" I'm assuming it's just a case of not knowing where free was when I wrote it or something equally silly. I don't believe there is any need to keep it around, but I can't promise. Either way, it's not actually that big so I'm not sure it matters.
- When we did the edits to the brctr files, there were no editors available, we did it by searching for the floating point numbers we'd found in RAM and editing the relevant ones. As far as I know that's all we did to the brctrs. All the actual behaviour is in menu.mod. As far as navigating between buttons is concerned, I don't actually know how that works. I thought it was deduced automatically based on the buttons coordinates, though it is slightly dodgy for the arrows as you note. I don't remember changing anything to cause the new layout to link up correctly. Perhaps the modern knowledge of brctrs could explain the dodgy behaviour ct-code exhibits.
- memmem is a glibc extension and not in the C standard library as far as I know, so it's unlikely to be present. I'm also not aware of any similar function that I've seen. A loop around memcmp would not be terribly inefficient for small searches, generally matches will be rare so memcmp will return after checking one byte. If you're searching a larger range then probably you should implement something like the Rabin-Karp algorithm. Brainslug solves the same problem with the Knuth-Morris-Pratt algorithm but that's overkill.
Chadderz (talk) 10:05, 14 October 2017 (UTC)
Thanks for your answer. I'll try adding the free() call to the module to see. I know it's not that much space, but it would have the advantage that one could just place all mods as MOD_REL without needing to find out if the code is in the DOL or the REL (if this is unknown), and without having to worry about space. Or does MOD_DOL have any other advantage over MOD_REL when space is of no concern because I free() it?
For the menu thing, if you have never changed anything about navigation but the game still recognizes the old special cup and the old lightning cup to be in the same row without any code or BRCTR mod, the only thing left could be position and size - but then why doesn't it select the arrow? In the main menu, you are perfectly able to press "down" on any of the "2 player, 3 player, 4 player" buttons to get to the MKWii channel. Maybe the left/right buttons' height is just a few pixels too low so the game doesn't recognize that these buttons stretch over two rows? I'll try making the arrow buttons a bit larger then.
The thing about memmem() is unfortunate. I wanted to use it to check the existance of a file on the disc by searching for \x00filename\x00 in the FST. Do you know where the game routine to open a file on disc is, so I could use that to check for existance of a file on-disc? When I tried to trace the code opening a file I always ended up in the general disc read function reading blocks, and not something like open("/Race/Course/whatever.szs") which I could use ...
Leseratte (talk) 10:25, 14 October 2017 (UTC)
About what determines which next button is selected, I think it's also in the BRCTR, but I'm not really sure in which value it depends. I remember that I modified this in my Race.szs pause menu, and the order didn't exactly changed, but it messed up and when pressing down or up it just skipped one button: (talk) – CT/MK8 Wiki Admin 11:54, 14 October 2017 (UTC)
Interesting. Do you still happen to have that BRCTR somewhere? Could the BRLYT be related to this, too? -- Leseratte (talk) 11:59, 14 October 2017 (UTC)
@Chadderz would it be possible that the game uses some "internal size" for that? Maybe the "scale" in the BRCTR is just for display and they use the internal default size for navigation? I'll try rescaling the arrows to 1.0 and instead move them down a bit ... -- Leseratte (talk) 12:19, 14 October 2017 (UTC)
This is going to be veeery difficult ... I have just looked into the main menu BRCTR to find out how Nintendo does this - every time Nintendo has a block of buttons navigating onto a single button (like the 6 cups onto each of the arrows), they put the block of buttons into its own BRCTR. That means, they would have implemented "load arrow left, load another BRCTR with 6 cups, load arrow right" into that one pane instead of loading every single cup icon at the same time as the arrows. That means one would have to hook into the generic game code handling the navigation and implementing an edge case for exactly this menu and that is probably outside of my skills ... -- Leseratte (talk) 12:42, 14 October 2017 (UTC)
Here's the BRCTR if you still need it: (talk) – CT/MK8 Wiki Admin 11:28, 15 October 2017 (UTC)
I have found another solution: I have modded the CTCODE so pressing "right" on the two right cups or "left" on the two left cups does the scrolling. No need to select the arrow button (that can only be pressed with the wiimote pointer with that change), so this works in both rows. Only problem is that the track list below doesn't update while scrolling. It didn't do that before either, but the "arrow" has no tracks anyways. Do you happen to know which of the dozen functions in menu.mod (or in the game itself?) handles just refreshing the track list and nothing else? -- Leseratte (talk) 15:00, 14 October 2017 (UTC)
Regarding MOD_DOL vs MOD_REL, the only thing to worry about is timing; MOD_DOL applies before any game code is run, whereas MOD_REL will apply shortly after StaticR.rel has loaded. Thus if you were patching say OSCreateThread using MOD_REL, only threads created after that time would use your mod. As for deciding whether an address is StaticR.rel or main.dol, that's actually trivial, below 0x80400000 is DOL, above is REL. The true cut off between the two is different, but fortunately there is a large gap between the two, so that test will always give the right answer. Most things we want to edit are in StaticR.rel, so what I tended to do in ct-code is use MOD_DOL to transfer large routines to the early RAM, then branch to them using MOD_RELs to keep those small.
Regarding memmem, yes that is unnecessary for that, the game obviously does contain FST parsing code. If you didn't already know Twilight Princess is very useful in that the game disk contains a symbol table for the entire game's code. Thus if you own and dump that game you can find out what library routines exist and what they look like, then search for the equivalents in other games. I note that game has a method called DVDConvertPathToEntrynum so I speculate that will suffice for an existence check on a file. A quick look suggests it has one parameter; presumably the path in r3 and returns the index into the FST of the file or -1 for non existent files. I'd say it looks like that method is at 8015df4c in RMCP.
Regarding the menus, I don't know where the game's method to refresh the track list is; we avoid needing it by having arrow buttons as you note. Bean does know where the method to change the text on an interface is, so perhaps if you ask him for that and breakpoint it, the track refresh method will be the one calling it.
Chadderz (talk) 09:14, 15 October 2017 (UTC)
Thanks for the DVDConvertPathToEntrynum function, I'll try that. Now that you remember me of Twilight Princess, I have already heard that this game has debug symbols and I planned on buying it. That function sounds like it does what I want it to do. Bean has already told me the function to draw a BMG text to a panel, it's at 8063DDB4 PAL. I'll look into its call stack to see if I find a function refreshing the whole list. Thanks! -- Leseratte (talk) 10:30, 15 October 2017 (UTC)

Another quick question, the ct-code (at least, MKW Fun with the ct-code does) seems to crash when you play a 4-player offline VS race and multiple players select a mii to drive. The crash happens around 80601C70 PAL because of a "bctrl" to 0. Do you have an idea what causes this? Is this because of the ct-code or because of something else? Did CTGP 1.03 have this problem as well and if yes, how did you fix it? -- Leseratte (talk) 17:19, 16 October 2017 (UTC)

It's not possible to play 4 Player mode in ctgp anyway. It crashes as soon as you select 4p mode from the first menu. Sucht93a (talk) 17:32, 16 October 2017 (UTC)
Wasn't this fixed in 1.03.1044? -- Leseratte (talk) 17:36, 16 October 2017 (UTC)
It's broken again for a long time Sucht93a (talk) 17:49, 16 October 2017 (UTC)
As far as we know the 4 player freeze(s) are all to do with memory exhaustion. The cup icons increase the memory consumption too far, malloc fails and the game does something with NULL. We're looking into optimisations to avoid this such as changing the format of the icons. Chadderz (talk) 09:07, 17 October 2017 (UTC)
The game requires that much memory it is unable to load ~50 small cup icons into RAM? Then how is it able to load multiple megabytes of tracks? -- Leseratte (talk) 09:15, 17 October 2017 (UTC)
Because the game doesn't actually have full use of continuous RAM and an implementation of malloc. Memory allocation is much more complicated from what I've seen involving the various heaps each with a given capacity. If one of those fills up then further allocations to that heap will fail. So the game can run out of memory with many megabytes free. Chadderz (talk)
It still freezes with only 14 cups. Is this possible, that 14 cups plus whatever the game tries to allocate is still less than what ~50 cups need? -- Leseratte (talk) 20:41, 18 October 2017 (UTC)
The main culprit, I think, is ct_icons.tpl, which holds one 128x128 RGB5A3 icon for each cup (plus the two arrows). Maybe it's possible for the game to use 64x64 cup icons instead, which can cut the memory usage by 75% per cup. A BRLYT and/or BRCTR edit will be necessary though. Aplumafreak500 (talk) 16:36, 19 October 2017 (UTC)
Yes, we suspect ct_icons.tpl. I suspect it is copied to some small heap somewhere. Our thought was to change the format to CMPR, though this would imply a code change to CT-CODE. Chadderz (talk) 08:26, 22 October 2017 (UTC)
Wouldn't it be easier to make the game copy that to a larger heap / somewhere else where there is enough space? --Leseratte (talk) 08:34, 22 October 2017 (UTC)
Perhaps, but given we don't know where it's going in the first place, that may not be so easy. Changing texture formats is easy. Chadderz (talk) 08:59, 22 October 2017 (UTC)

SFP Backups

Hi, Chadderz. I was wondering if you had a full backup of all the mods from the SFP server. Bri (talk) 01:42, 29 October 2017 (UTC)

Yes, though not in a sensible form. Stupidly the server stored the SFPs in a weird format which I can't convert back to SFP easily. Is there something in particular you were looking for? Chadderz (talk) 15:21, 3 November 2017 (UTC)

Codes and Edits

Please check this out: Talk:MKW Hack Pack#Codes_and_Edits Codes and Edits

Wii image FST parsing

Hi Chadderz, I am trying to write a Wii app which (among other things) reads a specific file from the game disc. I am using the di.c source code from your Brainslug app for the disc access, and I was already able to read the disc FST, parse it, search for the file I want to open and get its offset and length. However, when I try to read that file using DI_Read with the offset from the FST, no matter if I shift the offset by 2 bits or not (sometimes this is required, sometimes it isn't), the Wii still loads something else and not the file I wanted to load. I tried asking Wiimm since he has a lot of experience with Wii ISOs, but the process of reading an ISO file on a computer and a Wii disc through the IOS methods seems to be quite difficult. I figured you might be more likely to be able to help me with this problem. Do you know what exactly one is supposed to do with the offsets from the disc FST in order to read actual files and not just junk? -- Leseratte (talk) 20:00, 29 May 2018 (UTC)

Hi Leseratte. I think there are lots of examples of applications which do this, I believe the CTGP implementation is based on libfst but I can't find that library online. Fortunately there is a copy in WiiXplorer's source code, although that implementation seems to do all the decryption of the disc itself which is unnecessary so perhaps it is a bad example. For the purposes of the fst you do need to shift by 2 bits in all cases, but depending on the methods you're using to access the disc that may be done automatically. Perhaps the mistake you are making is not calling OpenPartition (DI_OPENPART) correctly. If I recall the Read calls are relative to a partition, so you must open that first.
I do call DI_OpenPartition before trying to read a file, that was not the issue, and all the encryption stuff from the fst.c in WiiXplorer doesn't seem to apply to me, IOS seems to take care of that. I just (again) forgot about that stupid requirement for the output buffer to be 32-byte-aligned. (I really wonder why IOS doesn't complain but instead just returns junk. I really should write my own wrapper for DI_Read which checks that before continuing ...). Thanks for your help. -- Leseratte (talk) 10:42, 30 May 2018 (UTC)
Again, thanks for your help so far. What I am trying to do is making brainslug work with ISOs instead of real discs. I got the channel embedded into an ISO and to load main.dol, symbols and modules from the ISO instead, it recognizes the modules, but when it starts the game, they are not active. I have sent you and MrBean a PM on with the source code, I would really appreciate it if you could take a look at it - I was unable to find out why it doesn't work and I'd guess it is due to some internal stuff in your module / symbol search engine and figured you might be able to help me out there. -- Leseratte (talk) 16:37, 31 May 2018 (UTC)

The CTGP pack has failed to compile

Hi Chadderz, recently I tried to make a CT distribution using DTools, and I changed everything. The strap, the main.dol,the track files, all the _U's in Scene/UI with SuperMenu_U, the ct_icons.tpl, everything. Then whenever I try to launch the pack, it shows the normal D Wiimm 4:3/16:9 texture, then it shows a blue screen that says "The CTGP pack has failed to compile, this texture should never appear on the Wii", etc. Then it shows weird animations on title screens, and my cup icons don't show. I don't think I could've done anything wrong, I tried with CTGP 1.02's main.dol, I even re-did the whole process 3 times. What do you think may be the cause of this? Also, since the DTools server went down, how can I make a custom SuperMenu to fit my track names? --iSYan (talk) 18:54, 8 August 2018 (UTC)