Jump to content
IGNORED

Altirra 2.40 Final out..


Mclaneinc

Recommended Posts

Fixed a lot of bugs in Altirra 8K BASIC, and integrated it into the emulator as the default BASIC ROM when no other one is available:

 

http://www.virtualdub.org/beta/Altirra-2.50-test20.zip

http://www.virtualdub.org/beta/Altirra-2.50-test20-src.zip

 

(If you've been wondering why I've been extending the debugger so much lately, this is why. ATBasic is extensively mined with trace and assert statements when symbols are loaded.)

 

It may seem a bit weird to do this, but it completes the last remaining ROM that I didn't have a viable, freely distributable replacement for (TBXL doesn't fit in the 8K BASIC ROM), and allows Altirra to be used for BASIC programming out of the box. It supports the whole Atari BASIC language except for the continue command (CONT), is binary compatible with .BAS files, and maintains reasonable compatibility with Atari BASIC's memory layout. I also fixed a few bugs in the built-in OS math pack and in the math accelerator that affected BASIC, so the baseline LLE[XL] OS + ATBasic configuration now seems to run a number of programs correctly now. It's pretty crazy what some people did with BASIC, like clearing players with A$(2)=A$.

 

Phaeron,

 

I performed a simple test to experiment with the new Altirra BASIC

 

CPU: 6502/6502C, System = 800XL, NTSC, 64K RAM

 

Program:

 

10 POKE 20,0

20 FOR I=0 TO 1000:NEXT I

30 ? PEEK(20)

 

Results:

Atari BASIC = 124 Jiffies

BASIC XL 1.03 = 88 Jiffies

Altirra BASIC 0.5 = 61 Jiffies

 

Very impressive execution speed. What made Altirra BASIC so much faster?

  • Like 3
Link to comment
Share on other sites

It's pretty crazy what some people did with BASIC, like clearing players with A$(2)=A$.

Not really crazy, this sort of string manipulation (ab)use was a well known technique for fast memory clears and moves, with magazine articles describing how to perform it and type-in games utilizing the technique. Just sayin' :)
Link to comment
Share on other sites

 

Cheating. Altirra BASIC doesn't support the CONT statement and stores direct addresses on the runtime stack instead of looking up the line with the FOR statement each time.

 

...and breaking the program with the 'Break'-key ("STOPPED AT LINE 20") GOTO 20 works flawlessly? (Yes, too lazy now to try that out... ;) )

Link to comment
Share on other sites

 

Cheating. Altirra BASIC doesn't support the CONT statement and stores direct addresses on the runtime stack instead of looking up the line with the FOR statement each time.

I'm not sure that's should be considered as cheating but rather optimization and the result is clearly effective. I tried one of my favorite BASIC game program with Altirra BASIC and it worked smoothly and flawlessly. Altirra BASIC is a definite keeper!

  • Like 1
Link to comment
Share on other sites

Hi Avery.

New generation W8.1 tablets have faster processors, good battery life and lower prices.

I think their market share will increase.

Obviously Altirra works perfectly on them but the lack of keyboard is a problem.

I've seen Altirra's on-screen keyboard (perhaps reset key is too big).

Would it be possible to add on-screen joystick control?

For example, joystick directions on the right lower side, fire button on the left lower side, console keys on the upper part of the screen.

It would be a nice feature.

Link to comment
Share on other sites

On-screen joystick control is possible, but there are a couple of problems. The first is that currently Altirra doesn't support multi-touch. The second is that finding a good layout and feedback mechanism for touch controls requires a lot of research and thought. I've played around with some other programs that have touch interfaces for joystick emulation on my Venue 8 Pro, and they're marginal at best -- the lack of tactile feedback for where your fingers are relative to the buttons and the tendency to drift off are major problems. There's a reason that touch devices like the Vita still have physical buttons.

Link to comment
Share on other sites

Thank you Avery.

I completely agree with you, on-screen joysticks are not good for playing arcade games.

It is better to connect a real joystick or keyboard with control keys to the tablet.

But an on-screen joystick + console keys would be useful for testing games when you are outside and you don't have a joystick or a keyboard with you.

Link to comment
Share on other sites

Well,

 

a backup of the database happened, some posts got lost, thus I have to ask the question again... (and I do hope of an answer again).

 

Is Altirra Basic available as a ROM or as a XEX-file ? (The XEX preferably with an Autorun-option like in TB XL, with RUN"D:Autorun.BAS" ; if the file does not exist, no Error appears, but the Ready prompt is displayed instead).

 

I am currently playing around with various Basic`s, like e.g. Fast Basic, Basic XL Runtime, TB XL and others to make Atari Basic programs run/execute a little faster without the need having to compile them. Think Altirra Basic could also speed up some Atari Basic programs...

 

-Andreas Koch.

 

 

Link to comment
Share on other sites

Here's the EXE version -- nothing fancy, just disables the built-in BASIC, resets HIMEM, and then loads at $A000. The source code is included in Altirra's source archive.

 

I never actually bothered to optimize Altirrra BASIC for speed; that it turned out faster than Atari BASIC is just a consequence of the way I wrote it. The priorities were (1) to get it to work and (2) to get it to fit. At one point in its development, it was 2K overweight at 10K and I had to spend some time doing "scrunching"... which is a nice way of saying that I started doing ugly hacks like this:

 

.proc stDegRad
.def :stDeg = *
        lda        #6
        dta        {bit $0100}
.def :stRad = *
        lda        #0
        sta        degflg
done:
        rts
.endp

 

And this:

 

ExprSkipCommaEvalAndPopString:
        inc        exLineOffset
ExprEvalAndPopString:
        jsr        evaluate
.proc    expPopAbsString
        ;lower SP
        ldy        argsp
        ;##ASSERT (y&7)=0 and y
        
        ;copy upper 6 bytes to FR0
        ldx        #5

 

Some of these improved execution speed, and some slowed it down. Interestingly, I ran a profile of the empty for loop case, and it turns out about half of the CPU is spent pushing values on and off the runtime stack. This could probably be sped up a bit, but the main enemy is code space: there are only 10 bytes free in the ROM. Not that it's very interesting to speed up empty loops, mind you -- in fact, some of the games I tried weren't very playable because delay loops already ran faster than they should.

 

atbasicx.xex

  • Like 6
Link to comment
Share on other sites

... which is a nice way of saying that I started doing ugly hacks like this:

 

.proc stDegRad
.def :stDeg = *
        lda        #6
        dta        {bit $0100}
.def :stRad = *
        lda        #0
        sta        degflg
done:
        rts
.endp

 

Heh... I just recently started using BIT as an unconditional branch and while it's not the prettiest code, it's useful enough.

Link to comment
Share on other sites

Is there a way to re-mount an existing VHD image in Altirra when it's not currently mounted in Windows? So I did this: created a new VHD in Altirra, closed the emulator, used a script in my SendTo folder to right-click mount the VHD in Windows. I then partitioned it and formatted it, ran Altirra, went to System->Hard Disk->Physical Disk, selected the virtual disk and all was well. Of course, this was read-only since the virtual disk was currently mounted under Windows, and I wanted Altirra to have write access again. No problem. So I right-click Unmount VHD, the disk unmounts... ack... :)

 

Is there any way to browse to an existing VHD that isn't currently a mounted device? As in: could we have - as well as a "Create VHD" button - an "Open VHD" or "Use existing VHD" button? Or is there a very obvious way to do this that I've missed?

Edited by flashjazzcat
Link to comment
Share on other sites

And, could Altirra remember the settings in the Hard Disk Setup dialog, even when the *.vhd file is not accessible (due to having been temporarily mounted into Windows, for example)? It is okay to automatically set the HD to off (by unchecking "Enable IDE hard disk") in this situation, just keep the rest of settings in the dialog.

Link to comment
Share on other sites

I think I once asked a similar question and Avery told me that the geometry and device emulation settings for the hard disk were somehow stored with the HDD image file and it was therefore impossible to toggle the status of the HDD on and off without unpopulating the dialog. Indeed it would be great if this could be overcome.

Link to comment
Share on other sites

One more note on the BASIC execution speed topic - Phaeron's statement, "and stores direct addresses on the runtime stack instead of looking up the line with the FOR statement each time." reminded me about the "Fast" statement in BASIC XL. I'm not quite sure how it works but it did speed up program execution a little bit.

 

Program:

 

5 Fast
10 Poke 20,0
20 For I=0 To 1000:Next I
30 ? Peek(20)

 

Results:

BASIC XL 1.03 = 88 Jiffies (Without Fast)

BASIC XL 1.03 = 80 Jiffies (With Fast)

Link to comment
Share on other sites

I guess MESS is a bit derpy on its A8 emulation xD... it has a hell of a time with the semicolon in this BASIC. xD As in, when you press ;, it just goes completely batguano insane.

 

Not sure if this was what you were seeing, but I tried MESS out, and it looks like it has a bug where it repeats the BREAK key IRQ. As far as I know, this isn't supposed to happen because POKEY is only supposed to fire it on key down.

 

Is there a way to re-mount an existing VHD image in Altirra when it's not currently mounted in Windows? So I did this: created a new VHD in Altirra, closed the emulator, used a script in my SendTo folder to right-click mount the VHD in Windows. I then partitioned it and formatted it, ran Altirra, went to System->Hard Disk->Physical Disk, selected the virtual disk and all was well. Of course, this was read-only since the virtual disk was currently mounted under Windows, and I wanted Altirra to have write access again. No problem. So I right-click Unmount VHD, the disk unmounts... ack... :)

 

Is there any way to browse to an existing VHD that isn't currently a mounted device? As in: could we have - as well as a "Create VHD" button - an "Open VHD" or "Use existing VHD" button? Or is there a very obvious way to do this that I've missed?

 

If you click ... and select a VHD file, it should automatically detect it as such and set the parameters to match those in the VHD file.

 

I think I once asked a similar question and Avery told me that the geometry and device emulation settings for the hard disk were somehow stored with the HDD image file and it was therefore impossible to toggle the status of the HDD on and off without unpopulating the dialog. Indeed it would be great if this could be overcome.

 

Not the image file, but in the class object that does the HDD emulation. Once you disable it... no more options. I need to overhaul the way that options are handled at some point.

 

Results:

BASIC XL 1.03 = 88 Jiffies (Without Fast)

BASIC XL 1.03 = 80 Jiffies (With Fast)

 

Took a look at what BASIC XL is doing... it turns out that another reason is that Atari BASIC and Basic XL are using the regular subtraction routine (FSUB) to compare against the ending condition, whereas Altirra BASIC uses a dedicated compare routine (FCOMP) which is much faster. There might be some corner case where this makes a difference in behavior, but I can't think of it offhand. I tested a bunch of corner cases, though, like FOR I=0 to 0 STEP 0.

Link to comment
Share on other sites

Not sure if this was what you were seeing, but I tried MESS out, and it looks like it has a bug where it repeats the BREAK key IRQ. As far as I know, this isn't supposed to happen because POKEY is only supposed to fire it on key down.

M5eLH6k.png

The actual Atari Basic goes banzai on MESS too (though it doesn't show all the cascading ERRERRERR stuff), I wasn't able to test the code I pasted earlier and I didn't have it "ready to load" into Altirra, just inside some zips in my MESS folder. xD

Link to comment
Share on other sites

If you click ... and select a VHD file, it should automatically detect it as such and set the parameters to match those in the VHD file.

Thanks: finally I get it. It wasn't clear that selecting "File..." and navigating to a VHD would work in just the same way as selecting a raw image file. It does appear to work perfectly, though, despite having to constantly mount and unmount the VHD in Windows to avoid access conflicts. But it works.

 

Not the image file, but in the class object that does the HDD emulation. Once you disable it... no more options. I need to overhaul the way that options are handled at some point.

Yes - I'm sorry I couldn't recall the exact details of your original response. :)

Link to comment
Share on other sites

M5eLH6k.png

The actual Atari Basic goes banzai on MESS too (though it doesn't show all the cascading ERRERRERR stuff), I wasn't able to test the code I pasted earlier and I didn't have it "ready to load" into Altirra, just inside some zips in my MESS folder. xD

Why would someone use MESS when Altirra is obviously a superior A800 emulator compared to MESS?

Link to comment
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.
Note: Your post will require moderator approval before it will be visible.

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...