Git Product home page Git Product logo

Comments (11)

konimaru avatar konimaru commented on July 24, 2024

What is this driver you speak of? The only graphics.spin I could find doesn't even have a stop method. And simply calling start on that one again will also start another VGA driver underneath (with expected results).

from jcap.

cspang1 avatar cspang1 commented on July 24, 2024

@konimaru it's on the feature/video/vga/multicog branch: https://github.com/cspang1/JCAP/tree/feat/video/vga/multicog/Dev/Game/Software

from jcap.

konimaru avatar konimaru commented on July 24, 2024

This should do the trick:

PUB start(graphics_addr_base) : vidstatus | nCogs,i                             ' Function to start VGA driver with pointer to Main RAM variables
    stop                                                                        ' Stop running driver
    repeat i from 0 to numCogs-1                                                ' Loop through cogs
      ifnot cog_[i] := cognew(@vga, graphics_addr_base) + 1                     ' Initialize cog running "vga" routine with reference to start of variable registers
        stop                                                                    ' Stop all cogs if insufficient number available
        abort FALSE                                                             ' Abort returning FALSE
    waitcnt($8000 + cnt)                                                        ' Wait for cogs to finish initializing 
    return TRUE                                                                 ' Return TRUE                                                

Note the extra stop call. This makes sure consecutive start calls don't attempt to start thousands of drivers. That said, this wouldn't explain the not-working stop/start sequence.

I guess I have to try it for real :)

from jcap.

cspang1 avatar cspang1 commented on July 24, 2024

@konimaru That definitely did the trick, because in my test code for stopping and starting the driver I don't check if it's already running or not and the input to start/stop is constant, so it just spams start or stop...

  started := true                                       ' Initialize video driver status
  repeat                                                ' Loop infinitely
    if (control_state & 8) AND started                  ' Test button #4 and that the video driver is started                  
      graphics.stop                                     ' Stop the video driver
      started := false                                  ' Set started status to false
    elseif (control_state & 4) AND !started             ' Test button #3 and that the video driver is not started
      graphics.start                                    ' Start the video driver
      started := true                                   ' Set started status to true

I code good.

Satisfied by commit 713ed56

from jcap.

konimaru avatar konimaru commented on July 24, 2024

Out of curiosity, why did you put this logic into to the application? Isn't the driver itself better suited for this (i.e. keeping state info)?

from jcap.

cspang1 avatar cspang1 commented on July 24, 2024

@konimaru Yes it definitely is! I was just testing to make sure the start and stop routines worked, and the easiest way at the time was to control them with button presses. I forsee no real reason I should ever have to stop or restart the video driver unless I implement some sort of software reset for the whole system, so just novelty mixed with making sure everything is tested instead of assumed-working.

from jcap.

konimaru avatar konimaru commented on July 24, 2024

OK, I thought this is for deployment. Personally I only implement init methods. No-one is stopping things anyway so there :)

from jcap.

cspang1 avatar cspang1 commented on July 24, 2024

@konimaru That's definitely a cleaner design paradigm haha.

Just a heads up, any branch that's preceded by "wip" is baseline "work in progress" (standard dev, such as for wip/video/vga or wip/sound), "feat" is "feature" (a unique dev aspect, such as feat/video/vga/multicog which is focused on refactoring my single-cog driver into a synchronized parallelized one). Other prefixes may be used for things like hotfixes etc. Nothing is merged with master until development on it is considered "complete" (for example, the wip/input branch was merged a while back because I considered the 74HC165 interfacing complete).The idea is that the only production/deployment code will be in master, and everything else is dev.

from jcap.

cspang1 avatar cspang1 commented on July 24, 2024

Starting/stopping driver exhibiting strange behavior again.

from jcap.

cspang1 avatar cspang1 commented on July 24, 2024

Stopping then starting the driver results in apparently valid sync waveforms, but not video.

from jcap.

cspang1 avatar cspang1 commented on July 24, 2024

Made unecessary by dual-Propeller development.

from jcap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.