emulator/cpu/buffer.h
static inline bool buffer_get(buffer_t *buffer, uint8_t *b_ptr) {
  if (buffer->read_position == buffer->write_position) {
    return false;
  }
  *b_ptr = buffer->data[buffer->read_position];
  size_t new_read = buffer->read_position + 1;
  if (new_read >= sizeof(buffer->data)) {
    new_read = 0;
  }
  buffer->read_position = new_read;
  return true;
}
// returns:
//   true  if byte was retrieved
//   false if buffer is empty
true  if byte was retrieved
false if buffer is empty
true if byte was retrieved false if buffer is empty
static inline bool buffer_get(buffer_t *buffer, uint8_t *b_ptr) {
  if (buffer->read_position == buffer->write_position) {
    return false;
  }
  *b_ptr = buffer->data[buffer->read_position];
  size_t new_read = buffer->read_position + 1;
  if (new_read >= sizeof(buffer->data)) {
    new_read = 0;
  }
  buffer->read_position = new_read;
  return true;
}
static inline bool buffer_get ( buffer_t * buffer , uint8_t * b_ptr ) { if ( buffer -> read_position == buffer -> write_position ) { return false ; } * b_ptr = buffer -> data [ buffer -> read_position ] ; size_t new_read = buffer -> read_position + 1 ; if ( new_read >= sizeof ( buffer -> data ) ) { new_read = 0 ; } buffer -> read_position = new_read ; return true ; }
returns:
true  if byte was retrieved
false if buffer is empty
returns : true if byte was retrieved false if buffer is empty