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 ... 50 51 [52] 53 54 55
766
ASM / Re: Multiplication!
« on: January 24, 2012, 06:23:13 pm »
Thanks for writing that out, jacobly. z80 arithmetic has always been a bit confusing for me (and i'm not very good at math to boot).

767
ASM / Re: Mad DJNZ Hacks
« on: January 18, 2012, 05:19:49 pm »
It's amazing how creative you all are. For the djnz list i usually just use a jump table and maybe push a return value onto the stack, but that looks like it'd be smaller (if not faster), though you'd have to be careful with 'b'.

768
ASM / Re: ASM Command of the Week
« on: January 18, 2012, 05:02:15 pm »
Like others have said, I use cpl for a quicker/smaller xor $FF, for example in my tilemapper to get the mask  when  rotating the screen:
Code: [Select]
updateRotation:
    ld a,(xOff)         ;what is the xOffset?
    and 7               ;we're only interested in the lower three bits (essentially xOff % 8)
    ld hl,gbufMask
    ld e,a
    ld d,0
    add hl,de           ;pointer to the rotation mask
    ld a,(hl)
    ld hl,maskLeft
    ld (hl),a
    ld hl,maskRight
    cpl                 ;xor $FF
    ld (hl),a
;...
    ret
gbufMask:
.db %11111111   ;0 display all of the first byte, none of the second
.db %11111110   ;1 after rotating left once, we only want the 7 leftern most bits of byte 1, and rightmost bit of byte 2
.db %11111100   ;2
.db %11111000   ;3
.db %11110000   ;4
.db %11100000   ;5
.db %11000000   ;6
.db %10000000   ;7
...which, btw, is based off an idea calc84maniac mentioned on IRC a few years ago of doing the rotation in the fastcopy routine, though i remember you saying that your main fastcopy loop was much faster than mine :)

769
ASM / Re: Multi Picture Storage
« on: January 15, 2012, 07:16:37 pm »
Well, assuming that none of the B_CALLs affected their values ;) And to expand a little on what Hot_Dog said, decrementing a register when it equals 0 will "reset" the register to $FF (1-byte reg) or $FFFF (2-byte reg) (in two's complement, -1). So when you do ldir when bc = 0, it first decrements bc by 1, converting it to $FFFF (-1), and checks for 0. As it doesn't equal 0, it repeats that operation $FFFF times until bc=0 again.

770
ASM / Re: Multi Picture Storage
« on: January 15, 2012, 02:17:58 pm »
ldir increments both hl AND de, so you'd need to reset de (ld de,plotsscreen or push de then pop de). :)

EDIT: ldir also decrements bc, so you'll need to reset bc as well.

771
ASM / Re: ASM Command of the Week
« on: January 13, 2012, 08:13:10 pm »
I haven't responded yet simply because, to be honest, i had no idea this command even existed :/ I could see it maybe being used for a fixed-width font text-wrapping routine or something, though that might not be quite so simple as you'd have to check for a space character and EOS character.

772
ASM / Re: The missing code!
« on: January 13, 2012, 11:27:26 am »
And to answer your other question, an asm program is first compiled to its hex statements. Later it is compressed into it's "one-byte" values (like the AsmComp( oncalc command). But if you want to program on a computer, you can, and just copy the hex values. But it'd be much easier (and safer) to send it. There are also programs you can send to your calc to program in actual assembly, if ever get the chance to borrow a USB cable.

773
ASM / Re: 68K ASM Help
« on: January 11, 2012, 05:35:35 am »
When i get some free time i'm gonna spend a couple evenings trying to wet my feet in 68k asm. I'm not entirely sure what the difference between the normal registers and the address registers are (i know a7 is reserved for the stack). Have you started your pong game yet? :D I was thinking of doing a 68k version of my old prgmBAD game i made like.. 10 years ago:
http://www.ticalc.org/archives/files/fileinfo/267/26730.html
Xeda, it was also ported in C to the 89, maybe you would be interested in the source ;)
http://www.ticalc.org/archives/files/fileinfo/240/24065.html

774
ASM / Re: So what next?
« on: January 11, 2012, 05:27:54 am »
Also, check this part here:
Code: [Select]
Game:
BCALL ClrLCDFull
LD A,Xpos ; This gets my variable Xpos.
LD (penRow),A ; This makes it in the penRow
LD A,Ypos
LD (penCol),A
Two things, first: penRow is the row, aka the y position. penCol is the X position. Next, you forgot the parenthesis again. It works initially because you have them defined as equates, so it essentially converts Xpos into the number equated as Xpos. Try making the change Hot_dog proposed (changing the equates into .db statements) and adding in the parenthesis. :)

775
ASM / Re: So what next?
« on: January 10, 2012, 10:58:55 am »
Yay! Another ASM programmer! To start out with, the ion routines should work well, they're easy to use and supported by pretty much all modern shells. If you want, start a few easy projects or two and post them here and i (or we :)) can help you get started, if you have questions on how to do this or that, etc. I've also posted the source to Monopoly (and the RPG i started) and can upload the current source(s) if you want to take a look through it(them), though it might be a little confusing. Later i plan to document everything a lot better, but they're there if you want them and i'd be more than glad to explain anything you don't understand (or if you have questions about the source of another game from ticalc). Reading through the old asm programming help sections on sites like MaxCoderz (or RevSoft, though you'd have to use the wayback machine) can be interesting.

Do you have any ideas of games you'd like to try to write?

EDIT: And if you have any particular questions about sprites, ask away. To copy the graphbuffer (gbuf) to the LCD, i'd just use ion's fastcopy routine.

776
ASM / Re: 68K ASM Help
« on: January 09, 2012, 05:32:32 am »
This has so far been very helpful, thanks! I wonder what my first program should be... maybe a bouncing thing or pong? Thank you much for your help so far!
What? No Hello World?! And what about the little dot that moves around the screen? Also, the 89's LCD is like the 86's, right? In that you don't have to send data to a port to update, just an address in memory? You could make a grayscale pong ;)

Btw, what do people use to emulate the 89? TiEmu?

EDIT: Oh, and i've also learned quite a bit, so thanks for bringing this discussion up. There's a few boards at yAronet which have (well, had :/) a lot of discussion on 68k asm programming, it might be fun to look through their old programming help archives. A lot of really knowledgeable people post(ed) there, you'll probably recognize a few of their names from games you've played. :)

EDIT2: If you don't have it already, you might want to check out TIGCC. I've read that all the ROM CALLS are documented there.

777
ASM / Re: 68K ASM Help
« on: January 09, 2012, 01:44:36 am »
Here's (a very short) one i found, in French:
http://www.squalenet.net/fr/ti/tutorial_asm/

Kevin Koffler also wrote a guide, in French, but it looks like they translated it to English:
http://members.chello.at/gerhard.kofler/kevin/ti89prog/asmnstb.htm

And "ZGuide" appears to have been popular, too. I haven't looked through it yet though.
http://www.ticalc.org/archives/files/fileinfo/59/5957.html

Also, i stumbled across this, for the Atari ST:
http://atariste.free.fr/asm/assembleur.html

Ticalc has a couple more:
http://www.ticalc.org/pub/text/68k/

Finding a comprehensive ASSEMBLY tutorial seems to be a bit complicated, probably because of TIGCC. I'm sure there are some books out there, though. There's also an 89 version of Phoenix ;)

778
ASM / Re: 68K ASM Help
« on: January 09, 2012, 12:41:27 am »
Wow! Just today i was asking about resources for 68k assembly programming. I think you might be interested in this:
http://www.cs.tcu.edu/people/professors/nute/systems/68K_Instr.pdf
movem means MOVEMultiple (registers). I think the .l and .w mean longword and word respectively.
So maybe "movem.l d4/a5,-(a7)" would load the d4 register at (a7), decrement, then load a5 register at (a7-4
The next part:
move.l         $C8,a5
move.l         HeapAllocPtr*4(a5),a0
jsr              (a0)
...is essentially a 68k B_CALL (ROM_CALL). I suppose $C8 is the address of the rom call table, and the what the second command does is store the longword (i guess each romcall pointer takes up 4 bytes, hence the *4), using the value in a5 as an offset, then stores it into a0. Jsr (Jump to SubRoutine) jumps to the address held in a0.

pea = push effective address. So pea.l pushes the address that follows onto the stack.

tst: Yep, this is TeST. I think it basically is like an "or a" in z80, or cp 0, it tests if the register = 0.

beq.s nomem: bra is branch (jr), bXX are the conditions. BEQ is Branch on EQual, aka jr z. The .s means short, i think the default is 16 bits, not 8.

"move.l        #3840,(a7) Does this push an immediate value to the stack?"
Yep.

lea.l 12(a7),a7: Load Effective Address. a7+12 to a7. The (a7) is an offset, though i'm not sure if it uses the value of the register or the value of the address pointed to by the register. It looks like this might clear up the stack?

clr = clear, set register to 0.

A lot of the information i've found (TI specific, that is) is in French, but none of it too comprehensive and don't really explain things in much detail. A lot of old tutorials appear to have disappeared due to offline sites. I'd be interested in trying to learn 68k asm together, if you're interested in changing thoughts/ideas/etc. Anyway, good luck!

EDIT: So yea, the $ROM_CALL(a5) takes the address pointed to by a5 as the offset (so the address that $C8 points to). AaronTheGreat recommended technoplaza to me, which is the first tutorial i've found which really explains things well for someone who is just starting and has no idea about the entirely different syntax from the z80. It's not very long, but maybe worthwhile checking out.

779
The Axe Parser Project / Re: Axe Parser
« on: January 07, 2012, 08:00:40 am »
Nope DCS7 is the only one still under active development. MirageOS 1.3 had no news since 2005 or so, Crunchy since 2004 and Ion since 2002 I think.
And of those, only ion released the source, though it looks like BrandonW (or someone) disassembled MirageOS:
http://brandonw.net/calcstuff/MirageOS.txt

780
The Axe Parser Project / Re: Axe Parser
« on: January 06, 2012, 02:59:37 pm »
Another possibility would be to create a smaller Axe shell (or something xLib-style, containing the necessary routines) for people who don't program with Axe or even talk to Kerm about including support for Axe routines in DoorsCS (are there any other shells currently still in development? Ion comes with the source...).

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