Shop OBEX P1 Docs P2 Docs Learn Events
stuck on passing an adress from one object to the next. — Parallax Forums

stuck on passing an adress from one object to the next.

mike goettlingmike goettling Posts: 31
edited 2007-04-26 21:48 in Propeller 1
i am trying to pass the adress of vgacolors to another object and start a new cog.
what am i doing wrong.

main program has vgacolors prams. using VGA 1280x1024 Tile Driver v0.9 for vid driver.

DAT
·
vgacolors long
· long $3C043C04······ 'lt grey on dk grey···················· 110
· long $3C3C0404
· long $C000C000······ 'red··································· 111
· long $C0C00000
· long $30003000······ 'green································· 112

call to object blinking colors

colors.start(@vgacolors)

this should pass the adress of vgacolors to the object blinking colors

this is blinking colors program

var
long stack[noparse][[/noparse]9]
long i

pub start(colortable)
····
· cognew (toggle(colortable),@stack)

pub toggle(colortable)
···
repeat
···· i := cnt
···· waitcnt(i += 22500000)
···· colortable := $C000C000·················
···· colortable[noparse][[/noparse]+1] := $C0C00000
···· waitcnt(i += 22500000)
···· colortable := $3C043C04
···· colortable[noparse][[/noparse]+1] := $3C3C0404



the repeat works if i put it in the main program and change colortable to vgacolors. the charactors will flash on the screen. i know that the adress is not passing to the blinking colors object but i cant figure out why.

·

Comments

  • KaioKaio Posts: 253
    edited 2007-04-26 08:58
    Mike,

    try this code.
    repeat
         i := cnt
         waitcnt(i += 22500000)
         LONG[noparse][[/noparse]colortable] := $C000C000                 
         LONG[noparse][[/noparse]colortable+1] := $C0C00000
         waitcnt(i += 22500000)
         LONG[noparse][[/noparse]colortable] := $3C043C04
         LONG[noparse][[/noparse]colortable+1] := $3C3C040
    
    
  • mike goettlingmike goettling Posts: 31
    edited 2007-04-26 21:48
    works but i had to make one change

    repeat
    ·····i·:=·cnt
    ·····waitcnt(i·+=·22500000)
    ·····LONG[noparse][[/noparse]colortable]·:=·$C000C000
    ·····LONG[noparse]/noparse]colortable[b[noparse][[/noparse][/b]1]·:=·$C0C00000
    ·····waitcnt(i·+=·22500000)
    ·····LONG[noparse][[/noparse]colortable]·:=·$3C043C04
    ·····LONG[noparse]/noparse]colortable[b[noparse][[/noparse][/b]1]·:=·$3C3C040

    thanks
Sign In or Register to comment.