Jump to content
serj

Altirra 2.50 Final out

Recommended Posts

In Atari BASIC, even if it is not a common technique, you can call it fairly accepted. It is like BASIC self-modifying code: you print the contents of a command or a new program line on the screen, print "CONT" below it, set the cursor above everything, do the POKE, and execute STOP. The cursor starts going down as if the user was pressing the Return key, so it enters the line/command/whatever, then finds the CONT and thus the program restarts itself.

 

It is used in some programs like Graph 3D for example.

I remember using this technique for bulk renumbering program lines since Atari BASIC doesn't have any form of RENUMBER command. It wasn't my idea, but I don't remember where did I get that from.

Share this post


Link to post
Share on other sites

I remember ANTIC or another magazine published a small BASIC program in every issue which you could type in to help you enter the larger programs correctly. It would let you enter a line of code and then it would compute an ATASCII checksum that you could compare with the symbols in the magazine. Anyhow, I'm pretty sure it also used this STOP/CONT trick.

Share this post


Link to post
Share on other sites

Some time ago I wrote BASX - reimplementation of Atari BASIC based on rev C.

It has a few features:

1. PORTB configuration of program memory banks (using RAM under ROM, extended memory banks) in BASX.CFG file in form:

BANK:BEGIN-END<EOL>

where BANK is hex value set in PORTB, BEGIN and END are hex addresses of memory block f.ex:

E1:4000-7FFF


E5:4000-7FFF


E9:4000-7FFF


ED:4000-7FFF


FE:D800-DFFF


FE:E400-FFBF


FE:C000-CFFF


FE:E000-E3FF


FF:A000-BFFF
and so on. Base memory is used at last, so it can be used for strings, arrays, graphics and music.

2. Automatic startup of D:AUTORUN.BAS file.

3. Some bugfixes of syntax valiadtor (f.ex. "10 DIM: DIM").

4. Case insensitive and inverse video parsing.

5. RESET resistance (return to BASX; only DOS exits and uninstall of BASX).

6. ASC("") throws ERROR 5, not 44 value (42 will be more correct :]).

7. Writing memory location $B9 (ERRCOD) with non zero value N from machine code executed by USR will return with ERROR N (throwing errors from USR).

8. FRE(0) returns amount of base RAM (like in standard AB), but FRE(-N) returns amount of all memory accessible for program.

9. ADR accept strings, variables and arrays (possibility of passing addresses of all BASIC objects to the USR call).

10. A$(1+LEN(A$)) returns empty string ("").

11. I/O instructions accept #0.

BASX isn't ROM replacement, but .COM file version interpretter.

Current version of BASX has a few number of bugs yet, but I have another projects and I cant say where I could fix them. So maybe some features suggestions would be useful in your project :)

On my bugfix list was yet:

- Automatic GR.0 after entering into BASX to open #6 for PLOT, DRAWTO and FILL (XIO#17),

- Safe program restore from high and extended memory after cold start.

 

Edit: CAUTION! ADR("some text") results with wrong address (because all program memory objects have virtual addresses).

Edited by mono
  • Like 1

Share this post


Link to post
Share on other sites

I remember ANTIC or another magazine published a small BASIC program in every issue which you could type in to help you enter the larger programs correctly. It would let you enter a line of code and then it would compute an ATASCII checksum that you could compare with the symbols in the magazine. Anyhow, I'm pretty sure it also used this STOP/CONT trick.

Yep, I remember seeing this trick used in a few programs, think I've even used it in some of my old programs...

Share this post


Link to post
Share on other sites

In Atari BASIC, even if it is not a common technique, you can call it fairly accepted. It is like BASIC self-modifying code: you print the contents of a command or a new program line on the screen, print "CONT" below it, set the cursor above everything, do the POKE, and execute STOP. The cursor starts going down as if the user was pressing the Return key, so it enters the line/command/whatever, then finds the CONT and thus the program restarts itself.

 

It is used in some programs like Graph 3D for example.

 

The old Forem XL BBS used this technique. Carina BBS uses it also...

Share this post


Link to post
Share on other sites

Anyone running Altirra in an Oracle Virtualbox VM (Win Xp)? As soon as I try to run it, it resizes the entire VM window and crashes creating the .mdmp file? (Altirra latest version)

Edited by bf2k+

Share this post


Link to post
Share on other sites

Update:

http://www.virtualdub.org/beta/Altirra-2.60-test22.zip

http://www.virtualdub.org/beta/Altirra-2.60-test22-src.zip

 

Crash on VirtualBox was due to some bizarre behavior with the VirtualBox graphics driver where merely initializing Direct3D 9 causes it to change the display mode -- added a workaround. Older versions should work if you force DirectDraw on first run (/ddraw).

 

Added options to swap and rotate disk drives, which should make it easier to work with programs that require swapping. Swapping is done through the sub-menu buttons in the Disk Drives dialog, and rotation is done through File > Attach Disk > Rotate commands, which can be bound to keyboard shortcuts. Unlike doing so manually, this can swap disk drives that contain temporarily modified disks without committing the changes to disk. Also, the detach commands now power off the emulated drive.

 

H: now has an option to use lowercase filenames.

 

ATBasic 1.30 fixes a bug in READ/INPUT with dangling empty string entries and adds more partial support for CONT, which can now preserve runtime stack entries. However, it stiil differs from Atari BASIC in that any missing lines referenced by the runtime stack will trigger a missing line error immediately instead of when the NEXT/RETURN is executed. This is enough at least to get some programs working.

 

atbasic.bin

atbasicx.xex

  • Like 1

Share this post


Link to post
Share on other sites

The 1.30 version XEX does not work for me using a 400/800 OSB operating system. The ROM version worked fine, just not the XEX.

Share this post


Link to post
Share on other sites

Back on-line (short holiday) :-)

 

Downloaded the new versions.

Well done!

 

Can you include the new MyIDE-][ CPLD-firmware on the next update?

Share this post


Link to post
Share on other sites

I'm using Altirra-2.60test22 on wine (Ubuntu 14.04 x64). I've enabled 800XL memory model (64K base RAM) with neither extended PORTB RAM nor Axlon RAM. I've enabled VBXE FX 1.24 core PAL with "Use VBXE memory for expansion" option checked. It should enable extended memory (RAMBO) emulated by VBXE accessible by PORTB, but it doesn't. I've enabled standard Atari XL/XE OS rev.B, Atari BASIC rev.C and SDX 4.47 cart.

 

Altirra debugger informations:

 

Altirra> .map
00D600-00D6FF 57 --W hardware
00D500-00D5FF 57 ARW hardware
00D600-00D6FF 57 ARW hardware
00D000-00D0FF 57 --W hardware
00D300-00D3FF 56 ARW hardware [PIA]
00D200-00D2FF 56 ARW hardware [POKEY]
00D000-00D0FF 56 ARW hardware [GTIA]
00D100-00D1FF 51 --W hardware
00D500-00D5FF 29 ARW hardware [Cartridge control window 1]
00A000-00BFFF 25 ARO direct memory [Cartridge variable window 1]
00D400-00D4FF 8 ARW hardware [ANTIC]
00A000-00BFFF 8 --- direct memory [bASIC ROM]
00D800-00FFFF 8 ARO direct memory [upper kernel ROM]
00C000-00CFFF 8 ARO direct memory [Lower kernel ROM]
005000-0057FF 8 --- direct memory [self-test ROM]
00D800-00E7FF 3 --- hardware
004000-007FFF 2 --- hardware
004000-007FFF 1 --- direct memory [Extended RAM]
00D800-00FFFF 0 ARW direct memory [High RAM]
000000-00CFFF 0 ARW direct memory [Low RAM]

Altirra> .pia
Port A control: 3c (IOR, motor line high / off)
Port A direction: 00
Port A output: 00
Port A edge: none
Port B control: 3c (IOR, command line high / off)
Port B direction: ff
Port B output: ff
Port B edge: pending

 

Altirra> .bank
Bank state: FF
Kernel ROM: enabled
BASIC ROM: disabled
CPU bank: disabled
Antic bank: disabled
Self test ROM: disabled
Antic bank: $000000
CPU bank: $000000
Cartridge 1 bank: $0E ($01C000)
Cartridge 2 bank: disabled

SysInfo2 screenshot assigned.

post-18632-0-41549900-1417264445_thumb.png

post-18632-0-64287100-1417264674_thumb.png

Edited by mono

Share this post


Link to post
Share on other sites

You need to set the memory configuration to 320K Rambo as well. The VBXE shared memory option just enables memory sharing, but doesn't set the PORTB extended memory mapping mode.

Share this post


Link to post
Share on other sites

Update:

http://www.virtualdub.org/beta/Altirra-2.60-test23.zip

http://www.virtualdub.org/beta/Altirra-2.60-test23-src.zip

 

Fixed an issue with the Hotel title screen when running under AltirraOS due to weird CIO usage (the game that keeps on giving...).

Fixed a bug causing video snow when running '816 mode >1.79MHz, due to the CPU using the bus at the same time as ANTIC for false indexing cycles. ("Hey, cool, the CPU's going so fast you can see it stealing cycles from the video chip. Uh, wait, it's not supposed to do that....")

Fixed ATBasic not recognizing . as REM.

Fixed ATBasic resetting the TRAP line on CLR and LOAD, when it should only do so for NEW.

Fixed another issue with running the EXE version of ATBasic under OS-B. It now lowers RAMTOP by 4K to work around the screen editor memory trashing bug.

 

Took a shot at writing a BASIC manual. It's not a great introduction to BASIC, but it should cover all of the extensions. I used LibreOffice's formula writer to do the syntax diagrams... was pretty easy to do but the formulas all look like they're covered in Vaseline after exporting to PDF.

 

atbasic.bin

atbasicx.xex

atbasic.pdf

  • Like 12

Share this post


Link to post
Share on other sites

I agree with Xuel. The LibreOffice's formula diagrams look perfectly clear to me as well. Overall, the ATBasic manual content is excellent and looks professional, too! The layout is easy to follow, the information is really useful, and the screen dumps are nice references. I also like the summary of "Compatibility with other BASICs" toward the end of the manual. For me, this summarizes all the additional statements that ATBasic offers. Thank you!

Share this post


Link to post
Share on other sites

The manual looks great. I spotted a few bugs:

  • page 13 claims that boolean values are -1 for true and 0 for false, but both Atari and Altirra BASIC use 1 for true (Microsoft-derived BASICs typically use -1)
  • the CHR$() function documentation on page 22 states that the clear screen character can't be put into a string, but it can (ESC CTRL-CLEAR)
  • page 32's description of PLOT ends rather abruptly

Just got Altirra working through CrossOver on my Mac (it's a paid app, $21 with their Cyber Monday promo code HOHOHO65), so I thought I'd celebrate by playing with Altirra BASIC. Really good work! I'll be testing it for compatibility with my extensive collection of magazine type-in programs :grin:

 

  • Like 3

Share this post


Link to post
Share on other sites

Ah, good catches. Updated version attached.

 

I spent some time cleaning up some misc stuff in the emulator:

http://www.virtualdub.org/beta/Altirra-2.60-test24.zip

http://www.virtualdub.org/beta/Altirra-2.60-test24-src.zip

 

Changes:

  • Several existing device types have been converted to the new device framework and moved into the Devices tree. This serves a couple of purposes: it paves the way for common UI and a way to save/load device settings, and it gets some of the crap out of the System menu.
  • There is now a vertical overscan override option.
  • Keyboard and controller inputs no longer get stuck if the window loses focus while they're active.
  • Moved game controller polling earlier in the frame so it occurs before VBI, to remove a frame of delay with most games.

Also in this version are some pretty major changes to the full-screen UI, to start making the emulator more game controller friendly. If you have an Xbox 360 controller, enable the Xbox 360 Controller -> User interface control input map in Input > Input Mappings, or set up an equivalent one that maps the UI* targets to a Console controller. This makes X bring up the on-screen keyboard and Y bring up a new settings panel. The settings panel is also accessible via mouse by double-clicking on the left side of the window. Also, fixed some bugs in the on screen keyboard and made it shrink the display, fixed game controller UI input not working when the simulator is paused, and fixed the message box not responding to controllers. The new UI's still a bit ugly, but it should now be more feasible to set up a game from the controller, including attaching the disk, doing a cold reset, and typing keys through the OSK. The UI elements may be a bit small depending on your screen res, so you may want to tweak the UI scale option in Options to make the UI elements bigger.

 

atbasic.pdf

post-16457-0-20524000-1417584702_thumb.png

post-16457-0-89563100-1417584709_thumb.png

  • Like 10

Share this post


Link to post
Share on other sites

wonderful, very long time waiting for this in emulator.
Avery, you're the best!
a couple of small requests:

please add on a virtual keyboard key "power" - Cold reset.
and if you can add the ability to move a virtual keyboard in the main window emulator.

 

 

and two more questions:
1
what happened to the "reset" button on the virtual keyboard?

 

2

Can you add later, image of a real keyboard atari in emulator?
so the virtual keyboard will look much prettier.

for example here such:

keyboard.png

Edited by serj

Share this post


Link to post
Share on other sites

Thanks for the ATBasic Manual updates. I think that you should also bump the 11/29/2014 revision level to differentiate from the previous version.

Edited by atx4us

Share this post


Link to post
Share on other sites

We (me and MaPa) just did some speed comparisons regarding speed of various BASIC implementations using the following program that calculates PI to 40 decimals:

 

5 POKE 20,0:POKE 19,0:POKE 18,0
10 ? "START"
15 A=10000:C=140:DIM F©:B=0:E=0:G=0
20 FOR I=0 TO C:F(I)=2000:NEXT I
25 ? "INITIALIZATION DONE..."
30 D=0:G=C+C:IF G=0 THEN GOTO 80
40 B=C
50 D=D+F(B)*A:G=G-1:F(B)=D-INT(D/G)*G:D=INT(D/G):G=G-1:B=B-1:IF B=0 THEN GOTO 70
60 D=D*B:GOTO 50
70 C=C-14:? INT(E+D/A):E=D-INT(D/A)*A:GOTO 30
80 ? "END"
85 ? (PEEK(18)*65536+PEEK(19)*256+PEEK(20))/50;" SECONDS"

 

The algorithm was taken from the following site: https://cs.uwaterloo.ca/~alopez-o/math-faq/mathtext/node12.html; the C code was reimplemented in BASIC by MaPa.

Here are the results:

Atari BASIC rev. C: 49.84 sec

Altirra BASIC 1.32: 32.68 sec (speed factor of 1.525x compared to Atari BASIC)

Turbo BASIC XL 1.5: 19.34 sec (speed factor of 2.577x compared to Atari BASIC, 1.69x compared to Altirra BASIC).

 

The improvements are great. Btw using some commands specific to Turbo BASIC reduced the time to 17.64 sec. There may still be some room for improvement in each of the BASIC implementations.

Edited by pseudografx

Share this post


Link to post
Share on other sites

Regarding the OSK: I'm concentrating more on usability than look at the moment, so I'd rather not jump into trying to make a realistic looking keyboard. Oddly shaped buttons are a pain in the butt for hit testing and scaling, also. I need to study some console and phone keyboards to see what layout they use. IIRC Microsoft uses a straight ABC layout on Xbox because they found it faster, but Sony stuck with QWERTY (and an alternate, insane T9 mode).

 

Manual version: dang it. That field's an auto-date field. Stupid Writer didn't update it. :P

 

Regarding PI: As usual, this is largely a math pack benchmark. ATBasic+AltirraOS runs this in 27 seconds, and if you turn on the Accelerated Floating Point in Altirra, it runs in 9.6 seconds.

Share this post


Link to post
Share on other sites

I am having a problem with the LIST command.

 

L. 1,99 doesn't list the full range of 0,99. LIST "D:GAME.LST",0,99 will not list all the lines between 0-99 and listing to screen L. 0,99 doesn't show the full range of numbers.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...