CCS64 Forum

A forum to discuss issues about CCS64!
It is currently Wed Oct 18, 2017 11:05 am

All times are UTC + 2 hours




Post new topic Reply to topic  [ 14 posts ] 
Author Message
 Post subject: SYS2063 etc.
PostPosted: Mon May 22, 2006 9:19 pm 
Offline

Joined: Tue Aug 03, 2004 4:06 pm
Posts: 125
Location: FLA, USA
Hi all. I dont have an issue, nor do I know where to post this. Back in the day when I started to want to edit games (before I found the good ol EX-DOS program), I always wondered what the SYS2063 (or any other number) meant. Or what was the best way to edit the programs. Any input? Thanks

_________________
When is the C64 gonna make a comeback?! LOL


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 23, 2006 8:27 am 
Offline

Joined: Fri Nov 12, 2004 12:12 pm
Posts: 115
Location: The Netherlands
SYS 2063 starts a machine code program beginning at address 2063.
BASIC programs are default loaded from address 2048. The line 10 SYS 2063 is just a small BASIC program. When loading a game and listing it, you will only see this line, but there is much more loaded. The machine language program is loaded just behind the last character of the BASIC line. This is most somewhere between 2060 and 2070. 2063 is just the position where the BASIC program stops and the machine language code starts.


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 23, 2006 1:07 pm 
Offline

Joined: Tue Aug 03, 2004 4:06 pm
Posts: 125
Location: FLA, USA
So what programs to use to get in there? Also is the SYS code one to use to interpret the mchine language? Too bad the internet was not around back then. The BBS was way too expensive to use, and not nearly as common.

_________________
When is the C64 gonna make a comeback?! LOL


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 06, 2006 1:17 pm 
Offline

Joined: Tue Aug 03, 2004 4:06 pm
Posts: 125
Location: FLA, USA
Anyone........

_________________
When is the C64 gonna make a comeback?! LOL


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 07, 2006 12:41 pm 
Offline

Joined: Fri Nov 12, 2004 12:12 pm
Posts: 115
Location: The Netherlands
I am not a machine code programmer, so I doubt that I'm the right person to answer your questions, but I'll give it a try. :)
SYS xxxx is a Basic command that starts a machine-code program beginning at address position xxxx. What RUN is for Basic, is SYS for machine code.
Every memory address has a value between 0 and 255. These values in the right order are the machine code program.
To view/edit it, you can use a monitor program. There are plenty of these programs, but they are also available in a lot of cartridges, like The Final Cartridge III.
To create a program in machine language, you will need an assembler. With an assembler you can type in machine code commands and comment your program. The assembler program will generate a real machine code program from the source you typed in.
You can find a good start for learning machine code right here.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 07, 2006 1:33 pm 
Offline

Joined: Tue Aug 03, 2004 4:06 pm
Posts: 125
Location: FLA, USA
Thank you KC.

_________________
When is the C64 gonna make a comeback?! LOL


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 13, 2006 9:51 pm 
Offline

Joined: Fri Oct 03, 2003 12:19 pm
Posts: 78
I's a llil more complex then that, usually.

Most games are written in asembler for c64.

HOwever to load into the proper memory locations, non relocating loads must be performed. (,8,1)

The problem is then you have to write a loader tha loads the m/l and starts it with a sys command.

So some people came up with this brillinat idea.

Take the parts of the main game, and relocate them all to just after basic memory. plae a small basic program in memory with a sys command to jump to just after it. Also they are often compressed using some sort of packer to save space when the final fie is saved onto disk/tape.

Then place a a ML move routine (maybe 30 bytes or so) after the basic progam at the specified sys address to move the other parts of the program back where they belong and/or uncompress them, then JMP to the right location to start the game.

Normally, only a contigious block of memory can be loaded. so we have 1 to 15 different data files to load or so. but with this method, they are all stored into one singe file that will load directly into basic memory and is compatible with all fastloader carts.

And thus, we have the Onefile, the favorite of pirates everywhere. :)

Such games generally cannot be edited. You will need to unpack the data, modify it, then pack it back together. Easier jstu to go to the original version usually. it's what remember/nostalgia/et. al do.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 15, 2006 2:14 pm 
Offline

Joined: Tue Aug 03, 2004 4:06 pm
Posts: 125
Location: FLA, USA
Okay, I am totally confused now. :? One part that you are incorrect is the files could be edited with EX-DOS, but you could only edit text that were not encrypted or whatever was used. I would like to disassemble one to see what is inside.

_________________
When is the C64 gonna make a comeback?! LOL


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 15, 2006 4:03 pm 
Offline

Joined: Fri Oct 03, 2003 12:19 pm
Posts: 78
SUre you can always try to edit the bytes directly, but as there is uusually compression in those files it won't have the expected effect, if you are lucky enough to spot readable text strings, then yes they can be changed (but the size of them can't)

if you want to do editing of cracked games, better to start with one of those that loads multiple files from disk before tstarting because those are usually uncompressed.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 16, 2006 5:32 pm 
Offline

Joined: Tue Aug 03, 2004 4:06 pm
Posts: 125
Location: FLA, USA
Quote:
then yes they can be changed (but the size of them can't)


LOL, yeah I figured that one out the hard way, back in the 80's. So the ones that were missing any text strings were compressed?

_________________
When is the C64 gonna make a comeback?! LOL


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 20, 2006 9:14 am 
Offline

Joined: Fri Oct 03, 2003 12:19 pm
Posts: 78
Precisely.

SOme crackers were notorious for stickig their name into prograsms in a way that is very difficult to remove. JEDI is the best example here, going so far as to repalce the "WILD CARD" in Matchboxes with a "JEDI CARD" for example. lol.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 21, 2006 1:17 pm 
Offline

Joined: Tue Aug 03, 2004 4:06 pm
Posts: 125
Location: FLA, USA
So how are they decompressed? Disassembler?

_________________
When is the C64 gonna make a comeback?! LOL


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 22, 2006 4:08 pm 
Offline

Joined: Thu Jun 22, 2006 2:39 pm
Posts: 11
Location: Michigan
renegade X wrote:
So how are they decompressed? Disassembler?

A compression program and a disassembler are two completely different types of things.

WinZip is a type of compression program. You have to understand that sometimes you have a need for areas of memory to be all filled with the same value. On the C64 you have a 1K area for the character info and another 1K area for the color of each of the characters. If you want all the characters on the screen to be the same color then you would have to fill the color area with all the same value. With a compression program, you can compress that 1000 bytes down to as littles as 12 bytes saving a lot of space. When you say decompressed, it just means unzipped.

Assembler is close to the same as machine language. Computers don't understand words like you and I, they just know a string of bits. This means that whenever you write a program, it has to be translated or converted (compiled) into something your computer can understand. This final code is called machine language. A program written in BASIC needs an intreptor to run. This means that for every line in the program it has to be interpreted on the fly which can really slow things down. A program can run much faster if it were written in the language the computer understands. Most of the video games are originally written using a compiler program. This means they can use a "source code" with names instead of just numbers. Their "source code" is "compiled" into "object code" which is all numbers.

You should first understand that machine language uses hexidecimal numbers instead of decimal. This is a base 16 numbering system. It goes 1 2 3 4 5 6 7 8 9 A B C D E F and then 10. # stands for base 10 decimal and $ stands for base 16 hexidecimal. This means $10 hex is #16 dec. When you see the number #2063 it means hex $08of.

If you get yourself a copy of the Commodore 64 Programmer's Reference Guide then it will tell you quite a lot about 6502 machine language along with a lot of good info on the C64. You will learn that the 3 byte string of "4C 00 C0" menas JMP $C000. Now when you go into the Machine Language Monitor inside the CCS64, you may begin to understand what you're looking at. But it could takes years of programming experience to even have a glimpse of what they're doing that way. If you wanted to actually see what they're doing then you would need the source code, and they're not providing that.

Some links to an on line Reference Guide

Cover page
http://www.devili.iki.fi/Computers/Comm ... cover.html

Table of contents
http://www.devili.iki.fi/Computers/Comm ... e_iii.html

1st page of 6502 machine language
http://www.devili.iki.fi/Computers/Comm ... e_232.html

_________________
Anything is possible, when you don't know what you're talking about.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 26, 2006 1:20 pm 
Offline

Joined: Tue Aug 03, 2004 4:06 pm
Posts: 125
Location: FLA, USA
Thanks Donski, that makes it clear.

_________________
When is the C64 gonna make a comeback?! LOL


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ] 

All times are UTC + 2 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group