Jump to content
IGNORED

ATR Image Explorer - browser based disassembler for Atari .BAS, XEX, ATR and other files.


rossum

Recommended Posts

39 minutes ago, rossum said:

Cleaned up names/UI

Thanks for the update. Looks nice.

 

35 minutes ago, rossum said:

"o" key will open a file selection dialog.

Couldn't an "Open" button be added somewhere on top or bottom of the left panel?

 

I dropped some random files to do some tests, and when I change the type for any of those files to "Hard Interlace Picture" (not being a file of that format), the header for the right pannel dissappears. Then, it is not possible to select other type for the file. Again, it could be a way to return to the default file format.

 

It is still missing an alternative way to display Font files, in order to use ANTIC 4 four color characters (2 bits per pixel similar to Graphics 7 Image, but on single scan lines).

 

For images without a defined palette, it could be great to use default color palette in addition to the grey scale (selectable?).

 

On ATASCII text modes, the extra top and bottom empty lines sometimes disturbs me...

 

55 minutes ago, rossum said:

still working on TurboBasic XL

These are the tokens and operands lists I extracted from my ATASCII printer:

tokens =
 ["REM ","DATA ","INPUT ","COLOR ","LIST ","ENTER ","LET ",
  "IF ","FOR ","NEXT ","GOTO ","GO TO ","GOSUB ","TRAP ",
  "BYE ","CONT ","COM ","CLOSE ","CLR ","DEG ","DIM ","END ",
  "NEW ","OPEN ","LOAD ","SAVE ","STATUS ","NOTE ","POINT ",
  "XIO ","ON ","POKE ","PRINT ","RAD ","READ ","RESTORE ",
  "RETURN ","RUN ","STOP ","POP ","? ","GET ","PUT ",
  "GRAPHICS ","PLOT ","POSITION ","DOS ","DRAWTO ","SETCOLOR ",
  "LOCATE ","SOUND ","LPRINT ","CSAVE ","CLOAD ","","ERROR - ",
  "DPOKE ","MOVE ","-MOVE ","*F" ,"REPEAT ","UNTIL ","WHILE ","WEND ",
  "ELSE ","ENDIF ","BPUT ","BGET ","FILLTO ","DO ","LOOP ","EXIT ",
  "DIR ","LOCK ","UNLOCK ","RENAME ","DELETE ","PAUSE ","TIME$= ",
  "PROC ","EXEC ","ENDPROC ","FCOLOR ","*L ",
  "------------------------------".chr(155),
  "RENUM ","DEL ","DUMP ","TRACE ","TEXT ","BLOAD ","BRUN ","GO# ","# ",
  "*B ","PAINT ","CLS ","DSOUND ","CIRCLE ","%PUT ","%GET "]

operators =
 ["","",",","$",":",";",chr(155),
  " GOTO "," GOSUB "," TO "," STEP "," THEN ",
  "#","<=","<>",">=","<",">","=","^","*","+","-","/",
  " NOT "," OR "," AND ",
  "(",")","=","=","<=","<>",">=","<",">","=","+","-",
  "(","","","(","(",",",
  "STR$","CHR$","USR","ASC","VAL","LEN","ADR","ATN","COS",
  "PEEK","SIN","RND","FRE","EXP","LOG","CLOG","SQR","SGN",
  "ABS","INT","PADDLE","STICK","PTRIG","STRIG",
  "DPEEK","&","!","INSTR","INKEY$"," EXOR ","HEX$","DEC",
  " DIV ","FRAC","TIME$","TIME"," MOD ","EXEC ","RND","RAND",
  "TRUNC","%0","%1","%2","%3","GO# ","UINSTR","ERR","ERL"]

They are the same than Atari BASIC lists, but with extensions. You must also add 0x0D type when checking a[j] to extract an hex constant from 6 byte data stored as a BCD number. For string constants, you must duplicate the contained double quotes. I think there was also a check for variable numbers for more than 128 of them (probably token 0x54 is related).

 

I hope this helps...

 

  • Like 2
Link to comment
Share on other sites

16 hours ago, vitoco said:

Thanks for the update. Looks nice.

 

Couldn't an "Open" button be added somewhere on top or bottom of the left panel?

 

I dropped some random files to do some tests, and when I change the type for any of those files to "Hard Interlace Picture" (not being a file of that format), the header for the right pannel dissappears. Then, it is not possible to select other type for the file. Again, it could be a way to return to the default file format.

 

It is still missing an alternative way to display Font files, in order to use ANTIC 4 four color characters (2 bits per pixel similar to Graphics 7 Image, but on single scan lines).

 

For images without a defined palette, it could be great to use default color palette in addition to the grey scale (selectable?).

 

On ATASCII text modes, the extra top and bottom empty lines sometimes disturbs me...

 

These are the tokens and operands lists I extracted from my ATASCII printer:


tokens =
 ["REM ","DATA ","INPUT ","COLOR ","LIST ","ENTER ","LET ",
  "IF ","FOR ","NEXT ","GOTO ","GO TO ","GOSUB ","TRAP ",
  "BYE ","CONT ","COM ","CLOSE ","CLR ","DEG ","DIM ","END ",
  "NEW ","OPEN ","LOAD ","SAVE ","STATUS ","NOTE ","POINT ",
  "XIO ","ON ","POKE ","PRINT ","RAD ","READ ","RESTORE ",
  "RETURN ","RUN ","STOP ","POP ","? ","GET ","PUT ",
  "GRAPHICS ","PLOT ","POSITION ","DOS ","DRAWTO ","SETCOLOR ",
  "LOCATE ","SOUND ","LPRINT ","CSAVE ","CLOAD ","","ERROR - ",
  "DPOKE ","MOVE ","-MOVE ","*F" ,"REPEAT ","UNTIL ","WHILE ","WEND ",
  "ELSE ","ENDIF ","BPUT ","BGET ","FILLTO ","DO ","LOOP ","EXIT ",
  "DIR ","LOCK ","UNLOCK ","RENAME ","DELETE ","PAUSE ","TIME$= ",
  "PROC ","EXEC ","ENDPROC ","FCOLOR ","*L ",
  "------------------------------".chr(155),
  "RENUM ","DEL ","DUMP ","TRACE ","TEXT ","BLOAD ","BRUN ","GO# ","# ",
  "*B ","PAINT ","CLS ","DSOUND ","CIRCLE ","%PUT ","%GET "]

operators =
 ["","",",","$",":",";",chr(155),
  " GOTO "," GOSUB "," TO "," STEP "," THEN ",
  "#","<=","<>",">=","<",">","=","^","*","+","-","/",
  " NOT "," OR "," AND ",
  "(",")","=","=","<=","<>",">=","<",">","=","+","-",
  "(","","","(","(",",",
  "STR$","CHR$","USR","ASC","VAL","LEN","ADR","ATN","COS",
  "PEEK","SIN","RND","FRE","EXP","LOG","CLOG","SQR","SGN",
  "ABS","INT","PADDLE","STICK","PTRIG","STRIG",
  "DPEEK","&","!","INSTR","INKEY$"," EXOR ","HEX$","DEC",
  " DIV ","FRAC","TIME$","TIME"," MOD ","EXEC ","RND","RAND",
  "TRUNC","%0","%1","%2","%3","GO# ","UINSTR","ERR","ERL"]

They are the same than Atari BASIC lists, but with extensions. You must also add 0x0D type when checking a[j] to extract an hex constant from 6 byte data stored as a BCD number. For string constants, you must duplicate the contained double quotes. I think there was also a check for variable numbers for more than 128 of them (probably token 0x54 is related).

 

I hope this helps...

 

 

It did. Many thx. Now with Turbobasic, cheese etc.

 

image.thumb.png.00c75642d91854a51f45ac24673cf0bd.png

atr_image_explorer.htm

  • Like 4
Link to comment
Share on other sites

1 hour ago, rossum said:

tokens = ["REM ","DATA ","INPUT ","COLOR ","LIST ","ENTER ","LET ", "IF ","FOR ","NEXT ","GOTO ","GO TO ","GOSUB ","TRAP ", "BYE ","CONT ","COM ","CLOSE ","CLR ","DEG ","DIM ","END ", "NEW ","OPEN ","LOAD ","SAVE ","STATUS ","NOTE ","POINT ", "XIO ","ON ","POKE ","PRINT ","RAD ","READ ","RESTORE ", "RETURN ","RUN ","STOP ","POP ","? ","GET ","PUT ", "GRAPHICS ","PLOT ","POSITION ","DOS ","DRAWTO ","SETCOLOR ", "LOCATE ","SOUND ","LPRINT ","CSAVE ","CLOAD ","","ERROR - ", "DPOKE ","MOVE ","-MOVE ","*F" ,"REPEAT ","UNTIL ","WHILE ","WEND ", "ELSE ","ENDIF ","BPUT ","BGET ","FILLTO ","DO ","LOOP ","EXIT ", "DIR ","LOCK ","UNLOCK ","RENAME ","DELETE ","PAUSE ","TIME$= ", "PROC ","EXEC ","ENDPROC ","FCOLOR ","*L ", "------------------------------".chr(155), "RENUM ","DEL ","DUMP ","TRACE ","TEXT ","BLOAD ","BRUN ","GO# ","# ", "*B ","PAINT ","CLS ","DSOUND ","CIRCLE ","%PUT ","%GET "]

 

14 minutes ago, MrFish said:

It shouldn't be showing the "ESC" character at the end of these dashed lines.

Clearly, it is interpreting the chr(155) I included in my list as a displayed character, but it actually acts as a line feed. I wrote that code about 15 years ago, and I'm not sure how I managed it. I guess that it can be removed from the list for this tool.

 

BTW, my statements list also includes the spaces for both Atari and TurboBasic reserved words, in order to manage them with a single algorithm, without checking if it is standard or extended (token id greater than 56). A single parser for both syntaxes, without the need of to add a single whitespace where it is required.

 

Oh, in the file type, it should now say something like "Atari BASIC/TurboBasic XL".

 

  • Like 2
Link to comment
Share on other sites

Hi!

 

3 hours ago, rossum said:

It did. Many thx. Now with Turbobasic, cheese etc.

 

image.thumb.png.00c75642d91854a51f45ac24673cf0bd.png

atr_image_explorer.htm 105.24 kB · 11 downloads

To support variables > 127, you need to add the "0" token at line 1624, like this (from line 1621):

 

                    case 0x16: // EOL
                        k = end;
                        break;
                    case 0x00: // variable > 127
                        txt = b.variable_names[a[j+k++]];
                        break;
                    default: {
                        var txt;
                        if (op & 0x80)
                            txt = b.variable_names[op&0x7F];
                        else {

Have Fun!

 

  • Like 1
Link to comment
Share on other sites

9 minutes ago, MrFish said:

Should add indenting for tokenized TBXL listings.

That is not very practical, because that should require a logic parser, not just a detokenizer. The structures don't look good when lines are combined using ":". I think this should remains the same, just like after an "*L-" statement.

 

Link to comment
Share on other sites

5 minutes ago, vitoco said:

That is not very practical, because that should require a logic parser, not just a detokenizer. The structures don't look good when lines are combined using ":". I think this should remains the same, just like after an "*L-" statement.

 

It certainly looks better to have indenting for listings like above.

 

Maybe he could have it as an option -- just as it's an option in TBXL.

 

Edited by MrFish
Link to comment
Share on other sites

Hi!

36 minutes ago, MrFish said:

It certainly looks better to have indenting for listings like above.

 

Maybe he could have it as an option -- just as it's an option in TBXL.

 

 

Attached has the three changes for TBXL files:

- Adds support for more than 128 variables,

- Removes the EOL at the end of "--",

- Adds indentation.

 

As @vitoco said, for this you need to parse the code a little, to detect "IF" without "THEN". I used the same algorithm as the original TBXL.

 

Have Fun!

 

atr_image_explorer.htm

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

Hi!

1 hour ago, vitoco said:

That is not very practical, because that should require a logic parser, not just a detokenizer. The structures don't look good when lines are combined using ":". I think this should remains the same, just like after an "*L-" statement.

This version adds a toggle to show indented or plain listing.

 

1 hour ago, MrFish said:

Thanks, it's working well -- as expected.

And also fixes a bug with IF and comparisons to empty strings:  IF A$="" THEN  was indented.

 

Have Fun!

 

atr_image_explorer.htm

  • Like 5
Link to comment
Share on other sites

18 hours ago, dmsc said:

Hi!

This version adds a toggle to show indented or plain listing.

 

And also fixes a bug with IF and comparisons to empty strings:  IF A$="" THEN  was indented.

 

Have Fun!

 

atr_image_explorer.htm 107.25 kB · 25 downloads

Incorporated changes. thx much.

On 5/21/2020 at 8:29 PM, vitoco said:

Thanks for the update. Looks nice.

 

Couldn't an "Open" button be added somewhere on top or bottom of the left panel?

 

I dropped some random files to do some tests, and when I change the type for any of those files to "Hard Interlace Picture" (not being a file of that format), the header for the right pannel dissappears. Then, it is not possible to select other type for the file. Again, it could be a way to return to the default file format.

 

It is still missing an alternative way to display Font files, in order to use ANTIC 4 four color characters (2 bits per pixel similar to Graphics 7 Image, but on single scan lines).

 

For images without a defined palette, it could be great to use default color palette in addition to the grey scale (selectable?).

 

On ATASCII text modes, the extra top and bottom empty lines sometimes disturbs me...

 

These are the tokens and operands lists I extracted from my ATASCII printer:


tokens =
 ["REM ","DATA ","INPUT ","COLOR ","LIST ","ENTER ","LET ",
  "IF ","FOR ","NEXT ","GOTO ","GO TO ","GOSUB ","TRAP ",
  "BYE ","CONT ","COM ","CLOSE ","CLR ","DEG ","DIM ","END ",
  "NEW ","OPEN ","LOAD ","SAVE ","STATUS ","NOTE ","POINT ",
  "XIO ","ON ","POKE ","PRINT ","RAD ","READ ","RESTORE ",
  "RETURN ","RUN ","STOP ","POP ","? ","GET ","PUT ",
  "GRAPHICS ","PLOT ","POSITION ","DOS ","DRAWTO ","SETCOLOR ",
  "LOCATE ","SOUND ","LPRINT ","CSAVE ","CLOAD ","","ERROR - ",
  "DPOKE ","MOVE ","-MOVE ","*F" ,"REPEAT ","UNTIL ","WHILE ","WEND ",
  "ELSE ","ENDIF ","BPUT ","BGET ","FILLTO ","DO ","LOOP ","EXIT ",
  "DIR ","LOCK ","UNLOCK ","RENAME ","DELETE ","PAUSE ","TIME$= ",
  "PROC ","EXEC ","ENDPROC ","FCOLOR ","*L ",
  "------------------------------".chr(155),
  "RENUM ","DEL ","DUMP ","TRACE ","TEXT ","BLOAD ","BRUN ","GO# ","# ",
  "*B ","PAINT ","CLS ","DSOUND ","CIRCLE ","%PUT ","%GET "]

operators =
 ["","",",","$",":",";",chr(155),
  " GOTO "," GOSUB "," TO "," STEP "," THEN ",
  "#","<=","<>",">=","<",">","=","^","*","+","-","/",
  " NOT "," OR "," AND ",
  "(",")","=","=","<=","<>",">=","<",">","=","+","-",
  "(","","","(","(",",",
  "STR$","CHR$","USR","ASC","VAL","LEN","ADR","ATN","COS",
  "PEEK","SIN","RND","FRE","EXP","LOG","CLOG","SQR","SGN",
  "ABS","INT","PADDLE","STICK","PTRIG","STRIG",
  "DPEEK","&","!","INSTR","INKEY$"," EXOR ","HEX$","DEC",
  " DIV ","FRAC","TIME$","TIME"," MOD ","EXEC ","RND","RAND",
  "TRUNC","%0","%1","%2","%3","GO# ","UINSTR","ERR","ERL"]

They are the same than Atari BASIC lists, but with extensions. You must also add 0x0D type when checking a[j] to extract an hex constant from 6 byte data stored as a BCD number. For string constants, you must duplicate the contained double quotes. I think there was also a check for variable numbers for more than 128 of them (probably token 0x54 is related).

 

I hope this helps...

 

Added palette editor. Kinda fun with GR7.

 

image.thumb.png.c30181e3bfdd6d245d2e6e1b4dee2247.png

cheers

 

atr_image_explorer.htm

Edited by rossum
now with attachment...
  • Like 7
Link to comment
Share on other sites

Oops!

 

I got an out of memory error after dropping a random JPG file and changing from "Raw Data" (the default for an unknown extension) to a "Load and Go Executable".

 

I had not taken a look into the sources but I guess that the tool is not checking for invalid XEX binary pointers for blocks, for example, a lower end memory address than the start one.

 

Edited by vitoco
Link to comment
Share on other sites

Hi!

6 hours ago, rossum said:

 

You missed the support for variable numbers > 127, see attached test program and patched file, with this change:

 

image.thumb.png.9737baf3a6d3b87f1978b0a0bb8ae80d.png

 

Have Fun!

 

manyvars.bas atr_image_explorer.htm

  • Like 1
Link to comment
Share on other sites

10 hours ago, dmsc said:

Hi!

 

You missed the support for variable numbers > 127, see attached test program and patched file, with this change:

 

image.thumb.png.9737baf3a6d3b87f1978b0a0bb8ae80d.png

 

Have Fun!

 

manyvars.bas 4.42 kB · 7 downloads atr_image_explorer.htm 111.67 kB · 11 downloads

Oops. Thanks again, really appreciate it.

 

Added scan for hidden directory entries (Cribbage etc)

Annotate Sectors with file info in ATR dump.

 

atr_image_explorer.htm

  • Like 4
Link to comment
Share on other sites

1 hour ago, rossum said:

Added scan for hidden directory entries (Cribbage etc)

Thanks, but out of the images I tested it against, it only works for Cribbage.

 

Perhaps it is easier to just let the user enter the starting sector of the directory. The VTOC has for read-only access no relevance.

 

Find attached some images with varying starts of the directory (VTOC is mostly the sector before the directory).

 

$16B - Spelling Bee v1.2 (1983)(MECC)(US)[BASIC][cr CSS]

$187 - Factory, The (1983)(Human Engineered Software)(US)[!][BASIC][cr CSS]

$2C2 - Survival Math (1982)(Sunburst(US)(Disk 1 of 2)[BASIC][cr CSS]

$2C9 - Semantic Calculator, The (1983)(Sunburst)(US)[BASIC][cr CSS]

$237 - M-ss-ng L-nks (1984)(Human Engineered Software)(US)[BASIC][OS-B][cr CSS]

$136 - Pond, The (1983)(Human Engineered Software)(US)[BASIC][cr CSS]

 

 

Various-Directories.zip

 

It also does not work for DOS 2.0 DD disks. It seems that DOS 2.0D only uses the first 128 bytes of each directory sector.

Atari Accountant, The (Disk 1 of 3)(Data Entry Program Diskette)(1981)(Atari)(US)[BASIC][OS-B][cr CSS].atr

 

Edited by DjayBee
Added DOS 2.0D
  • Like 1
Link to comment
Share on other sites

6 hours ago, DjayBee said:

Thanks, but out of the images I tested it against, it only works for Cribbage.

 

Perhaps it is easier to just let the user enter the starting sector of the directory. The VTOC has for read-only access no relevance.

 

Find attached some images with varying starts of the directory (VTOC is mostly the sector before the directory).

 

$16B - Spelling Bee v1.2 (1983)(MECC)(US)[BASIC][cr CSS]

$187 - Factory, The (1983)(Human Engineered Software)(US)[!][BASIC][cr CSS]

$2C2 - Survival Math (1982)(Sunburst(US)(Disk 1 of 2)[BASIC][cr CSS]

$2C9 - Semantic Calculator, The (1983)(Sunburst)(US)[BASIC][cr CSS]

$237 - M-ss-ng L-nks (1984)(Human Engineered Software)(US)[BASIC][OS-B][cr CSS]

$136 - Pond, The (1983)(Human Engineered Software)(US)[BASIC][cr CSS]

 

 

Various-Directories.zip 155.61 kB · 3 downloads

 

It also does not work for DOS 2.0 DD disks. It seems that DOS 2.0D only uses the first 128 bytes of each directory sector.

Atari Accountant, The (Disk 1 of 3)(Data Entry Program Diskette)(1981)(Atari)(US)[BASIC][OS-B][cr CSS].atr 179.64 kB · 0 downloads

 

This version does a full scan of the disk looking for directories and works for the above.

It also scans for files with no legitimate directory entries: kind of a poor man's unerase.

The Atari Accountant disk had garbage in the directory: sector start position and sized were mangled. an attempt at copy protection perhaps?

This new version recovers these files despite the broken directories.

 

many thanks for the help.

 

atr_image_explorer.htm

  • Like 4
Link to comment
Share on other sites

13 minutes ago, rossum said:

The Atari Accountant disk had garbage in the directory: sector start position and sized were mangled. an attempt at copy protection perhaps?

Yes, perhaps.

But most important: It works. :)

... also on a DD disk with a correct directory.

  • 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...