MCPcopy Create free account
hub / github.com/BlitterStudio/amiberry / checkvaltype2

Function checkvaltype2

src/debug.cpp:981–1098  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

979}
980
981static int checkvaltype2(TCHAR **c, uae_u32 *val, debugfloatx80 *valx80, TCHAR def)
982{
983 TCHAR nc;
984
985 ignore_ws(c);
986
987#ifdef WITH_SOFTFLOAT
988 // check for floating point formats
989 TCHAR *cp = *c;
990 for (;;) {
991 nc = *cp++;
992 TCHAR nc2 = _totupper (*cp);
993 if (!nc || _istspace(nc)) {
994 break;
995 }
996 if (nc == '.' && (nc2 == 'S' || nc2 == 'D' || nc2 == 'X')) {
997 float_status st = { 0 };
998 nc = _totupper(**c);
999 if (nc == '$') {
1000 (*c)++;
1001 }
1002 if (nc == '0' && _totupper((*c)[1]) == 'X') {
1003 (*c) += 2;
1004 }
1005 if (nc2 == 'S') {
1006 if (readhexx(c, val)) {
1007 *valx80 = float32_to_floatx80(*val, &st);
1008 return NUMTYTPE_S;
1009 }
1010 }
1011 if (nc2 == 'D') {
1012 uae_u32 val2;
1013 if (readhexx(c, val)) {
1014 if (readhexx(c, &val2)) {
1015 *valx80 = float64_to_floatx80((((uae_u64)(*val)) << 32) | val2, &st);
1016 return NUMTYTPE_D;
1017 }
1018 }
1019 }
1020 if (nc2 == 'X') {
1021 uae_u32 val1;
1022 uae_u32 val2, val3;
1023 if (readhexx(c, &val1)) {
1024 if (peekchar(c) == '.') {
1025 (*c)++;
1026 }
1027 if (readhexx(c, &val2)) {
1028 if (readhexx(c, &val3)) {
1029 valx80->high = val1;
1030 valx80->low = ((uae_u64)val2 << 32) | val3;
1031 return NUMTYTPE_X;
1032 }
1033 }
1034 }
1035 }
1036 return 0;
1037 }
1038 }

Callers 1

checkvaltypeFunction · 0.85

Calls 11

ignore_wsFunction · 0.85
readhexxFunction · 0.85
float32_to_floatx80Function · 0.85
float64_to_floatx80Function · 0.85
peekcharFunction · 0.85
readintxFunction · 0.85
readbinxFunction · 0.85
iscfloatFunction · 0.85
readfloatxFunction · 0.85
readregxFunction · 0.85

Tested by

no test coverage detected