Bitmap VRAM (8-bit, palette)


  • Display buffer: bmp_vram_info[1].vram2
  • Draft buffer: (uintptr_t)(bmp_vram_info[1].vram2) ^ 0x80000;

How Canon drawing worksEdit

  • dialog_draw is called
  • this redraws current dialog box to draft buffer
  • then, draft buffer is copied to display buffer, either normal or reversed (i.e. flipped horizontally)

Q: When does the firmware decide when to draw normal and when to draw reversed?Edit

DebugMsg(4, 2, 'refresh whole fReverseScreen=%d', *(0x1e7ac))

A: when MEM(0x1e7ac) (in winsys_struct) is nonzero, it draws reversed.

Q: Can we prevent Canon graphics from updating the display buffer, but let them update the draft buffer?Edit

A: Yes!

if *(0x1e7a0) == 0:
   if *(0x1e7ac) == 0:
       sub_FF2CA694(*(0x1e778), arg0 + MEM(124804), arg1, *(0x1e774))
   if *(0x1e7ac) != 0:
       sub_FF2CA8B4(*(0x1e778), arg0 + MEM(124804), arg1, *(0x1e774))
   DebugMsg(4, 2, msg='refresh partly  x=%d y=%d w=%d h=%d', arg0, arg1, arg2, arg3, arg3, ...)


MEM(0x1e7a0) = 1 is all we need :)

Q: So what?Edit

A: We can do arbitrary transformations on BMP overlay!

e.g. flipping it upside down, rescaling it (hint: HDMI monitors), erasing Canon GUI elements...

... all with 0% flicker :)

Community content is available under CC-BY-SA unless otherwise noted.