-
Posts
24 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Gallery
Events
Store
Everything posted by Robert Gremillion
-
I did have ldx PFOffset above the first WSYNC in one of my tests but I still didn't have enough time to get the coaster color set up. I think the two commented out lines take 8 cycles to perform. There was one more method to show the sprite without a mask. I don't know if that can be used here also to save 5 cycles from the rider being drawn??? Thanks for responding!
-
MaskDraw Simple Example
Robert Gremillion replied to Robert Gremillion's topic in 2600 Programming For Newbies
Here's the MaskDraw demo that SpiceWare created. Thanks!!! -
I was able to make it work!!! I made the sprites both 8 lines high so I could share the same mask graphic. I have some weird issues when it falls through the screen. My main goal was to reduce the drawing speed so I could draw double track lines. You can see the before and after videos here... I don't have enough clock cycles to color the coaster sprite. I think it looks better with the gray bottom. ldy #96 ; X counts the number of remaining scanlines .GameLineLoop: ;-------------------------------------------------------------------------------------------- .SetupPlayfield: sta WSYNC ; first scanline ldx PFOffset ; 3 03 lda $80,x ; 4 07 sta PF0 ; 3 10 lda $81,x ; 4 14 sta PF1 ; 3 17 lda $82,x ; 4 21 sta PF2 ; 3 24 ; set PF0, PF1, and PF2 playfield/terrain pattern lda (RiderSpritePtr),y ; 5 29 and (RiderMaskPtr),Y ; 5 34 sta GRP0 ; 3 37 lda $83,x ; 4 41 sta PF0 ; 3 44 lda $84,x ; 4 48 sta PF1 ; 3 51 lda $85,x ; 4 54 sta PF2 ; 3 57 ; set PF0, PF1, and PF2 playfield/terrain pattern lda (CoasterSpritePtr),Y ; 5 62 and (CoasterMaskPtr),Y ; 5 67 sta GRP1 ; 3 70 ;lda (CoasterColorPtr),y ;sta COLUP1 ;-------------------------------------------------------------------------------------------- sta WSYNC ; second scanline ldx PFOffset lda $80,x sta PF0 lda $81,x sta PF1 lda $82,x sta PF2 ; set PF0, PF1, and PF2 playfield/terrain pattern nop nop lda $83,x sta PF0 lda $84,x sta PF1 lda $85,x sta PF2 ; set PF0, PF1, and PF2 playfield/terrain pattern cpy #55 ; compare x to 55 bcs .SkipSetPlayfields ; cpy #44 ; compare x to 44 bcc .SkipSetPlayfields ; lda PFOffset ; this code is upping the offset by 6 sbc #6 ; move this code near end of frame sta PFOffset ; update if over x over 45 lines ; stop incrementing if x over 55 lines? .SkipSetPlayfields dey ; Y-- bne .GameLineLoop ; repeat next main game scanline until finished I don't know if I will keep the double lines or not. If I get rid of them I guess I could add a ball or missile? Thanks for helping me!!!!
-
Does someone have a complete simple example of using MaskDraw? I'm looking at the Stay Frosty example and the entire thing is 1000 light years above my head. I want to draw this sprite as fast as I can. Thanks! RiderSprite: .byte #%00000000 ; .byte #%00011000 ; ## .byte #%00100100 ; # # .byte #%01101010 ; ## # # .byte #%11100110 ; ## ## .byte #%11101010 ; ## # # .byte #%10100101 ; # # # # .byte #%10011001 ; # ## # .byte #%10000001 ; # #
-
I don't understand what's happening with a Mask. I have this sprite that can be monochrome. RiderSprite: .byte #%00000000 ; .byte #%00011000 ; ## .byte #%00100100 ; # # .byte #%01101010 ; ## # # .byte #%11100110 ; ## ## .byte #%11101010 ; ## # # .byte #%10100101 ; # # # # .byte #%10011001 ; # ## # .byte #%10000001 ; # # Does the mask match the size of the sprite? Or does it match the size of the arena? Thanks!
-
I am drawing these 2 sprites and want to reduce the cycles in the kernel. What are the better methods? I am looping through x 96 times... Thanks, .IsInsideSpriteP0Check: ; check if should render sprite player0 txa ; 2 transfer X to A sec ; 2 make sure carry flag is set sbc RiderYPos ; 3 subtract sprite Y coordinate cmp #RIDER_HEIGHT ; 2 are we inside the sprite height bounds? bcc .DrawSpriteP0 ; 2 if result < SpriteHeight, call subroutine lda #0 ; 2 else, set lookup index to 0 .DrawSpriteP0: tay ; 2 load Y so we can work with pointer lda (RiderSpritePtr),Y ; 5 load player bitmap slice of data sta GRP0 ; 3 set graphics for player 0 .IsInsideSpriteP1Check: ; check if should render sprite player1 txa ; 2 transfer X to A sec ; 2 make sure carry flag is set sbc CoasterYPos ; 3 subtract sprite Y coordinate cmp #COASTER_HEIGHT ; 2 are we inside the sprite height bounds? bcc .DrawSpriteP1 ; 2 if result < SpriteHeight, call subroutine lda #0 ; 2 else, set index to 0 .DrawSpriteP1: tay ; 2 lda (CoasterSpritePtr),Y ; 5 load player bitmap slice of data sta GRP1 ; 3 set graphics for player 0 lda (CoasterColorPtr),Y ; 5 load player color from lookup table sta COLUP1 ; 3 set color for player 0 slice Thank you!
-
-
-
Can I ask you one more question? What should I be using to set that bit on and off. I want to control it with the 2nd joystick - joystick right / turn off - joystick left / turn on. I have this code below, but cannot get it to work either. Thanks! CheckP1Left: lda #%00000100 ; player 1 joystick right - J bit SWCHA bne CheckP1Right lda Flags ; loading Flags variable into the accumulator ora #%00000010 ; Flags - Position 1 - setting Add Hole Flag to False sta Flags CheckP1Right: lda #%00001000 ; player 1 joystick left - G bit SWCHA bne CheckP1Up lda Flags ; loading Flags variable into the accumulator and #%00000010 ; Flags - Position 1 - setting Add Hole Flag to True sta Flags CheckP1Up:
-
I have all of these flag variables and I want to consolidate them into one byte called Flags. Flags is set to 0, but it doesn't branch here. lda #%00000010 ; setting up accumulator to check position 1 bit bit Flags ; comparing Flags - position 1 for Add Hole Flag set bne .SetPoleFlag What am I doing wrong? Thanks!
-
I started learning Assembly in early 2020, then Covid hit and I got dismayed for a while. But I am back into it and starting to make a little progress. My initial game idea is to turn the Bitcoin Roller coaster Meme into a game. It will be a side scroller game in the style of Moon Patrol. My first objective was to get a workable track that goes up and down. I've blown over half the memory making the track work. ? Here's a video of the progress so far. Added a Demo binary. Joystick 1 - Fire button - jumps the coaster. Joystick left and right moves the coaster horizontally on the track within a range. Joystick 2 - Fire button - starts / stops the track. Joystick up and down move the track up and down (10 pixels). Joystick left and right - adds and subtracts holes. I was able to get this binary to work in Stella. bcoaster_20220426.bin