2002-03-28 15:09:10 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* __________ __ ___.
|
|
|
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
* \/ \/ \/ \/ \/
|
|
|
|
* $Id$
|
|
|
|
*
|
|
|
|
* Copyright (C) 2002 by Alan Korr
|
|
|
|
*
|
|
|
|
* All files in this archive are subject to the GNU General Public License.
|
|
|
|
* See the file COPYING in the source tree root for full license agreement.
|
|
|
|
*
|
|
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
* KIND, either express or implied.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
2002-05-24 15:22:33 +00:00
|
|
|
#include <stdio.h>
|
2002-04-16 14:02:26 +00:00
|
|
|
#include "config.h"
|
|
|
|
|
Daniel,
The following patch makes loadable fonts actually work (finally!).
It took me quite a while, but I finally figured out why the sim
worked and the target didn't: the SH1 processor won't read
longwords from a shortword alignment... I had to rev the .fnt
file to version 1.1 (requires remaking *.fnt files) in order
to fix this. Please apply the following patch completely.
It's diffed against the latest CVS.
I've also attached rockbox-fonts-1.1.tar.gz which includes
known working *.fnt files, including a courB08 system.fnt,
for demonstration.
Now the real work can begin... Although the new
system.fnt will work fine, if you try going to a really
big font (try copying courB14.fnt to system.fnt), then
you will find that it comes up and works in tree mode,
but will crash the system when going into WPS
mode... I'm sure this is because of the low-level
lcd_bitmap not clipping properly when given a too-large
bitmap, which the characters become. I haven't yet
tried to debug the low-level driver. Of course, it all
works on the sim...
So the apps developers will now have to make sure that
all apps screen sizes may vary according to the loaded font.
The font height can be gotten through the lcd_getfontsize API.
Files patched in fonts-6.patch
1. apps/menu.c - LCD_PROPFONTS error (2nd resubmission on this, please checkin)
2. firmware/font.c - fixes and reformatting. Please check this in as is,
my vi editor requires more reformatting changes since I left tabs in the
file, these are removed now (2nd resubmission on this, please checkin)
3. firmware/fonts.h - doc change on .fnt file format, .fnt version
number incremented.
4. firmware/loadfont.c - fixes to load font properly, typedefs
removed.
5. firmware/system.c - lcd_setfont(FONT_SYSFIXED) before
issuing error, otherwise font may not exist.
6. tools/bdf2c - fixes for correct output when filename starts
with a number, as well as when no DEFAULT_CHAR in .bdf
file. (2nd resubmission on this, please checkin)
7. tools/writerbf.c - fixes for bugfixed fontfile format.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2294 a1c6a512-1295-4272-9138-f99709370657
2002-09-16 03:18:49 +00:00
|
|
|
#include "lcd.h"
|
|
|
|
#include "font.h"
|
2002-04-28 21:40:24 +00:00
|
|
|
#include "led.h"
|
2002-04-29 14:23:21 +00:00
|
|
|
#include "system.h"
|
2002-03-28 15:09:10 +00:00
|
|
|
|
|
|
|
#define default_interrupt(name,number) \
|
|
|
|
extern __attribute__((weak,alias("UIE" #number))) void name (void); void UIE##number (void)
|
|
|
|
#define reserve_interrupt(number) \
|
|
|
|
void UIE##number (void)
|
|
|
|
|
|
|
|
extern void reset_pc (void);
|
|
|
|
extern void reset_sp (void);
|
|
|
|
|
2002-05-28 13:38:42 +00:00
|
|
|
static const char* irqname[] = {
|
|
|
|
"", "", "", "", "IllInstr", "", "IllSltIn","","",
|
|
|
|
"CPUAdrEr", "DMAAdrEr", "NMI", "UserBrk",
|
|
|
|
"","","","","","","","","","","","","","","","","","","",
|
|
|
|
"Trap32","Trap33","Trap34","Trap35","Trap36","Trap37","Trap38","Trap39",
|
|
|
|
"Trap40","Trap41","Trap42","Trap43","Trap44","Trap45","Trap46","Trap47",
|
|
|
|
"Trap48","Trap49","Trap50","Trap51","Trap52","Trap53","Trap54","Trap55",
|
|
|
|
"Trap56","Trap57","Trap58","Trap59","Trap60","Trap61","Trap62","Trap63",
|
|
|
|
"Irq0","Irq1","Irq2","Irq3","Irq4","Irq5","Irq6","Irq7",
|
|
|
|
"Dma0","","Dma1","","Dma2","","Dma3","",
|
|
|
|
"IMIA0","IMIB0","OVI0","", "IMIA1","IMIB1","OVI1","",
|
|
|
|
"IMIA2","IMIB2","OVI2","", "IMIA3","IMIB3","OVI3","",
|
|
|
|
"IMIA4","IMIB4","OVI4","",
|
|
|
|
"Ser0Err","Ser0Rx","Ser0Tx","Ser0TE",
|
|
|
|
"Ser1Err","Ser1Rx","Ser1Tx","Ser1TE",
|
|
|
|
"ParityEr","A/D conv","","","Watchdog","DRAMRefr"
|
|
|
|
};
|
|
|
|
|
2002-03-28 15:09:10 +00:00
|
|
|
reserve_interrupt ( 0);
|
|
|
|
reserve_interrupt ( 1);
|
|
|
|
reserve_interrupt ( 2);
|
|
|
|
reserve_interrupt ( 3);
|
|
|
|
default_interrupt (GII, 4);
|
|
|
|
reserve_interrupt ( 5);
|
|
|
|
default_interrupt (ISI, 6);
|
|
|
|
reserve_interrupt ( 7);
|
|
|
|
reserve_interrupt ( 8);
|
|
|
|
default_interrupt (CPUAE, 9);
|
|
|
|
default_interrupt (DMAAE, 10);
|
|
|
|
default_interrupt (NMI, 11);
|
|
|
|
default_interrupt (UB, 12);
|
|
|
|
reserve_interrupt ( 13);
|
|
|
|
reserve_interrupt ( 14);
|
|
|
|
reserve_interrupt ( 15);
|
2003-02-23 19:02:31 +00:00
|
|
|
reserve_interrupt ( 16); /* TCB #0 */
|
|
|
|
reserve_interrupt ( 17); /* TCB #1 */
|
|
|
|
reserve_interrupt ( 18); /* TCB #2 */
|
|
|
|
reserve_interrupt ( 19); /* TCB #3 */
|
|
|
|
reserve_interrupt ( 20); /* TCB #4 */
|
|
|
|
reserve_interrupt ( 21); /* TCB #5 */
|
|
|
|
reserve_interrupt ( 22); /* TCB #6 */
|
|
|
|
reserve_interrupt ( 23); /* TCB #7 */
|
|
|
|
reserve_interrupt ( 24); /* TCB #8 */
|
|
|
|
reserve_interrupt ( 25); /* TCB #9 */
|
|
|
|
reserve_interrupt ( 26); /* TCB #10 */
|
|
|
|
reserve_interrupt ( 27); /* TCB #11 */
|
|
|
|
reserve_interrupt ( 28); /* TCB #12 */
|
|
|
|
reserve_interrupt ( 29); /* TCB #13 */
|
|
|
|
reserve_interrupt ( 30); /* TCB #14 */
|
|
|
|
reserve_interrupt ( 31); /* TCB #15 */
|
2002-03-28 15:09:10 +00:00
|
|
|
default_interrupt (TRAPA32, 32);
|
|
|
|
default_interrupt (TRAPA33, 33);
|
|
|
|
default_interrupt (TRAPA34, 34);
|
|
|
|
default_interrupt (TRAPA35, 35);
|
|
|
|
default_interrupt (TRAPA36, 36);
|
|
|
|
default_interrupt (TRAPA37, 37);
|
|
|
|
default_interrupt (TRAPA38, 38);
|
|
|
|
default_interrupt (TRAPA39, 39);
|
|
|
|
default_interrupt (TRAPA40, 40);
|
|
|
|
default_interrupt (TRAPA41, 41);
|
|
|
|
default_interrupt (TRAPA42, 42);
|
|
|
|
default_interrupt (TRAPA43, 43);
|
|
|
|
default_interrupt (TRAPA44, 44);
|
|
|
|
default_interrupt (TRAPA45, 45);
|
|
|
|
default_interrupt (TRAPA46, 46);
|
|
|
|
default_interrupt (TRAPA47, 47);
|
|
|
|
default_interrupt (TRAPA48, 48);
|
|
|
|
default_interrupt (TRAPA49, 49);
|
|
|
|
default_interrupt (TRAPA50, 50);
|
|
|
|
default_interrupt (TRAPA51, 51);
|
|
|
|
default_interrupt (TRAPA52, 52);
|
|
|
|
default_interrupt (TRAPA53, 53);
|
|
|
|
default_interrupt (TRAPA54, 54);
|
|
|
|
default_interrupt (TRAPA55, 55);
|
|
|
|
default_interrupt (TRAPA56, 56);
|
|
|
|
default_interrupt (TRAPA57, 57);
|
|
|
|
default_interrupt (TRAPA58, 58);
|
|
|
|
default_interrupt (TRAPA59, 59);
|
|
|
|
default_interrupt (TRAPA60, 60);
|
|
|
|
default_interrupt (TRAPA61, 61);
|
|
|
|
default_interrupt (TRAPA62, 62);
|
|
|
|
default_interrupt (TRAPA63, 63);
|
|
|
|
default_interrupt (IRQ0, 64);
|
|
|
|
default_interrupt (IRQ1, 65);
|
|
|
|
default_interrupt (IRQ2, 66);
|
|
|
|
default_interrupt (IRQ3, 67);
|
|
|
|
default_interrupt (IRQ4, 68);
|
|
|
|
default_interrupt (IRQ5, 69);
|
|
|
|
default_interrupt (IRQ6, 70);
|
|
|
|
default_interrupt (IRQ7, 71);
|
|
|
|
default_interrupt (DEI0, 72);
|
|
|
|
reserve_interrupt ( 73);
|
|
|
|
default_interrupt (DEI1, 74);
|
|
|
|
reserve_interrupt ( 75);
|
|
|
|
default_interrupt (DEI2, 76);
|
|
|
|
reserve_interrupt ( 77);
|
|
|
|
default_interrupt (DEI3, 78);
|
|
|
|
reserve_interrupt ( 79);
|
|
|
|
default_interrupt (IMIA0, 80);
|
|
|
|
default_interrupt (IMIB0, 81);
|
|
|
|
default_interrupt (OVI0, 82);
|
|
|
|
reserve_interrupt ( 83);
|
|
|
|
default_interrupt (IMIA1, 84);
|
|
|
|
default_interrupt (IMIB1, 85);
|
|
|
|
default_interrupt (OVI1, 86);
|
|
|
|
reserve_interrupt ( 87);
|
|
|
|
default_interrupt (IMIA2, 88);
|
|
|
|
default_interrupt (IMIB2, 89);
|
|
|
|
default_interrupt (OVI2, 90);
|
|
|
|
reserve_interrupt ( 91);
|
|
|
|
default_interrupt (IMIA3, 92);
|
|
|
|
default_interrupt (IMIB3, 93);
|
|
|
|
default_interrupt (OVI3, 94);
|
|
|
|
reserve_interrupt ( 95);
|
|
|
|
default_interrupt (IMIA4, 96);
|
|
|
|
default_interrupt (IMIB4, 97);
|
|
|
|
default_interrupt (OVI4, 98);
|
|
|
|
reserve_interrupt ( 99);
|
|
|
|
default_interrupt (REI0, 100);
|
|
|
|
default_interrupt (RXI0, 101);
|
|
|
|
default_interrupt (TXI0, 102);
|
|
|
|
default_interrupt (TEI0, 103);
|
|
|
|
default_interrupt (REI1, 104);
|
|
|
|
default_interrupt (RXI1, 105);
|
|
|
|
default_interrupt (TXI1, 106);
|
|
|
|
default_interrupt (TEI1, 107);
|
|
|
|
reserve_interrupt ( 108);
|
|
|
|
default_interrupt (ADITI, 109);
|
|
|
|
|
2002-04-24 21:55:32 +00:00
|
|
|
/* reset vectors are handled in crt0.S */
|
|
|
|
void (*vbr[]) (void) __attribute__ ((section (".vectors"))) =
|
2002-04-20 13:25:58 +00:00
|
|
|
{
|
|
|
|
/*** 4 General Illegal Instruction ***/
|
2002-03-28 15:09:10 +00:00
|
|
|
|
2002-04-20 13:25:58 +00:00
|
|
|
GII,
|
2002-03-28 15:09:10 +00:00
|
|
|
|
2002-04-20 13:25:58 +00:00
|
|
|
/*** 5 Reserved ***/
|
2002-03-28 15:09:10 +00:00
|
|
|
|
2002-04-20 13:25:58 +00:00
|
|
|
UIE5,
|
2002-03-28 15:09:10 +00:00
|
|
|
|
2002-04-20 13:25:58 +00:00
|
|
|
/*** 6 Illegal Slot Instruction ***/
|
2002-03-28 15:09:10 +00:00
|
|
|
|
2002-04-20 13:25:58 +00:00
|
|
|
ISI,
|
2002-03-28 15:09:10 +00:00
|
|
|
|
2002-04-20 13:25:58 +00:00
|
|
|
/*** 7-8 Reserved ***/
|
2002-03-28 15:09:10 +00:00
|
|
|
|
2002-04-20 13:25:58 +00:00
|
|
|
UIE7,UIE8,
|
2002-03-28 15:09:10 +00:00
|
|
|
|
2002-04-20 13:25:58 +00:00
|
|
|
/*** 9 CPU Address Error ***/
|
2002-03-28 15:09:10 +00:00
|
|
|
|
2002-04-20 13:25:58 +00:00
|
|
|
CPUAE,
|
2002-03-28 15:09:10 +00:00
|
|
|
|
2002-04-20 13:25:58 +00:00
|
|
|
/*** 10 DMA Address Error ***/
|
2002-03-28 15:09:10 +00:00
|
|
|
|
2002-04-20 13:25:58 +00:00
|
|
|
DMAAE,
|
2002-03-28 15:09:10 +00:00
|
|
|
|
2002-04-20 13:25:58 +00:00
|
|
|
/*** 11 NMI ***/
|
2002-03-28 15:09:10 +00:00
|
|
|
|
2002-04-20 13:25:58 +00:00
|
|
|
NMI,
|
2002-03-28 15:09:10 +00:00
|
|
|
|
2002-04-20 13:25:58 +00:00
|
|
|
/*** 12 User Break ***/
|
2002-03-28 15:09:10 +00:00
|
|
|
|
2002-04-20 13:25:58 +00:00
|
|
|
UB,
|
2002-03-28 15:09:10 +00:00
|
|
|
|
2002-04-20 13:25:58 +00:00
|
|
|
/*** 13-31 Reserved ***/
|
2002-03-28 15:09:10 +00:00
|
|
|
|
2002-04-20 13:25:58 +00:00
|
|
|
UIE13,UIE14,UIE15,UIE16,UIE17,UIE18,UIE19,UIE20,UIE21,UIE22,UIE23,UIE24,UIE25,UIE26,UIE27,UIE28,UIE29,UIE30,UIE31,
|
2002-03-28 15:09:10 +00:00
|
|
|
|
2002-04-20 13:25:58 +00:00
|
|
|
/*** 32-63 TRAPA #20...#3F ***/
|
2002-03-28 15:09:10 +00:00
|
|
|
|
|
|
|
TRAPA32,TRAPA33,TRAPA34,TRAPA35,TRAPA36,TRAPA37,TRAPA38,TRAPA39,TRAPA40,TRAPA41,TRAPA42,TRAPA43,TRAPA44,TRAPA45,TRAPA46,TRAPA47,TRAPA48,TRAPA49,TRAPA50,TRAPA51,TRAPA52,TRAPA53,TRAPA54,TRAPA55,TRAPA56,TRAPA57,TRAPA58,TRAPA59,TRAPA60,TRAPA61,TRAPA62,TRAPA63,
|
|
|
|
|
2002-04-20 13:25:58 +00:00
|
|
|
/*** 64-71 IRQ0-7 ***/
|
2002-03-28 15:09:10 +00:00
|
|
|
|
|
|
|
IRQ0,IRQ1,IRQ2,IRQ3,IRQ4,IRQ5,IRQ6,IRQ7,
|
|
|
|
|
2002-04-20 13:25:58 +00:00
|
|
|
/*** 72 DMAC0 ***/
|
2002-03-28 15:09:10 +00:00
|
|
|
|
2002-04-20 13:25:58 +00:00
|
|
|
DEI0,
|
2002-03-28 15:09:10 +00:00
|
|
|
|
2002-04-20 13:25:58 +00:00
|
|
|
/*** 73 Reserved ***/
|
2002-03-28 15:09:10 +00:00
|
|
|
|
|
|
|
UIE73,
|
|
|
|
|
2002-04-20 13:25:58 +00:00
|
|
|
/*** 74 DMAC1 ***/
|
2002-03-28 15:09:10 +00:00
|
|
|
|
|
|
|
DEI1,
|
|
|
|
|
2002-04-20 13:25:58 +00:00
|
|
|
/*** 75 Reserved ***/
|
2002-03-28 15:09:10 +00:00
|
|
|
|
|
|
|
UIE75,
|
|
|
|
|
2002-04-20 13:25:58 +00:00
|
|
|
/*** 76 DMAC2 ***/
|
2002-03-28 15:09:10 +00:00
|
|
|
|
|
|
|
DEI2,
|
|
|
|
|
2002-04-20 13:25:58 +00:00
|
|
|
/*** 77 Reserved ***/
|
2002-03-28 15:09:10 +00:00
|
|
|
|
|
|
|
UIE77,
|
|
|
|
|
2002-04-20 13:25:58 +00:00
|
|
|
/*** 78 DMAC3 ***/
|
2002-03-28 15:09:10 +00:00
|
|
|
|
2002-04-20 13:25:58 +00:00
|
|
|
DEI3,
|
2002-03-28 15:09:10 +00:00
|
|
|
|
2002-04-20 13:25:58 +00:00
|
|
|
/*** 79 Reserved ***/
|
2002-03-28 15:09:10 +00:00
|
|
|
|
|
|
|
UIE79,
|
|
|
|
|
2002-04-20 13:25:58 +00:00
|
|
|
/*** 80-82 ITU0 ***/
|
2002-03-28 15:09:10 +00:00
|
|
|
|
2002-04-20 13:25:58 +00:00
|
|
|
IMIA0,IMIB0,OVI0,
|
2002-03-28 15:09:10 +00:00
|
|
|
|
2002-04-20 13:25:58 +00:00
|
|
|
/*** 83 Reserved ***/
|
2002-03-28 15:09:10 +00:00
|
|
|
|
|
|
|
UIE83,
|
|
|
|
|
2002-04-20 13:25:58 +00:00
|
|
|
/*** 84-86 ITU1 ***/
|
2002-03-28 15:09:10 +00:00
|
|
|
|
2002-04-20 13:25:58 +00:00
|
|
|
IMIA1,IMIB1,OVI1,
|
2002-03-28 15:09:10 +00:00
|
|
|
|
2002-04-20 13:25:58 +00:00
|
|
|
/*** 87 Reserved ***/
|
2002-03-28 15:09:10 +00:00
|
|
|
|
|
|
|
UIE87,
|
|
|
|
|
2002-04-20 13:25:58 +00:00
|
|
|
/*** 88-90 ITU2 ***/
|
2002-03-28 15:09:10 +00:00
|
|
|
|
2002-04-20 13:25:58 +00:00
|
|
|
IMIA2,IMIB2,OVI2,
|
2002-03-28 15:09:10 +00:00
|
|
|
|
2002-04-20 13:25:58 +00:00
|
|
|
/*** 91 Reserved ***/
|
2002-03-28 15:09:10 +00:00
|
|
|
|
|
|
|
UIE91,
|
|
|
|
|
2002-04-20 13:25:58 +00:00
|
|
|
/*** 92-94 ITU3 ***/
|
2002-03-28 15:09:10 +00:00
|
|
|
|
2002-04-20 13:25:58 +00:00
|
|
|
IMIA3,IMIB3,OVI3,
|
2002-03-28 15:09:10 +00:00
|
|
|
|
2002-04-20 13:25:58 +00:00
|
|
|
/*** 95 Reserved ***/
|
2002-03-28 15:09:10 +00:00
|
|
|
|
|
|
|
UIE95,
|
|
|
|
|
2002-04-20 13:25:58 +00:00
|
|
|
/*** 96-98 ITU4 ***/
|
2002-03-28 15:09:10 +00:00
|
|
|
|
2002-04-20 13:25:58 +00:00
|
|
|
IMIA4,IMIB4,OVI4,
|
2002-03-28 15:09:10 +00:00
|
|
|
|
2002-04-20 13:25:58 +00:00
|
|
|
/*** 99 Reserved ***/
|
2002-03-28 15:09:10 +00:00
|
|
|
|
|
|
|
UIE99,
|
|
|
|
|
2002-04-20 13:25:58 +00:00
|
|
|
/*** 100-103 SCI0 ***/
|
2002-03-28 15:09:10 +00:00
|
|
|
|
2002-04-20 13:25:58 +00:00
|
|
|
REI0,RXI0,TXI0,TEI0,
|
2002-03-28 15:09:10 +00:00
|
|
|
|
2002-04-20 13:25:58 +00:00
|
|
|
/*** 104-107 SCI1 ***/
|
2002-03-28 15:09:10 +00:00
|
|
|
|
2002-04-20 13:25:58 +00:00
|
|
|
REI1,RXI1,TXI1,TEI1,
|
2002-03-28 15:09:10 +00:00
|
|
|
|
2002-04-20 13:25:58 +00:00
|
|
|
/*** 108 Parity Control Unit ***/
|
2002-03-28 15:09:10 +00:00
|
|
|
|
2002-04-20 13:25:58 +00:00
|
|
|
UIE108,
|
2002-03-28 15:09:10 +00:00
|
|
|
|
2002-04-20 13:25:58 +00:00
|
|
|
/*** 109 AD Converter ***/
|
2002-03-28 15:09:10 +00:00
|
|
|
|
2002-04-20 13:25:58 +00:00
|
|
|
ADITI
|
2002-03-28 15:09:10 +00:00
|
|
|
|
2002-04-20 13:25:58 +00:00
|
|
|
};
|
2002-03-28 15:09:10 +00:00
|
|
|
|
|
|
|
|
|
|
|
void system_reboot (void)
|
2002-04-20 13:25:58 +00:00
|
|
|
{
|
2002-03-28 15:09:10 +00:00
|
|
|
cli ();
|
|
|
|
|
|
|
|
asm volatile ("ldc\t%0,vbr" : : "r"(0));
|
|
|
|
|
2002-04-20 13:25:58 +00:00
|
|
|
IPRA = 0;
|
|
|
|
IPRB = 0;
|
|
|
|
IPRC = 0;
|
|
|
|
IPRD = 0;
|
|
|
|
IPRE = 0;
|
|
|
|
ICR = 0;
|
2002-03-28 15:09:10 +00:00
|
|
|
|
2002-04-20 13:25:58 +00:00
|
|
|
asm volatile ("jmp @%0; mov.l @%1,r15" : :
|
2002-06-26 22:39:22 +00:00
|
|
|
"r"(*(int*)0),"r"(4));
|
2002-04-20 13:25:58 +00:00
|
|
|
}
|
2002-03-28 15:09:10 +00:00
|
|
|
|
|
|
|
void UIE (unsigned int pc) /* Unexpected Interrupt or Exception */
|
2002-04-20 13:25:58 +00:00
|
|
|
{
|
2002-05-24 15:22:33 +00:00
|
|
|
bool state = true;
|
2002-04-24 21:55:32 +00:00
|
|
|
unsigned int n;
|
2002-05-24 15:22:33 +00:00
|
|
|
char str[32];
|
2002-04-24 21:55:32 +00:00
|
|
|
|
2002-03-28 15:09:10 +00:00
|
|
|
asm volatile ("sts\tpr,%0" : "=r"(n));
|
2002-04-24 21:55:32 +00:00
|
|
|
|
2002-06-24 11:35:13 +00:00
|
|
|
/* clear screen */
|
|
|
|
lcd_clear_display ();
|
2002-09-16 06:51:43 +00:00
|
|
|
#ifdef HAVE_LCD_BITMAP
|
Daniel,
The following patch makes loadable fonts actually work (finally!).
It took me quite a while, but I finally figured out why the sim
worked and the target didn't: the SH1 processor won't read
longwords from a shortword alignment... I had to rev the .fnt
file to version 1.1 (requires remaking *.fnt files) in order
to fix this. Please apply the following patch completely.
It's diffed against the latest CVS.
I've also attached rockbox-fonts-1.1.tar.gz which includes
known working *.fnt files, including a courB08 system.fnt,
for demonstration.
Now the real work can begin... Although the new
system.fnt will work fine, if you try going to a really
big font (try copying courB14.fnt to system.fnt), then
you will find that it comes up and works in tree mode,
but will crash the system when going into WPS
mode... I'm sure this is because of the low-level
lcd_bitmap not clipping properly when given a too-large
bitmap, which the characters become. I haven't yet
tried to debug the low-level driver. Of course, it all
works on the sim...
So the apps developers will now have to make sure that
all apps screen sizes may vary according to the loaded font.
The font height can be gotten through the lcd_getfontsize API.
Files patched in fonts-6.patch
1. apps/menu.c - LCD_PROPFONTS error (2nd resubmission on this, please checkin)
2. firmware/font.c - fixes and reformatting. Please check this in as is,
my vi editor requires more reformatting changes since I left tabs in the
file, these are removed now (2nd resubmission on this, please checkin)
3. firmware/fonts.h - doc change on .fnt file format, .fnt version
number incremented.
4. firmware/loadfont.c - fixes to load font properly, typedefs
removed.
5. firmware/system.c - lcd_setfont(FONT_SYSFIXED) before
issuing error, otherwise font may not exist.
6. tools/bdf2c - fixes for correct output when filename starts
with a number, as well as when no DEFAULT_CHAR in .bdf
file. (2nd resubmission on this, please checkin)
7. tools/writerbf.c - fixes for bugfixed fontfile format.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2294 a1c6a512-1295-4272-9138-f99709370657
2002-09-16 03:18:49 +00:00
|
|
|
lcd_setfont(FONT_SYSFIXED);
|
2002-09-16 06:51:43 +00:00
|
|
|
#endif
|
2002-06-24 11:35:13 +00:00
|
|
|
/* output exception */
|
2003-02-23 19:02:31 +00:00
|
|
|
n = (n - (unsigned)UIE0 - 4)>>2; /* get exception or interrupt number */
|
2002-05-28 13:38:42 +00:00
|
|
|
snprintf(str,sizeof(str),"I%02x:%s",n,irqname[n]);
|
2002-05-24 15:22:33 +00:00
|
|
|
lcd_puts(0,0,str);
|
|
|
|
snprintf(str,sizeof(str),"at %08x",pc);
|
|
|
|
lcd_puts(0,1,str);
|
2002-03-28 15:09:10 +00:00
|
|
|
|
2002-06-24 11:35:13 +00:00
|
|
|
#ifdef HAVE_LCD_BITMAP
|
|
|
|
lcd_update ();
|
|
|
|
#endif
|
|
|
|
|
2002-03-28 15:09:10 +00:00
|
|
|
while (1)
|
2002-04-20 13:25:58 +00:00
|
|
|
{
|
2002-05-24 15:22:33 +00:00
|
|
|
volatile int i;
|
2002-04-28 21:40:24 +00:00
|
|
|
led (state);
|
2002-05-13 12:29:34 +00:00
|
|
|
state = state?false:true;
|
2002-04-29 14:23:21 +00:00
|
|
|
|
2002-03-28 15:09:10 +00:00
|
|
|
for (i = 0; i < 240000; ++i);
|
2002-04-20 13:25:58 +00:00
|
|
|
}
|
|
|
|
}
|
2002-03-28 15:09:10 +00:00
|
|
|
|
|
|
|
asm (
|
2002-04-20 13:25:58 +00:00
|
|
|
"_UIE0:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\t\n"
|
|
|
|
"_UIE1:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\t\n"
|
|
|
|
"_UIE2:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\t\n"
|
|
|
|
"_UIE3:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\t\n"
|
|
|
|
"_UIE4:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\t\n"
|
|
|
|
"_UIE5:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\t\n"
|
|
|
|
"_UIE6:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\t\n"
|
|
|
|
"_UIE7:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\t\n"
|
|
|
|
"_UIE8:\tbsr\t_UIE\n\tmov.l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:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\t\n"
|
|
|
|
"_UIE93:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\t\n"
|
|
|
|
"_UIE94:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\t\n"
|
|
|
|
"_UIE95:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\t\n"
|
|
|
|
"_UIE96:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\t\n"
|
|
|
|
"_UIE97:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\t\n"
|
|
|
|
"_UIE98:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\t\n"
|
|
|
|
"_UIE99:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\t\n"
|
|
|
|
"_UIE100:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\t\n"
|
|
|
|
"_UIE101:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\t\n"
|
|
|
|
"_UIE102:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\t\n"
|
|
|
|
"_UIE103:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\t\n"
|
|
|
|
"_UIE104:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\t\n"
|
|
|
|
"_UIE105:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\t\n"
|
|
|
|
"_UIE106:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\t\n"
|
|
|
|
"_UIE107:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\t\n"
|
|
|
|
"_UIE108:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\t\n"
|
|
|
|
"_UIE109:\tbsr\t_UIE\n\tmov.l\t@r15+,r4");
|
2002-05-29 09:11:04 +00:00
|
|
|
|
|
|
|
void system_init(void)
|
|
|
|
{
|
|
|
|
/* Disable all interrupts */
|
|
|
|
IPRA = 0;
|
|
|
|
IPRB = 0;
|
|
|
|
IPRC = 0;
|
|
|
|
IPRD = 0;
|
|
|
|
IPRE = 0;
|
|
|
|
|
|
|
|
/* NMI level low, falling edge on all interrupts */
|
|
|
|
ICR = 0;
|
2002-09-05 07:22:37 +00:00
|
|
|
|
|
|
|
/* Enable burst mode on DRAM */
|
|
|
|
DCR |= 0x1000;
|
2002-09-05 10:21:48 +00:00
|
|
|
|
|
|
|
/* Activate Warp mode (simultaneous internal and external mem access) */
|
|
|
|
BCR |= 0x2000;
|
2002-05-29 09:11:04 +00:00
|
|
|
}
|