Jump to content

8-bit_d-boy

New Members
  • Posts

    59
  • Joined

  • Last visited

Posts posted by 8-bit_d-boy

  1.  

    That's a fun idea. What "standards" exist for 3-button controllers? I know people Genesis controllers -- is there anything else floating around that's commonly used?

    Dendy - essentially an unauthorized Famicom clone standard that uses a DB9 connector for NES/FC controllers, same number of buttons as the Genesis.

  2. So by playing around with the code for about a minute, I've regained some understanding of how the code works and the bug where the ball does not move in a straight horizontal line when hit from the side is caused by the clip check code I just fixed(duh):

    	temp6 = bvx + bvy
    	if bvx > bvy then temp5 = bvx / bvy : temp4 = bvy else temp5 = bvy / bvx : temp4 = bvx
    	
    		for temp3 = 0 to temp4
    			temp2 = temp3 / temp4
    			temp1 = temp3 - (temp2 * temp4)
    			if temp1 = 0 then if bvx > bvy then bally = bally + 1 : if bvy > bvx then ballx = ballx + 1
    			if temp1 <> 0 then if bvx > bvy then ballx = ballx + 1 : if bvy > bvx then bally = bally + 1
    			if collision(player0, ball) || collision(player1, ball) then temp3 = temp4
    		next
    

    I'm gonna stare at it for a bit to try to figure out why it's not working properly.

  3. YOU'RE ALIVE!!

    If you change this:


       if scoring <> 61 then _skip_ball_movment
    



    to this:

       if scoring <> 61 then goto _skip_ball_movment



    It will compile.

    Oh crap, its so simple, how did I miss it? :P

     

    Also I think I forgot to mention, I added use of the difficulty switches: players will no longer be able to move fast with the fire button with the switch set to "Advanced".

    EDIT:

    So I compiled it and it works!
    That said, I have good news, and bad news.

     

    Bad news is I kinda forgot how some of my code worked(or at least was supposed to) and some bugs got introduced where the ball gets stuck in the bottom edge of the playfield and the ball doesn't move horizontally when you hit it from the side so I can't tell if that fixed the clipping issue.

     

    Good news is there's like 1 frame where the screen flickers when you hit the ball at full force which looks REALLY cool, I'll include the ROM so you can see for yourself!

    airhockey.bas

    airhockey.bas.bin

  4. Hmmm, now I'm getting this error:

    --- Unresolved Symbol List
    
          284 bytes of ROM space left
    
    C:\Users\chris\atari\airHockey\air hockey\airhockey.bas.asm (3437): error: Branch out of range (158 bytes).
    
    Fatal assembly error: Source is not resolvable.
    Errors were encountered during assembly
    

    What does it mean by "branch out of range"?

     

    That reminds me, I hope RT is doing okay.

     

    Here's the code:

    airhockey.bas

  5. I don't even remember what section code I was working on where I was trying to get the modulus. It was rewritten in a way that the modulus was no longer needed.

     

    If you want to get the modulus manually, you could do something like this:

     

       temp1 = dividend / divisor
       modulus = dividend - (temp1 * divisor)

    If you want to report a bug with the // operator, I suggest starting a new thread, and creating a small test program that demonstrates the problem.

    Thanks! I'll have to try this.

  6. For reflection code, I wonder if it would be helpful to keep track of the previous positions of both the ball and the paddle? That way if the ball hits the paddle and the paddle hasn't moved, then you could have the ball reflect on the opposite direction that it came from. Otherwise, if the paddle hits the ball, then have the ball jump back in the direction that the paddle is going. It's not perfect physics, but it may be a decent starting point?

     

    Maybe others will have better ideas on how to compute this in a more realistic way.

    Thanks, that's a good idea.

     

    I didn't have much luck getting the modulus with the // operator, either, but I changed how I did it, and didn't look into it deeply at the time. Maybe it would be good to test it with a small test program that's easier to debug.

    If it's not too much to ask, could you find it?

  7. Is it possible to do a modulus operation without the advanced math modules? I can't get them working in my code. Haven't touched it in a while.

     

    I'm trying to make it so that when the ball collides with the paddle, it stays outside of it to make determining the direction it reflects in easier.

  8. It is doable, but I think the most columns the 2600 can do at once is 12 at 8px horizontal per character by multiplexing the scoreboard, 4 more if you use both sprites and multiplex them as well, which means characters will be interlaced and/or flickery, this cannot be done in Batari Basic, however, at least not yet.

    A good ROM to see this in action is Dark Mage which is a text adventure.

     

    Another option to fit more text in would be using the titlescreen minikernel(check out the robotron 2084 title demo), but that would require encoding the instructions as a bitmap and that would take up a lot of space.

     

    As for using separate ROMs, I think a better solution would be to hack it in so it's in a separate bank from the main game - perhaps accessible through the color/bw switch.

  9. More compilation issues (yayyy).

     

    So in order to move the ball up until it collides with the paddle and no more, I modified this:

    	if scoring <> 61 then _skip_ball_movment
    		pbx = ballx 
    		if bMoveLf then ballx = ballx - bvx
    		if bMoveRt then ballx = ballx + bvx
    		pby = bally
    		if bMoveUp then bally = bally - bvy
    		if bMoveDn then bally = bally + bvy
    
    _skip_ball_movment
    

    to this:

    
    	temp6 = bvx + bvy
    	if bvx > bvy then temp5 = bvx / bvy : temp4 = bvy else temp5 = bvy / bvx : temp4 = bvx
    	
    	if scoring <> 61 then _skip_ball_movment
    		pbx = ballx 
    		for temp3 = 0 to temp4
    			temp2 = temp3 // temp4
    			if temp2 = 0 then if bvx > bvy then bally = bally + 1 : if bvy > bvx then ballx = ballx + 1
    			if temp2 <> 0 then if bvx > bvy then ballx = ballx + 1 : if bvy > bvx then bally = bally + 1
    			if collision(player0, ball) || collision(player1, ball) then temp3 = temp4
    		next
    		if bMoveLf then ballx = ballx - bvx
    		if bMoveRt then ballx = ballx + bvx
    		pby = bally
    		if bMoveUp then bally = bally - bvy
    		if bMoveDn then bally = bally + bvy
    
    _skip_ball_movment
    
    

    and it won't compile now, stating:

    --- Unresolved Symbol List
    div8                     0000 ????         (R )
    
          425 bytes of ROM space left
    
    C:\Users\chris\atari\airHockey\air hockey\airhockey.bas.asm (3435): error: Branch out of range (138 bytes).
    
    Fatal assembly error: Source is not resolvable.
    Errors were encountered during assembly.
    
    

    Progress, I guess.

  10. Just letting you know that I'm not ignoring you. I had an operation on my right leg last week and I'm trying to finish up some other things on my computer while I don't have to be in bed. I have to see a doctor on Monday about my pancreas, then I get an operation on my left leg on Tuesday (if the gut doctor doesn't put me in the hospital), so I'm probably going to be useless for most of next week. I'll be able to post simple things from a smartphone while I'm in bed, but I won't be able to work on programs or anything like that.

    It's cool dude, I was asking help from anyone who could and was not expecting you to feel obligated to helping me.

    Thanks for all your help so far and good luck with your pancreas.

    https://www.youtube.com/watch?v=tqDBB0no6dQ

    • Like 1
  11. So I have 540 bytes left for my program to not only fix the clipping issue, but also implement collisions that move the ball in more directions than just the reverse of what it was doing, not to mention copy that over to player1.

     

    I REALLY wanna fix the clipping issue as it's kind of a game-breaker in some regards. I think I'd be able to implement the other things though.

     

     

    EDIT:

    I started working on some code to move the ball back to where it would hit the paddle between its last position and current position, and I'm trying to figure out how to move it so that it's only touching the paddle, and I think this could not only prevent the clipping issue, but also aid in determining what direction to ricochet in.

     

    I need to figure out what formula I can use to determine where to put the ball based on:

     

    Ball's direction

    Ball's current position

    Ball's previous position

    Ball's size(4 by 4)

    Player's position

    Player's size(8 by 8 )

    Here's what I have so far, and no, it doesn't work right, but it's a start I guess.:

    ; BEGIN CONTEXT
    rem ----RED PADDLE COLLISION----
    	if !collision(player0,ball) then goto _skip_P0_B_col
     	if bCollsn then goto _skip_P0_B_col
    
    	AUDF1 = 4 - bvy
    	AUDV1 = 15
    	bCollsn = 1
    	tmp = 0
    	
    	if ballx > player0x - 3 && ballx < player0x + 7 then xClip = 1
    	if bally > player0y - 3 && bally < player0y + 7 then yClip = 1
    	
    	if xClip && yClip then xy_Clip = 1 
    	temp6 = 0 : temp5 = 0
    ; END CONTEXT
    ; HERE'S THE KNOCKBACK CODE
    	if !xClip then _skip_offset_horizontal
    		temp6 = ballx - player0x
    		if !bMoveRt then _skip_offset_lf
    			temp5 = temp6 + 4
    			ballx = ballx - temp5
    _skip_offset_lf
    		if !bMoveLf then _skip_offset_horizontal
    			temp5 = 8 - temp6
    			ballx = ballx + temp5
     		temp6 = 0 : temp5 = 0
    _skip_offset_horizontal
    	if !yClip then _skip_offset_vertical
    		temp6 = ballx - player0y
    		if !bMoveUp then _skip_offset_up
    			temp5 = temp6 + 4
    			bally = bally - temp5
    _skip_offset_up
    		if !bMoveDn then _skip_offset_vertical
    			temp5 = 8 - temp6
    			bally = bally + temp5
    _skip_offset_vertical
    _skip_ball_knock_back
    
    

    I've included the game source as well.

    airhockey.bas

  12. Yours seems to compile, but when I copy your collision code into mine, it doesn't, even after changing xy_Clip back to xyClip.

     

    What all did you change?

     

    Also I can keep the if lines as:

    if p0_x = 0 then...
    

    as p0_x would be zero if the joystick hasn't been moved left or right. Same for p0_y. I was just seeing if it made any difference with the clipping, but it doesn't :\

     

    Could it be due to these lines?

    			if bMoveRt && p0_mv_Rt then goto _skip_to_p0_yCol
    			if bMoveLf && p0_mv_Lf then goto _skip_to_p0_yCol
    

    and

    			if bMoveUp && p0_mv_Up then goto _skip_to_bVel_accumulation
    			if bMoveDn && p0_mv_Dn then goto _skip_to_bVel_accumulation
    
×
×
  • Create New...