Jump to content
IGNORED

Berzerk Disassembling needed


Heaven/TQA

Recommended Posts

Hello Guys,

 

I would need help in terms of disassembling the Berzerk version. I used Dis6502 to produce some MADS compatible source but when assembling it the game does crash and produces annoying sounds etc.

 

Any ideas what I am doing wrong here? Is there anybody who can have a look and post a MADS or better DASM compatible source code to reassemble the game?

 

please note that the speech is only played back when emulator is set to Atari800 OS-B 48k machine.

 

My goal is to have a source code which I can try to port to other 6502 machines...

Berzerk.zip

Link to comment
Share on other sites

Try the attached: berzerk_disasm.zip

 

With DASM 2.20.07, it assembles byte-for-byte identical with the original Berzerk.com from your zip file. See the comments at the top of the file for the gory details...

 

Note this is just a straight disassembly, with 2 sections marked as data tables so they came out as .BYTEs instead of garbage instructions. I didn't try to figure out how the code works, or assign meaningful labels, or anything like that.

 

Also there are a couple of spots that look like this:

 

L7EC2:  .byte   $4C							; 7EC2 4C					   L
L7EC3:  brk									; 7EC3 00					   .
	.byte   $80							; 7EC4 80		 

; a few lines later

	bne	 L7EC3						  ; 7ED0 D0 F1					..

 

The BNE really is branching to the BRK... which also happens to be the low byte of the operand to the JMP ($4C) at L7EC2. Probably you want to change this construct to:

 

L7EC2:  JMP $8000

; ...

	BNE L7EC2+1

 

...but I don't actually know why the code was written this way (this is a "quick and dirty" disassembly).

 

Hope this helps!

Link to comment
Share on other sites

i am still in process of learning what is going on in the code... the game could be much faster and more compact... few examples:

 

- lookup table generator for the scanline adresses uses more than 60 lines! ("L856c ff.")

- the soft sprites are shifted in realtime while put on screen

- tons of jsr and jmps around the code

- a lot of LDA ADC STA ADC #0 STA

 

and so forth...

 

but the Berzerk logo f.e. is packed gfx data, so it is depacked, too... so instead of writing a depack routine for the logo...they should have put the logo unpacked in rom... would be much more efficient... ;)

 

as soon as I understand more as sooner I can rewrite the stuff...

Edited by Heaven/TQA
Link to comment
Share on other sites

  • 1 month later...

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