home *** CD-ROM | disk | FTP | other *** search
/ 8bitfiles.net/archives / archives.tar / archives / genie-commodore-file-library / Information / CAT5-940127A.SFX / 01cat5 < prev    next >
Encoding:
Text File  |  1990-02-12  |  33.5 KB  |  815 lines

  1.  
  2.  
  3. CBM-ED [e.g.bell]            (Forwarded) 
  4.  
  5.  I can add a couple of suggestions to yours JBEE. In your first line, with
  6.  the dsave, I always precede that with a scratch command and follow it with
  7.  a dverify command.  But after the REM, I put a quotation mark followed by
  8.  enough deletes to pull all but the command back to the start of the line
  9.  and delete the REM and the line number.  I usually include an 'x=08' or
  10.  something as the first statement on the line, and a ,u(x) after the 
  11.  'scratch', 'dsave', and 'dverify', so that I can easily change device 
  12.  numbers in all 3 commands with 1 or 2 keystrokes.  It usually works out
  13.  to about 8 deletes after the quotes.  *note* this will *NOT* work if your
  14.  filenames have upper case letters in them.
  15.  
  16.  I do something similar w/my routines, but I renumber them just before I 
  17.  save them to disk, then incorporate the first number into the file name.
  18.  For example, if I have a routine to display a directory, I might
  19.  renumber it starting with line 1000 in increments of 1 line number.  then
  20.  when I save the file, I'll call it     1000 directory.   I have a COMBINE
  21.  command built into my C128 chips, and use that to build up a foundation
  22.  of routines for new programs.  Just renumber when I'm finished.
  23.  Each routine on the 'routine disk'  starts with a different group of line 
  24.  numbers, which is why I can combine them w/o fear of overwriting anything,
  25.  and since I renumber in increments of 1, I have a *lot* of space to 
  26.  maneuver.
  27.  
  28.  
  29.  BTW, that inclusion of deletes can work for any line you use to clean things
  30.  up with after a test run.  I use one to restore the character set pointer
  31.  and one also with the FIND command, also in my C128 chipset.
  32.  
  33.  Your suggestion about the routines reminded me of the disk I have dedicated
  34.  to that purpose from TotalRecall that speeded up development of the support
  35.  programs.  It is a source of much of what I have entered into that Snippits
  36.  topic in Cat 21.
  37.  
  38.  ------------
  39. Category 5,  Topic 3
  40. Message 23        Fri Jul 24, 1992
  41. C128.JBEE [* Sysop *]        (Forwarded) 
  42.  
  43.  The only thing I don't like about scratching old files is sometimes I need
  44.  them :D  Also, I keep a time and date log of all the files created both for
  45.  development, legal, and accounting purposes.  So it literally doesn't pay
  46.  for me to scratch them :)
  47.  Of course if you are using a 1541/71 and saving 140+ block files every
  48.  ten minutes scratching the old ones will probably save a ton of disk space.
  49.  Even at $0.25 a piece you could go through some dollars fast :)
  50.  
  51.  The combine command sounds pretty interesting, did you burn your own
  52.  routine into a ROM?
  53.  ------------
  54. Category 5,  Topic 3
  55. Message 24        Fri Jul 24, 1992
  56. HOWIE-CBM                    (Forwarded) 
  57.  
  58.  JBEE,
  59.  
  60.  The Basic program listing, and structure is terrific!  You have several 
  61.  features that I will now incorporate into my template for use with new 
  62.  projects.
  63.  
  64.  They all seem so easy to implement.  I don't know why I never thought of 
  65.  them.   Very helpful info!  :)
  66.  
  67.  Howie
  68.  ------------
  69. Category 5,  Topic 3
  70. Message 25        Fri Jul 24, 1992
  71. HOWIE-CBM                    (Forwarded) 
  72.  
  73.  Ed,
  74.  
  75.  Yes!  Tell us more about your custom chips!!  And especially COMBINE.  :)
  76.  
  77.  For short combines, I've used that ole:  LIST, LOAD, and enter <CR>'s.
  78.  
  79.  For big combines, and where something gets inserted into the middle of
  80.  something else, BTP's buffer.  :)
  81.  
  82.  Howie
  83.  ------------
  84. Category 5,  Topic 3
  85. Message 26        Fri Jul 24, 1992
  86. CBM-ED [e.g.bell]            (Forwarded) 
  87.  
  88. John:  get ready to blush.  The COMBINE command in my C128 is indeed from a
  89. set of custom chips from Free Spirit, a ROM replacement that I was sold on
  90. when I read the review many years ago in TC128.  Course, you were not the
  91. publisher then.  The chips also have a FIND, CHANGE, and MERGE.   The MERGE
  92. gets a little flakey sometimes, not sure why.  I have a Super Chip (ha!) from
  93. I forget who that is really a piece of garbage. Anyway, the COMBINE function
  94. just appends programs to the end of whatever program is in memory.  Then I
  95. just renumber the file.  It's great.  as a matter of fact, I use FIND and
  96. CHANGE so much, I don't think I'll get  JIFFY DOS any time soon cuz I would
  97. lose that in their chip upgrade.  The chipset also fixes some bugs like the
  98. shift-q, and I believe the relative coordinates in the graphics commands. 
  99. There are other commands I have  long since forgotten because I don't use
  100. them.   I think there is also a numeric base conversion function but since I
  101. have that in the BASIC  language, the MLM, and probably my Mach 128, I"m not
  102. sure about that.  I believe there is also a nice set of FKEY definitions,but
  103. there is some  contention among chips in my C128 so I"m not sure which chipset
  104. has the priority in that regard.  Know the ones I like are not the ones I
  105. have,  but it is a nice chip set.  At $50, it was not cheap though, and I
  106. don't know if it is still available, but for the FIND and CHANGE alone, it was
  107. worth every penny!
  108.  ------------
  109. Category 5,  Topic 3
  110. Message 27        Sat Jul 25, 1992
  111. C128.JBEE [* Sysop *]        (Forwarded) 
  112.  
  113.  Yea, I remember that review ;)
  114.  ------------
  115. Category 5,  Topic 3
  116. Message 28        Sat Jul 25, 1992
  117. M.MCCORMIC10 [Mike Mc-]      (Forwarded) 
  118.  
  119. I have uploaded the genealogy prigram that we are discussing and started a
  120. topic for it in Cat.3,Topic #27.
  121.  
  122. The files are #'s 9900,9901,9902,9903,9904,9905. All are SDA.
  123.  
  124. Mike Mc-
  125.  ------------
  126. Category 5,  Topic 3
  127. Message 29        Sun Jul 26, 1992
  128. CBM-ED [e.g.bell]            (Forwarded) 
  129.  
  130. I grabbed them yesterday Mike.  They dissolved ok, but file 3, I believe, has
  131. a couple of duplicate files at least.  I started over on a separate  disk
  132. after 2 failures for that reason.  The filenames as uploaded don't  reflect
  133. the fact that they are SDA's either, for general info.  I didn't have time to
  134. run the prgs, and will now have to move them around on disks first.  >>sigh<<
  135. but this is a *massive* program in terms of support file count, etc.  Can you
  136. give me some kind of idea what files I  *need* to run the prog and duplicate
  137. the problem.  I'd rather not have to deal with all of those files if I don't
  138. have to.
  139.  ------------
  140. Category 5,  Topic 3
  141. Message 30        Sat Oct 31, 1992
  142. M.MCCORMIC10 [Mike Mc-]      at 07:29 EST
  143.  
  144. Ed-
  145.  
  146. I didn't realize that you had also answered my question in this topic.You can
  147. eliminate; overlay,notewriter,and files that have those names.
  148.  
  149. I will repeat the problem.This program will do all that I ask "EXCEPT"create a
  150. record or chart for  the irst great grandfather person # 8. That is where I
  151. get "string to long"error.All the great grandparents work fine. Could there be
  152. a missing module?
  153.  
  154. This is everything that I have.
  155.  
  156. Mike Mc-
  157.  ------------
  158. Category 5,  Topic 3
  159. Message 31        Sat Oct 31, 1992
  160. CBM-ED [e.g.bell]            at 08:53 EST
  161.  
  162. I just posted a  long answer to your other post, Mike.  See my post and  then
  163. we can go from there.  I have to dig up my copies of all those  files.  When
  164. dissolving them, I found at least 1 or 2 duplicate files in different archives
  165. and was never sure if they were different, or what. Also, this puts another
  166. thing into the equation.  Your data.  Could you drop a copy of what you are
  167. entering here or in my mailbox (CBM-ED) so I can enter things exactly as you
  168. are entering them.  I may or may not be able to duplicate your results if I am
  169. not using the same data.  But let me see what I can do... and give me every
  170. detail of what you have done. I've never used a genealogy program so I am
  171. starting from square one on  every front.
  172.  
  173.  ------------
  174. Category 5,  Topic 3
  175. Message 33        Tue Jan 19, 1993
  176. R.KNOP1 [Rob Knop]           at 00:43 EST
  177.  
  178. I echo Bruce's sentiment that the Hacking Magazine is a good place to see
  179. source code.  Some of the articles there are pretty technical, and useful even
  180. for folks who are old hands at ML.  Recently, the editor, Craig Taylor,
  181. started up a series where he's writing a "Space Invasion" game, which looks
  182. like it could be very useful for someone who knows the basics of ML but is
  183. unsure how to do anything with it.
  184.  
  185. Another good place for source code with explanations are the old Transactor
  186. magazines!
  187.  
  188. -Rob
  189.  ------------
  190. Category 5,  Topic 3
  191. Message 34        Sun Jun 06, 1993
  192. GULLIBLE [Jon]               at 16:53 EDT
  193.  
  194. Can't think of a better place to put this...
  195.  
  196. I'm working on a sequel to my PI DEMO. A demo which has the first 18,000
  197. digits of PI in the scroll.
  198.  
  199. I now have a file listing the first 1.25 Million digits of PI and I would like
  200. to come up with a compression method that will let me put as many digits
  201. possible in available memory...probably about 40K.
  202.  
  203. So far, the best I can get is a 2.4:1 compress ratio. It works like this:
  204.  Take the sequence:
  205.  123456789012
  206.  123 = 0001111011
  207.  456 = 0111001000
  208.  789 = 1100010101
  209.  012 = 0000001100
  210.  These 40 bits equal 5 bytes:
  211.  00011110 11011100 10001100 01010100 00001100
  212.  Thus, 12 digits in 5 bytes or 2.4:1
  213.  
  214. Can anyone think of a better compression method? The reason I ask is that 0-9
  215. is only 10 different characters and there are 256 in a byte. 25:1???
  216.  
  217. I know this is a weird request... :) But, I'd appreciate any help or
  218. suggestions. Thanks.
  219.  ------------
  220. Category 5,  Topic 3
  221. Message 35        Sun Jun 13, 1993
  222. C128.JBEE                    at 09:01 EDT
  223.  
  224.  Gullible,
  225.  I have been thinking this over and believe I have found a solution, short
  226.  of compression, that might work, especially with a series of numbers such
  227.  as PI.  Which is special in the way the numbers are (not;) sequenced.
  228.  
  229.  It takes 3 bits to represent a digit 0-9, but how about representing the
  230.  difference from one digit to another instead of using a trinary solution?
  231.  
  232.  Example:
  233.  Start the data flow with the first number
  234.  then start reading everything in according to bits
  235.  
  236.  If the first bit is zero it means to use the next bit to add or subtract
  237.  1 from the number in the A,X, or Y register.  Then display that number.
  238.  
  239.  0000 0000 -> first bit=0 so use the next bit to determine if you should
  240.               add or subtract, it is zero so subtract -1 from the A reg
  241.  
  242.  0000 0010 -> first bit=0 so use the next bit to determine if you should
  243.               add or subtract, it is one so add +1 to the A reg
  244.  
  245.  If you have a zero following the nine you would add one but write a zero
  246.  to the register.  So you would have to sacrifice speed for compression by
  247.  doing comparisons to a table of rules that says if A is greater than nine
  248.  (CMP) then A = 0
  249.  
  250.  If you have a sequence of numbers such as 4345 that would require 12 bits
  251.  at least but using this method only 8 bits!
  252.  
  253.  Now what happens if the first bit encountered is a 1?  Then use the
  254.  next three bits to branch to a table that keeps spliting the table of
  255.  remaining numbers in half.  01x3x56789
  256.  
  257.                           0135 6789
  258.  
  259.                            Bit #2
  260.                            true false
  261.                            0135 6789
  262.                          /         /
  263.                  Bit #3 =1         Bit #3 =0
  264.                  true false        true false
  265.                  01   35           67     89
  266.                 /   /             /       /
  267.        Bit #4 =1   Bit #4 =0   Bit #4=1   Bit#4
  268.        true false  true false  true false true flase
  269.        0     1     3    5      6    7     8    9
  270.  
  271.  
  272.  The only draw back is the size of the table vs compression gained and the
  273.  logic needed to keep track of where you are in the current byte (bit
  274.  wise).  I am not even sure it would compress the file better than using
  275.  your method.  But this is all I could think of taking into account the
  276.  way PI is represented and not knowing the odds of a digit having or not
  277.  having a number lower or higher than it, following it.  Though I am sure
  278.  the occurance of such is probably high.  Hey, that in itself would make
  279.  an interesting project :)
  280.  ------------
  281. Category 5,  Topic 3
  282. Message 36        Sun Jun 13, 1993
  283. GULLIBLE [Jon]               at 15:58 EDT
  284.  
  285. Thanks for the response. I hadn't thought about using a difference method. I
  286. am a bit confused as to how 4345 can be represented as 8 bits. If you have two
  287. bits that say subtract 1, then how do you know if those two bits mean subtract
  288. one or are the first two bits of a 3-4 bit sequence?
  289.  
  290. I will look over your post in greater detail. I do believe that using math
  291. will yield the best results. 
  292.  ------------
  293. Category 5,  Topic 3
  294. Message 37        Sun Jun 13, 1993
  295. C128.JBEE                    at 23:17 EDT
  296.  
  297.  If the first bit is unset (0), you know you are going to add or subtract
  298.  with the bit following it.  If the following bit is set you add one,
  299.  if it is unset (0) you subtract one.
  300.  
  301.  So a sequence of numbers such as 4345 (remember we started with a number
  302.  three) only requires two bits per digit because we are representing the
  303.  change, not the digit.  Since the sequence 4 3 4 5
  304.                                                
  305.                                 up one  ____   ___  up one
  306.                               down one  ______ ______ up one
  307.  
  308.  looks like that it would be represented in binary as
  309.  10100010
  310.  ----(4 up one)
  311.     (3 down one)
  312.    (4 up one)
  313.   (5 up one)
  314.  
  315.  8 bits!
  316.  
  317.  You use the first bit to determine if you are going to be using two bits
  318.  or four bits to determine the next number.  So you will always have at
  319.  least a 2x compression over the storing of just the numbers is ASCII
  320.  form.
  321.  ------------
  322. Category 5,  Topic 3
  323. Message 38        Wed Aug 25, 1993
  324. T.RUTTER2 [Troy Rutter]      at 19:17 EDT
  325.  
  326. Hi again people, well, its time to jump on the bandwagon and TRY (crossing
  327. fingers)  to finish my SIDplayer.  As many of you have followed through the
  328. Ultrasid Player topic under Sight & Sound, my SID player plays the individual
  329. parts of the sid archives, msw, pil, wpl, sal, slr, etc... without having to
  330. dissolve them.  The only thing holding me back is the words display.  Right
  331. now the conversion time from in memory to display is awfully sloooooooow. 
  332. Heres the scoop:
  333.  
  334. For some odd reason, the creators of Singalong songs (Kermit and Joe I think?)
  335. decided to store the word files in standard ASCII instead of PETSCII.  So...
  336. heres what happens in my program as it stands now. (Simplified of course)  Im
  337. doing this as a basic source around ML subroutine... so bear with me...
  338.  
  339. get location of words file, assign this to variable: WD
  340.  create array wd$
  341.  get character from memory
  342.         compare - does it need to be converted?
  343.         If so, convert
  344.         If not, store as is in WD$(x)
  345.  if peek(wd)=carraige return then x=x+1:go start over
  346.  if peek(wd)=0 then start music, start wds display.
  347.  
  348. This takes forever.  I have also tried two other ways:  1)  The "Index table"
  349. as it is referred to by ML experts.  This works... but still bothers me...
  350. slow, plus i have no idea what im doing.  2) Display without storing in wd$. 
  351. This is faster, but it is not guaranteed to display fast enough to keep in
  352. time with the mus flags.
  353.  
  354. If anybody can take a look at some SID player source code and help me out, i
  355. would appreciate being enlightened on how to display the words.  It seems like
  356. most sidplayers do some kind of banking so its automatic.   I dunno.  I have
  357. the source and object code in PAL (i think) of sidpic 3.4 if that would help. 
  358. I REALLY want to get this sucker done before the next SID-Fest.
  359.  
  360. Thanks,
  361.  Troy
  362.  
  363.  ------------
  364. Category 5,  Topic 3
  365. Message 39        Wed Aug 25, 1993
  366. CBM-ED [e.g.bell]            at 21:26 EDT
  367.  
  368.  Troy:
  369.   TR> I have also tried two other ways:  1)  The "Index table" as it
  370.   TR> is referred to by ML experts.  This works... but still bothers
  371.   TR> me... slow, plus i have no idea what im doing.  2) Display
  372.   TR> without storing in wd$. 
  373.  
  374.  If you are insistent on doing this display in BASIC, the 'Index Table'
  375.  is the fastest possible if done correctly.  What you are doing is
  376.  creating a lookup table for conversion from ASCII to PETSCII.  You use
  377.  the numeric value of the ASCII character as an index into the table,
  378.  which eliminates all IF statements, the REAL time hogs in a BASIC 
  379.  program, from the equation entirely.
  380.  
  381.  I would recommend doing the whole operation in ML,  which would 
  382.  assure the needed speed, and if you shelled to it from BASIC, you would
  383.  still be in control of the timing of the display.  An added plus is 
  384.  that it would take far less memory to do in ML than it would in BASIC,
  385.  particularly when you consider the elimination of the arrays, another
  386.  BASIC time hog.
  387.  
  388.   TR> If anybody can take a look at some SID player source code and
  389.   TR> help me out, i would appreciate being enlightened on how to
  390.   TR> display the words.  It seems like most sidplayers do some kind
  391.   TR> of banking so its automatic.   I dunno.  I have the source and
  392.   TR> object code in PAL (i think) of sidpic 3.4
  393.  
  394.  I will be happy to do that for the opportunity to get hold of the 
  395.  sid player source code.  What you are requesting seems to me to be
  396.  an extremely easy thing to do.  However, when is the SID-Fest.  I will
  397.  have to get your source code quickly to get it done for you because
  398.  I am leaving for vacation tomorrow night.  On the upside, I can't 
  399.  imagine what you want taking any more than about 5 minutes to code
  400.  once I have the source code.  If you can't work with this time-frame,
  401.  I hope you will still share the SID Player source code, which I've been
  402.  looking for for a long time.  I'm not planning anything that would 
  403.  'compete' with your work, and not for the C64 at all. But how does all
  404.  of this sound?  I already have the lookup-tables in files from other 
  405.  programs....  You get the code uploaded tonight I may be able to have
  406.  your solution first thing in the morning when I get home from work.
  407.  
  408.  (The above assumes we are talkingML source code, tho your mention of
  409.  PAL format pretty much indicates that)
  410.  ------------
  411. Category 5,  Topic 3
  412. Message 40        Wed Aug 25, 1993
  413. R.KNOP1 [Rob Knop]           at 22:25 EDT
  414.  
  415. 5-3
  416.  
  417. Troy- what exactly is done in the "compare" step where you decide if the
  418. string needs to be converted?  Is this something that detects whether the
  419. string is PETSCII or ASCII, or is it done on a character-by-character basis?
  420.  
  421. One thing that will help is to write a short ML subroutine to do your
  422. conversion for you... this will tend to make things faster.  Once in ML, my
  423. favorite way to do these things it the "Index Table" method.  Basically, you
  424. need to build a 256 byte table.  Let AV be the ASCII value (known) of the
  425. character, and PV be the PETSCII value (desired) of the character.  Then, the
  426. AV'th byte in the table is PV, assuming a properly built table.  In other
  427. words:
  428.  
  429.   ldx   #AV   ; or wherever you find the ASCII value, put that in .X
  430.   lda   table,x
  431.  
  432. At this point, .A will hold the PETSCII value, and you can stick it wherever
  433. you want it.
  434.  
  435. -Rob
  436.  ------------
  437. Category 5,  Topic 3
  438. Message 41        Wed Aug 25, 1993
  439. T.RUTTER2 [Troy Rutter]      at 22:37 EDT
  440.  
  441. Ed:
  442.  
  443. Sounds great, except for one small detail.  When Kermit made his source code
  444. available for SIDpic, he left the following in the file description:
  445.  
  446. "This code requires the use of Craug Chamberlain Sidplayer M/L (version one)
  447. that was especially modified to work with my player.  If you want to work on
  448. this and add more to my player, I cannot help you beyond providing this code
  449. abd pointing you to the M/L attached to SIDPIC V3.5 - I cannot distribute
  450. Craig's M/L as it might offend him.  If you want it though, you CAN figure out
  451. from my Source Code where his M/L loads into, and take it out of SIDPIC V3.5."
  452.  
  453. So, the actual ML that PLAYS the music is still in executable form only.  I
  454. would still appreciate it, however, if you took a look at the source code.
  455. Especially routines such as:
  456.  
  457. frommem
  458.  convert
  459.  
  460. and etc.
  461.  
  462.  
  463. PS.. the SIDfest is not until 1994.
  464.  -Troy
  465.  ------------
  466. Category 5,  Topic 3
  467. Message 42        Wed Aug 25, 1993
  468. C128.JBEE                    at 22:48 EDT
  469.  
  470.  Since I have the exclusive rights to the book, I do not mind the passing of
  471.  the code back and forth if it means getting something accomplished that
  472.  will increase the sales of the book.
  473.  ------------
  474. Category 5,  Topic 3
  475. Message 43        Thu Aug 26, 1993
  476. CBM-ED [e.g.bell]            at 10:00 EDT
  477.  
  478.  Does that mean, John, that you do have the source code for the SID
  479.  player?  ;)
  480.  
  481.  Troy:  I looked at the source code you sent me today, and I can honestly
  482.  say I can't understand why Kermit made such an extensive use of the 
  483.  .bas pseudo-op in PAL!  It is confusing reading, but I did find something
  484.  you should find interesting.  The routines you want to convert and
  485.  print the word strings seem to me to already exist in the code.  The
  486.  pertinent routine is FROMMEM in line 352.  It first calls the routine
  487.  called ROUTINE, which moves the variable pointers for I presume A1$ 
  488.  into the variables at $8c-$8e.  These are used as pointers and general
  489.  information into the string.  Note the definition of A1$ in line 11.
  490.  This seems to me to be defining the string in memory for use by the
  491.  FROMMEM routine.  It receives the string data when you call FROMMEM from
  492.  the BASIC routine.  Note particularly lines 161-175 (esp. lines 166-175).
  493.  If you study this routine, you should be able to either use it or see
  494.  how it is used.  It seems to me to do exactly what you want done tho,
  495.  and in ml to boot.  The routine CONVERT at line 410 in your source
  496.  file is a conversion routine.  I did not study it closely, but based
  497.  on what you say, I assume it converts A1$ data to the proper format.
  498.  It makes this change to the string directly.
  499.  
  500.  Without running this, the code seems to me to:
  501.  
  502.  set the word address in lne 168, poking the low and high bytes into
  503.  113 and 114  ($71/$72 used in FROMMEM)  I'm not sure what line 166 is
  504.  doing, but I bet it is turning something off, probably an interrupt (I
  505.  just checked... that is exactly what it is doing. See line 833)
  506.  167 is also assigning LA the value held in .x(low) and .y(high).
  507.  Line 169 calls FROMME, which loads the next string into A1$, and then
  508.  puts the length of that string into A.  Line 170 puts the string into
  509.  t$, necessary since you NEVER want to mess with A1$ or you would goof
  510.  it up as far as length!!!!  It assigns it the value of left$(a1$,a)
  511.  which pares it down to its actual length.  Line 171 apparently sets up
  512.  the pointer for the next string an also stores that in WA. Line 172
  513.  sets up the FROMMEM routine again, and line 173 calls it, doing as 
  514.  described above.  Line 174 converts a1$ for printing and stores it into
  515.  w2$ and updates the address pointer.  At this point, I don't know what
  516.  the difference is between t$ and w$, but you could find that out by
  517.  doing run-time displays (after reassembling the program with the
  518.  appropriate instructions) to see what is in them with each iteration
  519.  of the routine.  Bottom line is that the routines you need are already
  520.  written and available for your use.  Give them a try and see if I'm not
  521.  right.  
  522.  
  523.  Now, do you have access to Kermit Woodall?  I contacted him YEARS ago
  524.  about using Wxmodem in BellTerm,tho I never did.  I don't have his 
  525.  address even if I did have a presence of mind with him.  Based on what
  526.  John said about the book rights, it seems you have a basis for asking
  527.  for Craig's player source code if you are willing and have that kind
  528.  of access to him, and I would consider it a personal favor if you did!
  529.  egb
  530.  ------------
  531. Category 5,  Topic 3
  532. Message 44        Sat Aug 28, 1993
  533. T.RUTTER2 [Troy Rutter]      at 13:46 EDT
  534.  
  535. Ed, all,
  536.  
  537. unfortunately, I have tried to use those subroutines in my programs and it
  538. locks up...  i think it is bad memory management... here is what I have:
  539.  
  540. Main basic program:  7169-10026
  541.  ML (frommem,routine,convert) 12288-12378
  542.  SID files load in at 15000
  543.  sid routine:  49152-53152
  544.  
  545. And it locks up after i use modlink to put them all in one file.  Im wondering
  546. if modlink iteself uses some of that memory in there.
  547.  
  548. Also, i wonder why the basic program loads at 7169... isnt it sposed to load
  549. at 2048 or something?
  550.  
  551. BTW.. modlink = Modlink by Robert Stoerelle (MALAKAI)
  552.  
  553. Any idears?
  554.  
  555.  ------------
  556. Category 5,  Topic 3
  557. Message 45        Sat Aug 28, 1993
  558. C.DRUTIS [Monsoon]           at 23:15 EDT
  559.  
  560. Greetings. This seems as good a place to ask as any...
  561.  
  562. Could someone tell me if it's possible to run an ML subroutine within Bank 1?
  563.  
  564.   I want to put a text editor within Bank 1, but no matter what I do with the
  565. MMU register or the PCR's, the program refuses to work properly (or at all)
  566. within Bank 1. It works fine when I load it in Bank 0, though.
  567.  
  568.    For Bank 1, I begin with the following code:
  569.  
  570.      LDA #$4E   ; corresponds to %01001110 which SHOULD be : Bank 1 RAM
  571.      STA $D500  ;                                         Kernal and IO
  572.      .
  573.      .
  574.      .
  575.      STA $FF00
  576.  
  577.     Of course when I use it in Bank 0 I use LDA #$0E.
  578.  
  579.     Any help would be apprecitated.
  580.  
  581. [Apptest 0000321.A]
  582.  
  583.  ------------
  584. Category 5,  Topic 3
  585. Message 46        Sun Aug 29, 1993
  586. J.JONES36 [LOADSTAR]         at 00:09 EDT
  587.  
  588. YOu could try STARLINKER, on LOADSTAR #105.  It can link up to 140 blocks
  589. worth of BASIC and ML.  Just remember that with SL, your program MUST have a
  590. CLR before any variables are declared.  The trouble you're facing though
  591. really isn't because of MODLINK.  I see this as I'm typing.  MODLINK and
  592. STARLINKER are meant for BASIC prgs that run from $0801.  Your BASIC PRG is
  593. running from around $1800. Here's what you do:
  594.  
  595. Turn off your computer for a few secs.  This clears memory in case you're
  596. going to crunch the resulting program.  Turn it on and write a one liner at
  597. $0801
  598.  
  599. 10 POKE44,HI:POKE43,LO:POKE HI*256,0:RUN
  600.  
  601. Where HI is the HI byte of your program's location and LO is the Low byte. 
  602. DON'T RUN IT YET! Now type:
  603.  
  604. LOAD "YourProgram",8,1
  605.  
  606. Your program MUST have been saved from where it runs, not only for proper LOAD
  607. address, but for line links.
  608.  
  609. If you have JiffyDOS, DON'T use the %filename substitution since this won't
  610. set SOV pointers.
  611.  
  612. Now type:
  613.  
  614. SAVE"combo",8
  615.  
  616. This will SAVE the one liner you just typed in, a big gap of nothingness, then
  617. your program at $1800.  When RUN, this program will switch control to the
  618. program at $1800 and RUN it.  THIS file will link properly with MODLINK or
  619. STAR LINKER.  You can include any ML or graphics data between these areas, but
  620. LOAD the highest data last.
  621.  
  622. If you have font data at $800, use a monitor to load the fon, then the one
  623. line program, then your BASIC program, then save them all in one file.  Your
  624. BASIC program will have to restore the 8-16 bytes of corrupted font data when
  625. it's first RUN.  Or you can just have some ML copy an entire font from
  626. elsewhere.
  627.  
  628. I link at least two programs per month. Usually they run at $1000.  I have no
  629. prob.
  630.  ------------
  631. Category 5,  Topic 3
  632. Message 47        Sun Aug 29, 1993
  633. C128.JBEE                    at 00:43 EDT
  634.  
  635.  It sounds like a Basic 7.0 shell (C-128) using the original SID ML (C-64).
  636.  ------------
  637. Category 5,  Topic 3
  638. Message 48        Sun Aug 29, 1993
  639. R.KNOP1 [Rob Knop]           at 00:43 EDT
  640.  
  641. Troy-
  642.  
  643. I don't think you want to link these various sections into one file.  It looks
  644. like there are gaps between where the various sectios want to go.  I don't
  645. know how this linker works, but if it just links the files together into one
  646. program, the resulting program will load sequentially in memory starting at
  647. the load address, not putting the various parts where they ought to go.
  648.  
  649. If modlinker takes care of this, somebody please correct me....
  650.  
  651. Re: the starting address, the usual start for BASIC programs is indeed 2049.
  652. It sounds like the code was moved up for a relocated start-of-BASIC (e.g. to
  653. make room below the start of BASIC for a custom character set, a trick I used
  654. to use way back when).
  655.  
  656. How do you want this program to function after it has been linked?
  657.  
  658. -Rob
  659.  ------------
  660. Category 5,  Topic 3
  661. Message 49        Sun Aug 29, 1993
  662. R.KNOP1 [Rob Knop]           at 00:44 EDT
  663.  
  664. Monsoon-
  665.  
  666. I assume that you are issuing a "BANK 1" command before loading the ML program
  667. and SYS'ing to the address?  If not, then there's the simple answer :D
  668.  
  669. What are you calling in the way of BASIC and KERNAL subroutines?  I am not
  670. sure, but I believe it possible that some of the Kernal subroutines may only
  671. return to bank 15, or at any rate a configuration with RAM 0 rather than RAM 1
  672. visible.  Hopefully, and probably, this is not the case, and the Kernal
  673. routines are friendly, but it is possible.  It is more likely with some of the
  674. BASIC routines.  It's been years since I've directlly called any BASIC or
  675. KERNAL routines from RAM 1, and the only reason I did that was because I was
  676. doing it from within GEOS, and in GEOS it is usually not necessary to directly
  677. call BASIC or the Kernal.
  678.  
  679. Any idea just where the code is dying?  What is the manner in which it dies?
  680.  
  681. Ideally, ML things should work in RAM 1 just as they do in RAM 0.
  682.  
  683. Curious, why are you locating the program in RAM 1 as opposed to RAM 0?
  684.  
  685. -Rob
  686.  ------------
  687. Category 5,  Topic 3
  688. Message 50        Sun Aug 29, 1993
  689. R.KNOP1 [Rob Knop]           at 00:45 EDT
  690.  
  691. Aha!  JBEE posted that even as I was composing my reply, but yes, that load
  692. address is the standard start of BASIC for the 128, so it may be the BASIC
  693. program was intended to run on the 128.
  694.  
  695. -Rob
  696.  ------------
  697. Category 5,  Topic 3
  698. Message 51        Sun Aug 29, 1993
  699. C.DRUTIS [Monsoon]           at 04:09 EDT
  700.  
  701. Rob,
  702.  
  703.    Yes, I've issued a BANK1 command when I've tried to start if from Basic.
  704. I've also issued a G10400 (it resides at $400 in Bank 1) from the monitor.
  705.  
  706.    It doesn't crash... it simply stalls. In other words nothing happens. The
  707. computer doesn't lock up because it responds to a RS/Restore. This is why I'm
  708. puzzled. If it couldn't reach the kernal from Bank 1, it would (or should)
  709. break and drop to the monitor.
  710.  
  711.    I'm beginning to suspect that the kernal and the 128's editor wasn't
  712. designed to interact with Bank 1. I was kinda hoping someone had successfully
  713. written a program that uses them from Bank 1. Thanks anyway.  :)
  714.  
  715.    Oh... I want to put it in Bank 1 because of memory constraints in Bank 0. I
  716. also don't want to rewrite the entire thing using INDFET and INDSTA and the
  717. like. Call it laziness. <g>
  718.  
  719. [Apptest  00324.A]
  720.  
  721.  ------------
  722. Category 5,  Topic 3
  723. Message 52        Mon Aug 30, 1993
  724. R.KNOP1 [Rob Knop]           at 01:08 EDT
  725.  
  726. Monsoon- re: putting code in Bank 1 because of memory constraints, actually,
  727. this is a reasonable thing to do.  Speed constraints would be another good
  728. reason; if you are writing (say) a text editor that keeps its text in BANK 1,
  729. it might be advantageous to write short "memory moving" routines in bank 1,
  730. which would save several cycles for each lda and sta as compared to INDSTA and
  731. INDFET.
  732.  
  733. One other little obvious thing to check: how have you set the MMU register for
  734. common memory?  If you haven't messed with it, $400 should be fine. Also, are
  735. you using this program at all with BASIC?  If so, have you moved up the
  736. pointers for the bottom of variable memory?
  737.  
  738. Re: 128's OS interacting with Bank 1, in my experience the monitor works
  739. beautifully with Bank 1, no problem there.  Again, I am not sure about the
  740. Kernal.
  741.  
  742. One thing that might be worth trying: setting break points.  You can do this
  743. manually, by replacing instructions with BRK instructions.  Put these varying
  744. distances into your code, and if, when you execute the code, the program
  745. breaks out to the monitor from one of these, you know that the code is at
  746. least getting that far.  Another option would be to check out HEXPERT, which
  747. is a simple ML debugger that lets you set breakpoints and step through code. I
  748. am not sure that Hexpert will work with code in Bank 1, since (again) I
  749. haven't tried it, but it's probably worth looking at.
  750.  
  751. -Rob
  752.  ------------
  753. Category 5,  Topic 3
  754. Message 53        Mon Aug 30, 1993
  755. C.DRUTIS [Monsoon]           at 04:09 EDT
  756.  
  757.  
  758.   Rob,
  759.  
  760.   Yes, yes, no, yes. :) Did that. The monitor resides in RAM-0. I've used
  761. Hexpert. I've also set break points.
  762.  
  763.   The program actually WORKS in bank 1, but it doesn't seem to interact with
  764. some of the Kernal routines (GETIN and BSOUT for ex.).
  765.  
  766.   Yet, I HAVE found a kludgy work-around. What I did was move the program down
  767. to $1000 in Bank 1 (or, as you say, RAM-1 ), I then shifted Common Ram to 4k.
  768. I found a few spare bytes in that 4k and put in three subroutines that did the
  769. actual JSRs to the Kernal routines. Then I JSR to those routines from the
  770. program in place of the original Kernal calls. Seems to work.
  771.  
  772.    BTW, after much searching, I did find a couple of references to RAM 1 not
  773. working with the Kernal. On page 414 of the 128-PRG it says that you must be
  774. in RAM-0 (with I/O and high ROM). And on page 403 it states that you should
  775. invoke configurations 12, 13, 14 or 15; all of which use RAM-0.
  776.  
  777.    Thanks for your help. :)
  778.  
  779. [Apptest 00334.A]
  780.  
  781.  ------------
  782. Category 5,  Topic 3
  783. Message 54        Tue Aug 31, 1993
  784. R.KNOP1 [Rob Knop]           at 01:34 EDT
  785.  
  786. One thing you can do is use JSRFAR (or eqivalent) to call the Kernal routines-
  787. all it takes is changing one byte in the RAM routine to return to another
  788. configuration other than bank 15.  Myself, I don't really like JSRFAR (too
  789. much of a pain to use), so I brewed up something else that I call "JSROB"
  790. which is very much like what you describe doing with your "switchboard"
  791. routines in the 4K of common RAM- the main difference being that I put JSROB
  792. in zero page (obviously, this won't work if you want to use BASIC with the
  793. program). This requires less setup than JSRFAR, saves and restores the
  794. registers itself, and returns to the bank from whence it was called. IMHO such
  795. an entity is a better and safer way to call Kernal routines from Bank 1 than
  796. changing the return configuration of JSRFAR.
  797.  
  798. If anybody is interested I could post the routine here (it's short).
  799.  
  800. Re: terminology, I use RAM-0 and RAM-1 to refer to the RAM blocks in the 128,
  801. and Bank n to refer to the 128 standard memory configuration number n.
  802. Although bank 0 and bank 1 are (roughly) the same is RAM-0 and RAM-1, this way
  803. I avoid confusing myself when I start talking about bank 0 RAM being visible
  804. in bank 15 and such things.
  805.  
  806. -Rob
  807.  ------------
  808. Category 5,  Topic 3
  809. Message 55        Thu Sep 02, 1993
  810. T.RUTTER2 [Troy Rutter]      at 21:18 EDT
  811.  
  812. Indeed, Modlink thorws the files where they are supposed to be when it runs.
  813.  
  814. As for moving basic up...  I do use that trick... but later in the program.
  815.