mirror of https://github.com/falsovsky/z80.git
write_pixel now allows to set and unset
set - tested unset - not tested
This commit is contained in:
parent
7a387523fa
commit
66939f3406
|
@ -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
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue