Skip to content

Instantly share code, notes, and snippets.

@ax206geek
Created October 13, 2012 02:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ax206geek/3883028 to your computer and use it in GitHub Desktop.
Save ax206geek/3883028 to your computer and use it in GitHub Desktop.
Patch for dpf-ax
diff -Nuar --exclude .svn trunk//src/config.h ../dpf-ax.30-coby320x240//src/config.h
--- trunk//src/config.h 2012-10-13 10:31:04.939895827 +0800
+++ ../dpf-ax.30-coby320x240//src/config.h 2012-10-10 09:28:46.999560111 +0800
@@ -119,6 +119,11 @@
# define LCD_CONTROLLER_CUSTOM
# define LCD_ORIENTATION_RGB RGB_UP
# define DEFAULT_ORIENTATION ROT_LEFT
+#elif defined (DPFMODEL_coby_mko)
+# define LCD_320x240
+# define LCD_CONTROLLER_CUSTOM
+# define LCD_ORIENTATION_RGB RGB_UP
+# define DEFAULT_ORIENTATION ROT_LEFT
// <<<< INSERT NEW DPFS BEFORE THIS LINE <<<<
#else
#error "Unrecognized DPF TYPE specification"
diff -Nuar --exclude .svn trunk//src/lcd/coby_mko/lcdblit.s ../dpf-ax.30-coby320x240//src/lcd/coby_mko/lcdblit.s
--- trunk//src/lcd/coby_mko/lcdblit.s 1970-01-01 07:30:00.000000000 +0730
+++ ../dpf-ax.30-coby320x240//src/lcd/coby_mko/lcdblit.s 2012-10-10 09:40:11.749563779 +0800
@@ -0,0 +1,75 @@
+ .include 'dpf.inc'
+
+ .area BLIT (CODE)
+
+ar0 = 0x00
+
+_custom_landscape_blit::
+ push ar0
+ clr a
+ mov r0,#0x50
+ lcall X12f0
+ mov a,_g_blit+y0+1
+ mov r0,_g_blit+y0
+ lcall X12e7
+ clr a
+ mov r0,#0x51
+ lcall X12f0
+ mov a,_g_blit+y1+1
+ mov r0,_g_blit+y1
+ lcall X12e7
+ clr a
+ mov r0,#0x52
+ lcall X12f0
+ mov a,#0x3f
+ clr c
+ subb a,_g_blit+x1
+ mov r0,a
+ mov a,#0x1
+ subb a,_g_blit+x1+1
+ lcall X12e7
+ clr a
+ mov r0,#0x53
+ lcall X12f0
+ mov a,#0x3f
+ clr c
+ subb a,_g_blit+x0
+ mov r0,a
+ mov a,#0x1
+ subb a,_g_blit+x0+1
+ lcall X12e7
+ clr a
+ mov r0,#0x20
+ lcall X12f0
+ mov a,#0xef
+ clr c
+ subb a,_g_blit+y0
+ mov r0,a
+ mov a,#0x0
+ subb a,_g_blit+y0+1
+ lcall X12e7
+ clr a
+ mov r0,#0x21
+ lcall X12f0
+ mov a,#0x3f
+ clr c
+ subb a,_g_blit+x0
+ mov r0,a
+ mov a,#0x1
+ subb a,_g_blit+x0+1
+ lcall X12e7
+ clr a
+ mov r0,#0x22
+ lcall X12f0
+ setb LCD_A0
+ pop ar0
+ ret
+;
+X12e7: setb LCD_A0
+X12e9: lcall otp_lcd_write
+ mov a,r0
+ ljmp otp_lcd_write
+;
+X12f0: clr LCD_A0
+ sjmp X12e9
+;
diff -Nuar --exclude .svn trunk//src/lcd/coby_mko/lcdinit.s ../dpf-ax.30-coby320x240//src/lcd/coby_mko/lcdinit.s
--- trunk//src/lcd/coby_mko/lcdinit.s 1970-01-01 07:30:00.000000000 +0730
+++ ../dpf-ax.30-coby320x240//src/lcd/coby_mko/lcdinit.s 2012-10-10 09:12:53.411631621 +0800
@@ -0,0 +1,49 @@
+ .include 'dpf.inc'
+
+ .area LCDAUX (CODE)
+
+_lcd_custom_init::
+ mov dptr,#_custom_initseq
+ ljmp _lcd_init_by_table
+
+ .area LCDAUX (CODE)
+
+_custom_lcdcontrasttbl::
+ .db 0x01, 0x07, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10
+_custom_lcdcontrasttbl_len:: .db 9
+
+_custom_contrasttbl2::
+ .db 0xdd, 0x14, 0x08, 0x71, 0x00, 0x71, 0x00, 0x91, 0x00, 0x91
+ .db 0x00
+_custom_contrasttbl2_len:: .db 11
+
+_custom_backlighttbl::
+ .db 0x06, 0x10, 0x1a, 0x24, 0x2e, 0x38, 0x42, 0x4c, 0x56, 0x60
+ .db 0x6a, 0x74, 0x7e, 0x88, 0x92, 0x9c, 0xa6, 0xb0, 0xba, 0xc4
+ .db 0xce, 0xd8
+_custom_backlighttbl_len:: .db 22
+
+_custom_backlighttbl2::
+_custom_backlighttbl2_len:: .db 0
+
+_custom_initseq::
+ .db 0x00, 0xb0, 0x64, 0x11, 0xb0, 0x0a, 0x10, 0xb0, 0x64, 0x11
+ .db 0xb0, 0xff, 0x72, 0x00, 0x00, 0x92, 0x00, 0x01, 0xb0, 0xc8
+ .db 0x72, 0x00, 0x01, 0x92, 0x00, 0x00, 0x72, 0x00, 0x03, 0x92
+ .db 0x10, 0x98, 0x72, 0x00, 0x10, 0x92, 0x17, 0x90, 0x72, 0x00
+ .db 0x60, 0x92, 0x27, 0x00, 0x72, 0x00, 0x61, 0x92, 0x00, 0x01
+ .db 0x72, 0x00, 0x46, 0x92, 0x00, 0x02, 0x72, 0x00, 0x13, 0x92
+ .db 0x80, 0x10, 0x72, 0x00, 0x12, 0x92, 0x80, 0xfe, 0x72, 0x00
+ .db 0x02, 0x92, 0x05, 0x00, 0x72, 0x00, 0x30, 0x92, 0x03, 0x03
+ .db 0x72, 0x00, 0x31, 0x92, 0x03, 0x03, 0x72, 0x00, 0x32, 0x92
+ .db 0x03, 0x03, 0x72, 0x00, 0x33, 0x92, 0x03, 0x00, 0x72, 0x00
+ .db 0x34, 0x92, 0x00, 0x03, 0x72, 0x00, 0x35, 0x92, 0x03, 0x03
+ .db 0x72, 0x00, 0x36, 0x92, 0x00, 0x14, 0x72, 0x00, 0x37, 0x92
+ .db 0x03, 0x03, 0x72, 0x00, 0x38, 0x92, 0x03, 0x03, 0x72, 0x00
+ .db 0x39, 0x92, 0x03, 0x03, 0x72, 0x00, 0x3a, 0x92, 0x03, 0x00
+ .db 0x72, 0x00, 0x3b, 0x92, 0x00, 0x03, 0x72, 0x00, 0x3c, 0x92
+ .db 0x03, 0x03, 0x72, 0x00, 0x3d, 0x92, 0x14, 0x00, 0x72, 0x00
+ .db 0x92, 0x92, 0x02, 0x00, 0x72, 0x00, 0x93, 0x92, 0x03, 0x03
+ .db 0x72, 0x00, 0x90, 0x92, 0x08, 0x0d, 0x72, 0x00, 0x07, 0x92
+ .db 0x01, 0x73, 0xff
+_custom_initseq_len:: .db 183
diff -Nuar --exclude .svn trunk//src/lcd/coby_mko/lcdsetor.s ../dpf-ax.30-coby320x240//src/lcd/coby_mko/lcdsetor.s
--- trunk//src/lcd/coby_mko/lcdsetor.s 1970-01-01 07:30:00.000000000 +0730
+++ ../dpf-ax.30-coby320x240//src/lcd/coby_mko/lcdsetor.s 2012-10-10 09:10:38.796736835 +0800
@@ -0,0 +1,10 @@
+ .include 'dpf.inc'
+
+ .area INIT (CODE)
+
+; Just a nop at the moment - only landscape supported!
+; If you want other orientations, add code here,
+; create a correspondig method to lcdblit_*.s" and modify lcdinit_*.c accordingly.
+;
+_lcd_custom_setorientation::
+ ret
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment