**************************************** * SNG v0.72 * * (Shell avec Niveaux de Gris) * * Shell with Grayscale * * * * by Marc Plouhinec * * on 02/14/2003 m/d/y * * URL: http://thebestof.vze.com * * Email: mailto://m_plouhinec@yahoo.fr * * * **************************************** translated by pacHa CAUTION: the part "Vars list" doesn't work in this version. TABLE OF CONTENTS: I Introduction II Using SNG III How to program for SNG IV How to use the grayscale V How to use the sound VI How to use the interrupts VII Hexadecimal editor VIII Debugger IX How to program on your TI-82 (compressed language) X How to program in assembly on your TI-82 XI Features coming soon I Introduction: --------------- SNG has all of ACE's functions and new ones for grayscale and sound. Note that programs compiled for ACE aren't supported. SNG programs will all be available on my website (if you want to program for this shell, send me your program by e-mail). II Using SNG: ------------- Load SNG like a BASIC program, you see a menu. In the section "Programs list", choose your program and then hit [ENTER]. To quit a menu, hit [MODE]. III How to program for SNG: --------------------------- The file "help to compile for SNG.bat" is here to help you. Right click on it and select 'Edit' and replace 'test' by the name of your program. Don't forget to put a line #include "sngbeta.inc" at the start of your program. IV How to use the grayscale: ---------------------------- To create grayscales, the images are stored in two backgrounds (the 0 for light gray and the 1 for dark gray). If you want to create a white colour, keep the two backgrounds empty. If you want to create a light gray colour, fill only background 0.(same change to the next line) If you want to create a dark gray colour, fill only the background 1. If you want to create a black colour, fill both background 1 and 2. To activate the grayscale, put a line 'CALL GRAYSCALE_ON'. To stop the grayscale, put a line 'CALL GRAYSCALE_OFF'. See test.asm and test2.asm for better explanation. V How to use th sound: ---------------------- First you must own earphones connected to a small jack(2.5mm stereo) linked with the calculator's link port. In the program, you must type something like: LD HL,700 ;HL=ton LD DE,100 ;DE=time CALL BEEP See "son.asm" for better explanation. VI How to use the interrupts: ----------------------------- The interrupts are like multitasks, one or more routines are executed while the program is running. See how to use them: LD DE,name_of_the_routine_to_be_executed_as_an_interrupt CALL NEW_INTERRUPT main_loop: (...) JP NZ,main_loop LD A,0 ;A=# of the interrupt CALL STOP_INTERRUPT RET name_of_the_routine_to_be_executed_as_an_interrupt: (...) RET See "interrupt.asm" for better explanation. VII Hexadecimal editor: ----------------------- The editor isn't included in the program SNG for people who don't want it : it saves 1172 bytes. This program has 3 modes of display : -The first one is accessible by hitting the key [Y=], it's the default mode. (Go to adress $2AC0, here are chains of characters of TI OS). The controls: -[(up)], [(down)], [(right)], [(left)] = moves the cursor -[/] = - $1000 -[*] = + $1000 -[-] = - $100 -[+] = + $100 -# and letters (A-F) = modifies an hexadecimal number -The second one is the image mode, it's accessible by hiting the key [WINDOW]. (Go to the program SNG and you'll find the title screen of the shell) Controls: -[(up)], [(down)], [(right)], [(left)] = moves -The third one is the sprite mode, it's accessible by hitting the key [ZOOM]. (Go to address from $590D where are stored the characters) Controls: -[(up)], [(down)], [(right)], [(left)] = moves Important: Between addresses $4000 and $7FFF, it's the ROM page 1. VIII Debugger: -------------- The debuger can disassemble and modifiy a program (Be careful: this program doesn't know if something is code or data). The debugger isn't included in the backup for people who don't need it : they cansave 11777 bytes. Controls: -[(up)], [(down)] = moves the cursor -[/] = - $1000 -[*] = + $1000 -[-] = - $100 -[+] = + $100 -[ENTER] = modifies an instruction How to modify an instruction ? You have to select the instruction you want to modify, hit [ENTER], select the size of the instruction and then select it in the list. IX How to program on your TI-82 (compressed language): ------------------------------------------------------ First, print the files 'Tasm80.tab' and 'sngbeta.inc'. On your calc, create a BASIC program, edit it and type "SNG" followed by the name of the program that will appear in the shell list. Add some characters, it will be useful when you will replace them by code. Run SNG. Go to the vars list and then select your program. Go with the hexadecimal at the address of the file in the VAT. Replace the '05' by '06' and modify the name of the program if you want. Then, go to the address of the file in the RAM. You can modify the name of the program shown in the shell list. Put a '00' after the name of the prog. Now, you replace the characters you have put by code. If you find it too hard, look at the following example : A program 'TEST' is created, is edited and 'SNG' followed by the name of the program (TEST 1) and some characters is put. You will see something like : ---------------- |PROGRAM:TEST1 | |:SNGTEST 1AAAAA| |AAAAAAAAAAAAAAAA| |AAAAAAAAAAAAAAAA| | | | | | | | | ---------------- Run SNG. Look at the vars list for program TEST1. You see : ----------- NAME TEST1 TYPE PROG SIZE: 58 ADDRESS: -VAT: FD91 -RAM: FD58 ----------- Using the hexadecimal heditor go to the address in the VAT (FD91) and replace the '05' by a '06'. You see some lines above the name of the program written backwards (1TSET) and rename the file (1tseT). Go to the address of the file (FD58), two bytes after you see "SNGTEST))1AAA...", put '00' at the end of the name and you see "SNGTEST))1 AAA...", then rename the file (Be careful you have to replace the ")" by a space " " code $20) and you see "SNGTest 1 AAA". Look at this example : -------------------------------------------------------- | ASSEMBLY | COMPRESSED LANGUAGE | -------------------------------------------------------- |CALL CLEARLCD |CD CD 39 | |LD HL,0 |21 00 00 | |LD (CURSOR_POS),HL |22 0C 80 | |LD HL,chain |21 1B A6 | |CALL D_ZT_STR |CD 2D 3A | |CALL PAUSE |CD 56 8D | |RET |C9 | |chain .DB "Hello !",0 |48 65 6C 6C 6F 20 21 00 | -------------------------------------------------------- So you type: cd cd 39 21 00 00 22 0c 80 21 1b a6 cd 2d 3a cd 56 8d c9 48 65 6c 6c 6f 20 21 00 You've got an assembly program ! X How to program in assembly on your TI-82: ---------------------------------------------- First, print 'sngbeta.inc'. On you calc, create a BASIC program, edit it and type 'SNG' followed by the name of the prog and some characters. Run SNG. Go to the Vars list and select your program. Go to the address in the VAT with the hexadecimal editor. Replace he '05' by a '06' and modify the name of the program if you want. Go to the address of the file in the RAM. You can modify the name of the program (in the shell list). Put a '00' at the end of the name of the program. Remember the address of the start of the code (just after the '00' of the end of the program name). Run the debugger and start programming at the address you've remembered. If it's too much complicated, look at the example in the section above. Instead of typing the code in the hexadecimal heditor, type it in the debugger. XI Features coming soon: ------------------------ -Optimise the code -Implement the unimplemented functions -Fix the bug when exiting -Improve the grayscale Send me your questions and suggestions! Please report all the translation errors to pacHa : pacHa-@wanadoo.fr