1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2025-04-09 21:37:31 +00:00

Moved #include to CPreprocessor. Fixed problem where #include does not respect #if. Closes #442

This commit is contained in:
jespergravgaard 2020-05-29 23:11:52 +02:00
parent 0041a4d07c
commit 711458ec1f
179 changed files with 2537 additions and 1551 deletions

View File

@ -15,9 +15,7 @@ import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.*;
import java.util.stream.Collectors;
/**
@ -97,6 +95,19 @@ public class CTargetPlatformParser {
targetPlatform.setVariableBuilderConfig(config);
}
}
{
final JsonObject defines = platformJson.getJsonObject("defines");
if(defines != null) {
final Set<String> macroNames = defines.keySet();
final LinkedHashMap<String, String> macros = new LinkedHashMap<>();
for(String macroName : macroNames) {
final JsonValue jsonValue = defines.get(macroName);
final String macroBody = jsonValue.toString();
macros.put(macroName, macroBody);
}
targetPlatform.setDefines(macros);
}
}
return targetPlatform;
} catch(CompileError | IOException | JsonParsingException e) {
throw new CompileError("Error parsing target platform file " + platformFile.getAbsolutePath() + "\n" + e.getMessage());

View File

@ -225,11 +225,10 @@ ASM_WS : [ \t\r\n\u00a0]+ -> channel(1);
ASM_COMMENT_LINE : '//' ~[\r\n]* -> channel(2);
ASM_COMMENT_BLOCK : '/*' .*? '*/' -> channel(2);
// MODE FOR INCLUDE FILES
// MODE FOR #INCLUDE FILES
mode IMPORT_MODE;
IMPORT_SYSTEMFILE : '<' [a-zA-Z0-9_./\\\-]+ '>' { popMode();cParser.includeCFile(getText(), true); } ;
IMPORT_LOCALFILE : '"' ('\\"' | ~'"')* '"' { popMode(); cParser.includeCFile(getText(), false); } ;
IMPORT_SYSTEMFILE : '<' [a-zA-Z0-9_./\\\-]+ '>' { popMode(); } ;
IMPORT_LOCALFILE : '"' ('\\"' | ~'"')* '"' { popMode(); } ;
// White space on hidden channel 1
IMPORT_WS : [ \t\r\n\u00a0]+ -> channel(1);
// Comments on hidden channel 2

View File

@ -306,14 +306,14 @@ public class KickCLexer extends Lexer {
private void IMPORT_SYSTEMFILE_action(RuleContext _localctx, int actionIndex) {
switch (actionIndex) {
case 7:
popMode();cParser.includeCFile(getText(), true);
popMode();
break;
}
}
private void IMPORT_LOCALFILE_action(RuleContext _localctx, int actionIndex) {
switch (actionIndex) {
case 8:
popMode(); cParser.includeCFile(getText(), false);
popMode();
break;
}
}

View File

@ -26,18 +26,7 @@ asmFile
;
declSeq
: declOrImport*
;
declOrImport
: decl
| importDecl
;
importDecl
: IMPORT IMPORT_LOCALFILE #importFile
| INCLUDE IMPORT_LOCALFILE #includeFile
| INCLUDE IMPORT_SYSTEMFILE #includeSystem
: decl*
;
decl

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -49,54 +49,6 @@ public class KickCParserBaseListener implements KickCParserListener {
* <p>The default implementation does nothing.</p>
*/
@Override public void exitDeclSeq(KickCParser.DeclSeqContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterDeclOrImport(KickCParser.DeclOrImportContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitDeclOrImport(KickCParser.DeclOrImportContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterImportFile(KickCParser.ImportFileContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitImportFile(KickCParser.ImportFileContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterIncludeFile(KickCParser.IncludeFileContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitIncludeFile(KickCParser.IncludeFileContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterIncludeSystem(KickCParser.IncludeSystemContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitIncludeSystem(KickCParser.IncludeSystemContext ctx) { }
/**
* {@inheritDoc}
*

View File

@ -34,34 +34,6 @@ public class KickCParserBaseVisitor<T> extends AbstractParseTreeVisitor<T> imple
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override public T visitDeclSeq(KickCParser.DeclSeqContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
*
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override public T visitDeclOrImport(KickCParser.DeclOrImportContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
*
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override public T visitImportFile(KickCParser.ImportFileContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
*
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override public T visitIncludeFile(KickCParser.IncludeFileContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
*
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override public T visitIncludeSystem(KickCParser.IncludeSystemContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
*

View File

@ -39,52 +39,6 @@ public interface KickCParserListener extends ParseTreeListener {
* @param ctx the parse tree
*/
void exitDeclSeq(KickCParser.DeclSeqContext ctx);
/**
* Enter a parse tree produced by {@link KickCParser#declOrImport}.
* @param ctx the parse tree
*/
void enterDeclOrImport(KickCParser.DeclOrImportContext ctx);
/**
* Exit a parse tree produced by {@link KickCParser#declOrImport}.
* @param ctx the parse tree
*/
void exitDeclOrImport(KickCParser.DeclOrImportContext ctx);
/**
* Enter a parse tree produced by the {@code importFile}
* labeled alternative in {@link KickCParser#importDecl}.
* @param ctx the parse tree
*/
void enterImportFile(KickCParser.ImportFileContext ctx);
/**
* Exit a parse tree produced by the {@code importFile}
* labeled alternative in {@link KickCParser#importDecl}.
* @param ctx the parse tree
*/
void exitImportFile(KickCParser.ImportFileContext ctx);
/**
* Enter a parse tree produced by the {@code includeFile}
* labeled alternative in {@link KickCParser#importDecl}.
* @param ctx the parse tree
*/
void enterIncludeFile(KickCParser.IncludeFileContext ctx);
/**
* Exit a parse tree produced by the {@code includeFile}
* labeled alternative in {@link KickCParser#importDecl}.
* @param ctx the parse tree
*/
void exitIncludeFile(KickCParser.IncludeFileContext ctx);
/**
* Enter a parse tree produced by the {@code includeSystem}
* labeled alternative in {@link KickCParser#importDecl}.
* @param ctx the parse tree
*/
void enterIncludeSystem(KickCParser.IncludeSystemContext ctx);
/**
* Exit a parse tree produced by the {@code includeSystem}
* labeled alternative in {@link KickCParser#importDecl}.
* @param ctx the parse tree
*/
void exitIncludeSystem(KickCParser.IncludeSystemContext ctx);
/**
* Enter a parse tree produced by {@link KickCParser#decl}.
* @param ctx the parse tree

View File

@ -30,33 +30,6 @@ public interface KickCParserVisitor<T> extends ParseTreeVisitor<T> {
* @return the visitor result
*/
T visitDeclSeq(KickCParser.DeclSeqContext ctx);
/**
* Visit a parse tree produced by {@link KickCParser#declOrImport}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitDeclOrImport(KickCParser.DeclOrImportContext ctx);
/**
* Visit a parse tree produced by the {@code importFile}
* labeled alternative in {@link KickCParser#importDecl}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitImportFile(KickCParser.ImportFileContext ctx);
/**
* Visit a parse tree produced by the {@code includeFile}
* labeled alternative in {@link KickCParser#importDecl}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitIncludeFile(KickCParser.IncludeFileContext ctx);
/**
* Visit a parse tree produced by the {@code includeSystem}
* labeled alternative in {@link KickCParser#importDecl}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitIncludeSystem(KickCParser.IncludeSystemContext ctx);
/**
* Visit a parse tree produced by {@link KickCParser#decl}.
* @param ctx the parse tree

View File

@ -84,37 +84,7 @@ public class Pass0GenerateStatementSequence extends KickCParserBaseVisitor<Objec
this.visit(ctx.declSeq());
return null;
}
@Override
public Object visitImportFile(KickCParser.ImportFileContext ctx) {
String importName = ctx.IMPORT_LOCALFILE().getText();
String importFileName = importName.substring(1, importName.length() - 1);
if(program.getLog().isVerboseParse()) {
program.getLog().append("Importing " + importFileName);
}
return null;
}
@Override
public Object visitIncludeFile(KickCParser.IncludeFileContext ctx) {
String includeName = ctx.IMPORT_LOCALFILE().getText();
String includeFileName = includeName.substring(1, includeName.length() - 1);
if(program.getLog().isVerboseParse()) {
program.getLog().append("Including " + includeFileName);
}
return null;
}
@Override
public Object visitIncludeSystem(KickCParser.IncludeSystemContext ctx) {
String includeName = ctx.IMPORT_SYSTEMFILE().getText();
String includeFileName = includeName.substring(1, includeName.length() - 1);
if(program.getLog().isVerboseParse()) {
program.getLog().append("Including system" + includeFileName);
}
return null;
}
@Override
public Object visitGlobalDirectiveVarModel(KickCParser.GlobalDirectiveVarModelContext ctx) {
List<TerminalNode> settingNodes = new ArrayList<>(ctx.NAME());

View File

@ -144,6 +144,12 @@ public class CPreprocessor implements TokenSource {
} else if(inputToken.getType() == KickCLexer.ERROR) {
error(inputToken, cTokenSource);
return true;
} else if(inputToken.getType() == KickCLexer.IMPORT) {
include(inputToken, cTokenSource);
return true;
} else if(inputToken.getType() == KickCLexer.INCLUDE) {
include(inputToken, cTokenSource);
return true;
}
return false;
}
@ -203,6 +209,26 @@ public class CPreprocessor implements TokenSource {
throw new CompileError(errorMsg.toString(), new StatementSource(inputToken, lastToken));
}
/**
* Import a file
*
* @param inputToken The #import token
* @param cTokenSource The token source used to get the file to import
*/
private void include(Token inputToken, CTokenSource cTokenSource) {
skipWhitespace(cTokenSource);
final Token fileNameToken = cTokenSource.nextToken();
if(fileNameToken.getType() == KickCLexer.IMPORT_LOCALFILE) {
final String fileName = fileNameToken.getText();
cParser.includeCFile(fileName, false);
} else if(fileNameToken.getType() == KickCLexer.IMPORT_SYSTEMFILE) {
final String fileName = fileNameToken.getText();
cParser.includeCFile(fileName, true);
} else {
throw new CompileError("Error! #include not followed by file!", new StatementSource(inputToken, fileNameToken));
}
}
/**
* Define a macro.

View File

@ -134,7 +134,7 @@
}
#else
// #error "Target platform does not support conio.h"
#error "Target platform does not support conio.h"
#endif
// The current cursor x-position

View File

@ -398,6 +398,11 @@ public class TestPrograms {
compileAndCompare("cstyle-decl-function.c");
}
@Test
public void testPreprocessor12() throws IOException, URISyntaxException {
compileAndCompare("preprocessor-12.c");
}
@Test
public void testPreprocessor11() throws IOException, URISyntaxException {
compileAndCompare("preprocessor-11.c");

View File

@ -0,0 +1,12 @@
// Test the preprocessor
// #include that is not used
#ifdef ERR
#include "qwe.h"
#endif
char * const SCREEN = 0x0400;
void main() {
SCREEN[0] = 'a';
}

View File

@ -1,3 +1,6 @@
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"

View File

@ -1296,6 +1296,9 @@ Allocated zp[2]:51 [ fill::end#0 ]
INITIAL ASM
Target platform is c64basic / MOS6502X
// File Comments
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
@ -2176,6 +2179,9 @@ Allocated (was zp[2]:41) zp[2]:16 [ plot::$15 plot::$16 plot::$12 ]
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
@ -2932,11 +2938,11 @@ Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Fixing long branch [112] bmi __b3 to bpl
Fixing long branch [309] bmi __breturn to bpl
Fixing long branch [319] bmi __breturn to bpl
Fixing long branch [323] bmi __breturn to bpl
Fixing long branch [333] bpl __breturn to bmi
Fixing long branch [115] bmi __b3 to bpl
Fixing long branch [312] bmi __breturn to bpl
Fixing long branch [322] bmi __breturn to bpl
Fixing long branch [326] bmi __breturn to bpl
Fixing long branch [336] bpl __breturn to bmi
FINAL SYMBOL TABLE
(label) @1
@ -3160,6 +3166,9 @@ FINAL ASSEMBLER
Score: 51752
// File Comments
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)

View File

@ -1,5 +1,8 @@
// Tests the simple bitmap plotter - and counts plots per frame in an IRQ
// Plots simple plots
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
.pc = $80d "Program"

View File

@ -1681,6 +1681,9 @@ Target platform is c64basic / MOS6502X
// File Comments
// Tests the simple bitmap plotter - and counts plots per frame in an IRQ
// Plots simple plots
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
@ -2455,6 +2458,9 @@ ASSEMBLER BEFORE OPTIMIZATION
// File Comments
// Tests the simple bitmap plotter - and counts plots per frame in an IRQ
// Plots simple plots
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
@ -3370,6 +3376,9 @@ Score: 3175
// File Comments
// Tests the simple bitmap plotter - and counts plots per frame in an IRQ
// Plots simple plots
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)

View File

@ -1,5 +1,8 @@
// Tests the simple bitmap plotter - and counts plots per frame in an IRQ
// Plots a fullscreen elipsis
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
.pc = $80d "Program"

View File

@ -3815,6 +3815,9 @@ Target platform is c64basic / MOS6502X
// File Comments
// Tests the simple bitmap plotter - and counts plots per frame in an IRQ
// Plots a fullscreen elipsis
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
@ -6176,6 +6179,9 @@ ASSEMBLER BEFORE OPTIMIZATION
// File Comments
// Tests the simple bitmap plotter - and counts plots per frame in an IRQ
// Plots a fullscreen elipsis
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
@ -8481,6 +8487,9 @@ Score: 20648
// File Comments
// Tests the simple bitmap plotter - and counts plots per frame in an IRQ
// Plots a fullscreen elipsis
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)

View File

@ -1,5 +1,8 @@
// Tests the simple bitmap plotter - and counts plots per frame in an IRQ
// Plots a spiral
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
.pc = $80d "Program"

View File

@ -4021,6 +4021,9 @@ Target platform is c64basic / MOS6502X
// File Comments
// Tests the simple bitmap plotter - and counts plots per frame in an IRQ
// Plots a spiral
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
@ -6457,6 +6460,9 @@ ASSEMBLER BEFORE OPTIMIZATION
// File Comments
// Tests the simple bitmap plotter - and counts plots per frame in an IRQ
// Plots a spiral
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
@ -8853,6 +8859,9 @@ Score: 20833
// File Comments
// Tests the simple bitmap plotter - and counts plots per frame in an IRQ
// Plots a spiral
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)

View File

@ -1,5 +1,8 @@
// Tests the simple bitmap plotter
// Plots a few lines using the bresenham line algorithm
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"

View File

@ -2434,6 +2434,9 @@ Target platform is c64basic / MOS6502X
// File Comments
// Tests the simple bitmap plotter
// Plots a few lines using the bresenham line algorithm
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
@ -3658,6 +3661,9 @@ ASSEMBLER BEFORE OPTIMIZATION
// File Comments
// Tests the simple bitmap plotter
// Plots a few lines using the bresenham line algorithm
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
@ -4640,7 +4646,7 @@ Removing instruction __breturn:
Removing instruction __b2:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Fixing long branch [119] beq __b4 to bne
Fixing long branch [122] beq __b4 to bne
FINAL SYMBOL TABLE
(label) @1
@ -4968,6 +4974,9 @@ Score: 26883
// File Comments
// Tests the simple bitmap plotter
// Plots a few lines using the bresenham line algorithm
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)

View File

@ -1,4 +1,9 @@
// C64DTV 8bpp charmode stretcher
// C64 DTV version 2 Registers and Constants
//
// Sources
// (J) https://www.c64-wiki.com/wiki/C64DTV_Programming_Guide
// (H) http://dtvhacking.cbm8bit.com/dtv_wiki/images/d/d9/Dtv_registers_full.txt
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"

View File

@ -1298,6 +1298,11 @@ INITIAL ASM
Target platform is c64basic / MOS6502X
// File Comments
// C64DTV 8bpp charmode stretcher
// C64 DTV version 2 Registers and Constants
//
// Sources
// (J) https://www.c64-wiki.com/wiki/C64DTV_Programming_Guide
// (H) http://dtvhacking.cbm8bit.com/dtv_wiki/images/d/d9/Dtv_registers_full.txt
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
@ -2088,6 +2093,11 @@ Allocated (was zp[1]:24) zp[1]:9 [ gfx_init_screen0::$1 gfx_init_plane_charset8:
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
// C64DTV 8bpp charmode stretcher
// C64 DTV version 2 Registers and Constants
//
// Sources
// (J) https://www.c64-wiki.com/wiki/C64DTV_Programming_Guide
// (H) http://dtvhacking.cbm8bit.com/dtv_wiki/images/d/d9/Dtv_registers_full.txt
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
@ -3008,6 +3018,11 @@ Score: 75375
// File Comments
// C64DTV 8bpp charmode stretcher
// C64 DTV version 2 Registers and Constants
//
// Sources
// (J) https://www.c64-wiki.com/wiki/C64DTV_Programming_Guide
// (H) http://dtvhacking.cbm8bit.com/dtv_wiki/images/d/d9/Dtv_registers_full.txt
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)

View File

@ -1,4 +1,9 @@
// C64DTV 8bpp charmode stretcher
// C64 DTV version 2 Registers and Constants
//
// Sources
// (J) https://www.c64-wiki.com/wiki/C64DTV_Programming_Guide
// (H) http://dtvhacking.cbm8bit.com/dtv_wiki/images/d/d9/Dtv_registers_full.txt
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"

View File

@ -893,6 +893,11 @@ INITIAL ASM
Target platform is c64basic / MOS6502X
// File Comments
// C64DTV 8bpp charmode stretcher
// C64 DTV version 2 Registers and Constants
//
// Sources
// (J) https://www.c64-wiki.com/wiki/C64DTV_Programming_Guide
// (H) http://dtvhacking.cbm8bit.com/dtv_wiki/images/d/d9/Dtv_registers_full.txt
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
@ -1455,6 +1460,11 @@ Allocated (was zp[2]:14) zp[2]:7 [ gfx_init_chunky::$5 ]
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
// C64DTV 8bpp charmode stretcher
// C64 DTV version 2 Registers and Constants
//
// Sources
// (J) https://www.c64-wiki.com/wiki/C64DTV_Programming_Guide
// (H) http://dtvhacking.cbm8bit.com/dtv_wiki/images/d/d9/Dtv_registers_full.txt
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
@ -2141,6 +2151,11 @@ Score: 19882
// File Comments
// C64DTV 8bpp charmode stretcher
// C64 DTV version 2 Registers and Constants
//
// Sources
// (J) https://www.c64-wiki.com/wiki/C64DTV_Programming_Guide
// (H) http://dtvhacking.cbm8bit.com/dtv_wiki/images/d/d9/Dtv_registers_full.txt
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)

View File

@ -1,3 +1,8 @@
// C64 DTV version 2 Registers and Constants
//
// Sources
// (J) https://www.c64-wiki.com/wiki/C64DTV_Programming_Guide
// (H) http://dtvhacking.cbm8bit.com/dtv_wiki/images/d/d9/Dtv_registers_full.txt
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"

View File

@ -508,6 +508,11 @@ Allocated zp[1]:3 [ main::$0 ]
INITIAL ASM
Target platform is c64basic / MOS6502X
// File Comments
// C64 DTV version 2 Registers and Constants
//
// Sources
// (J) https://www.c64-wiki.com/wiki/C64DTV_Programming_Guide
// (H) http://dtvhacking.cbm8bit.com/dtv_wiki/images/d/d9/Dtv_registers_full.txt
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
@ -836,6 +841,11 @@ Uplifting [] best 2515 combination
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
// C64 DTV version 2 Registers and Constants
//
// Sources
// (J) https://www.c64-wiki.com/wiki/C64DTV_Programming_Guide
// (H) http://dtvhacking.cbm8bit.com/dtv_wiki/images/d/d9/Dtv_registers_full.txt
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
@ -1257,6 +1267,11 @@ FINAL ASSEMBLER
Score: 1553
// File Comments
// C64 DTV version 2 Registers and Constants
//
// Sources
// (J) https://www.c64-wiki.com/wiki/C64DTV_Programming_Guide
// (H) http://dtvhacking.cbm8bit.com/dtv_wiki/images/d/d9/Dtv_registers_full.txt
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)

View File

@ -1,4 +1,9 @@
// Interactive Explorer for C64DTV Screen Modes
// C64 DTV version 2 Registers and Constants
//
// Sources
// (J) https://www.c64-wiki.com/wiki/C64DTV_Programming_Guide
// (H) http://dtvhacking.cbm8bit.com/dtv_wiki/images/d/d9/Dtv_registers_full.txt
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"

View File

@ -13029,6 +13029,11 @@ INITIAL ASM
Target platform is c64basic / MOS6502X
// File Comments
// Interactive Explorer for C64DTV Screen Modes
// C64 DTV version 2 Registers and Constants
//
// Sources
// (J) https://www.c64-wiki.com/wiki/C64DTV_Programming_Guide
// (H) http://dtvhacking.cbm8bit.com/dtv_wiki/images/d/d9/Dtv_registers_full.txt
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
@ -20328,6 +20333,11 @@ Allocated (was zp[1]:347) zp[1]:34 [ gfx_init_screen0::$1 gfx_init_screen2::col2
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
// Interactive Explorer for C64DTV Screen Modes
// C64 DTV version 2 Registers and Constants
//
// Sources
// (J) https://www.c64-wiki.com/wiki/C64DTV_Programming_Guide
// (H) http://dtvhacking.cbm8bit.com/dtv_wiki/images/d/d9/Dtv_registers_full.txt
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
@ -26695,15 +26705,15 @@ Removing unreachable instruction jmp __b9
Removing unreachable instruction jmp __b14
Removing unreachable instruction jmp __b7
Succesful ASM optimization Pass5UnreachableCodeElimination
Fixing long branch [752] beq __b6 to bne
Fixing long branch [756] beq __b7 to bne
Fixing long branch [760] beq __b8 to bne
Fixing long branch [764] beq __b9 to bne
Fixing long branch [768] beq __b10 to bne
Fixing long branch [772] beq __b11 to bne
Fixing long branch [776] beq __b12 to bne
Fixing long branch [780] beq __b13 to bne
Fixing long branch [1345] bmi __b2 to bpl
Fixing long branch [757] beq __b6 to bne
Fixing long branch [761] beq __b7 to bne
Fixing long branch [765] beq __b8 to bne
Fixing long branch [769] beq __b9 to bne
Fixing long branch [773] beq __b10 to bne
Fixing long branch [777] beq __b11 to bne
Fixing long branch [781] beq __b12 to bne
Fixing long branch [785] beq __b13 to bne
Fixing long branch [1350] bmi __b2 to bpl
FINAL SYMBOL TABLE
(label) @1
@ -28198,6 +28208,11 @@ Score: 10118912
// File Comments
// Interactive Explorer for C64DTV Screen Modes
// C64 DTV version 2 Registers and Constants
//
// Sources
// (J) https://www.c64-wiki.com/wiki/C64DTV_Programming_Guide
// (H) http://dtvhacking.cbm8bit.com/dtv_wiki/images/d/d9/Dtv_registers_full.txt
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)

View File

@ -1,4 +1,9 @@
// Exploring C64DTV Screen Modes
// C64 DTV version 2 Registers and Constants
//
// Sources
// (J) https://www.c64-wiki.com/wiki/C64DTV_Programming_Guide
// (H) http://dtvhacking.cbm8bit.com/dtv_wiki/images/d/d9/Dtv_registers_full.txt
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"

View File

@ -11984,6 +11984,11 @@ INITIAL ASM
Target platform is c64basic / MOS6502X
// File Comments
// Exploring C64DTV Screen Modes
// C64 DTV version 2 Registers and Constants
//
// Sources
// (J) https://www.c64-wiki.com/wiki/C64DTV_Programming_Guide
// (H) http://dtvhacking.cbm8bit.com/dtv_wiki/images/d/d9/Dtv_registers_full.txt
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
@ -18963,6 +18968,11 @@ Allocated (was zp[1]:291) zp[1]:19 [ mode_stdchar::$5 mode_stdbitmap::cy#4 mode_
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
// Exploring C64DTV Screen Modes
// C64 DTV version 2 Registers and Constants
//
// Sources
// (J) https://www.c64-wiki.com/wiki/C64DTV_Programming_Guide
// (H) http://dtvhacking.cbm8bit.com/dtv_wiki/images/d/d9/Dtv_registers_full.txt
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
@ -24681,9 +24691,9 @@ Succesful ASM optimization Pass5UnnecesaryLoadElimination
Removing instruction __breturn:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Fixing long branch [251] beq __b5 to bne
Fixing long branch [158] bne __b3 to beq
Fixing long branch [256] beq __b5 to bne
Fixing long branch [163] bne __b3 to beq
Fixing long branch [168] bne __b3 to beq
FINAL SYMBOL TABLE
(label) @1
@ -26020,6 +26030,11 @@ Score: 2307926
// File Comments
// Exploring C64DTV Screen Modes
// C64 DTV version 2 Registers and Constants
//
// Sources
// (J) https://www.c64-wiki.com/wiki/C64DTV_Programming_Guide
// (H) http://dtvhacking.cbm8bit.com/dtv_wiki/images/d/d9/Dtv_registers_full.txt
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)

View File

@ -1,4 +1,6 @@
// Plot a r=9 circle on the screen using chars - count how many chars are used
// C standard library string.h
// Functions to manipulate C strings and arrays.
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
.pc = $80d "Program"

View File

@ -3885,6 +3885,8 @@ INITIAL ASM
Target platform is c64basic / MOS6502X
// File Comments
// Plot a r=9 circle on the screen using chars - count how many chars are used
// C standard library string.h
// Functions to manipulate C strings and arrays.
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
@ -5357,6 +5359,8 @@ Allocated (was zp[2]:80) zp[2]:18 [ utoa::digit_value#0 utoa_append::sub#0 memcp
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
// Plot a r=9 circle on the screen using chars - count how many chars are used
// C standard library string.h
// Functions to manipulate C strings and arrays.
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
@ -6925,6 +6929,8 @@ Score: 86027
// File Comments
// Plot a r=9 circle on the screen using chars - count how many chars are used
// C standard library string.h
// Functions to manipulate C strings and arrays.
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)

View File

@ -1,4 +1,8 @@
// Clears start screen throwing around the letters (by turning them into sprites)
// C standard library stdlib.h
// Implementation of functions found int C stdlib.h / stdlib.c
// C standard library string.h
// Functions to manipulate C strings and arrays.
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
.pc = $80d "Program"

View File

@ -4572,6 +4572,10 @@ INITIAL ASM
Target platform is c64basic / MOS6502X
// File Comments
// Clears start screen throwing around the letters (by turning them into sprites)
// C standard library stdlib.h
// Implementation of functions found int C stdlib.h / stdlib.c
// C standard library string.h
// Functions to manipulate C strings and arrays.
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
@ -7558,6 +7562,10 @@ Allocated (was zp[1]:173) zp[1]:43 [ processChars::ypos#0 ]
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
// Clears start screen throwing around the letters (by turning them into sprites)
// C standard library stdlib.h
// Implementation of functions found int C stdlib.h / stdlib.c
// C standard library string.h
// Functions to manipulate C strings and arrays.
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
@ -9792,23 +9800,23 @@ Removing instruction jmp __b1
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction ldy #OFFSET_STRUCT_PROCESSINGSPRITE_STATUS
Succesful ASM optimization Pass5UnnecesaryLoadElimination
Fixing long branch [453] bne __b2 to beq
Fixing long branch [868] beq __b12 to bne
Fixing long branch [1211] bne __b1 to beq
Fixing long branch [231] bne __b3 to beq
Fixing long branch [237] beq __b8 to bne
Fixing long branch [498] beq __b11 to bne
Fixing long branch [768] bpl __b1 to bmi
Fixing long branch [780] bpl __b4 to bmi
Fixing long branch [1025] beq __b2 to bne
Fixing long branch [1085] bne __b4 to beq
Fixing long branch [1119] bcc __b6 to bcs
Fixing long branch [1126] bcc __b6 to bcs
Fixing long branch [1133] bcc __b6 to bcs
Fixing long branch [1140] bcc __b6 to bcs
Fixing long branch [1148] bcc __b6 to bcs
Fixing long branch [1155] bcc __b6 to bcs
Fixing long branch [1163] bcc __b6 to bcs
Fixing long branch [457] bne __b2 to beq
Fixing long branch [872] beq __b12 to bne
Fixing long branch [1215] bne __b1 to beq
Fixing long branch [235] bne __b3 to beq
Fixing long branch [241] beq __b8 to bne
Fixing long branch [502] beq __b11 to bne
Fixing long branch [772] bpl __b1 to bmi
Fixing long branch [784] bpl __b4 to bmi
Fixing long branch [1029] beq __b2 to bne
Fixing long branch [1089] bne __b4 to beq
Fixing long branch [1123] bcc __b6 to bcs
Fixing long branch [1130] bcc __b6 to bcs
Fixing long branch [1137] bcc __b6 to bcs
Fixing long branch [1144] bcc __b6 to bcs
Fixing long branch [1152] bcc __b6 to bcs
Fixing long branch [1159] bcc __b6 to bcs
Fixing long branch [1167] bcc __b6 to bcs
FINAL SYMBOL TABLE
(const struct ProcessingSprite) $2 = { x: (word) 0, y: (word) 0, vx: (word) 0, vy: (word) 0, id: (byte) 0, ptr: (byte) 0, col: (byte) 0, status: (const byte) STATUS_FREE, screenPtr: (byte*) 0 }
@ -10451,6 +10459,10 @@ Score: 1113332
// File Comments
// Clears start screen throwing around the letters (by turning them into sprites)
// C standard library stdlib.h
// Implementation of functions found int C stdlib.h / stdlib.c
// C standard library string.h
// Functions to manipulate C strings and arrays.
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)

View File

@ -1,4 +1,7 @@
// Pre-calculated bobs inside a charset (pre-moved to all x/y-combinations)
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"

View File

@ -4575,6 +4575,9 @@ INITIAL ASM
Target platform is c64basic / MOS6502X
// File Comments
// Pre-calculated bobs inside a charset (pre-moved to all x/y-combinations)
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
@ -6685,6 +6688,9 @@ Allocated (was zp[2]:90) zp[2]:32 [ renderBobInit::$6 mulf_init::sqr1_lo#2 mulf_
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
// Pre-calculated bobs inside a charset (pre-moved to all x/y-combinations)
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
@ -9005,6 +9011,9 @@ Score: 3582851
// File Comments
// Pre-calculated bobs inside a charset (pre-moved to all x/y-combinations)
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)

View File

@ -1,4 +1,7 @@
// Pre-calculated bobs inside a charset (pre-moved to all x/y-combinations)
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"

View File

@ -4927,6 +4927,9 @@ INITIAL ASM
Target platform is c64basic / MOS6502X
// File Comments
// Pre-calculated bobs inside a charset (pre-moved to all x/y-combinations)
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
@ -7411,6 +7414,9 @@ Allocated (was zp[2]:111) zp[2]:24 [ renderBobInit::$6 mulf_init::sqr1_hi#2 mulf
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
// Pre-calculated bobs inside a charset (pre-moved to all x/y-combinations)
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
@ -9929,6 +9935,9 @@ Score: 3510799
// File Comments
// Pre-calculated bobs inside a charset (pre-moved to all x/y-combinations)
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)

View File

@ -1,4 +1,7 @@
// Same animation using a multiplexer
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
.pc = $80d "Program"

View File

@ -3214,6 +3214,9 @@ INITIAL ASM
Target platform is c64basic / MOS6502X
// File Comments
// Same animation using a multiplexer
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
@ -5181,6 +5184,9 @@ Allocated (was zp[1]:82) zp[1]:23 [ mulf8s_prepared::b#0 plexSort::nxt_y#0 ]
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
// Same animation using a multiplexer
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
@ -7152,6 +7158,9 @@ Score: 74020
// File Comments
// Same animation using a multiplexer
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)

View File

@ -1,4 +1,7 @@
// Put a 2x2 font into sprites and show it on screen
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
.pc = $80d "Program"

View File

@ -3565,6 +3565,9 @@ INITIAL ASM
Target platform is c64basic / MOS6502X
// File Comments
// Put a 2x2 font into sprites and show it on screen
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
@ -5476,6 +5479,9 @@ Allocated (was zp[1]:74) zp[1]:26 [ plexShowSprite::plex_sprite_idx2#0 ]
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
// Put a 2x2 font into sprites and show it on screen
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
@ -6984,7 +6990,7 @@ Removing instruction lda #0
Removing instruction lda #8
Removing instruction ldx.z plex_show_idx
Succesful ASM optimization Pass5UnnecesaryLoadElimination
Fixing long branch [556] bne __b1 to beq
Fixing long branch [559] bne __b1 to beq
FINAL SYMBOL TABLE
(label) @1
@ -7424,6 +7430,9 @@ Score: 159127
// File Comments
// Put a 2x2 font into sprites and show it on screen
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)

View File

@ -1,3 +1,8 @@
// Tetris Game for the Commodore 64
// A sprite multiplexer covering the playfield with a black layer to allow for 3 single-pixel colors
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
.pc = $80d "Program"

View File

@ -1680,6 +1680,11 @@ Allocated zp[1]:26 [ sprites_irq::ptr#2 ]
INITIAL ASM
Target platform is c64basic / MOS6502X
// File Comments
// Tetris Game for the Commodore 64
// A sprite multiplexer covering the playfield with a black layer to allow for 3 single-pixel colors
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
@ -2558,6 +2563,11 @@ Removing interrupt register storage ldy #00 in 161 [97] return - exit interrupt
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
// Tetris Game for the Commodore 64
// A sprite multiplexer covering the playfield with a black layer to allow for 3 single-pixel colors
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
@ -3538,6 +3548,11 @@ FINAL ASSEMBLER
Score: 11662
// File Comments
// Tetris Game for the Commodore 64
// A sprite multiplexer covering the playfield with a black layer to allow for 3 single-pixel colors
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)

View File

@ -178,6 +178,8 @@ __bbegin:
lda #>0>>$10
sta.z score_bcd+3
// kickasm
// Tetris Game for the Commodore 64
// A sprite multiplexer covering the playfield with a black layer to allow for 3 single-pixel colors
// irq_raster_next = IRQ_RASTER_FIRST
// The raster line of the next IRQ
lda #IRQ_RASTER_FIRST

View File

@ -11815,6 +11815,8 @@ __b1:
// @2
__b2:
// kickasm(location (const nomodify byte*) PLAYFIELD_SPRITES) {{ .var sprites = LoadPicture("playfield-sprites.png", List().add($010101, $000000)) // Put the sprites into memory .for(var sy=0;sy<10;sy++) { .var sprite_gfx_y = sy*20 .for(var sx=0;sx<3;sx++) { .for (var y=0;y<21; y++) { .var gfx_y = sprite_gfx_y + mod(2100+y-sprite_gfx_y,21) .for (var c=0; c<3; c++) { .byte sprites.getSinglecolorByte(sx*3+c,gfx_y) } } .byte 0 } } }}
// Tetris Game for the Commodore 64
// A sprite multiplexer covering the playfield with a black layer to allow for 3 single-pixel colors
jmp __b3
// @3
__b3:
@ -16958,6 +16960,8 @@ __b1:
// @2
__b2:
// kickasm(location (const nomodify byte*) PLAYFIELD_SPRITES) {{ .var sprites = LoadPicture("playfield-sprites.png", List().add($010101, $000000)) // Put the sprites into memory .for(var sy=0;sy<10;sy++) { .var sprite_gfx_y = sy*20 .for(var sx=0;sx<3;sx++) { .for (var y=0;y<21; y++) { .var gfx_y = sprite_gfx_y + mod(2100+y-sprite_gfx_y,21) .for (var c=0; c<3; c++) { .byte sprites.getSinglecolorByte(sx*3+c,gfx_y) } } .byte 0 } } }}
// Tetris Game for the Commodore 64
// A sprite multiplexer covering the playfield with a black layer to allow for 3 single-pixel colors
jmp __b3
// @3
__b3:
@ -20586,7 +20590,6 @@ Replacing label __b3_from___b3 with __b3
Replacing label __b4_from___b4 with __b4
Replacing label __b1_from___b5 with __b1
Removing instruction __b1:
Removing instruction __b2:
Removing instruction toSpritePtr1_from___b3:
Removing instruction toSpritePtr1:
Removing instruction __b4_from___b5:
@ -20714,6 +20717,7 @@ Removing instruction __breturn:
Removing instruction toSpritePtr1_from___b3:
Removing instruction toSpritePtr1:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __b2:
Removing instruction __b3:
Removing instruction __b5:
Removing instruction __b4:
@ -22302,6 +22306,8 @@ __bbegin:
// kickasm(location (const nomodify byte*) PLAYFIELD_CHARSET) {{ .fill 8,$00 // Place a filled char at the start of the charset .import binary "playfield-screen.imap" }}
// @2
// kickasm(location (const nomodify byte*) PLAYFIELD_SPRITES) {{ .var sprites = LoadPicture("playfield-sprites.png", List().add($010101, $000000)) // Put the sprites into memory .for(var sy=0;sy<10;sy++) { .var sprite_gfx_y = sy*20 .for(var sx=0;sx<3;sx++) { .for (var y=0;y<21; y++) { .var gfx_y = sprite_gfx_y + mod(2100+y-sprite_gfx_y,21) .for (var c=0; c<3; c++) { .byte sprites.getSinglecolorByte(sx*3+c,gfx_y) } } .byte 0 } } }}
// Tetris Game for the Commodore 64
// A sprite multiplexer covering the playfield with a black layer to allow for 3 single-pixel colors
// @3
// irq_raster_next = IRQ_RASTER_FIRST
// [5] (volatile byte) irq_raster_next ← (const nomodify byte) IRQ_RASTER_FIRST -- vbuz1=vbuc1

View File

@ -1,3 +1,5 @@
// Print a number of zero-terminated strings, each followed by a newline.
// The sequence of lines is terminated by another zero.
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"

View File

@ -1589,6 +1589,8 @@ Allocated zp[1]:18 [ print_char::ch#0 ]
INITIAL ASM
Target platform is c64basic / MOS6502X
// File Comments
// Print a number of zero-terminated strings, each followed by a newline.
// The sequence of lines is terminated by another zero.
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
@ -2286,6 +2288,8 @@ Allocated (was zp[2]:16) zp[2]:7 [ memset::dst#2 memset::dst#1 assert_sbyte::msg
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
// Print a number of zero-terminated strings, each followed by a newline.
// The sequence of lines is terminated by another zero.
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
@ -3121,6 +3125,8 @@ FINAL ASSEMBLER
Score: 1783
// File Comments
// Print a number of zero-terminated strings, each followed by a newline.
// The sequence of lines is terminated by another zero.
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)

View File

@ -1,5 +1,6 @@
// Find atan2(x, y) using the CORDIC method
// See http://bsvi.ru/uploads/CORDIC--_10EBA/cordic.pdf
// Creates a font where each char contains the number of the char (00-ff)
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"

View File

@ -2000,6 +2000,7 @@ Target platform is c64basic / MOS6502X
// File Comments
// Find atan2(x, y) using the CORDIC method
// See http://bsvi.ru/uploads/CORDIC--_10EBA/cordic.pdf
// Creates a font where each char contains the number of the char (00-ff)
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
@ -3049,6 +3050,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// File Comments
// Find atan2(x, y) using the CORDIC method
// See http://bsvi.ru/uploads/CORDIC--_10EBA/cordic.pdf
// Creates a font where each char contains the number of the char (00-ff)
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
@ -3922,9 +3924,9 @@ Removing instruction jmp __b1
Removing instruction jmp __b2
Removing instruction jmp __b3
Succesful ASM optimization Pass5NextJumpElimination
Fixing long branch [261] beq __b12 to bne
Fixing long branch [155] bpl __b1 to bmi
Fixing long branch [167] bpl __b4 to bmi
Fixing long branch [262] beq __b12 to bne
Fixing long branch [156] bpl __b1 to bmi
Fixing long branch [168] bpl __b4 to bmi
FINAL SYMBOL TABLE
(label) @1
@ -4222,6 +4224,7 @@ Score: 1056709
// File Comments
// Find atan2(x, y) using the CORDIC method
// See http://bsvi.ru/uploads/CORDIC--_10EBA/cordic.pdf
// Creates a font where each char contains the number of the char (00-ff)
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)

View File

@ -2,6 +2,9 @@
// Based on:
// - C= Hacking Magazine Issue 8. http://www.ffd2.com/fridge/chacking/c=hacking8.txt
// - Codebase64 Article http://codebase64.org/doku.php?id=base:3d_rotation
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"

View File

@ -4337,6 +4337,9 @@ Target platform is c64basic / MOS6502X
// Based on:
// - C= Hacking Magazine Issue 8. http://www.ffd2.com/fridge/chacking/c=hacking8.txt
// - Codebase64 Article http://codebase64.org/doku.php?id=base:3d_rotation
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
@ -7003,6 +7006,9 @@ ASSEMBLER BEFORE OPTIMIZATION
// Based on:
// - C= Hacking Magazine Issue 8. http://www.ffd2.com/fridge/chacking/c=hacking8.txt
// - Codebase64 Article http://codebase64.org/doku.php?id=base:3d_rotation
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
@ -9117,9 +9123,9 @@ Removing instruction jmp __b1
Removing instruction jmp __b2
Removing instruction jmp __b1
Succesful ASM optimization Pass5NextJumpElimination
Fixing long branch [317] bne __b1 to beq
Fixing long branch [923] bne __b2 to beq
Fixing long branch [932] bne __b1 to beq
Fixing long branch [320] bne __b1 to beq
Fixing long branch [926] bne __b2 to beq
Fixing long branch [935] bne __b1 to beq
FINAL SYMBOL TABLE
(label) @1
@ -9730,6 +9736,9 @@ Score: 67977
// Based on:
// - C= Hacking Magazine Issue 8. http://www.ffd2.com/fridge/chacking/c=hacking8.txt
// - Codebase64 Article http://codebase64.org/doku.php?id=base:3d_rotation
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)

View File

@ -2,6 +2,9 @@
// Based on:
// - C= Hacking Magazine Issue 8. http://www.ffd2.com/fridge/chacking/c=hacking8.txt
// - Codebase64 Article http://codebase64.org/doku.php?id=base:3d_rotation
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"

View File

@ -1745,6 +1745,9 @@ Target platform is c64basic / MOS6502X
// Based on:
// - C= Hacking Magazine Issue 8. http://www.ffd2.com/fridge/chacking/c=hacking8.txt
// - Codebase64 Article http://codebase64.org/doku.php?id=base:3d_rotation
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
@ -2590,6 +2593,9 @@ ASSEMBLER BEFORE OPTIMIZATION
// Based on:
// - C= Hacking Magazine Issue 8. http://www.ffd2.com/fridge/chacking/c=hacking8.txt
// - Codebase64 Article http://codebase64.org/doku.php?id=base:3d_rotation
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
@ -3665,6 +3671,9 @@ Score: 3201
// Based on:
// - C= Hacking Magazine Issue 8. http://www.ffd2.com/fridge/chacking/c=hacking8.txt
// - Codebase64 Article http://codebase64.org/doku.php?id=base:3d_rotation
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)

View File

@ -1,5 +1,7 @@
// Minimal Atari 2600 VCS Program
// Source: https://atariage.com/forums/blogs/entry/11109-step-1-generate-a-stable-display/
// Atari 2600 Registers and Constants
// https://web.archive.org/web/20170215054248/http://www.atariguide.com/pdfs/Atari_2600_VCS_Domestic_Field_Service_Manual.pdf
// Atari 2600 VCS 2K ROM
.file [name="atari2600-demo.a26", type="bin", segments="Code, Data, Vectors"]
.segmentdef Code [start=$f800,min=$f800,max=$fff9]

View File

@ -541,6 +541,8 @@ Target platform is atari2600 / MOS6502X
// File Comments
// Minimal Atari 2600 VCS Program
// Source: https://atariage.com/forums/blogs/entry/11109-step-1-generate-a-stable-display/
// Atari 2600 Registers and Constants
// https://web.archive.org/web/20170215054248/http://www.atariguide.com/pdfs/Atari_2600_VCS_Domestic_Field_Service_Manual.pdf
// Upstart
// Atari 2600 VCS 2K ROM
.file [name="atari2600-demo.a26", type="bin", segments="Code, Data, Vectors"]
@ -825,6 +827,8 @@ ASSEMBLER BEFORE OPTIMIZATION
// File Comments
// Minimal Atari 2600 VCS Program
// Source: https://atariage.com/forums/blogs/entry/11109-step-1-generate-a-stable-display/
// Atari 2600 Registers and Constants
// https://web.archive.org/web/20170215054248/http://www.atariguide.com/pdfs/Atari_2600_VCS_Domestic_Field_Service_Manual.pdf
// Upstart
// Atari 2600 VCS 2K ROM
.file [name="atari2600-demo.a26", type="bin", segments="Code, Data, Vectors"]
@ -1188,6 +1192,8 @@ Score: 8259
// File Comments
// Minimal Atari 2600 VCS Program
// Source: https://atariage.com/forums/blogs/entry/11109-step-1-generate-a-stable-display/
// Atari 2600 Registers and Constants
// https://web.archive.org/web/20170215054248/http://www.atariguide.com/pdfs/Atari_2600_VCS_Domestic_Field_Service_Manual.pdf
// Upstart
// Atari 2600 VCS 2K ROM
.file [name="atari2600-demo.a26", type="bin", segments="Code, Data, Vectors"]

View File

@ -1,5 +1,7 @@
// Minimal Atari 2600 VCS Program using Sprites
// Source: https://atariage.com/forums/blogs/entry/11109-step-1-generate-a-stable-display/
// Atari 2600 Registers and Constants
// https://web.archive.org/web/20170215054248/http://www.atariguide.com/pdfs/Atari_2600_VCS_Domestic_Field_Service_Manual.pdf
// Atari 2600 VCS 2K ROM
.file [name="atari2600-sprites.a26", type="bin", segments="Code, Data, Vectors"]
.segmentdef Code [start=$f800,min=$f800,max=$fff9]

View File

@ -849,6 +849,8 @@ Target platform is atari2600 / MOS6502X
// File Comments
// Minimal Atari 2600 VCS Program using Sprites
// Source: https://atariage.com/forums/blogs/entry/11109-step-1-generate-a-stable-display/
// Atari 2600 Registers and Constants
// https://web.archive.org/web/20170215054248/http://www.atariguide.com/pdfs/Atari_2600_VCS_Domestic_Field_Service_Manual.pdf
// Upstart
// Atari 2600 VCS 2K ROM
.file [name="atari2600-sprites.a26", type="bin", segments="Code, Data, Vectors"]
@ -1257,6 +1259,8 @@ ASSEMBLER BEFORE OPTIMIZATION
// File Comments
// Minimal Atari 2600 VCS Program using Sprites
// Source: https://atariage.com/forums/blogs/entry/11109-step-1-generate-a-stable-display/
// Atari 2600 Registers and Constants
// https://web.archive.org/web/20170215054248/http://www.atariguide.com/pdfs/Atari_2600_VCS_Domestic_Field_Service_Manual.pdf
// Upstart
// Atari 2600 VCS 2K ROM
.file [name="atari2600-sprites.a26", type="bin", segments="Code, Data, Vectors"]
@ -1756,6 +1760,8 @@ Score: 10872
// File Comments
// Minimal Atari 2600 VCS Program using Sprites
// Source: https://atariage.com/forums/blogs/entry/11109-step-1-generate-a-stable-display/
// Atari 2600 Registers and Constants
// https://web.archive.org/web/20170215054248/http://www.atariguide.com/pdfs/Atari_2600_VCS_Domestic_Field_Service_Manual.pdf
// Upstart
// Atari 2600 VCS 2K ROM
.file [name="atari2600-sprites.a26", type="bin", segments="Code, Data, Vectors"]

View File

@ -1,3 +1,6 @@
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"

View File

@ -2686,6 +2686,9 @@ Allocated zp[1]:67 [ bitmap_init::$9 ]
INITIAL ASM
Target platform is c64basic / MOS6502X
// File Comments
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
@ -4122,6 +4125,9 @@ Allocated (was zp[1]:64) zp[1]:14 [ bitmap_init::$10 bitmap_line_xdyi::yd#2 bitm
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
@ -5680,6 +5686,9 @@ FINAL ASSEMBLER
Score: 221364
// File Comments
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)

View File

@ -1,4 +1,7 @@
// Allows analysis of the CHARGEN ROM font
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"

View File

@ -1969,6 +1969,9 @@ INITIAL ASM
Target platform is c64basic / MOS6502X
// File Comments
// Allows analysis of the CHARGEN ROM font
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
@ -3060,6 +3063,9 @@ Allocated (was zp[2]:23) zp[2]:12 [ print_str_at::at#5 print_str_at::at#7 print_
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
// Allows analysis of the CHARGEN ROM font
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
@ -4010,8 +4016,8 @@ Removing instruction jmp __b12
Removing instruction jmp __b3
Removing instruction jmp __b4
Succesful ASM optimization Pass5NextJumpElimination
Fixing long branch [83] bcc __b2 to bcs
Fixing long branch [89] bcc __b2 to bcs
Fixing long branch [86] bcc __b2 to bcs
Fixing long branch [92] bcc __b2 to bcs
FINAL SYMBOL TABLE
(label) @1
@ -4371,6 +4377,9 @@ Score: 558979
// File Comments
// Allows analysis of the CHARGEN ROM font
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)

View File

@ -1,3 +1,4 @@
// Functions for performing input and output.
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
.pc = $80d "Program"

View File

@ -1051,6 +1051,7 @@ Allocated zp[2]:27 [ memcpy::src_end#0 ]
INITIAL ASM
Target platform is c64basic / MOS6502X
// File Comments
// Functions for performing input and output.
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
@ -1590,6 +1591,7 @@ Allocated (was zp[2]:27) zp[2]:14 [ memcpy::src_end#0 ]
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
// Functions for performing input and output.
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
@ -2179,6 +2181,7 @@ FINAL ASSEMBLER
Score: 10896
// File Comments
// Functions for performing input and output.
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)

View File

@ -1,4 +1,7 @@
// A raster IRQ that opens the top/bottom border.
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"

View File

@ -359,6 +359,9 @@ INITIAL ASM
Target platform is c64basic / MOS6502X
// File Comments
// A raster IRQ that opens the top/bottom border.
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
@ -545,6 +548,9 @@ Uplifting [] best 175 combination
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
// A raster IRQ that opens the top/bottom border.
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
@ -828,6 +834,9 @@ Score: 154
// File Comments
// A raster IRQ that opens the top/bottom border.
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)

View File

@ -1,4 +1,7 @@
// A simple usage of the flexible sprite multiplexer routine
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
.pc = $80d "Program"

View File

@ -1666,6 +1666,9 @@ INITIAL ASM
Target platform is c64basic / MOS6502X
// File Comments
// A simple usage of the flexible sprite multiplexer routine
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
@ -2623,6 +2626,9 @@ Allocated (was zp[1]:33) zp[1]:12 [ plexSort::nxt_y#0 ]
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
// A simple usage of the flexible sprite multiplexer routine
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
@ -3641,6 +3647,9 @@ Score: 60648
// File Comments
// A simple usage of the flexible sprite multiplexer routine
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)

View File

@ -1,4 +1,7 @@
// A simple SID music player playing music in the main loop.
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"

View File

@ -287,6 +287,9 @@ INITIAL ASM
Target platform is c64basic / MOS6502X
// File Comments
// A simple SID music player playing music in the main loop.
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
@ -372,6 +375,9 @@ Uplifting [] best 4227 combination
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
// A simple SID music player playing music in the main loop.
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
@ -559,6 +565,9 @@ Score: 3882
// File Comments
// A simple SID music player playing music in the main loop.
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)

View File

@ -1,4 +1,7 @@
// A simple SID music player using RASTER IRQ
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"

View File

@ -316,6 +316,9 @@ INITIAL ASM
Target platform is c64basic / MOS6502X
// File Comments
// A simple SID music player using RASTER IRQ
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
@ -451,6 +454,9 @@ Uplifting [] best 2947 combination
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
// A simple SID music player using RASTER IRQ
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
@ -691,6 +697,9 @@ Score: 2899
// File Comments
// A simple SID music player using RASTER IRQ
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)

View File

@ -1,4 +1,13 @@
// A minimal NES demo
// Based on: https://github.com/gregkrsak/first_nes written by Greg M. Krsak, 2018.
// Nintendo Entertainment System (NES
// https://en.wikipedia.org/wiki/Nintendo_Entertainment_System_(Model_NES-101)
// https://github.com/gregkrsak/first_nes
// Ricoh 2C02 - NES Picture Processing Unit (PPU)
// Ricoh RP2C02 (NTSC version) / RP2C07 (PAL version),
// https://en.wikipedia.org/wiki/Picture_Processing_Unit
// https://wiki.nesdev.com/w/index.php/PPU_registers
// http://nesdev.com/2C02%20technical%20reference.TXT
// Based on: https://github.com/gregkrsak/first_nes written by Greg M. Krsak, 2018.
// Nintendo Entertainment System (NES) ROM
// https://sadistech.com/nesromtool/romdoc.html

View File

@ -2417,6 +2417,15 @@ INITIAL ASM
Target platform is nes / MOS6502
// File Comments
// A minimal NES demo
// Based on: https://github.com/gregkrsak/first_nes written by Greg M. Krsak, 2018.
// Nintendo Entertainment System (NES
// https://en.wikipedia.org/wiki/Nintendo_Entertainment_System_(Model_NES-101)
// https://github.com/gregkrsak/first_nes
// Ricoh 2C02 - NES Picture Processing Unit (PPU)
// Ricoh RP2C02 (NTSC version) / RP2C07 (PAL version),
// https://en.wikipedia.org/wiki/Picture_Processing_Unit
// https://wiki.nesdev.com/w/index.php/PPU_registers
// http://nesdev.com/2C02%20technical%20reference.TXT
// Based on: https://github.com/gregkrsak/first_nes written by Greg M. Krsak, 2018.
// Upstart
// Nintendo Entertainment System (NES) ROM
@ -3553,6 +3562,15 @@ Allocated (was zp[1]:48) zp[1]:8 [ readJoy1::$1 ]
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
// A minimal NES demo
// Based on: https://github.com/gregkrsak/first_nes written by Greg M. Krsak, 2018.
// Nintendo Entertainment System (NES
// https://en.wikipedia.org/wiki/Nintendo_Entertainment_System_(Model_NES-101)
// https://github.com/gregkrsak/first_nes
// Ricoh 2C02 - NES Picture Processing Unit (PPU)
// Ricoh RP2C02 (NTSC version) / RP2C07 (PAL version),
// https://en.wikipedia.org/wiki/Picture_Processing_Unit
// https://wiki.nesdev.com/w/index.php/PPU_registers
// http://nesdev.com/2C02%20technical%20reference.TXT
// Based on: https://github.com/gregkrsak/first_nes written by Greg M. Krsak, 2018.
// Upstart
// Nintendo Entertainment System (NES) ROM
@ -4818,6 +4836,15 @@ Score: 3905
// File Comments
// A minimal NES demo
// Based on: https://github.com/gregkrsak/first_nes written by Greg M. Krsak, 2018.
// Nintendo Entertainment System (NES
// https://en.wikipedia.org/wiki/Nintendo_Entertainment_System_(Model_NES-101)
// https://github.com/gregkrsak/first_nes
// Ricoh 2C02 - NES Picture Processing Unit (PPU)
// Ricoh RP2C02 (NTSC version) / RP2C07 (PAL version),
// https://en.wikipedia.org/wiki/Picture_Processing_Unit
// https://wiki.nesdev.com/w/index.php/PPU_registers
// http://nesdev.com/2C02%20technical%20reference.TXT
// Based on: https://github.com/gregkrsak/first_nes written by Greg M. Krsak, 2018.
// Upstart
// Nintendo Entertainment System (NES) ROM

View File

@ -1,3 +1,6 @@
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"

View File

@ -373,6 +373,9 @@ Allocated zp[1]:3 [ raster::i#2 raster::i#1 ]
INITIAL ASM
Target platform is c64basic / MOS6502X
// File Comments
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
@ -536,6 +539,9 @@ Uplifting [] best 9585 combination
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
@ -810,6 +816,9 @@ FINAL ASSEMBLER
Score: 8340
// File Comments
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)

View File

@ -1,3 +1,6 @@
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"

View File

@ -650,6 +650,9 @@ Allocated zp[2]:7 [ fillscreen::cursor#2 fillscreen::cursor#1 ]
INITIAL ASM
Target platform is c64basic / MOS6502X
// File Comments
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
@ -906,6 +909,9 @@ Allocated (was zp[2]:7) zp[2]:4 [ fillscreen::cursor#2 fillscreen::cursor#1 ]
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
@ -1301,6 +1307,9 @@ FINAL ASSEMBLER
Score: 6262
// File Comments
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)

View File

@ -1,4 +1,7 @@
// An 8x8 char letter scroller
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"

View File

@ -1509,6 +1509,9 @@ INITIAL ASM
Target platform is c64basic / MOS6502X
// File Comments
// An 8x8 char letter scroller
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
@ -2069,6 +2072,9 @@ Allocated (was zp[2]:14) zp[2]:7 [ fillscreen::cursor#2 fillscreen::cursor#1 scr
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
// An 8x8 char letter scroller
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
@ -2771,6 +2777,9 @@ Score: 20886
// File Comments
// An 8x8 char letter scroller
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)

View File

@ -1,3 +1,6 @@
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"

View File

@ -4194,6 +4194,9 @@ Allocated zp[2]:179 [ memset::end#0 ]
INITIAL ASM
Target platform is c64basic / MOS6502X
// File Comments
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
@ -6343,6 +6346,9 @@ Allocated (was zp[2]:179) zp[2]:41 [ memset::end#0 sin16s_gen2::$8 divr16u::divi
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
@ -8520,6 +8526,9 @@ FINAL ASSEMBLER
Score: 46731
// File Comments
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)

View File

@ -1,3 +1,6 @@
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"

View File

@ -717,6 +717,9 @@ Allocated zp[2]:8 [ memset::end#0 ]
INITIAL ASM
Target platform is c64basic / MOS6502X
// File Comments
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
@ -962,6 +965,9 @@ Allocated (was zp[2]:8) zp[2]:4 [ memset::end#0 ]
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
@ -1335,6 +1341,9 @@ FINAL ASSEMBLER
Score: 5884
// File Comments
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)

View File

@ -1,3 +1,6 @@
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"

View File

@ -3491,6 +3491,9 @@ Allocated zp[1]:78 [ place_sprites::j2#1 ]
INITIAL ASM
Target platform is c64basic / MOS6502X
// File Comments
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
@ -5376,6 +5379,9 @@ Allocated (was zp[2]:70) zp[2]:21 [ gen_chargen_sprite::$14 gen_chargen_sprite::
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
@ -7499,6 +7505,9 @@ FINAL ASSEMBLER
Score: 769690
// File Comments
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)

View File

@ -1,4 +1,7 @@
// Shows a font where each char contains the number of the char (00-ff)
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"

View File

@ -778,6 +778,9 @@ INITIAL ASM
Target platform is c64basic / MOS6502X
// File Comments
// Shows a font where each char contains the number of the char (00-ff)
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
@ -1097,6 +1100,9 @@ Allocated (was zp[1]:13) zp[1]:11 [ init_font_hex::$0 ]
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
// Shows a font where each char contains the number of the char (00-ff)
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
@ -1538,6 +1544,9 @@ Score: 72379
// File Comments
// Shows a font where each char contains the number of the char (00-ff)
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)

View File

@ -1,4 +1,3 @@
// Test including a files with a #define and using it
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"

View File

@ -79,7 +79,6 @@ Complete equivalence classes
INITIAL ASM
Target platform is c64basic / MOS6502X
// File Comments
// Test including a files with a #define and using it
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
@ -126,7 +125,6 @@ Uplifting [] best 27 combination
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
// Test including a files with a #define and using it
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
@ -192,7 +190,6 @@ FINAL ASSEMBLER
Score: 12
// File Comments
// Test including a files with a #define and using it
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)

View File

@ -1,3 +1,5 @@
// Print a number of zero-terminated strings, each followed by a newline.
// The sequence of lines is terminated by another zero.
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"

View File

@ -707,6 +707,8 @@ Allocated zp[1]:11 [ print_char::ch#0 ]
INITIAL ASM
Target platform is c64basic / MOS6502X
// File Comments
// Print a number of zero-terminated strings, each followed by a newline.
// The sequence of lines is terminated by another zero.
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
@ -1013,6 +1015,8 @@ Allocated (was zp[2]:9) zp[2]:6 [ memset::dst#2 memset::dst#1 print_str::str#2 p
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
// Print a number of zero-terminated strings, each followed by a newline.
// The sequence of lines is terminated by another zero.
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
@ -1387,6 +1391,8 @@ FINAL ASSEMBLER
Score: 9880
// File Comments
// Print a number of zero-terminated strings, each followed by a newline.
// The sequence of lines is terminated by another zero.
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)

View File

@ -1,4 +1,7 @@
// A minimal working raster hardware IRQ with clobber-based register savings
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"

View File

@ -359,6 +359,9 @@ INITIAL ASM
Target platform is c64basic / MOS6502X
// File Comments
// A minimal working raster hardware IRQ with clobber-based register savings
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
@ -529,6 +532,9 @@ Removing interrupt register storage ldy #00 in 25 [16] return - exit interrupt(
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
// A minimal working raster hardware IRQ with clobber-based register savings
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
@ -791,6 +797,9 @@ Score: 224
// File Comments
// A minimal working raster hardware IRQ with clobber-based register savings
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)

View File

@ -1,4 +1,7 @@
// Test interrupt routine using a variable between calls (irq_idx)
// Commodore 64 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
.pc = $80d "Program"

Some files were not shown because too many files have changed in this diff Show More