Over the past week or two, I've been writing a tool to port games from the ti84ce to Windows/Linux. With the use of a few macros, one can compile a C/C++ program to run on the ti84ce or Windows/Linux.
PortCE simulates the lcd, keyboard, timers, along with some of the registers and library functions of the ti84ce. It is designed to minimize the amount of refactoring needed to port a ti84ce game to the PC. Most of the refactoring can be done by including PortCE.h in every file, and using find and replace to change int to ti_int.
To maintain compatibility between the ti84ce and Windows/Linux, the RAM_ADDRESS() and RAM_OFFSET() macros are used to access a specific address, such as a register.
Code:
PortCE also includes mouse and audio support, which can add extra functionality to your game.
The idea for PortCE came from one of my own ti84ce games that I ported to Windows. Using that as a starting point, and leveraging the fact that most of graphy (Column-Major graphx) is written in C, I was able to port and test a few graphx games.
Oiram is pretty nice to play with the addition of music and sound effects. Apart from a few heap-use-after-free issues, it runs pretty well.
There are a few things I need to work out still, fileioc is fairly limited currently, and some libraries aren't implemented yet. Hopefully by porting more games I can spot more bugs and implement missing features. One of the major annoyances I have encountered is how sizeof(_BitInt(24)) == 4, which means u24_array[1] is at an offset of 4 bytes instead of 3 bytes, breaking code that reads/writes packed data.
You can checkout PortCE on GitHub: https://github.com/ZERICO2005/PortCE
PortCE simulates the lcd, keyboard, timers, along with some of the registers and library functions of the ti84ce. It is designed to minimize the amount of refactoring needed to port a ti84ce game to the PC. Most of the refactoring can be done by including PortCE.h in every file, and using find and replace to change int to ti_int.
To maintain compatibility between the ti84ce and Windows/Linux, the RAM_ADDRESS() and RAM_OFFSET() macros are used to access a specific address, such as a register.
Code:
// Source (Sets pixel 0,0 of the LCD to 0xFF)
*(uint8_t*)RAM_ADDRESS(0xD40000) = 0xFF;
// Compiled for Ti84-CE
*(uint8_t*)((void*)(0xD40000)) = 0xFF;
// Compiled for Windows/Linux
*(uint8_t*)((void*)&simulated_ram[0xD40000]) = 0xFF;
PortCE also includes mouse and audio support, which can add extra functionality to your game.
The idea for PortCE came from one of my own ti84ce games that I ported to Windows. Using that as a starting point, and leveraging the fact that most of graphy (Column-Major graphx) is written in C, I was able to port and test a few graphx games.
Oiram is pretty nice to play with the addition of music and sound effects. Apart from a few heap-use-after-free issues, it runs pretty well.
There are a few things I need to work out still, fileioc is fairly limited currently, and some libraries aren't implemented yet. Hopefully by porting more games I can spot more bugs and implement missing features. One of the major annoyances I have encountered is how sizeof(_BitInt(24)) == 4, which means u24_array[1] is at an offset of 4 bytes instead of 3 bytes, breaking code that reads/writes packed data.
You can checkout PortCE on GitHub: https://github.com/ZERICO2005/PortCE