Author |
Message |
|
Tyraniek
Member
Joined: 07 Jun 2003 Posts: 133
|
Posted: 08 Jul 2003 10:00:33 am Post subject: |
|
|
How could I use these pictures, as private pictures, for exemple :
picture:
.db 255, 0, 124, 255 etc. (96*64)
Can I simply replace
ld hl, picture
bu ld hl, pic1 where pic1 is
.db PictObj, tVarPict, tStr1, 0
?
So how could I use them by the same way that private pictures. I mean :
Code: B_CALL(_grbufclr)
ld hl, pub
ld de, plotsscreen
ld bc, 768 ; Définit le nombre d'octets à copier (96*64)/8
ldir ; copie les octets
B_CALL(_grbufcpy)
Thank you |
|
Back to top |
|
|
Job the GameQuitter
Member
Joined: 04 Jun 2003 Posts: 102
|
Posted: 08 Jul 2003 09:14:40 pm Post subject: |
|
|
No, what you need to do is search the Symbol Table (also known as the VAT) for a Pic 1 entry, then load the starting adress of the picture, LDIR.
Look up FindSym in the system routine document of TI and the Symbol Table entry of the SDK. |
|
Back to top |
|
|
Adm.Wiggin aka Tianon
Know-It-All
Joined: 02 Jun 2003 Posts: 1874
|
Posted: 08 Jul 2003 10:32:18 pm Post subject: |
|
|
isnt findsym also the same as rst 10h or something? |
|
Back to top |
|
|
Job the GameQuitter
Member
Joined: 04 Jun 2003 Posts: 102
|
Posted: 09 Jul 2003 06:00:45 am Post subject: |
|
|
Whoop! Forgot to add that. Yeah, use RST 10h (make sure it's 10h and not $10) instead of bcall(findsym). It's functionally identical but it's faster and it saves a byte! |
|
Back to top |
|
|
Tyraniek
Member
Joined: 07 Jun 2003 Posts: 133
|
Posted: 09 Jul 2003 12:23:51 pm Post subject: |
|
|
Quote: No, what you need to do is search the Symbol Table (also known as the VAT) for a Pic 1 entry, then load the starting adress of the picture, LDIR.
That was compact !!! What do you mean ?
What I should find in the symbol Table isn't .db PictObj, tVarPict, tStr1, 0 ??? And then, how do I have to use LDIR ? You mean, I just have to LDIR if I want to display it at the screen (with plotsscreen) ? If so, OK, I know how to do.
So, could you just explain me a little bit more what I have to do with checkfindsym (or RST 10h) ?
And I don't have the documentation you're talking about any more :-/
I hope, you'll help me !
Thank you |
|
Back to top |
|
|
Job the GameQuitter
Member
Joined: 04 Jun 2003 Posts: 102
|
Posted: 09 Jul 2003 12:43:31 pm Post subject: |
|
|
You don't? Then get it man, you obviously have accest to the internet! There's a pinned thread, Good ASM tutorials. It has links to said documents.
Anyway, I'll copy the FindSym entry for you:
Code: Inputs:
Registers:
(OP1 + 1) to (OP1 + 6) = variable name
See documentation on variable naming conventions.
Flags:
None
Others:
None
Outputs:
Registers:
CA flag = 1 if symbol was not found
= 0 if symbol was found
If symbol is found, additional outputs are:
ACC lower 5 bits = data type
ACC upper 3 bits = system flags about variable. Mask via “AND” with a
value of 1Fh to obtain data type only.
B = 0 if variable is located in RAM else variable is archived
B = ROM page located on
If variable is archived then its data cannot be accessed directly, it
must be unarchived first.
HL = pointer to the start of the variables symbol table entry
DE = pointer to the start of the variables data area if in RAM
So you would do
Code: ld hl, pic1
pic1:
.db PictObj, tVarPict, tStr1, 0 like you said, but you should add: Code: ld hl, pic1
rst 20h; This is the equivalent of Mov9op1
rst 10h; look it up
LD H,D
LD L,E
LD BC,768
LD DE,gbuf
LDIR
B_CALL(_grbufcpy)
pic1:
.db PictObj, tVarPict, tStr1, 0 I hope what I say is understandable.
PS: You don't need to clear the gbuf, because you're loading a new picture into it anyway. |
|
Back to top |
|
|
Tyraniek
Member
Joined: 07 Jun 2003 Posts: 133
|
Posted: 09 Jul 2003 01:47:16 pm Post subject: |
|
|
What you said is perfectly understandable.
Allright, that's what I wrote by reading the "Asm lessons in 28 days". (its author does quite the same thing, but with a list).
Code: ld hl, pic1
rst 20h
rst 10h
ex de, hl
ld de, plotsscreen
ld bc, 768
ldir
B_CALL(_grbufcpy)
Then, I replaced "EX DE, HL" by your code, and it didn't work all the same :-/
Maybe it is because I wrote plotsscreen, but I didn't find any "gbuf" in the asm83p.inc file.
I add that when I say "it doesn't work", that means the picture is just not at the right place and is a little bit too much on the right.
I also wrote "Pic1" instead of "Str1", but anyways, both instructions are equal to "00h".
So what could be the cause of the problem ?
I add that I've created a pic and stored it as "pic1". |
|
Back to top |
|
|
Job the GameQuitter
Member
Joined: 04 Jun 2003 Posts: 102
|
Posted: 09 Jul 2003 03:46:48 pm Post subject: |
|
|
gbuf=Ion equate for plotsscreen . And you should use EX HL,DE. I forgot about that instruction (stupid, stupid me!). As for you problem... maybe the first byte of a Pic object is a token, just like ASM programs start with a tAsmPrgm.
Try inserting an INC HL before using LDIR. Does it display the picture properly now? I'm just guessing here. |
|
Back to top |
|
|
Tyraniek
Member
Joined: 07 Jun 2003 Posts: 133
|
Posted: 09 Jul 2003 04:18:19 pm Post subject: |
|
|
Hey !
I wrote "inc hl" 2 times and now, the picture is well centered ! Thank you Job !
However, I don't think your instruction is right : EX HL, DE. We can only write EX DE, HL, but neverwind (I'm trying to seem a good programer )
Now, I may continue my program, but I'm first sleeping (my english teacher told me I could say that instead of "I will first sleep", but I don't think she was right ;-)
I thank you all, guys ! |
|
Back to top |
|
|
Adm.Wiggin aka Tianon
Know-It-All
Joined: 02 Jun 2003 Posts: 1874
|
Posted: 09 Jul 2003 04:35:25 pm Post subject: |
|
|
yes, u must go past the 2 size bytes (wasted space, since they are always the same!) |
|
Back to top |
|
|
Job the GameQuitter
Member
Joined: 04 Jun 2003 Posts: 102
|
Posted: 09 Jul 2003 08:01:58 pm Post subject: |
|
|
It's a bit weird, isn't it? The only thing that matters is the adress in the SymTable anyway, why the heck use tokens like that? I mean, I understand why to put a token in front of an ASM program, but other than that. |
|
Back to top |
|
|
|