From: <th...@us...> - 2002-11-23 12:13:03
|
Update of /cvsroot/ro-oslib/OSLib/!OsLib/Source/Core/oslib In directory sc8-pr-cvs1:/tmp/cvs-serv11194/Source/Core/oslib Modified Files: OS.swi OSSpriteOp.swi Added Files: BlendTable.swi InverseTable.swi Log Message: Various updates to graphics related calls to reflect changes made in Select, including the addition of BlendTable, InverseTable, ConverPNG and ImageRender and the addition of CMYK sprite support. --- NEW FILE: BlendTable.swi --- TITLE BlendTable; AUTHOR "Tom Hughes, to...@co..., 20 Nov 2002"; NEEDS OS, OSSpriteOp; TYPE BlendTable_GenerateFlags = .Bits; CONST BlendTable_SourceIsPointer = BlendTable_GenerateFlags: 0b1, BlendTable_DestinaionIsPointer = BlendTable_GenerateFlags: 0b10, BlendTable_LockTable = BlendTable_GenerateFlags: 0b100; SWI BlendTable_GenerateTableModeToMode = ( NUMBER 0x56280 "Generate a table of blended palette entries for blending between two modes - RISC O S 4.31+", ENTRY ( R0 = BlendTable_GenerateFlags: flags, R1 = OS_Mode: source_mode, R2 # 0, R3 = OS_Mode: destination_mode, R4 # 0, R5 = .Int: translucency, R6 = .Ref .Data: buffer_in ), EXIT ( R0 = .Int: source_colours, R1 = .Int: destination_colours, R2 = .Int: size, R6 = .Ref .Data: buffer_out ) ), BlendTable_GenerateTableModeToSprite = ( NUMBER 0x56280 "Generate a table of blended palette entries for blending from a mode to a sprite - RISC O S 4.31+", ENTRY ( R0 = BlendTable_GenerateFlags: flags, R1 = OS_Mode: source_mode, R2 # 0, R3 -> OSSpriteOp_Area: destination_area, R4 = OSSpriteOp_Id: destination_id, R5 = .Int: translucency, R6 = .Ref .Data: buffer_in ), EXIT ( R0 = .Int: source_colours, R1 = .Int: destination_colours, R2 = .Int: size, R6 = .Ref .Data: buffer_out ) ), BlendTable_GenerateTableSpriteToMode = ( NUMBER 0x56280 "Generate a table of blended palette entries for blending from a sprite to a mode - RISC O S 4.31+", ENTRY ( R0 = BlendTable_GenerateFlags: flags, R1 -> OSSpriteOp_Area: source_area, R2 = OSSpriteOp_Id: source_id, R3 = OS_Mode: destination_mode, R4 # 0, R5 = .Int: translucency, R6 = .Ref .Data: buffer_in ), EXIT ( R0 = .Int: source_colours, R1 = .Int: destination_colours, R2 = .Int: size, R6 = .Ref .Data: buffer_out ) ), BlendTable_GenerateTableSpriteToSprite = ( NUMBER 0x56280 "Generate a table of blended palette entries for blending between two sprites - RISC O S 4.31+", ENTRY ( R0 = BlendTable_GenerateFlags: flags, R1 -> OSSpriteOp_Area: source_area, R2 = OSSpriteOp_Id: source_id, R3 -> OSSpriteOp_Area: destination_area, R4 = OSSpriteOp_Id: destination_id, R5 = .Int: translucency, R6 = .Ref .Data: buffer_in ), EXIT ( R0 = .Int: source_colours, R1 = .Int: destination_colours, R2 = .Int: size, R6 = .Ref .Data: buffer_out ) ), BlendTable_UnlockTable = ( NUMBER 0x56281 "Unlock a blend table - RISC O S 4.31+", ENTRY ( R0 = .Ref .Data: buffer ) ) --- NEW FILE: InverseTable.swi --- TITLE InverseTable; AUTHOR "Tom Hughes, to...@co..., 21 Nov 2002"; NEEDS OS, OSSpriteOp; TYPE InverseTable_Colour = .Bits; CONST InverseTable_RShift = .Int: 0, InverseTable_GShift = .Int: 5, InverseTable_BShift = .Int: 10, InverseTable_R = InverseTable_Colour: 0b11111, InverseTable_G = InverseTable_Colour: 0b1111100000, InverseTable_B = InverseTable_Colour: 0b111110000000000; SWI InverseTable_CalculateTable = ( NUMBER 0x4BF40 "Calculates inverse tables for the current destination - RISC O S 4.32+", EXIT ( R0 = .Ref InverseTable_Colour: gcol_to_colour, R1 = .Ref OS_GCOL: colour_to_gcol ) ), InverseTable_SpriteTableForSprite = ( NUMBER 0x4BF41 "Calculates inverse tables for the given sprite - RISC O S 4.32+", ENTRY ( R0 = .Ref InverseTable_Colour: gcol_to_colour_in, R1 = .Ref OS_GCOL: colour_to_gcol_in, R2 = OSSpriteOp_Area: area, R3 = OSSpriteOp_Id: id ), EXIT ( R0 = .Ref InverseTable_Colour: gcol_to_colour_out, R1 = .Ref OS_GCOL: colour_to_gcol_out ) ), InverseTable_SpriteTableForMode = ( NUMBER 0x4BF41 "Calculates inverse tables for the given mode - RISC O S 4.32+", ENTRY ( R0 = .Ref InverseTable_Colour: gcol_to_colour_in, R1 = .Ref OS_GCOL: colour_to_gcol_in, R2 = OS_Mode: mode, R3 # 0 ), EXIT ( R0 = .Ref InverseTable_Colour: gcol_to_colour_out, R1 = .Ref OS_GCOL: colour_to_gcol_out ) ) Index: OS.swi =================================================================== RCS file: /cvsroot/ro-oslib/OSLib/!OsLib/Source/Core/oslib/OS.swi,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** OS.swi 20 Nov 2002 19:07:50 -0000 1.6 --- OS.swi 23 Nov 2002 12:12:59 -0000 1.7 *************** *** 237,248 **** TYPE OS_ModeFlags = .Bits; CONST ! OS_ModeFlagNonGraphics = OS_ModeFlags: %1, ! OS_ModeFlagTeletext = OS_ModeFlags: %10, ! OS_ModeFlagGap = OS_ModeFlags: %100, ! OS_ModeFlagBBCGap = OS_ModeFlags: %1000, ! OS_ModeFlagHiResMono = OS_ModeFlags: %10000, ! OS_ModeFlagDoubleHeight = OS_ModeFlags: %100000, ! OS_ModeFlagHardwareScroll = OS_ModeFlags: %1000000, ! OS_ModeFlagFullPalette = OS_ModeFlags: %10000000; TYPE OS_VDUVar = OS_ModeVar; --- 237,252 ---- TYPE OS_ModeFlags = .Bits; CONST ! OS_ModeFlagNonGraphics = OS_ModeFlags: %1, ! OS_ModeFlagTeletext = OS_ModeFlags: %10, ! OS_ModeFlagGap = OS_ModeFlags: %100, ! OS_ModeFlagBBCGap = OS_ModeFlags: %1000, ! OS_ModeFlagHiResMono = OS_ModeFlags: %10000, ! OS_ModeFlagDoubleHeight = OS_ModeFlags: %100000, ! OS_ModeFlagHardwareScroll = OS_ModeFlags: %1000000, ! OS_ModeFlagFullPalette = OS_ModeFlags: %10000000, ! OS_ModeFlagDataFormat = OS_ModeFlags: %1111000000000000 "RISC O S 4.32+", ! OS_ModeFlagDataFormatShift = .Int: 12 "RISC O S 4.32+", ! OS_ModeFlagDataFormatRGB = OS_ModeFlags: 0 "RISC O S 4.32+", ! OS_ModeFlagDataFormatCMYK = OS_ModeFlags: 1 "RISC O S 4.32+"; TYPE OS_VDUVar = OS_ModeVar; Index: OSSpriteOp.swi =================================================================== RCS file: /cvsroot/ro-oslib/OSLib/!OsLib/Source/Core/oslib/OSSpriteOp.swi,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** OSSpriteOp.swi 28 Aug 2002 13:53:22 -0000 1.2 --- OSSpriteOp.swi 23 Nov 2002 12:12:59 -0000 1.3 *************** *** 10,13 **** --- 10,19 ---- OSSpriteOp_TransTab = .Struct (.Byte: c ...), + OSSpriteOp_ColourMapping = + .Struct + ( .Ref .Data: workspace, + .Ref .Asm: function + ), + OSSpriteOp_Area = .Struct *************** *** 95,107 **** Error_SpriteOpBadTransformation = .Bits: &715, Error_SpriteOpBadDepth = .Bits: &716, ! Error_SpriteOpBadSwitchDepth = .Bits: &717; TYPE OSSpriteOp_Action = OS_Action; CONST //for PutSpriteScaled, PutSpriteTrfm (R5) ! OSSpriteOp_UseMask = OSSpriteOp_Action: 0b1000, ! OSSpriteOp_UsePalette = OSSpriteOp_Action: 0b10000 "RISC OS 3.5+", ! OSSpriteOp_GivenWideEntries = OSSpriteOp_Action: 0b100000 "RISC OS 3.6+", ! OSSpriteOp_Dithered = OSSpriteOp_Action: 0b1000000 "RISC OS 3.6+"; SWI OS_SpriteOp = (NUMBER 0x2E "Controls the sprite system - --- 101,120 ---- Error_SpriteOpBadTransformation = .Bits: &715, Error_SpriteOpBadDepth = .Bits: &716, ! Error_SpriteOpBadSwitchDepth = .Bits: &717, ! Error_SpriteOpBadColourMap = .Bits: &720, ! Error_SpriteOpBadJPEGUnsupported = .Bits: &721, ! Error_SpriteOpBadJPEGProgressive = .Bits: &722, ! Error_SpriteOpBadType = .Bits: &723; TYPE OSSpriteOp_Action = OS_Action; CONST //for PutSpriteScaled, PutSpriteTrfm (R5) ! OSSpriteOp_UseMask = OSSpriteOp_Action: 0x8, ! OSSpriteOp_UsePalette = OSSpriteOp_Action: 0x10 "RISC O S 3.5+", ! OSSpriteOp_GivenWideEntries = OSSpriteOp_Action: 0x20 "RISC O S 3.6+", ! OSSpriteOp_Dithered = OSSpriteOp_Action: 0x40 "RISC O S 3.6+", ! OSSpriteOp_GivenColourMapping = OSSpriteOp_Action: 0x80 "RISC O S 4+", ! OSSpriteOp_Translucency = OSSpriteOp_Action: 0xff00 "RISC O S 4+", ! OSSpriteOp_TranslucencyShift = .Int: 8 "RISC O S 4+"; SWI OS_SpriteOp = (NUMBER 0x2E "Controls the sprite system - *************** *** 579,584 **** ) ), ! OSSpriteOp_PutSpriteGreyScaled = (NUMBER 0x2E, ENTRY (R0 # 53 "Puts ! sprite scaled and anti-aliased - not RISC O S 3.5+", R0 | OSSpriteOp_Flags: flags, R1 -> OSSpriteOp_Area: area, --- 592,614 ---- ) ), ! OSSpriteOp_PutSpriteScaledMapped = ! ( NUMBER 0x2E, ! ENTRY ! ( R0 # 52 "Puts sprite scaled with colour mapping - RISC O S 4+", ! R0 | OSSpriteOp_Flags: flags, ! R1 -> OSSpriteOp_Area: area, ! R2 = OSSpriteOp_Id: id, ! R3 = .Int: x, ! R4 = .Int: y, ! R5 # OSSpriteOp_GivenColourMapping, ! R5 | OSSpriteOp_Action: action, ! R6 -> OS_Factors: factors, ! R7 -> OSSpriteOp_ColourMapping: mapping ! ) ), ! ! OSSpriteOp_PutSpriteGreyScaled = ! ( NUMBER 0x2E, ! ENTRY ! ( R0 # 53 "Puts sprite scaled and anti-aliased - not RISC O S 3.5+", R0 | OSSpriteOp_Flags: flags, R1 -> OSSpriteOp_Area: area, *************** *** 588,592 **** R5 # 0, R6 -> OS_Factors: factors, ! R7 -> OSSpriteOp_TransTab: trans_tab)), OSSpriteOp_RemoveLeftHandWastage = --- 618,623 ---- R5 # 0, R6 -> OS_Factors: factors, ! R7 -> OSSpriteOp_TransTab: trans_tab ! ) ), OSSpriteOp_RemoveLeftHandWastage = *************** *** 629,632 **** --- 660,678 ---- R6 -> OS_Trfm: trfm, R7 -> OSSpriteOp_TransTab: trans_tab + ) ), + + OSSpriteOp_PutSpriteTrfmMapped = + ( NUMBER 0x2E, + ENTRY + ( R0 # 56 "Puts sprite transformed with colour mapping - RISC O S 4+", + R0 | OSSpriteOp_Flags: flags, + R1 -> OSSpriteOp_Area: area, + R2 = OSSpriteOp_Id: id, + R3 = OSSpriteOp_TrfmFlags: trfm_flags, + R4 -> OS_Box: source_rect, + R5 # OSSpriteOp_GivenColourMapping, + R5 | OSSpriteOp_Action: action, + R6 -> OS_Trfm: trfm, + R7 -> OSSpriteOp_ColourMapping: mapping ) ), |