mirror of
https://github.com/irmen/prog8.git
synced 2025-01-11 13:29:45 +00:00
fix irq routine removal
This commit is contained in:
parent
1f89571aa5
commit
0c7f107d01
@ -104,7 +104,12 @@ class CallGraph(private val program: Program): IAstVisitor {
|
||||
}
|
||||
|
||||
override fun visit(subroutine: Subroutine) {
|
||||
if((subroutine.name=="start" && subroutine.definingScope().name=="main")
|
||||
val alwaysKeepSubroutines = setOf(
|
||||
Pair("main", "start"),
|
||||
Pair("irq", "irq")
|
||||
)
|
||||
|
||||
if(Pair(subroutine.definingScope().name, subroutine.name) in alwaysKeepSubroutines
|
||||
|| subroutine.name== initvarsSubName || subroutine.definingModule().isLibraryModule) {
|
||||
// make sure the entrypoint is mentioned in the used symbols
|
||||
addNodeAndParentScopes(subroutine)
|
||||
|
@ -5,10 +5,11 @@
|
||||
~ main {
|
||||
|
||||
sub start() {
|
||||
c64.SCROLY &= %11101111 ; blank the screen
|
||||
c64utils.set_rasterirq_excl(40)
|
||||
c64.SCROLY &= %11101111 ; blank the screen
|
||||
c64utils.set_rasterirq_excl(40) ; register exclusive raster irq handler
|
||||
|
||||
while(true) {
|
||||
; enjoy the moving bars :)
|
||||
}
|
||||
|
||||
}
|
||||
@ -20,22 +21,20 @@
|
||||
const ubyte barheight = 4
|
||||
ubyte[] colors = [6,2,4,5,15,7,1,13,3,12,8,11,9]
|
||||
ubyte color = 0
|
||||
ubyte ypos = 0
|
||||
ubyte yanim = 0
|
||||
|
||||
sub irq() {
|
||||
Y++ ; slight timing delay to avoid rasterline transition issues
|
||||
ubyte rasterpos = c64.RASTER
|
||||
|
||||
if color!=len(colors) {
|
||||
c64.EXTCOL = colors[color]
|
||||
c64.RASTER += barheight ; next raster Irq for next color
|
||||
color++
|
||||
c64.RASTER = rasterpos+barheight
|
||||
}
|
||||
else {
|
||||
ypos += 2
|
||||
c64.EXTCOL = 0
|
||||
color = 0
|
||||
c64.RASTER = sin8u(ypos)/2+40
|
||||
yanim += 2
|
||||
c64.RASTER = sin8u(yanim)/2+30 ; new start of raster Irq
|
||||
}
|
||||
c64.SCROLY &= $7f ; set high bit of the raster pos to zero
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user