Skip to content

Commit

Permalink
V1.0 - Release at last
Browse files Browse the repository at this point in the history
Fix programs not being executed correctly if PC is an odd number, optimizations, have the font always loaded into memory
  • Loading branch information
NinjaWeedle authored Sep 29, 2022
1 parent 47a4504 commit a305932
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 41 deletions.
Binary file modified C8CPU.8xp
Binary file not shown.
15 changes: 8 additions & 7 deletions C8CPU.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ Then
End
If D=253
Stop
If D>223
ClrDraw
If D=254
Then
ClrDraw
32->L
64->W
Return
End
If D=255
Then
ClrDraw
If not(Xmin+|E2DeltaX>Xmax
Then
64->L
Expand All @@ -27,8 +27,6 @@ Then
92->W
End
End
If D=224
ClrDraw
Return
End
If C<32
Expand Down Expand Up @@ -109,6 +107,7 @@ Then
H+G->B
B>255->|LREG(16
256fPart(B/256->|LREG(1+16fPart(C/16
Return
End
If A=5
Then
Expand All @@ -124,11 +123,11 @@ Then
Then
If M
Then
int(|LREG(1+int(D/16))/2->|LREG(1+16fPart(C/16
int(.5H->|LREG(1+16fPart(C/16
Else
int(|LREG(1+16fPart(C/16))/2->|LREG(1+16fPart(C/16
int(.5G->|LREG(1+16fPart(C/16
End
2fPart(G/2->|LREG(16
2fPart(.5G->|LREG(16
Return
End
If A=7
Expand Down Expand Up @@ -279,6 +278,8 @@ If D=10
Then
0->K
Repeat Ans>71 and 1<10fPart(Ans/10
If Q
Q-1->Q
getKey
End
If Ans=72
Expand Down
Binary file modified C8SALT.8xp
Binary file not shown.
69 changes: 43 additions & 26 deletions C8SALT.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Then
End
Lbl A
ClrHome
Menu("C8SALT BY OXITI8","RESUME",1,"LOAD FROM |LROM",2,"SETTINGS",3,"CLEAR RPL FLAGS",4,"EXIT",5
Menu("C8SALT BY OXITI8","RESUME",1,"LOAD FROM |LROM",2,"SETTINGS",3,"CLEAR RPL DATA",4,"EXIT",5
Lbl 5
Stop
Lbl 4
Expand All @@ -26,13 +26,10 @@ W->B
32->L
ClrList |LREG,|LSTK,|LRAM
P->dim(|LRAM
If theta
Then
DelVar ZSetUpEditor FONT
For([recursiven],1,dim(|LFONT),2
Z+1->Z
|LFONT([recursiven])+[i]|LFONT([recursiven]+1->|LRAM(Z
End
DelVar ZSetUpEditor FONT
For([recursiven],1,dim(|LFONT),2
Z+1->Z
|LFONT([recursiven])+[i]|LFONT([recursiven]+1->|LRAM(Z
End
SetUpEditor ROM,RPL
If 2fPart(.5dim(|LROM
Expand All @@ -53,25 +50,45 @@ Text(~1,56(2-Ans),60(2-Ans),"C8SALT
Repeat getKey=22
|LRAM(1+int(P/8->A
8fPart(P/8->B
If B>3
If B=7
Then
iPart(1000fPart(10|E8imag(A->C
iPart(1000real(|LRAM(2+int(P/8->D
End
If B=6
Then
iPart(1000fPart(10|E5imag(A->C
iPart(1000fPart(10|E8imag(A->D
End
If B=5
Then
1000fPart(.001iPart(10|E5imag(A->C
iPart(1000fPart(10|E5imag(A->D
End
If B=4
Then
iPart(1000imag(A->C
1000fPart(.001iPart(10|E5imag(A->D
End
If B=1
Then
1000fPart(.001iPart(10|E5real(A->C
iPart(1000fPart(10|E5real(A->D
End
If B=2
Then
iPart(1000fPart(10|E5real(A->C
iPart(1000fPart(10|E8real(A->D
End
If B=3
Then
iPart(1000fPart(10|E8real(A->C
iPart(1000imag(A->D
End
If not(B
Then
If B=6
Then
iPart(1000fPart(10|E5imag(A->C
iPart(1000fPart(10|E8imag(A->D
Else
iPart(1000imag(A->C
1000fPart(.001iPart(10|E5imag(A->D
End
Else
If B
Then
iPart(1000fPart(10|E5real(A->C
iPart(1000fPart(10|E8real(A->D
Else
iPart(1000real(A->C
1000fPart(.001iPart(10|E5real(A->D
End
iPart(1000real(A->C
1000fPart(.001iPart(10|E5real(A->D
End
P+2->P
prgmC8CPU
Expand Down
Binary file modified FONT.8Xl
Binary file not shown.
37 changes: 29 additions & 8 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ CCC 8 8 SSS A T_T
C8SALT - A CHIP-8 emulator written in TI-BASIC for the TI-83+, TI-84+, TI-84+ C Silver Edition, and TI-84+ CE.
By Oxiti8

VERSION V0.10.1
VERSION V1.0

C8SALT is the first ever TI-BASIC CHIP-8 emulator. Play all your favorite CHIP-8 games (as well as some SCHIP games) at a blistering 0.1 FPS!
6 programs are included with C8SALT, along with a ROM converter written in Python 3 allowing you to use your own CHIP-8 games with C8SALT.
You can even import your own custom fonts! V1.0
9 programs are included with C8SALT, along with a ROM converter written in Python 3 allowing you to use your own CHIP-8 games with C8SALT.
You can even import your own custom fonts!

*TABLE OF CONTENTS*

Expand All @@ -28,12 +28,13 @@ I. INSTALLATION:
1 - RESUME: If you pressed ON to stop C8SALT mid-execution and you haven't cleared the graph screen, you can select this option to pick up where you left off.
2 - LOAD FROM LROM: Loads the rom data stored in ROM. For info on converting CHIP-8 software for use with C8SALT, see ROM CONVERSION INSTRUCTIONS.
3 - SETTINGS: From here, you can enable and disable HLE Text Rendering (0 = on, 1 = off) as well as decide the behavior of FX55/65 (0 = Do not increment I (SCHIP style), 1 = Increment I (VIP/Octo style)), and set the shift quirk for 8XY6/8XYE (0 = SCHIP style (default), 1 = VIP/Octo style).
4 - EXIT: Exits C8SALT.
4 - CLEAR RPL DATA: Selecting this option clears the RPL flags that FX75/FX85 use.
5 - EXIT: Exits C8SALT.

WARNING: IF YOU HAVE XLib OR CELTIC III INSTALLED, YOU MUST DISABLE THEM TO RUN C8SALT!
This is because C8SALT uses the Real( command as part of its memory decompression routine, a command which XLib uses for its functions.

You can find already converted ROM.8xl files to send to your calculator in the "Programs" folder, or if you want to import your own, refer to Section II.
You can find preconverted ROM.8xl files to send to your calculator in the "Programs" folder, or if you want to import your own, refer to Section II.


II. ROM CONVERSION INSTRUCTIONS:
Expand All @@ -58,13 +59,28 @@ II. ROM CONVERSION INSTRUCTIONS:

Now you can run C8SALT, and you should now be able to play your game!

(You can also create custom fonts this way by saving the hex data for them in a .ch8 file, then following the program conversion process- just rename the "ROM.8xl" to "FONT.8xl" when finished)
(You can also create custom fonts this way by saving the hex data for them in a .ch8 file, then following the program conversion process- just rename the resulting "ROM.8xl" file to "FONT.8xl" when finished)


III. CONTROLS (Note- Due to emulation speed you may need to mash the keys for them to register.):

MODE - Quit C8SALT, clean up lists used during emulation, and display debug info.

The controls for the keypad are the same as Vinegar:

Chip-8
1 2 3 C
4 5 6 D
7 8 9 E
A 0 B F

TI-83+
7 8 9 ×
4 5 6 -
1 2 3 +
0 . (-) Enter

You can also use the arrow keys in place of 2, 4, 5, and 6.


IV. TECHNICAL INFO
Expand All @@ -75,7 +91,7 @@ IV. TECHNICAL INFO
- On the limited SuperCHIP support:

You can use 00FD (EXIT), 00FE (LORES), Fx30 (BIGFONT VX), Fx75 (LD R, Vx), and Fx85 (LD Vx, R) just fine.
SuperCHIP Hires mode (00FF) can also be used, but on the monochrome calculators you're limited to a 92x62 resolution when using it rather than the full 128x64 and as such errors can and will occur.
SuperCHIP 128x64 mode (00FF) can also be used, but on the monochrome calculators you're limited to a 92x62 resolution when using it rather than the full 128x64 and as such errors can and will occur.
- On the CSE and CE though, you can use the full 128x64 resolution.

DXY0, 00Cn(SCD n), 00FB (SCR), and 00FC (SCL) are not supported.
Expand All @@ -84,6 +100,11 @@ IV. TECHNICAL INFO
- This means that one can use the "RPL flags" as a form of persistent data storage like on the HP48.
- Fx75 and Fx85 also support up to 16 entries as outlined in the XO-CHIP 1.1 spec instead of just the original 8.

Rom data is stored in a list, with 4 bytes being stored per list entry:
0.001002003004
C8SALT loads this ROM into list RAM, which itself stores 8 bytes per list entry:
.001002003004+i.005006007008


V. VARIABLE GUIDE

Expand All @@ -105,7 +126,7 @@ Q = Delay Timer
R = Return value
S = Sound timer
W = Screen width
Z = Temp in Fx55/65
Z = Temp
Theta = HLE Font Toggle
Recursive n = temp var.

Expand Down

0 comments on commit a305932

Please sign in to comment.