-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ATBASIC ERROR in string substrings #163
Comments
Here is a photo of my screen.
…On Thu, Oct 3, 2024, 12:55 p.m. Ivo van Poorten ***@***.***> wrote:
I can not reproduce this:
atari000.png (view on web)
<https://github.com/user-attachments/assets/f9f058f0-7682-47bc-aa3a-513f4168d86d>
Could you show the exact steps you took and its output?
—
Reply to this email directly, view it on GitHub
<#163 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/APALSOMZP6QRTXAGSRBJFRTZZWOMFAVCNFSM6AAAAABNVWEK2CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOJSGIYTMOJUHE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
I can also reproduce it on the Oric, VIC20 and PET (all emulated) - so somehow it seems to only work on the Atari. Strange! |
I suppose some Atari dependency is still left in the source code (Altirra was originally written solely for the Atari), hence it working correctly on the Atari but not on other systems. |
I have vague memories that Atari basic uses hardware to generate random numbers, and that doesn't work on the CP/M-65 port, so it's plausible that there's some other Atari-specific code I've missed. But it's too long ago now and I'd have no idea what it is. |
Yes, it reads the Atari Pokey chip's RANDOM register, which is a 17-bit LFSR. I see you replaced that with I could add sfc16 from here. That would add better random numbers than the original on the Atari 😉 A simple 16-bit LFSR could also be done, if adding 180 bytes would be too large. xorshift16 for example. This printing of a sub-string bug does not seem related though. I have no idea where to search for it. |
If you try and extract a substring using A$(4,5) it appears that it is treated as a numeric and the left Bracket is used as exponentiation.
ie if B$="AB" and you print B$(1) you get 5.20200002e+53
Edit: This is on nano6502. This is for printing. If you let A$=B$(1) then print A$ you get the correct result.
The text was updated successfully, but these errors were encountered: