Click here to Skip to main content
15,850,359 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 23:00
professionalpkfox10-Jul-23 23:00 
GeneralRe: WSO CCC OTD 2023-07-11 - we have a winner Pin
OriginalGriff10-Jul-23 23:08
mveOriginalGriff10-Jul-23 23:08 
GeneralRe: WSO CCC OTD 2023-07-11 Pin
MarkTJohnson11-Jul-23 4:45
professionalMarkTJohnson11-Jul-23 4:45 
GeneralRe: WSO CCC OTD 2023-07-11 Pin
FreedMalloc11-Jul-23 5:36
FreedMalloc11-Jul-23 5:36 
General#facts Pin
honey the codewitch10-Jul-23 22:27
mvahoney the codewitch10-Jul-23 22:27 
GeneralRe: #facts Pin
RickZeeland11-Jul-23 0:35
mveRickZeeland11-Jul-23 0:35 
GeneralRe: #facts Pin
Gary R. Wheeler15-Jul-23 4:10
Gary R. Wheeler15-Jul-23 4:10 
GeneralRacing the electron beam once more Pin
CodeWraith10-Jul-23 18:02
CodeWraith10-Jul-23 18: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 22:27
mvahoney the codewitch10-Jul-23 22:27 
GeneralRe: Racing the electron beam once more Pin
CodeWraith11-Jul-23 1:00
CodeWraith11-Jul-23 1:00 
GeneralRe: Racing the electron beam once more Pin
honey the codewitch11-Jul-23 1:07
mvahoney the codewitch11-Jul-23 1:07 
GeneralRe: Racing the electron beam once more Pin
CodeWraith11-Jul-23 1:51
CodeWraith11-Jul-23 1:51 
GeneralRe: Racing the electron beam once more Pin
honey the codewitch11-Jul-23 2:44
mvahoney the codewitch11-Jul-23 2:44 
GeneralRe: Racing the electron beam once more Pin
CodeWraith11-Jul-23 4:38
CodeWraith11-Jul-23 4:38 
GeneralRe: Racing the electron beam once more Pin
honey the codewitch11-Jul-23 5:13
mvahoney the codewitch11-Jul-23 5:13 
GeneralRe: Racing the electron beam once more Pin
CodeWraith11-Jul-23 7:05
CodeWraith11-Jul-23 7:05 
GeneralRe: Racing the electron beam once more Pin
honey the codewitch11-Jul-23 7:49
mvahoney the codewitch11-Jul-23 7:49 
GeneralRe: Racing the electron beam once more Pin
jmaida11-Jul-23 10:14
jmaida11-Jul-23 10:14 
GeneralRe: Racing the electron beam once more Pin
Gary Wheeler12-Jul-23 3:08
Gary Wheeler12-Jul-23 3:08 
GeneralRe: Racing the electron beam once more Pin
Gary Wheeler12-Jul-23 3:03
Gary Wheeler12-Jul-23 3:03 
GeneralRe: Racing the electron beam once more Pin
LucidDev12-Jul-23 7:10
LucidDev12-Jul-23 7:10 
GeneralRe: Racing the electron beam once more Pin
honey the codewitch12-Jul-23 7:36
mvahoney the codewitch12-Jul-23 7:36 
GeneralRe: Racing the electron beam once more Pin
LucidDev12-Jul-23 8:42
LucidDev12-Jul-23 8:42 
GeneralRe: Racing the electron beam once more Pin
BernardIE531711-Jul-23 9:38
BernardIE531711-Jul-23 9:38 
GeneralRe: Racing the electron beam once more Pin
CodeWraith12-Jul-23 3:59
CodeWraith12-Jul-23 3: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.