Mail Archives: djgpp-workers/1998/12/17/05:38:58
Dear All,
>What are the implications of this on other DPMI hosts? Aren't we
>introducing here something that relies on CWSDPMI features? Charles,
>can you comment on that?
Sorry, I don't understand fully.
>> + #if 1 /* patched by adamtk AT altavista DOT net 98.12.14 */
>> + static char char32spc[] = "xxx.xxx.xxx.xxx-xxx.xxx.xxx.xxx ";
>> + #else /* not patched by adamtk 98.12.14 */
>> static char char32spc[] = "xxx$B>> + #endif /* end of patch by adamtk 98.12.14 */
>
>Why is this needed?
Because PC98's character code is not ASCII.
It uses `Microsoft Kanji Encoding Scheme' (aka `Shift-JIS') code.
The chars MSB set (1) means `start of Double-Byte-Character-Sequense
(aka DBCS)'. So, `$B
>As far as I could see, `getkbd' calls function 07h of Interrupt 21h.
Edebug now uses only ASCII keys. and,
>But I must admit that I don't understand why the BIOS function is not
>good for PC98. AFAIK, BIOS keyboard support is not different there.
Sorry, PC98 is not PC/AT compatible, and not DOS/V. So, BIOS, I/O port,
Scan Code, etc, etc, ... are all different.
>> + #if 1 /* patched by adamtk AT altavista DOT net 98.12.14 */
>> + {
>> + putchar('\n');
>> + break;
>> + }
>> + #else /* not patched by adamtk 98.12.14 */
>
>What is this (and several similar patches) for?
This is for making sure prompt begins left most of next line.
>> + #if 1 /* patched by adamtk AT altavista DOT net 98.12.14 */
>> + vaddr++;
>> + #endif /* end of patch by adamtk 98.12.14 */
>
>And this?
All other commands like `Dump', `Set', etc, vaddr contains *next*
address when commands done. But only `Dump-ASCII' does not.
>> + #if 1 /* patched by adamtk AT altavista DOT net 98.12.14 */
>> + if ((c&=0xFF)<' ')
>> + putchar('.');
>> + else
>> + putchar(c);
>> + #else /* not patched by adamtk 98.12.14 */
>
>And what does this do?
Because Shift-JIS is 8-bits-character. When char's MSB is set, and
convert char to int, then it converted to negative number. If code is
as original, they are not displayed.
>> + #if 1 /* patched by adamtk AT altavista DOT net 98.12.14 */
>> + printf(" \n"); /* for DBCS */
>> + #else /* not patched by adamtk 98.12.14 */
>> printf("\n");
>> + #endif /* end of patch by adamtk 98.12.14 */
>
>Why does DBCS require a blank before the newline?
If last displayed char is DBCS leading code, console device requires
`printable-character' (greater or equals to 32 decimal).
>> + #if 1 /* patched by adamtk AT altavista DOT net 98.12.14 */
>> + printf("%s ", buf2);
>> + #endif /* end of patch by adamtk 98.12.14 */
>
>Why is this needed?
Please see above.
>> + #if 1 /* patched by adamtk AT altavista DOT net 98.12.14 */
>> + printf("%04x ", *(word16 *)((word8 *)tss_ptr + regs[i].ofs));
>> + #else /* not patched by adamtk 98.12.14 */
>> printf("%04x ", *(word16 *)((word16 *)tss_ptr + regs[i].ofs));
>> + #endif /* end of patch by adamtk 98.12.14 */
>
>What was wrong with the original code here?
type of word16 is `unsigned short'. We just want `byte offset' from
tss_ptr, but original code returns two-times of byte offset.
>> + #if 1 /* patched by adamtk AT altavista DOT net 98.12.14 */
>> + if (len > 1)
>> + #else /* not patched by adamtk 98.12.14 */
>> if (len < 2)
>> + #endif /* end of patch by adamtk 98.12.14 */
>
>What is the reason for this change?
This code is `parse SET's 2nd token'. `len' contains count of
tokens. Why do we parse the 2nd token just we know token count is
less than two?:)
>> + if (ScreenPrimary == 0xa0000) /* Japanese PC98? */
>
>Is this a reliable test for PC98? conio.c from v2.02 uses what I
>think is a better way: it calls function FEh of interrupt 10h.
INT 10h/AH=FEh detects DOS/V or not, but that can't detect PC98.
INT10h on PC98 is used for `Printer hardware interrupt', and software
calls this, then hangs up.
>> + #if 1 /* patched by adamtk AT altavista DOT net 98.12.14 */
>> + x stdout->_file = open(ctermid(NULL), (O_RDWR | O_TEXT), 0666);
>> + stdin->_file = dup(stdout->_file);
>> + #else /* not patched by adamtk 98.12.14 */
>> x stdout->_file = dup(fileno(stdout));
>> + #endif /* end of patch by adamtk 98.12.14 */
>
>What does this do, and why? (And, btw, what are those `x' characters
>at the beginning of the line?)
For works edebug32 correctly if stdin/stdout was redirected at start
up time. Because of original edebug32 uses the BIOS.
`x' is debug code I think. Please see ed.c line around 51.
>> + #if 1 /* patched by adamtk AT altavista DOT net 98.12.14 */
>> + "%g2 %Eb,%Ibb", "%g2 %Ev,%Ibb", "ret %Iww", "ret",
>> + #else /* not patched by adamtk 98.12.14 */
>> "%g2 %Eb,%Ibb", "%g2 %Ev,%Ibb", "ret %Iw", "ret",
>> + #endif /* end of patch by adamtk 98.12.14 */
>
>What about this one?
I don't understand fully :). All other `%I' sequence contains two
suffixes, and I just adjust it.
>> + #if 1 /* patched by adamtk AT altavista DOT net 98.12.14 */
>> + buf1[i] = (buf1[i-1] & 0x80) ? 0xff : 0;
>> + #else /* not patched by adamtk 98.12.14 */
>> buf1[i] = (buf[i-1] & 0x80) ? 0xff : 0;
>> + #endif /* end of patch by adamtk 98.12.14 */
>
>And what was wrong here?
This code does `Sign extend'. In above line (unassmbl.c line around
434), it gets some operand bytes in `buf1', not `buf'.
>Doesn't PC98 support graphics characters with ASCII codes below 32
>decimal?
Yes. PC98 maps some codes below 32 decimal as a screen control
character. For example, 26 decimal means `clear screen', 30 decimal
means `home', and so on.
--------
ADAM, as Toshio KUDO
GCG02632 AT nifty DOT ne DOT jp / adamtk AT altavista DOT net
- Raw text -