Click here to Skip to main content
15,886,919 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: WSO CCC OTD 2023-07-11 - we have a winner Pin
pkfox10-Jul-23 22:00
professionalpkfox10-Jul-23 22:00 
GeneralRe: WSO CCC OTD 2023-07-11 - we have a winner Pin
OriginalGriff10-Jul-23 22:08
mveOriginalGriff10-Jul-23 22:08 
GeneralRe: WSO CCC OTD 2023-07-11 Pin
MarkTJohnson11-Jul-23 3:45
professionalMarkTJohnson11-Jul-23 3:45 
GeneralRe: WSO CCC OTD 2023-07-11 Pin
FreedMalloc11-Jul-23 4:36
FreedMalloc11-Jul-23 4:36 
General#facts Pin
honey the codewitch10-Jul-23 21:27
mvahoney the codewitch10-Jul-23 21:27 
GeneralRe: #facts Pin
RickZeeland10-Jul-23 23:35
mveRickZeeland10-Jul-23 23:35 
GeneralRe: #facts Pin
Gary R. Wheeler15-Jul-23 3:10
Gary R. Wheeler15-Jul-23 3:10 
GeneralRacing the electron beam once more Pin
CodeWraith10-Jul-23 17:02
CodeWraith10-Jul-23 17:02 
I need a break. Time to go back when things were simple (or at least appeared to be so) and do something just for fun. Like writing a little game for my old box. A little 8 bit processor, 4k RAM, a weird little graphics chip and the assembler is all you need.

But wait, this is tech from 1976! A graphics chip? Yep, we are racing the electron beam again. But they did that in such a clever way that a kid could get it to work. It involved interrupts and DMA and all code that had to stay in sync with the electron beam was contained in that less than 32 instructions long interrupt routine.

However, that simplicity still does not come without a price. The graphics chip issues 1024 x 60 DMA requests every second and also calls the interrupt routine 60 times a second as well. Whatever is going on in that interrupt routine adds up very quickly to take away a good percentage of the instructions the processor can 'waste' on such luxuries as executing its program every second.

Just how much, exactly? Those interrupt routines come in two flavors and we get two very different values. After all these years I have now taken the time to actually do the math:

The worst case are those interrupt routines that manipulate the DMA pointer to repeat every raster line two or more times. To do that, you have to stay in the interrupt routine for the entire duration of the frame, leaving only the vertical blank period for program execution. Just as bad as racing the beam always was. At least you had a more useful vertical resolution this way and required a significantly smaller graphics buffer. Still, this left you with only 33.64% of the CPU time for your program. Ouch.

The better option was not to race the beam at all. The interrupt routine merely reset the DMA pointer to the beginning of your graphics buffer for every frame and did not hang around any longer to repeat any scan lines. That left you with a weird resolution of 64 x 128 pixels and required a graphics buffer of 1024 bytes, but also left 71.63% of the CPU time for the actual program.

So, which option would you choose? Memory is not as much of an issue as it used to be, but I think I can live with a weird resolution and take the performance gain. By the way, the same old processor, unrestricted by the old graphics chip, gives me more than 12 times the instructions per second compared to that worst case I have been using for 45 years now. And I have not even really tried to overclock it yet.
I have lived with several Zen masters - all of them were cats.

His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.

GeneralRe: Racing the electron beam once more Pin
honey the codewitch10-Jul-23 21:27
mvahoney the codewitch10-Jul-23 21:27 
GeneralRe: Racing the electron beam once more Pin
CodeWraith11-Jul-23 0:00
CodeWraith11-Jul-23 0:00 
GeneralRe: Racing the electron beam once more Pin
honey the codewitch11-Jul-23 0:07
mvahoney the codewitch11-Jul-23 0:07 
GeneralRe: Racing the electron beam once more Pin
CodeWraith11-Jul-23 0:51
CodeWraith11-Jul-23 0:51 
GeneralRe: Racing the electron beam once more Pin
honey the codewitch11-Jul-23 1:44
mvahoney the codewitch11-Jul-23 1:44 
GeneralRe: Racing the electron beam once more Pin
CodeWraith11-Jul-23 3:38
CodeWraith11-Jul-23 3:38 
GeneralRe: Racing the electron beam once more Pin
honey the codewitch11-Jul-23 4:13
mvahoney the codewitch11-Jul-23 4:13 
GeneralRe: Racing the electron beam once more Pin
CodeWraith11-Jul-23 6:05
CodeWraith11-Jul-23 6:05 
GeneralRe: Racing the electron beam once more Pin
honey the codewitch11-Jul-23 6:49
mvahoney the codewitch11-Jul-23 6:49 
GeneralRe: Racing the electron beam once more Pin
jmaida11-Jul-23 9:14
jmaida11-Jul-23 9:14 
GeneralRe: Racing the electron beam once more Pin
Gary Wheeler12-Jul-23 2:08
Gary Wheeler12-Jul-23 2:08 
GeneralRe: Racing the electron beam once more Pin
Gary Wheeler12-Jul-23 2:03
Gary Wheeler12-Jul-23 2:03 
GeneralRe: Racing the electron beam once more Pin
LucidDev12-Jul-23 6:10
LucidDev12-Jul-23 6:10 
GeneralRe: Racing the electron beam once more Pin
honey the codewitch12-Jul-23 6:36
mvahoney the codewitch12-Jul-23 6:36 
GeneralRe: Racing the electron beam once more Pin
LucidDev12-Jul-23 7:42
LucidDev12-Jul-23 7:42 
GeneralRe: Racing the electron beam once more Pin
BernardIE531711-Jul-23 8:38
BernardIE531711-Jul-23 8:38 
GeneralRe: Racing the electron beam once more Pin
CodeWraith12-Jul-23 2:59
CodeWraith12-Jul-23 2:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.