Skip to content

Commit

Permalink
Fixing bug in GR8NET devices not properly returning name version string
Browse files Browse the repository at this point in the history
  • Loading branch information
fr3nd authored and Carles Amigó committed Aug 21, 2018
1 parent ce623d0 commit b28b607
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
24 changes: 14 additions & 10 deletions src/hub.c
Original file line number Diff line number Diff line change
Expand Up @@ -307,23 +307,27 @@ void get_unapi_version_string(char *unapiver) {
byte version_main;
byte version_sec;
uint name_address;
char buffer[80];
/*char buffer[80];*/
int n;

UnapiCall(code_block, UNAPI_GET_INFO, &regs, REGS_NONE, REGS_MAIN);
version_main = regs.Bytes.B;
version_sec = regs.Bytes.C;
name_address = regs.UWords.HL;

n = 0;
do {
c = UnapiRead(code_block, name_address);
buffer[n] = c;
name_address++;
n++;
} while (c != '\0');

sprintf(unapiver, "%s v%i.%i", buffer, version_main, version_sec);
// XXX
// GR8NET doesn't seem to return the name string properly.
// Disabling it for now...
// See https://www.msx.org/forum/msx-talk/general-discussion/msxhub-first-beta-release-call-for-help
/*n = 0;*/
/*do {*/
/* c = UnapiRead(code_block, name_address);*/
/* buffer[n] = c;*/
/* name_address++;*/
/* n++;*/
/*} while (c != '\0');*/

sprintf(unapiver, "%s v%i.%i", "UNAPI", version_main, version_sec);
debug("%s", unapiver);
}

Expand Down
2 changes: 1 addition & 1 deletion src/include/globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#include "asm.h"

#define MSXHUB_VERSION "0.1.0 beta"
#define MSXHUB_VERSION "0.1.1 beta"

/* DOS errors */
#define NOFIL 0xD7
Expand Down

0 comments on commit b28b607

Please sign in to comment.