From cbfa041afc2f9c89a023785c6c79f29a5ce743a4 Mon Sep 17 00:00:00 2001 From: Gwenhael Le Moine Date: Wed, 3 May 2023 10:40:15 +0200 Subject: [PATCH] prefer commenting code rather that disbling it with #if 0 --- src/device.c | 158 ++++++++++++++++++++++++-------------------------- src/device.h | 5 +- src/emulate.c | 8 +-- src/mmu.h | 6 +- 4 files changed, 82 insertions(+), 95 deletions(-) diff --git a/src/device.c b/src/device.c index 9380a78..5b54321 100644 --- a/src/device.c +++ b/src/device.c @@ -58,89 +58,83 @@ void check_devices() { sched_timer2 = saturn.t2_tick; device.t2_touched = 0; } -#if 0 - if (device.disp_test_touched) { - device.disp_test_touched = 0; - } - if (device.crc_touched) { - device.crc_touched = 0; - } - if (device.power_status_touched) { - device.power_status_touched = 0; - } - if (device.power_ctrl_touched) { - device.power_ctrl_touched = 0; - } - if (device.mode_touched) { - device.mode_touched = 0; - } - if (device.card_ctrl_touched) { - device.card_ctrl_touched = 0; - } - if (device.card_status_touched) { - device.card_status_touched = 0; - } - if (device.tcs_touched) { - device.tcs_touched = 0; - } - if (device.rcs_touched) { - device.rcs_touched = 0; - } - if (device.sreq_touched) { - device.sreq_touched = 0; - } - if (device.ir_ctrl_touched) { - device.ir_ctrl_touched = 0; - } - if (device.base_off_touched) { - device.base_off_touched = 0; - } - if (device.lcr_touched) { - device.lcr_touched = 0; - } - if (device.lbr_touched) { - device.lbr_touched = 0; - } - if (device.scratch_touched) { - device.scratch_touched = 0; - } - if (device.base_nibble_touched) { - device.base_nibble_touched = 0; - } - if (device.unknown_touched) { - device.unknown_touched = 0; - } - if (device.t1_ctrl_touched) { - device.t1_ctrl_touched = 0; - } - if (device.t2_ctrl_touched) { - device.t2_ctrl_touched = 0; - } - if (device.unknown2_touched) { - device.unknown2_touched = 0; - } -#endif +/* if (device.disp_test_touched) { */ +/* device.disp_test_touched = 0; */ +/* } */ +/* if (device.crc_touched) { */ +/* device.crc_touched = 0; */ +/* } */ +/* if (device.power_status_touched) { */ +/* device.power_status_touched = 0; */ +/* } */ +/* if (device.power_ctrl_touched) { */ +/* device.power_ctrl_touched = 0; */ +/* } */ +/* if (device.mode_touched) { */ +/* device.mode_touched = 0; */ +/* } */ +/* if (device.card_ctrl_touched) { */ +/* device.card_ctrl_touched = 0; */ +/* } */ +/* if (device.card_status_touched) { */ +/* device.card_status_touched = 0; */ +/* } */ +/* if (device.tcs_touched) { */ +/* device.tcs_touched = 0; */ +/* } */ +/* if (device.rcs_touched) { */ +/* device.rcs_touched = 0; */ +/* } */ +/* if (device.sreq_touched) { */ +/* device.sreq_touched = 0; */ +/* } */ +/* if (device.ir_ctrl_touched) { */ +/* device.ir_ctrl_touched = 0; */ +/* } */ +/* if (device.base_off_touched) { */ +/* device.base_off_touched = 0; */ +/* } */ +/* if (device.lcr_touched) { */ +/* device.lcr_touched = 0; */ +/* } */ +/* if (device.lbr_touched) { */ +/* device.lbr_touched = 0; */ +/* } */ +/* if (device.scratch_touched) { */ +/* device.scratch_touched = 0; */ +/* } */ +/* if (device.base_nibble_touched) { */ +/* device.base_nibble_touched = 0; */ +/* } */ +/* if (device.unknown_touched) { */ +/* device.unknown_touched = 0; */ +/* } */ +/* if (device.t1_ctrl_touched) { */ +/* device.t1_ctrl_touched = 0; */ +/* } */ +/* if (device.t2_ctrl_touched) { */ +/* device.t2_ctrl_touched = 0; */ +/* } */ +/* if (device.unknown2_touched) { */ +/* device.unknown2_touched = 0; */ +/* } */ } -#if 0 +/* #include */ +/* #include */ +/* #include */ +/* #include */ -#include -#include -#include -#include +/* void check_out_register(oid) { */ +/* static int au = -2; */ +/* unsigned char c[] = { 0xff, 0x00 }; */ -void check_out_register(oid) { - static int au = -2; - unsigned char c[] = { 0xff, 0x00 }; - - if (au == -2) - if ((au = open("/dev/audio", O_WRONLY)) < 0) - if (au < 0) - return; - if (saturn.OUT[2] & 0x8) - write(au, c, 1); - else - write(au, &c[1], 1); -} - -#endif +/* if (au == -2) */ +/* if ((au = open("/dev/audio", O_WRONLY)) < 0) */ +/* if (au < 0) */ +/* return; */ +/* if (saturn.OUT[2] & 0x8) */ +/* write(au, c, 1); */ +/* else */ +/* write(au, &c[1], 1); */ +/* } */ diff --git a/src/device.h b/src/device.h index 0c615f8..6a24f3a 100644 --- a/src/device.h +++ b/src/device.h @@ -69,9 +69,8 @@ typedef struct device_t { extern device_t device; extern void check_devices(); -#if 0 -extern void check_out_register(); -#endif + +/* extern void check_out_register(); */ extern void update_display(); extern void redraw_display(); diff --git a/src/emulate.c b/src/emulate.c index 0ccef90..99b8609 100644 --- a/src/emulate.c +++ b/src/emulate.c @@ -73,16 +73,12 @@ int decode_group_80() { case 0: /* OUT=CS */ saturn.PC += 3; copy_register( saturn.OUT, saturn.C, OUTS_FIELD ); -#if 0 - check_out_register(); -#endif + /* check_out_register(); */ return 0; case 1: /* OUT=C */ saturn.PC += 3; copy_register( saturn.OUT, saturn.C, OUT_FIELD ); -#if 0 - check_out_register(); -#endif + /* check_out_register(); */ return 0; case 2: /* A=IN */ saturn.PC += 3; diff --git a/src/mmu.h b/src/mmu.h index 495a27e..c003710 100644 --- a/src/mmu.h +++ b/src/mmu.h @@ -17,9 +17,7 @@ #define MCTL_PORT2_GX 4 #define MCTL_SysROM_GX 5 -#if 0 -extern void init_mmu(); -extern void reset_mmu(); -#endif +/* extern void init_mmu(); */ +/* extern void reset_mmu(); */ #endif /* !_MMU_H */