Jump to content
IGNORED

some guidance, stuck with masked sprites


zilog_z80a

Recommended Posts

i`m at home now, it does not work. :( is distorted

 

 

 

this is strage... i did WSYNC OUT OF THE LOOP AND NOW WORKS FINE. ?

 

i will kill my self... brb.... lol but

 

dunno when used the other playfield some lines where altered, must wait to arrive at home to try.

  sta WSYNC
kernel_loop
   ldX PLAYF0,y	   ;+4   4 ----AND START TO COUNT HERE. 
   stX PF0	       ;+3   7  -- WE WRITE PF0 BEFORE TIA CYCLE 68  - PF0
   lda (player0),y ;+5   12
   and (mask0),y  ;+5   17
   sta GRP0	       ;+3   20
   ldx PLAYF1,y	   ;+4   24
   stx PF1	       ;+3   27 -- WE WRITE PF1 BEFORE TIA CYCLE 84  - PF1
   ldx PLAYF2,y	   ;+4   31
   stx PF2	       ;+3   34 -- WE WRITE PF2 BEFORE TIA CYCLE 116 - PF2
   lda (player0),Y ;+5   39
   ldx PLAYF3,y	   ;+4   43
   stx PF0	       ;+3   46 -- WE WRITE "RIGHT PF0" BEFORE TIA CYCLE 148 - PF0   
   ldx PLAYF4,y	   ;+4   50
   stx PF1	       ;+3   53 -- WE WRITE "RIGHT PF1" BEFORE TIA CYCLE 164 - PF1   
   ldx PLAYF5,y    ;+4   57
   stx PF2	       ;+3   60 -- WE WRITE "RIGHT PF2" BEFORE TIA CYCLE 196 - PF2   
   and (mask0),y   ;+5   65
   sta GRP1	       ;+3   68
   dey		       ;+2   70
   bne kernel_loop ;+2   72 ---OR 73 IF BRANCH WAS TAKEN.
Link to comment
Share on other sites

i`m at home now, it does not work. :( is distorted

 

 

I KNOW WHAT TO DO!! WILL COMMENT A MASK. I JUST NEED TWO MOBILE OBJECT.

 

THE OTHER TWO WILL BE A MEAL AND ANOTHER OBJECT!! (WITH MISSILES...)

 

I THINK THAT CAN WORK :)

 

ENEMY --- GRP0 STATIC MEAL --- MISSILE0

PLAYER--- GRP1 STATIC OBJECT ---MISSILE1

Edited by zilog_z80a
Link to comment
Share on other sites

Lots of problems, you're going to need to rethink your project.

 

Your image is 37 scanlines. To have the blank space above/below the image you need enough to cover the image's range. Your 1LK covers 192 scanlines so if your image is all the way at the top you need 155 zeros below it for the masking to work. Likewise, if your image is all the way to the bottom you need 155 zeros above it.

 

155 + 37 + 155 = 347. A single page of ROM is 256 bytes. Because the data you need to cover both extremes exceeds that, you'll eventually cross a page.

 

For Stay Frosty 1 I used a 1LK, but it didn't span the entire screen. The screen was broken up into zones, and each zone had their own pointers so significantly fewer zeros were needed above/below the image:

post-3056-0-11850100-1520637755.png

 

And even with that, I couldn't update everything. I ended up dropping PF0 and only using PF1 and PF2 to draw a mirrored playfield. If you do this that frees up 10 cycles per scanline, which gives you extra cycles so you don't have to worry about crossing a page.

post-3056-0-64759400-1520637819.png

Link to comment
Share on other sites

Lots of problems, you're going to need to rethink your project.

 

Your image is 37 scanlines. To have the blank space above/below the image you need enough to cover the image's range. Your 1LK covers 192 scanlines so if your image is all the way at the top you need 155 zeros below it for the masking to work. Likewise, if your image is all the way to the bottom you need 155 zeros above it.

 

155 + 37 + 155 = 347. A single page of ROM is 256 bytes. Because the data you need to cover both extremes exceeds that, you'll eventually cross a page.

 

For Stay Frosty 1 I used a 1LK, but it didn't span the entire screen. The screen was broken up into zones, and each zone had their own pointers so significantly fewer zeros were needed above/below the image:

attachicon.gifblogentry-3056-0-11662100-1467471571.png

 

And even with that, I couldn't update everything. I ended up dropping PF0 and only using PF1 and PF2 to draw a mirrored playfield. If you do this that frees up 10 cycles per scanline, which gives you extra cycles so you don't have to worry about crossing a page.

attachicon.gifblogentry-3056-0-01040700-1467567026_thumb.png

 

 

how did you all transparent? i don't remember if CTRLPF has this property?

Edited by zilog_z80a
Link to comment
Share on other sites

30 Hz flicker - Stay Frosty, Part 2

 

i'm thinking about using sectors Darrell, first now i must implement your 2LK with Masked graphics,
the kernel i have planned is 127 lines, up before this kernel in the black part will put other kernel with lifes,objects and energy, a lot of work too.
but you are right, must use sectors.i will take this with calm. and re understand all.
ty Darrel and thanks to all of you AtariAge.
Edited by zilog_z80a
Link to comment
Share on other sites

  • 2 weeks later...

Lots of problems, you're going to need to rethink your project.

 

Your image is 37 scanlines. To have the blank space above/below the image you need enough to cover the image's range. Your 1LK covers 192 scanlines so if your image is all the way at the top you need 155 zeros below it for the masking to work. Likewise, if your image is all the way to the bottom you need 155 zeros above it.

 

155 + 37 + 155 = 347. A single page of ROM is 256 bytes. Because the data you need to cover both extremes exceeds that, you'll eventually cross a page.

 

For Stay Frosty 1 I used a 1LK, but it didn't span the entire screen. The screen was broken up into zones, and each zone had their own pointers so significantly fewer zeros were needed above/below the image:

attachicon.gifblogentry-3056-0-11662100-1467471571.png

 

And even with that, I couldn't update everything. I ended up dropping PF0 and only using PF1 and PF2 to draw a mirrored playfield. If you do this that frees up 10 cycles per scanline, which gives you extra cycles so you don't have to worry about crossing a page.

attachicon.gifblogentry-3056-0-01040700-1467567026_thumb.png

 

Hi Darrell, i was trying to use a 2lk kernel for my port of the game, but the sprites become larger... too much for my taste.
i though that i could combine 2lk with SECTIONS
so now... i'm reading about your Stay Frosty and once i have understood all... will proceed to try again a (1LK+SECTIONS) for my purposes.
cheers.
Edited by zilog_z80a
Link to comment
Share on other sites

  • 2 weeks later...

I think you need to slow down, zilog!

 

A good strategy to learning something new is to learn things in steps!

 

I'd say master drawing a single character using DoDraw first, then draw a 2LK using DoDraw, then master drawing a symmetrical playfield using a 2LK, then perhaps draw an asymmetrical playfield by itself, and then see how much other stuff you can fit in with timing constraints.

I have found that an asymmetrical playfield uses up a LOT of cycles. It is probably the most difficult thing to fit into a kernel.

 

Small steps! I started building my game step by step - I had no ability to draw even a /single/ multi-coloured sprite when I first set out. Even multi-coloured sprites take up a lot of time. You have 76 cycles per scan line, that really is not a lot!!

Link to comment
Share on other sites

I think you need to slow down, zilog!

 

A good strategy to learning something new is to learn things in steps!

 

I'd say master drawing a single character using DoDraw first, then draw a 2LK using DoDraw, then master drawing a symmetrical playfield using a 2LK, then perhaps draw an asymmetrical playfield by itself, and then see how much other stuff you can fit in with timing constraints.

 

I have found that an asymmetrical playfield uses up a LOT of cycles. It is probably the most difficult thing to fit into a kernel.

 

Small steps! I started building my game step by step - I had no ability to draw even a /single/ multi-coloured sprite when I first set out. Even multi-coloured sprites take up a lot of time. You have 76 cycles per scan line, that really is not a lot!!

 

Hi Vidak!! i will use sectors with an asymetrical playfield 1LK (2LK ENLARGES MY SPRITES A LOT), two sprites (one masked).
if i try to use two masked nothing fits.... or if i retire STA WSYNC in kernel loop my asymetrical playfield gets all lines in a no sense offset.
i was thinking yesterday about Frosty and Sierra Maestra, if sectors works for me, great,
if not i will need to use c programming dpc+arm.
ty Vidak.
ps (my playfield is 127 lines) will do several sectors of this i think....
characters animation is already done but i don't use it in tests.
Edited by zilog_z80a
Link to comment
Share on other sites

You could always use 3E with enough RAM to buffer the entire screen as code and do lda #, sta zp for everything. After accounting for loop and bank switch overhead you'd probably have enough time for 10-12 TIA writes. That's enough for an assymetric PF and colored sprites. Of course writing a new PF to the buffer would need to span a few frames.

  • Like 1
Link to comment
Share on other sites

You could always use 3E with enough RAM to buffer the entire screen as code and do lda #, sta zp for everything. After accounting for loop and bank switch overhead you'd probably have enough time for 10-12 TIA writes. That's enough for an assymetric PF and colored sprites. Of course writing a new PF to the buffer would need to span a few frames.

 

Hi ZackAttack, i will maintain all monochrome. will be a version near to zx spectrum in that aspect, in that manner i can do more logical at extended ram and less graphics repeated info.
TY FOR YOUR INFO.
cheers!!
Edited by zilog_z80a
Link to comment
Share on other sites

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