Coding Questions and other Quandaries
#56
Code:
lis r11, 0x80AF #ASM Loads upper half-word of address being monitored 0x80AF6000
ori r11, r11, 0x6000 #ASM Loads lower half-word of address being monitored 0x80AF6000
lwz r12, 0(r11) #ASM Loads word currently held in monitor address
addi r12, r12, 0x1000 #If (-) button pressed, adds 0x1000 to value currently held in monitor address
stw r12, 0(r11) #ASM Stores increase in (-) button strokes
the_end:

You should never have to load and store with an offset of zero,

Get rid of the 'ori r11, r11, 0x6000'

Update the load and stores using a 0x6000 offset.

Code:
01269C35 00000001
0126A1B1 00000001
0126A72D 00000001
0126ACA9 00000001
0126B225 00000001
0126B7A1 00000001
0126BD1D 00000001
0126C299 00000001
0126C815 00000001
0126CD91 00000001

Since every byte here is the same written value and it appears the addresses are spaced out equally, you could use an '08' Gecko Codetype for a Serial Write. Will chop that down to just 2 lines of compiled code.

Code:
addi r12, r12, 0x1000 #If (-) button pressed, adds 0x1000 to value currently held in monitor address

Why are you adding 0x1000 to 0x80AF60000 when the 16-bit If Statements you have are checking for Hex digit values at 0x80AF6000 (0x1, 0x2, 0x3, 0x4 etc)?

I'm geniunely confused by your code, maybe because it's written in such a weird fashion.

For diff button combo for each pin configuration, you can do this (no C2 ASM required)...

Code:
28708D40 YYYY0100
01... ...
01... ...
... ...
01... ...
E0000000 00000000
28708D40 YYYY0200
01... ...
01... ...
... ...
01... ...
E0000000 00000000
28708D40 YYYY0400
01... ...
01... ...
... ...
01... ...
E0000000 00000000
28708D40 YYYY0800
01... ...
01... ...
... ...
01... ...
E0000000 00000000
28708D40 YYYY1000
01... ...
01... ...
... ...
01... ...
E0000000 80008000

I threw in random button values using only 5 total pin configurations, but it should give you an idea on how to expand it.

(12-21-2021, 11:59 PM)Hackwiz Wrote: The problem though, is that once you enter my splits mode, you can't go back to a standard game
unless you totally reboot the game, which with USBLoader can be a drag.

The template I provided above might solve that problem too (as long as you don't press any button activation combo sometime right before a whole new game is setup; the USA Bowling game has to null out or do something to those pin values by default I imagine...)
Reply


Messages In This Thread
RE: Coding Questions and other Quandaries - by Vega - 12-22-2021, 01:24 AM

Forum Jump:


Users browsing this thread: 32 Guest(s)