Improve pause.

This commit is contained in:
Randy Thiemann 2023-10-23 08:12:16 +02:00
parent c572aabefa
commit ee016a1480
2 changed files with 21 additions and 9 deletions

View File

@ -73,16 +73,28 @@ FieldInit::
ld hl, wShadowField
ld bc, 14*26
ld d, $FF
call UnsafeMemSet
ret
jp UnsafeMemSet
FieldClear::
ld hl, wField
ld bc, 10*24
ld d, TILE_FIELD_EMPTY
call UnsafeMemSet
ret
jp UnsafeMemSet
ToBackupField::
ld hl, wBackupField
ld de, wField
ld bc, 10*24
jp UnsafeMemCopy
FromBackupField::
ld hl, wField
ld de, wBackupField
ld bc, 10*24
jp UnsafeMemCopy
ToShadowField::

View File

@ -293,6 +293,7 @@ pieceInMotionMode:
ldh a, [hStartState]
cp a, 1
jr nz, :+
call ToBackupField
ldh a, [hMode]
ldh [hPrePause], a
ld a, MODE_PAUSED
@ -336,6 +337,7 @@ delayMode:
ldh a, [hStartState]
cp a, 1
jr nz, :+
call ToBackupField
ldh a, [hMode]
ldh [hPrePause], a
ld a, MODE_PAUSED
@ -482,15 +484,13 @@ pauseMode:
ldh a, [hStartState]
cp a, 1
jr nz, :+
call FromBackupField
ldh a, [hPrePause]
ldh [hMode], a
jr drawStaticInfo
; Draw PAUSE all over the field, but not if we came from delay mode.
: ldh a, [hPrePause]
cp a, MODE_DELAY
jr z, drawStaticInfo
ld de, sPause
; Draw PAUSE all over the field.
: ld de, sPause
ld hl, wField+(4*10)
ld bc, 200
call UnsafeMemCopy