1; #LAYOUT# STD * #TAKE 2; #LAYOUT# * KERNAL_0 #TAKE 3; #LAYOUT# * * #IGNORE 4 5 6vector_real: 7 8 ; Use MEMUSS as temporary storage location - checked on real C64 that this is the 9 ; address originally used; after calling VECTOR and checking zero page 10 ; area afterwards, the address could be found there 11 12 ; According to 'Computes Mapping the Commodore 64' page 237, 13 ; the CBM implementation does not disable IRQs - yet, the 14 ; 'C64 Programmers Reference Guide' does not contain such 15 ; warning and does not mention any preparations needed. 16 17 ; Initial idea was to do php, cli, ..., plp to make the routine safer, 18 ; but it seems it might cause problem with initialization on XEMU emulator 19 ; XXX find out, why 20 21 ; Prepare the user data pointer - strange order to reduce risk 22 ; of potential similarity to the original routine 23 sty MEMUSS + 1 24 stx MEMUSS + 0 25 26 ; Select routine variant - store or restore vectors 27 ldy #$1F 28 bcc vector_restore 29 30 lda CINV, y 31 sta (MEMUSS), y 32 33 bcs vector_end_loop ; branch always 34 35vector_restore: 36 lda (MEMUSS), y 37 sta CINV, y 38 39 ; FALLTROUGH 40 41vector_end_loop: 42 dey 43 bpl vector_restore 44 45 rts 46