mirror of
https://github.com/mlaux/gb6.git
synced 2025-01-02 16:29:34 +00:00
fix 8x16, inconsistent flags for lcd (1 << n) vs just n
This commit is contained in:
parent
e32535b016
commit
f79100694d
@ -7,18 +7,18 @@
|
||||
|
||||
void lcd_set_bit(struct lcd *lcd, u16 addr, u8 bit)
|
||||
{
|
||||
lcd_write(lcd, addr, lcd_read(lcd, addr) | (1 << bit));
|
||||
lcd_write(lcd, addr, lcd_read(lcd, addr) | bit);
|
||||
}
|
||||
|
||||
void lcd_clear_bit(struct lcd *lcd, u16 addr, u8 bit)
|
||||
{
|
||||
lcd_write(lcd, addr, lcd_read(lcd, addr) & ~(1 << bit));
|
||||
lcd_write(lcd, addr, lcd_read(lcd, addr) & ~bit);
|
||||
}
|
||||
|
||||
int lcd_isset(struct lcd *lcd, u16 addr, u8 bit)
|
||||
{
|
||||
u8 val = lcd_read(lcd, addr);
|
||||
return val & (1 << bit);
|
||||
return val & bit;
|
||||
}
|
||||
|
||||
void lcd_set_mode(struct lcd *lcd, int mode)
|
||||
|
10
src/lcd.h
10
src/lcd.h
@ -23,11 +23,11 @@
|
||||
|
||||
#define REG_LCD_LAST REG_WX
|
||||
|
||||
#define STAT_FLAG_MATCH 2
|
||||
#define STAT_INTR_SOURCE_HBLANK 3
|
||||
#define STAT_INTR_SOURCE_VBLANK 4
|
||||
#define STAT_INTR_SOURCE_MODE2 5
|
||||
#define STAT_INTR_SOURCE_MATCH 6
|
||||
#define STAT_FLAG_MATCH (1 << 2)
|
||||
#define STAT_INTR_SOURCE_HBLANK (1 << 3)
|
||||
#define STAT_INTR_SOURCE_VBLANK (1 << 4)
|
||||
#define STAT_INTR_SOURCE_MODE2 (1 << 5)
|
||||
#define STAT_INTR_SOURCE_MATCH (1 << 6)
|
||||
|
||||
|
||||
#define LCDC_ENABLE_BG (1 << 0)
|
||||
|
Loading…
Reference in New Issue
Block a user