Release DraStic Nintendo DS emulator


Just started Fire Emblem DS on this. I managed to play through the first scenario, though there were a couple of graphical glitches. Firstly, there looks to be an off-by-one error on most character animations, as once you get to a gameplay map, hovering over a character causes all characters to slide off the left as they animate, and also some icons, notably arrow icons slide into the next character. Secondly intro text on the top screen seems to have some duplicated scaled rubbish above the two lines of text, and on some pages a grey box obscures the second line of text.


I successfully completed the first scenario, saved using the game save system, then saved a savestate. On restarting, I tried to reload the savestate, but it did nothing and continued to play the attract screen. Shortly after (think I may have pressed B a couple of times) the system seized, and I had to reboot. On restart, I don't appear to have a /proc/last_kmsg file or any other log file I can report. Please let me know if there's some log I'm missing.
 
Uploaded a new version, has the conditional microphone code and a few other minor fixes and changes. Readme is in the usual place. Let me know how the freezes go. If it happens check if the stdout file was created, and see if the microphone was turned on it (there'll be a line about ALSA capture).
 
No crash so far.

Here's the dmesg:

Code:
[    0.000000] Linux version 3.2.39 (notaz@pixelinis) (gcc version 4.5.2 (Sourcery G++ Lite 2011.03-41) ) #874 Tue Apr 23 22:34:55 EEST 2013
[    0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c5387d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] Machine: Pandora Handheld Console
[    0.000000] Initialized persistent memory from 80fe0000-80ffffff
[    0.000000] cma: CMA: reserved 16 MiB at 9f000000
[    0.000000] Memory policy: ECC disabled, Data cache writeback
[    0.000000] On node 0 totalpages: 131072
[    0.000000] free_area_init_node: node 0, pgdat c05b236c, node_mem_map c05e4000
[    0.000000]   Normal zone: 1024 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 130048 pages, LIFO batch:31
[    0.000000] OMAP3630 ES1.2 (l2cache iva sgx neon isp 192mhz_clk )
[    0.000000] Clocking rate (Crystal/Core/MPU): 26.0/400/600 MHz
[    0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[    0.000000] pcpu-alloc: [0] 0 
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 130048
[    0.000000] Kernel command line: ubi.mtd=4 ubi.mtd=3 root=ubi0:rootfs rootfstype=ubifs rw rootflags=bulk_read vram=6272K omapfb.vram=0:3000K mmc_core.removable=0 quiet
[    0.000000] PID hash table entries: 2048 (order: 1, 8192 bytes)
[    0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
[    0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
[    0.000000] Memory: 512MB = 512MB total
[    0.000000] Memory: 497180k/497180k available, 27108k reserved, 0K highmem
[    0.000000] Virtual kernel memory layout:
[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
[    0.000000]     fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
[    0.000000]     vmalloc : 0xe0800000 - 0xf8000000   ( 376 MB)
[    0.000000]     lowmem  : 0xc0000000 - 0xe0000000   ( 512 MB)
[    0.000000]     modules : 0xbf000000 - 0xc0000000   (  16 MB)
[    0.000000]       .text : 0xc0008000 - 0xc05436dc   (5358 kB)
[    0.000000]       .init : 0xc0544000 - 0xc0576000   ( 200 kB)
[    0.000000]       .data : 0xc0576000 - 0xc05b2ac0   ( 243 kB)
[    0.000000]        .bss : 0xc05b2ae4 - 0xc05e3ce0   ( 197 kB)
[    0.000000] SLUB: Genslabs=11, HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS:410
[    0.000000] IRQ: Found an INTC at 0xfa200000 (revision 4.0) with 96 interrupts
[    0.000000] Total of 96 interrupts on 1 active controller
[    0.000000] OMAP clockevent source: GPTIMER1 at 32768 Hz
[    0.000000] sched_clock: 32 bits at 32kHz, resolution 30517ns, wraps every 131071999ms
[    0.000000] Console: colour dummy device 80x30
[    0.000000] console [tty0] enabled
[    0.000183] Calibrating delay loop... 597.64 BogoMIPS (lpj=2334720)
[    0.039123] pid_max: default: 32768 minimum: 301
[    0.039367] Mount-cache hash table entries: 512
[    0.039764] Initializing cgroup subsys devices
[    0.039825] CPU: Testing write buffer coherency: ok
[    0.040008] hw perfevents: enabled with ARMv7 Cortex-A8 PMU driver, 5 counters available
[    0.040100] Setting up static identity map for 0x803e61f0 - 0x803e6248
[    0.040771] devtmpfs: initialized
[    0.056732] print_constraints: dummy: 
[    0.057952] NET: Registered protocol family 16
[    0.059661] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.060028] GPMC revision 5.0
[    0.063110] OMAP GPIO hardware version 2.5
[    0.066345] omap_mux_init: Add partition: #1: core, flags: 0
[    0.072998] Reprogramming SDRC clock to 400000000 Hz
[    0.075195] hw-breakpoint: debug architecture 0x4 unsupported.
[    0.082061]  omap-mcbsp.2: alias fck already exists
[    0.082366]  omap-mcbsp.3: alias fck already exists
[    0.083801] OMAP DMA hardware revision 5.0
[    0.098663] bio: create slab <bio-0> at 0
[    0.099761] print_constraints: vwlan: 1800 mV 
[    0.101287] SCSI subsystem initialized
[    0.103607] usbcore: registered new interface driver usbfs
[    0.103851] usbcore: registered new interface driver hub
[    0.104095] usbcore: registered new device driver usb
[    0.117309] omap_i2c omap_i2c.1: bus 1 rev1.4.0 at 2600 kHz
[    0.120452] twl4030: PIH (irq 7) chaining IRQs 368..375
[    0.120544] twl4030: power (irq 373) chaining IRQs 376..383
[    0.121093] twl4030: gpio (irq 368) chaining IRQs 384..401
[    0.121520] _omap_mux_init_gpio: Could not set gpio192
[    0.122589] _omap_mux_init_gpio: Could not set gpio193
[    0.125183] print_constraints: VUSB1V5: 1500 mV normal standby
[    0.125854] print_constraints: VUSB1V8: 1800 mV normal standby
[    0.126403] print_constraints: VUSB3V1: 3100 mV normal standby
[    0.187622] twl4030_usb twl4030_usb: Initialized TWL4030 USB module
[    0.188934] print_constraints: vdd_mpu_iva: 600 <--> 1450 mV normal 
[    0.189514] print_constraints: vdd_core: 600 <--> 1450 mV normal 
[    0.190216] print_constraints: VMMC1: 1850 <--> 3150 mV at 3150 mV normal standby
[    0.190887] print_constraints: VDAC: 1800 mV normal standby
[    0.191558] print_constraints: VAUX2: 1800 mV normal standby
[    0.192199] print_constraints: VPLL2: 1800 mV normal standby
[    0.192901] print_constraints: VMMC2: 1850 <--> 3150 mV at 3150 mV normal standby
[    0.193572] print_constraints: VSIM: 2800 mV normal standby
[    0.194183] print_constraints: VAUX1: 3000 mV normal standby
[    0.194793] print_constraints: VAUX4: 3000 mV normal standby
[    0.203247] omap_i2c omap_i2c.3: bus 3 rev1.4.0 at 100 kHz
[    0.205413] omap-iommu omap-iommu.0: isp registered
[    0.205993] Advanced Linux Sound Architecture Driver Version 1.0.24.
[    0.206817] Switching to clocksource 32k_counter
[    0.228454] musb-hdrc: version 6.0, ?dma?, otg (peripheral+host)
[    0.233764] musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, bulk combine, bulk split, HB-ISO Rx, HB-ISO Tx, SoftConn)
[    0.233795] musb-hdrc: MHDRC RTL version 1.800 
[    0.233825] musb-hdrc: setup fifo_mode 4
[    0.233825] musb-hdrc: 28/31 max ep, 16384/16384 memory
[    0.234344] musb-hdrc musb-hdrc: USB OTG mode controller at fa0ab000 using DMA, IRQ 92
[    0.235076] NET: Registered protocol family 2
[    0.235260] IP route cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.235504] TCP established hash table entries: 16384 (order: 5, 131072 bytes)
[    0.235870] TCP bind hash table entries: 16384 (order: 4, 65536 bytes)
[    0.236083] TCP: Hash tables configured (established 16384 bind 16384)
[    0.236083] TCP reno registered
[    0.236114] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.236145] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.236389] NET: Registered protocol family 1
[    0.236602] NetWinder Floating Point Emulator V0.97 (double precision)
[    0.242156] HugeTLB registered 2 MB page size, pre-allocated 0 pages
[    0.257659] VFS: Disk quotas dquot_6.5.2
[    0.258056] Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    0.262878] msgmni has been set to 1003
[    0.264678] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 253)
[    0.264678] io scheduler noop registered
[    0.264709] io scheduler deadline registered
[    0.264739] io scheduler cfq registered (default)
[    0.279602] OMAP DSS rev 2.0
[    0.282806] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
[    0.284851] omap_uart.0: ttyO0 at MMIO 0x4806a000 (irq = 72) is a OMAP UART0
[    0.285369] omap_uart.1: ttyO1 at MMIO 0x4806c000 (irq = 73) is a OMAP UART1
[    0.285766] omap_uart.2: ttyO2 at MMIO 0x49020000 (irq = 74) is a OMAP UART2
[    0.286193] omap_uart.3: ttyO3 at MMIO 0x49042000 (irq = 80) is a OMAP UART3
[    0.297882] brd: module loaded
[    0.303741] loop: module loaded
[    0.303802] OMAP overclocker loaded.
[    0.305908] omap2-nand driver initializing
[    0.306060] NAND device: Manufacturer ID: 0x2c, Chip ID: 0xbc (Micron NAND 512MiB 1,8V 16-bit)
[    0.306488] Creating 5 MTD partitions on "omap2-nand.0":
[    0.306518] 0x000000000000-0x000000080000 : "xloader"
[    0.307250] 0x000000080000-0x000000260000 : "uboot"
[    0.308197] 0x000000260000-0x000000280000 : "uboot-env"
[    0.308868] 0x000000280000-0x000000c80000 : "boot"
[    0.311248] 0x000000c80000-0x000020000000 : "rootfs"
[    0.401794] UBI: attaching mtd4 to ubi0
[    1.376373] UBI: scanning is finished
[    1.390289] UBI: attached mtd4 (name "rootfs", size 499 MiB) to ubi0
[    1.390319] UBI: PEB size: 131072 bytes (128 KiB), LEB size: 129024 bytes
[    1.390319] UBI: min./max. I/O unit sizes: 2048/2048, sub-page size 512
[    1.390350] UBI: VID header offset: 512 (aligned 512), data offset: 2048
[    1.390350] UBI: good PEBs: 3996, bad PEBs: 0, corrupted PEBs: 0
[    1.390380] UBI: user volume: 1, internal volumes: 1, max. volumes count: 128
[    1.390380] UBI: max/mean erase counter: 71/2, WL threshold: 4096, image sequence number: 566439273
[    1.390411] UBI: available PEBs: 0, total reserved PEBs: 3996, PEBs reserved for bad PEB handling: 39
[    1.390441] UBI: attaching mtd3 to ubi1
[    1.390808] UBI: background thread "ubi_bgt0d" started, PID 572
[    1.410552] UBI: scanning is finished
[    1.417358] UBI: attached mtd3 (name "boot", size 10 MiB) to ubi1
[    1.417388] UBI: PEB size: 131072 bytes (128 KiB), LEB size: 129024 bytes
[    1.417388] UBI: min./max. I/O unit sizes: 2048/2048, sub-page size 512
[    1.417419] UBI: VID header offset: 512 (aligned 512), data offset: 2048
[    1.417419] UBI: good PEBs: 80, bad PEBs: 0, corrupted PEBs: 0
[    1.417449] UBI: user volume: 1, internal volumes: 1, max. volumes count: 128
[    1.417449] UBI: max/mean erase counter: 17/6, WL threshold: 4096, image sequence number: 860654548
[    1.417480] UBI: available PEBs: 0, total reserved PEBs: 80, PEBs reserved for bad PEB handling: 2
[    1.417663] UBI: background thread "ubi_bgt1d" started, PID 577
[    1.417755] usbcore: registered new interface driver libusual
[    1.418457] mousedev: PS/2 mouse device common for all mice
[    1.419067] input: keypad as /devices/platform/omap_i2c.1/i2c-1/1-004a/twl4030_keypad/input/input0
[    1.423339] input: power-button as /devices/platform/omap_i2c.1/i2c-1/1-0049/twl4030_pwrbutton/input/input1
[    1.424560] input: nub0 as /devices/platform/omap_i2c.3/i2c-3/3-0066/input/input2
[    1.425903] input: nub1 as /devices/platform/omap_i2c.3/i2c-3/3-0067/input/input3
[    1.432067] twl_rtc twl_rtc: rtc core: registered twl_rtc as rtc0
[    1.433135] i2c /dev entries driver
[    1.437591] bq27x00-battery 3-0055: support ver. 1.2.0 enabled
[    1.461303] OMAP Watchdog Timer Rev 0x31: initial timeout 60 sec
[    1.461700] twl4030_wdt twl4030_wdt: Failed to register misc device
[    1.461730] twl4030_wdt: probe of twl4030_wdt failed with error -16
[    1.462341] cpuidle: using governor ladder
[    1.462371] cpuidle: using governor menu
[    1.744201] Registered led device: pandora::sd1
[    1.744476] Registered led device: pandora::sd2
[    1.744720] Registered led device: pandora::bluetooth
[    1.744964] Registered led device: pandora::wifi
[    1.746368] Registered led device: pandora::keypad_bl
[    1.747344] Registered led device: pandora::power
[    1.750061] Registered led device: pandora::charger
[    1.751251] usbcore: registered new interface driver usbhid
[    1.751281] usbhid: USB HID core driver
[    1.751525] persistent_ram: uncorrectable error in header
[    1.751525] persistent_ram: no valid data in buffer (sig = 0xb7d5fffd)
[    1.752166] console [ram-1] enabled
[    1.754577] OMAP3 Pandora SoC init
[    1.789825] mmc2: card claims to support voltages below the defined range. These will be ignored.
[    1.790802] mmc2: new SDIO card at address 0001
[    1.836059] asoc: twl4030-hifi <-> omap-mcbsp-dai.1 mapping ok
[    1.837554] asoc: twl4030-hifi <-> omap-mcbsp-dai.3 mapping ok
[    1.840148] ALSA device list:
[    1.840148]   #0: omap3pandora
[    1.840332] TCP cubic registered
[    1.840332] NET: Registered protocol family 17
[    1.840393] NET: Registered protocol family 15
[    1.840423] Registering the dns_resolver key type
[    1.840484] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3
[    1.840484] ThumbEE CPU extension supported.
[    1.840515] Registering SWP/SWPB emulation handler
[    1.847045] clock: disabling unused clocks to save power
[    1.848297] registered taskstats version 1
[    1.863372] Console: switching to colour frame buffer device 100x30
[    2.048034] input: gpio-keys as /devices/platform/gpio-keys/input/input4
[    2.049346] twl_rtc twl_rtc: setting system clock to 2013-04-23 22:01:59 UTC (1366754519)
[    2.051147] UBIFS: background thread "ubifs_bgt0_0" started, PID 674
[    2.124908] UBIFS: mounted UBI device 0, volume 0, name "rootfs"(null)
[    2.124908] UBIFS: LEB size: 129024 bytes (126 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
[    2.124938] UBIFS: FS size: 508612608 bytes (485 MiB, 3942 LEBs), journal size 9033728 bytes (8 MiB, 71 LEBs)
[    2.124969] UBIFS: reserved for root: 0 bytes (0 KiB)
[    2.124969] UBIFS: media format: w4/r0 (latest is w4/r0), UUID 8671A7C9-9734-428C-9CAA-74588FCC3AEA, small LPT model
[    2.127075] VFS: Mounted root (ubifs filesystem) on device 0:14.
[    2.129119] devtmpfs: mounted
[    2.129425] Freeing init memory: 200K
[    3.474151] UBI: fixable bit-flip detected at PEB 978
[    3.474182] UBI: schedule PEB 978 for scrubbing
[    3.496826] UBI: fixable bit-flip detected at PEB 978
[    3.539550] UBI: scrubbed PEB 978 (LEB 0:2599), data moved to PEB 2391
[    4.332641] UBI: fixable bit-flip detected at PEB 918
[    4.332641] UBI: schedule PEB 918 for scrubbing
[    4.346649] UBI: fixable bit-flip detected at PEB 918
[    4.386474] UBI: scrubbed PEB 918 (LEB 0:2606), data moved to PEB 133
[    5.461547] udevd (720): /proc/720/oom_adj is deprecated, please use /proc/720/oom_score_adj instead.
[   28.246643] ads7846 spi1.0: touchscreen, irq 254
[   28.247528] input: touchscreen as /devices/platform/omap2_mcspi.1/spi_master/spi1/spi1.0/input/input5
[   35.769683] alignment: ignoring faults is unsafe on this CPU.  Defaulting to fixup mode.
[   36.018920] fuse init (API version 7.17)
[   36.131988] NET: Registered protocol family 10
[   36.267669] zram: module is from the staging directory, the quality is unknown, you have been warned.
[   36.269805] zram: num_devices not specified. Using default: 1
[   36.269836] zram: Creating 1 devices ...
[   36.452941] UBIFS: background thread "ubifs_bgt1_0" started, PID 1471
[   36.527679] UBIFS: mounted UBI device 1, volume 0, name "boot"(null)
[   36.527709] UBIFS: LEB size: 129024 bytes (126 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
[   36.527740] UBIFS: FS size: 8386560 bytes (7 MiB, 65 LEBs), journal size 1032193 bytes (0 MiB, 6 LEBs)
[   36.527740] UBIFS: reserved for root: 396117 bytes (386 KiB)
[   36.527770] UBIFS: media format: w4/r0 (latest is w4/r0), UUID 10BCD217-EC51-44AB-84FB-C50498BA4C69, small LPT model
[   36.865692] zram: disk size not provided. You can use disksize_kb module param to specify size.
[   36.865722] Using default: (25% of RAM).
[   36.866119] FAT-fs (zram0): bogus number of reserved sectors
[   36.866394] FAT-fs (zram0): Can't find a valid FAT filesystem
[   37.268035] FAT-fs (zram0): bogus number of reserved sectors
[   37.268402] FAT-fs (zram0): Can't find a valid FAT filesystem
[   39.980621] platform mpu.0: max OPP set to 4
[   40.264190] input: nub0 as /devices/platform/omap_i2c.3/i2c-3/3-0066/input/input6
[   40.323333] input: nub1 as /devices/platform/omap_i2c.3/i2c-3/3-0067/input/input7
[   40.477081] Adding 128436k swap on /dev/zram0.  Priority:5 extents:1 across:128436k SS
[   41.560394] SGX clock rate 200 MHz
[   42.538146]  gadget: using random self ethernet address
[   42.538177]  gadget: using random host ethernet address
[   42.541046] usb0: MAC 1a:ec:9c:01:7e:13
[   42.541046] usb0: HOST MAC 7e:0c:d9:dc:0c:9a
[   42.550811]  gadget: CDC Composite Gadget, version: King Kamehameha Day 2008
[   42.550842]  gadget: g_cdc ready
[   42.556976] musb-hdrc musb-hdrc: MUSB HDRC host driver
[   42.557067] musb-hdrc musb-hdrc: new USB bus registered, assigned bus number 1
[   42.557159] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[   42.557159] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[   42.557189] usb usb1: Product: MUSB HDRC host driver
[   42.557189] usb usb1: Manufacturer: Linux 3.2.39 musb-hcd
[   42.557189] usb usb1: SerialNumber: musb-hdrc
[   42.559082] hub 1-0:1.0: USB hub found
[   42.559112] hub 1-0:1.0: 1 port detected
[   49.271362] Bluetooth: Core ver 2.16
[   49.276153] NET: Registered protocol family 31
[   49.276184] Bluetooth: HCI device and connection manager initialized
[   49.276184] Bluetooth: HCI socket layer initialized
[   49.276184] Bluetooth: L2CAP socket layer initialized
[   49.278625] Bluetooth: SCO socket layer initialized
[  386.374145]  gadget: high-speed config #1: CDC Composite (ECM + ACM)
[  392.613555] platform mpu.0: max OPP set to 1
[  932.031036]  gadget: high-speed config #1: CDC Composite (ECM + ACM)
[ 9337.488037] mmc1: host does not support reading read-only switch. assuming write-enable.
[ 9337.490631] mmc1: new high speed SDHC card at address b368
[ 9337.504302] mmcblk0: mmc1:b368 LEXAR 29.8 GiB 
[ 9337.514801]  mmcblk0: p1
[ 9341.517913] FAT-fs (mmcblk0): invalid media value (0x00)
[ 9341.518463] FAT-fs (mmcblk0): Can't find a valid FAT filesystem
[ 9342.532226] FAT-fs (mmcblk0): invalid media value (0x00)
[ 9342.533203] FAT-fs (mmcblk0): Can't find a valid FAT filesystem
[11535.519958] platform mpu.0: max OPP set to 4
[11594.432647] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[11594.581176] aufs 3.2-20120109
[11594.606170] aufs test_add:261:mount[2466]: uid/gid/perm /mnt/pnd/DraStic 1000/1000/0775, 0/0/0777
[13505.323181] DMA transaction error with device 20
[13505.323211] ------------[ cut here ]------------
[13505.323242] WARNING: at arch/arm/mach-omap2/omap_l3_smx.c:186 omap3_l3_app_irq+0x12c/0x134()
[13505.323272] Modules linked in: aufs squashfs xz_dec bluetooth g_cdc omaplfb(O) pvrsrvkm(O) zram(C) snd_seq snd_seq_device snd_pcm_oss snd_mixer_oss ipv6 fuse ads7846 hwmon
[13505.323333] [<c001a680>] (unwind_backtrace+0x0/0xf8) from [<c003f0c4>] (warn_slowpath_common+0x54/0x64)
[13505.323364] [<c003f0c4>] (warn_slowpath_common+0x54/0x64) from [<c003f0f0>] (warn_slowpath_null+0x1c/0x24)
[13505.323364] [<c003f0f0>] (warn_slowpath_null+0x1c/0x24) from [<c002ea84>] (omap3_l3_app_irq+0x12c/0x134)
[13505.323394] [<c002ea84>] (omap3_l3_app_irq+0x12c/0x134) from [<c007b354>] (handle_irq_event_percpu+0x54/0x194)
[13505.323425] [<c007b354>] (handle_irq_event_percpu+0x54/0x194) from [<c007b4bc>] (handle_irq_event+0x28/0x38)
[13505.323425] [<c007b4bc>] (handle_irq_event+0x28/0x38) from [<c007d234>] (handle_level_irq+0x84/0x108)
[13505.323455] [<c007d234>] (handle_level_irq+0x84/0x108) from [<c007ac58>] (generic_handle_irq+0x30/0x40)
[13505.323486] [<c007ac58>] (generic_handle_irq+0x30/0x40) from [<c0014b54>] (handle_IRQ+0x38/0x84)
[13505.323486] [<c0014b54>] (handle_IRQ+0x38/0x84) from [<c0013834>] (__irq_svc+0x34/0x78)
[13505.323516] [<c0013834>] (__irq_svc+0x34/0x78) from [<c0029024>] (omap3_enter_idle+0xbc/0x138)
[13505.323516] [<c0029024>] (omap3_enter_idle+0xbc/0x138) from [<c00291b0>] (omap3_enter_idle_bm+0x110/0x2b0)
[13505.323547] [<c00291b0>] (omap3_enter_idle_bm+0x110/0x2b0) from [<c02fd55c>] (cpuidle_idle_call+0xb4/0x12c)
[13505.323577] [<c02fd55c>] (cpuidle_idle_call+0xb4/0x12c) from [<c0014e10>] (cpu_idle+0x68/0xa8)
[13505.323577] [<c0014e10>] (cpu_idle+0x68/0xa8) from [<c0544758>] (start_kernel+0x2cc/0x2d8)
[13505.323608] ---[ end trace deb0793b76b78924 ]---
[13505.323608] ------------[ cut here ]------------
[13505.323608] WARNING: at arch/arm/mach-omap2/omap_l3_smx.c:161 omap3_l3_app_irq+0xe8/0x134()
[13505.323638] In-band Error seen by SDMA_RD  at address 0
[13505.323638] Modules linked in: aufs squashfs xz_dec bluetooth g_cdc omaplfb(O) pvrsrvkm(O) zram(C) snd_seq snd_seq_device snd_pcm_oss snd_mixer_oss ipv6 fuse ads7846 hwmon
[13505.323669] [<c001a680>] (unwind_backtrace+0x0/0xf8) from [<c003f0c4>] (warn_slowpath_common+0x54/0x64)
[13505.323699] [<c003f0c4>] (warn_slowpath_common+0x54/0x64) from [<c003f168>] (warn_slowpath_fmt+0x30/0x40)
[13505.323699] [<c003f168>] (warn_slowpath_fmt+0x30/0x40) from [<c002ea40>] (omap3_l3_app_irq+0xe8/0x134)
[13505.323730] [<c002ea40>] (omap3_l3_app_irq+0xe8/0x134) from [<c007b354>] (handle_irq_event_percpu+0x54/0x194)
[13505.323730] [<c007b354>] (handle_irq_event_percpu+0x54/0x194) from [<c007b4bc>] (handle_irq_event+0x28/0x38)
[13505.323760] [<c007b4bc>] (handle_irq_event+0x28/0x38) from [<c007d234>] (handle_level_irq+0x84/0x108)
[13505.323791] [<c007d234>] (handle_level_irq+0x84/0x108) from [<c007ac58>] (generic_handle_irq+0x30/0x40)
[13505.323791] [<c007ac58>] (generic_handle_irq+0x30/0x40) from [<c0014b54>] (handle_IRQ+0x38/0x84)
[13505.323822] [<c0014b54>] (handle_IRQ+0x38/0x84) from [<c0013834>] (__irq_svc+0x34/0x78)
[13505.323822] [<c0013834>] (__irq_svc+0x34/0x78) from [<c0029024>] (omap3_enter_idle+0xbc/0x138)
[13505.323852] [<c0029024>] (omap3_enter_idle+0xbc/0x138) from [<c00291b0>] (omap3_enter_idle_bm+0x110/0x2b0)
[13505.323852] [<c00291b0>] (omap3_enter_idle_bm+0x110/0x2b0) from [<c02fd55c>] (cpuidle_idle_call+0xb4/0x12c)
[13505.323883] [<c02fd55c>] (cpuidle_idle_call+0xb4/0x12c) from [<c0014e10>] (cpu_idle+0x68/0xa8)
[13505.323883] [<c0014e10>] (cpu_idle+0x68/0xa8) from [<c0544758>] (start_kernel+0x2cc/0x2d8)
[13505.323883] ---[ end trace deb0793b76b78925 ]---
 
Just started Fire Emblem DS on this. I managed to play through the first scenario, though there were a couple of graphical glitches. Firstly, there looks to be an off-by-one error on most character animations, as once you get to a gameplay map, hovering over a character causes all characters to slide off the left as they animate, and also some icons, notably arrow icons slide into the next character. --


--
I would like to know the answer to this as well. It seems to happen across both DS Fire Emblem games, on both the Pandora and my computer's emulators. The graphical glitches are definitely somewhat annoying. It is also interesting that the map is apparently 3D-rendered. The menus and dialogue are flawless, but the combat screen is horribly laggy. With frameskip 9, the music in Fire Emblem 12 (the second DS FE, Japan only) is lagless with 800 MHz, except when selecting a unit - which also has the aforementioned weird graphical glitches.
 
What are the best DS games that work well on a 1Ghz model?
I think he refers to a top 5 list of games (game quality and emulation quality).

Exophase: any idea when you can release an optimized 3D render code (just the C(++) one, not the neon assembler one)?
 
Last edited by a moderator:
Exophase: any idea when you can release an optimized 3D render code (just the C(++) one, not the neon assembler one)?
I have an integer-only C renderer started, more accurate etc - it doesn't fully work right yet and it has zero optimizations. I hope to have a few basic performance improvements to it before releasing.. I won't use anything that isn't faster. As for how much faster it can get while still C-only, I really have no idea. When I first get that idea I'll try to post some numbers.

Although this isn't really reflected in the interview, I decided to focus on optimizing the geometry engine emulation before the rasterizer. Although the rasterizer will usually use much more CPU time the geometry engine is also using what I consider a dangerously high amount. The thing is, the current design lets the rasterizer be frame skipped but not the geometry engine. And when I move to something threaded I'll probably only have the rasterizer on a separate thread, at least a first - this doesn't matter for Pandora but will for the Android port, at least for a lot of devices.

I'm probably still at least a week off before I have the C version of the new geometry core working (depending on how much I can get myself to push through the final stuff that I need to work out), then I get to incrementally optimize that, including using NEON routines.

Hopefully some kind of major release will be ready by June.
 
I have an integer-only C renderer
Less floats sounds good (in general, but we use softfp so double yeah :) ).

Although the rasterizer will usually use much more CPU time the geometry engine is also using what I consider a dangerously high amount
Sorry to waste your time, but I am just to curious. What is the ratio from geometrie engine to rasterizer? The geometrie engine "just" transformes the vertices (object space -> world space -> camera space -> projection to camera plane), are there so many vertices, or are matrix multiplications so expensive? Matrix mult. can be neonized, right (or does neon just work with floating point instructions)?
 
Last edited by a moderator:
Geometry engine does these things:

1) matrix * matrix operations for modelview/projection/direction/texture matrixes, also implicitly updates a clip matrix when you modify modelview/projection.. these include full matrix multiplications and also scale, translate, etc, and comes with a matrix stack

2) geometry transformation (matrix * vector) bringing vertexes from model space to clip space

3) lighting against up to 4 lights, when you enter a normal command it transforms the normal against the direction matrix, and for each light: calculates diffuse + specular weights vs light (dot product, specular weight also involves a square and optionally a table lookup) and calculates diffuse + specular + ambient color contribution (light weight modulated by material color) + emission color for the material. If you think about it this can be a lot of calculations and a game can give a different normal for every vertex.

4) texture coordinate transformation (possible a few different places, useful for faking environment mapping and stuff)

5) primitive assembly where it submits a triangle or quad from lists or strips

6) backface culling, this happens totally in clip space and involves really wide multiply-adds

7) frustum and optional rear plane culling

8) arbitrary polygon clipping against frustum, this will generate 1:1 polygons.. since it's against the view frustum with zero guard band it happens more than it might on other platforms, and it can be expensive

9) screen space projection, which means a division for each visible vertex, plus an addition

10) optional small (1-dot) polygon culling, this happens in screen space so needs a later pass at the end

DS is limited to being able to draw up to 2048 polygons with 6144 vertexes per frame. If the geometry engine tries to submit more than that it'll block and at this point you can pretty much stop emulating the thing entirely. But the input to the geometry engine is limited only by the engine's performance which is very high in comparison to the rasterizer. You can find games that input lots of lots of polygons (sometimes 4+ times as many as are on the scene) that just end up culled, but they still need to be transformed - and trying to defer lighting until post-culling has its own expenses. So there can be a lot of work.

To give you an idea, @ 900MHz on a CC Pandora NSMB at the world 2 level select screen is using over 9ms for geometry. It's also using over 80ms for rasterization, but that doesn't change that the geometry number is way too high and must go down. In-level the ratio will be worse because NSMB uses a lot of tiny polygons that are cheaper to rasterize but still cost geometry time.

The geometry engine I have right now is not well optimized, there are many things I want to do. First though, it needed a total change in the basic dataflow. The approach I'm employing right now is to batch up untransformed vertexes and normals and transform + light them in blocks, then submit them to transformed vertex queues. These queues then track bundles of polygons (lists or strips) between glBegin commands, and when they fill up get flushed. The flushing will perform tests to determine which polygons should be culled or clipped then it'll split the bundles into multiple bundles where clipping or culling happens. Then it'll clip the clip bundles and finally it'll perform perspective transform on blocks of the vertexes in the buffer and submit them. But there's some annoying tracking logic that has to be done to support bundles that spill over the buffer sizes and matching per-polygon attributes (texture stuff) to output polygons. I'm still working on that stuff.

Right now what's most likely causing the biggest performance impact to the geometry core is that I for perspective transform I do 64-bit divisions where possibly only 32-bit is needed, and I do it three times for the same denominator instead of using a reciprocal calculation. I also do it redundantly for shared vertexes. And I do it before backface culling because I do the latter in screen space. 64-bit integer divisions are going to be super slow, and I can see how this is costing hundreds of extra cycles per polygon. So a NEON optimized reciprocal approximation loop over big blocks of vertexes will help a lot. I'll also use NEON in blocks for vertex transformation, lighting (should help especially here because I can use 16x16-bit operations), and clip/cull tests. I can probably further improve lighting a lot by detecting when the specular material is black, which is usually the case. And I can detect identity transforms used by 2D games, for instance. When moving to block processing there's a lot of stuff that becomes cheaper to special case. Another thing that's wrong with the current version is the data representation is awful, vertex structs are twice as big as they need to be and polygon structs have an array of 9 pointers to vertexes when ideally it should just need a 13-bit offset and a bit that says whether or not to swap the first two vertex indexes. So it's not cache friendly and there's no prefetching or anything to try to help.

But it's all a fair amount of work and has to be done.
 
Last edited by a moderator:
Thank you for your detailed answer :) . Not sure how expensive the clipping against the viewing frustum is. Maybe it could help to use an axis aligned box, to sort polygons out, that are outside the visible area. And then start the is_vertex_inside_frustum(Vec4i* vert) code. Just a spontaneous idea, since the box test is one of the cheapest things you can do.  But probably I am just waisting your time. You have done great work, and if you succeed with your optimization the emulation will become a lot faster. The Pandora community is lucky that you invest your time and hard work for us :) .
 
Last edited by a moderator:
That's how it works. The vertex clip-space x, y, and z are compared against w and -w to see if it's bounded by the frustum. This creates a 6-bit clip code. It's really standard 3D engine practice. Note the view space isn't a box, it's a square frustum (http://upload.wikimedia.org/wikipedia/commons/6/6a/Usech_kvadrat_piramid.png). The further away from the camera your view gets the wider your field of view is.

Two quick tests are done - if the OR of all the clip codes in the polygon is 0 the polygon is inside the view frustum. If the AND is non-zero then the polygon is entirely outside the view frustum. There are other cases where the polygon is entirely outside the view frustum where the latter doesn't pass, but they usually aren't that common and aren't that expensive to pick up afterwards.

In case the terms aren't clear to you, clipping means that the polygon is partially visible and that the view frustum bisects it. The expensive part is creating the new vertexes, it involves some divisions. Culling refers to cases where the polygon is completely discarded because it's outside the view frustum or wrong-facing.
 
Last edited by a moderator:
Thanks for all the hard work and the update Exophase! 

Gonna go try out the new build  :)
 
Last edited by a moderator:
Back
Top