void tms5220_data_write(int data) { /* add this byte to the FIFO */ if (fifo_count < FIFO_SIZE) { fifo[fifo_tail] = data; fifo_tail = (fifo_tail + 1) % FIFO_SIZE; fifo_count++; /* if we were speaking, then we're no longer empty */ if (speak_external) buffer_empty = 0; if (DEBUG_5220) logerror("Added byte to FIFO (size=%2d)\n", fifo_count); } else { if (DEBUG_5220) logerror("Ran out of room in the FIFO!\n"); } /* update the buffer low state */ check_buffer_low(); if (! speak_external) /* R Nabet : we parse commands at once. It is necessary for such commands as read. */ process_command (/*data*/); }
void tms5220_data_write_chip(void *chip, int data) { struct tms5220 *tms = chip; /* add this byte to the FIFO */ if (tms->fifo_count < FIFO_SIZE) { tms->fifo[tms->fifo_tail] = data; tms->fifo_tail = (tms->fifo_tail + 1) % FIFO_SIZE; tms->fifo_count++; /* if we were speaking, then we're no longer empty */ if (tms->speak_external) tms->buffer_empty = 0; if (DEBUG_5220) logerror("Added byte to FIFO (size=%2d)\n", tms->fifo_count); } else { if (DEBUG_5220) logerror("Ran out of room in the FIFO!\n"); } /* update the buffer low state */ check_buffer_low(tms); if (! tms->speak_external) /* R Nabet : we parse commands at once. It is necessary for such commands as read. */ process_command (tms/*data*/); }