Jump to content



1

SkipDraw


15 replies to this topic

#1 ~llama OFFLINE  

~llama

    Moonsweeper

  • 496 posts
  • temporary like Achilles
  • Location:Memphis

Posted Tue Oct 5, 2004 2:23 PM

I'm starting work on the sprite code for my game I've recently started working on (Phred) and I've been looking at examples of horizontal positioning code, etc. to use/adapt for my game, and I've come across the SkipDraw code...

and I have absolutely no idea how it works. Can someone please explain to me what Skipdraw is doing?

#2 DEBRO OFFLINE  

DEBRO

    Stargunner

  • 1,862 posts
  • Location:Atlanta, GA

Posted Tue Oct 5, 2004 2:25 PM

~llama said:

Can someone please explain to me what Skipdraw is doing?

It should be explained at The MiniDig. BTW, it's a nice piece of code.

#3 ~llama OFFLINE  

~llama

    Moonsweeper

  • 496 posts
  • temporary like Achilles
  • Location:Memphis

Posted Tue Oct 5, 2004 2:29 PM

Ok, after looking at the MiniDig I think I understand it pretty well (I've been to the Minidig a whole lot, not sure how I missed that file :? ) but... how would I use that code in my game? I guess what I'm asking is, I know what the code is doing, but how do I utilize the code?

Thanks :)

#4 DEBRO OFFLINE  

DEBRO

    Stargunner

  • 1,862 posts
  • Location:Atlanta, GA

Posted Tue Oct 5, 2004 2:46 PM

~llama said:

Ok, after looking at the MiniDig I think I understand it pretty well (I've been to the Minidig a whole lot, not sure how I missed that file  :? ) but... how would I use that code in my game? I guess what I'm asking is, I know what the code is doing, but how do I utilize the code?

Thanks :)
This might be a question for [stella]. There are a number of games in the [stella] archives that use skipDraw. You can look at those to see how to use it in a game.

For instance, checkout my Climber 5 source code. I use skipDraw here to draw the climber and the falling obstacles. The sprites are offset in the ROM based on the height of the kernel. This is so the y-index reads don't cross a page boundary. See if this answers your questions.

#5 ~llama OFFLINE  

~llama

    Moonsweeper

  • 496 posts
  • temporary like Achilles
  • Location:Memphis

Posted Tue Oct 5, 2004 4:29 PM

something isn't letting me download the .zip of your source... perhaps you could email it to me, or something?

I think this will probably be the best routine to use in my Phred game, so I'd definitely be interested in seeing how Climber5 uses skipDraw.

#6 DEBRO OFFLINE  

DEBRO

    Stargunner

  • 1,862 posts
  • Location:Atlanta, GA

Posted Wed Oct 6, 2004 8:32 AM

~llama said:

something isn't letting me download the .zip of your source... perhaps you could email it to me, or something?
:sad: Sorry to hear that. I'll upload it to this thread.

Maybe one day Al will be able to catch up on things and add it to the database :)

Attached Files



#7 ~llama OFFLINE  

~llama

    Moonsweeper

  • 496 posts
  • temporary like Achilles
  • Location:Memphis

Posted Wed Oct 6, 2004 6:50 PM

Thanks :) you were right about this being a question for [ stella ] though... I started a thread on the list :)

I'll check out this code later tonight when i have time to examine it closely. Thanks again!

#8 wrenchien OFFLINE  

wrenchien

    Stargunner

  • 1,097 posts
  • this is sparta!
  • Location:south texas

Posted Mon Oct 11, 2004 12:57 PM

what's best for compiling said source code?

#9 Nukey Shay OFFLINE  

Nukey Shay

    Sheik Yerbouti

  • 20,458 posts
  • Location:The land of Gorch

Posted Mon Oct 11, 2004 2:23 PM

:ponder:

The source said:

; dasm source.s -f3 -osource.bin to compile

Change "source" to "climber5" in this case

#10 xucaen OFFLINE  

xucaen

    Star Raider

  • 94 posts
  • Looking for new owner for commodore 64
  • Location:Ma

Posted Sun Jul 23, 2006 12:00 PM

The source said:

; dasm source.s -f3 -osource.bin to compile

Hi, I just stumbled across this post and wanted to assemble the climber5 source. But when I do I get DSAM errors having to do with the use of the minus sign. I recall seeing somewhere why this occurs and how to fix it, but right now my searches are not turning up anything.

I am using DASM V2.20.09

The errors I am getting are:

DASM said:

climber5.asm (1996): error: Value in 'lda #-FAIR_PIXEL_DELTA' must be <$100.
climber5.asm (2175): error: Value in 'lda #<HorizontalColors - KERNEL_HEIGHT - 1' must be <$100.
climber5.asm (2721): error: Value in 'ldy #-1' must be <$100.
climber5.asm (3360): error: Value in 'lda #<HorizontalColors - KERNEL_HEIGHT - 1' must be <$100.

Line 1996 is:

 lda #-FAIR_PIXEL_DELTA		  ; make the number negative so we subtract


Jim

#11 batari OFFLINE  

batari

    )66]U('=I;B$*

  • 6,237 posts
  • begin 644 contest

Posted Sun Jul 23, 2006 12:50 PM

View Postxucaen, on Sun Jul 23, 2006 1:00 PM, said:

The source said:

; dasm source.s -f3 -osource.bin to compile

Hi, I just stumbled across this post and wanted to assemble the climber5 source. But when I do I get DSAM errors having to do with the use of the minus sign. I recall seeing somewhere why this occurs and how to fix it, but right now my searches are not turning up anything.

I am using DASM V2.20.09

The errors I am getting are:

DASM said:

climber5.asm (1996): error: Value in 'lda #-FAIR_PIXEL_DELTA' must be <$100.
climber5.asm (2175): error: Value in 'lda #<HorizontalColors - KERNEL_HEIGHT - 1' must be <$100.
climber5.asm (2721): error: Value in 'ldy #-1' must be <$100.
climber5.asm (3360): error: Value in 'lda #<HorizontalColors - KERNEL_HEIGHT - 1' must be <$100.

Line 1996 is:

 lda #-FAIR_PIXEL_DELTA		 ; make the number negative so we subtract


Jim
This is a DASM bug that was introduced recently. Download 2.20.07 and it will assemble.

#12 xucaen OFFLINE  

xucaen

    Star Raider

  • 94 posts
  • Looking for new owner for commodore 64
  • Location:Ma

Posted Sun Jul 23, 2006 4:19 PM

View Postbatari, on Sun Jul 23, 2006 2:50 PM, said:

This is a DASM bug that was introduced recently. Download 2.20.07 and it will assemble.

Dasm said:

DASM V2.20.07, Macro Assembler ©1988-2003
*** 108 BYTES OF RAM USED 20 BYTES FREE
climber5.asm (1996): error: Value in 'lda #-FAIR_PIXEL_DELTA' must be <$100.
climber5.asm (2175): error: Value in 'lda #<HorizontalColors - KERNEL_HEIGHT - 1' must be <$100.
climber5.asm (2721): error: Value in 'ldy #-1' must be <$100.
climber5.asm (3360): error: Value in 'lda #<HorizontalColors - KERNEL_HEIGHT - 1' must be <$100.
*** 0 BYTES OF ROM FREE
Unrecoverable error(s) in pass, aborting assembly!


:(

#13 batari OFFLINE  

batari

    )66]U('=I;B$*

  • 6,237 posts
  • begin 644 contest

Posted Sun Jul 23, 2006 5:27 PM

Works fine for me. This is the one I downloaded:

http://www.atari2600...M/DASM22007.zip

#14 xucaen OFFLINE  

xucaen

    Star Raider

  • 94 posts
  • Looking for new owner for commodore 64
  • Location:Ma

Posted Mon Jul 24, 2006 7:54 AM

View Postbatari, on Sun Jul 23, 2006 7:27 PM, said:

Works fine for me. This is the one I downloaded:

http://www.atari2600...M/DASM22007.zip

Hi, I had a chance today to use the dos/windows version of dasm 2.20.07 and it did infact assemble climber5 with no errors.
I had built dasm 2.20.07 myself under linux, and it was that version that was giving the errors. It must be something about the way it is compiled that is causing the difference. I recall something about dasm using 32 bit integers or something like that which interperates #-1 differently. Maybe there is a compiler option I missed. I'll dig in and see what I can find out.. in the mean time I'll try to get the dos/windows version to work in dosemu under linux. Hmm.. a 6502 cross-assembler assembling atari 2600 source code, running on an AMD Sempron, under linux, within a dos emulator. Never saw that one coming. :)


Jim

#15 DEBRO OFFLINE  

DEBRO

    Stargunner

  • 1,862 posts
  • Location:Atlanta, GA

Posted Mon Jul 24, 2006 9:09 AM

View Postbatari, on Sun Jul 23, 2006 2:50 PM, said:

This is a DASM bug that was introduced recently. Download 2.20.07 and it will assemble.

Yeah, I use 2.20.07 just for this reason sometimes.

DASM said:

climber5.asm (1996): error: Value in 'lda #-FAIR_PIXEL_DELTA' must be <$100.
climber5.asm (2175): error: Value in 'lda #<HorizontalColors - KERNEL_HEIGHT - 1' must be <$100.
climber5.asm (2721): error: Value in 'ldy #-1' must be <$100.
climber5.asm (3360): error: Value in 'lda #<HorizontalColors - KERNEL_HEIGHT - 1' must be <$100.

Quote

Line 1996 is:

 lda #-FAIR_PIXEL_DELTA		; make the number negative so we subtract

Try placing a < in front of all reaferences to negative numbers.
 lda #<-FAIR_PIXEL_DELTA

And try () for the LSB references...
lda #<(HorizontalColors - KERNEL_HEIGHT - 1')
I haven't tried this with the latest DASM but it should work with these changes.

#16 Tom ONLINE  

Tom

    Moonsweeper

  • 449 posts
  • Location:Switzerland

Posted Tue Sep 19, 2006 3:01 AM

Quote

I had built dasm 2.20.07 myself under linux, and it was that version that was giving the errors. It must be something about the way it is compiled that is causing the difference. I recall something about dasm using 32 bit integers or something like that which interperates #-1 differently.

Nothing to do with data width. It's some field of a structure that was changed from a signed to an unsigned type. Can't remember which one exactly and wether fixing that typedef fixes the problem or reintroduces new ones. I think I posted about that on the stella list, I could look it up if it's of any interest.

Edited by Tom, Tue Sep 19, 2006 3:05 AM.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users