Skip to content

Commit

Permalink
Added blending registers and a linux Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
gdkchan committed Jan 18, 2017
1 parent d99a3ac commit cd07835
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
24 changes: 24 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
TARGET = gdkGBA
LIBS = -lm -lSDL2
CC = gcc
CFLAGS = -std=c99 -g -Wall -Ofast

.PHONY: default all clean

default: $(TARGET)
all: default

OBJECTS += $(patsubst %.c, %.o, $(wildcard *.c))
HEADERS = $(wildcard *.h) $(wildcard *.h)

%.o: %.cpp $(HEADERS)
$(CC) $(CFLAGS) -c $< -o $@

.PRECIOUS: $(TARGET) $(OBJECTS)

$(TARGET): $(OBJECTS)
$(CC) $(OBJECTS) -Wall -Ofast $(LIBS) -o $@

clean:
-rm -f *.o
-rm -f $(TARGET)
8 changes: 8 additions & 0 deletions io.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ uint8_t io_read(uint32_t address) {

case 0x04000050: return bld_cnt.b.b0;
case 0x04000051: return bld_cnt.b.b1;
case 0x04000052: return bld_alpha.b.b0;
case 0x04000053: return bld_alpha.b.b1;
case 0x04000054: return bld_bright.b.b0;
case 0x04000055: return bld_bright.b.b1;

case 0x04000060: return sqr_ch[0].sweep.b.b0;
case 0x04000061: return sqr_ch[0].sweep.b.b1;
Expand Down Expand Up @@ -336,6 +340,10 @@ void io_write(uint32_t address, uint8_t value) {

case 0x04000050: bld_cnt.b.b0 = value; break;
case 0x04000051: bld_cnt.b.b1 = value; break;
case 0x04000052: bld_alpha.b.b0 = value; break;
case 0x04000053: bld_alpha.b.b1 = value; break;
case 0x04000054: bld_bright.b.b0 = value; break;
case 0x04000055: bld_bright.b.b1 = value; break;

case 0x04000060:
if (snd_psg_enb.w & PSG_ENB)
Expand Down
2 changes: 2 additions & 0 deletions io.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ io_reg win_in;
io_reg win_out;

io_reg bld_cnt;
io_reg bld_alpha;
io_reg bld_bright;

#define SWEEP_DEC (1 << 3)
#define ENV_INC (1 << 11)
Expand Down

0 comments on commit cd07835

Please sign in to comment.