本文整理汇总了C++中READ_WORD函数的典型用法代码示例。如果您正苦于以下问题:C++ READ_WORD函数的具体用法?C++ READ_WORD怎么用?C++ READ_WORD使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了READ_WORD函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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]++;
}
}
示例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);
}
示例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);
}
示例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);
}
}
}
示例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);
}
}
}
}
示例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;
}
}
}
示例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);
}
示例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;
}
示例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)
}
示例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]);
}
示例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;
}
示例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);
}
}
}
}
示例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);
}
示例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]);
}
示例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);
}
}