diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a00d9d2..b4d1b47f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ The following enhancements and changes have been made to Atari Dev Studio: +## 0.9.4 + +* Updated 7800basic to v0.31 (Windows, Linux, macOS) +* Updated 7800basic keyword, hover and context help lists + ## 0.9.3 * Updated serial application debug for 7800GD developers (thanks saint) diff --git a/README.md b/README.md index 09d4518e..5f9c20de 100644 --- a/README.md +++ b/README.md @@ -130,7 +130,7 @@ batari Basic created by Fred 'batari' Quimby is a BASIC-like language used in th batari Basic is an external project is kindly currently maintained by Mike Saarna (RevEng) and can be downloaded separately [here](https://github.com/batari-Basic/batari-Basic). Further information is about this release is available here at [AtariAge](https://atariage.com/forums/topic/300856-official-home-for-batari-basic). -### 7800basic (release 0.30 - 20230921) +### 7800basic (release 0.31 - 20231031) 7800basic is a BASIC-like language for creating Atari 7800 games. It is a compiled language that runs on a computer, and it creates a binary file that can be run with an Atari 7800 emulator, or the binary file may be used to make a cartridge that will operate on a real Atari 7800. 7800basic is derived from batari basic, a BASIC-like language for creating Atari 2600 games. Special thanks to the bB creator, Fred Quimby, and all of the the bB contributors! 7800basic is included as part of this extension with many thanks to Mike Saarna (RevEng). 7800basic is an external project and can be downloaded separately [here](https://github.com/7800-devtools/7800basic). Further information about this release is available here at [AtariAge](http://atariage.com/forums/topic/222638-7800basic-beta-the-release-thread). diff --git a/hovers/7800basic.md b/hovers/7800basic.md index 122eb39f..bef3b75b 100644 --- a/hovers/7800basic.md +++ b/hovers/7800basic.md @@ -213,6 +213,15 @@ state - on, off + +## PAUSESILENCE + + set pausesilence state + + state - on, off + + + ## POKEYSOUND set pokeysound state @@ -477,6 +486,25 @@ incbin filename.xxx + filename.xxx - file name of the asset to include + + + +## DECOMPRESS + + decompress filename $#### + + filename.xxx - file name of the asset to decompress + $#### - address of dump ie. $4000 + + + +## INCCOMPRESS + + inccompress filename.xxx + + filename.xxx - file name of the asset to compress + ## NEWBLOCK @@ -498,6 +526,19 @@ +## PLOTSPRITE4 + + plotsprite4 sprite_graphic palette_# x y [frame] [tallheight] + + sprite_graphic - name of the included graphic + palette_# - index of palette (0-7) + x - x screen co-ordinate + y - y screen co-ordinate + frame (optional) - index of the frame to display + tallheight (optional) - number of zones each tallsprite occupies + + + ## PLOTBANNER plotbanner banner_graphic palette_# x y @@ -1349,14 +1390,3 @@ of the backup file directory_path - relative path to files to be included on backup - -## PLOTSPRITE4 - - plotsprite4 sprite_graphic palette_# x y - - sprite_graphic - name of the included graphic - palette_# - index of palette (0-7) - x - x screen co-ordinate - y - y screen co-ordinate - - diff --git a/out/application.js b/out/application.js index 4d63ae1c..0afae3dd 100644 --- a/out/application.js +++ b/out/application.js @@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }); }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.IsNumber = exports.Delay = exports.ShowStartupMessagesAsync = exports.GetConfiguration = exports.ShowErrorPopup = exports.ShowInformationPopup = exports.ShowWarningPopup = exports.WriteToCompilerTerminal = exports.OpenContextHelp = exports.KillBuildGame = exports.BuildGameAndRunAsync = exports.BuildGameAsync = exports.RegisterContextHelpsAsync = exports.ContextHelps = exports.RegisterReferenceProvidersAsync = exports.ReferenceProviders = exports.RegisterDefinitionProvidersAsync = exports.DefinitionProviders = exports.RegisterDocumentSymbolProvidersAsync = exports.DocumentSymbolProviders = exports.RegisterFoldingProvidersAsync = exports.Foldings = exports.RegisterCompletionProvidersAsync = exports.Completions = exports.RegisterHoverProvidersAsync = exports.Hovers = exports.Serials = exports.Emulators = exports.Compilers = exports.InitialiseAdsTerminalAsync = exports.AdsTerminal = exports.CompilerOutputChannel = exports.ChangeLogUri = exports.PreferencesSettingsExtensionPath = exports.Description = exports.DisplayName = exports.Version = exports.Publisher = exports.Name = exports.Path = exports.Id = exports.Is64Bit = exports.Is32Bit = exports.IsMacOS = exports.IsLinux = exports.IsWindows = exports.OSArch = exports.OSPlatform = void 0; +exports.IsNumber = exports.Delay = exports.ShowStartupMessagesAsync = exports.GetConfiguration = exports.ShowErrorPopup = exports.ShowInformationPopup = exports.ShowWarningPopup = exports.WriteToCompilerTerminal = exports.OpenContextHelp = exports.KillBuildGame = exports.BuildGameAndRunAsync = exports.BuildGameAsync = exports.RegisterContextHelpsAsync = exports.ContextHelps = exports.RegisterReferenceProvidersAsync = exports.ReferenceProviders = exports.RegisterDefinitionProvidersAsync = exports.DefinitionProviders = exports.RegisterDocumentSymbolProvidersAsync = exports.DocumentSymbolProviders = exports.RegisterFoldingProvidersAsync = exports.Foldings = exports.RegisterCompletionProvidersAsync = exports.Completions = exports.RegisterHoverProvidersAsync = exports.Hovers = exports.Serials = exports.Emulators = exports.Compilers = exports.InitialiseAdsTerminalAsync = exports.AdsTerminal = exports.CompilerOutputChannel = exports.ChangeLogUri = exports.PreferencesSettingsExtensionPath = exports.Description = exports.DisplayName = exports.Version = exports.Publisher = exports.Name = exports.Path = exports.Id = exports.IsMacOSArm = exports.Is64Bit = exports.Is32Bit = exports.IsMacOS = exports.IsLinux = exports.IsWindows = exports.OSArch = exports.OSPlatform = void 0; const vscode = require("vscode"); const filesystem = require("./filesystem"); const os = require("os"); @@ -49,6 +49,7 @@ exports.IsLinux = (os.platform() === 'linux'); exports.IsMacOS = (os.platform() === 'darwin'); exports.Is32Bit = (os.arch() === 'x32'); exports.Is64Bit = (os.arch() === 'x64'); +exports.IsMacOSArm = (os.platform() === 'darwin' && os.arch() === 'arm64'); // ------------------------------------------------------------------------------------- // Extension // ------------------------------------------------------------------------------------- diff --git a/out/application.js.map b/out/application.js.map index c62e2921..8c0b22cf 100644 --- a/out/application.js.map +++ b/out/application.js.map @@ -1 +1 @@ -{"version":3,"file":"application.js","sourceRoot":"","sources":["../src/application.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;;;;;AACb,iCAAiC;AACjC,2CAA2C;AAC3C,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,C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B;QACxB,aAAa,CAAC,MAAM,CAAC,yCAAyC,EAAE,eAAO,EAAE,MAAM,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC;QAE5G,UAAU;QACV,IAAI,aAAa,GAAG,qCAAqC,CAAC;QAC1D,IAAI,qBAAqB,GAAG,kCAAkC,CAAC;QAE/D,cAAc;QACd,MAAM,MAAM,CAAC,MAAM,CAAC,sBAAsB,CAAC,iCAAiC,mBAAW,EAAE,EACvF,aAAa,EAAC,qBAAqB,CAAC;aACnC,IAAI,CAAC,SAAS,CAAC,EAAE;YACjB,IAAI,SAAS,KAAK,SAAS,EAAE;gBAC5B,YAAY;aACZ;iBACI,IAAI,SAAS,KAAK,aAAa,EAAE;gBACrC,iBAAiB;gBACjB,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC,oBAAY,CAAC,CAAC;aACtC;iBACI,IAAI,SAAS,GAAG,qBAAqB,EAAE;gBAC3C,UAAU;gBACV,aAAa,CAAC,MAAM,CAAC,iDAAiD,EAAE,KAAK,EAAE,MAAM,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC;aAClH;QACF,CAAC,CAAC,CAAC;IACN,CAAC;CAAA;AAlCD,4DAkCC;AAED,SAAgB,KAAK,CAAC,EAAU;IAC/B,OAAO,IAAI,OAAO,CAAE,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAE,CAAC;AAC1D,CAAC;AAFD,sBAEC;AAED,SAAgB,QAAQ,CAAC,MAAc;IACtC,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAA;AACrD,CAAC;AAFD,4BAEC"} \ No newline at end of file +{"version":3,"file":"application.js","sourceRoot":"","sources":["../src/application.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;;;;;AACb,iCAAiC;AACjC,2CAA2C;AAC3C,MAAM,EAAE,GAAG,OAAO,CAAC,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800bas.bat b/out/bin/compilers/7800basic/7800bas.bat index 4d360961..f13a3a5a 100644 --- a/out/bin/compilers/7800basic/7800bas.bat +++ b/out/bin/compilers/7800basic/7800bas.bat @@ -1,8 +1,11 @@ @echo off if X"%bas7800dir%" == X goto nobasic :tryanyway -7800preprocess <"%~f1" | 7800basic.exe -i "%bas7800dir%" -b "%1" +rem 7800preprocess <"%~f1" | 7800basic.exe -i "%bas7800dir%" -b "%1" +7800preprocess.exe <"%~f1" >"%~f1.pre" +7800basic.exe -i "%bas7800dir%" -b "%1" -p "%1.pre" if errorlevel 1 goto basicerror +del "%1.pre" if X%2 == X-O goto optimize 7800postprocess -i "%bas7800dir%" > "%~f1.asm" goto nooptimize @@ -19,6 +22,7 @@ dasm "%~f1.asm" -I"%bas7800dir%"/includes -f3 -p20 -l"%~f1.list.txt" -o"%~f1.bin 7800sign -w "%~f1.bin" if not exist banksetrom.asm goto nobankset2 copy /b "%~f1.bin"+"banksetrom.bin" "%~f1.bin" + del banksetrom.asm banksetrom.bin :nobankset2 7800header -o -f a78info.cfg "%~f1.bin" 7800makecc2 "%~f1.bin" diff --git a/out/bin/compilers/7800basic/7800bas.c b/out/bin/compilers/7800basic/7800bas.c index 9050dc3a..cdc857b8 100644 --- a/out/bin/compilers/7800basic/7800bas.c +++ b/out/bin/compilers/7800basic/7800bas.c @@ -11,10 +11,13 @@ char stdoutfilename[256]; char backupname[256]; FILE *stdoutfilepointer; +FILE *preprocessedfd = NULL; +extern int currentbank; extern int currentdmahole; extern int numredefvars; extern int numconstants; +extern char constants[MAXCONSTANTS][100]; extern char incbasepath[500]; extern char redefined_variables[80000][100]; extern char bannerfilenames[1000][100]; @@ -22,16 +25,48 @@ extern char palettefilenames[1000][100]; extern char currentcharset[256]; extern int graphicsdatawidth[16]; extern char charactersetchars[257]; - -#define BASIC_VERSION_INFO "7800basic v0.30" +extern int passes; +extern int line; +extern int dmaplain; +extern int templabel; +extern int tallspritecount; +extern int fourbitfade_alreadyused; +extern int zonelocking; +extern int multtableindex; +extern int numfixpoint44; +extern int numfixpoint88; +extern int numjsrs; +extern int doingfunction; +extern int branchtargetnumber; +extern int banksetrom; +extern FILE *stderrfilepointer; +extern int condpart; +extern int ongosub; +extern int includesfile_already_done; +extern int fourbitfade_alreadyused; +extern int numfors; +extern int ors; +extern int numelses; +extern int numthens; +extern int extra; +extern int extralabel; +extern int dumpgraphics; +extern int doublebufferused; +extern int boxcollisionused; +extern int romsize_already_set; +extern int firstfourbyte; +extern int firstcompress; +extern int dumpgraphics_index; +int maxpasses = 2; + +#define BASIC_VERSION_INFO "7800basic v0.31" int main (int argc, char *argv[]) { char **statement; char **deallocate_mem; int i, j, k; - int unnamed = 0; - int defcount = 0; + int unnamed, defcount, defi; char *c; char single; char code[500]; @@ -40,17 +75,19 @@ int main (int argc, char *argv[]) int multiplespace = 0; char *includes_file = "default.inc"; char *filename = "7800basic_variable_redefs.h"; + char *prefilename = NULL; char *path = 0; char def[250][100]; char defr[250][100]; char finalcode[500]; char *codeadd; char mycode[500]; - int defi = 0; path = NULL; - backupname[0]=0; + backupname[0] = 0; + maxpasses = 2; + // get command line arguments - while ((i = getopt (argc, argv, "i:b:r:v")) != -1) + while ((i = getopt (argc, argv, "i:b:r:p:v")) != -1) { switch (i) { @@ -58,11 +95,14 @@ int main (int argc, char *argv[]) path = optarg; break; case 'b': - strncpy(backupname,optarg,256); + strncpy (backupname, optarg, 256); break; case 'r': filename = optarg; break; + case 'p': + prefilename = optarg; + break; case 'v': printf ("%s (%s, %s)\n", BASIC_VERSION_INFO, __TIME__, __DATE__); exit (0); @@ -72,224 +112,300 @@ int main (int argc, char *argv[]) } } - // global variable init... - strcpy (redefined_variables[numredefvars++], "collisionwrap = 1"); - incbasepath[0] = 0; - bannerfilenames[0][0] = 0; - palettefilenames[0][0] = 0; - currentcharset[0] = 0; - - for (i = 0; i < 16; i++) - graphicsdatawidth[i] = 0; - - strcpy (charactersetchars, " abcdefghijklmnopqrstuvwxyz.!?,\"$():"); - - fprintf (stderr, "%s %s %s\n", BASIC_VERSION_INFO, __DATE__, __TIME__); - - // redirect STDOUT to 7800.asm, overwriting if it exists... - strcpy (stdoutfilename, "7800.asm"); - if ((stdoutfilepointer = freopen (stdoutfilename, "w", stdout)) == NULL) + if (prefilename == NULL) { - prerror ("couldn't create the 7800.asm file."); + // we were called without the "-p" switch, so revert to the historic + // single-pass behavior, since the basic source is coming from stdin, + // and we can't rewind stdin. + maxpasses=1; + preprocessedfd = stdin; } - - printf (" ;%s %s %s\n", BASIC_VERSION_INFO, __DATE__, __TIME__); - - printf ("SPACEOVERFLOW SET 0\n"); - printf (" ifnconst SPACEOVERFLOWPASS\n"); - printf ("SPACEOVERFLOWPASS SET 0\n"); - printf (" endif SPACEOVERFLOWPASS\n"); - - // these asm files are produced dynamically, so as to allow out-of-order - // assembly with dasm. Their mere presence will affect the compile process - // so we start off by wiping them, if they exist from a previous compile. - remove ("7800hole.0.asm"); - remove ("7800hole.1.asm"); - remove ("7800hole.2.asm"); - remove ("banksetrom.asm"); - remove ("banksetstrings.asm"); - - char removefile[256]; - int t; - for (t = 0; t < 100; t++) + else { - sprintf (removefile, "dump_gfx_%02d.bin", t); - if (remove (removefile)) - break; - sprintf (removefile, "dump_gfx_%02d.asm", t); - remove (removefile); + preprocessedfd=fopen(prefilename,"rb"); + if (preprocessedfd == NULL) + { + fprintf (stderr, "unable to open preprocessed basic file: %s\n",prefilename); + exit (2); + } } + + // this is the info we're trying to extract from the first pass, + // so we initialize it prior to the pass loop + bannerfilenames[0][0] = 0; // incbanner reverse lookup + palettefilenames[0][0] = 0; // incbanner reverse lookup + tallspritecount = 0; + memset(constants,0,MAXCONSTANTS*CONSTANTLEN); + + for(passes=0;passes 250) + codeadd = NULL; + finalcode[0] = '\0'; + defcount = 0; + while (1) { - fprintf (stderr, - "(%d) Infinitely repeating definition or too many instances of a definition\n", - bbgetline ()); - exit (1); + if (defcount++ > 250) + { + fprintf (stderr, + "(%d) Infinitely repeating definition or too many instances of a definition\n", + bbgetline ()); + exit (1); + } + codeadd = strstr (mycode, def[i]); + if (codeadd == NULL) + break; + for (j = 0; j < 500; ++j) + finalcode[j] = '\0'; + strncpy (finalcode, mycode, 500); + finalcode[(strlen (mycode) - strlen (codeadd))] = 0; + strcat (finalcode, defr[i]); + strcat (finalcode, codeadd + strlen (def[i])); + strcpy (mycode, finalcode); } - codeadd = strstr (mycode, def[i]); - if (codeadd == NULL) - break; - for (j = 0; j < 500; ++j) - finalcode[j] = '\0'; - strncpy (finalcode, mycode, 500); - finalcode[(strlen (mycode) - strlen (codeadd))]=0; - strcat (finalcode, defr[i]); - strcat (finalcode, codeadd + strlen (def[i])); - strcpy (mycode, finalcode); } } - } - if (strcmp (mycode, code)) - strcpy (code, mycode); - if (!c) - break; //end of file + if (strcmp (mycode, code)) + strcpy (code, mycode); + if (!c) + break; //end of file - // preprocessing removed in favor of a simplistic lex-based preprocessor + // preprocessing removed in favor of a simplistic lex-based preprocessor - i = 0; - j = 0; - k = 0; + i = 0; + j = 0; + k = 0; - // look for spaces, reject multiples - while (code[i] != '\0') - { - single = code[i++]; - if (single == ' ') + // look for spaces, reject multiples + while (code[i] != '\0') { - if (!multiplespace) + single = code[i++]; + if (single == ' ') + { + if (!multiplespace) + { + j++; + k = 0; + } + multiplespace++; + } + else { - j++; - k = 0; + multiplespace = 0; + if (k < (SIZEOFSTATEMENT - 1)) // avoid overrun when users use REM with long horizontal separators + statement[j][k++] = single; } - multiplespace++; + } - else + if (j > 150) + { + fprintf (stderr, "(%d) Warning: long line\n", bbgetline ()); + } + if (statement[0][0] == '\0') { - multiplespace = 0; - if (k < (SIZEOFSTATEMENT-1)) // avoid overrun when users use REM with long horizontal separators - statement[j][k++] = single; + sprintf (statement[0], "L0%d", unnamed++); } + if (strncmp (statement[0], "end\0", 3)) + printf (".%s ;; %s\n", statement[0], displaycode); // printf(".%s ; %s\n",statement[0],code); + else + doend (); + keywords (statement); + if (numconstants == (MAXCONSTANTS - 1)) + { + fprintf (stderr, "(%d) Maximum number of constants exceeded.\n", bbgetline ()); + exit (1); + } } - if (j > 150) - { - fprintf (stderr, "(%d) Warning: long line\n", bbgetline ()); - } - if (statement[0][0] == '\0') - { - sprintf (statement[0], "L0%d", unnamed++); - } - if (strncmp (statement[0], "end\0", 3)) - printf (".%s ;; %s\n", statement[0], displaycode); // printf(".%s ; %s\n",statement[0],code); - else - doend (); - keywords (statement); - if (numconstants == (MAXCONSTANTS - 1)) - { - fprintf (stderr, "(%d) Maximum number of constants exceeded.\n", bbgetline ()); - exit (1); - } - } - printf ("DMAHOLEEND%d SET .\n", currentdmahole); + printf ("DMAHOLEEND%d SET .\n", currentdmahole); - //if stdout is redirected, change it back to 7800.asm so the gameend label goes in the right spot... - if (strcmp (stdoutfilename, "7800.asm") != 0) - { - strcpy (stdoutfilename, "7800.asm"); - if ((stdoutfilepointer = freopen (stdoutfilename, "a", stdout)) == NULL) + //if stdout is redirected, change it back to 7800.asm so the gameend label goes in the right spot... + if (strcmp (stdoutfilename, "7800.asm") != 0) { - prerror ("couldn't reopen the 7800.asm file."); + strcpy (stdoutfilename, "7800.asm"); + if ((stdoutfilepointer = freopen (stdoutfilename, "a", stdout)) == NULL) + { + prerror ("couldn't reopen the 7800.asm file."); + } } - } - - printf ("gameend\n"); - barf_graphic_file (); + printf ("gameend\n"); - barfmultiplicationtables (); + barf_graphic_file (); + barfmultiplicationtables (); - printf (" if SPACEOVERFLOW > 0\n"); - printf (" echo \"\"\n"); - printf (" echo \"######## ERROR: space overflow detected in\",[SPACEOVERFLOW]d,\"areas.\"\n"); - printf (" echo \"######## look above for areas with negative ROM space left.\"\n"); - printf (" echo \"######## Aborting assembly.\"\n"); - printf ("SET SPACEOVERFLOWPASS = (SPACEOVERFLOWPASS + 1)\n"); - printf (" if SPACEOVERFLOWPASS > 0\n"); - printf (" ERR\n"); - printf (" endif\n"); - printf (" endif\n"); + printf (" if SPACEOVERFLOW > 0\n"); + printf (" echo \"\"\n"); + printf (" echo \"######## ERROR: space overflow detected in\",[SPACEOVERFLOW]d,\"areas.\"\n"); + printf (" echo \"######## look above for areas with negative ROM space left.\"\n"); + printf (" echo \"######## Aborting assembly.\"\n"); + printf ("SET SPACEOVERFLOWPASS = (SPACEOVERFLOWPASS + 1)\n"); + printf (" if SPACEOVERFLOWPASS > 0\n"); + printf (" ERR\n"); + printf (" endif\n"); + printf (" endif\n"); - printf (" \n\n"); + printf (" \n\n"); + prout ("7800basic compilation complete.\n"); + freemem (deallocate_mem); + } header_write (header, filename); create_includes (includes_file); - fprintf (stderr, "7800basic compilation complete.\n"); - freemem (deallocate_mem); - lastrites(); + + lastrites (); + return 0; } diff --git a/out/bin/compilers/7800basic/7800basic Guide.pdf b/out/bin/compilers/7800basic/7800basic Guide.pdf index cec3064e..5a88d18b 100644 Binary files a/out/bin/compilers/7800basic/7800basic Guide.pdf and b/out/bin/compilers/7800basic/7800basic Guide.pdf differ diff --git a/out/bin/compilers/7800basic/7800basic.Darwin.x64 b/out/bin/compilers/7800basic/7800basic.Darwin.x64 index 82ad2503..42dc4be0 100644 Binary files a/out/bin/compilers/7800basic/7800basic.Darwin.x64 and b/out/bin/compilers/7800basic/7800basic.Darwin.x64 differ diff --git a/out/bin/compilers/7800basic/7800basic.Darwin.x86 b/out/bin/compilers/7800basic/7800basic.Darwin.x86 index ee5654dc..b15a98de 100644 Binary files a/out/bin/compilers/7800basic/7800basic.Darwin.x86 and b/out/bin/compilers/7800basic/7800basic.Darwin.x86 differ diff --git a/out/bin/compilers/7800basic/7800basic.Linux.x64 b/out/bin/compilers/7800basic/7800basic.Linux.x64 index a68aaa0c..87ed71a6 100644 Binary files a/out/bin/compilers/7800basic/7800basic.Linux.x64 and b/out/bin/compilers/7800basic/7800basic.Linux.x64 differ diff --git a/out/bin/compilers/7800basic/7800basic.Linux.x86 b/out/bin/compilers/7800basic/7800basic.Linux.x86 index eb73150b..b30d5f55 100644 Binary files a/out/bin/compilers/7800basic/7800basic.Linux.x86 and b/out/bin/compilers/7800basic/7800basic.Linux.x86 differ diff --git a/out/bin/compilers/7800basic/7800basic.Windows.x64.exe b/out/bin/compilers/7800basic/7800basic.Windows.x64.exe index deef862d..52165ba6 100644 Binary files a/out/bin/compilers/7800basic/7800basic.Windows.x64.exe and b/out/bin/compilers/7800basic/7800basic.Windows.x64.exe differ diff --git a/out/bin/compilers/7800basic/7800basic.exe b/out/bin/compilers/7800basic/7800basic.exe index a6ee47e7..f12f08e3 100644 Binary files a/out/bin/compilers/7800basic/7800basic.exe and b/out/bin/compilers/7800basic/7800basic.exe differ diff --git a/out/bin/compilers/7800basic/7800basic.sh b/out/bin/compilers/7800basic/7800basic.sh index a9aa6807..4b28a268 100755 --- a/out/bin/compilers/7800basic/7800basic.sh +++ b/out/bin/compilers/7800basic/7800basic.sh @@ -52,14 +52,16 @@ fi echo echo "Starting build of $1" - #7800preprocess$EXT<"$1" | valgrind --tool=memcheck --leak-check=yes 7800basic$EXT -i "$bas7800dir" -b "$1" - 7800preprocess$EXT<"$1" | 7800basic$EXT -i "$bas7800dir" -b "$1" + 7800preprocess$EXT <"$1" >"$1.pre" + #valgrind --tool=memcheck --leak-check=yes 7800basic$EXT -i "$bas7800dir" -b "$1" -p "$1.pre" + 7800basic$EXT -i "$bas7800dir" -b "$1" -p "$1.pre" if [ "$?" -ne "0" ] then echo "Compilation failed." exit fi + rm -f "$1.pre" if [ "$2" = "-O" ] then 7800postprocess$EXT -i "$bas7800dir" | 7800optimize$EXT > "$1.asm" @@ -78,7 +80,9 @@ dasm$DASMEXT $1.asm -I"$bas7800dir/includes" -f3 -l"$1.list.txt" -p20 -s"$1.symb if [ -r banksetrom.asm ] ; then cat "banksetrom.bin" >> "$1.bin" + rm -f banksetrom.bin banksetrom.asm fi + 7800header$EXT -o -f a78info.cfg "$1.bin" 7800makecc2$EXT "$1.bin" diff --git a/out/bin/compilers/7800basic/7800filter.Windows.x64.exe b/out/bin/compilers/7800basic/7800filter.Windows.x64.exe index 3e8c7cb2..59dd8937 100644 Binary files a/out/bin/compilers/7800basic/7800filter.Windows.x64.exe and b/out/bin/compilers/7800basic/7800filter.Windows.x64.exe differ diff --git a/out/bin/compilers/7800basic/7800filter.exe b/out/bin/compilers/7800basic/7800filter.exe index 8b10e563..bd72c38b 100644 Binary files a/out/bin/compilers/7800basic/7800filter.exe and b/out/bin/compilers/7800basic/7800filter.exe differ diff --git a/out/bin/compilers/7800basic/7800header.Darwin.x64 b/out/bin/compilers/7800basic/7800header.Darwin.x64 index 24aa5b39..e06fd1c1 100644 Binary files a/out/bin/compilers/7800basic/7800header.Darwin.x64 and b/out/bin/compilers/7800basic/7800header.Darwin.x64 differ diff --git a/out/bin/compilers/7800basic/7800header.Darwin.x86 b/out/bin/compilers/7800basic/7800header.Darwin.x86 index 9e3667dd..28ff4b9f 100644 Binary files a/out/bin/compilers/7800basic/7800header.Darwin.x86 and b/out/bin/compilers/7800basic/7800header.Darwin.x86 differ diff --git a/out/bin/compilers/7800basic/7800header.Linux.x64 b/out/bin/compilers/7800basic/7800header.Linux.x64 index 84623c4c..06e9bc70 100644 Binary files a/out/bin/compilers/7800basic/7800header.Linux.x64 and b/out/bin/compilers/7800basic/7800header.Linux.x64 differ diff --git a/out/bin/compilers/7800basic/7800header.Linux.x86 b/out/bin/compilers/7800basic/7800header.Linux.x86 index 816f377a..8e70d057 100644 Binary files a/out/bin/compilers/7800basic/7800header.Linux.x86 and b/out/bin/compilers/7800basic/7800header.Linux.x86 differ diff --git a/out/bin/compilers/7800basic/7800header.Windows.x64.exe b/out/bin/compilers/7800basic/7800header.Windows.x64.exe index f01177bc..d52c773a 100644 Binary files a/out/bin/compilers/7800basic/7800header.Windows.x64.exe and b/out/bin/compilers/7800basic/7800header.Windows.x64.exe differ diff --git a/out/bin/compilers/7800basic/7800header.exe b/out/bin/compilers/7800basic/7800header.exe index fe6aa133..999c8071 100644 Binary files a/out/bin/compilers/7800basic/7800header.exe and b/out/bin/compilers/7800basic/7800header.exe differ diff --git a/out/bin/compilers/7800basic/7800makecc2.Windows.x64.exe b/out/bin/compilers/7800basic/7800makecc2.Windows.x64.exe index f26d68b7..b95a6951 100644 Binary files a/out/bin/compilers/7800basic/7800makecc2.Windows.x64.exe and b/out/bin/compilers/7800basic/7800makecc2.Windows.x64.exe differ diff --git a/out/bin/compilers/7800basic/7800makecc2.exe b/out/bin/compilers/7800basic/7800makecc2.exe index b21a2ad4..1f77b302 100644 Binary files a/out/bin/compilers/7800basic/7800makecc2.exe and b/out/bin/compilers/7800basic/7800makecc2.exe differ diff --git a/out/bin/compilers/7800basic/7800optimize.Windows.x64.exe b/out/bin/compilers/7800basic/7800optimize.Windows.x64.exe index cf91a6ac..759039da 100644 Binary files a/out/bin/compilers/7800basic/7800optimize.Windows.x64.exe and b/out/bin/compilers/7800basic/7800optimize.Windows.x64.exe differ diff --git a/out/bin/compilers/7800basic/7800optimize.exe b/out/bin/compilers/7800basic/7800optimize.exe index 4e4551fa..0ab2e63e 100644 Binary files a/out/bin/compilers/7800basic/7800optimize.exe and b/out/bin/compilers/7800basic/7800optimize.exe differ diff --git a/out/bin/compilers/7800basic/7800postprocess.Windows.x64.exe b/out/bin/compilers/7800basic/7800postprocess.Windows.x64.exe index a25f3f1e..0c1306d1 100644 Binary files a/out/bin/compilers/7800basic/7800postprocess.Windows.x64.exe and b/out/bin/compilers/7800basic/7800postprocess.Windows.x64.exe differ diff --git a/out/bin/compilers/7800basic/7800postprocess.exe b/out/bin/compilers/7800basic/7800postprocess.exe index 95318af1..b94ed2d5 100644 Binary files a/out/bin/compilers/7800basic/7800postprocess.exe and b/out/bin/compilers/7800basic/7800postprocess.exe differ diff --git a/out/bin/compilers/7800basic/7800preprocess.Windows.x64.exe b/out/bin/compilers/7800basic/7800preprocess.Windows.x64.exe index 67534afd..c2e2cecd 100644 Binary files a/out/bin/compilers/7800basic/7800preprocess.Windows.x64.exe and b/out/bin/compilers/7800basic/7800preprocess.Windows.x64.exe differ diff --git a/out/bin/compilers/7800basic/7800preprocess.exe b/out/bin/compilers/7800basic/7800preprocess.exe index e9a703ff..4edf9864 100644 Binary files a/out/bin/compilers/7800basic/7800preprocess.exe and b/out/bin/compilers/7800basic/7800preprocess.exe differ diff --git a/out/bin/compilers/7800basic/7800rmt2asm.Darwin.x64 b/out/bin/compilers/7800basic/7800rmt2asm.Darwin.x64 index 1f51f81b..78c50fc6 100644 Binary files a/out/bin/compilers/7800basic/7800rmt2asm.Darwin.x64 and b/out/bin/compilers/7800basic/7800rmt2asm.Darwin.x64 differ diff --git a/out/bin/compilers/7800basic/7800rmt2asm.Darwin.x86 b/out/bin/compilers/7800basic/7800rmt2asm.Darwin.x86 index 1bbae470..f57637fd 100644 Binary files a/out/bin/compilers/7800basic/7800rmt2asm.Darwin.x86 and b/out/bin/compilers/7800basic/7800rmt2asm.Darwin.x86 differ diff --git a/out/bin/compilers/7800basic/7800rmt2asm.Linux.x64 b/out/bin/compilers/7800basic/7800rmt2asm.Linux.x64 index a3eba15b..381c1825 100644 Binary files a/out/bin/compilers/7800basic/7800rmt2asm.Linux.x64 and b/out/bin/compilers/7800basic/7800rmt2asm.Linux.x64 differ diff --git a/out/bin/compilers/7800basic/7800rmt2asm.Linux.x86 b/out/bin/compilers/7800basic/7800rmt2asm.Linux.x86 index 6a745a75..fede7d54 100644 Binary files a/out/bin/compilers/7800basic/7800rmt2asm.Linux.x86 and b/out/bin/compilers/7800basic/7800rmt2asm.Linux.x86 differ diff --git a/out/bin/compilers/7800basic/7800rmt2asm.Windows.x64.exe b/out/bin/compilers/7800basic/7800rmt2asm.Windows.x64.exe index 886975a1..101bbd74 100644 Binary files a/out/bin/compilers/7800basic/7800rmt2asm.Windows.x64.exe and b/out/bin/compilers/7800basic/7800rmt2asm.Windows.x64.exe differ diff --git a/out/bin/compilers/7800basic/7800rmt2asm.exe b/out/bin/compilers/7800basic/7800rmt2asm.exe index 5c892db7..85e41f9e 100644 Binary files a/out/bin/compilers/7800basic/7800rmt2asm.exe and b/out/bin/compilers/7800basic/7800rmt2asm.exe differ diff --git a/out/bin/compilers/7800basic/7800rmtfix.Darwin.x64 b/out/bin/compilers/7800basic/7800rmtfix.Darwin.x64 index 7e67d7f6..62fe0ff4 100644 Binary files a/out/bin/compilers/7800basic/7800rmtfix.Darwin.x64 and b/out/bin/compilers/7800basic/7800rmtfix.Darwin.x64 differ diff --git a/out/bin/compilers/7800basic/7800rmtfix.Darwin.x86 b/out/bin/compilers/7800basic/7800rmtfix.Darwin.x86 index 47431420..15fee56e 100644 Binary files a/out/bin/compilers/7800basic/7800rmtfix.Darwin.x86 and b/out/bin/compilers/7800basic/7800rmtfix.Darwin.x86 differ diff --git a/out/bin/compilers/7800basic/7800rmtfix.Linux.x64 b/out/bin/compilers/7800basic/7800rmtfix.Linux.x64 index 0b6ecf4d..b2e26217 100644 Binary files a/out/bin/compilers/7800basic/7800rmtfix.Linux.x64 and b/out/bin/compilers/7800basic/7800rmtfix.Linux.x64 differ diff --git a/out/bin/compilers/7800basic/7800rmtfix.Linux.x86 b/out/bin/compilers/7800basic/7800rmtfix.Linux.x86 index 42978d28..b271a583 100644 Binary files a/out/bin/compilers/7800basic/7800rmtfix.Linux.x86 and b/out/bin/compilers/7800basic/7800rmtfix.Linux.x86 differ diff --git a/out/bin/compilers/7800basic/7800rmtfix.Windows.x64.exe b/out/bin/compilers/7800basic/7800rmtfix.Windows.x64.exe index 7629e400..5e5c6716 100644 Binary files a/out/bin/compilers/7800basic/7800rmtfix.Windows.x64.exe and b/out/bin/compilers/7800basic/7800rmtfix.Windows.x64.exe differ diff --git a/out/bin/compilers/7800basic/7800rmtfix.exe b/out/bin/compilers/7800basic/7800rmtfix.exe index c982f652..d9e85c10 100644 Binary files a/out/bin/compilers/7800basic/7800rmtfix.exe and b/out/bin/compilers/7800basic/7800rmtfix.exe differ diff --git a/out/bin/compilers/7800basic/7800sign.Windows.x64.exe b/out/bin/compilers/7800basic/7800sign.Windows.x64.exe index 11d0ea3c..980233aa 100644 Binary files a/out/bin/compilers/7800basic/7800sign.Windows.x64.exe and b/out/bin/compilers/7800basic/7800sign.Windows.x64.exe differ diff --git a/out/bin/compilers/7800basic/7800sign.exe b/out/bin/compilers/7800basic/7800sign.exe index 00a73a4b..e8f50200 100644 Binary files a/out/bin/compilers/7800basic/7800sign.exe and b/out/bin/compilers/7800basic/7800sign.exe differ diff --git a/out/bin/compilers/7800basic/LICENSE.txt b/out/bin/compilers/7800basic/LICENSE.txt index 8bb82601..683ca43b 100644 --- a/out/bin/compilers/7800basic/LICENSE.txt +++ b/out/bin/compilers/7800basic/LICENSE.txt @@ -5,8 +5,8 @@ Included 6502 assembly code, and auto-generated 6502 assembly code, are both licensed under the public domain style CC0 license. - Binary files generated by running 7800basic against your own batari - Basic source files are owned by you, and may be licensed however you wish. + Binary files generated by running 7800basic against your own BASIC + source files are owned by you, and may be licensed however you wish. Other Included Software_ @@ -18,6 +18,11 @@ Other Included Software_ 7800 "contrib" directory. These have been linked against the 7800basic binaries, as their license terms are compatible with the GPL v2. + 7800basic uses LZSA as its compression format. The LZSA code is available + under the Zlib license. The match finder (matchfinder.c) is available + under the CC0 license due to using portions of code from Eric Bigger's + Wimlib in the suffix array-based matchfinder. + Licenses_ The GPL v2 license, LGPL v2 license, and CC0 license texts follow. diff --git a/out/bin/compilers/7800basic/README.txt b/out/bin/compilers/7800basic/README.txt index 9e4d2050..6160634a 100644 --- a/out/bin/compilers/7800basic/README.txt +++ b/out/bin/compilers/7800basic/README.txt @@ -11,6 +11,7 @@ Legal Stuff -Bruce Tomlin (sign7800) -the zlib/libpng team -the dasm team + -Emmanuel Marty (lzsa compression) See the LICENSE.txt file for details on licensing. diff --git a/out/bin/compilers/7800basic/TODO.txt b/out/bin/compilers/7800basic/TODO.txt index 68b4c556..afeef4e4 100644 --- a/out/bin/compilers/7800basic/TODO.txt +++ b/out/bin/compilers/7800basic/TODO.txt @@ -1,6 +1,5 @@ -bug - banners larger than 128 in 160B don't plot correctly. -data with trailing comment and comma's don't get the trailing comma stripped --fix tallsprite so it's DASM constants holding state, rather than C globals -horizontal scrolling -vertical scrolling diff --git a/out/bin/compilers/7800basic/banksetsymbols.Windows.x64.exe b/out/bin/compilers/7800basic/banksetsymbols.Windows.x64.exe index 8724fc22..3e4b0d97 100644 Binary files a/out/bin/compilers/7800basic/banksetsymbols.Windows.x64.exe and b/out/bin/compilers/7800basic/banksetsymbols.Windows.x64.exe differ diff --git a/out/bin/compilers/7800basic/banksetsymbols.exe b/out/bin/compilers/7800basic/banksetsymbols.exe index f8791a35..09e4e7d6 100644 Binary files a/out/bin/compilers/7800basic/banksetsymbols.exe and b/out/bin/compilers/7800basic/banksetsymbols.exe differ diff --git a/out/bin/compilers/7800basic/includes/7800basic.h b/out/bin/compilers/7800basic/includes/7800basic.h index 5e06a629..f8ebc9ac 100644 --- a/out/bin/compilers/7800basic/includes/7800basic.h +++ b/out/bin/compilers/7800basic/includes/7800basic.h @@ -122,8 +122,8 @@ pokey4pointlo = $61 pokey4pointhi = $62 dlpnt = $63 ; to $64 -dlend = $65 ; to $81 - for 28 possible visible dll entries -dlendsave = $82 ; to $9e - for 28 possible visible dll entries +dlend = $65 ; to $81 - for 29 possible visible dll entries +dlendsave = $82 ; to $9e - for 29 possible visible dll entries speech_addr = $9f speech_addr_hi = $a0 diff --git a/out/bin/compilers/7800basic/includes/7800macro.h b/out/bin/compilers/7800basic/includes/7800macro.h index b7c350ef..6e99bb6e 100644 --- a/out/bin/compilers/7800basic/includes/7800macro.h +++ b/out/bin/compilers/7800basic/includes/7800macro.h @@ -179,12 +179,21 @@ MedianOrderLUTend bcs .PLOTSPRITEnext ; carry is clear - lda DLPOINTL,x ; setup DL pointer for this zone + ifconst VSCROLL + ldy Xx3,x + lda DLLMEM+11,y + else ; !VSCROLL + lda DLPOINTL,x ; Get pointer to DL that this sprite starts in + endif ifconst DOUBLEBUFFER adc doublebufferdloffset endif ; DOUBLEBUFFER sta dlpnt - lda DLPOINTH,x ; setup DL pointer for this zone + ifconst VSCROLL + lda DLLMEM+10,y + else ; !VSCROLL + lda DLPOINTH,x + endif ; !VSCROLL ifconst DOUBLEBUFFER adc #0 endif ; DOUBLEBUFFER @@ -335,12 +344,21 @@ MedianOrderLUTend bcs .PLOTSPRITEend ; carry is clear - lda DLPOINTL,x ; setup DL pointer for this zone + ifconst VSCROLL + ldy Xx3,x + lda DLLMEM+11,y + else ; !VSCROLL + lda DLPOINTL,x ;Get pointer to DL that this sprite starts in + endif ; !VSCROLL ifconst DOUBLEBUFFER adc doublebufferdloffset endif ; DOUBLEBUFFER sta dlpnt - lda DLPOINTH,x ; setup DL pointer for this zone + ifconst VSCROLL + lda DLLMEM+10,y + else ; !VSCROLL + lda DLPOINTH,x + endif ; !VSCROLL ifconst DOUBLEBUFFER adc #0 endif ; DOUBLEBUFFER @@ -507,12 +525,21 @@ MedianOrderLUTend bcs .PLOTSPRITEnext ; carry is clear - lda DLPOINTL,x ; setup DL pointer for this zone + ifconst VSCROLL + ldy Xx3,x + lda DLLMEM+11,y + else ; !VSCROLL + lda DLPOINTL,x ;Get pointer to DL that this sprite starts in + endif ; !VSCROLL ifconst DOUBLEBUFFER adc doublebufferdloffset endif ; DOUBLEBUFFER sta dlpnt - lda DLPOINTH,x ; setup DL pointer for this zone + ifconst VSCROLL + lda DLLMEM+10,y + else ; !VSCROLL + lda DLPOINTH,x + endif ; !VSCROLL ifconst DOUBLEBUFFER adc #0 endif ; DOUBLEBUFFER @@ -664,12 +691,21 @@ MedianOrderLUTend bcs .PLOTSPRITEend ; carry is clear - lda DLPOINTL,x ; setup DL pointer for this zone + ifconst VSCROLL + ldy Xx3,x + lda DLLMEM+11,y + else ; !VSCROLL + lda DLPOINTL,x ;Get pointer to DL that this sprite starts in + endif ; !VSCROLL ifconst DOUBLEBUFFER adc doublebufferdloffset endif ; DOUBLEBUFFER sta dlpnt - lda DLPOINTH,x ; setup DL pointer for this zone + ifconst VSCROLL + lda DLLMEM+10,y + else ; !VSCROLL + lda DLPOINTH,x + endif ; !VSCROLL ifconst DOUBLEBUFFER adc #0 endif ; DOUBLEBUFFER @@ -837,13 +873,21 @@ MedianOrderLUTend cpx #WZONECOUNT bcs .PLOTSPRITEnext ; carry is clear - - lda DLPOINTL,x ; setup DL pointer for this zone + ifconst VSCROLL + ldy Xx3,x + lda DLLMEM+11,y + else ; !VSCROLL + lda DLPOINTL,x ;Get pointer to DL that this sprite starts in + endif ; !VSCROLL ifconst DOUBLEBUFFER adc doublebufferdloffset endif ; DOUBLEBUFFER sta dlpnt - lda DLPOINTH,x ; setup DL pointer for this zone + ifconst VSCROLL + lda DLLMEM+10,y + else ; !VSCROLL + lda DLPOINTH,x + endif ; !VSCROLL ifconst DOUBLEBUFFER adc #0 endif ; DOUBLEBUFFER @@ -986,13 +1030,21 @@ MedianOrderLUTend cpx #WZONECOUNT bcs .PLOTSPRITEend ; carry is clear - - lda DLPOINTL,x ; setup DL pointer for this zone + ifconst VSCROLL + ldy Xx3,x + lda DLLMEM+11,y + else ; !VSCROLL + lda DLPOINTL,x ;Get pointer to DL that this sprite starts in + endif ; !VSCROLL ifconst DOUBLEBUFFER adc doublebufferdloffset endif ; DOUBLEBUFFER sta dlpnt - lda DLPOINTH,x ; setup DL pointer for this zone + ifconst VSCROLL + lda DLLMEM+10,y + else ; !VSCROLL + lda DLPOINTH,x + endif ; !VSCROLL ifconst DOUBLEBUFFER adc #0 endif ; DOUBLEBUFFER @@ -1150,13 +1202,21 @@ MedianOrderLUTend cpx #WZONECOUNT bcs .PLOTSPRITEnext ; carry is clear - - lda DLPOINTL,x ; setup DL pointer for this zone + ifconst VSCROLL + ldy Xx3,x + lda DLLMEM+11,y + else ; !VSCROLL + lda DLPOINTL,x ;Get pointer to DL that this sprite starts in + endif ; !VSCROLL ifconst DOUBLEBUFFER adc doublebufferdloffset endif ; DOUBLEBUFFER sta dlpnt - lda DLPOINTH,x ; setup DL pointer for this zone + ifconst VSCROLL + lda DLLMEM+10,y + else ; !VSCROLL + lda DLPOINTH,x + endif ; !VSCROLL ifconst DOUBLEBUFFER adc #0 endif ; DOUBLEBUFFER @@ -1298,13 +1358,21 @@ MedianOrderLUTend cpx #WZONECOUNT bcs .PLOTSPRITEend ; carry is clear - - lda DLPOINTL,x ; setup DL pointer for this zone + ifconst VSCROLL + ldy Xx3,x + lda DLLMEM+11,y + else ; !VSCROLL + lda DLPOINTL,x ;Get pointer to DL that this sprite starts in + endif ; !VSCROLL ifconst DOUBLEBUFFER adc doublebufferdloffset endif ; DOUBLEBUFFER sta dlpnt - lda DLPOINTH,x ; setup DL pointer for this zone + ifconst VSCROLL + lda DLLMEM+10,y + else ; !VSCROLL + lda DLPOINTH,x + endif ; !VSCROLL ifconst DOUBLEBUFFER adc #0 endif ; DOUBLEBUFFER @@ -1437,10 +1505,100 @@ MedianOrderLUTend .PLOTSPRITEend ENDM + MAC SCROLLSETUP + + ; If vertical scrolling is enabled... + ; * Fills the DLs with hidden masking sprites. + ; Adds blank sprites to the DLs to fill the screen. + ; If horizontal scrolling is enabled... + ; * Adds another blank DL off-screen + + ; {1} - constant - the first dl of the scrolling area + ; {2} - symbol - blank tile label + + ; *** clear the saved dl ending for scrolling zones... + ldx #{1} + lda #0 +.scrollcleardls + sta dlend,x + inx + cpx #WZONECOUNT + bne .scrollcleardls + + ifconst VSCROLL + ; *** adjust the ending for our mask dl to allow for mask objects... + dex + lda #(maskscrollspriteend-maskscrollsprite) + sta dlend,x + + ; *** Add 4x dma masking objects to last zone... + ldx #(maskscrollspriteend-maskscrollsprite-1) +.scrollpopulateloop1 + lda maskscrollsprite,x + sta LASTZONEADDRESS+0,x + ifconst DOUBLEBUFFER + sta LASTZONEADDRESS+0+DOUBLEBUFFEROFFSET,x + endif ; DOUBLEBUFFER + dex + bpl .scrollpopulateloop1 + inx ; x=0 + stx finescrolly + endif ; VSCROLL + + ; *** Add blank sprite-tile objects to the scrolling zones... +PLOTSP4 = 1 ; ensure we use 4 byte sprites + + ; convert byte width of the sprit to coordinate width... + if {2}_mode = 0 ; ### 160A, 320A, 320D +.scrollXWIDTH SET ({2}_width * 4) ; 4x 160-mode pixels per byte + else ; ### 160B, 320B, 320C +.scrollXWIDTH SET ({2}_width * 2) ; 2x 160-mode pixels per byte + endif + + ; figure out how many sprites we need to fill a screen width... +.scrollSPRITECOuNT SET ((160+.scrollXWIDTH-1)/.scrollXWIDTH) + ifconst HSCROLL +.scrollSPRITECOuNT SET (.scrollSPRITECOuNT+1) + endif ; HSCROLL + + ; setup plotsprite4 parameters... + lda #<{2} + sta temp1 + lda #>{2} + sta temp2 + lda #{2}_width_twoscompliment + sta temp3 ; width + + lda #{1} + asl + asl + asl + if WZONEHEIGHT + asl + endif + sta temp5 ; Y +.scrollpopulateloop2 + lda #0 + sta temp4 ; X +.scrollpopulateloop3 + jsr skipplotsprite4wait + lda temp4 ; X + clc + adc #.scrollXWIDTH + sta temp4 ; X + cmp #(.scrollSPRITECOuNT*.scrollXWIDTH) + bne .scrollpopulateloop3 + lda temp5 ; Y + clc + adc #WZONEHEIGHT + sta temp5 ; Y + cmp #((WZONECOUNT*WZONEHEIGHT)+WZONEHEIGHT) + bne .scrollpopulateloop2 + ENDM ; SCROLLSETUP MAC SIZEOF - ; echo's the size difference between the current address and the + ; echoes the size difference between the current address and the ; a label that was passed as an argument. This is a quick way to ; determine the size of a structure. diff --git a/out/bin/compilers/7800basic/includes/last4k.asm b/out/bin/compilers/7800basic/includes/last4k.asm index b42bb826..2d561e44 100644 --- a/out/bin/compilers/7800basic/includes/last4k.asm +++ b/out/bin/compilers/7800basic/includes/last4k.asm @@ -74,3 +74,6 @@ ifnconst included.plotsprite4.asm include plotsprite4.asm endif + ifnconst included.lzsa1compression.asm + include lzsa1compression.asm + endif diff --git a/out/bin/compilers/7800basic/includes/lzsa1compression.asm b/out/bin/compilers/7800basic/includes/lzsa1compression.asm new file mode 100644 index 00000000..66777c64 --- /dev/null +++ b/out/bin/compilers/7800basic/includes/lzsa1compression.asm @@ -0,0 +1,391 @@ +; *************************************************************************** +; *************************************************************************** +; +; lzsa1_6502.s +; +; NMOS 6502 decompressor for data stored in Emmanuel Marty's LZSA1 format. +; +; Decompresses a raw LZSA1 block, created with the command-line lzsa utility: +; lzsa -r +; +; in: +; * LZSA_SRC_LO and LZSA_SRC_HI contain the compressed raw block address +; * LZSA_DST_LO and LZSA_DST_HI contain the destination buffer address +; +; out: +; * the destination buffer will contain the decompressed data +; * LZSA_DST_LO and LZSA_DST_HI contain the last decompressed byte address +1 +; +; *************************************************************************** +; +; This code is written for the ACME assembler. +; +; The code is 165 bytes for the small version, and 191 bytes for the normal. +; +; Copyright John Brandwood 2021. +; +; Changes intruduced by Mike Saarna, 2023: +; -converted to DASM format. +; -generalised memory locations, for easier incorporation into 7800basic +; -removed self-modifying code, for use on rom-based platforms. +; +; get the original unmodified code from: +; https://raw.githubusercontent.com/emmanuel-marty/lzsa +; +; Distributed under the Boost Software License, Version 1.0. +; (See accompanying file LICENSE_1_0.txt or copy at +; http://www.boost.org/LICENSE_1_0.txt) +; +; *************************************************************************** +; *************************************************************************** + + + +; *************************************************************************** +; *************************************************************************** +; +; Decompression Options & Macros +; + +; +; Choose size over decompression speed (within sane limits)? +; + +LZSA_SMALL_SIZE = 0 +LZSAFASTCOPYBYTE = 1 ; +11 bytes rom + +; *************************************************************************** +; *************************************************************************** +; +; ZP memory allocations... (temp1-temp9 are 7800basic ZP locations) +LSZA1ZPRAM = temp1 +lzsa_winptr = LSZA1ZPRAM ; 1 word. +lzsa_srcptr = LSZA1ZPRAM + 2 ; 1 word. +lzsa_dstptr = LSZA1ZPRAM + 4 ; 1 word. + +; Doesn't need to be ZP allocations... +LSZA1TEMPRAM = temp7 +lzsa_cmdbuf = LSZA1TEMPRAM ; 1 byte. +lzsa_cp_npages = LSZA1TEMPRAM + 1 +lzsa_lz_npages = LSZA1TEMPRAM + 2 + +; Alternate names for previous allocations... +lzsa_offset = lzsa_winptr +LZSA_SRC_LO = lzsa_srcptr +LZSA_SRC_HI = lzsa_srcptr+1 +LZSA_DST_LO = lzsa_dstptr +LZSA_DST_HI = lzsa_dstptr+1 + + ifconst lzsa1support + +lzsa1modulestart + +; *************************************************************************** +; *************************************************************************** +; +; lzsa1_unpack - Decompress data stored in Emmanuel Marty's LZSA1 format. +; +; Args: lzsa_srcptr = ptr to compessed data +; Args: lzsa_dstptr = ptr to output buffer +; + +DECOMPRESS_LZSA1_FAST +lzsa1_unpack + ldy #0 ; Initialize source index. + ldx #0 ; Initialize hi-byte of length. + stx lzsa_cp_npages + stx lzsa_lz_npages + +; +; Copy bytes from compressed source data. +; +; N.B. X=0 is expected and guaranteed when we get here. +; + +.cp_length + if LZSA_SMALL_SIZE = 1 + + jsr .get_byte + + else ; !LZSA_SMALL_SIZE + + lda (lzsa_srcptr),y + inc lzsa_srcptr+0 + bne .cp_skip0 + inc lzsa_srcptr+1 + + endif ; !LZSA_SMALL_SIZE + +.cp_skip0 + sta lzsa_cmdbuf ; Preserve this for later. + and #$70 ; Extract literal length. + lsr ; Set CC before ... + beq .lz_offset ; Skip directly to match? + + lsr ; Get 3-bit literal length. + lsr + lsr + cmp #$07 ; Extended length? + bcc .cp_got_len + + jsr .get_length ; X=0, CS from CMP, returns CC. + stx lzsa_cp_npages ; Hi-byte of length. + +.cp_got_len + tax ; Lo-byte of length. + + ifnconst LZSAFASTCOPYBYTE + +.cp_byte ; CC throughout the execution of this .cp_page loop. + lda (lzsa_srcptr),y ; 5 + sta (lzsa_dstptr),y ; 5 + inc lzsa_srcptr+0 ; 5 + bne .cp_skip1 ; 3 + inc lzsa_srcptr+1 +.cp_skip1 + inc lzsa_dstptr+0 ; 5 + bne .cp_skip2 ; 3 + inc lzsa_dstptr+1 +.cp_skip2 + dex ; 2 + bne .cp_byte ; 3 + ; ~29 cycles for X=1 + ; ~58 cycles for X=2 + ; ~87 cycles for X=3 + + else ; LZSAFASTCOPYBYTE + + ; according to 7800heat, this loop is hot. It runs on average ~6x. +.cp_byte ; CC throughout the execution of this .cp_page loop. + lda (lzsa_srcptr),y ; 5 + sta (lzsa_dstptr),y ; 5 + iny ; 2 + dex ; 2 + bne .cp_byte ; 3 + ; ~17 cycles per iteration + tya ; 2 + adc lzsa_srcptr+0 ; 3 + sta lzsa_srcptr+0 ; 3 + bcc .cp_skip1 ; 3 + inc lzsa_srcptr+1 + clc +.cp_skip1 + tya ; 2 + adc lzsa_dstptr+0 ; 3 + sta lzsa_dstptr+0 ; 3 + bcc .cp_skip2 ; 3 + inc lzsa_dstptr+1 + clc +.cp_skip2 + ldy #0 ; 2 + ; ~22 cycles overhead + + ; ~39 cycles for X=1 + ; ~56 cycles for X=2 (break-even) + ; ~73 cycles for X=3 + endif ; LZSAFASTCOPYBYTE + +.cp_npages + lda lzsa_cp_npages ; Any full pages left to copy? + beq .lz_offset + + dec lzsa_cp_npages ; Unlikely, so can be slow. + bcc .cp_byte ; Always true! + + if LZSA_SMALL_SIZE = 1 + +; Copy bytes from decompressed window. +; +; Shorter but slower version. +; +; N.B. X=0 is expected and guaranteed when we get here. +; + +.lz_offset + jsr .get_byte ; Get offset-lo. + +.offset_lo + adc lzsa_dstptr+0 ; Always CC from .cp_page loop. + sta lzsa_winptr+0 + + lda #$FF + bit lzsa_cmdbuf + bpl .offset_hi + + jsr .get_byte ; Get offset-hi. + +.offset_hi + adc lzsa_dstptr+1 ; lzsa_winptr < lzsa_dstptr, so + sta lzsa_winptr+1 ; always leaves CS. + +.lz_length + lda lzsa_cmdbuf ; X=0 from previous loop. + and #$0F + adc #$03 - 1 ; CS from previous ADC. + cmp #$12 ; Extended length? + bcc .lz_got_len + + jsr .get_length ; CS from CMP, X=0, returns CC. + stx lzsa_lz_npages ; Hi-byte of length. + +.lz_got_len + tax ; Lo-byte of length. + +.lz_byte + lda (lzsa_winptr),y ; CC throughout the execution of + sta (lzsa_dstptr),y ; of this .lz_page loop. + inc lzsa_winptr+0 + bne .lz_skip1 + inc lzsa_winptr+1 +.lz_skip1 + inc lzsa_dstptr+0 + bne .lz_skip2 + inc lzsa_dstptr+1 +.lz_skip2 + dex + bne .lz_byte +.lz_npages + lda lzsa_lz_npages ; Any full pages left to copy? + beq .cp_length + + dec lzsa_lz_npages ; Unlikely, so can be slow. + bcc .lz_byte ; Always true! + + else ; !LZSA_SMALL_SIZE + +; +; Copy bytes from decompressed window. +; +; Longer but faster. +; +; N.B. X=0 is expected and guaranteed when we get here. +; + +.lz_offset + lda (lzsa_srcptr),y ; Get offset-lo. + inc lzsa_srcptr+0 + bne .offset_lo + inc lzsa_srcptr+1 + +.offset_lo + sta lzsa_offset+0 + + lda #$FF ; Get offset-hi. + bit lzsa_cmdbuf + bpl .offset_hi + + lda (lzsa_srcptr),y + inc lzsa_srcptr+0 + bne .offset_hi + inc lzsa_srcptr+1 + +.offset_hi + sta lzsa_offset+1 + +.lz_length + lda lzsa_cmdbuf ; X=0 from previous loop. + and #$0F + adc #$03 ; Always CC from .cp_page loop. + cmp #$12 ; Extended length? + bcc .got_lz_len + + jsr .get_length ; X=0, CS from CMP, returns CC. + +.got_lz_len + inx ; Hi-byte of length+256. + + eor #$FF ; Negate the lo-byte of length + tay + eor #$FF + +.get_lz_dst + adc lzsa_dstptr+0 ; Calc address of partial page. + sta lzsa_dstptr+0 ; Always CC from previous CMP. + iny + bcs .get_lz_win + beq .get_lz_win ; Is lo-byte of length zero? + dec lzsa_dstptr+1 + +.get_lz_win + clc ; Calc address of match. + adc lzsa_offset+0 ; N.B. Offset is negative! + sta lzsa_winptr+0 + lda lzsa_dstptr+1 + adc lzsa_offset+1 + sta lzsa_winptr+1 + + ; according to 7800heat, this loop is hot. It runs on average ~7.5x. + ; TODO: see if there's a chance to unroll it. +.lz_byte + lda (lzsa_winptr),y + sta (lzsa_dstptr),y + iny + bne .lz_byte + + inc lzsa_dstptr+1 + dex ; Any full pages left to copy? + bne .lz_more + + jmp .cp_length ; Loop around to the beginning. + +.lz_more + inc lzsa_winptr+1 ; Unlikely, so can be slow. + bne .lz_byte ; Always true! + + endif ; !LZSA_SMALL_SIZE + +; +; Get 16-bit length in X:A register pair, return with CC. +; +; N.B. X=0 is expected and guaranteed when we get here. +; + +.get_length + clc ; Add on the next byte to get + adc (lzsa_srcptr),y ; the length. + inc lzsa_srcptr+0 + bne .skip_inc + inc lzsa_srcptr+1 +.skip_inc + + bcc .got_length ; No overflow means done. + clc ; MUST return CC! + tax ; Preserve overflow value. + +.extra_byte + jsr .get_byte ; So rare, this can be slow! + pha + txa ; Overflow to 256 or 257? + beq .extra_word + +.check_length + pla ; Length-lo. + bne .got_length ; Check for zero. + dex ; Do one less page loop if so. +.got_length + rts + +.extra_word + jsr .get_byte ; So rare, this can be slow! + tax + bne .check_length ; Length-hi == 0 at EOF. + +.finished + pla ; Length-lo. + pla ; Decompression completed, pop + pla ; return address. + rts + +.get_byte + lda (lzsa_srcptr),y ; Subroutine version for when + inc lzsa_srcptr+0 ; inlining isn't advantageous. + bne .got_byte + inc lzsa_srcptr+1 ; Inc & test for bank overflow. +.got_byte + rts + +lzsa1moduleend + + echo " (lzsa1compression module is using ",[(lzsa1moduleend-lzsa1modulestart)]d," bytes of rom)" + + endif ; lzsa1support diff --git a/out/bin/compilers/7800basic/includes/plotsprite4.asm b/out/bin/compilers/7800basic/includes/plotsprite4.asm index 61a5fff4..f6985ac2 100644 --- a/out/bin/compilers/7800basic/includes/plotsprite4.asm +++ b/out/bin/compilers/7800basic/includes/plotsprite4.asm @@ -59,17 +59,26 @@ skipplotsprite4wait jmp continueplotsprite42 exitplotsprite41 rts + endif continueplotsprite41 - endif - lda DLPOINTL,x ;Get pointer to DL that this sprite starts in + ifconst VSCROLL + ldy Xx3,x + lda DLLMEM+11,y + else ; !VSCROLL + lda DLPOINTL,x ;Get pointer to DL that this sprite starts in + endif ; !VSCROLL ifconst DOUBLEBUFFER clc adc doublebufferdloffset endif ; DOUBLEBUFFER sta dlpnt - lda DLPOINTH,x + ifconst VSCROLL + lda DLLMEM+10,y + else ; !VSCROLL + lda DLPOINTH,x + endif ; !VSCROLL ifconst DOUBLEBUFFER adc #0 endif ; DOUBLEBUFFER @@ -128,13 +137,22 @@ checkcontinueplotsprite42 continueplotsprite42 endif - lda DLPOINTL,x ;Get pointer to next DL + ifconst VSCROLL + ldy Xx3,x + lda DLLMEM+11,y + else ; !VSCROLL + lda DLPOINTL,x ;Get pointer to next DL + endif ; !VSCROLL ifconst DOUBLEBUFFER clc adc doublebufferdloffset endif ; DOUBLEBUFFER sta dlpnt - lda DLPOINTH,x + ifconst VSCROLL + lda DLLMEM+10,y + else ; !VSCROLL + lda DLPOINTH,x + endif ; !VSCROLL ifconst DOUBLEBUFFER adc #0 endif ; DOUBLEBUFFER diff --git a/out/bin/compilers/7800basic/includes/rmtplayer.asm b/out/bin/compilers/7800basic/includes/rmtplayer.asm index 964a873e..2f7a0e3b 100644 --- a/out/bin/compilers/7800basic/includes/rmtplayer.asm +++ b/out/bin/compilers/7800basic/includes/rmtplayer.asm @@ -1502,7 +1502,7 @@ ei4 jmp returnfromInstrumentsEffects rmtmoduleend - echo " (rmtplayer module is using ",[(rmtmoduleend-rmtmodulestart)]d," bytes of rom)" - echo " (rmtplayer module is using ",[(MEMLOC-RMTRAM-1)]d," bytes of ram)" + echo " (rmtplayer module is using ",[(rmtmoduleend-rmtmodulestart)]d," bytes of rom)" + echo " (rmtplayer module is using ",[(MEMLOC-RMTRAM-1)]d," bytes of ram)" endif ; RMT diff --git a/out/bin/compilers/7800basic/includes/std_routines.asm b/out/bin/compilers/7800basic/includes/std_routines.asm index 9757525c..c43e8ba5 100644 --- a/out/bin/compilers/7800basic/includes/std_routines.asm +++ b/out/bin/compilers/7800basic/includes/std_routines.asm @@ -104,6 +104,10 @@ TIMEOFFSET = 10 endif lda rasterpause beq skiprasterupdate + ifconst PAUSESILENT + lda pausestate + bne skiprasterupdate + endif jsr RASTERMUSICTRACKER+3 skiprasterupdate RMT_Iend @@ -547,13 +551,22 @@ terminatedisplaybuffer ;add DL end entry on each DL ldx #(WZONECOUNT-1) dlendloop - lda DLPOINTL,x + ifconst VSCROLL + ldy Xx3,x + lda DLLMEM+11,y + else ; !VSCROLL + lda DLPOINTL,x ;Get pointer to DL that this sprite starts in + endif ; !VSCROLL ifconst DOUBLEBUFFER clc adc doublebufferdloffset endif ; DOUBLEBUFFER sta dlpnt - lda DLPOINTH,x + ifconst VSCROLL + lda DLLMEM+10,y + else ; !VSCROLL + lda DLPOINTH,x + endif ; !VSCROLL ifconst DOUBLEBUFFER adc #0 endif ; DOUBLEBUFFER @@ -650,6 +663,10 @@ servicesongwasnotmissed ifconst RMT ifnconst RMTPALSPEED ifnconst RMTOFFSPEED + ifconst PAUSESILENT + lda pausestate + bne skiprasterupdate2 + endif lda palfastframe beq skiprasterupdate2 lda rasterpause @@ -853,6 +870,12 @@ servicesfxchannelsdone jmp checkpokeyplaying endif servicesfxchannels + ifconst PAUSESILENT + lda pausestate + beq servicesfxchannels_1 + rts +servicesfxchannels_1 + endif ldx #255 servicesfxchannelsloop inx @@ -999,8 +1022,10 @@ zerosfx schedulesfx ; called with sfxinstrumentlo=data sfxpitchoffset=pitch-offset sfxnoteindex=note index ldy #0 - lda (sfxinstrumentlo),y ifconst pokeysupport + lda sfxinstrumenthi + beq scheduletiasfx ; drums have undefined instrument + lda (sfxinstrumentlo),y cmp #$20 ; POKEY? bne scheduletiasfx jmp schedulepokeysfx @@ -1011,16 +1036,17 @@ scheduletiasfx ; rts ; unhandled!!! continuescheduletiasfx ifnconst TIASFXMONO - lda sfx1pointlo - ora sfx1pointhi + lda sfx1pointhi beq schedulesfx1 ;if channel 1 is idle, use it - lda sfx2pointlo - ora sfx2pointhi + lda sfx2pointhi beq schedulesfx2 ;if channel 2 is idle, use it ; Both channels are scheduled. + lda sfxinstrumenthi + beq skipscheduledrums ldy #1 lda (sfxinstrumentlo),y bne interruptsfx +skipscheduledrums rts ; the new sound has 0 priority and both channels are busy. Skip playing it. interruptsfx ;Compare which active sound has a lower priority. We'll interrupt the lower one. @@ -1137,13 +1163,22 @@ exitplotsprite1 continueplotsprite1 endif - lda DLPOINTL,x ;Get pointer to DL that this sprite starts in + ifconst VSCROLL + ldy Xx3,x + lda DLLMEM+11,y + else ; !VSCROLL + lda DLPOINTL,x ;Get pointer to DL that this sprite starts in + endif ; !VSCROLL ifconst DOUBLEBUFFER clc adc doublebufferdloffset endif ; DOUBLEBUFFER sta dlpnt - lda DLPOINTH,x + ifconst VSCROLL + lda DLLMEM+10,y + else ; !VSCROLL + lda DLPOINTH,x + endif ; !VSCROLL ifconst DOUBLEBUFFER adc #0 endif ; DOUBLEBUFFER @@ -1179,7 +1214,6 @@ continueplotsprite1a ora temp2 ; graphic data, hi byte sta (dlpnt),y - iny lda temp3 ;palette|width sta (dlpnt),y @@ -1219,13 +1253,22 @@ checkcontinueplotsprite2 continueplotsprite2 endif - lda DLPOINTL,x ;Get pointer to next DL + ifconst VSCROLL + ldy Xx3,x + lda DLLMEM+11,y + else ; !VSCROLL + lda DLPOINTL,x ;Get pointer to next DL + endif ; !VSCROLL ifconst DOUBLEBUFFER clc adc doublebufferdloffset endif ; DOUBLEBUFFER sta dlpnt - lda DLPOINTH,x + ifconst VSCROLL + lda DLLMEM+10,y + else ; !VSCROLL + lda DLPOINTH,x + endif ; !VSCROLL ifconst DOUBLEBUFFER adc #0 endif ; DOUBLEBUFFER @@ -1287,6 +1330,22 @@ continueplotsprite2a doneSPDL rts + ifconst VSCROLL + ; x3 table for fast DLL parsing +Xx3 + .byte 0,3,6,9,12,15,18,21,24,27 + .byte 30,33,36,39,42,45,48,51,54,57 + .byte 60,63,66,69,72,75,78,81,84,87 +maskscrollsprite + .byte $00,%11000000,($D0+WZONEHEIGHT),0,160 ; 5*2 + 32*3 = 106 cycles + .byte $00,1,($D0+WZONEHEIGHT),160 ; 4*2 + 31*3 = 101 cycles + .byte $00,1,($D0+WZONEHEIGHT),160 ; 4*2 + 31*3 = 101 cycles + .byte $00,1,($D0+WZONEHEIGHT),160 ; 4*2 + 31*3 = 101 cycles + .byte $00,%01000000,($D0+WZONEHEIGHT),16,160 ; 5*2 + 16*3 = 58 cycles + ; MAX ============ 467 cycles + ; MIN ============ 59 cycles +maskscrollspriteend + endif ; VSCROLL lockzonex ifconst ZONELOCKS @@ -1333,7 +1392,6 @@ unlockzonex endif ; DOUBLEBUFFER sta dlpnt+1 dey - ;ldy #(DLLASTOBJ-1) lda (dlpnt),y tay sty dlend,x @@ -1432,13 +1490,23 @@ plotcharactersskipentry ;endif tax - lda DLPOINTL,x ;Get pointer to DL that the characters are in + + ifconst VSCROLL + ldy Xx3,x + lda DLLMEM+11,y + else ; !VSCROLL + lda DLPOINTL,x ;Get pointer to DL that the characters are in + endif ; !VSCROLL ifconst DOUBLEBUFFER clc adc doublebufferdloffset endif ; DOUBLEBUFFER sta dlpnt - lda DLPOINTH,x + ifconst VSCROLL + lda DLLMEM+10,y + else ; !VSCROLL + lda DLPOINTH,x + endif ; !VSCROLL ifconst DOUBLEBUFFER adc #0 endif ; DOUBLEBUFFER @@ -1493,13 +1561,23 @@ plotcharacterslive lda temp5 ;Y position tax - lda DLPOINTL,x ;Get pointer to DL that the characters are in + + ifconst VSCROLL + ldy Xx3,x + lda DLLMEM+11,y + else ; !VSCROLL + lda DLPOINTL,x ;Get pointer to DL that the characters are in + endif ; !VSCROLL ifconst DOUBLEBUFFER clc adc doublebufferdloffset endif ; DOUBLEBUFFER sta dlpnt - lda DLPOINTH,x + ifconst VSCROLL + lda DLLMEM+10,y + else ; !VSCROLL + lda DLPOINTH,x + endif ; !VSCROLL ifconst DOUBLEBUFFER adc #0 endif ; DOUBLEBUFFER @@ -2026,133 +2104,179 @@ vblankresync rts createallgamedlls - ldx #0 - lda #NVLINES - ldy paldetected - beq skipcreatePALpadding + ldy #(DLLLUTEND-DLLLUT) +createallgamedllsloop + dey + lda DLLLUT,y + sta DLLMEM,y + ifconst DOUBLEBUFFER + sta DLLMEM+DBOFFSET,y + endif ; DOUBLEBUFFER + cpy #0 + bne createallgamedllsloop + + ifconst DOUBLEBUFFER + ldy #(DLLLUTNONVISSTART-DLLLUTVISSTART) +fixdoublebuffer + dey + lda DLLMEM+DBOFFSET+DLLLUTVISSTART-DLLLUT,y clc - adc #21 -skipcreatePALpadding - jsr createnonvisibledlls - stx visibleDLLstart - jsr createvisiblezones - stx overscanDLLstart -createallgamedllscontinue - lda #(NVLINES+55) ; extras for PAL - jsr createnonvisibledlls - - ldx visibleDLLstart - lda DLLMEM,x - ora #%10000000 ; NMI 1 - start of visible screen - sta DLLMEM,x - ifconst DOUBLEBUFFER - sta DLLMEM+DBOFFSET,x - endif ; DOUBLEBUFFER - - ldx overscanDLLstart - lda DLLMEM,x - ora #%10000011 ; NMI 2 - end of visible screen - and #%11110011 ; change this to a 1-line DLL, so there's time enough for the "deeper overscan" DLL - sta DLLMEM,x - ifconst DOUBLEBUFFER - sta DLLMEM+DBOFFSET,x - endif ; DOUBLEBUFFER - - inx - inx - inx - - lda DLLMEM,x - ora #%10000000 ; NMI 3 - deeper overscan - sta DLLMEM,x - ifconst DOUBLEBUFFER - sta DLLMEM+DBOFFSET,x - endif ; DOUBLEBUFFER - - rts - -createnonvisibledlls - sta temp1 - lsr - lsr - lsr - lsr ; /16 - beq skipcreatenonvisibledlls1loop - tay -createnonvisibledlls1loop - lda #%01001111 ;low nibble=16 lines, high nibble=Holey DMA - jsr createblankdllentry + adc #DOUBLEBUFFEROFFSET + sta DLLMEM+DBOFFSET+DLLLUTVISSTART-DLLLUT,y dey - bne createnonvisibledlls1loop -skipcreatenonvisibledlls1loop - lda temp1 - and #%00001111 - beq createnonvisibledllsreturn - sec - sbc #1 - ora #%01000000 - jsr createblankdllentry -createnonvisibledllsreturn - rts - -createblankdllentry - sta DLLMEM,x - ifconst DOUBLEBUFFER - sta DLLMEM+DBOFFSET,x - endif ; DOUBLEBUFFER - inx - lda #$21 ; blank - sta DLLMEM,x - ifconst DOUBLEBUFFER - sta DLLMEM+DBOFFSET,x - endif ; DOUBLEBUFFER - inx - lda #$00 - sta DLLMEM,x - ifconst DOUBLEBUFFER - sta DLLMEM+DBOFFSET,x - endif ; DOUBLEBUFFER - inx - rts + lda DLLMEM+DBOFFSET+DLLLUTVISSTART-DLLLUT,y + adc #0 + sta DLLMEM+DBOFFSET+DLLLUTVISSTART-DLLLUT,y + dey + bne fixdoublebuffer + endif + + ifconst BANKSET_DL_IN_CARTRAM + ; N.B. banksets doesn't in-fact allow DL in cart-ram, so this conditional + ; is always skipped. This is here in case some day the limitation is + ; worked around, but it's untested. + + ; With bankset cart ram, we added $8000 to the DL address so plot + ; functions would hit the cart-ram write-address. We need to subtract $80 + ; so Maria will read from the cart-ram read-address. + ldy #(DLLLUTNONVISSTART-DLLLUTVISSTART) +fixbanksetaddresses + dey + dey + lda DLLMEM+DLLLUTVISSTART-DLLLUT,y + and #%01111111 + sta DLLMEM+DLLLUTVISSTART-DLLLUT,y + ifconst DOUBLEBUFFER + lda DLLMEM+DBOFFSET+DLLLUTVISSTART-DLLLUT,y + and #%01111111 + sta DLLMEM+DBOFFSET+DLLLUTVISSTART-DLLLUT,y + endif ; DOUBLEBUFFER + dey + bne fixbanksetaddresses + endif ; BANKSET_DL_IN_CARTRAM -createvisiblezones - ldy #0 -createvisiblezonesloop - lda.w DLHEIGHT,y - ora #(WZONEHEIGHT * 4) ; set Holey DMA for 8 or 16 tall zones - sta DLLMEM,x - ifconst DOUBLEBUFFER - sta DLLMEM+DBOFFSET,x - endif ; DOUBLEBUFFER - inx - lda DLPOINTH,y - ifconst BANKSET_DL_IN_CARTRAM - ; with bankset cart ram, we added $8000 to the DL address so plot functions would hit the write-address - ; but now we need to subtract that $8000 location to give Maria the normal address - sec - sbc #$80 - endif ; BANKSET_DL_IN_CARTRAM - sta DLLMEM,x - ifconst DOUBLEBUFFER - sta DLLMEM+DBOFFSET,x - endif ; DOUBLEBUFFER - inx - lda DLPOINTL,y - sta DLLMEM,x - ifconst DOUBLEBUFFER - clc - adc #DOUBLEBUFFEROFFSET - sta DLLMEM+DBOFFSET,x - bcc skiphidoublebufferadjust ; dlls are big endian, so we need to fix the hi byte after-the-fact... - inc DLLMEM+DBOFFSET-1,x -skiphidoublebufferadjust - endif ; DOUBLEBUFFER - inx - iny - cpy #WZONECOUNT - bne createvisiblezonesloop + lda paldetected + beq skippaladjust + lda #($0F|(WZONEHEIGHT*4)) ; +15 lines + sta DLLMEM+6 + ifconst DOUBLEBUFFER + sta DLLMEM+DBOFFSET+6 + endif + if WSCREENHEIGHT = 192 + lda #($0D|(WZONEHEIGHT*4)) ; +6 lines + else + lda #($07|(WZONEHEIGHT*4)) ; +6 lines + endif ; + sta DLLMEM+3 + ifconst DOUBLEBUFFER + sta DLLMEM+DBOFFSET+3 + endif ; DOUBLEBUFFER + +skippaladjust + + ; save the DL markers... + lda #(DLLLUTVISSTART-DLLLUT) + sta visibleDLLstart + lda #(DLLLUTNONVISSTART-DLLLUT) + sta overscanDLLstart rts + ; N.B. max DLL length is 112 bytes (for double-buffered) + +DLLLUT + if WSCREENHEIGHT = 192 + .byte ($0F|(WZONEHEIGHT*4)),$21,$00 ; 16 blank lines + .byte ($07|(WZONEHEIGHT*4)),$21,$00 ; 8 blank lines + .byte ($00|(WZONEHEIGHT*4)),$21,$00 ; 1 blank lines + ;=25 blank lines + endif ; WSCREENHEIGHT = 192 + if WSCREENHEIGHT = 208 + .byte ($0E|(WZONEHEIGHT*4)),$21,$00 ; 15 blank lines + .byte ($00|(WZONEHEIGHT*4)),$21,$00 ; 1 blank lines + .byte ($00|(WZONEHEIGHT*4)),$21,$00 ; 1 blank lines + ;=17 blank lines + endif ; WSCREENHEIGHT = 208 + if WSCREENHEIGHT = 224 + .byte ($06|(WZONEHEIGHT*4)),$21,$00 ; 7 blank lines + .byte ($00|(WZONEHEIGHT*4)),$21,$00 ; 1 blank lines + .byte ($00|(WZONEHEIGHT*4)),$21,$00 ; 1 blank lines + ;= 9 blank lines + endif ; WSCREENHEIGHT = 224 + +DLLLUTVISSTART + .byte ($80|(WZONEHEIGHT*4)|(WZONEHEIGHT-1)),>ZONE0ADDRESS,ZONE1ADDRESS,ZONE2ADDRESS,ZONE3ADDRESS,ZONE4ADDRESS,ZONE5ADDRESS,ZONE6ADDRESS,ZONE7ADDRESS,ZONE8ADDRESS,ZONE9ADDRESS,ZONE10ADDRESS,ZONE11ADDRESS,ZONE12ADDRESS,ZONE13ADDRESS,ZONE14ADDRESS,ZONE15ADDRESS,ZONE16ADDRESS,ZONE17ADDRESS,ZONE18ADDRESS,ZONE19ADDRESS,ZONE20ADDRESS,ZONE21ADDRESS,ZONE22ADDRESS,ZONE23ADDRESS,ZONE24ADDRESS,ZONE25ADDRESS,ZONE26ADDRESS,ZONE27ADDRESS,DLLMEM + sta DPPH + lda #hiscorefont + sta CHARBASE + sta sCHARBASE + lda #%01000011 ;Enable DMA, mode=320A + sta CTRL + sta sCTRL + .byte $02 ; KIL/JAM +hiscorehexlut + ; 0 1 2 3 4 5 6 7 8 9 A B C D E F + .byte 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 0, 1, 2, 3, 4, 5 +show2700 + ; lo mode hi width=29 x EODL + .byte $00, %01100000, $27, 3, 20, 0,0,0 + else ; CRASHDUMP + .byte $02 ; KIL/JAM + endif ; crashdump + endif ; hiscorefont + else + RTI + endif + + ifconst LONGCONTROLLERREAD + +longreadtype + .byte 0, 0, 0, 1 ; NONE PROLINE LIGHTGUN PADDLE + .byte 2, 0, 3, 0 ; TRKBALL VCSSTICK DRIVING KEYPAD + .byte 3, 3, 0, 0 ; STMOUSE AMOUSE ATARIVOX SNES + +longreadroutineloP0 + .byte LLRET0 ; 0 = no routine + .byte >paddleport0update ; 1 = paddle + .byte >trakball0update ; 2 = trackball + .byte >mouse0update ; 3 = mouse + +longreadroutineloP1 + .byte LLRET1 ; 0 = no routine + .byte >paddleport1update ; 1 = paddle + .byte >trakball1update ; 2 = trackball + .byte >mouse1update ; 3 = mouse + + +SETTIM64T + bne skipdefaulttime + ifnconst PADDLESMOOTHINGOFF + lda #(TIMEVAL+TIMEOFFSET+1) + else + lda #(TIMEVAL+TIMEOFFSET) + endif +skipdefaulttime + tay + dey +.setTIM64Tloop + sta TIM64T + cpy INTIM + bne .setTIM64Tloop + rts + endif ; LONGCONTROLLERREAD + +reallyoffvisible + sta WSYNC + + lda #0 + sta visibleover + ifconst DEBUGINTERRUPT + sta BACKGRND + endif + + lda #3 + sta interruptindex + + jsr uninterruptableroutines + + ifconst .userinterrupt + lda interrupthold + beq skipuserintroutine + jsr .userinterrupt +skipuserintroutine + endif + + ifconst KEYPADSUPPORT + jsr keypadcolumnread + jsr keypadrowselect + endif + +NMIexit + pla + tay + pla + tax + pla + RTI + +clearscreen + ldx #(WZONECOUNT-1) + lda #0 +clearscreenloop + sta dlend,x + dex + bpl clearscreenloop + lda #0 + sta valbufend ; clear the bcd value buffer + sta valbufendsave + rts + +restorescreen + ldx #(WZONECOUNT-1) + lda #0 +restorescreenloop + lda dlendsave,x + sta dlend,x + dex + bpl restorescreenloop + lda valbufendsave + sta valbufend + rts + +savescreen + ldx #(WZONECOUNT-1) +savescreenloop + lda dlend,x + sta dlendsave,x + dex + bpl savescreenloop + lda valbufend + sta valbufendsave + ifconst DOUBLEBUFFER + lda doublebufferstate + beq savescreenrts + lda #1 + sta doublebufferbufferdirty +savescreenrts + endif ; DOUBLEBUFFER + rts + +drawscreen + + ifconst interrupthold + lda #$FF + sta interrupthold ; if the user called drawscreen, we're ready for interrupts + endif + + lda #0 + sta temp1 ; not B&W if we're here... + +drawscreenwait + lda visibleover + bne drawscreenwait ; make sure the visible screen isn't being drawn + + ;restore some registers in case the game changed them mid-screen... + lda sCTRL + ora temp1 + sta CTRL + lda sCHARBASE + sta CHARBASE + + ;ensure all of the display list is terminated... + jsr terminatedisplaylist + + ifnconst pauseroutineoff + jsr pauseroutine + endif ; pauseroutineoff + + ; Make sure the visible screen has *started* before we exit. That way we can rely on drawscreen + ; delaying a full frame, but still allowing time for basic calculations. +visiblescreenstartedwait + lda visibleover + beq visiblescreenstartedwait +visiblescreenstartedwaitdone + dec frameslost ; ; this gets balanced with an "inc frameslost" by an NMI at the top of the screen + rts + + ifnconst pauseroutineoff + ; check to see if pause was pressed and released +pauseroutine + lda pausedisable + bne leavepauseroutine + lda #8 + bit SWCHB + beq pausepressed + + ifconst SNES0PAUSE + lda port0control + cmp #11 + bne skipsnes0pause + lda snesdetected0 + beq skipsnes0pause + lda snes2atari0hi + and #%00010000 + beq pausepressed +skipsnes0pause + endif + ifconst SNES1PAUSE + + lda port1control + cmp #11 + bne skipsnes1pause + lda snesdetected1 + beq skipsnes1pause + lda snes2atari1hi + and #%00010000 + beq pausepressed +skipsnes1pause + endif + ifconst SNESNPAUSE + ldx snesport + lda port0control,x + cmp #11 + bne skipsnesNpause + lda snesdetected0,x + beq skipsnesNpause + lda snes2atari0hi,x + and #%00010000 + beq pausepressed +skipsnesNpause + endif + ifconst MULTIBUTTONPAUSE + ldx #1 +multibuttonpauseloop + lda port0control,x + cmp #11 + bcc multibuttonpauseloopbottom + lda sINPT1,x + and #1 + beq pausepressed +multibuttonpauseloopbottom + dex + bpl multibuttonpauseloop + endif ; MULTIBUTTONPAUSE + + ;pause isn't pressed + lda #0 + sta pausebuttonflag ; clear pause hold state in case its set + + ;check if we're in an already paused state + lda pausestate + beq leavepauseroutine ; nope, leave + + cmp #1 ; last frame was the start of pausing + beq enterpausestate2 ; move from state 1 to 2 + + cmp #2 + beq carryonpausing + + ;pausestate must be >2, which means we're ending an unpause + lda #0 + sta pausebuttonflag + sta pausestate + lda sCTRL + sta CTRL + jmp leavepauseroutine + +pausepressed + ;pause is pressed + lda pausebuttonflag + cmp #$ff + beq carryonpausing + + ;its a new press, increment the state + inc pausestate + + ;silence volume at the start and end of pausing + lda #0 + sta AUDV0 + sta AUDV1 + + ifconst pokeysupport + ldy #7 +pausesilencepokeyaudioloop + sta (pokeybase),y + dey + bpl pausesilencepokeyaudioloop + endif ; pokeysupport + + lda #$ff + sta pausebuttonflag + bne carryonpausing + +enterpausestate2 + lda #2 + sta pausestate + bne carryonpausing +leavepauseroutine + lda sCTRL + sta CTRL + rts +carryonpausing + ifconst .pause + jsr .pause + endif ; .pause + lda sCTRL + ora #%10000000 ; turn off colorburst during pause... + sta CTRL + jmp pauseroutine + endif ; pauseroutineoff + + + ifconst DOUBLEBUFFER +skipterminatedisplaylistreturn + rts + endif ; DOUBLEBUFFER +terminatedisplaylist + ifconst DOUBLEBUFFER + lda doublebufferstate + bne skipterminatedisplaylistreturn ; double-buffering runs it's own DL termination code + endif ; DOUBLEBUFFER +terminatedisplaybuffer + ;add DL end entry on each DL + ldx #(WZONECOUNT-1) +dlendloop + lda DLPOINTL,x + ifconst DOUBLEBUFFER + clc + adc doublebufferdloffset + endif ; DOUBLEBUFFER + sta dlpnt + lda DLPOINTH,x + ifconst DOUBLEBUFFER + adc #0 + endif ; DOUBLEBUFFER + sta dlpnt+1 + ldy dlend,x + lda #$00 +dlendmoreloops + iny + sta (dlpnt),y + ifconst FRAMESKIPGLITCHFIXWEAK + cpy #DLLASTOBJ+1 + beq dlendthiszonedone + iny + iny + iny + iny + iny + sta (dlpnt),y +dlendthiszonedone + endif FRAMESKIPGLITCHFIXWEAK + ifconst FRAMESKIPGLITCHFIX + iny + iny + iny + iny + cpy #DLLASTOBJ-1 + bcc dlendmoreloops + endif ; FRAMESKIPGLITCHFIX + dex + bpl dlendloop + + ifnconst pauseroutineoff + jsr pauseroutine + endif ; pauseroutineoff + rts + +uninterruptableroutines + ; this is for routines that must happen off the visible screen, each frame. + + ifconst AVOXVOICE + jsr serviceatarivoxqueue + endif + ifconst MEGA7800SUPPORT + ldx #1 +mega7800polling + lda port0control,x + cmp #12 ; mega7800 + bne mega7800handlercheck2 + jsr mega7800handler + jmp mega7800handlerdone +mega7800handlercheck2 + ifconst MULTIBUTTON + cmp #1 ; proline + bne mega7800handlerdone + lda framecounter + eor #7 ; avoid the same frame as the snes2atari probe + and #63 + bne mega7800handlerdone + lda #12 + sta port0control,x + jsr mega7800handler + endif ; MULTIBUTTON +mega7800handlerdone + dex + bpl mega7800polling + endif ; MEGA7800SUPPORT + + lda #0 + sta palfastframe + sta ntscslowframe + ldx paldetected ; 0=ntsc 1=pal + ldy palframes + iny + cpy #5 + bne palframeskipdone + lda paldetected + inc ntscslowframe,x + ldy #0 +palframeskipdone + sty palframes +skippalframeadjusting + + ifconst MUSICTRACKER + ; We normally run the servicesong routine from the top-screen interrupt, but if it + ; happens to interrupt the scheduling of a sound effect in the game code, we skip it. + ; If that happens, we try again here. Chances are very small we'll run into the same + ; problem twice, and if we do, we just drop a musical note or two. + lda sfxschedulemissed + beq servicesongwasnotmissed + jsr servicesong +servicesongwasnotmissed + endif ; MUSICTRACKER + + ifconst RMT + ifnconst RMTPALSPEED + ifnconst RMTOFFSPEED + lda palfastframe + beq skiprasterupdate2 + lda rasterpause + beq skiprasterupdate2 + jsr RASTERMUSICTRACKER+3 +skiprasterupdate2 + endif + endif + endif + + rts + +serviceatarivoxqueue + ifconst AVOXVOICE + lda voxlock + bne skipvoxprocessing ; the vox is in the middle of speech address update +skipvoxqueuesizedec + jmp processavoxvoice +skipvoxprocessing + rts + +processavoxvoice + ifconst HSSUPPORT + ; ** we skip speech if hi-score is on and no vox was detected + ; ** this is to avoid later collision with snes pads. + lda hsdevice + and #2 + beq processavoxvoicereturn + endif ; HSSUPPORT + lda avoxenable + bne avoxfixport + SPKOUT tempavox + rts +avoxfixport + lda #0 ; restore the port to all bits as inputs... + sta CTLSWA + rts +silenceavoxvoice + SPEAK avoxsilentdata +processavoxvoicereturn + rts +avoxsilentdata + .byte 31,255 + else + rts + endif ; AVOXVOICE + +prolinebuttonpadhandler + ifconst MULTIBUTTON + lda framecounter + and #63 + bne jbhandlercont1 + jsr setonebuttonmode + lda #11 + sta port0control,x + jsr snes2atari_signal_go + lda port0control,x + cmp #1 ; check if it's still a proline + beq jbhandlercont1 + jmp buttonreadloopreturn +jbhandlercont1 + lda #2 + sta multibuttoncount0,x + endif ; MULTIBUTTON +joybuttonpadhandler + lda sSWCHA ; clear previous dirs for this pad, from + ora SWCHA_DIRMASK,x ; our sSWCHA nibble. + sta sSWCHA + lda SWCHA ; load th actual joystick dirs, ensuring + ora SWCHA_DIRMASK+1,x ; we don't change the other nibble. + and sSWCHA + sta sSWCHA +joybuttonhandler + txa + asl + tay + lda INPT0,y + lsr + ;ora #%00111111 + sta sINPT1,x + lda INPT1,y + and #%10000000 + ora sINPT1,x + sta sINPT1,x + + lda INPT4,x + bmi .skip1bjoyfirecheck + ;one button joystick is down + eor #%10000000 + sta sINPT1,x + + lda joybuttonmode + and thisjoy2buttonbit,x + beq .skip1bjoyfirecheck + lda joybuttonmode + ora thisjoy2buttonbit,x + sta joybuttonmode + sta SWCHB +.skip1bjoyfirecheck + lda #%00111111 + ora sINPT1,x + sta sINPT1,x ; ensure multibutton bits are hi + jmp buttonreadloopreturn + +SWCHA_DIRMASK + ; p0 p1 p0 + .byte $F0,$0F,$F0 + +gunbuttonhandler ; outside of the conditional, so our button handler LUT is valid + ifconst LIGHTGUNSUPPORT + cpx #0 + bne secondportgunhandler +firstportgunhandler + lda SWCHA + asl + asl + asl ; shift D4 to D7 + and #%10000000 + eor #%10000000 + sta sINPT1 + jmp buttonreadloopreturn +secondportgunhandler + lda SWCHA + lsr ; shift D0 into carry + lsr ; shift carry into D7 + and #%10000000 + eor #%10000000 + sta sINPT3 + jmp buttonreadloopreturn + endif ; LIGHTGUNSUPPORT + +controlsusing2buttoncode + .byte 0 ; 00=no controller plugged in + .byte 1 ; 01=proline joystick + .byte 0 ; 02=lightgun + .byte 0 ; 03=paddle + .byte 1 ; 04=trakball + .byte 1 ; 05=vcs joystick + .byte 1 ; 06=driving control + .byte 0 ; 07=keypad control + .byte 0 ; 08=st mouse/cx80 + .byte 0 ; 09=amiga mouse + .byte 1 ; 10=atarivox + .byte 0 ; 11=snes2atari + .byte 0 ; 12=mega7800 + +buttonhandlerhi + .byte 0 ; 00=no controller plugged in + .byte >prolinebuttonpadhandler ; 01=proline joystick + .byte >gunbuttonhandler ; 02=lightgun + .byte >paddlebuttonhandler ; 03=paddle + .byte >joybuttonhandler ; 04=trakball + .byte >joybuttonpadhandler ; 05=vcs joystick + .byte >joybuttonhandler ; 06=driving control + .byte 0 ; 07=keypad + .byte >mousebuttonhandler ; 08=st mouse + .byte >mousebuttonhandler ; 09=amiga mouse + .byte >joybuttonhandler ; 10=atarivox + .byte >snes2atarihandler ; 11=snes + .byte 0 ; 12=mega7800 +buttonhandlerlo + .byte 0 ; 00=no controller plugged in + .byte $0F means the sound is looped while priority is active + + ora inttemp2 + ora inttemp1 ; check if F|C|V=0 + beq zerosfx ; if so, we're at the end of the sound. + +advancesfxpointer + ; advance the pointer to the next sound chunk + iny + sty inttemp3 + clc + lda sfx1pointlo,x + adc inttemp3 + sta sfx1pointlo,x + lda sfx1pointhi,x + adc #0 + sta sfx1pointhi,x + jmp servicesfxchannelsloop + +sfxsoundloop + pha + lda sfx1priority,x + bne sfxsoundloop_carryon + pla ; fix the stack before we go + jmp advancesfxpointer +sfxsoundloop_carryon + pla + and #$F0 + lsr + lsr + lsr + lsr + +zerosfx + sta sfx1pointlo,x + sta sfx1pointhi,x + sta sfx1priority,x + jmp servicesfxchannelsloop + + +schedulesfx + ; called with sfxinstrumentlo=data sfxpitchoffset=pitch-offset sfxnoteindex=note index + ldy #0 + lda (sfxinstrumentlo),y + ifconst pokeysupport + cmp #$20 ; POKEY? + bne scheduletiasfx + jmp schedulepokeysfx + endif +scheduletiasfx + ;cmp #$10 ; TIA? + ;beq continuescheduletiasfx + ; rts ; unhandled!!! +continuescheduletiasfx + ifnconst TIASFXMONO + lda sfx1pointlo + ora sfx1pointhi + beq schedulesfx1 ;if channel 1 is idle, use it + lda sfx2pointlo + ora sfx2pointhi + beq schedulesfx2 ;if channel 2 is idle, use it + ; Both channels are scheduled. + ldy #1 + lda (sfxinstrumentlo),y + bne interruptsfx + rts ; the new sound has 0 priority and both channels are busy. Skip playing it. +interruptsfx + ;Compare which active sound has a lower priority. We'll interrupt the lower one. + lda sfx1priority + cmp sfx2priority + bcs schedulesfx2 + endif ; !TIASFXMONO + +schedulesfx1 + ldx #0 ; channel 1 + ifnconst TIASFXMONO + beq skipschedulesfx2 +schedulesfx2 + ldx #1 ; channel 2 +skipschedulesfx2 + endif ; !TIASFXMONO + + ifconst MUSICTRACKER + lda sfxnoteindex + bpl skipdrumkitoverride + and #$7F ; subtract 128 + sec + sbc #4 ; drums start at 132, i.e. octave 10 + asl + tay + lda tiadrumkitdefinition,y + sta sfxinstrumentlo + iny + lda tiadrumkitdefinition,y + sta sfxinstrumenthi + lda #0 + sta sfxnoteindex ; and tell the driver it's a non-pitched instrument +skipdrumkitoverride + endif ; MUSICTRACKER + ldy #1 ; get priority and sound-resolution (in frames) + lda (sfxinstrumentlo),y + sta sfx1priority,x + iny + lda (sfxinstrumentlo),y + sta sfx1frames,x + lda sfxinstrumentlo + clc + adc #3 + sta sfx1pointlo,x + lda sfxinstrumenthi + adc #0 + sta sfx1pointhi,x + lda sfxpitchoffset + sta sfx1poffset,x + lda #0 + sta sfx1tick,x + lda sfxnoteindex + sta sfx1notedata,x + rts + +plotsprite + ifnconst NODRAWWAIT + ifconst DOUBLEBUFFER + lda doublebufferstate + bne skipplotspritewait + endif ; DOUBLEBUFFER + ifconst DEBUGWAITCOLOR + lda #$41 + sta BACKGRND + endif +plotspritewait + lda visibleover + bne plotspritewait +skipplotspritewait + ifconst DEBUGWAITCOLOR + lda #$0 + sta BACKGRND + endif + endif + + ;arguments: + ; temp1=lo graphicdata + ; temp2=hi graphicdata + ; temp3=palette | width byte + ; temp4=x + ; temp5=y + ; temp6=mode + lda temp5 ;Y position + lsr ; 2 - Divide by 8 or 16 + lsr ; 2 + lsr ; 2 + if WZONEHEIGHT = 16 + lsr ; 2 + endif + + tax + + ifnconst NOLIMITCHECKING + + ; the next block allows for vertical masking, and ensures we don't overwrite non-DL memory + + cmp #WZONECOUNT + + bcc continueplotsprite1 ; the sprite is fully on-screen, so carry on... + ; otherwise, check to see if the bottom half is in zone 0... + + if WZONEHEIGHT = 16 + cmp #15 + else + cmp #31 + endif + + bne exitplotsprite1 + ldx #0 + jmp continueplotsprite2 +exitplotsprite1 + rts + +continueplotsprite1 + endif + + lda DLPOINTL,x ;Get pointer to DL that this sprite starts in + ifconst DOUBLEBUFFER + clc + adc doublebufferdloffset + endif ; DOUBLEBUFFER + sta dlpnt + lda DLPOINTH,x + ifconst DOUBLEBUFFER + adc #0 + endif ; DOUBLEBUFFER + sta dlpnt+1 + + ;Create DL entry for upper part of sprite + + ldy dlend,x ;Get the index to the end of this DL + + ifconst CHECKOVERWRITE + cpy #DLLASTOBJ + beq checkcontinueplotsprite2 +continueplotsprite1a + endif + + lda temp1 ; graphic data, lo byte + sta (dlpnt),y ;Low byte of data address + + ifnconst ATOMICSPRITEUPDATE + iny + lda temp6 + sta (dlpnt),y + else + iny + sty temp8 + endif + + iny + + lda temp5 ;Y position + and #(WZONEHEIGHT - 1) + cmp #1 ; clear carry if our sprite is just in this zone + ora temp2 ; graphic data, hi byte + sta (dlpnt),y + + + iny + lda temp3 ;palette|width + sta (dlpnt),y + + iny + lda temp4 ;Horizontal position + sta (dlpnt),y + + iny + sty dlend,x + + ifconst ALWAYSTERMINATE + iny + lda #0 + sta (dlpnt),y + endif + + ifconst ATOMICSPRITEUPDATE + ldy temp8 + lda temp6 + sta (dlpnt),y + endif + +checkcontinueplotsprite2 + + bcc doneSPDL ;branch if the sprite was fully in the last zone + + ;Create DL entry for lower part of sprite + + inx ;Next region + + ifnconst NOLIMITCHECKING + cpx #WZONECOUNT + + bcc continueplotsprite2 ; the second half of the sprite is fully on-screen, so carry on... + rts +continueplotsprite2 + endif + + lda DLPOINTL,x ;Get pointer to next DL + ifconst DOUBLEBUFFER + clc + adc doublebufferdloffset + endif ; DOUBLEBUFFER + sta dlpnt + lda DLPOINTH,x + ifconst DOUBLEBUFFER + adc #0 + endif ; DOUBLEBUFFER + sta dlpnt+1 + ldy dlend,x ;Get the index to the end of this DL + + ifconst CHECKOVERWRITE + cpy #DLLASTOBJ + bne continueplotsprite2a + rts +continueplotsprite2a + endif + + lda temp1 ; graphic data, lo byte + sta (dlpnt),y + + ifnconst ATOMICSPRITEUPDATE + iny + lda temp6 + sta (dlpnt),y + else + iny + sty temp8 + endif + + iny + + lda temp5 ;Y position + anc #(WZONEHEIGHT - 1) ; undocumented. A=A&IMM, then move bit 7 into carry + ora temp2 ; graphic data, hi byte + sbc #(WZONEHEIGHT-1) ; start at the DMA hole. -1 because carry is clear + sta (dlpnt),y + + iny + + lda temp3 ;palette|width + sta (dlpnt),y + + iny + + lda temp4 ;Horizontal position + sta (dlpnt),y + + iny + sty dlend,x + + ifconst ALWAYSTERMINATE + iny + lda #0 + sta (dlpnt),y + endif + + ifconst ATOMICSPRITEUPDATE + ldy temp8 + lda temp6 + sta (dlpnt),y + endif + +doneSPDL + rts + + +lockzonex + ifconst ZONELOCKS + ldy dlend,x + cpy #DLLASTOBJ + beq lockzonexreturn ; the zone is either stuffed or locked. abort! + lda DLPOINTL,x + ifconst DOUBLEBUFFER + clc + adc doublebufferdloffset + endif ; DOUBLEBUFFER + sta dlpnt + lda DLPOINTH,x + ifconst DOUBLEBUFFER + adc #0 + endif ; DOUBLEBUFFER + sta dlpnt+1 + iny + lda #0 + sta (dlpnt),y + dey + tya + ldy #(DLLASTOBJ-1) + sta (dlpnt),y + iny + sty dlend,x +lockzonexreturn + rts + endif ; ZONELOCKS +unlockzonex + ifconst ZONELOCKS + ldy dlend,x + cpy #DLLASTOBJ + bne unlockzonexreturn ; if the zone isn't stuffed, it's not locked. abort! + lda DLPOINTL,x + ifconst DOUBLEBUFFER + clc + adc doublebufferdloffset + endif ; DOUBLEBUFFER + sta dlpnt + lda DLPOINTH,x + ifconst DOUBLEBUFFER + adc #0 + endif ; DOUBLEBUFFER + sta dlpnt+1 + dey + ;ldy #(DLLASTOBJ-1) + lda (dlpnt),y + tay + sty dlend,x +unlockzonexreturn + endif ; ZONELOCKS + rts + +plotcharloop + ; ** read from a data indirectly pointed to from temp8,temp9 + ; ** format is: lo_data, hi_data, palette|width, x, y + ; ** format ends with lo_data | hi_data = 0 + + ifconst DOUBLEBUFFER + lda doublebufferstate + bne skipplotcharloopwait + endif ; DOUBLEBUFFER + ifconst DEBUGWAITCOLOR + lda #$61 + sta BACKGRND + endif +plotcharloopwait + lda visibleover + bne plotcharloopwait + ifconst DEBUGWAITCOLOR + lda #0 + sta BACKGRND + endif +skipplotcharloopwait +plotcharlooploop + ldy #0 + lda (temp8),y + sta temp1 + iny + lda (temp8),y + sta temp2 + ora temp1 + bne plotcharloopcontinue + ;the pointer=0, so return + rts +plotcharloopcontinue + iny + lda (temp8),y + sta temp3 + iny + lda (temp8),y + sta temp4 + iny + lda (temp8),y + ;sta temp5 ; not needed with our late entry. + jsr plotcharactersskipentry + lda temp8 + clc + adc #5 + sta temp8 + lda temp9 + adc #0 + sta temp9 + jmp plotcharlooploop + +plotcharacters + ifconst DOUBLEBUFFER + lda doublebufferstate + bne skipplotcharacterswait + endif ; DOUBLEBUFFER + ifconst DEBUGWAITCOLOR + lda #$41 + sta BACKGRND + endif +plotcharacterswait + lda visibleover + bne plotcharacterswait + ifconst DEBUGWAITCOLOR + sta BACKGRND + endif +skipplotcharacterswait + ;arguments: + ; temp1=lo charactermap + ; temp2=hi charactermap + ; temp3=palette | width byte + ; temp4=x + ; temp5=y + + lda temp5 ;Y position + +plotcharactersskipentry + + ;ifconst ZONEHEIGHT + ; if ZONEHEIGHT = 16 + ; and #$0F + ; endif + ; if ZONEHEIGHT = 8 + ; and #$1F + ; endif + ;else + ; and #$0F + ;endif + + tax + lda DLPOINTL,x ;Get pointer to DL that the characters are in + ifconst DOUBLEBUFFER + clc + adc doublebufferdloffset + endif ; DOUBLEBUFFER + sta dlpnt + lda DLPOINTH,x + ifconst DOUBLEBUFFER + adc #0 + endif ; DOUBLEBUFFER + sta dlpnt+1 + + ;Create DL entry for the characters + + ldy dlend,x ;Get the index to the end of this DL + + ifconst CHECKOVERWRITE + cpy #DLLASTOBJ + bne continueplotcharacters + rts +continueplotcharacters + endif + + lda temp1 ; character map data, lo byte + sta (dlpnt),y ;(1) store low address + + iny + lda charactermode + sta (dlpnt),y ;(2) store mode + + iny + lda temp2 ; character map, hi byte + sta (dlpnt),y ;(3) store high address + + iny + lda temp3 ;palette|width + sta (dlpnt),y ;(4) store palette|width + + iny + lda temp4 ;Horizontal position + sta (dlpnt),y ;(5) store horizontal position + + iny + sty dlend,x ; save display list end byte + rts + + + ifconst plotvalueonscreen +plotcharacterslive + ; a version of plotcharacters that draws live and minimally disrupts the screen... + + ;arguments: + ; temp1=lo charactermap + ; temp2=hi charactermap + ; temp3=palette | width byte + ; temp4=x + ; temp5=y + + lda temp5 ;Y position + + tax + lda DLPOINTL,x ;Get pointer to DL that the characters are in + ifconst DOUBLEBUFFER + clc + adc doublebufferdloffset + endif ; DOUBLEBUFFER + sta dlpnt + lda DLPOINTH,x + ifconst DOUBLEBUFFER + adc #0 + endif ; DOUBLEBUFFER + sta dlpnt+1 + + ;Create DL entry for the characters + + ldy dlend,x ;Get the index to the end of this DL + + ifconst CHECKOVERWRITE + cpy #DLLASTOBJ + bne continueplotcharacterslive + rts +continueplotcharacterslive + endif + + lda temp1 ; character map data, lo byte + sta (dlpnt),y ;(1) store low address + + iny + ; we don't add the second byte yet, since the charmap could briefly + ; render without a proper character map address, width, or position. + lda charactermode + sta (dlpnt),y ;(2) store mode + + iny + lda temp2 ; character map, hi byte + sta (dlpnt),y ;(3) store high address + + iny + lda temp3 ;palette|width + sta (dlpnt),y ;(4) store palette|width + + iny + lda temp4 ;Horizontal position + sta (dlpnt),y ;(5) store horizontal position + + iny + sty dlend,x ; save display list end byte + + rts + endif ;plotcharacterslive + + ifconst USED_PLOTVALUE +plotvalue + ; calling 7800basic command: + ; plotvalue digit_gfx palette variable/data number_of_digits screen_x screen_y + ; ...displays the variable as BCD digits + ; + ; asm sub arguments: + ; temp1=lo charactermap + ; temp2=hi charactermap + ; temp3=palette | width byte + ; temp4=x + ; temp5=y + ; temp6=number of digits + ; temp7=lo variable + ; temp8=hi variable + ; temp9=character mode + +plotdigitcount = temp6 + + ifconst ZONELOCKS + ldx temp5 + ldy dlend,x + cpy #DLLASTOBJ + bne carryonplotvalue + rts +carryonplotvalue + endif + + lda #0 + tay + ldx valbufend + + lda plotdigitcount + and #1 + beq pvnibble2char + lda #0 + sta VALBUFFER,x ; just in case we skip this digit + beq pvnibble2char_skipnibble + +pvnibble2char + ; high nibble... + lda (temp7),y + and #$f0 + lsr + lsr + lsr + ifnconst DOUBLEWIDE ; multiply value by 2 for double-width + lsr + endif + + clc + adc temp1 ; add the offset to character graphics to our value + sta VALBUFFER,x + inx + dec plotdigitcount + +pvnibble2char_skipnibble + ; low nibble... + lda (temp7),y + and #$0f + ifconst DOUBLEWIDE ; multiply value by 2 for double-width + asl + endif + clc + adc temp1 ; add the offset to character graphics to our value + sta VALBUFFER,x + inx + iny + + dec plotdigitcount + bne pvnibble2char + + ;point to the start of our valuebuffer + clc + lda #VALBUFFER + adc #0 + sta temp2 + + ;advance valbufend to the end of our value buffer + stx valbufend + + ifnconst plotvalueonscreen + jmp plotcharacters + else + jmp plotcharacterslive + endif + + endif ; USED_PLOTVALUE + + + ifconst USED_PLOTVALUEEXTRA +plotdigitcount = temp6 +plotvalueextra + ; calling 7800basic command: + ; plotvalue digit_gfx palette variable/data number_of_digits screen_x screen_y + ; ...displays the variable as BCD digits + ; + ; asm sub arguments: + ; temp1=lo charactermap + ; temp2=hi charactermap + ; temp3=palette | width byte + ; temp4=x + ; temp5=y + ; temp6=number of digits + ; temp7=lo variable + ; temp8=hi variable + + lda #0 + tay + ldx valbufend + ifnconst plotvalueonscreen + sta VALBUFFER,x + endif + + lda plotdigitcount + and #1 + + bne pvnibble2char_skipnibbleextra + +pvnibble2charextra + ; high nibble... + lda (temp7),y + and #$f0 + lsr + lsr + ifnconst DOUBLEWIDE ; multiply value by 2 for double-width + lsr + endif + clc + adc temp1 ; add the offset to character graphics to our value + sta VALBUFFER,x + inx + + ; second half of the digit + clc + adc #1 + sta VALBUFFER,x + inx + +pvnibble2char_skipnibbleextra + ; low nibble... + lda (temp7),y + and #$0f + ifconst DOUBLEWIDE ; multiply value by 2 for double-width + asl + endif + asl + + clc + adc temp1 ; add the offset to character graphics to our value + sta VALBUFFER,x + inx + + clc + adc #1 + sta VALBUFFER,x + inx + iny + + dec plotdigitcount + bne pvnibble2charextra + + ;point to the start of our valuebuffer + clc + lda #VALBUFFER + adc #0 + sta temp2 + + ;advance valbufend to the end of our value buffer + stx valbufend + + ifnconst plotvalueonscreen + jmp plotcharacters + else + jmp plotcharacterslive + endif + endif ; USED_PLOTVALUEEXTRA + +boxcollision + ifconst BOXCOLLISION + ; the worst case cycle-time for the code below is 43 cycles. + ; unfortunately, prior to getting here we've burned 44 cycles in argument setup. eep! + + ;__boxx1 = accumulator + ;__boxy1 = y +__boxw1 = temp3 +__boxh1 = temp4 + +__boxx2 = temp5 +__boxy2 = temp6 +__boxw2 = temp7 +__boxh2 = temp8 + +DoXCollisionCheck + ;lda __boxx1 ; skipped. already in the accumulator + cmp __boxx2 ;3 + bcs X1isbiggerthanX2 ;2/3 +X2isbiggerthanX1 + ; carry is clear + adc __boxw1 ;3 + cmp __boxx2 ;3 + bcs DoYCollisionCheck ;3/2 + rts ;6 - carry clear, no collision +X1isbiggerthanX2 + clc ;2 + sbc __boxw2 ;3 + cmp __boxx2 ;3 + bcs noboxcollision ;3/2 +DoYCollisionCheck + tya ; 2 ; use to be "lda __boxy1" + cmp __boxy2 ;3 + bcs Y1isbiggerthanY2 ;3/2 +Y2isbiggerthanY1 + ; carry is clear + adc __boxh1 ;3 + cmp __boxy2 ;3 + rts ;6 +Y1isbiggerthanY2 + clc ;2 + sbc __boxh2 ;3 + cmp __boxy2 ;3 + bcs noboxcollision ;3/2 +yesboxcollision + sec ;2 + rts ;6 +noboxcollision + clc ;2 + rts ;6 + endif ; BOXCOLLISION + +randomize + lda rand + lsr + rol rand16 + bcc noeor + eor #$B4 +noeor + sta rand + eor rand16 + rts + + ; *** bcd conversion routine courtesy Omegamatrix + ; *** http://atariage.com/forums/blog/563/entry-10832-hex-to-bcd-conversion-0-99/ + ifconst .calledfunction_converttobcd +converttobcd + ;value to convert is in the accumulator + sta temp1 + lsr + adc temp1 + ror + lsr + lsr + adc temp1 + ror + adc temp1 + ror + lsr + and #$3C + sta temp2 + lsr + adc temp2 + adc temp1 + rts ; return the result in the accumulator + endif ; .calledfunction_converttobcd + + ifconst .calledfunction_mul8 + ; Y and A contain multiplicands, result in A +mul8 + sty temp1 + sta temp2 + lda #0 +reptmul8 + lsr temp2 + bcc skipmul8 + clc + adc temp1 + ;bcs donemul8 might save cycles? +skipmul8 + ;beq donemul8 might save cycles? + asl temp1 + bne reptmul8 +donemul8 + rts + endif ; .calledfunction_mul8 + + ifconst .calledfunction_div8 +div8 + ; A=numerator Y=denominator, result in A + cpy #2 + bcc div8end+1;div by 0 = bad, div by 1=no calc needed, so bail out + sty temp1 + ldy #$ff +div8loop + sbc temp1 + iny + bcs div8loop +div8end + tya + ; result in A + rts + endif ; .calledfunction_div8 + + ifconst .calledfunction_mul16 + ; Y and A contain multiplicands, result in temp2,A=low, temp1=high +mul16 + sty temp1 + sta temp2 + + lda #0 + ldx #8 + lsr temp1 +mul16_1 + bcc mul16_2 + clc + adc temp2 +mul16_2 + ror + ror temp1 + dex + bne mul16_1 + sta temp2 + rts + endif ; .calledfunction_mul16 + + ifconst .calledfunction_div16 + ; div int/int + ; numerator in A, denom in temp1 + ; returns with quotient in A, remainder in temp1 +div16 + sta temp2 + sty temp1 + lda #0 + ldx #8 + asl temp2 +div16_1 + rol + cmp temp1 + bcc div16_2 + sbc temp1 +div16_2 + rol temp2 + dex + bne div16_1 + sta temp1 + lda temp2 + rts + endif ; .calledfunction_div16 + + ifconst bankswitchmode +BS_jsr + ifconst dumpbankswitch + sta dumpbankswitch + endif + ifconst MCPDEVCART + ora #$18 + sta $3000 + else + sta $8000 + endif + pla + tax + pla + rts + +BS_return + pla ; bankswitch bank + ifconst dumpbankswitch + sta dumpbankswitch + endif + ifconst BANKRAM + sta currentbank + ora currentrambank + endif + ifconst MCPDEVCART + ora #$18 + sta $3000 + else + sta $8000 + endif + pla ; bankswitch $0 flag + rts + endif + +checkselectswitch + lda SWCHB ; check the real select switch... + and #%00000010 +checkselectswitchreturn + rts + +checkresetswitch + lda SWCHB ; check the real reset switch... + and #%00000001 + rts + + ifconst FINESCROLLENABLED +finescrolldlls + ldx temp1 ; first DLL index x3 + lda DLLMEM,x + and #%11110000 + ora finescrolly + sta DLLMEM,x + + ldx temp2 ; last DLL index x3 + lda DLLMEM,x + and #%11110000 + ora finescrolly + eor #(WZONEHEIGHT-1) + sta DLLMEM,x + rts + endif ; FINESCROLLENABLED + + ifconst USED_ADJUSTVISIBLE +adjustvisible + ; called with temp1=first visible zone *3, temp2=last visible zone *3 + jsr waitforvblankstart ; ensure vblank just started + ldx visibleDLLstart +findfirstinterrupt + lda DLLMEM,x + bmi foundfirstinterrupt + inx + inx + inx + bne findfirstinterrupt +foundfirstinterrupt + and #%01111111 ; clear the interrupt bit + sta DLLMEM,x + ifconst DOUBLEBUFFER + sta DLLMEM+DBOFFSET,x + endif ; DOUBLEBUFFER + ldx overscanDLLstart +findlastinterrupt + lda DLLMEM,x + bmi foundlastinterrupt + dex + dex + dex + bne findlastinterrupt +foundlastinterrupt + and #%01111111 ; clear the interrupt bit + sta DLLMEM,x + ifconst DOUBLEBUFFER + sta DLLMEM+DBOFFSET,x + endif ; DOUBLEBUFFER + ;now we need to set the new interrupts + clc + lda temp1 + adc visibleDLLstart + tax + lda DLLMEM,x + ora #%10000000 + sta DLLMEM,x + ifconst DOUBLEBUFFER + sta DLLMEM+DBOFFSET,x + endif ; DOUBLEBUFFER + clc + lda temp2 + adc visibleDLLstart + tax + lda DLLMEM,x + ora #%10000000 + sta DLLMEM,x + ifconst DOUBLEBUFFER + sta DLLMEM+DBOFFSET,x + endif ; DOUBLEBUFFER + jsr vblankresync + rts + endif ; USED_ADJUSTVISIBLE + +vblankresync + jsr waitforvblankstart ; ensure vblank just started + lda #0 + sta visibleover + lda #3 + sta interruptindex + rts + +createallgamedlls + ldx #0 + lda #NVLINES + ldy paldetected + beq skipcreatePALpadding + clc + adc #21 +skipcreatePALpadding + jsr createnonvisibledlls + stx visibleDLLstart + jsr createvisiblezones + stx overscanDLLstart +createallgamedllscontinue + lda #(NVLINES+55) ; extras for PAL + jsr createnonvisibledlls + + ldx visibleDLLstart + lda DLLMEM,x + ora #%10000000 ; NMI 1 - start of visible screen + sta DLLMEM,x + ifconst DOUBLEBUFFER + sta DLLMEM+DBOFFSET,x + endif ; DOUBLEBUFFER + + ldx overscanDLLstart + lda DLLMEM,x + ora #%10000011 ; NMI 2 - end of visible screen + and #%11110011 ; change this to a 1-line DLL, so there's time enough for the "deeper overscan" DLL + sta DLLMEM,x + ifconst DOUBLEBUFFER + sta DLLMEM+DBOFFSET,x + endif ; DOUBLEBUFFER + + inx + inx + inx + + lda DLLMEM,x + ora #%10000000 ; NMI 3 - deeper overscan + sta DLLMEM,x + ifconst DOUBLEBUFFER + sta DLLMEM+DBOFFSET,x + endif ; DOUBLEBUFFER + + rts + +createnonvisibledlls + sta temp1 + lsr + lsr + lsr + lsr ; /16 + beq skipcreatenonvisibledlls1loop + tay +createnonvisibledlls1loop + lda #%01001111 ;low nibble=16 lines, high nibble=Holey DMA + jsr createblankdllentry + dey + bne createnonvisibledlls1loop +skipcreatenonvisibledlls1loop + lda temp1 + and #%00001111 + beq createnonvisibledllsreturn + sec + sbc #1 + ora #%01000000 + jsr createblankdllentry +createnonvisibledllsreturn + rts + +createblankdllentry + sta DLLMEM,x + ifconst DOUBLEBUFFER + sta DLLMEM+DBOFFSET,x + endif ; DOUBLEBUFFER + inx + lda #$21 ; blank + sta DLLMEM,x + ifconst DOUBLEBUFFER + sta DLLMEM+DBOFFSET,x + endif ; DOUBLEBUFFER + inx + lda #$00 + sta DLLMEM,x + ifconst DOUBLEBUFFER + sta DLLMEM+DBOFFSET,x + endif ; DOUBLEBUFFER + inx + rts + +createvisiblezones + ldy #0 +createvisiblezonesloop + lda.w DLHEIGHT,y + ora #(WZONEHEIGHT * 4) ; set Holey DMA for 8 or 16 tall zones + sta DLLMEM,x + ifconst DOUBLEBUFFER + sta DLLMEM+DBOFFSET,x + endif ; DOUBLEBUFFER + inx + lda DLPOINTH,y + ifconst BANKSET_DL_IN_CARTRAM + ; with bankset cart ram, we added $8000 to the DL address so plot functions would hit the write-address + ; but now we need to subtract that $8000 location to give Maria the normal address + sec + sbc #$80 + endif ; BANKSET_DL_IN_CARTRAM + sta DLLMEM,x + ifconst DOUBLEBUFFER + sta DLLMEM+DBOFFSET,x + endif ; DOUBLEBUFFER + inx + lda DLPOINTL,y + sta DLLMEM,x + ifconst DOUBLEBUFFER + clc + adc #DOUBLEBUFFEROFFSET + sta DLLMEM+DBOFFSET,x + bcc skiphidoublebufferadjust ; dlls are big endian, so we need to fix the hi byte after-the-fact... + inc DLLMEM+DBOFFSET-1,x +skiphidoublebufferadjust + endif ; DOUBLEBUFFER + inx + iny + cpy #WZONECOUNT + bne createvisiblezonesloop + rts + +waitforvblankstart +vblankendwait + BIT MSTAT + bmi vblankendwait +vblankstartwait + BIT MSTAT + bpl vblankstartwait + rts + + ifconst DOUBLEBUFFER +flipdisplaybufferreturn + rts +flipdisplaybuffer + ifconst interrupthold + lda #$FF + sta interrupthold + endif + lda doublebufferstate + beq flipdisplaybufferreturn ; exit if we're not in double-buffer + + jsr terminatedisplaybuffer ; terminate the working buffer before we flip + + lda doublebufferstate + lsr ; /2, so we'll see 0 or 1, rather than 1 or 3 + tax + + ; ensure we don't flip mid-display. otherwise the displayed DL will be the one the game is working on. + +flipdisplaybufferwait1 + lda visibleover + beq flipdisplaybufferwait1 + +flipdisplaybufferwait + lda visibleover + bne flipdisplaybufferwait + + lda doublebufferminimumframetarget + beq skipminimumframecode + lda doublebufferminimumframeindex + bne flipdisplaybufferwait1 + lda doublebufferminimumframetarget + sta doublebufferminimumframeindex +skipminimumframecode + + lda DLLMEMLutHi,x + sta DPPH + lda DLLMEMLutLo,x + sta DPPL + + lda NewPageflipstate,x + sta doublebufferstate + lda NewPageflipoffset,x + sta doublebufferdloffset + + ifnconst BANKSET_DL_IN_CARTRAM + lda doublebufferbufferdirty + beq flipdisplaybufferreturn + + ; The doublebuffer buffer is dirty, so the game code must have issued a savescreen recently. + ; To make savescreen work with the new working buffer, we need to copy over the saved objects + ; from the displayed buffer to the working buffer... + + lda doublebufferdloffset + eor #DOUBLEBUFFEROFFSET + sta temp6 ; make temp6 the anti-doublebufferdloffset variable + + ldx #(WZONECOUNT-1) +copybufferzoneloop + + lda DLPOINTL,x + clc + adc doublebufferdloffset + sta temp1 + lda DLPOINTH,x + adc #0 + sta temp2 + + lda DLPOINTL,x + clc + adc temp6 + sta temp3 + lda DLPOINTH,x + adc #0 + sta temp4 + + lda dlendsave,x + tay +copybuffercharsloop + lda (temp3),y + sta (temp1),y + dey + bpl copybuffercharsloop + dex + bpl copybufferzoneloop + lda #0 + sta doublebufferbufferdirty + endif ; ! BANKSET_DL_IN_CARTRAM + rts + +doublebufferoff + lda #1 + sta doublebufferstate + jsr flipdisplaybuffer + lda #0 + sta doublebufferstate + sta doublebufferdloffset + rts + +DLLMEMLutLo + .byte DLLMEM,>(DLLMEM+DBOFFSET) +NewPageflipstate + .byte 3,1 +NewPageflipoffset + .byte DOUBLEBUFFEROFFSET,0 + + endif ; DOUBLEBUFFER + + ifconst MOUSESUPPORT + +rotationalcompare + ; old = 00 01 10 11 + .byte $00, $01, $ff, $00 ; new=00 + .byte $ff, $00, $00, $01 ; new=01 + .byte $01, $00, $00, $ff ; new=10 + .byte $00, $ff, $01, $00 ; new=11 + + ; 0000YyXx st mouse + + ; 0000xyXY amiga mouse + + ifconst MOUSEXONLY +amigatoataribits ; swap bits 1 and 4... + .byte %0000, %0000, %0010, %0010 + .byte %0000, %0000, %0010, %0010 + .byte %0001, %0001, %0011, %0011 + .byte %0001, %0001, %0011, %0011 + + ; null change bits + .byte %0000, %0001, %0010, %0011 + .byte %0000, %0001, %0010, %0011 + .byte %0000, %0001, %0010, %0011 + .byte %0000, %0001, %0010, %0011 + + else ; !MOUSEXONLY + +amigatoataribits ; swap bits 1 and 4... + .byte %0000, %1000, %0010, %1010 + .byte %0100, %1100, %0110, %1110 + .byte %0001, %1001, %0011, %1011 + .byte %0101, %1101, %0111, %1111 + ; null change bits + .byte %0000, %0001, %0010, %0011 + .byte %0100, %0101, %0110, %0111 + .byte %1000, %1001, %1010, %1011 + .byte %1100, %1101, %1110, %1111 + endif ; !MOUSEXONLY + + endif ; MOUSESUPPORT + +mouse0update + ifconst MOUSE0SUPPORT + +mousetableselect = inttemp2 +mousexdelta = inttemp3 +mouseydelta = inttemp4 +lastSWCHA = inttemp6 + + ; 0000YyXx st mouse + ; 0000xyXY amiga mouse + + lda #$ff + sta lastSWCHA + + ldy port0control + + lda #%00010000 + cpy #9 ; AMIGA? + bne skipamigabitsfix0 + lda #0 +skipamigabitsfix0 + sta mousetableselect + ifconst DRIVINGBOOST + cpy #6 ; DRIVING? + bne skipdriving0setup + ; swap mousex0 and mousey0. mousex seen by the 7800basic program + ; trails the actual mousex0, so we can smoothly interpolate toward + ; the actual position. This actual position is stored in mousey0 + ; after the driver has run. + ldx mousex0 + lda mousey0 + stx mousey0 + sta mousex0 +skipdriving0setup + endif ; DRIVINGBOOST + + lda #0 + sta mousexdelta + sta mouseydelta + + ifnconst MOUSETIME + ifnconst MOUSEXONLY + lda #180 ; minimum for x+y + else + lda #100 ; minimum for just x + endif + else + lda #MOUSETIME + endif + jsr SETTIM64T ; INTIM is in Y + +mouse0updateloop + lda SWCHA + asr #%11110000 ; Undocumented. A = A & #IMM, then LSR A. + cmp lastSWCHA + beq mouse0loopcondition + sta lastSWCHA + lsr + lsr + lsr + + ora mousetableselect ; atari/amiga decoding table selection + + ; st mice encode on different bits/joystick-lines than amiga mice... + ; 0000YyXx st mouse + ; 0000xyXY amiga mouse + ; ...so can shuffle the amiga bits to reuse the st driver. + tay + lax amigatoataribits,y + + ifnconst MOUSEXONLY + ; first the Y... + and #%00001100 + ora mousecodey0 + tay + lda rotationalcompare,y + clc + adc mouseydelta + sta mouseydelta + tya + lsr + lsr + sta mousecodey0 + txa + ; ...then the X... + and #%00000011 + tax + endif ; !MOUSEXONLY + + asl + asl + ora mousecodex0 + tay + lda rotationalcompare,y + adc mousexdelta ; carry was clear by previous ASL + sta mousexdelta + stx mousecodex0 +mouse0loopcondition + lda TIMINT + bpl mouse0updateloop + + ; *** adapt to selected device resolution. + ldx port0control + + ifconst PRECISIONMOUSING + ldy port0resolution + bne mouse0halveddone + cpx #6 ; half-resolution is no good for driving wheels + beq mouse0halveddone + ; resolution=0 is half mouse resolution, necessary for precision + ; mousing on a 160x240 screen with a 1000 dpi mouse. + + lda mousexdelta + cmp #$80 + ror ; do a signed divide by 2. + clc + adc mousex0 + sta mousex0 + ifnconst MOUSEXONLY + lda mouseydelta + clc + adc mousey0 + sta mousey0 + endif + ; at half resolution we just exit after updating x and y + jmp LLRET0 +mouse0halveddone + endif ; PRECISIONMOUSING + + ifnconst MOUSEXONLY + asl mouseydelta ; *2 because Y resolution is finer + ldy port0resolution + dey + lda #0 +mousey0resolutionfix + clc + adc mouseydelta + dey + bpl mousey0resolutionfix + clc + adc mousey0 + sta mousey0 + endif ; MOUSEXONLY + + ldy port0resolution + dey + lda #0 +mousex0resolutionfix + clc + adc mousexdelta + dey + bpl mousex0resolutionfix + ifnconst DRIVINGBOOST + clc + adc mousex0 + sta mousex0 + else + cpx #6 + beq carryonmouse0boost + clc + adc mousex0 + sta mousex0 + jmp LLRET0 +carryonmouse0boost + sta mousexdelta + clc + adc mousecodey0 + sta mousecodey0 + clc + adc mousex0 + tay ; save the target X + adc mousey0 ; average in the smoothly-trailing X + ror + sta mousex0 ; mousex0 now has the smoothly trailing X + sty mousey0 ; and mousey0 has the the target X + + ; check to see if the coordinate wrapped. If so, undo the averaging code. + ; A has mousex0, the smoothly trailing X + sbc mousey0 ; less the target X + bpl skipabsolutedrive0 + eor #$ff +skipabsolutedrive0 + cmp #64 ; just an unreasonably large change + bcc skipdrivewrapfix0 + sty mousex0 ; if X wrapped, we catch the trailing X up to the target X +skipdrivewrapfix0 + + ; get rid of the tweening if the distance travelled was very small + lda mousexdelta + cmp port0resolution + bcs skipbetweenfix0 + lda mousex0 + sta mousey0 +skipbetweenfix0 + +drivingboostreductioncheck0 + ; The below code amounts to mousecodey0=mousecodey0-(mousecodey0/8) + ; +ve mousecodey0 is converted to -ve to do the calculation, and then + ; negated again because truncation during BCD math results in + ; differing magnitudes, depending if the value is +ve or -ve. +driving0fix + lax mousecodey0 + cmp #$80 + bcs driving0skipnegate1 + eor #$FF + adc #1 + sta mousecodey0 +driving0skipnegate1 + cmp #$80 + ror + cmp #$80 + ror + cmp #$80 + ror + sta inttemp1 + lda mousecodey0 + sec + sbc inttemp1 + cpx #$80 + bcs driving0skipnegate2 + eor #$FF + adc #1 +driving0skipnegate2 + sta mousecodey0 +drivingboostdone0 + endif ; DRIVINGBOOST + + jmp LLRET0 + + endif ; MOUSE0SUPPORT + +mouse1update + ifconst MOUSE1SUPPORT + +mousetableselect = inttemp2 +mousexdelta = inttemp3 +mouseydelta = inttemp4 +lastSWCHA = inttemp6 + + ; 0000YyXx st mouse + ; 0000xyXY amiga mouse + + lda #$ff + sta lastSWCHA + + ldy port1control + + lda #%00010000 + cpy #9 ; AMIGA? + bne skipamigabitsfix1 + lda #0 +skipamigabitsfix1 + sta mousetableselect + ifconst DRIVINGBOOST + cpy #6 ; DRIVING? + bne skipdriving1setup + ; swap mousex1 and mousey1. mousex seen by the 7800basic program + ; trails the actual mousex1, so we can smoothly interpolate toward + ; the actual position. This actual position is stored in mousey1 + ; after the driver has run. + ldx mousex1 + lda mousey1 + stx mousey1 + sta mousex1 +skipdriving1setup + endif ; DRIVINGBOOST + + lda #0 + sta mousexdelta + sta mouseydelta + + ifnconst MOUSETIME + ifnconst MOUSEXONLY + lda #180 ; minimum for x+y + else + lda #100 ; minimum for just x + endif + else + lda #MOUSETIME + endif + jsr SETTIM64T ; INTIM is in Y + +mouse1updateloop + lda SWCHA + and #%00001111 + cmp lastSWCHA + beq mouse1loopcondition + sta lastSWCHA + + ora mousetableselect ; atari/amiga decoding table selection + + ; st mice encode on different bits/joystick-lines than amiga mice... + ; 0000YyXx st mouse + ; 0000xyXY amiga mouse + ; ...so can shuffle the amiga bits to reuse the st driver. + tay + lax amigatoataribits,y + + ifnconst MOUSEXONLY + ; first the Y... + and #%00001100 + ora mousecodey1 + tay + lda rotationalcompare,y + clc + adc mouseydelta + sta mouseydelta + tya + lsr + lsr + sta mousecodey1 + txa + ; ...then the X... + and #%00000011 + tax + endif ; !MOUSEXONLY + + asl + asl + ora mousecodex1 + tay + lda rotationalcompare,y + adc mousexdelta ; carry was clear by previous ASL + sta mousexdelta + stx mousecodex1 +mouse1loopcondition + lda TIMINT + bpl mouse1updateloop + + ; *** adapt to selected device resolution. + ldx port1control + + ifconst PRECISIONMOUSING + ldy port1resolution + bne mouse1halveddone + cpx #6 ; half-resolution is no good for driving wheels + beq mouse1halveddone + ; resolution=0 is half mouse resolution, necessary for precision + ; mousing on a 160x240 screen with a 1000 dpi mouse. + + lda mousexdelta + cmp #$80 + ror ; do a signed divide by 2. + clc + adc mousex1 + sta mousex1 + ifnconst MOUSEXONLY + lda mouseydelta + clc + adc mousey1 + sta mousey1 + endif + ; at half resolution we just exit after updating x and y + jmp LLRET1 +mouse1halveddone + endif ; PRECISIONMOUSING + + ifnconst MOUSEXONLY + asl mouseydelta ; *2 because Y resolution is finer + ldy port1resolution + dey + lda #0 +mousey1resolutionfix + clc + adc mouseydelta + dey + bpl mousey1resolutionfix + clc + adc mousey1 + sta mousey1 + endif ; MOUSEXONLY + + ldy port1resolution + dey + lda #0 +mousex1resolutionfix + clc + adc mousexdelta + dey + bpl mousex1resolutionfix + ifnconst DRIVINGBOOST + clc + adc mousex1 + sta mousex1 + else + cpx #6 + beq carryonmouse1boost + clc + adc mousex1 + sta mousex1 + jmp LLRET1 +carryonmouse1boost + sta mousexdelta + clc + adc mousecodey1 + sta mousecodey1 + clc + adc mousex1 + tay ; save the target X + adc mousey1 ; average in the smoothly-trailing X + ror + sta mousex1 ; mousex0 now has the smoothly trailing X + sty mousey1 ; and mousey0 has the the target X + + ; check to see if the coordinate wrapped. If so, undo the averaging code. + ; A has mousex1, the smoothly trailing X + sbc mousey1 ; less the target X + bpl skipabsolutedrive1 + eor #$ff +skipabsolutedrive1 + cmp #64 ; just an unreasonably large change + bcc skipdrivewrapfix1 + sty mousex1 ; if X wrapped, we catch the trailing X up to the target X +skipdrivewrapfix1 + + ; get rid of the tweening if the distance travelled was very small + lda mousexdelta + cmp port1resolution + bcs skipbetweenfix1 + lda mousex1 + sta mousey1 +skipbetweenfix1 + +drivingboostreductioncheck1 + ; The below code amounts to mousecodey0=mousecodey0-(mousecodey0/8) + ; +ve mousecodey0 is converted to -ve to do the calculation, and then + ; negated again because truncation during BCD math results in + ; differing magnitudes, depending if the value is +ve or -ve. +driving1fix + lax mousecodey1 + cmp #$80 + bcs driving0skipnegate1 + eor #$FF + adc #1 + sta mousecodey1 +driving0skipnegate1 + cmp #$80 + ror + cmp #$80 + ror + cmp #$80 + ror + sta inttemp1 + lda mousecodey1 + sec + sbc inttemp1 + cpx #$80 + bcs driving1skipnegate2 + eor #$FF + adc #1 +driving1skipnegate2 + sta mousecodey1 +drivingboostdone1 + endif ; DRIVINGBOOST + + jmp LLRET1 + + endif ; MOUSE1SUPPORT + + +trakball0update + ifconst TRAKBALL0SUPPORT + ifnconst TRAKTIME + ifnconst TRAKXONLY + lda #180 ; minimum for x+y + else; !TRAKXONLY + lda #100 ; minimum for just x + endif; !TRAKXONLY + else ; !TRAKTIME + lda #TRAKTIME + endif ; !TRAKTIME + jsr SETTIM64T ; INTIM is in Y + ldx #0 + ifnconst TRAKXONLY + ldy #0 + endif ; TRAKXONLY +trakball0updateloop + lda SWCHA + and #%00110000 + cmp trakballcodex0 + sta trakballcodex0 + beq trakball0movementXdone + and #%00010000 + beq trakball0negativeX +trakball0positiveX + ;(2 from beq) + inx ; 2 + jmp trakball0movementXdone ; 3 +trakball0negativeX + ;(3 from beq) + dex ; 2 + nop ; 2 +trakball0movementXdone + + ifnconst TRAKXONLY + lda SWCHA + and #%11000000 + cmp trakballcodey0 + sta trakballcodey0 + beq trakball0movementYdone + and #%01000000 + beq trakball0negativeY +trakball0positiveY + ;(2 from beq) + iny ; 2 + jmp trakball0movementYdone ; 3 +trakball0negativeY + ;(3 from beq) + dey ; 2 + nop ; 2 +trakball0movementYdone + endif ; !TRAKXONLY + + lda TIMINT + bpl trakball0updateloop + lda #0 + cpx #0 + beq trakball0skipXadjust + clc +trakball0Xloop + adc port0resolution + dex + bne trakball0Xloop + clc + adc trakballx0 + sta trakballx0 +trakball0skipXadjust + ifnconst TRAKXONLY + lda #0 + cpy #0 + beq trakball0skipYadjust + clc +trakball0yloop + adc port0resolution + dey + bne trakball0yloop + clc + adc trakbally0 + sta trakbally0 +trakball0skipYadjust + endif ; !TRAKXONLY + + jmp LLRET0 + endif + + + +trakball1update + ifconst TRAKBALL1SUPPORT + ifnconst TRAKTIME + ifnconst TRAKXONLY + lda #180 ; minimum for x+y + else; !TRAKXONLY + lda #100 ; minimum for just x + endif; !TRAKXONLY + else ; !TRAKTIME + lda #TRAKTIME + endif ; !TRAKTIME + jsr SETTIM64T ; INTIM is in Y + ldx #0 + ifnconst TRAKXONLY + ldy #0 + endif ; TRAKXONLY +trakball1updateloop + lda SWCHA + and #%00000011 + cmp trakballcodex1 + sta trakballcodex1 + beq trakball1movementXdone + and #%00000001 + beq trakball1negativeX +trakball1positiveX + ;(2 from beq) + inx ; 2 + jmp trakball1movementXdone ; 3 +trakball1negativeX + ;(3 from beq) + dex ; 2 + nop ; 2 +trakball1movementXdone + + ifnconst TRAKXONLY + lda SWCHA + and #%00001100 + cmp trakballcodey1 + sta trakballcodey1 + beq trakball1movementYdone + and #%00000100 + beq trakball1negativeY +trakball1positiveY + ;(2 from beq) + iny ; 2 + jmp trakball1movementYdone ; 3 +trakball1negativeY + ;(3 from beq) + dey ; 2 + nop ; 2 +trakball1movementYdone + endif ; !TRAKXONLY + + lda TIMINT + bpl trakball1updateloop + lda #0 + cpx #0 + beq trakball1skipXadjust + clc +trakball1Xloop + adc port1resolution + dex + bne trakball1Xloop + clc + adc trakballx1 + sta trakballx1 +trakball1skipXadjust + ifnconst TRAKXONLY + lda #0 + cpy #0 + beq trakball1skipYadjust + clc +trakball1yloop + adc port1resolution + dey + bne trakball1yloop + clc + adc trakbally1 + sta trakbally1 +trakball1skipYadjust + endif ; !TRAKXONLY + + jmp LLRET1 + endif + + +paddleport0update + ifconst PADDLE0SUPPORT + lda #6 + sta VBLANK ; start charging the paddle caps + lda #0 ; use PADDLE timing + jsr SETTIM64T ; INTIM is in Y + +paddleport0updateloop + lda INPT0 + bmi skippaddle0setposition + sty paddleposition0 +skippaddle0setposition + ifconst TWOPADDLESUPPORT + lda INPT1 + bmi skippaddle1setposition + sty paddleposition1 +skippaddle1setposition + endif + ldy INTIM + cpy #TIMEOFFSET + bcs paddleport0updateloop + + lda #%10000110 + sta VBLANK ; dump paddles to ground... this may not be great for genesis controllers + sec + lda paddleposition0 + sbc #TIMEOFFSET + ifconst PADDLESCALEX2 + asl + endif + + ifnconst PADDLESMOOTHINGOFF + clc + adc paddleprevious0 + ror + sta paddleprevious0 + endif + + sta paddleposition0 + + ifconst TWOPADDLESUPPORT + sec + lda paddleposition1 + sbc #TIMEOFFSET + ifconst PADDLESCALEX2 + asl + endif + + ifnconst PADDLESMOOTHINGOFF + clc + adc paddleprevious1 + ror + sta paddleprevious1 + endif + sta paddleposition1 + endif ; TWOPADDLESUPPORT + + jmp LLRET0 + endif + +paddleport1update + ifconst PADDLE1SUPPORT + lda #6 + sta VBLANK ; start charging the paddle caps + + lda #0 ; use PADDLE timing + jsr SETTIM64T ; INTIM is in Y + +paddleport1updateloop + lda INPT2 + bmi skippaddle2setposition + sty paddleposition2 +skippaddle2setposition + ifconst TWOPADDLESUPPORT + lda INPT3 + bmi skippaddle3setposition + sty paddleposition3 +skippaddle3setposition + endif + ldy INTIM + cpy #TIMEOFFSET + bcs paddleport1updateloop + + lda #%10000110 + sta VBLANK ; dump paddles to ground... this may not be great for genesis controllers + sec + lda paddleposition2 + sbc #TIMEOFFSET + ifconst PADDLESCALEX2 + asl + endif + + ifnconst PADDLESMOOTHINGOFF + clc + adc paddleprevious2 + ror + sta paddleprevious2 + endif + + sta paddleposition2 + + ifconst TWOPADDLESUPPORT + sec + lda paddleposition3 + sbc #TIMEOFFSET + ifconst PADDLESCALEX2 + asl + endif + + ifnconst PADDLESMOOTHINGOFF + clc + adc paddleprevious3 + ror + sta paddleprevious3 + endif + sta paddleposition3 + endif ; TWOPADDLESUPPORT + + jmp LLRET1 + endif + + +paddlebuttonhandler ; outside of conditional, for button-handler LUT + ifconst PADDLESUPPORT + ; x=0|1 for port, rather than paddle #. + ; Only the first paddle button will integrate into "joy0fire" testing. If the + ; game wants to support 2 paddles, up to the game to instead test the + ; joystick right+left directions instead. + lda SWCHA ; top of nibble is first paddle button + cpx #0 ; port 0? + beq skippaddleport2shift + asl ; shift second port to upper nibble + asl + asl + asl +skippaddleport2shift + and #%10000000 + eor #%10000000 ; invert + sta sINPT1,x + jmp buttonreadloopreturn + endif ; PADDLESUPPORT + +mousebuttonhandler ; outside of conditional, for button-handler LUT + ifconst MOUSESUPPORT + ; stick the mouse buttons in the correct shadow register... + txa + asl + tay ; y=x*2 + lda INPT4,x + eor #%10000000 + lsr + sta sINPT1,x + + lda INPT1,y + and #%10000000 + eor #%10000000 + ora sINPT1,x + sta sINPT1,x + jmp buttonreadloopreturn + endif ; MOUSESUPPORT + + ifconst KEYPADSUPPORT + ; ** select keypad rows 0 to 3 over 4 frames... +keypadrowselect + inc keypadcounter + ldy #0 + lda port0control + cmp #7 + bne skipport0val + iny ; y=y+1 +skipport0val + lda port1control + cmp #7 + bne skipport1val + iny + iny ; y=y+2 +skipport1val + cpy #0 + beq exitkeypadrowselect + lda keyrowdirectionmask,y + sta CTLSWA + tya + asl + asl + sta inttemp1 + lda keypadcounter + and #3 + ora inttemp1 + tax + lda keyrowselectvalue,x + sta SWCHA +exitkeypadrowselect + rts + +keyrowdirectionmask + .byte #%00000000 ; 0 : port0=input port1=input + .byte #%11110000 ; 1 : port0=output port1=input + .byte #%00001111 ; 2 : port0=input port1=output + .byte #%11111111 ; 3 : port0=output port1=output + +keyrowselectvalue + .byte #%00000000, #%00000000, #%00000000, #%00000000 ; no row selected, all pins high, always + .byte #%11100000, #%11010000, #%10110000, #%01110000 ; p0 keypad in + .byte #%00001110, #%00001101, #%00001011, #%00000111 ; p1 keypad in + .byte #%11101110, #%11011101, #%10111011, #%01110111 ; p0+p1 keypads in + endif; KEYPADSUPPORT + + ifconst KEYPADSUPPORT + ; TODO - split into compile-time KEYPAD0SUPPORT and KEYPAD1SUPPORT +keypadcolumnread + lda port0control + cmp #7 + bne skipkeypadcolumnread0 + lda keypadcounter + and #3 + asl ; x2 because keypad variables are interleaved + tax + lda #0 + sta keypadmatrix0a,x + lda INPT0 + cmp #$80 + rol keypadmatrix0a,x + lda INPT1 + cmp #$80 + rol keypadmatrix0a,x + lda INPT4 + cmp #$80 + rol keypadmatrix0a,x + lda keypadmatrix0a,x + eor #%00000111 + sta keypadmatrix0a,x +skipkeypadcolumnread0 + + lda port1control + cmp #7 + bne skipkeypadcolumnread1 + lda keypadcounter + and #3 + asl ; x2 because keypad variables are interleaved + tax + lda #0 + sta keypadmatrix1a,x + rol keypadmatrix1a,x + lda INPT2 + cmp #$80 + rol keypadmatrix1a,x + lda INPT3 + cmp #$80 + rol keypadmatrix1a,x + lda INPT5 + cmp #$80 + rol keypadmatrix1a,x + lda keypadmatrix1a,x + eor #%00000111 + sta keypadmatrix1a,x +skipkeypadcolumnread1 + rts + endif ; KEYPADSUPPORT + +setportforinput + lda CTLSWA + and SWCHA_DIRMASK,x + sta CTLSWA + rts + +setonebuttonmode + lda #6 ; in case we're in unlocked-bios mode + sta VBLANK ; if we were on paddles, the line is grounded out. + lda #$14 + sta CTLSWB + lda SWCHB + ora thisjoy2buttonbit,x ; disable: write 1 to the 2-button bit + sta SWCHB + rts + +settwobuttonmode + lda #6 ; in case we're in unlocked-bios mode + sta VBLANK ; if we were on paddles, the line is grounded out. + lda #$14 + sta CTLSWB + lda SWCHB + and thisjoy2buttonbit+1,x ; enable: write 0 to the 2-button bit + sta SWCHB + rts + +thisjoy2buttonbit + ; p0 p1 p0 + .byte $04, $10, $04 + diff --git a/out/bin/compilers/7800basic/includes/std_routines.asm.vscroll b/out/bin/compilers/7800basic/includes/std_routines.asm.vscroll new file mode 100644 index 00000000..9364aee9 --- /dev/null +++ b/out/bin/compilers/7800basic/includes/std_routines.asm.vscroll @@ -0,0 +1,3311 @@ + ; Provided under the CC0 license. See the included LICENSE.txt for details. + + ;standard routimes needed for pretty much all games + + ; some definitions used with "set debug color" +DEBUGCALC = $91 +DEBUGWASTE = $41 +DEBUGDRAW = $C1 + + ;NMI and IRQ handlers +NMI + ;VISIBLEOVER is 255 while the screen is drawn, and 0 right after the visible screen is done. + pha ; save A + cld + lda visibleover + eor #255 + sta visibleover + ifconst DEBUGINTERRUPT + and #$93 + sta BACKGRND + endif + txa ; save X + pha + tya ; save Y + pha + dec interruptindex + bne skipreallyoffvisible + jmp reallyoffvisible +skipreallyoffvisible + lda visibleover + bne carryontopscreenroutine + ifconst .bottomscreenroutine + lda interrupthold + beq skipbottomroutine + jsr .bottomscreenroutine +skipbottomroutine + endif + jmp NMIexit +carryontopscreenroutine + ifconst .topscreenroutine + lda interrupthold + beq skiptoproutine + jsr .topscreenroutine +skiptoproutine + endif + ifnconst CANARYOFF + lda canary + beq skipcanarytriggered + lda #$45 + sta BACKGRND + jmp skipbrkolorset ; common crash dump routine, if available +skipcanarytriggered + endif + + inc frameslost ; this is balanced with a "dec frameslost" when drawscreen is called. + + ; ** Other important routines that need to regularly run, and can run onscreen. + ; ** Atarivox can't go here, because Maria might interrupt it while it's bit-banging. + + ifconst LONGCONTROLLERREAD +longcontrollerreads ; ** controllers that take a lot of time to read. We use much of the visible screen here. + ldy port1control + lda longreadtype,y + beq LLRET1 + tay + lda longreadroutinehiP1,y + sta inttemp4 + lda longreadroutineloP1,y + sta inttemp3 + jmp (inttemp3) +LLRET1 + ldy port0control + lda longreadtype,y + beq LLRET0 + tay + lda longreadroutinehiP0,y + sta inttemp4 + lda longreadroutineloP0,y + sta inttemp3 + jmp (inttemp3) +LLRET0 + + + ifconst PADDLERANGE +TIMEVAL = PADDLERANGE + else +TIMEVAL = 160 + endif +TIMEOFFSET = 10 + + endif ; LONGCONTROLLERREAD + + + jsr servicesfxchannels + ifconst MUSICTRACKER + jsr servicesong + endif ; MUSICTRACKER + ifconst RMT + ifnconst RMTOFFSPEED + ifconst RMTPALSPEED + lda ntscslowframe + bne skiprasterupdate + endif + endif + lda rasterpause + beq skiprasterupdate + jsr RASTERMUSICTRACKER+3 +skiprasterupdate +RMT_Iend + endif + + inc framecounter + lda framecounter + and #63 + bne skipcountdownseconds + lda countdownseconds + beq skipcountdownseconds + dec countdownseconds +skipcountdownseconds + + ldx #1 +buttonreadloop + txa + pha + ldy port0control,x + lda buttonhandlerlo,y + sta inttemp3 + lda buttonhandlerhi,y + sta inttemp4 + ora inttemp3 + beq buttonreadloopreturn + jmp (inttemp3) +buttonreadloopreturn + pla + tax + dex + bpl buttonreadloop + + ifconst DOUBLEBUFFER + lda doublebufferminimumframeindex + beq skipdoublebufferminimumframeindexadjust + dec doublebufferminimumframeindex +skipdoublebufferminimumframeindexadjust + endif + + jmp NMIexit + +IRQ ; the only source of non-nmi interrupt should be the BRK opcode. + ifnconst BREAKPROTECTOFF + lda #$1A + sta BACKGRND +skipbrkolorset +skipbrkdetected + lda #$60 + sta sCTRL + sta CTRL + ifnconst hiscorefont + .byte $02 ; KIL/JAM + else ; hiscorefont is present + ifconst CRASHDUMP + bit MSTAT + bpl skipbrkdetected ; wait for vblank to ensure we're clear of NMI + + ifconst dumpbankswitch + lda dumpbankswitch + pha + endif + + ; bankswitch if needed, to get to the hiscore font + ifconst bankswitchmode + ifconst included.hiscore.asm.bank + ifconst MCPDEVCART + lda #($18 | included.hiscore.asm.bank) + sta $3000 + else + lda #(included.hiscore.asm.bank) + sta $8000 + endif + endif ; included.hiscore.asm.bank + endif ; bankswitchmode + + ifconst DOUBLEBUFFER + ;turn off double-buffering, if on... + lda #>DLLMEM + sta DPPH + lda #hiscorefont + sta CHARBASE + sta sCHARBASE + lda #%01000011 ;Enable DMA, mode=320A + sta CTRL + sta sCTRL + .byte $02 ; KIL/JAM +hiscorehexlut + ; 0 1 2 3 4 5 6 7 8 9 A B C D E F + .byte 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 0, 1, 2, 3, 4, 5 +show2700 + ; lo mode hi width=29 x EODL + .byte $00, %01100000, $27, 3, 20, 0,0,0 + else ; CRASHDUMP + .byte $02 ; KIL/JAM + endif ; crashdump + endif ; hiscorefont + else + RTI + endif + + ifconst LONGCONTROLLERREAD + +longreadtype + .byte 0, 0, 0, 1 ; NONE PROLINE LIGHTGUN PADDLE + .byte 2, 0, 3, 0 ; TRKBALL VCSSTICK DRIVING KEYPAD + .byte 3, 3, 0, 0 ; STMOUSE AMOUSE ATARIVOX SNES + +longreadroutineloP0 + .byte LLRET0 ; 0 = no routine + .byte >paddleport0update ; 1 = paddle + .byte >trakball0update ; 2 = trackball + .byte >mouse0update ; 3 = mouse + +longreadroutineloP1 + .byte LLRET1 ; 0 = no routine + .byte >paddleport1update ; 1 = paddle + .byte >trakball1update ; 2 = trackball + .byte >mouse1update ; 3 = mouse + + +SETTIM64T + bne skipdefaulttime + ifnconst PADDLESMOOTHINGOFF + lda #(TIMEVAL+TIMEOFFSET+1) + else + lda #(TIMEVAL+TIMEOFFSET) + endif +skipdefaulttime + tay + dey +.setTIM64Tloop + sta TIM64T + cpy INTIM + bne .setTIM64Tloop + rts + endif ; LONGCONTROLLERREAD + +reallyoffvisible + sta WSYNC + + lda #0 + sta visibleover + ifconst DEBUGINTERRUPT + sta BACKGRND + endif + + lda #3 + sta interruptindex + + jsr uninterruptableroutines + + ifconst .userinterrupt + lda interrupthold + beq skipuserintroutine + jsr .userinterrupt +skipuserintroutine + endif + + ifconst KEYPADSUPPORT + jsr keypadcolumnread + jsr keypadrowselect + endif + +NMIexit + pla + tay + pla + tax + pla + RTI + +clearscreen + ldx #(WZONECOUNT-1) + lda #0 +clearscreenloop + sta dlend,x + dex + bpl clearscreenloop + lda #0 + sta valbufend ; clear the bcd value buffer + sta valbufendsave + rts + +restorescreen + ldx #(WZONECOUNT-1) + lda #0 +restorescreenloop + lda dlendsave,x + sta dlend,x + dex + bpl restorescreenloop + lda valbufendsave + sta valbufend + rts + +savescreen + ldx #(WZONECOUNT-1) +savescreenloop + lda dlend,x + sta dlendsave,x + dex + bpl savescreenloop + lda valbufend + sta valbufendsave + ifconst DOUBLEBUFFER + lda doublebufferstate + beq savescreenrts + lda #1 + sta doublebufferbufferdirty +savescreenrts + endif ; DOUBLEBUFFER + rts + +drawscreen + + ifconst interrupthold + lda #$FF + sta interrupthold ; if the user called drawscreen, we're ready for interrupts + endif + + lda #0 + sta temp1 ; not B&W if we're here... + +drawscreenwait + lda visibleover + bne drawscreenwait ; make sure the visible screen isn't being drawn + + ;restore some registers in case the game changed them mid-screen... + lda sCTRL + ora temp1 + sta CTRL + lda sCHARBASE + sta CHARBASE + + ;ensure all of the display list is terminated... + jsr terminatedisplaylist + + ifnconst pauseroutineoff + jsr pauseroutine + endif ; pauseroutineoff + + ; Make sure the visible screen has *started* before we exit. That way we can rely on drawscreen + ; delaying a full frame, but still allowing time for basic calculations. +visiblescreenstartedwait + lda visibleover + beq visiblescreenstartedwait +visiblescreenstartedwaitdone + dec frameslost ; ; this gets balanced with an "inc frameslost" by an NMI at the top of the screen + rts + + ifnconst pauseroutineoff + ; check to see if pause was pressed and released +pauseroutine + lda pausedisable + bne leavepauseroutine + lda #8 + bit SWCHB + beq pausepressed + + ifconst SNES0PAUSE + lda port0control + cmp #11 + bne skipsnes0pause + lda snesdetected0 + beq skipsnes0pause + lda snes2atari0hi + and #%00010000 + beq pausepressed +skipsnes0pause + endif + ifconst SNES1PAUSE + + lda port1control + cmp #11 + bne skipsnes1pause + lda snesdetected1 + beq skipsnes1pause + lda snes2atari1hi + and #%00010000 + beq pausepressed +skipsnes1pause + endif + ifconst SNESNPAUSE + ldx snesport + lda port0control,x + cmp #11 + bne skipsnesNpause + lda snesdetected0,x + beq skipsnesNpause + lda snes2atari0hi,x + and #%00010000 + beq pausepressed +skipsnesNpause + endif + ifconst MULTIBUTTONPAUSE + ldx #1 +multibuttonpauseloop + lda port0control,x + cmp #11 + bcc multibuttonpauseloopbottom + lda sINPT1,x + and #1 + beq pausepressed +multibuttonpauseloopbottom + dex + bpl multibuttonpauseloop + endif ; MULTIBUTTONPAUSE + + ;pause isn't pressed + lda #0 + sta pausebuttonflag ; clear pause hold state in case its set + + ;check if we're in an already paused state + lda pausestate + beq leavepauseroutine ; nope, leave + + cmp #1 ; last frame was the start of pausing + beq enterpausestate2 ; move from state 1 to 2 + + cmp #2 + beq carryonpausing + + ;pausestate must be >2, which means we're ending an unpause + lda #0 + sta pausebuttonflag + sta pausestate + lda sCTRL + sta CTRL + jmp leavepauseroutine + +pausepressed + ;pause is pressed + lda pausebuttonflag + cmp #$ff + beq carryonpausing + + ;its a new press, increment the state + inc pausestate + + ;silence volume at the start and end of pausing + lda #0 + sta AUDV0 + sta AUDV1 + + ifconst pokeysupport + ldy #7 +pausesilencepokeyaudioloop + sta (pokeybase),y + dey + bpl pausesilencepokeyaudioloop + endif ; pokeysupport + + lda #$ff + sta pausebuttonflag + bne carryonpausing + +enterpausestate2 + lda #2 + sta pausestate + bne carryonpausing +leavepauseroutine + lda sCTRL + sta CTRL + rts +carryonpausing + ifconst .pause + jsr .pause + endif ; .pause + lda sCTRL + ora #%10000000 ; turn off colorburst during pause... + sta CTRL + jmp pauseroutine + endif ; pauseroutineoff + + + ifconst DOUBLEBUFFER +skipterminatedisplaylistreturn + rts + endif ; DOUBLEBUFFER +terminatedisplaylist + ifconst DOUBLEBUFFER + lda doublebufferstate + bne skipterminatedisplaylistreturn ; double-buffering runs it's own DL termination code + endif ; DOUBLEBUFFER +terminatedisplaybuffer + ;add DL end entry on each DL + ldx #(WZONECOUNT-1) +dlendloop + lda DLPOINTL,x + ifconst DOUBLEBUFFER + clc + adc doublebufferdloffset + endif ; DOUBLEBUFFER + sta dlpnt + lda DLPOINTH,x + ifconst DOUBLEBUFFER + adc #0 + endif ; DOUBLEBUFFER + sta dlpnt+1 + ldy dlend,x + lda #$00 +dlendmoreloops + iny + sta (dlpnt),y + ifconst FRAMESKIPGLITCHFIXWEAK + cpy #DLLASTOBJ+1 + beq dlendthiszonedone + iny + iny + iny + iny + iny + sta (dlpnt),y +dlendthiszonedone + endif FRAMESKIPGLITCHFIXWEAK + ifconst FRAMESKIPGLITCHFIX + iny + iny + iny + iny + cpy #DLLASTOBJ-1 + bcc dlendmoreloops + endif ; FRAMESKIPGLITCHFIX + dex + bpl dlendloop + + ifnconst pauseroutineoff + jsr pauseroutine + endif ; pauseroutineoff + rts + +uninterruptableroutines + ; this is for routines that must happen off the visible screen, each frame. + + ifconst AVOXVOICE + jsr serviceatarivoxqueue + endif + ifconst MEGA7800SUPPORT + ldx #1 +mega7800polling + lda port0control,x + cmp #12 ; mega7800 + bne mega7800handlercheck2 + jsr mega7800handler + jmp mega7800handlerdone +mega7800handlercheck2 + ifconst MULTIBUTTON + cmp #1 ; proline + bne mega7800handlerdone + lda framecounter + eor #7 ; avoid the same frame as the snes2atari probe + and #63 + bne mega7800handlerdone + lda #12 + sta port0control,x + jsr mega7800handler + endif ; MULTIBUTTON +mega7800handlerdone + dex + bpl mega7800polling + endif ; MEGA7800SUPPORT + + lda #0 + sta palfastframe + sta ntscslowframe + ldx paldetected ; 0=ntsc 1=pal + ldy palframes + iny + cpy #5 + bne palframeskipdone + lda paldetected + inc ntscslowframe,x + ldy #0 +palframeskipdone + sty palframes +skippalframeadjusting + + ifconst MUSICTRACKER + ; We normally run the servicesong routine from the top-screen interrupt, but if it + ; happens to interrupt the scheduling of a sound effect in the game code, we skip it. + ; If that happens, we try again here. Chances are very small we'll run into the same + ; problem twice, and if we do, we just drop a musical note or two. + lda sfxschedulemissed + beq servicesongwasnotmissed + jsr servicesong +servicesongwasnotmissed + endif ; MUSICTRACKER + + ifconst RMT + ifnconst RMTPALSPEED + ifnconst RMTOFFSPEED + lda palfastframe + beq skiprasterupdate2 + lda rasterpause + beq skiprasterupdate2 + jsr RASTERMUSICTRACKER+3 +skiprasterupdate2 + endif + endif + endif + + rts + +serviceatarivoxqueue + ifconst AVOXVOICE + lda voxlock + bne skipvoxprocessing ; the vox is in the middle of speech address update +skipvoxqueuesizedec + jmp processavoxvoice +skipvoxprocessing + rts + +processavoxvoice + ifconst HSSUPPORT + ; ** we skip speech if hi-score is on and no vox was detected + ; ** this is to avoid later collision with snes pads. + lda hsdevice + and #2 + beq processavoxvoicereturn + endif ; HSSUPPORT + lda avoxenable + bne avoxfixport + SPKOUT tempavox + rts +avoxfixport + lda #0 ; restore the port to all bits as inputs... + sta CTLSWA + rts +silenceavoxvoice + SPEAK avoxsilentdata +processavoxvoicereturn + rts +avoxsilentdata + .byte 31,255 + else + rts + endif ; AVOXVOICE + +prolinebuttonpadhandler + ifconst MULTIBUTTON + lda framecounter + and #63 + bne jbhandlercont1 + jsr setonebuttonmode + lda #11 + sta port0control,x + jsr snes2atari_signal_go + lda port0control,x + cmp #1 ; check if it's still a proline + beq jbhandlercont1 + jmp buttonreadloopreturn +jbhandlercont1 + lda #2 + sta multibuttoncount0,x + endif ; MULTIBUTTON +joybuttonpadhandler + lda sSWCHA ; clear previous dirs for this pad, from + ora SWCHA_DIRMASK,x ; our sSWCHA nibble. + sta sSWCHA + lda SWCHA ; load th actual joystick dirs, ensuring + ora SWCHA_DIRMASK+1,x ; we don't change the other nibble. + and sSWCHA + sta sSWCHA +joybuttonhandler + txa + asl + tay + lda INPT0,y + lsr + ;ora #%00111111 + sta sINPT1,x + lda INPT1,y + and #%10000000 + ora sINPT1,x + sta sINPT1,x + + lda INPT4,x + bmi .skip1bjoyfirecheck + ;one button joystick is down + eor #%10000000 + sta sINPT1,x + + lda joybuttonmode + and thisjoy2buttonbit,x + beq .skip1bjoyfirecheck + lda joybuttonmode + ora thisjoy2buttonbit,x + sta joybuttonmode + sta SWCHB +.skip1bjoyfirecheck + lda #%00111111 + ora sINPT1,x + sta sINPT1,x ; ensure multibutton bits are hi + jmp buttonreadloopreturn + +SWCHA_DIRMASK + ; p0 p1 p0 + .byte $F0,$0F,$F0 + +gunbuttonhandler ; outside of the conditional, so our button handler LUT is valid + ifconst LIGHTGUNSUPPORT + cpx #0 + bne secondportgunhandler +firstportgunhandler + lda SWCHA + asl + asl + asl ; shift D4 to D7 + and #%10000000 + eor #%10000000 + sta sINPT1 + jmp buttonreadloopreturn +secondportgunhandler + lda SWCHA + lsr ; shift D0 into carry + lsr ; shift carry into D7 + and #%10000000 + eor #%10000000 + sta sINPT3 + jmp buttonreadloopreturn + endif ; LIGHTGUNSUPPORT + +controlsusing2buttoncode + .byte 0 ; 00=no controller plugged in + .byte 1 ; 01=proline joystick + .byte 0 ; 02=lightgun + .byte 0 ; 03=paddle + .byte 1 ; 04=trakball + .byte 1 ; 05=vcs joystick + .byte 1 ; 06=driving control + .byte 0 ; 07=keypad control + .byte 0 ; 08=st mouse/cx80 + .byte 0 ; 09=amiga mouse + .byte 1 ; 10=atarivox + .byte 0 ; 11=snes2atari + .byte 0 ; 12=mega7800 + +buttonhandlerhi + .byte 0 ; 00=no controller plugged in + .byte >prolinebuttonpadhandler ; 01=proline joystick + .byte >gunbuttonhandler ; 02=lightgun + .byte >paddlebuttonhandler ; 03=paddle + .byte >joybuttonhandler ; 04=trakball + .byte >joybuttonpadhandler ; 05=vcs joystick + .byte >joybuttonhandler ; 06=driving control + .byte 0 ; 07=keypad + .byte >mousebuttonhandler ; 08=st mouse + .byte >mousebuttonhandler ; 09=amiga mouse + .byte >joybuttonhandler ; 10=atarivox + .byte >snes2atarihandler ; 11=snes + .byte 0 ; 12=mega7800 +buttonhandlerlo + .byte 0 ; 00=no controller plugged in + .byte $0F means the sound is looped while priority is active + + ora inttemp2 + ora inttemp1 ; check if F|C|V=0 + beq zerosfx ; if so, we're at the end of the sound. + +advancesfxpointer + ; advance the pointer to the next sound chunk + iny + sty inttemp3 + clc + lda sfx1pointlo,x + adc inttemp3 + sta sfx1pointlo,x + lda sfx1pointhi,x + adc #0 + sta sfx1pointhi,x + jmp servicesfxchannelsloop + +sfxsoundloop + pha + lda sfx1priority,x + bne sfxsoundloop_carryon + pla ; fix the stack before we go + jmp advancesfxpointer +sfxsoundloop_carryon + pla + and #$F0 + lsr + lsr + lsr + lsr + +zerosfx + sta sfx1pointlo,x + sta sfx1pointhi,x + sta sfx1priority,x + jmp servicesfxchannelsloop + + +schedulesfx + ; called with sfxinstrumentlo=data sfxpitchoffset=pitch-offset sfxnoteindex=note index + ldy #0 + ifconst pokeysupport + lda sfxinstrumenthi + beq scheduletiasfx ; drums have undefined instrument + lda (sfxinstrumentlo),y + cmp #$20 ; POKEY? + bne scheduletiasfx + jmp schedulepokeysfx + endif +scheduletiasfx + ;cmp #$10 ; TIA? + ;beq continuescheduletiasfx + ; rts ; unhandled!!! +continuescheduletiasfx + ifnconst TIASFXMONO + lda sfx1pointhi + beq schedulesfx1 ;if channel 1 is idle, use it + lda sfx2pointhi + beq schedulesfx2 ;if channel 2 is idle, use it + ; Both channels are scheduled. + lda sfxinstrumenthi + beq skipscheduledrums + ldy #1 + lda (sfxinstrumentlo),y + bne interruptsfx +skipscheduledrums + rts ; the new sound has 0 priority and both channels are busy. Skip playing it. +interruptsfx + ;Compare which active sound has a lower priority. We'll interrupt the lower one. + lda sfx1priority + cmp sfx2priority + bcs schedulesfx2 + endif ; !TIASFXMONO + +schedulesfx1 + ldx #0 ; channel 1 + ifnconst TIASFXMONO + beq skipschedulesfx2 +schedulesfx2 + ldx #1 ; channel 2 +skipschedulesfx2 + endif ; !TIASFXMONO + + ifconst MUSICTRACKER + lda sfxnoteindex + bpl skipdrumkitoverride + and #$7F ; subtract 128 + sec + sbc #4 ; drums start at 132, i.e. octave 10 + asl + tay + lda tiadrumkitdefinition,y + sta sfxinstrumentlo + iny + lda tiadrumkitdefinition,y + sta sfxinstrumenthi + lda #0 + sta sfxnoteindex ; and tell the driver it's a non-pitched instrument +skipdrumkitoverride + endif ; MUSICTRACKER + ldy #1 ; get priority and sound-resolution (in frames) + lda (sfxinstrumentlo),y + sta sfx1priority,x + iny + lda (sfxinstrumentlo),y + sta sfx1frames,x + lda sfxinstrumentlo + clc + adc #3 + sta sfx1pointlo,x + lda sfxinstrumenthi + adc #0 + sta sfx1pointhi,x + lda sfxpitchoffset + sta sfx1poffset,x + lda #0 + sta sfx1tick,x + lda sfxnoteindex + sta sfx1notedata,x + rts + +plotsprite + ifnconst NODRAWWAIT + ifconst DOUBLEBUFFER + lda doublebufferstate + bne skipplotspritewait + endif ; DOUBLEBUFFER + ifconst DEBUGWAITCOLOR + lda #$41 + sta BACKGRND + endif +plotspritewait + lda visibleover + bne plotspritewait +skipplotspritewait + ifconst DEBUGWAITCOLOR + lda #$0 + sta BACKGRND + endif + endif + + ;arguments: + ; temp1=lo graphicdata + ; temp2=hi graphicdata + ; temp3=palette | width byte + ; temp4=x + ; temp5=y + ; temp6=mode + lda temp5 ;Y position + lsr ; 2 - Divide by 8 or 16 + lsr ; 2 + lsr ; 2 + if WZONEHEIGHT = 16 + lsr ; 2 + endif + + tax + + ifnconst NOLIMITCHECKING + + ; the next block allows for vertical masking, and ensures we don't overwrite non-DL memory + + cmp #WZONECOUNT + + bcc continueplotsprite1 ; the sprite is fully on-screen, so carry on... + ; otherwise, check to see if the bottom half is in zone 0... + + if WZONEHEIGHT = 16 + cmp #15 + else + cmp #31 + endif + + bne exitplotsprite1 + ldx #0 + jmp continueplotsprite2 +exitplotsprite1 + rts + +continueplotsprite1 + endif + + ifconst VSCROLL + ldy Xx3,x + lda DLLMEM+11,y + else ; !VSCROLL + lda DLPOINTL,x ;Get pointer to DL that this sprite starts in + endif ; !VSCROLL + ifconst DOUBLEBUFFER + clc + adc doublebufferdloffset + endif ; DOUBLEBUFFER + sta dlpnt + ifconst VSCROLL + lda DLLMEM+10,y + else ; !VSCROLL + lda DLPOINTH,x + endif ; !VSCROLL + ifconst DOUBLEBUFFER + adc #0 + endif ; DOUBLEBUFFER + sta dlpnt+1 + + ;Create DL entry for upper part of sprite + + ldy dlend,x ;Get the index to the end of this DL + + ifconst CHECKOVERWRITE + cpy #DLLASTOBJ + beq checkcontinueplotsprite2 +continueplotsprite1a + endif + + lda temp1 ; graphic data, lo byte + sta (dlpnt),y ;Low byte of data address + + ifnconst ATOMICSPRITEUPDATE + iny + lda temp6 + sta (dlpnt),y + else + iny + sty temp8 + endif + + iny + + lda temp5 ;Y position + and #(WZONEHEIGHT - 1) + cmp #1 ; clear carry if our sprite is just in this zone + ora temp2 ; graphic data, hi byte + sta (dlpnt),y + + iny + lda temp3 ;palette|width + sta (dlpnt),y + + iny + lda temp4 ;Horizontal position + sta (dlpnt),y + + iny + sty dlend,x + + ifconst ALWAYSTERMINATE + iny + lda #0 + sta (dlpnt),y + endif + + ifconst ATOMICSPRITEUPDATE + ldy temp8 + lda temp6 + sta (dlpnt),y + endif + +checkcontinueplotsprite2 + + bcc doneSPDL ;branch if the sprite was fully in the last zone + + ;Create DL entry for lower part of sprite + + inx ;Next region + + ifnconst NOLIMITCHECKING + cpx #WZONECOUNT + + bcc continueplotsprite2 ; the second half of the sprite is fully on-screen, so carry on... + rts +continueplotsprite2 + endif + + ifconst VSCROLL + ldy Xx3,x + lda DLLMEM+11,y + else ; !VSCROLL + lda DLPOINTL,x ;Get pointer to next DL + endif ; !VSCROLL + ifconst DOUBLEBUFFER + clc + adc doublebufferdloffset + endif ; DOUBLEBUFFER + sta dlpnt + ifconst VSCROLL + lda DLLMEM+10,y + else ; !VSCROLL + lda DLPOINTH,x + endif ; !VSCROLL + ifconst DOUBLEBUFFER + adc #0 + endif ; DOUBLEBUFFER + sta dlpnt+1 + ldy dlend,x ;Get the index to the end of this DL + + ifconst CHECKOVERWRITE + cpy #DLLASTOBJ + bne continueplotsprite2a + rts +continueplotsprite2a + endif + + lda temp1 ; graphic data, lo byte + sta (dlpnt),y + + ifnconst ATOMICSPRITEUPDATE + iny + lda temp6 + sta (dlpnt),y + else + iny + sty temp8 + endif + + iny + + lda temp5 ;Y position + anc #(WZONEHEIGHT - 1) ; undocumented. A=A&IMM, then move bit 7 into carry + ora temp2 ; graphic data, hi byte + sbc #(WZONEHEIGHT-1) ; start at the DMA hole. -1 because carry is clear + sta (dlpnt),y + + iny + + lda temp3 ;palette|width + sta (dlpnt),y + + iny + + lda temp4 ;Horizontal position + sta (dlpnt),y + + iny + sty dlend,x + + ifconst ALWAYSTERMINATE + iny + lda #0 + sta (dlpnt),y + endif + + ifconst ATOMICSPRITEUPDATE + ldy temp8 + lda temp6 + sta (dlpnt),y + endif + +doneSPDL + rts + + ifconst VSCROLL + ; x3 table for fast DLL parsing +Xx3 + .byte 0,3,6,9,12,15,18,21,24,27 + .byte 30,33,36,39,42,45,48,51,54,57 + .byte 60,63,66,69,72,75,78,81,84,87 + endif ; VSCROLL + +lockzonex + ifconst ZONELOCKS + ldy dlend,x + cpy #DLLASTOBJ + beq lockzonexreturn ; the zone is either stuffed or locked. abort! + lda DLPOINTL,x + ifconst DOUBLEBUFFER + clc + adc doublebufferdloffset + endif ; DOUBLEBUFFER + sta dlpnt + lda DLPOINTH,x + ifconst DOUBLEBUFFER + adc #0 + endif ; DOUBLEBUFFER + sta dlpnt+1 + iny + lda #0 + sta (dlpnt),y + dey + tya + ldy #(DLLASTOBJ-1) + sta (dlpnt),y + iny + sty dlend,x +lockzonexreturn + rts + endif ; ZONELOCKS +unlockzonex + ifconst ZONELOCKS + ldy dlend,x + cpy #DLLASTOBJ + bne unlockzonexreturn ; if the zone isn't stuffed, it's not locked. abort! + lda DLPOINTL,x + ifconst DOUBLEBUFFER + clc + adc doublebufferdloffset + endif ; DOUBLEBUFFER + sta dlpnt + lda DLPOINTH,x + ifconst DOUBLEBUFFER + adc #0 + endif ; DOUBLEBUFFER + sta dlpnt+1 + dey + lda (dlpnt),y + tay + sty dlend,x +unlockzonexreturn + endif ; ZONELOCKS + rts + +plotcharloop + ; ** read from a data indirectly pointed to from temp8,temp9 + ; ** format is: lo_data, hi_data, palette|width, x, y + ; ** format ends with lo_data | hi_data = 0 + + ifconst DOUBLEBUFFER + lda doublebufferstate + bne skipplotcharloopwait + endif ; DOUBLEBUFFER + ifconst DEBUGWAITCOLOR + lda #$61 + sta BACKGRND + endif +plotcharloopwait + lda visibleover + bne plotcharloopwait + ifconst DEBUGWAITCOLOR + lda #0 + sta BACKGRND + endif +skipplotcharloopwait +plotcharlooploop + ldy #0 + lda (temp8),y + sta temp1 + iny + lda (temp8),y + sta temp2 + ora temp1 + bne plotcharloopcontinue + ;the pointer=0, so return + rts +plotcharloopcontinue + iny + lda (temp8),y + sta temp3 + iny + lda (temp8),y + sta temp4 + iny + lda (temp8),y + ;sta temp5 ; not needed with our late entry. + jsr plotcharactersskipentry + lda temp8 + clc + adc #5 + sta temp8 + lda temp9 + adc #0 + sta temp9 + jmp plotcharlooploop + +plotcharacters + ifconst DOUBLEBUFFER + lda doublebufferstate + bne skipplotcharacterswait + endif ; DOUBLEBUFFER + ifconst DEBUGWAITCOLOR + lda #$41 + sta BACKGRND + endif +plotcharacterswait + lda visibleover + bne plotcharacterswait + ifconst DEBUGWAITCOLOR + sta BACKGRND + endif +skipplotcharacterswait + ;arguments: + ; temp1=lo charactermap + ; temp2=hi charactermap + ; temp3=palette | width byte + ; temp4=x + ; temp5=y + + lda temp5 ;Y position + +plotcharactersskipentry + + ;ifconst ZONEHEIGHT + ; if ZONEHEIGHT = 16 + ; and #$0F + ; endif + ; if ZONEHEIGHT = 8 + ; and #$1F + ; endif + ;else + ; and #$0F + ;endif + + tax + + lda DLPOINTL,x ;Get pointer to DL that the characters are in + ifconst DOUBLEBUFFER + clc + adc doublebufferdloffset + endif ; DOUBLEBUFFER + sta dlpnt + lda DLPOINTH,x + ifconst DOUBLEBUFFER + adc #0 + endif ; DOUBLEBUFFER + sta dlpnt+1 + + ;Create DL entry for the characters + + ldy dlend,x ;Get the index to the end of this DL + + ifconst CHECKOVERWRITE + cpy #DLLASTOBJ + bne continueplotcharacters + rts +continueplotcharacters + endif + + lda temp1 ; character map data, lo byte + sta (dlpnt),y ;(1) store low address + + iny + lda charactermode + sta (dlpnt),y ;(2) store mode + + iny + lda temp2 ; character map, hi byte + sta (dlpnt),y ;(3) store high address + + iny + lda temp3 ;palette|width + sta (dlpnt),y ;(4) store palette|width + + iny + lda temp4 ;Horizontal position + sta (dlpnt),y ;(5) store horizontal position + + iny + sty dlend,x ; save display list end byte + rts + + + ifconst plotvalueonscreen +plotcharacterslive + ; a version of plotcharacters that draws live and minimally disrupts the screen... + + ;arguments: + ; temp1=lo charactermap + ; temp2=hi charactermap + ; temp3=palette | width byte + ; temp4=x + ; temp5=y + + lda temp5 ;Y position + + tax + lda DLPOINTL,x ;Get pointer to DL that the characters are in + ifconst DOUBLEBUFFER + clc + adc doublebufferdloffset + endif ; DOUBLEBUFFER + sta dlpnt + lda DLPOINTH,x + ifconst DOUBLEBUFFER + adc #0 + endif ; DOUBLEBUFFER + sta dlpnt+1 + + ;Create DL entry for the characters + + ldy dlend,x ;Get the index to the end of this DL + + ifconst CHECKOVERWRITE + cpy #DLLASTOBJ + bne continueplotcharacterslive + rts +continueplotcharacterslive + endif + + lda temp1 ; character map data, lo byte + sta (dlpnt),y ;(1) store low address + + iny + ; we don't add the second byte yet, since the charmap could briefly + ; render without a proper character map address, width, or position. + lda charactermode + sta (dlpnt),y ;(2) store mode + + iny + lda temp2 ; character map, hi byte + sta (dlpnt),y ;(3) store high address + + iny + lda temp3 ;palette|width + sta (dlpnt),y ;(4) store palette|width + + iny + lda temp4 ;Horizontal position + sta (dlpnt),y ;(5) store horizontal position + + iny + sty dlend,x ; save display list end byte + + rts + endif ;plotcharacterslive + + ifconst USED_PLOTVALUE +plotvalue + ; calling 7800basic command: + ; plotvalue digit_gfx palette variable/data number_of_digits screen_x screen_y + ; ...displays the variable as BCD digits + ; + ; asm sub arguments: + ; temp1=lo charactermap + ; temp2=hi charactermap + ; temp3=palette | width byte + ; temp4=x + ; temp5=y + ; temp6=number of digits + ; temp7=lo variable + ; temp8=hi variable + ; temp9=character mode + +plotdigitcount = temp6 + + ifconst ZONELOCKS + ldx temp5 + ldy dlend,x + cpy #DLLASTOBJ + bne carryonplotvalue + rts +carryonplotvalue + endif + + lda #0 + tay + ldx valbufend + + lda plotdigitcount + and #1 + beq pvnibble2char + lda #0 + sta VALBUFFER,x ; just in case we skip this digit + beq pvnibble2char_skipnibble + +pvnibble2char + ; high nibble... + lda (temp7),y + and #$f0 + lsr + lsr + lsr + ifnconst DOUBLEWIDE ; multiply value by 2 for double-width + lsr + endif + + clc + adc temp1 ; add the offset to character graphics to our value + sta VALBUFFER,x + inx + dec plotdigitcount + +pvnibble2char_skipnibble + ; low nibble... + lda (temp7),y + and #$0f + ifconst DOUBLEWIDE ; multiply value by 2 for double-width + asl + endif + clc + adc temp1 ; add the offset to character graphics to our value + sta VALBUFFER,x + inx + iny + + dec plotdigitcount + bne pvnibble2char + + ;point to the start of our valuebuffer + clc + lda #VALBUFFER + adc #0 + sta temp2 + + ;advance valbufend to the end of our value buffer + stx valbufend + + ifnconst plotvalueonscreen + jmp plotcharacters + else + jmp plotcharacterslive + endif + + endif ; USED_PLOTVALUE + + + ifconst USED_PLOTVALUEEXTRA +plotdigitcount = temp6 +plotvalueextra + ; calling 7800basic command: + ; plotvalue digit_gfx palette variable/data number_of_digits screen_x screen_y + ; ...displays the variable as BCD digits + ; + ; asm sub arguments: + ; temp1=lo charactermap + ; temp2=hi charactermap + ; temp3=palette | width byte + ; temp4=x + ; temp5=y + ; temp6=number of digits + ; temp7=lo variable + ; temp8=hi variable + + lda #0 + tay + ldx valbufend + ifnconst plotvalueonscreen + sta VALBUFFER,x + endif + + lda plotdigitcount + and #1 + + bne pvnibble2char_skipnibbleextra + +pvnibble2charextra + ; high nibble... + lda (temp7),y + and #$f0 + lsr + lsr + ifnconst DOUBLEWIDE ; multiply value by 2 for double-width + lsr + endif + clc + adc temp1 ; add the offset to character graphics to our value + sta VALBUFFER,x + inx + + ; second half of the digit + clc + adc #1 + sta VALBUFFER,x + inx + +pvnibble2char_skipnibbleextra + ; low nibble... + lda (temp7),y + and #$0f + ifconst DOUBLEWIDE ; multiply value by 2 for double-width + asl + endif + asl + + clc + adc temp1 ; add the offset to character graphics to our value + sta VALBUFFER,x + inx + + clc + adc #1 + sta VALBUFFER,x + inx + iny + + dec plotdigitcount + bne pvnibble2charextra + + ;point to the start of our valuebuffer + clc + lda #VALBUFFER + adc #0 + sta temp2 + + ;advance valbufend to the end of our value buffer + stx valbufend + + ifnconst plotvalueonscreen + jmp plotcharacters + else + jmp plotcharacterslive + endif + endif ; USED_PLOTVALUEEXTRA + +boxcollision + ifconst BOXCOLLISION + ; the worst case cycle-time for the code below is 43 cycles. + ; unfortunately, prior to getting here we've burned 44 cycles in argument setup. eep! + + ;__boxx1 = accumulator + ;__boxy1 = y +__boxw1 = temp3 +__boxh1 = temp4 + +__boxx2 = temp5 +__boxy2 = temp6 +__boxw2 = temp7 +__boxh2 = temp8 + +DoXCollisionCheck + ;lda __boxx1 ; skipped. already in the accumulator + cmp __boxx2 ;3 + bcs X1isbiggerthanX2 ;2/3 +X2isbiggerthanX1 + ; carry is clear + adc __boxw1 ;3 + cmp __boxx2 ;3 + bcs DoYCollisionCheck ;3/2 + rts ;6 - carry clear, no collision +X1isbiggerthanX2 + clc ;2 + sbc __boxw2 ;3 + cmp __boxx2 ;3 + bcs noboxcollision ;3/2 +DoYCollisionCheck + tya ; 2 ; use to be "lda __boxy1" + cmp __boxy2 ;3 + bcs Y1isbiggerthanY2 ;3/2 +Y2isbiggerthanY1 + ; carry is clear + adc __boxh1 ;3 + cmp __boxy2 ;3 + rts ;6 +Y1isbiggerthanY2 + clc ;2 + sbc __boxh2 ;3 + cmp __boxy2 ;3 + bcs noboxcollision ;3/2 +yesboxcollision + sec ;2 + rts ;6 +noboxcollision + clc ;2 + rts ;6 + endif ; BOXCOLLISION + +randomize + lda rand + lsr + rol rand16 + bcc noeor + eor #$B4 +noeor + sta rand + eor rand16 + rts + + ; *** bcd conversion routine courtesy Omegamatrix + ; *** http://atariage.com/forums/blog/563/entry-10832-hex-to-bcd-conversion-0-99/ + ifconst .calledfunction_converttobcd +converttobcd + ;value to convert is in the accumulator + sta temp1 + lsr + adc temp1 + ror + lsr + lsr + adc temp1 + ror + adc temp1 + ror + lsr + and #$3C + sta temp2 + lsr + adc temp2 + adc temp1 + rts ; return the result in the accumulator + endif ; .calledfunction_converttobcd + + ifconst .calledfunction_mul8 + ; Y and A contain multiplicands, result in A +mul8 + sty temp1 + sta temp2 + lda #0 +reptmul8 + lsr temp2 + bcc skipmul8 + clc + adc temp1 + ;bcs donemul8 might save cycles? +skipmul8 + ;beq donemul8 might save cycles? + asl temp1 + bne reptmul8 +donemul8 + rts + endif ; .calledfunction_mul8 + + ifconst .calledfunction_div8 +div8 + ; A=numerator Y=denominator, result in A + cpy #2 + bcc div8end+1;div by 0 = bad, div by 1=no calc needed, so bail out + sty temp1 + ldy #$ff +div8loop + sbc temp1 + iny + bcs div8loop +div8end + tya + ; result in A + rts + endif ; .calledfunction_div8 + + ifconst .calledfunction_mul16 + ; Y and A contain multiplicands, result in temp2,A=low, temp1=high +mul16 + sty temp1 + sta temp2 + + lda #0 + ldx #8 + lsr temp1 +mul16_1 + bcc mul16_2 + clc + adc temp2 +mul16_2 + ror + ror temp1 + dex + bne mul16_1 + sta temp2 + rts + endif ; .calledfunction_mul16 + + ifconst .calledfunction_div16 + ; div int/int + ; numerator in A, denom in temp1 + ; returns with quotient in A, remainder in temp1 +div16 + sta temp2 + sty temp1 + lda #0 + ldx #8 + asl temp2 +div16_1 + rol + cmp temp1 + bcc div16_2 + sbc temp1 +div16_2 + rol temp2 + dex + bne div16_1 + sta temp1 + lda temp2 + rts + endif ; .calledfunction_div16 + + ifconst bankswitchmode +BS_jsr + ifconst dumpbankswitch + sta dumpbankswitch + endif + ifconst MCPDEVCART + ora #$18 + sta $3000 + else + sta $8000 + endif + pla + tax + pla + rts + +BS_return + pla ; bankswitch bank + ifconst dumpbankswitch + sta dumpbankswitch + endif + ifconst BANKRAM + sta currentbank + ora currentrambank + endif + ifconst MCPDEVCART + ora #$18 + sta $3000 + else + sta $8000 + endif + pla ; bankswitch $0 flag + rts + endif + +checkselectswitch + lda SWCHB ; check the real select switch... + and #%00000010 +checkselectswitchreturn + rts + +checkresetswitch + lda SWCHB ; check the real reset switch... + and #%00000001 + rts + + ifconst FINESCROLLENABLED +finescrolldlls + ldx temp1 ; first DLL index x3 + lda DLLMEM,x + and #%11110000 + ora finescrolly + sta DLLMEM,x + + ldx temp2 ; last DLL index x3 + lda DLLMEM,x + and #%11110000 + ora finescrolly + eor #(WZONEHEIGHT-1) + sta DLLMEM,x + rts + endif ; FINESCROLLENABLED + + ifconst USED_ADJUSTVISIBLE +adjustvisible + ; called with temp1=first visible zone *3, temp2=last visible zone *3 + jsr waitforvblankstart ; ensure vblank just started + ldx visibleDLLstart +findfirstinterrupt + lda DLLMEM,x + bmi foundfirstinterrupt + inx + inx + inx + bne findfirstinterrupt +foundfirstinterrupt + and #%01111111 ; clear the interrupt bit + sta DLLMEM,x + ifconst DOUBLEBUFFER + sta DLLMEM+DBOFFSET,x + endif ; DOUBLEBUFFER + ldx overscanDLLstart +findlastinterrupt + lda DLLMEM,x + bmi foundlastinterrupt + dex + dex + dex + bne findlastinterrupt +foundlastinterrupt + and #%01111111 ; clear the interrupt bit + sta DLLMEM,x + ifconst DOUBLEBUFFER + sta DLLMEM+DBOFFSET,x + endif ; DOUBLEBUFFER + ;now we need to set the new interrupts + clc + lda temp1 + adc visibleDLLstart + tax + lda DLLMEM,x + ora #%10000000 + sta DLLMEM,x + ifconst DOUBLEBUFFER + sta DLLMEM+DBOFFSET,x + endif ; DOUBLEBUFFER + clc + lda temp2 + adc visibleDLLstart + tax + lda DLLMEM,x + ora #%10000000 + sta DLLMEM,x + ifconst DOUBLEBUFFER + sta DLLMEM+DBOFFSET,x + endif ; DOUBLEBUFFER + jsr vblankresync + rts + endif ; USED_ADJUSTVISIBLE + +vblankresync + jsr waitforvblankstart ; ensure vblank just started + lda #0 + sta visibleover + lda #3 + sta interruptindex + rts + +createallgamedlls + ldy #(DLLLUTEND-DLLLUT) +createallgamedllsloop + dey + lda DLLLUT,y + sta DLLMEM,y + ifconst DOUBLEBUFFER + sta DLLMEM+DBOFFSET,y + endif ; DOUBLEBUFFER + cpy #0 + bne createallgamedllsloop + + ifconst DOUBLEBUFFER + ldy #(DLLLUTNONVISSTART-DLLLUTVISSTART) +fixdoublebuffer + dey + lda DLLMEM+DBOFFSET+DLLLUTVISSTART-DLLLUT,y + clc + adc #DOUBLEBUFFEROFFSET + sta DLLMEM+DBOFFSET+DLLLUTVISSTART-DLLLUT,y + dey + lda DLLMEM+DBOFFSET+DLLLUTVISSTART-DLLLUT,y + adc #0 + sta DLLMEM+DBOFFSET+DLLLUTVISSTART-DLLLUT,y + dey + bne fixdoublebuffer + endif + + ifconst BANKSET_DL_IN_CARTRAM + ; N.B. banksets doesn't in-fact allow DL in cart-ram, so this conditional + ; is always skipped. This is here in case some day the limitation is + ; worked around, but it's untested. + + ; With bankset cart ram, we added $8000 to the DL address so plot + ; functions would hit the cart-ram write-address. We need to subtract $80 + ; so Maria will read from the cart-ram read-address. + ldy #(DLLLUTNONVISSTART-DLLLUTVISSTART) +fixbanksetaddresses + dey + dey + lda DLLMEM+DLLLUTVISSTART-DLLLUT,y + and #%01111111 + sta DLLMEM+DLLLUTVISSTART-DLLLUT,y + ifconst DOUBLEBUFFER + lda DLLMEM+DBOFFSET+DLLLUTVISSTART-DLLLUT,y + and #%01111111 + sta DLLMEM+DBOFFSET+DLLLUTVISSTART-DLLLUT,y + endif ; DOUBLEBUFFER + dey + bne fixbanksetaddresses + endif ; BANKSET_DL_IN_CARTRAM + + lda paldetected + beq skippaladjust + lda #($0F|(WZONEHEIGHT*4)) ; +15 lines + sta DLLMEM+6 + ifconst DOUBLEBUFFER + sta DLLMEM+DBOFFSET+6 + endif + if WSCREENHEIGHT = 192 + lda #($0D|(WZONEHEIGHT*4)) ; +6 lines + else + lda #($07|(WZONEHEIGHT*4)) ; +6 lines + endif ; + sta DLLMEM+3 + ifconst DOUBLEBUFFER + sta DLLMEM+DBOFFSET+3 + endif ; DOUBLEBUFFER + +skippaladjust + + ; save the DL markers... + lda #(DLLLUTVISSTART-DLLLUT) + sta visibleDLLstart + lda #(DLLLUTNONVISSTART-DLLLUT) + sta overscanDLLstart + rts + + ; N.B. max DLL length is 112 bytes (for double-buffered) + +DLLLUT + if WSCREENHEIGHT = 192 + .byte ($0F|(WZONEHEIGHT*4)),$21,$00 ; 16 blank lines + .byte ($07|(WZONEHEIGHT*4)),$21,$00 ; 8 blank lines + .byte ($00|(WZONEHEIGHT*4)),$21,$00 ; 1 blank lines + ;=25 blank lines + endif ; WSCREENHEIGHT = 192 + if WSCREENHEIGHT = 208 + .byte ($0E|(WZONEHEIGHT*4)),$21,$00 ; 15 blank lines + .byte ($00|(WZONEHEIGHT*4)),$21,$00 ; 1 blank lines + .byte ($00|(WZONEHEIGHT*4)),$21,$00 ; 1 blank lines + ;=17 blank lines + endif ; WSCREENHEIGHT = 208 + if WSCREENHEIGHT = 224 + .byte ($06|(WZONEHEIGHT*4)),$21,$00 ; 7 blank lines + .byte ($00|(WZONEHEIGHT*4)),$21,$00 ; 1 blank lines + .byte ($00|(WZONEHEIGHT*4)),$21,$00 ; 1 blank lines + ;= 9 blank lines + endif ; WSCREENHEIGHT = 224 + +DLLLUTVISSTART + .byte ($80|(WZONEHEIGHT*4)|(WZONEHEIGHT-1)),>ZONE0ADDRESS,ZONE1ADDRESS,ZONE2ADDRESS,ZONE3ADDRESS,ZONE4ADDRESS,ZONE5ADDRESS,ZONE6ADDRESS,ZONE7ADDRESS,ZONE8ADDRESS,ZONE9ADDRESS,ZONE10ADDRESS,ZONE11ADDRESS,ZONE12ADDRESS,ZONE13ADDRESS,ZONE14ADDRESS,ZONE15ADDRESS,ZONE16ADDRESS,ZONE17ADDRESS,ZONE18ADDRESS,ZONE19ADDRESS,ZONE20ADDRESS,ZONE21ADDRESS,ZONE22ADDRESS,ZONE23ADDRESS,ZONE24ADDRESS,ZONE25ADDRESS,ZONE26ADDRESS,ZONE27ADDRESS,DLLMEM,>(DLLMEM+DBOFFSET) +NewPageflipstate + .byte 3,1 +NewPageflipoffset + .byte DOUBLEBUFFEROFFSET,0 + + endif ; DOUBLEBUFFER + + ifconst MOUSESUPPORT + +rotationalcompare + ; old = 00 01 10 11 + .byte $00, $01, $ff, $00 ; new=00 + .byte $ff, $00, $00, $01 ; new=01 + .byte $01, $00, $00, $ff ; new=10 + .byte $00, $ff, $01, $00 ; new=11 + + ; 0000YyXx st mouse + + ; 0000xyXY amiga mouse + + ifconst MOUSEXONLY +amigatoataribits ; swap bits 1 and 4... + .byte %0000, %0000, %0010, %0010 + .byte %0000, %0000, %0010, %0010 + .byte %0001, %0001, %0011, %0011 + .byte %0001, %0001, %0011, %0011 + + ; null change bits + .byte %0000, %0001, %0010, %0011 + .byte %0000, %0001, %0010, %0011 + .byte %0000, %0001, %0010, %0011 + .byte %0000, %0001, %0010, %0011 + + else ; !MOUSEXONLY + +amigatoataribits ; swap bits 1 and 4... + .byte %0000, %1000, %0010, %1010 + .byte %0100, %1100, %0110, %1110 + .byte %0001, %1001, %0011, %1011 + .byte %0101, %1101, %0111, %1111 + ; null change bits + .byte %0000, %0001, %0010, %0011 + .byte %0100, %0101, %0110, %0111 + .byte %1000, %1001, %1010, %1011 + .byte %1100, %1101, %1110, %1111 + endif ; !MOUSEXONLY + + endif ; MOUSESUPPORT + +mouse0update + ifconst MOUSE0SUPPORT + +mousetableselect = inttemp2 +mousexdelta = inttemp3 +mouseydelta = inttemp4 +lastSWCHA = inttemp6 + + ; 0000YyXx st mouse + ; 0000xyXY amiga mouse + + lda #$ff + sta lastSWCHA + + ldy port0control + + lda #%00010000 + cpy #9 ; AMIGA? + bne skipamigabitsfix0 + lda #0 +skipamigabitsfix0 + sta mousetableselect + ifconst DRIVINGBOOST + cpy #6 ; DRIVING? + bne skipdriving0setup + ; swap mousex0 and mousey0. mousex seen by the 7800basic program + ; trails the actual mousex0, so we can smoothly interpolate toward + ; the actual position. This actual position is stored in mousey0 + ; after the driver has run. + ldx mousex0 + lda mousey0 + stx mousey0 + sta mousex0 +skipdriving0setup + endif ; DRIVINGBOOST + + lda #0 + sta mousexdelta + sta mouseydelta + + ifnconst MOUSETIME + ifnconst MOUSEXONLY + lda #180 ; minimum for x+y + else + lda #100 ; minimum for just x + endif + else + lda #MOUSETIME + endif + jsr SETTIM64T ; INTIM is in Y + +mouse0updateloop + lda SWCHA + asr #%11110000 ; Undocumented. A = A & #IMM, then LSR A. + cmp lastSWCHA + beq mouse0loopcondition + sta lastSWCHA + lsr + lsr + lsr + + ora mousetableselect ; atari/amiga decoding table selection + + ; st mice encode on different bits/joystick-lines than amiga mice... + ; 0000YyXx st mouse + ; 0000xyXY amiga mouse + ; ...so can shuffle the amiga bits to reuse the st driver. + tay + lax amigatoataribits,y + + ifnconst MOUSEXONLY + ; first the Y... + and #%00001100 + ora mousecodey0 + tay + lda rotationalcompare,y + clc + adc mouseydelta + sta mouseydelta + tya + lsr + lsr + sta mousecodey0 + txa + ; ...then the X... + and #%00000011 + tax + endif ; !MOUSEXONLY + + asl + asl + ora mousecodex0 + tay + lda rotationalcompare,y + adc mousexdelta ; carry was clear by previous ASL + sta mousexdelta + stx mousecodex0 +mouse0loopcondition + lda TIMINT + bpl mouse0updateloop + + ; *** adapt to selected device resolution. + ldx port0control + + ifconst PRECISIONMOUSING + ldy port0resolution + bne mouse0halveddone + cpx #6 ; half-resolution is no good for driving wheels + beq mouse0halveddone + ; resolution=0 is half mouse resolution, necessary for precision + ; mousing on a 160x240 screen with a 1000 dpi mouse. + + lda mousexdelta + cmp #$80 + ror ; do a signed divide by 2. + clc + adc mousex0 + sta mousex0 + ifnconst MOUSEXONLY + lda mouseydelta + clc + adc mousey0 + sta mousey0 + endif + ; at half resolution we just exit after updating x and y + jmp LLRET0 +mouse0halveddone + endif ; PRECISIONMOUSING + + ifnconst MOUSEXONLY + asl mouseydelta ; *2 because Y resolution is finer + ldy port0resolution + dey + lda #0 +mousey0resolutionfix + clc + adc mouseydelta + dey + bpl mousey0resolutionfix + clc + adc mousey0 + sta mousey0 + endif ; MOUSEXONLY + + ldy port0resolution + dey + lda #0 +mousex0resolutionfix + clc + adc mousexdelta + dey + bpl mousex0resolutionfix + ifnconst DRIVINGBOOST + clc + adc mousex0 + sta mousex0 + else + cpx #6 + beq carryonmouse0boost + clc + adc mousex0 + sta mousex0 + jmp LLRET0 +carryonmouse0boost + sta mousexdelta + clc + adc mousecodey0 + sta mousecodey0 + clc + adc mousex0 + tay ; save the target X + adc mousey0 ; average in the smoothly-trailing X + ror + sta mousex0 ; mousex0 now has the smoothly trailing X + sty mousey0 ; and mousey0 has the the target X + + ; check to see if the coordinate wrapped. If so, undo the averaging code. + ; A has mousex0, the smoothly trailing X + sbc mousey0 ; less the target X + bpl skipabsolutedrive0 + eor #$ff +skipabsolutedrive0 + cmp #64 ; just an unreasonably large change + bcc skipdrivewrapfix0 + sty mousex0 ; if X wrapped, we catch the trailing X up to the target X +skipdrivewrapfix0 + + ; get rid of the tweening if the distance travelled was very small + lda mousexdelta + cmp port0resolution + bcs skipbetweenfix0 + lda mousex0 + sta mousey0 +skipbetweenfix0 + +drivingboostreductioncheck0 + ; The below code amounts to mousecodey0=mousecodey0-(mousecodey0/8) + ; +ve mousecodey0 is converted to -ve to do the calculation, and then + ; negated again because truncation during BCD math results in + ; differing magnitudes, depending if the value is +ve or -ve. +driving0fix + lax mousecodey0 + cmp #$80 + bcs driving0skipnegate1 + eor #$FF + adc #1 + sta mousecodey0 +driving0skipnegate1 + cmp #$80 + ror + cmp #$80 + ror + cmp #$80 + ror + sta inttemp1 + lda mousecodey0 + sec + sbc inttemp1 + cpx #$80 + bcs driving0skipnegate2 + eor #$FF + adc #1 +driving0skipnegate2 + sta mousecodey0 +drivingboostdone0 + endif ; DRIVINGBOOST + + jmp LLRET0 + + endif ; MOUSE0SUPPORT + +mouse1update + ifconst MOUSE1SUPPORT + +mousetableselect = inttemp2 +mousexdelta = inttemp3 +mouseydelta = inttemp4 +lastSWCHA = inttemp6 + + ; 0000YyXx st mouse + ; 0000xyXY amiga mouse + + lda #$ff + sta lastSWCHA + + ldy port1control + + lda #%00010000 + cpy #9 ; AMIGA? + bne skipamigabitsfix1 + lda #0 +skipamigabitsfix1 + sta mousetableselect + ifconst DRIVINGBOOST + cpy #6 ; DRIVING? + bne skipdriving1setup + ; swap mousex1 and mousey1. mousex seen by the 7800basic program + ; trails the actual mousex1, so we can smoothly interpolate toward + ; the actual position. This actual position is stored in mousey1 + ; after the driver has run. + ldx mousex1 + lda mousey1 + stx mousey1 + sta mousex1 +skipdriving1setup + endif ; DRIVINGBOOST + + lda #0 + sta mousexdelta + sta mouseydelta + + ifnconst MOUSETIME + ifnconst MOUSEXONLY + lda #180 ; minimum for x+y + else + lda #100 ; minimum for just x + endif + else + lda #MOUSETIME + endif + jsr SETTIM64T ; INTIM is in Y + +mouse1updateloop + lda SWCHA + and #%00001111 + cmp lastSWCHA + beq mouse1loopcondition + sta lastSWCHA + + ora mousetableselect ; atari/amiga decoding table selection + + ; st mice encode on different bits/joystick-lines than amiga mice... + ; 0000YyXx st mouse + ; 0000xyXY amiga mouse + ; ...so can shuffle the amiga bits to reuse the st driver. + tay + lax amigatoataribits,y + + ifnconst MOUSEXONLY + ; first the Y... + and #%00001100 + ora mousecodey1 + tay + lda rotationalcompare,y + clc + adc mouseydelta + sta mouseydelta + tya + lsr + lsr + sta mousecodey1 + txa + ; ...then the X... + and #%00000011 + tax + endif ; !MOUSEXONLY + + asl + asl + ora mousecodex1 + tay + lda rotationalcompare,y + adc mousexdelta ; carry was clear by previous ASL + sta mousexdelta + stx mousecodex1 +mouse1loopcondition + lda TIMINT + bpl mouse1updateloop + + ; *** adapt to selected device resolution. + ldx port1control + + ifconst PRECISIONMOUSING + ldy port1resolution + bne mouse1halveddone + cpx #6 ; half-resolution is no good for driving wheels + beq mouse1halveddone + ; resolution=0 is half mouse resolution, necessary for precision + ; mousing on a 160x240 screen with a 1000 dpi mouse. + + lda mousexdelta + cmp #$80 + ror ; do a signed divide by 2. + clc + adc mousex1 + sta mousex1 + ifnconst MOUSEXONLY + lda mouseydelta + clc + adc mousey1 + sta mousey1 + endif + ; at half resolution we just exit after updating x and y + jmp LLRET1 +mouse1halveddone + endif ; PRECISIONMOUSING + + ifnconst MOUSEXONLY + asl mouseydelta ; *2 because Y resolution is finer + ldy port1resolution + dey + lda #0 +mousey1resolutionfix + clc + adc mouseydelta + dey + bpl mousey1resolutionfix + clc + adc mousey1 + sta mousey1 + endif ; MOUSEXONLY + + ldy port1resolution + dey + lda #0 +mousex1resolutionfix + clc + adc mousexdelta + dey + bpl mousex1resolutionfix + ifnconst DRIVINGBOOST + clc + adc mousex1 + sta mousex1 + else + cpx #6 + beq carryonmouse1boost + clc + adc mousex1 + sta mousex1 + jmp LLRET1 +carryonmouse1boost + sta mousexdelta + clc + adc mousecodey1 + sta mousecodey1 + clc + adc mousex1 + tay ; save the target X + adc mousey1 ; average in the smoothly-trailing X + ror + sta mousex1 ; mousex0 now has the smoothly trailing X + sty mousey1 ; and mousey0 has the the target X + + ; check to see if the coordinate wrapped. If so, undo the averaging code. + ; A has mousex1, the smoothly trailing X + sbc mousey1 ; less the target X + bpl skipabsolutedrive1 + eor #$ff +skipabsolutedrive1 + cmp #64 ; just an unreasonably large change + bcc skipdrivewrapfix1 + sty mousex1 ; if X wrapped, we catch the trailing X up to the target X +skipdrivewrapfix1 + + ; get rid of the tweening if the distance travelled was very small + lda mousexdelta + cmp port1resolution + bcs skipbetweenfix1 + lda mousex1 + sta mousey1 +skipbetweenfix1 + +drivingboostreductioncheck1 + ; The below code amounts to mousecodey0=mousecodey0-(mousecodey0/8) + ; +ve mousecodey0 is converted to -ve to do the calculation, and then + ; negated again because truncation during BCD math results in + ; differing magnitudes, depending if the value is +ve or -ve. +driving1fix + lax mousecodey1 + cmp #$80 + bcs driving0skipnegate1 + eor #$FF + adc #1 + sta mousecodey1 +driving0skipnegate1 + cmp #$80 + ror + cmp #$80 + ror + cmp #$80 + ror + sta inttemp1 + lda mousecodey1 + sec + sbc inttemp1 + cpx #$80 + bcs driving1skipnegate2 + eor #$FF + adc #1 +driving1skipnegate2 + sta mousecodey1 +drivingboostdone1 + endif ; DRIVINGBOOST + + jmp LLRET1 + + endif ; MOUSE1SUPPORT + + +trakball0update + ifconst TRAKBALL0SUPPORT + ifnconst TRAKTIME + ifnconst TRAKXONLY + lda #180 ; minimum for x+y + else; !TRAKXONLY + lda #100 ; minimum for just x + endif; !TRAKXONLY + else ; !TRAKTIME + lda #TRAKTIME + endif ; !TRAKTIME + jsr SETTIM64T ; INTIM is in Y + ldx #0 + ifnconst TRAKXONLY + ldy #0 + endif ; TRAKXONLY +trakball0updateloop + lda SWCHA + and #%00110000 + cmp trakballcodex0 + sta trakballcodex0 + beq trakball0movementXdone + and #%00010000 + beq trakball0negativeX +trakball0positiveX + ;(2 from beq) + inx ; 2 + jmp trakball0movementXdone ; 3 +trakball0negativeX + ;(3 from beq) + dex ; 2 + nop ; 2 +trakball0movementXdone + + ifnconst TRAKXONLY + lda SWCHA + and #%11000000 + cmp trakballcodey0 + sta trakballcodey0 + beq trakball0movementYdone + and #%01000000 + beq trakball0negativeY +trakball0positiveY + ;(2 from beq) + iny ; 2 + jmp trakball0movementYdone ; 3 +trakball0negativeY + ;(3 from beq) + dey ; 2 + nop ; 2 +trakball0movementYdone + endif ; !TRAKXONLY + + lda TIMINT + bpl trakball0updateloop + lda #0 + cpx #0 + beq trakball0skipXadjust + clc +trakball0Xloop + adc port0resolution + dex + bne trakball0Xloop + clc + adc trakballx0 + sta trakballx0 +trakball0skipXadjust + ifnconst TRAKXONLY + lda #0 + cpy #0 + beq trakball0skipYadjust + clc +trakball0yloop + adc port0resolution + dey + bne trakball0yloop + clc + adc trakbally0 + sta trakbally0 +trakball0skipYadjust + endif ; !TRAKXONLY + + jmp LLRET0 + endif + + + +trakball1update + ifconst TRAKBALL1SUPPORT + ifnconst TRAKTIME + ifnconst TRAKXONLY + lda #180 ; minimum for x+y + else; !TRAKXONLY + lda #100 ; minimum for just x + endif; !TRAKXONLY + else ; !TRAKTIME + lda #TRAKTIME + endif ; !TRAKTIME + jsr SETTIM64T ; INTIM is in Y + ldx #0 + ifnconst TRAKXONLY + ldy #0 + endif ; TRAKXONLY +trakball1updateloop + lda SWCHA + and #%00000011 + cmp trakballcodex1 + sta trakballcodex1 + beq trakball1movementXdone + and #%00000001 + beq trakball1negativeX +trakball1positiveX + ;(2 from beq) + inx ; 2 + jmp trakball1movementXdone ; 3 +trakball1negativeX + ;(3 from beq) + dex ; 2 + nop ; 2 +trakball1movementXdone + + ifnconst TRAKXONLY + lda SWCHA + and #%00001100 + cmp trakballcodey1 + sta trakballcodey1 + beq trakball1movementYdone + and #%00000100 + beq trakball1negativeY +trakball1positiveY + ;(2 from beq) + iny ; 2 + jmp trakball1movementYdone ; 3 +trakball1negativeY + ;(3 from beq) + dey ; 2 + nop ; 2 +trakball1movementYdone + endif ; !TRAKXONLY + + lda TIMINT + bpl trakball1updateloop + lda #0 + cpx #0 + beq trakball1skipXadjust + clc +trakball1Xloop + adc port1resolution + dex + bne trakball1Xloop + clc + adc trakballx1 + sta trakballx1 +trakball1skipXadjust + ifnconst TRAKXONLY + lda #0 + cpy #0 + beq trakball1skipYadjust + clc +trakball1yloop + adc port1resolution + dey + bne trakball1yloop + clc + adc trakbally1 + sta trakbally1 +trakball1skipYadjust + endif ; !TRAKXONLY + + jmp LLRET1 + endif + + +paddleport0update + ifconst PADDLE0SUPPORT + lda #6 + sta VBLANK ; start charging the paddle caps + lda #0 ; use PADDLE timing + jsr SETTIM64T ; INTIM is in Y + +paddleport0updateloop + lda INPT0 + bmi skippaddle0setposition + sty paddleposition0 +skippaddle0setposition + ifconst TWOPADDLESUPPORT + lda INPT1 + bmi skippaddle1setposition + sty paddleposition1 +skippaddle1setposition + endif + ldy INTIM + cpy #TIMEOFFSET + bcs paddleport0updateloop + + lda #%10000110 + sta VBLANK ; dump paddles to ground... this may not be great for genesis controllers + sec + lda paddleposition0 + sbc #TIMEOFFSET + ifconst PADDLESCALEX2 + asl + endif + + ifnconst PADDLESMOOTHINGOFF + clc + adc paddleprevious0 + ror + sta paddleprevious0 + endif + + sta paddleposition0 + + ifconst TWOPADDLESUPPORT + sec + lda paddleposition1 + sbc #TIMEOFFSET + ifconst PADDLESCALEX2 + asl + endif + + ifnconst PADDLESMOOTHINGOFF + clc + adc paddleprevious1 + ror + sta paddleprevious1 + endif + sta paddleposition1 + endif ; TWOPADDLESUPPORT + + jmp LLRET0 + endif + +paddleport1update + ifconst PADDLE1SUPPORT + lda #6 + sta VBLANK ; start charging the paddle caps + + lda #0 ; use PADDLE timing + jsr SETTIM64T ; INTIM is in Y + +paddleport1updateloop + lda INPT2 + bmi skippaddle2setposition + sty paddleposition2 +skippaddle2setposition + ifconst TWOPADDLESUPPORT + lda INPT3 + bmi skippaddle3setposition + sty paddleposition3 +skippaddle3setposition + endif + ldy INTIM + cpy #TIMEOFFSET + bcs paddleport1updateloop + + lda #%10000110 + sta VBLANK ; dump paddles to ground... this may not be great for genesis controllers + sec + lda paddleposition2 + sbc #TIMEOFFSET + ifconst PADDLESCALEX2 + asl + endif + + ifnconst PADDLESMOOTHINGOFF + clc + adc paddleprevious2 + ror + sta paddleprevious2 + endif + + sta paddleposition2 + + ifconst TWOPADDLESUPPORT + sec + lda paddleposition3 + sbc #TIMEOFFSET + ifconst PADDLESCALEX2 + asl + endif + + ifnconst PADDLESMOOTHINGOFF + clc + adc paddleprevious3 + ror + sta paddleprevious3 + endif + sta paddleposition3 + endif ; TWOPADDLESUPPORT + + jmp LLRET1 + endif + + +paddlebuttonhandler ; outside of conditional, for button-handler LUT + ifconst PADDLESUPPORT + ; x=0|1 for port, rather than paddle #. + ; Only the first paddle button will integrate into "joy0fire" testing. If the + ; game wants to support 2 paddles, up to the game to instead test the + ; joystick right+left directions instead. + lda SWCHA ; top of nibble is first paddle button + cpx #0 ; port 0? + beq skippaddleport2shift + asl ; shift second port to upper nibble + asl + asl + asl +skippaddleport2shift + and #%10000000 + eor #%10000000 ; invert + sta sINPT1,x + jmp buttonreadloopreturn + endif ; PADDLESUPPORT + +mousebuttonhandler ; outside of conditional, for button-handler LUT + ifconst MOUSESUPPORT + ; stick the mouse buttons in the correct shadow register... + txa + asl + tay ; y=x*2 + lda INPT4,x + eor #%10000000 + lsr + sta sINPT1,x + + lda INPT1,y + and #%10000000 + eor #%10000000 + ora sINPT1,x + sta sINPT1,x + jmp buttonreadloopreturn + endif ; MOUSESUPPORT + + ifconst KEYPADSUPPORT + ; ** select keypad rows 0 to 3 over 4 frames... +keypadrowselect + inc keypadcounter + ldy #0 + lda port0control + cmp #7 + bne skipport0val + iny ; y=y+1 +skipport0val + lda port1control + cmp #7 + bne skipport1val + iny + iny ; y=y+2 +skipport1val + cpy #0 + beq exitkeypadrowselect + lda keyrowdirectionmask,y + sta CTLSWA + tya + asl + asl + sta inttemp1 + lda keypadcounter + and #3 + ora inttemp1 + tax + lda keyrowselectvalue,x + sta SWCHA +exitkeypadrowselect + rts + +keyrowdirectionmask + .byte #%00000000 ; 0 : port0=input port1=input + .byte #%11110000 ; 1 : port0=output port1=input + .byte #%00001111 ; 2 : port0=input port1=output + .byte #%11111111 ; 3 : port0=output port1=output + +keyrowselectvalue + .byte #%00000000, #%00000000, #%00000000, #%00000000 ; no row selected, all pins high, always + .byte #%11100000, #%11010000, #%10110000, #%01110000 ; p0 keypad in + .byte #%00001110, #%00001101, #%00001011, #%00000111 ; p1 keypad in + .byte #%11101110, #%11011101, #%10111011, #%01110111 ; p0+p1 keypads in + endif; KEYPADSUPPORT + + ifconst KEYPADSUPPORT + ; TODO - split into compile-time KEYPAD0SUPPORT and KEYPAD1SUPPORT +keypadcolumnread + lda port0control + cmp #7 + bne skipkeypadcolumnread0 + lda keypadcounter + and #3 + asl ; x2 because keypad variables are interleaved + tax + lda #0 + sta keypadmatrix0a,x + lda INPT0 + cmp #$80 + rol keypadmatrix0a,x + lda INPT1 + cmp #$80 + rol keypadmatrix0a,x + lda INPT4 + cmp #$80 + rol keypadmatrix0a,x + lda keypadmatrix0a,x + eor #%00000111 + sta keypadmatrix0a,x +skipkeypadcolumnread0 + + lda port1control + cmp #7 + bne skipkeypadcolumnread1 + lda keypadcounter + and #3 + asl ; x2 because keypad variables are interleaved + tax + lda #0 + sta keypadmatrix1a,x + rol keypadmatrix1a,x + lda INPT2 + cmp #$80 + rol keypadmatrix1a,x + lda INPT3 + cmp #$80 + rol keypadmatrix1a,x + lda INPT5 + cmp #$80 + rol keypadmatrix1a,x + lda keypadmatrix1a,x + eor #%00000111 + sta keypadmatrix1a,x +skipkeypadcolumnread1 + rts + endif ; KEYPADSUPPORT + +setportforinput + lda CTLSWA + and SWCHA_DIRMASK,x + sta CTLSWA + rts + +setonebuttonmode + lda #6 ; in case we're in unlocked-bios mode + sta VBLANK ; if we were on paddles, the line is grounded out. + lda #$14 + sta CTLSWB + lda SWCHB + ora thisjoy2buttonbit,x ; disable: write 1 to the 2-button bit + sta SWCHB + rts + +settwobuttonmode + lda #6 ; in case we're in unlocked-bios mode + sta VBLANK ; if we were on paddles, the line is grounded out. + lda #$14 + sta CTLSWB + lda SWCHB + and thisjoy2buttonbit+1,x ; enable: write 0 to the 2-button bit + sta SWCHB + rts + +thisjoy2buttonbit + ; p0 p1 p0 + .byte $04, $10, $04 + diff --git a/out/bin/compilers/7800basic/includes/tracker.asm b/out/bin/compilers/7800basic/includes/tracker.asm index 591e7e5e..caa41bc3 100644 --- a/out/bin/compilers/7800basic/includes/tracker.asm +++ b/out/bin/compilers/7800basic/includes/tracker.asm @@ -11,6 +11,10 @@ trackerstart servicesongover rts servicesong + ifconst PAUSESILENT + lda pausestate + bne servicesongover + endif lda songtempo beq servicesongover ; ** if song is off/paused then return servicesongcontinue @@ -70,7 +74,7 @@ processsongdata sta songdatalo lda songchannel1layer1hi,y sta songdatahi - ora songdatalo + ;ora songdatalo bne channelhasdata ;channel data is pointing at $0000 lda #$7F @@ -130,7 +134,7 @@ handlenotedata sta sfxpitchoffset jsr schedulesfx - +skipnoteschedule jmp advancethesongpointer1byte ; advance to the next data byte and exit handlechannelrest diff --git a/out/bin/compilers/7800basic/includes/zonememory.asm b/out/bin/compilers/7800basic/includes/zonememory.asm index d71229b2..593c2650 100644 --- a/out/bin/compilers/7800basic/includes/zonememory.asm +++ b/out/bin/compilers/7800basic/includes/zonememory.asm @@ -16,9 +16,17 @@ WZONEHEIGHT = ZONEHEIGHT endif ifnconst ZONECOUNT + ifconst VSCROLL +WZONECOUNT = ((WSCREENHEIGHT/WZONEHEIGHT)+1) + else ; !VSCROLL WZONECOUNT = (WSCREENHEIGHT/WZONEHEIGHT) + endif ; !VSCROLL else + ifconst VSCROLL +WZONECOUNT = (ZONECOUNT+1) + else ; !VSCROLL WZONECOUNT = ZONECOUNT + endif ; !VSCROLL endif ; top of the frame, non-visible lines. this is based on NTSC, @@ -47,7 +55,14 @@ WDLMEMEND = DLMEMEND endif -WMEMSIZE = (WDLMEMEND-WDLMEMSTART+1) +WMEMSIZE SET (WDLMEMEND-WDLMEMSTART+1) + + ifconst VSCROLL + ifnconst DOUBLEBUFFER + ; give the last zone extra ram for the dma mask objects... +WMEMSIZE SET (WMEMSIZE-(maskscrollspriteend-maskscrollsprite)) + endif ; DOUBLEBUFFER + endif ; VSCROLL ifnconst DOUBLEBUFFER DLLASTOBJ = ((((WMEMSIZE/WZONECOUNT)-2)/5)*5) ; -2 to always ensure we have 1x double-byte terminator @@ -122,6 +137,7 @@ TMPMEMADDRESS SET (TMPMEMADDRESS + $300) endif ; EXTRADLMEMORY ZONE,DLINDEX,"ADDRESS" = TMPMEMADDRESS +LASTZONEADDRESS SET TMPMEMADDRESS DLINDEX SET DLINDEX + 1 REPEND diff --git a/out/bin/compilers/7800basic/keywords.c b/out/bin/compilers/7800basic/keywords.c index b1268fa5..af018c6b 100644 --- a/out/bin/compilers/7800basic/keywords.c +++ b/out/bin/compilers/7800basic/keywords.c @@ -535,6 +535,10 @@ void keywords (char **cstatement) incmapfile (statement); else if (!strncmp (statement[1], "incrmtfile\0", 10)) incrmtfile (statement); + else if (!strncmp (statement[1], "decompress\0", 10)) + decompress (statement); + else if (!strncmp (statement[1], "inccompress\0", 11)) + inccompress (statement); else if (!strncmp (statement[1], "newblock\0", 8)) newblock (); else if (!strncmp (statement[1], "voice\0", 5)) diff --git a/out/bin/compilers/7800basic/keywords.h b/out/bin/compilers/7800basic/keywords.h index c17fa5b5..67ca3b2b 100644 --- a/out/bin/compilers/7800basic/keywords.h +++ b/out/bin/compilers/7800basic/keywords.h @@ -4,6 +4,7 @@ #define KEYWORDS_H #define MAXCONSTANTS 80000 +#define CONSTANTLEN 100 void keywords (char **); diff --git a/out/bin/compilers/7800basic/lz4raw.LICENSE.txt b/out/bin/compilers/7800basic/lz4raw.LICENSE.txt deleted file mode 100644 index ce77fe93..00000000 --- a/out/bin/compilers/7800basic/lz4raw.LICENSE.txt +++ /dev/null @@ -1,3 +0,0 @@ -lz4raw is distributed here under the terms of the GNU GPL v2 License. - -Please see the included LICENSE.txt file for the full GPL v2 license text. diff --git a/out/bin/compilers/7800basic/lz4raw.exe b/out/bin/compilers/7800basic/lz4raw.exe deleted file mode 100644 index 13030656..00000000 Binary files a/out/bin/compilers/7800basic/lz4raw.exe and /dev/null differ diff --git a/out/bin/compilers/7800basic/lzsa.Darwin.x64 b/out/bin/compilers/7800basic/lzsa.Darwin.x64 new file mode 100644 index 00000000..204f80cc Binary files /dev/null and b/out/bin/compilers/7800basic/lzsa.Darwin.x64 differ diff --git a/out/bin/compilers/7800basic/lzsa.Darwin.x86 b/out/bin/compilers/7800basic/lzsa.Darwin.x86 new file mode 100644 index 00000000..e18ab7ac Binary files /dev/null and b/out/bin/compilers/7800basic/lzsa.Darwin.x86 differ diff --git a/out/bin/compilers/7800basic/lzsa.LICENSE.txt b/out/bin/compilers/7800basic/lzsa.LICENSE.txt new file mode 100644 index 00000000..b560b8a3 --- /dev/null +++ b/out/bin/compilers/7800basic/lzsa.LICENSE.txt @@ -0,0 +1,9 @@ +7800basic uses LZSA as its compression format. + +The LZSA code is available under the Zlib license. +The match finder (matchfinder.c) is available under the CC0 license due to using portions of code from Eric Bigger's Wimlib in the suffix array-based matchfinder. + +For more information, check out the LZSA github: + + https://github.com/emmanuel-marty/lzsa/ + diff --git a/out/bin/compilers/7800basic/lzsa.Linux.x64 b/out/bin/compilers/7800basic/lzsa.Linux.x64 new file mode 100644 index 00000000..b4e5b282 Binary files /dev/null and b/out/bin/compilers/7800basic/lzsa.Linux.x64 differ diff --git a/out/bin/compilers/7800basic/lzsa.Linux.x86 b/out/bin/compilers/7800basic/lzsa.Linux.x86 new file mode 100644 index 00000000..97424ffe Binary files /dev/null and b/out/bin/compilers/7800basic/lzsa.Linux.x86 differ diff --git a/out/bin/compilers/7800basic/lzsa.Windows.x32.exe b/out/bin/compilers/7800basic/lzsa.Windows.x32.exe new file mode 100644 index 00000000..4fce8e43 Binary files /dev/null and b/out/bin/compilers/7800basic/lzsa.Windows.x32.exe differ diff --git a/out/bin/compilers/7800basic/lzsa.Windows.x64.exe b/out/bin/compilers/7800basic/lzsa.Windows.x64.exe new file mode 100644 index 00000000..7bfa1ecb Binary files /dev/null and b/out/bin/compilers/7800basic/lzsa.Windows.x64.exe differ diff --git a/out/bin/compilers/7800basic/lzsa.exe b/out/bin/compilers/7800basic/lzsa.exe new file mode 100644 index 00000000..7bfa1ecb Binary files /dev/null and b/out/bin/compilers/7800basic/lzsa.exe differ diff --git a/out/bin/compilers/7800basic/makefile b/out/bin/compilers/7800basic/makefile index 8c330900..c6e76db7 100644 --- a/out/bin/compilers/7800basic/makefile +++ b/out/bin/compilers/7800basic/makefile @@ -1,56 +1,59 @@ -# The 7800basic generic-Unix makefile. Should work with most unixy OSes. -SHELL=/bin/sh -CHMOD=chmod -CP=cp -RM=rm -#CFLAGS for valgrind... -CFLAGS= -g -O0 -#CFLAGS=-O0 -Wall +# The 7800basic generic "adhoc" compiling makefile. +ARCH= +LDIR=contrib/adhoc CC=cc +CFLAGS= LEX=lex LEXFLAGS=-t -all: 7800basic 7800preprocess 7800postprocess 7800filter 7800optimize 7800header 7800sign 7800makecc2 snip banksetsymbols 7800rmtfix 7800rmt2asm +all: 7800basic 7800preprocess 7800postprocess 7800filter 7800optimize 7800header 7800sign 7800makecc2 snip banksetsymbols 7800rmtfix 7800rmt2asm -7800basic: 7800bas.c statements.c keywords.c statements.h keywords.h atarivox.h minitar.c minitar.h - ${CC} ${CFLAGS} -o $@ 7800bas.c statements.c keywords.c minitar.c -lz -lpng -lm +7800basic: 7800bas.c statements.c keywords.c statements.h keywords.h atarivox.h minitar.c minitar.h + cd contrib/src ; ./make_libraries_adhoc_static.sh ; cd ../.. + ${CC} ${CFLAGS} -o 7800basic 7800bas.c statements.c keywords.c minitar.c -L${LDIR}/lib -I${LDIR}/include -lpng -lz -lm -llzsa 7800postprocess: postprocess.c - ${CC} ${CFLAGS} -o $@ postprocess.c + ${CC} ${CFLAGS} -o 7800postprocess postprocess.c 7800filter: filter.c - ${CC} ${CFLAGS} -o $@ filter.c + ${CC} ${CFLAGS} -o 7800filter filter.c 7800preprocess: preprocess.lex ${LEX} ${LEXFLAGS}lex.yy.c - ${CC} ${CFLAGS} -o $@ lex.yy.c - ${RM} -f lex.yy.c + ${CC} ${CFLAGS} -o 7800preprocess lex.yy.c + rm -f lex.yy.c 7800optimize: optimize.lex ${LEX} ${LEXFLAGS} -ilex.yy.c - ${CC} ${CFLAGS} -o $@ lex.yy.c - ${RM} -f lex.yy.c + ${CC} ${CFLAGS} -o 7800optimize lex.yy.c + rm -f lex.yy.c 7800header: 7800header.c - ${CC} ${CFLAGS} -o $@ 7800header.c + ${CC} ${CFLAGS} -o 7800header 7800header.c 7800sign: 7800sign.c - ${CC} ${CFLAGS} -o $@ 7800sign.c + ${CC} ${CFLAGS} -o 7800sign 7800sign.c snip: snip.c - ${CC} ${CFLAGS} -o $@ snip.c + ${CC} ${CFLAGS} -o snip snip.c banksetsymbols: banksetsymbols.c - ${CC} ${CFLAGS} -o $@ banksetsymbols.c + ${CC} ${CFLAGS} -o banksetsymbols banksetsymbols.c 7800rmtfix: 7800rmtfix.c - ${CC} ${CFLAGS} -o $@ 7800rmtfix.c + ${CC} ${CFLAGS} -o 7800rmtfix 7800rmtfix.c 7800rmt2asm: 7800rmt2asm.c - ${CC} ${CFLAGS} -o $@ 7800rmt2asm.c + ${CC} ${CFLAGS} -o 7800rmt2asm 7800rmt2asm.c 7800makecc2: 7800makecc2.c - ${CC} ${CFLAGS} -o $@ 7800makecc2.c + ${CC} ${CFLAGS} -o 7800makecc2 7800makecc2.c + +install: all + +clean: + rm -f 7800basic 7800preprocess 7800postprocess 7800optimize 7800header 7800sign banksetsymbols 7800filter 7800makecc2 7800rmtfix 7800rmt2asm lzsa snip + rm -fr contrib/adhoc dist: make clean @@ -71,17 +74,3 @@ distclean: make -f makefile.xcmp.osx-x86 clean make -f makefile.xcmp.osx-x64 clean - -install: all - -clean: - ${RM} -f 7800basic 7800preprocess 7800postprocess 7800filter 7800optimize 7800header 7800sign snip banksetsymbols 7800makecc2 7800rmtfix 7800rmt2asm lz4raw snip - -love: - @echo "not war" -peace: - @echo "not war" -hay: - @echo "while the sun shines" -believe: - @echo "ok... the floor is lava" diff --git a/out/bin/compilers/7800basic/makefile.linux-x64 b/out/bin/compilers/7800basic/makefile.linux-x64 index b381f184..cd4ccb82 100644 --- a/out/bin/compilers/7800basic/makefile.linux-x64 +++ b/out/bin/compilers/7800basic/makefile.linux-x64 @@ -11,7 +11,7 @@ LEXFLAGS=-t all: 7800basic.${ARCH} 7800preprocess.${ARCH} 7800postprocess.${ARCH} 7800filter.${ARCH} 7800optimize.${ARCH} 7800header.${ARCH} 7800sign.${ARCH} 7800makecc2.${ARCH} snip.${ARCH} banksetsymbols.${ARCH} 7800rmtfix.${ARCH} 7800rmt2asm.${ARCH} 7800basic.${ARCH}: 7800bas.c statements.c keywords.c statements.h keywords.h atarivox.h minitar.c minitar.h - ${CC} ${CFLAGS} -o 7800basic.${ARCH} 7800bas.c statements.c keywords.c minitar.c -L${LDIR}/lib -I${LDIR}/include -lpng -lz -lm + ${CC} ${CFLAGS} -o 7800basic.${ARCH} 7800bas.c statements.c keywords.c minitar.c -L${LDIR}/lib -I${LDIR}/include -lpng -lz -lm -llzsa 7800postprocess.${ARCH}: postprocess.c ${CC} ${CFLAGS} -o 7800postprocess.${ARCH} postprocess.c diff --git a/out/bin/compilers/7800basic/makefile.linux-x86 b/out/bin/compilers/7800basic/makefile.linux-x86 index 8ab2875c..b735c528 100644 --- a/out/bin/compilers/7800basic/makefile.linux-x86 +++ b/out/bin/compilers/7800basic/makefile.linux-x86 @@ -11,7 +11,7 @@ LEXFLAGS=-t all: 7800basic.${ARCH} 7800preprocess.${ARCH} 7800postprocess.${ARCH} 7800filter.${ARCH} 7800optimize.${ARCH} 7800header.${ARCH} 7800sign.${ARCH} 7800makecc2.${ARCH} snip.${ARCH} banksetsymbols.${ARCH} 7800rmtfix.${ARCH} 7800rmt2asm.${ARCH} 7800basic.${ARCH}: 7800bas.c statements.c keywords.c statements.h keywords.h atarivox.h minitar.c minitar.h - ${CC} ${CFLAGS} -o 7800basic.${ARCH} 7800bas.c statements.c keywords.c minitar.c -L${LDIR}/lib -I${LDIR}/include -lpng -lz -lm + ${CC} ${CFLAGS} -o 7800basic.${ARCH} 7800bas.c statements.c keywords.c minitar.c -L${LDIR}/lib -I${LDIR}/include -lpng -lz -lm -llzsa 7800postprocess.${ARCH}: postprocess.c ${CC} ${CFLAGS} -o 7800postprocess.${ARCH} postprocess.c diff --git a/out/bin/compilers/7800basic/makefile.xcmp.osx-x64 b/out/bin/compilers/7800basic/makefile.xcmp.osx-x64 index 21ced5f1..145bb152 100644 --- a/out/bin/compilers/7800basic/makefile.xcmp.osx-x64 +++ b/out/bin/compilers/7800basic/makefile.xcmp.osx-x64 @@ -16,7 +16,7 @@ LDIR=contrib/${ARCH} all: 7800basic.${ARCH} 7800preprocess.${ARCH} 7800postprocess.${ARCH} 7800filter.${ARCH} 7800optimize.${ARCH} 7800header.${ARCH} 7800sign.${ARCH} 7800makecc2.${ARCH} snip.${ARCH} banksetsymbols.${ARCH} 7800rmtfix.${ARCH} 7800rmt2asm.${ARCH} 7800basic.${ARCH}: 7800bas.c statements.c keywords.c statements.h keywords.h atarivox.h minitar.c minitar.h - ${CC} ${CFLAGS} -o 7800basic.${ARCH} 7800bas.c statements.c keywords.c minitar.c -L${LDIR}/lib -I${LDIR}/include -lpng -lz -lm + ${CC} ${CFLAGS} -o 7800basic.${ARCH} 7800bas.c statements.c keywords.c minitar.c -L${LDIR}/lib -I${LDIR}/include -lpng -lz -lm -llzsa 7800postprocess.${ARCH}: postprocess.c ${CC} ${CFLAGS} -o 7800postprocess.${ARCH} postprocess.c diff --git a/out/bin/compilers/7800basic/makefile.xcmp.osx-x86 b/out/bin/compilers/7800basic/makefile.xcmp.osx-x86 index d3809c2f..0f52d4f1 100644 --- a/out/bin/compilers/7800basic/makefile.xcmp.osx-x86 +++ b/out/bin/compilers/7800basic/makefile.xcmp.osx-x86 @@ -16,7 +16,7 @@ LDIR=contrib/${ARCH} all: 7800basic.${ARCH} 7800preprocess.${ARCH} 7800postprocess.${ARCH} 7800filter.${ARCH} 7800optimize.${ARCH} 7800header.${ARCH} 7800sign.${ARCH} 7800makecc2.${ARCH} snip.${ARCH} banksetsymbols.${ARCH} 7800rmtfix.${ARCH} 7800rmt2asm.${ARCH} 7800basic.${ARCH}: 7800bas.c statements.c keywords.c statements.h keywords.h atarivox.h minitar.c minitar.h - ${CC} ${CFLAGS} -o 7800basic.${ARCH} 7800bas.c statements.c keywords.c minitar.c -L${LDIR}/lib -I${LDIR}/include -lpng -lz -lm + ${CC} ${CFLAGS} -o 7800basic.${ARCH} 7800bas.c statements.c keywords.c minitar.c -L${LDIR}/lib -I${LDIR}/include -lpng -lz -lm -llzsa 7800postprocess.${ARCH}: postprocess.c ${CC} ${CFLAGS} -o 7800postprocess.${ARCH} postprocess.c diff --git a/out/bin/compilers/7800basic/makefile.xcmp.win-x64 b/out/bin/compilers/7800basic/makefile.xcmp.win-x64 index 6582f400..64fe4c13 100644 --- a/out/bin/compilers/7800basic/makefile.xcmp.win-x64 +++ b/out/bin/compilers/7800basic/makefile.xcmp.win-x64 @@ -14,7 +14,7 @@ LDIR=contrib/${ARCH} all: 7800basic.Windows.x64.exe 7800preprocess.Windows.x64.exe 7800postprocess.Windows.x64.exe 7800filter.Windows.x64.exe 7800optimize.Windows.x64.exe 7800header.Windows.x64.exe 7800sign.Windows.x64.exe 7800makecc2.Windows.x64.exe snip.Windows.x64.exe banksetsymbols.Windows.x64.exe 7800rmtfix.Windows.x64.exe 7800rmt2asm.Windows.x64.exe 7800basic.Windows.x64.exe: 7800bas.c statements.c keywords.c statements.h keywords.h atarivox.h minitar.c minitar.h - ${CC} ${CFLAGS} -o 7800basic.Windows.x64.exe 7800bas.c statements.c keywords.c minitar.c -L${LDIR}/lib -I${LDIR}/include -lpng -lz -lm + ${CC} ${CFLAGS} -o 7800basic.Windows.x64.exe 7800bas.c statements.c keywords.c minitar.c -L${LDIR}/lib -I${LDIR}/include -lpng -lz -lm -llzsa 7800postprocess.Windows.x64.exe: postprocess.c ${CC} ${CFLAGS} -o 7800postprocess.Windows.x64.exe postprocess.c diff --git a/out/bin/compilers/7800basic/makefile.xcmp.win-x86 b/out/bin/compilers/7800basic/makefile.xcmp.win-x86 index 5de86c62..7c34caa3 100644 --- a/out/bin/compilers/7800basic/makefile.xcmp.win-x86 +++ b/out/bin/compilers/7800basic/makefile.xcmp.win-x86 @@ -15,7 +15,7 @@ LDIR=contrib/${ARCH} all: 7800basic.Windows.x86.exe 7800preprocess.Windows.x86.exe 7800postprocess.Windows.x86.exe 7800filter.Windows.x86.exe 7800optimize.Windows.x86.exe 7800header.Windows.x86.exe 7800sign.Windows.x86.exe 7800makecc2.Windows.x86.exe snip.Windows.x86.exe banksetsymbols.Windows.x86.exe 7800rmtfix.Windows.x86.exe 7800rmt2asm.Windows.x86.exe 7800basic.Windows.x86.exe: 7800bas.c statements.c keywords.c statements.h keywords.h atarivox.h minitar.c minitar.h - ${CC} ${CFLAGS} -o 7800basic.Windows.x86.exe 7800bas.c statements.c keywords.c minitar.c -L${LDIR}/lib -I${LDIR}/include -lpng -lz -lm + ${CC} ${CFLAGS} -o 7800basic.Windows.x86.exe 7800bas.c statements.c keywords.c minitar.c -L${LDIR}/lib -I${LDIR}/include -lpng -lz -lm -llzsa 7800postprocess.Windows.x86.exe: postprocess.c ${CC} ${CFLAGS} -o 7800postprocess.Windows.x86.exe postprocess.c diff --git a/out/bin/compilers/7800basic/release.dat b/out/bin/compilers/7800basic/release.dat index f7c6c31b..48b9990e 100644 --- a/out/bin/compilers/7800basic/release.dat +++ b/out/bin/compilers/7800basic/release.dat @@ -1 +1 @@ -0.30 +0.31 diff --git a/out/bin/compilers/7800basic/snip.Darwin.x64 b/out/bin/compilers/7800basic/snip.Darwin.x64 index abdb1511..1ef1711f 100644 Binary files a/out/bin/compilers/7800basic/snip.Darwin.x64 and b/out/bin/compilers/7800basic/snip.Darwin.x64 differ diff --git a/out/bin/compilers/7800basic/snip.Darwin.x86 b/out/bin/compilers/7800basic/snip.Darwin.x86 index ef4e156f..5600d271 100644 Binary files a/out/bin/compilers/7800basic/snip.Darwin.x86 and b/out/bin/compilers/7800basic/snip.Darwin.x86 differ diff --git a/out/bin/compilers/7800basic/snip.Linux.x64 b/out/bin/compilers/7800basic/snip.Linux.x64 index bf831ac9..c91b3428 100644 Binary files a/out/bin/compilers/7800basic/snip.Linux.x64 and b/out/bin/compilers/7800basic/snip.Linux.x64 differ diff --git a/out/bin/compilers/7800basic/snip.Linux.x86 b/out/bin/compilers/7800basic/snip.Linux.x86 index bf58c7a3..a34e9432 100644 Binary files a/out/bin/compilers/7800basic/snip.Linux.x86 and b/out/bin/compilers/7800basic/snip.Linux.x86 differ diff --git a/out/bin/compilers/7800basic/snip.Windows.x64.exe b/out/bin/compilers/7800basic/snip.Windows.x64.exe index 11373006..671fb163 100644 Binary files a/out/bin/compilers/7800basic/snip.Windows.x64.exe and b/out/bin/compilers/7800basic/snip.Windows.x64.exe differ diff --git a/out/bin/compilers/7800basic/snip.exe b/out/bin/compilers/7800basic/snip.exe index 5a357703..af66656c 100644 Binary files a/out/bin/compilers/7800basic/snip.exe and b/out/bin/compilers/7800basic/snip.exe differ diff --git a/out/bin/compilers/7800basic/statements.c b/out/bin/compilers/7800basic/statements.c index fc59c03b..74e133f8 100644 --- a/out/bin/compilers/7800basic/statements.c +++ b/out/bin/compilers/7800basic/statements.c @@ -13,6 +13,10 @@ #include "atarivox.h" #include "minitar.h" +// liblzsa headers... +#include +#include + #ifndef TRUE #define TRUE (1==1) #endif @@ -22,7 +26,14 @@ extern char stdoutfilename[256]; extern FILE *stdoutfilepointer; +extern FILE *preprocessedfd; extern char backupname[256]; +extern int maxpasses; + +FILE *stderrfilepointer = NULL; + +int passes; + char redefined_variables[80000][100]; char includespath[500]; @@ -47,7 +58,7 @@ char currentcharset[256]; int graphicsdatawidth[16]; char charactersetchars[257]; -char constants[MAXCONSTANTS][100]; +char constants[MAXCONSTANTS][CONSTANTLEN]; char bannerfilenames[1000][100]; int bannerheights[1000]; int bannerwidths[1000]; @@ -96,10 +107,18 @@ int extra = 0; int extralabel = 0; int extraactive = 0; int macroactive = 0; +int dumpgraphics_index = 0; + +int firstfourbyte = 1; +int firstcompress = 1; -char tallspritelabel[2048][1024]; -int tallspriteheight[2048]; -int tallspritecount = 0; +int romsize_already_set = 0; + + +#define TALLSPRITEMAX 2048 +char tallspritelabel[TALLSPRITEMAX][1024]; +int tallspriteheight[TALLSPRITEMAX]; +int tallspritecount; int fourbitfade_alreadyused = 0; @@ -163,7 +182,7 @@ void checkvalidfilename (char *filename) void backupthisfile(char *filename) { - if(!backupflag) + if((!backupflag)||(passes>0)) return; removeCR (filename); if(AddToArchive(filename,TRUE)==FALSE) @@ -960,7 +979,6 @@ int isfixpoint (char *item) void set_romsize (char *size) { - static int romsize_already_set = 0; if (romsize_already_set) prerror ("rom size was specified more than once."); romsize_already_set = 1; @@ -1153,25 +1171,27 @@ void shakescreen (char **statement) // 1 2 // shakescreen lo|med|hi|off - int shakeamount = 15; + int shakeamount = (zoneheight-1); assertminimumargs (statement, "shakescreen", 1); removeCR (statement[2]); if (statement[2][0] == 'l') - shakeamount = 3; + shakeamount = shakeamount/4; else if (statement[2][0] == 'm') - shakeamount = 7; + shakeamount = shakeamount/2; else if (statement[2][0] == 'h') - shakeamount = 15; + shakeamount = shakeamount; else if (statement[2][0] == 'o') { - printf (" lda #%%01001111\n"); - printf (" sta DLLMEM+3\n"); + printf (" lda DLLMEM+9\n"); + printf (" and #%%11110000\n"); + printf (" ora #%d\n",zoneheight-1); + printf (" sta DLLMEM+9\n"); printf (" ifconst DOUBLEBUFFER\n"); printf (" ldy doublebufferstate\n"); printf (" beq [.+5]\n"); - printf (" sta.w DLLMEM+DBOFFSET+3\n"); + printf (" sta.w DLLMEM+DBOFFSET+9\n"); printf (" endif ; DOUBLEBUFFER\n"); return; @@ -1181,12 +1201,12 @@ void shakescreen (char **statement) printf (" jsr randomize\n"); printf (" and #%d\n", shakeamount); - printf (" eor #%%01001111\n"); - printf (" sta DLLMEM+3\n"); + printf (" eor DLLMEM+9\n"); + printf (" sta DLLMEM+9\n"); printf (" ifconst DOUBLEBUFFER\n"); printf (" ldy doublebufferstate\n"); printf (" beq [.+5]\n"); - printf (" sta.w DLLMEM+DBOFFSET+3\n"); + printf (" sta.w DLLMEM+DBOFFSET+9\n"); printf (" endif ; DOUBLEBUFFER\n"); @@ -1382,7 +1402,7 @@ int gettallspriteindex (char *needle) if (tallspritemode == 0) return (-1); - for (t = 0; t < tallspritecount; t++) + for (t = 0; t < TALLSPRITEMAX ; t++) { if (strcmp (tallspritelabel[t], needle) == 0) { @@ -1404,7 +1424,6 @@ void plotsprite (char **statement, int fourbytesprite) // temp4 = x // temp5 = y - static int firstfourbyte = 1; assertminimumargs (statement, "plotsprite", 4); @@ -1412,6 +1431,12 @@ void plotsprite (char **statement, int fourbytesprite) { strcpy (redefined_variables[numredefvars++], "PLOTSP4 = 1"); sprintf (constants[numconstants++], "PLOTSP4"); + firstfourbyte = 0; + } + if(fourbytesprite) + { + printf(" if %s_width = 32\n echo \"*** ERROR: plotsprite4 encountered sprite 32 bytes wide (%s)\"\n",statement[2],statement[2]); + printf(" echo \"*** plotsprite4 is limited to sprites 31 bytes wide or less.\"\n ERR\n endif\n"); } int tsi = gettallspriteindex (statement[2]); @@ -1540,6 +1565,8 @@ void PLOTSPRITE (char **statement, int fourbytesprite) //a wrapper to the PLOTSPRITE* family of macros assertminimumargs (statement, "PLOTSPRITE", 4); + printf(" if %s_width > 16\n echo \"*** ERROR: PLOTSPRITE encountered sprite wider than 16 bytes. (%s)\"\n",statement[2],statement[2]); + printf(" echo \"*** PLOTSPRITE/PLOTSPRITE4 is limited to sprites 16 bytes wide or less.\"\n ERR\n endif\n"); if(fourbytesprite) { @@ -1584,8 +1611,12 @@ void plotbanner (char **statement) { if ((q == 999) || (bannerfilenames[q][0] == 0)) { - prerror ("plotbanner didn't find a banner height for %s", statement[2]); + if (passes==0) + return; + else + prerror ("plotbanner didn't find a banner height for %s", statement[2]); } + if (strcmp (bannerfilenames[q], statement[2]) == 0) break; } @@ -2132,7 +2163,10 @@ void plotmapfile (char **statement) { if ((q == 999) || (palettefilenames[q][0] == 0)) { - prerror ("plotmapfile didn't find a palette for %s", datavalues[gid]); + if (passes==0) + return; + else + prerror ("plotmapfile didn't find a palette for %s", datavalues[gid]); } if (strcmp (palettefilenames[q], datavalues[gid]) == 0) break; @@ -2941,7 +2975,7 @@ void psound (char **statement) void snesdetect () { printf (" jsr SNES_AUTODETECT\n"); - if (!isimmed ("SNES2ATARISUPPORT")) + if (!isconstantdefined ("SNES2ATARISUPPORT")) { strcpy (redefined_variables[numredefvars++], "SNES2ATARISUPPORT = 1"); sprintf (constants[numconstants++], "SNES2ATARISUPPORT"); @@ -3085,27 +3119,27 @@ void changecontrol (char **statement) if (!strcmp (statement[3], "paddle")) { - if (!isimmed ("PADDLESUPPORT")) + if (!isconstantdefined ("PADDLESUPPORT")) { strcpy (redefined_variables[numredefvars++], "PADDLESUPPORT = 1"); sprintf (constants[numconstants++], "PADDLESUPPORT"); } - if ((port == 0) && (!isimmed ("PADDLE0SUPPORT"))) + if ((port == 0) && (!isconstantdefined ("PADDLE0SUPPORT"))) { strcpy (redefined_variables[numredefvars++], "PADDLE0SUPPORT = 1"); sprintf (constants[numconstants++], "PADDLE0SUPPORT"); } - if ((port == 1) && (!isimmed ("PADDLE1SUPPORT"))) + if ((port == 1) && (!isconstantdefined ("PADDLE1SUPPORT"))) { strcpy (redefined_variables[numredefvars++], "PADDLE1SUPPORT = 1"); sprintf (constants[numconstants++], "PADDLE1SUPPORT"); } - if ((isimmed ("PADDLE1SUPPORT")) && (isimmed ("PADDLE1SUPPORT")) && (!isimmed ("FOURPADDLESUPPORT"))) + if ((isimmed ("PADDLE1SUPPORT")) && (isimmed ("PADDLE1SUPPORT")) && (!isconstantdefined ("FOURPADDLESUPPORT"))) { strcpy (redefined_variables[numredefvars++], "FOURPADDLESUPPORT = 1"); // if so, enable four paddle reads sprintf (constants[numconstants++], "FOURPADDLESUPPORT"); } - if (!isimmed ("LONGCONTROLLERREAD")) + if (!isconstantdefined ("LONGCONTROLLERREAD")) { strcpy (redefined_variables[numredefvars++], "LONGCONTROLLERREAD = 1"); sprintf (constants[numconstants++], "LONGCONTROLLERREAD"); @@ -3125,7 +3159,7 @@ void changecontrol (char **statement) } else if (!strcmp (statement[3], "trakball")) { - if (!isimmed ("TRAKBALLSUPPORT")) + if (!isconstantdefined ("TRAKBALLSUPPORT")) { strcpy (redefined_variables[numredefvars++], "TRAKBALLSUPPORT = 1"); sprintf (constants[numconstants++], "TRAKBALLSUPPORT"); @@ -3141,7 +3175,7 @@ void changecontrol (char **statement) printf (" sta port0resolution\n"); printf (" ldx #0\n"); - if (!isimmed ("TRAKBALL0SUPPORT")) + if (!isconstantdefined ("TRAKBALL0SUPPORT")) { strcpy (redefined_variables[numredefvars++], "TRAKBALL0SUPPORT = 1"); sprintf (constants[numconstants++], "TRAKBALL0SUPPORT"); @@ -3156,7 +3190,7 @@ void changecontrol (char **statement) printf (" lda #2\n"); printf (" sta port1resolution\n"); printf (" ldx #1\n"); - if (!isimmed ("TRAKBALL1SUPPORT")) + if (!isconstantdefined ("TRAKBALL1SUPPORT")) { strcpy (redefined_variables[numredefvars++], "TRAKBALL1SUPPORT = 1"); sprintf (constants[numconstants++], "TRAKBALL1SUPPORT"); @@ -3164,7 +3198,7 @@ void changecontrol (char **statement) } printf (" jsr setportforinput\n"); printf (" jsr settwobuttonmode\n"); - if (!isimmed ("LONGCONTROLLERREAD")) + if (!isconstantdefined ("LONGCONTROLLERREAD")) { strcpy (redefined_variables[numredefvars++], "LONGCONTROLLERREAD = 1"); sprintf (constants[numconstants++], "LONGCONTROLLERREAD"); @@ -3172,7 +3206,7 @@ void changecontrol (char **statement) } else if (!strcmp (statement[3], "keypad")) { - if (!isimmed ("KEYPADSUPPORT")) + if (!isconstantdefined ("KEYPADSUPPORT")) { strcpy (redefined_variables[numredefvars++], "KEYPADSUPPORT = 1"); sprintf (constants[numconstants++], "KEYPADSUPPORT"); @@ -3193,22 +3227,22 @@ void changecontrol (char **statement) else if ((!strcmp (statement[3], "stmouse")) || (!strcmp (statement[3], "amigamouse")) || (!strcmp (statement[3], "driving"))) { - if (!isimmed ("MOUSESUPPORT")) + if (!isconstantdefined ("MOUSESUPPORT")) { strcpy (redefined_variables[numredefvars++], "MOUSESUPPORT = 1"); sprintf (constants[numconstants++], "MOUSESUPPORT"); } - if ((port == 0) && (!isimmed ("MOUSE0SUPPORT"))) + if ((port == 0) && (!isconstantdefined ("MOUSE0SUPPORT"))) { strcpy (redefined_variables[numredefvars++], "MOUSE0SUPPORT = 1"); sprintf (constants[numconstants++], "MOUSE0SUPPORT"); } - if ((port == 1) && (!isimmed ("MOUSE1SUPPORT"))) + if ((port == 1) && (!isconstantdefined ("MOUSE1SUPPORT"))) { strcpy (redefined_variables[numredefvars++], "MOUSE1SUPPORT = 1"); sprintf (constants[numconstants++], "MOUSE1SUPPORT"); } - if (!isimmed ("LONGCONTROLLERREAD")) + if (!isconstantdefined ("LONGCONTROLLERREAD")) { strcpy (redefined_variables[numredefvars++], "LONGCONTROLLERREAD = 1"); sprintf (constants[numconstants++], "LONGCONTROLLERREAD"); @@ -3778,7 +3812,7 @@ void add_graphic (char **statement, int incbanner) //save the label strcpy (graphicslabels[dmaplain][graphicsdatawidth[dmaplain]], generalname); - if (istallsprite) + if ((istallsprite)&&(passes==0)) { //remember sprite height strcpy (tallspritelabel[tallspritecount], generalname); @@ -3811,6 +3845,8 @@ void add_graphic (char **statement, int incbanner) { if (palettefilenames[s][0] == 0) break; + if (strcmp (palettefilenames[s], graphicslabels[dmaplain][graphicsdatawidth[dmaplain]]) == 0) + break; } if (s > 998) prerror ("ran out of default graphic palette entries"); @@ -3863,14 +3899,15 @@ void add_graphic (char **statement, int incbanner) if (strcasecmp (generalname + t, ".png") == 0) generalname[t] = 0; - //remember the bannerheight value for this banner name, so plotbanner can use it... for (s = 0; s < 1000; s++) { if (bannerfilenames[s][0] == 0) - break; - } - if (s > 998) - prerror ("ran out of banner height entries"); + break; + if (strcmp (bannerfilenames[s], generalname) == 0) + break; + if (s > 998) + prerror ("ran out of banner height entries"); + } strcpy (bannerfilenames[s], generalname); bannerheights[s] = height / zoneheight; bannerwidths[s] = (width - 1) / 32; @@ -4682,7 +4719,6 @@ void init_includes (char *path) void barf_graphic_file (void) { - static int dumpgraphics_index = 0; FILE *dumpgraphics_fileout; char dumpgraphics_filename[256]; int s, t, currentplain; @@ -4867,7 +4903,7 @@ void barf_graphic_file (void) ABADDRBASE = REALSTART + (currentbank * 0x4000) + 0x2000 - ((dmaplain - currentplain) * DMASIZE); } - fprintf (stderr, "\n"); + prout ("\n"); if (bankcount == 0) { prinfo ("GFX Block #%d starts @ $%04X", currentplain, ADDRBASE); @@ -4885,7 +4921,7 @@ void barf_graphic_file (void) prerror ("couldn't open file for dumping graphics block"); } linewidth = 0; - fprintf (stderr, " "); + prout (" "); char dumpgraphics_data[256]; @@ -4914,9 +4950,9 @@ void barf_graphic_file (void) if ((linewidth + strlen (graphicslabels[currentplain][t])) > 60) { linewidth = 0; - fprintf (stderr, "\n "); + prout ("\n "); } - fprintf (stderr, " %s", graphicslabels[currentplain][t]); + prout (" %s", graphicslabels[currentplain][t]); linewidth = linewidth + strlen (graphicslabels[currentplain][t]); } else @@ -4936,7 +4972,7 @@ void barf_graphic_file (void) if (bankcount > 0) ABADDRBASE = ABADDRBASE + 256; } - fprintf (stderr, "\n"); + prout ("\n"); if (bankcount == 0) prinfo ("GFX block #%d has %d bytes left (%d x %d bytes)\n", currentplain, @@ -4971,7 +5007,7 @@ void barf_graphic_file (void) ((dmaplain - currentplain) * DMASIZE) + (DMASIZE / 2); } - fprintf (stderr, "\n"); + prout ("\n"); if (bankcount == 0) prinfo ("DMA hole #%d starts @ $%04X", currentplain, ADDRBASE); else @@ -4992,7 +5028,7 @@ void barf_graphic_file (void) holefilepointer = fopen (holefilename, "r"); if (holefilepointer != NULL) { - fprintf (stderr, " DMA hole code found and imported\n"); + prout (" DMA hole code found and imported\n"); int c; while ((c = getc (holefilepointer)) != EOF) putchar (c); @@ -5001,7 +5037,7 @@ void barf_graphic_file (void) } else { - fprintf (stderr, " no code defined for DMA hole\n"); + prout (" no code defined for DMA hole\n"); } if (bankcount == 0) @@ -5087,7 +5123,7 @@ void barf_graphic_file (void) dmaplain = 0; } - fprintf (stderr, "\n"); + prout ("\n"); } } @@ -5820,7 +5856,7 @@ void sdata (char **statement) printf ("%s_begin\n", statement[2]); while (1) { - if (((!fgets (data, SIZEOFSTATEMENT, stdin)) + if (((!fgets (data, SIZEOFSTATEMENT, preprocessedfd)) || ((data[0] < (unsigned char) 0x3A) && (data[0] > (unsigned char) 0x2F))) && (data[0] != 'e')) { prerror ("missing \"end\" keyword at end of data"); @@ -5873,7 +5909,7 @@ void data (char **statement) while (1) { - if (((!fgets (data, SIZEOFSTATEMENT, stdin)) + if (((!fgets (data, SIZEOFSTATEMENT, preprocessedfd)) || ((data[0] < (unsigned char) 0x3A) && (data[0] > (unsigned char) 0x2F))) && (data[0] != 'e')) { prerror ("missing \"end\" keyword at end of data"); @@ -6266,7 +6302,7 @@ void songdata (char **statement) while (1) { memset (data, 0, 1001); - if (!fgets (data, 1000, stdin)) + if (!fgets (data, 1000, preprocessedfd)) { prerror ("missing \"end\" keyword at end of data"); exit (1); @@ -6653,17 +6689,154 @@ void incrmtfile (char **statement) if (t%16>0) printf(","); if (t%16==0) - printf(" .byte "); + printf("\n .byte "); printf("$%02x",c); t++; if (t%16==0) printf("\n"); } printf("\n"); - fprintf(stderr,"RMT %s imported, %ld bytes\n",datalabelname,size); + prout ("RMT %s imported, %ld bytes\n",datalabelname,size); fclose(fp); } +void decompress (char **statement) +{ + // 1 2 3 + // decompress data destination + + assertminimumargs (statement, "decompress", 2); + removeCR (statement[3]); + + if(firstcompress) + { + strcpy (redefined_variables[numredefvars++], "lzsa1support = 1"); + firstcompress = 0; + } + + printf (" lda #<%s\n", statement[2]); + printf (" sta LZSA_SRC_LO\n"); + printf (" lda #>%s\n", statement[2]); + printf (" sta LZSA_SRC_HI\n"); + printf (" lda #<%s\n", statement[3]); + printf (" sta LZSA_DST_LO\n"); + printf (" lda #>%s\n", statement[3]); + printf (" sta LZSA_DST_HI\n"); + printf (" jsr lzsa1_unpack\n"); +} + + +void inccompress (char **statement) +{ + // creates compresses data from a data file. + // this shares a lot of code with incrmt, because it's supposed to work + // with rmt files too. It will advance the stream position to the RMT4 + // signature, if the signature exists. + + // 1 2 + // inccompress filename + + char datalabelname[256]; + int t; + + unsigned char *lzsa_buf_uncomp, *lzsa_buf_comp; + long uncompsize, compsize, position; + + assertminimumargs (statement, "inccompress", 1); + + if(firstcompress) + { + strcpy (redefined_variables[numredefvars++], "lzsa1support = 1"); + firstcompress = 0; + } + + fixfilename (statement[2]); + + //our label is based on the filename... + snprintf (datalabelname, 255, "%s", ourbasename (statement[2])); + checkvalidfilename (statement[2]); + + //but remove the extension... + for (t = (strlen (datalabelname) - 1); t > 0; t--) + { + if (datalabelname[t]=='.') + { + datalabelname[t] = 0; + break; + } + } + + printf("%s\n",datalabelname); + + backupthisfile(statement[2]); + + char magic[6]; + FILE *fp = fopen (statement[2], "rb"); + if(fp==NULL) + prerror ("couldn't open %s",statement[2]); + + // setup and scan for the 'RMT4' signature in the file + memset(magic,0,6); + int c; + while ((c = fgetc(fp)) != EOF) + { + magic[0]=magic[1]; + magic[1]=magic[2]; + magic[2]=magic[3]; + magic[3]=c; + if (!strncmp(magic,"RMT4",4)) + break; + } + if (c == EOF) // it's not an RMT4, so rewind to the start. + rewind(fp); + else + fseek(fp,-4,SEEK_CUR); // rewind to the start of the RMT4 header. + + // Get the size of the file, excluding any bytes we skipped to reach + // the RMT4 header... + position=ftell(fp); + fseek(fp,0,SEEK_END); + uncompsize=ftell(fp)-position; + fseek(fp,position,SEEK_SET); // and then restore the stream position + + lzsa_buf_uncomp = malloc(uncompsize); + if(lzsa_buf_uncomp==NULL) + prerror ("couldn't allocate memory to read %s",statement[2]); + if(fread(lzsa_buf_uncomp,1,uncompsize,fp)!=uncompsize) + prerror ("couldn't read %s into memory",statement[2]); + fclose(fp); + + // allocate the destination buffer + lzsa_buf_comp = malloc(uncompsize*2); + if(lzsa_buf_comp==NULL) + prerror ("couldn't allocate memory to compress %s",statement[2]); + + // call the lzsa library in-memory compression routine + // see libs.h for argument details + compsize=lzsa_compress_inmem(lzsa_buf_uncomp,lzsa_buf_comp,uncompsize,uncompsize*2,(LZSA_FLAG_RAW_BLOCK|LZSA_FLAG_FAVOR_RATIO),3,1); + + if (compsize<1) + prerror ("liblzsa couldn't compress %s",statement[2]); + + if (compsize>uncompsize) + prwarn ("compressing %s wastes more rom than the uncompressed file",statement[2]); + + for(t=0;t0) + printf(","); + if (t%16==0) + printf("\n .byte "); + printf("$%02x",lzsa_buf_comp[t]); + } + + printf("\n"); + prout (" %s compressed, %ld->%ld bytes, %02.2f ratio\n",statement[2],uncompsize,compsize,((float)uncompsize/(float)compsize)); + free(lzsa_buf_uncomp); + free(lzsa_buf_comp); +} + + void speechdata (char **statement) { char data[501], word[501], wordphonemes[501]; @@ -6684,7 +6857,7 @@ void speechdata (char **statement) while (1) { memset (data, 0, 501); - if (((!fgets (data, 500, stdin)) + if (((!fgets (data, 500, preprocessedfd)) || ((data[0] < (unsigned char) 0x3A) && (data[0] > (unsigned char) 0x2F))) && (data[0] != 'e')) { prerror ("missing \"end\" keyword at end of data"); @@ -7422,7 +7595,7 @@ void alphadata (char **statement) while (1) { - if (((!fgets (data, SIZEOFSTATEMENT, stdin)) + if (((!fgets (data, SIZEOFSTATEMENT, preprocessedfd)) || ((data[0] < (unsigned char) 0x3A) && (data[0] > (unsigned char) 0x2F))) && (data[0] != 'e')) { prerror ("missing \"end\" keyword at end of alphadata"); @@ -7859,7 +8032,7 @@ void doasm () char data[SIZEOFSTATEMENT]; while (1) { - if (((!fgets (data, SIZEOFSTATEMENT, stdin)) + if (((!fgets (data, SIZEOFSTATEMENT, preprocessedfd)) || ((data[0] < (unsigned char) 0x3A) && (data[0] > (unsigned char) 0x2F))) && (data[0] != 'e')) { prerror ("missing \"end\" keyword at end of inline asm"); @@ -10433,6 +10606,14 @@ void set (char **statement) strcpy (redefined_variables[numredefvars++], "AVOXVOICE = 1"); } } + else if (!strncmp (statement[2], "pausesilence\0", 12)) + { + assertminimumargs (statement, "set pausesilence", 1); + if (!strncmp (statement[3], "on", 2)) + { + strcpy (redefined_variables[numredefvars++], "PAUSESILENT = 1"); + } + } else if (!strncmp (statement[2], "plotvaluepage\0", 13)) { assertminimumargs (statement + 1, "set plotvaluepage", 1); //+1 to skip "dlmemory" @@ -10479,13 +10660,15 @@ void set (char **statement) deprecated160bindexes = 1; if (!strncmp (statement[3], "boxcollision", 12)) deprecatedboxcollision = 1; + if (!strncmp (statement[3], "onepass", 7)) + maxpasses = 1; } else if (!strncmp (statement[2], "dlmemory\0", 8)) { assertminimumargs (statement + 1, "set dlmemory", 2); //+1 to skip "dlmemory" removeCR (statement[4]); //remove CR if present if (banksetrom) - prerror ("\"set dlmemory\" isn't compatibl with banksets."); + prerror ("\"set dlmemory\" isn't compatible with banksets."); else { printf ("DLMEMSTART = %s\n", statement[3]); @@ -11496,36 +11679,58 @@ void gfxprintf (char *format, ...) fclose (banksetout); } +void prinit() +{ + if(stderrfilepointer) + return; + stderrfilepointer = fopen ("message.log","wb"); + if (!stderrfilepointer) + prerror("unable to open 'message.log'"); +} +void prout (char *format, ...) +{ + char buffer[1024]; + prinit(); + va_list args; + va_start (args, format); + vsnprintf (buffer, 1023, format, args); + fprintf (stderrfilepointer, "%s", buffer); + va_end (args); +} void prinfo (char *format, ...) { char buffer[1024]; + prinit(); va_list args; va_start (args, format); vsnprintf (buffer, 1023, format, args); - fprintf (stderr, "*** (): INFO, %s\n", buffer); + fprintf (stderrfilepointer, "*** (): INFO, %s\n", buffer); va_end (args); } void prwarn (char *format, ...) { char buffer[1024]; + prinit(); va_list args; va_start (args, format); vsnprintf (buffer, 1023, format, args); - fprintf (stderr, "*** (%d): WARNING, %s\n", line, buffer); + fprintf (stderrfilepointer, "*** (%d): WARNING, %s\n", line, buffer); va_end (args); } void prerror (char *format, ...) { char buffer[1024]; + prinit(); va_list args; va_start (args, format); vsnprintf (buffer, 1023, format, args); - fprintf (stderr, "*** (%d): ERROR, %s\n", line, buffer); + fprintf (stderrfilepointer, "*** (%d): ERROR, %s\n", line, buffer); va_end (args); + lastrites(); exit (1); } @@ -11539,24 +11744,41 @@ int printimmed (char *value) int isimmed (char *value) { - // search queue of constants + // search queue of constants defined in any pass int i; //removeCR(value); - for (i = 0; i < numconstants; ++i) + for (i = 0; i < MAXCONSTANTS; ++i) { + if(constants[i][0]==0) + break; if (!strcmp (value, constants[i])) { // a constant should be treated as an immediate return 1; } } - if (!strcmp (value + (strlen (value) > 7 ? strlen (value) - 7 : 0), "_length")) + if ((value[0] == '$') || (value[0] == '%') || (value[0] < (unsigned char) 0x3A)) + { + return 1; + } + else + return 0; +} + +int isconstantdefined (char *value) +{ + // search queue of constants defined in this pass + int i; + //removeCR(value); + + for (i = 0; i < numconstants; ++i) { - // Warning about use of data_length before data statement - prwarn - ("possible use of data statement length before data statement is defined\n workaround: forward declaration may be done by const %s=%s at beginning of code", - value, value); + if (!strcmp (value, constants[i])) + { + // a constant should be treated as an immediate + return 1; + } } if ((value[0] == '$') || (value[0] == '%') || (value[0] < (unsigned char) 0x3A)) { @@ -11571,6 +11793,7 @@ int number (unsigned char value) return ((int) value) - '0'; } + void removeCR (char *linenumber) // remove trailing CR from string { char *CR; @@ -11625,6 +11848,21 @@ void lastrites() if(backupflag) { CloseArchive(); - fprintf(stderr,"Backed up %d project files.\n",backupcount); - } + prout ("Backed up %d project files.\n",backupcount); + } + prinit(); + fclose(stderrfilepointer); + stderrfilepointer = fopen ("message.log","rb"); + int logchar; + logchar = fgetc (stderrfilepointer); + while (logchar != EOF) + { + fputc(logchar,stderr); + logchar = fgetc (stderrfilepointer); + } + fclose(stderrfilepointer); + remove("message.log"); + remove("7800hole.0.asm"); + remove("7800hole.1.asm"); + remove("7800hole.2.asm"); } diff --git a/out/bin/compilers/7800basic/statements.h b/out/bin/compilers/7800basic/statements.h index 441b80a4..fd78883f 100644 --- a/out/bin/compilers/7800basic/statements.h +++ b/out/bin/compilers/7800basic/statements.h @@ -27,6 +27,8 @@ void dopop (); void doreboot (); void incmapfile (char **statement); void incrmtfile (char **statement); +void decompress (char **statement); +void inccompress (char **statement); void domacro (char **statement); void callmacro (char **statement); void doextra (char *extrano); @@ -144,6 +146,7 @@ void doublebuffer (char **statement); void prerror (char *, ...); void prwarn (char *, ...); void prinfo (char *, ...); +void prout (char *, ...); void remove_trailing_commas (char *); void removeCR (char *); void bmi (char *); @@ -156,6 +159,7 @@ void bvc (char *); void bvs (char *); int printimmed (char *); int isimmed (char *); +int isconstantdefined (char *); int number (unsigned char); void header_open (FILE *); void header_write (FILE *, char *); diff --git a/out/compilers/compilerBase.js b/out/compilers/compilerBase.js index 5ea73a8b..6c2a8e4c 100644 --- a/out/compilers/compilerBase.js +++ b/out/compilers/compilerBase.js @@ -208,6 +208,8 @@ class CompilerBase { } // Read compiler version (if used) yield this.GetCompilerVersionAsync(); + // Show any specific compiler warnings + this.ShowAnyCompilerWarnings(); // Result return true; }); @@ -272,6 +274,8 @@ class CompilerBase { GetCompilerFileList() { return []; } + ShowAnyCompilerWarnings() { + } LoadConfigurationAsync() { return __awaiter(this, void 0, void 0, function* () { console.log('debugger:CompilerBase.LoadConfigurationAsync'); diff --git a/out/compilers/compilerBase.js.map b/out/compilers/compilerBase.js.map index d2b4393e..c43779c3 100644 --- a/out/compilers/compilerBase.js.map +++ b/out/compilers/compilerBase.js.map @@ -1 +1 @@ -{"version":3,"file":"compilerBase.js","sourceRoot":"","sources":["../../src/compilers/compilerBase.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;AACb,iCAAiC;AACjC,6BAA6B;AAC7B,8CAA8C;AAC9C,4CAA4C;AAC5C,sCAAsC;AAEtC,MAAsB,YAAY;IAqC9B,YAAY,EAAU,EAAE,IAAY,EAAE,UAAoB,EAAE,kBAA4B,EAAE,wBAAkC,EA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C;QAExD,oDAAoD;QACpD,4DAA4D;QAC5D,iCAAiC;QAEjC,WAAW;QACX,IAAI,GAAG,GAAG,MAAA,IAAI,CAAC,QAAQ,0CAAE,GAAG,CAAC;QAC7B,IAAI,IAAI,CAAC,QAAQ,EAAE;YAAE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;SAAE;QAEnE,0BAA0B;QAC1B,IAAI,MAAM,CAAC,SAAS,CAAC,gBAAgB,IAAI,GAAG,EAAE;YACtC,IAAI,eAAe,GAAG,MAAM,CAAC,SAAS,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAA;YAC9D,IAAI,eAAe,EAAE;gBACjB,OAAO,eAAe,CAAC,GAAG,CAAC,MAAM,CAAC;aACrC;YACD,OAAO,MAAM,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC;SAC9D;QACD,OAAO,EAAE,CAAC;IACd,CAAC;CACJ;AA9fD,oCA8fC"} \ No newline at end of file diff --git a/out/compilers/seventyEightHundredBasicCompiler.js b/out/compilers/seventyEightHundredBasicCompiler.js index cf920691..a0710750 100644 --- a/out/compilers/seventyEightHundredBasicCompiler.js +++ b/out/compilers/seventyEightHundredBasicCompiler.js @@ -171,43 +171,8 @@ class SeventyEightHundredBasicCompiler extends compilerBase_1.CompilerBase { platform = ".Darwin"; } let extension = (application.IsWindows ? ".exe" : `.${application.OSArch}`); - // Validate compiler version to determine list of required files - if (this.CompilerVersion >= 0.27) { - // version 0.27 and greater added: - // - 7800rmt2asm - return [command, - `7800basic${platform}${extension}`, - `7800filter${platform}${extension}`, - `7800header${platform}${extension}`, - `7800optimize${platform}${extension}`, - `7800postprocess${platform}${extension}`, - `7800preprocess${platform}${extension}`, - `7800sign${platform}${extension}`, - `7800makecc2${platform}${extension}`, - `7800rmt2asm${platform}${extension}`, - `7800rmtfix${platform}${extension}`, - `dasm${platform}${extension}`, - `banksetsymbols${platform}${extension}`]; - } - else if (this.CompilerVersion >= 0.22) { - // version 0.22 and greater added: - // - 7800rmtfix - // - banksetsymbols - return [command, - `7800basic${platform}${extension}`, - `7800filter${platform}${extension}`, - `7800header${platform}${extension}`, - `7800optimize${platform}${extension}`, - `7800postprocess${platform}${extension}`, - `7800preprocess${platform}${extension}`, - `7800sign${platform}${extension}`, - `7800makecc2${platform}${extension}`, - `7800rmtfix${platform}${extension}`, - `dasm${platform}${extension}`, - `banksetsymbols${platform}${extension}`]; - } - // up to version 0.21 (default) - return [command, + // Default items + let compilerFileList = [command, `7800basic${platform}${extension}`, `7800filter${platform}${extension}`, `7800header${platform}${extension}`, @@ -216,7 +181,31 @@ class SeventyEightHundredBasicCompiler extends compilerBase_1.CompilerBase { `7800preprocess${platform}${extension}`, `7800sign${platform}${extension}`, `7800makecc2${platform}${extension}`, - `dasm${platform}${extension}`]; + `snip${platform}${extension}`]; + // As of 1/11/23 the existing ARM version does not cater for this file + if (!application.IsMacOSArm) { + compilerFileList.push(`dasm${platform}${extension}`); + } + // Append additional items (based on the version) + if (this.CompilerVersion >= 0.22) { + compilerFileList.push(`7800rmtfix${platform}${extension}`, `banksetsymbols${platform}${extension}`); + } + if (this.CompilerVersion >= 0.27) { + compilerFileList.push(`7800rmt2asm${platform}${extension}`); + } + // As of 1/11/23 the existing ARM version does not cater for this file + if (this.CompilerVersion >= 0.31 && !application.IsMacOSArm) { + compilerFileList.push(`lzsa${platform}${extension}`); + } + // Return + return compilerFileList; + } + ShowAnyCompilerWarnings() { + if (application.IsMacOSArm) { + let message = `WARNING: The included MacOS ARM version of 7800basic is a number of versions behind the official build (currently v${this.CompilerVersion}) and may not compile correctly due to missing features and functionality.`; + application.WriteToCompilerTerminal(message); + application.WriteToCompilerTerminal(``); + } } } exports.SeventyEightHundredBasicCompiler = SeventyEightHundredBasicCompiler; diff --git a/out/compilers/seventyEightHundredBasicCompiler.js.map b/out/compilers/seventyEightHundredBasicCompiler.js.map index dd85a7a7..bd935ac1 100644 --- a/out/compilers/seventyEightHundredBasicCompiler.js.map +++ b/out/compilers/seventyEightHundredBasicCompiler.js.map @@ -1 +1 @@ -{"version":3,"file":"seventyEightHundredBasicCompiler.js","sourceRoot":"","sources":["../../src/compilers/seventyEightHundredBasicCompiler.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;;;;;AACb,iCAAiC;AACjC,6BAA6B;AAC7B,8CAA8C;AAC9C,4CAA4C;AAC5C,sCAAsC;AACtC,iDAA8C;AAE9C,MAAa,gCAAiC,SAAQ,2BAAY;IAE9D;QACI,KAAK,CAAC,WAAW,EACT,WAAW,EACX,CAAC,MAAM,EAAC,MAAM,CAAC,EACf,CAAC,MAAM,EAAC,MAAM,EAAC,UAAU,EAAC,YAAY,CAAC,EAAC,CAAC,MAAM,EAAC,MAAM,CAAC,EACvD,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,EAAC,KAAK,EAAC,KAAK,EAAC,WAAW,EAAC,WAAW,CAAC,EAC/D,OAAO,CAAC,CAAC;QAEjB,sBAAsB;QACtB,IAAI,CAAC,kBAAkB,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,IAAI,EAAC,aAAa,CAAC,EAAC,CAAC,IAAI,EAAC,WAAW,CAAC,CAAC,CAAC,CAAC;QAC7E,iBAAiB;QACjB,IAAI,CAAC,mCAAmC,GAAG,IAAI,CAAC;IACpD,CAAC;IAEe,uBAAuB;;YACzC,UAAU;YACJ,MAAM,QAAQ,GAAe,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,aAAa,CAAC,CAAC,CAAC;YAC1F,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;YAE5B,2BAA2B;YAC3B,IAAI,MAAM,CAAC,UAAU,CAAC,eAAe,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE;gBACrD,IAAI,WAAW,GAAG,CAAC,MAAM,UAAU,CAA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,SAAS,EAAE;gBACjC,cAAc,QAAQ,GAAG,SAAS,EAAE;gBACpC,aAAa,QAAQ,GAAG,SAAS,EAAE;gBACnC,OAAO,QAAQ,GAAG,SAAS,EAAE;gBAC7B,iBAAiB,QAAQ,GAAG,SAAS,EAAE,CAAC,CAAC;SAChD;QAED,+BAA+B;QAC/B,OAAO,CAAC,OAAO;YACX,YAAY,QAAQ,GAAG,SAAS,EAAE;YAClC,aAAa,QAAQ,GAAG,SAAS,EAAE;YACnC,aAAa,QAAQ,GAAG,SAAS,EAAE;YACnC,eAAe,QAAQ,GAAG,SAAS,EAAE;YACrC,kBAAkB,QAAQ,GAAG,SAAS,EAAE;YACxC,iBAAiB,QAAQ,GAAG,SAAS,EAAE;YACvC,WAAW,QAAQ,GAAG,SAAS,EAAE;YACjC,cAAc,QAAQ,GAAG,SAAS,EAAE;YACpC,OAAO,QAAQ,GAAG,SAAS,EAAE,CAAC,CAAC;IAEvC,CAAC;CAEJ;AAhOD,4EAgOC"} \ No newline at end of file +{"version":3,"file":"seventyEightHundredBasicCompiler.js","sourceRoot":"","sources":["../../src/compilers/seventyEightHundredBasicCompiler.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;;;;;AACb,iCAAiC;AACjC,6BAA6B;AAC7B,8CAA8C;AAC9C,4CAA4C;AAC5C,sCAAsC;AACtC,iDAA8C;AAE9C,MAAa,gCAAiC,SAAQ,2BAAY;IAE9D;QACI,KAAK,CAAC,WAAW,EACT,WAAW,EACX,CAAC,MAAM,EAAC,MAAM,CAAC,EACf,CAAC,MAAM,EAAC,MAAM,EAAC,UAAU,EAAC,YAAY,CAAC,EAAC,CAAC,MAAM,EAAC,MAAM,CAAC,EACvD,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,EAAC,KAAK,EAAC,KAAK,EAAC,WAAW,EAAC,WAAW,CAAC,EAC/D,OAAO,CAAC,CAAC;QAEjB,sBAAsB;QACtB,IAAI,CAAC,kBAAkB,GAAG,IAAI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,CAAC,UAAU,EAAE;YACzB,gBAAgB,CAAC,IAAI,CACjB,OAAO,QAAQ,GAAG,SAAS,EAAE,CAAC,CAAC;SACtC;QAED,iDAAiD;QACjD,IAAI,IAAI,CAAC,eAAe,IAAI,IAAI,EAAE;YAC9B,gBAAgB,CAAC,IAAI,CACjB,aAAa,QAAQ,GAAG,SAAS,EAAE,EACnC,iBAAiB,QAAQ,GAAG,SAAS,EAAE,CAAC,CAAC;SAEhD;QACD,IAAI,IAAI,CAAC,eAAe,IAAI,IAAI,EAAE;YAC9B,gBAAgB,CAAC,IAAI,CACjB,cAAc,QAAQ,GAAG,SAAS,EAAE,CAAC,CAAC;SAC7C;QACD,sEAAsE;QACtE,IAAI,IAAI,CAAC,eAAe,IAAI,IAAI,IAAI,CAAC,WAAW,CAAC,UAAU,EAAE;YACzD,gBAAgB,CAAC,IAAI,CACjB,OAAO,QAAQ,GAAG,SAAS,EAAE,CAAC,CAAC;SACtC;QAED,SAAS;QACT,OAAO,gBAAgB,CAAC;IAC5B,CAAC;IAES,uBAAuB;QAC7B,IAAI,WAAW,CAAC,UAAU,EAAE;YACxB,IAAI,OAAO,GAAG,sHAAsH,IAAI,CAAC,eAAe,4EAA4E,CAAC;YACrO,WAAW,CAAC,uBAAuB,CAAC,OAAO,CAAC,CAAC;YAC7C,WAAW,CAAC,uBAAuB,CAAC,EAAE,CAAC,CAAC;SAC3C;IACL,CAAC;CAEJ;AA7ND,4EA6NC"} \ No newline at end of file diff --git a/out/completions/seventyEightHundredBasicCompletion.js b/out/completions/seventyEightHundredBasicCompletion.js index b6dff1d9..a28cc8c7 100644 --- a/out/completions/seventyEightHundredBasicCompletion.js +++ b/out/completions/seventyEightHundredBasicCompletion.js @@ -421,6 +421,7 @@ class SeventyEightHundredBasicCompletion extends completionBase_1.CompletionBase new vscode.CompletionItem('plotvaluepage', vscode.CompletionItemKind.Method), new vscode.CompletionItem('zoneprotection', vscode.CompletionItemKind.Method), new vscode.CompletionItem('pauseroutine', vscode.CompletionItemKind.Method), + new vscode.CompletionItem('pausesilence', vscode.CompletionItemKind.Method), new vscode.CompletionItem('pokeysound', vscode.CompletionItemKind.Method), new vscode.CompletionItem('pokeysupport', vscode.CompletionItemKind.Method), new vscode.CompletionItem('pokeysfxsupport', vscode.CompletionItemKind.Method), diff --git a/out/completions/seventyEightHundredBasicCompletion.js.map b/out/completions/seventyEightHundredBasicCompletion.js.map index 39a2c302..b868b683 100644 --- a/out/completions/seventyEightHundredBasicCompletion.js.map +++ b/out/completions/seventyEightHundredBasicCompletion.js.map @@ -1 +1 @@ -{"version":3,"file":"seventyEightHundredBasicCompletion.js","sourceRoot":"","sources":["../../src/completions/seventyEightHundredBasicCompletion.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;;;;;AACb,iCAAiC;AACjC,qDAAkD;AAElD,MAAa,kCAAmC,SAAQ,+BAAc;IAElE,kDAAkD;IAElD;QACI,KAAK,CAAC,WAAW,CAAC,CAAC;IACvB,CAAC;IAEY,aAAa,CAAC,OAAgC;;YACvD,QAAQ;YACR,mHAAmH;YAE3H;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qEA+GyD;YAEjD,KAAK;YACL,IAAI,UAAU,GAAG,MAAM,CAAC,SAAS,CAAC,8BAA8B,CAC5D,IAAI,CAAC,EAAE,EACP;gBACI,4CAA4C;gBAC5C,sBAAsB,CAAC,QAA6B,EAAE,QAAyB;oBAC3E,gEAAgE;oBAChE,IAAI,UAAU,GAAG,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAC;oBACjF,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;wBAC7B,OAAO,SAAS,CAAC;qBACpB;oBAED,+CAA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aAAa,CAAC,IAAI,CAAC,UAAU,EAAE,cAAc,EAAE,eAAe,EAAE,mBAAmB,EAAE,uBAAuB,EAChH,aAAa,EAAE,sBAAsB,EAAE,oBAAoB,EAC3D,sBAAsB,EAAE,sBAAsB,EAC9C,wBAAwB,EAAE,WAAW,CAAC,CAAC;QAC/C,CAAC;KAAA;CAEJ;AA7gBD,gFA6gBC"} \ No newline at end of file +{"version":3,"file":"seventyEightHundredBasicCompletion.js","sourceRoot":"","sources":["../../src/completions/seventyEightHundredBasicCompletion.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;;;;;AACb,iCAAiC;AACjC,qDAAkD;AAElD,MAAa,kCAAmC,SAAQ,+BAAc;IAElE,kDAAkD;IAElD;QACI,KAAK,CAAC,WAAW,CAAC,CAAC;IACvB,CAAC;IAEY,aAAa,CAAC,OAAgC;;YACvD,QAAQ;YACR,mHAAmH;YAE3H;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qEA+GyD;YAEjD,KAAK;YACL,IAAI,UAAU,GAAG,MAAM,CAAC,SAAS,CAAC,8BAA8B,CAC5D,IAAI,CAAC,EAAE,EACP;gBACI,4CAA4C;gBAC5C,sBAAsB,CAAC,QAA6B,EAAE,QAAyB;oBAC3E,gEAAgE;oBAChE,IAAI,UAAU,GAAG,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAC;oBACjF,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;wBAC7B,OAAO,SAAS,CAAC;qBACpB;oBAED,+CAA+C;oBAC/C,OAAO;wBACH,IAAI,MAAM,CAAC,cAAc,CAAC,cAAc,EAAE,MAAM,CAAC,kBAAkB,CAAC,QAAQ,CAAC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I,CAAC,UAAU,EAAE,cAAc,EAAE,eAAe,EAAE,mBAAmB,EAAE,uBAAuB,EAChH,aAAa,EAAE,sBAAsB,EAAE,oBAAoB,EAC3D,sBAAsB,EAAE,sBAAsB,EAC9C,wBAAwB,EAAE,WAAW,CAAC,CAAC;QAC/C,CAAC;KAAA;CAEJ;AA9gBD,gFA8gBC"} \ No newline at end of file diff --git a/package.json b/package.json index 3190eea5..87f27056 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "atari-dev-studio", "displayName": "Atari Dev Studio", "description": "Homebrew game creation for the Atari 8-bit consoles", - "version": "0.9.3", + "version": "0.9.4", "icon": "images/icon.png", "preview": false, "author": "mksmith", diff --git a/src/application.ts b/src/application.ts index 59bb4d33..e48a4efe 100644 --- a/src/application.ts +++ b/src/application.ts @@ -49,7 +49,7 @@ export const IsLinux: boolean = (os.platform() === 'linux'); export const IsMacOS: boolean = (os.platform() === 'darwin'); export const Is32Bit: boolean = (os.arch() === 'x32'); export const Is64Bit: boolean = (os.arch() === 'x64'); - +export const IsMacOSArm: boolean = (os.platform() === 'darwin' && os.arch() === 'arm64') // ------------------------------------------------------------------------------------- // Extension // ------------------------------------------------------------------------------------- diff --git a/src/compilers/compilerBase.ts b/src/compilers/compilerBase.ts index aeffe43b..9554b862 100644 --- a/src/compilers/compilerBase.ts +++ b/src/compilers/compilerBase.ts @@ -177,7 +177,10 @@ export abstract class CompilerBase implements vscode.Disposable { // Read compiler version (if used) await this.GetCompilerVersionAsync(); - // Result + // Show any specific compiler warnings + this.ShowAnyCompilerWarnings(); + + // Result return true; } @@ -246,7 +249,10 @@ export abstract class CompilerBase implements vscode.Disposable { protected GetCompilerFileList(): string[] { return []; } - + + protected ShowAnyCompilerWarnings(): void { + } + protected async LoadConfigurationAsync(): Promise { console.log('debugger:CompilerBase.LoadConfigurationAsync'); diff --git a/src/compilers/seventyEightHundredBasicCompiler.ts b/src/compilers/seventyEightHundredBasicCompiler.ts index cbe52861..38f6fb5d 100644 --- a/src/compilers/seventyEightHundredBasicCompiler.ts +++ b/src/compilers/seventyEightHundredBasicCompiler.ts @@ -180,44 +180,8 @@ export class SeventyEightHundredBasicCompiler extends CompilerBase { if (application.IsMacOS) { platform = ".Darwin"; } let extension = (application.IsWindows ? ".exe" : `.${application.OSArch}`); - // Validate compiler version to determine list of required files - if (this.CompilerVersion >= 0.27) { - // version 0.27 and greater added: - // - 7800rmt2asm - return [command, - `7800basic${platform}${extension}`, - `7800filter${platform}${extension}`, - `7800header${platform}${extension}`, - `7800optimize${platform}${extension}`, - `7800postprocess${platform}${extension}`, - `7800preprocess${platform}${extension}`, - `7800sign${platform}${extension}`, - `7800makecc2${platform}${extension}`, - `7800rmt2asm${platform}${extension}`, - `7800rmtfix${platform}${extension}`, - `dasm${platform}${extension}`, - `banksetsymbols${platform}${extension}`]; - } - else if (this.CompilerVersion >= 0.22) { - // version 0.22 and greater added: - // - 7800rmtfix - // - banksetsymbols - return [command, - `7800basic${platform}${extension}`, - `7800filter${platform}${extension}`, - `7800header${platform}${extension}`, - `7800optimize${platform}${extension}`, - `7800postprocess${platform}${extension}`, - `7800preprocess${platform}${extension}`, - `7800sign${platform}${extension}`, - `7800makecc2${platform}${extension}`, - `7800rmtfix${platform}${extension}`, - `dasm${platform}${extension}`, - `banksetsymbols${platform}${extension}`]; - } - - // up to version 0.21 (default) - return [command, + // Default items + let compilerFileList = [command, `7800basic${platform}${extension}`, `7800filter${platform}${extension}`, `7800header${platform}${extension}`, @@ -226,8 +190,41 @@ export class SeventyEightHundredBasicCompiler extends CompilerBase { `7800preprocess${platform}${extension}`, `7800sign${platform}${extension}`, `7800makecc2${platform}${extension}`, - `dasm${platform}${extension}`]; + `snip${platform}${extension}`]; + + // As of 1/11/23 the existing ARM version does not cater for this file + if (!application.IsMacOSArm) { + compilerFileList.push( + `dasm${platform}${extension}`); + } + + // Append additional items (based on the version) + if (this.CompilerVersion >= 0.22) { + compilerFileList.push( + `7800rmtfix${platform}${extension}`, + `banksetsymbols${platform}${extension}`); + } + if (this.CompilerVersion >= 0.27) { + compilerFileList.push( + `7800rmt2asm${platform}${extension}`); + } + // As of 1/11/23 the existing ARM version does not cater for this file + if (this.CompilerVersion >= 0.31 && !application.IsMacOSArm) { + compilerFileList.push( + `lzsa${platform}${extension}`); + } + + // Return + return compilerFileList; + } + + protected ShowAnyCompilerWarnings(): void { + if (application.IsMacOSArm) { + let message = `WARNING: The included MacOS ARM version of 7800basic is a number of versions behind the official build (currently v${this.CompilerVersion}) and may not compile correctly due to missing features and functionality.`; + application.WriteToCompilerTerminal(message); + application.WriteToCompilerTerminal(``); + } } } \ No newline at end of file diff --git a/src/completions/seventyEightHundredBasicCompletion.ts b/src/completions/seventyEightHundredBasicCompletion.ts index d35df83e..efb9b59e 100644 --- a/src/completions/seventyEightHundredBasicCompletion.ts +++ b/src/completions/seventyEightHundredBasicCompletion.ts @@ -473,6 +473,7 @@ export class SeventyEightHundredBasicCompletion extends CompletionBase { new vscode.CompletionItem('plotvaluepage', vscode.CompletionItemKind.Method), new vscode.CompletionItem('zoneprotection', vscode.CompletionItemKind.Method), new vscode.CompletionItem('pauseroutine', vscode.CompletionItemKind.Method), + new vscode.CompletionItem('pausesilence', vscode.CompletionItemKind.Method), new vscode.CompletionItem('pokeysound', vscode.CompletionItemKind.Method), new vscode.CompletionItem('pokeysupport', vscode.CompletionItemKind.Method), new vscode.CompletionItem('pokeysfxsupport', vscode.CompletionItemKind.Method), diff --git a/syntaxes/7800basic.tmLanguage.json b/syntaxes/7800basic.tmLanguage.json index 60f07a6b..f62ef487 100644 --- a/syntaxes/7800basic.tmLanguage.json +++ b/syntaxes/7800basic.tmLanguage.json @@ -139,7 +139,7 @@ }, { "name": "keyword.other.78b", - "match": "\\b(7800GDmenuoff|7800header|adjustvisible|alphachars|alphadata|avoxvoice|backup|backupfile|backupstyle|bankset|basepath|breakprotect|boxcollision|characterset|canary|crashdump|clearscreen|collision|collisionwrap|converttobcd|deprecated|dictionary|dmahole|drawscreen|drawwait|drawhiscores|data|debug|displaymode|dlmemory|doublebuffer|doublewide|dumpgraphics|extradlmemory|extrawide|frameskipfix|fourbitfade|getfade|hiscoreload|hiscoreclear|hscolorbase|hsdifficultytext|hsgamename|hsgameranks|hsscoresize|hsseconds|hssupport|incbanner|incbin|incgraphic|incmapfile|incrmtfile|lockzone|loadmemory|loadrambank|loadrombank|mcpdevcart|memcpy|memset|multibutton|mutesfx|newblock|noflow|optimization|pauseroutine|peekchar|pitch|phonetic|playrmt|playsfx|playsong|plotbanner|plotchars|plotmap|plotmapfile|plotsprite|PLOTSPRITE|plotsprite4|PLOTSPRITE4|plotvalue|plotvalueonscreen|plotvaluepage|pokechar|pokeybase|pokeydetected|pokeysound|pokeysupport|pokeysfxsupport|psound|raw|reboot|restorescreen|reset|rmtspeed|rmtvolume|romsize|savescreen|savememory|screenheight|setfade|sdata|shakescreen|singlewide|sizeof|smartbranching|songtempo|speak|speechdata|speed|sread|startrmt|stoprmt|stopsong|songdata|tallsprite|tiasfx|tiavolume|trackersupport|tsound|unlockzone|voice|xm|zoneheight|zoneprotection)\\b", + "match": "\\b(7800GDmenuoff|7800header|adjustvisible|alphachars|alphadata|avoxvoice|backup|backupfile|backupstyle|bankset|basepath|breakprotect|boxcollision|characterset|canary|crashdump|clearscreen|collision|collisionwrap|converttobcd|decompress|deprecated|dictionary|dmahole|drawscreen|drawwait|drawhiscores|data|debug|displaymode|dlmemory|doublebuffer|doublewide|dumpgraphics|extradlmemory|extrawide|frameskipfix|fourbitfade|getfade|hiscoreload|hiscoreclear|hscolorbase|hsdifficultytext|hsgamename|hsgameranks|hsscoresize|hsseconds|hssupport|incbanner|incbin|inccompress|incgraphic|incmapfile|incrmtfile|lockzone|loadmemory|loadrambank|loadrombank|mcpdevcart|memcpy|memset|multibutton|mutesfx|newblock|noflow|optimization|pauseroutine|pausesilence|peekchar|pitch|phonetic|playrmt|playsfx|playsong|plotbanner|plotchars|plotmap|plotmapfile|plotsprite|PLOTSPRITE|plotsprite4|PLOTSPRITE4|plotvalue|plotvalueonscreen|plotvaluepage|pokechar|pokeybase|pokeydetected|pokeysound|pokeysupport|pokeysfxsupport|psound|raw|reboot|restorescreen|reset|rmtspeed|rmtvolume|romsize|savescreen|savememory|screenheight|setfade|sdata|shakescreen|singlewide|sizeof|smartbranching|songtempo|speak|speechdata|speed|sread|startrmt|stoprmt|stopsong|songdata|tallsprite|tiasfx|tiavolume|trackersupport|tsound|unlockzone|voice|xm|zoneheight|zoneprotection)\\b", "comment": "other keywords" }, {