Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - pbfy0

Pages: [1]
1
TI-Nspire / nspire-z80: open source ti-84 emulator for the nspire cx
« on: February 16, 2016, 01:23:26 pm »

This emulator is not fully functional, but it can boot up TI-OS, so it's fairly complete. It seems to freeze if it's idle for long enough that it should turn off, so don't use it for anything critical. However, it does work, so I'm publishing it now. I hope to keep working on it and add the missing features.


Download
Source code


To use, launch it once to register the file association, then launch a rom file with the extension "8rom". 
New in version 0.10: Fixed save states, Hardware W+ support, on button, offscreen area emulated

2
TI-Nspire / 2048 for Nspire
« on: March 29, 2014, 12:55:02 pm »
Since no one else has, I decided to take the plunge and write a version of 2048 in Nspire lua. It still has a few bugs, but it should be playable and fun

Controls: Arrow keys or 8/6/2/4 to move tiles. Enter to reset after winning or losing, or ctrl-del to force a reset during a game. Use any letter to change to a different save slot, to allow multiple games at the same time.

New: Now has graphics based on NBonaparte's modification

3
TI-Nspire / nvid - Compressed video player for the Nspire
« on: March 11, 2014, 10:02:05 pm »
Nvid is a video player for the Nspire. It is not the first such project, but it is unique in that it uses vp8 video. This allows long videos to be stored with a relatively small file size and good quality, although it results in somewhat slow playback.

Nvid supports both the Nspire CX, in full color, and the Touchpad/Clickpad in grayscale.

One example video is included, sintel.ivf.tns. To create your own videos, drag any video onto wrapper.bat in the "converter" folder. This creates a file called output.ivf.tns that can be transferred to the calculator.

Nvid does not have a file browser, so you need a version of ndless that supports file association. Run nvid.tns once to install the file association. After that, you should be able to open an ivf file and have it play.

Download here:
https://github.com/pbfy0/nvid/releases/download/v1.1/nvid.zip
Spoiler For File format details:
The file format is 320x240 YUV420P vp8 IVF. Any file of that format should work; you don't need to use the encoder.

4
Calculator C / [Ndless] Strange crash on load
« on: March 09, 2014, 05:23:32 pm »
I'm working on a vp8-based video player for the nSpire, but i'm getting very strange errors that seem to be unrelated to the vpx library. When I include the block
Code: [Select]
if(fread(frame, 1, frame_sz, infile) != frame_sz)
            die("Frame failed to read complete frame");
, the program crashes as soon as it loads, before that line is even executed. At first, I thought the error was because of libvpx, but the version below, which has everything related to libvpx commented out, still crashes in the same way. This occurs in both the kArmTi emulator and a physical calculator. What am I doing wrong? The full source is available at https://github.com/pbfy0/nvid
Code: [Select]
/*
  Copyright (c) 2010 The WebM project authors. All Rights Reserved.


  Use of this source code is governed by a BSD-style license
  that can be found in the LICENSE file in the root of the source
  tree. An additional intellectual property rights grant can be found
  in the file PATENTS.  All contributing project authors may
  be found in the AUTHORS file in the root of the source tree.
 */
 
 
#include <os.h>
#include <libndls.h>
#include <nspireio2.h>


FILE            *infile;
nio_console csl;
#define printf(...) nio_printf(&csl, __VA_ARGS__)


//#define VPX_CODEC_DISABLE_COMPAT 1
//#include "vpx/vpx_decoder.h"
//#include "vpx/vp8dx.h"
//#define vpx_interface (vpx_codec_vp8_dx())
//#define clamp(x) (x < 0 ? 0 : (x > 255 ? 255 : x))
 
 
#define IVF_FILE_HDR_SZ  (32)
#define IVF_FRAME_HDR_SZ (12)
 
static unsigned int mem_get_le32(const unsigned char *mem) {
    return (mem[3] << 24)|(mem[2] << 16)|(mem[1] <<|(mem[0]);
}
 
static void die(char *text) {
    uart_printf(text);
    if(text[strlen(text)-1] != '\n')
        uart_printf("\n");
      fclose(infile);
    exit(EXIT_FAILURE);
}
 
/*static void die_codec(vpx_codec_ctx_t *ctx, char *s) {
    const char *detail = vpx_codec_error_detail(ctx);
    uart_printf("%s: %s\n", s, vpx_codec_error(ctx));
    if(detail)
        uart_printf("    %s\n",detail);
      fclose(infile);
    exit(EXIT_FAILURE);
}*/
 
 
int main(int argc, char **argv) {
      uart_printf("asdasdasd\n");
    //vpx_codec_ctx_t  codec;
    int              flags = 0, frame_cnt = 0;
    unsigned char    file_hdr[IVF_FILE_HDR_SZ];
    unsigned char    frame_hdr[IVF_FRAME_HDR_SZ];
    unsigned char    frame[256*1024];
    //vpx_codec_err_t  res;
     
      nio_console csl;
      clrscr();
      // 53 columns, 29 rows. 0px offset for x/y. Background color 0 (black), foreground color 15 (white)
      nio_init(&csl, 53, 29, 0, 0, 0, 15, TRUE);
      nio_fflush(&csl);
      nio_set_default(&csl);
      printf("hello world!");
 
    //(void)res;
    /* Open files */
      if(argc!=2){
         die("Wrong number of arguments.");
         return 0;
      }
      if(!(infile = fopen(argv[1], "rb"))){
         die("Could not open input file");
         return 0;
      }
      //return 0;
 
    /* Read file header */
    if(!(fread(file_hdr, 1, IVF_FILE_HDR_SZ, infile) == IVF_FILE_HDR_SZ
         && file_hdr[0]=='D' && file_hdr[1]=='K' && file_hdr[2]=='I'
         && file_hdr[3]=='F'))
        die("Not an IVF file!");
 
    //printf("Using %s\n",vpx_codec_iface_name(vpx_interface));
    /* Initialize codec */
    //if(vpx_codec_dec_init(&codec, vpx_interface, NULL, flags))
//        die_codec(&codec, "Failed to initialize decoder");
 
    /* Read each frame */
    while(fread(frame_hdr, 1, IVF_FRAME_HDR_SZ, infile) == IVF_FRAME_HDR_SZ) {
        unsigned int               frame_sz = mem_get_le32(frame_hdr);
        //vpx_codec_iter_t  iter = NULL;
        //vpx_image_t      *img;
 
 
        frame_cnt++;
            uart_printf("x%u\n", frame_sz);
        if(frame_sz > sizeof(frame))
            die("Frame data too big for example code buffer");
           
        if(fread(frame, 1, frame_sz, infile) != frame_sz)
            die("Frame failed to read complete frame");
           
            //if(vpx_codec_decode(&codec, frame, frame_sz, NULL, 0))
        //    die_codec(&codec, "Failed to decode frame");
 
       
    }
     
    printf("Processed %d frames.\n",frame_cnt);
    //if(vpx_codec_destroy(&codec))
//        die_codec(&codec, "Failed to destroy codec");
 
    fclose(infile);
    return EXIT_SUCCESS;
}

Edit: I figured out what the problem was. The nspire apparently doesn't like large initializing large arrays. When that block was omitted, the initialization of the frame variable got optimized out, so the crash didn't happen. I replaced the array initialization with malloc, and now it works.

Pages: [1]