Changed bx_bool to bool type in the harddrv, cdrom, hdimage and sound code.

This commit is contained in:
Volker Ruppert 2021-01-31 15:44:39 +00:00
parent 1765a06d01
commit 45e03f9572
39 changed files with 264 additions and 264 deletions

View File

@ -730,7 +730,7 @@ void bx_hard_drive_c::runtime_config(void)
{ {
char pname[16]; char pname[16];
int handle; int handle;
bx_bool status; bool status;
for (Bit8u channel=0; channel<BX_MAX_ATA_CHANNEL; channel++) { for (Bit8u channel=0; channel<BX_MAX_ATA_CHANNEL; channel++) {
for (Bit8u device=0; device<2; device++) { for (Bit8u device=0; device<2; device++) {
@ -1055,7 +1055,7 @@ Bit32u bx_hard_drive_c::read(Bit32u address, unsigned io_len)
// b4: DRV // b4: DRV
// b3..0 HD3..HD0 // b3..0 HD3..HD0
value8 = (1 << 7) | value8 = (1 << 7) |
(controller->lba_mode << 6) | ((Bit8u)controller->lba_mode << 6) |
(1 << 5) | // 01b = 512 sector size (1 << 5) | // 01b = 512 sector size
(BX_HD_THIS channels[channel].drive_select << 4) | (BX_HD_THIS channels[channel].drive_select << 4) |
(controller->head_no << 0); (controller->head_no << 0);
@ -1068,14 +1068,14 @@ Bit32u bx_hard_drive_c::read(Bit32u address, unsigned io_len)
value8 = 0; value8 = 0;
} else { } else {
value8 = ( value8 = (
(controller->status.busy << 7) | ((Bit8u)controller->status.busy << 7) |
(controller->status.drive_ready << 6) | ((Bit8u)controller->status.drive_ready << 6) |
(controller->status.write_fault << 5) | ((Bit8u)controller->status.write_fault << 5) |
(controller->status.seek_complete << 4) | ((Bit8u)controller->status.seek_complete << 4) |
(controller->status.drq << 3) | ((Bit8u)controller->status.drq << 3) |
(controller->status.corrected_data << 2) | ((Bit8u)controller->status.corrected_data << 2) |
(controller->status.index_pulse << 1) | ((Bit8u)controller->status.index_pulse << 1) |
(controller->status.err)); ((Bit8u)controller->status.err));
controller->status.index_pulse_count++; controller->status.index_pulse_count++;
controller->status.index_pulse = 0; controller->status.index_pulse = 0;
if (controller->status.index_pulse_count >= INDEX_PULSE_CYCLE) { if (controller->status.index_pulse_count >= INDEX_PULSE_CYCLE) {
@ -1137,8 +1137,8 @@ void bx_hard_drive_c::write(Bit32u address, Bit32u value, unsigned io_len)
UNUSED(this_ptr); UNUSED(this_ptr);
#endif // !BX_USE_HD_SMF #endif // !BX_USE_HD_SMF
Bit64s logical_sector; Bit64s logical_sector;
bx_bool prev_control_reset; bool prev_control_reset;
bx_bool lba48 = 0; bool lba48 = 0;
Bit8u channel = BX_MAX_ATA_CHANNEL; Bit8u channel = BX_MAX_ATA_CHANNEL;
Bit32u port = 0xff; // undefined Bit32u port = 0xff; // undefined
@ -1335,9 +1335,9 @@ void bx_hard_drive_c::write(Bit32u address, Bit32u value, unsigned io_len)
case 0x1b: // start stop unit case 0x1b: // start stop unit
{ {
char ata_name[20]; char ata_name[20];
//bx_bool Immed = (controller->buffer[1] >> 0) & 1; //bool Immed = (controller->buffer[1] >> 0) & 1;
bx_bool LoEj = (controller->buffer[4] >> 1) & 1; bool LoEj = (controller->buffer[4] >> 1) & 1;
bx_bool Start = (controller->buffer[4] >> 0) & 1; bool Start = (controller->buffer[4] >> 0) & 1;
if (!LoEj && !Start) { // stop the disc if (!LoEj && !Start) { // stop the disc
BX_ERROR(("FIXME: Stop disc not implemented")); BX_ERROR(("FIXME: Stop disc not implemented"));
@ -1428,7 +1428,7 @@ void bx_hard_drive_c::write(Bit32u address, Bit32u value, unsigned io_len)
controller->buffer[12] = 0x71; controller->buffer[12] = 0x71;
controller->buffer[13] = (3 << 5); controller->buffer[13] = (3 << 5);
controller->buffer[14] = (unsigned char) (1 | controller->buffer[14] = (unsigned char) (1 |
(BX_SELECTED_DRIVE(channel).cdrom.locked ? (1 << 1) : 0) | ((Bit8u)BX_SELECTED_DRIVE(channel).cdrom.locked ? (1 << 1) : 0) |
(1 << 3) | (1 << 3) |
(1 << 5)); (1 << 5));
controller->buffer[15] = 0x00; controller->buffer[15] = 0x00;
@ -1505,7 +1505,7 @@ void bx_hard_drive_c::write(Bit32u address, Bit32u value, unsigned io_len)
controller->buffer[12] = 0x71; controller->buffer[12] = 0x71;
controller->buffer[13] = (3 << 5); controller->buffer[13] = (3 << 5);
controller->buffer[14] = (unsigned char) (1 | controller->buffer[14] = (unsigned char) (1 |
(BX_SELECTED_DRIVE(channel).cdrom.locked ? (1 << 1) : 0) | ((Bit8u)BX_SELECTED_DRIVE(channel).cdrom.locked ? (1 << 1) : 0) |
(1 << 3) | (1 << 3) |
(1 << 5)); (1 << 5));
controller->buffer[15] = 0x00; controller->buffer[15] = 0x00;
@ -1658,7 +1658,7 @@ void bx_hard_drive_c::write(Bit32u address, Bit32u value, unsigned io_len)
case 0x43: // read toc case 0x43: // read toc
if (BX_SELECTED_DRIVE(channel).cdrom.ready) { if (BX_SELECTED_DRIVE(channel).cdrom.ready) {
bx_bool msf = (controller->buffer[1] >> 1) & 1; bool msf = (controller->buffer[1] >> 1) & 1;
Bit8u starting_track = controller->buffer[6]; Bit8u starting_track = controller->buffer[6];
int toc_length = 0; int toc_length = 0;
Bit16u alloc_length = read_16bit(controller->buffer + 7); Bit16u alloc_length = read_16bit(controller->buffer + 7);
@ -1800,8 +1800,8 @@ void bx_hard_drive_c::write(Bit32u address, Bit32u value, unsigned io_len)
case 0x42: // read sub-channel case 0x42: // read sub-channel
{ {
bx_bool msf = get_packet_field(controller,1, 1, 1); bool msf = get_packet_field(controller,1, 1, 1);
bx_bool sub_q = get_packet_field(controller,2, 6, 1); bool sub_q = get_packet_field(controller,2, 6, 1);
Bit8u data_format = get_packet_byte(controller, 3); Bit8u data_format = get_packet_byte(controller, 3);
Bit8u track_number = get_packet_byte(controller, 6); Bit8u track_number = get_packet_byte(controller, 6);
Bit16u alloc_length = get_packet_word(controller, 7); Bit16u alloc_length = get_packet_word(controller, 7);
@ -1848,10 +1848,10 @@ void bx_hard_drive_c::write(Bit32u address, Bit32u value, unsigned io_len)
case 0x4a: // get event status notification case 0x4a: // get event status notification
{ {
bx_bool polled = (controller->buffer[1] & (1<<0)) > 0; bool polled = (controller->buffer[1] & (1<<0)) > 0;
int event_length, request = controller->buffer[4]; int event_length, request = controller->buffer[4];
Bit16u alloc_length = read_16bit(controller->buffer + 7); Bit16u alloc_length = read_16bit(controller->buffer + 7);
bx_bool inserted = BX_SELECTED_DRIVE(channel).cdrom.ready; bool inserted = BX_SELECTED_DRIVE(channel).cdrom.ready;
if (polled) { if (polled) {
// we currently only support the MEDIA event (bit 4) // we currently only support the MEDIA event (bit 4)
if (request == (1<<4)) { if (request == (1<<4)) {
@ -2643,7 +2643,7 @@ void bx_hard_drive_c::write(Bit32u address, Bit32u value, unsigned io_len)
} }
} }
bx_bool BX_CPP_AttrRegparmN(2) bool BX_CPP_AttrRegparmN(2)
bx_hard_drive_c::calculate_logical_address(Bit8u channel, Bit64s *sector) bx_hard_drive_c::calculate_logical_address(Bit8u channel, Bit64s *sector)
{ {
Bit64s logical_sector; Bit64s logical_sector;
@ -3143,7 +3143,7 @@ void bx_hard_drive_c::identify_drive(Bit8u channel)
BX_SELECTED_DRIVE(channel).identify_set = 1; BX_SELECTED_DRIVE(channel).identify_set = 1;
} }
void bx_hard_drive_c::init_send_atapi_command(Bit8u channel, Bit8u command, int req_length, int alloc_length, bx_bool lazy) void bx_hard_drive_c::init_send_atapi_command(Bit8u channel, Bit8u command, int req_length, int alloc_length, bool lazy)
{ {
controller_t *controller = &BX_SELECTED_CONTROLLER(channel); controller_t *controller = &BX_SELECTED_CONTROLLER(channel);
@ -3194,7 +3194,7 @@ void bx_hard_drive_c::init_send_atapi_command(Bit8u channel, Bit8u command, int
BX_SELECTED_DRIVE(channel).atapi.total_bytes_remaining = (req_length < alloc_length) ? req_length : alloc_length; BX_SELECTED_DRIVE(channel).atapi.total_bytes_remaining = (req_length < alloc_length) ? req_length : alloc_length;
} }
void bx_hard_drive_c::atapi_cmd_error(Bit8u channel, sense_t sense_key, asc_t asc, bx_bool show) void bx_hard_drive_c::atapi_cmd_error(Bit8u channel, sense_t sense_key, asc_t asc, bool show)
{ {
if (show) { if (show) {
BX_ERROR(("ata%d-%d: atapi_cmd_error: key=%02x asc=%02x", channel, BX_SLAVE_SELECTED(channel), sense_key, asc)); BX_ERROR(("ata%d-%d: atapi_cmd_error: key=%02x asc=%02x", channel, BX_SLAVE_SELECTED(channel), sense_key, asc));
@ -3303,7 +3303,7 @@ void bx_hard_drive_c::command_aborted(Bit8u channel, unsigned value)
raise_interrupt(channel); raise_interrupt(channel);
} }
bx_bool bx_hard_drive_c::set_cd_media_status(Bit32u handle, bx_bool status) bool bx_hard_drive_c::set_cd_media_status(Bit32u handle, bool status)
{ {
char ata_name[22]; char ata_name[22];
@ -3484,7 +3484,7 @@ void bx_hard_drive_c::set_signature(Bit8u channel, Bit8u id)
} }
} }
bx_bool bx_hard_drive_c::ide_read_sector(Bit8u channel, Bit8u *buffer, Bit32u buffer_size) bool bx_hard_drive_c::ide_read_sector(Bit8u channel, Bit8u *buffer, Bit32u buffer_size)
{ {
controller_t *controller = &BX_SELECTED_CONTROLLER(channel); controller_t *controller = &BX_SELECTED_CONTROLLER(channel);
@ -3521,7 +3521,7 @@ bx_bool bx_hard_drive_c::ide_read_sector(Bit8u channel, Bit8u *buffer, Bit32u bu
return 1; return 1;
} }
bx_bool bx_hard_drive_c::ide_write_sector(Bit8u channel, Bit8u *buffer, Bit32u buffer_size) bool bx_hard_drive_c::ide_write_sector(Bit8u channel, Bit8u *buffer, Bit32u buffer_size)
{ {
controller_t *controller = &BX_SELECTED_CONTROLLER(channel); controller_t *controller = &BX_SELECTED_CONTROLLER(channel);
@ -3558,7 +3558,7 @@ bx_bool bx_hard_drive_c::ide_write_sector(Bit8u channel, Bit8u *buffer, Bit32u b
return 1; return 1;
} }
void bx_hard_drive_c::lba48_transform(controller_t *controller, bx_bool lba48) void bx_hard_drive_c::lba48_transform(controller_t *controller, bool lba48)
{ {
controller->lba48 = lba48; controller->lba48 = lba48;
@ -3641,7 +3641,7 @@ Bit64s bx_hard_drive_c::cdrom_status_handler(bx_param_c *param, int set, Bit64s
int handle = get_device_handle_from_param(param); int handle = get_device_handle_from_param(param);
if (handle >= 0) { if (handle >= 0) {
if (!strcmp(param->get_name(), "status")) { if (!strcmp(param->get_name(), "status")) {
bx_bool locked = BX_HD_THIS channels[handle/2].drives[handle%2].cdrom.locked; bool locked = BX_HD_THIS channels[handle/2].drives[handle%2].cdrom.locked;
if ((val == 1) || !locked) { if ((val == 1) || !locked) {
BX_HD_THIS channels[handle/2].drives[handle%2].status_changed = 1; BX_HD_THIS channels[handle/2].drives[handle%2].status_changed = 1;
} else if (locked) { } else if (locked) {

View File

@ -42,15 +42,15 @@ class cdrom_base_c;
typedef struct { typedef struct {
struct { struct {
bx_bool busy; bool busy;
bx_bool drive_ready; bool drive_ready;
bx_bool write_fault; bool write_fault;
bx_bool seek_complete; bool seek_complete;
bx_bool drq; bool drq;
bx_bool corrected_data; bool corrected_data;
bx_bool index_pulse; bool index_pulse;
unsigned index_pulse_count; unsigned index_pulse_count;
bx_bool err; bool err;
} status; } status;
Bit8u error_register; Bit8u error_register;
Bit8u head_no; Bit8u head_no;
@ -82,13 +82,13 @@ typedef struct {
Bit32u drq_index; Bit32u drq_index;
Bit8u current_command; Bit8u current_command;
Bit8u multiple_sectors; Bit8u multiple_sectors;
bx_bool lba_mode; bool lba_mode;
bx_bool packet_dma; bool packet_dma;
Bit8u mdma_mode; Bit8u mdma_mode;
Bit8u udma_mode; Bit8u udma_mode;
struct { struct {
bx_bool reset; // 0=normal, 1=reset controller bool reset; // 0=normal, 1=reset controller
bx_bool disable_irq; // 0=allow irq, 1=disable irq bool disable_irq; // 0=allow irq, 1=disable irq
} control; } control;
Bit8u reset_in_progress; Bit8u reset_in_progress;
Bit8u features; Bit8u features;
@ -100,7 +100,7 @@ typedef struct {
Bit8u hcyl; Bit8u hcyl;
} hob; } hob;
Bit32u num_sectors; Bit32u num_sectors;
bx_bool lba48; bool lba48;
} controller_t; } controller_t;
struct sense_info_t { struct sense_info_t {
@ -130,8 +130,8 @@ Bit32u read_32bit(const Bit8u* buf) BX_CPP_AttrRegparmN(1);
struct cdrom_t struct cdrom_t
{ {
bx_bool ready; bool ready;
bx_bool locked; bool locked;
cdrom_base_c *cd; cdrom_base_c *cd;
Bit32u max_lba; Bit32u max_lba;
Bit32u curr_lba; Bit32u curr_lba;
@ -201,26 +201,26 @@ public:
private: private:
BX_HD_SMF bx_bool calculate_logical_address(Bit8u channel, Bit64s *sector) BX_CPP_AttrRegparmN(2); BX_HD_SMF bool calculate_logical_address(Bit8u channel, Bit64s *sector) BX_CPP_AttrRegparmN(2);
BX_HD_SMF void increment_address(Bit8u channel, Bit64s *sector) BX_CPP_AttrRegparmN(2); BX_HD_SMF void increment_address(Bit8u channel, Bit64s *sector) BX_CPP_AttrRegparmN(2);
BX_HD_SMF void identify_drive(Bit8u channel); BX_HD_SMF void identify_drive(Bit8u channel);
BX_HD_SMF void identify_ATAPI_drive(Bit8u channel); BX_HD_SMF void identify_ATAPI_drive(Bit8u channel);
BX_HD_SMF void command_aborted(Bit8u channel, unsigned command); BX_HD_SMF void command_aborted(Bit8u channel, unsigned command);
BX_HD_SMF void init_send_atapi_command(Bit8u channel, Bit8u command, int req_length, int alloc_length, bx_bool lazy = 0); BX_HD_SMF void init_send_atapi_command(Bit8u channel, Bit8u command, int req_length, int alloc_length, bool lazy = 0);
BX_HD_SMF void ready_to_send_atapi(Bit8u channel) BX_CPP_AttrRegparmN(1); BX_HD_SMF void ready_to_send_atapi(Bit8u channel) BX_CPP_AttrRegparmN(1);
BX_HD_SMF void raise_interrupt(Bit8u channel) BX_CPP_AttrRegparmN(1); BX_HD_SMF void raise_interrupt(Bit8u channel) BX_CPP_AttrRegparmN(1);
BX_HD_SMF void atapi_cmd_error(Bit8u channel, sense_t sense_key, asc_t asc, bx_bool show); BX_HD_SMF void atapi_cmd_error(Bit8u channel, sense_t sense_key, asc_t asc, bool show);
BX_HD_SMF void init_mode_sense_single(Bit8u channel, const void* src, int size); BX_HD_SMF void init_mode_sense_single(Bit8u channel, const void* src, int size);
BX_HD_SMF void atapi_cmd_nop(controller_t *controller) BX_CPP_AttrRegparmN(1); BX_HD_SMF void atapi_cmd_nop(controller_t *controller) BX_CPP_AttrRegparmN(1);
BX_HD_SMF bool bmdma_present(void); BX_HD_SMF bool bmdma_present(void);
BX_HD_SMF void set_signature(Bit8u channel, Bit8u id); BX_HD_SMF void set_signature(Bit8u channel, Bit8u id);
BX_HD_SMF bx_bool ide_read_sector(Bit8u channel, Bit8u *buffer, Bit32u buffer_size); BX_HD_SMF bool ide_read_sector(Bit8u channel, Bit8u *buffer, Bit32u buffer_size);
BX_HD_SMF bx_bool ide_write_sector(Bit8u channel, Bit8u *buffer, Bit32u buffer_size); BX_HD_SMF bool ide_write_sector(Bit8u channel, Bit8u *buffer, Bit32u buffer_size);
BX_HD_SMF void lba48_transform(controller_t *controller, bx_bool lba48); BX_HD_SMF void lba48_transform(controller_t *controller, bool lba48);
BX_HD_SMF void start_seek(Bit8u channel); BX_HD_SMF void start_seek(Bit8u channel);
BX_HD_SMF bx_bool set_cd_media_status(Bit32u handle, bx_bool status); BX_HD_SMF bool set_cd_media_status(Bit32u handle, bool status);
static Bit64s cdrom_status_handler(bx_param_c *param, int set, Bit64s val); static Bit64s cdrom_status_handler(bx_param_c *param, int set, Bit64s val);
static const char* cdrom_path_handler(bx_param_string_c *param, int set, static const char* cdrom_path_handler(bx_param_string_c *param, int set,
@ -237,7 +237,7 @@ private:
// they are fetched and returned via a return(), so // they are fetched and returned via a return(), so
// there's no need to keep them in x86 endian format. // there's no need to keep them in x86 endian format.
Bit16u id_drive[256]; Bit16u id_drive[256];
bx_bool identify_set; bool identify_set;
controller_t controller; controller_t controller;
cdrom_t cdrom; cdrom_t cdrom;
@ -252,7 +252,7 @@ private:
Bit8u model_no[41]; Bit8u model_no[41];
int statusbar_id; int statusbar_id;
Bit8u device_num; // for ATAPI identify & inquiry Bit8u device_num; // for ATAPI identify & inquiry
bx_bool status_changed; bool status_changed;
int seek_timer_index; int seek_timer_index;
} drives[2]; } drives[2];
unsigned drive_select; unsigned drive_select;
@ -265,7 +265,7 @@ private:
int rt_conf_id; int rt_conf_id;
Bit8u cdrom_count; Bit8u cdrom_count;
bx_bool pci_enabled; bool pci_enabled;
}; };
#endif #endif

View File

@ -2,7 +2,7 @@
// $Id$ // $Id$
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// //
// Copyright (C) 2002-2020 The Bochs Project // Copyright (C) 2002-2021 The Bochs Project
// //
// This library is free software; you can redistribute it and/or // This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public // modify it under the terms of the GNU Lesser General Public
@ -57,7 +57,7 @@ cdrom_base_c::~cdrom_base_c(void)
BX_DEBUG(("Exit")); BX_DEBUG(("Exit"));
} }
bx_bool cdrom_base_c::insert_cdrom(const char *dev) bool cdrom_base_c::insert_cdrom(const char *dev)
{ {
unsigned char buffer[BX_CD_FRAMESIZE]; unsigned char buffer[BX_CD_FRAMESIZE];
ssize_t ret; ssize_t ret;
@ -105,7 +105,7 @@ void cdrom_base_c::eject_cdrom()
} }
} }
bx_bool cdrom_base_c::read_toc(Bit8u* buf, int* length, bx_bool msf, int start_track, int format) bool cdrom_base_c::read_toc(Bit8u* buf, int* length, bool msf, int start_track, int format)
{ {
unsigned i; unsigned i;
Bit32u blocks; Bit32u blocks;
@ -231,7 +231,7 @@ bx_bool cdrom_base_c::read_toc(Bit8u* buf, int* length, bx_bool msf, int start_t
return 1; return 1;
} }
bx_bool BX_CPP_AttrRegparmN(3) cdrom_base_c::read_block(Bit8u* buf, Bit32u lba, int blocksize) bool BX_CPP_AttrRegparmN(3) cdrom_base_c::read_block(Bit8u* buf, Bit32u lba, int blocksize)
{ {
// Read a single block from the CD // Read a single block from the CD
@ -286,7 +286,7 @@ Bit32u cdrom_base_c::capacity()
} }
} }
bx_bool cdrom_base_c::start_cdrom() bool cdrom_base_c::start_cdrom()
{ {
// Spin up the cdrom drive. // Spin up the cdrom drive.
@ -297,7 +297,7 @@ bx_bool cdrom_base_c::start_cdrom()
return 0; return 0;
} }
bx_bool cdrom_base_c::seek(Bit32u lba) bool cdrom_base_c::seek(Bit32u lba)
{ {
unsigned char buffer[BX_CD_FRAMESIZE]; unsigned char buffer[BX_CD_FRAMESIZE];

View File

@ -2,7 +2,7 @@
// $Id$ // $Id$
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// //
// Copyright (C) 2002-2013 The Bochs Project // Copyright (C) 2002-2021 The Bochs Project
// //
// This library is free software; you can redistribute it and/or // This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public // modify it under the terms of the GNU Lesser General Public
@ -31,28 +31,28 @@ public:
virtual ~cdrom_base_c(void); virtual ~cdrom_base_c(void);
// Load CD-ROM. Returns 0 if CD is not ready. // Load CD-ROM. Returns 0 if CD is not ready.
virtual bx_bool insert_cdrom(const char *dev = NULL); virtual bool insert_cdrom(const char *dev = NULL);
// Logically eject the CD. // Logically eject the CD.
virtual void eject_cdrom(); virtual void eject_cdrom();
// Read CD TOC. Returns 0 if start track is out of bounds. // Read CD TOC. Returns 0 if start track is out of bounds.
virtual bx_bool read_toc(Bit8u* buf, int* length, bx_bool msf, int start_track, int format); virtual bool read_toc(Bit8u* buf, int* length, bool msf, int start_track, int format);
// Return CD-ROM capacity (in 2048 byte frames) // Return CD-ROM capacity (in 2048 byte frames)
virtual Bit32u capacity(); virtual Bit32u capacity();
// Read a single block from the CD. Returns 0 on failure. // Read a single block from the CD. Returns 0 on failure.
virtual bx_bool read_block(Bit8u* buf, Bit32u lba, int blocksize) BX_CPP_AttrRegparmN(3); virtual bool read_block(Bit8u* buf, Bit32u lba, int blocksize) BX_CPP_AttrRegparmN(3);
// Start (spin up) the CD. // Start (spin up) the CD.
virtual bx_bool start_cdrom(); virtual bool start_cdrom();
// Seek for new block address. // Seek for new block address.
virtual bx_bool seek(Bit32u lba); virtual bool seek(Bit32u lba);
protected: protected:
int fd; int fd;
char *path; char *path;
bx_bool using_file; bool using_file;
}; };

View File

@ -2,7 +2,7 @@
// $Id$ // $Id$
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// //
// Copyright (C) 2000-2013 The Bochs Project // Copyright (C) 2000-2021 The Bochs Project
// //
// This library is free software; you can redistribute it and/or // This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public // modify it under the terms of the GNU Lesser General Public
@ -147,7 +147,7 @@ cdrom_amigaos_c::~cdrom_amigaos_c(void)
} }
} }
bx_bool cdrom_amigaos_c::insert_cdrom(const char *dev) bool cdrom_amigaos_c::insert_cdrom(const char *dev)
{ {
Bit8u cdb[6]; Bit8u cdb[6];
Bit8u buf[2*BX_CD_FRAMESIZE]; Bit8u buf[2*BX_CD_FRAMESIZE];
@ -218,7 +218,7 @@ void cdrom_amigaos_c::eject_cdrom()
} }
bx_bool cdrom_amigaos_c::read_toc(Bit8u* buf, int* length, bx_bool msf, int start_track, int format) bool cdrom_amigaos_c::read_toc(Bit8u* buf, int* length, bool msf, int start_track, int format)
{ {
Bit8u cdb[10]; Bit8u cdb[10];
TOC *toc; TOC *toc;
@ -288,7 +288,7 @@ Bit32u cdrom_amigaos_c::capacity()
} }
} }
bx_bool cdrom_amigaos_c::read_block(Bit8u* buf, Bit32u lba, int blocksize) bool cdrom_amigaos_c::read_block(Bit8u* buf, Bit32u lba, int blocksize)
{ {
int n; int n;
Bit8u try_count = 3; Bit8u try_count = 3;

View File

@ -2,7 +2,7 @@
// $Id$ // $Id$
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// //
// Copyright (C) 2002-2013 The Bochs Project // Copyright (C) 2002-2021 The Bochs Project
// //
// This library is free software; you can redistribute it and/or // This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public // modify it under the terms of the GNU Lesser General Public
@ -29,11 +29,11 @@ class cdrom_amigaos_c : public cdrom_base_c {
public: public:
cdrom_amigaos_c(const char *dev); cdrom_amigaos_c(const char *dev);
virtual ~cdrom_amigaos_c(void); virtual ~cdrom_amigaos_c(void);
bx_bool insert_cdrom(const char *dev = NULL); bool insert_cdrom(const char *dev = NULL);
void eject_cdrom(); void eject_cdrom();
bx_bool read_toc(Bit8u* buf, int* length, bx_bool msf, int start_track, int format); bool read_toc(Bit8u* buf, int* length, bool msf, int start_track, int format);
Bit32u capacity(); Bit32u capacity();
bx_bool read_block(Bit8u* buf, Bit32u lba, int blocksize) BX_CPP_AttrRegparmN(3); bool read_block(Bit8u* buf, Bit32u lba, int blocksize) BX_CPP_AttrRegparmN(3);
private: private:
#if BX_WITH_AMIGAOS #if BX_WITH_AMIGAOS
BPTR fda; BPTR fda;

View File

@ -2,7 +2,7 @@
// $Id$ // $Id$
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// //
// Copyright (C) 2002-2020 The Bochs Project // Copyright (C) 2002-2021 The Bochs Project
// //
// This library is free software; you can redistribute it and/or // This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public // modify it under the terms of the GNU Lesser General Public
@ -107,7 +107,7 @@ extern "C" {
#include <stdio.h> #include <stdio.h>
bx_bool cdrom_misc_c::start_cdrom() bool cdrom_misc_c::start_cdrom()
{ {
// Spin up the cdrom drive. // Spin up the cdrom drive.
@ -146,7 +146,7 @@ void cdrom_misc_c::eject_cdrom()
} }
} }
bx_bool cdrom_misc_c::read_toc(Bit8u* buf, int* length, bx_bool msf, int start_track, int format) bool cdrom_misc_c::read_toc(Bit8u* buf, int* length, bool msf, int start_track, int format)
{ {
// Read CD TOC. Returns 0 if start track is out of bounds. // Read CD TOC. Returns 0 if start track is out of bounds.

View File

@ -2,7 +2,7 @@
// $Id$ // $Id$
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// //
// Copyright (C) 2002-2013 The Bochs Project // Copyright (C) 2002-2021 The Bochs Project
// //
// This library is free software; you can redistribute it and/or // This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public // modify it under the terms of the GNU Lesser General Public
@ -24,8 +24,8 @@
class cdrom_misc_c : public cdrom_base_c { class cdrom_misc_c : public cdrom_base_c {
public: public:
cdrom_misc_c(const char *dev) : cdrom_base_c(dev) {} cdrom_misc_c(const char *dev) : cdrom_base_c(dev) {}
bx_bool start_cdrom(); bool start_cdrom();
void eject_cdrom(); void eject_cdrom();
bx_bool read_toc(Bit8u* buf, int* length, bx_bool msf, int start_track, int format); bool read_toc(Bit8u* buf, int* length, bool msf, int start_track, int format);
Bit32u capacity(); Bit32u capacity();
}; };

View File

@ -2,7 +2,7 @@
// $Id$ // $Id$
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// //
// Copyright (C) 2002-2020 The Bochs Project // Copyright (C) 2002-2021 The Bochs Project
// //
// This library is free software; you can redistribute it and/or // This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public // modify it under the terms of the GNU Lesser General Public
@ -274,7 +274,7 @@ Exit:
} }
bx_bool cdrom_osx_c::insert_cdrom(const char *dev) bool cdrom_osx_c::insert_cdrom(const char *dev)
{ {
unsigned char buffer[BX_CD_FRAMESIZE]; unsigned char buffer[BX_CD_FRAMESIZE];
ssize_t ret; ssize_t ret;
@ -332,7 +332,7 @@ bx_bool cdrom_osx_c::insert_cdrom(const char *dev)
return read_block(buffer, 0, 2048); return read_block(buffer, 0, 2048);
} }
bx_bool cdrom_osx_c::read_toc(Bit8u* buf, int* length, bx_bool msf, int start_track, int format) bool cdrom_osx_c::read_toc(Bit8u* buf, int* length, bool msf, int start_track, int format)
{ {
// Read CD TOC. Returns 0 if start track is out of bounds. // Read CD TOC. Returns 0 if start track is out of bounds.
@ -483,7 +483,7 @@ Bit32u cdrom_osx_c::capacity()
} }
} }
bx_bool BX_CPP_AttrRegparmN(3) cdrom_osx_c::read_block(Bit8u* buf, Bit32u lba, int blocksize) bool BX_CPP_AttrRegparmN(3) cdrom_osx_c::read_block(Bit8u* buf, Bit32u lba, int blocksize)
{ {
// Read a single block from the CD // Read a single block from the CD

View File

@ -2,7 +2,7 @@
// $Id$ // $Id$
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// //
// Copyright (C) 2002-2013 The Bochs Project // Copyright (C) 2002-2021 The Bochs Project
// //
// This library is free software; you can redistribute it and/or // This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public // modify it under the terms of the GNU Lesser General Public
@ -24,8 +24,8 @@
class cdrom_osx_c : public cdrom_base_c { class cdrom_osx_c : public cdrom_base_c {
public: public:
cdrom_osx_c(const char *dev) : cdrom_base_c(dev) {} cdrom_osx_c(const char *dev) : cdrom_base_c(dev) {}
bx_bool insert_cdrom(const char *dev = NULL); bool insert_cdrom(const char *dev = NULL);
bx_bool read_toc(Bit8u* buf, int* length, bx_bool msf, int start_track, int format); bool read_toc(Bit8u* buf, int* length, bool msf, int start_track, int format);
Bit32u capacity(); Bit32u capacity();
bx_bool read_block(Bit8u* buf, Bit32u lba, int blocksize) BX_CPP_AttrRegparmN(3); bool read_block(Bit8u* buf, Bit32u lba, int blocksize) BX_CPP_AttrRegparmN(3);
}; };

View File

@ -2,7 +2,7 @@
// $Id$ // $Id$
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// //
// Copyright (C) 2002-2020 The Bochs Project // Copyright (C) 2002-2021 The Bochs Project
// //
// This library is free software; you can redistribute it and/or // This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public // modify it under the terms of the GNU Lesser General Public
@ -150,7 +150,7 @@ cdrom_win32_c::~cdrom_win32_c(void)
} }
} }
bx_bool cdrom_win32_c::insert_cdrom(const char *dev) bool cdrom_win32_c::insert_cdrom(const char *dev)
{ {
unsigned char buffer[BX_CD_FRAMESIZE]; unsigned char buffer[BX_CD_FRAMESIZE];
@ -215,7 +215,7 @@ void cdrom_win32_c::eject_cdrom()
} }
} }
bx_bool cdrom_win32_c::read_toc(Bit8u* buf, int* length, bx_bool msf, int start_track, int format) bool cdrom_win32_c::read_toc(Bit8u* buf, int* length, bool msf, int start_track, int format)
{ {
// Read CD TOC. Returns 0 if start track is out of bounds. // Read CD TOC. Returns 0 if start track is out of bounds.
@ -271,7 +271,7 @@ Bit32u cdrom_win32_c::capacity()
} }
} }
bx_bool BX_CPP_AttrRegparmN(3) cdrom_win32_c::read_block(Bit8u* buf, Bit32u lba, int blocksize) bool BX_CPP_AttrRegparmN(3) cdrom_win32_c::read_block(Bit8u* buf, Bit32u lba, int blocksize)
{ {
// Read a single block from the CD // Read a single block from the CD

View File

@ -2,7 +2,7 @@
// $Id$ // $Id$
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// //
// Copyright (C) 2002-2013 The Bochs Project // Copyright (C) 2002-2021 The Bochs Project
// //
// This library is free software; you can redistribute it and/or // This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public // modify it under the terms of the GNU Lesser General Public
@ -25,11 +25,11 @@ class cdrom_win32_c : public cdrom_base_c {
public: public:
cdrom_win32_c(const char *dev); cdrom_win32_c(const char *dev);
virtual ~cdrom_win32_c(void); virtual ~cdrom_win32_c(void);
bx_bool insert_cdrom(const char *dev = NULL); bool insert_cdrom(const char *dev = NULL);
void eject_cdrom(); void eject_cdrom();
bx_bool read_toc(Bit8u* buf, int* length, bx_bool msf, int start_track, int format); bool read_toc(Bit8u* buf, int* length, bool msf, int start_track, int format);
Bit32u capacity(); Bit32u capacity();
bx_bool read_block(Bit8u* buf, Bit32u lba, int blocksize) BX_CPP_AttrRegparmN(3); bool read_block(Bit8u* buf, Bit32u lba, int blocksize) BX_CPP_AttrRegparmN(3);
private: private:
#ifdef WIN32 #ifdef WIN32
HANDLE hFile; HANDLE hFile;

View File

@ -533,12 +533,12 @@ void hdimage_restore_handler(void *class_ptr, bx_param_c *param, Bit64s value)
} }
} }
bx_bool hdimage_backup_file(int fd, const char *backup_fname) bool hdimage_backup_file(int fd, const char *backup_fname)
{ {
char *buf; char *buf;
off_t offset; off_t offset;
int nread, size; int nread, size;
bx_bool ret = 1; bool ret = 1;
int backup_fd = ::open(backup_fname, O_RDWR | O_CREAT | O_TRUNC int backup_fd = ::open(backup_fname, O_RDWR | O_CREAT | O_TRUNC
#ifdef O_BINARY #ifdef O_BINARY
@ -574,10 +574,10 @@ bx_bool hdimage_backup_file(int fd, const char *backup_fname)
} }
#endif #endif
bx_bool hdimage_copy_file(const char *src, const char *dst) bool hdimage_copy_file(const char *src, const char *dst)
{ {
#ifdef WIN32 #ifdef WIN32
return (bx_bool)CopyFile(src, dst, FALSE); return (bool)CopyFile(src, dst, FALSE);
#elif defined(linux) #elif defined(linux)
pid_t pid, ws; pid_t pid, ws;
@ -599,7 +599,7 @@ bx_bool hdimage_copy_file(const char *src, const char *dst)
char *buf; char *buf;
off_t offset; off_t offset;
int nread, size; int nread, size;
bx_bool ret = 1; bool ret = 1;
fd1 = ::open(src, O_RDONLY fd1 = ::open(src, O_RDONLY
#ifdef O_BINARY #ifdef O_BINARY
@ -727,7 +727,7 @@ int flat_image_t::check_format(int fd, Bit64u imgsize)
} }
#ifndef BXIMAGE #ifndef BXIMAGE
bx_bool flat_image_t::save_state(const char *backup_fname) bool flat_image_t::save_state(const char *backup_fname)
{ {
return hdimage_backup_file(fd, backup_fname); return hdimage_backup_file(fd, backup_fname);
} }
@ -942,9 +942,9 @@ ssize_t concat_image_t::write(const void* buf, size_t count)
} }
#ifndef BXIMAGE #ifndef BXIMAGE
bx_bool concat_image_t::save_state(const char *backup_fname) bool concat_image_t::save_state(const char *backup_fname)
{ {
bx_bool ret = 1; bool ret = 1;
char tempfn[BX_PATHNAME_LEN]; char tempfn[BX_PATHNAME_LEN];
for (int index = 0; index < maxfd; index++) { for (int index = 0; index < maxfd; index++) {
@ -1033,7 +1033,7 @@ int sparse_image_t::read_header()
data_start = 0; data_start = 0;
while ((size_t)data_start < preamble_size) data_start += pagesize; while ((size_t)data_start < preamble_size) data_start += pagesize;
bx_bool did_mmap = 0; bool did_mmap = 0;
#ifdef _POSIX_MAPPED_FILES #ifdef _POSIX_MAPPED_FILES
// Try to memory map from the beginning of the file (0 is trivially a page multiple) // Try to memory map from the beginning of the file (0 is trivially a page multiple)
@ -1419,7 +1419,7 @@ ssize_t sparse_image_t::write(const void* buf, size_t count)
if (update_pagetable_count != 0) if (update_pagetable_count != 0)
{ {
bx_bool done = 0; bool done = 0;
off_t pagetable_write_from = sizeof(header) + (sizeof(Bit32u) * update_pagetable_start); off_t pagetable_write_from = sizeof(header) + (sizeof(Bit32u) * update_pagetable_start);
size_t write_bytecount = update_pagetable_count * sizeof(Bit32u); size_t write_bytecount = update_pagetable_count * sizeof(Bit32u);
@ -1539,7 +1539,7 @@ int sparse_image_t::create_image(const char *pathname, Bit64u size)
return 0; return 0;
} }
#else #else
bx_bool sparse_image_t::save_state(const char *backup_fname) bool sparse_image_t::save_state(const char *backup_fname)
{ {
return hdimage_backup_file(fd, backup_fname); return hdimage_backup_file(fd, backup_fname);
} }
@ -1928,7 +1928,7 @@ Bit32u redolog_t::get_timestamp()
return dtoh32(header.specific.timestamp); return dtoh32(header.specific.timestamp);
} }
bx_bool redolog_t::set_timestamp(Bit32u timestamp) bool redolog_t::set_timestamp(Bit32u timestamp)
{ {
header.specific.timestamp = htod32(timestamp); header.specific.timestamp = htod32(timestamp);
// Update header // Update header
@ -2017,7 +2017,7 @@ ssize_t redolog_t::write(const void* buf, size_t count)
Bit32u i; Bit32u i;
Bit64s block_offset, bitmap_offset, catalog_offset; Bit64s block_offset, bitmap_offset, catalog_offset;
ssize_t written; ssize_t written;
bx_bool update_catalog = 0; bool update_catalog = 0;
if (count != 512) { if (count != 512) {
BX_PANIC(("redolog : write() with count not 512")); BX_PANIC(("redolog : write() with count not 512"));
@ -2188,7 +2188,7 @@ int redolog_t::commit(device_image_t *base_image)
#endif #endif
#ifndef BXIMAGE #ifndef BXIMAGE
bx_bool redolog_t::save_state(const char *backup_fname) bool redolog_t::save_state(const char *backup_fname)
{ {
return hdimage_backup_file(fd, backup_fname); return hdimage_backup_file(fd, backup_fname);
} }
@ -2276,7 +2276,7 @@ int growing_image_t::create_image(const char *pathname, Bit64u size)
return 0; return 0;
} }
#else #else
bx_bool growing_image_t::save_state(const char *backup_fname) bool growing_image_t::save_state(const char *backup_fname)
{ {
return redolog->save_state(backup_fname); return redolog->save_state(backup_fname);
} }
@ -2289,7 +2289,7 @@ void growing_image_t::restore_state(const char *backup_fname)
BX_PANIC(("Can't open growing image backup '%s'", backup_fname)); BX_PANIC(("Can't open growing image backup '%s'", backup_fname));
return; return;
} else { } else {
bx_bool okay = (temp_redolog->get_size() == redolog->get_size()); bool okay = (temp_redolog->get_size() == redolog->get_size());
temp_redolog->close(); temp_redolog->close();
delete temp_redolog; delete temp_redolog;
if (!okay) { if (!okay) {
@ -2310,7 +2310,7 @@ void growing_image_t::restore_state(const char *backup_fname)
// compare hd_size and modification time of r/o disk and journal // compare hd_size and modification time of r/o disk and journal
bx_bool coherency_check(device_image_t *ro_disk, redolog_t *redolog) bool coherency_check(device_image_t *ro_disk, redolog_t *redolog)
{ {
Bit32u timestamp1, timestamp2; Bit32u timestamp1, timestamp2;
char buffer[24]; char buffer[24];
@ -2458,7 +2458,7 @@ ssize_t undoable_image_t::write(const void* buf, size_t count)
} }
#ifndef BXIMAGE #ifndef BXIMAGE
bx_bool undoable_image_t::save_state(const char *backup_fname) bool undoable_image_t::save_state(const char *backup_fname)
{ {
return redolog->save_state(backup_fname); return redolog->save_state(backup_fname);
} }
@ -2471,7 +2471,7 @@ void undoable_image_t::restore_state(const char *backup_fname)
BX_PANIC(("Can't open undoable redolog backup '%s'", backup_fname)); BX_PANIC(("Can't open undoable redolog backup '%s'", backup_fname));
return; return;
} else { } else {
bx_bool okay = coherency_check(ro_disk, temp_redolog); bool okay = coherency_check(ro_disk, temp_redolog);
temp_redolog->close(); temp_redolog->close();
delete temp_redolog; delete temp_redolog;
if (!okay) return; if (!okay) return;
@ -2632,7 +2632,7 @@ ssize_t volatile_image_t::write(const void* buf, size_t count)
} }
#ifndef BXIMAGE #ifndef BXIMAGE
bx_bool volatile_image_t::save_state(const char *backup_fname) bool volatile_image_t::save_state(const char *backup_fname)
{ {
return redolog->save_state(backup_fname); return redolog->save_state(backup_fname);
} }
@ -2645,7 +2645,7 @@ void volatile_image_t::restore_state(const char *backup_fname)
BX_PANIC(("Can't open volatile redolog backup '%s'", backup_fname)); BX_PANIC(("Can't open volatile redolog backup '%s'", backup_fname));
return; return;
} else { } else {
bx_bool okay = coherency_check(ro_disk, temp_redolog); bool okay = coherency_check(ro_disk, temp_redolog);
temp_redolog->close(); temp_redolog->close();
delete temp_redolog; delete temp_redolog;
if (!okay) return; if (!okay) return;

View File

@ -153,9 +153,9 @@ int hdimage_open_file(const char *pathname, int flags, Bit64u *fsize, time_t *mt
BOCHSAPI_MSVCONLY int hdimage_open_file(const char *pathname, int flags, Bit64u *fsize, FILETIME *mtime); BOCHSAPI_MSVCONLY int hdimage_open_file(const char *pathname, int flags, Bit64u *fsize, FILETIME *mtime);
#endif #endif
bool hdimage_detect_image_mode(const char *pathname, const char **image_mode); bool hdimage_detect_image_mode(const char *pathname, const char **image_mode);
BOCHSAPI_MSVCONLY bx_bool hdimage_backup_file(int fd, const char *backup_fname); BOCHSAPI_MSVCONLY bool hdimage_backup_file(int fd, const char *backup_fname);
BOCHSAPI_MSVCONLY bx_bool hdimage_copy_file(const char *src, const char *dst); BOCHSAPI_MSVCONLY bool hdimage_copy_file(const char *src, const char *dst);
bx_bool coherency_check(device_image_t *ro_disk, redolog_t *redolog); bool coherency_check(device_image_t *ro_disk, redolog_t *redolog);
#ifndef WIN32 #ifndef WIN32
Bit16u fat_datetime(time_t time, int return_time); Bit16u fat_datetime(time_t time, int return_time);
#else #else
@ -206,7 +206,7 @@ class BOCHSAPI_MSVCONLY device_image_t
#else #else
// Save/restore support // Save/restore support
virtual void register_state(bx_list_c *parent); virtual void register_state(bx_list_c *parent);
virtual bx_bool save_state(const char *backup_fname) {return 0;} virtual bool save_state(const char *backup_fname) {return 0;}
virtual void restore_state(const char *backup_fname) {} virtual void restore_state(const char *backup_fname) {}
#endif #endif
@ -250,7 +250,7 @@ class flat_image_t : public device_image_t
#ifndef BXIMAGE #ifndef BXIMAGE
// Save/restore support // Save/restore support
bx_bool save_state(const char *backup_fname); bool save_state(const char *backup_fname);
void restore_state(const char *backup_fname); void restore_state(const char *backup_fname);
#endif #endif
@ -286,7 +286,7 @@ class concat_image_t : public device_image_t
#ifndef BXIMAGE #ifndef BXIMAGE
// Save/restore support // Save/restore support
bx_bool save_state(const char *backup_fname); bool save_state(const char *backup_fname);
void restore_state(const char *backup_fname); void restore_state(const char *backup_fname);
#endif #endif
@ -352,7 +352,7 @@ class sparse_image_t : public device_image_t
int create_image(const char *pathname, Bit64u size); int create_image(const char *pathname, Bit64u size);
#else #else
// Save/restore support // Save/restore support
bx_bool save_state(const char *backup_fname); bool save_state(const char *backup_fname);
void restore_state(const char *backup_fname); void restore_state(const char *backup_fname);
#endif #endif
@ -443,7 +443,7 @@ class BOCHSAPI_MSVCONLY redolog_t
void close(); void close();
Bit64u get_size(); Bit64u get_size();
Bit32u get_timestamp(); Bit32u get_timestamp();
bx_bool set_timestamp(Bit32u timestamp); bool set_timestamp(Bit32u timestamp);
Bit64s lseek(Bit64s offset, int whence); Bit64s lseek(Bit64s offset, int whence);
ssize_t read(void* buf, size_t count); ssize_t read(void* buf, size_t count);
@ -454,7 +454,7 @@ class BOCHSAPI_MSVCONLY redolog_t
#ifdef BXIMAGE #ifdef BXIMAGE
int commit(device_image_t *base_image); int commit(device_image_t *base_image);
#else #else
bx_bool save_state(const char *backup_fname); bool save_state(const char *backup_fname);
#endif #endif
private: private:
@ -464,7 +464,7 @@ class BOCHSAPI_MSVCONLY redolog_t
redolog_header_t header; // Header is kept in x86 (little) endianness redolog_header_t header; // Header is kept in x86 (little) endianness
Bit32u *catalog; Bit32u *catalog;
Bit8u *bitmap; Bit8u *bitmap;
bx_bool bitmap_update; bool bitmap_update;
Bit32u extent_index; Bit32u extent_index;
Bit32u extent_offset; Bit32u extent_offset;
Bit32u extent_next; Bit32u extent_next;
@ -512,7 +512,7 @@ class growing_image_t : public device_image_t
int create_image(const char *pathname, Bit64u size); int create_image(const char *pathname, Bit64u size);
#else #else
// Save/restore support // Save/restore support
bx_bool save_state(const char *backup_fname); bool save_state(const char *backup_fname);
void restore_state(const char *backup_fname); void restore_state(const char *backup_fname);
#endif #endif
@ -552,7 +552,7 @@ class undoable_image_t : public device_image_t
#ifndef BXIMAGE #ifndef BXIMAGE
// Save/restore support // Save/restore support
bx_bool save_state(const char *backup_fname); bool save_state(const char *backup_fname);
void restore_state(const char *backup_fname); void restore_state(const char *backup_fname);
#endif #endif
@ -595,7 +595,7 @@ class volatile_image_t : public device_image_t
#ifndef BXIMAGE #ifndef BXIMAGE
// Save/restore support // Save/restore support
bx_bool save_state(const char *backup_fname); bool save_state(const char *backup_fname);
void restore_state(const char *backup_fname); void restore_state(const char *backup_fname);
#endif #endif

View File

@ -288,12 +288,12 @@ int vbox_image_t::check_format(int fd, Bit64u imgsize)
return HDIMAGE_FORMAT_OK; return HDIMAGE_FORMAT_OK;
} }
bx_bool vbox_image_t::is_open() const bool vbox_image_t::is_open() const
{ {
return (file_descriptor != -1); return (file_descriptor != -1);
} }
bx_bool vbox_image_t::read_header() bool vbox_image_t::read_header()
{ {
int ret; int ret;
@ -422,7 +422,7 @@ Bit32u vbox_image_t::get_capabilities(void)
} }
#ifndef BXIMAGE #ifndef BXIMAGE
bx_bool vbox_image_t::save_state(const char *backup_fname) bool vbox_image_t::save_state(const char *backup_fname)
{ {
return hdimage_backup_file(file_descriptor, backup_fname); return hdimage_backup_file(file_descriptor, backup_fname);
} }

View File

@ -10,7 +10,7 @@
* Contact: fys [at] fysnet [dot] net * Contact: fys [at] fysnet [dot] net
* *
* Copyright (C) 2015 Benjamin D Lunt. * Copyright (C) 2015 Benjamin D Lunt.
* Copyright (C) 2006-2015 The Bochs Project * Copyright (C) 2006-2021 The Bochs Project
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -90,7 +90,7 @@ class vbox_image_t : public device_image_t
static int check_format(int fd, Bit64u imgsize); static int check_format(int fd, Bit64u imgsize);
#ifndef BXIMAGE #ifndef BXIMAGE
bx_bool save_state(const char *backup_fname); bool save_state(const char *backup_fname);
void restore_state(const char *backup_fname); void restore_state(const char *backup_fname);
#endif #endif
@ -98,9 +98,9 @@ class vbox_image_t : public device_image_t
static const off_t INVALID_OFFSET; static const off_t INVALID_OFFSET;
static const int SECTOR_SIZE; static const int SECTOR_SIZE;
bx_bool is_open() const; bool is_open() const;
bx_bool read_header(); bool read_header();
off_t perform_seek(); off_t perform_seek();
void flush(); void flush();
void read_block(const Bit32u index); void read_block(const Bit32u index);
@ -112,9 +112,9 @@ class vbox_image_t : public device_image_t
Bit8u *block_data; Bit8u *block_data;
off_t current_offset; off_t current_offset;
Bit32u mtlb_sector; Bit32u mtlb_sector;
bx_bool is_dirty; bool is_dirty;
bx_bool mtlb_dirty; bool mtlb_dirty;
bx_bool header_dirty; bool header_dirty;
const char *pathname; const char *pathname;
}; };

View File

@ -99,7 +99,7 @@ int vmware3_image_t::check_format(int fd, Bit64u imgsize)
return HDIMAGE_FORMAT_OK; return HDIMAGE_FORMAT_OK;
} }
bx_bool vmware3_image_t::read_header(int fd, COW_Header & header) bool vmware3_image_t::read_header(int fd, COW_Header & header)
{ {
int ret; int ret;
@ -558,9 +558,9 @@ Bit32u vmware3_image_t::get_capabilities(void)
} }
#ifndef BXIMAGE #ifndef BXIMAGE
bx_bool vmware3_image_t::save_state(const char *backup_fname) bool vmware3_image_t::save_state(const char *backup_fname)
{ {
bx_bool ret = 1; bool ret = 1;
char tempfn[BX_PATHNAME_LEN]; char tempfn[BX_PATHNAME_LEN];
unsigned count = current->header.number_of_chains; unsigned count = current->header.number_of_chains;
@ -577,7 +577,7 @@ void vmware3_image_t::restore_state(const char *backup_fname)
{ {
int temp_fd; int temp_fd;
Bit64u imgsize; Bit64u imgsize;
bx_bool ret = 1; bool ret = 1;
char tempfn[BX_PATHNAME_LEN]; char tempfn[BX_PATHNAME_LEN];
if ((temp_fd = hdimage_open_file(backup_fname, O_RDONLY, &imgsize, NULL)) < 0) { if ((temp_fd = hdimage_open_file(backup_fname, O_RDONLY, &imgsize, NULL)) < 0) {

View File

@ -44,7 +44,7 @@ class vmware3_image_t : public device_image_t
static int check_format(int fd, Bit64u imgsize); static int check_format(int fd, Bit64u imgsize);
#ifndef BXIMAGE #ifndef BXIMAGE
bx_bool save_state(const char *backup_fname); bool save_state(const char *backup_fname);
void restore_state(const char *backup_fname); void restore_state(const char *backup_fname);
#endif #endif
@ -112,7 +112,7 @@ class vmware3_image_t : public device_image_t
bool synced; bool synced;
} * images, * current; } * images, * current;
bx_bool read_header(int fd, COW_Header & header); bool read_header(int fd, COW_Header & header);
int write_header(int fd, COW_Header & header); int write_header(int fd, COW_Header & header);
int read_ints(int fd, Bit32u *buffer, size_t count); int read_ints(int fd, Bit32u *buffer, size_t count);

View File

@ -232,12 +232,12 @@ int vmware4_image_t::check_format(int fd, Bit64u imgsize)
return HDIMAGE_FORMAT_OK; return HDIMAGE_FORMAT_OK;
} }
bx_bool vmware4_image_t::is_open() const bool vmware4_image_t::is_open() const
{ {
return (file_descriptor != -1); return (file_descriptor != -1);
} }
bx_bool vmware4_image_t::read_header() bool vmware4_image_t::read_header()
{ {
int ret; int ret;
@ -497,7 +497,7 @@ int vmware4_image_t::create_image(const char *pathname, Bit64u size)
return 0; return 0;
} }
#else #else
bx_bool vmware4_image_t::save_state(const char *backup_fname) bool vmware4_image_t::save_state(const char *backup_fname)
{ {
return hdimage_backup_file(file_descriptor, backup_fname); return hdimage_backup_file(file_descriptor, backup_fname);
} }

View File

@ -80,7 +80,7 @@ class vmware4_image_t : public device_image_t
#ifdef BXIMAGE #ifdef BXIMAGE
int create_image(const char *pathname, Bit64u size); int create_image(const char *pathname, Bit64u size);
#else #else
bx_bool save_state(const char *backup_fname); bool save_state(const char *backup_fname);
void restore_state(const char *backup_fname); void restore_state(const char *backup_fname);
#endif #endif
@ -88,9 +88,9 @@ class vmware4_image_t : public device_image_t
static const off_t INVALID_OFFSET; static const off_t INVALID_OFFSET;
static const int SECTOR_SIZE; static const int SECTOR_SIZE;
bx_bool is_open() const; bool is_open() const;
bx_bool read_header(); bool read_header();
off_t perform_seek(); off_t perform_seek();
void flush(); void flush();
Bit32u read_block_index(Bit64u sector, Bit32u index); Bit32u read_block_index(Bit64u sector, Bit32u index);
@ -101,7 +101,7 @@ class vmware4_image_t : public device_image_t
Bit8u* tlb; Bit8u* tlb;
off_t tlb_offset; off_t tlb_offset;
off_t current_offset; off_t current_offset;
bx_bool is_dirty; bool is_dirty;
const char *pathname; const char *pathname;
}; };

View File

@ -407,7 +407,7 @@ int vpc_image_t::create_image(const char *pathname, Bit64u size)
return 0; return 0;
} }
#else #else
bx_bool vpc_image_t::save_state(const char *backup_fname) bool vpc_image_t::save_state(const char *backup_fname)
{ {
return hdimage_backup_file(fd, backup_fname); return hdimage_backup_file(fd, backup_fname);
} }

View File

@ -168,7 +168,7 @@ class vpc_image_t : public device_image_t
#ifdef BXIMAGE #ifdef BXIMAGE
int create_image(const char *pathname, Bit64u size); int create_image(const char *pathname, Bit64u size);
#else #else
bx_bool save_state(const char *backup_fname); bool save_state(const char *backup_fname);
void restore_state(const char *backup_fname); void restore_state(const char *backup_fname);
#endif #endif

View File

@ -386,7 +386,7 @@ vvfat_image_t::~vvfat_image_t()
delete redolog; delete redolog;
} }
bx_bool vvfat_image_t::sector2CHS(Bit32u spos, mbr_chs_t *chs) bool vvfat_image_t::sector2CHS(Bit32u spos, mbr_chs_t *chs)
{ {
Bit32u head, sector; Bit32u head, sector;
@ -413,7 +413,7 @@ void vvfat_image_t::init_mbr(void)
{ {
mbr_t* real_mbr = (mbr_t*)first_sectors; mbr_t* real_mbr = (mbr_t*)first_sectors;
partition_t* partition = &(real_mbr->partition[0]); partition_t* partition = &(real_mbr->partition[0]);
bx_bool lba; bool lba;
// Win NT Disk Signature // Win NT Disk Signature
real_mbr->nt_id = htod32(0xbe1afdfa); real_mbr->nt_id = htod32(0xbe1afdfa);
@ -690,8 +690,8 @@ int vvfat_image_t::read_directory(int mapping_index)
char* buffer; char* buffer;
direntry_t* direntry; direntry_t* direntry;
struct stat st; struct stat st;
bx_bool is_dot = !strcmp(entry->d_name, "."); bool is_dot = !strcmp(entry->d_name, ".");
bx_bool is_dotdot = !strcmp(entry->d_name, ".."); bool is_dotdot = !strcmp(entry->d_name, "..");
if ((first_cluster == first_cluster_of_root_dir) && (is_dotdot || is_dot)) if ((first_cluster == first_cluster_of_root_dir) && (is_dotdot || is_dot))
continue; continue;
@ -703,9 +703,9 @@ int vvfat_image_t::read_directory(int mapping_index)
continue; continue;
} }
bx_bool is_mbr_file = !strcmp(entry->d_name, VVFAT_MBR); bool is_mbr_file = !strcmp(entry->d_name, VVFAT_MBR);
bx_bool is_boot_file = !strcmp(entry->d_name, VVFAT_BOOT); bool is_boot_file = !strcmp(entry->d_name, VVFAT_BOOT);
bx_bool is_attr_file = !strcmp(entry->d_name, VVFAT_ATTR); bool is_attr_file = !strcmp(entry->d_name, VVFAT_ATTR);
if (first_cluster == first_cluster_of_root_dir) { if (first_cluster == first_cluster_of_root_dir) {
if (is_attr_file || ((is_mbr_file || is_boot_file) && (st.st_size == 512))) { if (is_attr_file || ((is_mbr_file || is_boot_file) && (st.st_size == 512))) {
free(buffer); free(buffer);
@ -802,13 +802,13 @@ int vvfat_image_t::read_directory(int mapping_index)
unsigned int length = lstrlen(dirname) + 2 + lstrlen(finddata.cFileName); unsigned int length = lstrlen(dirname) + 2 + lstrlen(finddata.cFileName);
char* buffer; char* buffer;
direntry_t* direntry; direntry_t* direntry;
bx_bool is_dot = !lstrcmp(finddata.cFileName, "."); bool is_dot = !lstrcmp(finddata.cFileName, ".");
bx_bool is_dotdot = !lstrcmp(finddata.cFileName, ".."); bool is_dotdot = !lstrcmp(finddata.cFileName, "..");
if ((first_cluster == first_cluster_of_root_dir) && (is_dotdot || is_dot)) if ((first_cluster == first_cluster_of_root_dir) && (is_dotdot || is_dot))
continue; continue;
bx_bool is_mbr_file = !lstrcmp(finddata.cFileName, VVFAT_MBR); bool is_mbr_file = !lstrcmp(finddata.cFileName, VVFAT_MBR);
bx_bool is_boot_file = !lstrcmp(finddata.cFileName, VVFAT_BOOT); bool is_boot_file = !lstrcmp(finddata.cFileName, VVFAT_BOOT);
bx_bool is_attr_file = !lstrcmp(finddata.cFileName, VVFAT_ATTR); bool is_attr_file = !lstrcmp(finddata.cFileName, VVFAT_ATTR);
if (first_cluster == first_cluster_of_root_dir) { if (first_cluster == first_cluster_of_root_dir) {
if (is_attr_file || ((is_mbr_file || is_boot_file) && (finddata.nFileSizeLow == 512))) if (is_attr_file || ((is_mbr_file || is_boot_file) && (finddata.nFileSizeLow == 512)))
continue; continue;
@ -1102,7 +1102,7 @@ int vvfat_image_t::init_directories(const char* dirname)
return 0; return 0;
} }
bx_bool vvfat_image_t::read_sector_from_file(const char *path, Bit8u *buffer, Bit32u sector) bool vvfat_image_t::read_sector_from_file(const char *path, Bit8u *buffer, Bit32u sector)
{ {
int fd = ::open(path, O_RDONLY int fd = ::open(path, O_RDONLY
#ifdef O_BINARY #ifdef O_BINARY
@ -1121,7 +1121,7 @@ bx_bool vvfat_image_t::read_sector_from_file(const char *path, Bit8u *buffer, Bi
} }
int result = ::read(fd, buffer, 0x200); int result = ::read(fd, buffer, 0x200);
::close(fd); ::close(fd);
bx_bool bootsig = ((buffer[0x1fe] == 0x55) && (buffer[0x1ff] == 0xaa)); bool bootsig = ((buffer[0x1fe] == 0x55) && (buffer[0x1ff] == 0xaa));
return (result == 0x200) && bootsig; return (result == 0x200) && bootsig;
} }
@ -1195,7 +1195,7 @@ int vvfat_image_t::open(const char* dirname, int flags)
int filedes; int filedes;
const char *logname = NULL; const char *logname = NULL;
char ftype[10]; char ftype[10];
bx_bool ftype_ok; bool ftype_ok;
UNUSED(flags); UNUSED(flags);
use_mbr_file = 0; use_mbr_file = 0;
@ -1396,7 +1396,7 @@ direntry_t* vvfat_image_t::read_direntry(Bit8u *buffer, char *filename)
{ {
const Bit8u lfn_map[13] = {1, 3, 5, 7, 9, 14, 16, 18, 20, 22, 24, 28, 30}; const Bit8u lfn_map[13] = {1, 3, 5, 7, 9, 14, 16, 18, 20, 22, 24, 28, 30};
direntry_t *entry; direntry_t *entry;
bx_bool entry_ok = 0, has_lfn = 0; bool entry_ok = 0, has_lfn = 0;
char lfn_tmp[BX_PATHNAME_LEN]; char lfn_tmp[BX_PATHNAME_LEN];
int i; int i;
@ -1465,7 +1465,7 @@ Bit32u vvfat_image_t::fat_get_next(Bit32u current)
} }
} }
bx_bool vvfat_image_t::write_file(const char *path, direntry_t *entry, bx_bool create) bool vvfat_image_t::write_file(const char *path, direntry_t *entry, bool create)
{ {
int fd; int fd;
Bit32u csize, fsize, fstart, cur, next, rsvd_clusters, bad_cluster; Bit32u csize, fsize, fstart, cur, next, rsvd_clusters, bad_cluster;
@ -1967,7 +1967,7 @@ ssize_t vvfat_image_t::write(const void* buf, size_t count)
ssize_t ret = 0; ssize_t ret = 0;
char *cbuf = (char*)buf; char *cbuf = (char*)buf;
Bit32u scount = (Bit32u)(count / 512); Bit32u scount = (Bit32u)(count / 512);
bx_bool update_imagepos; bool update_imagepos;
while (scount-- > 0) { while (scount-- > 0) {
update_imagepos = 1; update_imagepos = 1;

View File

@ -6,7 +6,7 @@
// ported from QEMU block driver with some additions (see vvfat.cc) // ported from QEMU block driver with some additions (see vvfat.cc)
// //
// Copyright (c) 2004,2005 Johannes E. Schindelin // Copyright (c) 2004,2005 Johannes E. Schindelin
// Copyright (C) 2010-2020 The Bochs Project // Copyright (C) 2010-2021 The Bochs Project
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy // Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal // of this software and associated documentation files (the "Software"), to deal
@ -127,7 +127,7 @@ class vvfat_image_t : public device_image_t
Bit32u get_capabilities(); Bit32u get_capabilities();
private: private:
bx_bool sector2CHS(Bit32u spos, mbr_chs_t *chs); bool sector2CHS(Bit32u spos, mbr_chs_t *chs);
void init_mbr(); void init_mbr();
direntry_t* create_long_filename(const char* filename); direntry_t* create_long_filename(const char* filename);
void fat_set(unsigned int cluster, Bit32u value); void fat_set(unsigned int cluster, Bit32u value);
@ -138,10 +138,10 @@ class vvfat_image_t : public device_image_t
Bit32u sector2cluster(off_t sector_num); Bit32u sector2cluster(off_t sector_num);
off_t cluster2sector(Bit32u cluster_num); off_t cluster2sector(Bit32u cluster_num);
int init_directories(const char* dirname); int init_directories(const char* dirname);
bx_bool read_sector_from_file(const char *path, Bit8u *buffer, Bit32u sector); bool read_sector_from_file(const char *path, Bit8u *buffer, Bit32u sector);
void set_file_attributes(void); void set_file_attributes(void);
Bit32u fat_get_next(Bit32u current); Bit32u fat_get_next(Bit32u current);
bx_bool write_file(const char *path, direntry_t *entry, bx_bool create); bool write_file(const char *path, direntry_t *entry, bool create);
direntry_t* read_direntry(Bit8u *buffer, char *filename); direntry_t* read_direntry(Bit8u *buffer, char *filename);
void parse_directory(const char *path, Bit32u start_cluster); void parse_directory(const char *path, Bit32u start_cluster);
void commit_changes(void); void commit_changes(void);
@ -180,11 +180,11 @@ class vvfat_image_t : public device_image_t
const char *vvfat_path; const char *vvfat_path;
Bit32u sector_num; Bit32u sector_num;
bx_bool use_mbr_file; bool use_mbr_file;
bx_bool use_boot_file; bool use_boot_file;
FILE *vvfat_attr_fd; FILE *vvfat_attr_fd;
bx_bool vvfat_modified; bool vvfat_modified;
void *fat2; void *fat2;
redolog_t *redolog; // Redolog instance redolog_t *redolog; // Redolog instance
char *redolog_name; // Redolog name char *redolog_name; // Redolog name

View File

@ -595,7 +595,7 @@ void bx_es1370_c::write(Bit32u address, Bit32u value, unsigned io_len)
Bit16u offset; Bit16u offset;
Bit32u shift, mask; Bit32u shift, mask;
Bit8u index; Bit8u index;
bx_bool set_wave_vol = 0; bool set_wave_vol = 0;
chan_t *d = &BX_ES1370_THIS s.chan[0]; chan_t *d = &BX_ES1370_THIS s.chan[0];
unsigned i; unsigned i;
@ -722,7 +722,7 @@ void bx_es1370_c::write(Bit32u address, Bit32u value, unsigned io_len)
} }
} }
Bit16u bx_es1370_c::calc_output_volume(Bit8u reg1, Bit8u reg2, bx_bool shift) Bit16u bx_es1370_c::calc_output_volume(Bit8u reg1, Bit8u reg2, bool shift)
{ {
Bit8u vol1, vol2; Bit8u vol1, vol2;
float fvol1, fvol2; float fvol1, fvol2;
@ -764,7 +764,7 @@ Bit32u bx_es1370_c::run_channel(unsigned chan, int timer_id, Bit32u buflen)
Bit32u new_status = BX_ES1370_THIS s.status; Bit32u new_status = BX_ES1370_THIS s.status;
Bit32u addr, sc, csc_bytes, cnt, size, left, transfered, temp; Bit32u addr, sc, csc_bytes, cnt, size, left, transfered, temp;
Bit8u tmpbuf[BX_SOUNDLOW_WAVEPACKETSIZE]; Bit8u tmpbuf[BX_SOUNDLOW_WAVEPACKETSIZE];
bx_bool irq = 0; bool irq = 0;
chan_t *d = &BX_ES1370_THIS s.chan[chan]; chan_t *d = &BX_ES1370_THIS s.chan[chan];
@ -839,7 +839,7 @@ Bit32u bx_es1370_c::es1370_adc_handler(void *this_ptr, Bit32u buflen)
return 0; return 0;
} }
void bx_es1370_c::set_irq_level(bx_bool level) void bx_es1370_c::set_irq_level(bool level)
{ {
DEV_pci_set_irq(BX_ES1370_THIS s.devfunc, BX_ES1370_THIS pci_conf[0x3d], level); DEV_pci_set_irq(BX_ES1370_THIS s.devfunc, BX_ES1370_THIS pci_conf[0x3d], level);
} }
@ -874,7 +874,7 @@ void bx_es1370_c::check_lower_irq(Bit32u sctl)
} }
} }
void bx_es1370_c::update_voices(Bit32u ctl, Bit32u sctl, bx_bool force) void bx_es1370_c::update_voices(Bit32u ctl, Bit32u sctl, bool force)
{ {
unsigned i; unsigned i;
Bit32u old_freq, new_freq, old_fmt, new_fmt; Bit32u old_freq, new_freq, old_fmt, new_fmt;
@ -913,7 +913,7 @@ void bx_es1370_c::update_voices(Bit32u ctl, Bit32u sctl, bx_bool force)
} }
if (((ctl ^ BX_ES1370_THIS s.ctl) & ctl_ch_en[i]) || if (((ctl ^ BX_ES1370_THIS s.ctl) & ctl_ch_en[i]) ||
((sctl ^ BX_ES1370_THIS s.sctl) & sctl_ch_pause[i]) || force) { ((sctl ^ BX_ES1370_THIS s.sctl) & sctl_ch_pause[i]) || force) {
bx_bool on = ((ctl & ctl_ch_en[i]) && !(sctl & sctl_ch_pause[i])); bool on = ((ctl & ctl_ch_en[i]) && !(sctl & sctl_ch_pause[i]));
if (i == DAC1_CHANNEL) { if (i == DAC1_CHANNEL) {
timer_id = BX_ES1370_THIS s.dac1_timer_index; timer_id = BX_ES1370_THIS s.dac1_timer_index;

View File

@ -5,7 +5,7 @@
// ES1370 soundcard support (ported from QEMU) // ES1370 soundcard support (ported from QEMU)
// //
// Copyright (c) 2005 Vassili Karpov (malc) // Copyright (c) 2005 Vassili Karpov (malc)
// Copyright (C) 2011-2017 The Bochs Project // Copyright (C) 2011-2021 The Bochs Project
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy // Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal // of this software and associated documentation files (the "Software"), to deal
@ -63,7 +63,7 @@ typedef struct {
int dac1_timer_index; int dac1_timer_index;
int dac2_timer_index; int dac2_timer_index;
Bit8u dac_outputinit; Bit8u dac_outputinit;
bx_bool adc_inputinit; bool adc_inputinit;
int dac_nr_active; int dac_nr_active;
Bit16u dac_packet_size[2]; Bit16u dac_packet_size[2];
Bit32u dac_timer_val[2]; Bit32u dac_timer_val[2];
@ -104,14 +104,14 @@ public:
private: private:
bx_es1370_t s; bx_es1370_t s;
BX_ES1370_SMF void set_irq_level(bx_bool level); BX_ES1370_SMF void set_irq_level(bool level);
BX_ES1370_SMF void update_status(Bit32u new_status); BX_ES1370_SMF void update_status(Bit32u new_status);
BX_ES1370_SMF void check_lower_irq(Bit32u sctl); BX_ES1370_SMF void check_lower_irq(Bit32u sctl);
BX_ES1370_SMF void update_voices(Bit32u ctl, Bit32u sctl, bx_bool force); BX_ES1370_SMF void update_voices(Bit32u ctl, Bit32u sctl, bool force);
BX_ES1370_SMF Bit32u run_channel(unsigned channel, int timer_id, Bit32u buflen); BX_ES1370_SMF Bit32u run_channel(unsigned channel, int timer_id, Bit32u buflen);
BX_ES1370_SMF void sendwavepacket(unsigned channel, Bit32u buflen, Bit8u *buffer); BX_ES1370_SMF void sendwavepacket(unsigned channel, Bit32u buflen, Bit8u *buffer);
BX_ES1370_SMF void closewaveoutput(); BX_ES1370_SMF void closewaveoutput();
BX_ES1370_SMF Bit16u calc_output_volume(Bit8u reg1, Bit8u reg2, bx_bool shift); BX_ES1370_SMF Bit16u calc_output_volume(Bit8u reg1, Bit8u reg2, bool shift);
BX_ES1370_SMF int currentdeltatime(); BX_ES1370_SMF int currentdeltatime();
BX_ES1370_SMF void writemidicommand(int command, int length, Bit8u data[]); BX_ES1370_SMF void writemidicommand(int command, int length, Bit8u data[]);

View File

@ -996,12 +996,12 @@ static void OPL_INLINE clipit16(Bit32s ival, Bit16s* outval, Bit8u vol)
opl_active = 1; opl_active = 1;
#endif #endif
bx_bool adlib_getsample(Bit16u rate, Bit16s* sndptr, Bits numsamples, Bit16u volume) bool adlib_getsample(Bit16u rate, Bit16s* sndptr, Bits numsamples, Bit16u volume)
{ {
Bit8u lvol, rvol; Bit8u lvol, rvol;
Bits i, endsamples; Bits i, endsamples;
op_type* cptr; op_type* cptr;
bx_bool opl_active = 0; bool opl_active = 0;
Bit32s outbufl[BLOCKBUF_SIZE]; Bit32s outbufl[BLOCKBUF_SIZE];
#if defined(OPLTYPE_IS_OPL3) #if defined(OPLTYPE_IS_OPL3)

View File

@ -3,7 +3,7 @@
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
/* /*
* Copyright (C) 2002-2013 The DOSBox Team * Copyright (C) 2002-2013 The DOSBox Team
* Copyright (C) 2015 The Bochs Project * Copyright (C) 2015-2021 The Bochs Project
* OPL2/OPL3 emulation library * OPL2/OPL3 emulation library
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
@ -136,8 +136,8 @@ typedef struct operator_struct {
Bit16s* cur_wform; // start of selected waveform Bit16s* cur_wform; // start of selected waveform
Bit32u cur_wmask; // mask for selected waveform Bit32u cur_wmask; // mask for selected waveform
Bit32u act_state; // activity state (regular, percussion) Bit32u act_state; // activity state (regular, percussion)
bx_bool sus_keep; // keep sustain level when decay finished bool sus_keep; // keep sustain level when decay finished
bx_bool vibrato,tremolo; // vibrato/tremolo enable bits bool vibrato,tremolo; // vibrato/tremolo enable bits
// variables used to provide non-continuous envelopes // variables used to provide non-continuous envelopes
Bit32u generator_pos; // for non-standard sample rates we need to determine how many samples have passed Bit32u generator_pos; // for non-standard sample rates we need to determine how many samples have passed
@ -147,7 +147,7 @@ typedef struct operator_struct {
Bits env_step_skip_a; // bitmask that determines if a step is skipped (respective bit is zero then) Bits env_step_skip_a; // bitmask that determines if a step is skipped (respective bit is zero then)
#if defined(OPLTYPE_IS_OPL3) #if defined(OPLTYPE_IS_OPL3)
bx_bool is_4op,is_4op_attached; // base of a 4op channel/part of a 4op channel bool is_4op,is_4op_attached; // base of a 4op channel/part of a 4op channel
Bit32s left_pan,right_pan; // opl3 stereo panning amount Bit32s left_pan,right_pan; // opl3 stereo panning amount
#endif #endif
} op_type; } op_type;
@ -196,7 +196,7 @@ static Bit32u generator_add; // should be a chip parameter
// general functions // general functions
void adlib_init(Bit32u samplerate); void adlib_init(Bit32u samplerate);
void adlib_write(Bitu idx, Bit8u val); void adlib_write(Bitu idx, Bit8u val);
bx_bool adlib_getsample(Bit16u rate, Bit16s* sndptr, Bits numsamples, Bit16u volume); bool adlib_getsample(Bit16u rate, Bit16s* sndptr, Bits numsamples, Bit16u volume);
Bitu adlib_reg_read(Bitu port); Bitu adlib_reg_read(Bitu port);
void adlib_write_index(Bitu port, Bit8u val); void adlib_write_index(Bitu port, Bit8u val);

View File

@ -1251,7 +1251,7 @@ void bx_sb16_c::dsp_dma(Bit8u command, Bit8u mode, Bit16u length, Bit8u comp)
{ {
int ret; int ret;
bx_list_c *base; bx_list_c *base;
bx_bool issigned; bool issigned;
// command: 8bit, 16bit, in/out, single/auto, fifo // command: 8bit, 16bit, in/out, single/auto, fifo
// mode: mono/stereo, signed/unsigned // mode: mono/stereo, signed/unsigned
@ -1645,7 +1645,7 @@ Bit16u bx_sb16_c::dma_write16(Bit16u *buffer, Bit16u maxlen)
return len; return len;
} }
Bit16u bx_sb16_c::calc_output_volume(Bit8u reg1, Bit8u reg2, bx_bool shift) Bit16u bx_sb16_c::calc_output_volume(Bit8u reg1, Bit8u reg2, bool shift)
{ {
Bit8u vol1, vol2; Bit8u vol1, vol2;
float fvol1, fvol2; float fvol1, fvol2;
@ -1842,7 +1842,7 @@ void bx_sb16_c::mixer_writeregister(Bit32u value)
void bx_sb16_c::set_irq_dma() void bx_sb16_c::set_irq_dma()
{ {
static bx_bool isInitialized=0; static bool isInitialized=0;
int newirq; int newirq;
int oldDMA8, oldDMA16; int oldDMA8, oldDMA16;
@ -2110,7 +2110,7 @@ void bx_sb16_c::mpu_datawrite(Bit32u value)
void bx_sb16_c::mpu_mididata(Bit32u value) void bx_sb16_c::mpu_mididata(Bit32u value)
{ {
// first, find out if it is a midi command or midi data // first, find out if it is a midi command or midi data
bx_bool ismidicommand = 0; bool ismidicommand = 0;
if (value >= 0x80) if (value >= 0x80)
{ // bit 8 usually denotes a midi command... { // bit 8 usually denotes a midi command...
ismidicommand = 1; ismidicommand = 1;
@ -2427,7 +2427,7 @@ void bx_sb16_c::opl_settimermask(int value, int chipid)
Bit32u bx_sb16_c::fmopl_generator(Bit16u rate, Bit8u *buffer, Bit32u len) Bit32u bx_sb16_c::fmopl_generator(Bit16u rate, Bit8u *buffer, Bit32u len)
{ {
bx_bool ret = adlib_getsample(rate, (Bit16s*)buffer, len / 4, BX_SB16_THIS fm_volume); bool ret = adlib_getsample(rate, (Bit16s*)buffer, len / 4, BX_SB16_THIS fm_volume);
return ret ? len : 0; return ret ? len : 0;
} }
@ -2500,11 +2500,11 @@ int bx_sb16_c::currentdeltatime()
// process the midi command stored in MPU_B.midicmd.to the midi driver // process the midi command stored in MPU_B.midicmd.to the midi driver
void bx_sb16_c::processmidicommand(bx_bool force) void bx_sb16_c::processmidicommand(bool force)
{ {
int i, channel; int i, channel;
Bit8u value; Bit8u value;
bx_bool needremap = 0; bool needremap = 0;
channel = MPU_B.midicmd.currentcommand() & 0xf; channel = MPU_B.midicmd.currentcommand() & 0xf;
@ -2964,7 +2964,7 @@ int bx_sb16_buffer::bytes(void)
} }
// This puts one byte into the buffer // This puts one byte into the buffer
bx_bool bx_sb16_buffer::put(Bit8u data) bool bx_sb16_buffer::put(Bit8u data)
{ {
if (full() != 0) if (full() != 0)
return 0; // buffer full return 0; // buffer full
@ -2976,7 +2976,7 @@ bx_bool bx_sb16_buffer::put(Bit8u data)
} }
// This writes a formatted string to the buffer // This writes a formatted string to the buffer
bx_bool bx_sb16_buffer::puts(const char *data, ...) bool bx_sb16_buffer::puts(const char *data, ...)
{ {
if (data == NULL) if (data == NULL)
return 0; // invalid string return 0; // invalid string
@ -3009,7 +3009,7 @@ bx_bool bx_sb16_buffer::puts(const char *data, ...)
} }
// This returns if the buffer is full, i.e. if a put will fail // This returns if the buffer is full, i.e. if a put will fail
bx_bool bx_sb16_buffer::full(void) bool bx_sb16_buffer::full(void)
{ {
if (length == 0) if (length == 0)
return 1; // not initialized return 1; // not initialized
@ -3021,7 +3021,7 @@ bx_bool bx_sb16_buffer::full(void)
} }
// This reads the next available byte from the buffer // This reads the next available byte from the buffer
bx_bool bx_sb16_buffer::get(Bit8u *data) bool bx_sb16_buffer::get(Bit8u *data)
{ {
if (empty() != 0) if (empty() != 0)
{ {
@ -3039,7 +3039,7 @@ bx_bool bx_sb16_buffer::get(Bit8u *data)
} }
// Read a word in lo/hi order // Read a word in lo/hi order
bx_bool bx_sb16_buffer::getw(Bit16u *data) bool bx_sb16_buffer::getw(Bit16u *data)
{ {
Bit8u dummy; Bit8u dummy;
if (bytes() < 2) if (bytes() < 2)
@ -3061,7 +3061,7 @@ bx_bool bx_sb16_buffer::getw(Bit16u *data)
} }
// Read a word in hi/lo order // Read a word in hi/lo order
bx_bool bx_sb16_buffer::getw1(Bit16u *data) bool bx_sb16_buffer::getw1(Bit16u *data)
{ {
Bit8u dummy; Bit8u dummy;
if (bytes() < 2) if (bytes() < 2)
@ -3083,7 +3083,7 @@ bx_bool bx_sb16_buffer::getw1(Bit16u *data)
} }
// This returns if the buffer is empty, i.e. if a get will fail // This returns if the buffer is empty, i.e. if a get will fail
bx_bool bx_sb16_buffer::empty(void) bool bx_sb16_buffer::empty(void)
{ {
if (length == 0) if (length == 0)
return 1; // not inialized return 1; // not inialized
@ -3131,7 +3131,7 @@ void bx_sb16_buffer::clearcommand(void)
} }
// return if the command has received all necessary bytes // return if the command has received all necessary bytes
bx_bool bx_sb16_buffer::commanddone(void) bool bx_sb16_buffer::commanddone(void)
{ {
if (hascommand() == 0) if (hascommand() == 0)
return 0; // no command pending - not done then return 0; // no command pending - not done then
@ -3143,7 +3143,7 @@ bx_bool bx_sb16_buffer::commanddone(void)
} }
// return if there is a command pending // return if there is a command pending
bx_bool bx_sb16_buffer::hascommand(void) bool bx_sb16_buffer::hascommand(void)
{ {
return havecommand; return havecommand;
} }

View File

@ -2,7 +2,7 @@
// $Id$ // $Id$
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// //
// Copyright (C) 2001-2020 The Bochs Project // Copyright (C) 2001-2021 The Bochs Project
// //
// This library is free software; you can redistribute it and/or // This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public // modify it under the terms of the GNU Lesser General Public
@ -91,13 +91,13 @@ public:
BX_SB16_BUFINL void reset(); BX_SB16_BUFINL void reset();
/* These functions return 1 on success and 0 on error */ /* These functions return 1 on success and 0 on error */
BX_SB16_BUFINL bx_bool put(Bit8u data); // write one byte in the buffer BX_SB16_BUFINL bool put(Bit8u data); // write one byte in the buffer
BX_SB16_BUFINL bx_bool puts(const char *data, ...); // write a formatted string to the buffer BX_SB16_BUFINL bool puts(const char *data, ...); // write a formatted string to the buffer
BX_SB16_BUFINL bx_bool get(Bit8u *data); // read the next available byte BX_SB16_BUFINL bool get(Bit8u *data); // read the next available byte
BX_SB16_BUFINL bx_bool getw(Bit16u *data); // get word, in order lo/hi BX_SB16_BUFINL bool getw(Bit16u *data); // get word, in order lo/hi
BX_SB16_BUFINL bx_bool getw1(Bit16u *data);// get word, in order hi/lo BX_SB16_BUFINL bool getw1(Bit16u *data);// get word, in order hi/lo
BX_SB16_BUFINL bx_bool full(void); // is the buffer full? BX_SB16_BUFINL bool full(void); // is the buffer full?
BX_SB16_BUFINL bx_bool empty(void); // is it empty? BX_SB16_BUFINL bool empty(void); // is it empty?
BX_SB16_BUFINL void flush(void); // empty the buffer BX_SB16_BUFINL void flush(void); // empty the buffer
BX_SB16_BUFINL int bytes(void); // return number of bytes in the buffer BX_SB16_BUFINL int bytes(void); // return number of bytes in the buffer
@ -107,8 +107,8 @@ public:
BX_SB16_BUFINL void newcommand(Bit8u newcmd, int bytes); // start a new command with length bytes BX_SB16_BUFINL void newcommand(Bit8u newcmd, int bytes); // start a new command with length bytes
BX_SB16_BUFINL Bit8u currentcommand(void); // return the current command BX_SB16_BUFINL Bit8u currentcommand(void); // return the current command
BX_SB16_BUFINL void clearcommand(void); // clear the command BX_SB16_BUFINL void clearcommand(void); // clear the command
BX_SB16_BUFINL bx_bool commanddone(void); // return if all bytes have arrived BX_SB16_BUFINL bool commanddone(void); // return if all bytes have arrived
BX_SB16_BUFINL bx_bool hascommand(void); // return if there is a pending command BX_SB16_BUFINL bool hascommand(void); // return if there is a pending command
BX_SB16_BUFINL int commandbytes(void); // return the length of the command BX_SB16_BUFINL int commandbytes(void); // return the length of the command
@ -116,7 +116,7 @@ private:
Bit8u *buffer; Bit8u *buffer;
int head,tail,length; int head,tail,length;
Bit8u command; Bit8u command;
bx_bool havecommand; bool havecommand;
int bytesneeded; int bytesneeded;
}; };
@ -168,7 +168,7 @@ private:
bx_sb16_buffer datain, dataout, cmd, midicmd; bx_sb16_buffer datain, dataout, cmd, midicmd;
} b; } b;
struct { struct {
bx_bool uartmode, irqpending, forceuartmode, singlecommand; bool uartmode, irqpending, forceuartmode, singlecommand;
int banklsb[16]; int banklsb[16];
int bankmsb[16]; // current patch lists int bankmsb[16]; // current patch lists
@ -188,9 +188,9 @@ private:
struct { struct {
Bit8u resetport; // last value written to the reset port Bit8u resetport; // last value written to the reset port
Bit8u speaker,prostereo; // properties of the sound input/output Bit8u speaker,prostereo; // properties of the sound input/output
bx_bool irqpending; // Is an IRQ pending (not ack'd) bool irqpending; // Is an IRQ pending (not ack'd)
bx_bool midiuartmode; // Is the DSP in MIDI UART mode bool midiuartmode; // Is the DSP in MIDI UART mode
bx_bool nondma_mode; // Set if DSP command 0x10 active bool nondma_mode; // Set if DSP command 0x10 active
Bit32u nondma_count; // Number of samples sent in non-DMA mode Bit32u nondma_count; // Number of samples sent in non-DMA mode
Bit8u samplebyte; // Current data byte in non-DMA mode Bit8u samplebyte; // Current data byte in non-DMA mode
Bit8u testreg; Bit8u testreg;
@ -206,7 +206,7 @@ private:
// highspeed= 0: normal mode, 1: highspeed mode (only SBPro) // highspeed= 0: normal mode, 1: highspeed mode (only SBPro)
// timer= so many us between data bytes // timer= so many us between data bytes
int mode, bps, timer; int mode, bps, timer;
bx_bool fifo, output, highspeed; bool fifo, output, highspeed;
bx_pcm_param_t param; bx_pcm_param_t param;
Bit16u count; // bytes remaining in this transfer Bit16u count; // bytes remaining in this transfer
Bit8u *chunk; // buffers up to BX_SOUNDLOW_WAVEPACKETSIZE bytes Bit8u *chunk; // buffers up to BX_SOUNDLOW_WAVEPACKETSIZE bytes
@ -217,7 +217,7 @@ private:
} dma; } dma;
int timer_handle; // handle for the DMA timer int timer_handle; // handle for the DMA timer
Bit8u outputinit; // have the lowlevel output been initialized Bit8u outputinit; // have the lowlevel output been initialized
bx_bool inputinit; // have the lowlevel input been initialized bool inputinit; // have the lowlevel input been initialized
} d; } d;
} dsp; } dsp;
@ -287,7 +287,7 @@ private:
BX_SB16_SMF Bit32u mixer_readdata(void); BX_SB16_SMF Bit32u mixer_readdata(void);
BX_SB16_SMF void mixer_writedata(Bit32u value); BX_SB16_SMF void mixer_writedata(Bit32u value);
BX_SB16_SMF void mixer_writeregister(Bit32u value); BX_SB16_SMF void mixer_writeregister(Bit32u value);
BX_SB16_SMF Bit16u calc_output_volume(Bit8u reg1, Bit8u reg2, bx_bool shift); BX_SB16_SMF Bit16u calc_output_volume(Bit8u reg1, Bit8u reg2, bool shift);
BX_SB16_SMF void set_irq_dma(); BX_SB16_SMF void set_irq_dma();
/* The emulator ports to change emulator properties */ /* The emulator ports to change emulator properties */
@ -303,7 +303,7 @@ private:
/* several high level sound handlers */ /* several high level sound handlers */
BX_SB16_SMF int currentdeltatime(); BX_SB16_SMF int currentdeltatime();
BX_SB16_SMF void processmidicommand(bx_bool force); BX_SB16_SMF void processmidicommand(bool force);
BX_SB16_SMF void midiremapprogram(int channel); // remap program change BX_SB16_SMF void midiremapprogram(int channel); // remap program change
BX_SB16_SMF void writemidicommand(int command, int length, Bit8u data[]); BX_SB16_SMF void writemidicommand(int command, int length, Bit8u data[]);

View File

@ -45,7 +45,7 @@ PLUGIN_ENTRY_FOR_SND_MODULE(alsa)
// helper function for wavein / waveout // helper function for wavein / waveout
int alsa_pcm_open(bx_bool mode, alsa_pcm_t *alsa_pcm, bx_pcm_param_t *param, logfunctions *log) int alsa_pcm_open(bool mode, alsa_pcm_t *alsa_pcm, bx_pcm_param_t *param, logfunctions *log)
{ {
snd_pcm_format_t fmt; snd_pcm_format_t fmt;
snd_pcm_hw_params_t *hwparams; snd_pcm_hw_params_t *hwparams;

View File

@ -95,8 +95,8 @@ static void convert_to_float(Bit8u *src, unsigned srcsize, audio_buffer_t *audio
{ {
unsigned i, j; unsigned i, j;
bx_pcm_param_t *param = &audiobuf->param; bx_pcm_param_t *param = &audiobuf->param;
bx_bool issigned = (param->format & 1); bool issigned = (param->format & 1);
bx_bool setvol = (param->volume != BX_MAX_BIT16U); bool setvol = (param->volume != BX_MAX_BIT16U);
Bit16s val16s; Bit16s val16s;
Bit16u val16u; Bit16u val16u;
float volume[2]; float volume[2];
@ -355,7 +355,7 @@ void bx_soundlow_waveout_c::unregister_wave_callback(int callback_id)
BX_UNLOCK(mixer_mutex); BX_UNLOCK(mixer_mutex);
} }
bx_bool bx_soundlow_waveout_c::mixer_common(Bit8u *buffer, int len) bool bx_soundlow_waveout_c::mixer_common(Bit8u *buffer, int len)
{ {
Bit32u count, len2 = 0, len3 = 0; Bit32u count, len2 = 0, len3 = 0;
Bit16s src1, src2, dst_val; Bit16s src1, src2, dst_val;
@ -642,7 +642,7 @@ bx_sound_lowlevel_c::~bx_sound_lowlevel_c()
} }
} }
bx_bool bx_sound_lowlevel_c::module_present(const char *type) bool bx_sound_lowlevel_c::module_present(const char *type)
{ {
bx_sound_lowlevel_c *ptr = 0; bx_sound_lowlevel_c *ptr = 0;

View File

@ -2,7 +2,7 @@
// $Id$ // $Id$
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// //
// Copyright (C) 2011-2017 The Bochs Project // Copyright (C) 2011-2021 The Bochs Project
// //
// This library is free software; you can redistribute it and/or // This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public // modify it under the terms of the GNU Lesser General Public
@ -108,10 +108,10 @@ public:
virtual void resampler(audio_buffer_t *inbuffer, audio_buffer_t *outbuffer); virtual void resampler(audio_buffer_t *inbuffer, audio_buffer_t *outbuffer);
virtual bx_bool mixer_common(Bit8u *buffer, int len); virtual bool mixer_common(Bit8u *buffer, int len);
bx_bool resampler_running() {return res_thread_start;} bool resampler_running() {return res_thread_start;}
bx_bool mixer_running() {return mix_thread_start;} bool mixer_running() {return mix_thread_start;}
protected: protected:
void start_resampler_thread(void); void start_resampler_thread(void);
@ -119,8 +119,8 @@ protected:
Bit32u resampler_common(audio_buffer_t *inbuffer, float **fbuffer); Bit32u resampler_common(audio_buffer_t *inbuffer, float **fbuffer);
bx_pcm_param_t real_pcm_param; bx_pcm_param_t real_pcm_param;
bx_bool res_thread_start; bool res_thread_start;
bx_bool mix_thread_start; bool mix_thread_start;
BX_THREAD_VAR(res_thread_var); BX_THREAD_VAR(res_thread_var);
BX_THREAD_VAR(mix_thread_var); BX_THREAD_VAR(mix_thread_var);
#if BX_HAVE_LIBSAMPLERATE || BX_HAVE_SOXR_LSR #if BX_HAVE_LIBSAMPLERATE || BX_HAVE_SOXR_LSR
@ -173,7 +173,7 @@ public:
class BOCHSAPI_MSVCONLY bx_sound_lowlevel_c : public logfunctions { class BOCHSAPI_MSVCONLY bx_sound_lowlevel_c : public logfunctions {
public: public:
static bx_bool module_present(const char *type); static bool module_present(const char *type);
static bx_sound_lowlevel_c* get_module(const char *type); static bx_sound_lowlevel_c* get_module(const char *type);
static void cleanup(); static void cleanup();

View File

@ -79,7 +79,7 @@ bx_sound_lowlevel_c* bx_soundmod_ctl_c::get_driver(int driver_id)
return bx_sound_lowlevel_c::get_module(modname); return bx_sound_lowlevel_c::get_module(modname);
} }
bx_soundlow_waveout_c* bx_soundmod_ctl_c::get_waveout(bx_bool using_file) bx_soundlow_waveout_c* bx_soundmod_ctl_c::get_waveout(bool using_file)
{ {
bx_sound_lowlevel_c *module = NULL; bx_sound_lowlevel_c *module = NULL;
@ -116,7 +116,7 @@ bx_soundlow_wavein_c* bx_soundmod_ctl_c::get_wavein()
return wavein; return wavein;
} }
bx_soundlow_midiout_c* bx_soundmod_ctl_c::get_midiout(bx_bool using_file) bx_soundlow_midiout_c* bx_soundmod_ctl_c::get_midiout(bool using_file)
{ {
bx_sound_lowlevel_c *module = NULL; bx_sound_lowlevel_c *module = NULL;
bx_soundlow_midiout_c *midiout = NULL; bx_soundlow_midiout_c *midiout = NULL;

View File

@ -2,7 +2,7 @@
// $Id$ // $Id$
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// //
// Copyright (C) 2011-2017 The Bochs Project // Copyright (C) 2011-2021 The Bochs Project
// //
// This library is free software; you can redistribute it and/or // This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public // modify it under the terms of the GNU Lesser General Public
@ -32,10 +32,10 @@ public:
~bx_soundmod_ctl_c() {} ~bx_soundmod_ctl_c() {}
void init(void); void init(void);
void exit(void); void exit(void);
bx_bool register_driver(bx_sound_lowlevel_c *module, int driver_id); bool register_driver(bx_sound_lowlevel_c *module, int driver_id);
bx_soundlow_waveout_c* get_waveout(bx_bool using_file); bx_soundlow_waveout_c* get_waveout(bool using_file);
bx_soundlow_wavein_c* get_wavein(); bx_soundlow_wavein_c* get_wavein();
bx_soundlow_midiout_c* get_midiout(bx_bool using_file); bx_soundlow_midiout_c* get_midiout(bool using_file);
private: private:
bx_sound_lowlevel_c* get_driver(int driver_id); bx_sound_lowlevel_c* get_driver(int driver_id);

View File

@ -148,7 +148,7 @@ void bx_soundlow_waveout_sdl_c::resampler(audio_buffer_t *inbuffer, audio_buffer
} }
} }
bx_bool bx_soundlow_waveout_sdl_c::mixer_common(Bit8u *buffer, int len) bool bx_soundlow_waveout_sdl_c::mixer_common(Bit8u *buffer, int len)
{ {
Bit32u len2 = 0; Bit32u len2 = 0;

View File

@ -2,7 +2,7 @@
// $Id$ // $Id$
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// //
// Copyright (C) 2012-2017 The Bochs Project // Copyright (C) 2012-2021 The Bochs Project
// //
// This library is free software; you can redistribute it and/or // This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public // modify it under the terms of the GNU Lesser General Public
@ -39,10 +39,10 @@ public:
virtual void unregister_wave_callback(int callback_id); virtual void unregister_wave_callback(int callback_id);
virtual void resampler(audio_buffer_t *inbuffer, audio_buffer_t *outbuffer); virtual void resampler(audio_buffer_t *inbuffer, audio_buffer_t *outbuffer);
virtual bx_bool mixer_common(Bit8u *buffer, int len); virtual bool mixer_common(Bit8u *buffer, int len);
private: private:
bx_bool WaveOutOpen; bool WaveOutOpen;
SDL_AudioSpec fmt; SDL_AudioSpec fmt;
}; };
@ -60,7 +60,7 @@ public:
static void record_timer_handler(void *); static void record_timer_handler(void *);
void record_timer(void); void record_timer(void);
private: private:
bx_bool WaveInOpen; bool WaveInOpen;
SDL_AudioSpec fmt; SDL_AudioSpec fmt;
SDL_AudioDeviceID devID; SDL_AudioDeviceID devID;
}; };

View File

@ -118,7 +118,7 @@ int bx_soundlow_waveout_win_c::set_pcm_params(bx_pcm_param_t *param)
// try three times to find a suitable format // try three times to find a suitable format
for (int tries = 0; tries < 3; tries++) { for (int tries = 0; tries < 3; tries++) {
int frequency = real_pcm_param.samplerate; int frequency = real_pcm_param.samplerate;
bx_bool stereo = real_pcm_param.channels == 2; bool stereo = real_pcm_param.channels == 2;
int bits = real_pcm_param.bits; int bits = real_pcm_param.bits;
int bps = (bits / 8) * (stereo + 1); int bps = (bits / 8) * (stereo + 1);

View File

@ -2,7 +2,7 @@
// $Id$ // $Id$
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// //
// Copyright (C) 2001-2015 The Bochs Project // Copyright (C) 2001-2021 The Bochs Project
// //
// This library is free software; you can redistribute it and/or // This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public // modify it under the terms of the GNU Lesser General Public
@ -196,7 +196,7 @@ private:
LPWAVEHDR WaveInHdr; LPWAVEHDR WaveInHdr;
LPSTR WaveInData; LPSTR WaveInData;
bx_bool recording; bool recording;
int recordnextpacket(); int recordnextpacket();
}; };