progress report

5 views
Skip to first unread message

Caerwyn Jones

unread,
Mar 31, 2008, 12:02:58 PM3/31/08
to inferno-ds
I'll give an update of what I've been doing. Since inferno was coming
up on the hardware with buttons working I decided I'd spend a lot more
of my inferno-lab time on the inferno-ds.

I started with getting prefab and the mux window manager working.
This didn't take long, and I think its a good path to follow. Its
small, starts quickly, uses the keys effectively since it was designed
for remote controls, the programs are easy to understand, and they hit
most of the applications I'd like to start with, small games, news
reader, email reader, simple database browser (movies, tvlist), and
audio.

But I was having problems with the keys. I was getting double
presses. So I spent several evenings staring at the interrupt code
and IPC. Not until about 11:30pm last night did I begin to see what
was going on. Anyway, here's what I confirmed,

1. trap() is being called on the ARM9. At the moment its only being
called for the timer at 1HZ. I was surprised that copying the
interrupt vector to address 0 actually worked, rather than setting up
an interrupt handler register as suggested by most of the docs. I
thought that address would be reserved for the BIOS. The ARM7 code is
using the interrupt handler register.

2. I tried and tried to enable Key interrupts on the ARM9. No luck.
I was enabling it in the multiple places that need to be set.

3. I tried to enable VBLANK interrupt on the ARM9, No luck.

4. I tried to enable IPC interrupt on ARM9. Success!


The ARM7 does have VBLANK and VCOUNTER interrupts working and on one
of those it can cause the ARM9 to interrupt on the IPC bit.

But the existing code wasn't doing that. The current code seems to be
polling a shared memory, there's no locking, or waiting for the IPC
interrupts. So that could explain some of the Keys weirdness.


My next step is to try and enable Key interrupts on ARM7, then use IPC
bit to signal to ARM9 to read the keys.

Caerwyn

Caerwyn Jones

unread,
Mar 31, 2008, 11:00:29 PM3/31/08
to inferno-ds
Salva let me know the problem I was having with key interrupts was
actually to do with desmume. They worked on the hardware and on dsemu.
But dsemu has other problems. It's hard to get an environment where
everything is working just right. desmume works best, except for the
keys.

I've uploaded my latest build http://caerwyn.com/downloads/ipds1.nds

This is prefab and mux. It only runs on the hardware. On desmume it
comes up but you can't use the keys to get to any of the options. On
the hardware you can navigate using the keys, but the graphics don't
display.

Things to try if you download it. Rocker moves up and down selection.
'A' key enters, 'B' key backs out back up to the higher level. 'Start'
key returns to the top level menu.

Try Today's Newspaper, and The Thisburgh has the only working graphic.
Under news click through to actually read an article. Under games, try
connect4. Audio control would look cool if any of the graphics
actually came in. The Financial Reports gives a ticker. It scrolls
slowly only because of the sleep interval in the code. The sleep(2)
timeout doesn't match up to real milliseconds; a bug.

Caerwyn

David Leimbach

unread,
Mar 31, 2008, 11:06:41 PM3/31/08
to infer...@googlegroups.com
I can't run this binary, probably for the same reason I can't run salva's config.  I'm not sure what's missing or why the M3 player is having trouble with these configs or what precisely is causing the problem.

The older configs still seem to work fine.  I've not narrowed it all down yet.

Salva Peiró

unread,
Apr 1, 2008, 9:54:30 AM4/1/08
to infer...@googlegroups.com
On Mon, Mar 31, 2008 at 6:02 PM, Caerwyn Jones <caer...@gmail.com> wrote:
>
> I'll give an update of what I've been doing. Since inferno was coming
> up on the hardware with buttons working I decided I'd spend a lot more
> of my inferno-lab time on the inferno-ds.
>
> I started with getting prefab and the mux window manager working.
> This didn't take long, and I think its a good path to follow. Its
> small, starts quickly, uses the keys effectively since it was designed
> for remote controls, the programs are easy to understand, and they hit
> most of the applications I'd like to start with, small games, news
> reader, email reader, simple database browser (movies, tvlist), and
> audio.
>
> But I was having problems with the keys. I was getting double
> presses.

I can provide a little help here,
the code handling keys and touch screen should be revised: devnds.c:/^ndskeys.

I've attached a quick fix, i'll push to the repo
after some more testing (checked it only under desmume),

thanks for the bug report.

--
salva

devnds-doubles.patch

Salva Peiró

unread,
Apr 1, 2008, 11:01:06 AM4/1/08
to infer...@googlegroups.com
On Tue, Apr 1, 2008 at 5:00 AM, Caerwyn Jones <caer...@gmail.com> wrote:
>
> Salva let me know the problem I was having with key interrupts was
> actually to do with desmume. They worked on the hardware and on dsemu.
> But dsemu has other problems. It's hard to get an environment where
> everything is working just right. desmume works best, except for the
> keys.
>

> I've uploaded my latest build http://caerwyn.com/downloads/ipds1.nds

You can also upload them to inferno-ds downloads,
my idea is to put there stable/well tested nds files:
http://code.google.com/p/inferno-ds/downloads

> The sleep(2) timeout doesn't match up to real milliseconds; a bug.

The timer0 should be generating an interrput at a rate of HZ = 100
(see mem.h and clock.c),
thus i think the best resolution achievable using sleep is T=1/100 = 0.01 secs.

--
salva

Reply all
Reply to author
Forward
0 new messages