| |
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.... |
| |
trip6 Account closed
Registered: Jan 2007 Posts: 51 |
Fantastic progress you guys are making on this... Thanks for all the efforts and keep up the good work... I have no doubt soon we'll have a great C64 conversion of Berzerk. |
| |
Heaven Account closed
Registered: Jul 2008 Posts: 102 |
and here is the mentioned setsprite routine.
this must be rewritten to the c64 bitmap architecture but imho not a major issue:
(looks "tightly" written for these small sprites)
;set robots on screen
;soft sprite handling
L8716: lda $183A
beq L872A
sta $8F
ldx #$01
stx $86
dex
clc
L8723: jsr L872F
dec $8F
bne L8723
L872A: lda #$00
sta $86
rts
; ----------------------------------------------------------------------------
L872F: lda $0F00,x
sta $9C
lda $0F01,x
sta $9D
lda $0F02,x
sta $9E
lda $0F03,x
sta $9F
lda $0F04,x
sta $8B
lda $0F05,x
sta $8C
lda $0F06,x
sta $A0
asl
sta L00A2
txa
clc
adc #$07
sta $FF
lda #$09
sbc L00A2
sta $A3
ldy #$00
L8763: lda ($8B),y
sta $8D
iny
lda ($8B),y
sta $8E
sty $A1
ldy $9C
dey
sty $A5
sty $A6
L8775: ldy $A5
lda ($9E),y
sta $A4
ldx L00A2
beq L8794
ldx $A3
L8781: asl
dex
bne L8781
ldy $A6
iny
eor ($8D),y
sta ($8D),y
lda $A4
ldx L00A2
L8790: lsr
dex
bne L8790
L8794: ldy $A6
eor ($8D),y
sta ($8D),y
dec $A6
dec $A5
bpl L8775
dec $9D
beq L87B1
clc
lda $9C
adc $9E
sta $9E
ldy $A1
iny
jmp L8763
; ----------------------------------------------------------------------------
L87B1: ldx $FF
rts
in the end it should look like this:
http://de.youtube.com/watch?v=g8m4nBy7ayI
|
| |
Heaven Account closed
Registered: Jul 2008 Posts: 102 |
the berzerk logo of the start screen is ripped off and converted from atari bitmap format into c64 one...
now I am just need to get the bitmap into c64 to get familiar with that mode... ;)
|
| |
d0c
Registered: Apr 2006 Posts: 186 |
keep up the good work :) looking forward to a preview when its possible... |
| |
Heaven Account closed
Registered: Jul 2008 Posts: 102 |
I have the logo on c64 screen plus rasters running... ;) so many years atari experience and so less on c64... should have touched the commie more often instead of vic-20... ;)
i always forget to setup the colour ram... ;)
|
| |
Heaven Account closed
Registered: Jul 2008 Posts: 102 |
with the help of the guys at #c-64 I have the atari code running on the c64...
here is one of the first pics..
http://www.atariage.com/forums/index.php?showtopic=131873
it assembles fine and correct now for c64 so i can add and rewrite routines... next will be the atari2c64 bitmap screen calculations...
|
| |
Martin Piper
Registered: Nov 2007 Posts: 722 |
You're getting there :) |
| |
Heaven Account closed
Registered: Jul 2008 Posts: 102 |
yup. but unfortunatly i have only time to work on the stuff at weekends... so next build will be somewhere on sundays. |
| |
Heaven Account closed
Registered: Jul 2008 Posts: 102 |
ok... something to think about it... does anybody have some ideas regarding remapping atari screen adresses to c64 one?
the issue is following... assume a linear screen ram... so actually the walls for the rooms are drawn in this way:
; ----------------------------------------------------------------------------
L9A59: lda $A3
sta $9C
L9A5D: clc
lda $9C
asl
bcs L9A6E
adc #$D0
sta $9E
lda #$10
adc #$00
jmp L9A77
; ----------------------------------------------------------------------------
L9A6E: clc
adc #$D0
sta $9E
lda #$10
adc #$01
L9A77: sta $9F
ldy #$00
clc
lda ($9E),y
adc $A0
sta $8B,y
iny
lda ($9E),y
adc #$00
sta $8B,y
ldy $A1
lda $A5
dey
ora ($8B),y
sta ($8B),y
dey
bmi L9AA6
beq L9AA0
lda $A4
L9A9B: sta ($8B),y
dey
bne L9A9B
L9AA0: lda $A6
ora ($8B),y
sta ($8B),y
L9AA6: lda $9C
clc
adc #$01
sta $9C
cmp L00A2
bcc L9A5D
beq L9A5D
rts
$10d0,$10d1 etc is the lookup table for the start adress of each scanline in the bitmap (screen, screen+40, screen+80, etc... in lo, hi format)
$a0 is the offset in that line, $a1 is the length of the wall, $a3 the y-position, $a5 the right side bitmap value and $a4 the middle of the bitmap and $a6 the left edge.
so...actually this is how I understand the stuff:
ABBBBBBBBC
ABBBBBBBBC
ABBBBBBBBC
...
or
C
C
C
C
C
so...what I want to do at a first step is not to rewrite the whole algorithm but maybe a clever "remap" routine... i would like to take the $8b,$8c pointer and try to calc the desired c64 screenpos?
the bad thing would be ok, it slows down the drawing but the good would be that I could take the original code without rewriting the draw routine for the static elements on screen.
any cleaver ideas?
|
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
change the bitmap line start addies into c64 ones, then:
; ----------------------------------------------------------------------------
L9A59: lda $A3
sta $9C
L9A5D: clc
lda $9C
asl
bcs L9A6E
adc #$D0
sta $9E
lda #$10
adc #$00
jmp L9A77
; ----------------------------------------------------------------------------
L9A6E: clc
adc #$D0
sta $9E
lda #$10
adc #$01
L9A77: 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
ldy $A1
lda mul8lo,y ;
clc ;
adc $8b ;
sta $8b ;
lda mul8hi,y ;
adc $8c ;
sta $8c ;
lda $A5
secmacro ;
dey
ora ($8B),y
sta ($8B),y
secmacro ;
dey
bmi L9AA6
beq L9AA0
lda $A4
L9A9B: sta ($8B),y
secmacro ;
dey
bne L9A9B
L9AA0: lda $A6
ora ($8B),y
sta ($8B),y
L9AA6: lda $9C
clc
adc #$01
sta $9C
cmp L00A2
bcc L9A5D
beq L9A5D
rts
secmacro lda $8b
sec
sbc #$08
sta $8b
bcs *+4
dec $8c
I have marked each line added by me with ";" there's only new lines added, no original lines changed. it generally does what you have asked for :) converting the bitmap addy straight would be more painful imho. instead I have changed the logics to move in c64 steps.
edit: oops, dey fucks up my new adressing scheme, well you can change it to X reg nicely and keep Y 0 :) |
Previous - 1 | ... | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | ... | 27 - Next |