This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
oric:software:orics_compatibility [2016/09/26 11:24] jede |
oric:software:orics_compatibility [2016/09/26 17:31] (current) jede |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== To have a code working on the 3 machines : Generic rules ====== | ||
+ | |||
+ | - Don't call any ROM routines or see bellow | ||
+ | |||
+ | - Don't call sedoric routines | ||
+ | |||
+ | - Don't call Microdisc eprom : you don't have eprom on telestrat, telestrat boot on the floppy from a cardridge. It means that the cardridge (mainly stratoric or stratsed) reads boot sector. On the atmos/ | ||
+ | |||
+ | - If you use overlay RAM, you have to detect if you are on an oric -1/atmos or telestrat. To switch to ram overlay on the telestrat, you have to set bit 0, bit 1, bit 2 to 0 on the port A of the second via ($320) on the telestrat (Don't forget to SEI and set IRQ vectors). | ||
+ | |||
+ | - For Telestrat : if you have to manage IRQ (CPU receives an IRQ in the code), you should stop IRQ from VIA2. It can generate IRQ from VIA2 timers (or others stuff). If you don't inhibits this second via, you could received some IRQ from this via which could crash your code. Telemon (telestrat) does not have the same IRQ vectors than atmos, please load irq vector with CPU irq vector ! | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ====== How can i do a code which works on telemon and atmos ====== | ||
+ | |||
+ | You have to do 2 versions, but you can have one source code (you can detect telestrat, to have one object). You could do one version, but it means that any routine have to be in RAM | ||
+ | |||
+ | You have to know that | ||
+ | |||
+ | * Telemon has a **different IRQ vectors** than atmos (atmos : $244/ | ||
+ | * **hires routines** does not have the same calls (telemon : brk $1a/Atmos : jsr $ec33) | ||
+ | * if you redirect **irq vectors** for telemon all brk calls won't work. you have to restore irq vectors each time you need to call roms on telemon | ||
+ | * **Zero page** : if you want to restore telemon after your program, you should use "# | ||
+ | * **via6522** : Telemon initialize VIA1 differently than atmos rom. For example, T2 timer is enabled. If you have in your code : **"lda VIA_T1CL" | ||
+ | | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ===== Tutorial ===== | ||
+ | |||
+ | * Download here https:// | ||
+ | * create in your project a " | ||
+ | |||
+ | |||
+ | Sample to have different version of rom (telemon/ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | #ifdef TARGET_TELEMON | ||
+ | #include " | ||
+ | #else | ||
+ | #include " | ||
+ | #endif | ||
+ | | ||
+ | CALL_TEXT ; Macro it's in macro_telemon_compat.h and macro_basic1_1_compat.h | ||
+ | | ||
+ | ; setup IRQ | ||
+ | #define source $d0 | ||
+ | | ||
+ | ; **************** setup IRQ and keep old IRQ for telemon vectors ! | ||
+ | sei | ||
+ | lda $FFFE | ||
+ | sta source | ||
+ | lda $FFFF | ||
+ | sta source+1 | ||
+ | ldy #00 | ||
+ | | ||
+ | lda #$4C | ||
+ | sta (source),y | ||
+ | iny | ||
+ | lda (source),y ; save old vector | ||
+ | sta keep_telemon_vectors_IRQ_BRK+1 | ||
+ | lda #< | ||
+ | sta (source),y | ||
+ | iny | ||
+ | lda (source),y ; save old vector high | ||
+ | sta keep_telemon_vectors_IRQ_BRK+2 | ||
+ | lda #> | ||
+ | sta (source),y | ||
+ | cli | ||
+ | |||
+ | ; **************** Read keyboard from telemon vectors ! | ||
+ | ; I want to read keyboard | ||
+ | #ifdef TARGET_TELEMON | ||
+ | wait_key | ||
+ | CALL_READKEYBOARD ; macro from compat header | ||
+ | cmp #" " | ||
+ | bne wait_key | ||
+ | # | ||
+ | rts | ||
+ | IRQDriver | ||
+ | keep_telemon_vectors_IRQ_BRK ; in this case all BRK calls for telemon works | ||
+ | jmp $0000 | ||
+ | rti | ||
+ | end_of_code | ||
+ | #ifdef TARGET_TELEMON | ||
+ | routine_compat_telemon.s | ||
+ | #endif | ||
+ | ---- | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ====== Detect the machine ====== | ||
+ | |||
+ | It's a bit hard to detect if you are on a telestrat, here are some tips | ||
+ | |||
+ | - The telestrat has a second via. You can detect if you have a second via (You can test timers or any others things), it's not the best way to detect a telestrat | ||