Programmers - outputting a point from a table.

Mask #00
╔═══════════════════════════════ ═══════════════════════════════╗
│├┌╟▒░╪▓╖╫┌▓┌┤└▄┌╜┬┼│█┬│▓ FOR PROGRAMMERS ┼▄╫└┘╨┬▄╫├┼▓╢├│╢└█▓└╙╜┬│
╚═══════════════════════════════ ═══════════════════════════════╝
(c) SpaceS MDM 294-23-76

  If no one stops me, I will run this section
me again (SpaceS, of course)! Now I would like to talk about you
water points (!). I’ll say right away that the method proposed by SATSOFT in
the seventh issue of BODY, I am somewhat dissatisfied with its speed
work. I think that all this is explained by the fact that the above-mentioned co-
der, publishing BODY, does not read other publications, which, by the way, contain
quite a lot of useful information (I'm talking about ECHO#1). Namely about
I’m going to talk about ECHO’s point output procedure now.
rit. Why did I decide to publish it again? Logical question.
I answer: in ECHO the point output subroutine was printed in error.
bkoy (is this a mistake???), besides, I will give here the procedure for
building a table for it. So, let's start with...

   Output point:

	LD D,XPOSITION
	LD B,YPOSITION
	LD H,HIGH BYTE OF TABLE ADDRESS
	LD L,D ;I won’t comment anything further
	LD E,(HL) ;I will, because the program is very simple. Well
	INC H ;and if someone doesn’t understand, drop it
	LD A,(HL); message on ABIGOR BBS or call
	LD L,B ;I will explain it personally...
	INC H
	OR(HL)
	LD C,A
	INC H
	LDB(HL)
	LD A,(BC)
	OR E
	LD(BC),A

  And now, a program that creates a table for the previous procedure,
without which all of the above will not work:

	LD H,HIGH BYTE OF FUTURE TABLE PLACEMENT
	LD L,0 ;L=0
	LD A,1 ;A=1
	LD B,L ;B=256
MET1 RRCA ;scroll A
	LD (HL), A ;save in the table
	INC HL ;next cell
	DJNZ MET1 ;NEXT B
	LD D,L ;D=0
	LD B,D ;B=256
MET2 LD A,D ;A=D
	RRCA ;
	RRCA ;
	RRCA ;A=A/8
	AND 31 ;select the last five bits in A
	LD (HL), A ;save in the table
	INC HL ;next cell
	INC D ;D=D+1
	DJNZ MET2 ;NEXT B
	LD B,192 ;B=192
METЗ LD A,D ;A=0
	RLCA ;accumulator shift
	RLCA ;one more time
	AND 224 ;select the first three bits of A
	LD (HL), A ;save in the table
	LD A,D ;A=D
	AND 7 ;selecting the last three bits in A
	LD E,A ;E=A
	LD A,D ;A=D
	AND 192 ;select the first two bits from the accumulator
	RRCA ;
	RRCA ;
	RRCA ;three shifts right
	OR 64 ;OR #40
	OR E ;that's clear
	INC H ;H=H+1
	LD (HL), A ;save in the table
	DEC H ;H=H-1
	INC HL ;next cell
	INC D ;D=D+1
	DJNZ METЗ ;NEXT B
	RET ;THE END !

  As you probably already guessed, the table can have -
only at a “flat” hexadecimal address. Its size is
consideryourself ;-) !
  And in conclusion, I will give some more useful information that
Paradise will undoubtedly help you deal with all of the above. And
it will be called...

      DEPENDENCE OF THE SCREEN ADDRESS ON THE COORDINATES BY WHICH
		  HE WILL BE ACCOUNTABLE.

Wow!

   In short, let’s say we need to calculate ad-
screen res. The X coordinate can vary from 0 to 255, and the Y coordinate from 0 to
191.

 Y ▒▒▓▓▓░░░ X ╬╬╬╬╬+++
   76543210 76543210

Received address: 010▒▒░░░ ▓▓▓╬╬╬╬╬
		  76543210 76543210
		      │ │
		  This is old - And this is -
		  low byte
		  addresses in shiya
		  videopa-
		  wrinkle

   I think even an idiot can figure this out. BUT, just in case, I’ll explain
I know: with the icons “▒▒” or “╬╬╬╬╬” I designated a certain UNCHANGEABLE
THIS is the sequence of bits in a byte. And the symbols "+++" are followed by
bit value that does not affect the future address on the screen and
can be absolutely any (but note: this is only when calculating
those addresses, and not when displaying a dot!!!)
   In general, figure it out and write your super-mega-giga-ZD demos!

Share your thoughts about the article