Got the defensive playbook size increased. It only goes from 1 to 2 pages, but it's better than just the 1. It's still buggy with custom plays though.
I also noticed a bug with the offensive extended playbook when using custom plays - if you press B (flip play button) on page 2, it will switch to the custom play page with them flipped. It still works, it's just not supposed to happen.
I'm thinking about how exactly we can load the custom play data into the RAM where it needs to go (starts at address 802ADF20). An issue I foresee is that there are many addresses for the custom plays, so I don't know if there's anywhere in the ROM that has enough empty space to stick this data. The alternative is to try and make the game write the memory pak file into the RAM immediately instead of waiting. If multiple people made the own plays on different memory paks, we would still need to combine them into 1 mpk file which could then be loaded into the RAM. I guess it's not the end of the world if we can't get the mpk data directly in the ROM, but it would be nice as we wouldn't have to load the custom playbook each time.
I really want to see if the play data is the same for 2001 now... I may try and import a few of those plays to see. If so, we maybe able to get in enough default plays to make a 6th offensive page and 3rd defensive one.
Here is the code for the extended playbook/timer in case you're curious how it was done.
=======================
changes to Version 2.2
=======================
Fixed defensive play issues
0xD2980 8032E930 XORI V0, S3, 0x0002 //moves actual custom custom play data to last page
=======================
changes to Version 2.1
=======================
//fixing default play flipping issue w/ play 5
8032E7E0 SW T1, 0x002C (SP) //stores into 800C2C84; flip play - boolean 0 or 1; each is for normal or flipped
0xD7298 8032E748 XORI V0,S3, 0x0005 //Fixes flip page issues for custom plays, must be == to number of pages; originally 0x0002
0xD27AC 8032E75C SLTI V0,S3, 0x0006 //Fixes flip page w/ default plays; must be > # of pages; originally 0x0004
==========================================
changes to ROM blitzXL_V20.z64
==========================================
//extending playbook - default and custom
0xD2590 8032E540 ADDIU V0,R0,0x0005 //sets 5 pages for default playbook
0xD25D0 8032E580 SLTI V0,S3,0x0006 //sets 6 pages for custom playbook
0x34130 8024D410 ADDIU V0,A1,0x1399 //original 1369; moves defensive play data back to make room for new plays
0x34150 8024D430 SLTI V0,A3, 0x0023 //original 0009; allows all play table data to be written
//fixing playbook to read/write correct plays
0xd1924 J 0x80070C28 //ORIGINALLY addu a0,v0,v1 ; 71828 IN ROM; jump to new area to make playbook pages correct
0xd1928 addu a0,v0,v1 //ORIGINALLY LW V0, $0000 (A0)
0x71828 LW V0, 0x0000 (A0) //line needed from original function
0x7182C ADDU S4,S5,R0 //sets correct page number; may not work w/ custom plays
0x81730 ADDU A1,S5,R0 //sets correct page number; may not work w/ custom plays
0x71830 j 0x8032D8DC //jump back; D192C IN ROM; this is address from NEMU; calculated one didn't work
//move custom pages around - puts custom plays last - still need to fix page #
0x37B44 80250E24 ADDIU T0, A2, 0x1350 //original 0x1370; writes the entire first playbook; truncate may damage last play; make sure to only truncate play data
0xd2558 8032E508 XORI V0,S3, 0x0005 //original 0x2; sets playbook on the last page (versus 3rd)
0xd2a20 8032E9D0 ADDIU T1, R0, 0x0005 //original 0x2; sets playbook on last page; not changing this freezes game
//fix how to load in data for multiple playbooks for p2,p3,p4
80250E00 BEQL V0,R0, $XXXX // originally SUBU V0,V0,A0; jump to 80250E10 if first playbook
80250E04 NOP // originally SLL V0,V0, 0x4; delete for branch
80250E08 SUBU V0,V0,V0 // originally SUBU V0,V0,A0; set V0 = 0
80250E0C ORI V0,V0, 0x13C0 // originally SLL V0,V0, 0x3; set size of playbook to be larger
//fixing page 4 custom - above fixes the graphics and text, but this will fix actually loading correct play data
0xd1750 8032D700 J $00070C3C //originally lui v1, 0x8037; is 7183C in ROM
0xd1754 8032D704 lui v1, 0x8037 //originally addu v1,v1,v0
0x7183C addu v1,v1,v0 //entry point at jump
0x71840 addu a1,s3,r0 //copy s3 value (correct page #) to a1
0x71844 J $8032D708 //jump back to RAM address; is d1754 in ROM
//DEFENSE - add more pages (currently 2, default 1)
0xD26B8 BEQ R0, V1, 0x000D26B8 //branch if custom play or not; same as original code
0xD2698 SLTI V0,S3, 0x0003 //puts custom play page last; originally 0x0002
0xD26A4 ADDIU T1, R0, 0X0002 //increases to 3 pages for custom playbook; originally 1
0xD26B8 J $80070C70 //jumps to same page change code as offensive, just with page total = 2; 0x71870 IN ROM
0x71870 **page change code** //same code as that for offensive play select (found at 0x8032e5a4)
0x71890 SLTI V0,S3, 0X0002 //set playbook size to 2 pages (for defense); ORIGINALLY 1
0x7189C ADDIU T1, R0, 0X0002 //set playbook size to 2 (no custom plays)
0x7199C **end of page change code**
0xD2980 XORI V0, S3, 0x0002 //moves actual custom custom play data to last page
//Increasing playbook timer //
//Time stored in 800BCB68
//800BCB98 similar to timer
0xd7710 LW S0, 0x0000(A0)
0xd7714 J 0X80070C4C //originally LWC1, F2, 0x0004(A0); 7184C IN ROM
0xd7718 LWC1, F2, 0x0004(A0) //originally CVT.S.W F2, F2
0x7184C CVT.S.W F2, F2
0x71850 SUB S0,S0,S0 //SET S0 = 0
0x71854 ORI S0,R0, 0X0014 //INCREASE TIMER TO 20 SECONDS
0x71858 J 0x800D6B1C //JUMP BACK TO D771C IN ROM
Edit: got pretty much all the bugs figured out! Fixed the flipping play issue and got custom plays working perfectly for defense. I changed how the extra plays were added on the defensive side too and changed the code to represent it.
I think the only thing left is making the custom playbook work for players 2,3,4.