[Coco] NitrOS9 build errors

Darren A mechacoco at gmail.com
Sat Jan 18 17:55:56 EST 2014


On Sat, Jan 18, 2014 at 3:27 PM, Tormod Volden wrote:

> On Sat, Jan 18, 2014 at 9:24 PM, Darren A wrote:
> > One thing I noticed in boot_d64.asm is that the interrupt masks are being
> > set (ORCC #$50) before preserving CC on the stack (PSHS Y,DP,CC).  This
> > means when the code later restores CC (PULS Y,DP,CC) the interrupts will
> > remain masked.  I don't know if any subsequent code expects the
> interrupts
> > to be enabled, but if so that could be a problem.
>
> Thanks for looking at this! It is indeed interesting, since the
> comment says "enable FIRQ". I tried using ORCC #$10 instead to not
> disable FIRQ but that did not make it work. Even adding ANDCC #~$40
> did not help.
>
> But when I looked at the XRoar trace to see where PC would jump into
> nowhere, I recognized the start of "REL" at $2602 and some
> instructions there that did not match the code as I knew it from
> rel.asm. Turned out that many writes to the PIAs went to page 0
> (direct page addressing, and without DP set). Actually in
> defs/dragon.d the PIA0Base and PIA1Base did not have "IO" ($FF00)
> added. Now I added the IO offset, and voila, the disk images are
> booting up in a "beautiful" high-resolution console!
>
> Tormod
>

The ORCC #$50 is definitely the correct instruction.  It should just be
positioned after PSHS Y,DP,CC instead of before it.  You don't want any
service routines besides NMI invoked during disk I/O. The code uses a SYNC
instruction to wait for an FIRQ between each byte transfer.

In any case, its probably not important since you found the real problem.
It seems rather clunky that the code defines alternate PIA address symbols
just for the DP address mode. The assembler will happily cut the upper half
off the full extended address when you use a direct page prefix (<).

Darren



More information about the Coco mailing list