Jump to content

Photo

trying to modify un-listable BASIC file (timewise)


21 replies to this topic

#1 hloberg OFFLINE  

hloberg

    Moonsweeper

  • 350 posts
  • Location:Dallas, Texas. Down the street from TI.

Posted Sun Feb 5, 2012 9:06 PM

Atari Timewise program is a time management program. It is written in BASIC. Problem is that it doesn't recognize date above 1999. I would like to fix the problem but the file is un-listable and in a hidden directory.
I don't want to spend too much time on this project but is there a way to list a unlistable file to fix the program?
Attached is the file if anyone is curious.
thanks, HLO

Attached Files



#2 rdea6 OFFLINE  

rdea6

    Stargunner

  • 1,650 posts
  • Location:Arizona USA

Posted Mon Feb 6, 2012 1:39 AM

Atari Timewise program is a time management program. It is written in BASIC. Problem is that it doesn't recognize date above 1999. I would like to fix the problem but the file is un-listable and in a hidden directory.
I don't want to spend too much time on this project but is there a way to list a unlistable file to fix the program?
Attached is the file if anyone is curious.
thanks, HLO

I don't know about getting it to run properly, but I got the listing.


Attached File  CAL.BAS   16.02KB   56 downloads

this next one is the listed version, but named CAListed.BAS only so I could upload to the Forum..

Attached File  CAListed.BAS   21.26KB   81 downloads

#3 JAC! OFFLINE  

JAC!

    Stargunner

  • 1,029 posts
  • Always looking for GFX and MSX for my demos
  • Location:Lebach, Germany

Posted Mon Feb 6, 2012 6:05 AM

>Problem is that it doesn't recognize date above 1999
Finally a real year 2000 issue - And we found it in 2012 :-)

#4 flashjazzcat OFFLINE  

flashjazzcat

    Quadrunner

  • 8,302 posts
  • Location:United Kingdom

Posted Mon Feb 6, 2012 6:13 AM

Finally a real year 2000 issue - And we found it in 2012 :-)


Heh - I had to write a patch for SDX early in 2000 because the year wouldn't roll over properly in directory listings and on the TD line (it output garbage). Still got it somewhere, but it's obsalescent now. :)

#5 hloberg OFFLINE  

hloberg

    Moonsweeper

  • Topic Starter
  • 350 posts
  • Location:Dallas, Texas. Down the street from TI.

Posted Mon Feb 6, 2012 9:28 AM

>Problem is that it doesn't recognize date above 1999
Finally a real year 2000 issue - And we found it in 2012 :-)

LOL. And the world didn't come to a end, or my Atari for that matter. ;)

#6 hloberg OFFLINE  

hloberg

    Moonsweeper

  • Topic Starter
  • 350 posts
  • Location:Dallas, Texas. Down the street from TI.

Posted Mon Feb 6, 2012 9:32 AM


Atari Timewise program is a time management program. It is written in BASIC. Problem is that it doesn't recognize date above 1999. I would like to fix the problem but the file is un-listable and in a hidden directory.
I don't want to spend too much time on this project but is there a way to list a unlistable file to fix the program?
Attached is the file if anyone is curious.
thanks, HLO

I don't know about getting it to run properly, but I got the listing.


Attached File  CAL.BAS   16.02KB   56 downloads

this next one is the listed version, but named CAListed.BAS only so I could upload to the Forum..

Attached File  CAListed.BAS   21.26KB   81 downloads


WOW thanks! when/if I get it working I'll repost the Y2K compliment version.

Actually have some experience with Y2K compliment. made a few bucks making banking software Y2K (in COBOL) in the early 90s.

#7 rdea6 OFFLINE  

rdea6

    Stargunner

  • 1,650 posts
  • Location:Arizona USA

Posted Mon Feb 6, 2012 2:31 PM

WOW thanks! when/if I get it working I'll repost the Y2K compliment version.

Actually have some experience with Y2K compliment. made a few bucks making banking software Y2K (in COBOL) in the early 90s.


There were two more files on that atr. One was the logo file or title screen, Second one was a file to input initialization data to the program. It was modified to not show the directory and several calls to the DOS.SYS (i.e.) usr(7xxx) ...

And also an AUTORUN.SYS file to run the logo (title screen). I couldn't find out the version of dos yet..

#8 miker OFFLINE  

miker

    Stargunner

  • 1,561 posts
  • Stay Atari!
  • Location:Warsaw, Poland

Posted Mon Feb 6, 2012 4:20 PM

It looks like DOS 2.0 or 2.0S, as some texts appear in reversed order ie. "SROTCES EERF".

#9 hloberg OFFLINE  

hloberg

    Moonsweeper

  • Topic Starter
  • 350 posts
  • Location:Dallas, Texas. Down the street from TI.

Posted Thu Feb 9, 2012 11:44 PM

bypassed the autorun.sys. having other problems though. some ML calls are now crashing. looks to be calls to the disk buffers??? tracing them down.
bigger project than expected. :woozy:

#10 rdea6 OFFLINE  

rdea6

    Stargunner

  • 1,650 posts
  • Location:Arizona USA

Posted Thu Feb 9, 2012 11:56 PM

bypassed the autorun.sys. having other problems though. some ML calls are now crashing. looks to be calls to the disk buffers??? tracing them down.
bigger project than expected. :woozy:


The Autorun loads the LOGO file with alot of pokes to 1536 +. Which is probably used by the main program also..


0 REM (C) 1982 ATARI, Inc. All Rights Reserved Unauthorized reproduction,
1 REM adaptation, distribution, performance, or display of this document,
2 REM the associated computer program, or the audiovisual work is strictly prohibited.
4 DIM IO$(7),P$(40)<img src='http://www.atariage.com/forums/public/style_emoticons/<#EMO_DIR#>/icon_razz.gif' class='bbc_emoticon' alt=':P' />$="#  !4!2) ).#!,, 2)'(43 2%3%26%$ "
5 IO$="hhhªLVä":POKE 82,1
7 GRAPHICS 23:POKE 580,1:DL=PEEK(560)+PEEK(561)*256
8 POKE 752,1:POKE 708,138:POKE 709,14:POKE 710,24:POKE 712,112
11 ADL=PEEK(DL+4):ADH=PEEK(DL+5):AD=ADL+256*ADH-14:ADH=INT(AD/256):ADL=AD-ADH*256
14 OPEN #7,4,0,"D:CAL.SCR":POKE 948,ADL:POKE 949,ADH:POKE 952,10:POKE 953,15
15 POKE 946,7:A=USR(ADR(IO$),112):CLOSE #7
20 POKE DL+93,6:POKE DL+94,6:POKE DL+95,PEEK(DL+101):POKE DL+96,PEEK(DL+102):POKE DL+97,PEEK(DL+103)
22 A=AD+40*88+13:FOR I=1 TO 40:POKE A+I,ASC(P$(I,I)):NEXT I
80 FOR I=0 TO 47:READ A:POKE 1536+I,A:NEXT I:A=USR(1536)
81 DATA 120,173,22,2,141,108,4,173,23,2,141,109,4,169,100
82 DATA 141,22,2,169,4,141,23,2,173,8,2,141,98,4,173
83 DATA 9,2,141,99,4,169,80,141,8,2,169,4,141,9,2
84 DATA 88,104,96
98 FOR I=0 TO 217:READ A:POKE 1568+I,A:NEXT I
100 DATA 104,104,133,215,104,133,214,24,101,203,133,203,165,215,101
110 DATA 204,133,204,104,133,217,104,133,216,104,133,206,104,133,205
120 DATA 169,0,133,212,133,213,165,204,197,217,144,6,165,203,197
130 DATA 216,176,52,160,0,177,205,240,16,177,203,240,12,177,205
140 DATA 209,203,240,6,32,133,6,76,68,6,200,192,9,144,231
150 DATA 177,203,133,212,200,177,203,133,213,32,133,6,56,165,203
160 DATA 229,214,133,203,165,204,229,215,133,204,96,24,165,203,105
170 DATA 11,133,203,165,204,105,0,133,204,96,104,104,133,215,104
180 DATA 133,214,104,133,217,104,133,216,169,0,133,209,165,216,133
190 DATA 205,165,217,133,206,165,205,133,203,165,206,133,204,56,165
200 DATA 205,233,11,133,205,165,206,233,0,133,206,197,215,240,2
210 DATA 176,11,165,205,197,214,176,5,165,209,208,207,96,160,0
220 DATA 177,203,209,205,144,11,240,2,176,206,200,192,9,176,201
230 DATA 144,239,160,11,132,209,136,177,203,72,177,205,145,203,104
240 DATA 145,205,192,0,208,241,240,178

renamed to LOGO --Attached File  LOGO.LST.bas   1.99KB   46 downloads
so that I could upload here..

Edited by rdea6, Fri Feb 10, 2012 12:00 AM.


#11 hloberg OFFLINE  

hloberg

    Moonsweeper

  • Topic Starter
  • 350 posts
  • Location:Dallas, Texas. Down the street from TI.

Posted Sat Feb 11, 2012 1:34 PM

thanks for pulling the autorun.sys out for me. (I'm going to ask ya'll sometime how you do that.)
I had guessed that there were pokes from the autorun.sys setting up the program. I could have bypassed them all but it been really hard.
I have got the info for the variable loads so with this i should be able to now get it going.
I only need to modify a few lines to make it Y2k. I didn't want to have to rewrite the whole program to do it so this helps a lot.
If there isn't any more 'gotchas' I should be able to get to it in a week or so.
Again, thanks for all the help.

#12 rdea6 OFFLINE  

rdea6

    Stargunner

  • 1,650 posts
  • Location:Arizona USA

Posted Sat Feb 11, 2012 10:49 PM

thanks for pulling the autorun.sys out for me. (I'm going to ask ya'll sometime how you do that.)
I had guessed that there were pokes from the autorun.sys setting up the program. I could have bypassed them all but it been really hard.
I have got the info for the variable loads so with this i should be able to now get it going.
I only need to modify a few lines to make it Y2k. I didn't want to have to rewrite the whole program to do it so this helps a lot.
If there isn't any more 'gotchas' I should be able to get to it in a week or so.
Again, thanks for all the help.

More help

Attached File  Timewise.zip   11.88KB   68 downloads

Besides the DOS.SYS program this zip file has all the other files I extracted from the atr. The basic files have been converted to listable files (i.e.) CAL, and LOGO.
the other files are autorun.sys, C, and LOGO.SCR and a small textfile to explain more.

#13 hloberg OFFLINE  

hloberg

    Moonsweeper

  • Topic Starter
  • 350 posts
  • Location:Dallas, Texas. Down the street from TI.

Posted Sun Feb 12, 2012 1:10 PM


More help


Besides the DOS.SYS program this zip file has all the other files I extracted from the atr. The basic files have been converted to listable files (i.e.) CAL, and LOGO.
the other files are autorun.sys, C, and LOGO.SCR and a small textfile to explain more.


Thanks! this may be the last part of the puzzle (I hope).
For some reason the ML programs are still crashing. in fact, one of the ML programs loads into the disk buffers at 7000(ish) and I can't figure out where the ML program supposed to loading from.
My guess is that they must be loading from the autoexec.sys which I didn't have up this point.
funny, the program is very advanced with ML programs to speed disk loading, DLIs, extensive use of variables to save memory but the date routine is actually fairly simple.

Edited by hloberg, Sun Feb 12, 2012 1:34 PM.


#14 hloberg OFFLINE  

hloberg

    Moonsweeper

  • Topic Starter
  • 350 posts
  • Location:Dallas, Texas. Down the street from TI.

Posted Sun Feb 12, 2012 4:05 PM

The ML routines still blow up even with everything in place.
Here is my theory and see what ya'll think.
They (Atari) created a special DOS that allocated very little buffer space and used that extra space to load their ML routines in. Since they used a special ML routine to read the data disk they probably didn't need that buffer space anyway. I'm using a standard DOS2 and the ML routines are being overwritten in the buffer by the standard DOS.
Any thoughts or ideas or am I way off?

Edited by hloberg, Sun Feb 12, 2012 4:33 PM.


#15 rdea6 OFFLINE  

rdea6

    Stargunner

  • 1,650 posts
  • Location:Arizona USA

Posted Sun Feb 12, 2012 4:45 PM

Hi could you post your CAL program and I will try to insert it into the original ATR that you posted.
TIA

#16 hloberg OFFLINE  

hloberg

    Moonsweeper

  • Topic Starter
  • 350 posts
  • Location:Dallas, Texas. Down the street from TI.

Posted Sun Feb 12, 2012 7:34 PM

Hi could you post your CAL program and I will try to insert it into the original ATR that you posted.
TIA

That might work.
give me a few days, I been screwing with it so much to get the ML to work I kinda lost my place on the calendar issue.

#17 hloberg OFFLINE  

hloberg

    Moonsweeper

  • Topic Starter
  • 350 posts
  • Location:Dallas, Texas. Down the street from TI.

Posted Mon Feb 13, 2012 11:49 AM


Hi could you post your CAL program and I will try to insert it into the original ATR that you posted.
TIA

That might work.
give me a few days, I been screwing with it so much to get the ML to work I kinda lost my place on the calendar issue.




On second thought, I think I'm going to see if I can't get this to work the way I want it to.
I'm going to look at a few things and do some ideas I have that might get it to work.

Be a good way of me getting back into programming on the Atari. Also I want to learn how you guys pulled the info off the disk so I can do it. So I'm going to put this on the back burner and look at it when I have time.
I have all the parts now (thanks to all) and who knows, I might be able to come up with TimeWise 2.0
in a few months (more or less :-D )
Again, thanks to everyone for your help and I'll be back with you as soon as i have something.
HLO
P.S. if you want to use timewise (not sure why) as it is now just use the year 1984 in place of 2012. both years have the same calendar.

Edited by hloberg, Mon Feb 13, 2012 12:07 PM.


#18 ProWizard OFFLINE  

ProWizard

    River Patroller

  • 3,243 posts
  • MyIDE 2 Conversions in Progress!
  • Location:$d500-$d57f

Posted Tue Feb 21, 2012 2:18 AM

Is there a chance you increased the size of the program with your fix, and now the ML routine is overwritten by your program itself?

(Just like the way people had to reserve SAFE space for Player/Missile gfx)? I'd say: disassemble the ML routine. Look carefully what it does, and reserve a safe space in Basic (by moving Memtop) and put the ML routine there. Make sure you make all necessary changes in JMPS and JSRS (do not alter the branches, they are relative!); also change the USR(xxxxx) address in Basic.

Big chance the 'crash' is part of some copy protection. Perhaps when you recreate the list of a scrambled basic file, that another part of the protection kicks in. Just thinking.

#19 hloberg OFFLINE  

hloberg

    Moonsweeper

  • Topic Starter
  • 350 posts
  • Location:Dallas, Texas. Down the street from TI.

Posted Tue Feb 21, 2012 9:27 AM

Is there a chance you increased the size of the program with your fix, and now the ML routine is overwritten by your program itself?

(Just like the way people had to reserve SAFE space for Player/Missile gfx)? I'd say: disassemble the ML routine. Look carefully what it does, and reserve a safe space in Basic (by moving Memtop) and put the ML routine there. Make sure you make all necessary changes in JMPS and JSRS (do not alter the branches, they are relative!); also change the USR(xxxxx) address in Basic.

Big chance the 'crash' is part of some copy protection. Perhaps when you recreate the list of a scrambled basic file, that another part of the protection kicks in. Just thinking.


That could be. But where the ML is being stored shouldn't be over written by the BASIC. They store most of the ML in the unused disk buffer area. I have thought that they may have stored some ML in the BASIC, then hid it (a copy protection thing?), and when we LISTED the program to modify it we lost the ML. I still can't figure out where one routine is supposed to come from.
What I have found is that the ML routines really aren't necessary. They were more likely put in to save space so that this program could run on a 400 (they did a LOT of stuff to save space such as all literal numbers are converted to variables which is really annoying when trying to trace down a GOSUB or GOTO). I am currently looking into just replacing the ML with their BASIC equivalent. My idea is to convert it to all BASIC then use TurboBASIC (or some other) compiler to compile it to speed it up.
Or, that's the plan. I have had to set it aside for the moment to do other things and when I get back to it I might find that my idea isn't as workable as I first thought. At that point I will have to de-compile the ML or just give up. We will see. Thanks for the idea though. Any help I can get is greatly appreciated.
HLO

#20 Rybags ONLINE  

Rybags

    Quadrunner

  • 12,643 posts
  • Location:Australia

Posted Tue Feb 21, 2012 10:01 AM

Where is it stored (ML stuff)?

Note that page 6 isn't 100% safe. Basic's input buffer is at $580.

Inputting from E: won't overwrite it because E: limits input to 120 characters. But input from other devices can exceed that.

One way of overwriting page 6 is Listing then Entering a program from disk with long lines.

To generate a long line is easy enough. Statements like SETCOLOR can be abbreviated to SE. so potentially you could have a line well over 128 characters.

Another danger area is top of memory. Some Basic programs move the screen downwards in RAM then put stuff like asm routines and PM graphics at the top of RAM. When you press Reset, almost all the top 1K of RAM gets wiped.

#21 hloberg OFFLINE  

hloberg

    Moonsweeper

  • Topic Starter
  • 350 posts
  • Location:Dallas, Texas. Down the street from TI.

Posted Tue Feb 21, 2012 12:54 PM

Where is it stored (ML stuff)?

Note that page 6 isn't 100% safe. Basic's input buffer is at $580.

Inputting from E: won't overwrite it because E: limits input to 120 characters. But input from other devices can exceed that.

One way of overwriting page 6 is Listing then Entering a program from disk with long lines.

To generate a long line is easy enough. Statements like SETCOLOR can be abbreviated to SE. so potentially you could have a line well over 128 characters.

Another danger area is top of memory. Some Basic programs move the screen downwards in RAM then put stuff like asm routines and PM graphics at the top of RAM. When you press Reset, almost all the top 1K of RAM gets wiped.


That's the odd part. From what I can tell none of the ML routines are stored in page 6 or top of memory. they are all stored in the disk buffers. I once read (not sure where?) that if you were really short on memory that you could store ML routines in the disk buffers as long as you modified the DOS not to use all of it. That looks be to what they did. of course, when I start using any other DOS while modifying the program it crashes as the buffers are over written (this is a guess as I haven't de-compiled the ML yet).
I COULD modify the BASIC program a try to put it BACK on the original disk (the Y2K fix is only 4 lines long) but being the person I am I have decided to take the hard road of just modifying the whole program. :-D
Anyway, I'm using this a project to get me reacquainted with Atari BASIC and 6502 assembler (with all it's quirks, it's a good trainer).
But that is good information you gave me. I always assumed page 6 as safe. Never really trusted MEMTOP with BASIC though.

A couple of question.
Question 1: did an early version of the 400 not have page 6 memory? If it did then why didn't they use page 6? I can see why they didn't MEMTOP with the limited memory the 400 had.
Question 2: Is this possible with the Atari?
Another guess I been kicking around is they stored the ML routines in the BASIC LOAD file. I know some other computer BASICs you can do that then load them within BASIC prior to it starting. When we LISTED the file the ML routines were lost.
Maybe storing the ML code in a string, LIST it and the string is lost? A guess.

HLO

#22 hloberg OFFLINE  

hloberg

    Moonsweeper

  • Topic Starter
  • 350 posts
  • Location:Dallas, Texas. Down the street from TI.

Posted Tue Feb 21, 2012 1:32 PM

A little explanation on the what ML routines that are in the program:
First is a DLI routine to add color to the menu. I just bypassed it for now and will add it back at the end.
Second is a routine to read your keypress and put it at X,Y position on the screen. I guess they added this for speed and to save lines. I am re-writing it in BASIC and (so far) looks fine.
Third is the tough one. It's a routine to read, write to disk at x sector. Again, I think they use this ML routine for speed and save lines. It looks like just a ML version of note and point. When I have time I am going to run some test on an original TW data disk using note and point to see if I can read and write to it.
That's really it.
Like I said, I plan to rewrite these parts (and the Y2K fix) in BASIC and then compile it for speed. It should look just like the original when finished. I am also toying with adding access to a RAM disk to speed it up (maybe).
But, alas, I currently don't have time for it. I plan to get back to it in a few weeks.
HLO

Edited by hloberg, Tue Feb 21, 2012 1:34 PM.





0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users