Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > Berzek for C64
2008-07-30 18:07
trip6
Account closed

Registered: Jan 2007
Posts: 51
Berzek for C64

Hello... I recently recieved assembler source code for Berzerk video game. I was told that I would have to use CCS65 to compile it. However, I am quickly realizing that I have no idea how to do this in CCS65. Can some one help me our compile this for me with CCS65 if I sent the source code? All help is appreciated, I'd love to get a port of this classic on the C64.
 
... 260 posts hidden. Click here to view all posts....
 
2008-09-28 13:45
Heaven
Account closed

Registered: Jul 2008
Posts: 102
Koesz Oswald,

at a first glance it looks good. let me fire up my dev kit and see what happens... ;)
2008-09-28 14:22
Heaven
Account closed

Registered: Jul 2008
Posts: 102
Oswald... well.. at least it draws the first room... ;) but the horizontal lines are not put perfect on screen

http://www.atariage.com/forums/index.php?showtopic=131873&st=0&..

btw. can i send you the DASM file so you can play around?

if so...to which email adress?

2008-09-28 14:29
Heaven
Account closed

Registered: Jul 2008
Posts: 102
here is the bug free version:


lL9A59:	stx lllll+1
	lda     $A3                             
        sta     $9C                             
lL9A5D:  clc                                    
        lda     $9C                           
        asl                                     
        bcs     lL9A6E                           
        adc     #$D0                            
        sta     $9E                            
        lda     #$10                            
        adc     #$00                           
        jmp     lL9A77                          
; ----------------------------------------------------------------------------
lL9A6E:  clc                                   
        adc     #$D0                           
        sta     $9E                            
        lda     #$10                            
        adc     #$01                            
lL9A77:  sta     $9F                           
        ldy     #$00                           
        clc                                     
        ldx     $a0       ;
        lda     ($9E),y                        
        adc     mul8lo,x  ;                          
        sta     $8B,y                           
        iny                                    
        lda     ($9E),y                         
        adc     mul8hi,x  ;                            
        sta     $8B,y                           
        ldx     $A1
        lda     mul8lo,x ;
        clc              ;
        adc     $8b      ;
        sta     $8b      ;
        lda     mul8hi,x ;
        adc     $8c      ;
        sta     $8c      ;
   

		lda $8b
        sec
        sbc #$08
        sta $8b
        bcs *+4
        dec $8c
                                  
        lda     $A5
        dex
		ldy #0
        ora     ($8B),y                        
        sta     ($8B),y                        

        lda $8b
        sec
        sbc #$08
        sta $8b
        bcs *+4
        dec $8c
       

        dex                                    
        bmi     Ll9AA6                           
        beq     Ll9AA0                           
Ll9A9B:   lda     $A4                            
		sta     ($8B),y                        

		lda $8b
         sec
         sbc #$08
         sta $8b
         bcs *+4
         dec $8c
       ;
        dex                                     
        bne     Ll9A9B                           
Ll9AA0:  lda     $A6                            
        ora     ($8B),y                        
        sta     ($8B),y                        
Ll9AA6:  lda     $9C                         
        clc                                     
        adc     #$01                            
        sta     $9C                            
        cmp     L00A2                           
        bcc     llll                          
        beq     llll                           
lllll	ldx #0        
		rts   
llll	jmp lL9A5D
2008-09-28 15:09
Oswald

Registered: Apr 2002
Posts: 5094
what caused the bug? remember such forum code posts are "from the top of my head" stuff, not granted to work, but a guideline :) happy to see you got it right afterall.

edit: btw in the sprite routines you wont get away with such patches, imho they have to be optimized for speed, and the c64 bitmap format will be painful :)
2008-09-28 15:47
Heaven
Account closed

Registered: Jul 2008
Posts: 102
the sprite routines will be replaced... ;) i am 100% sure that these one can be optimised little bit... ;) even when running in c64 bitmap mode:

;set robots on screen
;soft sprite handling
L8716:  lda     $183A                           ; 8716 AD 3A 18                 .:.
        beq     L872A                           ; 8719 F0 0F                    ..
        sta     $8F                             ; 871B 85 8F                    ..
        ldx     #$01                            ; 871D A2 01                    ..
        stx     $86                             ; 871F 86 86                    ..
        dex                                     ; 8721 CA                       .
        clc                                     ; 8722 18                       .
L8723:  jsr     L872F                           ; 8723 20 2F 87                  /.
        dec     $8F                             ; 8726 C6 8F                    ..
        bne     L8723                           ; 8728 D0 F9                    ..
L872A:  lda     #$00                            ; 872A A9 00                    ..
        sta     $86                             ; 872C 85 86                    ..
        rts                                     ; 872E 60                       `
; ----------------------------------------------------------------------------
L872F:  lda     $0F00,x                         ; 872F BD 00 0F                 ...
        sta     $9C                             ; 8732 85 9C                    ..
        lda     $0F01,x                         ; 8734 BD 01 0F                 ...
        sta     $9D                             ; 8737 85 9D                    ..
        lda     $0F02,x                         ; 8739 BD 02 0F                 ...
        sta     $9E                             ; 873C 85 9E                    ..
        lda     $0F03,x                         ; 873E BD 03 0F                 ...
        sta     $9F                             ; 8741 85 9F                    ..
        lda     $0F04,x                         ; 8743 BD 04 0F                 ...
        sta     $8B                             ; 8746 85 8B                    ..
        lda     $0F05,x                         ; 8748 BD 05 0F                 ...
        sta     $8C                             ; 874B 85 8C                    ..
        lda     $0F06,x                         ; 874D BD 06 0F                 ...
        sta     $A0                             ; 8750 85 A0                    ..
        asl                                     ; 8752 0A                       .
        sta     L00A2                           ; 8753 85 A2                    ..
        txa                                     ; 8755 8A                       .
        clc                                     ; 8756 18                       .
        adc     #$07                            ; 8757 69 07                    i.
        sta     $FF                             ; 8759 85 FF                    ..
        lda     #$09                            ; 875B A9 09                    ..
        sbc     L00A2                           ; 875D E5 A2                    ..
        sta     $A3                             ; 875F 85 A3                    ..
        ldy     #$00                            ; 8761 A0 00                    ..
L8763:  lda     ($8B),y                         ; 8763 B1 8B                    ..
        sta     $8D                             ; 8765 85 8D                    ..
        iny                                     ; 8767 C8                       .
        lda     ($8B),y                         ; 8768 B1 8B                    ..
        sta     $8E                             ; 876A 85 8E                    ..
        sty     $A1                             ; 876C 84 A1                    ..
        ldy     $9C                             ; 876E A4 9C                    ..
        dey                                     ; 8770 88                       .
        sty     $A5                             ; 8771 84 A5                    ..
        sty     $A6                             ; 8773 84 A6                    ..
L8775:  ldy     $A5                             ; 8775 A4 A5                    ..
        lda     ($9E),y                         ; 8777 B1 9E                    ..
        sta     $A4                             ; 8779 85 A4                    ..
        ldx     L00A2                           ; 877B A6 A2                    ..
        beq     L8794                           ; 877D F0 15                    ..
        ldx     $A3                             ; 877F A6 A3                    ..
L8781:  asl                                    ; 8781 0A                       .
        dex                                     ; 8782 CA                       .
        bne     L8781                           ; 8783 D0 FC                    ..
        ldy     $A6                             ; 8785 A4 A6                    ..
        iny                                     ; 8787 C8                       .
        eor     ($8D),y                         ; 8788 51 8D                    Q.
        sta     ($8D),y                         ; 878A 91 8D                    ..
        lda     $A4                             ; 878C A5 A4                    ..
        ldx     L00A2                           ; 878E A6 A2                    ..
L8790:  lsr                                     ; 8790 4A                       J
        dex                                     ; 8791 CA                       .
        bne     L8790                           ; 8792 D0 FC                    ..
L8794:  ldy     $A6                             ; 8794 A4 A6                    ..
        eor     ($8D),y                         ; 8796 51 8D                    Q.
        sta     ($8D),y                         ; 8798 91 8D                    ..
        dec     $A6                             ; 879A C6 A6                    ..
        dec     $A5                             ; 879C C6 A5                    ..
        bpl     L8775                           ; 879E 10 D5                    ..
        dec     $9D                             ; 87A0 C6 9D                    ..
        beq     L87B1                           ; 87A2 F0 0D                    ..
        clc                                     ; 87A4 18                       .
        lda     $9C                             ; 87A5 A5 9C                    ..
        adc     $9E                             ; 87A7 65 9E                    e.
        sta     $9E                             ; 87A9 85 9E                    ..
        ldy     $A1                             ; 87AB A4 A1                    ..
        iny                                     ; 87AD C8                       .
        jmp     L8763                           ; 87AE 4C 63 87                 Lc.
; ----------------------------------------------------------------------------
L87B1:  ldx     $FF                             ; 87B1 A6 FF                    ..
        rts                                     ; 87B3 60                       `


2008-09-28 15:49
Heaven
Account closed

Registered: Jul 2008
Posts: 102
Quote: what caused the bug? remember such forum code posts are "from the top of my head" stuff, not granted to work, but a guideline :) happy to see you got it right afterall.

edit: btw in the sprite routines you wont get away with such patches, imho they have to be optimized for speed, and the c64 bitmap format will be painful :)


loading the byte to put on screen was put before the sec-macro so it trashed the accu therefor put garbage on screen.

the x-register needs to be rescued and as you have already written... y-register must stay #0 and we need to use the x-reg for counting instead.

so nothing major issues... ;)
2008-09-28 20:24
Heaven
Account closed

Registered: Jul 2008
Posts: 102
well... the sprite routine seems a little bit more tricky. the screen calculations are done somewhere else and i need to find the table setting for the sprites before I change the code...

2008-09-29 05:30
Martin Piper

Registered: Nov 2007
Posts: 722
Woo definitely getting there. :)

I'd be tempted to find out where the monster/player/bullet positions are stored and using them directly for hardware sprites with a multiplexor.

The tricky thing with that is the pixel accurate collision detection. On a real C64 it's not a big problem (the collision registers can be read during the multiplexor) but some emulators have distinct problems with accurate collision registers.
2008-09-29 10:11
Heaven
Account closed

Registered: Jul 2008
Posts: 102
you want to spread your 48 sprite multiplexor... ;)
2008-09-29 10:21
Oswald

Registered: Apr 2002
Posts: 5094
I'd go for soft sprites.
Previous - 1 | ... | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | ... | 27 - Next
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
Mike
psych
The Human Co../Maste..
Peacemaker/CENSOR/Hi..
iAN CooG/HVSC
MWR/Visdom
t0m3000/hf^boom!^ibx
Acidchild/Padua
E$G/HF ⭐ 7
Guests online: 125
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 Edge of Disgrace  (9.6)
6 What Is The Matrix 2  (9.6)
7 The Demo Coder  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 No Listen  (9.6)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 Dawnfall V1.1  (9.5)
7 Rainbow Connection  (9.5)
8 Onscreen 5k  (9.5)
9 Morph  (9.5)
10 Libertongo  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Censor Design  (9.3)
5 Triad  (9.3)
Top NTSC-Fixers
1 Pudwerx  (10)
2 Booze  (9.7)
3 Stormbringer  (9.7)
4 Fungus  (9.6)
5 Grim Reaper  (9.3)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.051 sec.