# Plotting a single dot on screen

Página 4/4
1 | 2 | 3 |

Never offended.

I am used to redundant answer from old yahoo message boards.

Hey, what is the best treatment for cancer.
WELL WHY DO YOU WANT TO BE CURED....
That kind of thing.

I appreciate all the help I can get.

Grauw wrote:

Btw, I could swear I saw another thread with this same question last month, but I can’t find it.

Edit: Ah, it was here: https://www.msx.org/forum/msx-talk/development/software-spri...

Grauw wrote:

The 256×192 pixels of screen 2 are organised as 8×8 patterns in a grid of 32×24. Each 8×8 pattern is made of 8 bytes. By default the name table is set up so that the patterns patterns follow each other in sequence from left to right top to bottom.

You need to first calculate the address of the byte in the pattern table: base address | ((y & 248) << 5) | (x & 248) | (y & 7). Then you read that byte from VRAM, set bit x & 7, and write it back.

Hopefully that provides enough of a starting point to get the grasp of it.

| = or
& = and
<< = left shift

Note that `add a,a` and `add hl,hl` are quick alternatives to `sla r`.

Seriously...
That was one of the other questions and I never connected the two.
Way too much on my mind....

Thanks

the example routine I've posted use two bios routine to read from vram/write to vram but they are easy to rewrite:

```write_vram:
push af
ld a,l
di
out (99h),a
ld a,h
or 64
ei
out (99h),a
pop af
out (98h),a
ret

ld a,l
di
out (99h),a
ld a,h
ei
out (99h),a
in a,(98h)
ret
```
thegeps wrote:
I have a ready routine in the book I read to learn msx asm coding. Never tried ot but it should work:

BTW...
What is the name of the book.
I am up for any reading that will help me create beautiful MSX games

My book is in italian language but I think you could find the english version.

MSX linguaggio macchina
C.I. Burkinshaw
R. Goodley

And... found english version (and a lot of msx coding books) here:

thegeps wrote:

My book is in italian language but I think you could find the english version.

MSX linguaggio macchina
C.I. Burkinshaw
R. Goodley

And... found english version (and a lot of msx coding books) here: