The shoutbox is currently out of service. Join us on Discord instead.

The ultimate extension Module for Gamebuino: The Ninja Board

Started by DarkestEx, June 30, 2015, 05:04:28 pm

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

DarkestEx

Quote from: CKH4 on July 04, 2015, 03:58:37 pm
Could the coprocessor be used for graphics? (Adding a gpu to the game buino :w00t:)

Only for the oled on the ninja board. The coprocessor has no connection to the display on the Gamebuino and can't ever get one (hardware limitations).

CKH4

Oh, do you sync between the coprocessor and the memory? It's possible that you could encode instructions but I guess it might not even be faster than doing all the calculations on the main processor. If the screen is stored in memory then it's possible you could do advanced shape calculations (ie. 3d) on the coprocessor then store the shape over the screen memory. I'm probably just throwing out garbage because I'm not familiar with the game buino but whatever.


DarkestEx

Quote from: CKH4 on July 04, 2015, 04:31:16 pm
Oh, do you sync between the coprocessor and the memory? It's possible that you could encode instructions but I guess it might not even be faster than doing all the calculations on the main processor. If the screen is stored in memory then it's possible you could do advanced shape calculations (ie. 3d) on the coprocessor then store the shape over the screen memory. I'm probably just throwing out garbage because I'm not familiar with the game buino but whatever.

That idea is really interesting!
I would probably need to run a cs pin to the coprocessor, but the I would have access. But I would have problems with race conditions.
On the other side, we have a high-speed connection between the coprocessor and the main cpu. maybe we could use that to do stuff.

CKH4

Maybe we could define the processor order at the beginning of the program so if you wanted the graphics done before the calculations you could define mP-cP or cP-mP to determine the processing order. Also I'll write two programs with fake syntax later to see if I can explain any other ideas with it.


DarkestEx

Quote from: CKH4 on July 04, 2015, 04:51:20 pm
Maybe we could define the processor order at the beginning of the program so if you wanted the graphics done before the calculations you could define mP-cP or cP-mP to determine the processing order. Also I'll write two programs with fake syntax later to see if I can explain any other ideas with it.

Oh, thanks!
Can't wait to see it! :)

CKH4

Heres the code stuff that I made up.

- means a user sub-routine

Code (Graphics Program) Select

// Setup
// No preference for main math or graphics processor
mP()  // sets the main processor to auto
cP()  // sets the co-processor to auto, not necessary if you only want the main processor

// variable loading
x1, x2, x3, x4, y1, y2, y3, y4 = 10, 50, 10, 50, 10, 10, 50, 50

// Main loop
Repeat()  // if empty defaults to quit
// rand(min,max,step size)
x1, x2, x3, x4, y1, y2, y3, y4 = 10+rand(-1,1,2), 50+rand(-1,1,2), 10+rand(-1,1,2), 50+rand(-1,1,2), 10+rand(-1,1,2), 10+rand(-1,1,2), 50+rand(-1,1,2), 50+rand(-1,1,2)
FPolygon(x1, y1, x2, y2, x3, y3, x4, y4)
ScreenUpd()
End  // closes the loop


Code (Mixed Program) Select

// Setup
// No preference for main math or graphics processor
mP(math)  // sets the main processor to math routines
cP(graphics)  // sets the co-processor to processes graphics routines

// variable loading
rotation = 0

// Main loop
Repeat()  // if empty defaults to quit
rotation = rotation + 1
a = sin(rotation/10)  // math handled by the main processor
b = cos(rotation/10)  // math handled by the main processor
Polygon(a,b,a,-b,-a,b,-a,-b)  // graphics handled by the coprocessor
ScreenUpd()
End  // closes the loop


DarkestEx

Quote from: CKH4 on July 04, 2015, 07:50:16 pm
Heres the code stuff that I made up.

- means a user sub-routine

Code (Graphics Program) Select

// Setup
// No preference for main math or graphics processor
mP()  // sets the main processor to auto
cP()  // sets the co-processor to auto, not necessary if you only want the main processor

// variable loading
x1, x2, x3, x4, y1, y2, y3, y4 = 10, 50, 10, 50, 10, 10, 50, 50

// Main loop
Repeat()  // if empty defaults to quit
// rand(min,max,step size)
x1, x2, x3, x4, y1, y2, y3, y4 = 10+rand(-1,1,2), 50+rand(-1,1,2), 10+rand(-1,1,2), 50+rand(-1,1,2), 10+rand(-1,1,2), 10+rand(-1,1,2), 50+rand(-1,1,2), 50+rand(-1,1,2)
FPolygon(x1, y1, x2, y2, x3, y3, x4, y4)
ScreenUpd()
End  // closes the loop


Code (Mixed Program) Select

// Setup
// No preference for main math or graphics processor
mP(math)  // sets the main processor to math routines
cP(graphics)  // sets the co-processor to processes graphics routines

// variable loading
rotation = 0

// Main loop
Repeat()  // if empty defaults to quit
rotation = rotation + 1
a = sin(rotation/10)  // math handled by the main processor
b = cos(rotation/10)  // math handled by the main processor
Polygon(a,b,a,-b,-a,b,-a,-b)  // graphics handled by the coprocessor
ScreenUpd()
End  // closes the loop


Thank you. That looks interesting and I will absolutely look into that.

Powered by EzPortal