Remove smart IRS.

This commit is contained in:
Randy Thiemann 2023-11-12 03:11:20 +01:00
parent 23160bfd56
commit d62c8fcf6d
5 changed files with 3004 additions and 3126 deletions

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -707,14 +707,13 @@ TrySpawnPiece::
cp a, $FF cp a, $FF
ret z ret z
; Otherwise, try in this order: 0, 1, 3, 2 ; If we didn't try to IRS in the first place, too bad. Game over.
ldh a, [hCurrentPieceRotationState] ldh a, [hCurrentPieceRotationState]
ldh [hWantRotation], a cp a, 0
ret z
; Try rotation state 0. ; Try rotation state 0.
.try0 .try0
cp a, 0
jr z, .try1
xor a, a xor a, a
ldh [hCurrentPieceRotationState], a ldh [hCurrentPieceRotationState], a
call SetPieceDataOffset call SetPieceDataOffset
@ -725,60 +724,6 @@ TrySpawnPiece::
ld d, h ld d, h
ld e, l ld e, l
call GetPieceDataFast call GetPieceDataFast
call CanPieceFitFast
cp a, $FF
ret z
; Try rotation state 1.
.try1
ldh a, [hWantRotation]
cp a, 1
jr z, .try3
ld a, 1
ldh [hCurrentPieceRotationState], a
call SetPieceDataOffset
ldh a, [hCurrentPieceY]
ld b, a
ldh a, [hCurrentPieceX]
call XYToSFieldPtr
ld d, h
ld e, l
call GetPieceDataFast
call CanPieceFitFast
cp a, $FF
ret z
; Try rotation state 3.
.try3
ldh a, [hWantRotation]
cp a, 3
jr z, .try2
ld a, 3
ldh [hCurrentPieceRotationState], a
call SetPieceDataOffset
ldh a, [hCurrentPieceY]
ld b, a
ldh a, [hCurrentPieceX]
call XYToSFieldPtr
ld d, h
ld e, l
call GetPieceDataFast
call CanPieceFitFast
cp a, $FF
ret z
; Try rotation state 2.
.try2
ld a, 2
ldh [hCurrentPieceRotationState], a
call SetPieceDataOffset
ldh a, [hCurrentPieceY]
ld b, a
ldh a, [hCurrentPieceX]
call XYToSFieldPtr
ld d, h
ld e, l
call GetPieceDataFast
jp CanPieceFitFast jp CanPieceFitFast
@ -3011,14 +2956,13 @@ BigTrySpawnPiece::
cp a, $FF cp a, $FF
ret z ret z
; Otherwise, try in this order: 0, 1, 3, 2 ; If we didn't try to IRS in the first place, too bad. Game over.
ldh a, [hCurrentPieceRotationState] ldh a, [hCurrentPieceRotationState]
ldh [hWantRotation], a cp a, 0
ret z
; Try rotation state 0. ; Try rotation state 0.
.try0 .try0
cp a, 0
jr z, .try1
xor a, a xor a, a
ldh [hCurrentPieceRotationState], a ldh [hCurrentPieceRotationState], a
call BigSetPieceDataOffset call BigSetPieceDataOffset
@ -3029,60 +2973,6 @@ BigTrySpawnPiece::
ld d, h ld d, h
ld e, l ld e, l
call BigGetPieceDataFast call BigGetPieceDataFast
call BigCanPieceFitFast
cp a, $FF
ret z
; Try rotation state 1.
.try1
ldh a, [hWantRotation]
cp a, 1
jr z, .try3
ld a, 1
ldh [hCurrentPieceRotationState], a
call BigSetPieceDataOffset
ldh a, [hCurrentPieceY]
ld b, a
ldh a, [hCurrentPieceX]
call BigXYToSFieldPtr
ld d, h
ld e, l
call BigGetPieceDataFast
call BigCanPieceFitFast
cp a, $FF
ret z
; Try rotation state 3.
.try3
ldh a, [hWantRotation]
cp a, 3
jr z, .try2
ld a, 3
ldh [hCurrentPieceRotationState], a
call BigSetPieceDataOffset
ldh a, [hCurrentPieceY]
ld b, a
ldh a, [hCurrentPieceX]
call BigXYToSFieldPtr
ld d, h
ld e, l
call BigGetPieceDataFast
call BigCanPieceFitFast
cp a, $FF
ret z
; Try rotation state 2.
.try2
ld a, 2
ldh [hCurrentPieceRotationState], a
call BigSetPieceDataOffset
ldh a, [hCurrentPieceY]
ld b, a
ldh a, [hCurrentPieceX]
call BigXYToSFieldPtr
ld d, h
ld e, l
call BigGetPieceDataFast
jp BigCanPieceFitFast jp BigCanPieceFitFast