• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ READ_WORD函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中READ_WORD函数的典型用法代码示例。如果您正苦于以下问题:C++ READ_WORD函数的具体用法?C++ READ_WORD怎么用?C++ READ_WORD使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了READ_WORD函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: gaelco_sort_sprites

static void gaelco_sort_sprites(void)
{
	int i;

	sprite_count[0] = 0;
	sprite_count[1] = 0;
	sprite_count[2] = 0;
	sprite_count[3] = 0;
	sprite_count[4] = 0;

	for (i = 6; i < 0x1000 - 6; i += 8){
		int color = (READ_WORD(&gaelco_spriteram[i+4]) & 0x7e00) >> 9;
		int priority = (READ_WORD(&gaelco_spriteram[i]) & 0x3000) >> 12;

		/* palettes 0x38-0x3f are used for high priority sprites in Big Karnak */
		if (color >= 0x38){
			sprite_table[4][sprite_count[4]] = i;
			sprite_count[4]++;
		}

		/* save sprite number in the proper array for later */
		sprite_table[priority][sprite_count[priority]] = i;
		sprite_count[priority]++;
	}
}
开发者ID:AlanApter,项目名称:steamlink-sdk,代码行数:25,代码来源:gaelco.c


示例2: pf_render_callback

static void pf_render_callback(const struct rectangle *clip, const struct rectangle *tiles, const struct atarigen_pf_state *state, void *param)
{
	const struct GfxElement *gfx = Machine->gfx[0];
	struct osd_bitmap *bitmap = (struct osd_bitmap *)param;
	int x, y;

	/* standard loop over tiles */
	for (x = tiles->min_x; x != tiles->max_x; x = (x + 1) & 63)
		for (y = tiles->min_y; y != tiles->max_y; y = (y + 1) & 63)
		{
			int offs = x * 64 + y;

			/* update only if dirty */
			if (atarigen_pf_dirty[offs])
			{
				int data1 = READ_WORD(&atarigen_playfieldram[offs * 2]);
				int data2 = READ_WORD(&atarigen_playfieldram[offs * 2 + 0x2000]);
				int color = (data2 >> 8) & 15;
				int hflip = data1 & 0x8000;
				int code = data1 & 0x7fff;

				drawgfx(atarigen_pf_bitmap, gfx, code, 0x10 + color, hflip, 0, 8 * x, 8 * y, 0, TRANSPARENCY_NONE, 0);
				atarigen_pf_dirty[offs] = 0;
			}
		}

	/* then blast the result */
	copybitmap(bitmap, atarigen_pf_bitmap, 0, 0, 0, 0, clip, TRANSPARENCY_NONE, 0);
}
开发者ID:ArnaudFeld,项目名称:MameAppleTV,代码行数:29,代码来源:offtwall.cpp


示例3: namcos2_68k_video_palette_w

void namcos2_68k_video_palette_w( int offset, int data )
{
	int oldword = READ_WORD(&namcos2_68k_palette_ram[offset&0xffff]);
	int newword = COMBINE_WORD(oldword, data);
	int pen,red,green,blue;

	if(oldword != newword)
	{
		WRITE_WORD(&namcos2_68k_palette_ram[offset&0xffff],newword);

        /* 0x3000 offset is control registers */
        if((offset&0x3000)!=0x3000)
        {
            pen=(((offset&0xc000)>>2) | (offset&0x0fff))>>1;

            red  =(READ_WORD(&namcos2_68k_palette_ram[offset&0xcfff]))&0x00ff;
            green=(READ_WORD(&namcos2_68k_palette_ram[(offset&0xcfff)+0x1000]))&0x00ff;
            blue =(READ_WORD(&namcos2_68k_palette_ram[(offset&0xcfff)+0x2000]))&0x00ff;

            /* Int color, uchar r/g/b */

            palette_change_color(pen,red,green,blue);

//          if (errorlog) fprintf(errorlog,"CPU#%d PC=$%06x Video Palette write Addr=%08x, Data=%04x\n",cpu_getactivecpu(),cpu_get_pc(),offset,data);
            if (errorlog) fprintf(errorlog,"CPU#%d PC=$%06x Video Palette PEN=%04x, R=%02x, G=%02x B=%02x\n",cpu_getactivecpu(),cpu_get_pc(),pen,red,green,blue);
        }
开发者ID:OS2World,项目名称:APP-EMULATION-MAME,代码行数:26,代码来源:namcos2.c


示例4: pf_overrender_callback

static void pf_overrender_callback(const struct rectangle *clip, const struct rectangle *tiles, const struct atarigen_pf_state *state, void *param)
{
	const struct GfxElement *gfx = Machine->gfx[0];
	struct osd_bitmap *bitmap = (struct osd_bitmap *)param;
	int x, y;

	/* standard loop over tiles */
	for (x = tiles->min_x; x != tiles->max_x; x = (x + 1) & 63)
		for (y = tiles->min_y; y != tiles->max_y; y = (y + 1) & 31)
		{
			int offs = x * 32 + y;
			int data2 = READ_WORD(&atarigen_playfieldram[offs * 2 + 0x1000]);
			int color = (data2 >> 8) & 15;

			/* overdraw if the color is 15 */
			if (color == 15)
			{
				int data1 = READ_WORD(&atarigen_playfieldram[offs * 2]);
				int hflip = data1 & 0x8000;
				int code = data1 & 0x1fff;

				drawgfx(bitmap, gfx, code, color, hflip, 0, 8 * x, 8 * y, clip, TRANSPARENCY_NONE, 0);
			}
		}
}
开发者ID:AlanApter,项目名称:steamlink-sdk,代码行数:25,代码来源:klax.c


示例5: pf2_overrender_callback

static void pf2_overrender_callback(const struct rectangle *clip, const struct rectangle *tiles, const struct atarigen_pf_state *state, void *param)
{
	const struct pf_overrender_data *overrender_data = param;
	struct osd_bitmap *bitmap = overrender_data->bitmap;
	int min_color = overrender_data->mo_priority ? 1 : 0;
	const struct GfxElement *gfx = Machine->gfx[0];
	int x, y;

	/* standard loop over tiles */
	for (x = tiles->min_x; x != tiles->max_x; x = (x + 1) & 63)
	{
		int sx = (8 * x - state->hscroll) & 0x1ff;
		if (sx >= XDIM) sx -= 0x200;

		for (y = tiles->min_y; y != tiles->max_y; y = (y + 1) & 63)
		{
			int offs = x * 64 + y;
			int data2 = READ_WORD(&atarigen_playfieldram_color[offs * 2]);
			int color = (data2 >> 8) & 0x0f;
			
			if (color >= min_color)
			{
				int data1 = READ_WORD(&atarigen_playfield2ram[offs * 2]);
				int code = data1 & 0x7fff;
				int hflip = data1 & 0x8000;

				int sy = (8 * y - state->vscroll) & 0x1ff;
				if (sy >= YDIM) sy -= 0x200;
			
				drawgfx(bitmap, gfx, code, color, hflip, 0, sx, sy, clip, TRANSPARENCY_PEN, 0);
			}
		}
	}
}
开发者ID:cdrr,项目名称:MAME_hack,代码行数:34,代码来源:relief.c


示例6: frameProcessData

void frameProcessData(Mod_Master_Frame_TypeDef* aFrame)
{
	//uint16_t 	*wp;
	//uint8_t 	*bp;
	uint16_t	i;
	uint8_t		*target;
	
	aFrame->fromAddr = aFrame->rxframe[0];
	//todo process
	if ((aFrame->rxframe[1] & 0x80) == 0x80) 
	{
		aFrame->errCode = aFrame->rxframe[2];
		//add err process FOR errCode
		aFrame->respOK = FALSE;
		return;
	} else {
		if (aFrame->cmdCode != aFrame->rxframe[1]) 
		{
			aFrame->errCode = Mod_Err_Unknow;
			//add err process for cmdCode err
			aFrame->respOK = FALSE;
			return ;
		} else {
			//start process 
			switch (aFrame->cmdCode)
			{
				case 0x03:
				{
					aFrame->dataLen = aFrame->rxframe[2];
					target = M; //
					for (i = 0; i < aFrame->dataLen; i ++)
					{
						aFrame->data[i] = aFrame->rxframe[i + 3];
						//此处需要特别留意,移植的时候切记 start 
						*target = aFrame->data[i];
						target ++;						
						//此处需要特别留意,移植的时候切记 end
					}
					aFrame->errCode = Mod_Err_No;
					break;
				}
				case 0x10:
				{
					aFrame->dataAddr = READ_WORD(aFrame->rxframe[2]);
					aFrame->dataLen = READ_WORD(aFrame->rxframe[4]);
					aFrame->errCode = Mod_Err_No;
					break;
				}
				default :
				{
					//todo add cmd function process
				}
			}
			aFrame->errCode = 0;
			aFrame->linkFail = FALSE;
			aFrame->respOK = TRUE;
			return;
		}
	}
}
开发者ID:tigeratgithub,项目名称:OPX,代码行数:60,代码来源:modstm8.c


示例7: maniacsq_vh_screenrefresh

void maniacsq_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh)
{
	/* set scroll registers */
	tilemap_set_scrolly(pant[0], 0, READ_WORD(&gaelco_vregs[0]));
	tilemap_set_scrollx(pant[0], 0, READ_WORD(&gaelco_vregs[2])+4);
	tilemap_set_scrolly(pant[1], 0, READ_WORD(&gaelco_vregs[4]));
	tilemap_set_scrollx(pant[1], 0, READ_WORD(&gaelco_vregs[6]));

	tilemap_update(ALL_TILEMAPS);
	gaelco_sort_sprites();

	if (palette_recalc())
		tilemap_mark_all_pixels_dirty(ALL_TILEMAPS);

	tilemap_render(ALL_TILEMAPS);


	fillbitmap( bitmap, Machine->pens[0], &Machine->visible_area );

	tilemap_draw(bitmap,pant[1],3);
	tilemap_draw(bitmap,pant[0],3);
	gaelco_draw_sprites(bitmap,3);

	tilemap_draw(bitmap,pant[1],2);
	tilemap_draw(bitmap,pant[0],2);
	gaelco_draw_sprites(bitmap,2);

	tilemap_draw(bitmap,pant[1],1);
	tilemap_draw(bitmap,pant[0],1);
	gaelco_draw_sprites(bitmap,1);

	tilemap_draw(bitmap,pant[1],0);
	tilemap_draw(bitmap,pant[0],0);
	gaelco_draw_sprites(bitmap,0);
}
开发者ID:AlanApter,项目名称:steamlink-sdk,代码行数:35,代码来源:gaelco.c


示例8: read_vectorram

INLINE void read_vectorram (int addr, int *x, int *y, int *c)
{
    addr <<= 1;
    *c = READ_WORD (&aztarac_vectorram[addr]) & 0xffff;
    *x = READ_WORD (&aztarac_vectorram[addr + 0x1000]) & 0x03ff;
    *y = READ_WORD (&aztarac_vectorram[addr + 0x2000]) & 0x03ff;
    if (*x & 0x200) *x |= 0xfffffc00;
    if (*y & 0x200) *y |= 0xfffffc00;
}
开发者ID:AlanApter,项目名称:steamlink-sdk,代码行数:9,代码来源:aztarac.c


示例9: get_pow_tile_info

static void get_pow_tile_info(int tile_index)
{
	int tile=READ_WORD(&videoram[4*tile_index])&0xff;
	int color=READ_WORD(&videoram[4*tile_index+2]);

	tile=((color&0xf0)<<4) | tile;
	color&=0xf;

	SET_TILE_INFO(0,tile,color)
}
开发者ID:AlanApter,项目名称:steamlink-sdk,代码行数:10,代码来源:snk68.c


示例10: READ_HANDLER

ROM_END

/******************************************************************************/

static READ_HANDLER( supbtime_cycle_r )
{
	if (cpu_get_pc()==0x7e2 && READ_WORD(&supbtime_ram[0])==0) {cpu_spinuntil_int(); return 1;}

	return READ_WORD(&supbtime_ram[0]);
}
开发者ID:helicomatic,项目名称:imame4all-libretro,代码行数:10,代码来源:supbtime.c


示例11: READ_DWORD

bool CGuideHintTable::SetTableData(void* pvTable, WCHAR* pwszSheetName, std::wstring* pstrDataName, BSTR bstrData)
{
	if (0 == wcscmp(pwszSheetName, L"Table_Data_KOR"))
	{
		sGUIDE_HINT_TBLDAT* pGuide = (sGUIDE_HINT_TBLDAT*)pvTable;

		if (0 == wcscmp(pstrDataName->c_str(), L"Tblidx"))
		{
			pGuide->tblidx = READ_DWORD( bstrData );
		}
		else if (0 == wcscmp(pstrDataName->c_str(), L"Type"))
		{
			pGuide->byType = READ_BYTE( bstrData, pstrDataName->c_str() );
		}
		else if (0 == wcscmp(pstrDataName->c_str(), L"WidthPosition"))
		{
			pGuide->byWidthPosition = READ_BYTE( bstrData, pstrDataName->c_str() );
		}
		else if (0 == wcscmp(pstrDataName->c_str(), L"HeightPosition"))
		{
			pGuide->byHeightPosition = READ_BYTE( bstrData, pstrDataName->c_str() );
		}
		else if (0 == wcscmp(pstrDataName->c_str(), L"WidthSize"))
		{
			pGuide->wWidthSize = READ_WORD( bstrData, pstrDataName->c_str() );
		}
		else if (0 == wcscmp(pstrDataName->c_str(), L"HeightSize"))
		{
			pGuide->wHeightSize = READ_WORD( bstrData, pstrDataName->c_str() );
		}
		else if (0 == wcscmp(pstrDataName->c_str(), L"Resource"))
		{
			READ_STRING(bstrData, pGuide->szResource, _countof(pGuide->szResource));
		}
		else if (0 == wcscmp(pstrDataName->c_str(), L"Note"))
		{
			READ_STRING(bstrData, pGuide->szNote, _countof(pGuide->szNote));
		}
		else if (0 == wcscmp(pstrDataName->c_str(), L"Auto_Show"))
		{
			pGuide->bAutoShow = READ_BOOL( bstrData, pstrDataName->c_str() );
		}
		else
		{
			CTable::CallErrorCallbackFunction(L"[File] : %s\n[Error] : Unknown field name found!(Field Name = %s)", m_wszXmlFileName, pstrDataName->c_str());
			return false;
		}
	}
	else
	{
		return false;
	}

	return true;
}
开发者ID:JunRyuu,项目名称:AKCore,代码行数:55,代码来源:GuideHintTable.cpp


示例12: namcos2_mark_used_sprite_colours

void namcos2_mark_used_sprite_colours(void){
	int offset,loop,coloop;
	/* Array to mark when a particular tile has had its colours marked  */
	/* so we dont scan it again if its marked in here                   */
	static char done_array[0x1000/8];
	static char pen_array[256/8];

	/* Blat the used array */
	memset(done_array,0,0x1000/8);

	/* Mark off all of the colour codes used by the sprites */
	offset=(namcos2_68k_sprite_bank_r(0)&0x000f)*(128*8);
	for(loop=0;loop<128;loop++)
	{
		int sizey=(READ_WORD(&namcos2_sprite_ram[offset+(loop*8)+0])>>10)&0x3f;

		/* Sprites are only active if they have a size>0 */
		if(sizey)
		{
			int offset2=READ_WORD(&namcos2_sprite_ram[offset+(loop*8)+2]);
			int offset6=READ_WORD(&namcos2_sprite_ram[offset+(loop*8)+6]);
			int sprn,sprn_done,spr_region,colour_code;

			/* Calulate spr number, region, colour code & the done sprite number */
			sprn=(offset2>>2)&0x7ff;
			sprn_done=sprn;
			sprn_done+=(offset2&0x2000)?0x800:0;
			spr_region=(offset2&0x2000)?GFX_OBJ2:GFX_OBJ1;
			colour_code=256*((offset6>>4)&0x000f);

			if( (done_array[sprn_done>>3]&(1<<(sprn_done&0x07)))==0 )
			{
				/* Clear the temporary pen usage array */
				memset(pen_array,0,256/8);
				/* Generate pen usage array for this tile on the fly */
				namcos2_calc_used_pens(spr_region,sprn,pen_array);

				/* Process tile used colours */
				for(coloop=0;coloop<256;coloop++)
				{
					/* Is this pen marked by the tile as being used ? */
					if( pen_array[coloop>>3]&(1<<(coloop&0x07)) )
					{
						/* Yes so mark it for the palette manager */
						palette_used_colors[colour_code+coloop] |= PALETTE_COLOR_VISIBLE;
					}
				}

				/* Mark the tile as having been done */
				done_array[sprn_done>>3]|=1<<(sprn_done&0x07);
			}
		}
	}
}
开发者ID:ArnaudFeld,项目名称:MameAppleTV,代码行数:54,代码来源:namcos2.cpp


示例13: get_tile_info_gaelco_screen1

static void get_tile_info_gaelco_screen1(int tile_index)
{
	int data = READ_WORD(&gaelco_videoram[0x1000 + (tile_index << 2)]);
	int data2 = READ_WORD(&gaelco_videoram[0x1000 + (tile_index << 2) + 2]);
	int code = ((data & 0xfffc) >> 2);

	tile_info.flags = TILE_FLIPYX(data & 0x03);
	tile_info.priority = (data2 >> 6) & 0x03;

	SET_TILE_INFO(1, 0x4000 + code, data2 & 0x3f);
}
开发者ID:AlanApter,项目名称:steamlink-sdk,代码行数:11,代码来源:gaelco.c


示例14: READ_HANDLER

static READ_HANDLER( bakatono_cycle_r )
{
        int mem;
        if (cpu_get_pc()==0x197cc)
        {
                cpu_spinuntil_int();
                mem=READ_WORD(&neogeo_ram[0x00fa]);
                mem--;
                WRITE_WORD(&neogeo_ram[0x00fa],mem);
                return mem;
        }
        return READ_WORD(&neogeo_ram[0x00fa]);
}
开发者ID:AlanApter,项目名称:steamlink-sdk,代码行数:13,代码来源:neogeo.c


示例15: do_mem

void do_mem()
{
  enum md_fault_type _fault;
  mw.inst = em.inst;
  if(mw.inst.a == NOP){
  	return;
  }
  mw.PC = em.PC;
  mw.opcode = em.opcode;
  mw.oprand = em.oprand;
  mw.ALUResult = em.ALUResult;
  mw.WriteData = em.WriteData;
  mw.WriteTargetRegister = em.WriteTargetRegister;

  mw.RegWrite = em.RegWrite;
  mw.MemtoReg = em.MemtoReg;
  mw.MemRead = em.MemRead;
  mw.MemWrite = em.MemWrite;
  if(mw.MemRead){
  	mw.MemReadData = READ_WORD(em.ALUResult,_fault);
  }else if(mw.MemWrite){
    WRITE_WORD(mw.WriteData,mw.ALUResult,_fault);
  }

    
}                                                                                        
开发者ID:breadbaconic,项目名称:SimpleScalar,代码行数:26,代码来源:sim-pipe.c


示例16: parse_item

// parse_item: Parse a kssl_item out of the body of a KSSL message
// NOTE: The payload for the item is not copied, a reference
// to the original stream is added to the kssl_item struct. The offset
// is updated if provided. Returns KSSL_ERROR_NONE if successful.
kssl_error_code parse_item(BYTE *bytes,       // Byte stream to parse
                           // kssl_item from
                           int *offset,       // (optional) if present
                           // specifies offset into bytes.
                           kssl_item *item) { // The kssl_item parsed (must be
    // allocated by caller)
    int local_offset = 0;
    BYTE local_tag;
    WORD local_len;
    BYTE *local_data;

    if (bytes == NULL || item == NULL) {
        return KSSL_ERROR_INTERNAL;
    }

    if (offset != NULL) {
        local_offset = *offset;
    }

    local_tag = READ_BYTE(bytes, local_offset);
    local_len = READ_WORD(bytes, local_offset);
    local_data = &bytes[local_offset];
    local_offset += local_len;

    item->tag = local_tag;
    item->length = local_len;
    item->data = local_data;

    if (offset != NULL) {
        *offset = local_offset;
    }

    return KSSL_ERROR_NONE;
}
开发者ID:b1v1r,项目名称:keyless,代码行数:38,代码来源:kssl_helpers.c


示例17: atarisys2_interrupt

int atarisys2_interrupt (void)
{
    int i;

	/* set the 32V timer */
	timer_set (TIME_IN_USEC (Machine->drv->vblank_duration), 0, atarisys2_32v_interrupt);
	timer_set (TIME_IN_USEC (Machine->drv->vblank_duration), 0, atarisys2_video_update);

	/* update the pedals once per frame */
    for (i = 0; i < pedal_count; i++)
	{
		if (readinputport (3 + i) & 0x80)
		{
			pedal_value[i] += 64;
			if (pedal_value[i] > 0xff) pedal_value[i] = 0xff;
		}
		else
		{
			pedal_value[i] -= 64;
			if (pedal_value[i] < 0) pedal_value[i] = 0;
		}
	}

	/* VBLANK is 3 */
	if (!irq_hold3 && (READ_WORD (&atarisys2_interrupt_enable[0]) & 8))
	{
		irq_hold3 = 1;
		return 3;
	}
	else
		return ignore_interrupt ();
}
开发者ID:cyberkni,项目名称:276in1JAMMA,代码行数:32,代码来源:atarisy2.cpp


示例18: pf_render_callback

static void pf_render_callback(const struct rectangle *clip, const struct rectangle *tiles, const struct atarigen_pf_state *state, void *param)
{
	const struct GfxElement *gfx = Machine->gfx[0];
	int bank = state->param[0] * 0x1000;
	struct osd_bitmap *bitmap = param;
	int x, y;

	/* standard loop over tiles */
	for (y = tiles->min_y; y != tiles->max_y; y = (y + 1) & 63)
		for (x = tiles->min_x; x != tiles->max_x; x = (x + 1) & 63)
		{
			int offs = y * 64 + x;

			/* update only if dirty */
			if (atarigen_pf_dirty[offs] != state->param[0])
			{
				int data = READ_WORD(&atarigen_playfieldram[offs * 2]);
				int code = data & 0x1fff;
				int color = data >> 13;
				if (code & 0x1000) code += bank;

				drawgfx(atarigen_pf_bitmap, gfx, code, color, 0, 0, 8 * x, 8 * y, 0, TRANSPARENCY_NONE, 0);
				atarigen_pf_dirty[offs] = state->param[0];
			}
		}
开发者ID:OS2World,项目名称:APP-EMULATION-MAME,代码行数:25,代码来源:badlands.c


示例19: draw_background

static void draw_background( struct osd_bitmap *bitmap ) {
    int offs;
    const struct GfxElement *gfx = Machine->gfx[1];

    for( offs = 0; offs < videoram_size; offs += 2 ){
        int offs2 = offs / 2;
        if( dirtybuffer[offs2] ) {
            int data = READ_WORD( &videoram[offs] );
            int numtile = ( data & 0xfff );
            int color = ( data & 0xf000 ) >> 12;
            int sx = ( offs2 % 16 ) * 16;
            int sy = ( offs2 / 16 ) * 16;

            dirtybuffer[offs2] = 0;

            drawgfx( tmpbitmap,gfx,
                numtile,
                color,
                0,0,
                sx,sy,
                0,TRANSPARENCY_NONE,0);
        }
    }

    copybitmap( bitmap, tmpbitmap,0,0,0,0,&Machine->visible_area,TRANSPARENCY_NONE,0 );
}
开发者ID:ArnaudFeld,项目名称:MameAppleTV,代码行数:26,代码来源:cabal.cpp


示例20: atarisys2_paletteram_w

void atarisys2_paletteram_w (int offset, int data)
{
	static const int intensity_table[16] =
	{
		#define ZB 115
		#define Z3 78
		#define Z2 37
		#define Z1 17
		#define Z0 9
		0, ZB+Z0, ZB+Z1, ZB+Z1+Z0, ZB+Z2, ZB+Z2+Z0, ZB+Z2+Z1, ZB+Z2+Z1+Z0,
		ZB+Z3, ZB+Z3+Z0, ZB+Z3+Z1, ZB+Z3+Z1+Z0,ZB+ Z3+Z2, ZB+Z3+Z2+Z0, ZB+Z3+Z2+Z1, ZB+Z3+Z2+Z1+Z0
	};
	static const int color_table[16] =
		{ 0x0, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xe, 0xf, 0xf };

	int inten, red, green, blue;

	int oldword = READ_WORD (&paletteram[offset]);
	int newword = COMBINE_WORD (oldword, data);
	int indx = offset / 2;

	WRITE_WORD (&paletteram[offset], newword);

	inten = intensity_table[newword & 15];
	red = (color_table[(newword >> 12) & 15] * inten) >> 4;
	green = (color_table[(newword >> 8) & 15] * inten) >> 4;
	blue = (color_table[(newword >> 4) & 15] * inten) >> 4;
	palette_change_color (indx, red, green, blue);
}
开发者ID:cyberkni,项目名称:276in1JAMMA,代码行数:29,代码来源:atarisy2.cpp



注:本文中的READ_WORD函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ REAL函数代码示例发布时间:2022-05-30
下一篇:
C++ READ_UINT16函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap