MCPcopy Create free account
hub / github.com/AppleWin/AppleWin / NTSC_VideoInit

Function NTSC_VideoInit

source/NTSC.cpp:2341–2424  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2339}
2340
2341void NTSC_VideoInit( uint8_t* pFramebuffer ) // wsVideoInit
2342{
2343 make_csbits();
2344 GenerateVideoTables();
2345 initPixelDoubleMasks();
2346 initChromaPhaseTables();
2347 updateMonochromeTables( 0xFF, 0xFF, 0xFF );
2348
2349 g_kFrameBufferWidth = GetVideo().GetFrameBufferWidth();
2350
2351 for (int y = 0; y < (VIDEO_SCANNER_Y_DISPLAY_IIGS*2); y++)
2352 {
2353 uint32_t offset = sizeof(bgra_t) * GetVideo().GetFrameBufferWidth()
2354 * ((GetVideo().GetFrameBufferHeight() - 1) - y - GetVideo().GetFrameBufferBorderHeight())
2355 + (sizeof(bgra_t) * GetVideo().GetFrameBufferBorderWidth());
2356 g_pScanLines[y] = (bgra_t*) (GetVideo().GetFrameBuffer() + offset);
2357 }
2358
2359 g_pVideoAddress = g_pScanLines[0];
2360
2361 g_pFuncUpdateTextScreen = updateScreenText40;
2362 g_pFuncUpdateGraphicsScreen = updateScreenText40;
2363
2364 GetVideo().VideoReinitialize(true); // Setup g_pFunc_ntsc*Pixel()
2365
2366 bgra_t baseColors[kNumBaseColors];
2367 GenerateBaseColors(&baseColors);
2368 VideoInitializeOriginal(&baseColors);
2369
2370#if HGR_TEST_PATTERN
2371// Init HGR to almost all-possible-combinations
2372// CALL-151
2373// C050 C053 C057
2374 unsigned char b = 0;
2375 unsigned char *main, *aux;
2376 uint16_t ad;
2377
2378 for( unsigned page = 0; page < 2; page++ )
2379 {
2380// for( unsigned w = 0; w < 2; w++ ) // 16 cols
2381 {
2382 for( unsigned z = 0; z < 2; z++ ) // 8 cols
2383 {
2384 b = 0; // 4 columns * 64 rows
2385 for( unsigned x = 0; x < 4; x++ ) // 4 cols
2386 {
2387 for( unsigned y = 0; y < 64; y++ ) // 1 col
2388 {
2389 unsigned y2 = y*2;
2390 ad = 0x2000 + (y2&7)*0x400 + ((y2/8)&7)*0x80 + (y2/64)*0x28 + 2*x + 10*z; // + 20*w;
2391 ad += 0x2000*page;
2392 main = MemGetMainPtr(ad);
2393 aux = MemGetAuxPtr (ad);
2394 main[0] = b; main[1] = z + page*0x80;
2395 aux [0] = z; aux [1] = 0;
2396
2397 if( page == 1 )
2398 {

Callers 1

InitializeMethod · 0.85

Calls 15

make_csbitsFunction · 0.85
GenerateVideoTablesFunction · 0.85
initPixelDoubleMasksFunction · 0.85
initChromaPhaseTablesFunction · 0.85
updateMonochromeTablesFunction · 0.85
GenerateBaseColorsFunction · 0.85
VideoInitializeOriginalFunction · 0.85
MemGetMainPtrFunction · 0.85
MemGetAuxPtrFunction · 0.85
GetFrameBufferWidthMethod · 0.80
GetFrameBufferHeightMethod · 0.80

Tested by

no test coverage detected