├── .hgignore ├── Attic └── nlib │ ├── src │ ├── dumped │ ├── dspblocks │ │ ├── block07.h │ │ ├── block0A.h │ │ ├── block0E.h │ │ ├── block10.h │ │ ├── block11.h │ │ ├── block12.h │ │ ├── block13.h │ │ ├── block19.h │ │ ├── block0F.h │ │ ├── block1B.h │ │ ├── block15.h │ │ ├── block16.h │ │ ├── block17.h │ │ └── block08.h │ ├── Makefile │ ├── lights.c │ ├── ptimer.c │ ├── dspblocks.c │ ├── nokio.c │ ├── lcd.c │ ├── gensio.c │ ├── flashdbg.c │ └── interrupt.c │ ├── dspsrc │ ├── test.elf │ ├── test.hex │ ├── mm.sh │ ├── test.s │ ├── dspy.dis │ └── dspx.dis │ ├── include │ └── nlib │ │ ├── ptimer.h │ │ ├── lights.h │ │ ├── dspblocks.h │ │ ├── gensio.h │ │ ├── lcd.h │ │ ├── ccont.h │ │ ├── typedef.h │ │ ├── flashdbg.h │ │ ├── interrupt.h │ │ ├── dsp.h │ │ └── nokio.h │ ├── script │ ├── d54x │ ├── dsp_fromhex.py │ └── halfwordify.py │ ├── README │ ├── res │ ├── memmap │ ├── Makefile │ └── memmap.dsp │ ├── ChangeLog │ ├── Makefile.cfg │ ├── Makefile.global │ ├── Makefile │ └── test │ └── Makefile ├── apps ├── f1.c ├── dct3algo_ARM.o ├── dct3algo_PC.o ├── dct4algo_ARM.o ├── dct4algo_PC.o ├── lgunlock_table_PC.o ├── lgunlock_table_ARM.o ├── alcatel.c └── screenshot.c ├── data ├── 2100 │ ├── memmap │ ├── memmap_embed │ └── memmap_loader ├── 3350 │ ├── memmap │ ├── memmap_embed │ └── memmap_loader ├── 3410 │ ├── memmap │ ├── memmap_embed │ └── memmap_loader ├── 5110 │ ├── memmap │ ├── memmap_embed │ └── memmap_loader ├── 6210 │ ├── memmap │ ├── memmap_embed │ └── memmap_loader ├── 8210 │ ├── memmap │ ├── memmap_embed │ └── memmap_loader ├── 0xFF.gz ├── 3310_new │ ├── memmap │ ├── memmap_embed │ └── memmap_loader ├── 3310_old │ ├── memmap │ ├── memmap_embed │ └── memmap_loader ├── 3330_new │ ├── memmap │ ├── memmap_embed │ └── memmap_loader └── 3330_old │ ├── memmap │ ├── memmap_embed │ └── memmap_loader ├── core ├── bitmap.c ├── conv.c └── fs.c ├── tools ├── compile.sh ├── g3n0lite ├── dialog.exe ├── g3n0lite.exe ├── [MADos] Studio .eXe ├── animation studio │ ├── Form1.frx │ ├── Form2.frx │ ├── Form3.frx │ ├── Form4.frx │ ├── frmAbout.frx │ ├── frmBitmap.frx │ ├── frmBitmap2.frx │ ├── MSSCCPRJ.SCC │ ├── Progetto1.vbw │ ├── Progetto1.vbp │ └── Form2.frm ├── MADos_startup.gsc └── conv_hth.c ├── include ├── apps │ ├── othello_KI.h │ ├── madmedia.h │ ├── meas.h │ ├── hangman.h │ ├── matrix.h │ ├── othello.h │ ├── engine3d.h │ ├── picpaint.h │ ├── tictactoe.h │ ├── demo_1.h │ ├── samsung.h │ ├── screenshot.h │ ├── f1.h │ ├── fire.h │ ├── alcatel.h │ ├── gallery.h │ ├── txtreader.h │ ├── provider.h │ ├── vitel.h │ ├── sony_cmd_c1.h │ ├── stars.h │ ├── dct4.h │ ├── dct3.h │ ├── lgunlock.h │ ├── arcanoid.h │ ├── dspcode.h │ ├── st55gd55.h │ ├── charger.h │ ├── snake.h │ ├── tetris.h │ └── huffman_testtext.h ├── hw │ ├── phoneinfo.h │ ├── genio.h │ ├── clock.h │ ├── dspblocks.h │ ├── led.h │ ├── vibra.h │ ├── sim.h │ ├── mdi.h │ ├── snd.h │ ├── timer.h │ ├── xbus.h │ ├── int.h │ ├── flash.h │ ├── ccont.h │ ├── kpd.h │ ├── mbus.h │ ├── buzzer.h │ ├── kpd_getkey_matrix.h │ ├── dsp.h │ └── io.h ├── dspblocks │ ├── block07.h │ ├── block0A.h │ ├── block0E.h │ ├── block10.h │ ├── block11.h │ ├── block12.h │ ├── block13.h │ ├── block19.h │ └── block0F.h └── core │ ├── fs.h │ ├── huffman.h │ ├── ui.h │ ├── ffs.h │ ├── ipc.h │ ├── milieu.h │ ├── stdio.h │ └── sched.h ├── Unlockers.txt ├── Marcanoid.txt ├── hw ├── clock.c ├── vibra.c ├── dspblocks.c └── genio.c ├── bugs.txt └── compile.conf /.hgignore: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Attic/nlib/src/dumped: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /apps/f1.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/g3gg0/mados/master/apps/f1.c -------------------------------------------------------------------------------- /data/0xFF.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/g3gg0/mados/master/data/0xFF.gz -------------------------------------------------------------------------------- /core/bitmap.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/g3gg0/mados/master/core/bitmap.c -------------------------------------------------------------------------------- /tools/compile.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | gcc -o test main.c -lioperm -O3 4 | -------------------------------------------------------------------------------- /tools/g3n0lite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/g3gg0/mados/master/tools/g3n0lite -------------------------------------------------------------------------------- /tools/dialog.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/g3gg0/mados/master/tools/dialog.exe -------------------------------------------------------------------------------- /apps/dct3algo_ARM.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/g3gg0/mados/master/apps/dct3algo_ARM.o -------------------------------------------------------------------------------- /apps/dct3algo_PC.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/g3gg0/mados/master/apps/dct3algo_PC.o -------------------------------------------------------------------------------- /apps/dct4algo_ARM.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/g3gg0/mados/master/apps/dct4algo_ARM.o -------------------------------------------------------------------------------- /apps/dct4algo_PC.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/g3gg0/mados/master/apps/dct4algo_PC.o -------------------------------------------------------------------------------- /tools/g3n0lite.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/g3gg0/mados/master/tools/g3n0lite.exe -------------------------------------------------------------------------------- /apps/lgunlock_table_PC.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/g3gg0/mados/master/apps/lgunlock_table_PC.o -------------------------------------------------------------------------------- /Attic/nlib/dspsrc/test.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/g3gg0/mados/master/Attic/nlib/dspsrc/test.elf -------------------------------------------------------------------------------- /apps/lgunlock_table_ARM.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/g3gg0/mados/master/apps/lgunlock_table_ARM.o -------------------------------------------------------------------------------- /include/apps/othello_KI.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/g3gg0/mados/master/include/apps/othello_KI.h -------------------------------------------------------------------------------- /tools/[MADos] Studio .eXe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/g3gg0/mados/master/tools/[MADos] Studio .eXe -------------------------------------------------------------------------------- /Attic/nlib/include/nlib/ptimer.h: -------------------------------------------------------------------------------- 1 | int IO_getTimestamp ( int type ); 2 | void IO_delay ( int wait ); 3 | -------------------------------------------------------------------------------- /tools/animation studio/Form1.frx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/g3gg0/mados/master/tools/animation studio/Form1.frx -------------------------------------------------------------------------------- /tools/animation studio/Form2.frx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/g3gg0/mados/master/tools/animation studio/Form2.frx -------------------------------------------------------------------------------- /tools/animation studio/Form3.frx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/g3gg0/mados/master/tools/animation studio/Form3.frx -------------------------------------------------------------------------------- /tools/animation studio/Form4.frx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/g3gg0/mados/master/tools/animation studio/Form4.frx -------------------------------------------------------------------------------- /tools/animation studio/frmAbout.frx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/g3gg0/mados/master/tools/animation studio/frmAbout.frx -------------------------------------------------------------------------------- /tools/animation studio/frmBitmap.frx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/g3gg0/mados/master/tools/animation studio/frmBitmap.frx -------------------------------------------------------------------------------- /tools/animation studio/frmBitmap2.frx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/g3gg0/mados/master/tools/animation studio/frmBitmap2.frx -------------------------------------------------------------------------------- /Attic/nlib/script/d54x: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # d54x 3 | tic54x-objdump -b binary -m tic54x --adjust-vma $2 -D $1 4 | 5 | -------------------------------------------------------------------------------- /Attic/nlib/README: -------------------------------------------------------------------------------- 1 | Edit makefile.cfg 2 | 3 | 'make' then creates test/test.bin, which you can send to your phone 4 | with wmx-sendcode 5 | -------------------------------------------------------------------------------- /Attic/nlib/include/nlib/lights.h: -------------------------------------------------------------------------------- 1 | #ifndef WMX_LIGHTS 2 | #define WMX_LIGHTS 3 | 4 | void IO_setLights ( int state ); 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /Attic/nlib/include/nlib/dspblocks.h: -------------------------------------------------------------------------------- 1 | #ifndef WMX_DSPBLOCKS 2 | #define WMX_DSPBLOCKS 3 | 4 | struct dsp_codeblock *DSP_getCodeBlock ( int n ); 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /Attic/nlib/dspsrc/test.hex: -------------------------------------------------------------------------------- 1 | /* Autogenerated by halfwordify.py -- Do not manually modify this file! */ 2 | { 3 | 0x76F8,0x0F05,0x0000,0xF073,0x0F03,0x1234,0x9999 4 | } 5 | -------------------------------------------------------------------------------- /Attic/nlib/res/memmap: -------------------------------------------------------------------------------- 1 | MEMORY { 2 | ram(RWXAIL) : ORIGIN = 0x0, LENGTH = 64K 3 | } 4 | 5 | SECTIONS { 6 | /* put crt0 at the beginning */ 7 | BOOT : { crt0.o } >ram 8 | } 9 | -------------------------------------------------------------------------------- /Attic/nlib/ChangeLog: -------------------------------------------------------------------------------- 1 | 2003-09-11 wumpus 2 | 3 | * Started this changelog 4 | * Changed nlib directory structure to more mature 5 | * dspsrc/ 6 | -------------------------------------------------------------------------------- /Attic/nlib/res/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR = .. 2 | 3 | include ../Makefile.global 4 | 5 | #all: crt0.o 6 | # cp ../src/crt0.o . 7 | #clean: 8 | # rm crt0.o 9 | 10 | all: 11 | 12 | clean: 13 | -------------------------------------------------------------------------------- /Attic/nlib/dspsrc/mm.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | tic54x-as -mcpu=545 $1.s -o $1.o 4 | tic54x-ld $1.o -T ../res/memmap.dsp -o $1.elf 5 | tic54x-objcopy -O binary $1.elf $1.bin 6 | ../script/halfwordify.py $1.bin $1.hex 7 | -------------------------------------------------------------------------------- /Attic/nlib/dspsrc/test.s: -------------------------------------------------------------------------------- 1 | .TEXT 2 | 3 | st #0,*(bls) @ test in test 4 | 5 | @ ret 6 | loopey: 7 | b loopey 8 | 9 | .DATA 10 | bls: 11 | .short 0x1234 12 | .short 0x9999 13 | 14 | .END 15 | -------------------------------------------------------------------------------- /tools/animation studio/MSSCCPRJ.SCC: -------------------------------------------------------------------------------- 1 | [SCC] 2 | SCC=This is a source code control file 3 | [Progetto1.vbp] 4 | SCC_Project_Name=this project is not under source code control 5 | SCC_Aux_Path= 6 | -------------------------------------------------------------------------------- /Attic/nlib/include/nlib/gensio.h: -------------------------------------------------------------------------------- 1 | #ifndef WMX_GENSIO 2 | #define WMX_GENSIO 3 | 4 | void IO_gensioInitialize ( ); 5 | void IO_gensioWait ( uint bits ); 6 | void IO_gensioSend ( uint xxx ); 7 | void IO_gensioStart ( ); 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /Attic/nlib/include/nlib/lcd.h: -------------------------------------------------------------------------------- 1 | #ifndef WMX_LCD 2 | #define WMX_LCD 3 | 4 | void IO_LCDInitialize ( ); 5 | void IO_LCDSendCmd ( uint cmd ); 6 | void IO_LCDSendData ( uint dat ); 7 | void IO_LCDSetContrast ( int vop ); 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /Attic/nlib/res/memmap.dsp: -------------------------------------------------------------------------------- 1 | /* 2 | simple memmap for dsp shared mem loader 3 | merge data and code sections.. 4 | */ 5 | MEMORY { 6 | ram(RWXAIL) : ORIGIN = 0xF00, LENGTH = 256 7 | } 8 | 9 | SECTIONS { 10 | .text : { 11 | *(.text) 12 | *(.data) 13 | } > ram 14 | } 15 | -------------------------------------------------------------------------------- /Attic/nlib/src/dspblocks/block07.h: -------------------------------------------------------------------------------- 1 | /* 07 00305514 w0:09c6 w1:0b39 size:0000 offset:01c6 w4:04ec w5:0000 2 | Block: (MCU)0001038c-0001038c (DSP)09c6-09c6 BS=04ec (TARG)09c6-09c6 */ 3 | static struct dsp_codeblock block07 = { 4 | {0x09C6, 0x0B39, 0x0000, 0x01C6, 0x04EC}, 5 | { 6 | } 7 | }; 8 | -------------------------------------------------------------------------------- /Attic/nlib/src/dspblocks/block0A.h: -------------------------------------------------------------------------------- 1 | /* 0a 00305f88 w0:0a4a w1:0b39 size:0000 offset:024a w4:04ec w5:0000 2 | Block: (MCU)00010494-00010494 (DSP)0a4a-0a4a BS=04ec (TARG)0a4a-0a4a */ 3 | static struct dsp_codeblock block0A = { 4 | {0x0A4A, 0x0B39, 0x0000, 0x024A, 0x04EC}, 5 | { 6 | } 7 | }; 8 | -------------------------------------------------------------------------------- /Attic/nlib/src/dspblocks/block0E.h: -------------------------------------------------------------------------------- 1 | /* 0e 00306f58 w0:1000 w1:0b39 size:0000 offset:01c6 w4:01f4 w5:0000 2 | Block: (MCU)0001038c-0001038c (DSP)09c6-09c6 BS=01f4 (TARG)1000-1000 */ 3 | static struct dsp_codeblock block0E = { 4 | {0x1000, 0x0B39, 0x0000, 0x01C6, 0x01F4}, 5 | { 6 | } 7 | }; 8 | -------------------------------------------------------------------------------- /Attic/nlib/src/dspblocks/block10.h: -------------------------------------------------------------------------------- 1 | /* 10 00307060 w0:0000 w1:ff80 size:0000 offset:0200 w4:0078 w5:0000 2 | Block: (MCU)00010400-00010400 (DSP)0a00-0a00 BS=0078 (TARG)0000-0000 */ 3 | static struct dsp_codeblock block10 = { 4 | {0x0000, 0xFF80, 0x0000, 0x0200, 0x0078}, 5 | { 6 | } 7 | }; 8 | -------------------------------------------------------------------------------- /Attic/nlib/src/dspblocks/block11.h: -------------------------------------------------------------------------------- 1 | /* 11 0030706c w0:0000 w1:ff80 size:0000 offset:0200 w4:0078 w5:0000 2 | Block: (MCU)00010400-00010400 (DSP)0a00-0a00 BS=0078 (TARG)0000-0000 */ 3 | static struct dsp_codeblock block11 = { 4 | {0x0000, 0xFF80, 0x0000, 0x0200, 0x0078}, 5 | { 6 | } 7 | }; 8 | -------------------------------------------------------------------------------- /Attic/nlib/src/dspblocks/block12.h: -------------------------------------------------------------------------------- 1 | /* 12 00307078 w0:0000 w1:f000 size:0000 offset:0200 w4:0078 w5:0000 2 | Block: (MCU)00010400-00010400 (DSP)0a00-0a00 BS=0078 (TARG)0000-0000 */ 3 | static struct dsp_codeblock block12 = { 4 | {0x0000, 0xF000, 0x0000, 0x0200, 0x0078}, 5 | { 6 | } 7 | }; 8 | -------------------------------------------------------------------------------- /Attic/nlib/src/dspblocks/block13.h: -------------------------------------------------------------------------------- 1 | /* 13 00307084 w0:0000 w1:f000 size:0000 offset:0200 w4:0078 w5:0000 2 | Block: (MCU)00010400-00010400 (DSP)0a00-0a00 BS=0078 (TARG)0000-0000 */ 3 | static struct dsp_codeblock block13 = { 4 | {0x0000, 0xF000, 0x0000, 0x0200, 0x0078}, 5 | { 6 | } 7 | }; 8 | -------------------------------------------------------------------------------- /Attic/nlib/src/dspblocks/block19.h: -------------------------------------------------------------------------------- 1 | /* 19 00307e8c w0:2206 w1:0000 size:0000 offset:0000 w4:0000 w5:0000 2 | Block: (MCU)00010000-00010000 (DSP)0800-0800 BS=0000 (TARG)2206-2206 */ 3 | static struct dsp_codeblock block19 = { 4 | {0x2206, 0x0000, 0x0000, 0x0000, 0x0000}, 5 | { 6 | } 7 | }; 8 | -------------------------------------------------------------------------------- /Attic/nlib/include/nlib/ccont.h: -------------------------------------------------------------------------------- 1 | #ifndef WMX_CCONT 2 | 3 | #define WMX_CCONT 4 | 5 | #define CCONT_READCACHE 0x8000 6 | #define CCONT_WRITECACHE 0x8000 7 | 8 | void IO_CContWrite ( uint reg, uint value ); 9 | int IO_CContRead ( uint reg ); 10 | uint IO_CContADRead ( int n ); 11 | void IO_CContInitialize ( ); 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /Attic/nlib/include/nlib/typedef.h: -------------------------------------------------------------------------------- 1 | #ifndef BS_TYPEDEF_H_INCLUDED 2 | #define BS_TYPEDEF_H_INCLUDED 3 | 4 | typedef char int8; 5 | typedef short int16; 6 | typedef long int32; 7 | typedef unsigned char uint8; 8 | typedef unsigned short uint16; 9 | typedef unsigned long uint32; 10 | 11 | typedef unsigned int uint; 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /Attic/nlib/Makefile.cfg: -------------------------------------------------------------------------------- 1 | export COMPILER_PATH=/home/-gamez-/gccarm/arm-thumb-elf/bin/ 2 | CC = /home/-gamez-/gccarm/arm-thumb-elf/bin/gcc 3 | GAS = /home/-gamez-/gccarm/arm-thumb-elf/bin/as -EB 4 | OBJDUMP = /home/-gamez-/gccarm/arm-thumb-elf/bin/objdump 5 | OBJCOPY = /home/-gamez-/gccarm/arm-thumb-elf/bin/objcopy 6 | AR = /home/-gamez-/gccarm/arm-thumb-elf/bin/ar 7 | -------------------------------------------------------------------------------- /Attic/nlib/include/nlib/flashdbg.h: -------------------------------------------------------------------------------- 1 | #ifndef WMX_FLASHER 2 | #define WMX_FLASHER 3 | 4 | uint IO_flashdbgReceiveByte ( ); 5 | void IO_flashdbgSendByte ( uint dat ); 6 | void IO_flashdbgSetSDA ( int state ); 7 | void IO_flashdbgSendPacket ( uint8 * packet, uint length ); 8 | void IO_flashdbg ( uint code, uint8 * param, uint length ); 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /Attic/nlib/Makefile.global: -------------------------------------------------------------------------------- 1 | #TOPDIR := $(shell pwd) 2 | SCRIPT := $(TOPDIR)/script 3 | HALFWORDIFY := $(SCRIPT)/halfwordify.py 4 | 5 | CFLAGS = -O2 -mthumb -mbig-endian -I$(TOPDIR)/include -EB 6 | CFLAGS_LINK = $(CFLAGS) -L$(TOPDIR)/src -nodefaultlibs -nostartfiles -Xlinker $(MEMMAP) 7 | MEMMAP = $(TOPDIR)/res/memmap 8 | 9 | include $(TOPDIR)/Makefile.cfg 10 | -------------------------------------------------------------------------------- /Attic/nlib/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR = . 2 | include Makefile.global 3 | 4 | all: src res test 5 | 6 | src: 7 | make -C src 8 | 9 | res: 10 | make -C res 11 | 12 | test: 13 | make -C test 14 | 15 | dspsrc: 16 | make -C dspsrc 17 | 18 | clean: 19 | make -C src clean 20 | make -C res clean 21 | make -C test clean 22 | 23 | .PHONY: src res test dspsrc 24 | -------------------------------------------------------------------------------- /tools/MADos_startup.gsc: -------------------------------------------------------------------------------- 1 | 2 | [PATCH] 3 | Description = Hack to integrate MADos into nokia flashes via 5E0 table 4 | Creator = g3gg0 5 | 6 | 7 | [SCRIPT] 8 | 5E0: 5E0_space = 10 9 | # 10 | # 3330 should be: 11 | # 12 | #CLC: MADos_startup = 0x00200000 + 0x00290041 13 | # 14 | # 15 | CLC: MADos_startup = 0x00200000 + 0x00140040 16 | A5E: foo = MADos_startup 17 | -------------------------------------------------------------------------------- /Attic/nlib/test/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR = .. 2 | 3 | include $(TOPDIR)/Makefile.global 4 | 5 | OBJECTS = test.o 6 | 7 | test.bin: test.elf 8 | $(OBJCOPY) -O binary test.elf test.bin 9 | 10 | test.elf : $(OBJECTS) 11 | ln -sf ../src/crt0.o . 12 | $(CC) $(CFLAGS_LINK) $(OBJECTS) -lnlib -o test.elf 13 | $(OBJDUMP) -D test.elf >test.lst 14 | 15 | clean: 16 | rm $(OBJECTS) test.bin test.elf test.lst crt0.o 17 | -------------------------------------------------------------------------------- /tools/animation studio/Progetto1.vbw: -------------------------------------------------------------------------------- 1 | frmBitmap = 88, 88, 608, 536, Z, 22, 22, 740, 637, C 2 | Form1 = 132, 174, 723, 618, , 110, 145, 701, 589, C 3 | Form2 = 22, 29, 613, 473, , 0, 0, 591, 444, C 4 | Form3 = 0, 0, 0, 0, C, 154, 203, 745, 647, C 5 | frmAbout = 0, 0, 0, 0, C, 0, 0, 0, 0, C 6 | frmeditBitmap = 88, 116, 679, 560, , 88, 116, 679, 560, C 7 | modFunctions = 0, 0, 0, 0, C 8 | Form4 = 0, 0, 0, 0, C, 132, 174, 723, 618, C 9 | -------------------------------------------------------------------------------- /Attic/nlib/src/Makefile: -------------------------------------------------------------------------------- 1 | TOPDIR = .. 2 | 3 | include ../Makefile.global 4 | 5 | #OBJECTS = test.o 6 | LIBOBJECTS = nokio.o dsp.o flashdbg.o gensio.o ptimer.o lights.o ccont.o lcd.o interrupt.o dspblocks.o 7 | 8 | all: crt0.o libnlib.a 9 | 10 | libnlib.a : $(LIBOBJECTS) 11 | $(AR) csr libnlib.a $(LIBOBJECTS) 12 | 13 | crt0.o : crt0.s 14 | $(GAS) $(GOPS) crt0.s -o crt0.o 15 | 16 | clean: 17 | rm $(LIBOBJECTS) libnlib.a crt0.o 18 | -------------------------------------------------------------------------------- /include/apps/madmedia.h: -------------------------------------------------------------------------------- 1 | 2 | typedef struct 3 | { 4 | char ext[5]; // extention 5 | char discription[50]; // discription length 50 6 | unsigned long type; // types 7 | char shortname[14]; // short name 8 | } 9 | file_type_t; 10 | 11 | 12 | 13 | 14 | #define FILE_TYPE_UNKNOWN 0x0 15 | #define FILE_TYPE_TEST 0x1 16 | #define FILE_TYPE_SYSTEM 0x2 17 | #define FILE_TYPE_IMAGE 0x3 18 | #define FILE_TYPE_SOUND 0x4 19 | #define FILE_TYPE_TEXT 0x5 20 | #define FILE_TYPE_ALL 0xFF 21 | 22 | 23 | 24 | extern const file_type_t file_types[]; 25 | 26 | 27 | int mediamain ( ); 28 | -------------------------------------------------------------------------------- /Attic/nlib/src/lights.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | /** 6 | * Switch LEDs on front 7 | * 8 | * In: 0 Leds off 9 | * 1 LCD leds on 10 | * 2 KEY leds on 11 | * 3 KEY and LCD leds on 12 | */ 13 | void 14 | IO_setLights ( int state ) 15 | { 16 | /* 17 | * Set display led state 18 | */ 19 | IO_setBit ( IO_CTRL3, CTRL3_DISPLAYLEDS, state & 1 ); 20 | /* 21 | * Enable key leds as Output 22 | */ 23 | IO_setBit ( IO_GENIO_RW, 0x08, 1 ); 24 | /* 25 | * Set key led state 26 | */ 27 | IO_setBit ( IO_GENIO_D, 0x08, state & 2 ); 28 | } 29 | -------------------------------------------------------------------------------- /Attic/nlib/script/dsp_fromhex.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | import struct 3 | import sys 4 | name = sys.argv[1] 5 | 6 | file = open(name+".hex","r") 7 | 8 | line = "" 9 | 10 | while 1: 11 | x = file.readline() 12 | if not x: 13 | break 14 | x = x[0:-1] 15 | line += x 16 | file.close() 17 | 18 | ptr = 0 19 | packed = "" 20 | while 1: 21 | try: 22 | xpos = line.index('x', ptr) 23 | except ValueError: 24 | break 25 | try: 26 | comma = line.index(',', ptr) 27 | except ValueError: 28 | comma = len(line) 29 | x = int(line[xpos+1:comma], 16) 30 | packed += struct.pack(": 7 | f00: 7706 stm #0,st0 8 | f01: 0000 9 | f02: 7707 stm #26880,st1 10 | f03: 6900 11 | f04: 771d stm #-88,pmst 12 | f05: ffa8 13 | f06: 7718 stm #121,sp 14 | f07: 0079 15 | f08: 7728 stm #8192,swwsr 16 | f09: 2000 17 | f0a: 7758 stm #12614,clkmd 18 | f0b: 3146 19 | f0c: f070 rpt #60000 20 | f0d: ea60 21 | f0e: f495 nop 22 | f0f: 7712 stm #2048,ar2 23 | f10: 0800 24 | f11: 7713 stm #2049,ar3 25 | f12: 0801 26 | f13: e501 mvdd *ar2,*ar3 27 | f14: f7bd ssbx st1,xf 28 | f15: f6bd rsbx st1,xf 29 | f16: f073 b 0xf14 30 | f17: 0f14 31 | -------------------------------------------------------------------------------- /data/2100/memmap: -------------------------------------------------------------------------------- 1 | OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") 2 | OUTPUT_ARCH(arm) 3 | ENTRY(_start) 4 | 5 | 6 | MEMORY 7 | { 8 | rom(RX) : ORIGIN = 0x00200000, LENGTH = 2048K 9 | ram(RWXAIL) : ORIGIN = 0x00100040, LENGTH = 127K 10 | } 11 | 12 | SECTIONS 13 | { 14 | ROM : { crt0.o } > rom 15 | .text : 16 | { 17 | *(.text) 18 | } 19 | .rodata : 20 | { 21 | *(.rodata.*) 22 | } 23 | .data : 24 | AT ( ADDR(.text) + SIZEOF( .text ) + SIZEOF( .rodata ) ) 25 | { 26 | _sdata = ADDR(.text) + SIZEOF( .text ) + SIZEOF( .rodata ); 27 | PROVIDE (_sdata = .); 28 | *(.data) 29 | *(.data.*) 30 | *(.gnu.linkonce.*) 31 | SORT(CONSTRUCTORS) 32 | } > ram 33 | 34 | } 35 | 36 | 37 | -------------------------------------------------------------------------------- /data/3350/memmap: -------------------------------------------------------------------------------- 1 | OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") 2 | OUTPUT_ARCH(arm) 3 | ENTRY(_start) 4 | 5 | 6 | MEMORY 7 | { 8 | rom(RX) : ORIGIN = 0x00200000, LENGTH = 2048K 9 | ram(RWXAIL) : ORIGIN = 0x00100040, LENGTH = 127K 10 | } 11 | 12 | SECTIONS 13 | { 14 | ROM : { crt0.o } > rom 15 | .text : 16 | { 17 | *(.text) 18 | } 19 | .rodata : 20 | { 21 | *(.rodata.*) 22 | } 23 | .data : 24 | AT ( ADDR(.text) + SIZEOF( .text ) + SIZEOF( .rodata ) ) 25 | { 26 | _sdata = ADDR(.text) + SIZEOF( .text ) + SIZEOF( .rodata ); 27 | PROVIDE (_sdata = .); 28 | *(.data) 29 | *(.data.*) 30 | *(.gnu.linkonce.*) 31 | SORT(CONSTRUCTORS) 32 | } > ram 33 | 34 | } 35 | 36 | 37 | -------------------------------------------------------------------------------- /data/3410/memmap: -------------------------------------------------------------------------------- 1 | OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") 2 | OUTPUT_ARCH(arm) 3 | ENTRY(_start) 4 | 5 | 6 | MEMORY 7 | { 8 | rom(RX) : ORIGIN = 0x00200000, LENGTH = 2048K 9 | ram(RWXAIL) : ORIGIN = 0x00100040, LENGTH = 127K 10 | } 11 | 12 | SECTIONS 13 | { 14 | ROM : { crt0.o } > rom 15 | .text : 16 | { 17 | *(.text) 18 | } 19 | .rodata : 20 | { 21 | *(.rodata.*) 22 | } 23 | .data : 24 | AT ( ADDR(.text) + SIZEOF( .text ) + SIZEOF( .rodata ) ) 25 | { 26 | _sdata = ADDR(.text) + SIZEOF( .text ) + SIZEOF( .rodata ); 27 | PROVIDE (_sdata = .); 28 | *(.data) 29 | *(.data.*) 30 | *(.gnu.linkonce.*) 31 | SORT(CONSTRUCTORS) 32 | } > ram 33 | 34 | } 35 | 36 | 37 | -------------------------------------------------------------------------------- /data/5110/memmap: -------------------------------------------------------------------------------- 1 | OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") 2 | OUTPUT_ARCH(arm) 3 | ENTRY(_start) 4 | 5 | 6 | MEMORY 7 | { 8 | rom(RX) : ORIGIN = 0x00200000, LENGTH = 2048K 9 | ram(RWXAIL) : ORIGIN = 0x00100040, LENGTH = 64K 10 | } 11 | 12 | SECTIONS 13 | { 14 | ROM : { crt0.o } > rom 15 | .text : 16 | { 17 | *(.text) 18 | } 19 | .rodata : 20 | { 21 | *(.rodata.*) 22 | } 23 | .data : 24 | AT ( ADDR(.text) + SIZEOF( .text ) + SIZEOF( .rodata ) ) 25 | { 26 | _sdata = ADDR(.text) + SIZEOF( .text ) + SIZEOF( .rodata ); 27 | PROVIDE (_sdata = .); 28 | *(.data) 29 | *(.data.*) 30 | *(.gnu.linkonce.*) 31 | SORT(CONSTRUCTORS) 32 | } > ram 33 | 34 | } 35 | 36 | 37 | -------------------------------------------------------------------------------- /data/6210/memmap: -------------------------------------------------------------------------------- 1 | OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") 2 | OUTPUT_ARCH(arm) 3 | ENTRY(_start) 4 | 5 | 6 | MEMORY 7 | { 8 | rom(RX) : ORIGIN = 0x00200000, LENGTH = 2048K 9 | ram(RWXAIL) : ORIGIN = 0x00100040, LENGTH = 127K 10 | } 11 | 12 | SECTIONS 13 | { 14 | ROM : { crt0.o } > rom 15 | .text : 16 | { 17 | *(.text) 18 | } 19 | .rodata : 20 | { 21 | *(.rodata.*) 22 | } 23 | .data : 24 | AT ( ADDR(.text) + SIZEOF( .text ) + SIZEOF( .rodata ) ) 25 | { 26 | _sdata = ADDR(.text) + SIZEOF( .text ) + SIZEOF( .rodata ); 27 | PROVIDE (_sdata = .); 28 | *(.data) 29 | *(.data.*) 30 | *(.gnu.linkonce.*) 31 | SORT(CONSTRUCTORS) 32 | } > ram 33 | 34 | } 35 | 36 | 37 | -------------------------------------------------------------------------------- /data/8210/memmap: -------------------------------------------------------------------------------- 1 | OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") 2 | OUTPUT_ARCH(arm) 3 | ENTRY(_start) 4 | 5 | 6 | MEMORY 7 | { 8 | rom(RX) : ORIGIN = 0x00200000, LENGTH = 2048K 9 | ram(RWXAIL) : ORIGIN = 0x00100040, LENGTH = 127K 10 | } 11 | 12 | SECTIONS 13 | { 14 | ROM : { crt0.o } > rom 15 | .text : 16 | { 17 | *(.text) 18 | } 19 | .rodata : 20 | { 21 | *(.rodata.*) 22 | } 23 | .data : 24 | AT ( ADDR(.text) + SIZEOF( .text ) + SIZEOF( .rodata ) ) 25 | { 26 | _sdata = ADDR(.text) + SIZEOF( .text ) + SIZEOF( .rodata ); 27 | PROVIDE (_sdata = .); 28 | *(.data) 29 | *(.data.*) 30 | *(.gnu.linkonce.*) 31 | SORT(CONSTRUCTORS) 32 | } > ram 33 | 34 | } 35 | 36 | 37 | -------------------------------------------------------------------------------- /data/2100/memmap_embed: -------------------------------------------------------------------------------- 1 | OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") 2 | OUTPUT_ARCH(arm) 3 | ENTRY(_start) 4 | 5 | 6 | MEMORY 7 | { 8 | rom(RX) : ORIGIN = 0x00340040, LENGTH = 200K 9 | ram(RWXAIL) : ORIGIN = 0x00100040, LENGTH = 127K 10 | } 11 | 12 | SECTIONS 13 | { 14 | ROM : { crt0.o } > rom 15 | .text : 16 | { 17 | *(.text) 18 | } 19 | .rodata : 20 | { 21 | *(.rodata.*) 22 | } 23 | .data : 24 | AT ( ADDR(.text) + SIZEOF( .text ) + SIZEOF( .rodata ) ) 25 | { 26 | _sdata = ADDR(.text) + SIZEOF( .text ) + SIZEOF( .rodata ); 27 | PROVIDE (_sdata = .); 28 | *(.data) 29 | *(.data.*) 30 | *(.gnu.linkonce.*) 31 | SORT(CONSTRUCTORS) 32 | } > ram 33 | 34 | } 35 | 36 | 37 | -------------------------------------------------------------------------------- /data/3310_new/memmap: -------------------------------------------------------------------------------- 1 | OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") 2 | OUTPUT_ARCH(arm) 3 | ENTRY(_start) 4 | 5 | 6 | MEMORY 7 | { 8 | rom(RX) : ORIGIN = 0x00200000, LENGTH = 2048K 9 | ram(RWXAIL) : ORIGIN = 0x00100040, LENGTH = 127K 10 | } 11 | 12 | SECTIONS 13 | { 14 | ROM : { crt0.o } > rom 15 | .text : 16 | { 17 | *(.text) 18 | } 19 | .rodata : 20 | { 21 | *(.rodata.*) 22 | } 23 | .data : 24 | AT ( ADDR(.text) + SIZEOF( .text ) + SIZEOF( .rodata ) ) 25 | { 26 | _sdata = ADDR(.text) + SIZEOF( .text ) + SIZEOF( .rodata ); 27 | PROVIDE (_sdata = .); 28 | *(.data) 29 | *(.data.*) 30 | *(.gnu.linkonce.*) 31 | SORT(CONSTRUCTORS) 32 | } > ram 33 | 34 | } 35 | 36 | 37 | -------------------------------------------------------------------------------- /data/3310_old/memmap: -------------------------------------------------------------------------------- 1 | OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") 2 | OUTPUT_ARCH(arm) 3 | ENTRY(_start) 4 | 5 | 6 | MEMORY 7 | { 8 | rom(RX) : ORIGIN = 0x00200000, LENGTH = 2048K 9 | ram(RWXAIL) : ORIGIN = 0x00100040, LENGTH = 127K 10 | } 11 | 12 | SECTIONS 13 | { 14 | ROM : { crt0.o } > rom 15 | .text : 16 | { 17 | *(.text) 18 | } 19 | .rodata : 20 | { 21 | *(.rodata.*) 22 | } 23 | .data : 24 | AT ( ADDR(.text) + SIZEOF( .text ) + SIZEOF( .rodata ) ) 25 | { 26 | _sdata = ADDR(.text) + SIZEOF( .text ) + SIZEOF( .rodata ); 27 | PROVIDE (_sdata = .); 28 | *(.data) 29 | *(.data.*) 30 | *(.gnu.linkonce.*) 31 | SORT(CONSTRUCTORS) 32 | } > ram 33 | 34 | } 35 | 36 | 37 | -------------------------------------------------------------------------------- /data/3330_new/memmap: -------------------------------------------------------------------------------- 1 | OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") 2 | OUTPUT_ARCH(arm) 3 | ENTRY(_start) 4 | 5 | 6 | MEMORY 7 | { 8 | rom(RX) : ORIGIN = 0x00200000, LENGTH = 2048K 9 | ram(RWXAIL) : ORIGIN = 0x00100040, LENGTH = 127K 10 | } 11 | 12 | SECTIONS 13 | { 14 | ROM : { crt0.o } > rom 15 | .text : 16 | { 17 | *(.text) 18 | } 19 | .rodata : 20 | { 21 | *(.rodata.*) 22 | } 23 | .data : 24 | AT ( ADDR(.text) + SIZEOF( .text ) + SIZEOF( .rodata ) ) 25 | { 26 | _sdata = ADDR(.text) + SIZEOF( .text ) + SIZEOF( .rodata ); 27 | PROVIDE (_sdata = .); 28 | *(.data) 29 | *(.data.*) 30 | *(.gnu.linkonce.*) 31 | SORT(CONSTRUCTORS) 32 | } > ram 33 | 34 | } 35 | 36 | 37 | -------------------------------------------------------------------------------- /data/3330_old/memmap: -------------------------------------------------------------------------------- 1 | OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") 2 | OUTPUT_ARCH(arm) 3 | ENTRY(_start) 4 | 5 | 6 | MEMORY 7 | { 8 | rom(RX) : ORIGIN = 0x00200000, LENGTH = 2048K 9 | ram(RWXAIL) : ORIGIN = 0x00100040, LENGTH = 127K 10 | } 11 | 12 | SECTIONS 13 | { 14 | ROM : { crt0.o } > rom 15 | .text : 16 | { 17 | *(.text) 18 | } 19 | .rodata : 20 | { 21 | *(.rodata.*) 22 | } 23 | .data : 24 | AT ( ADDR(.text) + SIZEOF( .text ) + SIZEOF( .rodata ) ) 25 | { 26 | _sdata = ADDR(.text) + SIZEOF( .text ) + SIZEOF( .rodata ); 27 | PROVIDE (_sdata = .); 28 | *(.data) 29 | *(.data.*) 30 | *(.gnu.linkonce.*) 31 | SORT(CONSTRUCTORS) 32 | } > ram 33 | 34 | } 35 | 36 | 37 | -------------------------------------------------------------------------------- /data/3350/memmap_embed: -------------------------------------------------------------------------------- 1 | OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") 2 | OUTPUT_ARCH(arm) 3 | ENTRY(_start) 4 | 5 | 6 | MEMORY 7 | { 8 | rom(RX) : ORIGIN = 0x00340040, LENGTH = 200K 9 | ram(RWXAIL) : ORIGIN = 0x00100040, LENGTH = 127K 10 | } 11 | 12 | SECTIONS 13 | { 14 | ROM : { crt0.o } > rom 15 | .text : 16 | { 17 | *(.text) 18 | } 19 | .rodata : 20 | { 21 | *(.rodata.*) 22 | } 23 | .data : 24 | AT ( ADDR(.text) + SIZEOF( .text ) + SIZEOF( .rodata ) ) 25 | { 26 | _sdata = ADDR(.text) + SIZEOF( .text ) + SIZEOF( .rodata ); 27 | PROVIDE (_sdata = .); 28 | *(.data) 29 | *(.data.*) 30 | *(.gnu.linkonce.*) 31 | SORT(CONSTRUCTORS) 32 | } > ram 33 | 34 | } 35 | 36 | 37 | -------------------------------------------------------------------------------- /data/3410/memmap_embed: -------------------------------------------------------------------------------- 1 | OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") 2 | OUTPUT_ARCH(arm) 3 | ENTRY(_start) 4 | 5 | 6 | MEMORY 7 | { 8 | rom(RX) : ORIGIN = 0x00340040, LENGTH = 200K 9 | ram(RWXAIL) : ORIGIN = 0x00100040, LENGTH = 127K 10 | } 11 | 12 | SECTIONS 13 | { 14 | ROM : { crt0.o } > rom 15 | .text : 16 | { 17 | *(.text) 18 | } 19 | .rodata : 20 | { 21 | *(.rodata.*) 22 | } 23 | .data : 24 | AT ( ADDR(.text) + SIZEOF( .text ) + SIZEOF( .rodata ) ) 25 | { 26 | _sdata = ADDR(.text) + SIZEOF( .text ) + SIZEOF( .rodata ); 27 | PROVIDE (_sdata = .); 28 | *(.data) 29 | *(.data.*) 30 | *(.gnu.linkonce.*) 31 | SORT(CONSTRUCTORS) 32 | } > ram 33 | 34 | } 35 | 36 | 37 | -------------------------------------------------------------------------------- /data/5110/memmap_embed: -------------------------------------------------------------------------------- 1 | OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") 2 | OUTPUT_ARCH(arm) 3 | ENTRY(_start) 4 | 5 | 6 | MEMORY 7 | { 8 | rom(RX) : ORIGIN = 0x00340040, LENGTH = 200K 9 | ram(RWXAIL) : ORIGIN = 0x00100040, LENGTH = 127K 10 | } 11 | 12 | SECTIONS 13 | { 14 | ROM : { crt0.o } > rom 15 | .text : 16 | { 17 | *(.text) 18 | } 19 | .rodata : 20 | { 21 | *(.rodata.*) 22 | } 23 | .data : 24 | AT ( ADDR(.text) + SIZEOF( .text ) + SIZEOF( .rodata ) ) 25 | { 26 | _sdata = ADDR(.text) + SIZEOF( .text ) + SIZEOF( .rodata ); 27 | PROVIDE (_sdata = .); 28 | *(.data) 29 | *(.data.*) 30 | *(.gnu.linkonce.*) 31 | SORT(CONSTRUCTORS) 32 | } > ram 33 | 34 | } 35 | 36 | 37 | -------------------------------------------------------------------------------- /data/6210/memmap_embed: -------------------------------------------------------------------------------- 1 | OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") 2 | OUTPUT_ARCH(arm) 3 | ENTRY(_start) 4 | 5 | 6 | MEMORY 7 | { 8 | rom(RX) : ORIGIN = 0x00340040, LENGTH = 200K 9 | ram(RWXAIL) : ORIGIN = 0x00100040, LENGTH = 127K 10 | } 11 | 12 | SECTIONS 13 | { 14 | ROM : { crt0.o } > rom 15 | .text : 16 | { 17 | *(.text) 18 | } 19 | .rodata : 20 | { 21 | *(.rodata.*) 22 | } 23 | .data : 24 | AT ( ADDR(.text) + SIZEOF( .text ) + SIZEOF( .rodata ) ) 25 | { 26 | _sdata = ADDR(.text) + SIZEOF( .text ) + SIZEOF( .rodata ); 27 | PROVIDE (_sdata = .); 28 | *(.data) 29 | *(.data.*) 30 | *(.gnu.linkonce.*) 31 | SORT(CONSTRUCTORS) 32 | } > ram 33 | 34 | } 35 | 36 | 37 | -------------------------------------------------------------------------------- /data/8210/memmap_embed: -------------------------------------------------------------------------------- 1 | OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") 2 | OUTPUT_ARCH(arm) 3 | ENTRY(_start) 4 | 5 | 6 | MEMORY 7 | { 8 | rom(RX) : ORIGIN = 0x00340040, LENGTH = 449K 9 | ram(RWXAIL) : ORIGIN = 0x00100040, LENGTH = 127K 10 | } 11 | 12 | SECTIONS 13 | { 14 | ROM : { crt0.o } > rom 15 | .text : 16 | { 17 | *(.text) 18 | } 19 | .rodata : 20 | { 21 | *(.rodata.*) 22 | } 23 | .data : 24 | AT ( ADDR(.text) + SIZEOF( .text ) + SIZEOF( .rodata ) ) 25 | { 26 | _sdata = ADDR(.text) + SIZEOF( .text ) + SIZEOF( .rodata ); 27 | PROVIDE (_sdata = .); 28 | *(.data) 29 | *(.data.*) 30 | *(.gnu.linkonce.*) 31 | SORT(CONSTRUCTORS) 32 | } > ram 33 | 34 | } 35 | 36 | 37 | -------------------------------------------------------------------------------- /data/3310_new/memmap_embed: -------------------------------------------------------------------------------- 1 | OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") 2 | OUTPUT_ARCH(arm) 3 | ENTRY(_start) 4 | 5 | 6 | MEMORY 7 | { 8 | rom(RX) : ORIGIN = 0x00340040, LENGTH = 200K 9 | ram(RWXAIL) : ORIGIN = 0x00100040, LENGTH = 127K 10 | } 11 | 12 | SECTIONS 13 | { 14 | ROM : { crt0.o } > rom 15 | .text : 16 | { 17 | *(.text) 18 | } 19 | .rodata : 20 | { 21 | *(.rodata.*) 22 | } 23 | .data : 24 | AT ( ADDR(.text) + SIZEOF( .text ) + SIZEOF( .rodata ) ) 25 | { 26 | _sdata = ADDR(.text) + SIZEOF( .text ) + SIZEOF( .rodata ); 27 | PROVIDE (_sdata = .); 28 | *(.data) 29 | *(.data.*) 30 | *(.gnu.linkonce.*) 31 | SORT(CONSTRUCTORS) 32 | } > ram 33 | 34 | } 35 | 36 | 37 | -------------------------------------------------------------------------------- /data/3310_old/memmap_embed: -------------------------------------------------------------------------------- 1 | OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") 2 | OUTPUT_ARCH(arm) 3 | ENTRY(_start) 4 | 5 | 6 | MEMORY 7 | { 8 | rom(RX) : ORIGIN = 0x00340040, LENGTH = 200K 9 | ram(RWXAIL) : ORIGIN = 0x00100040, LENGTH = 127K 10 | } 11 | 12 | SECTIONS 13 | { 14 | ROM : { crt0.o } > rom 15 | .text : 16 | { 17 | *(.text) 18 | } 19 | .rodata : 20 | { 21 | *(.rodata.*) 22 | } 23 | .data : 24 | AT ( ADDR(.text) + SIZEOF( .text ) + SIZEOF( .rodata ) ) 25 | { 26 | _sdata = ADDR(.text) + SIZEOF( .text ) + SIZEOF( .rodata ); 27 | PROVIDE (_sdata = .); 28 | *(.data) 29 | *(.data.*) 30 | *(.gnu.linkonce.*) 31 | SORT(CONSTRUCTORS) 32 | } > ram 33 | 34 | } 35 | 36 | 37 | -------------------------------------------------------------------------------- /data/3330_new/memmap_embed: -------------------------------------------------------------------------------- 1 | OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") 2 | OUTPUT_ARCH(arm) 3 | ENTRY(_start) 4 | 5 | 6 | MEMORY 7 | { 8 | rom(RX) : ORIGIN = 0x00340040, LENGTH = 200K 9 | ram(RWXAIL) : ORIGIN = 0x00100040, LENGTH = 127K 10 | } 11 | 12 | SECTIONS 13 | { 14 | ROM : { crt0.o } > rom 15 | .text : 16 | { 17 | *(.text) 18 | } 19 | .rodata : 20 | { 21 | *(.rodata.*) 22 | } 23 | .data : 24 | AT ( ADDR(.text) + SIZEOF( .text ) + SIZEOF( .rodata ) ) 25 | { 26 | _sdata = ADDR(.text) + SIZEOF( .text ) + SIZEOF( .rodata ); 27 | PROVIDE (_sdata = .); 28 | *(.data) 29 | *(.data.*) 30 | *(.gnu.linkonce.*) 31 | SORT(CONSTRUCTORS) 32 | } > ram 33 | 34 | } 35 | 36 | 37 | -------------------------------------------------------------------------------- /data/3330_old/memmap_embed: -------------------------------------------------------------------------------- 1 | OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") 2 | OUTPUT_ARCH(arm) 3 | ENTRY(_start) 4 | 5 | 6 | MEMORY 7 | { 8 | rom(RX) : ORIGIN = 0x00340040, LENGTH = 200K 9 | ram(RWXAIL) : ORIGIN = 0x00100040, LENGTH = 127K 10 | } 11 | 12 | SECTIONS 13 | { 14 | ROM : { crt0.o } > rom 15 | .text : 16 | { 17 | *(.text) 18 | } 19 | .rodata : 20 | { 21 | *(.rodata.*) 22 | } 23 | .data : 24 | AT ( ADDR(.text) + SIZEOF( .text ) + SIZEOF( .rodata ) ) 25 | { 26 | _sdata = ADDR(.text) + SIZEOF( .text ) + SIZEOF( .rodata ); 27 | PROVIDE (_sdata = .); 28 | *(.data) 29 | *(.data.*) 30 | *(.gnu.linkonce.*) 31 | SORT(CONSTRUCTORS) 32 | } > ram 33 | 34 | } 35 | 36 | 37 | -------------------------------------------------------------------------------- /Attic/nlib/dspsrc/dspx.dis: -------------------------------------------------------------------------------- 1 | 2 | g3gg0/nokia/dspx.bin: file format binary 3 | 4 | Disassembly of section .data: 5 | 6 | 00000f00 <.data>: 7 | f00: 7706 stm #0,st0 8 | f01: 0000 9 | f02: 7707 stm #26880,st1 10 | f03: 6900 11 | f04: 771d stm #-88,pmst 12 | f05: ffa8 13 | f06: 7718 stm #121,sp 14 | f07: 0079 15 | f08: 7728 stm #8192,swwsr 16 | f09: 2000 17 | f0a: 7758 stm #12614,clkmd 18 | f0b: 3146 19 | f0c: f070 rpt #60000 20 | f0d: ea60 21 | f0e: f495 nop 22 | f0f: 7713 stm #-256,ar3 23 | f10: ff00 24 | f11: 7712 stm #2048,ar2 25 | f12: 0800 26 | f13: ecff rpt #255 27 | f14: e598 mvdd *ar3+,*ar2+ 28 | f15: f7bd ssbx st1,xf 29 | f16: f6bd rsbx st1,xf 30 | f17: f073 b 0xf15 31 | f18: 0f15 32 | -------------------------------------------------------------------------------- /Attic/nlib/src/ptimer.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | /** 6 | * 0 programmable timer 7 | * 1 sleep timer 8 | */ 9 | int 10 | IO_getTimestamp ( int type ) 11 | { 12 | int time1, time2; 13 | int port; 14 | if ( type == 0 ) 15 | port = IO_TIMESTAMP; 16 | else 17 | port = 0x4; 18 | do 19 | { 20 | time1 = ioreadw ( port ); 21 | time2 = ioreadw ( port ); 22 | } 23 | while ( time1 != time2 ); 24 | return time1; 25 | } 26 | 27 | void 28 | IO_delay ( int wait ) 29 | { 30 | int begin = IO_getTimestamp ( 0 ); 31 | int diff; 32 | do 33 | { 34 | diff = ( IO_getTimestamp ( 0 ) - begin ) & 0xFFFF; 35 | } 36 | while ( diff < wait ); 37 | } 38 | -------------------------------------------------------------------------------- /include/hw/phoneinfo.h: -------------------------------------------------------------------------------- 1 | 2 | #define NOKIA3310OLD 0 3 | #define NOKIA3310NEW 1 4 | #define NOKIA3330OLD 2 5 | #define NOKIA3330NEW 3 6 | #define NOKIA8210 4 7 | #define NOKIA3410 5 8 | #define NOKIA3350 6 9 | #define NOKIA6210 7 10 | #define NOKIA2100 8 11 | #define NOKIA5110 9 12 | 13 | typedef struct 14 | { 15 | char *name; 16 | unsigned char genio; 17 | unsigned char kpd; 18 | unsigned char kpd_matrix; 19 | unsigned char kpd_led; 20 | unsigned char led; 21 | unsigned char lcd; 22 | unsigned char lcd_xsize; 23 | unsigned char lcd_ysize; 24 | unsigned char lcd_contrast; 25 | unsigned char flashvpp; 26 | } 27 | phone_info_t; 28 | 29 | #ifndef __MADOS_MAIN_C__ 30 | extern const phone_info_t mados_info[]; 31 | extern unsigned char mados_phone; 32 | #endif 33 | -------------------------------------------------------------------------------- /Attic/nlib/src/dspblocks.c: -------------------------------------------------------------------------------- 1 | /** 2 | * DSP code blocks 3 | * wumpus 2003 4 | */ 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | #include "dspblocks/block00.h" 11 | #include "dspblocks/block01.h" 12 | #include "dspblocks/block14.h" 13 | 14 | /** 15 | * Get codeblock by ID 16 | * @param n 17 | * Codeblock ID 18 | * 0x00 = Initialisation 19 | * 0x01 = MDI setup 20 | * 0x14 = Secondary initialisation 21 | */ 22 | struct dsp_codeblock * 23 | DSP_getCodeBlock ( int n ) 24 | { 25 | switch ( n ) 26 | { 27 | case 0x00: 28 | return &block00; 29 | case 0x01: 30 | return &block01; 31 | case 0x14: 32 | return &block14; 33 | } 34 | return 0; 35 | } 36 | -------------------------------------------------------------------------------- /data/2100/memmap_loader: -------------------------------------------------------------------------------- 1 | OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") 2 | OUTPUT_ARCH(arm) 3 | ENTRY(_start) 4 | 5 | 6 | MEMORY 7 | { 8 | boot(RX) : ORIGIN = 0x00100000, LENGTH = 64K 9 | ram(RWXAIL) : ORIGIN = 0x00110000, LENGTH = 60K 10 | } 11 | 12 | SECTIONS 13 | { 14 | ROM : 15 | { 16 | crt0.o 17 | } > boot 18 | .text : 19 | { 20 | *(.text) 21 | } > boot 22 | .rodata : 23 | { 24 | *(.rodata.*) 25 | } > boot 26 | .data : 27 | AT ( ADDR(.text) + SIZEOF( .text ) + SIZEOF( .rodata ) ) 28 | { 29 | _sdata = ADDR(.text) + SIZEOF( .text ) + SIZEOF( .rodata ); 30 | PROVIDE (_sdata = .); 31 | *(.data) 32 | *(.data.*) 33 | *(.gnu.linkonce.*) 34 | SORT(CONSTRUCTORS) 35 | } > ram 36 | 37 | } 38 | 39 | 40 | -------------------------------------------------------------------------------- /data/3350/memmap_loader: -------------------------------------------------------------------------------- 1 | OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") 2 | OUTPUT_ARCH(arm) 3 | ENTRY(_start) 4 | 5 | 6 | MEMORY 7 | { 8 | boot(RX) : ORIGIN = 0x00100000, LENGTH = 64K 9 | ram(RWXAIL) : ORIGIN = 0x00110000, LENGTH = 60K 10 | } 11 | 12 | SECTIONS 13 | { 14 | ROM : 15 | { 16 | crt0.o 17 | } > boot 18 | .text : 19 | { 20 | *(.text) 21 | } > boot 22 | .rodata : 23 | { 24 | *(.rodata.*) 25 | } > boot 26 | .data : 27 | AT ( ADDR(.text) + SIZEOF( .text ) + SIZEOF( .rodata ) ) 28 | { 29 | _sdata = ADDR(.text) + SIZEOF( .text ) + SIZEOF( .rodata ); 30 | PROVIDE (_sdata = .); 31 | *(.data) 32 | *(.data.*) 33 | *(.gnu.linkonce.*) 34 | SORT(CONSTRUCTORS) 35 | } > ram 36 | 37 | } 38 | 39 | 40 | -------------------------------------------------------------------------------- /data/3410/memmap_loader: -------------------------------------------------------------------------------- 1 | OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") 2 | OUTPUT_ARCH(arm) 3 | ENTRY(_start) 4 | 5 | 6 | MEMORY 7 | { 8 | boot(RX) : ORIGIN = 0x00100000, LENGTH = 64K 9 | ram(RWXAIL) : ORIGIN = 0x00110000, LENGTH = 60K 10 | } 11 | 12 | SECTIONS 13 | { 14 | ROM : 15 | { 16 | crt0.o 17 | } > boot 18 | .text : 19 | { 20 | *(.text) 21 | } > boot 22 | .rodata : 23 | { 24 | *(.rodata.*) 25 | } > boot 26 | .data : 27 | AT ( ADDR(.text) + SIZEOF( .text ) + SIZEOF( .rodata ) ) 28 | { 29 | _sdata = ADDR(.text) + SIZEOF( .text ) + SIZEOF( .rodata ); 30 | PROVIDE (_sdata = .); 31 | *(.data) 32 | *(.data.*) 33 | *(.gnu.linkonce.*) 34 | SORT(CONSTRUCTORS) 35 | } > ram 36 | 37 | } 38 | 39 | 40 | -------------------------------------------------------------------------------- /data/5110/memmap_loader: -------------------------------------------------------------------------------- 1 | OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") 2 | OUTPUT_ARCH(arm) 3 | ENTRY(_start) 4 | 5 | 6 | MEMORY 7 | { 8 | boot(RX) : ORIGIN = 0x00100000, LENGTH = 64K 9 | ram(RWXAIL) : ORIGIN = 0x00110000, LENGTH = 60K 10 | } 11 | 12 | SECTIONS 13 | { 14 | ROM : 15 | { 16 | crt0.o 17 | } > boot 18 | .text : 19 | { 20 | *(.text) 21 | } > boot 22 | .rodata : 23 | { 24 | *(.rodata.*) 25 | } > boot 26 | .data : 27 | AT ( ADDR(.text) + SIZEOF( .text ) + SIZEOF( .rodata ) ) 28 | { 29 | _sdata = ADDR(.text) + SIZEOF( .text ) + SIZEOF( .rodata ); 30 | PROVIDE (_sdata = .); 31 | *(.data) 32 | *(.data.*) 33 | *(.gnu.linkonce.*) 34 | SORT(CONSTRUCTORS) 35 | } > ram 36 | 37 | } 38 | 39 | 40 | -------------------------------------------------------------------------------- /data/6210/memmap_loader: -------------------------------------------------------------------------------- 1 | OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") 2 | OUTPUT_ARCH(arm) 3 | ENTRY(_start) 4 | 5 | 6 | MEMORY 7 | { 8 | boot(RX) : ORIGIN = 0x00100000, LENGTH = 64K 9 | ram(RWXAIL) : ORIGIN = 0x00110000, LENGTH = 60K 10 | } 11 | 12 | SECTIONS 13 | { 14 | ROM : 15 | { 16 | crt0.o 17 | } > boot 18 | .text : 19 | { 20 | *(.text) 21 | } > boot 22 | .rodata : 23 | { 24 | *(.rodata.*) 25 | } > boot 26 | .data : 27 | AT ( ADDR(.text) + SIZEOF( .text ) + SIZEOF( .rodata ) ) 28 | { 29 | _sdata = ADDR(.text) + SIZEOF( .text ) + SIZEOF( .rodata ); 30 | PROVIDE (_sdata = .); 31 | *(.data) 32 | *(.data.*) 33 | *(.gnu.linkonce.*) 34 | SORT(CONSTRUCTORS) 35 | } > ram 36 | 37 | } 38 | 39 | 40 | -------------------------------------------------------------------------------- /data/8210/memmap_loader: -------------------------------------------------------------------------------- 1 | OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") 2 | OUTPUT_ARCH(arm) 3 | ENTRY(_start) 4 | 5 | 6 | MEMORY 7 | { 8 | boot(RX) : ORIGIN = 0x00100000, LENGTH = 64K 9 | ram(RWXAIL) : ORIGIN = 0x00110000, LENGTH = 60K 10 | } 11 | 12 | SECTIONS 13 | { 14 | ROM : 15 | { 16 | crt0.o 17 | } > boot 18 | .text : 19 | { 20 | *(.text) 21 | } > boot 22 | .rodata : 23 | { 24 | *(.rodata.*) 25 | } > boot 26 | .data : 27 | AT ( ADDR(.text) + SIZEOF( .text ) + SIZEOF( .rodata ) ) 28 | { 29 | _sdata = ADDR(.text) + SIZEOF( .text ) + SIZEOF( .rodata ); 30 | PROVIDE (_sdata = .); 31 | *(.data) 32 | *(.data.*) 33 | *(.gnu.linkonce.*) 34 | SORT(CONSTRUCTORS) 35 | } > ram 36 | 37 | } 38 | 39 | 40 | -------------------------------------------------------------------------------- /data/3310_new/memmap_loader: -------------------------------------------------------------------------------- 1 | OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") 2 | OUTPUT_ARCH(arm) 3 | ENTRY(_start) 4 | 5 | 6 | MEMORY 7 | { 8 | boot(RX) : ORIGIN = 0x00100000, LENGTH = 64K 9 | ram(RWXAIL) : ORIGIN = 0x00110000, LENGTH = 60K 10 | } 11 | 12 | SECTIONS 13 | { 14 | ROM : 15 | { 16 | crt0.o 17 | } > boot 18 | .text : 19 | { 20 | *(.text) 21 | } > boot 22 | .rodata : 23 | { 24 | *(.rodata.*) 25 | } > boot 26 | .data : 27 | AT ( ADDR(.text) + SIZEOF( .text ) + SIZEOF( .rodata ) ) 28 | { 29 | _sdata = ADDR(.text) + SIZEOF( .text ) + SIZEOF( .rodata ); 30 | PROVIDE (_sdata = .); 31 | *(.data) 32 | *(.data.*) 33 | *(.gnu.linkonce.*) 34 | SORT(CONSTRUCTORS) 35 | } > ram 36 | 37 | } 38 | 39 | 40 | -------------------------------------------------------------------------------- /data/3310_old/memmap_loader: -------------------------------------------------------------------------------- 1 | OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") 2 | OUTPUT_ARCH(arm) 3 | ENTRY(_start) 4 | 5 | 6 | MEMORY 7 | { 8 | boot(RX) : ORIGIN = 0x00100000, LENGTH = 64K 9 | ram(RWXAIL) : ORIGIN = 0x00110000, LENGTH = 60K 10 | } 11 | 12 | SECTIONS 13 | { 14 | ROM : 15 | { 16 | crt0.o 17 | } > boot 18 | .text : 19 | { 20 | *(.text) 21 | } > boot 22 | .rodata : 23 | { 24 | *(.rodata.*) 25 | } > boot 26 | .data : 27 | AT ( ADDR(.text) + SIZEOF( .text ) + SIZEOF( .rodata ) ) 28 | { 29 | _sdata = ADDR(.text) + SIZEOF( .text ) + SIZEOF( .rodata ); 30 | PROVIDE (_sdata = .); 31 | *(.data) 32 | *(.data.*) 33 | *(.gnu.linkonce.*) 34 | SORT(CONSTRUCTORS) 35 | } > ram 36 | 37 | } 38 | 39 | 40 | -------------------------------------------------------------------------------- /data/3330_new/memmap_loader: -------------------------------------------------------------------------------- 1 | OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") 2 | OUTPUT_ARCH(arm) 3 | ENTRY(_start) 4 | 5 | 6 | MEMORY 7 | { 8 | boot(RX) : ORIGIN = 0x00100000, LENGTH = 64K 9 | ram(RWXAIL) : ORIGIN = 0x00110000, LENGTH = 60K 10 | } 11 | 12 | SECTIONS 13 | { 14 | ROM : 15 | { 16 | crt0.o 17 | } > boot 18 | .text : 19 | { 20 | *(.text) 21 | } > boot 22 | .rodata : 23 | { 24 | *(.rodata.*) 25 | } > boot 26 | .data : 27 | AT ( ADDR(.text) + SIZEOF( .text ) + SIZEOF( .rodata ) ) 28 | { 29 | _sdata = ADDR(.text) + SIZEOF( .text ) + SIZEOF( .rodata ); 30 | PROVIDE (_sdata = .); 31 | *(.data) 32 | *(.data.*) 33 | *(.gnu.linkonce.*) 34 | SORT(CONSTRUCTORS) 35 | } > ram 36 | 37 | } 38 | 39 | 40 | -------------------------------------------------------------------------------- /data/3330_old/memmap_loader: -------------------------------------------------------------------------------- 1 | OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") 2 | OUTPUT_ARCH(arm) 3 | ENTRY(_start) 4 | 5 | 6 | MEMORY 7 | { 8 | boot(RX) : ORIGIN = 0x00100000, LENGTH = 64K 9 | ram(RWXAIL) : ORIGIN = 0x00110000, LENGTH = 60K 10 | } 11 | 12 | SECTIONS 13 | { 14 | ROM : 15 | { 16 | crt0.o 17 | } > boot 18 | .text : 19 | { 20 | *(.text) 21 | } > boot 22 | .rodata : 23 | { 24 | *(.rodata.*) 25 | } > boot 26 | .data : 27 | AT ( ADDR(.text) + SIZEOF( .text ) + SIZEOF( .rodata ) ) 28 | { 29 | _sdata = ADDR(.text) + SIZEOF( .text ) + SIZEOF( .rodata ); 30 | PROVIDE (_sdata = .); 31 | *(.data) 32 | *(.data.*) 33 | *(.gnu.linkonce.*) 34 | SORT(CONSTRUCTORS) 35 | } > ram 36 | 37 | } 38 | 39 | 40 | -------------------------------------------------------------------------------- /Attic/nlib/include/nlib/interrupt.h: -------------------------------------------------------------------------------- 1 | #ifndef WMX_INTERRUPT 2 | #define WMX_INTERRUPT 3 | 4 | typedef void ( *inthandler ) ( ); /* Interrupt handler type */ 5 | 6 | #define FIQ_COUNT 9 7 | #define IRQ_COUNT 9 8 | 9 | /* Constants for "type" */ 10 | #define FIQ 0x00 11 | #define IRQ 0x40 12 | 13 | /* Interrupt IDs */ 14 | #define IRQ_KEYBOARD (IRQ|0) 15 | #define IRQ_CCONTINT (IRQ|2) 16 | #define IRQ_SLEEP (IRQ|3) 17 | #define IRQ_DSP (IRQ|4) 18 | 19 | #define FIQ_MDIRCV (FIQ|0) 20 | #define FIQ_MDISND (FIQ|1) 21 | #define FIQ_MBUSRX (FIQ|2) 22 | #define FIQ_MBUSTIM (FIQ|3) /* triggers 423.1 times per second */ 23 | #define FIQ_PTIMER (FIQ|4) 24 | #define FIQ_SIMCARDDETX (FIQ|7) 25 | 26 | void IO_globalInterruptEnable ( int mode ); 27 | void IO_setInterruptHandler ( uint num, inthandler handler ); 28 | void IO_setInterruptEnable ( uint num, int state ); 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /Unlockers.txt: -------------------------------------------------------------------------------- 1 | unlockers pack 2 | /* 3 | Unlockers\Nokia\DCT-2\ IMEI, GID1, GID2, IMSI, Unlock Code, Sec. Code 4 | Unlockers\Sony\CMD C1\ IMEI, Calc 5 | Unlockers\Vitel\TSM 3/4/5\ IMEI, Calc 6 | */ 7 | ============== 8 | 9 | MADos conversion by kraze1984 10 | 11 | ASKNOWLEDGEMENTS: 12 | Those sourcecodes were posted on nokiafree or 13 | their location was indicated there. 14 | 15 | Vitel TSM 3/4/5 (not 5m)- indear; 16 | Nokia DCT-2 - Pascal code by Zulea, C conversion by indear; 17 | Nokia DCT-2 Sec. Code - Source Code von andreas@ccc.de; 18 | Sony CMD C1 - SIMUNLOCK by S.S. v1.0 19 | 20 | PROBLEMS: 21 | In output before the normal text all give the latin alphabet (my problem). 22 | There are some strange things in showing gid1\gid2 in dct2 unlocker. 23 | 24 | TODO: 25 | IMSI reading from card inputted in phone. 26 | 27 | THE UNLOCKERS WERE NOT TESTED!!!! 28 | 29 | =============== 30 | 29.10.2004 31 | 32 | 33 | -------------------------------------------------------------------------------- /include/apps/meas.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * MADos, a free OS for N* handsets 4 | * Copyright (C) 2003/2004 MADos Core Developer Team 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * contact http://64.246.26.121/forum/forumdisplay.php?f=99 21 | * 22 | */ 23 | 24 | int meas_main ( void ); 25 | -------------------------------------------------------------------------------- /include/apps/hangman.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * MADos, a free OS for N* handsets 4 | * Copyright (C) 2003/2004 MADos Core Developer Team 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * contact http://64.246.26.121/forum/forumdisplay.php?f=99 21 | * 22 | */ 23 | 24 | void hangman_main ( void ); 25 | -------------------------------------------------------------------------------- /include/apps/matrix.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * MADos, a free OS for N* handsets 4 | * Copyright (C) 2003/2004 MADos Core Developer Team 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * contact http://64.246.26.121/forum/forumdisplay.php?f=99 21 | * 22 | */ 23 | 24 | void matrix_main ( void ); 25 | -------------------------------------------------------------------------------- /include/apps/othello.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * MADos, a free OS for N* handsets 4 | * Copyright (C) 2003/2004 MADos Core Developer Team 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * contact http://64.246.26.121/forum/forumdisplay.php?f=99 21 | * 22 | */ 23 | 24 | void othello_main ( void ); 25 | -------------------------------------------------------------------------------- /include/apps/engine3d.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * MADos, a free OS for N* handsets 4 | * Copyright (C) 2003/2004 MADos Core Developer Team 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * contact http://64.246.26.121/forum/forumdisplay.php?f=99 21 | * 22 | */ 23 | 24 | void simple_cube_main ( void ); 25 | -------------------------------------------------------------------------------- /include/apps/picpaint.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * MADos, a free OS for N* handsets 4 | * Copyright (C) 2003/2004 MADos Core Developer Team 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * contact http://64.246.26.121/forum/forumdisplay.php?f=99 21 | * 22 | */ 23 | 24 | void picpaint_main ( void ); 25 | -------------------------------------------------------------------------------- /include/hw/genio.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * MADos, a free OS for N* handsets 4 | * Copyright (C) 2003/2004 MADos Core Developer Team 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * contact http://64.246.26.121/forum/forumdisplay.php?f=99 21 | * 22 | */ 23 | 24 | 25 | void genio_init ( void ); 26 | -------------------------------------------------------------------------------- /Attic/nlib/script/halfwordify.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | """Simple utility that converts tic54x binary output to hex readable by gcc. 3 | -- wumpus 2003 4 | 5 | Usage: %s .bin .hex 6 | """ 7 | 8 | import sys 9 | 10 | if len(sys.argv)<3: 11 | print __doc__ % (sys.argv[0],) 12 | sys.exit(1) 13 | 14 | infile = sys.argv[1] 15 | outfile = sys.argv[2] 16 | 17 | # read infile 18 | ifd = open(infile, "rb") 19 | data = ifd.read() 20 | ifd.close() 21 | if len(data) & 1: 22 | print "File smells bad. (number of bytes must be even)" 23 | sys.exit(1) 24 | ofd = open(outfile, "w") 25 | 26 | x = 0 27 | size = len(data) 28 | ofd.write("/* Autogenerated by halfwordify.py -- Do not manually modify this file! */\n") 29 | ofd.write("{\n") 30 | while x < size: 31 | str = "" 32 | sub = 0 33 | while sub < 8 and x < size: 34 | str += "0x%02X%02X," % (ord(data[x+1]),ord(data[x+0])) 35 | sub += 1 36 | x += 2 37 | if x == size: 38 | str = str[0:-1] 39 | ofd.write(str) 40 | ofd.write("\n") 41 | ofd.write("}\n") 42 | -------------------------------------------------------------------------------- /include/hw/clock.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * MADos, a free OS for N* handsets 4 | * Copyright (C) 2003/2004 MADos Core Developer Team 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * contact http://64.246.26.121/forum/forumdisplay.php?f=99 21 | * 22 | */ 23 | 24 | 25 | 26 | void clock_speed ( int hi ); 27 | -------------------------------------------------------------------------------- /include/apps/tictactoe.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * MADos, a free OS for N* handsets 4 | * Copyright (C) 2003/2004 MADos Core Developer Team 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * contact http://64.246.26.121/forum/forumdisplay.php?f=99 21 | * 22 | */ 23 | 24 | #include 25 | 26 | void ttt_main ( ); 27 | -------------------------------------------------------------------------------- /include/hw/dspblocks.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * MADos, a free OS for N* handsets 4 | * Copyright (C) 2003/2004 MADos Core Developer Team 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * contact http://64.246.26.121/forum/forumdisplay.php?f=99 21 | * 22 | */ 23 | 24 | 25 | struct dsp_codeblock *dspblocks_get_block ( int n ); 26 | -------------------------------------------------------------------------------- /include/hw/led.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * MADos, a free OS for N* handsets 4 | * Copyright (C) 2003/2004 MADos Core Developer Team 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * contact http://64.246.26.121/forum/forumdisplay.php?f=99 21 | * 22 | */ 23 | 24 | void led_set ( int enable ); 25 | void led_fade_out ( int speed ); 26 | void led_fade_in ( int speed ); 27 | -------------------------------------------------------------------------------- /include/apps/demo_1.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * MADos, a free OS for N* handsets 4 | * Copyright (C) 2003/2004 MADos Core Developer Team 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * contact http://64.246.26.121/forum/forumdisplay.php?f=99 21 | * 22 | */ 23 | 24 | void demo_1_main ( void ); 25 | void demo_1_sndthread ( void ); 26 | void demo_1_2ndmainthread ( void ); 27 | -------------------------------------------------------------------------------- /include/apps/samsung.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * MADos, a free OS for N* handsets 4 | * Copyright (C) 2003/2004 MADos Core Developer Team 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * contact http://64.246.26.121/forum/forumdisplay.php?f=99 21 | * 22 | */ 23 | 24 | #include 25 | 26 | MENU_CALLBACK ( samsung_type ); 27 | MENU_CALLBACK ( samsung_code ); 28 | -------------------------------------------------------------------------------- /include/apps/screenshot.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * MADos, a free OS for N* handsets 4 | * Copyright (C) 2003/2004 MADos Core Developer Team 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * contact http://64.246.26.121/forum/forumdisplay.php?f=99 21 | * 22 | */ 23 | 24 | #include 25 | 26 | void screenshot_capture ( void ); 27 | MENU_CALLBACK ( screenshot_show ); 28 | -------------------------------------------------------------------------------- /include/hw/vibra.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * MADos, a free OS for N* handsets 4 | * Copyright (C) 2003/2004 MADos Core Developer Team 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * contact http://64.246.26.121/forum/forumdisplay.php?f=99 21 | * 22 | */ 23 | 24 | void vibra_init ( void ); 25 | void vibra_setfreq ( unsigned char freq ); 26 | void vibra_setmode ( unsigned char mode ); 27 | -------------------------------------------------------------------------------- /include/apps/f1.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * MADos, a free OS for N* handsets 4 | * Copyright (C) 2003/2004 MADos Core Developer Team 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * contact http://64.246.26.121/forum/forumdisplay.php?f=99 21 | * 22 | */ 23 | 24 | #include 25 | 26 | MENU_CALLBACK ( car_map_chg ); 27 | MENU_CALLBACK ( car_start ); 28 | MENU_CALLBACK ( car_info ); 29 | -------------------------------------------------------------------------------- /include/apps/fire.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * MADos, a free OS for N* handsets 4 | * Copyright (C) 2003/2004 MADos Core Developer Team 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * contact http://64.246.26.121/forum/forumdisplay.php?f=99 21 | * 22 | */ 23 | 24 | static void fire_gentable ( void ); 25 | static void fire_calc ( void ); 26 | void fire_draw ( void ); 27 | int fire_main ( int doloop ); 28 | -------------------------------------------------------------------------------- /Marcanoid.txt: -------------------------------------------------------------------------------- 1 | MADos Arcanoid (in menu - MArcanoid) 2 | Based on a C++ source written by Safronov Pavel found on http://www.progc.narod.ru 3 | 4 | Known bugs: 5 | - if the ball was directly punched too near from right or left wall it can start moving only around that wall. (occasional) 6 | 7 | Todo: 8 | - Fix bugs :) 9 | - make that the ball reacts with cubes like a one big point. now it is reacting only with a point in the higher left corner. 10 | - Some new levels (up to 40) (4 levels design is done, just to program) 11 | - Bonuses: additional life, closed barrier, stone ball, big ball, glue, 2x and 3x length 12 | - Handicaps: Block, invert screen, undo bonuses, 2x speed up 13 | 14 | - implement difficulty level through timer ? 15 | - optimize to take less space ? 16 | 17 | Log: 18 | 16.05.2004 - Added 1 level, menu for its selection, written rules for levels 19 | 20 | 15.05.2004 - Added vibrating in game, 21 | created menu with skills, 22 | implemented difficulty level thru pause delays. - try to win on hard with charger connected :) 23 | 24 | 28.04.2004 - Added vibrating func, 25 | exits game when 'C' is pressed - at last! 26 | Bug with ball not colliding cubes solved 27 | 28 | kraze1984 -------------------------------------------------------------------------------- /include/apps/alcatel.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * MADos, a free OS for N* handsets 4 | * Copyright (C) 2003/2004 MADos Core Developer Team 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * contact http://64.246.26.121/forum/forumdisplay.php?f=99 21 | * 22 | */ 23 | 24 | #include 25 | 26 | MENU_CALLBACK ( alcatel_type ); 27 | MENU_CALLBACK ( alcatel_inst ); 28 | MENU_CALLBACK ( alcatel_code ); 29 | -------------------------------------------------------------------------------- /include/apps/gallery.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * MADos, a free OS for N* handsets 4 | * Copyright (C) 2003/2004 MADos Core Developer Team 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * contact http://64.246.26.121/forum/forumdisplay.php?f=99 21 | * 22 | */ 23 | 24 | #include 25 | 26 | MENU_CALLBACK ( gallery_type ); 27 | MENU_CALLBACK ( gallery_imss ); 28 | MENU_CALLBACK ( gallery_view ); 29 | -------------------------------------------------------------------------------- /include/apps/txtreader.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * MADos, a free OS for N* handsets 4 | * Copyright (C) 2003/2004 MADos Core Developer Team 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * contact http://64.246.26.121/forum/forumdisplay.php?f=99 21 | * 22 | */ 23 | 24 | #include 25 | MENU_CALLBACK ( main_txtreader ); 26 | unsigned char *txtreader_print ( unsigned char *, const unsigned char ); 27 | -------------------------------------------------------------------------------- /Attic/nlib/src/dspblocks/block0F.h: -------------------------------------------------------------------------------- 1 | /* 0f 00306f64 w0:ff80 w1:ff80 size:0068 offset:0200 w4:008c w5:0000 2 | Block: (MCU)00010400-000104d0 (DSP)0a00-0a68 BS=008c (TARG)ff80-ffe8 */ 3 | static struct dsp_codeblock block0F = { 4 | {0xFF80, 0xFF80, 0x0068, 0x0200, 0x008C}, 5 | { 6 | 0x771D, 0xFFA8, 0xF073, 0xFF85, 0xF49B, 0xF073, 0x0F00, 0x0006, 7 | 0xF49B, 0xF495, 0xF495, 0xF495, 0xF49B, 0xF495, 0xF495, 0xF495, 8 | 0xF49B, 0xF495, 0xF495, 0xF495, 0xF49B, 0xF495, 0xF495, 0xF495, 9 | 0xF49B, 0xF495, 0xF495, 0xF495, 0xF49B, 0xF495, 0xF495, 0xF495, 10 | 0xF49B, 0xF495, 0xF495, 0xF495, 0xF49B, 0xF495, 0xF495, 0xF495, 11 | 0xF49B, 0xF495, 0xF495, 0xF495, 0xF49B, 0xF495, 0xF495, 0xF495, 12 | 0xF49B, 0xF495, 0xF495, 0xF495, 0xF49B, 0xF495, 0xF495, 0xF495, 13 | 0xF49B, 0xF495, 0xF495, 0xF495, 0xF49B, 0xF495, 0xF495, 0xF495, 14 | 0x4A1E, 0x4A06, 0xF880, 0x22DA, 0x4A1E, 0x4A06, 0xF880, 0x27CD, 15 | 0x4A1E, 0x4A06, 0xF880, 0x27CD, 0x4A1E, 0xF880, 0x05FA, 0xF495, 16 | 0x4A1E, 0x4A06, 0xF880, 0x25DF, 0xF49B, 0xF495, 0xF495, 0xF495, 17 | 0xF49B, 0xF495, 0xF495, 0xF495, 0xF49B, 0xF495, 0xF495, 0xF495, 18 | 0x4A1E, 0x4A06, 0xF880, 0x27CD, 0x4A1E, 0x4A06, 0xF880, 0x2B53} 19 | }; 20 | -------------------------------------------------------------------------------- /include/apps/provider.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * MADos, a free OS for N* handsets 4 | * Copyright (C) 2003/2004 MADos Core Developer Team 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * contact http://64.246.26.121/forum/forumdisplay.php?f=99 21 | * 22 | */ 23 | 24 | #include 25 | 26 | MENU_CALLBACK ( network_country ); 27 | MENU_CALLBACK ( network_provider ); 28 | MENU_CALLBACK ( network_mcc_mnc_gid1 ); 29 | -------------------------------------------------------------------------------- /include/apps/vitel.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * MADos, a free OS for N* handsets 4 | * Copyright (C) 2003/2004 MADos Core Developer Team 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * contact http://64.246.26.121/forum/forumdisplay.php?f=99 21 | * 22 | */ 23 | 24 | #include 25 | 26 | //MENU_CALLBACK ( dct4_type ); 27 | //MENU_CALLBACK ( dct4_selversion ); 28 | MENU_CALLBACK ( vitel_calc ); 29 | MENU_CALLBACK ( vitel_imei ); 30 | -------------------------------------------------------------------------------- /include/apps/sony_cmd_c1.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * MADos, a free OS for N* handsets 4 | * Copyright (C) 2003/2004 MADos Core Developer Team 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * contact http://64.246.26.121/forum/forumdisplay.php?f=99 21 | * 22 | */ 23 | 24 | #include 25 | 26 | //MENU_CALLBACK ( dct4_type ); 27 | //MENU_CALLBACK ( dct4_selversion ); 28 | MENU_CALLBACK ( sony_calc ); 29 | MENU_CALLBACK ( sony_imei ); 30 | -------------------------------------------------------------------------------- /include/hw/sim.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * MADos, a free OS for N* handsets 4 | * Copyright (C) 2003/2004 MADos Core Developer Team 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * contact http://64.246.26.121/forum/forumdisplay.php?f=99 21 | * 22 | */ 23 | 24 | void sim_init ( void ); 25 | volatile void sim_initcontrol ( void ); 26 | volatile void sim_reset ( void ); 27 | void sim_receive ( unsigned char *data ); 28 | void sim_int_handler ( void ); 29 | -------------------------------------------------------------------------------- /include/apps/stars.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * MADos, a free OS for N* handsets 4 | * Copyright (C) 2003/2004 MADos Core Developer Team 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * contact http://64.246.26.121/forum/forumdisplay.php?f=99 21 | * 22 | */ 23 | 24 | typedef struct 25 | { 26 | unsigned int x; 27 | unsigned int y; 28 | unsigned char ebene; 29 | } 30 | star_t; 31 | 32 | void stars_main ( void ); 33 | void starfield_main ( void ); 34 | -------------------------------------------------------------------------------- /include/apps/dct4.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * MADos, a free OS for N* handsets 4 | * Copyright (C) 2003/2004 MADos Core Developer Team 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * contact http://64.246.26.121/forum/forumdisplay.php?f=99 21 | * 22 | */ 23 | 24 | #include 25 | 26 | MENU_CALLBACK ( dct4_type ); 27 | MENU_CALLBACK ( dct4_selversion ); 28 | MENU_CALLBACK ( dct4_imei ); 29 | MENU_CALLBACK ( dct4_prov ); 30 | MENU_CALLBACK ( dct4_calc ); 31 | -------------------------------------------------------------------------------- /include/apps/dct3.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * MADos, a free OS for N* handsets 4 | * Copyright (C) 2003/2004 MADos Core Developer Team 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * contact http://64.246.26.121/forum/forumdisplay.php?f=99 21 | * 22 | */ 23 | 24 | #include 25 | 26 | //MENU_CALLBACK ( dct4_type ); 27 | //MENU_CALLBACK ( dct4_selversion ); 28 | MENU_CALLBACK ( dct3_imei ); 29 | MENU_CALLBACK ( dct3_prov ); 30 | MENU_CALLBACK ( dct3_calc ); 31 | -------------------------------------------------------------------------------- /include/apps/lgunlock.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * MADos, a free OS for N* handsets 4 | * Copyright (C) 2003/2004 MADos Core Developer Team 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * contact http://64.246.26.121/forum/forumdisplay.php?f=99 21 | * 22 | */ 23 | 24 | #include 25 | 26 | MENU_CALLBACK ( lgunlock_type ); 27 | MENU_CALLBACK ( lgunlock_imei ); 28 | MENU_CALLBACK ( lgunlock_calc ); 29 | void lgunlock_algo ( char *imei, unsigned char type, char *output ); 30 | -------------------------------------------------------------------------------- /include/hw/mdi.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * MADos, a free OS for N* handsets 4 | * Copyright (C) 2003/2004 MADos Core Developer Team 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * contact http://64.246.26.121/forum/forumdisplay.php?f=99 21 | * 22 | */ 23 | 24 | #ifndef MADOS_MDI 25 | #define MADOS_MDI 26 | 27 | void mdi_send_interrupt ( ); 28 | void mdi_recv_interrupt ( ); 29 | int mdi_poll_receive ( ); 30 | int mdi_receive ( unsigned char *buffer ); 31 | int mdi_send ( unsigned char *buffer ); 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /hw/clock.c: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * MADos, a free OS for N* handsets 4 | * Copyright (C) 2003/2004 MADos Core Developer Team 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * contact http://64.246.26.121/forum/forumdisplay.php?f=99 21 | * 22 | */ 23 | 24 | 25 | // should set the clock source... doesnt work 26 | void 27 | clock_speed ( int hi ) 28 | { 29 | /* if ( hi ) 30 | _io_set ( IO_CTSI_CTRL, io_read ( IO_CTSI_CTRL ) & 0xFC | 1 ); 31 | else 32 | _io_set ( IO_CTSI_CTRL, io_read ( IO_CTSI_CTRL ) | );*/ 33 | } 34 | -------------------------------------------------------------------------------- /include/hw/snd.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * MADos, a free OS for N* handsets 4 | * Copyright (C) 2003/2004 MADos Core Developer Team 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * contact http://64.246.26.121/forum/forumdisplay.php?f=99 21 | * 22 | */ 23 | 24 | const unsigned char snd_block[] = { 25 | 0x87, 0x8C, 0x91, 0x9A, 0x91, 0x8A, 0x8C, 0x87, 0x8A, 0x87, 0x79, 0x80, 0x86, 0x7F, 0x7D, 0x7A, 26 | 0x7B, 0x8E, 0x84, 0x68, 0x6B, 0x86, 0xA0, 0xA1, 0x7A, 0x69, 0x82, 0x93, 0x8E, 0x7B, 0x68, 0x64, 27 | 0x6A, 0x73, 0x00, 28 | }; 29 | -------------------------------------------------------------------------------- /include/dspblocks/block07.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * MADos, a free OS for N* handsets 4 | * Copyright (C) 2003/2004 MADos Core Developer Team 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * contact http://64.246.26.121/forum/forumdisplay.php?f=99 21 | * 22 | */ 23 | 24 | /* 07 00305514 w0:09c6 w1:0b39 size:0000 offset:01c6 w4:04ec w5:0000 25 | Block: (MCU)0001038c-0001038c (DSP)09c6-09c6 BS=04ec (TARG)09c6-09c6 */ 26 | static struct dsp_codeblock block07 = { 27 | {0x09C6, 0x0B39, 0x0000, 0x01C6, 0x04EC}, 28 | { 29 | } 30 | }; 31 | -------------------------------------------------------------------------------- /include/dspblocks/block0A.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * MADos, a free OS for N* handsets 4 | * Copyright (C) 2003/2004 MADos Core Developer Team 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * contact http://64.246.26.121/forum/forumdisplay.php?f=99 21 | * 22 | */ 23 | 24 | /* 0a 00305f88 w0:0a4a w1:0b39 size:0000 offset:024a w4:04ec w5:0000 25 | Block: (MCU)00010494-00010494 (DSP)0a4a-0a4a BS=04ec (TARG)0a4a-0a4a */ 26 | static struct dsp_codeblock block0A = { 27 | {0x0A4A, 0x0B39, 0x0000, 0x024A, 0x04EC}, 28 | { 29 | } 30 | }; 31 | -------------------------------------------------------------------------------- /include/dspblocks/block0E.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * MADos, a free OS for N* handsets 4 | * Copyright (C) 2003/2004 MADos Core Developer Team 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * contact http://64.246.26.121/forum/forumdisplay.php?f=99 21 | * 22 | */ 23 | 24 | /* 0e 00306f58 w0:1000 w1:0b39 size:0000 offset:01c6 w4:01f4 w5:0000 25 | Block: (MCU)0001038c-0001038c (DSP)09c6-09c6 BS=01f4 (TARG)1000-1000 */ 26 | static struct dsp_codeblock block0E = { 27 | {0x1000, 0x0B39, 0x0000, 0x01C6, 0x01F4}, 28 | { 29 | } 30 | }; 31 | -------------------------------------------------------------------------------- /include/dspblocks/block10.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * MADos, a free OS for N* handsets 4 | * Copyright (C) 2003/2004 MADos Core Developer Team 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * contact http://64.246.26.121/forum/forumdisplay.php?f=99 21 | * 22 | */ 23 | 24 | /* 10 00307060 w0:0000 w1:ff80 size:0000 offset:0200 w4:0078 w5:0000 25 | Block: (MCU)00010400-00010400 (DSP)0a00-0a00 BS=0078 (TARG)0000-0000 */ 26 | static struct dsp_codeblock block10 = { 27 | {0x0000, 0xFF80, 0x0000, 0x0200, 0x0078}, 28 | { 29 | } 30 | }; 31 | -------------------------------------------------------------------------------- /include/dspblocks/block11.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * MADos, a free OS for N* handsets 4 | * Copyright (C) 2003/2004 MADos Core Developer Team 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * contact http://64.246.26.121/forum/forumdisplay.php?f=99 21 | * 22 | */ 23 | 24 | /* 11 0030706c w0:0000 w1:ff80 size:0000 offset:0200 w4:0078 w5:0000 25 | Block: (MCU)00010400-00010400 (DSP)0a00-0a00 BS=0078 (TARG)0000-0000 */ 26 | static struct dsp_codeblock block11 = { 27 | {0x0000, 0xFF80, 0x0000, 0x0200, 0x0078}, 28 | { 29 | } 30 | }; 31 | -------------------------------------------------------------------------------- /include/dspblocks/block12.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * MADos, a free OS for N* handsets 4 | * Copyright (C) 2003/2004 MADos Core Developer Team 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * contact http://64.246.26.121/forum/forumdisplay.php?f=99 21 | * 22 | */ 23 | 24 | /* 12 00307078 w0:0000 w1:f000 size:0000 offset:0200 w4:0078 w5:0000 25 | Block: (MCU)00010400-00010400 (DSP)0a00-0a00 BS=0078 (TARG)0000-0000 */ 26 | static struct dsp_codeblock block12 = { 27 | {0x0000, 0xF000, 0x0000, 0x0200, 0x0078}, 28 | { 29 | } 30 | }; 31 | -------------------------------------------------------------------------------- /include/dspblocks/block13.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * MADos, a free OS for N* handsets 4 | * Copyright (C) 2003/2004 MADos Core Developer Team 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * contact http://64.246.26.121/forum/forumdisplay.php?f=99 21 | * 22 | */ 23 | 24 | /* 13 00307084 w0:0000 w1:f000 size:0000 offset:0200 w4:0078 w5:0000 25 | Block: (MCU)00010400-00010400 (DSP)0a00-0a00 BS=0078 (TARG)0000-0000 */ 26 | static struct dsp_codeblock block13 = { 27 | {0x0000, 0xF000, 0x0000, 0x0200, 0x0078}, 28 | { 29 | } 30 | }; 31 | -------------------------------------------------------------------------------- /include/dspblocks/block19.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * MADos, a free OS for N* handsets 4 | * Copyright (C) 2003/2004 MADos Core Developer Team 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * contact http://64.246.26.121/forum/forumdisplay.php?f=99 21 | * 22 | */ 23 | 24 | /* 19 00307e8c w0:2206 w1:0000 size:0000 offset:0000 w4:0000 w5:0000 25 | Block: (MCU)00010000-00010000 (DSP)0800-0800 BS=0000 (TARG)2206-2206 */ 26 | static struct dsp_codeblock block19 = { 27 | {0x2206, 0x0000, 0x0000, 0x0000, 0x0000}, 28 | { 29 | } 30 | }; 31 | -------------------------------------------------------------------------------- /include/core/fs.h: -------------------------------------------------------------------------------- 1 | 2 | typedef struct 3 | { 4 | unsigned char magic[8]; 5 | unsigned long length; 6 | unsigned char compat; 7 | unsigned char version; 8 | unsigned char fsdata[6]; 9 | } 10 | fs_hdr; 11 | 12 | typedef struct 13 | { 14 | void *addr; // the address to read from 15 | void *priv; // the FS's private data 16 | unsigned long fsize; // the file's size 17 | unsigned long fpos; // the file's pos of the block at addr 18 | unsigned long avail; // how many bytes are available at addr 19 | unsigned long pos; // the actual pos at addr 20 | unsigned long mode; // access mode 21 | // int (*read_func) 22 | } 23 | FILE; 24 | 25 | #define FS_MODE_READ 0 26 | #define FS_MODE_WRITE 1 27 | #define FS_BASE 0x00300000 28 | 29 | 30 | int fs_check ( void *base ); 31 | int fs_unlink ( const char *name ); 32 | int fs_format ( void *base ); 33 | int fs_fclose ( FILE * stream ); 34 | FILE *fs_fopen ( const char *name, const char *mode ); 35 | unsigned long fs_fwrite ( void *ptr, unsigned long size, unsigned long nmemb, FILE * stream ); 36 | unsigned long fs_fread ( void *ptr, unsigned long size, unsigned long nmemb, FILE * stream ); 37 | int fs_countfiles ( ); 38 | char *fs_listfile ( int number ); 39 | int fs_exists ( const char *name ); 40 | -------------------------------------------------------------------------------- /bugs.txt: -------------------------------------------------------------------------------- 1 | this should be a list of all known bugs in MADos, 2 | if you fix a bug or find a new one, you can change or 3 | let change this list! 4 | 5 | 6 | known, not fixed bugs: 7 | 8 | - hang at 4063 sec 9 | * krisha thinks it's because auf FIQ5, counts up to ~130 until hang 10 | * g3gg0: FIQ5 count == 131, then lockup. after 5 secs ccont reset 11 | - menu key presses lags and are not recognized fully 12 | - long scrolling menu names need many keys to get rid of them 13 | - right menubar has sometimes display errors 14 | - menu position cursor (right, menubar) could be in variable size (like in UserInterface) 15 | - bomberman not included, because of many bugs ;) 16 | - embed mode: should maybe capture nokia time and save it, so no time will be lost when going back to nokia 17 | - flickering fade in lights 18 | - dropdown menu entrys that are too long, if the list is too long there will also be some displaying errors 19 | - enigne3D buggy 20 | - picpaint not complete 21 | - MADos (standalone) don't start up with a const unsigned char header file included in main.c 22 | - define fixed huffman tables for some types (bitmap, text) to increase filesize saving 23 | - ... 24 | 25 | 26 | fixed bugs: 27 | 28 | - snakeIII couldn't be restartet, if abortet with C (maybe malloc helps) ::: was a little variable bug, no malloc ;) 29 | - demo_1 should be stopped on keypress -------------------------------------------------------------------------------- /include/apps/arcanoid.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * MADos, a free OS for N* handsets 4 | * Copyright (C) 2003/2004 MADos Core Developer Team 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * contact http://64.246.26.121/forum/forumdisplay.php?f=99 21 | * 22 | */ 23 | 24 | void marc_vibra_thread ( void ); 25 | void marc_spd ( void ); 26 | void marc_main ( ); 27 | void marc_skill ( ); 28 | void arcanoid_main ( ); 29 | void arcanoid ( void ); 30 | void show_score ( void ); 31 | int ball ( ); 32 | int kubik ( ); 33 | void cubes ( void ); 34 | void start ( ); 35 | void gameover_screen ( ); 36 | -------------------------------------------------------------------------------- /include/apps/dspcode.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * MADos, a free OS for N* handsets 4 | * Copyright (C) 2003/2004 MADos Core Developer Team 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * contact http://64.246.26.121/forum/forumdisplay.php?f=99 21 | * 22 | */ 23 | 24 | 25 | 26 | const unsigned short dspread_boot_table[] = { 27 | 0x7706, 0x0000, 0x7707, 0x6900, 28 | 0x771d, 0xffa8, 0x7718, 0x0079, 29 | 0x7728, 0x2000, 0x7758, 0x3146, 30 | 0xf070, 0xea60, 0xf495, 0x7713, 31 | 0xff00, 0x7712, 0x0800, 0xecff, 32 | 0xe598, 0xf7bd, 0xf6bd, 0xf073, 33 | 0x0f15 34 | }; 35 | -------------------------------------------------------------------------------- /include/hw/timer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * MADos, a free OS for N* handsets 4 | * Copyright (C) 2003/2004 MADos Core Developer Team 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * contact http://64.246.26.121/forum/forumdisplay.php?f=99 21 | * 22 | */ 23 | 24 | void timer_init ( void ); 25 | void timer_disable ( void ); 26 | void timer_enable ( void ); 27 | void timer_set_div ( unsigned char div ); 28 | void timer_force ( void ); 29 | void timer_advance ( void ); 30 | void timer_int_handler_prog ( void ); 31 | void timer_int_handler_time ( void ); 32 | unsigned int timer_get_time ( void ); 33 | -------------------------------------------------------------------------------- /include/hw/xbus.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * MADos, a free OS for N* handsets 4 | * Copyright (C) 2003/2004 MADos Core Developer Team 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * contact http://64.246.26.121/forum/forumdisplay.php?f=99 21 | * 22 | */ 23 | 24 | void xbus_init ( void ); 25 | void xbus_set_sda ( int state ); 26 | unsigned char xbus_get_scl ( void ); 27 | unsigned int xbus_receive_byte ( ); 28 | void xbus_send_byte ( unsigned int dat ); 29 | void xbus_send_packet ( unsigned char *packet, unsigned int length ); 30 | void xbus_dbg ( unsigned int code, unsigned char *param, unsigned int length ); 31 | -------------------------------------------------------------------------------- /include/apps/st55gd55.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * MADos, a free OS for N* handsets 4 | * Copyright (C) 2003/2004 MADos Core Developer Team 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * contact http://64.246.26.121/forum/forumdisplay.php?f=99 21 | * 22 | */ 23 | 24 | #include 25 | 26 | void st55gd55_calc ( unsigned char model ); 27 | 28 | MENU_CALLBACK ( st55gd55_imei ); 29 | MENU_CALLBACK ( st55gd55_calc_cl50 ); 30 | MENU_CALLBACK ( st55gd55_calc_st55 ); 31 | MENU_CALLBACK ( st55gd55_calc_gd55 ); 32 | void st55gd55_algo ( char *IMEI, char *std, unsigned char code, unsigned char model, char *output ); 33 | -------------------------------------------------------------------------------- /Attic/nlib/include/nlib/dsp.h: -------------------------------------------------------------------------------- 1 | #ifndef WMX_DSP 2 | #define WMX_DSP 3 | 4 | /* In words */ 5 | #define DSP_SHARED_SIZE (0x1000/2) 6 | 7 | /* _dsp shared memory areas */ 8 | #define DSP_MDISND_TAIL (0x0A4/2) 9 | #define DSP_MDISND_HEAD (0x0A6/2) 10 | #define DSP_INITDATA (0x0A8/2) 11 | #define DSP_MDISND_QUEUE (0x000/2) 12 | #define DSP_MDISND_SIZE (0x0A4/2) 13 | #define DSP_MDISND_QUEUEEND (DSP_MDISND_QUEUE + DSP_MDISND_SIZE) 14 | #define DSP_UPLOADREQUEST (0x0E2/2) 15 | #define DSP_UPLOADREPLY (0x0E4/2) 16 | #define DSP_UPLOADREPLY_MORE 0x0002 17 | #define DSP_UPLOADREPLY_FINISHED 0x0004 18 | #define DSP_UPLOADHEADER (0x0F6/2) 19 | #define DSP_MDIRCV_QUEUE (0x100/2) 20 | #define DSP_MDIRCV_SIZE (0x0C8/2) 21 | #define DSP_MDIRCV_QUEUEEND (DSP_MDIRCV_QUEUE + DSP_MDIRCV_SIZE) 22 | #define DSP_MDIRCV_TAIL (0x1C8/2) 23 | #define DSP_MDIRCV_HEAD (0x1CA/2) 24 | 25 | 26 | /* Offsets in upload header */ 27 | #define DSP_UPLHDR_TARGET 0 28 | #define DSP_UPLHDR_SIZE 2 29 | #define DSP_UPLHDR_OFFSET 3 30 | #define DSP_UPLHDR_BLOCKSIZE 4 31 | 32 | struct dsp_codeblock 33 | { 34 | uint16 header[5]; 35 | uint16 data[]; 36 | }; 37 | 38 | /* DSPIF constants */ 39 | #define DSPIF_ENABLE_SHARED 0x0000 40 | #define DSPIF_DISABLE_SHARED 0x0002 41 | #define DSPIF_INTERRUPT 0x0004 42 | 43 | void DSP_initialize ( ); 44 | void DSP_startup ( ); 45 | void DSP_interrupt ( ); 46 | void DSP_enable ( int state ); 47 | int DSP_uploadCodeblock ( struct dsp_codeblock *c, int sub ); 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /include/apps/charger.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * MADos, a free OS for N* handsets 4 | * Copyright (C) 2003/2004 MADos Core Developer Team 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * contact http://64.246.26.121/forum/forumdisplay.php?f=99 21 | * 22 | */ 23 | 24 | #define BATT_CHECK 0x05 25 | #define BATT_OVERLOAD 0x04 26 | #define BATT_OVERDISCHARGED 0x03 27 | #define BATT_SLOWCHARGE 0x02 28 | #define BATT_CHARGE 0x01 29 | #define BATT_DISCHARGE 0x00 30 | 31 | #define CHARGE_FAST 0xFF 32 | #define CHARGE_SLOW 0x7F 33 | #define CHARGE_CHECK 0x01 34 | #define CHARGE_OFF 0x00 35 | 36 | #define BATT_LOW 0x10 37 | #define BATT_NORM 0x11 38 | -------------------------------------------------------------------------------- /Attic/nlib/src/nokio.c: -------------------------------------------------------------------------------- 1 | /** 2 | * Generic I/O functions 3 | * wumpus 2003 4 | */ 5 | 6 | #include 7 | #include 8 | 9 | /** 10 | * Table for initial CTRL I/O values. 11 | */ 12 | static uint8 ctrlio_base[] = { 13 | /* 14 | * 0x70 - 0x73 15 | */ 16 | 0x00, 0x02, 0xA0, 0x63, /* 0x73 0x6B for 3310 */ 17 | /* 18 | * 0xB0 - 0xB3 19 | */ 20 | 0xFF, 0xFD, 0x5F, 0x00 21 | }; 22 | 23 | /** 24 | * Most basic I/O initialisations. 25 | */ 26 | void 27 | IO_initialize ( ) 28 | { 29 | int x; 30 | /* 31 | * CTRL I/O 32 | */ 33 | for ( x = 0; x < 4; x++ ) 34 | { 35 | _io[0x70 + x] = ctrlio_base[x + 0]; 36 | _io[0xB0 + x] = ctrlio_base[x + 4]; 37 | } 38 | } 39 | 40 | 41 | void 42 | usleep ( uint micros ) 43 | { 44 | while ( micros > 0 ) 45 | { 46 | asm ( "nop" ); 47 | asm ( "nop" ); 48 | micros--; 49 | } 50 | } 51 | 52 | /** 53 | * Set or clear bits in an I/O register. 54 | * 55 | * @param register [0x00-0xFF] I/O register to alter. 56 | * @param bit [0x00,0x01,0x02...] Bits to set or clear. 57 | * @param mode 0=clear, 1=set 58 | */ 59 | void 60 | IO_setBit ( uint reg, uint bit, uint mode ) 61 | { 62 | /* 63 | * todo disable interrupts 64 | */ 65 | if ( mode ) 66 | _io[reg] |= bit; 67 | else 68 | _io[reg] &= ~bit; 69 | /* 70 | * todo enable interrupts 71 | */ 72 | } 73 | -------------------------------------------------------------------------------- /include/hw/int.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * MADos, a free OS for N* handsets 4 | * Copyright (C) 2003/2004 MADos Core Developer Team 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * contact http://64.246.26.121/forum/forumdisplay.php?f=99 21 | * 22 | */ 23 | 24 | 25 | #define FIQ_COUNT 9 26 | #define IRQ_COUNT 9 27 | 28 | /* Constants for "type" */ 29 | 30 | 31 | /* Interrupt IDs */ 32 | #define IRQ_KEYBOARD 0 33 | #define IRQ_CCONTINT 2 34 | #define IRQ_SLEEP 3 35 | #define IRQ_DSP 4 36 | 37 | #define FIQ_MDIRCV 0 38 | #define FIQ_MDISND 1 39 | #define FIQ_MBUSRX 2 40 | #define FIQ_MBUSTIM 3 /* triggers 423.1 times per second */ 41 | #define FIQ_PTIMER 4 42 | #define FIQ_SIMUART 6 43 | #define FIQ_SIMCARDDETX 7 44 | 45 | 46 | 47 | void irq_init ( void ); 48 | void int_disable ( void ); 49 | void int_enable ( void ); 50 | -------------------------------------------------------------------------------- /hw/vibra.c: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * MADos, a free OS for N* handsets 4 | * Copyright (C) 2003/2004 MADos Core Developer Team 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * contact http://64.246.26.121/forum/forumdisplay.php?f=99 21 | * 22 | */ 23 | 24 | #include 25 | 26 | //initialize vibra 27 | void 28 | vibra_init ( void ) 29 | { 30 | _io_set ( IO_PUP_CTRL, _io_read ( IO_PUP_CTRL ) | 0x10 ); 31 | } 32 | 33 | //sets the frequency of vibra - allowed decimal values: 0 - 31 34 | void 35 | vibra_setfreq ( unsigned char freq ) 36 | { 37 | _io_set ( IO_PUP_VIB, ( _io_read ( IO_PUP_VIB ) & 0xe0 ) | ( freq & 0x1f ) ); 38 | } 39 | 40 | //sets the vibra mode - allowed values: 0(off) - 3 41 | void 42 | vibra_setmode ( unsigned char mode ) 43 | { 44 | _io_set ( IO_PUP_VIB, ( _io_read ( IO_PUP_VIB ) & 0x9f ) | ( ( mode << 5 ) & 0x60 ) ); 45 | } 46 | -------------------------------------------------------------------------------- /include/hw/flash.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * MADos, a free OS for N* handsets 4 | * Copyright (C) 2003/2004 MADos Core Developer Team 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * contact http://64.246.26.121/forum/forumdisplay.php?f=99 21 | * 22 | */ 23 | 24 | 25 | 26 | #define FLASH_STATUS_WSMS 0x80 27 | #define FLASH_STATUS_ESS 0x40 28 | #define FLASH_STATUS_ES 0x20 29 | #define FLASH_STATUS_PS 0x10 30 | #define FLASH_STATUS_VPPS 0x08 31 | #define FLASH_STATUS_PSS 0x04 32 | #define FLASH_STATUS_DPS 0x02 33 | #define FLASH_STATUS_R 0x01 34 | 35 | 36 | 37 | void flash_vpp ( unsigned int state ); 38 | unsigned int flash_get_ident ( int id ); 39 | unsigned char flash_erase ( void *dest ); 40 | unsigned char flash_write_ram ( void *dest, void *src, unsigned int length ); 41 | unsigned char flash_write ( void *dest, void *src, unsigned int length ); 42 | -------------------------------------------------------------------------------- /include/core/huffman.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * MADos, a free OS for N* handsets 4 | * Copyright (C) 2003/2004 MADos Core Developer Team 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * contact http://64.246.26.121/forum/forumdisplay.php?f=99 21 | * 22 | */ 23 | 24 | #ifndef MADOS_HUFFMAN 25 | #define MADOS_HUFFMAN 26 | 27 | //needs some tweaking 28 | typedef struct 29 | { 30 | unsigned int uncompressed_size; 31 | unsigned int compressed_size; 32 | const unsigned char *blockname; 33 | } huffman_compressed; 34 | 35 | int Huffman_Compress ( unsigned char *in, unsigned char *out, unsigned int insize ); 36 | void Huffman_Uncompress ( unsigned char *in, unsigned char *out, unsigned int insize, unsigned int outsize ); 37 | void huffman_decompress ( huffman_compressed hc, unsigned char *uncompressed ); 38 | inline void huffman_free ( unsigned char *uncompressed ); 39 | void huffman_testtextdisplay ( void ); 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /core/conv.c: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * MADos, a free OS for N* handsets 4 | * Copyright (C) 2003/2004 MADos Core Developer Team 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * contact http://64.246.26.121/forum/forumdisplay.php?f=99 21 | * 22 | */ 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | 29 | int 30 | main ( void ) 31 | { 32 | int i = 1; 33 | unsigned char buf = 0; 34 | FILE *f = NULL; 35 | 36 | f = fopen ( "snd.ub", "rb" ); 37 | if ( !f ) 38 | return 0; 39 | 40 | printf ( "const unsigned char snd_block[] =\n{\n" ); 41 | while ( fread ( &buf, 1, 1, f ) ) 42 | { 43 | printf ( "0x%02X, ", buf ); 44 | if ( i == 16 ) 45 | { 46 | printf ( "\n" ); 47 | i = 1; 48 | } 49 | else 50 | i++; 51 | } 52 | printf ( "0x%02X, ", 0 ); 53 | printf ( "};\n" ); 54 | fclose ( f ); 55 | } 56 | -------------------------------------------------------------------------------- /Attic/nlib/src/lcd.c: -------------------------------------------------------------------------------- 1 | /** 2 | * LCD functions for Philips LCD 3 | * wumpus 2003 4 | */ 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | void 11 | IO_LCDSendCmd ( uint cmd ) 12 | { 13 | IO_gensioWait ( 0x01 ); 14 | _io[IO_LCD_CMD] = cmd; 15 | } 16 | 17 | void 18 | IO_LCDSendData ( uint dat ) 19 | { 20 | IO_gensioWait ( 0x01 ); 21 | _io[IO_LCD_DATA] = dat; 22 | } 23 | 24 | void 25 | IO_LCDInitialize ( ) 26 | { 27 | int x, y; 28 | /* 29 | * LCD reset 30 | */ 31 | IO_gensioStart ( ); 32 | 33 | /* 34 | * Reset 35 | */ 36 | IO_setBit ( 0x32, 0x20, 0 ); 37 | IO_setBit ( 0x32, 0x20, 1 ); 38 | 39 | IO_LCDSendCmd ( 0x24 ); 40 | for ( x = 0; x < 6; x++ ) 41 | { 42 | IO_LCDSendCmd ( 0x40 | x ); 43 | IO_LCDSendCmd ( 0x80 ); 44 | for ( y = 0; y < 84; y++ ) 45 | { 46 | IO_LCDSendData ( 0x00 ); 47 | } 48 | } 49 | //IO_LCDSendCmd(0x20); 50 | //IO_gensioStart(); 51 | 52 | IO_LCDSendCmd ( 0x21 ); /* extended commands */ 53 | IO_LCDSendCmd ( 0x04 | 0x01 ); /* TC */ 54 | IO_LCDSendCmd ( 0x10 | 0x04 ); /* Bias system */ 55 | IO_LCDSendCmd ( 0x80 | 0x40 ); /* VOP 0x40 */ 56 | IO_LCDSendCmd ( 0x20 ); /* non extended commands */ 57 | IO_LCDSendCmd ( 0x0C ); /* Normal operating mode (inverse) */ 58 | } 59 | 60 | /* Set contrast */ 61 | void 62 | IO_LCDSetContrast ( int vop ) 63 | { 64 | IO_LCDSendCmd ( 0x21 ); /* extended commands */ 65 | IO_LCDSendCmd ( 0x80 | ( vop & 0x7F ) ); /* VOP */ 66 | IO_LCDSendCmd ( 0x20 ); /* non extended commands */ 67 | } 68 | -------------------------------------------------------------------------------- /include/hw/ccont.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * MADos, a free OS for N* handsets 4 | * Copyright (C) 2003/2004 MADos Core Developer Team 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * contact http://64.246.26.121/forum/forumdisplay.php?f=99 21 | * 22 | */ 23 | 24 | 25 | void ccont_init ( void ); 26 | int ccont_test ( void ); 27 | void ccont_write ( unsigned char reg, unsigned char byte ); 28 | unsigned char ccont_read ( unsigned char reg ); 29 | void ccont_reset_wdt ( void ); 30 | void ccont_disable_wdt ( void ); 31 | void ccont_poweroff ( void ); 32 | void ccont_set_chargemode ( unsigned char speed ); 33 | void ccont_set_charger ( int state ); 34 | void ccont_set_adcap ( int state ); 35 | void ccont_set_adsrc ( int src ); 36 | unsigned int ccont_get_adval ( void ); 37 | unsigned int ccont_read_adval ( int src ); 38 | unsigned char ccont_get_min ( void ); 39 | unsigned char ccont_get_hr ( void ); 40 | unsigned char ccont_get_day ( void ); 41 | 42 | #define CCONT_VSEL_3V 0 43 | #define CCONT_VSEL_5V 1 44 | -------------------------------------------------------------------------------- /tools/animation studio/Progetto1.vbp: -------------------------------------------------------------------------------- 1 | Type=Exe 2 | Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#..\..\WINDOWS\System32\stdole2.tlb#OLE Automation 3 | Object={FE0065C0-1B7B-11CF-9D53-00AA003C9CB6}#1.1#0; COMCT232.OCX 4 | Form=frmBitmap.frm 5 | Object={831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0; MSCOMCTL.OCX 6 | Object={38911DA0-E448-11D0-84A3-00DD01104159}#1.1#0; COMCT332.OCX 7 | Object={86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0; mscomct2.ocx 8 | Object={F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0; COMDLG32.OCX 9 | Form=Form1.frm 10 | Form=Form2.frm 11 | Form=Form3.frm 12 | Form=frmAbout.frm 13 | Form=frmBitmap2.frm 14 | Module=modFunctions; modFunctions.bas 15 | Form=Form4.frm 16 | IconForm="frmeditBitmap" 17 | Startup="frmBitmap" 18 | HelpFile="" 19 | Title="Progetto1" 20 | ExeName32="[MADos] AnImAtIoNs .eXe" 21 | Path32="..\..\Documents and Settings\DanielR\Desktop" 22 | Command32="" 23 | Name="bmpedit" 24 | HelpContextID="0" 25 | CompatibleMode="0" 26 | MajorVer=1 27 | MinorVer=0 28 | RevisionVer=0 29 | AutoIncrementVer=0 30 | ServerSupportFiles=0 31 | VersionComments="For the [MADos] developer" 32 | VersionCompanyName="pEzZoT_tEaM [MADos]" 33 | VersionFileDescription="For the [MADos] developer" 34 | VersionLegalCopyright="open source" 35 | VersionLegalTrademarks="open source" 36 | VersionProductName="Nokia Animation Editor v0.1 " 37 | CompilationType=0 38 | OptimizationType=0 39 | FavorPentiumPro(tm)=0 40 | CodeViewDebugInfo=0 41 | NoAliasing=-1 42 | BoundsCheck=-1 43 | OverflowCheck=-1 44 | FlPointCheck=-1 45 | FDIVCheck=-1 46 | UnroundedFP=-1 47 | StartMode=0 48 | Unattended=0 49 | Retained=0 50 | ThreadPerObject=0 51 | MaxNumberOfThreads=1 52 | 53 | [MS Transaction Server] 54 | AutoRefresh=1 55 | 56 | [AppForge Global] 57 | MODID=B298C5CC-EB58-40FB-9A84-F1263CC054F7 58 | -------------------------------------------------------------------------------- /include/core/ui.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * MADos, a free OS for N* handsets 4 | * Copyright (C) 2003/2004 MADos Core Developer Team 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * contact http://64.246.26.121/forum/forumdisplay.php?f=99 21 | * 22 | */ 23 | 24 | 25 | int ui_getnumber ( char *ptext, unsigned char max_length, unsigned char min_length ); 26 | void ui_gettext ( char *ptext, unsigned char max_length, char *output, unsigned char ui_type ); 27 | void ui_draw_scrolltext ( char *ptext ); 28 | unsigned char ui_dialog_box ( char *ptext, char **buttons ); 29 | 30 | #define UI_ALIGN_LEFT 0x00 31 | #define UI_ALIGN_RIGHT 0x01 32 | #define UI_ALIGN_CENTER 0x02 33 | 34 | #define UI_TYPE_UPPERCASE 0x01 35 | #define UI_TYPE_LOWERCASE 0x02 36 | #define UI_TYPE_NUMBER 0x04 37 | #define UI_TYPE_HEX 0x08 38 | #define UI_TYPE_TEXT UI_TYPE_LOWERCASE | UI_TYPE_UPPERCASE 39 | #define UI_TYPE_ALL UI_TYPE_LOWERCASE | UI_TYPE_UPPERCASE | UI_TYPE_NUMBER 40 | //#define UI_TYPE_HEX UI_TYPE_NUMBER | UI_TYPE_UPPERCASE 41 | -------------------------------------------------------------------------------- /include/hw/kpd.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * MADos, a free OS for N* handsets 4 | * Copyright (C) 2003/2004 MADos Core Developer Team 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * contact http://64.246.26.121/forum/forumdisplay.php?f=99 21 | * 22 | */ 23 | 24 | 25 | void kpd_init ( void ); 26 | void kpd_int_handler ( void ); 27 | unsigned char kpd_getkey ( void ); 28 | unsigned char kpd_get_second_key ( void ); 29 | unsigned char kpd_get_third_key ( void ); 30 | unsigned int kpd_getlast ( void ); 31 | unsigned char kpd_readkey ( void ); 32 | void kpd_wait_release_x ( int ms ); 33 | void kpd_wait_release ( void ); 34 | void kpd_wait_keypress_x ( int ms ); 35 | void kpd_wait_keypress ( void ); 36 | void kpd_buffer_clr ( void ); 37 | void kpd_mode ( unsigned char mode ); 38 | 39 | #define KPD_BUFSIZE 0x20 40 | 41 | #define KPD_UPARROW 0x16 42 | #define KPD_DWNARROW 0x13 43 | #define KPD_CANCEL 0x21 44 | #define KPD_SOFTBTN1 0x20 45 | #define KPD_OFF 0x30 46 | 47 | #define KPD_BUFFERED 0x00 48 | #define KPD_UNBUFFERED 0x01 49 | -------------------------------------------------------------------------------- /hw/dspblocks.c: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * MADos, a free OS for N* handsets 4 | * Copyright (C) 2003/2004 MADos Core Developer Team 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * contact http://64.246.26.121/forum/forumdisplay.php?f=99 21 | * 22 | */ 23 | 24 | /** 25 | * DSP code blocks 26 | * wumpus 2003 27 | * 28 | * merged into MADos by g3gg0 29 | */ 30 | 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | 37 | 38 | /** 39 | * Get codeblock by ID 40 | * @param n 41 | * Codeblock ID 42 | * 0x00 = Initialisation 43 | * 0x01 = MDI setup 44 | * 0x14 = Secondary initialisation 45 | */ 46 | struct dsp_codeblock * 47 | dspblocks_get_block ( int n ) 48 | { 49 | switch ( n ) 50 | { 51 | case 0x00: 52 | return &block00; 53 | case 0x01: 54 | return &block01; 55 | case 0x14: 56 | return &block14; 57 | } 58 | return 0; 59 | } 60 | -------------------------------------------------------------------------------- /include/apps/snake.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * MADos, a free OS for N* handsets 4 | * Copyright (C) 2003/2004 MADos Core Developer Team 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * contact http://64.246.26.121/forum/forumdisplay.php?f=99 21 | * 22 | */ 23 | 24 | void snake_vibra_thread ( void ); 25 | void snake_sound_thread ( void ); 26 | void snake_chg_level ( void ); 27 | void snake_chg_laby ( void ); 28 | void snake_draw ( unsigned char *posx, unsigned char *posy, unsigned char *applez_x, unsigned char *applez_y ); 29 | unsigned char snake_check_apple ( unsigned char x, unsigned char y, unsigned char *applez_x, unsigned char *applez_y, unsigned char nocheck ); 30 | void snake_kill_apple ( unsigned char x, unsigned char y, unsigned char *applez_x, unsigned char *applez_y ); 31 | unsigned char snake_check_snake ( unsigned char x, unsigned char y, unsigned char *posx, unsigned char *posy, unsigned char nocheck ); 32 | void snake_generate_apple ( unsigned char *posx, unsigned char *posy, unsigned char *applez_x, unsigned char *applez_y ); 33 | void snake_game_over ( unsigned int points ); 34 | void snake_start ( void ); 35 | void snake_main ( void ); 36 | -------------------------------------------------------------------------------- /Attic/nlib/src/gensio.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | /** 7 | * Initialize gensio 8 | */ 9 | void 10 | IO_gensioInitialize ( ) 11 | { 12 | /* 13 | * Phase 1 14 | */ 15 | _io[0xAF] = 0x60; 16 | _io[0x6F] = 0x04; 17 | _io[0xEF] = 0x00; 18 | 19 | /* 20 | * Phase 2 21 | */ 22 | _io[IO_CLOCKS] |= CLOCK_GENSIO; 23 | 24 | _io[0xAD] = 0xCF; 25 | _io[0xED] = 0x20; 26 | _io[0xAE] = 0x20; 27 | _io[0xEE] = 0x80; 28 | } 29 | 30 | /** 31 | * Wait for gensio status bits. 32 | */ 33 | void 34 | IO_gensioWait ( uint bits ) 35 | { 36 | while ( !( _io[IO_LCD_STATUS] & bits ) ) ; 37 | } 38 | 39 | /** 40 | * GenSIO control send 41 | */ 42 | void 43 | IO_gensioSend ( uint xxx ) 44 | { 45 | IO_gensioWait ( 0x02 ); 46 | _io[IO_GENSIO_CTRL] = xxx; 47 | } 48 | 49 | /** 50 | * This is used before CCont and LCD serial operations. 51 | */ 52 | void 53 | IO_gensioStart ( ) 54 | { 55 | /* 56 | * 0010 0101 57 | */ 58 | IO_gensioSend ( 0x25 ); 59 | //IO_gensioSend(0x05); /* 00110111 3456 */ 60 | //IO_gensioSend(0x37); /* 00110111 3456 */ 61 | //IO_gensioSend(0x35); /* 00110101 3168 */ 62 | //IO_gensioSend(0x30); /* 00110000 2448 */ 63 | //IO_gensioSend(0x2F); /* 00101111 2305 */ 64 | //IO_gensioSend(0x2E); /* 00101110 2160 */ 65 | //IO_gensioSend(0x2D); /* 00101101 2016 */ 66 | //IO_gensioSend(0x2C); /* 00101100 1872 */ 67 | //IO_gensioSend(0x2B); /* 00101011 1728 */ 68 | //IO_gensioSend(0x2A); /* 00101010 1584 */ 69 | //IO_gensioSend(0x29); /* 00101001 1440 */ 70 | //IO_gensioSend(0x28); /* 00101000 1296 */ 71 | //IO_gensioSend(0x27); /* 00100111 1153 */ 72 | //IO_gensioSend(0x25); /* 00100101 981 */ 73 | //IO_gensioSend(0x24); /* 00100100 981 */ 74 | //IO_gensioSend(0x23); /* 00100011 */ 75 | } 76 | -------------------------------------------------------------------------------- /Attic/nlib/src/flashdbg.c: -------------------------------------------------------------------------------- 1 | /** 2 | * Nokia Flasher functions 3 | * wumpus 2003 4 | */ 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | /** 12 | * Simple clocked serial -- Receive byte 13 | */ 14 | uint 15 | IO_flashdbgReceiveByte ( ) 16 | { 17 | while ( !( _io[IO_MBUS_STATUS] & 0x20 ) ) ; 18 | return _io[IO_MBUS_BYTE]; 19 | } 20 | 21 | /** 22 | * Simple clocked serial -- Send byte 23 | */ 24 | void 25 | IO_flashdbgSendByte ( uint dat ) 26 | { 27 | int x; 28 | for ( x = 8; x > 0; x-- ) 29 | { 30 | /* 31 | * wait SCL low 32 | */ 33 | while ( ( _io[IO_MBUS_STATUS] & 0x40 ) ) ; 34 | _io[IO_MBUS_STATUS] = dat << 7; 35 | /* 36 | * wait SCL high 37 | */ 38 | while ( !( _io[IO_MBUS_STATUS] & 0x40 ) ) ; 39 | dat >>= 1; 40 | } 41 | } 42 | 43 | /** 44 | * Simple clocked serial -- Set SDA (for host signalling/notification) 45 | */ 46 | void 47 | IO_flashdbgSetSDA ( int state ) 48 | { 49 | IO_setBit ( IO_MBUS_STATUS, 0x80, state ); 50 | } 51 | 52 | void 53 | IO_flashdbgSendPacket ( uint8 * packet, uint length ) 54 | { 55 | IO_globalInterruptEnable ( 0 ); 56 | 57 | IO_flashdbgSetSDA ( 0x80 ); 58 | IO_flashdbgSendByte ( length ); 59 | while ( length ) 60 | { 61 | IO_flashdbgSendByte ( *packet ); 62 | packet++; 63 | length--; 64 | } 65 | IO_flashdbgSetSDA ( 0x00 ); 66 | 67 | IO_globalInterruptEnable ( 1 ); 68 | } 69 | 70 | void 71 | IO_flashdbg ( uint code, uint8 * param, uint length ) 72 | { 73 | uint8 spacket[4 + length]; 74 | int x; 75 | *( uint32 * ) & spacket[0] = code; 76 | for ( x = 0; x < length; x++ ) 77 | { 78 | spacket[x + 4] = param[x]; 79 | } 80 | IO_flashdbgSendPacket ( spacket, sizeof ( spacket ) ); 81 | } 82 | -------------------------------------------------------------------------------- /include/hw/mbus.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * MADos, a free OS for N* handsets 4 | * Copyright (C) 2003/2004 MADos Core Developer Team 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * contact http://64.246.26.121/forum/forumdisplay.php?f=99 21 | * 22 | */ 23 | 24 | #ifndef WMX_MBUS 25 | #define WMX_MBUS 26 | 27 | #define MBUS_STOP 0 28 | #define MBUS_TRANSMIT 1 29 | #define MBUS_RECEIVE 2 30 | 31 | #define MBUS_SPEED_9600 0 32 | #define MBUS_SPEED_19200 1 33 | #define MBUS_SPEED_57600 3 34 | #define MBUS_SPEED_115200 4 35 | 36 | /** Initialize mbus */ 37 | void mbus_init ( int speed ); 38 | 39 | /** Set MBus mode to transmit or receive 40 | Make sure there is a byte in the transmit buffer before starting transmit 41 | */ 42 | void mbus_mode ( int mode ); /* MBUS_... */ 43 | 44 | /** 45 | * Initialize MBUS driver and hardware 46 | */ 47 | void mbus_start ( int speed ); 48 | 49 | /* TEST */ 50 | #define MBUS_QUEUESIZE 256 51 | 52 | /** 53 | * Transmit a block of data over MBUS line. Blocks. 54 | */ 55 | int mbus_transmit ( unsigned char *data, int size ); 56 | 57 | int mbus_receive ( unsigned char *address, int size ); 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /include/core/ffs.h: -------------------------------------------------------------------------------- 1 | 2 | #define FFS_VERSION 1 3 | #define FFS_COMPAT 1 4 | 5 | #define FFS_ERROR 1 6 | #define FFS_INV_MAGIC 2 7 | #define FFS_INV_COMPAT 3 8 | #define FFS_FSERR 4 9 | #define FFS_FLASHERR 5 10 | #define FFS_INV_PARM 6 11 | #define FFS_NOTFOUND 7 12 | #define FFS_INV_ADDR 8 13 | 14 | #define FFS_MAGIC "MADosFFS" 15 | 16 | 17 | #define FFS_STATE_FREE 0xFF 18 | #define FFS_STATE_ASSIGNED 0xFE 19 | #define FFS_STATE_ALLOCATED 0xFC 20 | #define FFS_STATE_EXTENDED 0xF8 21 | #define FFS_STATE_DELETED 0xF0 22 | 23 | #define FFS_FIND_ANY 0x01 24 | #define FFS_FIND_FIRST 0x00 25 | 26 | 27 | 28 | 29 | typedef struct 30 | { 31 | unsigned char magic[8]; 32 | unsigned long length; 33 | unsigned char compat; 34 | unsigned char version; 35 | unsigned char spare[6]; 36 | } 37 | ffs_hdr; 38 | 39 | typedef struct 40 | { 41 | unsigned long length; 42 | unsigned long fsize; 43 | unsigned char state; 44 | unsigned char padding[3]; 45 | } 46 | ffs_fhdr; 47 | 48 | 49 | int ffs_validaddr ( void *base ); 50 | int ffs_check ( void *base ); 51 | int ffs_format ( void *base ); 52 | void *ffs_find_first_free ( void ); 53 | int ffs_add_file ( unsigned char *name, unsigned long length ); 54 | void *ffs_find_file ( const char *name ); 55 | unsigned int ffs_file_exists ( const char *name ); 56 | int ffs_unlink ( const char *name ); 57 | unsigned int ffs_get_size ( const char *name ); 58 | FILE *ffs_open_file ( const char *name, const char *mode ); 59 | int ffs_close_file ( FILE * f ); 60 | int ffs_fclose ( FILE * stream ); 61 | FILE *ffs_fopen ( const char *name, const char *mode ); 62 | unsigned long ffs_fwrite ( void *ptr, unsigned long size, unsigned long nmemb, FILE * stream ); 63 | unsigned long ffs_fread ( void *ptr, unsigned long size, unsigned long nmemb, FILE * stream ); 64 | char *ffs_list_file ( unsigned char state ); 65 | char *ffs_list_file_ex ( unsigned char state, int number ); 66 | int ffs_file_count ( unsigned char state ); 67 | -------------------------------------------------------------------------------- /include/hw/buzzer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * MADos, a free OS for N* handsets 4 | * Copyright (C) 2003/2004 MADos Core Developer Team 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * contact http://64.246.26.121/forum/forumdisplay.php?f=99 21 | * 22 | */ 23 | 24 | typedef struct 25 | { 26 | char *tone_list; // "cpdpcpdpepfpgpaphp" // 'p' - pause 27 | char *duration_list; // 1, 2, 4, ... // n * 100ms 28 | char *octave_list; // 1, 2, 3 ... // c1 = 200 Hz, c2 = 400 Hz, c3 = 800 Hz 29 | unsigned char volume; // 0x00 - 0xFF 30 | char duration_fixed; // if set, duration_list is ignored 31 | char octave_fixed; // if set, octave_list is ignored 32 | char pause_fixed; // if set, after every tone from tone_list a pause is insert. tone_list without 'p'. 33 | char *interrupt; // pointer to 1 byte. if changed, buzzer_play_tones breaks 34 | char break_on_keypress; // if set to 1, buzzer_play_tones breaks on keypress 35 | } 36 | buzzer_tones_t; 37 | 38 | void buzzer_init ( void ); 39 | void buzzer_setvol ( unsigned char volume ); 40 | void buzzer_setfreq ( unsigned short freq ); 41 | void buzzer_play_tones ( buzzer_tones_t * tone_info ); 42 | -------------------------------------------------------------------------------- /include/core/ipc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * MADos, a free OS for N* handsets 4 | * Copyright (C) 2003/2004 MADos Core Developer Team 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * contact http://64.246.26.121/forum/forumdisplay.php?f=99 21 | * 22 | */ 23 | 24 | 25 | #ifdef LOADER 26 | #define IPC_BUFFERS 0x04 27 | #define IPC_BUFSIZE 0x20 28 | #else 29 | #define IPC_BUFFERS 0x04 30 | #define IPC_BUFSIZE 0xFF 31 | #endif 32 | 33 | #ifdef XX 34 | unsigned char b; // buffer number 35 | #endif 36 | 37 | typedef struct 38 | { 39 | unsigned char *b; // buffer number 40 | unsigned int s; // ringbuffer start 41 | unsigned int e; // ringbuffer end 42 | unsigned char l; // locked? 43 | } 44 | ipc_data; 45 | 46 | void ipc_wakeup_all ( void ); 47 | void ipc_wakeup ( unsigned char thread ); 48 | unsigned int ipc_get_size ( ipc_data * data, int lock ); 49 | void ipc_reorder ( ipc_data * data ); 50 | unsigned char ipc_poll ( void ); 51 | unsigned char *ipc_read ( unsigned int *len ); 52 | unsigned int ipc_get_blocksize ( ipc_data * data ); 53 | int ipc_flush ( void ); 54 | int ipc_add ( unsigned char thread, unsigned char *buf, unsigned int len ); 55 | unsigned char ipc_assign_data ( unsigned char thread, unsigned char num ); 56 | -------------------------------------------------------------------------------- /include/dspblocks/block0F.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * MADos, a free OS for N* handsets 4 | * Copyright (C) 2003/2004 MADos Core Developer Team 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * contact http://64.246.26.121/forum/forumdisplay.php?f=99 21 | * 22 | */ 23 | 24 | /* 0f 00306f64 w0:ff80 w1:ff80 size:0068 offset:0200 w4:008c w5:0000 25 | Block: (MCU)00010400-000104d0 (DSP)0a00-0a68 BS=008c (TARG)ff80-ffe8 */ 26 | static struct dsp_codeblock block0F = { 27 | {0xFF80, 0xFF80, 0x0068, 0x0200, 0x008C}, 28 | { 29 | 0x771D, 0xFFA8, 0xF073, 0xFF85, 0xF49B, 0xF073, 0x0F00, 0x0006, 30 | 0xF49B, 0xF495, 0xF495, 0xF495, 0xF49B, 0xF495, 0xF495, 0xF495, 31 | 0xF49B, 0xF495, 0xF495, 0xF495, 0xF49B, 0xF495, 0xF495, 0xF495, 32 | 0xF49B, 0xF495, 0xF495, 0xF495, 0xF49B, 0xF495, 0xF495, 0xF495, 33 | 0xF49B, 0xF495, 0xF495, 0xF495, 0xF49B, 0xF495, 0xF495, 0xF495, 34 | 0xF49B, 0xF495, 0xF495, 0xF495, 0xF49B, 0xF495, 0xF495, 0xF495, 35 | 0xF49B, 0xF495, 0xF495, 0xF495, 0xF49B, 0xF495, 0xF495, 0xF495, 36 | 0xF49B, 0xF495, 0xF495, 0xF495, 0xF49B, 0xF495, 0xF495, 0xF495, 37 | 0x4A1E, 0x4A06, 0xF880, 0x22DA, 0x4A1E, 0x4A06, 0xF880, 0x27CD, 38 | 0x4A1E, 0x4A06, 0xF880, 0x27CD, 0x4A1E, 0xF880, 0x05FA, 0xF495, 39 | 0x4A1E, 0x4A06, 0xF880, 0x25DF, 0xF49B, 0xF495, 0xF495, 0xF495, 40 | 0xF49B, 0xF495, 0xF495, 0xF495, 0xF49B, 0xF495, 0xF495, 0xF495, 41 | 0x4A1E, 0x4A06, 0xF880, 0x27CD, 0x4A1E, 0x4A06, 0xF880, 0x2B53} 42 | }; 43 | -------------------------------------------------------------------------------- /Attic/nlib/src/dspblocks/block1B.h: -------------------------------------------------------------------------------- 1 | /* 1b 0030814c w0:0f00 w1:0000 size:00df offset:0f00 w4:00dc w5:0000 2 | Block: (MCU)00011e00-00011fbe (DSP)1700-17df BS=00dc (TARG)0f00-0fdf */ 3 | static struct dsp_codeblock block1B = { 4 | {0x0F00, 0x0000, 0x00DF, 0x0F00, 0x00DC}, 5 | { 6 | 0xF7BB, 0x7718, 0x02C1, 0x771D, 0xFFA8, 0x7728, 0x2000, 0x7758, 7 | 0x51EE, 0xF070, 0x0140, 0xF495, 0x76F8, 0x0803, 0x0006, 0x7DF8, 8 | 0x0803, 0xFF87, 0x7CF8, 0x0802, 0xFF87, 0xF074, 0x0F67, 0x10F8, 9 | 0x087F, 0xF844, 0x0F17, 0x7213, 0x087B, 0x7212, 0x0881, 0x6BF8, 10 | 0x0013, 0x0800, 0xF074, 0x0FC4, 0x76F8, 0x087F, 0x0001, 0x44F8, 11 | 0x087D, 0x1AF8, 0x087E, 0x08F8, 0x0881, 0x82F8, 0x087D, 0x80F8, 12 | 0x087E, 0xF847, 0x0F4F, 0x10F8, 0x0880, 0xF844, 0x0F33, 0x7213, 13 | 0x087C, 0x7212, 0x0881, 0x6BF8, 0x0013, 0x0800, 0xF074, 0x0FC4, 14 | 0x76F8, 0x0880, 0x0001, 0x44F8, 0x087D, 0x1AF8, 0x087E, 0x08F8, 15 | 0x0881, 0x82F8, 0x087D, 0x80F8, 0x087E, 0xF846, 0x0F17, 0xF074, 16 | 0x0F70, 0x82F8, 0x04F7, 0x80F8, 0x04F8, 0xF020, 0x1387, 0xF495, 17 | 0x75F8, 0x0008, 0x000E, 0xEC16, 0xF495, 0xF074, 0x0F8B, 0x80F8, 18 | 0x0800, 0x7CF8, 0x0801, 0xFF87, 0xF4E1, 0xF073, 0x0F64, 0xF062, 19 | 0x5A19, 0xF040, 0x7B2D, 0x4EF8, 0x0060, 0xFC00, 0x0000, 0x0000, 20 | 0x56F8, 0x0060, 0x7713, 0x0F6E, 0x7712, 0x0001, 0xF074, 0x0FCC, 21 | 0xFC00, 0xF495, 0xF495, 0xF495, 0xF495, 0xF495, 0xF495, 0xF495, 22 | 0xF495, 0xF495, 0xF495, 0xF495, 0xF495, 0x771D, 0xFFA0, 0xF495, 23 | 0xF495, 0xF073, 0x0F00, 0xE80D, 0xF495, 0x75F8, 0x0008, 0x0000, 24 | 0xEC16, 0xF495, 0xE810, 0xF495, 0x75F8, 0x0008, 0x000C, 0xF495, 25 | 0xE90F, 0xF074, 0x0FB3, 0xFC00, 0x74F8, 0x0009, 0x002D, 0xF063, 26 | 0x1000, 0xF844, 0x0F9C, 0xF340, 0x0010, 0xF495, 0x75F8, 0x000B, 27 | 0x002C, 0xEC0E, 0xF495, 0x74F8, 0x0008, 0x002D, 0xF130, 0x1000, 28 | 0xF84C, 0x0FAB, 0xFC00, 0x4A0B, 0xF074, 0x0F9C, 0xE90D, 0xF074, 29 | 0x0F9C, 0xF030, 0x000C, 0xF495, 0xF010, 0x000C, 0xF844, 0x0FB6, 30 | 0x8A0B, 0xF074, 0x0F9C, 0xFC00, 0x6D8A, 0x56F8, 0x0060, 0xF074, 31 | 0x0FCC, 0x4EF8, 0x0060, 0xFC00, 0x4593, 0xF793, 0x771A, 0x000F, 32 | 0xF072, 0x0FDB, 0xF591, 0xF491, 0xF495, 0xF495, 0xFF0C, 0xF065, 33 | 0x2049, 0xFF0C, 0xF050, 0x7E95, 0x6C8A, 0x0FCC, 0xFC00} 34 | }; 35 | -------------------------------------------------------------------------------- /include/apps/tetris.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * MADos, a free OS for N* handsets 4 | * Copyright (C) 2003/2004 MADos Core Developer Team 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * contact http://64.246.26.121/forum/forumdisplay.php?f=99 21 | * 22 | */ 23 | 24 | void tetris_main ( void ); 25 | void tetris_sound_thread ( void ); 26 | void tetris_chg_shapes ( void ); 27 | void tetris_chg_design ( void ); 28 | void tetris_init_game ( void ); 29 | void tetris_loop ( void ); 30 | void tetris_drop_block ( void ); 31 | void tetris_show_score ( void ); 32 | void tetris_end_game ( void ); 33 | void tetris_left_proc ( void ); 34 | void tetris_right_proc ( void ); 35 | void tetris_anti_proc ( void ); 36 | void tetris_clock_proc ( void ); 37 | void tetris_fast_proc ( void ); 38 | void tetris_show_next ( void ); 39 | void tetris_print_shape ( int shape_no, int x, int y, int rot, int col ); 40 | void tetris_set1pixel ( int x, int y, int col ); 41 | void tetris_print_all_blocks ( void ); 42 | 43 | 44 | void tetris_define_shapes ( void ); 45 | void tetris_store_shape ( int shape_no, int xpos, int ypos, int rot ); 46 | void tetris_create_shape ( void ); 47 | int tetris_level ( void ); 48 | int tetris_block_can_drop ( int shape_no, int xpos, int ypos, int rot ); 49 | int tetris_block_can_left ( int shape_no, int xpos, int ypos, int rot ); 50 | int tetris_block_can_right ( int shape_no, int xpos, int ypos, int rot ); 51 | void tetris_remove_full_lines ( int y ); 52 | int tetris_check_rot ( int shape_no, int xpos, int ypos, int newrot ); 53 | -------------------------------------------------------------------------------- /include/apps/huffman_testtext.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * MADos, a free OS for N* handsets 4 | * Copyright (C) 2003/2004 MADos Core Developer Team 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * contact http://64.246.26.121/forum/forumdisplay.php?f=99 21 | * 22 | */ 23 | 24 | 25 | const unsigned char huffman_testtext[] = { 26 | 0x55, 0x90, 0x6C, 0xBB, 0x9D, 0x6E, 0x9B, 0x4E, 0xD9, 0x55, 0xB7, 0xEC, 0x36, 0xD1, 0xB3, 0x56, 27 | 0xE5, 0xB2, 0x6E, 0x15, 0x5B, 0x1E, 0xDB, 0xB7, 0x56, 0xEB, 0x96, 0x65, 0xD5, 0x6C, 0x5B, 0xBD, 28 | 0xBC, 0xED, 0x75, 0x5B, 0xC6, 0x43, 0x93, 0xD9, 0x46, 0x53, 0x56, 0x91, 0xAF, 0xEC, 0xF5, 0xB5, 29 | 0x6E, 0xCF, 0x81, 0x6E, 0x00, 0x3F, 0xA3, 0x4E, 0xB8, 0x85, 0x7A, 0xD4, 0x12, 0x4A, 0x41, 0x48, 30 | 0x7E, 0x68, 0x50, 0x22, 0x0D, 0x51, 0x18, 0x82, 0x09, 0x40, 0x9C, 0x28, 0x09, 0x21, 0x09, 0x69, 31 | 0x39, 0xE3, 0x1C, 0x86, 0x10, 0xA8, 0xE1, 0xE2, 0x0B, 0x30, 0x49, 0x29, 0x04, 0x1F, 0x04, 0x05, 32 | 0x21, 0x55, 0x36, 0xE3, 0xD0, 0xD4, 0x30, 0x85, 0x28, 0x38, 0x26, 0xA0, 0x92, 0x1C, 0x84, 0xB4, 33 | 0x9C, 0xF1, 0x8E, 0x7E, 0x6A, 0x38, 0x43, 0x1B, 0xA0, 0x92, 0x1C, 0xC2, 0x9D, 0x8D, 0x42, 0x39, 34 | 0xA8, 0x77, 0x45, 0x32, 0x88, 0x72, 0xAD, 0x87, 0x02, 0x11, 0x06, 0xA8, 0x8C, 0x42, 0x51, 0xBB, 35 | 0x51, 0xA6, 0xC3, 0x95, 0x49, 0x04, 0xB4, 0x9C, 0xF1, 0x8E, 0x41, 0x53, 0xC9, 0x0B, 0x81, 0x2B, 36 | 0xC3, 0x10, 0x48, 0x06, 0x10, 0xC6, 0xE8, 0x24, 0x84, 0xD5, 0x89, 0x0F, 0x43, 0xBF, 0xBB, 0x03, 37 | 0x0D, 0x33, 0x53, 0xA8, 0x70, 0xA9, 0x8C, 0x6C, 0xEA, 0x08, 0x3E, 0x08, 0x7D, 0xEC, 0x00, 38 | }; 39 | -------------------------------------------------------------------------------- /include/core/milieu.h: -------------------------------------------------------------------------------- 1 | 2 | /*============================================================================ 3 | 4 | This C header file is part of the SoftFloat IEC/IEEE Floating-point Arithmetic 5 | Package, Release 2b. 6 | 7 | Written by John R. Hauser. This work was made possible in part by the 8 | International Computer Science Institute, located at Suite 600, 1947 Center 9 | Street, Berkeley, California 94704. Funding was partially provided by the 10 | National Science Foundation under grant MIP-9311980. The original version 11 | of this code was written as part of a project to build a fixed-point vector 12 | processor in collaboration with the University of California at Berkeley, 13 | overseen by Profs. Nelson Morgan and John Wawrzynek. More information 14 | is available through the Web page `http://www.cs.berkeley.edu/~jhauser/ 15 | arithmetic/SoftFloat.html'. 16 | 17 | THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE. Although reasonable effort has 18 | been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT TIMES 19 | RESULT IN INCORRECT BEHAVIOR. USE OF THIS SOFTWARE IS RESTRICTED TO PERSONS 20 | AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ALL LOSSES, 21 | COSTS, OR OTHER PROBLEMS THEY INCUR DUE TO THE SOFTWARE, AND WHO FURTHERMORE 22 | EFFECTIVELY INDEMNIFY JOHN HAUSER AND THE INTERNATIONAL COMPUTER SCIENCE 23 | INSTITUTE (possibly via similar legal warning) AGAINST ALL LOSSES, COSTS, OR 24 | OTHER PROBLEMS INCURRED BY THEIR CUSTOMERS AND CLIENTS DUE TO THE SOFTWARE. 25 | 26 | Derivative works are acceptable, even for commercial purposes, so long as 27 | (1) the source code for the derivative work includes prominent notice that 28 | the work is derivative, and (2) the source code includes prominent notice with 29 | these four paragraphs for those parts of this code that are retained. 30 | 31 | =============================================================================*/ 32 | 33 | /*---------------------------------------------------------------------------- 34 | | Include common integer types and flags. 35 | *----------------------------------------------------------------------------*/ 36 | #include "arm-gcc.h" 37 | 38 | /*---------------------------------------------------------------------------- 39 | | Symbolic Boolean literals. 40 | *----------------------------------------------------------------------------*/ 41 | /*enum { 42 | FALSE = 0, 43 | TRUE = 1 44 | };*/ 45 | -------------------------------------------------------------------------------- /include/hw/kpd_getkey_matrix.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * MADos, a free OS for N* handsets 4 | * Copyright (C) 2003/2004 MADos Core Developer Team 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * contact http://64.246.26.121/forum/forumdisplay.php?f=99 21 | * 22 | */ 23 | 24 | 25 | const unsigned char kpd_getkey_matrix[2][25] = { 26 | 27 | {0x10, 0x20, 0x12, 0x03, 0x0F, 28 | 0x07, 0x08, 0x09, 0x0f, 0x0F, 29 | 0x04, 0x05, 0x06, 0x0f, 0x0F, 30 | 0x01, 0x02, 0x01, 0x13, 0x0F, 31 | 0x21, 0x0f, 0x00, 0x16, 0x0F}, 32 | //return values for the keys (3310): 33 | //dd * | menu | # | 3 (PWR)| 34 | //dd 7 | 8 | 9 | NA (PWR)| 35 | //dd 4 | 5 | 6 | NA (PWR)| 36 | //dd 1 | 2 | NA | down (PWR) | 37 | //dd clear | NA | 0 | hoch (PWR) | 38 | {0x12, 0x00, 0x10, 0x21, 0x24, 39 | 0x09, 0x08, 0x07, 0x13, 0x23, 40 | 0x06, 0x05, 0x04, 0x16, 0x22, 41 | 0x03, 0x02, 0x01, 0x20, 0x25, 42 | 0x30, 0x0F, 0x0F, 0x0F, 0x0F} 43 | //return values for the keys (8210): 44 | //dd # | 0 | * | SOFTBTN2 | VOLUP | 45 | //dd 9 | 8 | 7 | DOWN | RED | 46 | //dd 6 | 5 | 4 | UP | GREEN | 47 | //dd 3 | 2 | 1 | SOFTBTN1 | VOLDOWN | 48 | //dd PWR | | | | | 49 | }; 50 | 51 | const unsigned char kpd_off[2][3] = { 52 | {0x0F, 0x13, 0x16}, 53 | {0x03, 0x06, 0x30} 54 | }; 55 | -------------------------------------------------------------------------------- /Attic/nlib/src/interrupt.c: -------------------------------------------------------------------------------- 1 | /** 2 | * Interrupt functions 3 | * wumpus 2003 4 | */ 5 | #include 6 | #include 7 | #include 8 | 9 | /** 10 | * Interrupt handlers (refered to by crt0.s) 11 | */ 12 | inthandler _irq_handlers[IRQ_COUNT]; 13 | inthandler _fiq_handlers[FIQ_COUNT]; 14 | 15 | uint8 _last_int; 16 | /* TODO: IRQ and FIQ 8 */ 17 | 18 | /** 19 | * Set IRQ/FIQ mode 20 | * mode=0 disable, mode!=0 enable 21 | */ 22 | void 23 | IO_globalInterruptEnable ( int mode ) 24 | { 25 | static int icount = -1; 26 | if ( !mode ) 27 | { 28 | /* 29 | * disable 30 | */ 31 | _io[IO_INT_CTRL] = 0xA; 32 | icount--; 33 | } 34 | else 35 | { 36 | /* 37 | * enable 38 | */ 39 | icount++; 40 | if ( icount == 0 ) 41 | _io[IO_INT_CTRL] = 0x5; 42 | } 43 | } 44 | 45 | /** 46 | * Set the handler routine for an interrupt of a certain type. 47 | * 48 | * @param num Interrupt # (FIQ_*, IRQ_*) 49 | * @param handler Handler address 50 | */ 51 | void 52 | IO_setInterruptHandler ( uint num, inthandler handler ) 53 | { 54 | int type = num & ~0x3F; /* decode type */ 55 | num = num & 0x3F; 56 | 57 | switch ( type ) 58 | { 59 | case FIQ: 60 | _fiq_handlers[num] = handler; 61 | break; 62 | case IRQ: 63 | _irq_handlers[num] = handler; 64 | break; 65 | } 66 | } 67 | 68 | /** 69 | * Enable or disable an interrupt. 70 | * 71 | * @param num Interrupt # (FIQ_*, IRQ_*) 72 | * @param state 0 disable, 1 enable 73 | */ 74 | void 75 | IO_setInterruptEnable ( uint num, int state ) 76 | { 77 | int type = num & ~0x3F; /* decode type */ 78 | num = num & 0x3F; 79 | 80 | num = 1 << num; /* bit number */ 81 | state = !state; /* mask 0 = enabled */ 82 | switch ( type ) 83 | { 84 | case FIQ: 85 | IO_setBit ( IO_FIQ_ACTIVE, num, 1 ); /* clear pending */ 86 | IO_setBit ( IO_FIQ_MASK, num, state ); /* mask/unmask */ 87 | break; 88 | case IRQ: 89 | IO_setBit ( IO_IRQ_ACTIVE, num, 1 ); /* clear pending */ 90 | IO_setBit ( IO_IRQ_MASK, num, state ); /* mask/unmask */ 91 | break; 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /Attic/nlib/src/dspblocks/block15.h: -------------------------------------------------------------------------------- 1 | /* 15 0030759c w0:2206 w1:0000 size:00f7 offset:0000 w4:0000 w5:0000 2 | Block: (MCU)00010000-000101ee (DSP)0800-08f7 BS=0000 (TARG)2206-22fd */ 3 | static struct dsp_codeblock block15 = { 4 | {0x2206, 0x0000, 0x00F7, 0x0000, 0x0000}, 5 | { 6 | 0x545E, 0x7E3E, 0x6119, 0x49A8, 0xEC14, 0x16C2, 0x599A, 0x599A, 7 | 0x00A0, 0xFC01, 0x0332, 0x3232, 0x221E, 0x0000, 0x0000, 0x0800, 8 | 0x0800, 0x0E3A, 0x07BA, 0x0E3A, 0x07BA, 0x0000, 0x0000, 0x0000, 9 | 0x7FFF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0800, 0x0800, 0x0800, 10 | 0x0800, 0x0800, 0x0800, 0x0800, 0x0800, 0x0000, 0x0000, 0x0000, 11 | 0x0000, 0x0000, 0x7FFF, 0xFFFF, 0x1156, 0x2CA1, 0x0000, 0x2A80, 12 | 0xFF41, 0xBFA7, 0x0000, 0xF606, 0xF72E, 0x0000, 0x4342, 0x925B, 13 | 0x6EDA, 0xFFFE, 0xDCC3, 0xB0CC, 0x0001, 0x1EE9, 0x4480, 0x33F2, 14 | 0xFFFF, 0xC99C, 0x74A1, 0x0001, 0x248E, 0xB546, 0x274E, 0x0007, 15 | 0x0000, 0x0004, 0x0002, 0x9A45, 0x0008, 0x3B1C, 0x001A, 0x074E, 16 | 0x0052, 0x4F3B, 0x2000, 0x2000, 0x2000, 0x2000, 0x3000, 0x32E5, 17 | 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 18 | 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0xE22F, 19 | 0xE5CB, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 20 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x32E5, 21 | 0x47FA, 0x5092, 0x5092, 0x5092, 0x5092, 0x5092, 0x5092, 0x5092, 22 | 0x5092, 0x5092, 0x5062, 0x4BEE, 0x47B9, 0x43C0, 0x4000, 0xE22F, 23 | 0xD5D5, 0xEED1, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 24 | 0x0000, 0x0000, 0x0060, 0x08E7, 0x0869, 0x07F1, 0x0781, 0x32E5, 25 | 0x47FA, 0x656E, 0x656E, 0x656E, 0x656E, 0x656E, 0x656E, 0x656E, 26 | 0x656E, 0x656E, 0x64F5, 0x5A15, 0x5062, 0x47B9, 0x4000, 0xE22F, 27 | 0xD5D5, 0xC517, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 28 | 0x0000, 0x0000, 0x00F2, 0x15BF, 0x1367, 0x1150, 0x0F73, 0x32E5, 29 | 0x47FA, 0x65CB, 0x7FB2, 0x7FB2, 0x7FB2, 0x7FB2, 0x7FB2, 0x7FB2, 30 | 0x7FB2, 0x7FB2, 0x7EF3, 0x6E18, 0x5F7A, 0x52CD, 0x47CF, 0xE22F, 31 | 0xD5D5, 0xC45E, 0xCC32, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 32 | 0x0000, 0x0000, 0x017D, 0x21B5, 0x1D3C, 0x195A, 0x15FC, 0x1E3D, 33 | 0x2AC4, 0x3C7B, 0x5589, 0x6B2C, 0x6B2C, 0x6B2C, 0x6B2C, 0x6B2C, 34 | 0x6B2C, 0x6B2C, 0x6A8C, 0x5C67, 0x5022, 0x457E, 0x3C44, 0xEE48, 35 | 0xE6F2, 0xDC91, 0xCDE4, 0xD4B9, 0x0000, 0x0000, 0x0000, 0x0000, 36 | 0x0000, 0x0000, 0x0140, 0x1C4A, 0x1889, 0x1547, 0x1274} 37 | }; 38 | -------------------------------------------------------------------------------- /Attic/nlib/src/dspblocks/block16.h: -------------------------------------------------------------------------------- 1 | /* 16 003077b0 w0:2206 w1:0000 size:00f7 offset:0000 w4:0000 w5:0000 2 | Block: (MCU)00010000-000101ee (DSP)0800-08f7 BS=0000 (TARG)2206-22fd */ 3 | static struct dsp_codeblock block16 = { 4 | {0x2206, 0x0000, 0x00F7, 0x0000, 0x0000}, 5 | { 6 | 0x545E, 0x7E3E, 0x6119, 0x49A8, 0xEC14, 0x16C3, 0x599A, 0x599A, 7 | 0x0096, 0xFC00, 0x0032, 0x3232, 0x13EA, 0x0000, 0x0000, 0x0800, 8 | 0x0800, 0x1418, 0x0700, 0x1418, 0x0700, 0x0000, 0x0000, 0x0000, 9 | 0x7FFF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0800, 0x0800, 0x0800, 10 | 0x0800, 0x0800, 0x0800, 0x0800, 0x0800, 0x0000, 0x0000, 0x0000, 11 | 0x0000, 0x0000, 0x7FFF, 0xFFFE, 0xF004, 0x3F34, 0x0000, 0xB833, 12 | 0x1004, 0x6AA6, 0x0000, 0xD3B3, 0x9D73, 0x0000, 0x2DB0, 0xC66D, 13 | 0x7193, 0xFFFF, 0xB402, 0x82D0, 0x0000, 0x2A5F, 0x43E8, 0x47DB, 14 | 0x0005, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 15 | 0x0000, 0x0003, 0x0008, 0x3B1C, 0x0010, 0x6C42, 0x0020, 0xC49B, 16 | 0x0041, 0x6179, 0x2000, 0x2000, 0x2000, 0x2000, 0x3000, 0x32E5, 17 | 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 18 | 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0xE22F, 19 | 0xE5CB, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 20 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x32E5, 21 | 0x47FA, 0x5092, 0x5092, 0x5092, 0x5092, 0x5092, 0x5092, 0x5092, 22 | 0x5092, 0x5092, 0x5062, 0x4BEE, 0x47B9, 0x43C0, 0x4000, 0xE22F, 23 | 0xD5D5, 0xEED1, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 24 | 0x0000, 0x0000, 0x0060, 0x08E7, 0x0869, 0x07F1, 0x0781, 0x32E5, 25 | 0x47FA, 0x656E, 0x656E, 0x656E, 0x656E, 0x656E, 0x656E, 0x656E, 26 | 0x656E, 0x656E, 0x64F5, 0x5A15, 0x5062, 0x47B9, 0x4000, 0xE22F, 27 | 0xD5D5, 0xC517, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 28 | 0x0000, 0x0000, 0x00F2, 0x15BF, 0x1367, 0x1150, 0x0F73, 0x32E5, 29 | 0x47FA, 0x65CB, 0x7FB2, 0x7FB2, 0x7FB2, 0x7FB2, 0x7FB2, 0x7FB2, 30 | 0x7FB2, 0x7FB2, 0x7EF3, 0x6E18, 0x5F7A, 0x52CD, 0x47CF, 0xE22F, 31 | 0xD5D5, 0xC45E, 0xCC32, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 32 | 0x0000, 0x0000, 0x017D, 0x21B5, 0x1D3C, 0x195A, 0x15FC, 0x1E3D, 33 | 0x2AC4, 0x3C7B, 0x5589, 0x6B2C, 0x6B2C, 0x6B2C, 0x6B2C, 0x6B2C, 34 | 0x6B2C, 0x6B2C, 0x6A8C, 0x5C67, 0x5022, 0x457E, 0x3C44, 0xEE48, 35 | 0xE6F2, 0xDC91, 0xCDE4, 0xD4B9, 0x0000, 0x0000, 0x0000, 0x0000, 36 | 0x0000, 0x0000, 0x0140, 0x1C4A, 0x1889, 0x1547, 0x1274} 37 | }; 38 | -------------------------------------------------------------------------------- /Attic/nlib/src/dspblocks/block17.h: -------------------------------------------------------------------------------- 1 | /* 17 003079c4 w0:2206 w1:0000 size:00f7 offset:0000 w4:0000 w5:0000 2 | Block: (MCU)00010000-000101ee (DSP)0800-08f7 BS=0000 (TARG)2206-22fd */ 3 | static struct dsp_codeblock block17 = { 4 | {0x2206, 0x0000, 0x00F7, 0x0000, 0x0000}, 5 | { 6 | 0x545E, 0x7E3E, 0x6119, 0x49A8, 0xEC14, 0x16C3, 0x599A, 0x599A, 7 | 0x012C, 0xFC00, 0x0332, 0x3232, 0x210E, 0x0000, 0x0000, 0x0800, 8 | 0x0800, 0x11E9, 0x0800, 0x11E9, 0x0800, 0x0000, 0x0000, 0x0000, 9 | 0x7FFF, 0x0000, 0x0000, 0x0000, 0x0000, 0x0800, 0x0800, 0x0800, 10 | 0x0800, 0x0800, 0x0800, 0x0800, 0x0800, 0x0000, 0x0000, 0x0000, 11 | 0x0000, 0x0000, 0x7FFF, 0xFFFE, 0x38AC, 0xF6EF, 0x0000, 0x2620, 12 | 0x7467, 0x5097, 0x0000, 0xDD97, 0x44D3, 0x0000, 0xF7D2, 0xBB89, 13 | 0x58B8, 0x0000, 0xDC76, 0xB2EF, 0x0001, 0x44A0, 0x86F7, 0x6B91, 14 | 0xFFFF, 0xA171, 0xC088, 0x0000, 0x3895, 0x2635, 0x50BA, 0x0004, 15 | 0x0000, 0x0004, 0x0002, 0x9A45, 0x0008, 0x3B1C, 0x001A, 0x074E, 16 | 0x0052, 0x4F3B, 0x2000, 0x2000, 0x2000, 0x2000, 0x3000, 0x32E5, 17 | 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 18 | 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0xE22F, 19 | 0xE5CB, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 20 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x32E5, 21 | 0x47FA, 0x5092, 0x5092, 0x5092, 0x5092, 0x5092, 0x5092, 0x5092, 22 | 0x5092, 0x5092, 0x5062, 0x4BEE, 0x47B9, 0x43C0, 0x4000, 0xE22F, 23 | 0xD5D5, 0xEED1, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 24 | 0x0000, 0x0000, 0x0060, 0x08E7, 0x0869, 0x07F1, 0x0781, 0x32E5, 25 | 0x47FA, 0x656E, 0x656E, 0x656E, 0x656E, 0x656E, 0x656E, 0x656E, 26 | 0x656E, 0x656E, 0x64F5, 0x5A15, 0x5062, 0x47B9, 0x4000, 0xE22F, 27 | 0xD5D5, 0xC517, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 28 | 0x0000, 0x0000, 0x00F2, 0x15BF, 0x1367, 0x1150, 0x0F73, 0x32E5, 29 | 0x47FA, 0x65CB, 0x7FB2, 0x7FB2, 0x7FB2, 0x7FB2, 0x7FB2, 0x7FB2, 30 | 0x7FB2, 0x7FB2, 0x7EF3, 0x6E18, 0x5F7A, 0x52CD, 0x47CF, 0xE22F, 31 | 0xD5D5, 0xC45E, 0xCC32, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 32 | 0x0000, 0x0000, 0x017D, 0x21B5, 0x1D3C, 0x195A, 0x15FC, 0x1E3D, 33 | 0x2AC4, 0x3C7B, 0x5589, 0x6B2C, 0x6B2C, 0x6B2C, 0x6B2C, 0x6B2C, 34 | 0x6B2C, 0x6B2C, 0x6A8C, 0x5C67, 0x5022, 0x457E, 0x3C44, 0xEE48, 35 | 0xE6F2, 0xDC91, 0xCDE4, 0xD4B9, 0x0000, 0x0000, 0x0000, 0x0000, 36 | 0x0000, 0x0000, 0x0140, 0x1C4A, 0x1889, 0x1547, 0x1274} 37 | }; 38 | -------------------------------------------------------------------------------- /Attic/nlib/src/dspblocks/block08.h: -------------------------------------------------------------------------------- 1 | /* 08 00305520 w0:1000 w1:0b39 size:00fb offset:01c6 w4:0104 w5:0000 2 | Block: (MCU)0001038c-00010582 (DSP)09c6-0ac1 BS=0104 (TARG)1000-10fb */ 3 | static struct dsp_codeblock block08 = { 4 | {0x1000, 0x0B39, 0x00FB, 0x01C6, 0x0104}, 5 | { 6 | 0xF7BB, 0x7712, 0x0552, 0x61F8, 0x0866, 0x0003, 0xF830, 0x10F9, 7 | 0x61F8, 0x04C2, 0x00FF, 0xF830, 0x10F6, 0x6182, 0x0800, 0xF830, 8 | 0x10F6, 0xE800, 0x74F8, 0x0008, 0x0000, 0xF030, 0x0010, 0xF844, 9 | 0x10F6, 0x69F8, 0x0866, 0x0004, 0x74F8, 0x000B, 0x0000, 0x4A0B, 10 | 0x74F8, 0x000B, 0x0002, 0x4A0B, 0x7714, 0xFBFD, 0xF495, 0x75F8, 11 | 0x0014, 0x0002, 0x4A00, 0x7700, 0xFFFF, 0x74F8, 0x0008, 0x0000, 12 | 0xF040, 0x000C, 0xF495, 0x75F8, 0x0008, 0x0000, 0xEC10, 0xF495, 13 | 0xE90B, 0xF074, 0x4055, 0x4A08, 0xE800, 0xF074, 0x4007, 0xE900, 14 | 0xF020, 0x0800, 0xF074, 0x4007, 0xE908, 0xF074, 0x4055, 0x4A08, 15 | 0xF030, 0x0020, 0xF074, 0x4007, 0xF274, 0x84AF, 0x7715, 0x0002, 16 | 0xE800, 0x74F8, 0x0008, 0x0000, 0xF130, 0x1C00, 0x7215, 0x000B, 17 | 0xF040, 0x000C, 0xF495, 0x75F8, 0x0008, 0x0000, 0xEC0F, 0xF495, 18 | 0xF020, 0x0980, 0xE900, 0xF074, 0x4007, 0xE800, 0x8A08, 0xE908, 19 | 0xF074, 0x4007, 0x8A08, 0xE90B, 0xF074, 0x4007, 0x60F8, 0x0015, 20 | 0x0000, 0xF830, 0x10C2, 0xF062, 0x000F, 0xF274, 0x3FFA, 0x7708, 21 | 0xFFFF, 0xF070, 0x1324, 0xF495, 0xE800, 0xF120, 0xFFFF, 0x74F8, 22 | 0x0008, 0x0017, 0x74F8, 0x0009, 0x0016, 0x68F8, 0x0009, 0x000F, 23 | 0xF520, 0xFA4C, 0x107F, 0xF495, 0xF540, 0xF300, 0x0004, 0xE803, 24 | 0x00F8, 0x3E8D, 0xF486, 0xF074, 0x3FFA, 0xE880, 0xF495, 0x75F8, 25 | 0x0008, 0x0001, 0xEC16, 0xF495, 0x74F8, 0x0008, 0x0002, 0xF030, 26 | 0xFF7F, 0xF495, 0x75F8, 0x0008, 0x0002, 0x6882, 0xFFDF, 0x69F8, 27 | 0x0000, 0x0002, 0xF7BB, 0x6182, 0x0020, 0xF830, 0x10B3, 0xF6BB, 28 | 0xF4E1, 0xF073, 0x10AA, 0x74F8, 0x0008, 0x0002, 0xF040, 0x0080, 29 | 0xF495, 0x75F8, 0x0008, 0x0002, 0xF062, 0x0001, 0xF274, 0x3FFA, 30 | 0x7708, 0x0000, 0xF7D9, 0xF7BB, 0x7715, 0x2FC8, 0x68F8, 0x0866, 31 | 0xFFFB, 0xE800, 0x8B95, 0x8B95, 0x8B85, 0x61F8, 0x20FF, 0x0001, 32 | 0xF820, 0x10DC, 0x7715, 0x2FC8, 0x6995, 0x0306, 0x6985, 0x0400, 33 | 0x6895, 0xFDFF, 0x6985, 0x0010, 0x10F8, 0x04C2, 0xF845, 0x10E7, 34 | 0x7715, 0x2FC8, 0x6995, 0x0316, 0x6D95, 0x6985, 0x000C, 0x7200, 35 | 0x2FC8, 0xF495, 0x75F8, 0x2FC9, 0x0002, 0xF495, 0xF495, 0x75F8, 36 | 0x2FCA, 0x0000, 0xEC10, 0xF495, 0xF6BB, 0xFC00, 0xE800, 0xF074, 37 | 0x3986, 0xF6BB, 0xFC00} 38 | }; 39 | -------------------------------------------------------------------------------- /apps/alcatel.c: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * MADos, a free OS for N* handsets 4 | * Copyright (C) 2003/2004 MADos Core Developer Team 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * contact http://64.246.26.121/forum/forumdisplay.php?f=99 21 | * 22 | */ 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | #ifndef LOADER 29 | 30 | // Alcatel code list by Crux 31 | 32 | int alcatel_phonetype = 0; 33 | 34 | MENU_CALLBACK ( alcatel_type ) 35 | { 36 | char *entries[] = { "HD1/HE1", "BE1/BE3", "BE4/BE5/BFx", NULL }; 37 | int t; 38 | 39 | switch ( cmd ) 40 | { 41 | case MENU_SELECT: 42 | t = menu_dropdown ( entries, alcatel_phonetype ); 43 | if ( t > -1 ) 44 | alcatel_phonetype = t; 45 | break; 46 | case MENU_REDRAW: 47 | case MENU_DRAW: 48 | menu_disp ( entries[alcatel_phonetype] ); 49 | break; 50 | default: 51 | break; 52 | } 53 | 54 | } 55 | 56 | MENU_CALLBACK ( alcatel_inst ) 57 | { 58 | MENU_ONLY_SELECT; 59 | 60 | ui_draw_scrolltext ( "Check model under the battery of your alcatel. Select phone model and see the code. Press * and 787292 at same time and then enter the code." ); 61 | 62 | } 63 | 64 | MENU_CALLBACK ( alcatel_code ) 65 | { 66 | MENU_ONLY_SELECT; 67 | 68 | if ( alcatel_phonetype == 0 ) 69 | { 70 | ui_draw_scrolltext ( "25228353" ); 71 | } 72 | 73 | if ( alcatel_phonetype == 1 ) 74 | { 75 | ui_draw_scrolltext ( "25228352" ); 76 | } 77 | 78 | if ( alcatel_phonetype == 2 ) 79 | { 80 | ui_draw_scrolltext ( "83227423" ); 81 | } 82 | 83 | } 84 | 85 | #endif 86 | -------------------------------------------------------------------------------- /core/fs.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | 5 | #define _CONFIG_FFS_ 6 | 7 | #ifdef _CONFIG_FFS_ 8 | int 9 | fs_check ( void *base ) 10 | { 11 | return ffs_check ( base ); 12 | } 13 | 14 | int 15 | fs_unlink ( const char *name ) 16 | { 17 | return ffs_unlink ( name ); 18 | } 19 | 20 | int 21 | fs_exists ( const char *name ) 22 | { 23 | return ffs_file_exists ( name ); 24 | } 25 | 26 | int 27 | fs_getsize ( const char *name ) 28 | { 29 | return ffs_get_size ( name ); 30 | } 31 | 32 | char * 33 | fs_listfile ( int number ) 34 | { 35 | return ( void * ) ffs_list_file_ex ( FFS_FIND_FIRST, number ); 36 | } 37 | 38 | int 39 | fs_countfiles ( ) 40 | { 41 | return ffs_file_count ( FFS_FIND_FIRST ); 42 | } 43 | 44 | int 45 | fs_format ( void *base ) 46 | { 47 | return ffs_format ( base ); 48 | } 49 | 50 | int 51 | fs_fclose ( FILE * stream ) 52 | { 53 | return ffs_fclose ( stream ); 54 | } 55 | 56 | FILE * 57 | fs_fopen ( const char *name, const char *mode ) 58 | { 59 | return ffs_fopen ( name, mode ); 60 | } 61 | 62 | unsigned long 63 | fs_fwrite ( void *ptr, unsigned long size, unsigned long nmemb, FILE * stream ) 64 | { 65 | return ffs_fwrite ( ptr, size, nmemb, stream ); 66 | } 67 | 68 | unsigned long 69 | fs_fread ( void *ptr, unsigned long size, unsigned long nmemb, FILE * stream ) 70 | { 71 | return ffs_fread ( ptr, size, nmemb, stream ); 72 | } 73 | #else 74 | int 75 | fs_check ( void *base ) 76 | { 77 | return 0; 78 | } 79 | 80 | int 81 | fs_unlink ( const char *name ) 82 | { 83 | return 0; 84 | } 85 | 86 | int 87 | fs_format ( void *base ) 88 | { 89 | return 0; 90 | } 91 | 92 | int 93 | fs_fclose ( FILE * stream ) 94 | { 95 | return 0; 96 | } 97 | 98 | FILE * 99 | fs_fopen ( const char *name, const char *mode ) 100 | { 101 | return NULL; 102 | } 103 | 104 | unsigned long 105 | fs_fwrite ( void *ptr, unsigned long size, unsigned long nmemb, FILE * stream ) 106 | { 107 | return 0; 108 | } 109 | 110 | unsigned long 111 | fs_fread ( void *ptr, unsigned long size, unsigned long nmemb, FILE * stream ) 112 | { 113 | return 0; 114 | } 115 | 116 | int 117 | fs_exists ( const char *name ) 118 | { 119 | return 0; 120 | } 121 | 122 | int 123 | fs_getsize ( const char *name ) 124 | { 125 | return 0; 126 | } 127 | 128 | char * 129 | fs_listfile ( int number ) 130 | { 131 | return 0; 132 | } 133 | 134 | int 135 | fs_countfiles ( ) 136 | { 137 | return 0; 138 | } 139 | #endif 140 | -------------------------------------------------------------------------------- /compile.conf: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | export LEAVELOG="YES" 4 | 5 | 6 | #export TYPE="STANDALONE" 7 | #export TYPE="PC" 8 | #export TYPE="LOADER" 9 | #export TYPE="STANDALONE" 10 | export TYPE="EMBED" 11 | #export TYPE="FULLEMBED" 12 | #export TYPE="BEAUTY" 13 | # 14 | # STANDALONE, EMBED, LOADER, PC, FULLEMBED, BEAUTY 15 | # can be redefined by argument 1 of compile script 16 | 17 | 18 | #export PHONE="3310_old" 19 | #export PHONE="3310_new" 20 | #export PHONE="3330_old" 21 | #export PHONE="3330_new" 22 | #export PHONE="6210" 23 | export PHONE="8210" 24 | #export PHONE="2100" 25 | #export PHONE="5110" 26 | #export PHONE="AUTO" 27 | 28 | 29 | export OS="WIN98" 30 | # uncomment it, if your operating system is M$ Windows 98 31 | 32 | export DEFINES="" 33 | 34 | # all .o & .c files 35 | export C_FILES_ALL="apps/f1 core/huffman apps/engine3d apps/dct3algo apps/dct4algo apps/madmedia apps/arcanoid apps/picpaint core/softfloat hw/sim core/fs core/ffs apps/screenshot apps/demo_1 apps/tictactoe apps/alcatel apps/samsung apps/meas apps/matrix apps/charger apps/othello apps/hangman apps/txtreader apps/sony_cmd_c1 apps/vitel apps/lgunlock apps/dct3 apps/dct4 apps/st55gd55 hw/timer hw/genio hw/mbus hw/xbus hw/clock hw/flash hw/int hw/dspblocks hw/mdi hw/dsp hw/vibra hw/buzzer hw/ccont hw/kpd hw/io hw/led hw/lcd_font hw/lcd core/bitmap core/ipc core/menu core/lib core/sched core/ui core/stdio apps/fire apps/snake apps/tetris apps/gallery apps/provider apps/bomberman apps/stars apps/main" 36 | export O_FILES_ALL="apps/dct3algo_ARM apps/dct3algo_PC apps/dct4algo_PC apps/dct4algo_ARM apps/lgunlock_table_ARM apps/lgunlock_table_PC" 37 | 38 | 39 | # excluding area & compiler options 40 | # STANDALONE 41 | export C_EXCL_STANDALONE="" 42 | export O_EXCL_STANDALONE="apps/dct3algo_PC apps/dct4algo_PC apps/lgunlock_table_PC" 43 | export O_STANDALONE="-DARM -Os -mpoke-function-name -Iinclude -mcaller-super-interworking -DPHONE_${PHONE} -DTYPE_${TYPE}" 44 | 45 | 46 | # EMBED 47 | export C_EXCL_EMBED="apps/snake apps/othello apps/stars apps/fire" 48 | export O_EXCL_EMBED="apps/dct3algo_PC apps/dct4algo_PC apps/lgunlock_table_PC" 49 | export O_EMBED="-DARM -DEMBED -Os -Iinclude -mcaller-super-interworking -DPHONE_${PHONE} -DTYPE_${TYPE}" 50 | 51 | 52 | # LOADER 53 | export C_EXCL_LOADER="" 54 | export O_EXCL_LOADER="apps/dct3algo_PC apps/dct4algo_PC apps/lgunlock_table_PC" 55 | export O_LOADER="-DLOADER -DARM -Os -Iinclude -mcaller-super-interworking -DPHONE_${PHONE} -DTYPE_${TYPE}" 56 | 57 | 58 | # PC 59 | export C_EXCL_PC="" 60 | export O_EXCL_PC="apps/dct3algo_ARM apps/dct4algo_ARM apps/lgunlock_table_ARM" 61 | export O_PC="-DPC -Iinclude -ggdb -DPHONE_${PHONE} -DTYPE_${TYPE} -DOS_${OS}" 62 | 63 | # FULLEMBED 64 | # same as STANDALONE 65 | 66 | # Linux -- wumpus 67 | # export DIALOG="tools/dialog" 68 | -------------------------------------------------------------------------------- /Attic/nlib/include/nlib/nokio.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Nokia DCT3 I/O definitions 3 | * wumpus 2003 4 | * x x 5 | * xx x xx 6 | * XxxxxxxxX 7 | * x\xx x 8 | * xxxx 9 | * _ xxxx 10 | * Xxxxx\xxX 11 | * xx x xx 12 | * x x 13 | */ 14 | #ifndef BS_NOKIA_H_INCLUDED 15 | #define BS_NOKIA_H_INCLUDED 16 | 17 | /* Ports */ 18 | 19 | #define IO_ASIC_ID 0x00 20 | #define IO_DSP_RESET 0x02 21 | #define DSP_ENABLE 0x01 22 | #define IO_FIQ_ACTIVE 0x08 23 | #define IO_IRQ_ACTIVE 0x09 24 | #define IO_FIQ_MASK 0x0A 25 | #define IO_IRQ_MASK 0x0B 26 | #define IO_INT_CTRL 0x0C 27 | #define IO_CLOCKS 0x0D 28 | #define CLOCK_GENSIO 0x04 /* Generic serial I/O */ 29 | #define CLOCK_PROG 0x08 /* ?? */ 30 | #define IO_TIMESTAMP 0x10 /* halfword */ 31 | #define IO_WATCHDOG 0x12 /* halfword */ 32 | #define IO_BUZCTRL 0x15 33 | #define BUZCTRL_VIBRATOR 0x10 34 | #define BUZCTRL_BUZZER 0x20 35 | #define IO_FIQ8 0x16 /* ? */ 36 | #define IO_MBUS_CTRL 0x18 37 | #define IO_MBUS_STATUS 0x19 38 | #define IO_MBUS_BYTE 0x1A 39 | #define IO_VIBRATOR 0x1B 40 | #define IO_BUZFREQ 0x1C /* halfword */ 41 | #define IO_BUZVOL 0x1E 42 | #define IO_GENIO_D 0x20 43 | #define IO_GENIO_RW 0x24 44 | #define IO_CCONT_WRITE 0x2C 45 | #define IO_GENSIO_CTRL 0x2D 46 | #define IO_LCD_DATA 0x2E 47 | #define IO_GENPIO 0x32 48 | #define LCD_RESET 0x20 49 | #define IO_CTRL3 0x33 50 | #define CTRL3_DISPLAYLEDS 0x02 51 | #define IO_CCONT_READ 0x6C 52 | #define IO_LCD_STATUS 0x6D 53 | #define IO_LCD_CMD 0x6E 54 | /* Keyboard */ 55 | #define IO_KEY_AAA 0x68 56 | #define IO_KEY_BBB 0x69 57 | #define IO_KEY_CCC 0x6A /* columns; 0 = enabled; 1 = always disabled */ 58 | #define IO_KEY_IRQC 0x6B /* columns; 0 = cause IRQ0, 1 = no irq */ 59 | #define IO_KEY_ROW_CLR 0x28 /* rows; 0 = enabled, 1 = disabled */ 60 | #define IO_KEY_COL_RD 0x2A /* columns; 0 = pressed, 1 = no signal */ 61 | #define IO_KEY_ROW_SET 0xA8 /* rows; 0 = tristate, 1 = pass */ 62 | #define IO_KEY_EEE 0xA9 63 | #define IO_KEY_FFF 0xAB 64 | 65 | /* CCont */ 66 | #define CCONT_REGS 0x20 67 | 68 | /* Danger -- Memory Mapped I/O ahead */ 69 | extern volatile uint16 _dsp[]; 70 | extern volatile uint8 _io[]; 71 | #define ioreadw(addr) (*(volatile unsigned short *) &_io[addr]) 72 | #define iowritew(addr, value) ((*(volatile unsigned short *) &_io[addr]) = (value)) 73 | extern volatile uint16 _dspif[]; 74 | extern volatile uint8 _mcuif[]; 75 | 76 | /* Generic functions */ 77 | void IO_initialize ( ); 78 | void IO_globalInterruptEnable ( int mode ); 79 | void IO_setBit ( uint reg, uint bit, uint mode ); 80 | void usleep ( uint micros ); 81 | 82 | #endif 83 | -------------------------------------------------------------------------------- /include/core/stdio.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * MADos, a free OS for N* handsets 4 | * Copyright (C) 2003/2004 MADos Core Developer Team 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * contact http://64.246.26.121/forum/forumdisplay.php?f=99 21 | * 22 | */ 23 | 24 | #ifndef PC 25 | 26 | typedef char *va_list; 27 | typedef unsigned int size_t; 28 | #define _AUPBND (sizeof (int) - 1) 29 | #define _ADNBND (sizeof (int) - 1) 30 | #define _bnd(X, bnd) (((sizeof (X)) + (bnd)) & (~(bnd))) 31 | #define va_arg(ap, T) (*(T *)(((ap) += (_bnd (T, _AUPBND))) - (_bnd (T,_ADNBND)))) 32 | #define va_end(ap) (void) 0 33 | #define va_start(ap, A) (void) ((ap) = (((char *) &(A)) + (_bnd (A,_AUPBND)))) 34 | #define isdigit(c) ('0' <= (c) && (c) <= '9') 35 | #define do_div(n,base) \ 36 | ({ \ 37 | int __res; \ 38 | __res = lib_mod ( ((unsigned long)n), (unsigned int)base ); \ 39 | n = lib_div ( ((unsigned long)n), (unsigned int)base ); \ 40 | __res; \ 41 | }) 42 | 43 | #define ZEROPAD 1 /* pad with zero */ 44 | #define SIGN 2 /* unsigned/signed long */ 45 | #define PLUS 4 /* show plus */ 46 | #define SPACE 8 /* space if plus */ 47 | #define LEFT 16 /* left justified */ 48 | #define SPECIAL 32 /* 0x */ 49 | #define LARGE 64 /* use 'ABCDEF' instead of 'abcdef' */ 50 | 51 | int vsnprintf ( char *buf, size_t size, const char *fmt, va_list args ); 52 | int sprintf ( char *__restrict buf, const char *__restrict format, ... ); 53 | static char *number ( char *buf, char *end, long long num, int base, int size, int precision, int type ); 54 | size_t strnlen ( const char *s, size_t count ); 55 | static int skip_atoi ( const char **s ); 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /hw/genio.c: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * MADos, a free OS for N* handsets 4 | * Copyright (C) 2003/2004 MADos Core Developer Team 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * contact http://64.246.26.121/forum/forumdisplay.php?f=99 21 | * 22 | */ 23 | 24 | 25 | #include 26 | #include 27 | // 28 | // GENSIO and other IO init 29 | // so i named it genIO init ;) 30 | // 31 | 32 | /** 33 | * Table for initial CTRL I/O values. 34 | */ 35 | static const unsigned char ctrlio_base[3][22] = { 36 | {0x70, 0x00, 0x71, 0x02, 0x72, 0xA0, 0x73, 0x63, 37 | 0xB0, 0xFF, 0xB1, 0xFD, 0xB2, 0x5F, 0xB3, 0x00, 38 | 0xAF, 0x60, 0x6F, 0x04, 0xEF, 0x00}, 39 | {0x70, 0x00, 0x71, 0x02, 0x72, 0x20, 0x73, 0x2B, 40 | 0xB0, 0xFF, 0xB1, 0xFD, 0xB2, 0xFF, 0xB3, 0x00, 41 | 0xAF, 0x64, 0x6F, 0x00, 0xEF, 0x00}, 42 | // 6210: 43 | {0x70, 0x00, 0x71, 0x02, 0x72, 0x21, 0x73, 0x23, 44 | 0xB0, 0xFF, 0xB1, 0xFD, 0xB2, 0xDE, 0xB3, 0x10, 45 | 0xAF, 0x00, 0x6F, 0x05, 0xEF, 0x00} 46 | }; 47 | 48 | /** 49 | * Most basic I/O initialisations. 50 | */ 51 | void 52 | genio_init ( void ) 53 | { 54 | int x; 55 | 56 | #ifndef PHONE_5110 57 | for ( x = 0; x < 11; x++ ) 58 | _io_set ( ctrlio_base[mados_info[mados_phone].genio][2 * x], ctrlio_base[mados_info[mados_phone].genio][( 2 * x ) + 1] ); 59 | 60 | 61 | // before converting to new _io method, we have to decode this sequence ;) 62 | // dont know how to name them 63 | 64 | io_set ( 0x000200AD, 0x00 ); 65 | io_set ( 0x000200ED, 0x00 ); 66 | io_set ( 0x000200AE, 0xA0 ); 67 | io_set ( 0x000200EE, 0x00 ); 68 | #endif 69 | 70 | _io_set_bit ( IO_CTSI_CTRL, CTSI_CTL_GC | CTSI_CTL_UU ); 71 | 72 | io_set ( 0x00020024, 0x19 ); // CCUT, LCD LED and CHARLIM as output 73 | 74 | // io_set ( 0x00020072, 0xA0 ); // LCD Reset and another unkown port as output 75 | // io_set ( 0x000200B2, 0xFF ); // as nokia does it 76 | // io_set ( 0x00020073, 0x6B ); // BUTTON_CTRL, CHAR_CTRL, MMAP, KBD LED and Vpp as output 77 | // io_set ( 0x000200B3, 0x00 ); // as nokia does it 78 | 79 | } 80 | -------------------------------------------------------------------------------- /include/hw/dsp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * MADos, a free OS for N* handsets 4 | * Copyright (C) 2003/2004 MADos Core Developer Team 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * contact http://64.246.26.121/forum/forumdisplay.php?f=99 21 | * 22 | */ 23 | 24 | #ifndef MADOS_DSP 25 | #define MADOS_DSP 26 | 27 | struct dsp_codeblock 28 | { 29 | unsigned short header[5]; 30 | unsigned short data[]; 31 | }; 32 | 33 | void dsp_init ( void ); 34 | void dsp_setmem ( unsigned int mode ); 35 | void dsp_genint ( void ); 36 | void dsp_enable ( void ); 37 | void dsp_disable ( void ); 38 | void dsp_reset ( void ); 39 | void dsp_upload ( unsigned int block, const unsigned short *src, unsigned int len ); 40 | int dsp_upload_codeblock ( struct dsp_codeblock *c, int sub ); 41 | void dsp_int_handler ( void ); 42 | void dsp_clear_ram ( void ); 43 | void dsp_bootstrap ( const unsigned short *block, unsigned int len ); 44 | int dsp_test ( void ); 45 | void dsp_readmem ( void ); 46 | 47 | 48 | #define DSP_MEM_HOST 0 49 | #define DSP_MEM_SHARED 1 50 | 51 | /* In words */ 52 | #define DSP_SHARED_SIZE (0x1000/2) 53 | 54 | /* _dsp shared memory areas */ 55 | #define DSP_MDISND_TAIL (0x0A4/2) 56 | #define DSP_MDISND_HEAD (0x0A6/2) 57 | #define DSP_INITDATA (0x0A8/2) 58 | #define DSP_MDISND_QUEUE (0x000/2) 59 | #define DSP_MDISND_SIZE (0x0A4/2) 60 | #define DSP_MDISND_QUEUEEND (DSP_MDISND_QUEUE + DSP_MDISND_SIZE) 61 | #define DSP_UPLOADREQUEST (0x0E2/2) 62 | #define DSP_UPLOADREPLY (0x0E4/2) 63 | #define DSP_UPLOADREPLY_MORE 0x0002 64 | #define DSP_UPLOADREPLY_FINISHED 0x0004 65 | #define DSP_UPLOADHEADER (0x0F6/2) 66 | #define DSP_MDIRCV_QUEUE (0x100/2) 67 | #define DSP_MDIRCV_SIZE (0x0C8/2) 68 | #define DSP_MDIRCV_QUEUEEND (DSP_MDIRCV_QUEUE + DSP_MDIRCV_SIZE) 69 | #define DSP_MDIRCV_TAIL (0x1C8/2) 70 | #define DSP_MDIRCV_HEAD (0x1CA/2) 71 | 72 | 73 | /* Offsets in upload header */ 74 | #define DSP_UPLHDR_TARGET 0 75 | #define DSP_UPLHDR_SIZE 2 76 | #define DSP_UPLHDR_OFFSET 3 77 | #define DSP_UPLHDR_BLOCKSIZE 4 78 | 79 | 80 | /* DSPIF constants */ 81 | #define DSPIF_ENABLE_SHARED 0x0000 82 | #define DSPIF_DISABLE_SHARED 0x0002 83 | #define DSPIF_INTERRUPT 0x0004 84 | 85 | 86 | #endif 87 | -------------------------------------------------------------------------------- /tools/conv_hth.c: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * MADos, a free OS for N* handsets 4 | * Copyright (C) 2003/2004 MADos Core Developer Team 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * contact http://64.246.26.121/forum/forumdisplay.php?f=99 21 | * 22 | */ 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | 29 | int 30 | main ( void ) 31 | { 32 | int i = 1; 33 | char *filename_in, *filename_out, *blockname, *tmp; 34 | unsigned char buf = 0; 35 | FILE *input, *output; 36 | 37 | filename_in = ( char * ) malloc ( 256 ); 38 | filename_out = ( char * ) malloc ( 256 ); 39 | blockname = ( char * ) malloc ( 256 ); 40 | tmp = ( char * ) malloc ( 512 ); 41 | 42 | printf ( "this tool converts a hex file to a c-header file\n" ); 43 | // similiar to conv.c but more options 44 | 45 | printf ( "input file (hex): " ); 46 | scanf ( "%s", filename_in ); 47 | 48 | printf ( "\noutput file (header, add extension .h): " ); 49 | scanf ( "%s", filename_out ); 50 | 51 | printf ( "\nname of block: " ); 52 | scanf ( "%s", blockname ); 53 | 54 | input = fopen ( filename_in, "rb" ); 55 | output = fopen ( filename_out, "wba" ); 56 | if ( !input || !output ) 57 | { 58 | printf ( "\nthe input or output file couldn't be opened ... aborting ..." ); 59 | //files should be closed, mem should be free'd 60 | return 1; 61 | } 62 | 63 | sprintf ( tmp, "const unsigned char %s[] =\n{\n ", blockname ); 64 | fwrite ( tmp, 1, strlen ( tmp ), output ); 65 | while ( fread ( &buf, 1, 1, input ) ) 66 | { 67 | sprintf ( tmp, "0x%02X, ", buf ); 68 | fwrite ( tmp, 1, strlen ( tmp ), output ); 69 | if ( i == 16 ) 70 | { 71 | fwrite ( "\n ", 1, 5, output ); 72 | i = 1; 73 | } 74 | else 75 | i++; 76 | } 77 | fwrite ( "\n};\n", 1, 4, output ); 78 | 79 | fclose ( input ); 80 | fclose ( output ); 81 | 82 | free ( filename_in ); 83 | free ( filename_out ); 84 | free ( blockname ); 85 | free ( tmp ); 86 | 87 | printf ( "done ;)" ); 88 | return 0; 89 | 90 | } 91 | -------------------------------------------------------------------------------- /include/core/sched.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * MADos, a free OS for N* handsets 4 | * Copyright (C) 2003/2004 MADos Core Developer Team 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * contact http://64.246.26.121/forum/forumdisplay.php?f=99 21 | * 22 | */ 23 | 24 | 25 | 26 | #define SCHED_THREADS 8 27 | #define SCHED_NUM_DATA 8 28 | 29 | #define SCHED_PARM_STOP 0x01 30 | #define SCHED_PARM_RUN 0x02 31 | #define SCHED_PARM_MASTER 0x04 32 | #define SCHED_PARM_WAITIPC 0x08 33 | 34 | #define SCHED_DATA_IPC 0x00 35 | 36 | #define SCHED_LOCK sched_set_parm ( 0xFF, SCHED_PARM_MASTER ); 37 | #define SCHED_UNLOCK sched_set_parm ( 0xFF, SCHED_PARM_RUN ); 38 | 39 | typedef struct 40 | { 41 | unsigned char id; 42 | unsigned char used; 43 | unsigned char started; 44 | unsigned char remove; 45 | unsigned int regs[17]; 46 | unsigned char parms; 47 | unsigned int act_time; 48 | unsigned char *data[SCHED_NUM_DATA]; 49 | } 50 | thread_t; 51 | 52 | typedef struct 53 | { 54 | unsigned int time; 55 | unsigned int next_act; 56 | unsigned char force_thread; 57 | unsigned char cur_thread; 58 | unsigned char num_threads; 59 | thread_t threads[SCHED_THREADS]; 60 | unsigned int regs[17]; 61 | } 62 | sched_t; 63 | 64 | #ifdef _SCHED_ 65 | unsigned int sched_stacks[] = { 66 | 0x00110000, 0x00111000, 0x00112000, 0x00113000, 67 | 0x00114000, 0x00115000, 0x00116000, 0x00117000 68 | }; 69 | #endif 70 | 71 | 72 | 73 | unsigned int sched_now ( void ); 74 | void sched_yield ( void ); 75 | void sched_init ( void ); 76 | void sched_save ( unsigned char reg, unsigned int val ); 77 | unsigned int sched_get ( unsigned char reg ); 78 | void sched_critical ( void ); 79 | void sched_next ( void ); 80 | void sched_delete ( unsigned char num ); 81 | void sched_remove ( unsigned char num ); 82 | void sched_threadend ( void ); 83 | void sched_update_activation ( void ); 84 | void sched_activation ( void ); 85 | void sched_set_activation ( unsigned char thread, unsigned int time ); 86 | void sched_set_parm ( unsigned char thread, unsigned char parm ); 87 | unsigned char sched_get_parm ( unsigned char thread ); 88 | unsigned char sched_add ( unsigned int addr, unsigned int thumb, unsigned char parm ); 89 | -------------------------------------------------------------------------------- /include/hw/io.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * MADos, a free OS for N* handsets 4 | * Copyright (C) 2003/2004 MADos Core Developer Team 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * contact http://64.246.26.121/forum/forumdisplay.php?f=99 21 | * 22 | */ 23 | 24 | #include 25 | 26 | volatile inline unsigned char io_read ( unsigned long io ); 27 | volatile inline unsigned short io_read_word ( unsigned long io ); 28 | volatile inline unsigned int io_read_dword ( unsigned long io ); 29 | volatile inline void io_set ( unsigned long io, unsigned char val ); 30 | volatile inline void io_set_word ( unsigned long io, unsigned short val ); 31 | volatile inline void io_set_dword ( unsigned long io, unsigned int val ); 32 | volatile inline void io_wait ( unsigned long io, unsigned long bit ); 33 | volatile inline void io_set_bit ( unsigned long io, unsigned long mask ); 34 | volatile inline void io_clr_bit ( unsigned long io, unsigned long mask ); 35 | 36 | extern volatile unsigned short _dsp[]; 37 | extern volatile unsigned char _io[]; 38 | extern volatile unsigned short _dspif[]; 39 | extern volatile unsigned char _mcuif[]; 40 | 41 | 42 | #ifdef XX 43 | #define _io_clr_bit(p,v) ((*(volatile unsigned char *) &_io[p]) &= (~v)) 44 | #define _io_set_bit(p,v) ((*(volatile unsigned char *) &_io[p]) |= (v)) 45 | #define _io_set(p,v) ((*(volatile unsigned char *) &_io[p]) = (v)) 46 | #define _io_read(p) (*(volatile unsigned char *) &_io[p]) 47 | #define _io_read_word(p) (*(volatile unsigned short *) &_io[p]) 48 | #define _io_set_word(p,v) ((*(volatile unsigned short *) &_io[p]) = (v)) 49 | #define _io_wait(p,v) io_wait (0x00020000+p,v) 50 | #else 51 | #define _io_clr_bit(p,v) io_clr_bit(0x00020000+p,v) 52 | #define _io_set_bit(p,v) io_set_bit(0x00020000+p,v) 53 | #define _io_set(p,v) io_set(0x00020000+p,v) 54 | #define _io_read(p) io_read(0x00020000+p) 55 | #define _io_read_word(p) io_read_word(0x00020000+p) 56 | #define _io_set_word(p,v) io_set_word(0x00020000+p,v) 57 | #define _io_wait(p,v) io_wait (0x00020000+p,v) 58 | #endif 59 | 60 | #ifdef ARM 61 | // (g3gg0) THIS IS NOT CORRECT 62 | //#define _io_wait(p,v) while ( _io_read(p)&v != v ) usleep(1); 63 | #else 64 | #undef _io_wait 65 | #define _io_wait(p,v) 66 | #endif 67 | -------------------------------------------------------------------------------- /tools/animation studio/Form2.frm: -------------------------------------------------------------------------------- 1 | VERSION 5.00 2 | Begin VB.Form Form2 3 | BorderStyle = 1 'Fixed Single 4 | Caption = "Enter hex code" 5 | ClientHeight = 1575 6 | ClientLeft = 45 7 | ClientTop = 435 8 | ClientWidth = 4920 9 | ClipControls = 0 'False 10 | ControlBox = 0 'False 11 | Icon = "Form2.frx":0000 12 | LinkTopic = "Form2" 13 | MaxButton = 0 'False 14 | MinButton = 0 'False 15 | ScaleHeight = 1575 16 | ScaleWidth = 4920 17 | StartUpPosition = 3 'Windows Default 18 | Begin VB.CommandButton Command2 19 | Caption = "Cancel" 20 | Height = 375 21 | Left = 3720 22 | TabIndex = 6 23 | Top = 1200 24 | Width = 1215 25 | End 26 | Begin VB.TextBox Text3 27 | Height = 285 28 | Left = 1680 29 | TabIndex = 5 30 | Text = "84" 31 | Top = 1200 32 | Width = 615 33 | End 34 | Begin VB.TextBox Text2 35 | Height = 285 36 | Left = 600 37 | TabIndex = 3 38 | Text = "48" 39 | Top = 1200 40 | Width = 495 41 | End 42 | Begin VB.CommandButton Command1 43 | Caption = "Use this Code" 44 | Height = 375 45 | Left = 2400 46 | TabIndex = 1 47 | Top = 1200 48 | Width = 1335 49 | End 50 | Begin VB.TextBox Text1 51 | Height = 1095 52 | Left = 0 53 | TabIndex = 0 54 | Top = 0 55 | Width = 4935 56 | End 57 | Begin VB.Label Label2 58 | Caption = " X:" 59 | Height = 255 60 | Left = 1200 61 | TabIndex = 4 62 | Top = 1200 63 | Width = 855 64 | End 65 | Begin VB.Label Label1 66 | Caption = " Y:" 67 | Height = 255 68 | Left = 0 69 | TabIndex = 2 70 | Top = 1200 71 | Width = 735 72 | End 73 | End 74 | Attribute VB_Name = "Form2" 75 | Attribute VB_GlobalNameSpace = False 76 | Attribute VB_Creatable = False 77 | Attribute VB_PredeclaredId = True 78 | Attribute VB_Exposed = False 79 | Private Sub Command1_Click() 80 | frmBitmap.txtHex = Text1.Text 81 | frmBitmap.txtY.Text = Text2.Text 82 | frmBitmap.txtX.Text = Text3.Text 83 | frmBitmap.UpdateBitmap 84 | Form1.Image1.Picture = frmBitmap.pctTemp.image 85 | 86 | Form1.Show 87 | Form1.Text1.Text = frmBitmap.txtHex.Text 88 | Form1.Text4 = frmBitmap.txtY.Text 89 | Form1.Text5 = frmBitmap.txtX.Text 90 | Text1.Text = "" 91 | 'Form1.picture1 = frmBitmap.pctTemp.Picture 92 | Me.Hide 93 | End Sub 94 | 95 | Private Sub Command2_Click() 96 | Me.Hide 97 | End Sub 98 | -------------------------------------------------------------------------------- /apps/screenshot.c: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * MADos, a free OS for N* handsets 4 | * Copyright (C) 2003/2004 MADos Core Developer Team 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free Software 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 | * 20 | * contact http://64.246.26.121/forum/forumdisplay.php?f=99 21 | * 22 | */ 23 | 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | // #define LCD_BUFLEN (84*48)/8 32 | //extern unsigned char lcd_buf[LCD_BUFLEN]; 33 | 34 | MENU_CALLBACK ( screenshot_show ) 35 | { 36 | int len = 0; 37 | unsigned char *buf = NULL; 38 | FILE *f = NULL; 39 | MENU_ONLY_SELECT; 40 | 41 | len = lcd_get_bufsize ( ); 42 | buf = ( unsigned char * ) malloc ( len ); 43 | f = fs_fopen ( "screenshot.bin", "r" ); 44 | if ( !f ) 45 | return 0; 46 | 47 | if ( fs_fread ( buf, 1, len, f ) != len ) 48 | return 0; 49 | fs_fclose ( f ); 50 | lcd_clr ( ); 51 | lcd_to_screen ( ); 52 | memcpy ( ( void * ) lcd_get_buf ( ), buf, lcd_get_bufsize ( ) ); 53 | free ( buf ); 54 | lcd_to_screen ( ); 55 | ksleep ( 5 ); 56 | 57 | } 58 | 59 | void 60 | screenshot_capture ( void ) 61 | { 62 | int len = 0; 63 | unsigned char *buf = NULL; 64 | FILE *f = NULL; 65 | 66 | 67 | len = lcd_get_bufsize ( ); 68 | buf = ( unsigned char * ) malloc ( len ); 69 | memcpy ( buf, ( void * ) lcd_get_buf ( ), len ); 70 | lcd_clr ( ); 71 | lcd_type_text_2 ( 0, 0 * 8, 3, " Screenshot", 1 ); 72 | lcd_render_text ( 0, 2 * 8, "- open -", 1 ); 73 | lcd_to_screen_hw ( ); 74 | f = fs_fopen ( "screenshot.bin", "w" ); 75 | if ( !f ) 76 | return; 77 | lcd_render_text ( 0, 2 * 8, "- open -", 0 ); 78 | lcd_to_screen_hw ( ); 79 | lcd_render_text ( 0, 2 * 8, "- write -", 1 ); 80 | lcd_to_screen_hw ( ); 81 | if ( fs_fwrite ( buf, 1, len, f ) != len ) 82 | { 83 | fs_fclose ( f ); 84 | lcd_type_text_2 ( 0, 4 * 8, 3, "Format FS", 1 ); 85 | lcd_type_text_2 ( 0, 5 * 8, 3, "please", 1 ); 86 | } 87 | free ( buf ); 88 | lcd_render_text ( 0, 2 * 8, "- write -", 0 ); 89 | fs_fclose ( f ); 90 | lcd_render_text ( 0, 2 * 8, "- done -", 1 ); 91 | lcd_to_screen_hw ( ); 92 | ksleep ( 1 ); 93 | 94 | } 95 | --------------------------------------------------------------------------------