Maybe something like the following to get the colour of the pixel at (x, y):

10 LET A=IN 252 BAND 31
20 LET BASE=(A+1)*16384
30 LET ADDR = BASE + (x/2) + y*128
40 LET BYTE = PEEK(ADDR)
50 IF x BAND 1 THEN LET COL = BYTE/16 ELSE LET COL = BYTE BAND 15

(psuedo code, because I'm not sure offhand what SAM BASIC does with
respect to floating point numbers versus integer numbers and I don't
recall the syntax for bit shifting - for the purposes of that code
just imagine that all variables are integers and adapt as necessary)

Once you've calculated ADDR for one point, it's probably easier just
to add and subtract fixed amounts to get the address for your other
pixels.

On Thu, Sep 18, 2008 at 11:35 AM, Calvin Allett
<[EMAIL PROTECTED]> wrote:
> Hey there, been a while... hope everybody's doing good :)
>
> Some of you may remember me starting work on a new game engine last year,
> "Slip 'n Slide", well it only got to the stage of a couple of weeks work,
> but picked it up again 3 months ago and have been working on it daily since
> then.
>
> It's progressed a lot, with relation to how 'nice' the engine is, and I'm
> rather pleased with it so far, however since the levels are drawn and there
> is no map data everything is done using the POINT command (collisions with
> scenery, enemies and power pills(well there's an array for pills, but fiding
> them is handled with point initially)), and whilst this allows for rather
> sweet level designs and movement (You can get squashed vertically or
> horizontally now :) ) the engine has slowed about 50 % even in the last 4
> weeks :(
>
> Is there nothing to be done, is the Point command as fast as it could be or
> is
> there another way forward? I'm always shy/awkward over asking for help, but
> could anybody see themselves helping with a little machine code prog that
> would do the following:-
>
> take the x and y values from the Basic variable list, check about 9 pixel
> colour values around it the main 9*9 sprite (L,R,B,B2,B3,T,C,BR,B0) and put
> the values into those variables, could this in theory be done easily, or
> would there be no speed benefit... POINT does seem to be really slow, it's
> the complexity of the game engine too slowing it down (a lot of code for
> uncompiled 8 bit basic at least, every iteration) and I've used every trick
> I learned from Tomato Antics, so no more I can do :(
>
> I'm really sad over this, this is for the 20 Mhz SAM and I know I should
> be using MC but I just haven't got the head for learning it at the moment
> still, and
> honestly don't think I would enjoy programming in anything else than
> Basic... I
> really like this engine too, but have took the enemies out, so I'm only
> drawing 1 (yes ONE) masked sprite... I'm stupid for attempting this in
> Basic, but it would just be another flat level mapped platformer without the
> POINT command...
>
> anyways, I've had my moan ;)
>
> Hope all your own projects are coming along, and I'm not really expecting
> anyone to be able to find the time, but I'd be a fool not to mention it :)
>
> Cal...
>
>

Reply via email to