gauauu Posted April 18, 2018 Share Posted April 18, 2018 I have a project I'm working on where most of the game uses the bB DPC+ kernel. But for some other parts (menus, etc), I want to do some custom things that I'd need to implement my own kernel from scratch. What all needs to be done in my main loop to let me break out cleanly and run my own kernel code? I assume the "drawscreen" bb command waits until the vblank timer is done, jumps into a kernel loop, then sets a new timer. Can I just hijack that, and instead of calling drawscreen, jump to my own loop where I wait for the timer, run my own kernel, then set a new timer? Are there additional considerations that I need to keep in mind being DPC+? Quote Link to comment Share on other sites More sharing options...
+Karl G Posted April 19, 2018 Share Posted April 19, 2018 Someone else can probably answer in better detail, but I was thinking that the Titlescreen Kernel would be a good example of this. One calls it from a loop, with "gosub titledrawscreen" replacing the usual bB drawscreen command, so the bB display kernel is never run while it is active. 1 Quote Link to comment Share on other sites More sharing options...
gauauu Posted April 19, 2018 Author Share Posted April 19, 2018 Yeah. I figure if nobody responds I can just look at the generated assembly of doing what you're talking about. But if somebody knows the details (particularly the interaction with the DPC+ data fetchers/etc) it'd be easier than digging through code. Quote Link to comment Share on other sites More sharing options...
RevEng Posted April 19, 2018 Share Posted April 19, 2018 It's pretty much as you thought. Just wait for overscan to end, run your own vsync, set+wait for vblank, run your kernel, then set the timer for overscan as bB expects it, and return to the bB code. No messing with fetchers or any other ARM hand-holding. As kdgarris advises, the Titlescreen Kernel would be a good place to start. Otherwise, study how bB sets the overscan and vblank timers, and copy it. bB sets them a bit differently than most homebrews. 1 Quote Link to comment Share on other sites More sharing options...
gauauu Posted April 19, 2018 Author Share Posted April 19, 2018 Cool, thanks. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.