Author Topic: Sprites ?  (Read 8078 times)

0 Members and 1 Guest are viewing this topic.

tama

  • Guest
Sprites ?
« on: July 10, 2007, 02:35:00 am »
Here's my first question ^^

Does anybody know how can I make a grayscale sprite without using Ion nor Mirage OS ?
That would help me a lot
Thanks =)

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Sprites ?
« Reply #1 on: July 10, 2007, 03:32:00 am »
I don't think the shells support greyscale anyway... oh well, just wait 'till Jim e comes, he can tell you. ;)wink.gif
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Fallen Ghost

  • Guest
Sprites ?
« Reply #2 on: July 10, 2007, 04:07:00 am »
QuoteBegin-calc84maniac+10 Jul, 2007, 9:32-->
QUOTE (calc84maniac @ 10 Jul, 2007, 9:32)
I don't think the shells support greyscale anyway... oh well, just wait 'till Jim e comes, he can tell you. ;)wink.gif

 ^^ May take some time

To have greyscale, you need to have 2 Black/White normal drawings of your thing (2 blacks=black, 2 white=white, 1 of both=grey) that you flip over very fast, to make illusion of it.

Offline bfr

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 819
  • Rating: +4/-0
    • View Profile
    • bfr's website
Sprites ?
« Reply #3 on: July 10, 2007, 05:29:00 am »
I recommend the Revolution Grayscale Package.  I *think* the latest release can be downloaded http://www.revsoft.org/phpBB2/viewtopic.php?t=26&postdays=0&postorder=asc&start=45 (look at the attachment in Jim E's post).

tama

  • Guest
Sprites ?
« Reply #4 on: July 10, 2007, 05:35:00 am »
ok.
and do you know how can the program stop a very few time ?

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Sprites ?
« Reply #5 on: July 10, 2007, 06:52:00 am »
Sorry, can you rephrase that? I don't want to try decoding that message...
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

tama

  • Guest
Sprites ?
« Reply #6 on: July 10, 2007, 06:58:00 am »
er...
ok I'll try

I want to stop a program for a few microseconds...

"Halt" don't seem to work...
I also tried "nop" but it does nothing

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Sprites ?
« Reply #7 on: July 10, 2007, 07:01:00 am »
nop waits 4 clock cycles. That's 4/6000000 seconds.

halt waits for an interrupt to trigger, which takes various amounts of time, depending on when the last interrupt triggered. If interrupts are disabled, then don't try halt. ;)wink.gif
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

tama

  • Guest
Sprites ?
« Reply #8 on: July 10, 2007, 07:22:00 am »
so how can I do ?
do a loop ?

Fallen Ghost

  • Guest
Sprites ?
« Reply #9 on: July 10, 2007, 10:11:00 am »
well, depends on how many milliseconds you want to shove off.

nop stops for 1/1 500 000 of a second (exactly)
halt stops for about 1/120 or 1/140 of a second if you haven't messed up with interrupts (ei, di, port 3 or port 4).

To obtain a good timing, I suggest using a loop doing a bunch of nop instructions, saving the most possible bytes (we actually want to lose time, so why not save space)

c1-->
CODE
ec1
 

Liazon

  • Guest
Sprites ?
« Reply #10 on: July 10, 2007, 11:26:00 am »
you'll want to pick up graylib.inc (the first release) as well because the second release is simply a modification of some of the original routines, while excluding the unmodified ones.

Offline Iambian

  • Coder Of Tomorrow
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 739
  • Rating: +216/-3
  • Cherry Flavoured Nommer of Fishies
    • View Profile
Sprites ?
« Reply #11 on: July 12, 2007, 06:53:00 am »
If you're trying to waste space, and you needed to use one more byte, why couldn't you use an instruction that takes up a helluvalot more time? The push/pop sequence is a good candidate for that. If you know that HL doesn't point to any ROM, you can also do a INC (HL) \ DEC (HL) sequence to waste one more CC than the push/pop sequence.

But if this wasn't greyscale and if you needed to waste a LOT of time, couldn't you just call the fastcopy routine again?
A Cherry-Flavored Iambian draws near... what do you do? ...

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Sprites ?
« Reply #12 on: July 12, 2007, 01:38:00 pm »
If HL does point to ROM, would that affect anything?
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline Iambian

  • Coder Of Tomorrow
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 739
  • Rating: +216/-3
  • Cherry Flavoured Nommer of Fishies
    • View Profile
Sprites ?
« Reply #13 on: July 12, 2007, 03:30:00 pm »
QuoteBegin-calc84maniac+12 Jul, 2007, 19:38-->
QUOTE (calc84maniac @ 12 Jul, 2007, 19:38)
If HL does point to ROM, would that affect anything?  

 I'm not sure, but it might be treated as implied load instructions by the FlashROM chip, which may tell it that you're attempting to send commands to it. Because of Flash locking, the microcontroller will see this and issue the standard response for attempting to issue instructions to Flash. I believe this is a calc reset. (RST 00h)

Need verification.
A Cherry-Flavored Iambian draws near... what do you do? ...

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Sprites ?
« Reply #14 on: July 13, 2007, 04:31:00 am »
I tested this code oncalc and nothing happened:

c1-->
CODE
ec1ld hl,$4000
inc (hl)
dec (hl)
retc2
ec2
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman