Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Strugglemeat authored Mar 11, 2022
0 parents commit f07fa0a
Show file tree
Hide file tree
Showing 21 changed files with 1,861 additions and 0 deletions.
8 changes: 8 additions & 0 deletions 2779c.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
lea 10bbb0,a4;49F9 0010 BBB0;p1 points address
move.b #20,(A4);18BC 0020;should this be 0x14?
moveq #1, D1;7201;d1 is free to use
adda.w D1, A4;D8C1;increment A4 by 1 to get to P2 address
move.b #20,(A4);18BC 0020;should this be 0x14?
lea 108500,a4;49f9 0010 8500;restore what was in a4
bra Finish;60 02;go to 277be
jmp $f619a.l;4E F9 00 0F 61 9A;jump to injection
4 changes: 4 additions & 0 deletions 2779c_timersubq.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
; subq.w #1,$d4(A4)
; moveq 1,A4
nop
nop
1 change: 1 addition & 0 deletions 277ae.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
move.w #88,$d2(a4)
1 change: 1 addition & 0 deletions 277ae_2.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
move.w #136,D0
5 changes: 5 additions & 0 deletions 3nop.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
; subq.w #1,$d4(A4)
; moveq 1,A4
nop
nop
nop
40 changes: 40 additions & 0 deletions F619A.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
*need to analyze registers to see which we can use*
bp f619a
====================
0) load the start button toggle 10fdac
1) is the start button toggle on? (01=p1 only, 04=p2 only, 05=both p1 & p2)
1a) no -> lookup the cost and load it to the player's cost register
1b) yes -> go through all 12 and see if id matches, when the match is found, load it to the player's cost register
2) load the player's respective points to another register
3) compare the cost of the player's designed chr against the player's points
4) if they can afford it, proceed as usual
4a) if they cannot afford it, need to find a good place to dump them off
====================
;need at least 2 address registers and 2 data registers
;using D0,D1,D2,D4
;using A0,A1,A2,A3












;restore registers that were used (consult **RATIO CHECK NEW CODE)

move.l 00000008,D0;203C 0000 0008
move.l 0000FFFF,D1;223C 0000 FFFF
move.l 00000010,D2;243C 0000 0010
move.l 00010004,D4;283C 0001 0004

lea 000284A0,a0;41f9 0002 84A0;restore what was in a0
lea 0010DA61,a1;43f9 0010 DA61;restore what was in a1
lea 0000990E,a2;45f9 0000 990E;restore what was in a2
lea 00108500,a3;47f9 0010 8500;restore what was in a3

jmp 000286e0;4E F9 00 02 86 E0
61 changes: 61 additions & 0 deletions F619A_2.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
bp f619a
====================
-1) determine which player we are, 1 or 2 (where do we use this?)
0) load the start button toggle 10fdac
1) is the start button toggle on? (01=p1 only, 04=p2 only, 05=both p1 & p2)
1a) no -> lookup the cost and load it to the player's cost register
1b) yes -> go through all 12 and see if id matches, when the match is found, load it to the player's cost register
2) load the player's respective points to another register
3) compare the cost of the player's designed chr against the player's points
4) if they can afford it, proceed as usual
4a) if they cannot afford it, need to find a good place to dump them off
====================
;need at least 2 address registers and 2 data registers
;using D0,D1,D2,D4
;using A0,A1,A2,A3 (A5 but I can't restore it with lea so didn't add it)

lea 0010 FDAC,A3;47F9 0010 FDAC;load start button toggle addr into A3
move.b @A3,D4;1813;move start button byte into D4
tst.b D4;4A04;is it zero? (note that this isn't effective because it could be p1 choosing while p2 had start held. we need to compare against who this is, p1 can use 01 or 05, p2 can use 02 or 05)
bne 12AltLookup


;10a84d is which chr p1 is selecting (00,01,02, finished=03)
;10a85e is which chr p2 is selecting (00,01,02, finished=03)
;3 chrs for p1 10A84e,10A84f,10A850
;3 chrs for p2 10a85f,10a860,10a861

PC for writing chr taken = PC 28738 (it was in D1)









;restore registers that were used (consult **RATIO CHECK NEW CODE)
restorations that are the same for both players:
move.l 00000010,D2;243C 0000 0010
lea 000284A0,a0;41f9 0002 84A0;restore what was in a0
lea 0000990E,a2;45f9 0000 990E;restore what was in a2
lea 00108500,a3;47f9 0010 8500;restore what was in a3

cmpi #$5, D4;0C04 0005 ;are we p2? D4's byte is 5 if so
beq 1A;67 1A ;skipping the p1 if we're p2

restorations for p1 only:
move.l 00000008,D0;203C 0000 0008
move.l 0000FFFF,D1;223C 0000 FFFF
move.l 00010004,D4;283C 0001 0004
lea 0010DA61,a1;43f9 0010 DA61;restore what was in a1 for p1
bra 18;60 18 ;bra to the jmp

restorations for p2 only:
move.l 000003FE,D0;203C 0000 03FE
move.l 00000700,D1;223C 0000 0700
move.l 00010005,D4;283C 0001 0005
lea 0010075D,a1;43f9 0010 075D;restore what was in a1 for p2

jmp 000286e0;4E F9 00 02 86 E0
38 changes: 38 additions & 0 deletions F619A_code_sep11.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
;save 2 data registers to RAM addresses next to the points
;10bbb2 = D2
;10bbb3 = D4
;A3 and A5 available for general use
lea $0010BBB2,A3;load byte holder address for D2 into A3
move.b D2,(A3);save the byte in D2 at 10BBB2
lea $0010BBB3,A3;load byte holder address for D4 into A3
move.b D4,(A3);save the byte in D4 at 10BBB3

;code goes here

;code ends here
;restore begins here
;restore registers from RAM
lea $0010BBB2,A3;load byte holder address for D2 into A3
move.b (A3),D2;restore saved byte back to D2
lea $0010BBB3,A3;load byte holder address for D4 into A3
move.b (A3),D4;save the byte in D4 at 10BBB3

;general restore
lea $00108500,A3
lea $00108000,A5

;per-player restore
cmpi.b #$05,D4;are we P2? D4's byte is 5 if so
beq P2Restoration
lea $0010A84A,A0
lea $00100D00,A4
bra Leave

P2Restoration:
lea $0010A85B,A0
lea $00100900,A4

Leave:
move.l A4,D7;whatever address is in A4 needs to go into D7
;restore ends here
jmp $00028730;go back to where we need to return to (if they are allowed to pick)
104 changes: 104 additions & 0 deletions F619A_code_sep11_1.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
;save 2 data registers to RAM addresses next to the points
;10bbb2 = D2
;10bbb3 = D4 (used in P1/P2 check)
;A3 and A5 available for general use
lea $0010BBB2,A3;load byte holder address for D2 into A3
move.b D2,(A3);save the byte in D2 at 10BBB2
lea $0010BBB3,A3;load byte holder address for D4 into A3
move.b D4,(A3);save the byte in D4 at 10BBB3

;code goes here
;using D2,D7,A0,A3,A4,A5
;D4 also available for use AFTER we have done all necessary P1/P2 checks

lea $0010FDAC,A0;load start button toggle addr into A0
move.b (A0),D2;move start button byte into D2
tst.b D2;is button toggle zero?
beq TableLookup;if start is not held down by either player, go to table check
;01,05=p1.04,05=p2. if it's 04, skip to PlayerTwoAltCheck
cmpi.b #$04,D2;is it P2 only holding start?
beq PlayerTwoAltCheck

PlayerOneAltCheck:
;code goes here
nop
;after P1 is done with their stuff, let's see if we need to flow into P2 as well
;(if it was 5)
P2hadStartAlso:
cmpi.b #$05,D2;were both players holding start?
bne BeginRestore

PlayerTwoAltCheck:
;code goes here
nop
bra BeginRestore

TableLookup:
;slot is in D0
;chr ID is in D1
;let's load player's points into D2
cmpi.b #$05,D4;are we P2? D4 is 05 if so
beq LoadP2PointsAddress
lea $0010BBB0,A3
bra MovePointsIntoRegister
LoadP2PointsAddress:
lea $0010BBB1,A3
MovePointsIntoRegister:
move.b (A3),D2;current player's points are now loaded into D2
;now we need to load this character's cost into D7
lea $000FFFDA,A4;table data at EOF
add D1,A4;add char ID number to table pointer
move.b (A4),D7;move cost of character into D7
;WE NEED CHECKS TO DETERMINE IF THIS IS THE 2ND SELECTION! IF SO, THEY
;MUST HAVE 2 PTS LEFT OVER AFTER PICKING CHR 2
;remaining points minus 2 = max a player can spend on character B
;do a check to see if we're in the 2nd character choice
;if we are, subtract 2 from D2 (not the RAM address)
cmp #01,D0
bne ContinueToCompare
subq.b #02,D2
ContinueToCompare:
cmp.b D7,D2;D2=points,D7=cost
bge SubtractIfAllowed;if they are allowed to pick
;code goes here if they are NOT allowed to pick - dump them off
bra CantTake;dont subtract pts
SubtractIfAllowed:
;we still have this character's points address loaded into A3
sub.b D7,D2;subtract cost from points
move.b D2,(A3);put the new points total into the player's address


;code ends here
;restore registers from RAM begins here
BeginRestore:
lea $0010BBB2,A3;load byte holder address for D2 into A3
move.b (A3),D2;restore saved byte back to D2
lea $0010BBB3,A3;load byte holder address for D4 into A3
move.b (A3),D4;save the byte in D4 at 10BBB3

;general restore
lea $00108500,A3
lea $00108000,A5

;per-player restore
cmpi.b #$05,D4;are we P2? D4's byte is 5 if so
beq P2Restoration

P1Restoration:
lea $0010A84A,A0
lea $00100D00,A4
move.l A4,D7;whatever address is in A4 needs to go into D7
bra Leave

P2Restoration:
lea $0010A85B,A0
lea $00100900,A4
move.l A4,D7;whatever address is in A4 needs to go into D7
;restore ends here

Leave:
jmp $00028730;go back to where we need to return to (if they are allowed to pick)

CantTake:
;need to restore registers?
jmp $0000a142
Loading

0 comments on commit f07fa0a

Please sign in to comment.