Stories
Slash Boxes
Comments

SoylentNews is people

SoylentNews is powered by your submissions, so send in your scoop. Only 16 submissions in the queue.
posted by martyb on Sunday October 07 2018, @01:14PM   Printer-friendly
from the have-you-ever-programmed-a-6502? dept.

Adafruit visited the history of the LOGO "turtle graphics" language not long ago.

Now on Twitter, folks have found the source code for the LOGO program used on Apple II computers. Source on GitHub.

It turns out that the program was written on a DEC PDP-10 minicomputer running the Incompatible Timesharing System (ITS).

I'd take it that the code is in 6502 assembly and the program works the whole Apple II memory map for functionality. Did ITS have a 6502 cross-compiler or did the MIDAS program have separate target environments?

Very interesting programming archaeology – see the source code yourself along with the full PDP-10 ITS image still maintained today.

-- submitted from IRC


Original Submission

 
This discussion has been archived. No new comments can be posted.
Display Options Threshold/Breakthrough Mark All as Read Mark All as Unread
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • (Score: 2) by Rich on Sunday October 07 2018, @11:04PM (5 children)

    by Rich (945) on Sunday October 07 2018, @11:04PM (#745681) Journal

    The Disk II interface card "customarily" resides in slot 6. I/O addresses are at $C0E0-C0EF ($C080+$10*slot). $C0E8/9=motor, C0EA/B=drive, C0EC:read latch. C0E0..C0E7: phases 0..3 of the stepper. Forget to turn the phases off (or worse, turn on all phases), and you're eventually in for a bit soldering to swap the ULN2003 on the analog board. PROM address is at $C600 (again, $C000+$100*slot). Jumping to $C600 initiates the boot. There are early non-autostart ROMs, where you had to manually boot. Either *C600G from the monitor, or PR#6 (or IN#6) from Integer Basic. The PR/IN commands redirect the COUT routine at $FDED to the slot PROM (the direct video output is at $FDF0). So it's a slight trick to redirect the character output to floppy boot code. Apple II+ and on have autostart ROMs, which search for the disk controller after cold reset (which is detected by a memory flag, warm reset will (usually) drop to BASIC).

    Slot 3 customarily took the 80-column card, which was activated with "PR#3" (putting the redirection logic to proper use). There is also an extended PROM area from $C800..$CFFF than can mapped in by a card (which primarily is used by the Videx-style 80-column cards. And don't forget to deactivate through $CFFF, or there will be bus conflicts).

    Now you know, even if you didn't want to. Everything out of my head, and it's been a few years, so no guarantees on correctness, but i'm rather confident ;)

    Starting Score:    1  point
    Karma-Bonus Modifier   +1  

    Total Score:   2  
  • (Score: 3, Interesting) by bzipitidoo on Monday October 08 2018, @01:39AM (4 children)

    by bzipitidoo (4388) on Monday October 08 2018, @01:39AM (#745764) Journal

    Heh, I knew about the phases for the stepper motor, but didn't know they could all be left on and fry a chip. I knew the Commodore 64's disk drive could be instructed to damage itself-- think it could be made to bump the read head against the side of the case or some internal component, thus knocking it out of alignment, and heard there was at least one game that allegedly used this to punish pirates if it detected it was a pirated copy.

    One caveat about your masterful knowledge: the language card. There was a 16k expansion card, called a "language card", that could be added to turn a 48k machine into a 64k machine. This extra 16k used the same high memory addresses as the ROM, which held the BASIC programming language, hence why it was called the language card as it could be used to "replace" the language, and was often used to run the older Integer BASIC on Apples that came with the newer floating point Applesoft BASIC. There was a memory location that would toggle between the ROM and the card's RAM. I don't recall for certain, but think it could mask even the other expansion cards so that C600G could be a call to anything if the machine was reading the language card rather than the ROM.

    Also very useful for breaking copy protection-- used the language card to break Ultima IV. Boot trace to the point that Ultima IV's custom, copy protected DOS was loaded, putting a break just after letting it execute their cutesy little XOR code deobfuscation routine, make it read its boot disk, then toggle the language card and use standard Apple DOS to write the data back out to a different floppy disk that had been formatted with the standard format. Didn't have to modify the code in the slightest, as the Ultima IV DOS was designed to read standard format, to handle the rest of the disks, and didn't bat an eye at the boot disk also being in standard format. Once that was done, I started hacking on the game. Changed the graphics to make it more colorful, not have so much black background. Even optimized the tile drawing routine to make it a little faster.

    Lot of low hanging fruit in Apple II games, particularly the ones that used BASIC. Like, there was this Dark Forest game (a computer adaptation of an old Avalon Hill game, Wizard's Quest) that used the BASIC line drawing routines to draw horizontal blue lines on the top row of text, to erase text messages. Of course it was incredibly slow-- could see the individual lines being drawn. I replaced that with a lightning fast assembly language routine. Then, Dark Forest had a bug in which it would sometimes incorrectly compute the number of men you received for reinforcements. I corrected it, and made it much faster. Another terrible one was a very basic galactic conquest kind of game, which needed 30 seconds to generate a galaxy thanks to the idiotic algorithm the author chose to check that no two planets ended up in the same location. The improved method took about 1 second, if that. Earth Orbit Stations has a bug deep in the game which I managed to fix once by accident, but I never could figure out what I did, so it stayed broken.

    • (Score: 2) by Rich on Monday October 08 2018, @01:56PM (3 children)

      by Rich (945) on Monday October 08 2018, @01:56PM (#745952) Journal

      There was a 16k expansion card, called a "language card"...

      Mine had two switches soldered in, a toggle to disable the software switching of the card (so the interrupt vectors were immutable), and a pushbutton for NMI. Hello "Snapshot"! Those were the days. :) Eventually I got a Saturn 128K card, but my mind is blurry whether i used to swap those two (which would have been extra effort, because the classic language card tapped into one of the 4116 sockets, and I don't remember this particular socket wearing out).

      I wrote all the embedded code for a Woz machine clone in a standalone RS-232 connected "smart" floppy drive that was solely made to read machine knitting-patterns (which apparently was a total Apple II domain) into newer Silicon Graphics workstations. I guess that's why these particular details stuck so well (besides helping out the occasional game with a ..er.. compatibility-improved RWTS...). A friend then did the DOS3.3 file system utilities for the DOS and Unix machines.

      Recently, I also started wearing a long grey beard.

      • (Score: 2) by bzipitidoo on Monday October 08 2018, @06:18PM (2 children)

        by bzipitidoo (4388) on Monday October 08 2018, @06:18PM (#746054) Journal

        Cool. I didn't have that hardware mod, but I did have a toggle switch to set the floppy disk write protection any way I wanted (on, off, or detect the notch), and a rotary pot from an old radio to control the volume. Saved a lot of bother punching notches for the reverse sides of floppies. I also used, as I recall, a 130 ohm resistor to touch 2 pins in any expansion slot-- maybe it was pin 29 and 32-- and this generated an interrupt, breaking into any BASIC program. Never got around to wiring that resistor in, in a more permanent way, with a push button momentary switch.

        I also have a few gray hairs in my beard :p.

        • (Score: 2) by Rich on Monday October 08 2018, @07:17PM

          by Rich (945) on Monday October 08 2018, @07:17PM (#746088) Journal

          I also have a few gray hairs in my beard :p.

          If you ever get to central Germany and want to discuss further details (and lament how the world's come down since), the beer's on me. ;)

        • (Score: 0) by Anonymous Coward on Monday October 08 2018, @07:26PM

          by Anonymous Coward on Monday October 08 2018, @07:26PM (#746093)

          Beard was, seemingly, mandatory if you worked at computer shops that sold Apple computers (although they typically also sold kaypro and other garbage game machines). The new-fangled hipsters has not a clue.