write_pixel now allows to set and unset

set - tested
unset - not tested
This commit is contained in:
Pedro de Oliveira 2014-08-19 09:15:58 +01:00
parent 7a387523fa
commit 66939f3406
2 changed files with 13 additions and 3 deletions

View File

@ -41,6 +41,7 @@ main
call get_screen_address
; Video RAM address for those X,Y is now in HL and the bit needed
; to be set in that address value is in A
ld d, $1
call write_pixel ; Uses those values and writes the pixel
pop hl
@ -96,9 +97,18 @@ write_pixel_loop
dec b
jr write_pixel_loop
write_pixel_do_it
ld a, d
cp $1
jr z, write_pixel_set
ld a, (hl)
xor c
ld (hl), a
jr write_pixel_end
write_pixel_set
ld a, (hl)
or c
ld (hl), a
write_pixel_end
pop bc
ret
ENDP

View File

@ -15,8 +15,8 @@ f.write("StarRnd\n")
for x in range(NumStars):
x = random.randint(0,256 - 1)
y = random.randint(0,192 - 1)
#z = random.randint(0,10)
#f.write("\t\tdb %i, %i, %i\n" % (y ,x ,z))
f.write("\t\tdb %i, %i\n" % (x ,y))
z = random.randint(0,10)
#f.write("\t\tdb %i, %i, %i\n" % (x, y, z))
f.write("\t\tdb %i, %i\n" % (x, y))
f.close()