home *** CD-ROM | disk | FTP | other *** search
/ The CDPD Public Domain Collection for CDTV 3 / CDPDIII.bin / pd / programming / assembler / thesource / volume1 / source / scrollers / manyfields.lha / ManyFields.txt
Encoding:
Text File  |  1993-06-10  |  1.8 KB  |  37 lines

  1. How can you cheat to have more than the two hardware playfields?
  2.  
  3. Well, there are more than one way to do this :
  4.  
  5. One way is to use the blitter to put two of the 'fields' on top
  6. of eachother, ie. two of them use the same playfield. This means
  7. they must use the same colours aswell.
  8.  
  9. Another technic that is used in many games, is to use the sprites as one
  10. of the playfields. LEANDER, RISKY WOODS and many more use this technic.
  11. The whole secret about this is to use the copper to change the x-position
  12. of the sprites, so that one sprite can be displayed more than once on
  13. each horizontal scan-line. In this way it's possible to have two
  14. 'playfields' with 16 colours in each. The problem is that you don't have
  15. the time to change the sprites bitmap-data aswell, so in the playfield
  16. with sprites you must repeat the graphics every 128 pixels in the
  17. x-direction. And if you use more than 4 biplanes, you steal some cycles
  18. from the copper, and then you don't have the time to replace all the
  19. sprites. Here's a copper example of how to replace the sprites :
  20.  
  21.  
  22. dc.w    $2C37,$FFFE            ; Wait for y = $2c , x = $37
  23. dc.w    $0140,$0040,$0144,$xxxx        ; New xpos and data for sprite0
  24. dc.w    $0148,$0048,$014C,$xxxx        ; New xpos and data for sprite1
  25. dc.w    $0140,$0050,$0144,$xxxx        ; New xpos and data for sprite0
  26. dc.w    $0148,$0058,$014C,$xxxx        ; New xpos and data for sprite1
  27. dc.w    $0140,$0060,$0144,$xxxx        ; New xpos and data for sprite0
  28. dc.w    $0148,$0068,$014C,$xxxx        ; New xpos and data for sprite1
  29. dc.w    $0140,$0070,$0144,$xxxx        ; New xpos and data for sprite0
  30. dc.w    $0148,$0078,$014C,$xxxx        ; New xpos and data for sprite1
  31.  
  32. repeat until you reach the end of the screen at x = $D0, and then do this
  33. for each scan-line.
  34.  
  35. With the above copperlist, you can have a one-bitplane scroller across the 
  36. screen without using any bitplanes, and you still have 6 sprites free!
  37.