I would like to know more about HOW did Paul do it? I read his statement that he wrote a disasembler and worked over it about 6 months (!) on it ("crazy thing to do. But it works"). I`d like to read more about the process of translating the machine code.Paul dissembled the machine code for atari to covert for PC
How was CSBWin created?
Moderator: Zyx
Forum rules
Please read the Forum rules and policies before posting.
Please read the Forum rules and policies before posting.
How was CSBWin created?
Spoiler
(\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/)
Spoiler
(@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@)
Spoiler
(>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<)
- Paul Stevens
- CSBwin Guru
- Posts: 4318
- Joined: Sun Apr 08, 2001 6:00 pm
- Location: Madison, Wisconsin, USA
Re: How was CSBWin created?
You cannot believe it until you try it.
I did it manually. Bit did it more mechanically.
Bit is a bit more loquacious than I. Perhaps he can
outline his methods for you.
If you have some Atari binary code you want to translate,
I am willing to help get you started.
I did it manually. Bit did it more mechanically.
Bit is a bit more loquacious than I. Perhaps he can
outline his methods for you.
If you have some Atari binary code you want to translate,
I am willing to help get you started.
- ChristopheF
- Encyclopedist
- Posts: 1538
- Joined: Sun Oct 24, 1999 2:36 pm
- Location: France
- Contact:
Re: How was CSBWin created?
I made my own disassemblies of all versions of DM & CSB for Atari ST using the following method:
On Atari ST versions, the program is compressed in START.PAK. You can use SCK to uncompress the START.PAK file or write your own tool as the PAK format is described here: http://greatstone.free.fr/dm/d_pak.html
The result is a standard Atari executable file (.PRG).
In order to disassemble the .prg files I used a freeware disassembler called TTDigger: http://members.chello.nl/h.robbers/TTD.html
The resulting assembler code must be tweaked a bit as there are a few data sections inside the code that are treated as instructions by default.
On Atari ST versions, the program is compressed in START.PAK. You can use SCK to uncompress the START.PAK file or write your own tool as the PAK format is described here: http://greatstone.free.fr/dm/d_pak.html
The result is a standard Atari executable file (.PRG).
In order to disassemble the .prg files I used a freeware disassembler called TTDigger: http://members.chello.nl/h.robbers/TTD.html
The resulting assembler code must be tweaked a bit as there are a few data sections inside the code that are treated as instructions by default.
Christophe - Dungeon Master Encyclopaedia
Re: How was CSBWin created?
haha, I don`t have anything like that.If you have some Atari binary code you want to translate,
I am willing to help get you started.
![Smile :)](./images/smilies/icon_e_smile.gif)
Manually? Did you do it in first half of 2002?I did it manually.
I would like to know more about the process, but I don`t even know what to ask, because I don`t know much about that.
Did you have to understand CSB machine code deeply to translate it into something else? I guess translating machine code is a hard task?
As far as I remember, there was 60000+ lines of code, wasn`t it?
Could you give an example line of machine code and its translation into the format used in CSBwin? I`m just curious..
Spoiler
(\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/)
Spoiler
(@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@)
Spoiler
(>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<)
- Paul Stevens
- CSBwin Guru
- Posts: 4318
- Joined: Sun Apr 08, 2001 6:00 pm
- Location: Madison, Wisconsin, USA
Re: How was CSBWin created?
Go fetch
http://dianneandpaul.net/CSBwin/CSBwin_ ... Source.zip
It is pretty much the whole thing. Example:
What we started with:
528a
200a
2640
What the disassembler did ( I wrote my own disassembler. And yes, I was
very familiar with both the binary and assembly machine language.)
528a ADDQ.L #1,A2
200a MOVE.L A2,D0
2640 MOVE.L D0,A3
What I did manually:
//528a ADDQ.L #1,A2
//200a MOVE.L A2,D0
//2640 MOVE.L D0,A3
A3 = A2 + 1;
But that is the easy part. Figuring out why we added
a 1 to A2 and put it in A3 while destroying D0 and discarding
the value in A2 was the hard part.
http://dianneandpaul.net/CSBwin/CSBwin_ ... Source.zip
It is pretty much the whole thing. Example:
What we started with:
528a
200a
2640
What the disassembler did ( I wrote my own disassembler. And yes, I was
very familiar with both the binary and assembly machine language.)
528a ADDQ.L #1,A2
200a MOVE.L A2,D0
2640 MOVE.L D0,A3
What I did manually:
//528a ADDQ.L #1,A2
//200a MOVE.L A2,D0
//2640 MOVE.L D0,A3
A3 = A2 + 1;
But that is the easy part. Figuring out why we added
a 1 to A2 and put it in A3 while destroying D0 and discarding
the value in A2 was the hard part.
Last edited by Paul Stevens on Tue Aug 03, 2010 10:39 pm, edited 1 time in total.
Re: How was CSBWin created?
Well, you explained it quite well Paul , interesting.
but I typed the following so I post it..maybe it helps Adamo further if it is correct
As I see it , assembler is a programming language that is made for a specific computer/Processor. so you have ATari ST assembler, Amiga Assembler, 64000 Assembler(MSdos) so there is not one assembly language and assembler is not equal to some other assembler. Exchange Amiga, Atari etc with the corresponding processor name, it is just for getting the picture.
programs have code which in turn sends instructions to the processor via the language of the processor, which is its assembly language. The code of the program, its source code (maybe) is not visible. It is built=compiled, more or less installed for a specific computer.
There are several layers of deepness of programming languages. Assembler is very direct communication with the processor, therefore it is very hard to read. It can take days to get to know what one line does or means. You can alter or direct the usage of memory for programs, you even have to . More upper level programming languages have not as much power maybe, but are easier to read and are faster to do. Since Processors tend to get overhauled very quickly, it does not yield much to learn assembler anymore, maybe.erm.
So Paul did probably take all the instructions the processor of the Atari St did receive while the game was running (I guess, however that may have worked) and tried to get head or tails of the numbers that got stored in memory and changed in memory. a very large puzzle that changed over time...
This could all be wrong in parts<.>, very likely, but the best effort to represent my understanding of your question Adamo
but I typed the following so I post it..maybe it helps Adamo further if it is correct
As I see it , assembler is a programming language that is made for a specific computer/Processor. so you have ATari ST assembler, Amiga Assembler, 64000 Assembler(MSdos) so there is not one assembly language and assembler is not equal to some other assembler. Exchange Amiga, Atari etc with the corresponding processor name, it is just for getting the picture.
programs have code which in turn sends instructions to the processor via the language of the processor, which is its assembly language. The code of the program, its source code (maybe) is not visible. It is built=compiled, more or less installed for a specific computer.
There are several layers of deepness of programming languages. Assembler is very direct communication with the processor, therefore it is very hard to read. It can take days to get to know what one line does or means. You can alter or direct the usage of memory for programs, you even have to . More upper level programming languages have not as much power maybe, but are easier to read and are faster to do. Since Processors tend to get overhauled very quickly, it does not yield much to learn assembler anymore, maybe.erm.
So Paul did probably take all the instructions the processor of the Atari St did receive while the game was running (I guess, however that may have worked) and tried to get head or tails of the numbers that got stored in memory and changed in memory. a very large puzzle that changed over time...
This could all be wrong in parts<.>, very likely, but the best effort to represent my understanding of your question Adamo
Re: How was CSBWin created?
I got the assembler-code from DM right out of the Atari.
It was a confusing process to launch the disassembler (a tool called IDEAL I think), then launch the game and finally catch the code right after it was expanded and relocated in memory, saving it then disassembled.
However, for DM that was relatively easy, it just has very few data within code areas - in other cases that fools a disassembler pretty good.
Bringing that disassembler-listing with its 52000 lines of code to a working clone - that's a longer story...
It was a confusing process to launch the disassembler (a tool called IDEAL I think), then launch the game and finally catch the code right after it was expanded and relocated in memory, saving it then disassembled.
However, for DM that was relatively easy, it just has very few data within code areas - in other cases that fools a disassembler pretty good.
Bringing that disassembler-listing with its 52000 lines of code to a working clone - that's a longer story...
Re: How was CSBWin created?
I must say that I have fullly never understood what it meant when paul and bit said that they disassembled the code for the atari to pc. But I can now see what hard work it is behind this, and I am really impressed with both your work and paticence!!
A question to both Bit and Paul..
Why did you use the atari for CSB, why not the PC?
Is it more hard work or is it because CSB has more functions that DM doesn't have.. And why not the amiga in that case?
A question to both Bit and Paul..
Why did you use the atari for CSB, why not the PC?
Is it more hard work or is it because CSB has more functions that DM doesn't have.. And why not the amiga in that case?
Website: http://dwelvers.com/
YouTube: http://www.youtube.com/Dwelvers
Twitter: https://twitter.com/dwelvers
Facebook: https://www.facebook.com/Dwelvers
Forum: http://www.dungeondwellers.net/forum/
YouTube: http://www.youtube.com/Dwelvers
Twitter: https://twitter.com/dwelvers
Facebook: https://www.facebook.com/Dwelvers
Forum: http://www.dungeondwellers.net/forum/
- Paul Stevens
- CSBwin Guru
- Posts: 4318
- Joined: Sun Apr 08, 2001 6:00 pm
- Location: Madison, Wisconsin, USA
Re: How was CSBWin created?
I could not get my hands on a PC version of CSB. ![Wink ;-)](./images/smilies/icon_e_wink.gif)
Moreover.....the PC has 'banked' memory and Atari
was a much more powerful linear memory. And no
swapping and such nonsense. The Atari code is much
easier to disassemble into something meaningful.
I wanted to play CSB after my Atari quit me. There
were Atari emulators (Steem and such) but they were slow.
I never thought that my program (CSBwin) could also play
DM!!!!! Someone else discovered that after I released it!!
![Wink ;-)](./images/smilies/icon_e_wink.gif)
Moreover.....the PC has 'banked' memory and Atari
was a much more powerful linear memory. And no
swapping and such nonsense. The Atari code is much
easier to disassemble into something meaningful.
I wanted to play CSB after my Atari quit me. There
were Atari emulators (Steem and such) but they were slow.
I never thought that my program (CSBwin) could also play
DM!!!!! Someone else discovered that after I released it!!
Re: How was CSBWin created?
How was that discovered? By replacing the graphic and dungeon.dat files? Sorry for my ignorance.. Only curiousI never thought that my program (CSBwin) could also play
DM!!!!! Someone else discovered that after I released it!!
![Smile :)](./images/smilies/icon_e_smile.gif)
Website: http://dwelvers.com/
YouTube: http://www.youtube.com/Dwelvers
Twitter: https://twitter.com/dwelvers
Facebook: https://www.facebook.com/Dwelvers
Forum: http://www.dungeondwellers.net/forum/
YouTube: http://www.youtube.com/Dwelvers
Twitter: https://twitter.com/dwelvers
Facebook: https://www.facebook.com/Dwelvers
Forum: http://www.dungeondwellers.net/forum/
- Sophia
- Concise and Honest
- Posts: 4240
- Joined: Thu Sep 12, 2002 9:50 pm
- Location: Nowhere in particular
- Contact:
Re: How was CSBWin created?
Recently I had the experience of having to reverse-engineer a small bit of 286 (i.e., 16-bit x86) code. It's not a fun experience, and for something on the order of DM-- forget it. Bill Gates famously called the 286 "brain damaged" and he pretty much got it right. Not being able to deference a pointer in any sane fashion and having a cripplingly small array of registers to work with makes your brain melt.The Atari code is much easier to disassemble into something meaningful.
Re: How was CSBWin created?
I believe it was Sphenx who fiorst discovered that the endian of CSB and DM was the only difference between the two. Certainly I played his CSB dungeon converted into PC DM format. Christophe and Paul were the ones to make official programmes/routines to convert the files around easily.
Re: How was CSBWin created?
Is it the same with newer version, lets say 386, 486, pentium? What version does dm for pc have? Is there some tutorials/manuals on the net that describes disassembled code and how it is translated?Gates famously called the 286 "brain damaged"
Thousands of question, but I find this very interesting
![Smile :)](./images/smilies/icon_e_smile.gif)
Website: http://dwelvers.com/
YouTube: http://www.youtube.com/Dwelvers
Twitter: https://twitter.com/dwelvers
Facebook: https://www.facebook.com/Dwelvers
Forum: http://www.dungeondwellers.net/forum/
YouTube: http://www.youtube.com/Dwelvers
Twitter: https://twitter.com/dwelvers
Facebook: https://www.facebook.com/Dwelvers
Forum: http://www.dungeondwellers.net/forum/
- Paul Stevens
- CSBwin Guru
- Posts: 4318
- Joined: Sun Apr 08, 2001 6:00 pm
- Location: Madison, Wisconsin, USA
Re: How was CSBWin created?
The 386 introduced the 32-bit register and pointer, allowing
a linear address space up to 4 gigabytes. But the newer processors
maintained the ability to run the old code and inherited a great
deal of the brain-deadness of the older. But it is possible
to write reasonable programs on the pentium. Until you get
to 4 gigabytes, of course.
DM for PC asssumes an old, old processor.....8088 perhaps
would suffice. It certainly works on my 286.
a linear address space up to 4 gigabytes. But the newer processors
maintained the ability to run the old code and inherited a great
deal of the brain-deadness of the older. But it is possible
to write reasonable programs on the pentium. Until you get
to 4 gigabytes, of course.
DM for PC asssumes an old, old processor.....8088 perhaps
would suffice. It certainly works on my 286.
Re: How was CSBWin created?
Okey then.. I see what you mean. But isn't possible to sort out the braindamaged code in a program, so that is will be less braindamaged? Or is it simular to what you described here:
But only more twisted? Is a example possible?It is pretty much the whole thing. Example:
What we started with:
528a
200a
2640
What the disassembler did ( I wrote my own disassembler. And yes, I was
very familiar with both the binary and assembly machine language.)
528a ADDQ.L #1,A2
200a MOVE.L A2,D0
2640 MOVE.L D0,A3
Website: http://dwelvers.com/
YouTube: http://www.youtube.com/Dwelvers
Twitter: https://twitter.com/dwelvers
Facebook: https://www.facebook.com/Dwelvers
Forum: http://www.dungeondwellers.net/forum/
YouTube: http://www.youtube.com/Dwelvers
Twitter: https://twitter.com/dwelvers
Facebook: https://www.facebook.com/Dwelvers
Forum: http://www.dungeondwellers.net/forum/
- Sophia
- Concise and Honest
- Posts: 4240
- Joined: Thu Sep 12, 2002 9:50 pm
- Location: Nowhere in particular
- Contact:
Re: How was CSBWin created?
Part of this limitation is Microsoft's fault, not the processor itself. The 32-bit Pentium has had a 36-bit address bus for quite some time, and actually can address 64GB of memory, not 4GB. The idea behind this was that the 4GB limit to a 32-bit pointer could apply on a per-application basis. Each application would get, essentially, its own 4GB of address space, and the operating system and MMU would reconcile 32-bit application pointers into the 36-bit address space. It's a bit like the old segmented memory model, but at least this time it's done in OS-land and applications wouldn't have to suffer. Microsoft refused to support this in XP for some reason or other, though. Probably something to do with backward compatibility back to 1992. So 32-bit Windows users get stuck with 4GB for the whole system. I guess they wanted everyone buying 64 bit anyway.Paul Stevens wrote:But it is possible to write reasonable programs on the pentium. Until you get to 4 gigabytes, of course.
![Razz :P](./images/smilies/icon_razz.gif)
As you may already know, the reason a processor that uses 32-bit addressing runs into the 4GB limit is because 4GB=2^32 is simply the largest number that can be represented with 32 bits. On a processor that uses 16-bit addressing, the largest number is 2^16 = 65536, so you're stuck with 64K of RAM unless you start doing really weird tricks. And that's where the brain damage comes in. You can undo all this garbage, of course, but it just takes time and work.Rasmus wrote:But isn't possible to sort out the braindamaged code in a program, so that is will be less braindamaged?
Re: How was CSBWin created?
I thought I did buy the PC-version of DM too, but - can't find it anymore. Also, I started that process on the Atari long time ago and that was like an open bill, so I was glad to find this site. I never had started a disassembling process for the PC-version, because my knowledge of the x86-processors is just enough that I know that I don't like that them. For the Amiga - that's another thing. Didn't I already write that I took a look into UAE's frozen memory and find that there is something very odd with the code?
@Rasmus:
That's all about lifetime of variables. The compiler has to make the things a safe way, and we can be glad that this compiler wasn't really optimizing the code. Let's just take that little sample of Paul. There's much between the lines! Try to figure it out - i.e. D0-value is same to A2 of line 200a. Means, at that point you can track back and free the responsibility to care for the contents of the old D0 value. This compiler i.e. carries the return-value of a C-function by writing it to D0. Then again, the D0-register is the first one to be used as a temporary variable. There are zillions of commands with D0 that die if you make a C-code out of it. But - you can first delete it, if you can be sure that it isn't used the other way.
Then data-structures. There are really bad traps. You never know, if a variable is bound into a structure, an array of this structure, or maybe that's just part of another higher structure and you can't simply cut this out of the 'starting spaghetti'.
Some of the offsets are precalculated by the compiler that you think - ah, that variable I already know - but wrong - it's because it's just some added value of different offsets within a higher structure and another index will be added and you are in a completely other area of the memory. (Now combine that with the endianness-problem...)
I won't even talk about how they arranged the linked list of the graphics... those are the things you spot when you already reached a higher level. All those are the reasons why you somehow have to do loops in redeveloping the code.
After all - that's a challenge. Maybe even worth to do it in a team - and discuss how to continue. But hey - whom one could bug with that?
@Rasmus:
That's all about lifetime of variables. The compiler has to make the things a safe way, and we can be glad that this compiler wasn't really optimizing the code. Let's just take that little sample of Paul. There's much between the lines! Try to figure it out - i.e. D0-value is same to A2 of line 200a. Means, at that point you can track back and free the responsibility to care for the contents of the old D0 value. This compiler i.e. carries the return-value of a C-function by writing it to D0. Then again, the D0-register is the first one to be used as a temporary variable. There are zillions of commands with D0 that die if you make a C-code out of it. But - you can first delete it, if you can be sure that it isn't used the other way.
Then data-structures. There are really bad traps. You never know, if a variable is bound into a structure, an array of this structure, or maybe that's just part of another higher structure and you can't simply cut this out of the 'starting spaghetti'.
Some of the offsets are precalculated by the compiler that you think - ah, that variable I already know - but wrong - it's because it's just some added value of different offsets within a higher structure and another index will be added and you are in a completely other area of the memory. (Now combine that with the endianness-problem...)
I won't even talk about how they arranged the linked list of the graphics... those are the things you spot when you already reached a higher level. All those are the reasons why you somehow have to do loops in redeveloping the code.
After all - that's a challenge. Maybe even worth to do it in a team - and discuss how to continue. But hey - whom one could bug with that?
- Paul Stevens
- CSBwin Guru
- Posts: 4318
- Joined: Sun Apr 08, 2001 6:00 pm
- Location: Madison, Wisconsin, USA
Re: How was CSBWin created?
And the 16-bit 8088 had a 20-bit address bus. Lot of good thatThe 32-bit Pentium has had a 36-bit address bus
did for the poor assembly-language programmer who needed
a 65537 byte array. DS, ES, SS, CS. What a treat.
I remember an IBM fellow quoted as saying that no
personal-computer application would ever need more
than 65K of memory.
Re: How was CSBWin created?
First one breaking the limits was the WATCOM-compiler with DOS4GW if I remember right.
Did you ever wrote a bank-switching-routine using VESA to fill a 640*400-truecolor-screen?
That was as evil as programming interrupt 2 to get access to the interrupts 9+...
And for all that crap they say today you're too old to be up-to-date and you can drive a cab,,,
pffft-
I *did* use assembler-commands within C-code for DJGPP without having to struggle much with data-segment-stuff etc.
That was not that bad, and I could do real 3D-calculations with transparent-bitmaps without 3dfx-hardware-support.
To optimize that was also a lot of work - Rasmus' generation just has to checkout which function has to be used.
That's necessary to reach a somewhat higher level for that software develops at all, but compared to the bit-biting. that is some kind of another world.
Did you ever wrote a bank-switching-routine using VESA to fill a 640*400-truecolor-screen?
That was as evil as programming interrupt 2 to get access to the interrupts 9+...
And for all that crap they say today you're too old to be up-to-date and you can drive a cab,,,
pffft-
I *did* use assembler-commands within C-code for DJGPP without having to struggle much with data-segment-stuff etc.
That was not that bad, and I could do real 3D-calculations with transparent-bitmaps without 3dfx-hardware-support.
To optimize that was also a lot of work - Rasmus' generation just has to checkout which function has to be used.
That's necessary to reach a somewhat higher level for that software develops at all, but compared to the bit-biting. that is some kind of another world.
Re: How was CSBWin created?
Okey.. I think I got most of the stuff you wrote Bit (mostly because Sophia gave me an 2 hour lesson yesterday on the chat). This have gotten me in the mode to learn more about disassembleing..
As for my question about disassembleing a 16 bit cpu into a readable language, I have understand that it isn't impossible. But that the assemble program for 16 bit systems take on evil tricks (that involves alot of confusion for the human brain) to beeing able to reach memory outside the 65k limit. And because programs/games is all about getting information from the memory into the cpu, calculate it there and then return the new values to the same/new spots in the memory.. So I can understand that every command made in high assemble language and converted into low assemble language for a 16 bit system will requier alot of more commands in the low assemble language than if it were converted into a 32 bit system..
Correct me if I am wrong![Smile :)](./images/smilies/icon_e_smile.gif)
As for my question about disassembleing a 16 bit cpu into a readable language, I have understand that it isn't impossible. But that the assemble program for 16 bit systems take on evil tricks (that involves alot of confusion for the human brain) to beeing able to reach memory outside the 65k limit. And because programs/games is all about getting information from the memory into the cpu, calculate it there and then return the new values to the same/new spots in the memory.. So I can understand that every command made in high assemble language and converted into low assemble language for a 16 bit system will requier alot of more commands in the low assemble language than if it were converted into a 32 bit system..
Correct me if I am wrong
![Smile :)](./images/smilies/icon_e_smile.gif)
Website: http://dwelvers.com/
YouTube: http://www.youtube.com/Dwelvers
Twitter: https://twitter.com/dwelvers
Facebook: https://www.facebook.com/Dwelvers
Forum: http://www.dungeondwellers.net/forum/
YouTube: http://www.youtube.com/Dwelvers
Twitter: https://twitter.com/dwelvers
Facebook: https://www.facebook.com/Dwelvers
Forum: http://www.dungeondwellers.net/forum/
Re: How was CSBWin created?
uh uh. I fear the Worst!Rasmus wrote: gotten me in the mode to learn more about disassembleing..
![Wink ;)](./images/smilies/icon_e_wink.gif)
Re: How was CSBWin created?
Hehe, nothing too fear
But I have read that the more I understand low assemble language the better I can write high assemble language (c++). But I guess it is like a whole science and nothing I can learn in a month.
![Wink ;)](./images/smilies/icon_e_wink.gif)
Website: http://dwelvers.com/
YouTube: http://www.youtube.com/Dwelvers
Twitter: https://twitter.com/dwelvers
Facebook: https://www.facebook.com/Dwelvers
Forum: http://www.dungeondwellers.net/forum/
YouTube: http://www.youtube.com/Dwelvers
Twitter: https://twitter.com/dwelvers
Facebook: https://www.facebook.com/Dwelvers
Forum: http://www.dungeondwellers.net/forum/
- Sophia
- Concise and Honest
- Posts: 4240
- Joined: Thu Sep 12, 2002 9:50 pm
- Location: Nowhere in particular
- Contact:
Re: How was CSBWin created?
It let that programmer actually have a 65537 byte array. If the address bus was only 16 bits wide, there would be no way to address that 65537th byte, period.Paul Stevens wrote:And the 16-bit 8088 had a 20-bit address bus. Lot of good that did for the poor assembly-language programmer who needed a 65537 byte array.
Re: How was CSBWin created?
Some systems could switch "memory banks". Like the upper 16k of the total 64k, you could tell the hardware which addresses of your ram should be visible there and then access it. Or something.
Some systems also did address multiplexing. First here were the low 16 bit of the address put on the bus, then came the upper 16 bits (or vice versa). The memory controller could translate that into a memory access.
Atari ST and Amiga both had 68000 CPUs and therefore used the same assembly code. But all OS calls, hardware registers and such differed. This CPU was internally a 32bit CPU with 32 bit registers for address and data calculations. I don't remember the address bus details though, just that all 16 and 32 data had to be aligned on even addresses.
I'd assume that the most tricky thing to disassemble is self-modifying code. Some games of that era used that, but I have no idea if DM did.
I'd think, that if today someone tries to write a clone, it is better to start newly with a high level language and implement the reverse-engineered game mechanics instead of trying to lift disassembled code to a higher level.
Edit: And next time I read the whole thread before boring people with already mentioned facts. Sorry![Sad :(](./images/smilies/icon_e_sad.gif)
Some systems also did address multiplexing. First here were the low 16 bit of the address put on the bus, then came the upper 16 bits (or vice versa). The memory controller could translate that into a memory access.
Atari ST and Amiga both had 68000 CPUs and therefore used the same assembly code. But all OS calls, hardware registers and such differed. This CPU was internally a 32bit CPU with 32 bit registers for address and data calculations. I don't remember the address bus details though, just that all 16 and 32 data had to be aligned on even addresses.
I'd assume that the most tricky thing to disassemble is self-modifying code. Some games of that era used that, but I have no idea if DM did.
I'd think, that if today someone tries to write a clone, it is better to start newly with a high level language and implement the reverse-engineered game mechanics instead of trying to lift disassembled code to a higher level.
Edit: And next time I read the whole thread before boring people with already mentioned facts. Sorry
![Sad :(](./images/smilies/icon_e_sad.gif)
Re: How was CSBWin created?
@Rasmus: I need to read your question some times more - I still don't get it. Think I reply better in PM then - that's all much too boring for non-programmers. I'd say a CPU with two modes - 16 bit and more - is doomed, but well...
Today the chip-power is that high, that they could hide a complete P2 including DOS for backward-compatibility in a modern CPU. But they better make a Java-processor that's machine commands are the Java tokens itself...
@Hajo: DM/CSB has no self-modifying code, but the original copy protection does checksums from routines. But - there is code to load pieces of code from graphics.dat into three buffers and execute this (short jumps only, no relocation stuff).
Graphics.dat is the wrong name anyways, that's just kind of a zipped directory with files of different formats.
And hey - for checking out all game mechanics, you need this higher level. Without CSBwin, I'd be doomed![Wink ;)](./images/smilies/icon_e_wink.gif)
@Sophia: When did you make this hardware-crash-course? Some months ago you refused to know anything about assembler.![Wink ;)](./images/smilies/icon_e_wink.gif)
Today the chip-power is that high, that they could hide a complete P2 including DOS for backward-compatibility in a modern CPU. But they better make a Java-processor that's machine commands are the Java tokens itself...
@Hajo: DM/CSB has no self-modifying code, but the original copy protection does checksums from routines. But - there is code to load pieces of code from graphics.dat into three buffers and execute this (short jumps only, no relocation stuff).
Graphics.dat is the wrong name anyways, that's just kind of a zipped directory with files of different formats.
And hey - for checking out all game mechanics, you need this higher level. Without CSBwin, I'd be doomed
![Wink ;)](./images/smilies/icon_e_wink.gif)
@Sophia: When did you make this hardware-crash-course? Some months ago you refused to know anything about assembler.
![Wink ;)](./images/smilies/icon_e_wink.gif)
- Sophia
- Concise and Honest
- Posts: 4240
- Joined: Thu Sep 12, 2002 9:50 pm
- Location: Nowhere in particular
- Contact:
Re: How was CSBWin created?
Just now we were talking about x86 architecture. Back then, you were trying to show me some of your DM disassembly which was for the 68k. I don't know nearly as much about the 68k.Bit wrote:When did you make this hardware-crash-course? Some months ago you refused to know anything about assembler.
![Smile :)](./images/smilies/icon_e_smile.gif)
Re: How was CSBWin created?
@bit: As I only got a somewhat extremly basic view on how it works and have probably used the wrong terms explaining what it is that I maybe understand, it is not supprising that you may not understand me ![Wink ;)](./images/smilies/icon_e_wink.gif)
I will send you a PM later this week when I have more time over too get into it..
![Wink ;)](./images/smilies/icon_e_wink.gif)
I will send you a PM later this week when I have more time over too get into it..
Website: http://dwelvers.com/
YouTube: http://www.youtube.com/Dwelvers
Twitter: https://twitter.com/dwelvers
Facebook: https://www.facebook.com/Dwelvers
Forum: http://www.dungeondwellers.net/forum/
YouTube: http://www.youtube.com/Dwelvers
Twitter: https://twitter.com/dwelvers
Facebook: https://www.facebook.com/Dwelvers
Forum: http://www.dungeondwellers.net/forum/
Re: How was CSBWin created?
I like to read it. and Adamo -it looks like it, too! After all, it is a programming related thread.´Good old´ Bit wrote:- that's all much too boring for non-programmers.
Non interessants may skip it.. Then again, the thread could become too detailed...just wanted to say this
Re: How was CSBWin created?
zoom, those are just the very common things of the details - you won't know how deep those details can be.
Maybe there's one interesting page for all those who still seach details about the Atari ST: (the link goes randomly into that wiki - in that case it's about the floppy controller, which was pretty important for the original)
http://www.atari-forum.com/wiki/index.php/WD1772
and yup - studying all those stuff was surely pretty important to create CSBwin.
And it's not that you get correct informations on every link you find - and it's not that you understand everything on a quick view![Wink ;)](./images/smilies/icon_e_wink.gif)
Maybe there's one interesting page for all those who still seach details about the Atari ST: (the link goes randomly into that wiki - in that case it's about the floppy controller, which was pretty important for the original)
http://www.atari-forum.com/wiki/index.php/WD1772
and yup - studying all those stuff was surely pretty important to create CSBwin.
And it's not that you get correct informations on every link you find - and it's not that you understand everything on a quick view
![Wink ;)](./images/smilies/icon_e_wink.gif)
Re: How was CSBWin created?
Just because DM and CSB are nearly 100% the same engine (I don't talk about the hint oracle). Just have to switch dungeon.dat and graphics.dat and it's done!Paul Stevens wrote:I never thought that my program (CSBwin) could also play
DM!!!!! Someone else discovered that after I released it!!
That's also why Theron Quests maps could be extracted then playable with DM engine.
Now, I let you go on with CPU talk.