pseudografx #351 Posted November 13, 2014 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. Quote Share this post Link to post Share on other sites
Xuel #352 Posted November 13, 2014 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. Quote Share this post Link to post Share on other sites
mono #353 Posted November 13, 2014 (edited) 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-BFFFand 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 November 13, 2014 by mono 1 Quote Share this post Link to post Share on other sites
AtariGeezer #354 Posted November 13, 2014 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... Quote Share this post Link to post Share on other sites
Xuel #355 Posted November 13, 2014 I found the program that I was talking about. It's called TYPO II. Quote Share this post Link to post Share on other sites
+bf2k+ #356 Posted November 15, 2014 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... Quote Share this post Link to post Share on other sites
+bf2k+ #357 Posted November 15, 2014 (edited) 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 November 15, 2014 by bf2k+ Quote Share this post Link to post Share on other sites
phaeron #358 Posted November 28, 2014 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 1 Quote Share this post Link to post Share on other sites
ACML #359 Posted November 28, 2014 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. Quote Share this post Link to post Share on other sites
phaeron #360 Posted November 28, 2014 TIL that OS-B trashes an entire IOCB when you do an OPEN on an IOCB that's already open. Fixed. atbasicx.xex Quote Share this post Link to post Share on other sites
mr-atari #361 Posted November 29, 2014 Back on-line (short holiday) :-) Downloaded the new versions. Well done! Can you include the new MyIDE-][ CPLD-firmware on the next update? Quote Share this post Link to post Share on other sites
mono #362 Posted November 29, 2014 (edited) 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> .map00D600-00D6FF 57 --W hardware00D500-00D5FF 57 ARW hardware00D600-00D6FF 57 ARW hardware00D000-00D0FF 57 --W hardware00D300-00D3FF 56 ARW hardware [PIA]00D200-00D2FF 56 ARW hardware [POKEY]00D000-00D0FF 56 ARW hardware [GTIA]00D100-00D1FF 51 --W hardware00D500-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 --- hardware004000-007FFF 2 --- hardware004000-007FFF 1 --- direct memory [Extended RAM]00D800-00FFFF 0 ARW direct memory [High RAM]000000-00CFFF 0 ARW direct memory [Low RAM] Altirra> .piaPort A control: 3c (IOR, motor line high / off)Port A direction: 00Port A output: 00Port A edge: nonePort B control: 3c (IOR, command line high / off)Port B direction: ffPort B output: ffPort B edge: pending Altirra> .bankBank state: FF Kernel ROM: enabled BASIC ROM: disabled CPU bank: disabled Antic bank: disabled Self test ROM: disabledAntic bank: $000000CPU bank: $000000Cartridge 1 bank: $0E ($01C000)Cartridge 2 bank: disabled SysInfo2 screenshot assigned. Edited November 29, 2014 by mono Quote Share this post Link to post Share on other sites
phaeron #363 Posted November 29, 2014 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. Quote Share this post Link to post Share on other sites
phaeron #364 Posted November 30, 2014 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 12 Quote Share this post Link to post Share on other sites
Xuel #365 Posted November 30, 2014 The formulas look crystal clear even under heavy magnification for me. Quote Share this post Link to post Share on other sites
atx4us #366 Posted November 30, 2014 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! Quote Share this post Link to post Share on other sites
flashjazzcat #367 Posted November 30, 2014 No problems with the diagrams here either. The manual looks splendid and makes for really interesting reading. Thanks! Quote Share this post Link to post Share on other sites
Eyvind Bernhardsen #368 Posted December 1, 2014 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 3 Quote Share this post Link to post Share on other sites
phaeron #369 Posted December 3, 2014 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 10 Quote Share this post Link to post Share on other sites
Heaven/TQA #370 Posted December 3, 2014 Cool! Quote Share this post Link to post Share on other sites
serj #371 Posted December 3, 2014 (edited) 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:1what 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: Edited December 3, 2014 by serj Quote Share this post Link to post Share on other sites
atx4us #372 Posted December 3, 2014 (edited) 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 December 3, 2014 by atx4us Quote Share this post Link to post Share on other sites
pseudografx #373 Posted December 3, 2014 (edited) 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,010 ? "START"15 A=10000:C=140:DIM F©:B=0:E=0:G=020 FOR I=0 TO C:F(I)=2000:NEXT I25 ? "INITIALIZATION DONE..."30 D=0:G=C+C:IF G=0 THEN GOTO 8040 B=C50 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 7060 D=D*B:GOTO 5070 C=C-14:? INT(E+D/A):E=D-INT(D/A)*A:GOTO 3080 ? "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 December 3, 2014 by pseudografx Quote Share this post Link to post Share on other sites
phaeron #374 Posted December 3, 2014 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. 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. Quote Share this post Link to post Share on other sites
+Roydea6 #375 Posted December 4, 2014 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. Quote Share this post Link to post Share on other sites