Comments (11)
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.
@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.
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.
@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.
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.
@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.
OK, I thought this is for deployment. Personally I only implement init methods. No-one is stopping things anyway so there :)
from jcap.
@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.
Starting/stopping driver exhibiting strange behavior again.
from jcap.
Stopping then starting the driver results in apparently valid sync waveforms, but not video.
from jcap.
Made unecessary by dual-Propeller development.
from jcap.
Related Issues (20)
- Integrate stereo/mono pre-amp, RGBS, and coin counter circuits w/ schematics HOT 1
- Fix intermittent start-up video desync HOT 11
- Incorporate header files for constants HOT 1
- Elaborate on Video Part 3/4 Wiki Pages
- Update .io pages w/ Wiki info
- Refactor TX/RX handshake to encapsulate by modules HOT 1
- Implement sprite sizing HOT 16
- Implement horizontal fine pixel tile scrolling HOT 2
- Implement vertical fine pixel tile scrolling HOT 3
- Implement tile map scroll wrapping HOT 1
- Render cycle count improvements HOT 29
- Determine EEPROM Writing Solution HOT 8
- Optimize cog-hub scanline buffer transfer HOT 3
- Random stutter when scrolling HOT 1
- Replace sprite vertical wrapping magic number HOT 1
- Broken JAMMA links in wiki/README HOT 1
- Implement parallax scrolling HOT 6
- Implement full-featured gfx sys demo
- Fix CPU/GPU restart order bug HOT 1
- Implement GPU bank switching
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jcap.