Hardware sprites on/off

By meits

Scribe (6530)

meits's picture

11-05-2017, 17:15

I found out that hardware sprites get disabled with: vdp(9)=vdp(9)or2
Now I need the command to enable them again. I remember something like vdp(9)=vdp(9)and [something]

Login or register to post comments

By meits

Scribe (6530)

meits's picture

11-05-2017, 17:50

ghe... I found out myself Smile

By Grauw

Ascended (10699)

Grauw's picture

11-05-2017, 18:56

253 Smile

By meits

Scribe (6530)

meits's picture

11-05-2017, 19:22

just out of curiosity. why this long way? is vdp(9)=vdp(9)and253 not an integer? or is the value x on computer a and y on computer b?

By Grauw

Ascended (10699)

Grauw's picture

11-05-2017, 19:56

2 is 00000010 binary, 253 is 11111101.

A OR B sets the bits which are 1 in either, A AND B clears the bits which are 0 in either.

As you can see in the binary notation, 253 is the complement of 2. Ways to calculate the complement of an 8-bit number is 255 - A = B, or A XOR 255 = B.

By ARTRAG

Enlighted (6923)

ARTRAG's picture

11-05-2017, 20:42

He asked if vdp(9) can have different values on different machines

By Manuel

Ascended (19273)

Manuel's picture

11-05-2017, 20:55

Meits: you use the long way to only toggle that single bit in the register and leave the rest for what it is.

By Grauw

Ascended (10699)

Grauw's picture

11-05-2017, 21:33

Oh, in that case, maybe different on some machines, maybe not. Or the user might have changed it. Also I don’t really know exactly what each bit does, and in which screen modes they should be set. The uncertainties are exactly why I think it’s best to just change the bit you want to change instead of setting all 8. Better safe than sorry Smile.