Skip to content

Commit

Permalink
some loose ends
Browse files Browse the repository at this point in the history
  • Loading branch information
irmen committed Apr 6, 2023
1 parent c4f53fe commit 4a0f15e
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 15 deletions.
7 changes: 5 additions & 2 deletions compiler/res/prog8lib/cx16/syslib.p8
Original file line number Diff line number Diff line change
Expand Up @@ -399,8 +399,11 @@ romsub $ff56 = joystick_get(ubyte joynr @A) -> ubyte @A, ubyte @X, ubyte @Y
romsub $ff56 = joystick_get2(ubyte joynr @A) clobbers(Y) -> uword @AX ; alternative to above to not have the hassle to deal with multiple return values

; Audio (bank 10)
romsub $C09F = audio_init() -> ubyte @Pc ; (re)initialize PSG and YM audio chips
; TODO: add more of the audio routines here.
romsub $C04B = psg_init() clobbers(A,X,Y)
romsub $C063 = ym_init() clobbers(A,X,Y) -> ubyte @Pc ; (re)init YM chip
romsub $C066 = ym_loaddefpatches() clobbers(A,X,Y) -> ubyte @Pc ; load default YM patches
romsub $C09F = audio_init() clobbers(A,X,Y) -> ubyte @Pc ; (re)initialize PSG and YM audio chips
; TODO: add more of the audio routines?


asmsub kbdbuf_clear() {
Expand Down
2 changes: 1 addition & 1 deletion compiler/res/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8.11-dev
8.11
2 changes: 1 addition & 1 deletion compiler/src/prog8/compiler/Compiler.kt
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ private fun transformNewExpressions(program: PtProgram) {
var countByteVars = 0
var countWordVars = 0
var countFloatVars = 0
// TODO: find a reliable way to reuse the temp vars across expressions
// TODO: find a reliable way to reuse more temp vars across expressions

fun getExprVar(type: DataType, pos: Position, scope: PtSub): PtIdentifier {
val count = when(type) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ internal class AstOnetimeTransforms(private val program: Program, private val op
private fun replacePointerVarIndexWithMemreadOrMemwrite(arrayIndexedExpression: ArrayIndexedExpression, parent: Node): Iterable<IAstModification> {
// note: The CodeDesugarer already does something similar, but that is meant ONLY to take
// into account the case where the index value is a word type.
// The replacement here is to fix missing cases in the 6502 codegen.
// The replacement here is to fix missing cases in the 6502 codegen. (VM codegen doesn't use this workaround)
// TODO make the 6502 codegen better so this workaround can be removed
val arrayVar = arrayIndexedExpression.arrayvar.targetVarDecl(program)
if(arrayVar!=null && arrayVar.datatype == DataType.UWORD) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,7 @@ internal class NotExpressionAndIfComparisonExprChanger(val program: Program, val
if(binExpr==null || binExpr.operator !in ComparisonOperators)
return noModifications

return noModifications // TODO tijdelijk geen simplify

// Simplify the conditional expression, introduce simple assignments if required.
// This is REQUIRED for correct code generation on 6502 because evaluating certain expressions
// clobber the handful of temporary variables in the zeropage and leaving everything in one
// expression then results in invalid values being compared. VM Codegen doesn't suffer from this.
// NOTE: sometimes this increases code size because additional stores/loads are generated for the
// intermediate variables. We assume these are optimized away from the resulting assembly code later.
val simplify = simplifyConditionalExpression(binExpr)
Expand Down
2 changes: 1 addition & 1 deletion examples/cx16/pcmaudio/pcmplay2.asm
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ irq_handler:
lda VERA_ISR
and #%00001000 ; is aflow?
bne _aflow_irq
; TODO other irq
; handle other irq here
bra _exit_irq

_aflow_irq:
Expand Down
2 changes: 1 addition & 1 deletion examples/cx16/pcmaudio/play-adpcm.p8
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ main {
}

} else {
; TODO not AFLOW, handle other IRQ
; it's not AFLOW, handle other IRQ here.
}

;; cx16.vpoke(1,$fa0c, 0) ; back to other screen color
Expand Down
2 changes: 1 addition & 1 deletion examples/cx16/pcmaudio/stream-wav.p8
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ interrupt {
uncompressed_block_8()
} else if cx16.VERA_ISR & %00000001 {
cx16.VERA_ISR = %00000001
; TODO handle vsync irq
; handle vsync irq here
}

%asm {{
Expand Down
4 changes: 2 additions & 2 deletions examples/test.p8
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ main {
txt.nl()
txt.print_uw(wa[1])
txt.nl()
floats.print_f(fa[1]) ; TODO FIX FLOAT PRINT IN VM
floats.print_f(fa[1])
txt.nl()

ubyte index=1
Expand All @@ -25,7 +25,7 @@ main {
txt.nl()
txt.print_uw(wa[1])
txt.nl()
floats.print_f(fa[1]) ; TODO FIX FLOAT PRINT IN VM
floats.print_f(fa[1])
txt.nl()
}
}

0 comments on commit 4a0f15e

Please sign in to comment.