diff --git a/Programs/CosmOS/Apps/Lander.asm b/Programs/CosmOS/Apps/Lander.asm index f2df4f6..571bcda 100644 --- a/Programs/CosmOS/Apps/Lander.asm +++ b/Programs/CosmOS/Apps/Lander.asm @@ -103,6 +103,7 @@ everyFrame: CALL moveStation CALL follow CALL touchdown + CALL dock CALL showLander CALL showStation CALL showDrift @@ -750,7 +751,10 @@ fall: LDA.1 SETD.1 FallTick STA.1 - ; Gravity does not pull on a lander that is already sitting on the ground. + ; Gravity does not pull on a lander that is sitting on the ground or holding onto something. + SETD.0 Docked + LDA.0 + BNA fallResting SETD.0 Landed LDA.0 BNA fallResting @@ -1124,6 +1128,13 @@ move: ; kept going came back through the bottom and hit the ground FROM ABOVE. Two thousand pixels ; of climb is a long way and entirely reachable with a full tank. ; + ; ---- And it is 192 pixels up, not 64, because the screen grew ---- + ; + ; Sixty four was the whole of the sky a forty column screen had over the world's origin, so + ; it was never a fact about the world - it was a fact about the view. The wide one starts + ; twenty four rows higher, and a lander stopped at the old line was stopped a long way short + ; of the top of its own picture for no reason it could see. + ; ; Pinned rather than ended. Leaving upward is RECOVERABLE - gravity is always available and ; a lander with fuel can always come back - so stopping the run there would punish a state ; the player can fly out of. What kills you out here is running dry a long way from the @@ -1139,10 +1150,10 @@ move: AND BRQ moveInside ; The height is positive, so it is somewhere below the top. LDA.0 ; DP0 is still DownHigh, from the sign test. - INIB 0xFD + INIB 0xF5 CCF SUB - BRC moveAdrift ; Borrowed: at 0xFC00 or above it, which is 64 pixels over the top. + BRC moveAdrift ; Borrowed: at 0xF400 or above it, 192 pixels over the world's top. moveInside: ; Back under the ceiling, so the warning goes if there was one. @@ -1161,7 +1172,7 @@ moveAdrift: ; is left alone, so gravity has somewhere to move it to. SETD.0 DownHigh LDA.0 - INIB 0xFC + INIB 0xF4 CCF SUB BNC moveAdriftSaid ; No borrow, so it is at the ceiling and not past it. @@ -1169,7 +1180,7 @@ moveAdrift: RSTA SETD.0 DownLow STA.0 - INIA 0xFC + INIA 0xF4 SETD.0 DownHigh STA.0 @@ -1775,6 +1786,210 @@ touchdownStop: touchdownDone: RET +; ---- Docking, which is landing on something that is moving ---- +; +; The same shape as touchdown and for the same reason: close enough, and slow enough, or it is +; a wreck. What makes it a different skill is that "slow enough" is measured against the +; STATION rather than against nothing. Its speed is orbital speed, which is the number the +; marks on the drift bar point at - so the instrument for this was already on the screen +; before there was anything to dock with. +; +; The tolerances are the ground's own, deliberately, so there is one number to argue with if +; this turns out to be too kind. +dock: + SETD.0 Docked + LDA.0 + BNA dockRiding + + ; ---- Close enough, going round ---- + ; + ; Wrapped to fourteen bits like everything else on this moon, which measures the long way + ; round when the station is behind, so past the half way point is turned into a distance + ; backwards before its size is taken. + SETD.0 StationLow + LDA.0 + SETD.1 AcrossLow + LDB.1 + CCF + SUB + SETD.1 DockGapLow + STQ.1 + SETD.0 StationHigh + LDA.0 + SETD.1 AcrossHigh + LDB.1 + SUB + MVQA + INIB 0x3F + AND + SETD.1 DockGapHigh + STQ.1 + LDA.1 + INIB 0x20 + AND + BRQ dockGapNear + SETD.0 DockGapHigh + LDA.0 + INIB 0x40 + CCF + SUB + STQ.0 +dockGapNear: + SETD.0 DockGapLow + CALL magnitude + SETD.0 DriftHigh + LDA.0 + BNA dockDone + SETD.0 DriftLow + LDA.0 + INIB 0d128 + CCF + SUB + BNC dockDone ; A whole tile away or more, so there is nothing to touch. + + ; ---- And close enough, up and down ---- + SETD.0 StationDownLow + LDA.0 + SETD.1 DownLow + LDB.1 + CCF + SUB + SETD.1 DockRiseLow + STQ.1 + SETD.0 StationDownHigh + LDA.0 + SETD.1 DownHigh + LDB.1 + SUB + SETD.1 DockRiseHigh + STQ.1 + SETD.0 DockRiseLow + CALL magnitude + SETD.0 DriftHigh + LDA.0 + BNA dockDone + SETD.0 DriftLow + LDA.0 + INIB 0d128 + CCF + SUB + BNC dockDone + + ; ---- Touching. Now, how fast, and RELATIVE TO WHAT ---- + ; + ; The station is going at orbital speed, so a lander going at orbital speed is standing still + ; beside it however fast the ground below says they are both travelling. That difference is + ; the whole of the manoeuvre. + SETD.0 SpeedAcross + LDA.0 + INIB 0d64 + CCF + SUB + SETD.1 DockVxLow + STQ.1 + INCD.0 + LDA.0 + RSTB + SUB ; And the borrow, which is the other half of the difference. + SETD.1 DockVxHigh + STQ.1 + SETD.0 DockVxLow + CALL magnitude + SETD.0 DriftHigh + LDA.0 + BNA dockStruck + SETD.0 DriftLow + LDA.0 + SETD.1 GentleAcross + LDB.1 + CCF + SUB + BNC dockStruck + + ; Downwards, where the station has no speed at all, so the difference is simply the fall. + SETD.0 SpeedDown + CALL magnitude + SETD.0 DriftHigh + LDA.0 + BNA dockStruck + SETD.0 DriftLow + LDA.0 + SETD.1 GentleDown + LDB.1 + CCF + SUB + BNC dockStruck + + ; ---- Aboard ---- + INIA 0x01 + SETD.0 Docked + STA.0 + CALL payFuel + SETD.0 DockedText + CALL sayInWindow + CALL waitKey +dockDone: + RET + +dockStruck: + SETD.0 StruckText + BRI touchdownStop ; Which settles the view, says it, and ends the run. + +; ---- Riding, until something is leaned on ---- +; +; Held to the station rather than merely paid by it, because that is what docking IS. The +; speeds are the station's, so the pair drift round together, and the lander sits one tile +; under it so both are still visible. +; +; ANY thruster lets go. It has to be checked before the speeds are put back, or a burn would +; be wiped by the snap on the very frame it was made and the lander could never leave. +dockRiding: + SETD.0 Held + LDA.0 + INIB 0x0F + AND + BNQ dockLetGo + + SETD.0 StationLow + LDA.0 + SETD.1 AcrossLow + STA.1 + SETD.0 StationHigh + LDA.0 + SETD.1 AcrossHigh + STA.1 + SETD.0 StationDownLow + LDA.0 + INIB 0d128 + CCF + ADD + SETD.1 DownLow + STQ.1 + SETD.0 StationDownHigh + LDA.0 + RSTB + ADD ; One tile below it, carry included. + SETD.1 DownHigh + STQ.1 + + INIA 0d64 + SETD.0 SpeedAcross + STA.0 + RSTA + INCD.0 + STA.0 ; Orbital speed exactly, which is what it is riding. + SETD.0 SpeedDown + STA.0 + INCD.0 + STA.0 + RET + +dockLetGo: + RSTA + SETD.0 Docked + STA.0 + RET + ; ---- A key, or a button ---- ; ; Somebody flying on a controller should not have to reach for the keyboard to say "yes, I @@ -1850,22 +2065,26 @@ showHeight: AND BNQ showHeightNone ; Negative: the feet are under the surface, so there is no sky. LDA.0 ; The AND left A alone, so it still holds the high half. - INIB 0d16 + INIB 0d32 CCF SUB - BNC showHeightFull ; 4,096 sixteenths or more, which is the whole bar and then some. + BNC showHeightFull ; 8,192 sixteenths or more, which is the whole bar and then some. LDA.0 ; DP0 still names the high half, and the compare did not touch A. SETD.0 HeightLow LDB.0 SHL - SHL - SHL ; ---- Over thirty two, which comes out in A ---- + SHL ; ---- Over sixty four, which comes out in A ---- ; - ; A is the HIGH half of the shift register, so three turns LEFT of - ; the whole sixteen bits leaves bits five to twelve in A - which is - ; the height over thirty two, in one instruction each and no + ; A is the HIGH half of the shift register, so two turns LEFT of + ; the whole sixteen bits leaves bits six to thirteen in A - which + ; is the height over sixty four, in one instruction each and no ; division anywhere. + ; + ; Over sixty four rather than thirty two because the ceiling moved: + ; the band is 368 pixels now, and half a pixel of bar to a pixel of + ; sky would stand 184 tall and run off the top of the forty column + ; screen it is drawn beside. BRI showHeightReady showHeightFull: INIA 0d127 @@ -2775,6 +2994,21 @@ Carrying: 0x00 Landed: 0x00 +; Holding onto the station, which is the same kind of rest as sitting on the ground. +Docked: + 0x00 +DockGapLow: + 0x00 +DockGapHigh: + 0x00 +DockRiseLow: + 0x00 +DockRiseHigh: + 0x00 +DockVxLow: + 0x00 +DockVxHigh: + 0x00 ; Whether the lander is pinned against the ceiling, so the warning is said once rather than ; sixty times a second and taken away when it comes back down. @@ -2796,6 +3030,10 @@ EmptyText: 0x00 CrashedText: "Crashed." +DockedText: +"Docked. Eighty units of fuel." +StruckText: +"Wrecked against the station." ; ---- The station, which is a body and not a special case ---- ; @@ -2817,7 +3055,14 @@ StationHigh: StationDownLow: 0x00 StationDownHigh: - 0xFE ; Minus 512 sixteenths, which is four rows up. + 0xFA ; ---- Minus 1,536 sixteenths, which is twelve rows up ---- + ; + ; About two thirds of the way from the ground to the ceiling. It + ; was four rows up when four rows was most of the sky there was, + ; which put it exactly where anything climbing away from the + ; surface had to pass - and being run down there is not a hazard, + ; it is a toll. Twelve rows up is clear of work near the ground and + ; still a dozen rows under the ceiling. StationSpeed: 0x40 0x00 ; Orbital speed, and the whole of its behaviour. diff --git a/Programs/CosmOS/README.md b/Programs/CosmOS/README.md index bf990e5..d686294 100644 --- a/Programs/CosmOS/README.md +++ b/Programs/CosmOS/README.md @@ -727,7 +727,7 @@ from every assembly file in it. Several are old programs written for the bare ma | Grid | The first program to use the screen as a screen. Redefines a tile above the font, fills all 128 map rows, and scrolls it diagonally a pixel at a time. | | Sprite | Moves a ball across the shell's own text, writing not one byte of the map to do it. It leaves the sprite in the table on the way out, because clearing them is the system's job - see below. | | Pad | Says what the controllers are doing, printing a line whenever one changes. It tells apart the three things that look identical from inside a game that is not responding: a pad nobody noticed, a pad mapped to nothing, and a mapping that is wrong. | -| Lander | Lunar Porter, rung one: a lander over a moon that wraps. Flown with a controller if there is one - a held thruster burns every tick it is held for - and with the arrow keys if there is not, where one press is one burn and that is the most the console can say. A bar at the bottom is the sideways drift, drawn as a sprite stretched to the speed - a moon has no air, so a drift never stops by itself and stopping one means cancelling it exactly, which is hard to do blind. It lands or crashes on arrival, and what decides is the speed at the moment it touches: gentler than three quarters of a pixel a frame downwards and half of one sideways, or it is a lander on its side. A fuel gauge sits in the window layer, where the moon turning underneath cannot scroll it away, and every thruster costs a unit of fuel every tick it fires. An empty tank is not an ending: it is a lander still flying that can no longer do anything about where. Four landing pads are carved into the moon after it is generated, levelled to whatever height their first column happened to have, and marked in cyan by an attribute rather than a tile of their own. The lander starts above one, because that is where a porter's day begins. Each pad is a base, told apart by the colour it is drawn in, and landing at one either loads cargo for the base across the moon or delivers what is aboard and pays eighty units of fuel. A landing is not an ending: the lander rests where it is until the throttle opens again, and A or Start says "read it" as readily as a key does. What a base says goes in the window rather than out of the console: the console draws into the map, so a message printed while flying is one the lander then flies over, and printing scrolls the whole world up a row. Opening the throttle wipes the line. Two bars read the speeds and are green while a landing would survive and red while it would not, so "can I put down" is a glance rather than a sum. A third runs up the left edge and is how much sky is under the lander, half a pixel of bar to a pixel of it; it reads nought the moment the lander is down, and it exists because the orbit takes the lander off the top of the screen and a panel that only works while the ground is in sight is no use above it. And gravity here is the pull MINUS the swing outwards, which is what makes an orbit rather than a one way trip: under four pixels a frame sideways the pull wins and the lander falls, over it the swing wins and the lander climbs, and at it they cancel and it circles. Falling buys sideways speed and climbing spends it - at a rate set by the product of the two, so the trade stops by itself as the sideways speed runs out - and that is the cycle: a fall carries the lander past orbital speed and becomes a climb, the climb pays it back and becomes a fall, periapse and apoapse, round and round. Orbital speed is marked on the drift bar, sixty four pixels either side of the middle, because a number nothing points at is folklore. Gravity never falls off and the moon wraps, so a circular orbit is the same length at any height and one orbital speed serves everywhere. There is a ceiling sixty four pixels above the screen, which pins rather than ends: leaving upward is recoverable, so the lander is held there and told so, and one sideways is spent every tick it tries to climb - without that the pin wiped the climb, the trade saw neither fall nor climb, and the speed pushing it up never changed. What kills you out here is running dry a long way from the ground. B, or z on the keyboard, swaps the screen between forty columns and eighty, which is the same map, the same cells and the same engine at half the size: nearly two thirds of the moon at once for the orbit, and twice as big for the landing. The twenty extra rows that buys go to the SKY and not to the moon - the wide view starts twenty four rows above the world's origin rather than at it, so the ground sits near the bottom and the whole flyable band is on the screen. Drawn down from the origin instead it was 71 per cent rock, which is a zoom that shows you more of the thing you cannot fly through. A lander at the ceiling is off the top of a forty column screen, which is where the orbit lives and why the altitude bar had to exist; zoomed out it is in the picture. And there is a station up there, four rows above the world's origin, going round at orbital speed - which needs no physics of its own, because a body at 64 sixteenths is exactly what a circular orbit IS under these rules, at any height, since gravity never falls off and the moon wraps. It is off the top of a forty column screen too, so it is somewhere to go that the zoom is needed to see. It cannot be docked with yet: it goes round, and that is all. Down is a retro thruster at half the strength of up - one sixteenth a tick against two, which is exactly gravity's own step, so it can stop a climb and hurry a descent and can never turn a landing approach into a crash faster than letting go would. Arresting a rise otherwise meant a sideways burn and a wait for the orbit to come round, which is how a rendezvous really is flown and a lot to ask of somebody who has not flown one. It does nothing at all to a lander on the ground, which is not politeness: touchdown has already had its say and will not speak again, so without that guard a landed lander holding it goes straight through the moon. | +| Lander | Lunar Porter, rung one: a lander over a moon that wraps. Flown with a controller if there is one - a held thruster burns every tick it is held for - and with the arrow keys if there is not, where one press is one burn and that is the most the console can say. A bar at the bottom is the sideways drift, drawn as a sprite stretched to the speed - a moon has no air, so a drift never stops by itself and stopping one means cancelling it exactly, which is hard to do blind. It lands or crashes on arrival, and what decides is the speed at the moment it touches: gentler than three quarters of a pixel a frame downwards and half of one sideways, or it is a lander on its side. A fuel gauge sits in the window layer, where the moon turning underneath cannot scroll it away, and every thruster costs a unit of fuel every tick it fires. An empty tank is not an ending: it is a lander still flying that can no longer do anything about where. Four landing pads are carved into the moon after it is generated, levelled to whatever height their first column happened to have, and marked in cyan by an attribute rather than a tile of their own. The lander starts above one, because that is where a porter's day begins. Each pad is a base, told apart by the colour it is drawn in, and landing at one either loads cargo for the base across the moon or delivers what is aboard and pays eighty units of fuel. A landing is not an ending: the lander rests where it is until the throttle opens again, and A or Start says "read it" as readily as a key does. What a base says goes in the window rather than out of the console: the console draws into the map, so a message printed while flying is one the lander then flies over, and printing scrolls the whole world up a row. Opening the throttle wipes the line. Two bars read the speeds and are green while a landing would survive and red while it would not, so "can I put down" is a glance rather than a sum. A third runs up the left edge and is how much sky is under the lander, half a pixel of bar to a pixel of it; it reads nought the moment the lander is down, and it exists because the orbit takes the lander off the top of the screen and a panel that only works while the ground is in sight is no use above it. And gravity here is the pull MINUS the swing outwards, which is what makes an orbit rather than a one way trip: under four pixels a frame sideways the pull wins and the lander falls, over it the swing wins and the lander climbs, and at it they cancel and it circles. Falling buys sideways speed and climbing spends it - at a rate set by the product of the two, so the trade stops by itself as the sideways speed runs out - and that is the cycle: a fall carries the lander past orbital speed and becomes a climb, the climb pays it back and becomes a fall, periapse and apoapse, round and round. Orbital speed is marked on the drift bar, sixty four pixels either side of the middle, because a number nothing points at is folklore. Gravity never falls off and the moon wraps, so a circular orbit is the same length at any height and one orbital speed serves everywhere. There is a ceiling 192 pixels above the world's origin, which is the top of the wide view - it was sixty four while sixty four was all the sky a forty column screen had over the origin, which was a fact about the view rather than about the world. It pins rather than ends: leaving upward is recoverable, so the lander is held there and told so, and one sideways is spent every tick it tries to climb - without that the pin wiped the climb, the trade saw neither fall nor climb, and the speed pushing it up never changed. What kills you out here is running dry a long way from the ground. B, or z on the keyboard, swaps the screen between forty columns and eighty, which is the same map, the same cells and the same engine at half the size: nearly two thirds of the moon at once for the orbit, and twice as big for the landing. The twenty extra rows that buys go to the SKY and not to the moon - the wide view starts twenty four rows above the world's origin rather than at it, so the ground sits near the bottom and the whole flyable band is on the screen. Drawn down from the origin instead it was 71 per cent rock, which is a zoom that shows you more of the thing you cannot fly through. A lander at the ceiling is off the top of a forty column screen, which is where the orbit lives and why the altitude bar had to exist; zoomed out it is in the picture. And there is a station up there, twelve rows above the world's origin - about two thirds of the way from the ground to the ceiling, clear of work near the surface - going round at orbital speed - which needs no physics of its own, because a body at 64 sixteenths is exactly what a circular orbit IS under these rules, at any height, since gravity never falls off and the moon wraps. It is off the top of a forty column screen too, so it is somewhere to go that the zoom is needed to see. Docking it is landing on something that is moving: close enough, and slow enough RELATIVE TO THE STATION, or it is a wreck. Its speed is orbital speed, which is the number the marks on the drift bar point at, so the instrument for it was on the screen before there was anything to dock with. A dock pays eighty units of fuel and holds the lander a tile under the station until a thruster lets go. Getting there is a two burn manoeuvre and not a straight line: climbing SPENDS sideways speed, so a lander cannot rise while matched - it arrives slower than orbital every time, and has to raise the far side of its orbit and then circularise at the top. Down is a retro thruster at half the strength of up - one sixteenth a tick against two, which is exactly gravity's own step, so it can stop a climb and hurry a descent and can never turn a landing approach into a crash faster than letting go would. Arresting a rise otherwise meant a sideways burn and a wait for the orbit to come round, which is how a rendezvous really is flown and a lot to ask of somebody who has not flown one. It does nothing at all to a lander on the ground, which is not politeness: touchdown has already had its say and will not speak again, so without that guard a landed lander holding it goes straight through the moon. | | Depth | Four pillars at four distances and a ball walking past them, behind the near ones and in front of the far ones. The ball is sprite nought and every pillar is numbered after it, so table order puts it in front of all four - what actually decides is the depth buffer, asked a column at a time. | | Flip | Draws a whole screen into the bank that is not being shown, waits, and then shows it in one byte out of one port. It writes nothing else at all - not a tile, not a colour - so it does not ask for the screen to be saved, and the line it printed is still there when it comes back. It deliberately does not put the displayed screen back either, because that is the system's to restore: a program that faulted while flipped could not have. | | Edit | A line editor. | diff --git a/Tests/expected/cosmosCrossDisk.out b/Tests/expected/cosmosCrossDisk.out index b0a2b01..7c3fc00 100644 --- a/Tests/expected/cosmosCrossDisk.out +++ b/Tests/expected/cosmosCrossDisk.out @@ -25,7 +25,7 @@ Mode.sbx 48 Flip.sbx 173 Sprite.sbx 442 Depth.sbx 672 -Lander.sbx 5823 +Lander.sbx 6290 Pad.sbx 264 Crash.sbx 632 vars.script 50 diff --git a/Tests/expected/cosmosDrives.out b/Tests/expected/cosmosDrives.out index a4fa732..474b47d 100644 --- a/Tests/expected/cosmosDrives.out +++ b/Tests/expected/cosmosDrives.out @@ -15,7 +15,7 @@ Mode.sbx 48 Flip.sbx 173 Sprite.sbx 442 Depth.sbx 672 -Lander.sbx 5823 +Lander.sbx 6290 Pad.sbx 264 Crash.sbx 632 vars.script 50 diff --git a/Tests/expected/cosmosFault.out b/Tests/expected/cosmosFault.out index 481dee6..85951e2 100644 --- a/Tests/expected/cosmosFault.out +++ b/Tests/expected/cosmosFault.out @@ -32,7 +32,7 @@ Mode.sbx 48 Flip.sbx 173 Sprite.sbx 442 Depth.sbx 672 -Lander.sbx 5823 +Lander.sbx 6290 Pad.sbx 264 Crash.sbx 632 vars.script 50 diff --git a/Tests/expected/cosmosFlip.out b/Tests/expected/cosmosFlip.out index 77b32cd..bac6449 100644 --- a/Tests/expected/cosmosFlip.out +++ b/Tests/expected/cosmosFlip.out @@ -22,7 +22,7 @@ Mode.sbx 48 Flip.sbx 173 Sprite.sbx 442 Depth.sbx 672 -Lander.sbx 5823 +Lander.sbx 6290 Pad.sbx 264 Crash.sbx 632 vars.script 50 diff --git a/Tests/expected/cosmosGrid.out b/Tests/expected/cosmosGrid.out index 2f5fe53..16c9ccc 100644 --- a/Tests/expected/cosmosGrid.out +++ b/Tests/expected/cosmosGrid.out @@ -22,7 +22,7 @@ Mode.sbx 48 Flip.sbx 173 Sprite.sbx 442 Depth.sbx 672 -Lander.sbx 5823 +Lander.sbx 6290 Pad.sbx 264 Crash.sbx 632 vars.script 50 diff --git a/Tests/expected/cosmosMonitor.out b/Tests/expected/cosmosMonitor.out index 02759ae..f598191 100644 --- a/Tests/expected/cosmosMonitor.out +++ b/Tests/expected/cosmosMonitor.out @@ -108,7 +108,7 @@ Mode.sbx 48 Flip.sbx 173 Sprite.sbx 442 Depth.sbx 672 -Lander.sbx 5823 +Lander.sbx 6290 Pad.sbx 264 Crash.sbx 632 vars.script 50 diff --git a/Tests/expected/cosmosMonitorRun.out b/Tests/expected/cosmosMonitorRun.out index 5fa6870..b3021c8 100644 --- a/Tests/expected/cosmosMonitorRun.out +++ b/Tests/expected/cosmosMonitorRun.out @@ -27,7 +27,7 @@ Mode.sbx 48 Flip.sbx 173 Sprite.sbx 442 Depth.sbx 672 -Lander.sbx 5823 +Lander.sbx 6290 Pad.sbx 264 Crash.sbx 632 vars.script 50 diff --git a/Tests/expected/cosmosRun.out b/Tests/expected/cosmosRun.out index 8247aba..a0075b4 100644 --- a/Tests/expected/cosmosRun.out +++ b/Tests/expected/cosmosRun.out @@ -15,7 +15,7 @@ Mode.sbx 48 Flip.sbx 173 Sprite.sbx 442 Depth.sbx 672 -Lander.sbx 5823 +Lander.sbx 6290 Pad.sbx 264 Crash.sbx 632 vars.script 50 diff --git a/Tests/expected/cosmosSlowDisk.out b/Tests/expected/cosmosSlowDisk.out index 5f194db..2884e2e 100644 --- a/Tests/expected/cosmosSlowDisk.out +++ b/Tests/expected/cosmosSlowDisk.out @@ -13,7 +13,7 @@ Mode.sbx 48 Flip.sbx 173 Sprite.sbx 442 Depth.sbx 672 -Lander.sbx 5823 +Lander.sbx 6290 Pad.sbx 264 Crash.sbx 632 vars.script 50 diff --git a/Tests/expected/cosmosSprite.out b/Tests/expected/cosmosSprite.out index c8395b9..ee199f5 100644 --- a/Tests/expected/cosmosSprite.out +++ b/Tests/expected/cosmosSprite.out @@ -22,7 +22,7 @@ Mode.sbx 48 Flip.sbx 173 Sprite.sbx 442 Depth.sbx 672 -Lander.sbx 5823 +Lander.sbx 6290 Pad.sbx 264 Crash.sbx 632 vars.script 50 diff --git a/Tests/video.sh b/Tests/video.sh index 25b4c37..3953391 100755 --- a/Tests/video.sh +++ b/Tests/video.sh @@ -2347,6 +2347,53 @@ MOVED=$(( X3 - X2 )) && result ok "and round the back of the moon and out again" "gone, then back at $X7" \ || result no "and round the back of the moon and out again" "$X5 at five million, $X7 at seven" +# ---- Docking, and the half of it that can be flown to ---- +# +# The same shape as touchdown: close enough, and slow enough, or it is a wreck. What makes it +# a different skill is that "slow enough" is measured against the STATION, which is doing +# orbital speed - the number the marks on the drift bar already point at. +# +# ---- A NARROW FIXTURE, and it is written down rather than hidden ---- +# +# The climb here has to arrive at the station's altitude just as the station arrives at the +# lander, and the window measured 496 to 514 frames - about nineteen. 505 sits in the middle +# of it. That is thinner than this suite likes and it is the same shape as the orbit check +# that had to be deleted for measuring the boot time, so: IF THIS EVER FAILS, re-measure the +# window before believing the code is broken. +# +# It was not always narrow. The station used to orbit four rows up, where anything climbing +# away from the surface had to pass, and a strike could be had with any climb between 135 and +# 300 frames - eleven of this suite's other flights were being run down as collateral. Moving +# it to twelve rows and the ceiling to twenty four fixed all eleven at once, and made the +# station properly hard to blunder into. The narrow window is the price of that, and it is the +# right way round. +python3 -c "open('$BUILD/struck.pad','wb').write(b'\x08' * 505 + b'\x00' * 60000)" +timeout 60 "$EMU" --fast --cycles 40000000 --keyboard "$BUILD/fly.keys" \ + --pad "$BUILD/struck.pad" --disk "$ROOT/Tests/build/disks/cosmos.img" \ + --ram-disk 2048 "$BUILD/cosmos.bin" > "$BUILD/struck.out" 2>&1 || true +grep -q "Wrecked against the station" "$BUILD/struck.out" \ + && result ok "the station runs down a lander in its lane" "at 64 sixteenths of relative speed" \ + || result no "the station runs down a lander in its lane" "no wreck in the transcript" + +# ---- And the half that is not checked here ---- +# +# THE SUCCESSFUL DOCK IS NOT FLOWN. It was measured working, from a build that PLACED the +# lander alongside the station and matched: the tank went from 100 to 180, once and not once a +# frame, the message went up, and the pair then held together - lander at 316,168 and station +# at 320,160, one tile apart and unmoving for two hundred and forty frames, which is what +# riding looks like. A thrust in any direction let go of it. +# +# What could not be found was a pad file that flies there. Ninety six were tried and every one +# either hit the moon or was run down on the way UP, which turns out not to be the search's +# fault: climbing SPENDS sideways speed, by the exchange that makes the orbit work at all, so +# a lander cannot rise while matched - it arrives slower than orbital every time. Docking needs +# two burns, one to raise the far side of the orbit and one to circularise at the top, and no +# straight line of button presses stumbles into that. +# +# So it wants either a hand flown recording or, better, a way to PLACE the lander at a chosen +# position and velocity before the loop starts - which is now wanted by this, by the orbit +# above, by the ride, and by the narrow window three paragraphs up. + # ---- Clearing puts the cursor back at the top ---- # # A screen with nothing on it and a cursor half way down it is not a cleared screen. This