The Incredible KIMplement

Started by Blacklord, January 09, 2007, 07:56 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Blacklord

Cameron Kaiser has updated his KIM emulator for the C64 to version 0.2a.

Here's what's new:

    * Smaller, pre-crunched executable (about half the size) using Pasi Ojala's pucrunch -- did I mention this guy is the god of Commodore compression utilities? It takes a few seconds to decompress and depack itself; on the 128, it will kick the 8502 to 2MHz mode temporarily to speed this up, so the screen will get garbled for a second or two. This is normal.
    * Overall emulation speed is about 25% faster, thanks largely to improvements in the CPU core, and some optimization in the memory handlers and emulator main loop.
    * KIM addressing space expanded to 16K ($0000-$3fff), using a KIM-4-like scheme.
    * TTY emulation improved: SHIFT and CTRL properly monitored in TTY mode, ASR-33 character set fully supported, BEL added, LF moved to F1 to allow backarrow, XON/XOFF on CLR HOME and CRSR DN, BS on CRSR LF (and RT for single key typing); smarter handling of LF and CR LF sequences.
    * RIOT emulation improved: correct bits set for TTY activity.
    * BRK made "transparent" but still has brief visual notification for debugging.
    * Disk wedge and multiple device number support added.
    * Loading binaries without Commodore-style starting addresses supported.
    * Le funky musique.

Here's what's fixed:

    * (0.2a) Fixed error in KIM-4 memory addressing; corrected GETCH trap.
    * Saving RAM to disk works properly now.
    * Backspace-on-resume bug fixed.
    * Stuck keys getting echoed into the menu fixed.

You can visit the pages at http://www.floodgap.com/retrobits/kim-1/emu.html

Stephane Richard

That looks pretty impressive...anyone suggested he works on a true 128 emulator after this? ;-).  

I'm gonna have a bit of fun with this :-)...ok, maybe more than a bit lol.
When God created light, so too was born, the first Shadow!

MystikShadows

nikoniko

Emulation ON the C64 rather than emulation OF the C64... now that's cool!

I first learned some 6502 programming from "The First Book of KIM", which was one of only three computer programming books the local library had. Funny thing is I didn't even have a computer at the time. I'd sit with a notebook and pen and simulate running the programs on paper. For anyone who wants to fool around with KIM programming but needs a refresher, The First Book of KIM can be found online, and the same site even has a Microchess and a book on TinyBASIC.

Stephane Richard

I have a question for anyone that knows :-)...say I wanted to learn c128 assembly, aside the bank switching part (if it is different) could I learn and use what I know from that first book of KIM?  I'm wondering because well we all know 6502 machine language is the fastest way to get it to do anything.  ;-).....unless there's a better book out there?  

I have mappign the 128 and the 128 Programmer's reference in PDF here, are these worth it?  I also have Machine Language on the 64 and other computers which also covers the 128...
When God created light, so too was born, the first Shadow!

MystikShadows

nikoniko

Butterfield's Machine Language on the 64 and 128 is a nice introduction, very easy to get into and with good explanations of the material. You can also find some of his machine language articles in the Compute! Magazine archive. I'm pretty sure their machine language column, written by Jim Butterfield, was almost always 6502-oriented. (Too bad they don't have many Compute's Gazette articles scanned, though!) That'll get you comfortable enough that you should be able to start making good use of Mapping the 128 and the Programmer's Reference Guide and understanding source listings you find elsewhere or studying disassemblies.

The best book I ever found, besides the reference guides, for doing serious 128 programming was Advanced Commodore 128 Graphics and Sound Programming by Stan Krute. Unfortunately, I couldn't really take advantage of it at the time I bought it since I didn't have a monitor for 80 column graphics, but it's pretty much the only book I know of that actually showed how to make the most of the 128's capabilities, and if I remember correctly it had copiously documented examples ranging from building a GUI to memory management to doing interrupt-driven music. I no longer have my copy, but I just ordered one from a used book dealer in the hope that it's what I remember it to be. In any case, I can hardly go wrong since it was only $15. :)

In order to study how to "think" in 6502, I recommend the Rodney Zaks books, Programming the 6502 and Advanced 6502 Programming. Again, I no longer have them myself, but found them very useful since they show how to solve common problems in assembly language. Some considered him a programming god, while others complained that his code wasn't optimal enough, but his books were for teaching how to do things, not necessarily the indisputably fastest or most compact way. Optimization is best done once you already understand what's going on. He also did Programming the Z-80, but I had less interest in Z-80 programming. Besides those, I also had a few Apple II assembly language books which were awesome in their scope and depth, full of great source examples, but unfortunately I don't remember the names or authors. I think one was called, simply, Apple IIe Assembly Language. It had a red binding and was fairly thick. Great stuff, even if it was for a machine I never had or liked. Later books for the IIc or enhanced IIe address the 65c02 processor, which is still similar enough to be useful. Likewise, some people may find Atari programming books helpful. There are a number of scanned books over at Atari Archives, and if you ignore the graphics and sound routines you may be able to learn from them.

Stephane Richard

Sounds like my kind of book indeed yes.  Darn, now I'll have to buy it, thanks alot niko...the next 2 weeks of no sleep, I blame on you ;-).

Hmmm no one happen to have PDF of that do they by any chance? ;-)
When God created light, so too was born, the first Shadow!

MystikShadows

nikoniko

Well, the Butterfield book is available for download over at Project 64.

For other books, Operator Headgap has a very nice page linking to what's available through Amazon and its network of used book dealers. Advanced Graphics is listed there, but the one with the disk seems to be no longer available. When mine arrives, I'd be happy to mail the disk to someone if they'll agree to make a D64/D71 of it for me. Farther down the page, you can find a link to just the book by itself. Operator Headgap will get a little commission if you click his link and buy something, and since he's been so kind to put the page together I think he deserves it. Some of those books I'd never heard of, so I'm grateful to him for making me aware of them.