Dead Hackers Society
Other BBSes »
 
 
Demoscene  Coding  CT60  Buy/sell

Atari coding BBS
 
Re: clear pixel
Posted by: evil Oct,24.2013-16:58 


Well it's a way to optimize away the code modifying for the clearing with CPU and the clear-list alltogether with the blitter.

CPU-example:

Say you have a list of
or.b dn,ofs(a0)
or.b dn,ofs(a0)
or.b dn,ofs(a0)
or.b dn,ofs(a0)
etc

For plotting pixels, the calc-routine routine will selfmodify the codelist and write screen offsets (to ofs) and datareg (instruction word, dn) into the list. That's for plotting, not that uncommon I guess.


Then for clearing, you'd normally need something similar;

clr.b ofs(a0)
clr.b ofs(a0)
clr.b ofs(a0)
clr.b ofs(a0)
etc

The calc-rout would have to write the offset into the clearing code as well.
Glokys clever idea is to reuse the "ofs" part of the instruction from the plotcode. Eliminating the need to selfmodify two code-lists, so his clear will look like (a0=the plotcode list):

move.l (a0)+,d0 ;fetch the plot instruction and offset
clr.b (a1,d0.w) ;use the low word of d0 for clear offset


It's smart stuff, I like it :)


Blitter-example:

His second idea about using the blitter to change the opcode in the plotcode-list and save the offset. Very smart as well as the blitter will do auto increment and you can move the opcode from Halftone blitter memory, 4 cycles per replaced instruction.

Eg, before the blitterpass the plotcode-list looks like before:

or.b dn,ofs(a0)
or.b dn,ofs(a0)
etc

After the blitterpass it will look like:

clr.b ofs(a0)
clr.b ofs(a0)
etc

The calc-code will restore the opcode from clr.b to or.b the next frame.


Salutations to gloky for clever coding :)

--
Anders Eriksson
ae@dhs.nu










[All messages in this thread]    [Start new thread]

Topic Posted by  Date 
clear pixel gloky Oct,20.2013-11:44
  Re: clear pixel specter Oct,24.2013-04:19
    Re: clear pixel evil Oct,24.2013-16:58
      Re: clear pixel nerve Oct,25.2013-18:18
        Re: clear pixel gwEm Oct,27.2013-22:57
          Re: clear pixel gloky Nov,05.2013-09:29
  Re: clear pixel Leonard Nov,13.2013-02:30
    Re: clear pixel gloky Nov,16.2013-12:54
      Re: clear pixel gloky Nov,27.2013-00:44
  Re: clear pixel RA/pdx Nov,13.2013-10:27
    Re: clear pixel leonard Nov,14.2013-01:15
      Re: clear pixel RA/pdx Nov,14.2013-10:01
        Re: clear pixel leonard Nov,16.2013-11:49


Reply to this message
Name:
Topic:
Anti-troll code:

Message:

What's the anti-troll code?
That's your personal code to be able to add comments and messages on the dhs.nu site.
Don't have a code or forgot it? Fix it here.
© 1994-2024 Dead Hackers Society Contact: Anders Eriksson