From 3f5bb6c67f1341788bf5dea35575080136fba27c Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Sun, 17 May 2020 00:21:02 -0300 Subject: [PATCH 1/2] Versioning improvements * Add numeric major/minor version constants to 86box.h * Add copyright year constant to 86box.h * Update 86Box.rc to use the constants from 86box.h --- src/include/86box/86box.h | 5 +++++ src/win/86Box.rc | 27 +++++++++++---------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/include/86box/86box.h b/src/include/86box/86box.h index 38afdda57..ef0878b46 100644 --- a/src/include/86box/86box.h +++ b/src/include/86box/86box.h @@ -32,10 +32,15 @@ #ifdef RELEASE_BUILD #define EMU_VERSION "2.07" #define EMU_VERSION_W L"2.07" +#define EMU_VERSION_MAJ 2 +#define EMU_VERSION_MIN 7 #else #define EMU_VERSION "2.10" #define EMU_VERSION_W L"2.10" +#define EMU_VERSION_MAJ 2 +#define EMU_VERSION_MIN 10 #endif +#define COPYRIGHT_YEAR "2020" /* Filename and pathname info. */ #define CONFIG_FILE L"86box.cfg" diff --git a/src/win/86Box.rc b/src/win/86Box.rc index 068f8d6ed..3be96434c 100644 --- a/src/win/86Box.rc +++ b/src/win/86Box.rc @@ -281,13 +281,8 @@ FONT 9, "Segoe UI" BEGIN DEFPUSHBUTTON "OK",IDOK,129,94,71,12 ICON 100,IDC_ABOUT_ICON,7,7,20,20 -#ifdef RELEASE_BUILD - LTEXT "86Box v2.07 - An emulator of old computers\n\nAuthors: Sarah Walker, Miran Grca, Fred N. van Kempen (waltje), SA1988, MoochMcGee, reenigne, leilei, JohnElliott, greatpsycho, and others.\n\nReleased under the GNU General Public License version 2. See LICENSE for more information.", + LTEXT "86Box v" EMU_VERSION " - An emulator of old computers\n\nAuthors: Sarah Walker, Miran Grca, Fred N. van Kempen (waltje), SA1988, MoochMcGee, reenigne, leilei, JohnElliott, greatpsycho, and others.\n\nReleased under the GNU General Public License version 2. See LICENSE for more information.", IDC_ABOUT_ICON,54,7,146,73 -#else - LTEXT "86Box v2.10 - An emulator of old computers\n\nAuthors: Sarah Walker, Miran Grca, Fred N. van Kempen (waltje), SA1988, MoochMcGee, reenigne, leilei, JohnElliott, greatpsycho, and others.\n\nReleased under the GNU General Public License version 2. See LICENSE for more information.", - IDC_ABOUT_ICON,54,7,146,73 -#endif CONTROL "",IDC_ABOUT_ICON,"Static",SS_BLACKFRAME | SS_SUNKEN,0, 86,208,1 END @@ -1043,8 +1038,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 2,10,0,0 - PRODUCTVERSION 2,10,0,0 + FILEVERSION EMU_VERSION_MAJ,EMU_VERSION_MIN,0,0 + PRODUCTVERSION EMU_VERSION_MAJ,EMU_VERSION_MIN,0,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -1059,14 +1054,14 @@ BEGIN BEGIN BLOCK "040904b0" BEGIN - VALUE "CompanyName", "86Box\0" - VALUE "FileDescription", "86Box\0" - VALUE "FileVersion", "2.10\0" - VALUE "InternalName", "86Box\0" - VALUE "LegalCopyright", "Copyright © 2007-2020 86Box contributors\0" - VALUE "OriginalFilename", "86Box.exe\0" - VALUE "ProductName", "86Box Emulator\0" - VALUE "ProductVersion", "2.10\0" + VALUE "CompanyName", EMU_NAME "\0" + VALUE "FileDescription", EMU_NAME "\0" + VALUE "FileVersion", EMU_VERSION "\0" + VALUE "InternalName", EMU_NAME "\0" + VALUE "LegalCopyright", "Copyright © 2007-" COPYRIGHT_YEAR " " EMU_NAME " contributors\0" + VALUE "OriginalFilename", EMU_NAME ".exe\0" + VALUE "ProductName", EMU_NAME " Emulator\0" + VALUE "ProductVersion", EMU_VERSION "\0" END END BLOCK "VarFileInfo" From 1ceebf6860bbe59f25197b76a7676eba9ac0b4c5 Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Sun, 17 May 2020 00:49:03 -0300 Subject: [PATCH 2/2] SMBus: add length to block read operations --- src/include/86box/smbus.h | 8 ++++---- src/smbus.c | 14 +++++++------- src/smbus_piix4.c | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/include/86box/smbus.h b/src/include/86box/smbus.h index 058b70ffc..6923a7edb 100644 --- a/src/include/86box/smbus.h +++ b/src/include/86box/smbus.h @@ -24,7 +24,7 @@ extern void smbus_sethandler(uint8_t base, int size, uint8_t (*read_byte)(uint8_t addr, void *priv), uint8_t (*read_byte_cmd)(uint8_t addr, uint8_t cmd, void *priv), uint16_t (*read_word_cmd)(uint8_t addr, uint8_t cmd, void *priv), - uint8_t (*read_block_cmd)(uint8_t addr, uint8_t cmd, uint8_t *data, void *priv), + uint8_t (*read_block_cmd)(uint8_t addr, uint8_t cmd, uint8_t *data, uint8_t len, void *priv), void (*write_byte)(uint8_t addr, uint8_t val, void *priv), void (*write_byte_cmd)(uint8_t addr, uint8_t cmd, uint8_t val, void *priv), void (*write_word_cmd)(uint8_t addr, uint8_t cmd, uint16_t val, void *priv), @@ -35,7 +35,7 @@ extern void smbus_removehandler(uint8_t base, int size, uint8_t (*read_byte)(uint8_t addr, void *priv), uint8_t (*read_byte_cmd)(uint8_t addr, uint8_t cmd, void *priv), uint16_t (*read_word_cmd)(uint8_t addr, uint8_t cmd, void *priv), - uint8_t (*read_block_cmd)(uint8_t addr, uint8_t cmd, uint8_t *data, void *priv), + uint8_t (*read_block_cmd)(uint8_t addr, uint8_t cmd, uint8_t *data, uint8_t len, void *priv), void (*write_byte)(uint8_t addr, uint8_t val, void *priv), void (*write_byte_cmd)(uint8_t addr, uint8_t cmd, uint8_t val, void *priv), void (*write_word_cmd)(uint8_t addr, uint8_t cmd, uint16_t val, void *priv), @@ -46,7 +46,7 @@ extern void smbus_handler(int set, uint8_t base, int size, uint8_t (*read_byte)(uint8_t addr, void *priv), uint8_t (*read_byte_cmd)(uint8_t addr, uint8_t cmd, void *priv), uint16_t (*read_word_cmd)(uint8_t addr, uint8_t cmd, void *priv), - uint8_t (*read_block_cmd)(uint8_t addr, uint8_t cmd, uint8_t *data, void *priv), + uint8_t (*read_block_cmd)(uint8_t addr, uint8_t cmd, uint8_t *data, uint8_t len, void *priv), void (*write_byte)(uint8_t addr, uint8_t val, void *priv), void (*write_byte_cmd)(uint8_t addr, uint8_t cmd, uint8_t val, void *priv), void (*write_word_cmd)(uint8_t addr, uint8_t cmd, uint16_t val, void *priv), @@ -57,7 +57,7 @@ extern uint8_t smbus_has_device(uint8_t addr); extern uint8_t smbus_read_byte(uint8_t addr); extern uint8_t smbus_read_byte_cmd(uint8_t addr, uint8_t cmd); extern uint16_t smbus_read_word_cmd(uint8_t addr, uint8_t cmd); -extern uint8_t smbus_read_block_cmd(uint8_t addr, uint8_t cmd, uint8_t *data); +extern uint8_t smbus_read_block_cmd(uint8_t addr, uint8_t cmd, uint8_t *data, uint8_t len); extern void smbus_write_byte(uint8_t addr, uint8_t val); extern void smbus_write_byte_cmd(uint8_t addr, uint8_t cmd, uint8_t val); extern void smbus_write_word_cmd(uint8_t addr, uint8_t cmd, uint16_t val); diff --git a/src/smbus.c b/src/smbus.c index d24435cc7..fdb98ea78 100644 --- a/src/smbus.c +++ b/src/smbus.c @@ -33,7 +33,7 @@ typedef struct _smbus_ { uint8_t (*read_byte)(uint8_t addr, void *priv); uint8_t (*read_byte_cmd)(uint8_t addr, uint8_t cmd, void *priv); uint16_t (*read_word_cmd)(uint8_t addr, uint8_t cmd, void *priv); - uint8_t (*read_block_cmd)(uint8_t addr, uint8_t cmd, uint8_t *data, void *priv); + uint8_t (*read_block_cmd)(uint8_t addr, uint8_t cmd, uint8_t *data, uint8_t len, void *priv); void (*write_byte)(uint8_t addr, uint8_t val, void *priv); void (*write_byte_cmd)(uint8_t addr, uint8_t cmd, uint8_t val, void *priv); @@ -73,7 +73,7 @@ smbus_log(const char *fmt, ...) static uint8_t smbus_null_read_byte(uint8_t addr, void *priv) { smbus_log("SMBus: read_byte(%02x)\n", addr); return(0xff); } static uint8_t smbus_null_read_byte_cmd(uint8_t addr, uint8_t cmd, void *priv) { smbus_log("SMBus: read_byte_cmd(%02x, %02x)\n", addr, cmd); return(0xff); } static uint16_t smbus_null_read_word_cmd(uint8_t addr, uint8_t cmd, void *priv) { smbus_log("SMBus: read_word_cmd(%02x, %02x)\n", addr, cmd); return(0xffff); } -static uint8_t smbus_null_read_block_cmd(uint8_t addr, uint8_t cmd, uint8_t *data, void *priv) { smbus_log("SMBus: read_block_cmd(%02x, %02x)\n", addr, cmd); return(0x00); }; +static uint8_t smbus_null_read_block_cmd(uint8_t addr, uint8_t cmd, uint8_t *data, uint8_t len, void *priv) { smbus_log("SMBus: read_block_cmd(%02x, %02x)\n", addr, cmd); return(0x00); }; static void smbus_null_write_byte(uint8_t addr, uint8_t val, void *priv) { smbus_log("SMBus: write_byte(%02x, %02x)\n", addr, val); } static void smbus_null_write_byte_cmd(uint8_t addr, uint8_t cmd, uint8_t val, void *priv) { smbus_log("SMBus: write_byte_cmd(%02x, %02x, %02x)\n", addr, cmd, val); } static void smbus_null_write_word_cmd(uint8_t addr, uint8_t cmd, uint16_t val, void *priv) { smbus_log("SMBus: write_word_cmd(%02x, %02x, %04x)\n", addr, cmd, val); } @@ -135,7 +135,7 @@ smbus_sethandler(uint8_t base, int size, uint8_t (*read_byte)(uint8_t addr, void *priv), uint8_t (*read_byte_cmd)(uint8_t addr, uint8_t cmd, void *priv), uint16_t (*read_word_cmd)(uint8_t addr, uint8_t cmd, void *priv), - uint8_t (*read_block_cmd)(uint8_t addr, uint8_t cmd, uint8_t *data, void *priv), + uint8_t (*read_block_cmd)(uint8_t addr, uint8_t cmd, uint8_t *data, uint8_t len, void *priv), void (*write_byte)(uint8_t addr, uint8_t val, void *priv), void (*write_byte_cmd)(uint8_t addr, uint8_t cmd, uint8_t val, void *priv), void (*write_word_cmd)(uint8_t addr, uint8_t cmd, uint16_t val, void *priv), @@ -180,7 +180,7 @@ smbus_removehandler(uint8_t base, int size, uint8_t (*read_byte)(uint8_t addr, void *priv), uint8_t (*read_byte_cmd)(uint8_t addr, uint8_t cmd, void *priv), uint16_t (*read_word_cmd)(uint8_t addr, uint8_t cmd, void *priv), - uint8_t (*read_block_cmd)(uint8_t addr, uint8_t cmd, uint8_t *data, void *priv), + uint8_t (*read_block_cmd)(uint8_t addr, uint8_t cmd, uint8_t *data, uint8_t len, void *priv), void (*write_byte)(uint8_t addr, uint8_t val, void *priv), void (*write_byte_cmd)(uint8_t addr, uint8_t cmd, uint8_t val, void *priv), void (*write_word_cmd)(uint8_t addr, uint8_t cmd, uint16_t val, void *priv), @@ -223,7 +223,7 @@ smbus_handler(int set, uint8_t base, int size, uint8_t (*read_byte)(uint8_t addr, void *priv), uint8_t (*read_byte_cmd)(uint8_t addr, uint8_t cmd, void *priv), uint16_t (*read_word_cmd)(uint8_t addr, uint8_t cmd, void *priv), - uint8_t (*read_block_cmd)(uint8_t addr, uint8_t cmd, uint8_t *data, void *priv), + uint8_t (*read_block_cmd)(uint8_t addr, uint8_t cmd, uint8_t *data, uint8_t len, void *priv), void (*write_byte)(uint8_t addr, uint8_t val, void *priv), void (*write_byte_cmd)(uint8_t addr, uint8_t cmd, uint8_t val, void *priv), void (*write_word_cmd)(uint8_t addr, uint8_t cmd, uint16_t val, void *priv), @@ -308,7 +308,7 @@ smbus_read_word_cmd(uint8_t addr, uint8_t cmd) } uint8_t -smbus_read_block_cmd(uint8_t addr, uint8_t cmd, uint8_t *data) +smbus_read_block_cmd(uint8_t addr, uint8_t cmd, uint8_t *data, uint8_t len) { uint8_t ret = 0; smbus_t *p; @@ -318,7 +318,7 @@ smbus_read_block_cmd(uint8_t addr, uint8_t cmd, uint8_t *data) if (p) { while(p) { if (p->read_block_cmd) { - ret = MAX(ret, p->read_block_cmd(addr, cmd, data, p->priv)); + ret = MAX(ret, p->read_block_cmd(addr, cmd, data, len, p->priv)); found++; } p = p->next; diff --git a/src/smbus_piix4.c b/src/smbus_piix4.c index 8a1a0a762..ad8ff64d0 100644 --- a/src/smbus_piix4.c +++ b/src/smbus_piix4.c @@ -157,7 +157,7 @@ smbus_piix4_write(uint16_t addr, uint8_t val, void *priv) break; case 0x5: /* block R/W */ if (smbus_read) - dev->data0 = smbus_read_block_cmd(smbus_addr, dev->cmd, dev->data); + dev->data0 = smbus_read_block_cmd(smbus_addr, dev->cmd, dev->data, SMBUS_PIIX4_BLOCK_DATA_SIZE); else smbus_write_block_cmd(smbus_addr, dev->cmd, dev->data, dev->data0); dev->next_stat = 0x2;