Jump to content
IGNORED

Logical Line Character limit broken....but how?


Recommended Posts

ah yeah, I downloaded that atr, and even put it in that tool, but it shows no files besides the DOS.SYS file. Even though if you look at the disassembled view and scroll down to look at the sector data, the game is clearly there in some form.

Link to comment
Share on other sites

42 minutes ago, TheRaven81 said:

ah yeah, I downloaded that atr, and even put it in that tool, but it shows no files besides the DOS.SYS file. Even though if you look at the disassembled view and scroll down to look at the sector data, the game is clearly there in some form.

The directory of this disk is not in the usual place. 

That's the reason why I requested @rossum to make this configurable. There are lots of (mainly educational) BASIC programs out there with this type of protection. 

Link to comment
Share on other sites

ah. Well all this protection by moving the directory, blocking the LIST command, blocking the BREAK Key, causing cold boot upon pressing RESET, all makes sense for back then. But now, when the software is as old as me and no longer being sold, it would be nice to have all that removed, for the sake of preservation.

  • Like 1
Link to comment
Share on other sites

As annoying as it seems, preservation actually means keeping a near as original as possible game which means hard to duplicate disk errors and those annoying attributes.  But of course it's good to also have the fully cracked easily modifyable one.

  • Like 1
Link to comment
Share on other sites

2 hours ago, TheRaven81 said:

ah. Well all this protection by moving the directory, blocking the LIST command, blocking the BREAK Key, causing cold boot upon pressing RESET, all makes sense for back then. But now, when the software is as old as me and no longer being sold, it would be nice to have all that removed, for the sake of preservation.

 

4 hours ago, DjayBee said:

The directory of this disk is not in the usual place. 

That's the reason why I requested @rossum to make this configurable. There are lots of (mainly educational) BASIC programs out there with this type of protection. 

Added a search for hidden directories, now happily finds Cribbage code

image.thumb.png.76c2a3649537570f671c1b5feeb61943.png

atr_image_explorer.htm

  • Like 4
  • Thanks 1
Link to comment
Share on other sites

On 5/24/2020 at 9:07 AM, Rybags said:

As annoying as it seems, preservation actually means keeping a near as original as possible game which means hard to duplicate disk errors and those annoying attributes.  But of course it's good to also have the fully cracked easily modifyable one.

I suppose you are correct. Maybe we could work towards that - having a fully cracked, easily modified version, so that I might possibly learn a thing or two from this. But I can't really do that when it's easily blocking someone like me out. Perhaps a topic for another thread, though.

Link to comment
Share on other sites

On 5/24/2020 at 7:53 AM, Rybags said:

It also imposes a 255 byte limit (?) on actual line length once tokenized (rarely would you come near that)

Unless you use SLXPRESS ;) to stuff lines to maximum length. That 255 byte limit is due to the pointer indicating the offset to the next line being one byte only. 

 

SLXPRESS.BA2

Link to comment
Share on other sites

Hi!

 

On 5/25/2020 at 1:02 PM, TheRaven81 said:

I suppose you are correct. Maybe we could work towards that - having a fully cracked, easily modified version, so that I might possibly learn a thing or two from this. But I can't really do that when it's easily blocking someone like me out. Perhaps a topic for another thread, though.

You can use my basicParser program to get a readable long-listing from an Atari BASIC program, it has options to remove line numbers and replace variables with constant values.

 

The attached is the same "cribbage 1.0" program, from the ATX disk, in long listing format and in the optimized tokenized format produced with "basicParser  -A  cribbage-1.0.list -O". I removed the copy protection measures: reset protection, variable names overwriting, invalid immediate statement length and DOS disk directory location patching.

 

cribbage-1.0.list cribbage-1.0.bas

  • Thanks 1
  • Sad 1
Link to comment
Share on other sites

  • 2 weeks later...
On 5/26/2020 at 9:41 PM, dmsc said:

Hi!

 

You can use my basicParser program to get a readable long-listing from an Atari BASIC program, it has options to remove line numbers and replace variables with constant values.

 

The attached is the same "cribbage 1.0" program, from the ATX disk, in long listing format and in the optimized tokenized format produced with "basicParser  -A  cribbage-1.0.list -O". I removed the copy protection measures: reset protection, variable names overwriting, invalid immediate statement length and DOS disk directory location patching.

 

cribbage-1.0.list 42.17 kB · 4 downloads cribbage-1.0.bas 21.68 kB · 5 downloads

I can't type this in, the lines are too long. And that list file looks like it's made for TurboBasic, which I don't have.

Edited by TheRaven81
Link to comment
Share on other sites

1 hour ago, TheRaven81 said:

I can't type this in, the lines are too long.

Why don't you give v2.0 a try?

The current version of rossum's tool can see the non-standard directory on that disk and therefore you now can extract the BASIC program.

  • Like 1
Link to comment
Share on other sites

1 hour ago, DjayBee said:

Why don't you give v2.0 a try?

The current version of rossum's tool can see the non-standard directory on that disk and therefore you now can extract the BASIC program.

I did. I used rossum's tool and made a listing of it, and it's actually what I've been typing in for the past.week, maybe more now. I came back to this thread, because I was wondering if there was maybe something I missed. I finally finished typing in 2.0 this morning, and I ran it,. The title screen came up, which was kind of exciting, but by the way it looked, there were obvious indicators that something was wrong somewhere. Some of the framework didn't look right, like I had made a mistake typing somewhere. So I took advantage of the lack of a LIST block, and looked to see if I could fix it, examining the lines that (from what I could tell anyways) constructed the screen.  Found a few mistakes, saved it and ran it again. Not totally fixed but better. But it was still wrong somehow even though I could find no further mistakes.

    I decided I would ponder away at that later(because loading and saving this huge program took forever), and examine further, to see if the actual game was working.  So I pressed the Fire button on the Joystick to make a difficulty selection, and the screen went blank, and the game/computer froze.

 

That got a big sigh and a "Well, shit."  

 

The whole thing was frustrating because I had spent all that time typing in the program, only for it to not work. It didn't help that I barely understood half of how it was working. But I have been wracking my brain at it for the past few hours, and I don't know where I went wrong. My hunch is that it's a variable typo somewhere that didn't get caught as an error, and there's no way to check for that, save going through the program again line by line, which would probably take another several days(that I didn't know if I was willing to spend) to work through it.

Edited by TheRaven81
Link to comment
Share on other sites

51 minutes ago, TheRaven81 said:

and it's actually what I've been typing in for the past.week,

Man, that is what I call dedication. 

 

I don't know if you are already up to this, but anyway :

LIST your typed in program to disk or tape. 

Then write a small program which opens the listed file and reads it line for line. 

Create a checksum for each line and print it together with the line's number. 

Now do the same thing in an emulator and compare the output. 

It certainly will be cumbersome, but eventually you should find the line(s) with typos. 

Link to comment
Share on other sites

hmmm

I ran into another problem, which makes me wonder if that crash is actually my fault. There must be something that the AUTORUN.SYS is doing to it. Because I dropped the ATR of Side A into Altirra, and the game will run fine like that.

BUT

If I drop that same ATR into rossum's tool, save the game file(CRIBBAGE.DSK), rename with a .BAS extension(since Altirra wouldn't run it as .DSK), and run it - the same thing happens - it will load as far as the title screen, but if you press the FIRE button to make a selection and start the game, then it will go to a blank screen and the emulator will pop up a window say it has crashed due to a program error.  This here is the debug output at the time of the crash:

247010905_2020-06-05001.thumb.png.26c616477c91fb2e3b867975acceffdf.png

 

IDK what it means though.

Edited by TheRaven81
Link to comment
Share on other sites

Hi!

8 hours ago, TheRaven81 said:

I can't type this in, the lines are too long. And that list file looks like it's made for TurboBasic, which I don't have.

Of course, those are not typeable on the Atari - the first is in long-form input and the second is directly runnable. You specifically asked for "having a fully cracked, easily modified version", this is what I gave you :) 

 

What you are not grasping yet is: the program, as you are seeing it, was not originally entered in that form in the Atari. In this game, the source was: optimized to remove redundant constants, optimized using long lines and then protected to made it not listable, so the original version is already lost.

 

If you want a *typeable* listing, you can use my parser with "basicParser  -A  -s cribbage-1.0.list -o cribbage.lst" , the output would not be pretty but it would be typeable in a standard Atari.

 

To make typing easier, you can add the "-n 100" option to make lines shorter than 100 characters (this is the minimum possible for this program, as line 5182 can't be split further), and you get this:

 

image.thumb.png.371727cdaaddb33f4c3d5d6ccd772465.png

 

Have Fun!

 

 

 

 

Link to comment
Share on other sites

10 hours ago, TheRaven81 said:

There must be something that the AUTORUN.SYS is doing to it.

RUN this before running CRIBBAGE.DSK:

10 FOR I=0 TO 139
20 READ X
30 POKE 31303+I,X
40 NEXT I
110 DATA 104,162,8,202,104,149,214,138,208,249
120 DATA 165,214,133,203,165,215,133,204,169,0
130 DATA 170,168,200,145,203,208,251,230,204,232
140 DATA 224,2,208,244,169,3,141,29,208,169
150 DATA 30,160,66,200,145,214,145,220,192,69
160 DATA 240,6,192,75,240,8,208,241,160,73
170 DATA 169,28,208,235,169,62,200,145,214,145
180 DATA 220,160,27,145,216,169,28,200,145,216
190 DATA 192,29,240,6,192,36,240,8,208,243
200 DATA 160,33,169,30,208,237,169,255,160,106
210 DATA 145,218,160,93,145,218,169,129,200,145
220 DATA 218,192,105,208,249,169,1,141,111,2
230 DATA 141,10,208,169,46,141,47,2,169,49
240 DATA 141,0,208,141,1,208,141,3,208,96

It puts 140 byte of AUTORUN.SYS in place which are called when CRIBBAGE.DSK currently crashes. The game starts now, but I am not sure if it needs more of the original file which has 865 bytes.

 

You can also make it an AUTORUN.SYS. Then you can boot the disk an immediately run CRIBBAGE.DSK.

 

RUN the above program from BASIC, the go to DOS and do the following:

 

grafik.thumb.png.99721eafa8d1065a863b639db1a802b8.png

 

 

Link to comment
Share on other sites

On 6/6/2020 at 6:50 AM, DjayBee said:

RUN this before running CRIBBAGE.DSK:


10 FOR I=0 TO 139
20 READ X
30 POKE 31303+I,X
40 NEXT I
110 DATA 104,162,8,202,104,149,214,138,208,249
120 DATA 165,214,133,203,165,215,133,204,169,0
130 DATA 170,168,200,145,203,208,251,230,204,232
140 DATA 224,2,208,244,169,3,141,29,208,169
150 DATA 30,160,66,200,145,214,145,220,192,69
160 DATA 240,6,192,75,240,8,208,241,160,73
170 DATA 169,28,208,235,169,62,200,145,214,145
180 DATA 220,160,27,145,216,169,28,200,145,216
190 DATA 192,29,240,6,192,36,240,8,208,243
200 DATA 160,33,169,30,208,237,169,255,160,106
210 DATA 145,218,160,93,145,218,169,129,200,145
220 DATA 218,192,105,208,249,169,1,141,111,2
230 DATA 141,10,208,169,46,141,47,2,169,49
240 DATA 141,0,208,141,1,208,141,3,208,96

It puts 140 byte of AUTORUN.SYS in place which are called when CRIBBAGE.DSK currently crashes. The game starts now, but I am not sure if it needs more of the original file which has 865 bytes.

 

You can also make it an AUTORUN.SYS. Then you can boot the disk an immediately run CRIBBAGE.DSK.

 

RUN the above program from BASIC, the go to DOS and do the following:

 

grafik.thumb.png.99721eafa8d1065a863b639db1a802b8.png

 

 

OK,2 questions before I do this: 

1. Does my typed-in file have to be named "CRIBBAGE.DSK"? Or is it ok for it to be as "CRIBBAGE.BAS", which is how I have it named now?

2. Would it be safe to add a RUN line at the end of this, like

250 RUN "D:CRIBBAGE.BAS"

or 

250 RUN "D:CRIBBAGE.DSK"

(of course, which one of those I use depends on the answer of Question 1)

or is that not a good idea? If not please explain.

Link to comment
Share on other sites

OK, I tested just this process in Altirra:

Pasted your program into BASIC, and saved it as "CRIBPTCH.BAS" so I wouldn't have to do it again,

Ran it.

Then directly afterwards, did RUN "H:CRIBBAGE.DSK"

selected the first option, and it got a little further. It got to the point where it was able to set up the table on the screen. But that's it. It didn't go any further. Another thing though, is it didn't crash the emulator this time. It just.... didn't go any further. So I don't have any more data to go by from the Debugger, because it didn't give any when it stopped.

 

Link to comment
Share on other sites

2 hours ago, TheRaven81 said:

OK,2 questions before I do this: 

1. does not matter. I used the original file name only as reference.

2. yes

 

Before "trial-and-erroring on" you might try in Altirra, if DOS 2.0 + original AUTORUN.SYS + original CRIBBAGE.DSK will work.

If that works, it is worth to go ahead and make a DATA-version of the whole AUTORUN.SYS which you could type in.

 

Perhaps by then rossum has implemented this request by FULS into ATR Image Explorer:

"I can't think of to many more features that could be added, but is there a way to convert a binary file to Basic Data statements and then added to a Basic Program?"

 

Then the conversion to DATA would be automatic. The file I posted in post #41 was done manually.

Edited by DjayBee
Link to comment
Share on other sites

3 hours ago, DjayBee said:

1. does not matter. I used the original file name only as reference.

2. yes

 

Before "trial-and-erroring on" you might try in Altirra, if DOS 2.0 + original AUTORUN.SYS + original CRIBBAGE.DSK will work.

If that works, it is worth to go ahead and make a DATA-version of the whole AUTORUN.SYS which you could type in.

 

Perhaps by then rossum has implemented this request by FULS into ATR Image Explorer:

"I can't think of to many more features that could be added, but is there a way to convert a binary file to Basic Data statements and then added to a Basic Program?"

 

Then the conversion to DATA would be automatic. The file I posted in post #41 was done manually.

OK, so I made this disk, with DOS 2.0S. I put the original AUTORUN.SYS, and CRIBBAGE.DSK on it. 
It doesn't work, when you disable BASIC, and put it in D1, the program crashes.

Here's the ATR so you can see it. 

Cribbage test.atr

Link to comment
Share on other sites

18 minutes ago, DjayBee said:

Why would you do that? Cribbage needs BASIC.

oh. right. sorry, derp moment, it's really late. But still, even when it's not disabled, it still crashes.

 

CPU: Illegal instruction hit: 0017
(1734:  1, 97) A=06 X=00 Y=01 S=02 P=32 (    Z )  0016: 02                KIL

Edited by TheRaven81
Link to comment
Share on other sites

6 hours ago, TheRaven81 said:

But still, even when it's not disabled, it still crashes.

You somehow managed to do an EOL-conversion to both files. Each $0A became a $9B.

 

It's a little bit difficult to read, but look at the red colored bytes in the comparison of the beginning of AUTORUN.SYS (left yours, right the original):

 

grafik.thumb.png.f37230aaf11c264610e39dda336d65f8.png

 

Try this image:

Cribbage test-fixed.atr

 

Edited by DjayBee
Link to comment
Share on other sites

39 minutes ago, DjayBee said:

You somehow managed to do an EOL-conversion to both files. Each $0A became a $9B.

 

It's a little bit difficult to read, but look at the red colored bytes in the comparison of the beginning of AUTORUN.SYS (left yours, right the original):

 

grafik.thumb.png.d9c9345f1ed66f3c55f5f0ee20d77493.png

 

Try this image:

Cribbage test-fixed.atr 90.02 kB · 1 download

 

Can't see your comparison image, link is broken.

EDIT: OK, see it now, but idk how it happened. Perhaps it was a bad copy process. I used a DOS 2.0S ATR in D1, put an empty ATR in D2, used (I) to format it, then H to write the DOS files to the disk. After that was done, I used C to copy the file from H1: to D2:, for both files.

Edited by TheRaven81
Link to comment
Share on other sites

1 hour ago, DjayBee said:

You somehow managed to do an EOL-conversion to both files. Each $0A became a $9B.

 

It's a little bit difficult to read, but look at the red colored bytes in the comparison of the beginning of AUTORUN.SYS (left yours, right the original):

 

grafik.thumb.png.f37230aaf11c264610e39dda336d65f8.png

 

Try this image:

Cribbage test-fixed.atr 90.02 kB · 2 downloads

 

Well the fixed ATR works, so now that feature request for @rossum's tool would be useful.  In the meantime, I might just use your little manual bit for now, to try to work out these visual bugs that I have typed in. Since I typed in your bit, saved and ran it, and then ran the game on the Atari, and somehow it went slightly further than it does on the emulator. It will  also go through the Low card draw process, then deal the cards face down, and reveal my cards to me. But then that's where it stops.

 

Seeing it do this, there's another visual bug that I made somehow, with how it draws the card back - I don't know where it is though. I'll have to figure out how to write that checksum program maybe, and go through it. Though writing that program will be a puzzle in itself.

 

BTW, thank you for your help with this, I really appreciate it.

 

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...