Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
BritLion's Putchars
#31
britlion Wrote:Added a paintData sub for you. It's really quite similar to paint - but has to work a bit harder.
How can I thank you for it? Smile
------------------------------------------------------------
http://lcd-one.da.ru redirector is dead
Visit my http://members.inode.at/838331/index.html home page!
Reply
#32
Make borIDE better than TommyGun :-)
Reply
#33
britlion Wrote:Make borIDE better than TommyGun :-)
How much better? :mrgreen:
BorIDE is dedicated only for BorIDE, and is already much better, except that it still misses some important parts. I plan to release the first test version in 2-3 weeks.
I also plan to bundle a game on which I'm working too, but with final version. I'm testinf BorIDE for bugs by writing this gane.
------------------------------------------------------------
http://lcd-one.da.ru redirector is dead
Visit my http://members.inode.at/838331/index.html home page!
Reply
#34
Question for Britlion or others:
I see You use this in your code
Code:
SUB paint (x as uByte,y as uByte, width as uByte, height as uByte, attribute as ubyte)
    asm
    ld      a,(IX+7)   ;ypos
And I ask about the maneuver you had to know that in (IX+7) is ypos?
I know in fastcall you read in the registers hl de ... the arguments sends by fastcall. But you use IX register. Can you explain me about this. I believe you use similar method by fastcall in the sub function.
Thx.
Reply
#35
@compiuter: There's a simple way: generate the asm source code with --asm and see how the function is compiled. I always do this test:
Code:
SUB xxx(a as uByte, b as Uinteger)
a = 5
b = 6
END SUB
Now compile with --asm and see the generated code (don't use any optimization, just --asm). The .asm generated file in this case will contain an _xxx label (that is, the name of your sub, prefixed with "_" character). This is the code of your compiled sobroutine:
Code:
_xxx:
    push ix
    ld ix, 0
    add ix, sp
    ld (ix+5), 5
    ld (ix+6), 6
    ld (ix+7), 0
_xxx__leave:
    ld sp, ix
    pop ix
    exx
    pop hl
    pop bc
    ex (sp), hl
    exx
    ret
Notice a = 5 becames LD (ix + 5), 5 and b = 6 becames ld (ix+6), 6 and ld (ix+7),0 (hi byte). In the future I'm planning to use something similar to FreeBasic's inline assebler: LD [a], 5 (translated to ld (ix+5), 5) and LD [b],... whenever possible. That is, [<variable_name>] will be replaced with var address.
Reply
#36
O_O

That will be VERY useful indeed!
Reply
#37
Thx for explaining, I donĀ“t know how is the value of all codes ix,ld,...
I take a look in spectaculator with a for.. next peeking the values and search where is 5 or 6 or 99 or the value I put for arguments.
I see you use IX in sub for taking the parameters.
Seems to be a good method.
The other method, I never used freebasic, seems to me more complicated, but perhaps more effective and quick.
Reply
#38
You can grab function parameters starting at (IX+4) - but you have to know the size of the parameters, and how they stack up to make it work.

For example, single bytes are still stacked as two (because PUSH does that), so if the first parameter is a byte, you'll find it at IX+5.
Reply
#39
britlion Wrote:You can grab function parameters starting at (IX+4) - but you have to know the size of the parameters, and how they stack up to make it work.

For example, single bytes are still stacked as two (because PUSH does that), so if the first parameter is a byte, you'll find it at IX+5.
I also forgot to mention that Local byte variables do take a single byte as expected, because PUSH is not used :wink:
Reply
#40
Just a request: How about a modification to use mask bytes? 1 Byte for mask and 1 byte for graphics data. Also GetChars() to grab original background to preserve it?
------------------------------------------------------------
http://lcd-one.da.ru redirector is dead
Visit my http://members.inode.at/838331/index.html home page!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)