nvidiaconfiguration.java

来自「纯java操作系统jnode,安装简单和操作简单的个人使用的Java操作系统」· Java 代码 · 共 159 行

JAVA
159
字号
/*
 * $Id: NVidiaConfiguration.java,v 1.2 2003/12/21 07:59:15 epr Exp $
 */
package org.jnode.driver.video.nvidia;

import java.awt.image.BufferedImage;
import java.awt.image.ColorModel;
import java.awt.image.DirectColorModel;

import org.jnode.awt.image.JNodeBufferedImage;
import org.jnode.driver.video.FrameBufferConfiguration;
import org.jnode.driver.video.vgahw.DisplayMode;

/**
 * @author Ewout Prangsma (epr@users.sourceforge.net)
 */
public class NVidiaConfiguration extends FrameBufferConfiguration {

	/** Bits/pixel */
	private final int bpp;
	private final NVidiaVgaState vgaState;
	private final DisplayMode mode;
	private final int screen;
	private final int horiz;
	private final int arb0;
	private final int arb1;
	private final int vpll;

	/*
	 * { 0x115, 32, 800,  600,  0,  0, 3,   16, 162571, { 
	 * crt { 127, 99, 99, 131, 106, 26, 114, 240, 0, 96, 0, 0, 0, 0, 0, 0, 89, 13, 87, 144, 0, 87, 115, 227, 255 }, 
	 * att { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 65, 0, 15, 0, 0 }, 
	 * gra { 0, 0, 0, 0, 0, 64, 5, 15, 255 },
	 * seq { 3, 1, 15, 0, 14 }, 
	 * 43  } 
	 */
	public static final NVidiaConfiguration VESA_115 =
		new NVidiaConfiguration(
			32,
			0,
			0,
			3,
			16,
			162571,
			new NVidiaVgaState(
				new int[] { 3, 1, 15, 0, 14 },
				new int[] { 127, 99, 99, 131, 106, 26, 114, 240, 0, 96, 0, 0, 0, 0, 0, 0, 89, 13, 87, 144, 0, 87, 115, 227, 255 },
				new int[] { 0, 0, 0, 0, 0, 64, 5, 15, 255 },
				new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 65, 0, 15, 0, 0 },
				0x2B,
				null),
			new DisplayMode("40000 800 840 968 1056 600 601 605 628"));

	/*{ 0x118, 32, 1024, 768,  0,  0, 3,   17, 95757,  { 
	 * crt { 163, 127, 127, 135, 132, 149, 36, 245, 0, 96, 0, 0, 0, 0, 0, 0, 3, 9, 255, 0, 0, 255, 37, 227, 255    },
	 * att { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 65, 0, 15, 0, 0 }, 
	 * gra { 0, 0, 0, 0, 0, 64, 5, 15, 255 }, 
	 * seq { 3, 1, 15, 0, 14 }, 
	 * 235 } 
	 * 
	 */
	public static final NVidiaConfiguration VESA_118 =
		new NVidiaConfiguration(
			32,
			0,
			0,
			3,
			17,
			95757,
			new NVidiaVgaState(
				new int[] { 3, 1, 15, 0, 14 },
				new int[] { 163, 127, 127, 135, 132, 149, 36, 245, 0, 96, 0, 0, 0, 0, 0, 0, 3, 9, 255, 0, 0, 255, 37, 227, 255 },
				new int[] { 0, 0, 0, 0, 0, 64, 5, 15, 255 },
				new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 65, 0, 15, 0, 0 },
				0xEB,
				null),
			new DisplayMode("65000 1024 1048 1184 1344 768 771 777 806"));

	/**
	 * @param bpp
	 * @param screen
	 * @param horiz
	 */
	private NVidiaConfiguration(int bpp, int screen, int horiz, int arb0, int arb1, int vpll, NVidiaVgaState vgaState, DisplayMode mode) {
		super(mode.getWidth(), mode.getHeight(), createColorModel(bpp));
		this.bpp = bpp;
		this.screen = screen;
		this.horiz = horiz;
		this.arb0 = arb0;
		this.arb1 = arb1;
		this.vpll = vpll;
		this.vgaState = vgaState;
		this.mode = mode;
	}

	/**
	 * @see org.jnode.driver.video.FrameBufferConfiguration#createCompatibleImage(int, int, int)
	 */
	public JNodeBufferedImage createCompatibleImage(int w, int h, int transparency) {
		return new JNodeBufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
	}

	/** Gets the number of bits/pixel for this configuration */
	public int getBitsPerPixel() {
		return bpp;
	}

	/** Gets the vga state for this configuration */
	public NVidiaVgaState getVgaState() {
		return vgaState;
	}

	private static ColorModel createColorModel(int bpp) {
		return new DirectColorModel(bpp, 0xff0000, 0x00ff00, 0x0000ff);
	}

	/**
	 * @return The VPLL register value
	 */
	public final int getVpll() {
		return this.vpll;
	}

	/**
	 * @return The ARBITRATION0 register value
	 */
	public final int getArb0() {
		return this.arb0;
	}

	/**
	 * @return The ARBITRATION1 register value
	 */
	public final int getArb1() {
		return this.arb1;
	}

	/**
	 * @return The HORIZ register value
	 */
	public final int getHoriz() {
		return this.horiz;
	}

	/**
	 * @return The SCREEN register value
	 */
	public final int getScreen() {
		return this.screen;
	}
	
	/**
	 * @return The display mode
	 */
	public final DisplayMode getMode() {
		return this.mode;
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?