Search the Community
Showing results for tags 'sort'.
Found 2 results
If anyone can use them, the attached ATR has several utility programs I've written. SORTDISK will sort the directory of any ATARI DOS disk (including DOSXL). Since Atari DOS stores the file number in every files data sectors, it will rewrite each file with the new file number. I am working on a new version that does not require data sectors to be rewritten FIXDISK will repair disks of common problems. Opening a file for output and not closing it can cause hidden directory entries that chew up space on your disk. Run this utility on your disks and if there are any errors it will report on them and repair them. If there are lost sectors on your disk it will give them back to you. UNDELETE will undelete a file as long as the data sectors in the file have not been reused by another file. If so, it will tell you that the file cannot be undeleted. RAMXL is very cool (if you are running on an XL machine). When using DOSXL, external commands such as COPY, DUPSK, etc. have to load into memory every time you use them. Rename RAMXL.COM as AUTORUN.SYS. On a DOSXL disk, change the extension of COPY.COM to COPY.MEM. You can rename up to four files (such as DUPDSK.MEM, INIT.MEM). When you reboot your disk, RAMXL will search for file with the MEM extension and store them beneath the OS. Now, to run any external command, prefix it with RUN 2300. For example, to copy a file your would key in RUN 2300 COPY <File A> <File B> Or to run DUPDSK you would key in RUN 2300 DUPDSK Finally, a hidden utility. Atari DOS will only let you store 64 files on a disk, even if it is a double density disk and has lots of room. This ATR was created with a utility I call DOS CD (capacity doubler). It will allow you to store up to 128 files on a DD disk. If you boot from this disk and then create new disks using INIT to rewrite your DOS files, the new disks will also have DOS CD on them. I hope someone finds this stuff useful. Utilities.atr
Since it is like 35 years ago I seriously coded 6502 I'm currently a bit rusty, but I'm trying to figure out a decently fast sorting algorithm for small arrays like for a list of Y-values of objects that are to be displayed on the screen as the scanlines passes by. This must be something that is quite common and already solved many times over for 2600 games. I did my own version of a bubble sort that is kept sorted byte-by-byte as I move the Y-values from the objects into the array of sorted data that is used in the kernel display loop. It is significantly larger in code size than the standard bubble sorts I found for 6502, but it performs rather well both for data that is already pre-sorted and data that is in reverse order. In the table below the first three entries are for my code the last two is something I found on the net. (This is for sorting 8 bytes) ; First value is the number of scanlines required for pre-sorted data, ; second is for data that is fully reverse order. ; ; Yellow 3.0 - 7.5 (369 bytes) Continous Unrolled ; Orange 7.4 - 12.0 (262 bytes) Continous Subroutined ; Red 4.0 - 9.0 (138 bytes) Continous Fallthrough ; Blue 2.4 - 29.9 ( 51 bytes) Bubblesort ; Green 12.1 - 14.0 ( 53 bytes) Optisort But spending 4 to 9 scanlines of time for sorting just eight bytes seems like a very long time. I guess you guys have something much better for this, or is it what's actually expected time wise ? Here's a visual comparison of the data from the above table: [Edit: Seems like attachments are auto-displayed so I removed it from the post itself] sorttest.asm