kanflo / opendps

Give your DPS5005 the upgrade it deserves
MIT License
895 stars 124 forks source link

4bpp fonts #115

Closed tzarc closed 5 years ago

tzarc commented 5 years ago

As per #95, as a first cut, just for fonts. Saves about 13k of flash. No noticeable speed decrease on my setup.

before:

% arm-none-eabi-readelf  -l opendps/opendps.elf

Elf file type is EXEC (Executable file)
Entry point 0x8006e7d
There are 6 program headers, starting at offset 52

Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  LOAD           0x000000 0x08000000 0x08000000 0x0de28 0x0de28 R E 0x10000
  LOAD           0x010150 0x20000150 0x0800de28 0x0083c 0x0083c RW  0x10000
  LOAD           0x010990 0x20000990 0x0800e664 0x00000 0x007d4 RW  0x10000
  LOAD           0x01f800 0x0800f800 0x0800f800 0x00000 0x00800 RW  0x10000
  LOAD           0x020000 0x20000000 0x20000000 0x00000 0x00150 RW  0x10000
  LOAD           0x011ff0 0x20001ff0 0x20001ff0 0x00000 0x00010 RW  0x10000

 Section to Segment mapping:
  Segment Sections...
   00     .text
   01     .data
   02     .bss
   03     .past
   04     .ram_vect
   05     .bootcom

after:

% arm-none-eabi-readelf  -l opendps/opendps.elf

Elf file type is EXEC (Executable file)
Entry point 0x8006e55
There are 6 program headers, starting at offset 52

Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  LOAD           0x000000 0x08000000 0x08000000 0x0aa00 0x0aa00 R E 0x10000
  LOAD           0x010150 0x20000150 0x0800aa00 0x007a4 0x007a4 RW  0x10000
  LOAD           0x0108f8 0x200008f8 0x0800b1a4 0x00000 0x007d4 RW  0x10000
  LOAD           0x01f800 0x0800f800 0x0800f800 0x00000 0x00800 RW  0x10000
  LOAD           0x020000 0x20000000 0x20000000 0x00000 0x00150 RW  0x10000
  LOAD           0x011ff0 0x20001ff0 0x20001ff0 0x00000 0x00010 RW  0x10000

 Section to Segment mapping:
  Segment Sections...
   00     .text
   01     .data
   02     .bss
   03     .past
   04     .ram_vect
   05     .bootcom

size reduction of .text section:

0xDE28 -> 0xAA00 bytes
56,872 -> 43,520 bytes
tzarc commented 5 years ago

In fact, better results with 2bpp. Closing and will reopen a 2bpp PR instead.