Every thruster that catches pops, not only the first
A pilot already burning upwards who then adds a sideways thruster has lit an engine, and that is what an engine lighting sounds like. So what is watched is now the SET of thrusters rather than whether any of them is lit: the bits on now that were not on before, which is an exclusive or and an and and no comparison at all. The rumble still asks the old question, because it is the right question for it - struck when the first lights and not again until every one has gone out. Restriking it when a second joins would start its attack over, which is a stutter rather than an engine, so it keeps a flag of its own. Pitches are as tuned by ear: 36 for the pop, 60 for the rumble. Checked by two flights of the same length, one thruster held throughout against one that gains a second in the middle. The rumble is identical in both, so the whole of the difference is the extra pop: peak 11,452 against 15,540, and the recordings diverge at 3.19 seconds, which is the frame the second thruster lights.
This commit is contained in:
@@ -2817,40 +2817,72 @@ putThrust:
|
||||
; tank is a pilot doing nothing. What is watched is the edge - a rumble restruck every frame
|
||||
; would never get past its own attack, and a bang struck every frame is a buzz.
|
||||
thrustSound:
|
||||
; ---- WHICH thrusters are lit, not merely whether any is ----
|
||||
;
|
||||
; Kept as the set of them, because the two sounds want different questions asked of it: the
|
||||
; pop is about each engine and the rumble is about all of them together.
|
||||
SETD.0 Fuel
|
||||
LDA.0
|
||||
BRA thrustOut
|
||||
BRA thrustNoneLit
|
||||
SETD.0 Held
|
||||
LDA.0
|
||||
INIB 0x0F
|
||||
AND
|
||||
BRQ thrustOut
|
||||
INIA 0x01
|
||||
BRI thrustNow
|
||||
thrustOut:
|
||||
MVQA
|
||||
BRI thrustHaveSet
|
||||
thrustNoneLit:
|
||||
RSTA
|
||||
thrustNow:
|
||||
thrustHaveSet:
|
||||
SETD.0 ThrustNow
|
||||
STA.0
|
||||
|
||||
; ---- A pop for every thruster that has just caught ----
|
||||
;
|
||||
; Not for the first one only. A pilot already burning upwards who then adds a sideways
|
||||
; thruster has lit an engine, and that is what an engine lighting sounds like - so what is
|
||||
; wanted is the bits that are on NOW and were not before, rather than "was anything on".
|
||||
;
|
||||
; What changed is an exclusive or, and of those the ones lit now is an and, which is two
|
||||
; instructions and no comparison at all.
|
||||
SETD.1 ThrustWas
|
||||
LDB.1
|
||||
STA.1 ; Now becomes what "last frame" means next time round.
|
||||
CCF
|
||||
SUB
|
||||
BRQ thrustDone ; The same as last frame, so nothing has lit or gone out.
|
||||
LDA.1
|
||||
BRA thrustStopped
|
||||
|
||||
XOR
|
||||
MVQB
|
||||
AND
|
||||
BRQ thrustNoPop ; Nothing newly lit, whatever else is still burning.
|
||||
RSTA
|
||||
OUTA 0x41
|
||||
INIA 0d48
|
||||
OUTA 0x44 ; The bang of it catching.
|
||||
INIA 0x01
|
||||
OUTA 0x41
|
||||
INIA 0d36
|
||||
OUTA 0x44 ; And the rumble under it, which is held.
|
||||
RET
|
||||
thrustStopped:
|
||||
CALL hushThrust
|
||||
thrustDone:
|
||||
OUTA 0x44 ; The bang of it catching.
|
||||
thrustNoPop:
|
||||
|
||||
; ---- And the rumble, which is about all of them at once ----
|
||||
;
|
||||
; Struck when the first lights and not again until every one has gone out. Restriking it
|
||||
; when a second thruster joins would start its attack over, which is a stutter rather than
|
||||
; an engine.
|
||||
SETD.0 ThrustNow
|
||||
LDA.0
|
||||
BRA thrustAllOut
|
||||
SETD.0 Rumbling
|
||||
LDA.0
|
||||
BNA thrustRemember ; Already running, and it should simply keep running.
|
||||
INIA 0x01
|
||||
STA.0
|
||||
OUTA 0x41
|
||||
INIA 0d60
|
||||
OUTA 0x44 ; Held, until the gate comes up.
|
||||
BRI thrustRemember
|
||||
thrustAllOut:
|
||||
SETD.0 Rumbling
|
||||
LDA.0
|
||||
BRA thrustRemember ; Already quiet.
|
||||
CALL hushRumble
|
||||
thrustRemember:
|
||||
SETD.0 ThrustNow
|
||||
LDA.0
|
||||
SETD.1 ThrustWas
|
||||
STA.1 ; Now becomes what "last frame" means next time round.
|
||||
RET
|
||||
|
||||
; ---- The rumble stopped, wherever the stopping is happening ----
|
||||
@@ -2863,11 +2895,19 @@ thrustDone:
|
||||
; Forgetting last frame with it, so that a thruster still held when the waiting ends counts as
|
||||
; lighting again rather than as never having stopped.
|
||||
hushThrust:
|
||||
CALL hushRumble
|
||||
RSTA
|
||||
SETD.0 ThrustWas
|
||||
STA.0 ; And nothing was lit, so anything still held counts as new.
|
||||
RET
|
||||
|
||||
; The held note stopped, wherever the stopping is happening.
|
||||
hushRumble:
|
||||
INIA 0x01
|
||||
OUTA 0x41
|
||||
RSTA
|
||||
OUTA 0x45 ; The gate up is the only thing that ends a held note.
|
||||
SETD.0 ThrustWas
|
||||
SETD.0 Rumbling
|
||||
STA.0
|
||||
RET
|
||||
|
||||
@@ -3841,9 +3881,15 @@ PendNote:
|
||||
0x00
|
||||
PendIn:
|
||||
0x00
|
||||
; Whether a thruster was lit last frame, since only the changes are worth a sound.
|
||||
; Which thrusters were lit last frame and which are now, since only the changes are worth a
|
||||
; sound - and which ones they are, not merely how many.
|
||||
ThrustWas:
|
||||
0x00
|
||||
ThrustNow:
|
||||
0x00
|
||||
; Whether the held rumble is running, which is a different question from any of the above.
|
||||
Rumbling:
|
||||
0x00
|
||||
; Whether the quarter tank warning has been given since the last time it was filled.
|
||||
AlarmSaid:
|
||||
0x00
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -25,7 +25,7 @@ Mode.sbx 48
|
||||
Flip.sbx 173
|
||||
Sprite.sbx 442
|
||||
Depth.sbx 672
|
||||
Lander.sbx 9168
|
||||
Lander.sbx 9220
|
||||
Pad.sbx 264
|
||||
Crash.sbx 632
|
||||
vars.script 50
|
||||
|
||||
@@ -15,7 +15,7 @@ Mode.sbx 48
|
||||
Flip.sbx 173
|
||||
Sprite.sbx 442
|
||||
Depth.sbx 672
|
||||
Lander.sbx 9168
|
||||
Lander.sbx 9220
|
||||
Pad.sbx 264
|
||||
Crash.sbx 632
|
||||
vars.script 50
|
||||
|
||||
@@ -32,7 +32,7 @@ Mode.sbx 48
|
||||
Flip.sbx 173
|
||||
Sprite.sbx 442
|
||||
Depth.sbx 672
|
||||
Lander.sbx 9168
|
||||
Lander.sbx 9220
|
||||
Pad.sbx 264
|
||||
Crash.sbx 632
|
||||
vars.script 50
|
||||
|
||||
@@ -22,7 +22,7 @@ Mode.sbx 48
|
||||
Flip.sbx 173
|
||||
Sprite.sbx 442
|
||||
Depth.sbx 672
|
||||
Lander.sbx 9168
|
||||
Lander.sbx 9220
|
||||
Pad.sbx 264
|
||||
Crash.sbx 632
|
||||
vars.script 50
|
||||
|
||||
@@ -22,7 +22,7 @@ Mode.sbx 48
|
||||
Flip.sbx 173
|
||||
Sprite.sbx 442
|
||||
Depth.sbx 672
|
||||
Lander.sbx 9168
|
||||
Lander.sbx 9220
|
||||
Pad.sbx 264
|
||||
Crash.sbx 632
|
||||
vars.script 50
|
||||
|
||||
@@ -108,7 +108,7 @@ Mode.sbx 48
|
||||
Flip.sbx 173
|
||||
Sprite.sbx 442
|
||||
Depth.sbx 672
|
||||
Lander.sbx 9168
|
||||
Lander.sbx 9220
|
||||
Pad.sbx 264
|
||||
Crash.sbx 632
|
||||
vars.script 50
|
||||
|
||||
@@ -27,7 +27,7 @@ Mode.sbx 48
|
||||
Flip.sbx 173
|
||||
Sprite.sbx 442
|
||||
Depth.sbx 672
|
||||
Lander.sbx 9168
|
||||
Lander.sbx 9220
|
||||
Pad.sbx 264
|
||||
Crash.sbx 632
|
||||
vars.script 50
|
||||
|
||||
@@ -15,7 +15,7 @@ Mode.sbx 48
|
||||
Flip.sbx 173
|
||||
Sprite.sbx 442
|
||||
Depth.sbx 672
|
||||
Lander.sbx 9168
|
||||
Lander.sbx 9220
|
||||
Pad.sbx 264
|
||||
Crash.sbx 632
|
||||
vars.script 50
|
||||
|
||||
@@ -13,7 +13,7 @@ Mode.sbx 48
|
||||
Flip.sbx 173
|
||||
Sprite.sbx 442
|
||||
Depth.sbx 672
|
||||
Lander.sbx 9168
|
||||
Lander.sbx 9220
|
||||
Pad.sbx 264
|
||||
Crash.sbx 632
|
||||
vars.script 50
|
||||
|
||||
@@ -22,7 +22,7 @@ Mode.sbx 48
|
||||
Flip.sbx 173
|
||||
Sprite.sbx 442
|
||||
Depth.sbx 672
|
||||
Lander.sbx 9168
|
||||
Lander.sbx 9220
|
||||
Pad.sbx 264
|
||||
Crash.sbx 632
|
||||
vars.script 50
|
||||
|
||||
+30
-3
@@ -2737,6 +2737,25 @@ timeout 60 "$EMU" --fast --cycles 12000000 --keyboard "$BUILD/fly.keys" \
|
||||
--pad "$BUILD/hold.pad" --sound "$BUILD/hold.raw" \
|
||||
--disk "$BUILD/high.img" --ram-disk 2048 \
|
||||
"$BUILD/cosmos.bin" > "$BUILD/hold.out" 2>&1 || true
|
||||
# ---- Every thruster that catches pops, not only the first ----
|
||||
#
|
||||
# A pilot already burning upwards who then adds a sideways thruster has lit an engine, and
|
||||
# that is what an engine lighting sounds like. So what is watched is the SET of them: the bits
|
||||
# on now that were not on before, which is an exclusive or and an and. "Was anything on" is a
|
||||
# different and poorer question.
|
||||
#
|
||||
# Two flights of the same length: one thruster held throughout, against one that gains a
|
||||
# second in the middle and loses it again. The rumble is identical in both - it is struck once
|
||||
# and runs until everything is out - so the whole of the difference is the extra pop.
|
||||
python3 -c "open('$BUILD/onethruster.pad','wb').write(b'\x00' * 130 + b'\x08' * 180 + b'\x00' * 20000)"
|
||||
python3 -c "open('$BUILD/twothrusters.pad','wb').write(b'\x00' * 130 + b'\x08' * 60 + b'\x0A' * 60 + b'\x08' * 60 + b'\x00' * 20000)"
|
||||
for view in onethruster twothrusters; do
|
||||
timeout 60 "$EMU" --fast --cycles 12000000 --keyboard "$BUILD/fly.keys" \
|
||||
--pad "$BUILD/$view.pad" --sound "$BUILD/$view.raw" \
|
||||
--disk "$BUILD/high.img" --ram-disk 2048 \
|
||||
"$BUILD/cosmos.bin" > "$BUILD/$view.out" 2>&1 || true
|
||||
done
|
||||
|
||||
# ---- And landing with the thruster STILL DOWN ----
|
||||
#
|
||||
# The case the release above cannot reach. Braking into the ground ends the flying and then
|
||||
@@ -2753,7 +2772,7 @@ timeout 60 "$EMU" --fast --cycles 8000000 --keyboard "$BUILD/fly.keys" \
|
||||
--pad "$BUILD/none.pad" --sound "$BUILD/latch.raw" \
|
||||
--disk "$BUILD/dock.img" --ram-disk 2048 \
|
||||
"$BUILD/cosmos.bin" > "$BUILD/latch.out" 2>&1 || true
|
||||
read -r BURNING AFTERWARDS LATCHLONG UNDERVERDICT <<EOT
|
||||
read -r BURNING AFTERWARDS LATCHLONG UNDERVERDICT ONELIT TWOLIT <<EOT
|
||||
$(python3 -c "
|
||||
import struct
|
||||
def samples(path):
|
||||
@@ -2768,8 +2787,13 @@ l = samples('$BUILD/latch.raw')
|
||||
loud = [i for i, x in enumerate(l) if abs(x) > 300]
|
||||
span = (loud[-1] - loud[0]) if loud else 0
|
||||
# During the burn, and a second and a half after it, which is still long before the ground.
|
||||
print(peak(h, 115200, 124800), peak(h, 192000, 288000), span, peak(b, 240000, 336000))
|
||||
" 2>/dev/null || echo "0 -1 0 -1")
|
||||
# The burn, wide enough that a few frames of drift in when the program starts cannot move
|
||||
# the event out of it.
|
||||
one = peak(samples('$BUILD/onethruster.raw'), 100000, 260000)
|
||||
two = peak(samples('$BUILD/twothrusters.raw'), 100000, 260000)
|
||||
print(peak(h, 115200, 124800), peak(h, 192000, 288000), span, peak(b, 240000, 336000),
|
||||
one, two)
|
||||
" 2>/dev/null || echo "0 -1 0 -1 0 0")
|
||||
EOT
|
||||
[ "$BURNING" -gt 1000 ] \
|
||||
&& result ok "a held thruster rumbles" "$BURNING while it burns" \
|
||||
@@ -2791,6 +2815,9 @@ EOT
|
||||
[ "$UNDERVERDICT" = "0" ] \
|
||||
&& result ok "and nothing roars under the verdict" "landed on the thruster, and it stopped anyway" \
|
||||
|| result no "and nothing roars under the verdict" "$UNDERVERDICT still sounding after landing"
|
||||
[ "$TWOLIT" -gt "$(( ONELIT + 2000 ))" ] \
|
||||
&& result ok "and a second thruster pops as well" "$ONELIT alone against $TWOLIT with two" \
|
||||
|| result no "and a second thruster pops as well" "$ONELIT alone, $TWOLIT with two"
|
||||
|
||||
# ---- A quarter of a tank, said once ----
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user