uze6666 wrote:
It disappeared! Seems Artfox or Jubatian removed it while doing all the optimizations. Was it because it would not work with the way the rendering is done? I'd like it back too fir sure, neatly put in some function.
As far as I can tell, it was initially in there, but commented out. When we both made improvements, the commented out code did not get improved/refactored by either of us (to me it looked like abandoned code) and in Jubatian's linebuffer branch he removed bits and pieces of commented out code (what looked like cruft), and the unused variables that went with it. When I combined part of his linebuffer branch with some other tricks we came up with, I merged the bits that removed those lines because I believed it was abandoned code as well. It's easy enough to put back though, but it will need to be freshened up in order to fit within the new framework.
This commit is the one that removed that chunk of commented out code shown below:
Code: Select all
if(hsyncHelp){
if(prev_scanline!=NULL && elapsedCycles > HSYNC_PERIOD){
for(u8 x=0;x<(elapsedCycles-HSYNC_PERIOD);x++){
prev_scanline[(x*5)+5] = hsync_more_col;
prev_scanline[(x*5)+6] = hsync_more_col;
prev_scanline[(x*5)+7] = hsync_more_col;
prev_scanline[(x*5)+8] = 0;
prev_scanline[(x*5)+9] = 0;
prev_scanline[(x*5)+5+(screen->pitch>>2)] = hsync_more_col;
prev_scanline[(x*5)+6+(screen->pitch>>2)] = hsync_more_col;
prev_scanline[(x*5)+7+(screen->pitch>>2)] = hsync_more_col;
prev_scanline[(x*5)+8+(screen->pitch>>2)] = 0;
prev_scanline[(x*5)+9+(screen->pitch>>2)] = 0;
}
}else if(prev_scanline!=NULL && elapsedCycles < HSYNC_PERIOD){
for(u8 x=0;x<(HSYNC_PERIOD-elapsedCycles);x++){
prev_scanline[(x*5)+5] = hsync_less_col;
prev_scanline[(x*5)+6] = hsync_less_col;
prev_scanline[(x*5)+7] = hsync_less_col;
prev_scanline[(x*5)+8] = 0;
prev_scanline[(x*5)+9] = 0;
prev_scanline[(x*5)+5+(screen->pitch>>2)] = hsync_less_col;
prev_scanline[(x*5)+6+(screen->pitch>>2)] = hsync_less_col;
prev_scanline[(x*5)+7+(screen->pitch>>2)] = hsync_less_col;
prev_scanline[(x*5)+8+(screen->pitch>>2)] = 0;
prev_scanline[(x*5)+9+(screen->pitch>>2)] = 0;
}
}
current_cycle += (elapsedCycles - HSYNC_PERIOD); //to simulate line offsync
}
Is that the thing you're talking about?
But I don't understand what it's trying to do with the HSYNC_PERIOD, nor do I understand why the current code has this in there:
Code: Select all
if (scanline_count == -999 && elapsedCycles >= HSYNC_HALF_PERIOD -10 && elapsedCycles <= HSYNC_HALF_PERIOD + 10)
Uze, could you explain why there is such a big window for the elapsedCycles?
I'm thinking instead of commenting stuff out for debugging, to give it a proper #ifdef that you can set in the Makefile. Then we would know that it's not cruft or abandoned code. For a future change I'm planning on allowing all of the gdb stuff to be excluded from being compiled by setting a compile flag in the Makefile. I made a test build like that and it ran significantly faster without any of the gdb stuff compiled in, because even if it's disabled, it still has multiple conditionals that get hit every simulated clock cycle.