home *** CD-ROM | disk | FTP | other *** search
Text File | 2019-04-13 | 62.8 KB | 1,704 lines |
-
-
- --------------------------------------
- The following C64/128 RoundTable
- Bulletin Board Messages have been
- archived by H.HERMAN8 (Howie).
- --------------------------------------
-
-
- ************
- Topic 11 Sun Apr 19, 1992
- CBM-ED [e.g.bell] (Forwarded)
- Sub: Snippits for the 128
-
- Just a place to put useful programming routines for the C128. Why keep
- reinventing the wheel?
-
- 72 message(s) total.
- ************
- ------------
- Category 5, Topic 11
- Message 1 Sun Apr 19, 1992
- CBM-ED [e.g.bell] (Forwarded)
-
- Here is a neat technique for eliminating the question mark in INPUT
- statements without opening a file to the screen:
-
- POKE 21,64:input "<string>";io$:POKE 21,0
-
- Make sure you use both POKE's and note... this *will* eliminate any pre-
- existing value in 'io$'.
-
- *NOTE*. If this topic goes over ok, one could be started for the C64 mode
- too. In the meantime, you can use this same technique on the C64 but use
- address 19 instead of 21.
- ------------
- Category 5, Topic 11
- Message 2 Sun Apr 19, 1992
- PAUL-MB (Forwarded)
-
- Good topic idea, Ed ;)
-
- Here's a simple 80-column screen on/off toggle:
-
- ON: SYS52684,100,35
- OFF: SYS52684,0,35
-
- Good for drawing screens without the user knowing it :)
-
- Happy Easter!! -=* Paul *=-
- ------------
- Category 5, Topic 11
- Message 3 Mon Apr 20, 1992
- HOWIE-CBM (Forwarded)
-
- e.g.,
-
- My favorite is using the keyboard buffer to poke up to 10 values into 842
- thru 851, and then the number of the pokes into 208.
-
- So...
-
- 10 poke 842,13:poke 843,13:poke208,1:rem executes two carriage returns
-
- Things may be displayed or not, by setting character colors ahead of the
- pokes.
-
- So you can write to the screen, cursor to the line, do a carriage return
- and have the command executed. Very helpful in setting up series of batch
- type files with Basic for doing unattended file copying chores, and the
- like (especially with JiffyDos). Also works fine with the three Digital
- Pocket programs, letting you enter up to 10 keystrokes which will then be
- executed *AFTER* the programs have booted. Allows for a bit of custom
- configuring, like putting you into a directory for easy file load, or in
- the case of Writer3, auto starting one of its macros, for almost unlimited
- activity. (Ought to work the same with lots of commercial progams.)
-
- Only limitation on using these pokes seems to be ones imagination. :)
-
- ---------------------------
-
- One more, which I've never had to use, but it's nice to have handy is an
- `un-new'. Enter the following in direct mode:
-
- poke 7170,28:x=7171:do:y=peek(x):x=x+1:loop until y=28:
- poke 7169,dec(right$(hex$(x-2),2))
-
- I broke the above into two lines, but it should get entered as one big line,
- before doing one carriage return.
-
- Howie
- ------------
- Category 5, Topic 11
- Message 4 Mon Apr 20, 1992
- HOWIE-CBM (Forwarded)
-
- Paul,
-
- I added a few <CR>'s to the routines, and here's what I got:
-
- 10 BANK 15
- 20 SYS DEC("FFF0"),,ROW,COLUMN,0
- 30 RETURN
-
- And the second:
-
- 29380 REM -----<DEVICE SETUP>
- 29400 :
- 29420 TRAP 29740
- 29440 INPUT "SOURCE DEVICE ";D$
- 29460 DR%=VAL(D$):IF DR%<8 OR DR%>11 GOTO 29440
- 29480 HN%=DR%:GOSUB 29920:IF HN%=. GOTO 29440
- 29500 :
- 29520 INPUT "DESTINATION DRIVE ";D$
- 29540 DD%=VAL(D$):IF DD%<8 OR DD%>11 GOTO 29520
- 29560 IF DD%<>DR% THEN HN%=DD%:GOSUB 29920:IF HN%=. GOTO 29520
- 29580 :
- 29600 INPUT "PRINTER NUMBER ";D$
- 29620 PR%=VAL(D$):IF PR%<4 OR PR%>5 GOTO 29600
- 29640 HN%=PR%:GOSUB 29940:IF HN%=. THEN POKE 21,.:GOTO 29600
- 29660 TRAP:RETURN
- 29680 :
- 29700 REM -----<TRAP FOR 'DEVICE NOT PRESENT'>
- 29720 :
- 29740 IF ER=5 THEN BEGIN
- 29760 : PRINT "DEVICE [" MID$(STR$(HN%),2) "] NOT PRESENT"
- 29780 : SLEEP 4:HN%=.
- 29800 BEND
- 29820 RESUME NEXT
- 29840 :
- 29860 REM -----<TEST FOR DEVICE PRESENCE>
- 29880 :
- 29920 CLOSE15:OPEN 15,HN%,15,"I":CLOSE15:RETURN
- 29940 CLOSE 3:OPEN 3,HN%, 7:PRINT#3:CLOSE3:RETURN
-
- You can use a capture buffer like BTP's to save these routines direct in
- tokenized form, and save the typing. :)
-
- One change to the second one might be nice tho. Allowing drives from 8 to
- 30 for us power users. :)
-
- Howie
- ------------
- Category 5, Topic 11
- Message 5 Sat Apr 25, 1992
- CBM-ED [e.g.bell] (Forwarded)
-
- Here is a quick and dirty file reader for the C128...
-
- 1940 rem -----<read a seq file from disk>
- 1960 :
- 1980 ft$="":fi$="":input "Read Which File ";fi$:if fi$ ="" then return
- 2000 :
- 2020 print "<CLR/HOME><BEL>";:close.:open.,8,.,+"0:"+fi$+ft$:sys 41149
- 2040 :
- 2060 if ds=64 then begin
- 2080 : input "File Type s/p/u ";ft$
- 2100 : if instr("spu",ft$)=. then print "<BEL><2 crsr UP>";:goto 2080
- 2120 bend
- \2140 if ds=64 goto 2020
- 2160 :
- 2180 return
- ------------
- Category 5, Topic 11
- Message 6 Mon Apr 27, 1992
- CBM-ED [e.g.bell] (Forwarded)
-
- Got a use for up to 5 different 80 column screens. Only 1 block
- of color, and only the default character set, but for help screens,
- you can't beat it...
-
- 540 rem -----<multi-pages of 80 col screen>
- 560 :
- 561 bank 15:on page% goto 562,563,564,565,566
- 562 poke 2606,. :sys dec("cdcc"), .,12:goto 578
- 563 poke 2606,16:sys dec("cdcc"),16,12:goto 578
- 564 poke 2606,24:sys dec("cdcc"),24,12:goto 578
- 565 poke 2606,32:sys dec("cdcc"),32,12:goto 578
- 566 poke 2606,40:sys dec("cdcc"),40,12
- 567 :
- 578 print "<CLR/HOM><BEL>.... your text here" : return
-
- The POKE's to 2606 tell the C128 where to do the printing. This is
- invisible to you, so the above routine would just set up the screens.
- That is where the SYS commands come in. They actually toggle the
- display *to* the new screen memory. You could also have up to 3
- screens in memory each with it's own color/attribte memory. I'll put
- that up later, lest someone beats me to it.
-
- Sorry about the numbering schemes... these are taken directly from
- different programs I have written.
-
- On last note... You *would* want each of the above routines to GOTO
- a different printing routine if you want different printed screens.
- My program follows this with a routine to fill each screen with 4
- columns of up to 20 filenames, and is variable controlled, which is
- why I only use 1 target address, line 578.
- ------------
- Category 5, Topic 11
- Message 7 Sun May 03, 1992
- CBM-ED [e.g.bell] (Forwarded)
-
- Here is a program to read in Print Shop graphics into 7 variables
- for display on your 80 column screen. This version uses the
- 3 block graphics. It is kinda long, but neat!
-
- 100 dim oldbyte%(56,13)
- 105 gosub 345[gosub 430:print "<clr/home><bel>";
- 110 :
- 115 for gf=1 to 60:fi$="i"+right$("0"+mid$(str$(gf),2),2)
- 120 :
- 125 : open6,8,6,fi$:get#6,a$,a$
- 130 : for row=1 to 51
- 135 : for column=1 to 11
- 145 : get#6,a$
- 150 : oldbyte%(row,column)=asc(a$)
- 155 : next
- 160 : next
- 165 : close6:gosub 215
- 170 :
- 175 : print "<bel><wht>" chr$(142);
- 180 : for x=1 to 7
- 185 : print c$(x);
- 190 : next
- 195 next:return
- 200 :
- 205 rem -----<display on 80 column screen>
- 210 :
- 215 gosub 515:restore 405:parse=1
- 220 read a$:b$=mid$(a$,parse,1)
- 225 a%=asc(b$):gosub 470:sp=(a%*16)+8192
- 230 :
- 235 parse=parse+1
- 240 for row=1 to 56 step 8
- 245 : column=.
- 250 : hi%=int(sp/256):lo=sp%-(hi%*256)
- 255 : sys dec("cdcc"),hi%,18
- 260 : sys dec("cdcc"),lo%,19
- 265 :
- 270 : for cc=row to row+7
- 275 : sys dec("cdcc"),oldbyte%(cc,column),31
- 280 : next
- 285 :
- 290 : b$=mid$(a$,parse,1)
- 295 : a%=asc(b$):if a%=. the parse=1:read a$:goto 290
- 300 : gosub 470
- 305 : sp=(a%*16)+8192:parse=parse+1
- 310 : column=column+1:if column<13 goto 250
- 315 next
- 320 return
- 325 :
- 330 rem -----<install ml>
- 335 :
- 340 restore 360:x=.
- 345 read a%:if a%<>256 then poke 3400+x,a%:x=x+1:goto 345
- 350 return
- 355 :
- 360 data 94,0,12,232,126,0,12,8,232,228,251,176,4,40,76,76,13,40,96
- 365 data 160,6,126,0,12,62,0,13,136,16,247,96,256
- 370 :
- 375 rem -----<restore 8563 rom set>
- 380 :
- 385 poke 251,88:poke 252,96:sys 251
- 395 stop
- 400 :
- 405 data "abcdefghijklmnopqrstuvwxyz"
- 410 data "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
- 415 data "1234567890+-!#$%&'()\<>=*^"
- 420 data chr$(96)+chr$(95)+"@[]:;,./?"
- 421 data chr$(220)+chr$(168)+"<13 spaces>"
- 425 :
- 430 c$(1)="abcdefghijklm"
- 435 c$(2)="nopqrstuvwxyz"
- 440 c$(3)="ABCDEFGHIJKLM"
- 445 c$(4)="NOPQRSTUVWXYZ"
- 450 c$(5)="1234567890+-!"
- 455 c$(6)="#$%&'()\<>=*^"
- 460 c$(7)=chr$(96)+chr$(95)+"@[]:;,./?"+chr$(220)+chr$(168)
- 465 :
- 470 if a%>63 and a%<96 then a%=a%-64
- 475 if a%>191 then a%=a%-128
- 480 if a%>31 and a%<64 then return
- 485 if a%>159 and a%<193 then a5%=a%-64
- 490 if a%=255 then a%=94
- 495 return
- 500 :
- 505 rem -----<zap upper case character set>
- 510 :
- 515 sys dec("cdcc"),0,24
- 520 sys dec("cdcc"),32,18
- 525 sys dec("cdcc"),0,19
- 530 sys dec("cdcc"),0,31
- 535 sys dec("cdcc"),254,30
- 540 for x=1 to 15
- 545 : sys dec("cdcc"),255,30
- 550 next
- 555 return
-
- Sorry about the length of this, but it is a neat little function that
- you may want to use in your own programs. It blows away the upper
- case character set. You will still have upper case letters in the
- character set your 128 starts out with though. BTW, in case your term
- is redefining the characters like this one is...
-
- \=british pound sterling sign=chr$(92)
- ^=up arrow=chr$(94)
- ------------
- Category 5, Topic 11
- Message 8 Sat May 09, 1992
- CBM-ED [e.g.bell] (Forwarded)
-
- Found a little technique last night that is Looonnggg overdue...
- How about a way to load a SEQ file from the 1571. I know there
- is a prg out that does it, complete with source code now, right,
- but how about when you need something small, quick, and dirty?
-
- 10 open15,8,15,"i"
- 20 print#15,"u0"+chr$(255)+"file name"
- 30 bload "filename,s",b1,p7168
-
- Use whatever filename you like, and load it wherever you like in
- whatever bank. Still, this is something I wasn't able to do when
- I wrote BLAZE years ago. Still learning!
- ------------
- Category 5, Topic 11
- Message 9 Sat May 09, 1992
- C128.JBEE [* Sysop *] (Forwarded)
-
- How come you can not just bload the sequential file into memory and read
- it with the monitor from there?
- What does (10+20) do? <- curious minds want to know!
- ------------
- Category 5, Topic 11
- Message 10 Sat May 09, 1992
- R.KNOP1 [Rob Knop] (Forwarded)
-
- That's odd code.... Line 10 initialized the drive, which may make sense, but
- then line 20 sends the command to the drive to try to burst load the file.
- (That's what "u0"+chr$(255)+filename tells the drive; after that, you could do
- a series of input#'s which would read the file... only, BASIC is slow enough
- that I don't think you can take full advantage of the burst speed. You're
- better of writing a burst loader in ML.)
-
- What I don't understand is, why do you send this burst command to the drive
- and then do a bload? I thought bload already tried to do burst loading if it
- is available.
-
- -Rob
- ------------
- Category 5, Topic 11
- Message 11 Sun May 10, 1992
- CBM-ED [e.g.bell] (Forwarded)
-
- I usually always ad the 'i' command when I open the command channel. It
- is just my technique. As for the burst load, I think if you try the little
- program you will see that line 20 just tells the drive that it should ignore
- the fact that the file is sequential. The BLOAD is used to pull it in,
- directing it to the area in RAM, and the BANK, where I want it.
-
- The key reason for this whole routine is that you can't do a load of any type
- on a SEQ file using the C128 and the 1581 or 1571 in 1571 mode. Not even
- using 'filename,s', like you could with the C64. Thus, to get that
- capability, and in burst mode, I issue the command in line 20. The chr$(255)
- simply sets bit 7 in the BCIS fast load command, which tells the drive to go
- ahead and perform the load, even if the file is not a PRG. That just sets
- things up. The BLOAD follows through. I am not an expert in using the BCIS,
- but I waited a long time to figure out how to do this type of load. You may
- know more than me about the BCIS, but 3 lines to do this is a major
- breakthrough for me.
-
- btw: For any who read this and don't know what BCIS is, it stands for BURST
- COMMAND INSTRUCTION SET, which is documented in the back of the manuals for
- both the 1571 and 1581.
-
- Thanks for this question. If I answered correctly, let me know. If I am
- missing something, that will be even more appreciated. egb
- ------------
- Category 5, Topic 11
- Message 12 Sun May 10, 1992
- R.KNOP1 [Rob Knop] (Forwarded)
-
- Aha - yes, very nice! What I had forgotten was, you couldn't do the bload on
- a SEQ file. (Sort of annoying, really.) Never occured to me that this
- workaround would do it! But it does make sense.
-
- Yeah, a 3-line program, but a nice programming job at that. (Did you send
- this to RUN? They'd probably love it for their magic tricks.)
-
- -Rob
- ------------
- Category 5, Topic 11
- Message 13 Sun May 10, 1992
- CBM-ED [e.g.bell] (Forwarded)
-
- I probably could, but for $5, it is just as good to post it here and make it
- available now. I wrote a program called BLAZE several years ago that loads
- SEQ files, then prints them to printer/screen real fast. Trouble was, the prgs
- had to be changed to PRG, so I had to write a program, FLIX, to do that. Too
- bad I didn't do the legwork back then!
- ------------
- Category 5, Topic 11
- Message 14 Sun May 10, 1992
- C128.JBEE [* Sysop *] (Forwarded)
-
- Ahhhh..... now I understand :)
- ------------
- Category 5, Topic 11
- Message 15 Mon May 11, 1992
- M.DULSKI1 [Mark @WIZARD] (Forwarded)
-
- I thought it was you couldn't DLOAD a SEQ file? A while ago I wrote a
- small program that contains this line:
- bload(fa$+",s"),u(d1),p1024
-
- No setting up for burst load ahead of time like you did, Ed. However I
- do DOPEN the file and immediately DCLOSE it. Then read DS$. Maybe that
- is setting it up for burst somehow? At least my program works like it
- is suppose to ;) Just don't know why.
-
- ~~Mark~~
- ------------
- Category 5, Topic 11
- Message 16 Wed May 13, 1992
- CBM-ED [e.g.bell] (Forwarded)
-
- I don't know what you did Mark... But why would you DOPEN a file you are
- going to BLOAD. That is not the normal chain of events, and DCLOSE would also
- normally be unnecessary. Anyway, I know what I was able to do before I found
- this technique, and that I can do it now quite nicely.
-
- I *do* need some information now for this topic. I'll delete this message
- if/when I get a reply. I need the code to lock and unlock a 1581 diskette. I
- know the way to do it on a 1541/1571, which I may just post, but I have no
- detailed information on the workings of the 1581, and no source I know of.
- ------------
- Category 5, Topic 11
- Message 17 Thu May 14, 1992
- M.DULSKI1 [Mark @WIZARD] (Forwarded)
-
- Reason I DOPENed the file was to first check for disk errors. Chiefly
- for "file not found". DCLOSEing was done right after and *then* the
- seqential file was BLOADed into bank 1. Ok ok I probably could have
- TRAPed for errors. Never said I was an expert in programming ;-D
- Will admit I have much to learn but as I said, for some reason this
- method worked. Didn't have to set up for burst load first to get the
- job done.
-
- If you want to see the file I can upload it. Nothing special about it,
- all it does is take a seq file up to 253 blocks and splits into 2.
- BSAVEing the 2 new ones to disk. Wizards buffer was bigger than what
- my word proccessor takes and most other seq file splitters took too long
- for me. Never timed this one but it's fast ;)
-
- ~~Mark~~
- ------------
- Category 5, Topic 11
- Message 18 Thu May 14, 1992
- CBM-ED [e.g.bell] (Forwarded)
-
- Mark: I looked over the topics in this category and couldn't really find
- another place to move this discussion that is more appropriate than this.
-
- WRT your program, would I be correct in assuming you are running Jiffy DOS, or
- any kind of enhancement to your 128. Your technique does not work on my C128,
- even after opening it. I get a file not found error, whether I use a ',s' or
- not. That is the problem I have always run into. I have the Free Spirit
- ROM upgrade chip set, but to say that causes the problem would probably be a
- stretch, because the problem is not in the C128, it is in the 1571/1581. I
- have to suspect for now that you are using Jiffy DOS or something, and that
- your prg will not work on my machine. Instead of uploading it, post it here
- and I will check it to see if it works for me. Just give me exactly what you
- use, though I just did it on my 128 like this...
-
- 10 dopen#3,"tables,s":print ds$ : dclose#3 20 bload "tables,s",b1,p7168
-
- the screen output is as follows...
-
- run 00, ok,00,00
-
- ?file not found error in 20
-
- I suspect most of the c128 users will get the same error using the same bit
- of code Is this what you did?
- ------------
- Category 5, Topic 11
- Message 19 Thu May 14, 1992
- CBM-ED [e.g.bell] (Forwarded)
-
- sorry about the <CR>'s lost in the prev. msg. in the screen output
- illus. should have been..
-
- run
- 00, ok,00,00
-
- ?file not found error in 20
- ------------
- Category 5, Topic 11
- Message 20 Fri May 15, 1992
- M.DULSKI1 [Mark @WIZARD] (Forwarded)
-
- Ed, you're completely right when you asked about Jiffydos or enhancements
- on my 128. It's Warp Speed. I totally forgot about it and feel rather
- foolish ;> See, I said I had a lot to learn!
-
- And no, my method won't work without Warpspeed attached :( So I'm happy
- to say, Thank you! for this latest routine. Will be replacing my method
- with yours!
-
- Keep 'em comming Ed!
- ~~Mark~~
- ------------
- Category 5, Topic 11
- Message 21 Fri May 15, 1992
- CBM-ED [e.g.bell] (Forwarded)
-
- Great! I was kinda suspicious! And I got a *LOT* more to come, as I cull
- them from various programs I've written over the years and am in the process
- of writing. Hope some others will join in some more. There is a lot of useful
- stuff I have received from others!
- ------------
- Category 5, Topic 11
- Message 22 Sun May 17, 1992
- R.KNOP1 [Rob Knop] (Forwarded)
-
- Can't remember if I've posted this before, but here's a little assembly
- debugging routine that I use quite a bit. Call it with .AX having a pointer
- to a multi-byte variable (A=low, X=hi), and Y having the number of bytes in
- your variable. It prints the variable in hexidecimal.
-
- I give Merlin128 source since that's what I use.... :) (Although I'll bag
- the all capitals routines, since I'm typing this in the Dialogue128 editor.)
-
- num = $fb ;Or any other zero page variable...
- bsout = $ffd2 ;Yeah, you gotta call this with Kernal visible
-
- PUTYHEX sta num
- stx num+1
- dey
- ]L10 lda (num),y
- jsr PUT1HEX
- dey
- bpl ]L10
- rts
-
-
- PUT1HEX pha
- lsr a
- lsr a
- lsr a
- lsr a
- tax
- lda hexnums,x
- jsr bsout
- pla
- and #%00001111
- tax
- lda hexnums,x
- jsr bsout
- rts
-
- hexnums txt '0123456789abcdef'
-
-
- -Rob
- ------------
- Category 5, Topic 11
- Message 23 Wed May 20, 1992
- CBM-ED [e.g.bell] (Forwarded)
-
- Here is a couple of ways to check for device presence in ML...
-
- lda dev#
- jsr listen
- lda #$6f
- jsr second
- jsr unlisten
- lda $90
- bmi nodrive
- bpl drivepresent
-
- That one was given to me, and is very similar to the one used in CCGMS.
- This one is the one I use...
-
- lda #0
- jsr setnam
- lda #15
- ldx #device
- tay
- jsr setlfs
- jsr open
- ldx #15
- jsr chkout
- pha
- jsr clrchn
- pla
- cmp #5
- beq nodrive
- bne drivepresent
-
- Either one works. The first one doesn't need a file to be opened. The
- second opens a command channel (#15) to the drive similar to
- OPEN15,drive#,15.
-
- ------------
- Category 5, Topic 11
- Message 24 Fri May 29, 1992
- HOWIE-CBM (Forwarded)
-
- Well, here's a very basic Basic I whipped together to show the time
- on screen with CMD's RTC:
-
- 4 print" [shift/clr home] [23 cursor downs] "
- 5 open14,16,15:print#14,"t-ra"
- 10 get#14,a$:t$=t$+a$:if st<>64 then 10
- 12 print " [2 cursor ups] [25 spaces] ";
- 15 print " [1 cursor down] " t$;
- 16 t$=""
- 20 close14:goto5
-
- This will display the current date and time at one location, updating the
- date and time each second.
-
- Not too useful, but the basic info is here which can be expanded, perhaps
- opening a window on a menu screen, or other enhancement.
-
- Now I've gotta change a few starter (boot) routines for some programs that
- can use the clock to pick up the correct time, when they get run. Programs
- like Dialogue, Big Blue Reader, GEOS...
-
- Hmm... I am sure I've left some out. oh! CP/M would be nice. Not quite
- sure how to go about this, however.
-
- For other cbm mode programs that may not access the RTC direct, there
- appear to be some nifty work-arounds. For example with Pocket Writer3,
- a letter, memo, and note template all pick up a date file to insert in the
- appropriate place. Pocket Writer will display the current date and time
- thru the command channel, but as far as I know it cannot get `imported'
- into the running program this way. The work around that I am thinking
- about is to have the main menu (to which all programs exit) branch off
- to write the current date into a file, and then let PW3, when booted,
- thru its auto macros, pick up this file, and change it into a useable
- date file.
-
- Seems like it should work out fine, and the fraction of a second extra
- that this might take shouldn't be all that noticeable.
-
- CP/M tho has me stumped. Wonder if the routine which picks up the time
- from the Right Time Clock for CP/M can be adapted.
-
- That might be one way...
-
- Howie
- ------------
- Category 5, Topic 11
- Message 25 Sat Jul 04, 1992
- CBM-ED [e.g.bell] (Forwarded)
-
- Need some TRUE ASCII characters for your C128 80 col program? Here
- are 5, the circumflex (^), underscore (_), left bracket ({), right
- bracket (}), and tilde (~).
-
- 10 for c=1 to 7
- 20 : read a%:sp%=(a%*16)+12288
- 30 : hi%=int(sp%/256):lo%=sp%-(hi%*256)
- 40 :
- 50 : sys dec("cdcc"),hi%,18
- 60 : sys dec("cdcc"),lo%,19
- 70 :
- 80 : for x=1 to 8
- 90 : read a%:if a%=256 then x=9: goto 110
- 100: sys dec("cdcc"),a%,31
- 110: next
- 120next
- 130:
- 140 poke 251,88:poke 252,96:sys 251: rem clear interrupts
- 150:
- 160 data 30,008,028,034,065,000,000,000,000:rem circumflex
- 170 data 31,000,000,000,000,000,000,255,000:rem underscore
- 180 data 91,028,048,024,048,024,048,028,000:rem left bracket
- 190 data 93,028,006,012,006,012,006,028,000:rem right bracket
- 200 data 92,012,012,012,012,000,012,012,012:rem bar (surprise!)
- 210 data 28,000,096,048,024,012,006,003,000:rem backslash (surprise again)
- 220 data 94,000,017,041,070,000,000,000,000:rem tilde
-
- I missed the bar and backslash characters. The bar is, I believe, shift +
- or minus, and the backslash is the english pound sterling symbol. The
- circumflex is the uparrow, the underscore is the back arrow, the right and
- left brackets I believe are the shifted + or - (shift +,-, and pound
- sterling symbols until you figure it out, and the tilde is shift *, I
- think. Sorry for the uncertainty. I am doing this from a listing and
- uncommented memory. Dontcha hate it when that happens. :-(
-
- ------------
- Category 5, Topic 11
- Message 26 Mon Jul 20, 1992
- HOWIE-CBM (Forwarded)
-
- Did you ever have a piece of info, that didn't quite fit in anywhere...
-
- Well I got together some obscure info for a member of our user group.
- Mostly for CP/M, and hopefully someone else might find this helpful:
-
- This lets drive M turn into another drive, so that software that may want
- to run from only drive A, will now run from the REU:
-
- To turn drive M: into another Drive:
- ====================================
-
- conf poke fbd1=96fb turn M into A
- conf poke fbd3=96fb turn M into B
- conf poke fbd5=96fb turn M into C
- conf poke fbd7=96fb turn M into D
- conf poke fbdb=96fb turn M into F
-
- Now drive M will be both drive M and drive A, or whatever.
-
- A dir shows same exact files.
-
- While this is active the alternate drive is off line.
-
- To turn drive A back on:
- ========================
-
- conf poke fbd1=82fa
-
- To turn drive B back on:
- ========================
-
- conf poke fbd3=b9fa
-
-
- And, one more obscure one before Ed throws me out of his Topic...
-
- This, for both 64 and 128 mode:
-
- If anyone would ever want a 1571 to mimic a dual disk drive, maybe to
- achieve software compatibility, here's how:
-
- Enter either in program or direct mode:
-
- open15,8,15,"v0>h0":close15
-
- Then format (new or header) the disk.
-
- Enter either in program or direct mode:
-
- open15,8,15,"v0>h1" close15
-
- Then format (new or header) the disk.
-
- The 1571 will now respond to program commands directed to drives 0 and 1.
-
- This one was never popular with 128 users, since the activity to the second
- side could not be burst.
-
- What you end up with is a two sided flippy, that doesn't get flipped, since
- the other side spins the wrong way.... :)
-
- Howie
- ------------
- Category 5, Topic 11
- Message 27 Mon Jul 20, 1992
- C128.JBEE [* Sysop *] (Forwarded)
-
- Yes, that 1571 trick was in vogue for a while with C-64 BBS owners because
- the 1571 held up better than the C-1541 and had double the storage.
- I think the Laser BBS for the C-128 also did this trick.
- ------------
- Category 5, Topic 11
- Message 28 Wed Jul 22, 1992
- CBM-ED [e.g.bell] (Forwarded)
-
- I'll tell you what else that formatting trick is useful for Howie. If a
- person has a lot of 1541 format disks, formatting the back side of the disk
- like that keeps the drive from doing all that rattling when y first turn the
- computer on or reset and it looks for a boot. BTW, I think CP/M snippits have
- must as much a place here as anything in BASIC or ML for native mode.
- ------------
- Category 5, Topic 11
- Message 29 Fri Jul 24, 1992
- HOWIE-CBM (Forwarded)
-
- Thanks Ed! :)
-
- Howie
- ------------
- Category 5, Topic 11
- Message 30 Tue Aug 04, 1992
- CBM-ED [e.g.bell] (Forwarded)
-
- I added some <CR>'s to a snippet Rob posted earlier. Included is the
- whole post...
-
- R.KNOP1 [Rob Knop] at 01:34 EDT
-
- Here's a programming trick that someone in my UG (although I've been bad and
- have missed two meetings :( ) came up with. I am pulling this off the top of
- my head, so check my code!
- With this, you can execute direct mode commands from within a program. Some
- commands function differently (the one I have listed here will give an
- error... big whoop, eh?), and one can think of uses for this.
-
- 100 gosub1000
- 110 rem rest of code
-
- ...
-
- 1000 print"<clr>inputa$":print"<c/dwn><c/dwn><c/dwn>":rem "enough downs???"
- 1010 print"restore<home>"
- 1020 poke842,13:poke843,13:poke208,2:rem put 2 CR's in keyboard buffer
- 1030 end
-
- What this will do is, put the command you want to execute on the screen, and
- the direct mode "restore". You then end your program; the two CR's in the
- keyboard buffer are pulled out, the first one executing your command (here
- the
- input statement), the second one executing the RETURN. The RETURN returns
- you
- to line 200 of the program.
-
- Neat, eh?
- ------------
- Category 5, Topic 11
- Message 31 Tue Aug 04, 1992
- CBM-ED [e.g.bell] (Forwarded)
-
- Just a suggestion for any further additions to this topic... As Mark pointed
- out earlier in this topic, the '*sn' command is really needed to make sure
- that what you enter is what we see. It is especially important so that the
- program segments don't get jumbled into long lines and line divisions are
- lost... Stay tuned... this topic is still under construction...
- ------------
- Category 5, Topic 11
- Message 32 Tue Aug 04, 1992
- CBM-ED [e.g.bell] (Forwarded)
-
- Here is a little unnew taken from the book BASIC 7.0 Internals. You
- can't get much shorter than this without an outside utility...
-
- poke 7169,1:renumber
-
- Give it a try....
- ------------
- Category 5, Topic 11
- Message 33 Fri Sep 04, 1992
- HOWIE-CBM (Forwarded)
-
- This is strictly C64 stuff, but it is sooo... remarkable, I thought I'd
- place it here for max viewability. Following from the C64 of John
- Iannetta:
-
- 10 poke55,190:poke56,161:clr
- 20 a$="no"+"no"
- 30 b$=" honest"+" politicians"
- 40 b$="cheap"+"pc's"
- 50 c$=" good tv"+" shows"
- 60 c$="no"+"no"
- 70 printa$;b$;c$
-
- [To avoid even this 'lil bit of typing, those with BTP can use its
- tokenizing feature to write direct to disk. Others might try saving as a
- SEQ, and then doing a: LOAD "filename,s",8]
- ^^
-
- (Up arrows courtesy of Mark!) :)
-
- Howie
- ------------
- Category 5, Topic 11
- Message 34 Fri Sep 04, 1992
- CBM-ED [e.g.bell] (Forwarded)
-
- How about a one-liner to change your prg files to SEQ files, stripping
- line numbers in the process...
-
- open1,8,2,"file,s,w":cmd1:poke24,37:list:print#1:close1:poke24,27
-
- To make it a PRG type file on disk, change the ',s,w' to ',p,w'.
-
- You can also get a machine language monitor dump to SEQ file using a
- similar technique. Open a file, as above, but don't do any pokes.
- Enter the CMD1 command, then the MONITOR command to enter the machine
- language monitor. Then just do a display of the desired memory range
- using the 'd' or 'm' commands. When the cursor comes back, exit the
- monitor using the 'x' command, type PRINT#1:CLOSE1.
-
- ------------
- Category 5, Topic 11
- Message 35 Mon Sep 07, 1992
- M.DULSKI1 [Mark @WIZARD] (Forwarded)
-
- Guys, I give this whole topic - ^^
- ------------
- Category 5, Topic 11
- Message 36 Tue Sep 08, 1992
- CBM-ED [e.g.bell] (Forwarded)
-
- Hope that is good! :^) The only thing keeping me from puttting up a load
- more stuff is time and other projects, which of course, generate more
- snippits.
- ------------
- Category 5, Topic 11
- Message 37 Wed Sep 09, 1992
- R.KNOP1 [Rob Knop] (Forwarded)
-
- Hey, on the topic of example code, Craig Taylor, the C= Hacking Mag editor, is
- working on an article that ought to be very useful to beginning ML
- programmers. It's the sort of article that I wished I had back when I knew ML
- well enough that I basically understood the opcodes and how they each worked,
- but was rather clueless about how to go about putting a largish program
- together. Once issue 4 of this Hacking Mag shows up, I'll be sure to upload
- it to the libaries here.
-
- -Rob
- ------------
- Category 5, Topic 11
- Message 38 Wed Sep 09, 1992
- C128.JBEE [* Sysop *] (Forwarded)
-
- I think LADS128 is the best book for a beginners.
- How it shows the relationship between ML and Basic is worth the cover
- price because it lets you "do now" and understand what you did.
- ------------
- Category 5, Topic 11
- Message 39 Wed Sep 09, 1992
- CBM-ED [e.g.bell] (Forwarded)
-
- I did a major upgrade to LADS, and when done w/my current project will resume
- my complete rewrite of it. And I always liked it too.
- ------------
- Category 5, Topic 11
- Message 40 Tue May 18, 1993
- HOWIE-CBM at 06:12 EDT
-
- I ran across the following from John Iannetta, titled "REALLY NOTHING", which
- while C64 specific (I think) is also equally applicable for the C128:
-
- The zero doesn't get much respect.
- One would not be very pleased if it represented his income, net profit, net
- worth, IQ score, life expectancy, batting average, pulse rate, etc. And it
- doesn't seem to do much. If you add it to a number, the result is the same
- number (0 is the "identity element" for addition). But the invention of the
- zero by the Hindus is considered to be one of the two most important advances
- in mathematics (the other is positional notation, also by the Hindus).
-
- Roman numerals don't include a zero.
- Partly for that reason, you see them only in copyright notices and on paper
- money. Computers use them all the time.
- They account for about half of all the bits ever used. In C-64 BASIC, it is
- used for the color "black". Poke 53280,0 for a black border, poke 53281,0
- for
- a black background, poke 646,0 for a black foreground (characters). Zero is
- "@" in screencode. If you poke 2004,0 you will see "@" on the bottom line of
- your screen. Poke 657,0 to prevent changing character set when you press
- SHIFT
- and C= keys. If you poke 56334,0 you will never poke again (until you do a
- STOP/RESTORE). It turns off the timer (the jiffy clock) that generates the
- system interrupt. If your terminal program always corrupts the first
- character
- received, try doing a poke 169,0 before running the program.
-
- Using a FOR NEXT loop, 0 is often poked into memory to clear the SID
- registers or to initialize graphics memory in hi-res mode (and for many other
- purposes). So what is the fastest way to do that? Poke xxxx,0? That is the
- slowest way. The following BASIC type-in program will count to 2000 using
- five
- different FOR NEXT loops. Each represents the zero differently. When you
- run
- the program, you will see the elapsed time for each routine. Actually, not0
- (or
- -1) is subtracted from each preceding number. I tried using 0 and it was
- taking forever. The first routine uses 0 and the second uses a variable (x).
- But x is not defined in the program, so each pass through the loop, BASIC
- must
- search through the seven simple variables. When x is not found, 0 is used.
- But x is NOT defined as 0, so the variables are searched on every pass. But
- the routine is still faster than the first. Any time that digits are used
- (whether 0 or 123 or 91), BASIC uses a long routine to convert the characters
- to number in floating point form.
-
- The third FOR NEXT loop uses the variable y. That IS defined, but as the
- seventh and last of the simple variables. That routine is a bit faster. The
- fourth routine uses the variable z, which is the first one defined. That is
- faster yet. The last FOR NEXT loop uses "." for zero, and is the fastest of
- them all. BASIC evaluates "." to zero relatively quickly, and making use of
- that fact can speed up a routine that pokes zeros into a large section of
- memory.
-
- 10 poke55,0:poke56,160:clr:z=0:i=0
- 20 e=1999:a$=chr$(145):s=60:n=0:y=0
- 30 a$(2)="0":a$(3)="x":a$(4)="y"
- 40 a$(5)="z":a$(6)=".":goto80
- 50 printtab(6);ti/s;tab(18);
- 60 print"seconds for ";a$(n)
- 70 print:ti$="000000":goto200
- 80 pokepeek(61)+256*peek(62)-3,n+50
- 90 n=n+1:ifn=1then70
- 100 goto50
- 200 fori=ztoe:printi-not0;a$:next
- 250 goto80
- 300 fori=ztoe:printi-notx;a$:next
- 350 goto80
- 400 fori=ztoe:printi-noty;a$:next
- 450 goto80
- 500 fori=ztoe:printi-notz;a$:next
- 550 goto80
- 600 fori=ztoe:printi-not.;a$:next
- 650 goto80
- 700 end
-
- John
-
- ------------
- Category 5, Topic 11
- Message 41 Tue May 18, 1993
- HOWIE-CBM at 06:13 EDT
-
- uh oh....
-
- I quess I should have reformatted a few of those lines above.... :(
-
- Howie
- ------------
- Category 5, Topic 11
- Message 42 Tue May 18, 1993
- CBM-MARK at 11:32 EDT
-
- That snippet is simply excellent Howie! Keep those comming ;)
-
- ~~Mark~~
- ------------
- Category 5, Topic 11
- Message 43 Tue May 18, 1993
- HOWIE-CBM at 23:08 EDT
-
- Mark,
-
- As long as you asked, here is another one from John Iannetta:
-
- --------
-
- Did you ever validate a 1541 or 1571 disk and find that you gained quite
- a few free blocks? DOS is supposed to keep track of the number of free
- blocks as you write and delete files. Every time you store a file onto your
- disk, DOS puts the block count into the directory entry for that file. You
- see it when you list the directory. Those blocks are allocated in the BAM
- (block availability map), and cannot be used by future files. That number
- is also subtracted from the number of free blocks that appears at the bottom
- of a directory listing.
-
- If you delete (scratch) a file, the entry is removed from the directory.
- The blocks that were allocated are now freed up, and that number is added to
- the number of free blocks at the end of the directory. So you can save and
- scratch files until the cows come home, and the numbers in the directory
- listing will always be correct. WRONG WRONG WRONG.
-
- The sum of all of the file block counts plus the number of free blocks
- should be 664 for a 1541. But there has been a bug in the DOS scratch (S0:)
- command that is still present in my 1541-II and 1571 with an -05 ROM. If
- you scratch a file whose size is an integral multiple of 254 bytes, DOS will
- free up one block too few. There are 254 data bytes in a disk block, so we
- are talking about the last block being completely full. In the following
- BASIC type-in program, a file named "axolotl" is written to disk. You can
- change the name (f$ in line 30) if you already have a file of that name on
- your disk. The file is then scratched. The number of free blocks is shown
- before and after the two operations, and you will see that you lose a free
- block each time that you run the program.
-
- If you run the program ten times, there will be ten fewer blocks shown
- to be free. And the disk has the same files at the end as it had at the
- start. You merely wrote "axolotl" ten times and scratched "axolotl" ten
- times. Run 300 to validate the disk and see the original number of free
- blocks displayed. The number of blocks used by the file is in the variable
- n in line 20. You can change n to any number, but I used 1 to save time.
- The 1541 never got any speeding tickets. Some of the best C-64 software
- ever written was created while waiting for a 1541 to load a program.
-
- 10 poke55,.:poke56,160:clr
- 20 n=1:z$=chr$(0)
- 30 f$="axolotl":gosub100
- 40 open8,8,1,f$
- 50 fori=1to254*n:print#8:next
- 60 close8
- 70 open15,8,15,"s0:"+f$:close15
- 80 gosub100:end
- 100 print:open8,8,0,"$$"
- 110 fori=1to6:get#8,a$:next
- 120 print:print"0 ";
- 130 get#8,a$:printa$;:ifa$=""then150
- 140 goto130
- 150 print:get#8,a$:get#8,b$
- 160 get#8,a$:get#8,b$:printchr$(157);
- 170 printasc(a$+z$)+256*asc(b$+z$);
- 180 get#8,a$:printa$;:ifstthen200
- 190 goto180
- 200 close8:return
- 300 z$=chr$(0):gosub100
- 310 open15,8,15,"v0:":close15
- 320 gosub100
-
- John
-
- ---------
-
- Running the routine on a 1541 partition within RAMLink had no effect.
- Beginning and ending block count was the same.
-
- However, running it on a 1581 *with* JiffyDos, made me lose one block.
-
- A collect brought the missing block back.
-
- A nice one! :)
-
- Howie
- ------------
- Category 5, Topic 11
- Message 44 Tue May 18, 1993
- CBM-MARK at 23:23 EDT
-
- Hey, great Howie! I always noticed the 'extra' block or two that showed up
- after a validate but never knew *why*. Now I do ;)
-
- ~~Mark~~
- ------------
- Category 5, Topic 11
- Message 45 Wed May 19, 1993
- HOWIE-CBM at 03:01 EDT
-
- oh!
-
- For those wanting to RUN the program listing above (which I highly recommend
- for those wanting to observe superb Basic coding in action), there is no need
- to actually type it. That is if you have access to an edit buffer like
- BobsTermPro. Simply tag the beginning and ending of the listing, and save to
- disk with the Seq To Basic Program option. It will run when loaded.
-
- Howie
- ------------
- Category 5, Topic 11
- Message 46 Mon May 31, 1993
- CBM-ED [e.g.bell] at 11:00 EDT
-
- I couldn't find the topic asking for it, but here is a little hack I
- believe will return the Julian date for any gregorian date input in the
- format YYMMDD. The only exception is the leap year exception that occurs
- on either centuries divisible by 100 or 400... couldn't remember which
- it was... it does work on all the leap years divisible by 4 otherwise.
- Does anyone know that quirk in the leap year calculations???
-
-
- 20 d$="_\_^_^__^_^_"
- 25 fast
- 30 poke 241,peek(241) or 128
- 35 input "Enter Date [YYMMDD] ";dd$
- 40 :
- 45 yr%=val(left$(dd$,2))
- 50 lp%=-((yr%/4)=int(yr%/4))
- 55 :
- 60 mt%=val(mid$(dd$,3,2)):if mt%<1 or mt%>12 goto 85
- 65 :
- 70 dy%=val(right$(dd$,2))
- 75 if dy%<=asc(mid$(d$,mt%,1)) and 31 goto 95
- 80 if (mt%=2) and (dy%=29) and (lp%=1) goto 95
- 85 print "Invalid Date":sleep 2:goto 35
- 90 :
- 95 jd%=.
- 100 for x=1 to (mt%-1)
- 105 : jd%=jd%+(asc(mid$(d$,x,1)) and 31)
- 110 next
- 115 :
- 120 jd%=jd%+dy%+(lp%*-(mt%>1)):print "Julian Date :"jd%:goto 35
-
- Line 20 will look more sensible when converted to graphic characters.
- The '_' is the commodore back arrow and the '^' is the commodore up
- arrow. The '\' is the commodore pound-sterling key.
- ------------
- Category 5, Topic 11
- Message 47 Fri Aug 20, 1993
- G.CORREA [RAMRunner] at 23:21 EDT
-
- Heh. Okay, folks, from an admitted Amiga lover you are reading an admission:
- Now I remember WHY I loved the 128. All these little hacker tricks. Thanks
- for the reminder, from me and my two 128s.
- As for my contribution, I cannot recall WHERE I got it. All this talk about
- BTP's tokenizing ability made me thing, geez, that'd be handy to have, but YOU
- DON'T NEED IT. There's a simpler way.
- Make sure you have a SEQ file. It'd be best for the file to have no
- extraneous characters in it, just the program, but blank lines are not a
- problem. The READY. printed at the end of a listing (say you OPEN 1,8,1,
- "filename,s,w": CMD 1: LIST: PRINT#1: CLOSE 1 to get the listing in SEQ form
- to begin with) will be helpful as it will usually cause an error.
- Alternatively, you can add a DCLEAR as the last line in the SEQ file, with no
- line number.
- As an example,
- 10 REM A handy little program.
- 20 PRINT "This is a handy little program."
- DCLEAR
- (You of course would have to edit this into the file via buffer edit).
- Now, on to the actual trick. You have a SEQ file which is a program listing
- and an intense desire NOT to retype it all. Whatcha gonna do...? Enter, in
- direct mode,
- OPEN 1,8,0,"filename,S,R"; SYS 65478,0,1
- The drive will whirr, blank lines will advance, and what winds it all up
- depends on how the file ends. If it is a LISTed file with a READY. at the end
- and NO DATA statements, an ?OUT OF DATA error will come up and you're free to
- DCLOSE or DCLEAR (which is my preferred method). If it is a file that has
- DCLEAR edited into the last line, it'll take care of itself. If neither, then
- you'll have to type blind, DCLEAR, when the drive motor shuts down (the busy
- light will still be on). You won't see anything on the screen except for
- blank lines scrolling up.
- What this does is re-assign input from the keyboard to a SEQ disk file. Your
- drive does all the typing for you. :)
- ------------
- Category 5, Topic 11
- Message 48 Sat Aug 21, 1993
- CBM-ED [e.g.bell] at 01:58 EDT
-
- Good one. This was published by Miklos G. in an old issue of the
- Transactor. I believe the article was titled 'An new look at an
- old dog' or something very similar. It has lost nothing over the
- years for novelty and utility!
- ------------
- Category 5, Topic 11
- Message 49 Sun Aug 22, 1993
- G.CORREA [RAMRunner] at 22:45 EDT
-
- Ah! Thanks, eg. Now that you mention it, I recall it well. Heckuva one-
- liner.
- ------------
- Category 5, Topic 11
- Message 50 Thu Nov 11, 1993
- H.HERMAN1 at 01:34 EST
-
- Here is the *updated* and *corrected* Pocket Writer 3 starter. I _think_ I
- posted an earlier version in the Dialogue 128 topic. Just capture it, and
- save it as a tokenized BASIC to disk.
-
- --- snip here ---
- 10 en=0:em$="":et=0:es=0
- 20 u=peek(186)
- 30 f$="today.dat"
- 40 open15,16,15
- 50 print#15,"t-rd"
- 60 fori=0to7:get#15,z$:y(i)=asc(z$):next:close15
- 70 ify(1)=93theny1$="1993"
- 80 ify(1)=94theny1$="1994"
- 90 ify(1)=95theny1$="1995"
- 100 ify(1)=96theny1$="1996"
- 110 ify(1)=97theny1$="1997"
- 120 ify(1)=98theny1$="1998"
- 130 ify(1)=99theny1$="1999"
- 140 ify(1)=00theny1$="2000"
- 150 ify(2)=1theny2$="January"
- 160 ify(2)=2theny2$="February"
- 170 ify(2)=3theny2$="March"
- 180 ify(2)=4theny2$="April"
- 190 ify(2)=5theny2$="May"
- 200 ify(2)=6theny2$="June"
- 210 ify(2)=7theny2$="July"
- 220 ify(2)=8theny2$="August"
- 230 ify(2)=9theny2$="September"
- 240 ify(2)=10theny2$="October"
- 250 ify(2)=11theny2$="November"
- 260 ify(2)=12theny2$="December"
- 270 y3$=right$(str$(y(3)),2)
- 280 ify(3)<10theny3$=right$(y3$,1)
- 290 x1$=" ":x3$=","
- 300 xz$=y2$+x1$+y3$+x3$+x1$+y1$
- 310 :
- 320 open15,16,15:print#15,"cp3":close 15
- 330 open15,u,15
- 340 dopen#4,"@"+(f$)+",s,w",u16
- 350 gosub440
- 360 print#4,xz$
- 370 gosub440:dclose#4,u16:close15
- 380 :
- 390 @"cd2:telcom",16
- 400 open15,16,15:print#15,"s-8":fori=1to750:next:close15
- 410 poke842,96:poke843,77:poke844,76:poke845,48:poke846,58:poke847,73
- 415 poke848,78:poke849,13:poke850,108:poke851,80:poke208,10
- 420 open15,11,15:print#15,"ui":close15,15:dload"pw",u11:end
- 430 :
- 440 input#15,en,em$,et,es
- 450 ifen>1thenprint en,em$,et,es:dclose#4,u16:close15:stop
- 460 return
- --- snip here ---
-
- Notes for use:
- --------------
-
- + Call routine from your CMD device which has the RTC.
-
- Instead of adding lots of comments to the above, below I'll tell you what
- is happening so that anyone can delete lines they do not want, and change
- others, as they want:
-
- + Lines 10-330 get the date for a file called today.dat.
-
- + Line 320 sets up partition 3 as the default
-
- + Lines 330-370 write the file, today.dat, which has today's date into
- partition number 3.
-
- + Line 390 changes the default again, this time to partition 2, and the
- subdirectory called TELCOM.
-
- + Line 400 swaps RAMLink into device #8, because PW 3 OVERLAY.* files are
- in RAMLink and PW 3 will boot up faster.
-
- + Lines 410- 415 poke keystrokes into the 128's keyboard buffer, and these
- keys will execute _AFTER_ PW 3 has booted. More on this later.
-
- + Line 420 loads and runs PW 3 from drive #11
-
- + Line 440-460 do drive error checking and should be left in as it is a part
- of the routine to write today's date file.
-
- Now, if I remember correctly, here is what those pokes make PW do, once it
- has loaded:
-
- (1) Load a macro file into its macro buffer from PW device 0. The
- macro file is called: IN
-
- (2) Execute macro "Q" from that macro file.
-
- Now macro "Q" can do anything you would like it to do, including running
- other macro keys, so you have about 1,000 auto keystrokes to customize
- things to your liking.
-
- Among some of the things it does for me:
-
- (a) Swaps RAMLink back into device #16.
-
- (b) Loads the file TODAY.DAT into a "template" file so that it gets postioned
- correctly, and saved to REU in real ascii. This then allows today.dat on
- the REU to be accessed by all templates as an external file, which always has
- the current date.
-
- (c) Resets the default RAMLink partition/directory.
-
- (d) Concludes by leaving me in a directory of partition 7, with the cursor
- placed under the template I most often use. (If I will be using this, a
- <CR>, or mouse click, has it loaded into PW's buffer. If not, I am in the
- partition which holds all PW templates, and can then select another.)
-
- It may do some more minor things, but this is the thrust of what all it
- does each time PW boots.
-
- All this customizing adds 2-3 seconds to the overall boot time.
-
- Howie
-
- P.S. By extension the procedures listed might work with many different
- word processors and commercial programs. It works with all 3 of Digital
- Solution's Pocket programs.
- ------------
- Category 5, Topic 11
- Message 51 Thu Nov 11, 1993
- CBM-ED [e.g.bell] at 04:01 EST
-
- Nice addition to the topic Howie!!! :)
- ------------
- Category 5, Topic 11
- Message 52 Wed Dec 29, 1993
- S.EYRSE at 21:51 EST
-
- This will TOKENIZE a seq text file
- that you have downloaded from this or
- other Boards. It is very good for those
- quick little things that people put in
- posts.
- It will run in a AUTO mode or
- MANUAL use which ever is best for the
- file your working on.
- There are Doc's attached which
- explain all in more depth. It only goes
- one way SEQ to BASIC, cause that is all
- you really need. STEVE :)
- And what this is is file TOKENS.ARC
- that I just uploaded to area 20 Disk&File
- seemed to be the right place. It should be
- file #14055 when released. Hope it will
- help those who don't have Bob's term but
- want to have the Puter type in the small
- files found here..
- ------------
- Category 5, Topic 11
- Message 53 Mon Oct 03, 1994
- H.HERMAN1 at 05:29 EDT
-
- Would anyone know if there is any difference, when do a software reset on the
- 128, between using sys65341, or BANK1:sys57344?
-
- From observation, they both seem to do the same thing, very well. Anyway, I
- wondered if one would be better to use than the other.
-
- Howie
- ------------
- Category 5, Topic 11
- Message 54 Mon Oct 03, 1994
- CBM-ED [e.g.bell] at 08:20 EDT
-
- Howie: Both end up at the same address, sort of. Instead of BANK 1
- you should really do BANK 15. The routine may be copied into all
- banks, but I would recommend accessing it in bank 15. SYS 65341 should
- also work in BANK 1 as the routine is copied into all banks 'just in
- case'.
-
- The difference between the two is just that one is a documented entry
- address and the other is the direct address. When I need to do a reset
- I use the 'bank 15:sys 57344' or from the monitor, 'g fe000' to call this
- block of code. Commodore internal code uses an internal call,
- JMP ($FFFC) to do the same thing (at yet another entry point).
-
- Another recommended entry point (which I have never found completely
- satisfying) is at 65366, the PHOENIX entry point which is supposed to,
- among other things, call the routine at 57344 to some point. Try it tho
- from immediate mode, and you will see that it does not do the same thing
- as the RESET routine (57344) at all, at least not all of the same things.
- The evidence will be on your screen.
-
- Does all of this answer your question or just muddy the water further.
- >:)
- ------------
- Category 5, Topic 11
- Message 55 Tue Oct 04, 1994
- H.HERMAN1 at 04:11 EDT
-
- Ed,
-
- It sure does! No more muddy waters here....
-
- The extra info about PHOENIX and g fe000 are especially interesting. I like
- the g fe000 and see myself using this from now on, and when I run into
- trouble.
-
- I did PHOENIX a number of times, and while it is certainly a lot faster than
- SYS 65341 or BANK15:SYS57344, I get the feeling that it is not quite as
- thorough. It just seems too fast. What? Booting the RAMLink boot file. I
- feel better when the 128 seems to take its time, and (hopefully) go through a
- series of resets, or whatever, during that 1.5 second delay, or whatever it
- might be.
-
- The difference between the original two is something that I had wondered
- about for quite sometime.
-
- Now I can begin to wonder about more esoteric things! :)
-
- Thanks!
-
- Howie
-
- ------------
- Category 5, Topic 11
- Message 56 Mon Nov 14, 1994
- H.HERMAN1 at 21:51 EST
-
- Here's one of Jim Brain's teaser-questions......
-
- At the Basic interperter enter: ?""+-0
-
- I did, and was I surprised!! :)
-
- I quess Jim will explain all this...
-
- Howie
- ------------
- Category 5, Topic 11
- Message 57 Sat Nov 26, 1994
- BADCO at 16:49 EST
-
- Anyone have a snippit to sniff out whether a machine has 64k VDC ram oor 16k?
- I am having a dog of a time figuring out how to do this... I know there must
- be a way. I can go into 64k mode with machines that have 64k fine and all
- that, I just need to be able to tell if a machine has 64k VDC in it or not.
- Regards,
- Sean.
- ------------
- Category 5, Topic 11
- Message 58 Sat Nov 26, 1994
- E.GBELL [e.g.bell] at 19:43 EST
-
- Sean: There was a little one posted around here not too long ago by
- Fred Bowen. Bet THE.OUTLAW still has a copy of it somewhere. I was
- never able to get it to work, but others were.
- ------------
- Category 5, Topic 11
- Message 59 Sat Nov 26, 1994
- THE.OUTLAW at 21:56 EST
-
- I'll have to look for it, I know it's here somewhere :>
- ------------
- Category 5, Topic 11
- Message 60 Sun Nov 27, 1994
- BADCO at 08:41 EST
-
- I would greatly appreciate it. I really need this code. I am working on puon
- putting all the maps for GWterm into VDC ram, (provided you have a 64k VDC
- machine) as to speed up the play even further. Along with a few other "bonus"
- features I have in mind for 64k vdc machines
- Thanks in advance,
- Sean
- ------------
- Category 5, Topic 11
- Message 61 Sun Nov 27, 1994
- THE.OUTLAW at 12:09 EST
-
-
- EB> Sean: There was a little one posted around here not too long ago by
- EB> Fred Bowen. Bet THE.OUTLAW still has a copy of it somewhere. I was
- EB> never able to get it to work, but others were.
-
- Here it is. I couldn't find the original post, so I retyped it! :>
-
- ------------
- 1 REM FRED'S NIFTY PROGRAM TO DETERMINE SIZE OF 8563 DRAM
- 10 BANK15: AD=DEC("D600"): DA=AD+1: GOSUB 900 :REM SETUP ML
- 20 POKEAD,28: S=PEEK(DA): POKEDA,63 :REM SELECT 64K
- 30 I=16896: SYSW,I/256,18:SYSW,IAND255,19,SYSW,85,31 :REM WRITE $55
- 40 I=16896: SYSW,I/256,18:SYSW,IAND255,19:SYSR,,31:RREGC1 :REM READ HERE
- 50 I=17152: SYSW,I/256,18:SYSW,IAND255,19:SYSR,,31:RREGC2 :REM AND HERE
- 60 I=16896: SYSW,I/256,18:SYSW,IAND255,19:SYSW,170,31 :REM WRITE $AA
- 70 I=16896: SYSW,I/256,18:SYSW,IAND255,19:SYSR,,31 RREGC3 :REM READ HERE
- 80 I=17152: SYSW,I/256,18:SYSW,IAND255,19:SYSR,,31 RREGC4 :REM AND HERE
- 90 POKEAD,28: POKEDA,S:SYSDEC("FF62") :REM RESTORE 16/64K
- 100 IF C1=C2 AND C3=C4 THEN PRINT "16K": ELSE PRINT"64K" :REM DID IT ECHO?
- 110 END
- 900 FORI=0TO13: READA$: POKEDEC("1800")+DEC(A$): NEXT
- 910 R=DEC("1800"): DATA 8E,00,D6,AD,01,D6,60 :LDA $D601:RTS
- 920 W=DEC("1800"): DATA 8E,00,D6,8D,01,D6,60 :LDA $D601:RTS
- 930 RETURN
- ------------
- Category 5, Topic 11
- Message 62 Sun Nov 27, 1994
- D.TUOMI [Doctor] at 21:25 EST
-
- I originally asked this question myself. The program I finally came up
- with (which was actually a hybrid of the various programs on-line was
- ) was this:
-
- 10 BANK 15:AD=DEC("D600"):DA=AD+1:R=DEC("1800"):W=DEC("1807")
- 20 FOR I=0 TO 13:READ A$:POKE R+I,DEC(A$):NEXT I
- 30 DATA 8E,00,D6,AD,01,D6,60,8E,00,D6,8D,01,D6,60
- 35 POKE AD,28:S=PEEK(DA):POKE DA,63
- 40 I=16896:WW=85:X=0:GOSUB 100:X=1:GOSUB 100:C1=X:I=17152:X=1:GOSUB100:C2=X
- 45 POKE AD,28:POKE DA,S:SYS ("FF62")
- 50 IF C1=C2 THEN PRINT "16K VDC":ELSE PRINT "64K VDC"
- 60 END
- 100 SYS W,I/256,18:SYS W,I AND 255,19
- 110 IF X THEN SYSR,,31:RREGX:RETURN:ELSE SYSW,WW,31:RETURN
-
- I hope I typed that in correctly. It should be if you have problems let
- me know. That's the routine I ended up using in my 128 menu program.
-
- Doc.
- ------------
- Category 5, Topic 11
- Message 63 Sat Dec 03, 1994
- J.THOMPSO122 [JIMBOB51] at 23:28 EST
-
- Maverick from Software support will do that. Plus they sell the memory board
- if you want to add on.
-
- Jimbob ;]
- ------------
- Category 5, Topic 11
- Message 64 Mon Dec 05, 1994
- E.GBELL [e.g.bell] at 18:07 EST
-
- For anyone who wants it, I fixed the file sent up to detect 16 or 64K
- VDC. I have never been able to get the ones I buffer to work. This one
- does, at least for me.... all of my machines are now 64K, and they detect
- it fine. Someone w/a 16K machine might want to give this a try to make
- sure that works too.
-
- 1 rem fred's nifty program to determine size of 8563 dram
- 5 w=dec("cdcc"):r=dec("cdda")
- 10 bank15: ad=dec("d600"): da=ad+1 :rem setup ml
- 20 pokead,28: s=peek(da): pokeda,63 :rem select 64k
- 30 i=16896: sysw,i/256,18:sysw,iand255,19:sysw,85,31 :rem write $55
- 40 i=16896: sysw,i/256,18:sysw,iand255,19:sysr,,31:rregc1 :rem read here
- 50 i=17152: sysw,i/256,18:sysw,iand255,19:sysr,,31:rregc2 :rem and here
- 60 i=16896: sysw,i/256,18:sysw,iand255,19:sysw,170,31 :rem write $aa
- 70 i=16896: sysw,i/256,18:sysw,iand255,19:sysr,,31:rregc3 :rem read here
- 80 i=17152: sysw,i/256,18:sysw,iand255,19:sysr,,31:rregc4 :rem and here
- 90 pokead,28: pokeda,s:sysdec("ff62") :rem restore 16/64k
- 95 print chr$(14)chr$(147)
- 100 if c1=c2 and c3=c4 then print "16K": else print"64K" :rem did it echo?
- 110 end
-
- You'll note that the data statements are gone. They poked a shortened
- form of the VDC pokes into memory. I just used existing ROM routines to
- do this, and an added plus are that these do the whole procedure.
- ------------
- Category 5, Topic 11
- Message 65 Sun Apr 02, 1995
- W.OVE at 14:36 EDT
-
- I am looking for the vector that is used for the reset of the computer when
- the reset button is pushed. I assume that this must be something in hardware
- that alway goes to the same place. I am hoping to modify a program that
- always restes back to itsefl when the button is pushed. I am hoping to get it
- to go back to basic. I would like to find the address it is going to so I
- could do a restart to the progrm with a syssys from basic.
-
- I am not sure this is clear to even me. I do hope someone follows what I am
- saying. Also is there a memory map or documentation in library files on Genie
- that would help whith these types of questions. The jargon of the macjhine and
- machine language programers is confusing. to the dabbler. Are vectors the same
- as pointers/? Is charout the name of a latin singer? thank you w.ove
- ------------
- Category 5, Topic 11
- Message 66 Sun Apr 02, 1995
- E.GBELL [e.g.bell] at 19:20 EDT
-
- Bill: Oddly enough, that is one of the questions that got me started
- learning ML. Of course, when I was starting, books were very easy to
- find and magazines were plentiful. I don't have an answer for you right
- off the top of my head, but I can answer some of what you ask....
-
- A vector is kind of like a pointer. Think of it like this.... your boss
- wants you to do something for him. He sends you to the mail room where you
- pick up the orders telling you what he wants done. He could have told you
- directly, but instead he sent you to the mail room. Here is the kick...
- when you go to the mail room to get your orders, they tell you to go back
- to the printer right outside the boss' office and get the memo there and
- deliver it to the dispatcher. That is kind of how vectors always struck
- me.... a machine language routine jumps through a vector, which is indeed
- a pointer, and in the case of the Commodore, the initial pointer points to
- the address immediately after the original jump. The benefit is that the
- vector is in RAM and can be changed by you or anyone... things can be
- 'wedged' in in that way..... new routines that do their stuff and then
- go where they were originally headed.
-
- The reset vector in the 1128 (and the 64 too I believe) is at $FFFC, which
- is RAM sort of... in that it is copied into all banks so that it can be
- accessed wherever the computer happens to be when the reset is pushed.
- However, there must be one master copy, and this is the one I think you
- would have problems with....
-
- You might be able to trick the program by wedging something into the
- NMI vector at 792 and 793 to point at address 16387 (I believe that is it)
- which is the basic warm start address. The pokes would be:
-
- poke 792,3 : poke 793,64
-
- If your program does not change the vectors, when you press the RESTORE
- key this should drop you gently into the BASIC editor at the READY prompt.
- No guarantees... just one of the things I'd try if I were working on
- it.
-
- CHAROUT, or CHROUT, which I prefer, just a commonly used label for the
- ROM routine that prints a character out to whatever channel (screen/printer/
- etc.) happens to be open. Might be a Latin singer too... not sure. :)
-
- By the way, my quest years ago was to do this on the 64 so that the
- reset key would just restart the program. There is a way to beat the
- reset key with a few pokes of specific characters at the right address
- and the address where you want the program to jump. Keep in mind that
- even knowing where the address is of the vector being used, you would still
- have to find out where it is loaded. :/
- ------------
- Category 5, Topic 11
- Message 67 Sun Apr 02, 1995
- D.TUOMI [Doctor] at 19:34 EDT
-
- One of the ways I know of to change the reset on the 64 is by fooling the
- computer into thinking there is a cartridge in the port. You do this by
- placing a set of characters in a particular location. Unfortunately, I do not
- have my notes here with me, so I can't tell you preceisly, but someone else
- might be able to jump in. Once the computer is fooled into thinking a
- cartridge is in place, it will try to run whatever is at location 32768 in
- memory. You can place your own program there to do whatever it is you want to
- do.
-
- Doc.
- ------------
- Category 5, Topic 11
- Message 68 Thu Apr 06, 1995
- W.OVE at 08:23 EDT
-
- Thank you for your replys. Actually the restore key serves a good function f
- in the prigram and so I don not wish to change it. I am looking to get the
- computer to set set (get the Commodore start up screen) when I push the reset
- button on the side of the computer. The program corrently just restarts
- itself when you push the button. It has a quit sequence, but if you go through
- that it washes the memory. If I could get a normal reset it would still be in
- memory and I could restart it with a sys. I was assuming that the computer
- have some location determined by hardware/rom that it must have to first got
- to to begin the restart sequence, and wass hoping that if the program is
- changing vector? pointer? that I could change it back to the stock one that I
- could get a normal restart of the computer by pushing the reset button.
- w.ove
- ------------
-
- Command: CATegories, TOPics, REAd, REPly
- BROwse, SETcat, EXIt, or HELp
-
-
- --------------------------------------
- End of Messages
- --------------------------------------
-