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 - chickendude
Pages: 1 ... 39 40 [41] 42 43 ... 55
601
« on: October 23, 2012, 04:00:49 pm »
Anyone who stayed around long enough to program an RPG was more than likely a member of one of those communities (especially ticalc). Also, check out Shadow of Nárkemen. There was also a sequel which was pretty much finished. Unfortunately, somehow it never got released and seems to have disappeared from the internet. And you didn't like Joltima? I think that's one of the most polished games (not just RPGs) ever made for the ti calcs! (EDIT: Searching for "Shadow of Nárkemen", google suggested "shadow of naked men" )
602
« on: October 23, 2012, 03:38:49 pm »
So what is the speed, then? Would speed be "96"? I'm trying to figure out how to calculate the initial velocities. Let's simplify 96 to 3. object = 10,10 (x,y) bullet = 5,2 length = sqrt(3 2+0 2) length = 3 xVel = (10-5)/3*...3? -> 5/1 xVel = 5 yVel = (10-2)/3*3 -> 8/1 yVel = 8 If i change speed to one: xVel = (10-5)/3*1 -> 5/3 xVel = 1 2/3 yVel = (10-2)/3*1 -> 8/3 yVel = 2 2/3 I don't quite get what values i'm supposed to be using. EDIT: Maybe i've got it now, i'll test it out tomorrow and see.
603
« on: October 23, 2012, 03:23:19 pm »
Ok, i just tried to write this out but i'm a little confused as to what "speed" is. It seems to me that speed and length are the same? But that can't be right. Right now, bullet x velocity is 96 (%01100000: moving 3 (%011) pixels every frame) when y velocity = 0, so that should mean that length is also 96, right? It seems to me like: velX = length/(objX-bullX) * speed velY = length/(objY-bullY) * speed ..would be more accurate, as shouldn't a larger distance between the object and the bullet give a lower velocity?
604
« on: October 23, 2012, 02:57:03 pm »
Do you need it to clip? I can post the clipped sprite routine i've got though it's much more dependent on SMC (and much larger). It's also probably not very optimized. To give you an idea, this is what it looks like (this is for a 24x24 sprite): bossY = $+1 ld hl,TERRE_Y*256 ;la coordonnée y du boss call subMapYHL ;hl (bossY) - map Y ret c ;si le carry est armé, le boss est hors de l'écran ld a,h cp 64 ;plus de 8 et le boss est hors d'écran ret nc ld e,a ;sauver coordonnée Y ld b,0 bossX = $+1 ld hl,$0400 ld a,l rlca rlca rlca and $7 ;a = xOff ld c,a ;sauver xOff dans c ld a,h ld hl,xCoord sub (hl) ;bossX-mapX jr nc,xNotNegative ;pour une explication, voir dessous ld d,a ;sauver a dans d. a = combien d'octets (pas de pixels!) on est de le bout gauche de l'écran add a,BOSS_W ret m ; ... le sprite est hors d'écran ld b,a ; add a,a ;*2 add a,b ;*3 (parce que chaque ld (xxx),a occupe trois octets) ld (clipLeft),a ;SMC: changer où va sauter le jr xor a ;valeur qui va remplacer spriteByteX ld b,$FF ;plus tard nous chargeons b dans d. $FF est parce que c'est un numéro (16bit) négatif clipLeft = $+1 jr $ ;avec du SMC on va sauter ld (spriteByte3),a ;SMC: change the ld (hl),a to a nop (HEX $00) ld (spriteByte2),a ; ld (spriteByte1),a ; ld a,d ld d,0 jr noWorkToDo xNotNegative: cp 13 ;s'il est complètement hors d'écran, quitter ret nc cp 10 ;s'il est partiellement hors d'écran, clipper jr c,noWorkToDo push af ;########################### ;# je vais expliquer cette partie-ci parce qu'elle m'a vraiment frustré ;# cette partie s'occupe du "clippage" des sprites hors d'écran ;# si le sprite va s'afficher dans la 11ème colonne (ou la 10ème commençant de zéro) ;# une partie va être hors d'écran. il faut la clipper. ;# si le sprite s'affiche dans la 10ème colonne, il y a un octet qui ne s'affichera pas ;# la 11ème, il y'en aura 2, et la 12ème, 3. ;# regarder la liste au-dessous du "jr $". si nous voulons effacer le dernier octet du sprite ;# il nous faut sauter "ld (spriteByte2),a" et "ld (spriteByte3),a". donc, on nécessite savoir 12-a ;# puis, nous multiplions ça par 3 (chaque instruction occupe 3 octets) et changer où "jr" va sauter. ld b,a ld a,12 sub b ;essentiellement, a=12-a ld b,a add a,a add a,b ;a*3 (parce que chaque ld (xxx),a occupe trois octets) ld (clipRight),a ;SMC: changer le jr xor a ;valeur qui va remplacer spriteByteX ld b,a clipRight = $+1 jr $ ld (spriteByte2),a ;SMC: change the ld (hl),a to a nop (HEX $00) ld (spriteByte3),a ; ld (spriteByte4),a ; pop af noWorkToDo: ld d,0 ld l,e ld h,d add hl,hl ;y*2 add hl,de ;y*3 add hl,hl ;y*6 add hl,hl ;y*12 add hl,de ;y*13 ld de,megaGbuf+BOSS_W ;86EC+2 (nous dessinons de droite à gauche, les sprites des boss occupent 2 octets, 16 pixels) add hl,de ld e,a ld d,b add hl,de ld a,c ld b,a ld c,BOSS_H desBossBoucle: push bc ld d,(ix) ;sprite ld e,(ix+1) ld c,(ix+2) xor a cp b ;si b = 0 jp z,spriteAligne srl d \ rr e \ rr c \ rra \ djnz $-7 ;rotate sprite spriteAligne: or (hl) ;HL = endroit dans gbuf spriteByte4 = $ ld (hl),a ;charger a dec hl ld a,(hl) or c spriteByte3 = $ ld (hl),a ;charger c dec hl ld a,(hl) or e spriteByte2 = $ ld (hl),a ;charger e dec hl ld a,(hl) or d spriteByte1 = $ ld (hl),a ;charger d inc ix inc ix inc ix ld de,13+BOSS_W add hl,de pop bc dec c jp nz,desBossBoucle ld a,LDHLA ld (spriteByte4),a ld (spriteByte3),a ld (spriteByte2),a ld (spriteByte1),a ret
LDHLA = $77 ;$77 est le "opcode" de "ld (hl),a" And this is subMapYHL/XHL, which is used all over the place: subMapYHL: ld a,(yCoord) jr subMapHL subMapXHL: ld a,(xCoord) subMapHL: push de ld d,a ld e,0 or a sbc hl,de jr c,endSubMap add hl,hl add hl,hl add hl,hl endSubMap: pop de ret The comments are all in (really bad) French, sorry. It'd be slightly smaller but that's what you'd be dealing with for a clipped routine (at least from me ). It might be easier just to give you my entire tilemapper.
605
« on: October 23, 2012, 02:36:30 pm »
Awesome, that's exactly what i needed. I remembered A 2 + B 2 = C 2 but was afraid i'd have to use sine/cosine (and an LUT) which seemed like a lot of work/memory for something that's not that important. I looked at a couple line-drawing routines but they were just way above my head. It's for a boomerang-effect, but only on the way back (the angle should be constant on the way out). The routine i used is pretty buggy. Actually, i'm gonna try to implement that right now EDIT:
606
« on: October 23, 2012, 08:45:26 am »
I'm trying to put together a routine that will calculate the appropriate X/Y velocity to go towards an object. What i've got now is really buggy, i think the general algorithm/idea is ok though. My biggest hurdle so far has been handling negative numbers, as none of my routines for multiplication/division seem to like negative numbers. What i'm currently doing is really just adjusting the Y velocity and not bothering with the X velocity. The general equation is something like this: (object Y - bullet Y)/(object X - bullet X)
The X/Y velocities have 5 bits which act as a decimal place, but this doesn't let me use it. I hacked in the ability to handle negative numbers in the division routine (essentially turning all negative numbers positive, then negating the result afterward), but my multiplication routine doesn't like negatives numbers either.
607
« on: October 23, 2012, 05:35:13 am »
Or just use "jr z,skipSpriteClip", but yeah if you're typing it out by hand it should be 28 07 (28 00 jumps to the next instruction). And about the missing $1F and $10, i must've accidentally cut them off when copying/pasting it, sorry about that. The hex codes spanned two lines and i moved them all onto one line.
608
« on: October 22, 2012, 10:33:24 am »
You're right, either way it'll still be slower. If you are using a 16x16 routine, you will be calling that routine more times than if you were drawing normal 16x16 sprites (essentially the last four rows will be time completely wasted, doing nothing), and calculating the offset every time means a lot more shifting bytes since at least every other tile will be unaligned. But another reason for the slowdown with Sam Heald's Zelda might just be that back then there weren't that many smooth-scrolling games in general.
609
« on: October 22, 2012, 09:43:21 am »
I'm not sure how you are using that routine, that routine requires the position in the gbuf to be set already. The other routine i posted will calculate the x/y position in the gbuf for you. In that routine, b isn't the x coordinate on screen, it's the x offset, essentially how many pixels from 8 (being byte-aligned) it is. So if X = 32, 32 AND 7: b=0. If X = 35, 35 AND 7: b=3. I'm not sure what you're trying to put into b, but if you are putting 'h' into 'b', you're putting the byte at $83A8 into b. 'l' holds the byte at $83A7. But anyway, i think you're passing the wrong parameter. The other code i posted should calculate the position in the gbuf for you with an X/Y coordinate (in pixels)
610
« on: October 21, 2012, 05:44:49 am »
Again a bit of a bump, but (in the picture) how do you get 126 from (sign-extended) $FE? I believe it should be 254 (like mentioned in the post body). And i'd be interested in discussing SH3 assembly with anyone else interested
611
« on: October 19, 2012, 05:53:15 am »
Awesome thanks, i'll test it out later tonight
612
« on: October 19, 2012, 03:20:39 am »
Wow, i played this game when it came out and thought it was awesome (a little short, though). It's cool to see updates to all these great games that helped me get through high school!
613
« on: October 18, 2012, 11:36:31 am »
Other way around, an 84+SE inside an 84+ case, but yeah! And i thought i was just getting a regular 84+ and bought it 'cuz it was about half the price of the SE Now i just need to figure out if it's got the extra RAM pages...
614
« on: October 18, 2012, 11:33:27 am »
Yeah, that's exactly it. If your buffer is 12 bytes wide and you want to draw on the 4th row, you'll need to add 4*12 to the buffer address. The other code i posted above will calculate that for you with e=y, b=x. However, if you can save your position in the gbuf each time you draw a tile, you can save quite a few clocks by not having to recalculate your location in the buffer again.
615
« on: October 18, 2012, 06:37:50 am »
Ah that space is empty EDIT: The about screen DOES say Silver Edition, but the case doesn't. Weird.
Pages: 1 ... 39 40 [41] 42 43 ... 55
|