mirror of
https://github.com/irmen/prog8.git
synced 2024-12-25 23:29:55 +00:00
cleanups
This commit is contained in:
parent
f5ba072294
commit
cd2c4e13da
@ -1645,7 +1645,7 @@ class Subroutine(override val name: String,
|
|||||||
.map { (it as InlineAssembly).assembly }
|
.map { (it as InlineAssembly).assembly }
|
||||||
.count { " rti" in it || "\trti" in it || " rts" in it || "\trts" in it || " jmp" in it || "\tjmp" in it }
|
.count { " rti" in it || "\trti" in it || " rts" in it || "\trts" in it || " jmp" in it || "\tjmp" in it }
|
||||||
|
|
||||||
val canBeAsmSubroutine =false // TODO see below
|
val canBeAsmSubroutine =false // TODO disabled for now, see below about problem with converting to asm subroutine
|
||||||
// !isAsmSubroutine
|
// !isAsmSubroutine
|
||||||
// && ((parameters.size == 1 && parameters[0].type in setOf(DataType.BYTE, DataType.UBYTE, DataType.WORD, DataType.UWORD))
|
// && ((parameters.size == 1 && parameters[0].type in setOf(DataType.BYTE, DataType.UBYTE, DataType.WORD, DataType.UWORD))
|
||||||
// || (parameters.size == 2 && parameters.map { it.type }.all { it == DataType.BYTE || it == DataType.UBYTE }))
|
// || (parameters.size == 2 && parameters.map { it.type }.all { it == DataType.BYTE || it == DataType.UBYTE }))
|
||||||
|
@ -357,14 +357,14 @@ class AsmGen(val options: CompilationOptions, val program: IntermediateProgram,
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun encodeStr(str: String, dt: DataType): List<Short> {
|
private fun encodeStr(str: String, dt: DataType): List<Short> {
|
||||||
when(dt) {
|
return when(dt) {
|
||||||
DataType.STR -> {
|
DataType.STR -> {
|
||||||
val bytes = Petscii.encodePetscii(str, true)
|
val bytes = Petscii.encodePetscii(str, true)
|
||||||
return bytes.plus(0)
|
bytes.plus(0)
|
||||||
}
|
}
|
||||||
DataType.STR_S -> {
|
DataType.STR_S -> {
|
||||||
val bytes = Petscii.encodeScreencode(str, true)
|
val bytes = Petscii.encodeScreencode(str, true)
|
||||||
return bytes.plus(0)
|
bytes.plus(0)
|
||||||
}
|
}
|
||||||
else -> throw AssemblyError("invalid str type")
|
else -> throw AssemblyError("invalid str type")
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,6 @@ import prog8.ast.*
|
|||||||
import prog8.compiler.LauncherType
|
import prog8.compiler.LauncherType
|
||||||
import prog8.compiler.OutputType
|
import prog8.compiler.OutputType
|
||||||
import prog8.determineCompilationOptions
|
import prog8.determineCompilationOptions
|
||||||
import java.io.File
|
|
||||||
import java.io.InputStream
|
import java.io.InputStream
|
||||||
import java.nio.file.Files
|
import java.nio.file.Files
|
||||||
import java.nio.file.Path
|
import java.nio.file.Path
|
||||||
|
@ -4,7 +4,9 @@
|
|||||||
|
|
||||||
; @todo: holding a block
|
; @todo: holding a block
|
||||||
; @todo: joystick control
|
; @todo: joystick control
|
||||||
; @todo: sometimes the game gets confused about what the current tetromino is and will draw the wrong one. Maybe occurs when rotating directly after dropping the previous?
|
; @todo: large explosion with ding when clearing 4 lines
|
||||||
|
; @todo: click sound (same as rotate) when block lands in place (without dropping it)
|
||||||
|
; @todo: sometimes the game gets confused about what the current tetromino is and will draw the wrong one. When rotating a square it turns into the previous piece!
|
||||||
|
|
||||||
~ main {
|
~ main {
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Generated from /home/irmen/Projects/prog8/parser/antlr/prog8.g4 by ANTLR 4.7.2
|
// Generated from ./parser/antlr/prog8.g4 by ANTLR 4.7.2
|
||||||
|
|
||||||
package prog8.parser;
|
package prog8.parser;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Generated from /home/irmen/Projects/prog8/parser/antlr/prog8.g4 by ANTLR 4.7.2
|
// Generated from ./parser/antlr/prog8.g4 by ANTLR 4.7.2
|
||||||
|
|
||||||
package prog8.parser;
|
package prog8.parser;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user