diff options
-rw-r--r-- | roms/audio.rom | bin | 435 -> 959 bytes | |||
-rw-r--r-- | roms/automata.rom | bin | 255 -> 243 bytes | |||
-rw-r--r-- | roms/bifurcan.rom | bin | 583 -> 634 bytes | |||
-rw-r--r-- | roms/controller.rom | bin | 958 -> 958 bytes | |||
-rw-r--r-- | roms/dvd.rom | bin | 307 -> 307 bytes | |||
-rw-r--r-- | roms/file.load.rom | bin | 1233 -> 1230 bytes | |||
-rw-r--r-- | roms/file.save.rom | bin | 108 -> 108 bytes | |||
-rw-r--r-- | roms/hover.rom | bin | 502 -> 493 bytes | |||
-rw-r--r-- | roms/label.rom | bin | 1439 -> 1434 bytes | |||
-rw-r--r-- | roms/multichannel.audio.rom | bin | 1228 -> 1228 bytes | |||
-rw-r--r-- | roms/noodle.rom | bin | 0 -> 7274 bytes | |||
-rw-r--r-- | roms/polycat.rom | bin | 793 -> 793 bytes | |||
-rw-r--r-- | roms/proportional_fonts.rom | bin | 1333 -> 1330 bytes | |||
-rw-r--r-- | roms/screen.rom | bin | 785 -> 785 bytes | |||
-rw-r--r-- | roms/shapes.rom | bin | 1055 -> 1147 bytes | |||
-rw-r--r-- | roms/theme.rom | bin | 3224 -> 3152 bytes | |||
-rw-r--r-- | roms/wallpaper.rom | bin | 190 -> 181 bytes | |||
-rw-r--r-- | src/main.c | 79 | ||||
-rw-r--r-- | src/uxn.h | 1 |
19 files changed, 50 insertions, 30 deletions
diff --git a/roms/audio.rom b/roms/audio.rom index 614c817..15c8f2d 100644 --- a/roms/audio.rom +++ b/roms/audio.rom | |||
Binary files differ | |||
diff --git a/roms/automata.rom b/roms/automata.rom index ec6dfb9..9c0b3f7 100644 --- a/roms/automata.rom +++ b/roms/automata.rom | |||
Binary files differ | |||
diff --git a/roms/bifurcan.rom b/roms/bifurcan.rom index 284e22a..92e613f 100644 --- a/roms/bifurcan.rom +++ b/roms/bifurcan.rom | |||
Binary files differ | |||
diff --git a/roms/controller.rom b/roms/controller.rom index 3e786fb..eb672b3 100644 --- a/roms/controller.rom +++ b/roms/controller.rom | |||
Binary files differ | |||
diff --git a/roms/dvd.rom b/roms/dvd.rom index 7ddabe9..9d47e7d 100644 --- a/roms/dvd.rom +++ b/roms/dvd.rom | |||
Binary files differ | |||
diff --git a/roms/file.load.rom b/roms/file.load.rom index e99bae3..1f486ee 100644 --- a/roms/file.load.rom +++ b/roms/file.load.rom | |||
Binary files differ | |||
diff --git a/roms/file.save.rom b/roms/file.save.rom index 8680264..6d8debb 100644 --- a/roms/file.save.rom +++ b/roms/file.save.rom | |||
Binary files differ | |||
diff --git a/roms/hover.rom b/roms/hover.rom index 9ad97a1..3c59f52 100644 --- a/roms/hover.rom +++ b/roms/hover.rom | |||
Binary files differ | |||
diff --git a/roms/label.rom b/roms/label.rom index c8fe6b8..fc5fd9c 100644 --- a/roms/label.rom +++ b/roms/label.rom | |||
Binary files differ | |||
diff --git a/roms/multichannel.audio.rom b/roms/multichannel.audio.rom index dc1d708..e737701 100644 --- a/roms/multichannel.audio.rom +++ b/roms/multichannel.audio.rom | |||
Binary files differ | |||
diff --git a/roms/noodle.rom b/roms/noodle.rom new file mode 100644 index 0000000..4776074 --- /dev/null +++ b/roms/noodle.rom | |||
Binary files differ | |||
diff --git a/roms/polycat.rom b/roms/polycat.rom index a8c3a22..cc9df69 100644 --- a/roms/polycat.rom +++ b/roms/polycat.rom | |||
Binary files differ | |||
diff --git a/roms/proportional_fonts.rom b/roms/proportional_fonts.rom index 2208d35..ff8291b 100644 --- a/roms/proportional_fonts.rom +++ b/roms/proportional_fonts.rom | |||
Binary files differ | |||
diff --git a/roms/screen.rom b/roms/screen.rom index de04425..ced1f64 100644 --- a/roms/screen.rom +++ b/roms/screen.rom | |||
Binary files differ | |||
diff --git a/roms/shapes.rom b/roms/shapes.rom index 0aeabac..9e6acfb 100644 --- a/roms/shapes.rom +++ b/roms/shapes.rom | |||
Binary files differ | |||
diff --git a/roms/theme.rom b/roms/theme.rom index b3eb1ef..58d0e41 100644 --- a/roms/theme.rom +++ b/roms/theme.rom | |||
Binary files differ | |||
diff --git a/roms/wallpaper.rom b/roms/wallpaper.rom index 81a55f0..114f465 100644 --- a/roms/wallpaper.rom +++ b/roms/wallpaper.rom | |||
Binary files differ | |||
@@ -129,36 +129,55 @@ system_talk(Device *d, u8 b0, u8 w) { | |||
129 | IWRAM_CODE | 129 | IWRAM_CODE |
130 | void | 130 | void |
131 | screen_talk(Device *d, u8 b0, u8 w) { | 131 | screen_talk(Device *d, u8 b0, u8 w) { |
132 | if(w && b0 == 0xe) { | 132 | if (w) { |
133 | u16 x = mempeek16(d->dat, 0x8); | 133 | switch (b0) { |
134 | u16 y = mempeek16(d->dat, 0xa); | 134 | case 0x1: { |
135 | u8 *addr = &d->mem[mempeek16(d->dat, 0xc)]; | 135 | d->vector = mempeek16(d->dat, 0x0); |
136 | u8 *layer = d->dat[0xe] >> 4 & 0x1 ? ppu.fg : ppu.bg; | 136 | } break; |
137 | u8 mode = d->dat[0xe] >> 5; | 137 | case 0xe: { |
138 | u8 color = d->dat[0xf] & 0xf; | 138 | u16 x = mempeek16(d->dat, 0x8); |
139 | if(!mode) { | 139 | u16 y = mempeek16(d->dat, 0xa); |
140 | ppu_pixel(layer, x, y, d->dat[0xe] & 0x3); | 140 | u8 *addr = &d->mem[mempeek16(d->dat, 0xc)]; |
141 | } else if(mode-- & 0x1) { | 141 | u8 *layer = d->dat[0xe] >> 4 & 0x1 ? ppu.fg : ppu.bg; |
142 | u8 flipx = mode & 0x2; | 142 | u8 mode = d->dat[0xe] >> 5; |
143 | u8 flipy = mode & 0x4; | 143 | u8 color = d->dat[0xf] & 0xf; |
144 | ppu_1bpp(layer, x, y, addr, color, flipx, flipy); | 144 | if(!mode) { |
145 | } else { | 145 | ppu_pixel(layer, x, y, d->dat[0xe] & 0x3); |
146 | u8 flipx = mode & 0x2; | 146 | } else if(mode-- & 0x1) { |
147 | u8 flipy = mode & 0x4; | 147 | u8 flipx = mode & 0x2; |
148 | ppu_2bpp(layer, x, y, addr, color, flipx, flipy); | 148 | u8 flipy = mode & 0x4; |
149 | } | 149 | ppu_1bpp(layer, x, y, addr, color, flipx, flipy); |
150 | } else if(w && b0 == 0xf) { | 150 | } else { |
151 | u16 x = mempeek16(d->dat, 0x8); | 151 | u8 flipx = mode & 0x2; |
152 | u16 y = mempeek16(d->dat, 0xa); | 152 | u8 flipy = mode & 0x4; |
153 | u8 *addr = &d->mem[mempeek16(d->dat, 0xc)]; | 153 | ppu_2bpp(layer, x, y, addr, color, flipx, flipy); |
154 | u8 *layer = d->dat[0xf] >> 6 & 0x1 ? ppu.fg : ppu.bg; | 154 | } |
155 | u8 color = d->dat[0xf] & 0xf; | 155 | if(d->dat[0x6] & 0x01) { mempoke16(d->dat, 0x8, x + 1); } |
156 | u8 flipx = (d->dat[0xf] >> 0x4) & 0x1; | 156 | if(d->dat[0x6] & 0x02) { mempoke16(d->dat, 0xa, y + 1); } |
157 | u8 flipy = (d->dat[0xf] >> 0x5) & 0x1; | 157 | } break; |
158 | if(d->dat[0xf] >> 0x7 & 0x1) { | 158 | case 0xf: { |
159 | ppu_2bpp(layer, x, y, addr, color, flipx, flipy); | 159 | u16 x = mempeek16(d->dat, 0x8); |
160 | } else { | 160 | u16 y = mempeek16(d->dat, 0xa); |
161 | ppu_1bpp(layer, x, y, addr, color, flipx, flipy); | 161 | u8 *addr = &d->mem[mempeek16(d->dat, 0xc)]; |
162 | u8 *layer = d->dat[0xf] >> 6 & 0x1 ? ppu.fg : ppu.bg; | ||
163 | u8 color = d->dat[0xf] & 0xf; | ||
164 | u8 flipx = (d->dat[0xf] >> 0x4) & 0x1; | ||
165 | u8 flipy = (d->dat[0xf] >> 0x5) & 0x1; | ||
166 | if(d->dat[0xf] >> 0x7 & 0x1) { | ||
167 | ppu_2bpp(layer, x, y, addr, color, flipx, flipy); | ||
168 | if(d->dat[0x6] & 0x04) { | ||
169 | mempoke16(d->dat, 0xc, mempeek16(d->dat, 0xc) + 16); | ||
170 | } | ||
171 | } else { | ||
172 | ppu_1bpp(layer, x, y, addr, color, flipx, flipy); | ||
173 | if(d->dat[0x6] & 0x04) { | ||
174 | mempoke16(d->dat, 0xc, mempeek16(d->dat, 0xc) + 8); | ||
175 | } | ||
176 | } | ||
177 | if(d->dat[0x6] & 0x01) { mempoke16(d->dat, 0x8, x + 8); } | ||
178 | if(d->dat[0x6] & 0x02) { mempoke16(d->dat, 0xa, y + 8); } | ||
179 | } break; | ||
180 | default: break; | ||
162 | } | 181 | } |
163 | } | 182 | } |
164 | } | 183 | } |
@@ -29,6 +29,7 @@ typedef struct { | |||
29 | typedef struct Device { | 29 | typedef struct Device { |
30 | struct Uxn *u; | 30 | struct Uxn *u; |
31 | u8 addr, dat[16], *mem; | 31 | u8 addr, dat[16], *mem; |
32 | u16 vector; | ||
32 | void (*talk)(struct Device *d, u8, u8); | 33 | void (*talk)(struct Device *d, u8, u8); |
33 | } Device; | 34 | } Device; |
34 | 35 | ||