How can I view BASIC code hidden by SYS?
Clash Royale CLAN TAG#URR8PPP
up vote
3
down vote
favorite
I ran a validation of an old disk, and it turns out this ruined a game (won't load) and deleted my old high score list on David's Midnight Magic. I would like to edit the code to get the high score list back, but when I load the program and type list, it displays 711 SYS(2069) DMM
. What does this mean? I notice a similar message from Jumpman Jr. (which incidentally allows me to run the game by typing the sys command). Further, as per above, how can I move last this and actually view the code? The high score list must be there somewhere.
commodore-64 basic copy-protection
add a comment |Â
up vote
3
down vote
favorite
I ran a validation of an old disk, and it turns out this ruined a game (won't load) and deleted my old high score list on David's Midnight Magic. I would like to edit the code to get the high score list back, but when I load the program and type list, it displays 711 SYS(2069) DMM
. What does this mean? I notice a similar message from Jumpman Jr. (which incidentally allows me to run the game by typing the sys command). Further, as per above, how can I move last this and actually view the code? The high score list must be there somewhere.
commodore-64 basic copy-protection
1
It's possible that the "validation" destroyed the high score list entirely. Which tool did you use to validate it? (This is tangential to the actual question.)
â wizzwizz4â¦
Sep 8 at 10:18
2
I typed firstOPEN 15,8,15
thenPRINT#15,"V"
. Before doing anything else, I allowed the drive to finish, even though the screen displayed READY. I am using an original CBM64 with a 1541-II floppy drive, so no emulator. In other words: No tools in particular, but the commands supported natively by the floppy drive.
â Canned Man
Sep 8 at 15:46
Make sure everything you want to keep comes off that floppy; I think it is dying.
â wizzwizz4â¦
Sep 8 at 20:51
2
The Validate DOS command rearranges the free blocks on the disk. If the highscore list was hidden somewhere in the free blocks (not unlikely), it's gone now.
â Janka
Sep 8 at 23:46
add a comment |Â
up vote
3
down vote
favorite
up vote
3
down vote
favorite
I ran a validation of an old disk, and it turns out this ruined a game (won't load) and deleted my old high score list on David's Midnight Magic. I would like to edit the code to get the high score list back, but when I load the program and type list, it displays 711 SYS(2069) DMM
. What does this mean? I notice a similar message from Jumpman Jr. (which incidentally allows me to run the game by typing the sys command). Further, as per above, how can I move last this and actually view the code? The high score list must be there somewhere.
commodore-64 basic copy-protection
I ran a validation of an old disk, and it turns out this ruined a game (won't load) and deleted my old high score list on David's Midnight Magic. I would like to edit the code to get the high score list back, but when I load the program and type list, it displays 711 SYS(2069) DMM
. What does this mean? I notice a similar message from Jumpman Jr. (which incidentally allows me to run the game by typing the sys command). Further, as per above, how can I move last this and actually view the code? The high score list must be there somewhere.
commodore-64 basic copy-protection
commodore-64 basic copy-protection
asked Sep 8 at 9:49
Canned Man
183
183
1
It's possible that the "validation" destroyed the high score list entirely. Which tool did you use to validate it? (This is tangential to the actual question.)
â wizzwizz4â¦
Sep 8 at 10:18
2
I typed firstOPEN 15,8,15
thenPRINT#15,"V"
. Before doing anything else, I allowed the drive to finish, even though the screen displayed READY. I am using an original CBM64 with a 1541-II floppy drive, so no emulator. In other words: No tools in particular, but the commands supported natively by the floppy drive.
â Canned Man
Sep 8 at 15:46
Make sure everything you want to keep comes off that floppy; I think it is dying.
â wizzwizz4â¦
Sep 8 at 20:51
2
The Validate DOS command rearranges the free blocks on the disk. If the highscore list was hidden somewhere in the free blocks (not unlikely), it's gone now.
â Janka
Sep 8 at 23:46
add a comment |Â
1
It's possible that the "validation" destroyed the high score list entirely. Which tool did you use to validate it? (This is tangential to the actual question.)
â wizzwizz4â¦
Sep 8 at 10:18
2
I typed firstOPEN 15,8,15
thenPRINT#15,"V"
. Before doing anything else, I allowed the drive to finish, even though the screen displayed READY. I am using an original CBM64 with a 1541-II floppy drive, so no emulator. In other words: No tools in particular, but the commands supported natively by the floppy drive.
â Canned Man
Sep 8 at 15:46
Make sure everything you want to keep comes off that floppy; I think it is dying.
â wizzwizz4â¦
Sep 8 at 20:51
2
The Validate DOS command rearranges the free blocks on the disk. If the highscore list was hidden somewhere in the free blocks (not unlikely), it's gone now.
â Janka
Sep 8 at 23:46
1
1
It's possible that the "validation" destroyed the high score list entirely. Which tool did you use to validate it? (This is tangential to the actual question.)
â wizzwizz4â¦
Sep 8 at 10:18
It's possible that the "validation" destroyed the high score list entirely. Which tool did you use to validate it? (This is tangential to the actual question.)
â wizzwizz4â¦
Sep 8 at 10:18
2
2
I typed first
OPEN 15,8,15
then PRINT#15,"V"
. Before doing anything else, I allowed the drive to finish, even though the screen displayed READY. I am using an original CBM64 with a 1541-II floppy drive, so no emulator. In other words: No tools in particular, but the commands supported natively by the floppy drive.â Canned Man
Sep 8 at 15:46
I typed first
OPEN 15,8,15
then PRINT#15,"V"
. Before doing anything else, I allowed the drive to finish, even though the screen displayed READY. I am using an original CBM64 with a 1541-II floppy drive, so no emulator. In other words: No tools in particular, but the commands supported natively by the floppy drive.â Canned Man
Sep 8 at 15:46
Make sure everything you want to keep comes off that floppy; I think it is dying.
â wizzwizz4â¦
Sep 8 at 20:51
Make sure everything you want to keep comes off that floppy; I think it is dying.
â wizzwizz4â¦
Sep 8 at 20:51
2
2
The Validate DOS command rearranges the free blocks on the disk. If the highscore list was hidden somewhere in the free blocks (not unlikely), it's gone now.
â Janka
Sep 8 at 23:46
The Validate DOS command rearranges the free blocks on the disk. If the highscore list was hidden somewhere in the free blocks (not unlikely), it's gone now.
â Janka
Sep 8 at 23:46
add a comment |Â
3 Answers
3
active
oldest
votes
up vote
10
down vote
accepted
SYS
is the BASIC instruction to execute a routine written in machine code. There is no more BASIC code to view, the entire game is implemented as a machine code program, and the BASIC only exists as a stub to make it easier to load and run.
The best approach to viewing what the code actually does and potentially being able to restore your table (if it is still there at all) is to load the program into an emulator that has an integrated machine-level monitor/debugger. The most popular C64 emulator is VICE and although I've never used it so can't comment on how good it is, it definitely includes a monitor with the ability to disassemble code.
How would you go about doing that when it is saved on LD floppies? Is there any way to connect a 1541-II to a modern PC? I know it runs on a serial connection. Might there be ways to connect it to an IBM serial connection?
â Canned Man
Sep 8 at 15:49
I'm afraid I've never worked with C64 disks at all, so have no idea about that. If there isn't a question here on the subject already, it would be a very good topic for a new one...
â Jules
Sep 8 at 15:56
Have a look at the ZoomFloppy: go4retro.com/products/zoomfloppy
â bodgit
Sep 10 at 13:23
add a comment |Â
up vote
3
down vote
A lot of Commodore 8-bit computer games used a disk that had random-access files on them. This means they were written directly to disk blocks, not via a program, sequential or relative file, which are the three ways Commodore DOS officially supports files.
Random files are protected by having the programmer manually mark the blocks as being used. This works perfectly well... unless you validate the disk like you did. When this happens, Commodore DOS scans the disk and sees if any blocks (sectors) aren't tied to a file in the disk directory. This means all PRG, SEQ and REL files will continue to be protected (or re-protected, if some of the blocks were accidentally de-allocated). However, it means if there are any random file blocks, they will be marked as being available.
Even now, you still don't have a problem, but if you write a file to the disk, there is a chance DOS will use a block that had a random file on it, and this data will then be overwritten.
I suspect this is what happened to you, in which case you'll need a backup to restore your high score list (now you've learned the importance of backups :) ).
add a comment |Â
up vote
2
down vote
As Jules said, SYS is the BASIC instruction to execute a routine in machine code. Very much like GOSUB. USR is the equivalent of DEF FN.
There are 2 ways in which machine code is loaded
It is saved with the code. This is great against piracy but it is a pain to modify. Also any minor mod you make might wipe out the assembler.
There is a bunch of data statements with a whole bunch of numbers and somewhere in the code, there is a loop which reads the data and pokes it to consecutive locations.
If the second method is used, you're in luck. Somewhere in the code, it will overwrite one of the data statements and resave the file. All you have to do is convert the bunch of numbers to assembler to work out what it is doing.
If you haven't used 6502 assembler before be aware of the switch statement trick in 6502 assembler which jumps to the middle of the BIT instruction.
Also noticed that the instruction said
711 SYS(2069) DMM
DMM probably means David's Midnight Magic. There may be others using the same routine which pass different parameters across.
add a comment |Â
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
10
down vote
accepted
SYS
is the BASIC instruction to execute a routine written in machine code. There is no more BASIC code to view, the entire game is implemented as a machine code program, and the BASIC only exists as a stub to make it easier to load and run.
The best approach to viewing what the code actually does and potentially being able to restore your table (if it is still there at all) is to load the program into an emulator that has an integrated machine-level monitor/debugger. The most popular C64 emulator is VICE and although I've never used it so can't comment on how good it is, it definitely includes a monitor with the ability to disassemble code.
How would you go about doing that when it is saved on LD floppies? Is there any way to connect a 1541-II to a modern PC? I know it runs on a serial connection. Might there be ways to connect it to an IBM serial connection?
â Canned Man
Sep 8 at 15:49
I'm afraid I've never worked with C64 disks at all, so have no idea about that. If there isn't a question here on the subject already, it would be a very good topic for a new one...
â Jules
Sep 8 at 15:56
Have a look at the ZoomFloppy: go4retro.com/products/zoomfloppy
â bodgit
Sep 10 at 13:23
add a comment |Â
up vote
10
down vote
accepted
SYS
is the BASIC instruction to execute a routine written in machine code. There is no more BASIC code to view, the entire game is implemented as a machine code program, and the BASIC only exists as a stub to make it easier to load and run.
The best approach to viewing what the code actually does and potentially being able to restore your table (if it is still there at all) is to load the program into an emulator that has an integrated machine-level monitor/debugger. The most popular C64 emulator is VICE and although I've never used it so can't comment on how good it is, it definitely includes a monitor with the ability to disassemble code.
How would you go about doing that when it is saved on LD floppies? Is there any way to connect a 1541-II to a modern PC? I know it runs on a serial connection. Might there be ways to connect it to an IBM serial connection?
â Canned Man
Sep 8 at 15:49
I'm afraid I've never worked with C64 disks at all, so have no idea about that. If there isn't a question here on the subject already, it would be a very good topic for a new one...
â Jules
Sep 8 at 15:56
Have a look at the ZoomFloppy: go4retro.com/products/zoomfloppy
â bodgit
Sep 10 at 13:23
add a comment |Â
up vote
10
down vote
accepted
up vote
10
down vote
accepted
SYS
is the BASIC instruction to execute a routine written in machine code. There is no more BASIC code to view, the entire game is implemented as a machine code program, and the BASIC only exists as a stub to make it easier to load and run.
The best approach to viewing what the code actually does and potentially being able to restore your table (if it is still there at all) is to load the program into an emulator that has an integrated machine-level monitor/debugger. The most popular C64 emulator is VICE and although I've never used it so can't comment on how good it is, it definitely includes a monitor with the ability to disassemble code.
SYS
is the BASIC instruction to execute a routine written in machine code. There is no more BASIC code to view, the entire game is implemented as a machine code program, and the BASIC only exists as a stub to make it easier to load and run.
The best approach to viewing what the code actually does and potentially being able to restore your table (if it is still there at all) is to load the program into an emulator that has an integrated machine-level monitor/debugger. The most popular C64 emulator is VICE and although I've never used it so can't comment on how good it is, it definitely includes a monitor with the ability to disassemble code.
answered Sep 8 at 10:21
Jules
7,38612038
7,38612038
How would you go about doing that when it is saved on LD floppies? Is there any way to connect a 1541-II to a modern PC? I know it runs on a serial connection. Might there be ways to connect it to an IBM serial connection?
â Canned Man
Sep 8 at 15:49
I'm afraid I've never worked with C64 disks at all, so have no idea about that. If there isn't a question here on the subject already, it would be a very good topic for a new one...
â Jules
Sep 8 at 15:56
Have a look at the ZoomFloppy: go4retro.com/products/zoomfloppy
â bodgit
Sep 10 at 13:23
add a comment |Â
How would you go about doing that when it is saved on LD floppies? Is there any way to connect a 1541-II to a modern PC? I know it runs on a serial connection. Might there be ways to connect it to an IBM serial connection?
â Canned Man
Sep 8 at 15:49
I'm afraid I've never worked with C64 disks at all, so have no idea about that. If there isn't a question here on the subject already, it would be a very good topic for a new one...
â Jules
Sep 8 at 15:56
Have a look at the ZoomFloppy: go4retro.com/products/zoomfloppy
â bodgit
Sep 10 at 13:23
How would you go about doing that when it is saved on LD floppies? Is there any way to connect a 1541-II to a modern PC? I know it runs on a serial connection. Might there be ways to connect it to an IBM serial connection?
â Canned Man
Sep 8 at 15:49
How would you go about doing that when it is saved on LD floppies? Is there any way to connect a 1541-II to a modern PC? I know it runs on a serial connection. Might there be ways to connect it to an IBM serial connection?
â Canned Man
Sep 8 at 15:49
I'm afraid I've never worked with C64 disks at all, so have no idea about that. If there isn't a question here on the subject already, it would be a very good topic for a new one...
â Jules
Sep 8 at 15:56
I'm afraid I've never worked with C64 disks at all, so have no idea about that. If there isn't a question here on the subject already, it would be a very good topic for a new one...
â Jules
Sep 8 at 15:56
Have a look at the ZoomFloppy: go4retro.com/products/zoomfloppy
â bodgit
Sep 10 at 13:23
Have a look at the ZoomFloppy: go4retro.com/products/zoomfloppy
â bodgit
Sep 10 at 13:23
add a comment |Â
up vote
3
down vote
A lot of Commodore 8-bit computer games used a disk that had random-access files on them. This means they were written directly to disk blocks, not via a program, sequential or relative file, which are the three ways Commodore DOS officially supports files.
Random files are protected by having the programmer manually mark the blocks as being used. This works perfectly well... unless you validate the disk like you did. When this happens, Commodore DOS scans the disk and sees if any blocks (sectors) aren't tied to a file in the disk directory. This means all PRG, SEQ and REL files will continue to be protected (or re-protected, if some of the blocks were accidentally de-allocated). However, it means if there are any random file blocks, they will be marked as being available.
Even now, you still don't have a problem, but if you write a file to the disk, there is a chance DOS will use a block that had a random file on it, and this data will then be overwritten.
I suspect this is what happened to you, in which case you'll need a backup to restore your high score list (now you've learned the importance of backups :) ).
add a comment |Â
up vote
3
down vote
A lot of Commodore 8-bit computer games used a disk that had random-access files on them. This means they were written directly to disk blocks, not via a program, sequential or relative file, which are the three ways Commodore DOS officially supports files.
Random files are protected by having the programmer manually mark the blocks as being used. This works perfectly well... unless you validate the disk like you did. When this happens, Commodore DOS scans the disk and sees if any blocks (sectors) aren't tied to a file in the disk directory. This means all PRG, SEQ and REL files will continue to be protected (or re-protected, if some of the blocks were accidentally de-allocated). However, it means if there are any random file blocks, they will be marked as being available.
Even now, you still don't have a problem, but if you write a file to the disk, there is a chance DOS will use a block that had a random file on it, and this data will then be overwritten.
I suspect this is what happened to you, in which case you'll need a backup to restore your high score list (now you've learned the importance of backups :) ).
add a comment |Â
up vote
3
down vote
up vote
3
down vote
A lot of Commodore 8-bit computer games used a disk that had random-access files on them. This means they were written directly to disk blocks, not via a program, sequential or relative file, which are the three ways Commodore DOS officially supports files.
Random files are protected by having the programmer manually mark the blocks as being used. This works perfectly well... unless you validate the disk like you did. When this happens, Commodore DOS scans the disk and sees if any blocks (sectors) aren't tied to a file in the disk directory. This means all PRG, SEQ and REL files will continue to be protected (or re-protected, if some of the blocks were accidentally de-allocated). However, it means if there are any random file blocks, they will be marked as being available.
Even now, you still don't have a problem, but if you write a file to the disk, there is a chance DOS will use a block that had a random file on it, and this data will then be overwritten.
I suspect this is what happened to you, in which case you'll need a backup to restore your high score list (now you've learned the importance of backups :) ).
A lot of Commodore 8-bit computer games used a disk that had random-access files on them. This means they were written directly to disk blocks, not via a program, sequential or relative file, which are the three ways Commodore DOS officially supports files.
Random files are protected by having the programmer manually mark the blocks as being used. This works perfectly well... unless you validate the disk like you did. When this happens, Commodore DOS scans the disk and sees if any blocks (sectors) aren't tied to a file in the disk directory. This means all PRG, SEQ and REL files will continue to be protected (or re-protected, if some of the blocks were accidentally de-allocated). However, it means if there are any random file blocks, they will be marked as being available.
Even now, you still don't have a problem, but if you write a file to the disk, there is a chance DOS will use a block that had a random file on it, and this data will then be overwritten.
I suspect this is what happened to you, in which case you'll need a backup to restore your high score list (now you've learned the importance of backups :) ).
answered Sep 9 at 1:10
Jim MacKenzie
812125
812125
add a comment |Â
add a comment |Â
up vote
2
down vote
As Jules said, SYS is the BASIC instruction to execute a routine in machine code. Very much like GOSUB. USR is the equivalent of DEF FN.
There are 2 ways in which machine code is loaded
It is saved with the code. This is great against piracy but it is a pain to modify. Also any minor mod you make might wipe out the assembler.
There is a bunch of data statements with a whole bunch of numbers and somewhere in the code, there is a loop which reads the data and pokes it to consecutive locations.
If the second method is used, you're in luck. Somewhere in the code, it will overwrite one of the data statements and resave the file. All you have to do is convert the bunch of numbers to assembler to work out what it is doing.
If you haven't used 6502 assembler before be aware of the switch statement trick in 6502 assembler which jumps to the middle of the BIT instruction.
Also noticed that the instruction said
711 SYS(2069) DMM
DMM probably means David's Midnight Magic. There may be others using the same routine which pass different parameters across.
add a comment |Â
up vote
2
down vote
As Jules said, SYS is the BASIC instruction to execute a routine in machine code. Very much like GOSUB. USR is the equivalent of DEF FN.
There are 2 ways in which machine code is loaded
It is saved with the code. This is great against piracy but it is a pain to modify. Also any minor mod you make might wipe out the assembler.
There is a bunch of data statements with a whole bunch of numbers and somewhere in the code, there is a loop which reads the data and pokes it to consecutive locations.
If the second method is used, you're in luck. Somewhere in the code, it will overwrite one of the data statements and resave the file. All you have to do is convert the bunch of numbers to assembler to work out what it is doing.
If you haven't used 6502 assembler before be aware of the switch statement trick in 6502 assembler which jumps to the middle of the BIT instruction.
Also noticed that the instruction said
711 SYS(2069) DMM
DMM probably means David's Midnight Magic. There may be others using the same routine which pass different parameters across.
add a comment |Â
up vote
2
down vote
up vote
2
down vote
As Jules said, SYS is the BASIC instruction to execute a routine in machine code. Very much like GOSUB. USR is the equivalent of DEF FN.
There are 2 ways in which machine code is loaded
It is saved with the code. This is great against piracy but it is a pain to modify. Also any minor mod you make might wipe out the assembler.
There is a bunch of data statements with a whole bunch of numbers and somewhere in the code, there is a loop which reads the data and pokes it to consecutive locations.
If the second method is used, you're in luck. Somewhere in the code, it will overwrite one of the data statements and resave the file. All you have to do is convert the bunch of numbers to assembler to work out what it is doing.
If you haven't used 6502 assembler before be aware of the switch statement trick in 6502 assembler which jumps to the middle of the BIT instruction.
Also noticed that the instruction said
711 SYS(2069) DMM
DMM probably means David's Midnight Magic. There may be others using the same routine which pass different parameters across.
As Jules said, SYS is the BASIC instruction to execute a routine in machine code. Very much like GOSUB. USR is the equivalent of DEF FN.
There are 2 ways in which machine code is loaded
It is saved with the code. This is great against piracy but it is a pain to modify. Also any minor mod you make might wipe out the assembler.
There is a bunch of data statements with a whole bunch of numbers and somewhere in the code, there is a loop which reads the data and pokes it to consecutive locations.
If the second method is used, you're in luck. Somewhere in the code, it will overwrite one of the data statements and resave the file. All you have to do is convert the bunch of numbers to assembler to work out what it is doing.
If you haven't used 6502 assembler before be aware of the switch statement trick in 6502 assembler which jumps to the middle of the BIT instruction.
Also noticed that the instruction said
711 SYS(2069) DMM
DMM probably means David's Midnight Magic. There may be others using the same routine which pass different parameters across.
answered Sep 8 at 18:04
cup
46117
46117
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fretrocomputing.stackexchange.com%2fquestions%2f7514%2fhow-can-i-view-basic-code-hidden-by-sys%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
1
It's possible that the "validation" destroyed the high score list entirely. Which tool did you use to validate it? (This is tangential to the actual question.)
â wizzwizz4â¦
Sep 8 at 10:18
2
I typed first
OPEN 15,8,15
thenPRINT#15,"V"
. Before doing anything else, I allowed the drive to finish, even though the screen displayed READY. I am using an original CBM64 with a 1541-II floppy drive, so no emulator. In other words: No tools in particular, but the commands supported natively by the floppy drive.â Canned Man
Sep 8 at 15:46
Make sure everything you want to keep comes off that floppy; I think it is dying.
â wizzwizz4â¦
Sep 8 at 20:51
2
The Validate DOS command rearranges the free blocks on the disk. If the highscore list was hidden somewhere in the free blocks (not unlikely), it's gone now.
â Janka
Sep 8 at 23:46