diff --git a/README.md b/README.md index 4379442..5e3cfe7 100644 --- a/README.md +++ b/README.md @@ -256,3 +256,20 @@ so it was easy to get something to work. Not a bad version i would say. [Download Oric version](https://github.com/gameblabla/copyright_infringement_ports/releases/tag/1.0-ORIC) + +TI-83 CE +================== +![](https://github.com/gameblabla/copyright_infringement_ports/raw/simp/img/ti83ce.jpg) + +I found one by sheer luck for really cheap (15€) instead of the usual expensive prices so thought that would be an opportunity. +The C toolchain for it is really nice and uses Clang as the new backend (previously it was using a proprietary solution but that's now largely fixed). +ZX0/ZX7 are also directly integrated so that saved me some time. +The only issue was the size for archive files was small. It's possible i believe to go beyond the 65k limit by having several ones +but i only learned of this much later... +In any case, i didn't want this game to be too big so i stuck with 64kb and instead upscaled the 160x100 frames to 320x200 in short of a nasty way. +It works fine though, since this is decently powerful. + +I implemented highscore saving (this is based upon the Oric version) but it seems not to work reliably so unsure... +It's still there in any case. + +[Download TI83CE version](https://github.com/gameblabla/copyright_infringement_ports/releases/tag/1.0-TI83CE) diff --git a/TI83CE/.gitignore b/TI83CE/.gitignore new file mode 100644 index 0000000..805b686 --- /dev/null +++ b/TI83CE/.gitignore @@ -0,0 +1,9 @@ +obj/ +bin/ +src/gfx/*.c +src/gfx/*.h +src/gfx/*.8xv +.DS_Store +convimg.out +*.8xv +*.8xp diff --git a/TI83CE/autotest.json b/TI83CE/autotest.json new file mode 100644 index 0000000..d66d1f9 --- /dev/null +++ b/TI83CE/autotest.json @@ -0,0 +1,37 @@ +{ + "transfer_files": + [ + "bin/DEMO.8xp", + "src/gfx/vargfx.8xv" + ], + "target": + { + "name": "DEMO", + "isASM": true + }, + "sequence": + [ + "action|launch", + "delay|500", + "hashWait|1", + "key|enter", + "hashWait|2" + ], + "hashes": + { + "1": + { + "description": "Test tilemap fullscreen image display", + "start": "vram_start", + "size": "vram_8_size", + "expected_CRCs": [ "94A5E1D6" ] + }, + "2": + { + "description": "Test program exit", + "start": "vram_start", + "size": "vram_16_size", + "expected_CRCs": [ "FFAF89BA", "101734A5", "9DA19F44", "A32840C8", "349F4775" ] + } + } +} diff --git a/TI83CE/icon.png b/TI83CE/icon.png new file mode 100644 index 0000000..e63fa82 Binary files /dev/null and b/TI83CE/icon.png differ diff --git a/TI83CE/makefile b/TI83CE/makefile new file mode 100644 index 0000000..8445b23 --- /dev/null +++ b/TI83CE/makefile @@ -0,0 +1,16 @@ +# ---------------------------- +# Makefile Options +# ---------------------------- + +NAME = CIRIGHT +ICON = icon.png +DESCRIPTION = "Gay game" +COMPRESSED = NO +ARCHIVED = YES + +CFLAGS = -Wall -Wextra -Oz +CXXFLAGS = -Wall -Wextra -Oz + +# ---------------------------- + +include $(shell cedev-config --makefile) diff --git a/TI83CE/readme.md b/TI83CE/readme.md new file mode 100644 index 0000000..aefedfd --- /dev/null +++ b/TI83CE/readme.md @@ -0,0 +1,16 @@ +### CopyRight Infringement Regressive Right for TI 83 CE + +This is a port of my smallish game for the TI 83CE. +It's a decent port all things considered but i didn't put too much effort into it. +Internal resolution for the frames are 160x100 which are then scaled up to 320x200, +on top of being ZX0 compressed. +Thankfully the eZ80 inside has plenty of horse power to do stuff like that. +Also other lower end Z80 machines would be too slow for ZX0 in real time whereas +this is quite capable indeed. +So much in fact that ZX1 is not even provided in the toolchain, only ZX7 and ZX0. + +# Usage + +Make sure to transfer vargci.8xv (as an archive, it should do so automatically) and CIRIGHT.8xp. +Once that's done, unarchive the game CIRIGHT.8xp either from the memory screen (2nd + Mem) +or using 2nd+Catalog and then use the UnArchiv command. diff --git a/TI83CE/src/gfx/bakura.png b/TI83CE/src/gfx/bakura.png new file mode 100644 index 0000000..593a056 Binary files /dev/null and b/TI83CE/src/gfx/bakura.png differ diff --git a/TI83CE/src/gfx/convimg.yaml b/TI83CE/src/gfx/convimg.yaml new file mode 100644 index 0000000..808b324 --- /dev/null +++ b/TI83CE/src/gfx/convimg.yaml @@ -0,0 +1,60 @@ +palettes: + - name: global_palette + fixed-entries: + - color: {index: 0, r: 0, g: 0, b: 0} + - color: {index: 1, r: 255, g: 255, b: 255} + images: automatic + +converts: + - name: yami + palette: global_palette + compress: zx0 + transparent-color-index: 0 + images: + - yami.png + - name: frame1 + palette: global_palette + compress: zx0 + transparent-color-index: 0 + images: + - frame1.png + - name: frame2 + palette: global_palette + compress: zx0 + transparent-color-index: 0 + images: + - frame2.png + - name: frame3 + palette: global_palette + compress: zx0 + transparent-color-index: 0 + images: + - frame3.png + - name: frame4 + palette: global_palette + compress: zx0 + transparent-color-index: 0 + images: + - frame4.png + - name: frame5 + palette: global_palette + compress: zx0 + transparent-color-index: 0 + images: + - frame5.png + +outputs: + - type: appvar + name: vargci + source-format: c + include-file: vargci.h + header-string: STRING + palettes: + - global_palette + converts: + - frame1 + - frame2 + - frame3 + - frame4 + - frame5 + - yami diff --git a/TI83CE/src/gfx/convimg.yaml.lst b/TI83CE/src/gfx/convimg.yaml.lst new file mode 100644 index 0000000..bf1b4de --- /dev/null +++ b/TI83CE/src/gfx/convimg.yaml.lst @@ -0,0 +1,3 @@ +vargci.h +vargci.c +vargci.8xv diff --git a/TI83CE/src/gfx/frame1.png.zip b/TI83CE/src/gfx/frame1.png.zip new file mode 100644 index 0000000..3464507 Binary files /dev/null and b/TI83CE/src/gfx/frame1.png.zip differ diff --git a/TI83CE/src/gfx/title.png b/TI83CE/src/gfx/title.png new file mode 100644 index 0000000..2750e07 Binary files /dev/null and b/TI83CE/src/gfx/title.png differ diff --git a/TI83CE/src/gfx/yami.png b/TI83CE/src/gfx/yami.png new file mode 100644 index 0000000..eb980fb Binary files /dev/null and b/TI83CE/src/gfx/yami.png differ diff --git a/TI83CE/src/main.c b/TI83CE/src/main.c new file mode 100644 index 0000000..672d5f5 --- /dev/null +++ b/TI83CE/src/main.c @@ -0,0 +1,378 @@ +#include +#include +#include +#include +#include +#include +#include + +#define ARCHIVE_APP 1 + +/* Include the converted graphics appvar file */ +#include "gfx/vargci.h" + +unsigned char k, game_mode, text_progress; +unsigned char FRAME_CURRENT; + +void switch_gamemode(unsigned char mode) ; + +#define KEEPITUP_GAME_STATUS 0 +#define STOP_GAME_STATUS 1 +#define FUCK_GAME_STATUS 2 +#define END_GAME_STATUS 3 + +const unsigned char status_level1[] = +{ + FUCK_GAME_STATUS, KEEPITUP_GAME_STATUS, + STOP_GAME_STATUS, FUCK_GAME_STATUS, KEEPITUP_GAME_STATUS, + STOP_GAME_STATUS, FUCK_GAME_STATUS, KEEPITUP_GAME_STATUS, + STOP_GAME_STATUS, FUCK_GAME_STATUS, + END_GAME_STATUS, END_GAME_STATUS +}; + +unsigned char status; +unsigned char i, c; +unsigned char delay; +unsigned long time_game; + +const char ingame_quote[5][12] = +{ + "KEEP IT UP!", + "STOP ", + "FUCK HIM ! ", + "FINISH ! ", +}; + +/* This is done to save further space as game_mode 3, 0 , 1 all shared the same code */ +const unsigned char jump[5] = +{ 3, 0xFF, 0, 0xFF, 1 }; + +static char bcd[4]; +static char hibcd[4]; + +#define add_score(add) \ + bcd[2] += add; \ + if (bcd[2] > 57) { \ + bcd[1]+= 1; \ + bcd[2] = 48; } \ + if (bcd[1] > 57) { \ + bcd[0]+= 1; \ + bcd[1] = 48; } \ + +#define decrease_score(dec) \ + bcd[2] -= dec; \ + if (bcd[2] < 48) \ + { \ + bcd[1]-= 1; \ + bcd[2] = 57; \ + } \ + if (bcd[1] < 48) \ + { \ + bcd[0]-= 1; \ + bcd[1] = 57; \ + } \ + + +kb_key_t key; +uint8_t prevkey; +gfx_sprite_t *mainimage; +uint8_t filesave; + +#ifndef ARCHIVE_APP +const unsigned char* frame_anim[] = +{ + frame1_compressed, frame2_compressed, frame3_compressed, frame4_compressed, frame5_compressed +}; +#endif + +int main() +{ + os_ClrHome(); + #ifdef ARCHIVE_APP + if (vargci_init() == 0) + { + os_PutStrFull( "Missing vargci file"); + os_PutStrFull( "This game needs it to run"); + while (!os_GetCSC()); + return 1; + } + #endif + gfx_Begin(); + gfx_SetDrawBuffer(); + gfx_SetPalette(global_palette, sizeof_global_palette, 0); + + gfx_SetTextScale(1, 1); + gfx_SetTextBGColor(0); + gfx_SetTextFGColor(1); + + mainimage = gfx_MallocSprite(160, 100); + + hibcd[0] = 48; + hibcd[1] = 48; + hibcd[2] = 48; + + filesave = ti_Open("VarCIH", "rb"); + if (filesave != 0) + { + ti_Read(hibcd, sizeof(hibcd), 1, filesave); + ti_Close(filesave); + } + hibcd[3] = '\0'; + + switch_gamemode(0); + + while (kb_Data[6] != kb_Clear) + { + kb_Scan(); + key = kb_Data[1]; + + switch(game_mode) + { + case 0: + delay++; + if (kb_AnyKey() && delay > 60) + { + switch_gamemode(jump[game_mode]); + } + + gfx_ZeroScreen(); + + gfx_PrintStringXY("COPYRIGHT INFRINGEMENT", 8 * 8, 100); + gfx_PrintStringXY("BY GAMEBLABLA", 12 * 8, 120); + + gfx_PrintStringXY("HISCORE", 0, 200-8-8); + gfx_PrintStringXY(hibcd, 0, 200-8); + + gfx_PrintStringXY("PRESS KEY TO START", 10 * 8, 180); + + gfx_BlitBuffer(); + break; + case 1: + time_game+=1; + + if (FRAME_CURRENT > 0 && status_level1[status] != END_GAME_STATUS) + { + if (status_level1[status] == STOP_GAME_STATUS) + { + if (!(bcd[2] == 48 && bcd[0] == 48 && bcd[1] == 48)) + { + decrease_score(1); + } + } + else + { + add_score(1); + } + + delay++; + + if (delay > 0) + { + FRAME_CURRENT++; + if (FRAME_CURRENT > 4) FRAME_CURRENT = 0; + + #ifdef ARCHIVE_APP + zx0_Decompress(mainimage, vargci_appvar[1+FRAME_CURRENT]); + #else + zx0_Decompress(mainimage, frame_anim[FRAME_CURRENT]); + #endif + delay = 0; + } + time_game+= 2; + } + + if (FRAME_CURRENT == 0) + { + if (kb_AnyKey()) + { + FRAME_CURRENT = 1; + } + } + + + if (time_game > 128) + { + if (status_level1[status] == END_GAME_STATUS) + { + switch_gamemode(2); + } + else + { + time_game = 0; + status++; + } + } + + + gfx_ZeroScreen(); + gfx_ScaledSprite_NoClip(mainimage, 0, 0, 2, 2); + gfx_PrintStringXY("SCORE", 0, 200); + gfx_PrintStringXY(bcd, 0, 208); + gfx_PrintStringXY(ingame_quote[status_level1[status]], 160, 200); + + gfx_BlitBuffer(); + break; + case 3: + delay++; + if (kb_AnyKey() && delay > 10) + { + text_progress++; + delay = 0; + + if (text_progress > 4) + { + switch_gamemode(4); + } + } + + gfx_ZeroScreen(); + gfx_ScaledSprite_NoClip(mainimage, 0, 0, 2, 2); + gfx_Rectangle_NoClip(0, 180, 320, 64); + switch(text_progress) + { + case 0: + gfx_PrintStringXY("Oh my, what do we have here?", 0, 200); + gfx_PrintStringXY("You look so innocent", 0, 208); + break; + case 1: + gfx_PrintStringXY("You're going to be the perfect victim", 0, 200); + gfx_PrintStringXY("for my games!", 0, 208); + break; + case 2: + gfx_PrintStringXY("I'm Rikuto, i offer you the chance to", 0, 200); + gfx_PrintStringXY("prove your worth in a trial", 0, 208); + break; + case 3: + gfx_PrintStringXY("Don't be scared, it'll be fun!", 0, 200); + break; + case 4: + gfx_PrintStringXY("Your challenge will be this: you'll be", 0, 200); + gfx_PrintStringXY("on the other end and punish them", 0, 208); + break; + } + + gfx_BlitBuffer(); + break; + // Results + case 2: + delay++; + if (kb_AnyKey() && delay > 60) + { + switch_gamemode(jump[game_mode]); + } + + gfx_ZeroScreen(); + + gfx_ScaledSprite_NoClip(mainimage, 0, 0, 2, 2); + + gfx_PrintStringXY("Your SCORE was ", 0, 0); + gfx_PrintStringXY(bcd, 104, 0); + + if (bcd[0] < 48+1) + { + gfx_PrintStringXY("Guess you'll stay there for a while...", 0, 200); + gfx_PrintStringXY("Hahaha !", 0, 208); + } + else if (bcd[0] < 48+2) + { + gfx_PrintStringXY("Not bad but you can do better!", 0, 200); + gfx_PrintStringXY("Otherwise you can't leave this place!", 0, 208); + } + else + { + gfx_PrintStringXY("Congrats! I'll leave you alone.", 0, 200); + gfx_PrintStringXY("This won't be the last of me!", 0, 208); + } + + gfx_BlitBuffer(); + break; + // Instructions + case 4: + delay++; + if (kb_AnyKey() && delay > 10) + { + switch_gamemode(jump[game_mode]); + } + + gfx_ZeroScreen(); + + gfx_PrintStringXY("Your goal is to FUCK Zhongli!", 16, 16); + gfx_PrintStringXY("Follow the instructions to get points", 16, 32); + gfx_PrintStringXY("Penetrate him by pressing a key", 16, 48); + gfx_PrintStringXY("then pull out by releasing it.", 16, 64); + gfx_PrintStringXY("Good luck !", 16, 128); + + gfx_BlitBuffer(); + break; + } + + prevkey = key; + } + + free(mainimage); + + gfx_End(); + return 0; +} + +void switch_gamemode(unsigned char mode) +{ + game_mode = mode; + text_progress = 0; + status = 0; + time_game = 0; + i = 0; + delay = 0; + FRAME_CURRENT = 0; + + gfx_ZeroScreen(); + + switch(mode) + { + case 0: + + + break; + case 1: + bcd[0] = 48; + bcd[1] = 48; + bcd[2] = 48; + bcd[3] = '\0'; + #ifdef ARCHIVE_APP + zx0_Decompress(mainimage, vargci_appvar[1+FRAME_CURRENT]); + #else + zx0_Decompress(mainimage, frame_anim[FRAME_CURRENT]); + #endif + break; + case 2: + zx0_Decompress(mainimage, yami_compressed); + if (bcd[0] > hibcd[0]) + { + if (bcd[1] > hibcd[1]) + { + if (bcd[2] > hibcd[2]) + { + hibcd[0] = bcd[0]; + hibcd[1] = bcd[1]; + hibcd[2] = bcd[2]; + filesave = ti_Open("VarCIH", "wb"); + if (filesave != 0) + { + ti_Write(hibcd, sizeof(hibcd), 1, filesave); + ti_Close(filesave); + } + } + } + } + break; + case 3: + zx0_Decompress(mainimage, yami_compressed); + break; + case 4: + + + break; + } + +} + diff --git a/img/ti83ce.jpg b/img/ti83ce.jpg new file mode 100644 index 0000000..a1ec548 Binary files /dev/null and b/img/ti83ce.jpg differ