inline void gba_state::update_mask(UINT8* mask, int mode, int submode, UINT32* obj_win, UINT8 inwin0, UINT8 inwin1, UINT8 in0_mask, UINT8 in1_mask, UINT8 out_mask) { UINT8 mode_mask = 0; if (submode == GBA_SUBMODE2) { for (int x = 0; x < 240; x++) { mask[x] = out_mask; if ((obj_win[x] & 0x80000000) == 0) mask[x] = m_WINOUT >> 8; if (inwin1) { if (is_in_window(x, 1)) mask[x] = in1_mask; } if (inwin0) { if (is_in_window(x, 0)) mask[x] = in0_mask; } } } if (mode == GBA_MODE1) { // disable line3 mode_mask = ~0x08; } else if (mode == GBA_MODE2) { // disable line0 & line1 mode_mask = ~0x03; } else if (mode == GBA_MODE345) { // disable line0, line1 & line3 mode_mask = ~0x0b; } if (mode_mask) { for (int x = 0; x < 240; x++) mask[x] &= mode_mask; } }
void determine(){ int x, y; int pos; scanf("%d %d ", &x, &y); for(pos=wnum-1;pos>=0; pos--){ if(is_in_window(&win[pos],x,y)){ break; } } printf("%d\n",pos); }