The room a zoom buys goes to the sky, not to the moon
Zooming out drew fifty rows DOWN from the world's origin, which put exactly the same sky on the screen as before with twice as much moon under it. Measured: 47 per cent rock zoomed in and 71 per cent zoomed out. A zoom that shows you more of the thing you cannot fly through is not worth a button. The eighty column screen is fifty rows and the flyable band is thirty - the ceiling is eight rows above the origin and the deepest valley is twenty two below it - so the twenty rows a zoom buys have to go somewhere. They go above. The wide view starts twenty four rows over the origin, the ground sits near the bottom, and the whole band is on the screen: 23 per cent rock instead of 71. Which needed three things. The moon is drawn from row minus twenty four rather than from nought, because rows above the origin are sky by definition and because whatever the shell left in them is otherwise still there. The row origin comes out of the view block like every other screen number. And the lander's own Y moves with the view, which meant making toPixels' answer SIGNED at last: it masks to twelve bits, so a lander above the origin came back as a large positive number rather than a small negative one - harmless while such a lander was off the picture either way, and wrong the moment the view moved up to include it. That is the point of the button. 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 at row 149 and you can watch the whole orbit. Four checks, and the proportion is deliberately not on its own: measured alone it passes for a moon floating over a void, because pointing the view back at the origin leaves the rows under the terrain simply never drawn, and black counts as sky. Both breaks that matter went straight through it. What catches them is that the ground has to reach the bottom of the screen and the sky has to be empty - the latter only on a shell scrolled a hundred and eighteen lines deep, since that is what it takes to get anything into the rows the wide view moves into. The tap fixture also moved to frame 100. Fifty rows of moon take longer to draw than twenty five, and a six frame tap at frame thirty now lands before the program is reading a controller at all, which reads exactly like a button that has stopped working.
This commit is contained in:
@@ -52,7 +52,6 @@ start:
|
||||
SETD.0 Wide
|
||||
LDA.0
|
||||
OUTA 0x31 ; Forty columns to start in. B swaps to eighty and back.
|
||||
RSTA
|
||||
|
||||
; ---- And the view put back to the top of the map ----
|
||||
;
|
||||
@@ -66,7 +65,10 @@ start:
|
||||
;
|
||||
; The column origin and the fine offsets are set every frame by follow, so they need no
|
||||
; help. The row origin is set once, here, because nothing scrolls vertically after this.
|
||||
SETD.0 ScrollRow
|
||||
LDA.0
|
||||
OUTA 0x34
|
||||
RSTA
|
||||
OUTA 0x38 ; No fraction of a cell downwards either.
|
||||
|
||||
CALL mulReady ; The quarter square table, once. The orbit below needs a product.
|
||||
@@ -344,8 +346,22 @@ randomTap:
|
||||
; are next to each other, so the address is named once and the controller's Data port steps
|
||||
; through 128 of them. Cells down a COLUMN are a page apart, and doing it that way would mean
|
||||
; naming an address for every one of the 3,200 cells.
|
||||
; ---- Drawn from twenty four rows above the world, not from the world's top ----
|
||||
;
|
||||
; The eighty column screen is fifty rows and the flyable band is thirty: the ceiling is eight
|
||||
; rows above the origin and the deepest valley is twenty two below it. So the extra twenty
|
||||
; rows a zoom buys have to go SOMEWHERE, and the first version gave them all to rock - it
|
||||
; drew fifty rows down from the origin, which put the same sky on the screen as before with
|
||||
; twice as much moon under it. Measured: 47 per cent moon zoomed in and 71 per cent zoomed
|
||||
; out, which is a zoom that shows you less of what you are flying in.
|
||||
;
|
||||
; They go above instead. The rows run from minus twenty four to twenty five, which is the
|
||||
; whole band with the ground near the bottom of it, and negative rows are sky by definition
|
||||
; because nothing has a surface up there. In forty columns the ones above the origin are not
|
||||
; on the screen at all, and drawing them anyway costs a startup and clears whatever the shell
|
||||
; left in them.
|
||||
drawMoon:
|
||||
RSTA
|
||||
INIA 0xE8 ; Minus twenty four.
|
||||
SETD.1 Row
|
||||
STA.1
|
||||
drawRow:
|
||||
@@ -353,6 +369,9 @@ drawRow:
|
||||
OUTA 0xE3
|
||||
SETD.1 Row
|
||||
LDA.1
|
||||
INIB 0x7F
|
||||
AND
|
||||
MVQA ; Round the ring of 128, so minus twenty four is row 104.
|
||||
INIB 0x40
|
||||
CCF
|
||||
ADD
|
||||
@@ -364,12 +383,18 @@ drawRow:
|
||||
SETD.1 Column
|
||||
STA.1 ; A is still the nought that went to DestLow.
|
||||
drawCell:
|
||||
; Above the world's origin, where no column has a surface, so there is nothing to compare.
|
||||
SETD.1 Row
|
||||
LDA.1
|
||||
INIB 0x80
|
||||
AND
|
||||
BNQ drawSky
|
||||
|
||||
; ---- Ground at the surface row and everything under it ----
|
||||
;
|
||||
; ROW MINUS HEIGHT and not the other way round, which matters at the surface itself: the
|
||||
; two are equal there, equal does not borrow, and the row a column's surface is on has to
|
||||
; be ground rather than the last of the sky.
|
||||
SETD.1 Row
|
||||
LDA.1
|
||||
LDB.2
|
||||
CCF
|
||||
@@ -422,11 +447,10 @@ drawNextCell:
|
||||
LDA.1
|
||||
INCA
|
||||
STA.1
|
||||
SETD.2 MoonRows
|
||||
LDB.2
|
||||
INIB 0d26
|
||||
CCF
|
||||
SUB
|
||||
BNQ drawRow
|
||||
BNQ drawRow ; Fifty rows, from minus twenty four up to and including 25.
|
||||
RET
|
||||
|
||||
; ---- The lander, as a sprite ----
|
||||
@@ -1162,6 +1186,24 @@ follow:
|
||||
showLander:
|
||||
SETD.0 DownLow
|
||||
CALL toPixels
|
||||
|
||||
; ---- Signed, which it did not have to be while the view never moved ----
|
||||
;
|
||||
; toPixels shifts a sixteen bit position down four and masks what is left to twelve bits, so
|
||||
; a lander above the world's origin comes back as a large POSITIVE number rather than a small
|
||||
; negative one. That was harmless while the top of the screen was the origin: such a lander
|
||||
; was off the picture either way. Now that the wide view starts twenty four rows higher it is
|
||||
; on the picture, and it has to be on the right part of it.
|
||||
SETD.0 PixelHigh
|
||||
LDA.0
|
||||
INIB 0x08
|
||||
AND
|
||||
BRQ showLanderDown
|
||||
LDA.0
|
||||
INIB 0xF0
|
||||
OR
|
||||
STQ.0 ; The twelfth bit was the sign, so the top nibble is too.
|
||||
showLanderDown:
|
||||
INIA 0d4
|
||||
OUTA 0xE3
|
||||
INIA 0xC0
|
||||
@@ -1170,10 +1212,17 @@ showLander:
|
||||
OUTA 0xE5 ; Y is bytes four and five of the entry.
|
||||
SETD.0 PixelLow
|
||||
LDA.0
|
||||
OUTA 0xE9
|
||||
SETD.1 ShipYAdd
|
||||
LDB.1
|
||||
CCF
|
||||
ADD
|
||||
OUTQ 0xE9
|
||||
SETD.0 PixelHigh
|
||||
LDA.0
|
||||
OUTA 0xE9
|
||||
INCD.1
|
||||
LDB.1
|
||||
ADD ; And the carry, which is the other half of the shift.
|
||||
OUTQ 0xE9
|
||||
RET
|
||||
|
||||
; ---- Green if it would survive, red if it would not ----
|
||||
@@ -1722,7 +1771,7 @@ setView:
|
||||
SETD.0 ViewWide
|
||||
setViewFrom:
|
||||
SETD.1 View
|
||||
INIA 0d15
|
||||
INIA 0d17
|
||||
SETD.2 ViewLeft
|
||||
STA.2
|
||||
setViewByte:
|
||||
@@ -1752,6 +1801,9 @@ toggleView:
|
||||
SETD.0 Wide
|
||||
LDA.0
|
||||
OUTA 0x31
|
||||
SETD.0 ScrollRow
|
||||
LDA.0
|
||||
OUTA 0x34 ; The wide view starts higher up, which is where the sky is.
|
||||
CALL drawMoon
|
||||
CALL putLander
|
||||
CALL putGauge
|
||||
@@ -2368,8 +2420,10 @@ HeightFoot:
|
||||
0xB4 0x00
|
||||
RowCells:
|
||||
0d40
|
||||
MoonRows:
|
||||
0d25
|
||||
ScrollRow:
|
||||
0d0
|
||||
ShipYAdd:
|
||||
0x00 0x00
|
||||
ViewLeft:
|
||||
0x00 ; How much of the block is still to copy.
|
||||
|
||||
@@ -2383,7 +2437,8 @@ ViewNarrow:
|
||||
0d100 ; Half the height, which is where the fall bar starts.
|
||||
0xB4 0x00 ; The height bar's foot.
|
||||
0d40 ; Cells to a window row.
|
||||
0d25 ; Rows of moon to draw.
|
||||
0d0 ; The map row the top of the screen is, and
|
||||
0x00 0x00 ; how far the lander's own Y has to move with it.
|
||||
|
||||
; Eighty columns: 640 by 400, the same cells at half the size, so twice as much moon either
|
||||
; way. Every screen number doubles except the ones measured from an edge, which are the edge
|
||||
@@ -2397,7 +2452,8 @@ ViewWide:
|
||||
0d200
|
||||
0x7C 0x01 ; 380.
|
||||
0d80
|
||||
0d50
|
||||
0d104 ; Twenty four rows ABOVE the world's origin, which is the point.
|
||||
0xC0 0x00 ; So the lander's Y moves 192 pixels down to match.
|
||||
|
||||
; Which of the two is up. Nought is forty columns, which is what the program starts in.
|
||||
Wide:
|
||||
|
||||
Reference in New Issue
Block a user