Jump to content

Photo

Maxximum Confusion


73 replies to this topic

#26 The Maxx OFFLINE  

The Maxx

    Star Raider

  • Topic Starter
  • 79 posts

Posted Sat Dec 17, 2016 9:01 AM

I thought I might try the titlescreen kernel.  I made a crappy little titlescreen and then started through the .pdf guide, but my Visual bB doesn't seem to have the options listed in the manual : "Title Kernal 96x1", "Title Kernal 48x1", "Title Kernel 48x2", etc.

 

Here is my version of visual bB compared to the one in the TSKernel manual.

 

Whaaaa.png


Edited by The Maxx, Sat Dec 24, 2016 12:39 PM.


#27 CaptainBreakout OFFLINE  

CaptainBreakout

    Star Raider

  • 52 posts
  • Location:Rough & Ready

Posted Sun Dec 18, 2016 5:44 PM

I love this game!  It's like Minesweeper and Boulderdash had a baby.

 

I especially like how you got the multi-colored characters. They look particularly good and the game layout is really clean too.

 

The one thing I'd say it needs is sound. Some sort of sound.



#28 The Maxx OFFLINE  

The Maxx

    Star Raider

  • Topic Starter
  • 79 posts

Posted Sun Dec 18, 2016 6:22 PM

Thanks!  :thumbsup:


Edited by The Maxx, Sat Dec 24, 2016 12:50 PM.


#29 CaptainBreakout OFFLINE  

CaptainBreakout

    Star Raider

  • 52 posts
  • Location:Rough & Ready

Posted Mon Dec 19, 2016 12:48 AM

Nice! Definitely an improvement. The sounds make the game much more of an Atari experience. 



#30 Mountain King OFFLINE  

Mountain King

    Dragonstomper

  • 607 posts
  • Location:Philadelphia, PA

Posted Mon Dec 19, 2016 4:42 AM

Nice job. The game does remind me of minesweeper. I like the colors and the sound. There have been a couple of times where a bomb was right below the ladder. On the first level this would ok but higher levels this would be frustrating since you only have one life.

On a technical note your fps seem to be all over the place. At least they are under 60 most of the time. It looks like they jump past 60 when you collect a diamond. The game will probably have some jitter on real hardware.



#31 The Maxx OFFLINE  

The Maxx

    Star Raider

  • Topic Starter
  • 79 posts

Posted Mon Dec 19, 2016 6:31 AM

The top row should be free of any mines, so if there is a mine below the ladder, just move to the left or right.  I should have mentioned this before.


Edited by The Maxx, Sat Dec 24, 2016 12:41 PM.


#32 The Maxx OFFLINE  

The Maxx

    Star Raider

  • Topic Starter
  • 79 posts

Posted Tue Dec 20, 2016 8:28 PM

<edit>

 

In an effort to keep this thread about programming in batari Basic, I have moved all Mine Dig stuff here:

 

http://atariage.com/...60288-mine-dig/


Edited by The Maxx, Sat Dec 24, 2016 12:49 PM.


#33 The Maxx OFFLINE  

The Maxx

    Star Raider

  • Topic Starter
  • 79 posts

Posted Wed Dec 21, 2016 7:28 PM

<edit>

 

Screen rolling due to unstable fps... 

 

Simplified some code and, although it ate up more ROM, the problem is alleviated.


Edited by The Maxx, Sat Dec 24, 2016 12:48 PM.


#34 The Maxx OFFLINE  

The Maxx

    Star Raider

  • Topic Starter
  • 79 posts

Posted Thu Dec 22, 2016 12:47 PM

Is there a good example of a simple function?  I'm sure that the one on RT's page is good, but I can't figure out how to add arguments or make it useful...


Edited by The Maxx, Sat Dec 24, 2016 12:48 PM.


#35 bogax OFFLINE  

bogax

    Dragonstomper

  • 697 posts

Posted Thu Dec 22, 2016 7:31 PM

 
functions are pretty much useless (or worse) in bB
about the only thing you can do is assign it to a variable
use a subroutine 
 
you don't need (or want) an end statement, just return
 
whatever is in the accumulator is what the functiion returns
 
a function always passes two values and puts them in temp1 and temp2
whether you supply parameters or not
 
 function dummy
 b = 3
 return
 
 c = dummy()
 
c contains 3
 
 function void
 return
 
 l = 5
 
 d = void()
 
temp1 and d contain 5

Edited by bogax, Thu Dec 22, 2016 7:32 PM.


#36 The Maxx OFFLINE  

The Maxx

    Star Raider

  • Topic Starter
  • 79 posts

Posted Thu Dec 22, 2016 8:11 PM

Thanks!  :)

 

I ended up solving the problem with a subroutine. 


Edited by The Maxx, Sat Dec 24, 2016 12:43 PM.


#37 The Maxx OFFLINE  

The Maxx

    Star Raider

  • Topic Starter
  • 79 posts

Posted Fri Dec 23, 2016 12:46 PM

The colors look a little funny on my Atari, but that might be because I'm playing on a squished tiny little 8 inch screen. 

 

<edit>

 

I tore open my Atari and adjusted the potentiometers. The picture is better, but not exactly as nice as I'd hoped. What can I expect though, this machine is as old as I am... my colors aren't so pretty either.


Edited by The Maxx, Sat Dec 24, 2016 12:45 PM.


#38 The Maxx OFFLINE  

The Maxx

    Star Raider

  • Topic Starter
  • 79 posts

Posted Sun Dec 25, 2016 12:05 AM

Can you toggle a bit on and off by adding to it? For example...

toenail= toenail+1
if toenail= 25 then toejam{0} = toejam{0}+1 : toenail=0

Edited by The Maxx, Sun Dec 25, 2016 1:04 AM.


#39 Random Terrain OFFLINE  

Random Terrain

    Visual batari Basic User

  • 27,819 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Sun Dec 25, 2016 1:26 AM

Can you toggle a bit on and off by adding to it? For example...

toenail= toenail+1
if toenail= 25 then toejam{0} = toejam{0}+1 : toenail=0

 

Related link:

 

randomterrain.com/atari-2600-memories-batari-basic-commands.html#flip_a_bit



#40 The Maxx OFFLINE  

The Maxx

    Star Raider

  • Topic Starter
  • 79 posts

Posted Sun Dec 25, 2016 7:13 PM

Thanks, RT!  You're a swell guy, you know?  I'm really digging the quick and friendly support! 

 

k, so (queso?)... I have a new question:

 

I have a small program that cycles through colors:

   dim changeColor = a.b 			; cycling color variables

start

   player0x = 16 : player0y = 20		; set player position

 player0:
  %01111110
  %11100111
  %11000011
  %10000001
  %11111111
  %11011011
  %11011011
  %01111110
end

main

   changeColor = changeColor + 0.66		; cycle through

   COLUP0 = changeColor 			; change player color

   drawscreen					; drawscreen

 goto main			

^ That works with the default bB kernel, but if I try to use similar code to change the colors of a sprite in the DPC+ kernel, it changes it to a pale yellow color and doesn't cycle:

dim changeColor = a.b                ; cycling color variables

start

player0x = 16 : player0y = 20        ; set player position

player0color:                        
changeColor
changeColor
changeColor
changeColor
changeColor
changeColor
changeColor
changeColor
end

player0:
%01111110
%11100111
%11000011
%10000001
%11111111
%11011011
%11011011
%01111110
end

main

changeColor = changeColor + 0.66      ; cycle through

drawscreen                    

goto main            



I'm probably trying to do something majorly dumb.  Hah!



#41 Random Terrain OFFLINE  

Random Terrain

    Visual batari Basic User

  • 27,819 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Sun Dec 25, 2016 10:06 PM

Can we put variables where color data is supposed to be? As far as I know, we have to use numbers, but I could be wrong:

 

randomterrain.com/atari-2600-memories-batari-basic-commands.html#dpc_sprite_colors



#42 The Maxx OFFLINE  

The Maxx

    Star Raider

  • Topic Starter
  • 79 posts

Posted Sun Dec 25, 2016 11:26 PM

There must be a way to do it without entering a data set for each color change.  I think I'm going to continue on with my game in monochrome and hope that an answer comes.  If not, I may just end up hardcoding the colors for each change, but that seems like a waste of space and I can't imagine the transition would look nearly as cool. 

 

Whoah, your avatar just changed color and I thought I was hallucinating.  :o  Hahah!



#43 bogax OFFLINE  

bogax

    Dragonstomper

  • 697 posts

Posted Mon Dec 26, 2016 8:57 AM

I'm not all that familiar with the DPC+ kernel

 

It looks to me like it just passes a pointer to the color table to the ARM code.

so short of modifying the kernel

you could have a routine that passed a pointer from a variable, but the colors themselves would

have to be in a ROM table and they'd have to be in the graphics bank and I think the only

way to get them there is with a player color statement

 

it might be possible to have all the colors in one big playercolor statement though



#44 The Maxx OFFLINE  

The Maxx

    Star Raider

  • Topic Starter
  • 79 posts

Posted Mon Dec 26, 2016 11:23 AM

Wow, that's way over my head.  It's good information to have for later when I understand this stuff more.  Thanks!

 

Is there a simple example of a routine that passed a pointer from a variable?  I have looked around on the interwebz, but I don't really get the pointer stuff yet.


Edited by The Maxx, Mon Dec 26, 2016 12:17 PM.


#45 bogax OFFLINE  

bogax

    Dragonstomper

  • 697 posts

Posted Thu Dec 29, 2016 12:14 AM

Wow, that's way over my head.  It's good information to have for later when I understand this stuff more.  Thanks!

 

Is there a simple example of a routine that passed a pointer from a variable?  I have looked around on the interwebz, but I don't really get the pointer stuff yet.

 

a pointer is a location in memory that contains the location (memory address) of something else

I suppose by that definition a pointer could be a constant but they're always variables

 

technically I misspoke I should have said that it passes a reference since I was talking about the value the pointer would contain

(which in this case would be the address of the playercolor table)



#46 The Maxx OFFLINE  

The Maxx

    Star Raider

  • Topic Starter
  • 79 posts

Posted Tue Jan 3, 2017 8:13 PM

Okay, so... sometimes I do things the long and tedious way.  Then I go back and tidy things up when I can see a broader picture of where the patterns are.  However... I started putting together a 32 direction subpixel movement and found that, even though the pattern is obvious, I am unable to multiply the floats the way that seems most obvious in order to shrink the code down to something less ridiculous (bB hangs). 

 

This is what I got...  it works fine, but it's BLOOAATED.  Ha!  Thanks in advance if there is anyone who could give me some advice:

 

my variables are set like:

 

 dim xVel = a.b
 dim yVel = c.d

 

 I have tried creating my own "temp variables" to do the multiplication ahead, but that failed as well

 

 dim temp2 = e.f  ; etc

 if direction=0 && joy0up then xVel=xVel+0.032 		
 if direction=1 && joy0up then xVel=xVel+0.028 	: yVel=yVel-0.004
 if direction=2 && joy0up then xVel=xVel+0.024 	: yVel=yVel-0.008
 if direction=3 && joy0up then xVel=xVel+0.020 	: yVel=yVel-0.012
 if direction=4 && joy0up then xVel=xVel+0.016 	: yVel=yVel-0.016
 if direction=5 && joy0up then xVel=xVel+0.012 	: yVel=yVel-0.020
 if direction=6 && joy0up then xVel=xVel+0.008 	: yVel=yVel-0.024
 if direction=7 && joy0up then xVel=xVel+0.004 	: yVel=yVel-0.028

 if direction=8 && joy0up then yVel=yVel-0.032		
 if direction=9 && joy0up then xVel=xVel-0.004  : yVel=yVel-0.028
 if direction=10 && joy0up then xVel=xVel-0.008 : yVel=yVel-0.024
 if direction=11 && joy0up then xVel=xVel-0.012 : yVel=yVel-0.020
 if direction=12 && joy0up then xVel=xVel-0.016 : yVel-yVel-0.016
 if direction=13 && joy0up then xVel=xVel-0.020 : yVel=yVel-0.012
 if direction=14 && joy0up then xVel=xVel-0.024 : yVel=yVel-0.008
 if direction=15 && joy0up then xVel=xVel-0.028 : yVel=yVel-0.004

 if direction=16 && joy0up then xVel=xVel-0.032 	
 if direction=17 && joy0up then xVel=xVel-0.028 : yVel=yVel+0.004
 if direction=18 && joy0up then xVel=xVel-0.024 : yVel=yVel+0.008
 if direction=19 && joy0up then xVel=xVel-0.020 : yVel=yVel+0.012
 if direction=20 && joy0up then xVel=xVel-0.016 : yVel=yVel+0.016
 if direction=21 && joy0up then xVel=xVel-0.012 : yVel=yVel+0.020
 if direction=22 && joy0up then xVel=xVel-0.008 : yVel=yVel+0.024
 if direction=23 && joy0up then xVel=xVel-0.004 : yVel=yVel+0.028

 if direction=24 && joy0up then yVel=yVel+0.032
 if direction=25 && joy0up then xVel=xVel+0.004 : yVel=yVel+0.028
 if direction=26 && joy0up then xVel=xVel+0.008 : yVel=yVel+0.024
 if direction=27 && joy0up then xVel=xVel+0.012 : yVel=yVel+0.020
 if direction=28 && joy0up then xVel=xVel+0.016 : yVel=yVel+0.016
 if direction=29 && joy0up then xVel=xVel+0.020 : yVel=yVel+0.012
 if direction=30 && joy0up then xVel=xVel+0.024 : yVel=yVel+0.008
 if direction=31 && joy0up then xVel=xVel+0.028 : yVel=yVel+0.004

Edited by The Maxx, Tue Jan 3, 2017 8:19 PM.


#47 bogax OFFLINE  

bogax

    Dragonstomper

  • 697 posts

Posted Tue Jan 3, 2017 11:11 PM

 
 first you consolidate the redundant predicates
 then use a lookup table
 
 here's a macro to lookup 8.8 values
 
 you'll have to figure out the table(s) yourself
 
 
 untested but it should give you the idea
 
 
 dim tmp88 = temp4.temp3
 
 
 ; lookup an 8.8 constant from a table
 ; the table is in two data statements one for hi bytes and one for lo bytes
 ; takes three parameters
 ; a variable to take the looked up value it must be in consecutive locations
 ; eg variable a for the lo byte and b for the hi byte b.a or temp4.temp3 etc
 ; an 8 bit index
 ; the name of the table if the name supplied is "table" then the data statements
 ; must be named tablelo, tablehi
 
 
  macro lu88
  asm
  ldx {2}
  lda {3}lo,x
  sta {1}-1
  lda {3}hi,x
  sta {1}
end
end
 
 
 
 if joy0up then callmacro lu88 tmp88 direction Vx_table : xVel = xVel + tmp88 : callmacro lu88 tmp88 direction Vy_table : yVel = yVel + tmp88 
 


#48 The Maxx OFFLINE  

The Maxx

    Star Raider

  • Topic Starter
  • 79 posts

Posted Thu Jan 5, 2017 8:21 AM

Thank you!  I almost understand this.  It will be good to have here when things start coming together in my feeble brain.  :)



#49 bogax OFFLINE  

bogax

    Dragonstomper

  • 697 posts

Posted Thu Jan 5, 2017 6:37 PM

 
  Here is something similar in bB with the tables
 
  the tables have redundancies and symmetries that could be exploited to make them
  smaller but it would be slower
 
 
  I should have mentioned that this assumes that directions is limited to 0..31
 
 
  dim tmp88 = temp4.temp3
 
 
 
  if !joy0up then skip
  temp3 = Vx_lo[direction] : temp4 = Vx_hi[direction] : xVel = xVel + tmp88
  temp3 = Vy_lo[direction] : temp4 = Vy_hi[direction] : yVel = yVel + tmp88
 
skip
 
 
 
 
 
 
  data Vx_lo
    8,   7,   6,   5,   4,   3,   2,   1  
  248, 255, 254, 253, 252, 251, 250, 249 
  248, 249, 250, 251, 252, 253, 254, 255
    8,   1,   2,   3,   4,   5,   6,  7
end
 
  data Vx_hi
    0,   0,   0,   0,   0,   0,   0,   0
  255, 255, 255, 255, 255, 255, 255, 255
  255, 255, 255, 255, 255, 255, 255, 255
    0,   0,   0,   0,   0,   0,   0,   0
end
 
  data Vy_lo
    0, 255, 254, 253, 252, 251, 250, 249 
    0, 249, 250, 251, 252, 253, 254, 255
    0,   1,   2,   3,   4,   5,   6,   7
    0,   7,   6,   5,   4,   3,   2,   1  
end
 
  data Vy_hi
    0, 255, 255, 255, 255, 255, 255, 255
    0, 255, 255, 255, 255, 255, 255, 255
    0,   0,   0,   0,   0,   0,   0,   0
    0,   0,   0,   0,   0,   0,   0,   0
end
 
 
 
 
 
 
 
  I may have gotten the tables right ;)
 
  edit: oops nope
 (fixed now)
 (I hope ;)
 

Edited by bogax, Fri Jan 6, 2017 7:47 PM.


#50 The Maxx OFFLINE  

The Maxx

    Star Raider

  • Topic Starter
  • 79 posts

Posted Sat Jan 7, 2017 10:08 AM

Aha!  Now, this is something that I'm pretty sure I understand.  I've been wondering how to use tables and it appears that it is easier than I thought... kind of like a 1d (read only?) array...  that can be used with multiple objects.  

 

Thanks!!!  Now, I just need to put it to use.  :D


Edited by The Maxx, Sat Jan 7, 2017 10:27 AM.





0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users