@(#)top: ######## ################## ###### ###### ##### ##### #### #### ## ##### #### #### #### #### #### ##### ##### ## ## #### ## ## ## ### ## #### ## ## ## ##### ######## ## ## ## ##### ## ## ## ## ## ##### ## ## ######## ## ## ## ### ## ## #### ## ## ##### #### #### #### #### ##### #### #### #### #### #### ###### ##### ## ###### ###### Issue #12 ################## Version 1.3 ######## March 1996 ------------------------------------------------------------------------- @(#)contents: Table of Contents Features 6. "Polygonamy": A Study in 3 Dimensions by Stephen Judd (Reference: polygon) Did you ever feel real time 3 Dimensional graphics was just asking too much from a Commodore 64? Well, ask no more, as Stephen shows us just hoiw it can be done. The 64 steps up to the challenge of displaying correctly rendered shaded 3D polygons right before your very eyes. 9. Underneath the Hood of the SuperCPU by Jim Brain (Reference: cmdcpu) Delve into the technical details of this new accelerator under development by CMD. Jim will explain its advantages over existing offering, epxlain the features it provides, and dispel some myths about the unit. Columns 4. Hi Tech Trickery by Doug Cotton (Reference: trick) Trying to switch from 128 mode to 64 mode on a C128 without human intervwention is triccky. Doing it on modified KERNAL ROMs is doubly so. Doug details a routine that will work regardless of the ROM in use. 12. Hacking Graphics by Levente Harsfalvi (Reference: gfx) All you Commodore Plus/4 lovers, listen up. Levente delves into the Commodore Plus/4 TED chip, explains its many functions and details its various registers. Do you know all the things the TED chip does in addition to handle video. Now you'll know. Departments 1. The (cough,cough) Hacking Editor (Reference: editor) 2. Input/Output (Reference: io) 3. Newsfront (Reference: news) 5. Hacking the Mags (Reference: mags) 7. UseNuggets (Reference: usenet) 8. FIDO's Nuggets (Reference: fido) 10. Hack Surfing (Reference: surf) 11. Commodore Trivia (Reference: trivia) 13. ? DS, DS$: rem The Error Channel (Reference: error) 14. The Next Hack (Reference: next) 15. Hacking the Code (Reference: code) ------------------------------------------------------------------------- @(#)legal: Commodore Hacking Legal Notice Commodore and the respective Commodore product names are trademarks or registered trademarks of ESCOM GmbH. Commodore hacking is in no way affiliated with ESCOM GmbH, owners of said trademarks. Commodore Hacking is published 4 times yearly by: Brain Innovations Inc. 602 N. Lemen Fenton MI 48430 The magazine is published on on-line networks free of charge, and a nominal fee is charged for alternate mediums of transmission. Permission is granted to re-distribute this "net-magazine" or "e-zine" in its entirety for non-profit use. A charge of no more than US$5.00 may be charged by redistribution parties to cover printed duplication and no more than US$10.00 for other types of duplication to cover duplication and media costs for this publication. If this publications is included in a for-profit compilation, this publication must be alternately available separately or as part of a non-profit compilation. This publication, in regards to its specific ordering and compilations of various elements, is copyright(c) 1995 by Brain Innovations, Incorporated, unless otherwise noted. Each work in this publication retains any and all copyrights pertaining to the individual work's contents. For redistribution rights to individual works, please contact the author of said work or Brain Innovations, Inc. Brain Innovations, Inc. assumes no responsibility for errors or omissions in editorial, article, or program listing content. ------------------------------------------------------------------------- @(#)info: Commodore Hacking Information Commodore Hacking is published via the Internet 4 times yearly, and is presented in both ISO-8859-1 and HTML versions. This and previous issues can be found at the Commodore Hacking Home Page (http://www.msen.com/~brain/chacking/), as well as via FTP (ftp://ccnga.uwaterloo.ca/pub/cbm/hacking.mag/) In addition, the Commodore Hacking mail server can be used to retrieve each issue. To request a copy of an issue, please send the following electronic mail message: To: brain@mail.msen.com Subject: MAILSERV Body of Message: help catalog send c=hacking12.txt quit To retrieve a PKZIP 1.01 archive of the individual articles in Commodore Hacking, request the file c=hacking12.zip To subscribe to the Commodore Hacking and receive new issues as they are published, add the following command to you MAILSERV message prior to the quit command: subscribe c=hacking Firstname Lastname msglen (msglen is largest size of email message in line you can receive. Each line is roughly 50 characters, so 600 lines is about 30000 bytes. When in doubt, choose 600) example: subscribe c=hacking Jim Brain 600 Although no fee is charged for this magazine, donations are gladly accepted from corporate and individual concerns. All monies will be used to defray any administrative costs, subscribe to publications for review, and compensate the individual authors contributing to this issue. Any persons wishing to author articles for inclusion in Commodore Hacking are encouraged to view the submission guidelines on the WWW (http://www.msen.com/~brain/pub/c-hacking-submit.txt) or via the MAILSERV server (send c-hacking-submit.txt). ========================================================================= @(#)rch: Reading C=Hacking Starting with Issue 11 of Commodore Hacking, the new QuickFind indexing system is utilized to aid readers of the text version in navigating the magazine. At the top of each article or other important place in the magazine, a word prefixed with a special string is present. (See the title of this article for an example. Throughout the magazine, if an article is mentioned, it will be followed by a reference string. For example, if we mentioned this article, we would add (Reference: rch) after the name. By using your favorite editor's search function and searching for the string after the word "Reference:", prefixed by the magic prefix string, will move you directly to the article of choice. To merely skip to the next article in the magazine, search only for the magic prefix string. Some handy indexing strings possibly not referenced anywhere are: top top of issue bottom bottom of issue contents table of contents legal legal notice For those with access to a UNIX system, the command "what" can be run on the issue, which will result in all the article titles being printed. A slightly different magic prefix string "@(A)" is used to delimit sub-topics or main heading in articles. The text after the magic string differs depending on article content. For the Input/Output column (Reference: io), the text after the magic prefix will either be "c" for comment, or "r" for response. In features and columns, a number after the prefix indicates the ordinal of that heading or sub-topic in the article. If a specific sub-topic is referenced elsewhere in the article, a sub-topic reference will be indicated. A reference to "@(A)r" would be written as "(SubRef: r)". As time goes on, the role of this indexing system will be expanded and changed to ease navigation of the text version, but minimize the clutter added by these extra items. ========================================================================= @(#)editor: The Hacking Editor by Jim Brain (brain@mail.msen.com) Speed and the Web. The owners are asking about it. The developers are looking into it. The market is readying itself for it. No, not the PC market, I'm referring to the Commodore 8-bit market. The same market usually referred to as "mature". The same market usually referred to with a condescending tone. Well, mature we might be, but isn't that considered a good thing? People are supposed to mature as they grow older. As such, they are revered and looked up to. What parallels can we draw here? If you haven't anything about the planned introduction of the CMD SuperCPU 20 MHz accelerator cartridges for the C64 and C128, shame on you! You need to stay in touch more. For those who have, let's not overdo the hype. CMD isn't the first to produce such a cartridge, but they will be the first to introduce 20 MHz as a speed option. C128 users will rejoice as the first 128 mode accelerator ships from CMD. When this happens, performance approaching that of the venerable Intel 80386 will be as close as the on/off switch. The explosion of interest in the Internet and the World Wide Web is changing the way people view computers. Until recently, it seemed that people thought only computer systems including a 32 or 64 bit CPU, multiple megabytes of RAM, gigabyte hard drives, infinite resolution monitors and million bit sound cards were worth owning. Commodore owners have felt the sting of ridicule as they continually take blow after blow for remaining loyal to a machine with much to offer. Well, be patient, because 1996 might be the year of the "network computer", a smaller comuter system that trades all the fancy features of bloated PCs for a smaller size, cost, and a connection to the Internet. Big names like IBM, Oracle and Apple are pushing this idea, which would bring to market systems with modest RAM, small drives, television displays, and small operating systems. Does this idea sound familiar? It should, as it describes many features of Commodore 8-bit systems. No, the CBM 8-bit still lacks a few items present in the IBM/Apple/Oracle designs, but the bulk of features are already available on your so called "obsolete" CBM machine. Don't gloat yet, as there's much to do, but if your friends tout the benefits of such a machine, gently remind them that you own of of the first and best, a Commodore 8-bit. Enjoy YOUR magazine, Jim Brain (brain@mail.msen.com) editor ============================================================================ @(#)io: Input/Ouput Obviously, Commodore Hacking depends on the comments and article submissions from the Commodore community to flourish. Everyone sees the articles, but let's not forget those comments. They are very helpful, and every attempt is made to address concerns in them. Address any comments, concerns, or suggestions to: Commodore Hacking 602 N. Lemen Fenton, MI 48430 brain@mail.msen.com (Internet) @(A)c: Time Travellin' From: Robin Harbron Dear C=Hacking, I was looking at the Commodore Hacking page (fantastic magazine) and noticed that the "Publishing Schedule for 95-96" has 1995 for all the dates, while I assume that the last 4,5,or 6 probably should be 1996. Thanks for everything! Robin @(A)r: Yep, we must have just returned from our time travel experiments when we wrote that in the WWW pages. Note that the magazine was correct, but the home was in error. Oh well. @(A)c: Run (Down) the Software From: sis319@educ.di.unito.it Dear C=Hacking, I really appreciate the work you are doing with the Commodore Hacking on-line magazine. I like the new look and the new features you added, such as newsfront and hacking the mags. I would like to see on the magazine some reviews about the latest and more interesting PD and Shareware software (with a list of FTP sites where these are available) and hardware products. Please note that Commodore Hacking is the only Commodore magazine I can easily find here in Italy, because all the Italian magazine there were are dead and all the foreign magazines that were distributed, such as "RUN", "Compute!'s Gazette", "64'er" are either dead or no longer distributed. @(A)r: We appreciate your comments about the new look of C=Hacking. As for the inclusion of reviews, we're looking into it. it's not that we don't want to do it, just that we need to schedule the reviews (Commodore Hacking shouldn't do all of them, as that creates bias), and determining what software is worthy of review. Look for some reviews in upcoming issues. @(A)c: Separate But Equal From: alan.jones@qcs.org (Alan Jones) Dear C=Hacking, I like your new version of C=Hacking. I like the idea of including relevant news and summaries of other magazines and disks. Size should not be a constraint, although you should publish early when it exceeds some critical size. Don't scrimp on source code listings and uuencoded files! There is no other publication for this sort of bulky technical stuff. It would also be wonderfull if we could get an apropriate means for including diagrams or pictures, viewable by C64/128 users. I would REALLY like to have the C64/128 html viewer/printer that you mentioned. You may not know it but we came very close to having Al Angers Tower article submitted to C=Hacking in place of _Commodore World_, but C=Hacking could not really handle drawings and photos. I have been separating C=Hacking into separate articles and files, archiving them and placing the archive(s) on a local BBS. This compacts the length and makes it easier to read and use. I try to make C=Hacking easy to download and use locally, but I still want to keep it as whole and original as possible. @(A)r: Alan, we're glad you approve of the new format. We're going to try to keep the size so that it will always fit onto 2 1541 disk sides. C=Hacking is still working on the HTML viewer, but it's taking a back seat to other more pressing issues. We'll have it finished at some point, and start distributing the magazine that way as well. As for your separation, we appreciate the work you've done to make C=Hacking easier to distribute. With issue #12, we are offering an archive of all the article in separate files. The archival method has not been chosen just yet, but look on the C=Hacking MAILSERV server for the file. Late news: check Commodore Hacking Information (Reference: info) for more information of retrieving an archive of the individual articles. @(A)c: Enquiring Minds Wanna Know! From: Peter Hofman Dear C=Hacking I would like to make a suggestion for your "Commodore Hacking E-Zine" page. Maybe you could add a link to a page with some info about the next issue of Commodore Hacking, so people know what will be in the next issue. The reason why I make this suggestion is that I read the other issues, and I am very curious, what will be published. @(A)r: Good suggestion. So good, in fact, that we implemented it. Mind you, we can't completely predict the future, so the information in the link may not exactly reflect the contents of the issue when it is published, but we'll try to keep the two in sync. @(A)c: Pulling It Out of the Closet From: bloodbane@rlion.com (Jeffrey S Cotterman) Dear C=Hacking, Well, I was just writing to say I think you did a great job on C= Hacking... I am throughly amazed by the support and the interest in the Commodores. I have a Vic-20, C-64, C-128, and an Amiga 1000. I have not used any of them in a long time, I have two Beamers that I use more. However seeing all this stuff makes me want to turn them back on. (Actually I use the 64 quite a bit for playing games, plus the 1702 monitor works great with a Super Nintendo!) I used to be quite proficient at the 64, but it is slipping. I will try to get my butt back in gear so maybe I can post an article or two.... Geesh, and just last year I got rid of all my Run and Compute's Gazette magazines.... Oh well I will look through the cobwebs and see what I can come up with. Anyway, congrats on the mag, I think it's going great. @(Ar: We appreciate the thanks. And, if we can get one person to pull a C64 or other CBM machines out of the closet and turn it back on through what we do, it is worth it. @(A)c: C=Hacking Flunked Geography From: Peter Karlsson Dear C=Hacking, I saw your mention of Atta Bitar in Commodore Hacking. German? Heheheh... :-) Anyway, the English information page is available now, but not much will=20 be in English (sorry). It is a Swedish paper :) From: Erik Paulsson Dear C=Hacking, I'm the editor of the Swedish mag Atta Bitar (8 bitter), so I thought I should drop you a line. I really like the "new" C= Hacking it's really great, keep up the good work! One small comment regarding Atta Bitar, it's not in German, it's in swedish. I just thought you should know... @(A)r: Picky, picky, picky. It's not like we would react that way if you said Commodore Hacking came from CANADA. Wait, hold it.... I guess we would. Correction made. Thanks for the update, and if we ever learn Swedish, we'll try to read it again. (Anyone want to translate for us?) ========================================================================= @(#)news: Newsfront * Matthew Desmond, the author of Desterm, has recently resurfaced and states that he is once again working on something. Although Commodore Hacking discourages hourds from emailing him to ask about Desterm progress, Matt's email address is mdesmond@ionline.net, for those who wish to register Desterm or express their support. * Speaking of email addresses, LOADSTAR will be changing theirs. As the online service GEnie has recently been purchased and new fares have been put in place, LOADSTAR finds its monthly bill rising too high for pleasure. As of March, 1996, the Internet address for LOADSTAR will be loadstar@softdisk.com. * While we're on the subject of email addresses, CMD has expanded their set of Internet email address contacts in order to better support its online users. The following addresses are now valid: Email Address Usage cmd.sales@the-spa.com Questions relating to product prices, catalog requests, ordering onformation, cmd.support@the-spa.com Technical questions concerning CMD products. cmd.cw@the-spa.com Questions or comments relating to Commodore World magazine. doug.cotton@the-spa.com superceded the cmd-doug@genie.geis.com address previously used for all CMD inquires. Should be used items not applicable to the above addresses cmd.cac@the-spa.com Direct link to Charles A. Christianson, VP of Sales and Marketing. Again, shuld be used for items not applicable to above email addresses. * We're not done yet, as COMMODORE CEE has recently moved its office and is now at: COMMODORE CEE 5443 College Oak Drive #26 Sacramento, CA 95841 Jack Vanderwhite@cee-64.wmeonlin.sacbbx.com (Contact) ceejack@crl.com (Contact) Jack Vanderwhite, editor. Fidonet: 1:203/999 (916) 339-3403 (Bulletin Board System) * The Commodore Zone. No, it's not an alternate universe, but a magazine for the Commodore gamer and/or demo fan. Each issue's 40 pages is full of reviews, interviews with top programmers, and an exclusive comic strip done by Alf Yngve. Accompanying each issue is a 5.25" disk or tape containing game demos, demos, and full games. Free software is often included. More information can be obtained through: Commodore Zone 34 Portland Road Droitwich Worcestershire WR9 7QW England Copies are available for UK3.00. Make checks payable to Binary Zone PD. * Also in the magazine front, Computer Workshops, Inc. is planning a World Wide Web magazine to feature gaming. The blurb follows: CWI is working on a new Web magazine to feature the newest and hottest in c64/128 Gaming. But, before we can do that, we need your help. Send us what you're working on, or, if you're a programmer with something for review, send us that too! Also, if you've got a product you'd like to advertise, we'd like to hear that too (a la Yahoo). Send it to either, or both: spectre@deepthought.armory.com Computer Workshops/Cameron Kaiser ATTN: Commodore Gamer 3612 Birdie Drive La Mesa, CA 91941-8044 (Please don't send binaries to the spectre@ address.) Thanks for your support, and barring any unforseen difficulties, Commodore Gamer should be ready to premiere in about two months. Cameron Kaiser * The December 10, 1995 edition of the Waco Tribune Herald put one of our own in the spotlight. The headline read "'Antique' PCs have loyal fans here, elsewhere." and was written by Sherry W. Evans, Tribune-Herald staff writer. The Commodore user taking the spotlight was Karen Allison, known on the FIDO network. Sharing the spotlight with Karen was Brad Jackson, of Commodore Country, who said that a C64 was raced against an Intel 386 using identical programs, and the 64 won. Allison claims in the article that "the challenge is finding creative ways to solve problems since Commies have had no ... support..." Allison indirectly mentioned GeoFAX, the GEOS Fax program, and a low cost Tax program she uses to pay the IRS every year. Allison, a diehard "Commie", explained in the article that "(People who use IBMs) all think my Commodore can't do much and is just a toy. But for a toy, this computer does pretty good." * For those good with an assembler and the VIC/SID registers, Driven Magazine is sponsoring a 4K Demo competition. The deadline is July 1st 1996. Although the program must run on an NTSC 64, PAL programmers are encouraged to enter. The entries will be released as a group at the close of the contest, and entrants can re-use their entries. The complete rules follow: 4k Demo Contest Rules - 1 file only (no secondary loading) - max file size is $1000 bytes - must be started with BASIC 'run' - 1 demo per coder; multiple entries per group are allowed. Multiple coders can collaborate on a single demo, so long as there remains only 1 demo per coder. - credits for all parts of an entry must be given at time of entry; if a particular credit is unknown, mark it as "unknown" - demos will be evaluated on NTSC c64. Anything not specifically denied above is allowed; e.g. packing + crunching, use or non-use of music or graphics, entries by PAL sceners, etc. Deadline = July 1. Entries need to go to coolhand: coolhand@kaiwan.com or postal mail to: Bill Lueck 17411 Mayor Lane Huntington Beach, California, 92647 USA Evaluators will be selected shortly, but will include Coolhand and 2-3 other non-demomaking NTSC demo enthusiasts. There will be categories for evaluation, but there will not be separate winners - the scores from the categories will be added together. The categories will be announced after the evaluation team is established, but they will include design, originality, technical difficulty, artistic impact, and best overall impact, etc (all tentative at this time). * Bo Zimmerman has put his Commodore 128 on the net. No, he didn't log into some Internet service from his 128, he actually PUT it on the 'Net. Running the BBS program called "Zelch", the machine can be accessed by telntting to 147.26.162.107 and giving "zelch" as the login. Bo warns that the system is running off a single 1571 at 2400 bps, so don't hog the system, OK. For the technical types, the 128 is connected to the serial port of a Linux PC hooked up the Internet. Nonetheless, we're getting closer to the standalone CBM Internet server. * In the March 1996 issue of _Next Generation_ magazine, on pages 31 and 32, NG published a very unflattering definition of the Commodore 64 as part of their: "The Next Generation 1996 Lexicon A to Z: A definitive guide to gaming terminology". Among other things, the definition's writer confused the Apple II with the Commodore 64 and stated that the C64 could not display lowercase, a common problem on early Apples. The writer was biased in favor of the Apple II line, but evidently had never used a C64 or never owned an early Apple II. In either case, the fervor caused by the definition sparked an outrage in the USENET newsgroup comp.sys.cbm. See UseNuggets (Reference: usenet) for the scoop. If you would like to write to _Next Generation_, even though the article claimed no comments would be heard on the subject, or to request a copy of the article, their address is: Editorial: Email: ngonline@imagine-inc.com Fax: (415) 696-1678 Phone: (415) 696-1688 Subscriptions: Email: ngsubs@aol.com Phone: (415) 696-1661 Post Office Mail: Next Generation Imagine Publishing, Inc. 1350 Old Bayshore Highway, Suite 210 Burlingame, CA 94010 ========================================================================= @(#): trick: RUN64: Moving to 64 Mode by Doug Cotton (doug.cotton@the-spa.com) Reprinted with permission. Copyright (c) 1996 Creative Micro Designs, Inc. Various routines have been used over the years to allow programs to move from 128 mode to 64 mode without user intervention. With the advent of modified Kernal ROMs (JiffyDOS, RAMLink, and others) many of the methods that work on stock machines have either failed to do the job completely, and in some cases fail all together. RUN64 is the answer to those users looking to worm their way into 64 mode without having to be concerned with the different Kernal ROMs. The program is presented here in two ways: as a BASIC program that will move to 64 mode and load the program you request, and as assembly language source for ML programmers. BASIC Notes: The BASIC version uses the ML code produced by the assembly language source. This is found in the data statements beginning at line 660. When you run it, the program will ask for the file name, device number, and file load type (BASIC or ML). The first two parameters should be self-explanatory, but the load type may confuse you. If the file you're loading is itself a small loader (1, 2 or 3 blocks) then it will almost always be an ML program. Likewise, if you usually load the file with a ",8,1" at the end of the load statement, it's ML. If you're loading a larger file, or a file that you normally load with just a ",8", then use the BASIC option. Also, if you remove the REM instructions from lines 150 through 180 the program becomes a dedicated loader. Just specify the file name and other options within those lines. @(A): How The Routine Works RUN64 performs its trick by masquerading as a cartridge. When started, the code copies the payload routines into $8000, with the special header that signifies a cartridge is present. It then resets the system. The system initializes and checks for a cartridge. When it finds the payload routines, it executes them just like it would any cartridge. The pseudo-cartridge routines then switch out BASIC, call the remainder of the KERNAL init routines, switch BASIC in, call some BASIC init routines, set the "load" and "run" lines on screen, dump some "returns" into the keyboard buffer, and finally jump into the BASIC interpreter. @(A): Assembly Language Notes: The source code is pretty well documented, and ML programmers should have little trouble figuring out what everything does. Take note of the Buddy Assembler .off pseudo-op used a few lines below the code label. This adjusts all fixed references within the code that follows it to execute properly at $8000. The code uses some indirect vectors (ibv, ibr and ibm) to overcome not having an indirect jsr opcode, and switches out BASIC ROM temporarily since the KERNAL finishes intializing by indirectly jumping through the address at $a000. Since the target application hasn't been loaded yet, the code must put its own address at $a000 to regain control. To use the routine, just set up a file name at filename, put a device number in $ba, set the load type in sa1flag, then execute the routine. 100 rem run64.bas (c) 1996 creative micro designs, inc. 110 : 120 print "{CLEAR/HOME}run64" 130 print 140 : 150 rem f$="filename" : rem filename 160 rem dv=peek(186) : rem device number (8, 9, 10, etc.) 170 rem l$="a" : rem load type (a=basic, b=ml [,1]) 180 rem goto 310 190 : 200 input "filename";f$ 210 input "{2 SPACES}device";dv$ : if dv$="" then 230 220 poke 186,val(dv$) 230 dv = peek(186) 240 print 250 print "select a or b" 260 print "{2 SPACES}a. load";chr$(34);f$;chr$(34);",";right$(str$(dv),len(str$(dv))-1) 270 print "{2 SPACES}b. load";chr$(34);f$;chr$(34);",";right$(str$(dv),len(str$(dv))-1);",1" 280 get l$ : if l$<>"a" and l$<>"b" then goto 280 290 print 300 print l$;" selected" 310 print 320 print "going to 64 mode!" 330 : 340 : rem poke in main ml 350 : 360 i = 6144 370 read d 380 if d = -1 then 450 390 poke i,d 400 i = i + 1 410 goto 370 420 : 430 : rem poke in filename 440 : 450 for i = 0 to len(f$)-1 460 : poke 6356+i, asc(mid$(f$,i+1,1)) 470 next i 480 poke