Heaven/TQA Posted September 6, 2008 Share Posted September 6, 2008 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 Quote Link to comment Share on other sites More sharing options...
Rybags Posted September 6, 2008 Share Posted September 6, 2008 Running it from RAM? Maybe you've still got some self-destruct code in there somewhere. Quote Link to comment Share on other sites More sharing options...
Heaven/TQA Posted September 6, 2008 Author Share Posted September 6, 2008 (edited) Rybags...well...the included .com file is a "XL-friendly" version anyway so RAM/ROM protection is not an issue. the berzerk.com is the one I got from atarimania website. Edited September 6, 2008 by Heaven/TQA Quote Link to comment Share on other sites More sharing options...
Urchlay Posted September 6, 2008 Share Posted September 6, 2008 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! Quote Link to comment Share on other sites More sharing options...
Heaven/TQA Posted September 6, 2008 Author Share Posted September 6, 2008 Great work! DASM berzerk.dasm -f3 -oberzerk.xex works... Quote Link to comment Share on other sites More sharing options...
tebe Posted September 6, 2008 Share Posted September 6, 2008 dis6502.exe berzerk.xex -s$6 -a$7eaf -bc$7ecc in previous version of dis6502 parameter -S$xxxx work wrong dis6502 v2.2 -> parameter -S$xxxx work ok berzerk_dis6502_v2.2.zip Quote Link to comment Share on other sites More sharing options...
Heaven/TQA Posted September 6, 2008 Author Share Posted September 6, 2008 Thanks, Tebe... Quote Link to comment Share on other sites More sharing options...
Heaven/TQA Posted September 14, 2008 Author Share Posted September 14, 2008 (edited) 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 September 14, 2008 by Heaven/TQA Quote Link to comment Share on other sites More sharing options...
Heaven/TQA Posted October 18, 2008 Author Share Posted October 18, 2008 ok...here is the WIP of commented Berzerk source... you can assemble it with DASM berzerk.asm -f3 -oberzerk.xex more insight information here: http://noname.c64.org/csdb/forums/?roomid=...p;topicid=58028 berzerk800.zip Quote Link to comment Share on other sites More sharing options...
Bryan Posted October 19, 2008 Share Posted October 19, 2008 I thought it was neat how the speech code uses two alternating voices to 'oversample' the waveform a bit. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.