The following warnings occurred: | |||||||||||||||
Warning [2] Undefined property: MyLanguage::$archive_pages - Line: 2 - File: printthread.php(287) : eval()'d code PHP 8.2.18 (Linux)
|
Coding Questions and other Quandaries - Printable Version +- Mario Kart Wii Gecko Codes, Cheats, & Hacks (https://mariokartwii.com) +-- Forum: Hacks/Modding (https://mariokartwii.com/forumdisplay.php?fid=14) +--- Forum: Code Support / Help / Requests (https://mariokartwii.com/forumdisplay.php?fid=61) +--- Thread: Coding Questions and other Quandaries (/showthread.php?tid=1926) |
RE: Coding Questions and other Quandaries - Vega - 12-23-2021 Here's a better version of what I wrote up. I haven't tested this at all. Uses C0 instead of C2. Pin Config table (10 available configs) done as a Gecko String Write at 0x80001500. Button Status byte still at 0x800003FF, and Pin Config tracker byte still at 0x800003FE Here's the code, I left all the pin config blank (00's). Each pin config allows to edit the config of all 10 pins aka bytes. 10 x 10 = 100 total pins (bytes) to configure 06001500 00000064 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 #Final word of null is NOT part of the pin config C0000000 00000010 3C608071 A0038D40 7000XXXX 3C608000 #XXXX = button activator 40820010 38000000 980303FF 4E800020 880303FF 2C000001 4D820020 38000001 980303FF 88A303FE 38A50001 2805000A 41A00008 38A00000 98A303FE 1CA5000A 3D208126 612996B9 60631500 7C632A14 3863FFFF 3800000A 7C0903A6 8C030001 9C09057C 4200FFF8 4E800020 00000000 Sources: 06 Write ~ Code: #Pin Config Table at EVA (06 Gecko String Write at 0x80001500) And C0~ Code: #Get button(s) pressed, check against desired activator If you are going to test this, step thru it first. Thread on C0 codetypes (includes how to debug/step them) - https://mariokartwii.com/showthread.php?tid=1156 RE: Coding Questions and other Quandaries - Hackwiz - 12-24-2021 Ok, now I have time to check this out. Looks interesting. BTW, my code with less writes was No Bueno. 1) I was doing using exact value conditionals with a changing number. 2) I also found it is necessary to write all ten pins or there are bugs when the pins are swept away and reset. with the code activated and #1 fixed. Updated with > < conditionals, and the values of the conditionals to adjust for pin placement lag. Seems to work pretty good. The way you are proposing is more what I had in mind. Besides, this could open up doors to other modes of gameplay. Random pins????....... RE: Coding Questions and other Quandaries - Vega - 12-24-2021 (12-24-2021, 08:13 PM)Hackwiz Wrote: Besides, this could open up doors to other modes of gameplay. Random pins????....... That would be neat. Random pins (considering we're just differentiating between 1's and 0's) would be easy to implement a function for. Could use what's called the Time Base, or write your own RNG. RE: Coding Questions and other Quandaries - Hackwiz - 12-25-2021 Winner winner chicken dinner! Works fine in Dolphin. 06001500 00000064 01010101 01010101 01010000 00010001 01010001 00000001 00010100 00010000 00010001 00000001 00000001 00010100 00000001 00000000 00010001 00000100 00000100 01000000 00010001 00000000 00000000 00000100 01000101 01000000 01000001 00000000 C0000000 00000010 3C608071 A0038D40 70001000 3C608000 40820010 38000000 980303FF 4E800020 880303FF 2C000001 4D820020 38000001 980303FF 88A303FE 38A50001 2805000A 41A00008 38A00000 98A303FE 1CA5000A 3D208126 612996B9 60631500 7C632A14 3863FFFF 3800000A 7C0903A6 8C030001 9C09057C 4200FFF8 4E800020 00000000 E0000000 80008000 Will check it out on the Wii. Nice piece of work. Now to dissect what you did. Very cool indeed. Had to add another pin configuration for 10x10=100 Only had nine configs. RE: Coding Questions and other Quandaries - Vega - 12-25-2021 Mine does have 10 configs, the source clearly shows that. And on the compiled code there's 12 1/2 words of null. 12 1/2 words converted to bytes is 100. Either way, I'm surprised it works. My usual rough draft sources always have some blunder present somewhere. I have a tendency of making silly mistakes For making random pins, a simple way would be using the Time Base. Since we need ten pin configs and the pin value as a byte can only be 0x00 or 0x01, we can use a stream of 10 bits for the random pin sequence. We'll use the least significant (far right) 10 bits of the time base. It's random 'enough' to get the job done. Here's the code and source where you update the pin config based on the typical button activator like the last source. C0000000 0000000D 3C608071 A0038D40 7000XXXX 3C608000 #XXXX = button activator 40820010 38000000 980303FF 4E800020 880303FF 2C000001 4D820020 38000001 980303FF 7C0C42E6 700003FF 3C608126 606396B9 38A0000A 7CA903A6 5400083C 5400F87E 540507FE 9CA3057C 4200FFF4 4E800020 00000000 Source: Code: #Get button(s) pressed, check against desired activator RE: Coding Questions and other Quandaries - Hackwiz - 12-25-2021 You are correct. Your code does account for ten configurations. However, I found a duplicate configuration after you posted your code and removed it. the reason I noticed is because one of the configurations was "no pins set" lol. So I added a 1-2-3-7-10 split for the tenth config. RE: Coding Questions and other Quandaries - Hackwiz - 12-26-2021 So here is what I found checking out your code. Not the random pin one. The one you posted just before it. Works great on the Wii also. One of the things I was after, was having the pin configurations set all the pins, even on your second roll, so you could practice the chosen split, over and over, even if you knock a pin or two over on the first roll. Your code will indeed change the split configs, but on the second roll any pins knocked down on the first roll, stay down. Basically, it works like the standard game with the ability to change pin configs. This is good, because: 1) It does behave like the standard game until your code is activated with (-) button. and continues to act like a standard game. This makes for a great default setting. 2) Using your code with my insanely long conditionals with writes for all the pin configs, gives me exactly what I was looking for. - "Standard" gameplay mode until you Press (-) to enter "Splits Only" mode and cycle through pin configs. - Press 1 to exit Splits Only mode and continue in standard mode. Behold: 06001500 00000064 01010101 01010101 01010000 00010001 01010001 00000001 00010100 00010000 00010001 00000001 00000001 00010100 00000001 00000000 00010001 00000100 00000100 01000000 00010001 00000000 00000000 00000100 01000101 01000000 01000001 00000000 c0000000 00000010 3c608071 a0038d40 70001000 3c608000 40820010 38000000 980303ff 4e800020 880303ff 2c000001 4d820020 38000001 980303ff 88a303fe 38a50001 2805000a 41a00008 38a00000 98a303fe 1ca5000a 3d208126 612996b9 60631500 7c632a14 3863ffff 3800000a 7c0903a6 8c030001 9c09057c 4200fff8 4e800020 00000000 280003fe 00000000 01269c35 00000001 0126a1b1 00000001 0126a72d 00000001 0126aca9 00000001 0126b225 00000001 0126b7a1 00000001 0126bd1d 00000001 0126c299 00000001 0126c815 00000001 0126cd91 00000001 e0000000 80000000 280003fe 00000100 01269c35 00000000 0126a1b1 00000000 0126a72d 00000000 0126aca9 00000001 0126b225 00000000 0126b7a1 00000001 0126bd1d 00000001 0126c299 00000001 0126c815 00000000 0126cd91 00000001 e0000000 80000000 280003fe 00000200 01269c35 00000000 0126a1b1 00000000 0126a72d 00000000 0126aca9 00000001 0126b225 00000000 0126b7a1 00000001 0126bd1d 00000001 0126c299 00000000 0126c815 00000000 0126cd91 00000001 e0000000 80000000 280003fe 00000300 01269c35 00000000 0126a1b1 00000000 0126a72d 00000000 0126aca9 00000001 0126b225 00000000 0126b7a1 00000001 0126bd1d 00000000 0126c299 00000000 0126c815 00000000 0126cd91 00000001 e0000000 80000000 280003fe 00000400 01269c35 00000000 0126a1b1 00000000 0126a72d 00000000 0126aca9 00000001 0126b225 00000000 0126b7a1 00000001 0126bd1d 00000001 0126c299 00000000 0126c815 00000000 0126cd91 00000000 e0000000 80000000 280003fe 00000500 01269c35 00000000 0126a1b1 00000001 0126a72d 00000000 0126aca9 00000000 0126b225 00000000 0126b7a1 00000000 0126bd1d 00000000 0126c299 00000001 0126c815 00000000 0126cd91 00000001 e0000000 80000000 280003fe 00000600 01269c35 00000000 0126a1b1 00000000 0126a72d 00000001 0126aca9 00000000 0126b225 00000000 0126b7a1 00000000 0126bd1d 00000001 0126c299 00000000 0126c815 00000001 0126cd91 00000000 e0000000 80000000 280003fe 00000700 01269c35 00000000 0126a1b1 00000000 0126a72d 00000000 0126aca9 00000001 0126b225 00000000 0126b7a1 00000001 0126bd1d 00000000 0126c299 00000000 0126c815 00000000 0126cd91 00000000 e0000000 80000000 280003fe 00000800 01269c35 00000000 0126a1b1 00000000 0126a72d 00000000 0126aca9 00000000 0126b225 00000000 0126b7a1 00000000 0126bd1d 00000001 0126c299 00000000 0126c815 00000001 0126cd91 00000000 e0000000 80000000 280003fe 00000900 01269c35 00000001 0126a1b1 00000001 0126a72d 00000001 0126aca9 00000000 0126b225 00000000 0126b7a1 00000000 0126bd1d 00000001 0126c299 00000000 0126c815 00000000 0126cd91 00000001 e0000000 00000000 28708d40 00000200 020003fe 00001000 e0000000 80008000 Works great on the Wii RE: Coding Questions and other Quandaries - Vega - 12-26-2021 That's because the ASM only writes the pin config once while the RAM writes keep writing the specified pin config every frame (every time the Code Handler is executed). You can modify the ASM to include writing a certain pin config every frame too like the RAM writes. Let me know how the random pin config ASM works. RE: Coding Questions and other Quandaries - Hackwiz - 12-26-2021 (12-26-2021, 03:06 AM)Vega Wrote: That's because the ASM only writes the pin config once while the RAM writes keep writing the specified pin config every frame (every time the Code Handler is executed). You can modify the ASM to include writing a certain pin config every frame too like the RAM writes. Will do!!!! RE: Coding Questions and other Quandaries - Hackwiz - 12-26-2021 I went in and revisited the nightmare of setting bp's on pin status. Was quickly reminded that it brings the game to its knees (2 fps), and can cause Dolphin to crash/shut down. So I enlisted the help of the wife, in throwing the ball, so I could pause it, and just before hitting the pins, set the bp. Two instructions break when going through all pin sequences eg. Initial pin setting, replay sequences, setting pins after the first roll and the top of the next frame: 804DC914 stb r4, 0x26D (r3) and 804DCB2C stb r0, 0x26D (r30) Struck paydirt when I changed: 804DC914 stb r4, 0x26D (r3) to 804DC914 lbz r4, 0x26D (r3) Set up a couple button activators to alternate the new and original asm, and BOOM we have a code that exceeded my expectations Press (-) to cycle through splits configs. Game remains in "Standard Mode." Press (1) to lock the current pins standing, so they always appear with every roll. "Splits Training Mode." Press (2) to unlock pins and resume "Standard Mode" play. 06001500 00000064 01010101 01010101 01010000 00010001 01010001 00000001 00010100 00010000 00010001 00000001 00000001 00010100 00000001 00000000 00010001 00000100 00000100 01000000 00010001 00000000 00000000 00000100 01000101 01000000 01000001 00000000 C0000000 00000010 3C608071 A0038D40 70001000 3C608000 40820010 38000000 980303FF 4E800020 880303FF 2C000001 4D820020 38000001 980303FF 88A303FE 38A50001 2805000A 41A00008 38A00000 98A303FE 1CA5000A 3D208126 612996B9 60631500 7C632A14 3863FFFF 3800000A 7C0903A6 8C030001 9C09057C 4200FFF8 4E800020 00000000 28708D40 00000100 C24DC914 00000001 9883026D 00000000 020003FE 00001000 E0000000 00000000 28708D40 00000200 C24DC914 00000001 8883026D 00000000 E0000000 80008000 Good job Vega! Now on to the random pin code....... |