hello,
I have modified the irq-handler to do, according to me, the same that the SJWoolham's one does.
I must have done something wrong becuase I keep on having unstability in the two PMODEs boundary and
the upper screen flickers from time to time (getting the full screen the PMODE4, that should only be applied to the lower part)
@sorchard
Have you had the time to make any tests on the ideas Steve mentioned?
For if anyone is willing to help, I am attaching an VDK image with the source, binary and a Basic test program.
If anyone prefers just the plain txt source, I copy it herunder
Code: Select all
*
* PM34SW - test for two simultaneous graphic modes
*
ORG $4000
put $4000
*
ctrl equ $0114 * flag (1 byte) --- What is this for???
count equ $f8 * counter (2 bytes) to change PMODE
*
instal ORCC #$50 * Disable IRQ/FIRQ interrupts
LDX #ISR * get new IRQ-dispatch routine
CMPX $010D * is it already installed?
BEQ UNINST * uninstall it - disable control
*
ENABLE STA $FFC0 * clear SAM V0
STA $FFC3 * set SAM V1
STA $FFC5 * set SAM V2
STA $FFC6 * start of graph memory = $0C00
STA $FFC9 *
STA $FFCB *
STA $FFCC *
STA $FFCE *
STA $FFD0 *
STA $FFD2 *
LDA $FF03 * enable Frame Sync Interrupt
ORA #$03 * detect rising edge
STA $FF03 *
LDA $FF01 * Disable Horizontal Sync Interrupt
ANDA #$FE *
STA $FF01 *
BRA CHGVEC * change to the new IRQ-dispatcher into vector
*
UNINST LDX #$9d3d * get std default value
LDA $FF03 * enable Frame Sync Interrupt
ORA #$01 *
STA $FF03 *
*
CHGVEC STX $010D * set IRQ dispatch routine
ANDCC #$AF * enable IRQ/FIRQ interrupts
RTS * return to caller
*
isr lda >ctrl * internal counter (?)
beq vsync * if zero processs interrupt
jmp $9d3d * else go to std irq-handler
vsync lda #$e0 * set PIA1 = 1110 0--- (colorset 0)
sta $ff22 * set PMODE3
ldx >count * get wait counter
iloop leax -1,x * decrement
bne iloop * till zero
lda #$f8 * set PIA1 = 1111 1--- (colorset 1)
sta $ff22 * set PMODE4
lda $ff02 * clear VSYNC IRQ flag
ldd >$0112 * get timer value
addd #1 * increment it
std >$0112 * stores it back
lda <$e4 * play not yet ended?
lbne $afd9 * go to PLAY interrupt routine
lda <$8e * sound not yet ended?
lbne $8802 * go to SOUND interrupt routine
rti * return from interrupt
*