CPU bot[Dea]
#15
(06-04-2024, 12:19 AM)Vega Wrote: Try this. You need to fill in the truth table. Each byte (pair of hex digits) represents the Slot.

01 = Use code on that slot.
00 = Don't use code on that slot.

LL = Slot 0
NN = Slot 1
PP = Slot 2
QQ = Slot 3
RR = Slot 4
SS = Slot 5
TT = Slot 6
UU = Slot 7
VV = Slot 8
XX = Slot 9
YY = Slot A
ZZ = Slot B

NTSC-U
06001500 0000000C
LLNNPPQQ RRSSTTUU
VVXXYYZZ 00000000
C252A9F0 00000005
3D808000 618C1500
7D8CD0AE 2C0C0000
801E0018 41820010
2C000000 40820008
38000001 00000000
C2721E2C 00000002
5460063E 5464063E
60000000 00000000
C2721E4C 00000005
3D808000 618C1500
7D8C20AE 2C0C0000
4182000C 38600001
48000008 5403D97E
60000000 00000000

PAL
06001500 0000000C
LLNNPPQQ RRSSTTUU
VVXXYYZZ 00000000
C252F538 00000005
3D808000 618C1500
7D8CD0AE 2C0C0000
801E0018 41820010
2C000000 40820008
38000001 00000000
C272625C 00000002
5460063E 5464063E
60000000 00000000
C272627C 00000005
3D808000 618C1500
7D8C20AE 2C0C0000
4182000C 38600001
48000008 5403D97E
60000000 00000000

NTSC-J
too lazy to port

NTSC-K
too lazy to port

Code:
#Address Ports
#All = 0x80001500
#1 = True, 0 = False
.long 0x00000000 #Slots 0 thru 3
.long 0x00000000 #Slots 4 thru 7
.long 0x00000000 #Slots 8 thru B

==========

#1st ASM (change byte value that gets read)
# 0 = Human, 1 = CPU, 2 = unused?, 3 = CPU?
#Address Ports
#NTSC-U 8052A9F0
#PAL 8052F538
#Set Truth Table addr
lis r12, 0x8000
ori r12, r12, 0x1500

#r26 = slot code is currently hooked on
#Load truth table byte based on r26
lbzx r12, r12, r26
cmpwi r12, 0
lwz r0, 0x0018 (r30) #OG Instruction; regardless of truth table byte, we need to do this instruction
beq- end

#Slot matches Truth Table
#However only change it if zero (human). As other values can exist (such as 1 and 3)
cmpwi r0, 0
bne- end

#Everything good to go, force 0x1
li r0, 1
end:

==========

#2nd ASM (get slot for 3rd ASM)

#Address Ports
#NTSC-U 80721E2C
#PAL 8072625C

#Original Instruction
#Slot in r3, extract byte and place in r0
rlwinm r0, r3, 0, 24, 31

#Also Save Slot in r4 (safe, preserved til next ASM code)
rlwinm r4, r3, 0, 24, 31

==========

#3rd ASM (return bool for parent func??. 1 = CPU bot, 0 = Human)

#Address Ports
#NTSC-U 80721E4C
#PAL 8072627C

#Set Truth Table addr
lis r12, 0x8000
ori r12, r12, 0x1500

#r4 = slot code is currently hooked on
#Load truth table byte based on r26
lbzx r12, r12, r4
cmpwi r12, 0
beq- 0xC
li r3, 1 #When slot & truth table is met, force return of True
b 0x8
rlwinm r3, r0, 27, 5, 31 #Why the mask?

OMG it works!! For whatever reason the character/vehicle choice gets screwed up a bit (P4's choice gets assigned to P1, P1's to P2's, ect) but other than that it works exactly how I wanted it to! Thank you so much, I'm going to have so much fun using this lol.
Reply


Messages In This Thread
CPU bot[Dea] - by Dea00 - 09-15-2021, 09:45 AM
RE: CPU bot[Dea] - by Yuri Bacon - 09-16-2021, 05:28 AM
RE: CPU bot[Dea] - by Vega - 09-16-2021, 09:36 PM
RE: CPU bot[Dea] - by AGES - 07-09-2022, 10:56 PM
RE: CPU bot[Dea] - by emeraldvixen - 06-02-2024, 04:53 AM
RE: CPU bot[Dea] - by Vega - 06-03-2024, 02:28 AM
RE: CPU bot[Dea] - by emeraldvixen - 06-03-2024, 02:55 AM
RE: CPU bot[Dea] - by emeraldvixen - 06-03-2024, 03:13 AM
RE: CPU bot[Dea] - by AGES - 06-03-2024, 07:38 AM
RE: CPU bot[Dea] - by Vega - 06-03-2024, 01:17 PM
RE: CPU bot[Dea] - by emeraldvixen - 06-03-2024, 07:14 PM
RE: CPU bot[Dea] - by emeraldvixen - 06-03-2024, 08:47 PM
RE: CPU bot[Dea] - by emeraldvixen - 06-03-2024, 09:00 PM
RE: CPU bot[Dea] - by Vega - 06-04-2024, 12:19 AM
RE: CPU bot[Dea] - by emeraldvixen - 06-04-2024, 01:26 AM
RE: CPU bot[Dea] - by Vega - 06-04-2024, 02:27 AM
RE: CPU bot[Dea] - by Zeraora - 07-03-2024, 02:17 AM
RE: CPU bot[Dea] - by emeraldvixen - 07-03-2024, 05:31 AM
RE: CPU bot[Dea] - by Zeraora - 07-03-2024, 05:23 PM

Forum Jump:


Users browsing this thread: 3 Guest(s)