Пример #1
0
void CUIWindowItem::PositionSelf()
{
	if( m_pWindow )
	{
		CEGUI::MouseCursor& cursor = CEGUI::MouseCursor::getSingleton();
        CEGUI::Rect screen( CEGUI::System::getSingleton().getRenderer()->getRect());
        CEGUI::Rect tipRect( m_pWindow->getUnclippedPixelRect());
        const CEGUI::Image* mouseImage = cursor.getImage();

        CEGUI::Point mousePos(cursor.getPosition());
        CEGUI::Size mouseSz(0,0);

        if (mouseImage)
        {
            mouseSz = mouseImage->getSize();
        }

        CEGUI::Point tmpPos(mousePos.d_x - tipRect.getWidth() - 5, mousePos.d_y - tipRect.getHeight() - 5);
        tipRect.setPosition(tmpPos);

        // if tooltip would be off the right of the screen,
        // reposition to the other side of the mouse cursor.
        if ( tipRect.d_right < 0 )
        {
            tmpPos.d_x = mousePos.d_x + mouseSz.d_width + 5;
        }

        // if tooltip would be off the bottom of the screen,
        // reposition to the other side of the mouse cursor.
        if ( tipRect.d_bottom < 0 )
        {
            tmpPos.d_y = mousePos.d_y + mouseSz.d_height + 5;
        }

        // set final position of tooltip window.
        m_pWindow->setPosition( CEGUI::Absolute, tmpPos);
	}
}
Пример #2
0
void sys2900_state::sys2900(machine_config &config)
{
	/* basic machine hardware */
	Z80(config, m_maincpu, XTAL(8'000'000) / 2);
	m_maincpu->set_addrmap(AS_PROGRAM, &sys2900_state::mem_map);
	m_maincpu->set_addrmap(AS_IO, &sys2900_state::io_map);

	/* video hardware */
	screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
	screen.set_refresh_hz(50);
	screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */
	screen.set_size(640, 480);
	screen.set_visarea(0, 640-1, 0, 480-1);
	screen.set_screen_update(FUNC(sys2900_state::screen_update_sys2900));
	screen.set_palette("palette");

	PALETTE(config, "palette", palette_device::MONOCHROME);

	Z80CTC(config, "ctc", 0);
	Z80PIO(config, "pio", 0);
	Z80SIO(config, "sio1", 0);
	Z80SIO(config, "sio2", 0);
}
Пример #3
0
std::string
CommandEventHandler::info(std::vector<std::string>& args)
{
  if (args.size() != 1)
    return agentWarnInvalidNumArgs(1);
  if (args[0].compare("id") == 0)
    return id();
  else if (args[0].compare("os") == 0)
    return os();
  else if (args[0].compare("systime") == 0)
    return systime();
  else if (args[0].compare("uptime") == 0)
    return uptime();
  else if (args[0].compare("uptimemillis") == 0)
    return uptimemillis();
  else if (args[0].compare("screen") == 0)
    return screen();
  else if (args[0].compare("memory") == 0)
    return memory();
  else if (args[0].compare("power") == 0)
    return power();
  return agentWarn("Invalid info subcommand.");
}
Пример #4
0
// TODO: Additional machine definition - Master Monty has a different memory layout
void monty_state::monty(machine_config &config)
{
	// Basic machine hardware
	Z80(config, m_maincpu, 3580000);       // Ceramic resonator labeled 3.58MT
	m_maincpu->set_addrmap(AS_PROGRAM, &monty_state::monty_mem);
	m_maincpu->set_addrmap(AS_IO, &monty_state::monty_io);
	m_maincpu->halt_cb().set(FUNC(monty_state::halt_changed));

	// Video hardware
	screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_LCD));
	screen.set_refresh_hz(50);
	screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); // Not accurate
	screen.set_size(50, 32); // Two SED1503s (42x16 pixels) control the top and bottom halves
	screen.set_visarea(0, 50-1, 0, 32-1);
	screen.set_screen_update(FUNC(monty_state::lcd_update));

	/* sound hardware */
	SPEAKER(config, "mono").front_center();
	SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.50);

	// LCD controller interfaces
	SED1520(config, m_sed0).set_screen_update_cb(FUNC(monty_state::screen_update));
}
Пример #5
0
void cswat_state::cswat(machine_config &config)
{
	/* basic machine hardware */
	MC6809E(config, m_maincpu, XTAL(18'432'000)/3/4); // HD68A09EP, 1.5MHz?
	m_maincpu->set_addrmap(AS_PROGRAM, &cswat_state::cswat_map);
	m_maincpu->set_vblank_int("screen", FUNC(cswat_state::irq0_line_assert));
	m_maincpu->set_periodic_int(FUNC(cswat_state::nmi_handler), attotime::from_hz(300)); // ?

	/* video hardware */
	screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
	screen.set_refresh_hz(60);
	screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500));
	screen.set_size(36*8, 28*8);
	screen.set_visarea_full();
	screen.set_palette("palette");
	screen.set_screen_update(FUNC(cswat_state::screen_update_cswat));

	GFXDECODE(config, "gfxdecode", "palette", gfx_cswat);
	PALETTE(config, "palette").set_entries(4*256);

	/* sound hardware */
	// TODO
}
Пример #6
0
ROM_END

/***************************************************************************
    FUNCTION PROTOTYPES
***************************************************************************/

//-------------------------------------------------
//  device_add_mconfig - add device configuration
//-------------------------------------------------

void a2bus_videx160_device::device_add_mconfig(machine_config &config)
{
	screen_device &screen(SCREEN(config, ULTRATERM_SCREEN_NAME, SCREEN_TYPE_RASTER));
	screen.set_raw(CLOCK_LOW, 882, 0, 720, 370, 0, 350);
	screen.set_screen_update(ULTRATERM_MC6845_NAME, FUNC(mc6845_device::screen_update));

	MC6845(config, m_crtc, CLOCK_LOW/9);
	m_crtc->set_screen(ULTRATERM_SCREEN_NAME);
	m_crtc->set_show_border_area(false);
	m_crtc->set_char_width(8);
	m_crtc->set_update_row_callback(FUNC(a2bus_videx160_device::crtc_update_row), this);
	m_crtc->out_vsync_callback().set(FUNC(a2bus_videx160_device::vsync_changed));
}
Пример #7
0
DIR *CommandMenu::screenopendir(char *m_commandDir,int *dirlen,int olddirlen)
{
    char *p;
    DIR *dir;
    
    if(isRootDir)
    {
	for(p=m_commandDir;*p;p++);  // search end of m_commandDir
	sprintf(p,".%d",screen());   // append screen number
	dir = opendir(m_commandDir);
	if (dir == NULL) {
	    m_commandDir[olddirlen] = '\0'; // strip of screen number
	    *dirlen = olddirlen;
	    dir = opendir(m_commandDir);
	}
    }
    else
    {
	*dirlen = olddirlen;
	dir = opendir(m_commandDir);
    }
    return(dir);
}
Пример #8
0
void microterm_state::mt5510(machine_config &config)
{
	Z80(config, m_maincpu, 6_MHz_XTAL);
	m_maincpu->set_addrmap(AS_PROGRAM, &microterm_state::mt5510_mem_map);
	m_maincpu->set_addrmap(AS_IO, &microterm_state::mt5510_io_map);

	scn2681_device &duart(SCN2681(config, "duart", 3.6864_MHz_XTAL));
	duart.irq_cb().set_inputline(m_maincpu, 0);
	duart.outport_cb().set("eeprom1", FUNC(eeprom_serial_93cxx_device::di_write)).bit(6);
	duart.outport_cb().append("eeprom2", FUNC(eeprom_serial_93cxx_device::di_write)).bit(5);
	duart.outport_cb().append("eeprom1", FUNC(eeprom_serial_93cxx_device::cs_write)).bit(4);
	duart.outport_cb().append("eeprom2", FUNC(eeprom_serial_93cxx_device::cs_write)).bit(4);
	duart.outport_cb().append("eeprom1", FUNC(eeprom_serial_93cxx_device::clk_write)).bit(3);
	duart.outport_cb().append("eeprom2", FUNC(eeprom_serial_93cxx_device::clk_write)).bit(3);

	EEPROM_93C46_16BIT(config, "eeprom1").do_callback().set("duart", FUNC(scn2681_device::ip6_w));

	EEPROM_93C46_16BIT(config, "eeprom2").do_callback().set("duart", FUNC(scn2681_device::ip5_w));

	screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
	screen.set_raw(45.8304_MHz_XTAL / 2, 1120, 0, 960, 341, 0, 300); // wild guess at resolution
	screen.set_screen_update(FUNC(microterm_state::mt5510_update));
}
Пример #9
0
/*===========================================================================*/
int main( int argc, char** argv )
{
    kvs::glut::Application app( argc, argv );

    /* Read volume data from the specified data file. If the data file is not
     * specified, tornado volume data is created by using kvs::TornadoVolumeData class.
     */
    kvs::StructuredVolumeObject* object = NULL;
    if ( argc > 1 ) object = new kvs::StructuredVolumeImporter( std::string( argv[1] ) );
    else            object = new kvs::TornadoVolumeData( kvs::Vector3ui( 8, 8, 8 ) );

    if ( !object )
    {
        kvsMessageError( "Cannot create a structured volume object." );
        return false;
    }

    // Create a diamond glyph renderer.
    kvs::DiamondGlyph* glyph = new kvs::DiamondGlyph();
    if ( !glyph )
    {
        kvsMessageError( "Cannot creat an diamond glyph.");
        return false;
    }

    // Set properties.
    const kvs::TransferFunction transfer_function( 256 );
    glyph->setTransferFunction( transfer_function );

    kvs::glut::Screen screen( &app );
    screen.registerObject( object, glyph );
    screen.setGeometry( 0, 0, 512, 512 );
    screen.setTitle( "kvs::DiamondGlyph" );
    screen.show();

    return app.run();
}
Пример #10
0
int main(int argc, char *argv[])
{

    QApplication app(argc, argv);
    QSplashScreen screen(QPixmap(":/images/chargement.png"));
    screen.show();
    app.processEvents();

    //Traduction des boutons
    QString locale = QLocale::system().name().section('_', 0, 0);
    QTranslator translator;
    translator.load(QString("qt_") + locale, QLibraryInfo::location(QLibraryInfo::TranslationsPath));
    app.installTranslator(&translator);
    
    //-----------------------------------------------------
    // Vérification de l'existence d'une autre instance
    //-----------------------------------------------------
    app.setApplicationName("Dadaword");
    QSharedMemory sharedMemory(app.applicationName());
    
    // On vérifie à la création de cette zone mémoire si celle-ci existe
    if(sharedMemory.create(sizeof(int))==false){
        QMessageBox::warning(0, QObject::tr("Programme en cours d'exécution"), QObject::tr("Dadaword est déjà en cours d'exécution.  Veuillez fermer l'instance ouverte avant de le lance à nouveau."));
        //exit(EXIT_SUCCESS);
    }

    DadaWord instance;

    //Création de l'interface utilisateur
    instance.createUI();

    //Affichage
    instance.show();
    screen.finish(&instance);

    return app.exec();
}
Пример #11
0
void pokechmp_state::pokechmp(machine_config &config)
{
	/* basic machine hardware */
	M6502(config, m_maincpu, 4_MHz_XTAL/4);
	m_maincpu->set_addrmap(AS_PROGRAM, &pokechmp_state::pokechmp_map);

	M6502(config, m_audiocpu, 4_MHz_XTAL/4);
	m_audiocpu->set_addrmap(AS_PROGRAM, &pokechmp_state::pokechmp_sound_map);

	/* video hardware */
	screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
	screen.set_refresh_hz(60);
	screen.set_vblank_time(ATTOSECONDS_IN_USEC(0));
	screen.set_size(32*8, 32*8);
	screen.set_visarea(0*8, 32*8-1, 2*8, 30*8-1);
	screen.set_screen_update(FUNC(pokechmp_state::screen_update_pokechmp));
	screen.set_palette(m_palette);
	screen.screen_vblank().set_inputline(m_maincpu, INPUT_LINE_NMI);
	screen.screen_vblank().append(FUNC(pokechmp_state::sound_irq));

	GFXDECODE(config, m_gfxdecode, m_palette, gfx_pokechmp);
	PALETTE(config, m_palette).set_format(palette_device::xBGR_555, 0x400);

	/* sound hardware */
	SPEAKER(config, "mono").front_center();

	GENERIC_LATCH_8(config, m_soundlatch);

	YM2203(config, "ym1", XTAL(4'000'000)/4).add_route(ALL_OUTPUTS, "mono", 0.60);

	YM3812(config, "ym2", XTAL(24'000'000)/16).add_route(ALL_OUTPUTS, "mono", 1.0);

	okim6295_device &oki(OKIM6295(config, "oki", XTAL(24'000'000)/16, okim6295_device::PIN7_LOW));
	oki.add_route(ALL_OUTPUTS, "mono", 0.50); /* sound fx */
	oki.add_route(ALL_OUTPUTS, "mono", 0.50);
	oki.set_addrmap(0, &pokechmp_state::pokechmp_oki_map);
}
Пример #12
0
    void Tooltip::positionSelf(void)
    {
        MouseCursor& cursor = MouseCursor::getSingleton();
        Rect screen(Vector2(0, 0), System::getSingleton().getRenderer()->getDisplaySize());
        Rect tipRect(getUnclippedOuterRect());
        const Image* mouseImage = cursor.getImage();

        Point mousePos(cursor.getPosition());
        Size mouseSz(0,0);

        if (mouseImage)
        {
            mouseSz = mouseImage->getSize();
        }

        Point tmpPos(mousePos.d_x + mouseSz.d_width, mousePos.d_y + mouseSz.d_height);
        tipRect.setPosition(tmpPos);

        // if tooltip would be off the right of the screen,
        // reposition to the other side of the mouse cursor.
        if (screen.d_right < tipRect.d_right)
        {
            tmpPos.d_x = mousePos.d_x - tipRect.getWidth() - 5;
        }

        // if tooltip would be off the bottom of the screen,
        // reposition to the other side of the mouse cursor.
        if (screen.d_bottom < tipRect.d_bottom)
        {
            tmpPos.d_y = mousePos.d_y - tipRect.getHeight() - 5;
        }

        // set final position of tooltip window.
        setPosition(
            UVector2(cegui_absdim(tmpPos.d_x),
                     cegui_absdim(tmpPos.d_y)));
    }
Пример #13
0
void calorie_state::calorie(machine_config &config)
{
	/* basic machine hardware */
	Z80(config, m_maincpu, 4000000);         /* 4 MHz */
	m_maincpu->set_addrmap(AS_PROGRAM, &calorie_state::calorie_map);
	m_maincpu->set_addrmap(AS_OPCODES, &calorie_state::decrypted_opcodes_map);
	m_maincpu->set_vblank_int("screen", FUNC(calorie_state::irq0_line_hold));

	z80_device &audiocpu(Z80(config, "audiocpu", 3000000));        /* 3 MHz */
	audiocpu.set_addrmap(AS_PROGRAM, &calorie_state::calorie_sound_map);
	audiocpu.set_addrmap(AS_IO, &calorie_state::calorie_sound_io_map);
	audiocpu.set_periodic_int(FUNC(calorie_state::irq0_line_hold), attotime::from_hz(64));


	/* video hardware */
	screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
	screen.set_refresh_hz(60);
	screen.set_vblank_time(ATTOSECONDS_IN_USEC(0));
	screen.set_size(256, 256);
	screen.set_visarea(0, 256-1, 16, 256-16-1);
	screen.set_screen_update(FUNC(calorie_state::screen_update_calorie));
	screen.set_palette(m_palette);

	GFXDECODE(config, m_gfxdecode, m_palette, gfx_calorie);
	PALETTE(config, m_palette).set_format(palette_device::xBGR_444, 0x100);

	/* sound hardware */
	SPEAKER(config, "mono").front_center();

	GENERIC_LATCH_8(config, m_soundlatch);

	YM2149(config, "ay1", 1500000).add_route(ALL_OUTPUTS, "mono", 0.8);

	YM2149(config, "ay2", 1500000).add_route(ALL_OUTPUTS, "mono", 0.8);

	YM2149(config, "ay3", 1500000).add_route(ALL_OUTPUTS, "mono", 0.8);
}
Пример #14
0
void ParameterWindow::_constrainToScreen() {
    D_INTERNAL(("ParameterWindow::_constrainToScreen()\n"));

    BScreen screen(this);
    BRect screenRect = screen.Frame();
    BRect windowRect = Frame();

    // if the window is outside the screen rect
    // move it to the default position
    if (!screenRect.Intersects(windowRect)) {
        windowRect.OffsetTo(screenRect.LeftTop());
        MoveTo(windowRect.LeftTop());
        windowRect = Frame();
    }

    // if the window is larger than the screen rect
    // resize it to fit at each side
    if (!screenRect.Contains(windowRect)) {
        if (windowRect.left < screenRect.left) {
            windowRect.left = screenRect.left + 5.0;
            MoveTo(windowRect.LeftTop());
            windowRect = Frame();
        }
        if (windowRect.top < screenRect.top) {
            windowRect.top = screenRect.top + 5.0;
            MoveTo(windowRect.LeftTop());
            windowRect = Frame();
        }
        if (windowRect.right > screenRect.right) {
            windowRect.right = screenRect.right - 5.0;
        }
        if (windowRect.bottom > screenRect.bottom) {
            windowRect.bottom = screenRect.bottom - 5.0;
        }
        ResizeTo(windowRect.Width(), windowRect.Height());
    }
}
Пример #15
0
void
PreviewView::Update(const BRect* rect, BBitmap* bitmap)
{
	if (Window() == NULL || Window()->IsHidden())
		return;

	if (rect != NULL)
		_SetRect(*rect);

	bigtime_t now = system_time();
	if (bitmap == NULL) {
		// Avoid updating preview too often
		if (fTimeStamp + 50000 >= now)
			return;
		BScreen screen(Window());
		screen.GetBitmap(&bitmap, false, &fCoordRect);
	}
	if (bitmap != NULL) {
		BRect destRect;
		BRect bitmapBounds = bitmap->Bounds();
		BRect viewBounds = fBitmapView->Bounds();
		if (BRectRatio(viewBounds) >= BRectRatio(bitmapBounds)) {
			float overlap = BRectHorizontalOverlap(viewBounds, bitmapBounds);
			destRect.Set(-overlap, 0, viewBounds.Width() + overlap,
						viewBounds.Height());
		} else {
			float overlap = BRectVerticalOverlap(viewBounds, bitmapBounds);
			destRect.Set(0, -overlap, viewBounds.Width(), viewBounds.Height() + overlap);
		}
		fTimeStamp = now;
		fBitmapView->SetViewBitmap(bitmap,
			bitmap->Bounds().OffsetToCopy(B_ORIGIN),
			destRect,
			B_FOLLOW_TOP|B_FOLLOW_LEFT, B_FILTER_BITMAP_BILINEAR);
		Invalidate();
	}
}
Пример #16
0
PersonWindow*
TPeopleApp::_NewWindow(const entry_ref* ref, BFile* file)
{
	BRawContact* rawContact;
	if (file == NULL)
		rawContact = new BRawContact(B_CONTACT_FORMAT);
	else
		rawContact = new BRawContact(B_CONTACT_ANY, file);

	BContact* contact = new BContact(rawContact);

	if (contact->InitCheck() != B_OK) {
		BAlert *alert = new BAlert("Alert",
			B_TRANSLATE("Contact initialization failed!."),"OK");
		alert->Go();
		return NULL;
	}

	PersonWindow* window = new PersonWindow(fPosition,
		B_TRANSLATE("New contact"), ref, file, contact);

	window->Show();
	window->Activate(true);

	fWindowCount++;

	// Offset the position for the next window which will be opened and
	// reset it if it would open outside the screen bounds.
	fPosition.OffsetBy(20, 20);
	BScreen screen(window);
	if (fPosition.bottom > screen.Frame().bottom)
		fPosition.OffsetTo(fPosition.left, TITLE_BAR_HEIGHT);
	if (fPosition.right > screen.Frame().right)
		fPosition.OffsetTo(6, fPosition.top);

	return window;
}
Пример #17
0
void dim68k_state::dim68k(machine_config &config)
{
	/* basic machine hardware */
	M68000(config, m_maincpu, XTAL(10'000'000));
	m_maincpu->set_addrmap(AS_PROGRAM, &dim68k_state::dim68k_mem);

	/* video hardware */
	screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
	screen.set_refresh_hz(50);
	screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */
	screen.set_screen_update("crtc", FUNC(mc6845_device::screen_update));
	screen.set_size(640, 480);
	screen.set_visarea(0, 640-1, 0, 250-1);
	PALETTE(config, m_palette, palette_device::MONOCHROME);
	GFXDECODE(config, "gfxdecode", m_palette, gfx_dim68k);

	/* sound hardware */
	SPEAKER(config, "mono").front_center();
	SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.50);

	/* Devices */
	UPD765A(config, "fdc", 8'000'000, true, true); // these options unknown
	FLOPPY_CONNECTOR(config, "fdc:0", dim68k_floppies, "525hd", floppy_image_device::default_floppy_formats);
	FLOPPY_CONNECTOR(config, "fdc:1", dim68k_floppies, "525hd", floppy_image_device::default_floppy_formats);

	MC6845(config, m_crtc, 1790000);
	m_crtc->set_screen("screen");
	m_crtc->set_show_border_area(false);
	m_crtc->set_char_width(8);
	m_crtc->set_update_row_callback(FUNC(dim68k_state::crtc_update_row), this);

	generic_keyboard_device &keyboard(GENERIC_KEYBOARD(config, "keyboard", 0));
	keyboard.set_keyboard_callback(FUNC(dim68k_state::kbd_put));

	// software lists
	SOFTWARE_LIST(config, "flop_list").set_original("dim68k");
}
Пример #18
0
bool PointRenderer::Hits(const RenderState &inState)
{
    UserPoint screen(inState.mClipRect.x, inState.mClipRect.y);

    Extent2DF extent;
    CachedExtentRenderer::GetExtent(inState.mTransform,extent);
    if (!extent.Contains(screen))
        return false;

    UserPoint hit_test = inState.mTransform.mMatrix->ApplyInverse(screen);
    if (inState.mTransform.mScale9->Active())
    {
        hit_test.x = inState.mTransform.mScale9->InvTransX(hit_test.x);
        hit_test.y = inState.mTransform.mScale9->InvTransY(hit_test.y);
    }

    for(int i=0; i<mTransformed.size(); i++)
    {
        const UserPoint &point = mTransformed[i];
        if ( fabs(point.x-screen.x) < 1 && fabs(point.y-screen.y) < 1 )
            return true;
    }
    return false;
}
Пример #19
0
int main()
{
    strstream str;
    AFileIOStream screen(&cout), file(&str, &str);
    MyObject obj0, obj1;

    obj0.setCount(5);
    obj0.setName("This is my name");

//  obj0.debugDump(cerr, 0x0);
//  obj1.debugDump(cerr, 0x0);

    file << obj0;
    file >> obj1;

    if (obj0.compare(obj1))
    {
        cerr << "\r\nUnequal after serialization\r\n" << endl;
    }

    for (int iT = 0x0; iT < 512; ++iT)
    {
        obj1.setCount(iT);
        file << obj1;
        file >> obj0;
//    obj0.debugDump(cerr, 0x0);
//    obj1.debugDump(cerr, 0x0);
        if (obj0.compare(obj1))
        {
            cerr << "\r\nComparisson failed\r\n" << endl;
        }
    }


    return 0x0;
}
Пример #20
0
int main(void) {
//Initialisation
	consoleDemoInit();
	screen();
//Programme
	while(1){
		touchPosition touchXY;
		touchRead(&touchXY);
		if((touchXY.px==0x00)&&(touchXY.py==0x00)){
			menu();
		}
		if((touchXY.px>0x50)&&(touchXY.py>0x24)&&(touchXY.px<0xA6)&&(touchXY.py<0x45)){
			clear();
			touch();
			clear();
		}
		if((touchXY.px>0x50)&&(touchXY.py>0x5B)&&(touchXY.px<0xA6)&&(touchXY.py<0x7D)){
			clear();
			input();
			clear();
		}
	}
	return 0;
}
Пример #21
0
GFXDECODE_END

void hitpoker_state::hitpoker(machine_config &config)
{
	MC68HC11(config, m_maincpu, 1000000);
	m_maincpu->set_addrmap(AS_PROGRAM, &hitpoker_state::hitpoker_map);
	m_maincpu->set_addrmap(AS_IO, &hitpoker_state::hitpoker_io);
	m_maincpu->set_config(0, 0x100, 0x01);

	NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);

	/* video hardware */
	screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
	screen.set_refresh_hz(60);
	screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); // not accurate
	screen.set_size(648, 480); //setted by the CRTC
	screen.set_visarea(0, 648-1, 0, 240-1);
	screen.set_screen_update(FUNC(hitpoker_state::screen_update_hitpoker));
	screen.set_palette(m_palette);

	h46505_device &crtc(H46505(config, "crtc", CRTC_CLOCK/2));  /* hand tuned to get ~60 fps */
	crtc.set_screen("screen");
	crtc.set_show_border_area(false);
	crtc.set_char_width(8);
	crtc.out_vsync_callback().set(FUNC(hitpoker_state::hitpoker_irq));

	GFXDECODE(config, m_gfxdecode, m_palette, gfx_hitpoker);
	PALETTE(config, m_palette).set_entries(0x800);

	SPEAKER(config, "mono").front_center();

	ym2149_device &aysnd(YM2149(config, "aysnd", 1500000));
	aysnd.port_a_read_callback().set_ioport("DSW1");
	aysnd.port_b_read_callback().set_ioport("DSW2");
	aysnd.add_route(ALL_OUTPUTS, "mono", 0.50);
}
Пример #22
0
EXPORT	int g_read_state_type_from_string(
	const char *stype)
{
	if (strcmp(stype,"GAS_STATE") == 0)
	    return GAS_STATE;
	if (strcmp(stype,"EGAS_STATE") == 0)
	    return EGAS_STATE;
	if (strcmp(stype,"TGAS_STATE") == 0)
	    return TGAS_STATE;
	if (strcmp(stype,"FGAS_STATE") == 0)
	    return FGAS_STATE;
	if (strcmp(stype,"VGAS_STATE") == 0)
	    return VGAS_STATE;
#if defined(COMBUSTION_CODE)
	if (strcmp(stype,"ZGAS_STATE") == 0)
	    return ZGAS_STATE;
	if (strcmp(stype,"CGAS_STATE") == 0)
	    return CGAS_STATE;
#endif /* defined(COMBUSTION_CODE) */
	screen("ERROR in read_state_type_from_string(), "
	       "unknown state type = %s\n",stype);
	clean_up(ERROR);
	return UNKNOWN_STATE;
}		/*end read_state_type_from_string*/
Пример #23
0
void gb_state::gameboy(machine_config &config)
{
	/* basic machine hardware */
	LR35902(config, m_maincpu, XTAL(4'194'304));
	m_maincpu->set_addrmap(AS_PROGRAM, &gb_state::gameboy_map);
	m_maincpu->timer_cb().set(FUNC(gb_state::gb_timer_callback));
	m_maincpu->set_halt_bug(true);

	/* video hardware */
	screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_LCD));
	screen.set_refresh_hz(DMG_FRAMES_PER_SECOND);
	screen.set_vblank_time(0);
	screen.set_screen_update("ppu", FUNC(dmg_ppu_device::screen_update));
	screen.set_palette(m_palette);
//  screen.set_size(20*8, 18*8);
	screen.set_size(458, 154);
	screen.set_visarea(0*8, 20*8-1, 0*8, 18*8-1);

	GFXDECODE(config, "gfxdecode", m_palette, gfxdecode_device::empty);
	PALETTE(config, m_palette, FUNC(gb_state::gb_palette), 4);

	DMG_PPU(config, m_ppu, m_maincpu);

	/* sound hardware */
	SPEAKER(config, "lspeaker").front_left();
	SPEAKER(config, "rspeaker").front_right();
	DMG_APU(config, m_apu, XTAL(4'194'304));
	m_apu->add_route(0, "lspeaker", 0.50);
	m_apu->add_route(1, "rspeaker", 0.50);

	/* cartslot */
	GB_CART_SLOT(config, m_cartslot, gb_cart, nullptr);

	SOFTWARE_LIST(config, "cart_list").set_original("gameboy");
	SOFTWARE_LIST(config, "gbc_list").set_compatible("gbcolor");
}
Пример #24
0
dVector dSceneRender::GlobalToScreen (const dVector& global) const
{
	dMatrix modelview (GetModelViewMatrix());
	dMatrix projection (GetProjectionMatrix());

	dVector screen (projection.RotateVector4x4(modelview.TransformVector(global)));

//dMatrix matrix (modelview * projection);
//dMatrix invMatrix (matrix.Inverse4x4());
//dVector p2 (invMatrix.RotateVector4x4(screen));

	dAssert (screen.m_w > 0.0f);
	screen.m_w = 1.0f / screen.m_w;
	screen = screen.Scale(screen.m_w);

	dFloat width = dFloat  (GetViewPortWidth());
	dFloat height = dFloat (GetViewPortHeight());

	screen.m_x = 0.5f * (screen.m_x + 1.0f) * width;
	screen.m_y = height - 0.5f * (screen.m_y + 1.0f) * height;
	screen.m_z = 0.5f * (screen.m_z + 1.0f);
	screen.m_w = 1.0f;
	return screen;
}
Пример #25
0
LOCAL void rotate_interface(
	INTERFACE	*intfc,
	double		*origin,
	double		**Q)
{
	BOND		*b;
	CURVE	 	**c;
	NODE  		**n;
	POINT		*p;
	int		dim = intfc->dim;
	
	if (is_identity_matrix(Q,dim) == YES)
	    return;

	for (n = intfc->nodes; *n; n++)
	{
		p = (*n)->posn;
		rotate_point(origin,Coords(p),Q,Coords(p),dim);
	}

	for (c = intfc->curves; *c; c++)
	{
		for (b = (*c)->first; b != (*c)->last; b = b->next)
		{
			p = b->end;
			rotate_point(origin,Coords(p),Q,Coords(p),dim);
		}
	}

	if (dim == 3)
	{
		/* TODO */
		screen("ERROR in rotate_interface(), 3D code needed\n");
		clean_up(ERROR);
	}
}		/*end rotate_interface*/
// Loads the application settings file from (loadMsg) and resizes the interface
// to match the previously saved settings.  Because this is a non-essential
// file, errors are ignored when loading the settings.
void
ShortcutsWindow::_LoadWindowSettings(const BMessage& loadMsg)
{
	BRect frame;
	if (loadMsg.FindRect("window frame", &frame) == B_OK) {
		// Ensure the frame does not resize below the computed minimum.
		float width = max_c(Bounds().right, frame.right - frame.left);
		float height = max_c(Bounds().bottom, frame.bottom - frame.top);
		ResizeTo(width, height);

		// Ensure the frame is not placed outside of the screen.
		BScreen screen(this);
		float left = min_c(screen.Frame().right - width, frame.left);
		float top = min_c(screen.Frame().bottom - height, frame.top);
		MoveTo(left, top);
	}

	for (int i = 0; i < fColumnListView->CountColumns(); i++) {
		CLVColumn* column = fColumnListView->ColumnAt(i);
		float columnWidth;
		if (loadMsg.FindFloat("column width", i, &columnWidth) == B_OK)
			column->SetWidth(max_c(column->Width(), columnWidth));
	}
}
Пример #27
0
	bool PolygonRender::Hits(const RenderState &inState)
	{
		if (inState.mClipRect.w != 1 || inState.mClipRect.h != 1)
			return false;
		
		UserPoint screen(inState.mClipRect.x, inState.mClipRect.y);
		
		Extent2DF extent;
		CachedExtentRenderer::GetExtent(inState.mTransform, extent);
		
		if (!extent.Contains(screen))
			return false;
		
		mHitTest = inState.mTransform.mMatrix->ApplyInverse(screen);
		if (inState.mTransform.mScale9->Active())
		{
			mHitTest.x = inState.mTransform.mScale9->InvTransX(mHitTest.x);
			mHitTest.y = inState.mTransform.mScale9->InvTransY(mHitTest.y);
		}
		
		mHitsLeft = 0;
		Iterate(itHitTest, Matrix());
		return mHitsLeft & 0x01;
	}
Пример #28
0
void QXcbScreen::readXResources()
{
    int offset = 0;
    QByteArray resources;
    while(1) {
        xcb_get_property_reply_t *reply =
            xcb_get_property_reply(xcb_connection(),
                xcb_get_property_unchecked(xcb_connection(), false, screen()->root,
                                 XCB_ATOM_RESOURCE_MANAGER,
                                 XCB_ATOM_STRING, offset/4, 8192), NULL);
        bool more = false;
        if (reply && reply->format == 8 && reply->type == XCB_ATOM_STRING) {
            resources += QByteArray((const char *)xcb_get_property_value(reply), xcb_get_property_value_length(reply));
            offset += xcb_get_property_value_length(reply);
            more = reply->bytes_after != 0;
        }

        if (reply)
            free(reply);

        if (!more)
            break;
    }

    QList<QByteArray> split = resources.split('\n');
    for (int i = 0; i < split.size(); ++i) {
        const QByteArray &r = split.at(i);
        if (r.startsWith("Xft.dpi:\t")) {
            bool ok;
            int dpi = r.mid(sizeof("Xft.dpi:")).toInt(&ok);
            if (ok)
                m_forcedDpi = dpi;
            break;
        }
    }
}
Пример #29
0
void mstation_state::mstation(machine_config &config)
{
	/* basic machine hardware */
	Z80(config, m_maincpu, XTAL(4'000'000));      //unknown clock
	m_maincpu->set_addrmap(AS_PROGRAM, &mstation_state::mstation_mem);
	m_maincpu->set_addrmap(AS_IO, &mstation_state::mstation_io);

	/* video hardware */
	screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_LCD));
	screen.set_refresh_hz(50);
	screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */
	screen.set_screen_update(FUNC(mstation_state::screen_update));
	screen.set_size(320, 128);
	screen.set_visarea(0, 320-1, 0, 128-1);
	screen.set_palette("palette");

	PALETTE(config, "palette", FUNC(mstation_state::mstation_palette), 2);

	AMD_29F080(config, "flash0");
	SST_28SF040(config, "flash1");

	// IRQ 4 is generated every second, used for auto power off
	TIMER(config, "1hz_timer").configure_periodic(FUNC(mstation_state::mstation_1hz_timer), attotime::from_hz(1));

	// IRQ 1 is used for scan the kb and for cursor blinking
	TIMER(config, "kb_timer").configure_periodic(FUNC(mstation_state::mstation_kb_timer), attotime::from_hz(50));

	rp5c01_device &rtc(RP5C01(config, "rtc", XTAL(32'768)));
	rtc.out_alarm_callback().set(FUNC(mstation_state::rtc_irq));

	ADDRESS_MAP_BANK(config, "bank0").set_map(&mstation_state::mstation_banked_map).set_options(ENDIANNESS_LITTLE, 8, 32, 0x4000);
	ADDRESS_MAP_BANK(config, "bank1").set_map(&mstation_state::mstation_banked_map).set_options(ENDIANNESS_LITTLE, 8, 32, 0x4000);

	/* internal ram */
	RAM(config, RAM_TAG).set_default_size("128K");
}
Пример #30
0
void ClockApplet::open()
{
  QRect bar = parentWidget()->geometry();
  QRect screen(QApplication::desktop()->screenGeometry());
  QRect local(pos() + parentWidget()->pos(), size());
  QRect trans;

  // [0] == horizontal  [1] == common  [2] == vertical
  int xs[] = { width() - m_calendar->width(), 0, 0 - width() - m_calendar->width() };
  int ys[] = { height(), 0 - m_calendar->height(), 0 - height() };

  int start = 0;

  if(bar.width() > bar.height())
    bar.setWidth(screen.width());
  else
  {
    bar.setHeight(screen.height());
    start = 1; // adjust for vertical orientation
  }

  int end = start + 2;
  for(int x = start; x < end; ++x)
  {
    for(int y = start; y < end; ++y)
    {
      trans = local.translated(xs[x], ys[y]);
      if(screen.contains(trans) &&
        !bar.intersects(trans))
      {
        m_calendar->popup(trans.topLeft());
        return;
      }
    }
  }
}