+atari2600land Posted March 11, 2018 Share Posted March 11, 2018 So I'm trying to make a round missile and I'm having trouble. Here is my current missile drawing code: StopCoinDrawing lda #0 sta ENAM0 jmp tTTTT Turn_M0_on ldx SFXTimer cpx #0 beq DisplayM0 lda #0 sta ENAM0 jmp tTTTT DisplayM0 ldx GameRunning cpx #2 bcs StopCoinDrawing ldx CoinDrawTimer cpx #4 beq StopCoinDrawing inc CoinDrawTimer lda #2 sta ENAM0 ldx CoinDrawTimer cpx #2 beq roundcoin2 ldx CoinDrawTimer cpx #4 beq roundcoin1 jmp tTTTT roundcoin1 lda #$25 sta NUSIZ0 jmp tTTTT roundcoin2 lda #$35 sta NUSIZ0 jmp tTTTT That produces this: Is there a way to maneuver the coin's X position so the top and bottom are in the center instead of being at the left to make it a round shape instead of a D shape? Quote Link to comment Share on other sites More sharing options...
zilog_z80a Posted March 11, 2018 Share Posted March 11, 2018 So I'm trying to make a round missile and I'm having trouble. Here is my current missile drawing code: StopCoinDrawing lda #0 sta ENAM0 jmp tTTTT Turn_M0_on ldx SFXTimer cpx #0 beq DisplayM0 lda #0 sta ENAM0 jmp tTTTT DisplayM0 ldx GameRunning cpx #2 bcs StopCoinDrawing ldx CoinDrawTimer cpx #4 beq StopCoinDrawing inc CoinDrawTimer lda #2 sta ENAM0 ldx CoinDrawTimer cpx #2 beq roundcoin2 ldx CoinDrawTimer cpx #4 beq roundcoin1 jmp tTTTT roundcoin1 lda #$25 sta NUSIZ0 jmp tTTTT roundcoin2 lda #$35 sta NUSIZ0 jmp tTTTT That produces this: coin.png Is there a way to maneuver the coin's X position so the top and bottom are in the center instead of being at the left to make it a round shape instead of a D shape? this is what you need? http://atariage.com/forums/topic/71120-6502-killer-hacks/?p=876950 Quote Link to comment Share on other sites More sharing options...
+atari2600land Posted March 11, 2018 Author Share Posted March 11, 2018 Yes, but I don't understand it. Quote Link to comment Share on other sites More sharing options...
zilog_z80a Posted March 11, 2018 Share Posted March 11, 2018 (edited) Yes, but I don't understand it. i'm learning missiles too, can let you this dude, good luck!! http://atariage.com/forums/topic/78727-session-25-lets-start-with-missles-perhaps Edited March 11, 2018 by zilog_z80a Quote Link to comment Share on other sites More sharing options...
+SpiceWare Posted March 11, 2018 Share Posted March 11, 2018 You have to use HMM0 & HMOVE to shift the missile as well as NUSIZ0 to resize it. Something like this (untested): KernelLoop: sta WSYNC sta HMOVE ; 3 3 lda (SIZE),y ; 5 8 size of missile for current scanline sta NUSIZ0 ; 3 11 ... ; later in scanline as this is for the NEXT scanline lda (SHIFT),y ; 5 ?? sta HMM0 ; 3 ?? dey ; 2 ?? bne KernelLoop ; 2 ?? (3 ??) ... CoinSize: byte $25 ; _XX_ row 0 Note: the $x5 = Double Size Player. byte $25 ; _XX_ row 1 if your player can be different sizes you will need byte $35 ; XXXX row 2 to make additional CoinSize tables to go along with byte $35 ; XXXX row 3 each player size byte $35 ; XXXX row 4 byte $35 ; XXXX row 5 byte $25 ; _XX_ row 6 byte $25 ; _XX_ row 7 CoinShift: ; NOTE this data is for the NEXT scanline, so is off 1 row from CoinSize ; _XX_ row 0 byte $00 ; _XX_ row 1 byte $10 ; XXXX row 2 - shift left 1 pixel byte $00 ; XXXX row 3 byte $00 ; XXXX row 4 byte $00 ; XXXX row 5 byte $F0 ; _XX_ row 6 - shift right 1 pixel byte $00 ; _XX_ row 7 byte $00 ; row 8 Quote Link to comment Share on other sites More sharing options...
+atari2600land Posted March 12, 2018 Author Share Posted March 12, 2018 I guess I can't use it in this game. I got it working, but it screws everything else up. I'm just posting this here in case someone finds it useful: Turn_M0_on ldx SFXTimer cpx #0 beq DisplayM0 lda #0 sta ENAM0 jmp tTTTT DisplayM0 ldx GameRunning cpx #2 bcs StopCoinDrawing ldx CoinDrawTimer cpx #5 beq StopCoinDrawing inc CoinDrawTimer lda #2 sta ENAM0 lda #0 sta HMM0 ldx CoinDrawTimer cpx #2 beq roundcoin1 ldx CoinDrawTimer cpx #4 beq roundcoin2 jmp tTTTT roundcoin1 sta WSYNC sta HMOVE lda #$35 sta NUSIZ0 lda #$20 sta HMM0 jmp tTTTT roundcoin2 sta WSYNC sta HMOVE lda #$25 sta NUSIZ0 lda #$E0 sta HMM0 jmp tTTTT Quote Link to comment Share on other sites More sharing options...
+SpiceWare Posted March 12, 2018 Share Posted March 12, 2018 Other objects moving to where they shouldn't? HMP0, HMP1, HMM1 and HMBL need to be zeroed out before you get roundcoin1. Easiest way to do that is sta HMCLR after you've set the position of all the objects. But you can't do it too soon after you set those positions. From Stella Programmer's Guide: 8.0 Horizontal Motion Horizontal motion allows the programmer to move any of the 5 graphics objects relative to their current horizontal position. Each object has a 4 bit horizontal motion register (HMP0, HMP1, HMM0, HMM1, HMBL) that can be loaded with a value in the range of +7 to -8 (negative values are expressed in two’s complement from). This motion is not executed until the HMOVE register is written to, at which time all motion registers move their respective objects. Objects can be moved repeatedly by simply executing HMOVE. Any object that is not to move must have a 0 in its motion register. With the horizontal positioning command confined to positioning objects at 15 color clock intervals, the motion registers fills in the gaps by moving objects +7 to -8 color clocks. Objects can not be placed at any color clock position across the screen. All 5 motion registers can be set to zero simultaneously by writing to the horizontal motion clear register (HMCLR). There are timing constraints for the HMOVE command. The HMOVE command must immediately follow a WSYNC (Wait for SYNC) to insure the HMOVE operation occurs during horizontal blanking. This is to allow sufficient time for the motion registers to do their thing before the electron beam starts drawing the next scan line. Also, for mysterious internal hardware considerations, the motion registers should not be modified for at least 24 machine cycles after an HMOVE command. Quote Link to comment Share on other sites More sharing options...
+atari2600land Posted March 12, 2018 Author Share Posted March 12, 2018 (edited) Well, that worked, but now the scanline counter jumps about every screen or so. That and the dreaded COMB showed up. Edited March 12, 2018 by atari2600land Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.