[Coco] Disto 4-in-1 clock2 with CocoSDC

Christopher R. Hawks chawks at dls.net
Wed Jan 21 18:21:25 EST 2015


On Thu, 22 Jan 2015 08:23:27 +1000
Bob Devries <devries.bob at gmail.com> wrote:

> Hi Robert,
> 
> I also notice that there's no entry in the makefile to actually
> *build* the clock2_disto4 module. The makefile has an entry for two
> software clocks (50 and 60Hz), the cloud9 and the BNB clock2 modules.
> 
> I notice that the other clock2 entries have something like -DCLOUD9=1
> or -DBNB=1. However, I can't see where this is used. Should I set the
> clock2_disto4 to -DDISTO or -DDISTO4.
> 
> And yet, it appears that there is a clock2 module in the
> NITROS9/6309L2/CLOCKS directory on the created disk image. That image
> doesn't read the clock since I suspect that the default clock2 module
> is the 60Hz software clock.
> 
> You would be forgiven if you think I'm floundering here. :)
> 
> Regards, Bob Devries
> Dalby, QLD, Australia
> 
> 
> On 21/01/2015 2:11 PM, Robert Gault wrote:
> > Bob Devries wrote:
> >> Hi Robert,
> >>
> >> I have had a look at the source of clock2_disto4.asm and found
> >> that it is indeed
> >> set up to be slot-ready, but it needs to have MPIFlag set to the
> >> slot number
> >> (1-4). Now I'm left wondering where this is set? I have the idea
> >> that it should
> >> be in one of the rules.mak? Would that be correct?
> >>
> >> Regards, Bob Devries
> >> Dalby, QLD, Australia
> >>
> >>
> >
> > Look at the level2/coco3/modules/makefile for example and you will
> > see
> >
> > CLOCKSMART      = -DRTCSmart=1 -DMPIFlag=1
> >
> > None of the other clock2 files have the flag set and you would need
> > to adjust the makefile to suit your preferences.
> >
> > MPIFlag does seem to be used to indicate the slot holding the RTC.
> > That would save code but a search routine would be better since you
> > would not need to recompile if the clock were moved from a default
> > slot#.
> >
> > Note that clock2_smart.asm does not use MPIFlag even though the
> > makefile does but always searches through all four slots looking
> > for the RTC.
> >
> > Robert
> >
> >
> 

Bob:

	Add this line after the '# Clocks' line in the makefile:
clock2_disto4: clock2_disto4.asm
	$(AS) $(AFLAGS) $(ASOUT)$@ $< -DMPIFlag=1

Change the MPIFlag to the slot number yours is in ( 1 - 4 ).

	I agree with Robert that all clocks should search for their
hardware in their Init routine, but, this should get you going in the
mean time.

BTW: the module is built because it is listed in the CLOCKS line near
the top of the file, and the ALLOBJS line includes $(CLOCKS), and the
requirement for the rule all: is $(ALLOBJS). Which includes $(CLOCKS)
and so, includes clock2_disto4.

	Only modules with special parameters need a separate rule (like
we just created). Others use one of the rules in rules.mak. (The
clock2_disto4 matches the last rule in rules.mak.)


Christopher R. Hawks
HAWKSoft
-- 
UNIX command of the day:
	  # man: why did you get a divorce?
	  man:: Too many arguments.


More information about the Coco mailing list