Author Topic: Casio Prizm documentation  (Read 240060 times)

0 Members and 2 Guests are viewing this topic.

Offline AHelper

  • LV3 Member (Next: 100)
  • ***
  • Posts: 99
  • Rating: +18/-0
    • View Profile
    • GlaßOS razzl
Re: Casio Prizm documentation
« Reply #600 on: August 25, 2012, 06:51:28 pm »
But is it possible to have the DMA run while the program continues? The program may have to use double-buffering in that case, but it sounds possible.

*AHelper bumps this question.
SDCC tastes like air bags - big output, but fast and safe to run.

Offline SimonLothar

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 129
  • Rating: +35/-1
    • View Profile
Re: Casio Prizm documentation
« Reply #601 on: August 26, 2012, 07:20:12 am »
But is it possible to have the DMA run while the program continues? The program may have to use double-buffering in that case, but it sounds possible.
In fact syscall 0x0260 runs a simple wait-for-DMA-ready-loop while the DMA takes place,
only checking DMA0_CHCR_0.TE (Transfer End Flag) and DMA0_DMAOR.AE (Address Error Flag).
During this wait-loop, you could possibly do anything, which does not disturb the running DMA-job.
But that would mean to replace Bdisp_PutDisp_DD by some assembler function. Bdisp_PutDisp_DD itself does not offer any hook.
I'll be back.

Offline AHelper

  • LV3 Member (Next: 100)
  • ***
  • Posts: 99
  • Rating: +18/-0
    • View Profile
    • GlaßOS razzl
Re: Casio Prizm documentation
« Reply #602 on: August 26, 2012, 08:04:49 am »
But is it possible to have the DMA run while the program continues? The program may have to use double-buffering in that case, but it sounds possible.
In fact syscall 0x0260 runs a simple wait-for-DMA-ready-loop while the DMA takes place,
only checking DMA0_CHCR_0.TE (Transfer End Flag) and DMA0_DMAOR.AE (Address Error Flag).
During this wait-loop, you could possibly do anything, which does not disturb the running DMA-job.
But that would mean to replace Bdisp_PutDisp_DD by some assembler function. Bdisp_PutDisp_DD itself does not offer any hook.


Ok, that sounds interesting.  I will have to try this some time.  What would disturb it? writing to the memory it is copying (or would it not mind this)?  Using a syscall that tries to use the DMA?
SDCC tastes like air bags - big output, but fast and safe to run.

Offline SimonLothar

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 129
  • Rating: +35/-1
    • View Profile
Re: Casio Prizm documentation
« Reply #603 on: August 26, 2012, 08:31:15 am »
What would disturb it? writing to the memory it is copying (or would it not mind this)?  Using a syscall that tries to use the DMA?
I think any access to the LCD-controller and any syscall which accesses the LCD-controller will disturb.
DMAC0 mustn't be touched, of course (except for polling the TE- and AE-flag).
I do not know if the source memory can be written to during the DMA-transfer. But I do not see why not.

I'll be back.

Offline KermMartian

  • Editor
  • LV7 Elite (Next: 700)
  • *******
  • Posts: 500
  • Rating: +233/-20
    • View Profile
    • Cemetech
Re: Casio Prizm documentation
« Reply #604 on: August 26, 2012, 12:22:41 pm »
Based on my experiences with other SoCs, you can do anything you want during an LCD DMA, as the LCD DMA controller is separate from the rest of the memory subsystem and won't prevent any other memory accesses.



Offline Eiyeron

  • Urist McEiyolobster
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1430
  • Rating: +130/-10
  • (-_(//));
    • View Profile
    • Rétro-Actif : Rétro/Prog/Blog
Re: Casio Prizm documentation
« Reply #605 on: August 26, 2012, 12:23:43 pm »
So, Rebooting when pressing OPTN+EXP+ON makes you jump to a "Please SD Card insert", and fiddling with Fkeys make your calc format the SMEM...

Offline AHelper

  • LV3 Member (Next: 100)
  • ***
  • Posts: 99
  • Rating: +18/-0
    • View Profile
    • GlaßOS razzl
Re: Casio Prizm documentation
« Reply #606 on: August 26, 2012, 12:24:03 pm »
hmm... I will see about using the background VRAM as a second buffer.  I don't know of anywhere that documents the required writes and such to copy the VRAM to the LCD.  Do I need to play with the LCD at all before using the DMAC?
SDCC tastes like air bags - big output, but fast and safe to run.

Offline SimonLothar

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 129
  • Rating: +35/-1
    • View Profile
Re: Casio Prizm documentation
« Reply #607 on: August 26, 2012, 12:48:37 pm »
hmm... I will see about using the background VRAM as a second buffer.  I don't know of anywhere that documents the required writes and such to copy the VRAM to the LCD.  Do I need to play with the LCD at all before using the DMAC?
I am about to write some little assembler function, which will transfer any rectangular range from RAM to the LCD's GRAM via DMA. When it works well I will post the source.
I'll be back.

Offline Eiyeron

  • Urist McEiyolobster
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1430
  • Rating: +130/-10
  • (-_(//));
    • View Profile
    • Rétro-Actif : Rétro/Prog/Blog
Re: Casio Prizm documentation
« Reply #608 on: August 26, 2012, 12:51:22 pm »
Without waiting the lcd to refresh? Would be the end of the FPS "cap"?

Offline AHelper

  • LV3 Member (Next: 100)
  • ***
  • Posts: 99
  • Rating: +18/-0
    • View Profile
    • GlaßOS razzl
Re: Casio Prizm documentation
« Reply #609 on: August 26, 2012, 01:16:35 pm »
hmm... I will see about using the background VRAM as a second buffer.  I don't know of anywhere that documents the required writes and such to copy the VRAM to the LCD.  Do I need to play with the LCD at all before using the DMAC?
I am about to write some little assembler function, which will transfer any rectangular range from RAM to the LCD's GRAM via DMA. When it works well I will post the source.

That sounds great! Thank you for doing this.  When you make the code public, would you like me to add it to http://prizm.cemetech.net/? Link to a post here?
« Last Edit: August 26, 2012, 01:16:45 pm by AHelper »
SDCC tastes like air bags - big output, but fast and safe to run.

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Casio Prizm documentation
« Reply #610 on: August 26, 2012, 01:53:01 pm »
Based on my experiences with other SoCs, you can do anything you want during an LCD DMA, as the LCD DMA controller is separate from the rest of the memory subsystem and won't prevent any other memory accesses.
The LCD doesn't have its own DMA on the Prizm though, I think it's set up with the processor's DMA.
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline Eiyeron

  • Urist McEiyolobster
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1430
  • Rating: +130/-10
  • (-_(//));
    • View Profile
    • Rétro-Actif : Rétro/Prog/Blog
Re: Casio Prizm documentation
« Reply #611 on: August 26, 2012, 06:41:58 pm »
I love the work that Simon does, but I prefer when I understand what happen! :p
So, will the future routine be speedier than the syscall? The loop that disp_Vram creates will be avoided?

Offline SimonLothar

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 129
  • Rating: +35/-1
    • View Profile
Re: Casio Prizm documentation
« Reply #612 on: September 16, 2012, 01:04:34 pm »
I love the work that Simon does, but I prefer when I understand what happen! :p
I understand that. But I need your help, too. I am no teacher. It is difficult for me to develop a proper feeling for what is necessary to document. I try to do my best, but I think I need your questions.
So, will the future routine be speedier than the syscall? The loop that disp_Vram creates will be avoided?
The loop cannot be avoided. But one of the advantages of DMA is, that you can do other things simultaneously during the DMA-transfer takes place.

I attached fx_calculators_SuperH_based_13.chm. It contains an example. Look for "History" or "LCD-DMA-hook".

Attachment removed.
Updated: http://ourl.ca/8207/318834

« Last Edit: October 06, 2012, 04:16:58 am by SimonLothar »
I'll be back.

Offline AHelper

  • LV3 Member (Next: 100)
  • ***
  • Posts: 99
  • Rating: +18/-0
    • View Profile
    • GlaßOS razzl
Re: Casio Prizm documentation
« Reply #613 on: September 16, 2012, 01:07:15 pm »
Wow, I am going to have to look at that in a few days. Ty!
SDCC tastes like air bags - big output, but fast and safe to run.

Offline SimonLothar

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 129
  • Rating: +35/-1
    • View Profile
Re: Casio Prizm documentation
« Reply #614 on: September 16, 2012, 01:09:12 pm »
When you make the code public, would you like me to add it to http://prizm.cemetech.net/? Link to a post here?
Feel yourself free.
I'll be back.