megadrive_test2
diff src/main.c @ 10:ca7108a82867
fixed gamepad input on real megadrive
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sat, 24 Jun 2017 02:33:52 +0300 |
parents | 6ecf2f3ff05a |
children |
line diff
1.1 --- a/src/main.c Sat Jun 24 00:33:10 2017 +0300 1.2 +++ b/src/main.c Sat Jun 24 02:33:52 2017 +0300 1.3 @@ -3,6 +3,7 @@ 1.4 #include "io.h" 1.5 #include "pad.h" 1.6 #include "intr.h" 1.7 +#include "debug.h" 1.8 #include "tun_data.h" 1.9 1.10 #define NAMETAB_A 6 1.11 @@ -27,12 +28,16 @@ 1.12 VDP_PACK_RGB(7, 0, 3) /* 15: fixed */ 1.13 }; 1.14 1.15 +static uint16_t dbg; 1.16 + 1.17 1.18 int main(void) 1.19 { 1.20 int i, j; 1.21 1.22 vdp_init(); 1.23 + io_init(); 1.24 + dbg_init(); 1.25 1.26 if(IO_REG_VER & IO_VER_PAL) { 1.27 vdp_setreg(VDP_REG_MODE2, vdp_getreg(VDP_REG_MODE2) | VDP_MODE2_V30CELL); 1.28 @@ -65,6 +70,7 @@ 1.29 if(pad_pressed(0, IO_PAD_C)) { 1.30 disable_intr(); 1.31 vdp_setreg(VDP_REG_MODE2, vdp_getreg(VDP_REG_MODE2) ^ VDP_MODE2_V30CELL); 1.32 + vdp_set_bgcolor(DBG_PALIDX, ++dbg & 1); 1.33 enable_intr(); 1.34 } 1.35