From c127c5eb813a9c727aa538360bae05cb254f31e0 Mon Sep 17 00:00:00 2001 From: Stephen Toth Date: Sat, 7 Jul 2018 10:08:04 -0400 Subject: [PATCH] V0.1.0 added so many new things making a release new commands new interface! --- .gitignore | 1 + CONTRIBUTING.md | 53 +++++++ FSHa.asm | 31 ++-- README.md | 39 +++++ bin/FSHa.8xp | Bin 2943 -> 5708 bytes build | 2 +- includes/Byte.asm | 31 ---- includes/Command.asm | 37 ++--- includes/FshCmd.asm | 114 --------------- includes/FshCommands/CLS.asm | 13 +- includes/FshCommands/COPY.asm | 41 +++--- includes/FshCommands/EXIT.asm | 3 +- includes/FshCommands/FshCommand.asm | 63 ++++++++ includes/FshCommands/FshCommands.inc | 4 + includes/FshCommands/HELP.asm | 64 +++++++++ includes/FshCommands/INFO.asm | 42 ++++++ includes/FshCommands/MAN.asm | 62 ++++++++ includes/FshCommands/MOVE.asm | 39 +++-- includes/FshCommands/SET.asm | 57 ++++---- includes/FshCommands/SLEEP.asm | 3 +- includes/FshCommands/VAR.asm | 41 ++++++ includes/FshCommands/VARS.asm | 10 +- includes/Math.asm | 107 -------------- includes/Text.inc | 13 ++ includes/define.inc | 26 ---- includes/lib/fsh/Command.asm | 24 ++++ includes/lib/fsh/Draw.asm | 30 ++++ includes/{ => lib/fsh}/Err.asm | 56 ++++++-- includes/{ => lib/fsh}/FshVar.asm | 42 +++--- includes/lib/fsh/Parse.asm | 187 ++++++++++++++++++++++++ includes/lib/fsh/Print.asm | 44 ++++++ includes/lib/fsh/fsh.inc | 6 + includes/lib/std/Array.asm | 19 +++ includes/lib/std/Byte.asm | 31 ++++ includes/{ => lib/std}/Char.asm | 20 +-- includes/{ => lib/std}/Cursor.asm | 1 - includes/lib/std/Draw.asm | 125 ++++++++++++++++ includes/{ => lib/std}/Input.asm | 146 +++++++++++++------ includes/lib/std/Math.asm | 109 ++++++++++++++ includes/lib/std/Mem.asm | 16 +++ includes/{ => lib/std}/Print.asm | 0 includes/{ => lib/std}/String.asm | 208 ++++++++++++--------------- includes/{ => lib/std}/Word.asm | 10 +- includes/lib/std/std.inc | 12 ++ includes/macros/command.asm | 21 +++ includes/macros/draw.asm | 33 +++++ includes/macros/macros.inc | 4 + includes/macros/misc.asm | 9 ++ includes/macros/pixel.asm | 10 ++ includes/man-db.asm | 52 +++++++ includes/static/define.inc | 28 ++++ includes/{ => static}/ti84pce.inc | 2 +- includes/tables/CSC.asm | 10 +- screenshots/help.png | Bin 0 -> 3526 bytes screenshots/man_set.png | Bin 0 -> 2615 bytes screenshots/motd.png | Bin 0 -> 2604 bytes screenshots/vars.png | Bin 0 -> 1754 bytes 57 files changed, 1540 insertions(+), 611 deletions(-) create mode 100644 .gitignore create mode 100644 CONTRIBUTING.md create mode 100644 README.md delete mode 100644 includes/Byte.asm delete mode 100644 includes/FshCmd.asm create mode 100644 includes/FshCommands/FshCommand.asm create mode 100644 includes/FshCommands/HELP.asm create mode 100644 includes/FshCommands/INFO.asm create mode 100644 includes/FshCommands/MAN.asm create mode 100644 includes/FshCommands/VAR.asm delete mode 100644 includes/Math.asm create mode 100644 includes/Text.inc delete mode 100644 includes/define.inc create mode 100644 includes/lib/fsh/Command.asm create mode 100644 includes/lib/fsh/Draw.asm rename includes/{ => lib/fsh}/Err.asm (58%) rename includes/{ => lib/fsh}/FshVar.asm (78%) create mode 100644 includes/lib/fsh/Parse.asm create mode 100644 includes/lib/fsh/Print.asm create mode 100644 includes/lib/fsh/fsh.inc create mode 100644 includes/lib/std/Array.asm create mode 100644 includes/lib/std/Byte.asm rename includes/{ => lib/std}/Char.asm (62%) rename includes/{ => lib/std}/Cursor.asm (95%) create mode 100644 includes/lib/std/Draw.asm rename includes/{ => lib/std}/Input.asm (72%) create mode 100644 includes/lib/std/Math.asm create mode 100644 includes/lib/std/Mem.asm rename includes/{ => lib/std}/Print.asm (100%) rename includes/{ => lib/std}/String.asm (54%) rename includes/{ => lib/std}/Word.asm (57%) create mode 100644 includes/lib/std/std.inc create mode 100644 includes/macros/command.asm create mode 100644 includes/macros/draw.asm create mode 100644 includes/macros/macros.inc create mode 100644 includes/macros/misc.asm create mode 100644 includes/macros/pixel.asm create mode 100644 includes/man-db.asm create mode 100644 includes/static/define.inc rename includes/{ => static}/ti84pce.inc (99%) create mode 100644 screenshots/help.png create mode 100644 screenshots/man_set.png create mode 100644 screenshots/motd.png create mode 100644 screenshots/vars.png diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1377554 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.swp diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..decca2a --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,53 @@ +# Contributing +Before you fork and change anything, please read this file! + +## Conventions +This project *may* contain some conventions not found in other simalar projects. The main code styles and locations of use are listed below. + +### Universal +* Indents +Indents are inportant to keep code readable. The superior indent character is space, so. You should indent when: + * Pushing to stack (unindent when poping) + * ex instruction (only when the ex is temporary and reversed) + * Loops +* Routines + * Routines should have the following header: + ```asm + ;;name + ;;Discription + ;;Inputs: + ;; HL: purpose + ;;Outputs: + ;; HL: ... + ``` + * Inputs/Outputs only if needed. + * Labels + * Name of routine must be lowercase + * Name of routine must have prefix of file name + * If there are lables in a routine: + * label must be name of routine + Suffix (capitalized): + `fileroutineSuffix` + * Keep to `jr` in routines (unless impossible) + * All routines MUST ret at the end (no jp) + * Routines MUST preserve all registers (except outputs) + * A routine's instructions should be lowercase + +### FSHa.asm +* All instructions/registers/directives are UPPERCASE (strings are fine) +* High level view + * Only ld, calls, jmps (no routines/macros) +* Keep it readable + +### Command Files +* Name of file is UPPERCASE +* Inctructions are lowercase +* The layout of the file must be as follows: + ```asm + cmd: .db "", 0 + cmdo: .db $ + cmdu: .db "", 0 + cmdf: + + jp Fin + ``` +* Registers CAN be destroyed during execution of command's code diff --git a/FSHa.asm b/FSHa.asm index de19a71..fcbc9dc 100644 --- a/FSHa.asm +++ b/FSHa.asm @@ -1,5 +1,6 @@ -#include "includes/ti84pce.inc" -#include "includes/define.inc" +#include "includes/static/ti84pce.inc" +#include "includes/static/define.inc" +#include "includes/macros/macros.inc" .assume ADL=1 .org userMem-2 @@ -12,9 +13,14 @@ Setup: CALL _homeup CALL _ClrLCDFull + CALL drawstatusbar + CALL fshvarreset + CALL printmotd + Input: + ;; TODO: Update status bar sometimes LD A, $00 CALL commandfill @@ -25,6 +31,9 @@ Input: LD DE, FshCmdInptSize CALL inputstr + LD HL, FshCmd + CALL fshparsecommand + CALL _NewLine Decode: @@ -45,28 +54,24 @@ Err: Cleanup: SET graphdraw,(IY+graphflags) CALL _ClrLCDFull + CALL _ClrTxtShdw + CALL _homeup + call _DrawStatusBar Exit: RES donePrgm,(iy+doneFlags) RET -PS1: .DB "FSH> ",0 +#include "includes/Text.inc" FshFlags: .DB %00000000 ; 0: Debug Flag ; 1: Error Flag ; 2: Program Flag -#include "includes/Math.asm" -#include "includes/Byte.asm" -#include "includes/Char.asm" -#include "includes/Cursor.asm" -#include "includes/Print.asm" +#include "includes/lib/std/std.inc" +#include "includes/lib/fsh/fsh.inc" +#include "includes/man-db.asm" #include "includes/Command.asm" -#include "includes/Err.asm" -#include "includes/String.asm" -#include "includes/FshVar.asm" - -#include "includes/Input.asm" .end diff --git a/README.md b/README.md new file mode 100644 index 0000000..e0dc041 --- /dev/null +++ b/README.md @@ -0,0 +1,39 @@ +# Fsh SHell +Fsh SHell is a compact command-line interface for TI-84 Plus CE calculators. + +## Installing +* Windows + 1. Download and install a linking program. is ti's prepritory software. + 2. Plug in calculator and launch ti connect ce + 3. Drag and drop `bin\FSHa.8xp` to calculator + 4. Done! +* Linux + 1. Install TiLP + 2. Plug in Calculator and launch TiLP + 3. Send over `bin/FSHa.8xp` + +## Running +For most people all that is required is to press 2nd+0 and select the Asm( option. Then, press Prgm and select FSHA. you should now have the following: `Asm(PrgmFSHA` Press Enter + +For TIOS 5.3+ + Press Prgm and select FSHA. you should now have the following: `PrgmFSHA` Press Enter + +## Building From Source +* Linux + 1. Clone, make, and install spasm-ng + 2. Run the `build` script + ``` + ./build + ``` + +## Contributing +Please see `CONTRIBUTING.md` + +## Bug Reports +If you find an Issue or Bug, please let me know by making an Issue on Gitlab: +Please include: +1. What went wrong. +2. What you were doing when the issue occurred. +3. Possible cause/fixes? (optional) + +Thank you! diff --git a/bin/FSHa.8xp b/bin/FSHa.8xp index 6557199a1bde0e36affd15fcc408d66cf84017b2..ad25169130d5c213f19c7546512ed7e3119116fa 100644 GIT binary patch literal 5708 zcmbtYeNbH06~DWDEitCNU znz1uZ|7b_sQOD{e?Tj-85+EeBkdQd8xYh+93MzW3N& z0^>N{nca83?!D*!-nr+Ty<4_4*OlE_yCrWGskJ*q{xQ)ddaORt#vk?b-gc|kNpAdP z=iE$;Iq9`c2dY%1F^A-Q{)BYEWR%J{~9zO`~x)y8}peQCTJ&Q zWd88_(8&DW%#iY^9T+(jY&em1{e?g%80G+!NR(Jo_pi^oPC+uO%x*J<6#?YU4;M^k zPp(~8v?`E!MVWt)My>>BxAJp=z^ohyDdD`4H>ey6E0MfTnTC{Lr#b7JfE?O%-{C_C zVzJ#1wfyMd{#dO1!FwC;sofXjA82m)Va?uH?Ea?uy6URJty}Im5{o@@XX#x9frn$; zN_Lc4o_K0kQStVjxAPU1PsY-OJ?7gs$FvWaF$&D^iDsIHJ($0niJSXdFJ0d)hZgyQ zzGU90^RJ{$m-1jZSn^WZwDe|%5$JHlYxbyHDo})Hj6`~_mqz6E0MZBRBeL{jAH{tt z!lwqN(&UCcz=AG2`zE%oRGY9O@!#Qv}njLbIAJ{<8&C;MnX z&X%0Ll%J!kyDsooLdv`Ymn8SYnxSjT;QogBp}`j#PCdW>Ci&kCcT2__e7ZS1_geSJ zZv7RESW-c<0B@pu#F94pt~qz10$%VM(j6refzxyinJJEzm!+6uP-`{>*4eKZ=gj9s5hdr2D2 zFm{?#fo!q#DFQ6jeRrpvdrA?0MW(y2nmXn2*U!){z!4smyfmC)RM5d4vdR>uCFsF- z@SDS+Mc-jE4*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B+x(T?4uZp$WjBR?G z(cHEMqb7Q0m@BmnTadicytgw65^OVLeVf^~hqYk6!N6Lr$*`S=d!^XU!X3Xdwz-UV zYBdR)eH2+lq|l@r75GaNvFXh1mKF+TBE))aQ#DGdH}7Ysexp}M_7y}1MRpt_<9{Ig zc51c%Ko+63X7ckTfmm6mL%EeER&TLlcp+?Uv9N3#q7~1x^q3+Z+?7(CZEDkOtI!i{8}IZqnP#7RUyO8>@+B_u^KwfyL^IhN=SeC#~*fGUliv zWLMc~ng55{VSaOx;Km=IUXSjM(CVZ7KAwgb+(dalzJ35w(>+9VPzk%FdR5?LOc?l3 zz-Wb{Gd(x8##$_9OX)^4t~9r{>e~#ZNY4Bn6P+l6we2>n-Hq3o+uIBfm9DB$;y9CUL@v{aL#%6lYsMpLdI_YlX;#hQ$0X>qD*THeDV z$IW7G5up|27KpLDHQm@t)L{%pEjq@EosgxIb~F-|~aAni9o3ufS8O4`(=! ", 0 fshcmdCOPYf: fshcmdCOPYfArg0: - ld hl, FshCmdArg0 - ld de, 0 - ld e, (hl) - inc hl - ld d, (hl) - ex de, hl - ld de, 0 - call cpHLDE + ld hl, FshCmdArgFlags + bit 1, (hl) jr nz, fshcmdCOPYfArg1 + bit 0, (hl) + jr z, fshcmdCOPYfArg0Get + ld hl, ErrUsageo + call ErrSet + call ErrCatch fshcmdCOPYfArg0Get: ld hl, fshcmdCOPYfDSource call printprompt @@ -23,25 +23,24 @@ fshcmdCOPYfArg0Get: ld (hl), a call _NewLine fshcmdCOPYfArg1: - ld hl, FshCmdArg1 - ld de, 0 - ld e, (hl) - inc hl - ld d, (hl) - ex de, hl - ld de, 0 - call cpHLDE + ld hl, FshCmdArgFlags + bit 3, (hl) jr nz, fshcmdCOPYfExe + bit 2, (hl) + jr z, fshcmdCOPYfArg1Get + ld hl, ErrUsageo + call ErrSet + call ErrCatch fshcmdCOPYfArg1Get: - ld hl, fshcmdCOPYfDDestination + ld hl, fshcmdCOPYfDSource call printprompt ld hl, fshcmdCOPYfInputBuffer ld de, 3 call inputnumstr call strtob - ex de, hl ld hl, FshCmdArg1 ld (hl), a + call _NewLine fshcmdCOPYfExe: ld hl, FshCmdArg0 ld de, 0 @@ -53,8 +52,8 @@ fshcmdCOPYfExe: ld e, (hl) pop hl call fshvarcpy - call _NewLine - jp ErrCatch + call ErrCatch + jp Fin fshcmdCOPYfInputBuffer: .db $00, $00, $00, $00 fshcmdCOPYfDSource: .db "Source= ", 0 diff --git a/includes/FshCommands/EXIT.asm b/includes/FshCommands/EXIT.asm index 9818e7c..6df801c 100644 --- a/includes/FshCommands/EXIT.asm +++ b/includes/FshCommands/EXIT.asm @@ -1,4 +1,5 @@ fshcmdEXIT: .db "EXIT", 0 fshcmdEXITo: .db $FF -fshcmdEXITu: .db "Exits Fsh", 0 +fshcmdEXITm: .db "Exits Fsh", 0 +fshcmdEXITu: .db "EXIT", 0 fshcmdEXITf: JP Cleanup diff --git a/includes/FshCommands/FshCommand.asm b/includes/FshCommands/FshCommand.asm new file mode 100644 index 0000000..a86d7f1 --- /dev/null +++ b/includes/FshCommands/FshCommand.asm @@ -0,0 +1,63 @@ +fshcmddecode: + decodecmdopt(fshcmdEXIT, fshcmdEXITo) + decodecmdopt(fshcmdSET, fshcmdSETo) + decodecmdopt(fshcmdCOPY, fshcmdCOPYo) + decodecmdopt(fshcmdMOVE, fshcmdMOVEo) + decodecmdopt(fshcmdCLS, fshcmdCLSo) + decodecmdopt(fshcmdVAR, fshcmdVARo) + decodecmdopt(fshcmdVARS, fshcmdVARSo) + decodecmdopt(fshcmdSLEEP, fshcmdSLEEPo) + decodecmdopt(fshcmdINFO, fshcmdINFOo) + decodecmdopt(fshcmdHELP, fshcmdHELPo) + decodecmdopt(fshcmdMAN, fshcmdMANo) + ret + +fshcmdroute: + pop bc ;pop the ret loc from stack into bc + routeoptjp(fshcmdEXITo, fshcmdEXITf) + routeoptjp(fshcmdSETo, fshcmdSETf) + routeoptjp(fshcmdCOPYo, fshcmdCOPYf) + routeoptjp(fshcmdMOVEo, fshcmdMOVEf) + routeoptjp(fshcmdCLSo, fshcmdCLSf) + routeoptjp(fshcmdVARo, fshcmdVARf) + routeoptjp(fshcmdVARSo, fshcmdVARSf) + routeoptjp(fshcmdSLEEPo, fshcmdSLEEPf) + routeoptjp(fshcmdINFOo, fshcmdINFOf) + routeoptjp(fshcmdHELPo, fshcmdHELPf) + routeoptjp(fshcmdMANo, fshcmdMANf) + push bc ;put ret location back on stack + ret + +fshcmdmanroute: + pop bc + routestrjp(fshcmdEXIT, fshCmdEXITm) + routestrjp(fshcmdSET, fshCmdSETm) + routestrjp(fshcmdCOPY, fshCmdCOPYm) + routestrjp(fshcmdMOVE, fshCmdMOVEm) + routestrjp(fshcmdCLS, fshCmdCLSm) + routestrjp(fshcmdVAR, fshCmdVARm) + routestrjp(fshcmdVARS, fshCmdVARSm) + routestrjp(fshcmdSLEEP, fshCmdSLEEPm) + routestrjp(fshcmdINFO, fshCmdINFOm) + routestrjp(fshcmdHELP, fshCmdHELPm) + routestrjp(fshcmdMAN, fshCmdMANm) + push bc + ret + +fshcmdmanrouteu: + pop bc + routeustrjp(fshcmdEXIT, fshCmdEXITu) + routeustrjp(fshcmdSET, fshCmdSETu) + routeustrjp(fshcmdCOPY, fshCmdCOPYu) + routeustrjp(fshcmdMOVE, fshCmdMOVEu) + routeustrjp(fshcmdCLS, fshCmdCLSu) + routeustrjp(fshcmdVAR, fshCmdVARu) + routeustrjp(fshcmdVARS, fshCmdVARSu) + routeustrjp(fshcmdSLEEP, fshCmdSLEEPu) + routeustrjp(fshcmdINFO, fshCmdINFOu) + routeustrjp(fshcmdHELP, fshCmdHELPu) + routeustrjp(fshcmdMAN, fshCmdMANu) + push bc + ret + +#include "includes/FshCommands/FshCommands.inc" diff --git a/includes/FshCommands/FshCommands.inc b/includes/FshCommands/FshCommands.inc index 8460529..c1ac7ae 100644 --- a/includes/FshCommands/FshCommands.inc +++ b/includes/FshCommands/FshCommands.inc @@ -3,5 +3,9 @@ #include "includes/FshCommands/COPY.asm" #include "includes/FshCommands/MOVE.asm" #include "includes/FshCommands/CLS.asm" +#include "includes/FshCommands/VAR.asm" #include "includes/FshCommands/VARS.asm" #include "includes/FshCommands/SLEEP.asm" +#include "includes/FshCommands/INFO.asm" +#include "includes/FshCommands/HELP.asm" +#include "includes/FshCommands/MAN.asm" diff --git a/includes/FshCommands/HELP.asm b/includes/FshCommands/HELP.asm new file mode 100644 index 0000000..49af614 --- /dev/null +++ b/includes/FshCommands/HELP.asm @@ -0,0 +1,64 @@ +fshcmdHELP: .db "HELP", 0 +fshcmdHELPo: .db $21 +fshcmdHELPm: .db "Displays all commands", 0 +fshcmdHELPu: .db "HELP", 0 +fshcmdHELPf: + ld hl, FshCmdArgFlags + bit 0, (hl) + jr z, fshcmdHELPfExe + ld hl, ErrUsageo + call ErrSet + call ErrCatch +fshcmdHELPfExe: + ld hl, fshcmdHELPfLine1 + call _PutS + call _NewLine + +#macro fshcmdHELPmRow1(cmdXs) + xor a + ld (curCol), a + ld hl, cmdXs + call _PutS + call _NewLine +#endmacro +#macro fshcmdHELPmRow2(cmdXs, cmdYs) + xor a + ld (curCol), a + ld hl, cmdXs + call _PutS + ld a, 9 + ld (curcol), a + ld hl, cmdYs + call _PutS + call _NewLine +#endmacro +#macro fshcmdHELPmRow3(cmdXs, cmdYs, cmdZs) + xor a + ld (curCol), a + ld hl, cmdXs + call _PutS + ld a, 9 + ld (curcol), a + ld hl, cmdYs + call _PutS + ld a, 19 + ld (curcol), a + ld hl, cmdZs + call _PutS + call _NewLine +#endmacro + + fshcmdHELPmRow3(fshcmdEXIT, fshcmdSET, fshcmdCOPY) + fshcmdHELPmRow3(fshcmdMOVE, fshcmdCLS, fshcmdVAR) + fshcmdHELPmRow3(fshcmdVARS, fshcmdSLEEP, fshcmdINFO) + fshcmdHELPmRow2(fshcmdHELP, fshcmdMAN) + ; Extention Point + + call _NewLine + ld hl, fshcmdHELPfLine2 + call _PutS + call _NewLine + jp Fin + +fshcmdHELPfLine1: .db "Available Commands:", 0 +fshcmdHELPfLine2: .db "Type 'MAN' and command for more info", 0 diff --git a/includes/FshCommands/INFO.asm b/includes/FshCommands/INFO.asm new file mode 100644 index 0000000..24ec38d --- /dev/null +++ b/includes/FshCommands/INFO.asm @@ -0,0 +1,42 @@ +fshcmdINFO: .db "INFO", 0 +fshcmdINFOo: .db $20 +fshcmdINFOm: .db "Displays Syetem Information and Stats", 0 +fshcmdINFOu: .db "INFO", 0 +fshcmdINFOf: + ld hl, FshCmdArgFlags + bit 0, (hl) + jr z, fshcmdINFOfExe + ld hl, ErrUsageo + call ErrSet + call ErrCatch +fshcmdINFOfExe: + call _ClrLCDFull + xor a + ld (CurRow), a + ld (CurCol), a + + call printfshnamelong + call _NewLine + + ld hl, FshBy + call _PutS + call _NewLine + + ld hl, FshSite + call _PutS + call _NewLine + + call _NewLine + ld hl, fshcmdINFOfSPS1 + call _PutS + ld a, $27 + call _PutC + ld hl, PS1 + call _PutS + ld a, $27 + call _PutC + call _NewLine + + jp Fin + +fshcmdINFOfSPS1: .db "PS1", $CE, $CE, $CE, ":", 0 diff --git a/includes/FshCommands/MAN.asm b/includes/FshCommands/MAN.asm new file mode 100644 index 0000000..78b6e8f --- /dev/null +++ b/includes/FshCommands/MAN.asm @@ -0,0 +1,62 @@ +fshcmdMAN: .db "MAN", 0 +fshcmdMANo: .db $22 +fshcmdMANm: .db "Displays MAN text for command", 0 +fshcmdMANu: .db "MAN ", 0 +fshcmdMANf: +fshcmdMANfCheckArgs: + ld hl, FshCmdArgFlags + bit 0, (hl) + jr z, fshcmdMANfArg0Get + bit 1, (hl) + jr z, fshcmdMANfExe + ld hl, ErrUsageo + call ErrSet + call ErrCatch +fshcmdMANfArg0Get: + ld hl, fshcmdMANfPrompt + call printprompt + + ld hl, FshCmdArg0 + ld de, FshCmdCmdSize + call inputstr + call _NewLine + +fshcmdMANfExe: + ld hl, FshCmdArg0 + ld de, FshCmd + call strcpy + + ld hl, fshcmdMANfPrefix + call _PutS + + ld hl, FshCmd + call _PutS + call _NewLine + call _NewLine + + ld hl, FshCmd + call manroute + ld de, $00 + call cpHLDE + jp z, Err + + call _PutS + call _NewLine + call _NewLine + + ld hl, fshcmdMANfUsage + call _PutS + + ld hl, FshCmd + call manrouteu + ld de, $00 + call cpHLDE + jp z, Err + call _PutS + call _NewLine + + jp Fin + +fshcmdMANfPrefix: .db "MAN-DB", $DF, ' ', 0 +fshcmdMANfUsage: .db "Usage: ",0 +fshcmdMANfPrompt: .db "Command= ", 0 diff --git a/includes/FshCommands/MOVE.asm b/includes/FshCommands/MOVE.asm index 30c5fca..f6024f1 100644 --- a/includes/FshCommands/MOVE.asm +++ b/includes/FshCommands/MOVE.asm @@ -1,17 +1,17 @@ fshcmdMOVE: .db "MOVE", 0 fshcmdMOVEo: .db $03 -fshcmdMOVEu: .db "Move a value in FSH memory to another addess", 0 +fshcmdMOVEm: .db "Move a value in FSH memory to another addess", 0 +fshcmdMOVEu: .db "MOVE ", 0 fshcmdMOVEf: fshcmdMOVEfArg0: - ld hl, FshCmdArg0 - ld de, 0 - ld e, (hl) - inc hl - ld d, (hl) - ex de, hl - ld de, 0 - call cpHLDE + ld hl, FshCmdArgFlags + bit 1, (hl) jr nz, fshcmdMOVEfArg1 + bit 0, (hl) + jr z, fshcmdMOVEfArg0Get + ld hl, ErrUsageo + call ErrSet + call ErrCatch fshcmdMOVEfArg0Get: ld hl, fshcmdMOVEfDSource call printprompt @@ -23,15 +23,14 @@ fshcmdMOVEfArg0Get: ld (hl), a call _NewLine fshcmdMOVEfArg1: - ld hl, FshCmdArg1 - ld de, 0 - ld e, (hl) - inc hl - ld d, (hl) - ex de, hl - ld de, 0 - call cpHLDE + ld hl, FshCmdArgFlags + bit 3, (hl) jr nz, fshcmdMOVEfExe + bit 2, (hl) + jr z, fshcmdMOVEfArg1Get + ld hl, ErrUsageo + call ErrSet + call ErrCatch fshcmdMOVEfArg1Get: ld hl, fshcmdMOVEfDDestination call printprompt @@ -39,9 +38,9 @@ fshcmdMOVEfArg1Get: ld de, 3 call inputnumstr call strtob - ex de, hl ld hl, FshCmdArg1 ld (hl), a + call _NewLine fshcmdMOVEfExe: ld hl, FshCmdArg0 ld de, 0 @@ -56,8 +55,8 @@ fshcmdMOVEfExe: ex de, hl ld hl, 0 call fshvarset - call _NewLine - jp ErrCatch + call ErrCatch + jp Fin fshcmdMOVEfInputBuffer: .db $00, $00, $00, $00 fshcmdMOVEfDSource: .db "Source= ", 0 diff --git a/includes/FshCommands/SET.asm b/includes/FshCommands/SET.asm index 893fb68..535475f 100644 --- a/includes/FshCommands/SET.asm +++ b/includes/FshCommands/SET.asm @@ -1,37 +1,39 @@ fshcmdSET: .db "SET", 0 fshcmdSETo: .db $01 -fshcmdSETu: .db "Sets a value in FSH memory", 0 +fshcmdSETm: .db "Sets a value in FSH memory", 0 +fshcmdSETu: .db "SET ", 0 fshcmdSETf: fshcmdSETfArg0: - ld hl, FshCmdArg0 - ld de, 0 - ld e, (hl) - inc hl - ld d, (hl) - ex de, hl - ld de, 0 - call cpHLDE + ld hl, FshCmdArgFlags + bit 1, (hl) jr nz, fshcmdSETfArg1 + bit 0, (hl) + jr z, fshcmdSETfArg0Get + ld hl, ErrUsageo + call ErrSet + call ErrCatch fshcmdSETfArg0Get: ld hl, fshcmdSETfDIndex call printprompt ld hl, fshcmdSETfInputBuffer ld de, 3 call inputnumstr - call strtob - ld hl, FshCmdArg0 - ld (hl), a + call strtow + ld de, FshCmdArg0 + ex de, hl + ld (hl), e + inc hl + ld (hl), d call _NewLine fshcmdSETfArg1: - ld hl, FshCmdArg1 - ld de, 0 - ld e, (hl) - inc hl - ld d, (hl) - ex de, hl - ld de, 0 - call cpHLDE + ld hl, FshCmdArgFlags + bit 3, (hl) jr nz, fshcmdSETfExe + bit 2, (hl) + jr z, fshcmdSETfArg1Get + ld hl, ErrUsageo + call ErrSet + call ErrCatch fshcmdSETfArg1Get: ld hl, fshcmdSETfDValue call printprompt @@ -41,23 +43,26 @@ fshcmdSETfArg1Get: call strtow ex de, hl ld hl, FshCmdArg1 - ld (hl), d - inc hl ld (hl), e + inc hl + ld (hl), d + call _NewLine fshcmdSETfExe: ld hl, FshCmdArg0 ld de, 0 ld e, (hl) + inc hl + ld d, (hl) push de ld hl, FshCmdArg1 - ld d, (hl) - inc hl ld e, (hl) + inc hl + ld d, (hl) ex de, hl pop de call fshvarset - call _NewLine - jp ErrCatch + call ErrCatch + jp Fin fshcmdSETfInputBuffer: .db $00, $00, $00, $00, $00, $00 fshcmdSETfDIndex: .db "Destination= ", 0 diff --git a/includes/FshCommands/SLEEP.asm b/includes/FshCommands/SLEEP.asm index 074d6eb..e414cb0 100644 --- a/includes/FshCommands/SLEEP.asm +++ b/includes/FshCommands/SLEEP.asm @@ -1,6 +1,7 @@ fshcmdSLEEP: .db "SLEEP", 0 fshcmdSLEEPo: .db $16 -fshcmdSLEEPu: .db "Puts the calculator into sleep mode (APD)", 0 +fshcmdSLEEPm: .db "Puts the calculator into sleep mode (APD)", 0 +fshcmdSLEEPu: .db "SLEEP", 0 fshcmdSLEEPf: di call _EnableAPD diff --git a/includes/FshCommands/VAR.asm b/includes/FshCommands/VAR.asm new file mode 100644 index 0000000..e03e87a --- /dev/null +++ b/includes/FshCommands/VAR.asm @@ -0,0 +1,41 @@ +fshcmdVAR: .db "VAR", 0 +fshcmdVARo: .db $11 +fshcmdVARm: .db "Displays a value from FSH memory", 0 +fshcmdVARu: .db "VAR ", 0 +fshcmdVARf: +fshcmdVARfArg0: + ld hl, FshCmdArgFlags + bit 1, (hl) + jr nz, fshcmdVARfExe + bit 0, (hl) + jr z, fshcmdVARfArg0Get + ld hl, ErrUsageo + call ErrSet + call ErrCatch +fshcmdVARfArg0Get: + ld hl, fshcmdVARfDIndex + call printprompt + ld hl, fshcmdVARfInputBuffer + ld de, 3 + call inputnumstr + call strtow + ld de, FshCmdArg0 + ex de, hl + ld (hl), e + inc hl + ld (hl), d + call _NewLine +fshcmdVARfExe: + ld hl, FshCmdArg0 + ld de, 0 + ld e, (hl) + inc hl + ld d, (hl) + call fshvarget + call ErrCatch + call _DispHL_s + call _NewLine + jp Fin + +fshcmdVARfInputBuffer: .db $00, $00, $00, $00 +fshcmdVARfDIndex: .db "Index= ", 0 diff --git a/includes/FshCommands/VARS.asm b/includes/FshCommands/VARS.asm index 2792fe0..3ffa1a1 100644 --- a/includes/FshCommands/VARS.asm +++ b/includes/FshCommands/VARS.asm @@ -1,7 +1,15 @@ fshcmdVARS: .db "VARS", 0 fshcmdVARSo: .db $12 -fshcmdVARSu: .db "Displays all Fsh Vars", 0 +fshcmdVARSm: .db "Displays all Fsh Vars", 0 +fshcmdVARSu: .db "VARS", 0 fshcmdVARSf: + ld hl, FshCmdArgFlags + bit 0, (hl) + jr z, fshcmdVARSfExe + ld hl, ErrUsageo + call ErrSet + call ErrCatch +fshcmdVARSfExe: ld b, 0 ld c, 0 ld de, 0 diff --git a/includes/Math.asm b/includes/Math.asm deleted file mode 100644 index a43a0e0..0000000 --- a/includes/Math.asm +++ /dev/null @@ -1,107 +0,0 @@ -;; cpHLDE [Maths] -;; Compares HL to DE. -;; Output: -;; Same as z80 CP instruction. -cpHLDE: - or a - sbc hl, de - add hl,de - ret -;; cpHLBC [Maths] -;; Compares HL to BC. -;; Output: -;; Same as z80 CP instruction. -cpHLBC: - or a - sbc hl, bc - add hl,bc - ret -;; cpBCDE [Maths] -;; Compares DE to BC. -;; Output: -;; Same as z80 CP instruction. -cpBCDE: - push hl - ld h, b - ld l, c - or a - sbc hl, de - pop hl - ret - -;; mulAbyB -;; Multiplys AxB -;; Inputs: -;; A: Multiplier -;; B: Multiplicand -;; Outputs: -;; A: Product of A and B. -mulAbyB: - push bc - ld c, a -mulAbyBLoop: - add a, c - djnz mulAbyBLoop - sub c - pop bc - ret - -;; mulAbyHL -;; Multiplys AxHL -;; Inputs: -;; A: Multiplier -;; HL: Multiplicand -;; Outputs: -;; HL: Product of A and HL. -mulAbyHL: - push bc - push de - ld de, 0 - ex de, hl - cp 0 - jr z, mulAbyHLEnd - ld b, a -mulAbyHLLoop: - add hl, de - djnz mulAbyHLLoop -mulAbyHLEnd: - pop de - pop bc - ret - - -;; mul32By8 [Maths] -;; Performs an unsigned multiplication of DEHL and A. -;; Outputs: -;; DEHL: product of DEHL and A -mul32By8: - push bc \ push ix - ld ixl, 8 - push de - push hl - ld hl, 0 - ld d, h - ld e, l -mul32by8loop: - add hl, hl - rl e - rl d - rla - jr nc, mul32by8noAdd - pop bc - add hl, bc - ex (sp), hl - push hl - adc hl, de - pop de - ex de, hl - ex (sp), hl - push bc -mul32by8noAdd: - dec ixl - jr nz, mul32by8loop - pop bc - pop bc - pop ix \ pop bc - ret - diff --git a/includes/Text.inc b/includes/Text.inc new file mode 100644 index 0000000..49b6678 --- /dev/null +++ b/includes/Text.inc @@ -0,0 +1,13 @@ +;STRINGS ------------------------- +FshName: .db "Fsh SHell", 0 +FshBy: .db "By pixiys", 0 +FshSite: .db "stephenltoth.com/fsh-shell", 0 +PS1: .db "FSH> ", 0 +FshVVars: .db "64w", 0 +FshVMajor: .db "0", 0 +FshVMinor: .db "1", 0 +FshVPatch: .db "0", 0 +FshVBuild: .db "205", 0 +FshVSeparator: .db ".", 0 +FshMotd2nd: .db "Press 2nd for numbers", 0 +FshMotdHelp: .db "Type 'HELP' for help", 0 diff --git a/includes/define.inc b/includes/define.inc deleted file mode 100644 index 64ce319..0000000 --- a/includes/define.inc +++ /dev/null @@ -1,26 +0,0 @@ -.nolist - -; Included for Assembler Compatibility -;------------------------------------ -#define equ .equ -#define EQU .equ -#define end .end -#define END .end - -#define FshVarsSize 128 ;256 bytes | 64 words -#define FshCmdSize 24 ;17 bytes | 8 chars | 1 null, 4 words (args) | 1 byte (err code) | 6 unused -#define FshCmdInptSize 8 ;8 bytes | 8 chars -#define FshPrgmSize 1024 ;1024 bytes | max size - -RamVars equ 0D0EA1Fh ;saveSScreen | 21945 bytes -FshVars equ RamVars -FshCmd equ FshVars + FshVarsSize -FshPrgm equ FshCmd + FshCmdSize - -FshCmdNull equ FshCmd + FshCmdInptSize -FshCmdOP equ FshCmdNull + 1 -FshCmdArg0 equ FshCmdOP + 1 -FshCmdArg1 equ FshCmdOP + 3 -FshCmdArg2 equ FshCmdOP + 5 -FshCmdArg3 equ FshCmdOP + 7 -FshCmdErrCode equ FshCmdArg3 + 1 diff --git a/includes/lib/fsh/Command.asm b/includes/lib/fsh/Command.asm new file mode 100644 index 0000000..999b17b --- /dev/null +++ b/includes/lib/fsh/Command.asm @@ -0,0 +1,24 @@ +;;commandfill +;;Fills command mem with byte a +;;Inputs: +;; A: byte +commandfill: + push hl + push bc + push de + ld b, 0 + ld de, 0 + ld c, a + ld hl, FshCmd +commandfillLoop: + ld (hl), c + inc hl + inc b + inc de + ld a, b + cp FshCmdSize + jr c, commandfillLoop + pop de + pop bc + pop hl + ret diff --git a/includes/lib/fsh/Draw.asm b/includes/lib/fsh/Draw.asm new file mode 100644 index 0000000..d28ef16 --- /dev/null +++ b/includes/lib/fsh/Draw.asm @@ -0,0 +1,30 @@ +;;drawstatusbar +;;draws the FSH status bar +drawstatusbar: + ;rgbto565(84, 84, 84) + ld hl, $52AA + ld a, 0 + ld bc, 30 + call drawbar + ;rgbto565(0, 159, 209) + ld hl, $04FA + ;ld hl, %1111100000000000 + drawrectfilledM(0, 0, 2, 30) + call _DrawBatteryIndicator + ;draw name + set fracDrawLFont, (iy + fontFlags) + ld a, 6 + ld (penRow), a + ld a, 7 + ld (penCol), a + ld hl, $52AA + ld (drawBGcolor), hl + ld hl, $ffff + ld (drawFGcolor), hl + ld hl, FshName + call _VPutS + ld hl, $ffff + ld (drawBGcolor), hl + ld hl, $0000 + ld (drawFGcolor), hl + ret diff --git a/includes/Err.asm b/includes/lib/fsh/Err.asm similarity index 58% rename from includes/Err.asm rename to includes/lib/fsh/Err.asm index d2bdb26..765b2fb 100644 --- a/includes/Err.asm +++ b/includes/lib/fsh/Err.asm @@ -1,34 +1,47 @@ ;;ErrCatch ;;Checks err bit and jp to err route ErrCatch: - ld hl, FshFlags - bit 1, (hl) - jp nz, ErrRoute - jp Fin + pop bc + push hl + ld hl, FshFlags + bit 1, (hl) + pop hl + jp nz, ErrRoute + push bc + ret ;;ErrRoute ;;Routes err codes. ErrRoute: + ld hl, FshFlags res 1, (hl) ld hl, FshCmdErrCode - - ld de, ErrCmdNotFoundo - call bytecmp + + ld de, ErrCmdNotFoundo + call bytecmp jp z, ErrCmdNotFoundf ld de, ErrOutOfBoundso call bytecmp jp z, ErrOutOfBoundsf + ld de, ErrArgso + call bytecmp + jp z, ErrArgsf + + ld de, ErrUsageo + call bytecmp + jp z, ErrUsagef + jp ErrDefault ;;ErrSet ;;Sets all things relating to Err codes -;; Inputs: -;; HL: Err____o +;;Inputs: +;; HL: Err_____o ErrSet: push hl ld a, (hl) @@ -39,10 +52,14 @@ ErrSet: pop hl ret -;;ERR FUNCS +;;ERR FUNCS------------------- ErrCmdNotFoundo: .db $01 ErrCmdNotFoundf: + ld hl, FshCmd + ld a, (hl) + cp $00 + jp z, Fin ld hl, ErrCmdNotFoundt call _PutS ld hl, FshCmd @@ -59,6 +76,25 @@ ErrOutOfBoundsf: jp Fin ErrOutOfBoundst: .db "error: Out Of Bounds", 0 +ErrArgso: .db $03 +ErrArgsf: + ld hl, ErrArgst + call _PutS + call _NewLine + jp Fin +ErrArgst: .db "error: Invalid Arguments", 0 + +ErrUsageo: .db $04 +ErrUsagef: + ld hl, ErrUsaget + call _PutS + ld hl, FshCmd + call manrouteu + call _PutS + call _NewLine + jp Fin +ErrUsaget: .db "error: Usage: ", 0 + ErrDefault: ld hl, ErrDefaultt call _PutS diff --git a/includes/FshVar.asm b/includes/lib/fsh/FshVar.asm similarity index 78% rename from includes/FshVar.asm rename to includes/lib/fsh/FshVar.asm index 42669d5..ec8dc3e 100644 --- a/includes/FshVar.asm +++ b/includes/lib/fsh/FshVar.asm @@ -1,15 +1,14 @@ -;;; fshvarset [Bytes] -;; Sets a Word in FshVars. -;; Inputs: -;; HL: 16b -;; DE: Destination Word Relitive to FshVars +;;fshvarset +;;Sets a Word in FshVars. +;;Inputs: +;; HL: 16b +;; DE: Destination Word Relitive to FshVars fshvarset: push bc ld bc, FshVarsSize / 2 - 1 call cpBCDE pop bc jr c, fshvarsetOOBException - push bc push de push hl @@ -24,7 +23,6 @@ fshvarset: pop de pop bc ret - fshvarsetOOBException: push hl ld hl, ErrOutOfBoundso @@ -32,19 +30,18 @@ fshvarsetOOBException: pop hl ret -;;; fshvarget [Words] -;; Gets a Word in FshVars. -;; Inputs: -;; DE: Destination Word Relitive to FshVars -;; Outputs: -;; HL: Word in (DE) +;;fshvarget +;;Gets a Word in FshVars. +;;Inputs: +;; DE: Destination Word Relitive to FshVars +;;Outputs: +;; HL: Word in (DE) fshvarget: push bc ld bc, FshVarsSize / 2 - 1 call cpBCDE pop bc jr c, fshvargetOOBException - push bc push de ld hl, 0 @@ -59,19 +56,17 @@ fshvarget: pop de pop bc ret - fshvargetOOBException: push hl ld hl, ErrOutOfBoundso call ErrSet pop hl ret - -; fshvarcpy [Bytes] -;; Copies a word. -;; Inputs: -;; HL: Byte pointer -;; DE: Destination +;;fshvarcpy +;;Copies a word. +;;Inputs: +;; HL: Byte pointer +;; DE: Destination fshvarcpy: push bc ld bc, FshVarsSize / 2 - 1 @@ -83,7 +78,6 @@ fshvarcpy: call cpHLBC pop bc jr nc, fshvarcpyOOBException - push de push hl ld bc, FshVarsSize / 2 @@ -112,8 +106,8 @@ fshvarcpyOOBException: pop hl ret -; fshvarreset -;; fills fshvars with word +;;fshvarreset +;;Fills fshvars with $00 fshvarreset: push hl push bc diff --git a/includes/lib/fsh/Parse.asm b/includes/lib/fsh/Parse.asm new file mode 100644 index 0000000..951f374 --- /dev/null +++ b/includes/lib/fsh/Parse.asm @@ -0,0 +1,187 @@ +;;fshparsecommand +;;Inputs: +;; HL: FshCmd +;;b = buf row +;;c = char in row +;de = scratch +fshparsecommand: + push hl + push bc + push de + push hl + push hl + ld hl, fshparsecommandCmd + ld b, 45 + ld a, $00 + call memset + pop hl + + ld bc, 0 + ld de, 0 +fshparsecommandLoop: + ld a, (hl) +fshparsecommandCheckSpace: + cp ' ' ;end of word + jr nz, fshparsecommandCheckEnd + ld a, $00 + call fshparsecommandCopyChar + ld c, 0 + inc b + inc hl + jr fshparsecommandLoop + +fshparsecommandCheckEnd: + cp $00 ;end of string + jr z, fshparsecommandCheckArgStatus + +fshparsecommandLoopEnd: + call fshparsecommandCopyChar + inc hl + inc c + + ld a, c + cp FshCmdCmdSize + jr nz, fshparsecommandLoop + ;inc hl + ld c, 0 + inc b + ld a, b + cp 5 + jr nz, fshparsecommandLoop +; ld bc, 0 + +fshparsecommandCheckArgStatus: + xor a + ld hl, FshCmdArgFlags + ld (hl), a +fshparsecommandCheckArg0: + ld hl, fshparsecommandArg0 + ld a, (hl) + cp $00 + jr z, fshparsecommandCheckArg1 + ld hl, FshCmdArgFlags + set 0, (hl) + ld a, (hl) + ld hl, fshparsecommandArg0 + ld a, (hl) + sub '0' + cp '9' - '0' + 1 + jr nc, fshparsecommandCheckArg1 + call strtow + ld de, fshparsecommandArg0 + ex de, hl + ld (hl), e + inc hl + ld (hl), d + inc (hl) + ld (hl), $00 + ld hl, FshCmdArgFlags + set 1, (hl) +fshparsecommandCheckArg1: + ld hl, fshparsecommandArg1 + ld a, (hl) + cp $00 + jr z, fshparsecommandCheckArg2 + ld hl, FshCmdArgFlags + set 2, (hl) + ld hl, fshparsecommandArg1 + ld a, (hl) + sub '0' + cp '9' - '0' + 1 + jr nc, fshparsecommandCheckArg2 + call strtow + ld de, fshparsecommandArg1 + ex de, hl + ld (hl), e + inc hl + ld (hl), d + inc hl + ld (hl), $00 + ld hl, FshCmdArgFlags + set 3, (hl) +fshparsecommandCheckArg2: + ld hl, fshparsecommandArg2 + ld a, (hl) + cp $00 + jr z, fshparsecommandCheckArg3 + ld hl, FshCmdArgFlags + set 4, (hl) + ld hl, fshparsecommandArg2 + ld a, (hl) + sub '0' + cp '9' - '0' + 1 + jr nc, fshparsecommandCheckArg3 + call strtow + ld de, fshparsecommandArg2 + ex de, hl + ld (hl), e + inc hl + ld (hl), d + inc hl + ld (hl), $00 + ld hl, FshCmdArgFlags + set 5, (hl) +fshparsecommandCheckArg3: + ld hl, fshparsecommandArg3 + ld a, (hl) + cp $00 + jr z, fshparsecommandCopyBack + ld hl, FshCmdArgFlags + set 6, (hl) + ld hl, fshparsecommandArg3 + ld a, (hl) + sub '0' + cp '9' - '0' + 1 + jr nc, fshparsecommandCopyBack + call strtow + ld de, fshparsecommandArg3 + ex de, hl + ld (hl), e + inc hl + ld (hl), d + inc hl + ld (hl), $00 + ld hl, FshCmdArgFlags + set 7, (hl) +fshparsecommandCopyBack: + pop hl + push bc + ex de, hl + ld hl, fshparsecommandCmd + ld bc, 45 + ldir + pop bc + + pop de + pop bc + pop hl + ret + +fshparsecommandCmd: .db $00, $00, $00, $00, $00, $00, $00, $00, $00 +fshparsecommandArg0: .db $00, $00, $00, $00, $00, $00, $00, $00, $00 +fshparsecommandArg1: .db $00, $00, $00, $00, $00, $00, $00, $00, $00 +fshparsecommandArg2: .db $00, $00, $00, $00, $00, $00, $00, $00, $00 +fshparsecommandArg3: .db $00, $00, $00, $00, $00, $00, $00, $00, $00 +fshparsecommandOverB: .db $00, $00, $00, $00, $00, $00 + +fshparsecommandCopyChar: + ;Copy + push hl + push bc + ld hl, 0 + ld h, b + ld l, 9 + ld b, c + ld de, fshparsecommandCmd + call array2d + pop bc + pop hl + ;push hl + ; ld hl, fshparsecommandCmd+45+1 + ; call cpHLDE + ;pop hl + ;pop de + ;ret c + ;push de + ld (de), a ;ld buffer + ret diff --git a/includes/lib/fsh/Print.asm b/includes/lib/fsh/Print.asm new file mode 100644 index 0000000..a74034c --- /dev/null +++ b/includes/lib/fsh/Print.asm @@ -0,0 +1,44 @@ +;;printfshnamelong +;;prints Name + Varsv + Version to screen +printfshnamelong: + push hl + ld hl, FshName + call _PutS + ld a, ' ' + call _PutC + ld hl, FshVVars + call _PutS + ld a, ' ' + call _PutC + ld a, 'v' + call _PutC + ld hl, FshVMajor + call _PutS + ld hl, FshVSeparator + call _PutS + ld hl, FshVMinor + call _PutS + ld hl, FshVSeparator + call _PutS + ld hl, FshVPatch + call _PutS + ld a, ' ' + call _PutC + ld hl, FshVBuild + call _PutS + pop hl + ret + +;;printmotd +;;prints the motd to screen +printmotd: + call printfshnamelong + call _NewLine + call _NewLine + ld hl, FshMotd2nd + call _PutS + call _NewLine + ld hl, FshMotdHelp + call _PutS + call _NewLine + ret diff --git a/includes/lib/fsh/fsh.inc b/includes/lib/fsh/fsh.inc new file mode 100644 index 0000000..10acee1 --- /dev/null +++ b/includes/lib/fsh/fsh.inc @@ -0,0 +1,6 @@ +#include "includes/lib/fsh/Command.asm" +#include "includes/lib/fsh/Parse.asm" +#include "includes/lib/fsh/FshVar.asm" +#include "includes/lib/fsh/Err.asm" +#include "includes/lib/fsh/Print.asm" +#include "includes/lib/fsh/Draw.asm" diff --git a/includes/lib/std/Array.asm b/includes/lib/std/Array.asm new file mode 100644 index 0000000..c1aa52a --- /dev/null +++ b/includes/lib/std/Array.asm @@ -0,0 +1,19 @@ +;;array2d +;;gets the address of 2d array +;;Inputs: +;; H: y +;; L: x width +;; B: x +;; DE: Array start +;;Outputs: +;; DE: Array loc address +array2d: + push hl + mlt hl + add hl, de + ld de, 0 + ld e, b + add hl, de + ex de, hl + pop hl + ret diff --git a/includes/lib/std/Byte.asm b/includes/lib/std/Byte.asm new file mode 100644 index 0000000..2b9b790 --- /dev/null +++ b/includes/lib/std/Byte.asm @@ -0,0 +1,31 @@ +;;bytecmp +;;Determines if two bytes are equal. +;;Inputs: +;; HL: Byte pointer +;; DE: Byte pointer +;;Outputs: +;; Z: Set if equal, reset if not equal +bytecmp: + push hl + push de + ld a, (de) + or a + cp (hl) + pop de + pop hl + ret + +;;bytecpy +;; Copies a byte. +;;Inputs: +;; HL: Byte pointer +;; DE: Destination +bytecpy: + push de + push hl + ex de, hl + ld a, (de) + ld (hl), a + pop hl + pop de + ret diff --git a/includes/Char.asm b/includes/lib/std/Char.asm similarity index 62% rename from includes/Char.asm rename to includes/lib/std/Char.asm index 1e0a350..910e202 100644 --- a/includes/Char.asm +++ b/includes/lib/std/Char.asm @@ -1,12 +1,12 @@ #include "includes/tables/CSC.asm" -; chartoascii -;; Converts a char to "ascii" +;;chartoascii +;;Converts a char to "ascii" ;;Inputs: ;; A: char code (csc) ;;Outputs: ;; A: ascii char chartoascii: - push hl ; Convert scan code into character + push hl ld hl, 0 ld h, 0 ld l, a @@ -15,14 +15,15 @@ chartoascii: ld a, (hl) pop hl ret -; charnumtoascii -;; Converts a char to "ascii" + +;;Charnumtoascii +;;Converts a char to "ascii" ;;Inputs: ;; A: char code (csc) ;;Outputs: ;; A: ascii char charnumtoascii: - push hl ; Convert scan code into character + push hl ld hl, 0 ld h, 0 ld l, a @@ -31,14 +32,15 @@ charnumtoascii: ld a, (hl) pop hl ret -; charnumsymtoascii -;; Converts a char to "ascii" + +;;charnumsymtoascii +;;Converts a char to "ascii" ;;Inputs: ;; A: char code (csc) ;;Outputs: ;; A: ascii char charnumsymtoascii: - push hl ; Convert scan code into character + push hl ld hl, 0 ld h, 0 ld l, a diff --git a/includes/Cursor.asm b/includes/lib/std/Cursor.asm similarity index 95% rename from includes/Cursor.asm rename to includes/lib/std/Cursor.asm index 6915b98..ed26b30 100644 --- a/includes/Cursor.asm +++ b/includes/lib/std/Cursor.asm @@ -1,4 +1,3 @@ -;TODO ;;cursorcharunderreset ;;Sets curUnder to 0 cursorcurunderreset: diff --git a/includes/lib/std/Draw.asm b/includes/lib/std/Draw.asm new file mode 100644 index 0000000..6354655 --- /dev/null +++ b/includes/lib/std/Draw.asm @@ -0,0 +1,125 @@ +;;drawpixel +;;Sets a pixel to specified color (565) +;;Inputs: +;; HL: color +;; DE: vRam location +drawpixel: + push hl + push de + ex de, hl + ld (hl), e + inc hl + ld (hl), d + pop de + pop hl + ret + +;;drawpixelxy +;;Sets a pixel to specified color +;;Inputs: +;; HL: color +;; DE: x +;; A: y +drawpixelxy + push de + push hl + ex de, hl + add hl, hl + push hl + ld hl, 640 + call mulAbyHL + ex de, hl + pop hl + add hl, de + ld de, vRam + add hl, de + ex de, hl + pop hl + call drawpixel + pop de + ret + +;;drawrow +;;Draws a row on lcd +;;Inputs: +;; A: y +;; HL: color +drawrow: + push hl + push bc + push hl + ld hl, lcdHeight * 2 + call mulAbyHL + ld de, vRam + add hl, de + ex de, hl + pop hl + ld bc, lcdWidth +drawrowLoop: + call drawpixel + inc de + inc de + dec bc + push hl + ld hl, 0 + call cpHLBC + pop hl + jr nz, drawrowLoop + pop bc + pop hl + ret + +;;drawbar +;;Loops drawing row +;;Inputs: +;; A: y +;; [B]C: height +;; HL: color +drawbar: + push bc +drawbarLoop: + call drawrow + dec bc + inc a + push hl + ld hl, 0 + call cpHLBC + pop hl + jr nz, drawbarLoop + pop bc + ret + +;;drawrectfilled +;;Draws a rectangle from coordinates (Slow) +;;Inputs: +;; DE: x +;; C: y +;; HL: width +;; A: height +;; IXH+IXL: color +drawrectfilled: + add hl, de + add a, c + ld b, a +drawrectfilledLoopY: + push de +drawrectfilledLoopX: + push hl + push bc + ex de, hl + ld d, ixh + ld e, ixl + ex de, hl + ld a, c + call drawpixelxy + pop bc + pop hl + inc de + call cpHLDE + jr nz, drawrectfilledLoopX + pop de + inc c + ld a, b + cp c + jr nz, drawrectfilledLoopY + ret diff --git a/includes/Input.asm b/includes/lib/std/Input.asm similarity index 72% rename from includes/Input.asm rename to includes/lib/std/Input.asm index 18ea571..495bd37 100644 --- a/includes/Input.asm +++ b/includes/lib/std/Input.asm @@ -12,9 +12,8 @@ inputgetkey: jr z, inputgetkey ret - -;;inputstr [Input, String] -;; +;;inputstr +;;Inputs string of length [Buffer Size] and puts it in (Destination) ;;Inputs: ;; HL: Destination ;; D[E]: Buffer Size @@ -29,12 +28,16 @@ inputstr: ld hl, CurCol ld de, inputstrCurColBuf call bytecpy + ld hl, CurRow + ld de, inputstrCurRowBuf + call bytecpy pop de pop hl + res Shift2nd, (IY + ShiftFlags) call _CursorOn - xor a + xor a ld b, a inputstrKeyInput: call cursorcurunderreset @@ -67,12 +70,25 @@ inputstrKeyInput: call z, chartoascii call nz, charnumsymtoascii + cp $FF + jr z, inputstrKeyInput + + res textScrolled, (iy+textFlags) + call _PutC ld (hl), a inc hl inc b - + + bit textScrolled, (iy+textFlags) + jr z, inputstrKeyInput + push hl + ld hl, inputstrCurRowBuf + ld a, (hl) + dec a + ld (hl), a + pop hl jr inputstrKeyInput inputstrKey2nd: push hl @@ -92,7 +108,6 @@ inputstrKeyDel: push hl ld hl, CurCol - ld a, (hl) dec (hl) pop hl @@ -108,16 +123,14 @@ inputstrKeyClear: cp 0 jp z, inputstrKeyInput - push hl - ld hl, CurRow - ld c, (hl) - pop hl - push hl push de ld hl, inputstrCurColBuf ld de, CurCol call bytecpy + ld hl, inputstrCurRowBuf + ld de, CurRow + call bytecpy pop de pop hl @@ -126,17 +139,18 @@ inputstrKeyClear: inputstrKeyClearLoop: call _PutC djnz inputstrKeyClearLoop + ld b, 0 - push hl - push de + push de + push hl ld hl, inputstrCurColBuf ld de, CurCol call bytecpy - pop de - pop hl - - ld hl, CurRow - ld (hl), c + ld hl, inputstrCurRowBuf + ld de, CurRow + call bytecpy + pop hl + pop de pop hl push hl jp inputstrKeyInput @@ -148,15 +162,17 @@ inputstrKeyEnter: call _PutMap pop hl pop de + res Shift2nd, (IY + ShiftFlags) ret inputstrFlags: .db %00000000 ; 0: num Flag inputstrSizeBuf: .dw $0000 inputstrCurColBuf: .db $00 +inputstrCurRowBuf: .db $00 -;;inputcharstr [Input, String] -;; +;;inputcharstr +;;Inputs string of (only letters) of length [Buffer Size] and puts it in (Destination) ;;Inputs: ;; HL: Destination ;; D[E]: Buffer Size @@ -165,11 +181,14 @@ inputstrCurColBuf: .db $00 inputcharstr: push de push hl - ld (inputcharstrSizeBuf), de + ld (inputstrSizeBuf), de push hl push de ld hl, CurCol - ld de, inputcharstrCurColBuf + ld de, inputstrCurColBuf + call bytecpy + ld hl, CurRow + ld de, inputstrCurRowBuf call bytecpy pop de pop hl @@ -178,7 +197,6 @@ inputcharstr: xor a ld b, a - inputcharstrKeyInput: call cursorcurunderreset call inputgetkey @@ -206,14 +224,26 @@ inputcharstrKeyInput: call chartoascii + cp $FF + jr z, inputcharstrKeyInput + + res textScrolled, (iy+textFlags) + call _PutC ld (hl), a inc hl inc b - - jr inputcharstrKeyInput - + + bit textScrolled, (iy+textFlags) + jr z, inputcharstrKeyInput + push hl + ld hl, inputcharstrCurRowBuf + ld a, (hl) + dec a + ld (hl), a + pop hl + jr inputcharstrKeyInput inputcharstrKeyDel: ld a, b cp 0 @@ -224,7 +254,6 @@ inputcharstrKeyDel: push hl ld hl, CurCol - ld a, (hl) dec (hl) pop hl @@ -250,6 +279,9 @@ inputcharstrKeyClear: ld hl, inputcharstrCurColBuf ld de, CurCol call bytecpy + ld hl, inputcharstrCurRowBuf + ld de, CurRow + call bytecpy pop de pop hl @@ -267,8 +299,16 @@ inputcharstrKeyClearLoop: pop de pop hl - ld hl, CurRow - ld (hl), c + push de + push hl + ld hl, inputcharstrCurColBuf + ld de, CurCol + call bytecpy + ld hl, inputcharstrCurRowBuf + ld de, CurRow + call bytecpy + pop hl + pop de pop hl push hl jp inputcharstrKeyInput @@ -284,9 +324,10 @@ inputcharstrKeyEnter: inputcharstrSizeBuf: .dw $0000 inputcharstrCurColBuf: .db $00 +inputcharstrCurRowBuf: .db $00 -;;inputnumstr [Input, String] -;; +;;inputnumstr +;;Inputs string of (only numbers) of length [Buffer Size] and puts it in (Destination) ;;Inputs: ;; HL: Destination ;; D[E]: Buffer Size @@ -301,6 +342,9 @@ inputnumstr: ld hl, CurCol ld de, inputnumstrCurColBuf call bytecpy + ld hl, CurRow + ld de, inputnumstrCurRowBuf + call bytecpy pop de pop hl @@ -338,15 +382,24 @@ inputnumstrKeyInput: cp $FF jr z, inputnumstrKeyInput + res textScrolled, (iy+textFlags) + call _PutC ld (hl), a inc hl inc b - jr inputnumstrKeyInput - -inputnumstrKeyDel: + bit textScrolled, (iy+textFlags) + jr z, inputnumstrKeyInput + push hl + ld hl, inputnumstrCurRowBuf + ld a, (hl) + dec a + ld (hl), a + pop hl + jr inputnumstrKeyInput +inputnumstrkeydel: ld a, b cp 0 jp z, inputnumstrKeyInput @@ -355,9 +408,8 @@ inputnumstrKeyDel: call _PutMap push hl - ld hl, CurCol - ld a, (hl) - dec (hl) + ld hl, CurCol + dec (hl) pop hl ld a, ' ' @@ -382,6 +434,9 @@ inputnumstrKeyClear: ld hl, inputnumstrCurColBuf ld de, CurCol call bytecpy + ld hl, inputnumstrCurRowBuf + ld de, CurRow + call bytecpy pop de pop hl @@ -391,16 +446,16 @@ inputnumstrKeyClearLoop: call _PutC djnz inputnumstrKeyClearLoop - push hl - push de - ld hl, inputnumstrCurColBuf + push de + push hl + ld hl, inputnumstrCurColBuf ld de, CurCol call bytecpy - pop de - pop hl - - ld hl, CurRow - ld (hl), c + ld hl, inputnumstrCurRowBuf + ld de, CurRow + call bytecpy + pop hl + pop de pop hl push hl jp inputnumstrKeyInput @@ -416,3 +471,4 @@ inputnumstrKeyEnter: inputnumstrSizeBuf: .dw $0000 inputnumstrCurColBuf: .db $00 +inputnumstrCurRowBuf: .db $00 diff --git a/includes/lib/std/Math.asm b/includes/lib/std/Math.asm new file mode 100644 index 0000000..030e3f6 --- /dev/null +++ b/includes/lib/std/Math.asm @@ -0,0 +1,109 @@ +;;cpHLDE +;;Compares HL to DE. +;;Output: +;; Same as z80 CP instruction. +cpHLDE: + or a + sbc hl, de + add hl,de + ret + +;;cpHLBC +;;Compares HL to BC. +;;Output: +;; Same as z80 CP instruction. +cpHLBC: + or a + sbc hl, bc + add hl,bc + ret + +;;cpBCDE +;;Compares DE to BC. +;;Output: +;; Same as z80 CP instruction. +cpBCDE: + push hl + ld h, b + ld l, c + or a + sbc hl, de + pop hl + ret + +;;mulAbyB +;;Multiplys AxB +;;Inputs: +;; A: Multiplier +;; B: Multiplicand +;;Outputs: +;; A: Product of A and B. +mulAbyB: + push bc + ld c, a +mulAbyBLoop: + add a, c + djnz mulAbyBLoop + sub c + pop bc + ret + +;;mulAbyHL +;;Multiplys AxHL +;;Inputs: +;; A: Multiplier +;; HL: Multiplicand +;;Outputs: +;; HL: Product of A and HL. +mulAbyHL: + push bc + push de + ld de, 0 + ex de, hl + cp 0 + jr z, mulAbyHLEnd + ld b, a +mulAbyHLLoop: + add hl, de + djnz mulAbyHLLoop +mulAbyHLEnd: + pop de + pop bc + ret + + +;;mul32By8 +;;Performs an unsigned multiplication of DEHL and A. +;;Outputs: +;; DEHL: product of DEHL and A +mul32By8: + push bc \ push ix + ld ixl, 8 + push de + push hl + ld hl, 0 + ld d, h + ld e, l +mul32by8loop: + add hl, hl + rl e + rl d + rla + jr nc, mul32by8noAdd + pop bc + add hl, bc + ex (sp), hl + push hl + adc hl, de + pop de + ex de, hl + ex (sp), hl + push bc +mul32by8noAdd: + dec ixl + jr nz, mul32by8loop + pop bc + pop bc + pop ix \ pop bc + ret + diff --git a/includes/lib/std/Mem.asm b/includes/lib/std/Mem.asm new file mode 100644 index 0000000..8cf7244 --- /dev/null +++ b/includes/lib/std/Mem.asm @@ -0,0 +1,16 @@ +;;memset +;;Fills B amount of bytes from hl with a +;;Inputs: +;; HL: start +;; B: how many bytes +;; A: Byte +memset: + push hl + push bc +memsetLoop: + ld (hl), a + inc hl + djnz memsetLoop + pop bc + pop hl + ret diff --git a/includes/Print.asm b/includes/lib/std/Print.asm similarity index 100% rename from includes/Print.asm rename to includes/lib/std/Print.asm diff --git a/includes/String.asm b/includes/lib/std/String.asm similarity index 54% rename from includes/String.asm rename to includes/lib/std/String.asm index 94ccc87..e23a99f 100644 --- a/includes/String.asm +++ b/includes/lib/std/String.asm @@ -1,81 +1,60 @@ -;; strlen [Strings] -;; Determines the length of a zero delimited string. -;; Inputs: -;; HL: String pointer -;; Outputs: -;; BC: String length +;;strlen +;;Determines the length of a zero delimited string. +;;Inputs: +;; HL: String pointer +;;Outputs: +;; BC: String length strlen: - push af - push hl - xor a - ld b, a - ld c, a - cpir - ; bc = -bc - xor a \ sub c \ ld c, a \ sbc a, a \ sub b \ ld b, a - dec bc - pop hl - pop af - ret + push af + push hl + xor a + ld b, a + ld c, a + cpir + ; bc = -bc + xor a \ sub c \ ld c, a \ sbc a, a \ sub b \ ld b, a + dec bc + pop hl + pop af + ret -;; strcmp [Strings] -;; Determines if two strings are equal, and checks alphabetical sort order. -;; Inputs: -;; HL: String pointer -;; DE: String pointer -;; Outputs: -;; Z: Set if equal, reset if not equal -;; C: Set if string HL is alphabetically earlier than string DE +;;strcmp +;;Determines if two strings are equal, and checks alphabetical sort order. +;;Inputs: +;; HL: String pointer +;; DE: String pointer +;;Outputs: +;; Z: Set if equal, reset if not equal +;; C: Set if string HL is alphabetically earlier than string DE strcmp: - push hl - push de + push hl + push de strcmpLoop: - ld a, (de) - or a - jr z, strCmpEnd - cp (hl) - jr nz, strcmpExit - inc hl - inc de - jr strcmpLoop + ld a, (de) + or a + jr z, strCmpEnd + cp (hl) + jr nz, strcmpExit + inc hl + inc de + jr strcmpLoop strcmpEnd: - ld a, (hl) - or a + ld a, (hl) + or a strcmpExit: - ccf - pop de - pop hl - ret - -;; strcmp_sort [Strings] -;; Compares strings at ((HL)) and ((DE)). That is, calls [[indirect16HLDE]], -;; then calls [[strcmp]]. -;; Inputs: -;; HL: Pointer to string pointer -;; DE: Pointer to string pointer -;; Outputs: -;; Z: Set if equal, reset if not equal -;; C: Set if string (HL) is alphabetically earlier than string (DE) -;; Notes: -;; This routine is useful as the callback for the [[callbackSort]] routine. -;; It allows sorting a list of pointers to strings in alphabetical order. -;strcmp_sort: -; push hl -; push de -; call indirect16HLDE -; call strcmp -; pop de -; pop hl -; ret - -;; strcpy [Strings] -;; Copies a string. -;; Inputs: -;; HL: String pointer -;; DE: Destination -;; Notes: -;; This will trample into undefined territory if you try to copy a string into some -;; allocated memory it won't fit in. + ccf + pop de + pop hl + ret + +;;strcpy +;;Copies a string. +;;Inputs: +;; HL: String pointer +;; DE: Destination +;;Notes: +;; This will trample into undefined territory if you try to copy a string into some +;;allocated memory it won't fit in. strcpy: push de push hl @@ -90,34 +69,34 @@ _: pop hl pop de ret -;; strchr [Strings] -;; Returns a pointer on the first occurence of a character in a string. -;; Inputs: -;; HL: Haystack -;; B: Needle -;; Outputs: -;; HL: Pointer to first occurence of character -;; Z: Set if character found -;; A: Destroyed +;;strchr +;;Returns a pointer on the first occurence of a character in a string. +;;Inputs: +;; HL: Haystack +;; B: Needle +;;Outputs: +;; HL: Pointer to first occurence of character +;; Z: Set if character found +;; A: Destroyed strchr: strchrLoop: - ld a, (hl) - or a - jr z, strchrNoCharFound - cp b - ret z - inc hl - jr strchrLoop + ld a, (hl) + or a + jr z, strchrNoCharFound + cp b + ret z + inc hl + jr strchrLoop strchrNoCharFound: - inc a - ret + inc a + ret -;; strtob -;; Converts a string to a byte -;; Inputs: -;; HL: string pointer -;; Outputs: -;; A: byte +;;strtob +;;Converts a string to a byte +;;Inputs: +;; HL: string pointer +;;Outputs: +;; A: byte strtob: push bc push de @@ -176,12 +155,12 @@ strtobExit: pop bc ret -;; strtow -;; Converts a string to a byte -;; Inputs: -;; HL: string pointer -;; Outputs: -;; HL: byte +;;strtow +;;Converts a string to a byte +;;Inputs: +;; HL: string pointer +;;Outputs: +;; HL: byte strtow: push bc push de @@ -211,6 +190,7 @@ strtowNumWhileLoop: inc c jr strtowNumWhileLoop strtowConvert: + ld bc, 0 dec hl ld a, (hl) sub '0' @@ -278,12 +258,12 @@ strtowExit: pop bc ret -;; toLower [Strings] -;; Converts every alpha character of a string to lowercase. -;; Inputs: -;; HL: Pointer to string -;; Notes: -;; This modifies the string in-place. +;;toLower [Strings] +;;Converts every alpha character of a string to lowercase. +;;Inputs: +;; HL: Pointer to string +;;Notes: +;; This modifies the string in-place. ;toLower: ; push af \ push hl ; ld a, (hl) @@ -302,12 +282,12 @@ strtowExit: ; pop hl \ pop af ; ret -;; toUpper [Strings] -;; Converts every alpha character of a string to uppercase. -;; Inputs: -;; HL: Pointer to string -;; Notes: -;; This modifies the string in-place. +;;toUpper [Strings] +;;Converts every alpha character of a string to uppercase. +;;Inputs: +;; HL: Pointer to string +;;Notes: +;; This modifies the string in-place. ;toUpper: ; push af \ push hl ; ld a, (hl) diff --git a/includes/Word.asm b/includes/lib/std/Word.asm similarity index 57% rename from includes/Word.asm rename to includes/lib/std/Word.asm index 1d9b796..5168a3b 100644 --- a/includes/Word.asm +++ b/includes/lib/std/Word.asm @@ -1,8 +1,8 @@ -;; wordcpy [Words] -;; Copies a word. -;; Inputs: -;; HL: word pointer -;; DE: Destination +;;wordcpy [Words] +;;Copies a word. +;;Inputs: +;; HL: word pointer +;; DE: Destination wordcpy: push de push hl diff --git a/includes/lib/std/std.inc b/includes/lib/std/std.inc new file mode 100644 index 0000000..0e4e778 --- /dev/null +++ b/includes/lib/std/std.inc @@ -0,0 +1,12 @@ +#include "includes/lib/std/Math.asm" +#include "includes/lib/std/Byte.asm" +#include "includes/lib/std/Mem.asm" +#include "includes/lib/std/Char.asm" +#include "includes/lib/std/Cursor.asm" +#include "includes/lib/std/Print.asm" +#include "includes/lib/std/Draw.asm" +#include "includes/lib/std/Array.asm" + +#include "includes/lib/std/String.asm" + +#include "includes/lib/std/Input.asm" diff --git a/includes/macros/command.asm b/includes/macros/command.asm new file mode 100644 index 0000000..4486998 --- /dev/null +++ b/includes/macros/command.asm @@ -0,0 +1,21 @@ +;;decodecmdopt +;;compares cmdXs to command input and conditionally sets opt to optcode +;;Inputs: +;; HL: cmd string input +;; DE: op code mem location +#macro decodecmdopt(cmdXs, cmdXo) + push hl + push de + ld de, cmdXs + call strcmp + ld hl, cmdXo + pop de + call z, bytecpy + pop hl +#endmacro + +#macro routeoptjp(cmdXo, cmdXf) + ld de, cmdXo + call bytecmp + jp z, cmdXf +#endmacro diff --git a/includes/macros/draw.asm b/includes/macros/draw.asm new file mode 100644 index 0000000..664a4a7 --- /dev/null +++ b/includes/macros/draw.asm @@ -0,0 +1,33 @@ +#macro drawpixelxyM(x, y) + ld de, x + ld a, y + call drawpixelxy +#endmacro + +#macro drawlineM(x1, y1, x2, y2) +;TODO +#endmacro + +#macro drawrowM(y) + ld a, y + call drawrow +#endmacro + +#macro drawbarM(y, height) + ld a, y + ld bc, height + call drawbar +#endmacro + +#macro drawrectfilledM(x, y, width, height) + ex de, hl + ld ixl, e + ld ixh, d + ex de, hl + ld hl, width + ld de, x + ld bc, 0 + ld c, y + ld a, height + call drawrectfilled +#endmacro diff --git a/includes/macros/macros.inc b/includes/macros/macros.inc new file mode 100644 index 0000000..9cac28f --- /dev/null +++ b/includes/macros/macros.inc @@ -0,0 +1,4 @@ +#include "includes/macros/misc.asm" +#include "includes/macros/pixel.asm" +#include "includes/macros/draw.asm" +#include "includes/macros/command.asm" diff --git a/includes/macros/misc.asm b/includes/macros/misc.asm new file mode 100644 index 0000000..ba398d7 --- /dev/null +++ b/includes/macros/misc.asm @@ -0,0 +1,9 @@ +;;rgbto565 +;;turns an rgb input into the 656 format that the lcd uses +;;Inputs: +;; r,g,b +;;Outputs: +;; HL: color +#macro rgbto565(red, green, blue) + ld hl, ((red / 255 * 31) << 11) | ((green / 255 * 63) << 5) | ((blue / 255 * 31)) +#endmacro diff --git a/includes/macros/pixel.asm b/includes/macros/pixel.asm new file mode 100644 index 0000000..0b60bb5 --- /dev/null +++ b/includes/macros/pixel.asm @@ -0,0 +1,10 @@ +;;pixel +;;Gets vRam location of coordinates +;;Inputs: +;; x: x axis +;; y: y axis +;;Outputs: +;; DE: vRam location +#macro pixel(x, y) + ld de, vRam + (y * 320 * 2) + (x * 2) +#endmacro diff --git a/includes/man-db.asm b/includes/man-db.asm new file mode 100644 index 0000000..77d348d --- /dev/null +++ b/includes/man-db.asm @@ -0,0 +1,52 @@ +;;TODO: move module specific macros to diffrent file +;;manroute +;;routes command string to discription +;;Inputs: +;; HL: Command String +;;Outputs: +;; HL: Command Discription String +manroute: + push de +#macro routestrjp(cmdXs, cmdXm) + ld de, cmdXs + call strcmp + ld de, cmdXm + jp z, manrouteReturn +#endmacro + + call fshcmdmanroute + ;Extention Point + + ld hl, FshCmdErrCode + ld (hl), $01 + ld de, $00 +manrouteReturn: + ex de, hl + pop de + ret + +;;manrouteu +;;routes command string to usage +;;Inputs: +;; HL: Command String +;;Outputs: +;; HL: Command Usage String +manrouteu: + push de +#macro routeustrjp(cmdXs, cmdXu) + ld de, cmdXs + call strcmp + ld de, cmdXu + jp z, manrouteuReturn +#endmacro + + call fshcmdmanrouteu + ;Extention Point + + ld hl, FshCmdErrCode + ld (hl), $01 + ld de, $00 +manrouteuReturn: + ex de, hl + pop de + ret diff --git a/includes/static/define.inc b/includes/static/define.inc new file mode 100644 index 0000000..021531b --- /dev/null +++ b/includes/static/define.inc @@ -0,0 +1,28 @@ +.nolist + +; Included for Assembler Compatibility +;------------------------------------ +#define equ .equ +#define EQU .equ +#define end .end +#define END .end + +#define FshVarsSize 128 ;256 bytes | 64 words +#define FshCmdSize 64 ;64 bytes | 44 chars , 5 qwords (CMD + args) , + 4 0's| 1 byte null | 2 byte optcode | 1 byte arg flags |1 byte (err code) | 6 unused +#define FshCmdInptSize 44 +#define FshCmdCmdSize 8 +#define FshPrgmSize 1024 + +RamVars equ 0D0EA1Fh ;saveSScreen | 21945 bytes +FshVars equ RamVars +FshCmd equ FshVars + FshVarsSize +FshPrgm equ FshCmd + FshCmdSize + +FshCmdNull equ FshCmd + FshCmdInptSize +FshCmdOP equ FshCmdNull + 1 +FshCmdArg0 equ FshCmd + 9 +FshCmdArg1 equ FshCmdArg0 + 9 +FshCmdArg2 equ FshCmdArg1 + 9 +FshCmdArg3 equ FshCmdArg2 + 9 +FshCmdArgFlags equ FshCmdArg3 + 10 +FshCmdErrCode equ FshCmdArgFlags + 1 diff --git a/includes/ti84pce.inc b/includes/static/ti84pce.inc similarity index 99% rename from includes/ti84pce.inc rename to includes/static/ti84pce.inc index 100235a..e150bc3 100644 --- a/includes/ti84pce.inc +++ b/includes/static/ti84pce.inc @@ -481,7 +481,7 @@ _ClrLCDFull equ 0020808h _ClrLCD equ 002080Ch _ClrScrnFull equ 0020810h _ClrScrn equ 0020814h -_ClrTxtShd equ 0020818h +_ClrTxtShdw equ 0020818h _ClrWindow equ 002081Ch _EraseEOL equ 0020820h _EraseEOW equ 0020824h diff --git a/includes/tables/CSC.asm b/includes/tables/CSC.asm index a39b69b..0f7d420 100644 --- a/includes/tables/CSC.asm +++ b/includes/tables/CSC.asm @@ -1,9 +1,9 @@ charMapCSC: - .DB 0, "WRMH", 0, 0 - .DB Lquestion, Ltheta, "VQLG", 0, 0 - .DB ":ZUPKFC", 0 - .DB " YTOJEB",0 - .DB 0, "XSNIDA" + .DB "\"WRMH", $FF, $FF + .DB Lquestion, Ltheta, "VQLG", $FF, $FF + .DB ":ZUPKFC", $FF + .DB " YTOJEB", $FF + .DB $FF, "XSNIDA" numsymMapCSC .DB "+-*/^", $FF, $FF diff --git a/screenshots/help.png b/screenshots/help.png new file mode 100644 index 0000000000000000000000000000000000000000..a92bd39c1214117a03e808415a171e81e57f4e0b GIT binary patch literal 3526 zcmbVPX*d*I8z!2>L`C-KO_IH4$d)BpDy8g@(_H8WFcr9g33sHk1g^;nYV=N(K zY|R*qHDa2v6@x*1-uGLstM}*k=bUpr&snZ>pXYh*`#iaCYbsu~ zhkRMoyYl=4xZK>_tSv-jq;)8Dy~-mTKW-ZFY}|5E%e(F+{G+Q--l#8Pet(C)xQPJO z4GwwrE-p%?|0&&auo$(~JC~d0hk>%B@rrnD#7ozi0kz2w8hAe|vIP}x0Gqjp{^g1| z3y3dzeW0*~1tQye+vgKMV4?iU-nVB4pLcgIWHdQ z(TgLy=}&9GR&vorH3I6{KPGaeq6~vheRvf=yoGC;i1zWldO7AD@J%B77GEYUPGK^` zU$amm#!WO(m4pI@!YLtOjcacjX*TPOq~gcAY=paoc7Dj@>zK2?qcwB*3VX z^-1>HnXch-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AltlfPEeptsb51zg9(Z1Z&9;(I3bNVw)x8@v&YChp)m(qmpbvmuO`(LP zTsSVVIxidDw#sIkv$fO;e1ljJ{W3@Qhd@$m=V#L{Z&9w`7lTLB*1U1w7~ax$7i-G= zESN|8Lr3H3Z7UglOPjZZw%4SU82L#I^ZViIHJCJ=-hTy8P8};;d6Jlc zS#pnN&D_LPO=zjL#ClSvvRpsL0NtX z(CbSOx1!Cl7TGU+3A@k7mR~5aHdD}R88eYhB2|OmB1RvQ`)6-`2}ou>m)p6$5y<14 zOwTADtcgn2csiEb=ad!9&%Tx&$(=c2XI|nP))mzMyuxbEJ9PMppn{6|?z}j;Nd}MG zghI%MB*u)9FI@53(BflEv`4PR5BX}$>W>N$pS_&7z+J-4xcq3cNPbi;oT00Y6{8?# zkI)EZ0jxhg7tIfR+=QN_ZTF#;hP0GX*1>h%lsNK!T?V7C?AI4Ubrl(2JJ~LUcsEyl zZ?0CD@?Mp#Y3cfge83RpLBd%pdX3B>z~k=f4!h>QAEJ&;&9?(^GzDigQu_BOvi>-B zGmsLUX`rH|pa)R6cm>Cy;$Hw<0@++pR^zW{7peygC0&0(>MSX@GPm084xRB>XvqjC z835P1vN+>S-Ew}(ec4K}(B;NUn0IzK=01=^WQ9SF4(kv>Dxq`94~B;N}t zj$p5rjRs8huihmvl=&IQ1?U16mvL7Z$@X<@Ncl)(J7!G~h$Arq&^ zP8XSh#Z}j*8!gfkkm}qhYkA%uPaN~&I#$_K&c`D?eVZVb8VRoFGYhn6edGCFA<~sr z)nYnUHUI^g?;Lq`F)%6>G?e3FR7j=T-+HZ+K4M(D`BVaq^gPPCSNeIWDLh}mV`!Xf z^7OEt;$TtU#SCA9)S+o{kn8To5i9gX{&UI9e=G5Sr1ZhDo5IJWm9NCcAAZbOZs{BA JmFqgh{0oJw*jxYr literal 0 HcmV?d00001 diff --git a/screenshots/man_set.png b/screenshots/man_set.png new file mode 100644 index 0000000000000000000000000000000000000000..96e02946a9e52b8faa87859adb1e5b1f4b777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