mirror of
https://github.com/irmen/prog8.git
synced 2024-12-26 14:29:35 +00:00
todo
This commit is contained in:
parent
1fe4439395
commit
fe2954ce08
@ -205,7 +205,7 @@ internal class AstChecker(private val program: Program,
|
|||||||
|
|
||||||
if(subroutine.inline) {
|
if(subroutine.inline) {
|
||||||
if (subroutine.containsDefinedVariables())
|
if (subroutine.containsDefinedVariables())
|
||||||
err("can't inline a subroutine that defines variables")
|
err("can't inline a subroutine that defines variables (might also be a generated intermediate variable for complex return expressions)")
|
||||||
if (!subroutine.isAsmSubroutine && subroutine.parameters.isNotEmpty())
|
if (!subroutine.isAsmSubroutine && subroutine.parameters.isNotEmpty())
|
||||||
err("can't inline a non-asm subroutine that has parameters")
|
err("can't inline a non-asm subroutine that has parameters")
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
TODO
|
TODO
|
||||||
====
|
====
|
||||||
|
|
||||||
|
- allow inlining of subroutines with vardecls
|
||||||
- optimize several inner loops in gfx2
|
- optimize several inner loops in gfx2
|
||||||
- hoist all variable declarations up to the subroutine scope *before* even the constant folding takes place (to avoid undefined symbol errors when referring to a variable from another nested scope in the subroutine)
|
- hoist all variable declarations up to the subroutine scope *before* even the constant folding takes place (to avoid undefined symbol errors when referring to a variable from another nested scope in the subroutine)
|
||||||
- optimize swap of two memread values with index, using the same pointer expression/variable, like swap(@(ptr+1), @(ptr+2))
|
- optimize swap of two memread values with index, using the same pointer expression/variable, like swap(@(ptr+1), @(ptr+2))
|
||||||
|
@ -1,27 +1,11 @@
|
|||||||
%import textio
|
%import textio
|
||||||
%zeropage basicsafe
|
%zeropage basicsafe
|
||||||
%option no_sysinit
|
|
||||||
|
|
||||||
main {
|
main {
|
||||||
|
|
||||||
sub start() {
|
sub start() {
|
||||||
|
ubyte thing = otherblock.othersub()
|
||||||
ubyte color=0
|
txt.print_ub(thing) ; should print 99!
|
||||||
ubyte xx
|
|
||||||
uword ptr = $0400
|
|
||||||
|
|
||||||
@($02) = 0
|
|
||||||
|
|
||||||
repeat {
|
|
||||||
sys.waitvsync()
|
|
||||||
%asm {{
|
|
||||||
ldy $02
|
|
||||||
lda #'*'
|
|
||||||
sta $0400,y
|
|
||||||
inc $02
|
|
||||||
}}
|
|
||||||
}
|
|
||||||
txt.print("hello")
|
|
||||||
|
|
||||||
; str filename = "titlescreen.bin"
|
; str filename = "titlescreen.bin"
|
||||||
; ubyte success = cx16.vload(filename, 8, 0, $0000)
|
; ubyte success = cx16.vload(filename, 8, 0, $0000)
|
||||||
@ -38,3 +22,16 @@ main {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
otherblock {
|
||||||
|
|
||||||
|
ubyte othervar=20
|
||||||
|
ubyte calcparam=10
|
||||||
|
|
||||||
|
sub calc(ubyte zz) -> ubyte {
|
||||||
|
return zz+1
|
||||||
|
}
|
||||||
|
|
||||||
|
inline sub othersub() -> ubyte {
|
||||||
|
return calc(calcparam)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user