Jump to content

Photo

Altirra 2.40 Final out..


412 replies to this topic

#151 npturton OFFLINE  

npturton

    Chopper Commander

  • 187 posts
  • Location:Rotherham, UK

Posted Sat Jan 18, 2014 6:04 PM

Im just going to get into this emulaton thing with Alterra and WIn800,

 

How do we use Atari Joysticks/Trackballs into a modern PC considering all we have now is USB for IO ports



#152 atx4us OFFLINE  

atx4us

    Moonsweeper

  • 428 posts
  • Location:Michigan, USA

Posted Sat Jan 18, 2014 9:41 PM

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.virtualdu...2.50-test20.zip

http://www.virtualdu...-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?



#153 itaych OFFLINE  

itaych

    Chopper Commander

  • 196 posts
  • Location:Jerusalem, Israel

Posted Sun Jan 19, 2014 12:45 AM

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' :)

#154 phaeron OFFLINE  

phaeron

    River Patroller

  • 2,139 posts
  • Location:USA

Posted Sun Jan 19, 2014 1:33 AM

 

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

 

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.



#155 flashjazzcat OFFLINE  

flashjazzcat

    Quadrunner

  • 12,212 posts
  • Location:United Kingdom

Posted Sun Jan 19, 2014 5:45 AM

Don't think I ever used CONT anyway. Very cool.

#156 Irgendwer ONLINE  

Irgendwer

    Stargunner

  • 1,110 posts
  • Location:Germany

Posted Sun Jan 19, 2014 1:07 PM

 

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



#157 atx4us OFFLINE  

atx4us

    Moonsweeper

  • 428 posts
  • Location:Michigan, USA

Posted Mon Jan 20, 2014 7:15 AM

 

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!



#158 Philsan ONLINE  

Philsan

    River Patroller

  • 3,260 posts
  • New Orleans Saints Super Bowl XLIV Champions
  • Location:Switzerland

Posted Tue Jan 21, 2014 3:09 PM

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.



#159 phaeron OFFLINE  

phaeron

    River Patroller

  • 2,139 posts
  • Location:USA

Posted Tue Jan 21, 2014 11:35 PM

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.



#160 Philsan ONLINE  

Philsan

    River Patroller

  • 3,260 posts
  • New Orleans Saints Super Bowl XLIV Champions
  • Location:Switzerland

Posted Wed Jan 22, 2014 12:45 AM

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.



#161 CharlieChaplin OFFLINE  

CharlieChaplin

    River Patroller

  • 2,411 posts

Posted Wed Jan 22, 2014 5:54 PM

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.

 

 



#162 flashjazzcat OFFLINE  

flashjazzcat

    Quadrunner

  • 12,212 posts
  • Location:United Kingdom

Posted Wed Jan 22, 2014 6:46 PM

Wow... it's like Groundhog Day. :) Here goes:

 

Hopefully Avery won't mind: I already dumped the ROM and flashed it to Ultimate 1MB using the new flashing tool and it seems to work well.

 

Attached File  ALTBASIC.ROM   8KB   108 downloads

 



#163 phaeron OFFLINE  

phaeron

    River Patroller

  • 2,139 posts
  • Location:USA

Posted Wed Jan 22, 2014 11:10 PM

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.

 

Attached Files



#164 The Usotsuki OFFLINE  

The Usotsuki

    Stargunner

  • 1,838 posts
  • Also called "Licca"

Posted Thu Jan 23, 2014 12:30 AM

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.

 

LOL MESS though.



#165 flashjazzcat OFFLINE  

flashjazzcat

    Quadrunner

  • 12,212 posts
  • Location:United Kingdom

Posted Thu Jan 23, 2014 5:06 AM

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

#166 The Usotsuki OFFLINE  

The Usotsuki

    Stargunner

  • 1,838 posts
  • Also called "Licca"

Posted Thu Jan 23, 2014 5:26 AM

10 ? chr$(6+int(rnd(1)*2));:goto 10

 

</random>



#167 flashjazzcat OFFLINE  

flashjazzcat

    Quadrunner

  • 12,212 posts
  • Location:United Kingdom

Posted Thu Jan 23, 2014 2:02 PM

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, Thu Jan 23, 2014 2:02 PM.


#168 drac030 OFFLINE  

drac030

    Stargunner

  • 1,737 posts
  • Location:Warszawa, Poland

Posted Thu Jan 23, 2014 2:08 PM

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.

#169 flashjazzcat OFFLINE  

flashjazzcat

    Quadrunner

  • 12,212 posts
  • Location:United Kingdom

Posted Thu Jan 23, 2014 2:20 PM

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.



#170 atx4us OFFLINE  

atx4us

    Moonsweeper

  • 428 posts
  • Location:Michigan, USA

Posted Thu Jan 23, 2014 9:59 PM

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)



#171 phaeron OFFLINE  

phaeron

    River Patroller

  • 2,139 posts
  • Location:USA

Posted Fri Jan 24, 2014 1:01 AM

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.



#172 The Usotsuki OFFLINE  

The Usotsuki

    Stargunner

  • 1,838 posts
  • Also called "Licca"

Posted Fri Jan 24, 2014 1:19 AM

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



#173 flashjazzcat OFFLINE  

flashjazzcat

    Quadrunner

  • 12,212 posts
  • Location:United Kingdom

Posted Fri Jan 24, 2014 5:09 AM

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

#174 atx4us OFFLINE  

atx4us

    Moonsweeper

  • 428 posts
  • Location:Michigan, USA

Posted Fri Jan 24, 2014 6:30 AM

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?



#175 The Usotsuki OFFLINE  

The Usotsuki

    Stargunner

  • 1,838 posts
  • Also called "Licca"

Posted Fri Jan 24, 2014 6:31 AM

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

 

Because it's not Altirra.  I wanted to see if it would work outside of Altirra.






0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users