Search Results - MEL PICBASIC Forum


Search:

Type: Posts; User: HenrikOlsson; Keyword(s):

Search: Search took 0.01 seconds.

  1. Replies
    45
    Views
    88,148

    Re: Conway's Game Of Life

    On EEVBlog I stumbled across a link to an old (1979) issue of BYTE Magazine, in it there's an article on algorithms for this Game of Life thing. Thought it might be interesting:
    ...
  2. Replies
    45
    Views
    88,148

    Re: Conway's Game Of Life

    The array transform routine, as posted above executes in 4.66ms on my test hardware (18F46K42 @64MHz).
    It's a small improvement but I managed to reduce that to 4.28ms by changing it into two...
  3. Replies
    45
    Views
    88,148

    Re: Conway's Game Of Life

    This shaved another 4ms off here, instead of:

    IF population > 3 OR population < 2 THEN
    lednew[counter] = 0
    ENDIF

    Do:

    IF Population > 3 THEN LEDNew[Counter] = 0
    IF Population < 2 THEN...
  4. Replies
    45
    Views
    88,148

    Re: Conway's Game Of Life

    From 3 to 15 frames per second in a couple of hours, I call that improvement.
    At one place (at least) you first do IF LED[Counter] = 0 and then a couple of lines further down you do IF LED[Counter]...
  5. Replies
    45
    Views
    88,148

    Re: Conway's Game Of Life

    Great that it all still works!
    I timed it and Richards is a quite a bit quicker. On my test setup it went from 67 to 48ms which is not surprising since, generally speaking, anything involving...
  6. Replies
    45
    Views
    88,148

    Re: Conway's Game Of Life

    There's also an array called colour, how large is that?

    For this I just toggle an output and measure it with the scope but for more precise measurements I use one of the onboard timers. Reset it,...
  7. Replies
    45
    Views
    88,148

    Re: Conway's Game Of Life

    In the Grid Evalutaion section, precalculating the Array index values and replacing the AND-logic with nested IF/THEN saves Another bunch of cycles

    'Grid Evaluation

    CntPlus33 VAR WORD...
  8. Replies
    45
    Views
    88,148

    Re: Conway's Game Of Life

    What size are all the different arrays?
  9. Replies
    45
    Views
    88,148

    Re: Conway's Game Of Life

    Here's another tiny tweak to the array transformation routine that makes quite a difference:

    FOR Row = 0 to 31 ' Cycle thru 32 rows

    TempW = ROW * 32 ' Precalculate this...
  10. Replies
    45
    Views
    88,148

    Re: Conway's Game Of Life

    Hi,
    It might very well be that I don't quite understand what you're doing in the code but replacing all that OR logic with some math increases the performance in that particulat section of the code...
  11. Replies
    45
    Views
    88,148

    Re: Conway's Game Of Life

    Here's an idea, untested, don't know if it compiles.


    InPtr VAR BYTE
    OutPtr VAR BYTE

    Row VAR BYTE
    Col VAR BYTE

    Even VAR BIT
Results 1 to 11 of 11