#include "video_low.h"
#include "input.h"
#include "console.h"
+#include "irq.h"
+#include "usb/core/core.h"
+#include "usb/drivers/class/hid.h"
#include "sha1.h"
#include "hollywood.h"
exception_init();
dsp_reset();
- // clear interrupt mask
- write32(0x0c003004, 0);
+ irq_initialize();
+ irq_bw_enable(BW_PI_IRQ_RESET);
+ irq_bw_enable(BW_PI_IRQ_HW); //hollywood pic
+ /* external ohci */
+ irq_hw_enable(IRQ_OHCI0);
+ /* internal ohci */
+ //irq_hw_enable(IRQ_OHCI1);
ipc_initialize();
ipc_slowping();
; // better ideas welcome!
}
+ /* external ohci */
+ usb_init(OHCI0_REG_BASE);
+
+ /* internal ohci */
+ //usb_init(OHCI1_REG_BASE);
+
+ /* load HID keyboard driver */
+ usb_hidkb_init();
+
+ /* you are welcome to make this nice :) */
+ char str[7];
+ u16 i, j, y=20, x=20;
+ struct kbrep *k;
+
+ while(1) {
+ memset(str, '\0', 8);
+ j=0;
+ k = usb_hidkb_getChars();
+ for(i=0; k->keys[i]>0; i++) {
+ if(x>650) {
+ x = 20;
+ y += 15;
+ }
+ if(y>440) {
+ y=20;
+ }
+ if((k->keys[i] >= 4) && k->keys[i] <= 4+'z'-'a') {
+ str[j] = k->keys[i] - 4 + 'a';
+ }
+ else if (k->keys[i] == 0x28) {
+ y += 15;
+ x = 20;
+ }
+ j++;
+ }
+ if(j > 0) {
+ print_str_noscroll(x, y, str);
+ printf("y: %d\n", y);
+ }
+ while(j--) {
+ x += 13;
+ }
+ }
+
+#if 0
printf("===============================\n");
SHA1TestCases();
printf("bye, world!\n");
+#endif
return 0;
}