Small improvement of using the compilation switches

This commit is contained in:
Vincent Barrilliot 2023-02-26 21:17:06 +01:00
parent e0c9e7d7c0
commit 600adcf406
5 changed files with 1130 additions and 1131 deletions

View file

@ -362,13 +362,7 @@ short chan_write(short channel, const uint8_t * buffer, short size) {
p_channel chan;
p_dev_chan cdev;
short res;
short test=0x1234;
log(LOG_TRACE,"chan_write(%d,%p,%x)", channel, buffer, test/*(int)size*/);
TRACE1("chan_write(%d)", (short)channel);
TRACE1("chan_write(,%p,)", buffer);
TRACE1("chan_write(,,%x)", (short)test/*(int)size*/);
// log_num(LOG_INFO, "chan_write: ", channel);
log(LOG_TRACE,"chan_write(%d,%p,%x)", channel, buffer, (int)size);
res = chan_get_records(channel, &chan, &cdev);
if (res == 0)

View file

@ -89,7 +89,7 @@ extern void cdev_init_system();
* Inputs:
* p_dev_chan = pointer to the description of the channel device
*/
extern short cdev_register(const p_dev_chan device);
extern short cdev_register(p_dev_chan device);
/*
* Get a free channel

View file

@ -7,6 +7,7 @@
#include <ctype.h>
#include <string.h>
#include "features.h"
#include "log.h"
#include "types.h"
#include "constants.h"
@ -818,7 +819,7 @@ short con_install() {
chan_open(CDEV_CONSOLE, 0, 0);
#if HAS_DUAL_SCREEN
#if MODEL == MODEL_FOENIX_A2560K || MODEL == MODEL_FOENIX_GENX || MODEL == MODEL_FOENIX_A2560X
chan_open(CDEV_EVID, 0, 0);
#endif

View file

@ -15,7 +15,7 @@
#include "dev/kbd_mo.h"
#endif
#if (MODEL == MODEL_FOENIX_A2560K || MODEL == MODEL_FOENIX_GENX || MODEL == MODEL_FOENIX_A2560X)
#if ( MODEL == MODEL_FOENIX_A2560K || MODEL == MODEL_FOENIX_GENX || MODEL == MODEL_FOENIX_A2560X)
short ind_state_color(short state) {
switch (state) {
case IND_ON:
@ -27,7 +27,7 @@ short ind_state_color(short state) {
#elif MODEL == MODEL_FOENIX_A2560X
return 0x06;
#else
return 0x03; // That is not possble because of the #if so why did Stefany mean ?
return 0x03;
#endif
case IND_ERROR:
/* Red for error */
@ -95,12 +95,15 @@ void ind_set_hdc(short state) {
}
#else
void ind_set_fdc(short state) {
}
void ind_set_sdc(short state) {
}
void ind_set_hdc(short state) {
}
#endif
@ -113,11 +116,10 @@ void ind_set_hdc(short state) {
*/
void ind_set(short ind_number, short state) {
switch (ind_number) {
#if (MODEL == MODEL_FOENIX_A2560K || MODEL == MODEL_FOENIX_GENX || MODEL == MODEL_FOENIX_A2560X)
case IND_POWER:
ind_set_power(state);
break;
#endif
case IND_FDC:
ind_set_fdc(state);
break;

View file

@ -2,6 +2,7 @@
* Master file for the Yamaha sound chips
*/
#include "features.h"
#include "sound_reg.h"
#include "snd/yamaha.h"
@ -16,7 +17,7 @@
*/
void ym_write(enum e_ym_snd_dev dev, enum e_ym_position position, short port, unsigned char value) {
switch (dev) {
#if MODEL == MODEL_FOENIX_A2560K
#if HAS_OPN
case SND_OPN2:
switch (position) {
case EXTERNAL:
@ -31,7 +32,8 @@ void ym_write(enum e_ym_snd_dev dev, enum e_ym_position position, short port, un
break;
}
break;
#endif
#if HAS_OPM
case SND_OPM:
switch (position) {
case EXTERNAL:
@ -63,22 +65,22 @@ void ym_init() {
short position;
short port;
#if MODEL == MODEL_FOENIX_A2560K
#if HAS_OPN
/* OPN */
for (position = EXTERNAL; position <= INTERNAL; position++) {
for (port = 0x40; port <= 0x4F; port++) {
ym_write(SND_OPN2, position, port, 0x7F); /* Maximum attentuation */
}
}
#endif
#if HAS_OPM
/* OPM */
for (position = EXTERNAL; position <= INTERNAL; position++) {
for (port = 0x60; port <= 0x6F; port++) {
ym_write(SND_OPM, position, port, 0x7F); /* Maximum attentuation */
}
}
#endif
/* OPL3 */