コード例 #1
0
ファイル: photon2_window.c プロジェクト: CarnyPriest/SAMbuild
/* invoked by main tree code to update bitmap into screen */
void ph_window_update_display (struct mame_bitmap *bitmap)
{
   PhRegion_t region_info;	

//	fprintf(stderr,"Calling update display\n");

// TODO:  Not sure just yet what this is for...if it's only x related we can probably
//	  toss it.   
   (*ph_window_update_display_func) (bitmap);

   if (use_mouse &&
       keyboard_pressed (KEYCODE_LALT) &&
       keyboard_pressed_memory (KEYCODE_PGDN))
   {
      if (ph_grab_mouse)
      {
         region_info.cursor_type = 0;
	 region_info.rid = PtWidgetRid(P_mainWindow);
	 ph_grab_mouse = FALSE;
      }
      else
      {
	 region_info.cursor_type = Ph_CURSOR_NONE;
	 region_info.rid = PtWidgetRid(P_mainWindow);      
	 ph_grab_mouse = TRUE;
      }

      PhRegionChange (Ph_REGION_CURSOR, 0, &region_info, NULL, NULL);
   }

   PgFlush();         /* flush buffer to server */
}
コード例 #2
0
void slapfght_log_vram(void)
{
	if ( keyboard_pressed_memory(KEYCODE_B) )
	{
		int i;
		for (i=0; i<0x800; i++)
		{
			logerror("Offset:%03x   TileRAM:%02x   AttribRAM:%02x   SpriteRAM:%02x\n",i, videoram[i],colorram[i],spriteram[i]);
		}
	}
}
コード例 #3
0
ファイル: m107.c プロジェクト: Ezio-PS/mame2003-libretro
static INTERRUPT_GEN( m107_raster_interrupt )
{
	static int last_line=0;
	int line = 256 - cpu_getiloops();

	if (keyboard_pressed_memory(KEYCODE_F1)) {
		raster_enable ^= 1;
		if (raster_enable)
			usrintf_showmessage("Raster IRQ enabled");
		else
			usrintf_showmessage("Raster IRQ disabled");
	}

	/* Raster interrupt */
	if (raster_enable && line==m107_raster_irq_position) {
		if (osd_skip_this_frame()==0)
			m107_vh_raster_partial_refresh(Machine->scrbitmap,last_line,line);
		last_line=line+1;

		cpu_set_irq_line_and_vector(0, 0, HOLD_LINE, m107_IRQ_2);
	}

	/* Kludge to get Fire Barrel running */
	else if (line==118)
	{
		cpu_set_irq_line_and_vector(0, 0, HOLD_LINE, m107_IRQ_3);
	}

	/* Redraw screen, then set vblank and trigger the VBL interrupt */
	else if (line==248) {
		if (osd_skip_this_frame()==0)
			m107_vh_raster_partial_refresh(Machine->scrbitmap,last_line,248);
		last_line=0;
		m107_vblank=1;
		cpu_set_irq_line_and_vector(0, 0, HOLD_LINE, m107_IRQ_0);
	}

	/* End of vblank */
	else if (line==255)
		m107_vblank=0;
}
コード例 #4
0
ファイル: cps2.cpp プロジェクト: ArnaudFeld/MameAppleTV
void cps2_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh)
{
    static int qcode;
    int stop=0;
    int oldq=qcode;
    int i,offset;

    if (cps1_palette)
    {
        for (i=0; i<cps1_palette_size; i+=2)
        {
            int color=0x0fff+((i&0x0f)<<(8+4));
            WRITE_WORD(&cps1_palette[i],color);
        }
    }

	/* Get video memory base registers */
	cps1_get_video_base();

    cps1_build_palette();
   	for (i = offset = 0; i < cps1_palette_entries; i++)
	{
        int j;
        for (j = 0; j < 15; j++)
        {
           palette_used_colors[offset++] = PALETTE_COLOR_USED;
        }
        palette_used_colors[offset++] = PALETTE_COLOR_TRANSPARENT;
	}

    palette_recalc ();

    cps1_debug_tiles(bitmap);
    if (keyboard_pressed_memory(KEYCODE_UP))
        qcode++;

    if (keyboard_pressed_memory(KEYCODE_DOWN))
        qcode--;

    qcode &= 0xffff;

    if (keyboard_pressed_memory(KEYCODE_ENTER))
        stop=0xff;


    if (qcode != oldq)
    {
        int mode=0;
        cps2_qsound_sharedram_w(0x1ffa, 0x0088);
        cps2_qsound_sharedram_w(0x1ffe, 0xffff);

        cps2_qsound_sharedram_w(0x00, 0x0000);
        cps2_qsound_sharedram_w(0x02, qcode);
        cps2_qsound_sharedram_w(0x06, 0x0000);
        cps2_qsound_sharedram_w(0x08, 0x0000);
        cps2_qsound_sharedram_w(0x0c, mode);
        cps2_qsound_sharedram_w(0x0e, 0x0010);
        cps2_qsound_sharedram_w(0x10, 0x0000);
        cps2_qsound_sharedram_w(0x12, 0x0000);
        cps2_qsound_sharedram_w(0x14, 0x0000);
        cps2_qsound_sharedram_w(0x16, 0x0000);
        cps2_qsound_sharedram_w(0x18, 0x0000);
        cps2_qsound_sharedram_w(0x1e, 0x0000);
    }
    {
    struct DisplayText dt[3];
    char *instructions="PRESS: PGUP/PGDN=CODE  1=8x8  2=16x16  3=32x32  UP/DN=QCODE";
    char text1[256];
    sprintf(text1, "GFX CODE=%06x  :  QSOUND CODE=%04x", cps2_start, qcode );
    dt[0].text = text1;
    dt[0].color = UI_COLOR_INVERSE;
    dt[0].x = (Machine->uiwidth - Machine->uifontwidth * strlen(text1)) / 2;
    dt[0].y = 8*23;
    dt[1].text = instructions;
    dt[1].color = UI_COLOR_NORMAL;
    dt[1].x = (Machine->uiwidth - Machine->uifontwidth * strlen(instructions)) / 2;
    dt[1].y = dt[0].y+2*Machine->uifontheight;

    dt[2].text = 0; /* terminate array */
	displaytext(Machine->scrbitmap,dt,0,0);
    }
}
コード例 #5
0
ファイル: zn.c プロジェクト: AlanApter/steamlink-sdk
static void zn_vh_screenrefresh( struct osd_bitmap *bitmap, int full_refresh )
{
    int refresh = full_refresh;

    if( queue_len == 0 )
    {
        if( keyboard_pressed_memory( KEYCODE_UP ) )
        {
            qcode=( qcode & 0xff00 ) | ( ( qcode + 0x0001 ) & 0xff );
        }
        if( keyboard_pressed_memory( KEYCODE_DOWN ) )
        {
            qcode=( qcode & 0xff00 ) | ( ( qcode - 0x0001 ) & 0xff );
        }
        if( keyboard_pressed_memory( KEYCODE_RIGHT ) )
        {
            qcode=( ( qcode + 0x0100 ) & 0xff00 ) | ( qcode & 0xff );
        }
        if( keyboard_pressed_memory( KEYCODE_LEFT ) )
        {
            qcode=( ( qcode - 0x0100 ) & 0xff00 ) | ( qcode & 0xff );
        }
        if( qcode != qcode_last )
        {
            qsound_queue_w( 0, qcode );
            qcode_last = qcode;
            refresh = 1;
        }
    }

    if( refresh )
    {
            struct DisplayText dt[ 4 ];
            char text1[ 256 ];
            char text2[ 256 ];
            char text3[ 256 ];

            strcpy( text1, Machine->gamedrv->description );
            if( strlen( text1 ) > Machine->uiwidth / Machine->uifontwidth )
            {
                text1[ Machine->uiwidth / Machine->uifontwidth ] = 0;
            }
            sprintf( text2, "QSOUND CODE=%02x/%02x", qcode >> 8, qcode & 0xff );
            if( strlen( text2 ) > Machine->uiwidth / Machine->uifontwidth )
            {
                text2[ Machine->uiwidth / Machine->uifontwidth ] = 0;
            }
            strcpy( text3, "SELECT WITH RIGHT&LEFT/UP&DN" );
            if( strlen( text3 ) > Machine->uiwidth / Machine->uifontwidth )
            {
                text3[ Machine->uiwidth / Machine->uifontwidth ] = 0;
            }
            dt[ 0 ].text = text1;
            dt[ 0 ].color = UI_COLOR_NORMAL;
            dt[ 0 ].x = ( Machine->uiwidth - Machine->uifontwidth * strlen( dt[ 0 ].text ) ) / 2;
            dt[ 0 ].y = Machine->uiheight - Machine->uifontheight * 5;
            dt[ 1 ].text = text2;
            dt[ 1 ].color = UI_COLOR_NORMAL;
            dt[ 1 ].x = ( Machine->uiwidth - Machine->uifontwidth * strlen( dt[ 1 ].text ) ) / 2;
            dt[ 1 ].y = Machine->uiheight - Machine->uifontheight * 3;
            dt[ 2 ].text = text3;
            dt[ 2 ].color = UI_COLOR_NORMAL;
            dt[ 2 ].x = ( Machine->uiwidth - Machine->uifontwidth * strlen( dt[ 2 ].text ) ) / 2;
            dt[ 2 ].y = Machine->uiheight - Machine->uifontheight * 1;
            dt[ 3 ].text = 0; /* terminate array */
            displaytext( Machine->scrbitmap, dt, 0, 0 );
    }
}