Commodore 64 Uživatelský manuál Strana 53

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 83
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 52
INTERRUPT STATUS REGISTER
The interrupt status register shows the current status of any interrupt
source. The current status of bit 2 of the interrupt register will be a 1
when two sprites hit each other. The same is true, in a corresponding 1
to 1 relationship, for bits 0-3 listed in the chart below. Bit 7 is also set
with aI, whenever an interrupt occurs.
The interrupt status register is located at 53273 ($DOI9) and is as
follows:
BIT # DESCRIPTIONLATCH
IRST
IMDC
IMMC
ILP
IRQ
o Set when current raster count = stored raster count
1 Set by SPRITE-DATAcollision (1st one only, until reset)
2 Set by SPRITE-SPRITEcollision (1st one only, until reset)
3 Set by negative transition of light pen (1 per frame)
7 Set by latch set and enabled
Once an interrupt bit has been set, it's "latched" in and must be
cleared by writing a 1 to that bit in the. interrupt register when you're
ready to handle it. This allows selective interrupt handling, without hav-
ing.to store the other interrupt bits.
The INTERRUPTENABLEREGISTERis located at 53274 ($D01A). It has
the same format as the interrupt status register. Unless the correspond-
ing bit in the interrupt enable register is set to aI, no interrupt from that
source will take place. The interrupt status register can still be polled for
information, but no interrupts will be generated.
To enable an. interrupt request the corresponding interrupt enable bit
(as shown in the chart above) must be set to a 1.
This powerful interrupt structure lets you use split screen modes. For
instance you can have half of the screen bit mapped, half text, more
than 8 sprites at a time, etc. The secret is to use interrupts properly. For
example, if you want the top half of the screen to be bit mapped and
the bottom to be text, just set the raster compare register (as explained
previously) for halfway down the screen. When the interrupt occurs, tell
the VIC-II chip to get characters from ROM, then set the raster compare
register to interrupt at the top of the screen. When the interrupt occurs
at the top of the screen, tell the VIC-II chip to get characters from RAM
(bit map mode).
PROGRAMMING GRAPHICS 151
Zobrazit stránku 52
1 2 ... 48 49 50 51 52 53 54 55 56 57 58 ... 82 83

Komentáře k této Příručce

Žádné komentáře