video ***** This module provides access to the entire GBA video hardware: registers, VRAM, PAL RAM and :abbr:`OAM (Object Attribute Memory)`. I/O Registers ============= Display Control --------------- .. autonim:: video.DisplayLayer .. autonim:: video.DisplayLayers .. autonim:: video.DispCnt .. autonim:: private.gba.video.dispcnt .. autonim:: video.allDisplayLayers Display Status -------------- .. autonim:: video.DispStat .. autonim:: private.gba.video.dispstat .. autonim:: private.gba.video.vcount BG Control ------------------ .. autonim:: video.BgSize .. autonim:: video.RegBgSize .. autonim:: video.AffBgSize .. autonim:: video.BgCnt .. autonim:: private.gba.video.bgcnt .. container:: group .. autonim:: video.toBgSize .. autonim:: video.toBgSize_2 BG Scrolling & Transforms ------------------------- .. autonim:: private.types.Point16 .. autonim:: private.types.BgPoint .. autonim:: video.BgOfs .. autonim:: private.gba.video.bgofs .. autonim:: private.gba.video.bgaff Windowing ----------- .. autonim:: video.WinH .. autonim:: video.WinV .. autonim:: video.WindowLayer .. autonim:: video.WinCnt .. autonim:: video.allWindowLayers .. autonim:: private.gba.video.winh .. autonim:: private.gba.video.winv .. autonim:: private.gba.video.win0cnt .. autonim:: private.gba.video.win1cnt .. autonim:: private.gba.video.winoutcnt .. autonim:: private.gba.video.winobjcnt .. autonim:: video.setWindow Mosaic ---------- .. autonim:: private.gba.video.mosaic Blending ---------- .. autonim:: video.BldCnt .. autonim:: video.BlendMode .. autonim:: video.BlendLayer .. autonim:: video.BlendLayers .. autonim:: video.allBlendLayers .. autonim:: video.BlendAlpha .. autonim:: video.BlendBrightness .. autonim:: private.gba.video.bldcnt .. autonim:: private.gba.video.bldalpha .. autonim:: private.gba.video.bldy Colors ====== Types ----- .. autonim:: private.types.Color .. autonim:: private.types.Palette Constructors ------------ .. autonim:: video.rgb5 .. autonim:: video.rgb5safe .. autonim:: video.rgb8 .. autonim:: video.rgb8_2 Color memory ------------ .. autonim:: private.gba.video.bgColorMem .. autonim:: private.gba.video.bgPalMem .. autonim:: private.gba.video.objColorMem .. autonim:: private.gba.video.objPalMem Color Constants --------------- .. container:: group .. autonim:: video.clrBlack .. autonim:: video.clrRed .. autonim:: video.clrLime .. autonim:: video.clrYellow .. autonim:: video.clrBlue .. autonim:: video.clrMagenta .. autonim:: video.clrCyan .. autonim:: video.clrWhite .. autonim:: video.clrDead .. autonim:: video.clrMaroon .. autonim:: video.clrGreen .. autonim:: video.clrOlive .. autonim:: video.clrOrange .. autonim:: video.clrNavy .. autonim:: video.clrPurple .. autonim:: video.clrTeal .. autonim:: video.clrGray .. autonim:: video.clrMedGray .. autonim:: video.clrSilver .. autonim:: video.clrMoneyGreen .. autonim:: video.clrFuchsia .. autonim:: video.clrSkyBlue .. autonim:: video.clrCream Bulk color manipulation ----------------------- These functions are lifted straight from libtonc. They're unsafe as they deal with raw pointers. .. autonim:: video.clrRotate .. autonim:: video.clrBlend .. autonim:: video.clrFade .. autonim:: video.clrGrayscale .. autonim:: video.clrRgbscale .. autonim:: video.clrAdjBrightness .. autonim:: video.clrAdjContrast .. autonim:: video.clrAdjIntensity .. autonim:: video.palGradient .. autonim:: video.palGradient_2 .. autonim:: private.gba.video.clrBlendFast .. autonim:: private.gba.video.clrFadeFast Tiled backgrounds ================= .. autonim:: video.bgIsAffine .. autonim:: video.bgIsAvailable Tile data ------------- .. autonim:: private.types.Tile .. autonim:: private.types.Tile4 .. autonim:: private.types.Tile8 .. autonim:: private.types.Charblock .. autonim:: private.types.Charblock8 .. autonim:: private.types.UnboundedCharblock .. autonim:: private.types.UnboundedCharblock8 .. autonim:: private.gba.video.bgTileMem .. autonim:: private.gba.video.bgTileMem8 .. autonim:: private.gba.video.objTileMem .. autonim:: private.gba.video.objTileMem8 Screen entries -------------- .. autonim:: private.types.ScrEntry .. autonim:: private.types.ScrAffEntry .. autonim:: private.types.Screenline .. autonim:: private.types.ScreenMat .. autonim:: private.types.Screenblock .. autonim:: private.gba.video.seMem Screen entry tile plotting -------------------------- .. autonim:: video.fill .. autonim:: video.plot .. autonim:: video.hline .. autonim:: video.vline .. autonim:: video.rect .. autonim:: video.frame .. autonim:: video.window .. autonim:: video.clearRow .. _bitmapdrawing: Bitmap Drawing ============== To use the bitmap drawing procedures, you have to set the appropriate bitmap mode and enable background layer 2. e.g. .. code-block:: nim dispcnt.init(mode = 3, layers = {lBg2}) # draw a green pixel at x=100, y=100 m3mem.plot(100, 100, clrGreen) .. autonim:: private.gba.video.vidMem .. autonim:: private.gba.video.vidMemFront .. autonim:: private.gba.video.vidMemBack Mode 3 -------------- .. autonim:: private.types.M3Mem .. autonim:: private.gba.video.m3Mem .. autonim:: video.fill_2 .. autonim:: video.plot_2 .. autonim:: video.hline_2 .. autonim:: video.vline_2 .. autonim:: video.line .. autonim:: video.rect_2 .. autonim:: video.frame_2 Mode 4 -------------- .. autonim:: private.types.M4Mem .. autonim:: private.gba.video.m4Mem .. autonim:: private.gba.video.m4MemBack .. autonim:: video.fill_3 .. autonim:: video.plot_3 .. autonim:: video.hline_3 .. autonim:: video.vline_3 .. autonim:: video.line_2 .. autonim:: video.rect_3 .. autonim:: video.frame_3 Mode 5 -------------- .. autonim:: private.types.M5Mem .. autonim:: private.gba.video.m5Mem .. autonim:: private.gba.video.m5MemBack .. autonim:: video.fill_4 .. autonim:: video.plot_4 .. autonim:: video.hline_4 .. autonim:: video.vline_4 .. autonim:: video.line_3 .. autonim:: video.rect_4 .. autonim:: video.frame_4 Objects Attribute Memory ======================== Object Attributes ----------------- .. autonim:: private.types.ObjAttr .. autonim:: private.types.ObjAttrPtr .. autonim:: video.ObjMode .. autonim:: video.ObjFxMode .. autonim:: video.ObjSize .. autonim:: private.gba.video.objMem .. autonim:: private.gba.video.objAffMem .. autonim:: video.initObj .. autonim:: video.init_2 .. autonim:: video.edit_2 .. autonim:: video.dup_2 Obj Helpers ------------ .. autonim:: video.hide .. autonim:: video.unhide .. autonim:: video.getSize .. autonim:: video.getWidth .. autonim:: video.getHeight .. autonim:: video.getSize_2 .. autonim:: video.getWidth_2 .. autonim:: video.getHeight_2 .. _affinematrices: Affine Matrices ================ Types ----------------- .. autonim:: private.types.AffSrc .. autonim:: private.types.AffSrcEx .. autonim:: private.types.AffDst .. autonim:: private.types.AffDstEx .. autonim:: private.types.BgAffineSource .. autonim:: private.types.BgAffineDest .. autonim:: private.types.ObjAffineSource .. autonim:: private.types.ObjAffineDest .. autonim:: private.types.BgAffine .. autonim:: private.types.ObjAffine Obj Transforms -------------- .. autonim:: private.gba.video.init .. autonim:: private.gba.video.setToIdentity .. autonim:: private.gba.video.setToScale .. autonim:: private.gba.video.setToShearX .. autonim:: private.gba.video.setToShearY .. autonim:: private.gba.video.setToRotation .. autonim:: private.gba.video.setToScaleAndRotation .. autonim:: private.gba.video.premul .. autonim:: private.gba.video.postmul .. autonim:: private.gba.video.rotscaleEx .. autonim:: private.gba.video.setToScaleRaw .. autonim:: private.gba.video.setToRotationRaw .. autonim:: private.gba.video.setToShearXRaw .. autonim:: private.gba.video.setToShearYRaw BG Transforms ------------- .. autonim:: video.init_3 .. autonim:: video.setToIdentity .. autonim:: video.setToScale .. autonim:: video.setToShearX .. autonim:: video.setToShearY .. autonim:: video.setToRotation .. autonim:: video.setToScaleAndRotation .. autonim:: video.premul .. autonim:: video.postmul .. autonim:: video.rotscaleEx .. autonim:: video.setToScaleRaw .. autonim:: video.setToRotationRaw .. autonim:: video.setToShearXRaw .. autonim:: video.setToShearYRaw