prefer commenting code rather that disbling it with #if 0
This commit is contained in:
parent
af965c4775
commit
cbfa041afc
4 changed files with 82 additions and 95 deletions
158
src/device.c
158
src/device.c
|
@ -58,89 +58,83 @@ void check_devices() {
|
||||||
sched_timer2 = saturn.t2_tick;
|
sched_timer2 = saturn.t2_tick;
|
||||||
device.t2_touched = 0;
|
device.t2_touched = 0;
|
||||||
}
|
}
|
||||||
#if 0
|
/* if (device.disp_test_touched) { */
|
||||||
if (device.disp_test_touched) {
|
/* device.disp_test_touched = 0; */
|
||||||
device.disp_test_touched = 0;
|
/* } */
|
||||||
}
|
/* if (device.crc_touched) { */
|
||||||
if (device.crc_touched) {
|
/* device.crc_touched = 0; */
|
||||||
device.crc_touched = 0;
|
/* } */
|
||||||
}
|
/* if (device.power_status_touched) { */
|
||||||
if (device.power_status_touched) {
|
/* device.power_status_touched = 0; */
|
||||||
device.power_status_touched = 0;
|
/* } */
|
||||||
}
|
/* if (device.power_ctrl_touched) { */
|
||||||
if (device.power_ctrl_touched) {
|
/* device.power_ctrl_touched = 0; */
|
||||||
device.power_ctrl_touched = 0;
|
/* } */
|
||||||
}
|
/* if (device.mode_touched) { */
|
||||||
if (device.mode_touched) {
|
/* device.mode_touched = 0; */
|
||||||
device.mode_touched = 0;
|
/* } */
|
||||||
}
|
/* if (device.card_ctrl_touched) { */
|
||||||
if (device.card_ctrl_touched) {
|
/* device.card_ctrl_touched = 0; */
|
||||||
device.card_ctrl_touched = 0;
|
/* } */
|
||||||
}
|
/* if (device.card_status_touched) { */
|
||||||
if (device.card_status_touched) {
|
/* device.card_status_touched = 0; */
|
||||||
device.card_status_touched = 0;
|
/* } */
|
||||||
}
|
/* if (device.tcs_touched) { */
|
||||||
if (device.tcs_touched) {
|
/* device.tcs_touched = 0; */
|
||||||
device.tcs_touched = 0;
|
/* } */
|
||||||
}
|
/* if (device.rcs_touched) { */
|
||||||
if (device.rcs_touched) {
|
/* device.rcs_touched = 0; */
|
||||||
device.rcs_touched = 0;
|
/* } */
|
||||||
}
|
/* if (device.sreq_touched) { */
|
||||||
if (device.sreq_touched) {
|
/* device.sreq_touched = 0; */
|
||||||
device.sreq_touched = 0;
|
/* } */
|
||||||
}
|
/* if (device.ir_ctrl_touched) { */
|
||||||
if (device.ir_ctrl_touched) {
|
/* device.ir_ctrl_touched = 0; */
|
||||||
device.ir_ctrl_touched = 0;
|
/* } */
|
||||||
}
|
/* if (device.base_off_touched) { */
|
||||||
if (device.base_off_touched) {
|
/* device.base_off_touched = 0; */
|
||||||
device.base_off_touched = 0;
|
/* } */
|
||||||
}
|
/* if (device.lcr_touched) { */
|
||||||
if (device.lcr_touched) {
|
/* device.lcr_touched = 0; */
|
||||||
device.lcr_touched = 0;
|
/* } */
|
||||||
}
|
/* if (device.lbr_touched) { */
|
||||||
if (device.lbr_touched) {
|
/* device.lbr_touched = 0; */
|
||||||
device.lbr_touched = 0;
|
/* } */
|
||||||
}
|
/* if (device.scratch_touched) { */
|
||||||
if (device.scratch_touched) {
|
/* device.scratch_touched = 0; */
|
||||||
device.scratch_touched = 0;
|
/* } */
|
||||||
}
|
/* if (device.base_nibble_touched) { */
|
||||||
if (device.base_nibble_touched) {
|
/* device.base_nibble_touched = 0; */
|
||||||
device.base_nibble_touched = 0;
|
/* } */
|
||||||
}
|
/* if (device.unknown_touched) { */
|
||||||
if (device.unknown_touched) {
|
/* device.unknown_touched = 0; */
|
||||||
device.unknown_touched = 0;
|
/* } */
|
||||||
}
|
/* if (device.t1_ctrl_touched) { */
|
||||||
if (device.t1_ctrl_touched) {
|
/* device.t1_ctrl_touched = 0; */
|
||||||
device.t1_ctrl_touched = 0;
|
/* } */
|
||||||
}
|
/* if (device.t2_ctrl_touched) { */
|
||||||
if (device.t2_ctrl_touched) {
|
/* device.t2_ctrl_touched = 0; */
|
||||||
device.t2_ctrl_touched = 0;
|
/* } */
|
||||||
}
|
/* if (device.unknown2_touched) { */
|
||||||
if (device.unknown2_touched) {
|
/* device.unknown2_touched = 0; */
|
||||||
device.unknown2_touched = 0;
|
/* } */
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
/* #include <fcntl.h> */
|
||||||
|
/* #include <stdio.h> */
|
||||||
|
/* #include <stdlib.h> */
|
||||||
|
/* #include <unistd.h> */
|
||||||
|
|
||||||
#include <fcntl.h>
|
/* void check_out_register(oid) { */
|
||||||
#include <stdio.h>
|
/* static int au = -2; */
|
||||||
#include <stdlib.h>
|
/* unsigned char c[] = { 0xff, 0x00 }; */
|
||||||
#include <unistd.h>
|
|
||||||
|
|
||||||
void check_out_register(oid) {
|
/* if (au == -2) */
|
||||||
static int au = -2;
|
/* if ((au = open("/dev/audio", O_WRONLY)) < 0) */
|
||||||
unsigned char c[] = { 0xff, 0x00 };
|
/* if (au < 0) */
|
||||||
|
/* return; */
|
||||||
if (au == -2)
|
/* if (saturn.OUT[2] & 0x8) */
|
||||||
if ((au = open("/dev/audio", O_WRONLY)) < 0)
|
/* write(au, c, 1); */
|
||||||
if (au < 0)
|
/* else */
|
||||||
return;
|
/* write(au, &c[1], 1); */
|
||||||
if (saturn.OUT[2] & 0x8)
|
/* } */
|
||||||
write(au, c, 1);
|
|
||||||
else
|
|
||||||
write(au, &c[1], 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
|
@ -69,9 +69,8 @@ typedef struct device_t {
|
||||||
|
|
||||||
extern device_t device;
|
extern device_t device;
|
||||||
extern void check_devices();
|
extern void check_devices();
|
||||||
#if 0
|
|
||||||
extern void check_out_register();
|
/* extern void check_out_register(); */
|
||||||
#endif
|
|
||||||
|
|
||||||
extern void update_display();
|
extern void update_display();
|
||||||
extern void redraw_display();
|
extern void redraw_display();
|
||||||
|
|
|
@ -73,16 +73,12 @@ int decode_group_80() {
|
||||||
case 0: /* OUT=CS */
|
case 0: /* OUT=CS */
|
||||||
saturn.PC += 3;
|
saturn.PC += 3;
|
||||||
copy_register( saturn.OUT, saturn.C, OUTS_FIELD );
|
copy_register( saturn.OUT, saturn.C, OUTS_FIELD );
|
||||||
#if 0
|
/* check_out_register(); */
|
||||||
check_out_register();
|
|
||||||
#endif
|
|
||||||
return 0;
|
return 0;
|
||||||
case 1: /* OUT=C */
|
case 1: /* OUT=C */
|
||||||
saturn.PC += 3;
|
saturn.PC += 3;
|
||||||
copy_register( saturn.OUT, saturn.C, OUT_FIELD );
|
copy_register( saturn.OUT, saturn.C, OUT_FIELD );
|
||||||
#if 0
|
/* check_out_register(); */
|
||||||
check_out_register();
|
|
||||||
#endif
|
|
||||||
return 0;
|
return 0;
|
||||||
case 2: /* A=IN */
|
case 2: /* A=IN */
|
||||||
saturn.PC += 3;
|
saturn.PC += 3;
|
||||||
|
|
|
@ -17,9 +17,7 @@
|
||||||
#define MCTL_PORT2_GX 4
|
#define MCTL_PORT2_GX 4
|
||||||
#define MCTL_SysROM_GX 5
|
#define MCTL_SysROM_GX 5
|
||||||
|
|
||||||
#if 0
|
/* extern void init_mmu(); */
|
||||||
extern void init_mmu();
|
/* extern void reset_mmu(); */
|
||||||
extern void reset_mmu();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* !_MMU_H */
|
#endif /* !_MMU_H */
|
||||||
|
|
Loading…
Reference in a new issue