mirror of
https://gitlab.com/camelot/kickc.git
synced 2025-02-06 13:31:05 +00:00
Fixed a few errors introduced by condition simplification rewrite. Added a fragment.
This commit is contained in:
parent
5fd74a8d39
commit
e9eeafd170
4
src/main/fragment/mos6502-common/pdum1=vwuc1.asm
Normal file
4
src/main/fragment/mos6502-common/pdum1=vwuc1.asm
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
lda #<{c1}
|
||||||
|
sta {m1}
|
||||||
|
lda #>{c1}
|
||||||
|
sta {m1}+1
|
@ -6,6 +6,7 @@ import dk.camelot64.kickc.model.statements.StatementPhiBlock;
|
|||||||
import dk.camelot64.kickc.model.symbols.Label;
|
import dk.camelot64.kickc.model.symbols.Label;
|
||||||
import dk.camelot64.kickc.model.symbols.Procedure;
|
import dk.camelot64.kickc.model.symbols.Procedure;
|
||||||
import dk.camelot64.kickc.model.values.LabelRef;
|
import dk.camelot64.kickc.model.values.LabelRef;
|
||||||
|
import dk.camelot64.kickc.model.values.ProcedureRef;
|
||||||
import dk.camelot64.kickc.model.values.ScopeRef;
|
import dk.camelot64.kickc.model.values.ScopeRef;
|
||||||
import dk.camelot64.kickc.model.values.SymbolRef;
|
import dk.camelot64.kickc.model.values.SymbolRef;
|
||||||
import dk.camelot64.kickc.passes.Pass2ConstantIdentification;
|
import dk.camelot64.kickc.passes.Pass2ConstantIdentification;
|
||||||
@ -279,6 +280,8 @@ public class ControlFlowGraph implements Serializable {
|
|||||||
// Recurse to successor blocks
|
// Recurse to successor blocks
|
||||||
final Collection<LabelRef> successors = block.getSuccessors();
|
final Collection<LabelRef> successors = block.getSuccessors();
|
||||||
for(LabelRef successor : successors) {
|
for(LabelRef successor : successors) {
|
||||||
|
if(successor.getFullName().equals(ProcedureRef.PROCEXIT_BLOCK_NAME))
|
||||||
|
continue;
|
||||||
final ControlFlowBlock successorBlock = getBlock(successor);
|
final ControlFlowBlock successorBlock = getBlock(successor);
|
||||||
populateStatementsBetween(from, to, true, between, successorBlock);
|
populateStatementsBetween(from, to, true, between, successorBlock);
|
||||||
}
|
}
|
||||||
|
@ -212,6 +212,9 @@ public class VariableReferenceInfos {
|
|||||||
*/
|
*/
|
||||||
public Collection<VariableRef> getDefinedVars(Statement stmt) {
|
public Collection<VariableRef> getDefinedVars(Statement stmt) {
|
||||||
Collection<ReferenceToSymbolVar> referenceToSymbolVars = statementVarReferences.get(stmt.getIndex());
|
Collection<ReferenceToSymbolVar> referenceToSymbolVars = statementVarReferences.get(stmt.getIndex());
|
||||||
|
// TODO: This may cause problems since it is a sign that the maps are out of date!
|
||||||
|
if(referenceToSymbolVars==null)
|
||||||
|
return new ArrayList<>();
|
||||||
return referenceToSymbolVars
|
return referenceToSymbolVars
|
||||||
.stream()
|
.stream()
|
||||||
.filter(referenceToSymbolVar -> referenceToSymbolVar.getReferenced() instanceof VariableRef)
|
.filter(referenceToSymbolVar -> referenceToSymbolVar.getReferenced() instanceof VariableRef)
|
||||||
|
@ -10,7 +10,7 @@ const char* PLAYFIELD_SPRITE_PTRS_1 = (PLAYFIELD_SCREEN_1+SPRITE_PTRS);
|
|||||||
// Screen Sprite pointers on screen 2
|
// Screen Sprite pointers on screen 2
|
||||||
const char* PLAYFIELD_SPRITE_PTRS_2 = (PLAYFIELD_SCREEN_2+SPRITE_PTRS);
|
const char* PLAYFIELD_SPRITE_PTRS_2 = (PLAYFIELD_SCREEN_2+SPRITE_PTRS);
|
||||||
// Address of the sprites covering the playfield
|
// Address of the sprites covering the playfield
|
||||||
const char* PLAYFIELD_SPRITES = 0x2000;
|
const char* PLAYFIELD_SPRITES = 0x3000;
|
||||||
// Address of the charset
|
// Address of the charset
|
||||||
const char* PLAYFIELD_CHARSET = 0x2800;
|
const char* PLAYFIELD_CHARSET = 0x2800;
|
||||||
|
|
||||||
|
@ -91,7 +91,7 @@
|
|||||||
// Screen Sprite pointers on screen 2
|
// Screen Sprite pointers on screen 2
|
||||||
.label PLAYFIELD_SPRITE_PTRS_2 = PLAYFIELD_SCREEN_2+SPRITE_PTRS
|
.label PLAYFIELD_SPRITE_PTRS_2 = PLAYFIELD_SCREEN_2+SPRITE_PTRS
|
||||||
// Address of the sprites covering the playfield
|
// Address of the sprites covering the playfield
|
||||||
.label PLAYFIELD_SPRITES = $2000
|
.label PLAYFIELD_SPRITES = $3000
|
||||||
// Address of the charset
|
// Address of the charset
|
||||||
.label PLAYFIELD_CHARSET = $2800
|
.label PLAYFIELD_CHARSET = $2800
|
||||||
// The size of the playfield
|
// The size of the playfield
|
||||||
|
@ -3458,7 +3458,7 @@ SYMBOL TABLE SSA
|
|||||||
// <<6 to move extended colors to the upper 2 bits
|
// <<6 to move extended colors to the upper 2 bits
|
||||||
.fill screen.getSize(), ( (screen.get(i)+1) | (extended.get(i)-1)<<6 )
|
.fill screen.getSize(), ( (screen.get(i)+1) | (extended.get(i)-1)<<6 )
|
||||||
}}
|
}}
|
||||||
(const byte*) PLAYFIELD_SPRITES = (byte*)(number) $2000
|
(const byte*) PLAYFIELD_SPRITES = (byte*)(number) $3000
|
||||||
(const byte*) PLAYFIELD_SPRITE_PTRS_1 = (const byte*) PLAYFIELD_SCREEN_1+(const word) SPRITE_PTRS
|
(const byte*) PLAYFIELD_SPRITE_PTRS_1 = (const byte*) PLAYFIELD_SCREEN_1+(const word) SPRITE_PTRS
|
||||||
(const byte*) PLAYFIELD_SPRITE_PTRS_2 = (const byte*) PLAYFIELD_SCREEN_2+(const word) SPRITE_PTRS
|
(const byte*) PLAYFIELD_SPRITE_PTRS_2 = (const byte*) PLAYFIELD_SCREEN_2+(const word) SPRITE_PTRS
|
||||||
(const byte*) PROCPORT = (byte*)(number) 1
|
(const byte*) PROCPORT = (byte*)(number) 1
|
||||||
@ -6512,7 +6512,7 @@ Simplifying constant pointer cast (byte*) 54290
|
|||||||
Simplifying constant pointer cast (byte*) 54299
|
Simplifying constant pointer cast (byte*) 54299
|
||||||
Simplifying constant pointer cast (byte*) 1024
|
Simplifying constant pointer cast (byte*) 1024
|
||||||
Simplifying constant pointer cast (byte*) 11264
|
Simplifying constant pointer cast (byte*) 11264
|
||||||
Simplifying constant pointer cast (byte*) 8192
|
Simplifying constant pointer cast (byte*) 12288
|
||||||
Simplifying constant pointer cast (byte*) 10240
|
Simplifying constant pointer cast (byte*) 10240
|
||||||
Simplifying constant integer cast $13
|
Simplifying constant integer cast $13
|
||||||
Simplifying constant integer cast 1
|
Simplifying constant integer cast 1
|
||||||
@ -11710,7 +11710,7 @@ Target platform is c64basic / MOS6502X
|
|||||||
// Screen Sprite pointers on screen 2
|
// Screen Sprite pointers on screen 2
|
||||||
.label PLAYFIELD_SPRITE_PTRS_2 = PLAYFIELD_SCREEN_2+SPRITE_PTRS
|
.label PLAYFIELD_SPRITE_PTRS_2 = PLAYFIELD_SCREEN_2+SPRITE_PTRS
|
||||||
// Address of the sprites covering the playfield
|
// Address of the sprites covering the playfield
|
||||||
.label PLAYFIELD_SPRITES = $2000
|
.label PLAYFIELD_SPRITES = $3000
|
||||||
// Address of the charset
|
// Address of the charset
|
||||||
.label PLAYFIELD_CHARSET = $2800
|
.label PLAYFIELD_CHARSET = $2800
|
||||||
// The size of the playfield
|
// The size of the playfield
|
||||||
@ -16861,7 +16861,7 @@ ASSEMBLER BEFORE OPTIMIZATION
|
|||||||
// Screen Sprite pointers on screen 2
|
// Screen Sprite pointers on screen 2
|
||||||
.label PLAYFIELD_SPRITE_PTRS_2 = PLAYFIELD_SCREEN_2+SPRITE_PTRS
|
.label PLAYFIELD_SPRITE_PTRS_2 = PLAYFIELD_SCREEN_2+SPRITE_PTRS
|
||||||
// Address of the sprites covering the playfield
|
// Address of the sprites covering the playfield
|
||||||
.label PLAYFIELD_SPRITES = $2000
|
.label PLAYFIELD_SPRITES = $3000
|
||||||
// Address of the charset
|
// Address of the charset
|
||||||
.label PLAYFIELD_CHARSET = $2800
|
.label PLAYFIELD_CHARSET = $2800
|
||||||
// The size of the playfield
|
// The size of the playfield
|
||||||
@ -21039,7 +21039,7 @@ FINAL SYMBOL TABLE
|
|||||||
// <<6 to move extended colors to the upper 2 bits
|
// <<6 to move extended colors to the upper 2 bits
|
||||||
.fill screen.getSize(), ( (screen.get(i)+1) | (extended.get(i)-1)<<6 )
|
.fill screen.getSize(), ( (screen.get(i)+1) | (extended.get(i)-1)<<6 )
|
||||||
}}
|
}}
|
||||||
(const byte*) PLAYFIELD_SPRITES = (byte*) 8192
|
(const byte*) PLAYFIELD_SPRITES = (byte*) 12288
|
||||||
(const byte*) PLAYFIELD_SPRITE_PTRS_1 = (const byte*) PLAYFIELD_SCREEN_1+(const word) SPRITE_PTRS
|
(const byte*) PLAYFIELD_SPRITE_PTRS_1 = (const byte*) PLAYFIELD_SCREEN_1+(const word) SPRITE_PTRS
|
||||||
(const byte*) PLAYFIELD_SPRITE_PTRS_2 = (const byte*) PLAYFIELD_SCREEN_2+(const word) SPRITE_PTRS
|
(const byte*) PLAYFIELD_SPRITE_PTRS_2 = (const byte*) PLAYFIELD_SCREEN_2+(const word) SPRITE_PTRS
|
||||||
(const byte*) PROCPORT = (byte*) 1
|
(const byte*) PROCPORT = (byte*) 1
|
||||||
@ -22117,7 +22117,7 @@ Score: 3348735
|
|||||||
// Screen Sprite pointers on screen 2
|
// Screen Sprite pointers on screen 2
|
||||||
.label PLAYFIELD_SPRITE_PTRS_2 = PLAYFIELD_SCREEN_2+SPRITE_PTRS
|
.label PLAYFIELD_SPRITE_PTRS_2 = PLAYFIELD_SCREEN_2+SPRITE_PTRS
|
||||||
// Address of the sprites covering the playfield
|
// Address of the sprites covering the playfield
|
||||||
.label PLAYFIELD_SPRITES = $2000
|
.label PLAYFIELD_SPRITES = $3000
|
||||||
// Address of the charset
|
// Address of the charset
|
||||||
.label PLAYFIELD_CHARSET = $2800
|
.label PLAYFIELD_CHARSET = $2800
|
||||||
// The size of the playfield
|
// The size of the playfield
|
||||||
|
@ -79,7 +79,7 @@
|
|||||||
// <<6 to move extended colors to the upper 2 bits
|
// <<6 to move extended colors to the upper 2 bits
|
||||||
.fill screen.getSize(), ( (screen.get(i)+1) | (extended.get(i)-1)<<6 )
|
.fill screen.getSize(), ( (screen.get(i)+1) | (extended.get(i)-1)<<6 )
|
||||||
}}
|
}}
|
||||||
(const byte*) PLAYFIELD_SPRITES = (byte*) 8192
|
(const byte*) PLAYFIELD_SPRITES = (byte*) 12288
|
||||||
(const byte*) PLAYFIELD_SPRITE_PTRS_1 = (const byte*) PLAYFIELD_SCREEN_1+(const word) SPRITE_PTRS
|
(const byte*) PLAYFIELD_SPRITE_PTRS_1 = (const byte*) PLAYFIELD_SCREEN_1+(const word) SPRITE_PTRS
|
||||||
(const byte*) PLAYFIELD_SPRITE_PTRS_2 = (const byte*) PLAYFIELD_SCREEN_2+(const word) SPRITE_PTRS
|
(const byte*) PLAYFIELD_SPRITE_PTRS_2 = (const byte*) PLAYFIELD_SCREEN_2+(const word) SPRITE_PTRS
|
||||||
(const byte*) PROCPORT = (byte*) 1
|
(const byte*) PROCPORT = (byte*) 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user