VOGONS


First post, by davecom

User metadata
Rank Newbie
Rank
Newbie

Hi All,

Well I have my emulator to the point of booting into Casette BASIC. I just implemented the keyboard and I'm wondering why I'm only seeing apostrophes (') in BASIC when I type. The scan codes look correct to me from my PPI and I'm just storing those scan codes in port A and calling interrupt line 1 on the PIC. Has anyone seen behavior like this before and have an idea where I have gone wrong? A screenshot is attached so you can see the apostrophes I can type (no matter what key I hit). The strange u under the cursor I think is a separate problem.

Not sure why the bytes are also wrong... this is a 640K machine but maybe Casette BASIC V1 doesn't know about more than 64K?

Thanks in advance!

PS My hacky source code for the PPI is here if you're interested:
https://github.com/davecom/DK86PC/blob/master/PPI.cpp

Screen Shot 2021-01-03 at 9.30.00 PM.png
Filename
Screen Shot 2021-01-03 at 9.30.00 PM.png
File size
9.17 KiB
Views
1302 views
File license
Public domain

Reply 1 of 9, by Jo22

User metadata
Rank l33t++
Rank
l33t++

This is very interesting, I wished I could help.
All I can say is, that GW-BASIC has a ~64KB limit, too.
According to the screenshots found online, it's 60300 bytes..
I assume it's related to the limit of what a COM file or a simple memory segment can hold in Real-Mode.
Ironically, though, GWBASIC was distributed as an EXE file..
(Makes me wonder if EXE2BIN coukd7 turn it into a COM file!)

"Time, it seems, doesn't flow. For some it's fast, for some it's slow.
In what to one race is no time at all, another race can rise and fall..." - The Minstrel

//My video channel//

Reply 2 of 9, by davecom

User metadata
Rank Newbie
Rank
Newbie

Thanks for the reply. I believe the memory issue is related to a 64K limit after learning some more.

However, the apostrophes thing I have no idea what is going on. Any ideas about the reason all keystrokes are ending up as apostrophes I would be interested in. I have verified the initial scan codes are correct, but somehow they are being transformed incorrectly I suppose.

Reply 3 of 9, by Jo22

User metadata
Rank l33t++
Rank
l33t++

Hi again, not sure if this helpful, but on an XT machine I sometimes got weird
characters if I used an AT keyboard switched to PC/XT mode.
More precisely, if I used the arrow keys or other extra keys not found on a true XT keyboard.
Also, the XT machine would make a beep sound whenever I pressed the extra keys (the key presses worked, though).

Again, not sure if this is related in any way. 😅
It's just the closest thing I've encountered in the past.

"Time, it seems, doesn't flow. For some it's fast, for some it's slow.
In what to one race is no time at all, another race can rise and fall..." - The Minstrel

//My video channel//

Reply 4 of 9, by superfury

User metadata
Rank l33t++
Rank
l33t++

Perhaps it's some CPU instruction calculation error? Check conditional jumps and arithmetic instructions(affected flags)?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 5 of 9, by davecom

User metadata
Rank Newbie
Rank
Newbie

Thanks for the replies.

So, this is an XT BIOS (the public domain one) and the scan codes are XT scan codes that I am following.

It could be a CPU bug of course—I'll need to rerun my automated tests. Related aside—is there a raw ROM that does more extensive CPU tests than the public domain BIOS does? I have alternative tests, but I don't love them. I am trying the 5150 Diagnostics ROM, but I am having some trouble booting it, so it's not super helpful at this point.

Reply 6 of 9, by superfury

User metadata
Rank l33t++
Rank
l33t++

Perhaps try the Landmark/Supersoft BIOS? Or perhaps strip down the test386.asm one for 8086 instructions only?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 7 of 9, by davecom

User metadata
Rank Newbie
Rank
Newbie

So, it turned out to be a problem with my XLAT instruction. Next issue... always seeing a ü where the cursor is positioned. What controls in Casette BASIC the character under the cursor? Screenshot attached.

CasetteBASIC.png
Filename
CasetteBASIC.png
File size
8.4 KiB
Views
1107 views
File license
Public domain

Reply 9 of 9, by davecom

User metadata
Rank Newbie
Rank
Newbie

Incase anyone digs up this old thread... the weird u character turned out to be something related to not respecting segment registers in certain opcodes. In other words it was a CPU bug, not CGA bug.

I'm successfully running some BASIC now.

Attachments

  • CasetteBASIC.png
    Filename
    CasetteBASIC.png
    File size
    54.81 KiB
    Views
    892 views
    File license
    Public domain