Jump to content
IGNORED

Maxximum Confusion


The Maxx

Recommended Posts

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.

 

post-48779-0-25398400-1481986814_thumb.png

Edited by The Maxx
Link to comment
Share on other sites

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.

  • Like 1
Link to comment
Share on other sites


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
  • Like 1
Link to comment
Share on other sites

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
  • Like 1
Link to comment
Share on other sites

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

  • Like 1
Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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

  • Like 1
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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)

Link to comment
Share on other sites

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
Link to comment
Share on other sites


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

  • Like 1
Link to comment
Share on other sites



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
Link to comment
Share on other sites

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