Example #1
0
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]++;
	}
}
Example #2
0
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);
}
Example #3
0
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);
        }
Example #4
0
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);
			}
		}
}
Example #5
0
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);
			}
		}
	}
}
Example #6
0
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;
		}
	}
}
Example #7
0
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);
}
Example #8
0
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;
}
Example #9
0
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)
}
Example #10
0
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]);
}
Example #11
0
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;
}
Example #12
0
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);
			}
		}
	}
}
Example #13
0
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);
}
Example #14
0
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]);
}
Example #15
0
static READ_HANDLER( minasan_cycle_r )
{
        int mem;
        if (cpu_get_pc()==0x17766)
        {
                cpu_spinuntil_int();
                mem=READ_WORD(&neogeo_ram[0x00ca]);
                mem--;
                WRITE_WORD(&neogeo_ram[0x00ca],mem);
                return mem;
        }
        return READ_WORD(&neogeo_ram[0x00ca]);
}
Example #16
0
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);
  }

    
}                                                                                        
Example #17
0
// 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;
}
Example #18
0
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 ();
}
Example #19
0
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];
			}
		}
Example #20
0
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 );
}
Example #21
0
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);
}
Example #22
0
static WRITE_HANDLER( sync_w )
{
	int oldword = READ_WORD(&sync_data[offset]);
	int newword = COMBINE_WORD(oldword, data);
	WRITE_WORD(&sync_data[offset], newword);
	if ((oldword & 0xff00) != (newword & 0xff00))
		cpu_yield();
}
Example #23
0
static void atarisys2_soundint (void)
{
	if (!irq_hold0 && (READ_WORD (&atarisys2_interrupt_enable[0]) & 1))
	{
		cpu_cause_interrupt (0, 0);
		irq_hold0 = 1;
	}
}
Example #24
0
VOID vFillKernPairs(BYTE *pjKernOut, BYTE *pjPFM)
{
    DWORD  dpPairKernTable = READ_DWORD(&pjPFM[OFF_PairKernTable]);
    ULONG  cKernPairs;
    BYTE  *pjKern;
    WCHAR  awcKern[2];
    FD_KERNINGPAIR *pkp, *pkpEnd;

    if (!dpPairKernTable)
        return;

// first WORD is the number of kerning pairs to follow

    cKernPairs = READ_WORD(&pjPFM[dpPairKernTable]);

// skip the count, point to data:

    pjKern = &pjPFM[dpPairKernTable + sizeof(WORD)];
    pkp = (FD_KERNINGPAIR *)pjKernOut;
    pkpEnd = &pkp[cKernPairs];

// 4 == sizeof(BYTE) + sizeof(BYTE) + sizeof(WORD)

    for ( ; pkp < pkpEnd; pkp++, pjKern += 4)
    {
    // Upon every entry to this loop the input data looks as follows
    // pjKern[0] = iCh1;
    // pjKern[1] = iCh2;
    // This is followed by a WORD of data for the Kerning distance.

    // The ANSI character codes for each character
    // of the kerning pair need to be converted to UNICODE:

        MULTIBYTETOUNICODE(awcKern, (2 * sizeof(WCHAR)),NULL, pjKern, 2);

        pkp->wcFirst  = awcKern[0];
        pkp->wcSecond = awcKern[1];
        pkp->fwdKern  = (FWORD)READ_WORD(&pjKern[2]);
    }

// fill in the zero terminator:

    pkpEnd->wcFirst  = 0;
    pkpEnd->wcSecond = 0;
    pkpEnd->fwdKern  = 0;
}
Example #25
0
static READ_HANDLER( bankswitch_r )
{
	/* this is the table lookup; the bank is determined by the address that was requested */
	bank_offset = ((offset / 2) & 3) * 0x2000;
	//logerror("Bankswitch index %d -> %04X\n", offset, bank_offset);

	return READ_WORD(&bankswitch_base[offset]);
}
Example #26
0
static void cabal_background_w( int offset, int data ){
	int oldword = READ_WORD(&videoram[offset]);
	int newword = COMBINE_WORD(oldword,data);
	if( oldword != newword ){
		WRITE_WORD(&videoram[offset],newword);
		dirtybuffer[offset/2] = 1;
	}
}
Example #27
0
static void sync_w(int offset, int data)
{
	int oldword = READ_WORD(&sync_data[offset]);
	int newword = COMBINE_WORD(oldword, data);
	WRITE_WORD(&sync_data[offset], newword);
	if ((oldword & 0xff00) != (newword & 0xff00))
		cpu_yield();
}
Example #28
0
static void get_tile_info_screen0(int tile_index)
{
    unsigned short data = READ_WORD(&splash_videoram[2*tile_index]);
    unsigned char attr = data >> 8;
    unsigned char code = data & 0xff;

    SET_TILE_INFO(0, code + ((0x20 + (attr & 0x0f)) << 8), (attr & 0xf0) >> 4);
}
Example #29
0
bool CChatCommandTable::SetTableData(void* pvTable, WCHAR* pwszSheetName, std::wstring* pstrDataName, BSTR bstrData)
{
	if (0 == wcscmp(pwszSheetName, L"Table_Data_KOR"))
	{
		sCHAT_COMMAND_TBLDAT* pChatCommand = (sCHAT_COMMAND_TBLDAT*)pvTable;

		if (0 == wcscmp(pstrDataName->c_str(), L"Tblidx"))
		{
			CheckNegativeInvalid( pstrDataName->c_str(), bstrData );
			pChatCommand->tblidx = READ_DWORD(bstrData);
		}
		else if ( 0 == wcscmp(pstrDataName->c_str(), L"Validity_Able") )
		{
			CheckNegativeInvalid( pstrDataName->c_str(), bstrData );
			pChatCommand->bValidity_Able = READ_BOOL(bstrData, pstrDataName->c_str());
		}
		else if (0 == wcscmp(pstrDataName->c_str(), L"Action_Animation_Index"))
		{
			pChatCommand->wAction_Animation_Index = READ_WORD(bstrData, pstrDataName->c_str());
		}
		else if ( 0 == wcsncmp(pstrDataName->c_str(), L"Chat_Command_", wcslen(L"Chat_Command_") ) )
		{
			bool bFound = false;
			WCHAR szBuffer[1024] = { 0x00, };
			for( int i = 0; i < NTL_MAX_CHAT_COMMAND; i++ )
			{
				swprintf( szBuffer, 1024, L"Chat_Command_%d", i + 1 );

				if( 0 == wcscmp(pstrDataName->c_str(), szBuffer) )
				{
					if ( 0 == i )
						CheckNegativeInvalid( pstrDataName->c_str(), bstrData );
					pChatCommand->aChat_Command[ i ] = READ_DWORD( bstrData);

					bFound = true;
					break;
				}
			}
			if( false == bFound )
			{
				CTable::CallErrorCallbackFunction(L"[File] : %s\n[Error] : Unknown field name found!(Field Name = %s)", m_wszXmlFileName, pstrDataName->c_str());
				return false;
			}
		}
		else
		{
			CTable::CallErrorCallbackFunction(L"[File] : %s\n[Error] : Unknown field name found!(Field Name = %s)", m_wszXmlFileName, pstrDataName->c_str());
			return false;
		}
	}
	else
	{
		_ASSERT(0);
		return false;
	}

	return true;
}
Example #30
0
static void get_sar_tile_info(int tile_index)
{
	int tile=READ_WORD(&videoram[4*tile_index]);
	int color=tile >> 12;

	tile=tile&0xfff;

	SET_TILE_INFO(0,tile,color)
}