Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Xeda112358

Pages: 1 ... 141 142 [143] 144 145 ... 317
2131
Grammer / Re: Gravity Jump
« on: March 14, 2012, 09:20:52 pm »
Yeah, we went over this before, didn't we? :P (in another topic) It can do over 3500 at 15 MHz

2132
Grammer / Re: Gravity Jump
« on: March 14, 2012, 07:23:54 pm »
Well, think of it this way-- If I can do over 1000 pxl-tests in a second, then checking if I am in the kill zone will not be a problem at all.

2133
First download O.O Awesome job, calc :)

2134
Humour and Jokes / Re: Funny #omnimaga quotes (NSFW)
« on: March 14, 2012, 03:51:31 pm »

[15:41:26]      calc84maniac    otherwise you'll have to settle with pi approximation day :P
[15:41:29]      hellninjas      oh yeah, i keep forgetting other countries do it different D:
[15:41:29]      calc84maniac    22/7
[15:41:33]      Xeda112358      22/7
[15:41:39]      BlakPilar       So my pre-calc teacher went on a whole rant today about how since pi is an arbitrary number, it should be celebrated on an arbitrary day if it is to be celebrated at all...
[15:41:41]      hellninjas      NINJA'D!!!
[15:41:41]      Xeda112358      Ninja'd >.>
[15:41:59]      calc84maniac    how is pi an arbitrary number
[15:41:59]      Xeda112358      !_! Ninja'd again
[15:42:01]      hellninjas      ninja'd again!!!
[15:42:05]      hellninjas      damnit
[15:42:07]      Xeda112358      yesssss
[15:42:13]      hellninjas      lol



I'm only part ninja XD

2135
Grammer / Re: Grammer Q&A
« on: March 14, 2012, 07:53:16 am »
Also, I am not sure if DCS7 and Grammer play poorly together. (You won't be able to run a Grammer program from DCs7, anyways, though)

2136
ASM / Re: ASM Command of the Week
« on: March 13, 2012, 11:55:16 pm »
In a similar vein, you can do some soft-core SMC to speed up a routine such as pixel-testing or even turning the pixel on or off:
Code: [Select]
;===============================================================
PlotPixel:
;===============================================================
;Inputs:
;     B is the x-coordinate
;     C is the y-coordinate
;     D=Method
;        1=Test
;        2=Off
;        3=On
;     (BufPtr) points to the buffer to draw to
;Outputs:
;     BC is equal to (BufPtr)
;     DE not modified
;     HL points to the byte the pixel is drawn to
;     When using the pixel test method:
;       z means pixel off
;       nz means pixel on
;Destroys:
;     A
;===============================================================
     ld a,3Fh            ;7
     srl b \ rra         ;12    19
     srl b \ rra         ;12    31
     srl b \ rra         ;12    43
     cpl                 ;4     47
     or d                ;4     51
     rrca \ rrca         ;8     59
     ld (Method),a       ;13    72
     ld a,b              ;4     76
     ld b,0              ;7     83
     ld h,b \ ld l,c     ;4     87
     add hl,bc           ;11    98
     add hl,bc           ;11   109
     add hl,hl           ;11   120
     add hl,hl           ;11   131
     ld c,a              ;4    135
     add hl,bc           ;11   146
     ld bc,(BufPtr)      ;20   166    BufPtr points to the buffer
     add hl,bc           ;11   177
     .db $CB             ;15   192    First byte of BIT
Method:
     .db 46h             ;            second byte of the BIT instruction
     ret                 ;10   202  37 bytes

2137
How about add hl,(**)? I would use that in cases where, say, HL is the offset into a buffer and the location of the buffer is at **. Or an instruction I just invented off the top of my head:

asjnc *

It performs add a,c \ sub b and does a relative jump if it did not go below zero. That might be useful, especially for line drawing and circle drawing and whatnot. I think it would be 16 cycles using the current processor.

2138
Grammer / Re: Grammer Q&A
« on: March 13, 2012, 05:36:52 pm »
Okay, I am trying to think of what could be wrong D:
As for grayscale, here is what you can try:

Store pi9872 to a pointer-- this is where a 768-byte buffer is located. I'll call the pointer G, for Gray.
Now do this: Disp oG to set the gray buffer.

Now when you draw, you draw the gray stuff to buffer G and black to the normal buffer. To make white, you need to erase on both buffers.

You also need to be constantly updating with DispGraph for it to appear gray. To draw to the gray buffer, most drawing instructions will let you use an extra argument to point to the buffer. For example, to draw a rectangle to the gray buffer:

Lined(0,0,8,8,1,G

I hope that helps!

2139
Introduce Yourself! / Re: Hello.
« on: March 13, 2012, 03:33:08 pm »
Hi! And I get it, Stefan XD Um, so would you like some complimentary
!peanuts
with your stay? Enjoy!

2140
Grammer / Re: Grammer 2-The APP
« on: March 13, 2012, 03:17:37 pm »
I also wrote the code in assembly and for things like this, the process can be really sped up. I am not sure how other languages compare.

2141
I now have the MORPION program done :D I wrote it during class today and it has a few nice features. I won't tell the features or anything that it does, though, because I don't think I can.

I am not sure how the judging works, but I think the programs are submitted with your secret number, then scored, and then matched up with the correct person at the end.

2142
Grammer / Re: Grammer 2-The APP
« on: March 13, 2012, 03:03:02 pm »
Wow O.O 48Hz is 8 times faster than the calc. Okay, some pseudo code...
Make a finite array of, say, 12 elements. This is the data for 6 particles. The elements are:
{X1,Y1,X2,Y2,X3,Y3,X4,Y4,X5,Y5,X6,Y6}

So loop through the particles like this:
For the first particle, get (X1,Y1). Test the pixel below that coordinate. If it is empty, do Pxl-Off on the original, Pxl-On to the new location and change Y1. If it is not empty, randomly select left or right to test first. If it is empty, move there, adjusting pixel states and updating X1. If that is not available, check the other left/right and do the same. Finally, if that isn't empty, either, do nothing.

Since the particle should not be starting on any already made pixels, it never occupies an already occupied space and so it does not delete any original contents. It only deletes itself from frame to frame. In BASIC, I did this:

Code: [Select]
{3,3,3,3,3,3→L1    ;Y-coordinates
Ans→L2              ;X-coordinates
Repeat getKey=45
For(A,1,6
L2(A→X
L1(A→Y
If pxl-Test(Ans+1,X
Then                     ;This checks left/right
2randInt(0,1)-1→B   ;B becomes 1 or -1
If pxl-Test(Y,X+B
-B→B
If not(pxl-Test(Y,X+B
Then
Pxl-Off(Y,X
X+B→L2(A
Pxl-On(Y,Ans
End
Else
Y+1→L1(A
Pxl-Off(Y,X
Pxl-On(Ans,X
End
End
End

You will see it doesn't go nearly as fast in BASIC which is why I did it in ASM >.>

2143
I'm 1083 :D Also, I probably signed up for an account a few years before I became active. I think DJ deleted it for me, though :)

2144
Grammer / Re: Grammer 2-The APP
« on: March 13, 2012, 08:49:36 am »
The array is stored elsewhere. As long as you have a pointer to the array, you are fine :) The location is generally a fixed location for the duration of the program, though.

2145
Grammer / Re: Grammer 2-The APP
« on: March 13, 2012, 08:37:58 am »
Oh, for the particles. Yes, it has to read from both so that it can interact with the environment. There is a particle buffer and screen buffer. The particle buffer interacts with the screen buffer :) That is how it flows around static objects :D

EDIT: I refer to the particle array as a particle buffer.

Pages: 1 ... 141 142 [143] 144 145 ... 317