Hi,
Putting all together I learned so far it seems that this all-in-one approach (no init code and no exit code) is preferable as it is least intrusive:
* It sets the CPU IRQ mask only during the actual wait.
* It restores the VBL interrupt mask to the previous state.
RDVBLBAR := $C019 ; >127 if not vertical blanking
RDVBLMSK := $C041 ; >127 if VBL interrupts enabled
DISVBL := $C05A ; Disable VBL interrupts
ENVBL := $C05B ; Enable VBL interrupts
IOUDISON := $C07E ; Disable IOU
IOUDISOFF := $C07F ; Enable IOU
sei
sta IOUDISOFF
lda RDVBLMSK
bit ENVBL
bit PTRIG ; Reset VBL interrupt flag
1: bit RDVBLBAR
bpl 1
asl
bcs 2 ; VBL interrupts were already enabled
bit DISVBL
2: sta IOUDISON ; IIc Tech Ref Man: The firmware normally leaves IOUDIS on. cli
rts
Regards,
Oliver
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 546 |
Nodes: | 16 (0 / 16) |
Uptime: | 161:59:35 |
Calls: | 10,385 |
Calls today: | 2 |
Files: | 14,057 |
Messages: | 6,416,500 |