[Coco] Coco Digest, Vol 122, Issue 19

Brett Gordon beretta42 at gmail.com
Sat Mar 9 08:56:21 EST 2013


> Hello, I'm new to this list.
>
> I would like to code a game for the Coco1/2. I usually code for the
> commodore c64 so I am aquainted with the 6502 but I also can code for the
> motorolas 6800, 6809 and 680000. During the last days I have coded a sprite
> engine for a computer with a 6809E and it is working great and then I
> thought that I could code also the game for the Coco/Dragon computers.
>
> I need to know if there is a register that I can poll to check the current
> raster position or if there is another way to know when the VDP starts
> painting the horizontal borders. I am asking this because as many will know
> if I paint the sprites there(borders) there will be no flickering. Another
> option I have would be to use double buffering but then this would eat much
> more memory and that would be perhaps a no go.
>
> How safe is it to use the high speed poke on a game? Do coco games use it?
>
> Thanks
>
> Wood

Welcome Wood!  We need good programmers for the CoCo!  I have a
feeling there is going to be some new hardware on the CoCo's horizon,
and we need people producing new software.

Unfortunately, unlike more sophisticated systems, the CoCo's VDG chip
doesn't include an external register for scan lines; It does, however,
send it's HSYNC and VSYNC lines to the PIA chips for Interrupt
latching.   The HSYNC is latched and gated vi PIA to the FIRQ line and
the VSYNC is gated and latched to the IRQ line.   You can setup the
interrupts like this

.db      scanline      ;;  scan line counter

FIRQ:
            lda    PIADATA       ;  clear pia interrupt
            inc    scanline        ;  increment scanline on HSYNC ( ~15,750 Hz)
            rti                           ;  return

IRQ:
            lda    PIADATA       ; clear pia interrupt
            clr     scanline        ; reset scanline counter on VSYNC (~60 Hz)
            rti                           ; return

initirq:
            orcc  #0x50            ; shut off interrupts
            ldd    FIRQ              ; set BASIC's revectored FIRQ
            std    0x103
            ldd    IRQ                 ; set BASIC's revectored IRQ
            std    0x106
            andcc #0xaf           ; turn on interrupts
            rts

Double check usual places for the exact addresses for the PIA
addresses, BASIC's IRQ handler addresses, and CC's INT masks :)

https://sites.google.com/a/aaronwolfe.com/cococoding/

is Aaron's great repo for technical docs on BASIC and CoCo in general.

Cheers,

-- 
Brett M. Gordon, (CoCoBoot)
beretta42 at gmail.com



More information about the Coco mailing list