User Tools

Site Tools


notes:atari:book_dereatari:player-missile_graphics

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
notes:atari:book_dereatari:player-missile_graphics [2016/09/15]
admin [Applications of Player-Missile Graphics]
notes:atari:book_dereatari:player-missile_graphics [2016/09/15] (current)
admin
Line 237: Line 237:
  
 Figure 4-3 Masking a Player for More Resolution Figure 4-3 Masking a Player for More Resolution
 +
 +
 +===== Special Characters =====
 +
 +Another application of player-missile graphics is for special characters. There are many special types of characters that cross vertical boundaries in normal character sets. One way to deal with these is to create special character sets that address this problem. Another way is to use a player. Subscripts, integral signs, and other special symbols can be done this way. A sample program for doing this is:
 +
 +<code zxbasic>
 +CH4PRG3.BAS
 +
 +1  RAMTOP=106:​REM ​                     OS top of RAM pointer
 +2  PMBASE=54279:​REM ​                   ANTIC player-missile RAM pointer
 +3  SDMCTL=559:​REM ​                     Shadow of DMACTL
 +4  GRACTL=53277:​REM ​                   CTIA's graphics control register
 +5  HPOSP0=53248:​REM ​                   Horizontal position register of P0
 +6  PCOLR0=704:​REM ​                     Shadow of player 0 color register
 +10 GRAPHICS 0:​A=PEEK(RAMTOP)-16:​REM ​   Must back up for 1-line resolution
 +20 POKE PMBASE,A
 +30 MYPMBASE=256*A
 +40 POKE SDMCTL,62
 +50 POKE GRACTL,3
 +60 POKE HPOSP0,102
 +70 FOR I=MYPMBASE+1024 TO MYPMBASE+1280
 +80 POKE I,0
 +90 NEXT I
 +100 POKE PCOLR0,140
 +110 FOR I=0 TO 15
 +120 READ X
 +130 POKE MYPMBASE+1100+I,​X
 +140 NEXT I
 +150 DATA 14,​29,​24,​24,​24,​24,​24,​24
 +160 DATA 24,​24,​24,​24,​24,​24,​184,​112
 +170 ?" ":​REM ​                          Clear screen
 +180 POSITION 15,6
 +190 ?"​xdx"​
 +</​code>​
 +
 +This program produces the following display:
 +
 +{{  Atari_Book_Fig4-4.PNG?​500 ​ }}
 +
 +Figure 4-4 Using a Player as a Special Character
 +
 +A particularly useful application of players is for cursors. With their ability to smoothly move anywhere over the screen without disturbing its contents they are ideally suited for such applications. The cursor can change color as it moves over the screen to indicate what it has under it.
 +
 +Player-missile graphics provide many capabilities. Their uses for action games as animated objects are obvious. They have many serious uses as well. They can add color and resolution to any display. They can present special characters. They can be used as cursors. Use them.
notes/atari/book_dereatari/player-missile_graphics.txt ยท Last modified: 2016/09/15 by admin