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

Pages: 1 ... 51 52 [53] 54 55
781
ASM / Re: Useful Routines
« on: January 05, 2012, 12:56:41 pm »
You're right, i love looking at how people go about their tilemappers. Thanks for sharing!

782
ASM / Re: Useful Routines
« on: January 05, 2012, 05:44:27 am »
I think pretty much everyone knows about z80 bits, but:
http://baze.au.com/misc/z80bits.html
Also, there's a nice French site which talks about z80 multiplication/division:
http://projets.infos.free.fr/CPC/CPC_MultiplicationsDivisions.php5

Later i can maybe upload my tilemap routine or maybe my number-to-string routine. :)
EDIT: Here's the number-to-string routine i wrote:
http://pastebin.com/sudK27tC (anti-copyright)
And here's a simplified version of the 16x16 tilemap routine i wrote (though i was using a 7(wide)x5(tall) buffer):
http://pastebin.com/hxtH1Vqu (anti-copyright)
It's a bit smaller than the one you posted and maybe a bit faster as i incorporated the sprite drawing directly into the routine, not using a separate sprite routine, but i haven't checked, so i dunno. I'm really bad at multiplication routines, i usually do things by multiples of two or use a simple routine similar to what everyone else uses. I should look into how z80 math works a bit more...

783
ASM / Re: ASM Command of the Week
« on: January 03, 2012, 07:12:20 pm »
Well, my laptop busted (or rather, i busted my laptop) but i had made a fairely recent backup of it (the code on yaronet). Right now i'm a bit spread out but especially once i get Monopoly taken care of (a project that's been biting at my feet for maybe 8 years now) it's next on my hitlist. Actually, a lot of the work i've done with the Monopoly text/menu engine will probably be carried over into the RPG. One of the big things i need to do now is work on the story a bit. Thanks, btw :)

Does anyone have any suggestions for the next "Command of the Week"?

784
Other Calculators / Re: 83+ discontinued in some areas?
« on: January 03, 2012, 07:02:31 pm »
The 83+ was always fairly stable (i'll never upgrade beyond 1.12). With the SE a lot of problems started popping up, incompatibility with certain games, etc. but the extra memory was definitely worth it. Still, i'd never consider programming a 15mhz-only program, as the 82/83/+ hold a special place in my heart. Some things, like calc84maniac's incredible emulator or some of the 3D projects which would otherwise be impossible at the slower speed/without the extra hardware of the newer calcs, i can sympathize with. But it seems to me like a lot of people use the faster speed to get away with sloppier coding. Besides, with all the newer models it seems there's so much inconsistency. Who'd of thought that wanting to stick with my trusty old 83+ would make me into an old-timer? Has so much time really passed? The only person i still see around clinging to their 82 is DigiTan :P

785
[DE] Andere TI- und Casio-Diskussionen / Re: ASM-programmierer
« on: December 31, 2011, 02:46:05 pm »
Willkommen, im deutschen Bereich, mdr1 :)

786
ASM / Re: Constructive and Creative uses of RLD and RRD
« on: December 31, 2011, 11:00:35 am »
Well, it doesn't really matter now as i see what code you were talking about in Hayleia's post. Btw, what exactly do you mean by "hexidecimal sprites"? I'm trying to figure out what exactly your code does.

787
ASM / Re: Constructive and Creative uses of RLD and RRD
« on: December 31, 2011, 05:32:36 am »
Unless i'm missing something, the first just says "Array", maybe you pasted the wrong thing?

788
ASM / Re: ASM Command of the Week
« on: December 30, 2011, 01:09:06 pm »
Ok, i'm not really too interested in grayscale, but i'd like to see how masking sprites might work out.

Here's some basic code to draw a masked byte to the gbuf:
Code: [Select]
;ix=masked byte to draw
;ix+1=byte mask
;hl=location in gbuf to draw to
 ld a,(ix+1)  ;load mask into a
 and (hl)   ;and the mask onto the byte in gbuf
 or (ix)    ;draw the byte
 ld (hl),a  ;update gbuf
So that would become:
Code: [Select]
ld a,(ix)
 xor (hl)
 and (ix+1)
 xor (hl)
 ld (hl),a
Which is an extra byte larger. I've always drawn my masks like this:
sprite:
%00011000
%00111100
%01111110
%11111111

mask:
%11100111
%11000011
%10000001
%00000000
...a 1 being a byte to preserve in the gbuf (whereas i suppose with the xor method it'd be inverted).

If you want, i've got some code from a masked sprite routine i wrote a while back for an rpg i was working on that we could try to optimize :D I don't like how i went about it, first rotating/loading the mask onto the gbuf and updating the gbuf, then rotating/loading the sprite onto the gbuf (drawing twice to the gbuf).
Code: [Select]
drawPlayerLoop:
   push bc
drawPlayerRow
   ld d,(ix+32)     ;sprite mask
   ld e,(ix+33)
   ld a,$ff         ;a 1 means the gbuf bit will be preserved
   dec b \ inc b \ jr z,skipMaskClip    ;if b=0, no need to rotate
   scf \ rr d \ rr e \ rra \ djnz $-6   ;rotate mask b bits
skipMaskClip:
   and (hl)         ;a = mask to the furthest right
   ld (hl),a        ;store masked gbuf
   dec hl           ;next byte...
   ld a,(hl)
   and e
   ld (hl),a
   dec hl           ;last byte
   ld a,(hl)
   and d
   ld (hl),a
   pop bc           ;recall b=x offset, how many bits to rotate
   inc hl           ;return hl to starting gbuf position
   inc hl
   push bc          ;store bc again
   ld d,(ix)        ;sprite
   ld e,(ix+1)
   xor a            ;empty a to receive flowover from shifting
   cp b
   jp z,skipSpriteClip
   srl d \ rr e \ rra \ djnz $-5   ;rotate sprite
skipSpriteClip:
   or (hl)          ;load sprite into masked gbuf
   ld (hl),a        ;update gbuf
   dec hl           ;next byte, etc.
   ld a,(hl)
   or e
   ld (hl),a
   dec hl
   ld a,(hl)
   or d
   ld (hl),a
   inc ix           ;next sprite row
   inc ix
   ld de,14         ;jump to next row in gbuf, +2 (draw rightmost byte first)
   add hl,de
   pop bc
   dec c
   jp nz, drawPlayerLoop

789
ASM / Re: ASM Command of the Week
« on: December 26, 2011, 01:59:03 pm »
Possibly one of the best uses of XOR is in combination with AND, to act as a bitwise multiplexer.

For example, this uses the bits of C to select bits from A and B: if the bit in C is 1, that bit is selected from A, and if the bit in C is 0, that bit is selected from B.
xor b
and c
xor b

What could you/would you want to use this for?

I think this is an interesting topic and would like to see it continue :)

Like Hot_dog, i often use xor to flip bytes. I think i'm pretty unimaginative though when i code.

791
De petites suggestions:
Quote
Quote
Hi,

It would really be nice if a contest were organized for the LuaFX language, but the language isn't ready yet.

First of all, I would need to program the g85 file management system (otherwise we wouldn't be able to save).
Also the language documentation would also need to be available in English (It has been months since I've had news from the translators).

If someone could make an on-calc Lua editor, it would definitively boost the language's popularity.

As for the many bugs, they aren't likely to get fixed anytime soon, because I'm really busy.
To program efficiently, I need 2 hours before I'm really into it... and often it takes more than an hour to solve the one or many hidden bugs.

I don't know when I'll be able to program the file management system, I'll try my best during vacations.
If you're motivated to contribute to this promising community language, contact me via PM and I'll give you Veb's e-mail.

Thanks for reading. :)

Malheureusement, n'étant plus dans la programmation depuis fort longtemps et n'étant plus assez actif sur les topics à ce sujet, je ne pourrai pas vraiment aider. :(
Je sais pas ce qu'il est, ce LuaFX, c'est la même chose que Lua ? Je n'ai pas d'Nspire etje ne sais programmer Lua, mais peut-être je peux t'aider avec les traductions ? On peut pas programmer ASM pour les Nspires ?

792
ASM / Re: Linux - assembler for TI-83+
« on: October 30, 2011, 04:02:16 pm »
I'd just install burntfuse's linux ide, that always worked wonderfully for me. That and PindurTI through wine (WabbitEmu gave me weird problems). Welcome to the asm world!

793
ASM / Re: I don't know what's wring with this code D:
« on: October 30, 2011, 03:42:39 pm »
Ok, so it's been a few months since i've touched z80, but i think you could do something like this:
Code: [Select]
cp 3 ;check if we are going horizontally or vertically, i might have this backwards
 jr c,skip
  inc hl
skip:
 rla
 rla
 jr nc,skip2 ;if no carry (ie. down or right was pressed)
 dec (hl)
 jr skip3
skip2:
 inc (hl)
skip3:
Here are your equates:
kDown .equ    04h
kUp .equ    03h
kLeft .equ    02h
kRight .equ    01h

10000000 right
01000000 left
11000000 up
00100000 down

after first shift we have:
00 r
10 l
10 u
01 d
which is more usable, as with r/d we need to increment and with l/u we need to decrement. Now another shift lets us use the carry flag. To do boundary checking, you could just use b instead of acting directly on hl:
Code: [Select]
ld b,1
 cp 3
 jr c,skip
  inc hl
skip:
 rla
 rla
 jr nc,skip2
 dec b
 dec b
skip2:
 ld a,(hl)
 add a,b
;boundary checking
 ld (hl),a
You'd probably also want to test that a>0 & a<5, or at least that a isn't 0. I'm not sure if the code i gave you will actually work as i just wrote it off the top of my head, but maybe it'll give you something to think about even if it's completely useless :)
EDIT: Oh, and of course you would ld hl,Coor beforehand (vs ld hl,(Coor)).
EDIT2: Ah! And one more thing, i'd check for kClear before the other tests.
EDIT3: I imagine you've already discussed it, but the problem with your original code is probably your calls. You check a key, change the value of "a",  then return to check for another key. You are almost certainly calling multiple labels at a time at each keypress (especially since many of the X/Y values match the getkey values)

794
Merci, je crois bien que je retournerai bientôt aux forums, j'ai plusieurs projets à terminer et j'aurai enfin le temps d'y dédier mon temps :) D'ailleurs, j'aimerais programmer quelque chose pour le concours de yAronet et peut-être instiller un peu d'activité dans la communauté asm.

795
Je crois que tous qui me connaissent sauront qu'il n'y a qu'un langage dans laquelle je programme, et ça c'est l'assembleur. Ce qui me surprend surtout c'est qu'il n'y en a pas plus, des programmeurs d'asm, car je croirait qu'avec tous ces nouveaux langages on aurait envie d'explorer plus le pouvoir (si l'on peut l'appelle ainsi) de sa calculatrice. :D

Salut à tous :)

Pages: 1 ... 51 52 [53] 54 55